PageSourceSearch

https://www.chloe.com/on/demandware.static/Sites-ChloeUS-Site/-/en_US/v1790860951381/js/productQuickView.js

js chloe.com collected 2026-10-02 03:01:02 UTC 934,100 bytes, 74 lines download raw bytes

vendor: 9,174 bytes, line 1
1(()=>{var e={2167:function(e,t){"use strict";function i(e,t){return void 0===t&&(t=Object),t&&"function"==typeof t.getOwnPropertyDescriptors&&(e=t.create(null,t.getOwnPropertyDescriptors(e))),t&&"function"==typeof t.freeze?t.freeze(e):e}function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var n=i({allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0}),s=i({area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),a=i({script:!1,style:!1,textarea:!0,title:!0});function o(e){return e===l.HTML}var l=i({HTML:"text/html",XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),u=Object.keys(l).map(function(e){return l[e]}),d=i({HTML:"http://www.w3.org/1999/xhtml",SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});t.assign=function(e,t){if(null===e||"object"!=typeof e)throw TypeError("target is not an object");for(var i in t)r(t,i)&&(e[i]=t[i]);return e},t.find=function(e,t,i){if(void 0===i&&(i=Array.prototype),e&&"function"==typeof i.find)return i.find.call(e,t);for(var n=0;n<e.length;n++)if(r(e,n)){var s=e[n];if(t.call(void 0,s,n,e))return s}},t.freeze=i,t.HTML_BOOLEAN_ATTRIBUTES=n,t.HTML_RAW_TEXT_ELEMENTS=a,t.HTML_VOID_ELEMENTS=s,t.hasDefaultHTMLNamespace=function(e){return o(e)||e===l.XML_XHTML_APPLICATION},t.hasOwn=r,t.isHTMLBooleanAttribute=function(e){return r(n,e.toLowerCase())},t.isHTMLRawTextElement=function(e){var t=e.toLowerCase();return r(a,t)&&!a[t]},t.isHTMLEscapableRawTextElement=function(e){var t=e.toLowerCase();return r(a,t)&&a[t]},t.isHTMLMimeType=o,t.isHTMLVoidElement=function(e){return r(s,e.toLowerCase())},t.isValidMimeType=function(e){return u.indexOf(e)>-1},t.MIME_TYPE=l,t.NAMESPACE=d},6129:function(e,t,i){"use strict";var r=i(2167),n=i(1146),s=i(2337),a=i(1045),o=i(6925),l=n.DOMImplementation,u=r.hasDefaultHTMLNamespace,d=r.isHTMLMimeType,c=r.isValidMimeType,h=r.MIME_TYPE,p=r.NAMESPACE,f=s.ParseError,m=o.XMLReader;function g(e){return e.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028\u2029]/g,"\n")}function y(e){if(void 0===(e=e||{}).locator&&(e.locator=!0),this.assign=e.assign||r.assign,this.domHandler=e.domHandler||v,this.onError=e.onError||e.errorHandler,e.errorHandler&&"function"!=typeof e.errorHandler)throw TypeError("errorHandler object is no longer supported, switch to onError!");e.errorHandler&&e.errorHandler("warning","The `errorHandler` option has been deprecated, use `onError` instead!",this),this.normalizeLineEndings=e.normalizeLineEndings||g,this.locator=!!e.locator,this.xmlns=this.assign(Object.create(null),e.xmlns)}function v(e){var t=e||{};this.mimeType=t.mimeType||h.XML_APPLICATION,this.defaultNamespace=t.defaultNamespace||null,this.cdata=!1,this.currentElement=void 0,this.doc=void 0,this.locator=void 0,this.onError=t.onError}function _(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function b(e,t,i){return"string"==typeof e?e.substr(t,i):e.length>=t+i||t?new java.lang.String(e,t,i)+"":e}function T(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}y.prototype.parseFromString=function(e,t){if(!c(t))throw TypeError('DOMParser.parseFromString: the provided mimeType "'+t+'" is not valid.');var i=this.assign(Object.create(null),this.xmlns),n=a.XML_ENTITIES,s=i[""]||null;u(t)?(n=a.HTML_ENTITIES,s=p.HTML):t===h.XML_SVG_IMAGE&&(s=p.SVG),i[""]=s,i.xml=i.xml||p.XML;var o=new this.domHandler({mimeType:t,defaultNamespace:s,onError:this.onError}),l=this.locator?{}:void 0;this.locator&&o.setDocumentLocator(l);var d=new m;return d.errorHandler=o,d.domBuilder=o,r.isHTMLMimeType(t)||"string"==typeof e||d.errorHandler.fatalError("source is not a string"),d.parse(this.normalizeLineEndings(String(e)),i,n),o.doc.documentElement||d.errorHandler.fatalError("missing root element"),o.doc},v.prototype={startDocument:function(){var e=new l;this.doc=d(this.mimeType)?e.createHTMLDocument(!1):e.createDocument(this.defaultNamespace,"")},startElement:function(e,t,i,r){var n=this.doc,s=n.createElementNS(e,i||t),a=r.length;T(this,s),this.currentElement=s,this.locator&&_(this.locator,s);for(var o=0;o<a;o++){var e=r.getURI(o),l=r.getValue(o),i=r.getQName(o),u=n.createAttributeNS(e,i);this.locator&&_(r.getLocator(o),u),u.value=u.nodeValue=l,s.setAttributeNode(u)}},endElement:function(e,t,i){this.currentElement=this.currentElement.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var i=this.doc.createProcessingInstruction(e,t);this.locator&&_(this.locator,i),T(this,i)},ignorableWhitespace:function(e,t,i){},characters:function(e,t,i){if(e=b.apply(this,arguments)){if(this.cdata)var r=this.doc.createCDATASection(e);else var r=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(r):/^\s*$/.test(e)&&this.doc.appendChild(r),this.locator&&_(this.locator,r)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){e&&(e.lineNumber=0),this.locator=e},comment:function(e,t,i){e=b.apply(this,arguments);var r=this.doc.createComment(e);this.locator&&_(this.locator,r),T(this,r)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,i,r){var n=this.doc.implementation;if(n&&n.createDocumentType){var s=n.createDocumentType(e,t,i,r);this.locator&&_(this.locator,s),T(this,s),this.doc.doctype=s}},reportError:function(e,t){if("function"==typeof this.onError)try{this.onError(e,t,this)}catch(i){throw new f("Reporting "+e+' "'+t+'" caused '+i,this.locator)}else console.error("[xmldom "+e+"]	"+t,function(e){if(e)return"\n@#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}(this.locator))},warning:function(e){this.reportError("warning",e)},error:function(e){this.reportError("error",e)},fatalError:function(e){throw this.reportError("fatalError",e),new f(e,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(e){v.prototype[e]=function(){return null}}),t.__DOMHandler=v,t.DOMParser=y,t.normalizeLineEndings=g,t.onErrorStopParsing=function(e){if("error"===e)throw"onErrorStopParsing"},t.onWarningStopParsing=function(){throw"onWarningStopParsing"}},1146:function(e,t,i){"use strict";var r=i(2167),n=r.find,s=r.hasDefaultHTMLNamespace,a=r.hasOwn,o=r.isHTMLMimeType,l=r.isHTMLRawTextElement,u=r.isHTMLVoidElement,d=r.MIME_TYPE,c=r.NAMESPACE,h=Symbol(),p=i(2337),f=p.DOMException,m=p.DOMExceptionName,g=i(26);function y(e){if(e!==h)throw TypeError("Illegal constructor")}function v(e){return""!==e}function _(e,t){return a(e,t)||(e[t]=!0),e}function b(e){return e?Object.keys((e?e.split(/[\t\n\f\r ]+/).filter(v):[]).reduce(_,{})):[]}function T(e){if(!g.QName_exact.test(e))throw new f(f.INVALID_CHARACTER_ERR,'invalid character in qualified name "'+e+'"')}function w(e,t){T(t),e=e||null;var i=null,n=t;if(t.indexOf(":")>=0){var s=t.split(":");i=s[0],n=s[1]}if(null!==i&&null===e)throw new f(f.NAMESPACE_ERR,"prefix is non-null and namespace is null");if("xml"===i&&e!==r.NAMESPACE.XML)throw new f(f.NAMESPACE_ERR,'prefix is "xml" and namespace is not the XML namespace');if(("xmlns"===i||"xmlns"===t)&&e!==r.NAMESPACE.XMLNS)throw new f(f.NAMESPACE_ERR,'either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace');if(e===r.NAMESPACE.XMLNS&&"xmlns"!==i&&"xmlns"!==t)throw new f(f.NAMESPACE_ERR,'namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns"');return[e,i,n]}function S(e,t){for(var i in e)a(e,i)&&(t[i]=e[i])}function E(e,t){var i=e.prototype;if(!(i instanceof t)){function r(){}r.prototype=t.prototype,S(i,r=new r),e.prototype=i=r}i.constructor!=e&&("function"!=typeof e&&console.error("unknown Class:"+e),i.constructor=e)}var C={},k=C.ELEMENT_NODE=1,x=C.ATTRIBUTE_NODE=2,D=C.TEXT_NODE=3,I=C.CDATA_SECTION_NODE=4,A=C.ENTITY_REFERENCE_NODE=5,O=C.ENTITY_NODE=6,L=C.PROCESSING_INSTRUCTION_NODE=7,P=C.COMMENT_NODE=8,N=C.DOCUMENT_NODE=9,M=C.DOCUMENT_TYPE_NODE=10,R=C.DOCUMENT_FRAGMENT_NODE=11,U=C.NOTATION_NODE=12,B=r.freeze({DOCUMENT_POSITION_DISCONNECTED:1,DOCUMENT_POSITION_PRECEDING:2,DOCUMENT_POSITION_FOLLOWING:4,DOCUMENT_POSITION_CONTAINS:8,DOCUMENT_POSITION_CONTAINED_BY:16,DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32});function j(e){return e.guid||(e.guid=Math.random()),e.guid}function q(){}function F(e,t){this._node=e,this._refresh=t,H(this)}function H(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var i=e._refresh(e._node);if(eC(e,"length",i.length),!e.$$length||i.length<e.$$length)for(var r=i.length;r in e;r++)a(e,r)&&delete e[r];S(i,e),e._inc=t}}function z(){}function V(e,t){for(var i=0;i<e.length;){if(e[i]===t)return i;i++}}function W(e,t,i){var r=V(t,i);if(r>=0){for(var n=t.length-1;r<=n;)t[r]=t[++r];
1if(t.length=n,e){var s=e.ownerDocument;s&&J(s,e,i),i.ownerElement=null}}}function G(){}function X(e){y(e)}function Y(e){return"<"==e&&"&lt;"||">"==e&&"&gt;"||"&"==e&&"&amp;"||'"'==e&&"&quot;"||"&#"+e.charCodeAt()+";"}function K(e,t){if(t(e))return!0;if(e=e.firstChild)do if(K(e,t))return!0;while(e=e.nextSibling)}function Q(e,t){y(e),this.ownerDocument=this,this.contentType=(t||{}).contentType||d.XML_APPLICATION,this.type=o(this.contentType)?"html":"xml"}function J(e,t,i,r){e&&e._inc++,i.namespaceURI===c.XMLNS&&delete t._nsMap[i.prefix?i.localName:""]}function Z(e,t,i){if(e&&e._inc){e._inc++;var r=t.childNodes;if(i&&!i.nextSibling)r[r.length++]=i;else{for(var n=t.firstChild,s=0;n;)r[s++]=n,n=n.nextSibling;r.length=s,delete r[r.length]}}}function ee(e,t){if(e!==t.parentNode)throw new f(f.NOT_FOUND_ERR,"child's parent is not parent");var i=t.previousSibling,r=t.nextSibling;return i?i.nextSibling=r:e.firstChild=r,r?r.previousSibling=i:e.lastChild=i,Z(e.ownerDocument,e),t.parentNode=null,t.previousSibling=null,t.nextSibling=null,t}function et(e){return e&&e.nodeType===X.DOCUMENT_TYPE_NODE}function ei(e){return e&&e.nodeType===X.ELEMENT_NODE}function er(e){return e&&e.nodeType===X.TEXT_NODE}function en(e,t){var i=e.childNodes||[];if(n(i,ei)||et(t))return!1;var r=n(i,et);return!(t&&r&&i.indexOf(r)>i.indexOf(t))}function es(e,t){var i=e.childNodes||[];if(n(i,function(e){return ei(e)&&e!==t}))return!1;var r=n(i,et);return!(t&&r&&i.indexOf(r)>i.indexOf(t))}function ea(e,t,i){var r=e.childNodes||[],s=t.childNodes||[];
1if(t.nodeType===X.DOCUMENT_FRAGMENT_NODE){var a=s.filter(ei);if(a.length>1||n(s,er))throw new f(f.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(1===a.length&&!es(e,i))throw new f(f.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(ei(t)&&!es(e,i))throw new f(f.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(et(t)){if(n(r,function(e){return et(e)&&e!==i}))throw new f(f.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var o=n(r,ei);if(i&&r.indexOf(o)<r.indexOf(i))throw new f(f.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element")}}function eo(e,t,i,r){if(!(e&&(e.nodeType===X.DOCUMENT_NODE||e.nodeType===X.DOCUMENT_FRAGMENT_NODE||e.nodeType===X.ELEMENT_NODE)))throw new f(f.HIERARCHY_REQUEST_ERR,"Unexpected parent node type "+e.nodeType);if(i&&i.parentNode!==e)throw new f(f.NOT_FOUND_ERR,"child not in parent");if(!(t&&(t.nodeType===X.CDATA_SECTION_NODE||t.nodeType===X.COMMENT_NODE||t.nodeType===X.DOCUMENT_FRAGMENT_NODE||t.nodeType===X.DOCUMENT_TYPE_NODE||t.nodeType===X.ELEMENT_NODE||t.nodeType===X.PROCESSING_INSTRUCTION_NODE||t.nodeType===X.TEXT_NODE))||et(t)&&e.nodeType!==X.DOCUMENT_NODE)throw new f(f.HIERARCHY_REQUEST_ERR,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType);e.nodeType===X.DOCUMENT_NODE&&(r||function(e,t,i){var r=e.childNodes||[],s=t.childNodes||[];
1if(t.nodeType===X.DOCUMENT_FRAGMENT_NODE){var a=s.filter(ei);if(a.length>1||n(s,er))throw new f(f.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(1===a.length&&!en(e,i))throw new f(f.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(ei(t)&&!en(e,i))throw new f(f.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(et(t)){if(n(r,et))throw new f(f.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var o=n(r,ei);if(i&&r.indexOf(o)<r.indexOf(i))throw new f(f.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element");if(!i&&o)throw new f(f.HIERARCHY_REQUEST_ERR,"Doctype can not be appended since element is present")}})(e,t,i);var s=t.parentNode;if(s&&s.removeChild(t),t.nodeType===R){var a=t.firstChild;if(null==a)return t;var o=t.lastChild}else a=o=t;var l=i?i.previousSibling:e.lastChild;a.previousSibling=l,o.nextSibling=i,l?l.nextSibling=a:e.firstChild=a,null==i?e.lastChild=o:i.previousSibling=o;do a.parentNode=e;while(a!==o&&(a=a.nextSibling));return Z(e.ownerDocument||e,e,t),t.nodeType==R&&(t.firstChild=t.lastChild=null),t}function el(e){y(e),this._nsMap=Object.create(null)}function eu(e){y(e),this.namespaceURI=null,this.prefix=null,this.ownerElement=null}function ed(e){y(e)}function ec(e){y(e)}function eh(e){y(e)}function ep(e){y(e)}function ef(e){y(e)}function em(e){y(e)}function eg(e){y(e)}function ey(e){y(e)}function ev(e){y(e)}function e_(e){y(e)}function eb(){}function eT(e){var t=[],i=this.nodeType===N&&this.documentElement||this,r=i.prefix,n=i.namespaceURI;if(n&&null==r){var r=i.lookupPrefix(n);if(null==r)var s=[{namespace:n,prefix:null}]}return eE(this,t,e,s),t.join("")}function ew(e,t,i){var r=e.prefix||"",n=e.namespaceURI;if(!n||"xml"===r&&n===c.XML||n===c.XMLNS)return!1;for(var s=i.length;s--;){var a=i[s];if(a.prefix===r)return a.namespace!==n}return!0}function eS(e,t,i){e.push(" ",t,'="',i.replace(/[<>&"\t\n\r]/g,Y),'"')}function eE(e,t,i,r){r||(r=[]);var n="html"===(e.nodeType===N?e:e.ownerDocument).type;if(i){if(!(e=i(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case k:var s,a=e.attributes,o=a.length,d=e.firstChild,h=e.tagName,p=h;if(!n&&!e.prefix&&e.namespaceURI){for(var f=0;f<a.length;f++)if("xmlns"===a.item(f).name){s=a.item(f).value;break}if(!s)for(var m=r.length-1;m>=0;m--){var y=r[m];if(""===y.prefix&&y.namespace===e.namespaceURI){s=y.namespace;break}}if(s!==e.namespaceURI)for(var m=r.length-1;m>=0;m--){var y=r[m];if(y.namespace===e.namespaceURI){y.prefix&&(p=y.prefix+":"+h);break}}}t.push("<",p);for(var v=0;v<o;v++){var _=a.item(v);"xmlns"==_.prefix?r.push({prefix:_.localName,namespace:_.value}):"xmlns"==_.nodeName&&r.push({prefix:"",namespace:_.value})}for(var v=0;v<o;v++){var _=a.item(v);if(ew(_,n,r)){var b=_.prefix||"",T=_.namespaceURI;eS(t,b?"xmlns:"+b:"xmlns",T),r.push({prefix:b,namespace:T})}eE(_,t,i,r)}if(h===p&&ew(e,n,r)){var b=e.prefix||"",T=e.namespaceURI;eS(t,b?"xmlns:"+b:"xmlns",T),r.push({prefix:b,namespace:T})}var w=!d;if(w&&(n||e.namespaceURI===c.HTML)&&(w=u(h)),w)t.push("/>");else{if(t.push(">"),n&&l(h))for(;d;)d.data?t.push(d.data):eE(d,t,i,r.slice()),d=d.nextSibling;else for(;d;)eE(d,t,i,r.slice()),d=d.nextSibling;t.push("</",p,">")}return;case N:case R:for(var d=e.firstChild;d;)eE(d,t,i,r.slice()),d=d.nextSibling;return;case x:return eS(t,e.name,e.value);case D:return t.push(e.data.replace(/[<&>]/g,Y));case I:return t.push(g.CDATA_START,e.data,g.CDATA_END);case P:return t.push(g.COMMENT_START,e.data,g.COMMENT_END);case M:var S=e.publicId,E=e.systemId;t.push(g.DOCTYPE_DECL_START," ",e.name),S?(t.push(" ",g.PUBLIC," ",S),E&&"."!==E&&t.push(" ",E)):E&&"."!==E&&t.push(" ",g.SYSTEM," ",E),e.internalSubset&&t.push(" [",e.internalSubset,"]"),t.push(">");return;case L:return t.push("<?",e.target," ",e.data,"?>");case A:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function eC(e,t,i){e[t]=i}q.prototype={length:0,item:function(e){return e>=0&&e<this.length?this[e]:null},toString:function(e){for(var t=[],i=0;i<this.length;i++)eE(this[i],t,e);return t.join("")},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}},q.prototype[Symbol.iterator]=function(){var e=this,t=0;return{next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0}},return:function(){return{done:!0}}}},F.prototype.item=function(e){return H(this),this[e]||null},E(F,q),z.prototype={length:0,item:q.prototype.item,getNamedItem:function(e){this._ownerElement&&this._ownerElement._isInHTMLDocumentAndNamespace()&&(e=e.toLowerCase());for(var t=0;t<this.length;){var i=this[t];if(i.nodeName===e)return i;t++}return null},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!==this._ownerElement)throw new f(f.INUSE_ATTRIBUTE_ERR);var i=this.getNamedItemNS(e.namespaceURI,e.localName);return i===e?e:(!function(e,t,i,r){if(r?t[V(t,r)]=i:(t[t.length]=i,t.length++),e){i.ownerElement=e;var n,s,a,o=e.ownerDocument;o&&(r&&J(o,e,r),n=o,s=e,a=i,n&&n._inc++,a.namespaceURI===c.XMLNS&&(s._nsMap[a.prefix?a.localName:""]=a.value))}}(this._ownerElement,this,e,i),i)},setNamedItemNS:function(e){return this.setNamedItem(e)},removeNamedItem:function(e){var t=this.getNamedItem(e);if(!t)throw new f(f.NOT_FOUND_ERR,e);return W(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var i=this.getNamedItemNS(e,t);if(!i)throw new f(f.NOT_FOUND_ERR,e?e+" : "+t:t);return W(this._ownerElement,this,i),i},getNamedItemNS:function(e,t){e||(e=null);for(var i=0;i<this.length;){var r=this[i];if(r.localName===t&&r.namespaceURI===e)return r;i++}return null}},z.prototype[Symbol.iterator]=function(){var e=this,t=0;return{next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0}},return:function(){return{done:!0}}}},G.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,i){var r=d.XML_APPLICATION;e===c.HTML?r=d.XML_XHTML_APPLICATION:e===c.SVG&&(r=d.XML_SVG_IMAGE);var n=new Q(h,{contentType:r});if(n.implementation=this,n.childNodes=new q,n.doctype=i||null,i&&n.appendChild(i),t){var s=n.createElementNS(e,t);n.appendChild(s)}return n},createDocumentType:function(e,t,i,r){T(e);var n=new ef(h);return n.name=e,n.nodeName=e,n.publicId=t||"",n.systemId=i||"",n.internalSubset=r||"",n.childNodes=new q,n},createHTMLDocument:function(e){var t=new Q(h,{contentType:d.HTML});if(t.implementation=this,t.childNodes=new q,!1!==e){t.doctype=this.createDocumentType("html"),t.doctype.ownerDocument=t,t.appendChild(t.doctype);var i=t.createElement("html");t.appendChild(i);var r=t.createElement("head");if(i.appendChild(r),"string"==typeof e){var n=t.createElement("title");n.appendChild(t.createTextNode(e)),r.appendChild(n)}i.appendChild(t.createElement("body"))}return t}},X.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,parentNode:null,get parentElement(){return this.parentNode&&this.parentNode.nodeType===this.ELEMENT_NODE?this.parentNode:null},childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,baseURI:"about:blank",get isConnected(){var ek=this.getRootNode();return ek&&ek.nodeType===ek.DOCUMENT_NODE}
vendor: 11,893 bytes, line 1
1,contains:function(e){if(!e)return!1;var t=e;do{if(this===t)return!0;t=e.parentNode}while(t);return!1},getRootNode:function(e){var t=this;do{if(!t.parentNode)return t;t=t.parentNode}while(t)},isEqualNode:function(e){if(!e||this.nodeType!==e.nodeType)return!1;switch(this.nodeType){case this.DOCUMENT_TYPE_NODE:if(this.name!==e.name||this.publicId!==e.publicId||this.systemId!==e.systemId)return!1;break;case this.ELEMENT_NODE:if(this.namespaceURI!==e.namespaceURI||this.prefix!==e.prefix||this.localName!==e.localName||this.attributes.length!==e.attributes.length)return!1;for(var t=0;t<this.attributes.length;t++){var i=this.attributes.item(t);if(!i.isEqualNode(e.getAttributeNodeNS(i.namespaceURI,i.localName)))return!1}break;case this.ATTRIBUTE_NODE:if(this.namespaceURI!==e.namespaceURI||this.localName!==e.localName||this.value!==e.value)return!1;break;case this.PROCESSING_INSTRUCTION_NODE:if(this.target!==e.target||this.data!==e.data)return!1;break;case this.TEXT_NODE:case this.COMMENT_NODE:if(this.data!==e.data)return!1}if(this.childNodes.length!==e.childNodes.length)return!1;for(var t=0;t<this.childNodes.length;t++)if(!this.childNodes[t].isEqualNode(e.childNodes[t]))return!1;return!0},isSameNode:function(e){return this===e},insertBefore:function(e,t){return eo(this,e,t)},replaceChild:function(e,t){eo(this,e,t,ea),t&&this.removeChild(t)},removeChild:function(e){return ee(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return function e(t,i,r){var n=new i.constructor(h);for(var s in i)if(a(i,s)){var o=i[s];"object"!=typeof o&&o!=n[s]&&(n[s]=o)}switch(i.childNodes&&(n.childNodes=new q),n.ownerDocument=t,n.nodeType){case k:var l=i.attributes,u=n.attributes=new z,d=l.length;u._ownerElement=n;for(var c=0;c<d;c++)n.setAttributeNode(e(t,l.item(c),!0));break;case x:r=!0}if(r)for(var p=i.firstChild;p;)n.appendChild(e(t,p,r)),p=p.nextSibling;return n}(this.ownerDocument||this,this,e)},normalize:function(){for(var e=this.firstChild;e;){var t=e.nextSibling;t&&t.nodeType==D&&e.nodeType==D?(this.removeChild(t),e.appendData(t.data)):(e.normalize(),e=t)}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},lookupPrefix:function(e){for(var t=this;t;){var i=t._nsMap;if(i){for(var r in i)if(a(i,r)&&i[r]===e)return r}t=t.nodeType==x?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var i=t._nsMap;if(i&&a(i,e))return i[e];t=t.nodeType==x?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)},compareDocumentPosition:function(e){if(this===e)return 0;var t=e,i=this,r=null,n=null;if(t instanceof eu&&(t=(r=t).ownerElement),i instanceof eu&&(i=(n=i).ownerElement,r&&t&&i===t))for(var s,a=0;s=i.attributes[a];a++){if(s===r)return B.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+B.DOCUMENT_POSITION_PRECEDING;if(s===n)return B.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+B.DOCUMENT_POSITION_FOLLOWING}if(!t||!i||i.ownerDocument!==t.ownerDocument)return B.DOCUMENT_POSITION_DISCONNECTED+B.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+(j(i.ownerDocument)>j(t.ownerDocument)?B.DOCUMENT_POSITION_FOLLOWING:B.DOCUMENT_POSITION_PRECEDING);if(n&&t===i)return B.DOCUMENT_POSITION_CONTAINS+B.DOCUMENT_POSITION_PRECEDING;if(r&&t===i)return B.DOCUMENT_POSITION_CONTAINED_BY+B.DOCUMENT_POSITION_FOLLOWING;for(var o=[],l=t.parentNode;l;){if(!n&&l===i)return B.DOCUMENT_POSITION_CONTAINED_BY+B.DOCUMENT_POSITION_FOLLOWING;o.push(l),l=l.parentNode}o.reverse();for(var u=[],d=i.parentNode;d;){if(!r&&d===t)return B.DOCUMENT_POSITION_CONTAINS+B.DOCUMENT_POSITION_PRECEDING;u.push(d),d=d.parentNode}u.reverse();var c=function e(t,i){if(i.length<t.length)return e(i,t);var r=null;for(var n in t){if(t[n]!==i[n])break;r=t[n]}return r}(o,u);for(var h in c.childNodes){var p=c.childNodes[h];if(p===i)return B.DOCUMENT_POSITION_FOLLOWING;if(p===t)return B.DOCUMENT_POSITION_PRECEDING;if(u.indexOf(p)>=0)return B.DOCUMENT_POSITION_FOLLOWING;if(o.indexOf(p)>=0)return B.DOCUMENT_POSITION_PRECEDING}return 0}},S(C,X),S(C,X.prototype),S(B,X),S(B,X.prototype),Q.prototype={implementation:null,nodeName:"#document",nodeType:N,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType===R){for(var i=e.firstChild;i;){var r=i.nextSibling;this.insertBefore(i,t),i=r}return e}return eo(this,e,t),e.ownerDocument=this,null===this.documentElement&&e.nodeType===k&&(this.documentElement=e),e},removeChild:function(e){var t=ee(this,e);return t===this.documentElement&&(this.documentElement=null),t},replaceChild:function(e,t){eo(this,e,t,ea),e.ownerDocument=this,t&&this.removeChild(t),ei(e)&&(this.documentElement=e)},importNode:function(e,t){return function e(t,i,r){var n;switch(i.nodeType){case k:(n=i.cloneNode(!1)).ownerDocument=t;case R:break;case x:r=!0}if(n||(n=i.cloneNode(!1)),n.ownerDocument=t,n.parentNode=null,r)for(var s=i.firstChild;s;)n.appendChild(e(t,s,r)),s=s.nextSibling;return n}(this,e,t)},getElementById:function(e){var t=null;return K(this.documentElement,function(i){if(i.nodeType==k&&i.getAttribute("id")==e)return t=i,!0}),t},createElement:function(e){var t=new el(h);return t.ownerDocument=this,"html"===this.type&&(e=e.toLowerCase()),s(this.contentType)&&(t.namespaceURI=c.HTML),t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new q,(t.attributes=new z)._ownerElement=t,t},createDocumentFragment:function(){var e=new ev(h);return e.ownerDocument=this,e.childNodes=new q,e},createTextNode:function(e){var t=new ec(h);return t.ownerDocument=this,t.childNodes=new q,t.appendData(e),t},createComment:function(e){var t=new eh(h);return t.ownerDocument=this,t.childNodes=new q,t.appendData(e),t},createCDATASection:function(e){var t=new ep(h);return t.ownerDocument=this,t.childNodes=new q,t.appendData(e),t},createProcessingInstruction:function(e,t){var i=new e_(h);return i.ownerDocument=this,i.childNodes=new q,i.nodeName=i.target=e,i.nodeValue=i.data=t,i},createAttribute:function(e){if(!g.QName_exact.test(e))throw new f(f.INVALID_CHARACTER_ERR,'invalid character in name "'+e+'"');return"html"===this.type&&(e=e.toLowerCase()),this._createAttribute(e)},_createAttribute:function(e){var t=new eu(h);return t.ownerDocument=this,t.childNodes=new q,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){if(!g.Name.test(e))throw new f(f.INVALID_CHARACTER_ERR,'not a valid xml name "'+e+'"');if("html"===this.type)throw new f("document is an html document",m.NotSupportedError);var t=new ey(h);return t.ownerDocument=this,t.childNodes=new q,t.nodeName=e,t},createElementNS:function(e,t){var i=w(e,t),r=new el(h),n=r.attributes=new z;return r.childNodes=new q,r.ownerDocument=this,r.nodeName=t,r.tagName=t,r.namespaceURI=i[0],r.prefix=i[1],r.localName=i[2],n._ownerElement=r,r},createAttributeNS:function(e,t){var i=w(e,t),r=new eu(h);return r.ownerDocument=this,r.childNodes=new q,r.nodeName=t,r.name=t,r.specified=!0,r.namespaceURI=i[0],r.prefix=i[1],r.localName=i[2],r}},E(Q,X),el.prototype={nodeType:k,attributes:null,getQualifiedName:function(){return this.prefix?this.prefix+":"+this.localName:this.localName},_isInHTMLDocumentAndNamespace:function(){return"html"===this.ownerDocument.type&&this.namespaceURI===c.HTML},hasAttributes:function(){return!!(this.attributes&&this.attributes.length)},hasAttribute:function(e){return!!this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t?t.value:null},getAttributeNode:function(e){return this._isInHTMLDocumentAndNamespace()&&(e=e.toLowerCase()),this.attributes.getNamedItem(e)},setAttribute:function(e,t){this._isInHTMLDocumentAndNamespace()&&(e=e.toLowerCase());var i=this.getAttributeNode(e);i?i.value=i.nodeValue=""+t:((i=this.ownerDocument._createAttribute(e)).value=i.nodeValue=""+t,this.setAttributeNode(i))},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);i&&this.removeAttributeNode(i)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);return i?i.value:null},setAttributeNS:function(e,t,i){var r=w(e,t)[2],n=this.getAttributeNodeNS(e,r);n?n.value=n.nodeValue=""+i:((n=this.ownerDocument.createAttributeNS(e,t)).value=n.nodeValue=""+i,this.setAttributeNode(n))},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByClassName:function(e){var t=b(e);return new F(this,function(i){var r=[];return t.length>0&&K(i,function(n){if(n!==i&&n.nodeType===k){var s=n.getAttribute("class");if(s){var a=e===s;if(!a){var o=b(s);a=t.every(function(e){return o&&-1!==o.indexOf(e)})}a&&r.push(n)}}}),r})},getElementsByTagName:function(e){var t="html"===(this.nodeType===N?this:this.ownerDocument).type,i=e.toLowerCase();return new F(this,function(r){var n=[];return K(r,function(s){s!==r&&s.nodeType===k&&("*"===e?n.push(s):s.getQualifiedName()===(t&&s.namespaceURI===c.HTML?i:e)&&n.push(s))}),n})},getElementsByTagNameNS:function(e,t){return new F(this,function(i){var r=[];return K(i,function(n){n!==i&&n.nodeType===k&&("*"===e||n.namespaceURI===e)&&("*"===t||n.localName==t)&&r.push(n)}),r})}},Q.prototype.getElementsByClassName=el.prototype.getElementsByClassName,Q.prototype.getElementsByTagName=el.prototype.getElementsByTagName,Q.prototype.getElementsByTagNameNS=el.prototype.getElementsByTagNameNS,E(el,X),eu.prototype.nodeType=x,E(eu,X),ed.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,i){i=this.data.substring(0,e)+i+this.data.substring(e+t),this.nodeValue=this.data=i,this.length=i.length}},E(ed,X),ec.prototype={nodeName:"#text",nodeType:D,splitText:function(e){var t=this.data,i=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var r=this.ownerDocument.createTextNode(i);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}},E(ec,ed),eh.prototype={nodeName:"#comment",nodeType:P},E(eh,ed),ep.prototype={nodeName:"#cdata-section",nodeType:I},E(ep,ec),ef.prototype.nodeType=M,E(ef,X),em.prototype.nodeType=U,E(em,X),eg.prototype.nodeType=O,E(eg,X),ey.prototype.nodeType=A,E(ey,X),ev.prototype.nodeName="#document-fragment",ev.prototype.nodeType=R,E(ev,X),e_.prototype.nodeType=L,E(e_,ed),eb.prototype.serializeToString=function(e,t){return eT.call(e,t)},X.prototype.toString=eT;try{Object.defineProperty&&(Object.defineProperty(F.prototype,"length",{get:function(){return H(this),this.$$length}}),Object.defineProperty(X.prototype,"textContent",{get:function(){return function e(t){switch(t.nodeType){case k:case R:var i=[];for(t=t.firstChild;t;)7!==t.nodeType&&8!==t.nodeType&&i.push(e(t)),t=t.nextSibling;return i.join("");default:return t.nodeValue}}(this)},set:function(e){switch(this.nodeType){case k:case R:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),eC=function(e,t,i){e["$$"+t]=i})}catch(e){}t._updateLiveList=H,t.Attr=eu,t.CDATASection=ep,t.CharacterData=ed,t.Comment=eh,t.Document=Q,t.DocumentFragment=ev,t.DocumentType=ef,t.DOMImplementation=G,t.Element=el,t.Entity=eg,t.EntityReference=ey,t.LiveNodeList=F,t.NamedNodeMap=z,t.Node=X,t.NodeList=q,t.Notation=em,t.Text=ec,t.ProcessingInstruction=e_,t.XMLSerializer
1=eb},1045:function(e,t,i){"use strict";var r=i(2167).freeze;t.XML_ENTITIES=r({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),t.HTML_ENTITIES=r({Aacute:"\xc1",aacute:"\xe1",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"\xc2",acirc:"\xe2",acute:"\xb4",Acy:"А",acy:"а",AElig:"\xc6",aelig:"\xe6",af:"⁡",Afr:"\uD835\uDD04",afr:"\uD835\uDD1E",Agrave:"\xc0",agrave:"\xe0",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"\xc5",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"\uD835\uDD38",aopf:"\uD835\uDD52",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"\xc5",aring:"\xe5",Ascr:"\uD835\uDC9C",ascr:"\uD835\uDCB6",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"\xc3",atilde:"\xe3",Auml:"\xc4",auml:"\xe4",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"\uD835\uDD05",bfr:"\uD835\uDD1F",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"\uD835\uDD39",bopf:"\uD835\uDD53",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"\xa6",Bscr:"ℬ",bscr:"\uD835\uDCB7",bsemi:"⁏",bsim:"∽",b
1sime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"\xc7",ccedil:"\xe7",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"\xb8",Cedilla:"\xb8",cemptyv:"⦲",cent:"\xa2",CenterDot:"\xb7",centerdot:"\xb7",Cfr:"ℭ",cfr:"\uD835\uDD20",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"\xae",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"\uD835\uDD54",coprod:"∐",Coproduct:"∐",COPY:"\xa9",copy:"\xa9",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"\uD835\uDC9E",cscr:"\uD835\uDCB8",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"\xa4",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"\xb0",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"\uD835\uDD07",dfr:"\uD835\uDD21",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"\xb4",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"\xa8",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"\xf7",divide:"\xf7",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"\uD835\uDD3B",dopf:"\uD835\uDD55",Dot:"\xa8",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"\xa8",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"\uD835\uDC9F",dscr:"\uD835\uDCB9",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"\xc9",eacute:"\xe9",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"\xca",ecirc:"\xea",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"\uD835\uDD08",efr:"\uD835\uDD22",eg:"⪚",Egrave:"\xc8",egrave:"\xe8",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"\uD835\uDD3C",eopf:"\uD835\uDD56",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"\xd0",eth:"\xf0",Euml:"\xcb",euml:"\xeb",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"\uD835\uDD09",ffr:"\uD835\uDD23",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"\uD835\uDD3D",fopf:"\uD835\uDD57",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"\xbd",frac13:"⅓",frac14:"\xbc",frac15:"⅕",frac16:"⅙",frac18
1:"⅛",frac23:"⅔",frac25:"⅖",frac34:"\xbe",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"\uD835\uDCBB",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ä¢",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ä ",gdot:"Ä¡",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"\uD835\uDD0A",gfr:"\uD835\uDD24",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"\uD835\uDD3E",gopf:"\uD835\uDD58",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"\uD835\uDCA2",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"\xbd",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"Ä¥",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"\uD835\uDD25",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"\uD835\uDD59",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"\uD835\uDCBD",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"\xcd",iacute:"\xed",ic:"⁣",Icirc:"\xce",icirc:"\xee",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"\xa1",iff:"⇔",Ifr:"ℑ",ifr:"\uD835\uDD26",Igrave:"\xcc",igrave:"\xec",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"Ä«",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Ä®",iogon:"į",Iopf:"\uD835\uDD40",iopf:"\uD835\uDD5A",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"\xbf",Iscr:"ℐ",iscr:"\uD835\uDCBE",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"Ä©",Iukcy:"І",iukcy:"і",Iuml:"\xcf",iuml:"\xef",Jcirc:"Ä´",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"\uD835\uDD0D",jfr:"\uD835\uDD27",jmath:"È·",Jopf:"\uD835\uDD41",jopf:"\uD835\uDD5B",Jscr:"\uD835\uDCA5",jscr:"\uD835\uDCBF",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"Ä·",Kcy:"К",kcy:"к",Kfr:"\uD835\uDD0E",kfr:"\uD835\uDD28",kgreen:"ĸ",KHcy:"Ð¥",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"\uD835\uDD42",kopf:"\uD835\uDD5C",Kscr:"\uD835\uDCA6",kscr:"\uD835\uDCC0",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"\xab",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ä»",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"â©¿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"â
1‹–",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"\uD835\uDD0F",lfr:"\uD835\uDD29",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ä¿",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"\uD835\uDD43",lopf:"\uD835\uDD5D",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"â§«",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"\uD835\uDCC1",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"â©»",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"\xaf",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"\uD835\uDD10",mfr:"\uD835\uDD2A",mho:"℧",micro:"\xb5",mid:"∣",midast:"*",midcir:"â«°",middot:"\xb7",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"\uD835\uDD44",mopf:"\uD835\uDD5E",mp:"∓",Mscr:"ℳ",mscr:"\uD835\uDCC2",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:"\xa0",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"\uD835\uDD11",nfr:"\uD835\uDD2B",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:"\xa0",Nopf:"ℕ",nopf:"\uD835\uDD5F",Not:"⫬",not:"\xac",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"â
1‹ ",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"\uD835\uDCA9",nscr:"\uD835\uDCC3",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"\xd1",ntilde:"\xf1",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"\xd3",oacute:"\xf3",oast:"⊛",ocir:"⊚",Ocirc:"\xd4",ocirc:"\xf4",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"\uD835\uDD12",ofr:"\uD835\uDD2C",ogon:"˛",Ograve:"\xd2",ograve:"\xf2",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"\uD835\uDD46",oopf:"\uD835\uDD60",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"\xaa",ordm:"\xba",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"\uD835\uDCAA",oscr:"ℴ",Oslash:"\xd8",oslash:"\xf8",osol:"⊘",Otilde:"\xd5",otilde:"\xf5",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"\xd6",ouml:"\xf6",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"\xb6",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"\uD835\uDD13",pfr:"\uD835\uDD2D",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"\xb1",plusmn:"\xb1",plussim:"⨦",plustwo:"⨧",pm:"\xb1",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"\uD835\uDD61",pound:"\xa3",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"\uD835\uDCAB",pscr:"\uD835\uDCC5",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"\uD835\uDD14",qfr:"\uD835\uDD2E",qint:"⨌",Qopf:"ℚ",qopf:"\uD835\uDD62",qprime:"⁗",Qscr:"\uD835\uDCAC",qscr:"\uD835\uDCC6",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"\xbb",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"\xae",reg:"\xae",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rf
1isht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"\uD835\uDD2F",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"\uD835\uDD63",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"\uD835\uDCC7",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"\xa7",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"\uD835\uDD16",sfr:"\uD835\uDD30",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"\xad",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"\uD835\uDD4A",sopf:"\uD835\uDD64",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"\uD835\uDCAE",sscr:"\uD835\uDCC8",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"\xaf",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"\xb9",sup2:"\xb2",sup3:"\xb3",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"\xdf",Tab:"	",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"\uD835\uDD17",tfr:"\uD835\uDD31",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickS
1pace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"\xde",thorn:"\xfe",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"\xd7",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"\uD835\uDD4B",topf:"\uD835\uDD65",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"\uD835\uDCAF",tscr:"\uD835\uDCC9",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"\xda",uacute:"\xfa",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"\xdb",ucirc:"\xfb",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"\uD835\uDD18",ufr:"\uD835\uDD32",Ugrave:"\xd9",ugrave:"\xf9",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"\xa8",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"\uD835\uDD4C",uopf:"\uD835\uDD66",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"\uD835\uDCB0",uscr:"\uD835\uDCCA",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"\xdc",uuml:"\xfc",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"\uD835\uDD19",vfr:"\uD835\uDD33",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"\uD835\uDD4D",vopf:"\uD835\uDD67",vprop:"∝",vrtri:"⊳",Vscr:"\uD835\uDCB1",vscr:"\uD835\uDCCB",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"\uD835\uDD1A",wfr:"\uD835\uDD34",Wopf:"\uD835\uDD4E",wopf:"\uD835\uDD68",wp:"℘",wr:"≀",wreath:"≀",Wscr:"\uD835\uDCB2",wscr:"\uD835\uDCCC",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"\uD835\uDD1B",xfr:"\uD835\uDD35",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"\uD835\uDD4F",xopf:"\uD835\uDD69",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"\uD835\uDCB3",xscr:"\uD835\uDCCD",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"\xdd",yacute:"\xfd",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"\xa5",Yfr:"\uD835\uDD1C",yfr:"\uD835\uDD36",YIcy:"Ї",yicy:"ї",Yopf:"\uD835\uDD50",yopf:"\uD835\uDD6A",Yscr:"\uD835\uDCB4",yscr:"\uD835\uDCCE",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"\xff",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"\uD835\uDD37",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"\uD835\uDD6B",Zscr:"\uD835\uDCB5",zscr:"\uD835\uDCCF",zwj:"‍",zwnj:"‌"}),t.entityMap=t.HTML_ENTITIES},2337:function(e,t,i){"use strict";function r(e,t){e.prototype=Object.create(Error.prototype,{constructor:{value:e},name:{value:e.name,enumerable:!0,writable:t}})}var n=i(2167).freeze({Error:"Error",IndexSizeError:"IndexSizeError",DomstringSizeError:"DomstringSizeError",HierarchyRequestError:"HierarchyRequestError",WrongDocumentError:"WrongDocumentError",InvalidCharacterError:"InvalidCharacterError",NoDataAllowedError:"NoDataAllowedError",NoModificationAllowedError:"NoModificationAllowedError",NotFoundError:"NotFoundError",NotSupportedError:"NotSupportedError",InUseAttributeError:"InUseAttributeError",InvalidStateError:"InvalidStateError",SyntaxError:"SyntaxError",InvalidModificationError:"InvalidModificationError",NamespaceError:"NamespaceError",InvalidAccessError:"InvalidAccessError",ValidationError:"ValidationError",TypeMismatchError:"TypeMismatchError",SecurityError:"SecurityError",NetworkError:"NetworkError",AbortError:"AbortError",URLMismatchError:"URLMismatchError",QuotaExceededError:"QuotaExceededError",TimeoutError:"TimeoutError",InvalidNodeTypeError:"InvalidNodeTypeError",DataCloneError:"DataCloneError",EncodingError:"EncodingError",NotReadableError:"NotReadableError",UnknownError:"UnknownError",ConstraintError:"ConstraintError",DataError:"DataError",TransactionInactiveError:"TransactionInactiveError",ReadOnlyError:"ReadOnlyError",VersionError:"VersionError",OperationError:"OperationError",NotAllowedError:"NotAllowedError",OptOutError:"OptOutError"}),s=Object.keys(n);function a(e){return"number"==typeof e&&e>=1&&e<=25}function o(e,t){if(a(e))this.name=s[e],this.message=t||"";else this.message=e,this.name="string"==typeof t&&t.substring(t.length-n.Error.length)===n.Error?t:n.Error;Error.captureStackTrace&&Error.captureStackTrace(this,o)}
1r(o,!0),Object.defineProperties(o.prototype,{code:{enumerable:!0,get:function(){var e=s.indexOf(this.name);return a(e)?e:0}}});for(var l={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25},u=Object.entries(l),d=0;d<u.length;d++)o[u[d][0]]=u[d][1];function c(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,c)}r(c),t.DOMException=o,t.DOMExceptionName=n,t.ExceptionCode=l,t.ParseError=c},26:function(e,t){"use strict";function i(e){try{"function"!=typeof e&&(e=RegExp);var t=new e("\uD834\uDF06","u").exec("\uD834\uDF06");return!!t&&2===t[0].length}catch(e){}return!1}var r=i();function n(e){if("["!==e.source[0])throw Error(e+" can not be used with chars");return e.source.slice(1,e.source.lastIndexOf("]"))}function s(e,t){if("["!==e.source[0])throw Error("/"+e.source+"/ can not be used with chars_without");if(!t||"string"!=typeof t)throw Error(JSON.stringify(t)+" is not a valid search");if(-1===e.source.indexOf(t))throw Error('"'+t+'" is not is /'+e.source+"/");if("-"===t&&1!==e.source.indexOf(t))throw Error('"'+t+'" is not at the first postion of /'+e.source+"/");return new RegExp(e.source.replace(t,""),r?"u":"")}function a(e){var t=this;return new RegExp(Array.prototype.slice.call(arguments).map(function(e){var i="string"==typeof e;if(i&&void 0===t&&"|"===e)throw Error("use regg instead of reg to wrap expressions with `|`!");return i?e:e.source}).join(""),r?"mu":"m")}function o(e){if(0==arguments.length)throw Error("no parameters provided");return a.apply(o,["(?:"].concat(Array.prototype.slice.call(arguments),[")"]))}var l=/[-\x09\x0A\x0D\x20-\x2C\x2E-\uD7FF\uE000-\uFFFD]/;r&&(l=a("[",n(l),"\\u{10000}-\\u{10FFFF}","]"));var u=/[\x20\x09\x0D\x0A]/,d=n(u),c=a(u,"+"),h=a(u,"*"),p=/[:_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;r&&(p=a("[",n(p),"\\u{10000}-\\u{10FFFF}","]"));var f=a("[",n(p),n(/[-.0-9\xB7]/),n(/[\u0300-\u036F\u203F-\u2040]/),"]"),m=a(p,f,"*"),g=a(f,"+"),y=a("&",m,";"),v=o(/&#[0-9]+;|&#x[0-9a-fA-F]+;/),_=o(y,"|",v),b=a("%",m,";"),T=o(a('"',o(/[^%&"]/,"|",b,"|",_),"*",'"'),"|",a("'",o(/[^%&']/,"|",b,"|",_),"*","'")),w=o('"',o(/[^<&"]/,"|",_),"*",'"',"|","'",o(/[^<&']/,"|",_),"*","'"),S=a(s(p,":"),s(f,":"),"*"),E=a(S,o(":",S),"?"),C=a("^",E,"$"),k=a("(",E,")"),x=o(/"[^"]*"|'[^']*'/),D=a(/^<\?/,"(",m,")",o(c,"(",l,"*?)"),"?",/\?>/),I=/[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/,A=o('"',I,'*"',"|","'",s(I,"'"),"*'"),O="\x3c!--",L=a(O,o(s(l,"-"),"|",a("-",s(l,"-"))),"*","--\x3e"),P="#PCDATA",N=o(a(/\(/,h,P,o(h,/\|/,h,E),"*",h,/\)\*/),"|",a(/\(/,h,P,h,/\)/)),M=o("EMPTY","|","ANY","|",N,"|",a(/\([^>]+\)/,/[?*+]?/)),R=a("<!ELEMENT",c,o(E,"|",b),c,o(M,"|",b),h,">"),U=a("NOTATION",c,/\(/,h,m,o(h,/\|/,h,m),"*",h,/\)/),B=a(/\(/,h,g,o(h,/\|/,h,g),"*",h,/\)/),j=o(U,"|",B),q=o(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/,"|",j),F=o(/#REQUIRED|#IMPLIED/,"|",o(o("#FIXED",c),"?",w)),H=o(c,m,c,q,c,F),z=a("<!ATTLIST",c,m,H,"*",h,">"),V="about:legacy-compat",W=o('"'+V+'"',"|","'"+V+"'"),G="SYSTEM",X="PUBLIC",Y=o(o(G,c,x),"|",o(X,c,A,c,x)),K=a("^",o(o(G,c,"(?<SystemLiteralOnly>",x,")"),"|",o(X,c,"(?<PubidLiteral>",A,")",c,"(?<SystemLiteral>",x,")"))),Q=o(c,"NDATA",c,m),J=o(T,"|",o(Y,Q,"?")),Z="<!ENTITY",ee=a(Z,c,m,c,J,h,">"),et=a(Z,c,"%",c,m,c,o(T,"|",Y),h,">"),ei=o(ee,"|",et),er=a(X,c,A),en=a("<!NOTATION",c,m,c,o(Y,"|",er),h,">"),es=a(h,"=",h),ea=/1[.]\d+/,eo=a(c,"version",es,o("'",ea,"'","|",'"',ea,'"')),el=/[A-Za-z][-A-Za-z0-9._]*/,eu=a(/^<\?xml/,eo,o(c,"encoding",es,o('"',el,'"',"|","'",el,"'")),"?",o(c,"standalone",es,o("'",o("yes","|","no"),"'","|",'"',o("yes","|","no"),'"')),"?",h,/\?>/),ed=a(l,"*?",/\]\]>/),ec=a(/<!\[CDATA\[/,ed);t.chars=n,t.chars_without=s,t.detectUnicodeSupport=i,t.reg=a,t.regg=o,t.ABOUT_LEGACY_COMPAT=V,t.ABOUT_LEGACY_COMPAT_SystemLiteral=W,t.AttlistDecl=z,t.CDATA_START="<![CDATA[",t.CDATA_END="]]>",t.CDSect=ec,t.Char=l,t.Comment=L,t.COMMENT_START=O,t.COMMENT_END="--\x3e",t.DOCTYPE_DECL_START="<!DOCTYPE",t.elementdecl=R,t.EntityDecl=ei,t.EntityValue=T,t.ExternalID=Y,t.ExternalID_match=K,t.Name=m,t.NotationDecl=en,t.Reference=_,t.PEReference=b,t.PI=D,t.PUBLIC=X,t.PubidLiteral=A,t.QName=E,t.QName_exact=C,t.QName_group=k,t.S=c,t.SChar_s=d,t.S_OPT=h,t.SYSTEM=G,t.SystemLiteral=x,t.UNICODE_REPLACEMENT_CHARACTER="�",t.UNICODE_SUPPORT=r,t.XMLDecl=eu},3969:function(e,t,i){"use strict";var r=i(2167);r.assign,r.hasDefaultHTMLNamespace,r.isHTMLMimeType,r.isValidMimeType,r.MIME_TYPE,r.NAMESPACE;var n=i(2337);n.DOMException,n.DOMExceptionName,n.ExceptionCode,n.ParseError;var s=i(1146);s.Attr,s.CDATASection,s.CharacterData,s.Comment,s.Document,s.DocumentFragment,s.DocumentType,s.DOMImplementation,s.Element,s.Entity,s.EntityReference,s.LiveNodeList,s.NamedNodeMap,s.Node,s.NodeList,s.Notation,s.ProcessingInstruction,s.Text,s.XMLSerializer;var a=i(6129);t.DOMParser=a.DOMParser,a.normalizeLineEndings,a.onErrorStopParsing,a.onWarningStopParsing},6925:function(e,t,i){"use strict";var r=i(2167),n=i(26),s=i(2337),a=r.isHTMLEscapableRawTextElement,o=r.isHTMLMimeType,l=r.isHTMLRawTextElement,u=r.hasOwn,d=r.NAMESPACE,c=s.ParseError,h=s.DOMException;function p(){}p.prototype={parse:function(e,t,i){var s=this.domBuilder;s.startDocument(),y(t,t=Object.create(null)),function(e,t,i,s,d){var p=o(s.mimeType);function y(e){var t,r=";"===e[e.length-1]?e:e+";";if(!p&&r!==e)return d.error("EntityRef: expecting ;"),e;var s=n.Reference.exec(r);
1if(!s||s[0].length!==r.length)return d.error("entity not matching Reference production: "+e),e;var a=r.slice(1,-1);return u(i,a)?i[a]:"#"===a.charAt(0)?(t=parseInt(a.substring(1).replace("x","0x")))>65535?String.fromCharCode(55296+((t-=65536)>>10),56320+(1023&t)):String.fromCharCode(t):(d.error("entity not found:"+e),e)}function v(t){if(t>D){var i=e.substring(D,t).replace(f,y);E&&C(D),s.characters(i,0,t-D),D=t}}e.indexOf(n.UNICODE_REPLACEMENT_CHARACTER)>=0&&d.warning("Unicode replacement character detected, source encoding issues?");var T=0,w=0,S=/\r\n?|\n|$/g,E=s.locator;function C(t,i){for(;t>=w&&(i=S.exec(e));)T=w,w=i.index+i[0].length,E.lineNumber++;E.columnNumber=t-T+1}for(var k=[{currentNSMap:t}],x=[],D=0;;){try{var I=e.indexOf("<",D);if(I<0){if(!p&&x.length>0)return d.fatalError("unclosed xml tag(s): "+x.join(", "));if(!e.substring(D).match(/^\s*$/)){var A=s.doc,O=A.createTextNode(e.substring(D));if(A.documentElement)return d.error("Extra content at the end of the document");A.appendChild(O),s.currentElement=O}return}if(I>D){var L=e.substring(D,I);!p&&0===x.length&&(L=L.replace(RegExp(n.S_OPT.source,"g"),""))&&d.error("Unexpected content outside root element: '"+L+"'"),v(I)}switch(e.charAt(I+1)){case"/":var P=e.indexOf(">",I+2),N=e.substring(I+2,P>0?P:void 0);if(!N)return d.fatalError("end tag name missing");var M=P>0&&n.reg("^",n.QName_group,n.S_OPT,"$").exec(N);if(!M)return d.fatalError('end tag name contains invalid characters: "'+N+'"');if(!s.currentElement&&!s.doc.documentElement)return;var R=x[x.length-1]||s.currentElement.tagName||s.doc.documentElement.tagName||"";if(R!==M[1]){var U=M[1].toLowerCase();if(!p||R.toLowerCase()!==U)return d.fatalError('Opening and ending tag mismatch: "'+R+'" != "'+N+'"')}var B=k.pop();x.pop();var j=B.localNSMap;if(s.endElement(B.uri,B.localName,R),j)for(var q in j)u(j,q)&&s.endPrefixMapping(q);P++;break;case"?":E&&C(I),P=function(e,t,i,r){var s=e.substring(t).match(n.PI);if(!s)return r.fatalError("Invalid processing instruction starting at position "+t);if("xml"===s[1].toLowerCase()){if(t>0)return r.fatalError("processing instruction at position "+t+" is an xml declaration which is only at the start of the document");if(!n.XMLDecl.test(e.substring(t)))return r.fatalError("xml declaration is not well-formed")}return i.processingInstruction(s[1],s[2]),t+s[0].length}(e,I,s,d);break;case"!":E&&C(I),P=_(e,I,s,d,p);break;default:E&&C(I);var F=new b,H=k[k.length-1].currentNSMap,P=function(e,t,i,r,n,s,a){function o(e,t,r){return u(i.attributeNames,e)?s.fatalError("Attribute "+e+" redefined"):!a&&t.indexOf("<")>=0?s.fatalError("Unescaped '<' not allowed in attributes values"):void i.addValue(e,t.replace(/[\t\n\r]/g," ").replace(f,n),r)}for(var l,d,c=++t,h=0;;){var p=e.charAt(c);switch(p){case"=":if(1===h)l=e.slice(t,c),h=3;else if(2===h)h=3;else throw Error("attribute equal must after attrName");break;case"'":case'"':if(3===h||1===h)if(1===h&&(s.warning('attribute value must after "="'),l=e.slice(t,c)),t=c+1,(c=e.indexOf(p,t))>0)o(l,d=e.slice(t,c),t-1),h=5;else throw Error("attribute value no end '"+p+"' match");else if(4==h)o(l,d=e.slice(t,c),t),s.warning('attribute "'+l+'" missed start quot('+p+")!!"),t=c+1,h=5;else throw Error('attribute value must after "="');break;case"/":switch(h){case 0:i.setTagName(e.slice(t,c));case 5:case 6:case 7:h=7,i.closed=!0;case 4:case 1:break;case 2:i.closed=!0;break;default:throw Error("attribute invalid close char('/')")}break;case"":return s.error("unexpected end of input"),0==h&&i.setTagName(e.slice(t,c)),c;case">":switch(h){case 0:i.setTagName(e.slice(t,c));case 5:case 6:case 7:break;case 4:case 1:"/"===(d=e.slice(t,c)).slice(-1)&&(i.closed=!0,d=d.slice(0,-1));case 2:2===h&&(d=l),4==h?(s.warning('attribute "'+d+'" missed quot(")!'),o(l,d,t)):(a||s.warning('attribute "'+d+'" missed value!! "'+d+'" instead!!'),o(d,d,t));break;case 3:if(!a)return s.fatalError("AttValue: ' or \" expected")}return c;case"\x80":p=" ";default:if(p<=" ")switch(h){case 0:i.setTagName(e.slice(t,c)),h=6;break;case 1:l=e.slice(t,c),h=2;break;case 4:var d=e.slice(t,c);s.warning('attribute "'+d+'" missed quot(")!!'),o(l,d,t);case 5:h=6}else switch(h){case 2:a||s.warning('attribute "'+l+'" missed value!! "'+l+'" instead2!!'),o(l,l,t),t=c,h=1;break;case 5:s.warning('attribute space is required"'+l+'"!!');case 6:h=1,t=c;break;case 3:h=4,t=c;break;case 7:throw Error("elements closed character '/' and '>' must be connected to")}}c++}}(e,I,F,0,y,d,p),z=F.length;if(F.closed||(p&&r.isHTMLVoidElement(F.tagName)?F.closed=!0:x.push(F.tagName)),E&&z){for(var V=m(E,{}),W=0;W<z;W++){var G=F[W];C(G.offset),G.locator=m(E,{})}s.locator=V,g(F,s,H)&&k.push(F),s.locator=E}else g(F,s,H)&&k.push(F);p&&!F.closed?P=function(e,t,i,r,n){var s=a(i);if(s||l(i)){var o=e.indexOf("</"+i+">",t),u=e.substring(t+1,o);return s&&(u=u.replace(f,r)),n.characters(u,0,u.length),o}return t+1}(e,P,F.tagName,y,s):P++}}catch(e){if(e instanceof c)throw e;if(e instanceof h)throw new c(e.name+": "+e.message,s.locator,e);d.error("element parse error: "+e),P=-1}P>D?D=P:v(Math.max(I,D)+1)}}(e,t,i,s,this.errorHandler),s.endDocument()}};var f=/&#?\w+;?/g;function m(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}
1function g(e,t,i){for(var r=e.tagName,n=null,s=e.length;s--;){var a=e[s],o=a.qName,l=a.value,c=o.indexOf(":");if(c>0)var h=a.prefix=o.slice(0,c),p=o.slice(c+1),f="xmlns"===h&&p;else p=o,h=null,f="xmlns"===o&&"";a.localName=p,!1!==f&&(null==n&&(n=Object.create(null),y(i,i=Object.create(null))),i[f]=n[f]=l,a.uri=d.XMLNS,t.startPrefixMapping(f,l))}for(var s=e.length;s--;)(a=e[s]).prefix&&("xml"===a.prefix&&(a.uri=d.XML),"xmlns"!==a.prefix&&(a.uri=i[a.prefix]));var c=r.indexOf(":");c>0?(h=e.prefix=r.slice(0,c),p=e.localName=r.slice(c+1)):(h=null,p=e.localName=r);var m=e.uri=i[h||""];if(t.startElement(m,p,r,e),!e.closed)return e.currentNSMap=i,e.localNSMap=n,!0;if(t.endElement(m,p,r),n)for(h in n)u(n,h)&&t.endPrefixMapping(h)}function y(e,t){for(var i in e)u(e,i)&&(t[i]=e[i])}function v(e,t){var i=t;function r(t){return t=t||0,e.charAt(i+t)}function s(e){i+=e=e||1}function a(){return e.substring(i)}return{char:r,getIndex:function(){return i},getMatch:function(e){var t=n.reg("^",e).exec(a());return t?(s(t[0].length),t[0]):null},getSource:function(){return e},skip:s,skipBlanks:function(){for(var t=0;i<e.length;){var n=r();if(" "!==n&&"\n"!==n&&"	"!==n&&"\r"!==n)return t;t++,s()}return -1},substringFromIndex:a,substringStartsWith:function(t){return e.substring(i,i+t.length)===t},substringStartsWithCaseInsensitive:function(t){return e.substring(i,i+t.length).toUpperCase()===t.toUpperCase()}}}function _(e,t,i,r,s){var a=v(e,t);switch(s?a.char(2).toUpperCase():a.char(2)){case"-":var o=a.getMatch(n.Comment);if(o)return i.comment(o,n.COMMENT_START.length,o.length-n.COMMENT_START.length-n.COMMENT_END.length),a.getIndex();return r.fatalError("comment is not well-formed at position "+a.getIndex());case"[":var l=a.getMatch(n.CDSect);if(!l)return r.fatalError("Invalid CDATA starting at position "+t);if(!s&&!i.currentElement)return r.fatalError("CDATA outside of element");return i.startCDATA(),i.characters(l,n.CDATA_START.length,l.length-n.CDATA_START.length-n.CDATA_END.length),i.endCDATA(),a.getIndex();case"D":if(i.doc&&i.doc.documentElement)return r.fatalError("Doctype not allowed inside or after documentElement at position "+a.getIndex());if(s?!a.substringStartsWithCaseInsensitive(n.DOCTYPE_DECL_START):!a.substringStartsWith(n.DOCTYPE_DECL_START))return r.fatalError("Expected "+n.DOCTYPE_DECL_START+" at position "+a.getIndex());if(a.skip(n.DOCTYPE_DECL_START.length),1>a.skipBlanks())return r.fatalError("Expected whitespace after "+n.DOCTYPE_DECL_START+" at position "+a.getIndex());var u={name:void 0,publicId:void 0,systemId:void 0,internalSubset:void 0};if(u.name=a.getMatch(n.Name),!u.name)return r.fatalError("doctype name missing or contains unexpected characters at position "+a.getIndex());if(s&&"html"!==u.name.toLowerCase()&&r.warning("Unexpected DOCTYPE in HTML document at position "+a.getIndex()),a.skipBlanks(),a.substringStartsWith(n.PUBLIC)||a.substringStartsWith(n.SYSTEM)){var d=n.ExternalID_match.exec(a.substringFromIndex());if(!d)return r.fatalError("doctype external id is not well-formed at position "+a.getIndex());void 0!==d.groups.SystemLiteralOnly?u.systemId=d.groups.SystemLiteralOnly:(u.systemId=d.groups.SystemLiteral,u.publicId=d.groups.PubidLiteral),a.skip(d[0].length)}else if(s&&a.substringStartsWithCaseInsensitive(n.SYSTEM)){if(a.skip(n.SYSTEM.length),1>a.skipBlanks())return r.fatalError("Expected whitespace after "+n.SYSTEM+" at position "+a.getIndex());if(u.systemId=a.getMatch(n.ABOUT_LEGACY_COMPAT_SystemLiteral),!u.systemId)return r.fatalError("Expected "+n.ABOUT_LEGACY_COMPAT+" in single or double quotes after "+n.SYSTEM+" at position "+a.getIndex())}if(s&&u.systemId&&!n.ABOUT_LEGACY_COMPAT_SystemLiteral.test(u.systemId)&&r.warning("Unexpected doctype.systemId in HTML document at position "+a.getIndex()),s||(a.skipBlanks(),u.internalSubset=function(e,t){var i=e.getSource();if("["===e.char()){e.skip(1);for(var r=e.getIndex();e.getIndex()<i.length;){if(e.skipBlanks(),"]"===e.char()){var s=i.substring(r,e.getIndex());return e.skip(1),s}var a=null;if("<"===e.char()&&"!"===e.char(1))switch(e.char(2)){case"E":"L"===e.char(3)?a=e.getMatch(n.elementdecl):"N"===e.char(3)&&(a=e.getMatch(n.EntityDecl));break;case"A":a=e.getMatch(n.AttlistDecl);break;case"N":a=e.getMatch(n.NotationDecl);break;case"-":a=e.getMatch(n.Comment)}else if("<"===e.char()&&"?"===e.char(1))a=function(e,t){var i=n.PI.exec(e.substringFromIndex());return i?"xml"===i[1].toLowerCase()?t.fatalError("xml declaration is only allowed at the start of the document, but found at position "+e.getIndex()):(e.ski
1p(i[0].length),i[0]):t.fatalError("processing instruction is not well-formed at position "+e.getIndex())}(e,t);else{if("%"!==e.char())return t.fatalError("Error detected in Markup declaration");a=e.getMatch(n.PEReference)}if(!a)return t.fatalError("Error in internal subset at position "+e.getIndex())}return t.fatalError("doctype internal subset is not well-formed, missing ]")}}(a,r)),a.skipBlanks(),">"!==a.char())return r.fatalError("doctype not terminated with > at position "+a.getIndex());return a.skip(1),i.startDTD(u.name,u.publicId,u.systemId,u.internalSubset),i.endDTD(),a.getIndex();default:return r.fatalError('Not well-formed XML starting with "<!" at position '+t)}}function b(){this.attributeNames=Object.create(null)}b.prototype={setTagName:function(e){if(!n.QName_exact.test(e))throw Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,i){if(!n.QName_exact.test(e))throw Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:i}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},t.XMLReader=p,t.parseUtils=v,t.parseDoctypeCommentOrCData=_},7138:function(e,t,i){"use strict";let r,n,s,a;i.r(t),i.d(t,{clearAllBodyScrollLocks:()=>v,disableBodyScroll:()=>y,enableBodyScroll:()=>_});let o=!1;if("undefined"!=typeof window){let e={get passive(){o=!0;return}};window.addEventListener("testPassive",null,e),window.removeEventListener("testPassive",null,e)}let l="undefined"!=typeof window&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||"MacIntel"===window.navigator.platform&&window.navigator.maxTouchPoints>1),u=[],d=new Map,c=!1,h=-1,p=e=>u.some(t=>!!(t.options.allowTouchMove&&t.options.allowTouchMove(e))),f=e=>{let t=e||window.event;return!!p(t.target)||t.touches.length>1||(t.preventDefault&&t.preventDefault(),!1)},m=()=>{void 0!==a&&(document.body.style.paddingRight=a,a=void 0),void 0!==r&&(document.body.style.overflow=r,r=void 0)},g=()=>{if(void 0!==s){let e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10),i=document.documentElement,r=document.body;i.style.height=(null==n?void 0:n.height)||"",i.style.overflow=(null==n?void 0:n.overflow)||"",r.style.position=s.position||"",r.style.top=s.top||"",r.style.left=s.left||"",r.style.width=s.width||"",r.style.height=s.height||"",r.style.overflow=s.overflow||"",window.scrollTo(t,e),s=void 0}},y=(e,t)=>{if(!e)return void console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");if(d.set(e,(null==d?void 0:d.get(e))?(null==d?void 0:d.get(e))+1:1),!u.some(t=>t.targetElement===e)){if(u=[...u,{targetElement:e,options:t||{}}],l)window.requestAnimationFrame(()=>{let e=document.documentElement,t=document.body;if(void 0===s){n={...e.style},s={...t.style};let{scrollY:i,scrollX:r,innerHeight:a}=window;e.style.height="100%",e.style.overflow="hidden",t.style.position="fixed",t.style.top=`${-i}px`,t.style.left=`${-r}px`,t.style.width="100%",t.style.height="auto",t.style.overflow="hidden",setTimeout(()=>window.requestAnimationFrame(()=>{let e=a-window.innerHeight;e&&i>=a&&(t.style.top=-(i+e)+"px")}),300)}});else{if(void 0===a){let e=!!t&&!0===t.reserveScrollBarGap,i=window.innerWidth-document.documentElement.getBoundingClientRect().width;if(e&&i>0){let e=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right"),10);a=document.body.style.paddingRight,document.body.style.paddingRight=`${e+i}px`}}void 0===r&&(r=document.body.style.overflow,document.body.style.overflow="hidden")}l&&(e.ontouchstart=e=>{1===e.targetTouches.length&&(h=e.targetTouches[0].clientY)},e.ontouchmove=t=>{1===t.targetTouches.length&&((e,t)=>{let i=e.targetTouches[0].clientY-h;return p(e.target)||(t&&0===t.scrollTop&&i>0?f(e):t&&t.scrollHeight-t.scrollTop<=t.clientHeight&&i<0?f(e):e.stopPropagation())})(t,e)},c||(document.addEventListener("touchmove",f,o?{passive:!1}:void 0),c=!0))}},v=()=>
1{l&&(u.forEach(e=>{e.targetElement.ontouchstart=null,e.targetElement.ontouchmove=null}),c&&(document.removeEventListener("touchmove",f,o?{passive:!1}:void 0),c=!1),h=-1),l?g():m(),u=[],d.clear()},_=e=>{if(!e)return void console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");d.set(e,(null==d?void 0:d.get(e))?(null==d?void 0:d.get(e))-1:0),(null==d?void 0:d.get(e))===0&&(u=u.filter(t=>t.targetElement!==e),null==d||d.delete(e)),l&&(e.ontouchstart=null,e.ontouchmove=null,c&&0===u.length&&(document.removeEventListener("touchmove",f,o?{passive:!1}:void 0),c=!1)),0===u.length&&(l?g():m())}},3348:function(e,t,i){"use strict";i.r(t),i.d(t,{createFocusTrap:()=>G});var r=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","area[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],n=r.join(","),s="undefined"==typeof Element,a=s?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,o=!s&&Element.prototype.getRootNode?function(e){var t;return null==e||null==(t=e.getRootNode)?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},l=function(e,t){void 0===t&&(t=!0);var i,r=null==e||null==(i=e.getAttribute)?void 0:i.call(e,"inert");return""===r||"true"===r||t&&e&&("function"==typeof e.closest?e.closest("[inert]"):l(e.parentNode))},u=function(e){var t,i=null==e||null==(t=e.getAttribute)?void 0:t.call(e,"contenteditable");return""===i||"true"===i},d=function(e,t,i){if(l(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(n));return t&&a.call(e,n)&&r.unshift(e),r=r.filter(i)},c=function(e,t,i){for(var r=[],s=Array.from(e);s.length;){var o=s.shift();if(!l(o,!1))if("SLOT"===o.tagName){var u=o.assignedElements(),d=c(u.length?u:o.children,!0,i);
vendor: 5,269 bytes, line 1
1i.flatten?r.push.apply(r,d):r.push({scopeParent:o,candidates:d})}else{a.call(o,n)&&i.filter(o)&&(t||!e.includes(o))&&r.push(o);var h=o.shadowRoot||"function"==typeof i.getShadowRoot&&i.getShadowRoot(o),p=!l(h,!1)&&(!i.shadowRootFilter||i.shadowRootFilter(o));if(h&&p){var f=c(!0===h?o.children:h.children,!0,i);i.flatten?r.push.apply(r,f):r.push({scopeParent:o,candidates:f})}else s.unshift.apply(s,o.children)}}return r},h=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},p=function(e){if(!e)throw Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||u(e))&&!h(e)?0:e.tabIndex},f=function(e,t){var i=p(e);return i<0&&t&&!h(e)?0:i},m=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},g=function(e){return"INPUT"===e.tagName},y=function(e,t){for(var i=0;i<e.length;i++)if(e[i].checked&&e[i].form===t)return e[i]},v=function(e){if(!e.name)return!0;var t,i=e.form||o(e),r=function(e){return i.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var n=y(t,e.form);return!n||n===e},_=function(e){return g(e)&&"radio"===e.type&&!v(e)},b=function(e){var t,i,r,n,s,a,l,u=e&&o(e),d=null==(t=u)?void 0:t.host,c=!1;if(u&&u!==e)for(c=!!(null!=(i=d)&&null!=(r=i.ownerDocument)&&r.contains(d)||null!=e&&null!=(n=e.ownerDocument)&&n.contains(e));!c&&d;)c=!!(null!=(a=d=null==(s=u=o(d))?void 0:s.host)&&null!=(l=a.ownerDocument)&&l.contains(d));return c},T=function(e){var t=e.getBoundingClientRect(),i=t.width,r=t.height;return 0===i&&0===r},w=function(e,t){var i=t.displayCheck,r=t.getShadowRoot;if("full-native"===i&&"checkVisibility"in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});var n=getComputedStyle(e).visibility;if("hidden"===n||"collapse"===n)return!0;var s=a.call(e,"details>summary:first-of-type")?e.parentElement:e;if(a.call(s,"details:not([open]) *"))return!0;if(i&&"full"!==i&&"full-native"!==i&&"legacy-full"!==i){if("non-zero-area"===i)return T(e)}else{if("function"==typeof r){for(var l=e;e;){var u=e.parentElement,d=o(e);if(u&&!u.shadowRoot&&!0===r(u))return T(e);e=e.assignedSlot?e.assignedSlot:u||d===e.ownerDocument?u:d.host}e=l}if(b(e))return!e.getClientRects().length;if("legacy-full"!==i)return!0}return!1},S=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var i=0;i<t.children.length;i++){var r=t.children.item(i);if("LEGEND"===r.tagName)return!!a.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1},E=function(e,t){return!(t.disabled||g(t)&&"hidden"===t.type||w(t,e)||"DETAILS"===t.tagName&&Array.prototype.slice.apply(t.children).some(function(e){return"SUMMARY"===e.tagName})||S(t))},C=function(e,t){return!(_(t)||0>p(t))&&!!E(e,t)},k=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!isNaN(t)||!!(t>=0)},x=function(e){var t=[],i=[];return e.forEach(function(e,r){var n=!!e.scopeParent,s=n?e.scopeParent:e,a=f(s,n),o=n?x(e.candidates):s;0===a?n?t.push.apply(t,o):t.push(s):i.push({documentOrder:r,tabIndex:a,item:e,isScope:n,content:o})}),i.sort(m).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},D=function(e,t){return x((t=t||{}).getShadowRoot?c([e],t.includeContainer,{filter:C.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:k}):d(e,t.includeContainer,C.bind(null,t)))},I=function(e,t){return(t=t||{}).getShadowRoot?c([e],t.includeContainer,{filter:E.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):d(e,t.includeContainer,E.bind(null,t))},A=function(e,t){if(t=t||{},!e)throw Error("No node provided");return!1!==a.call(e,n)&&C(t,e)},O=r.concat("iframe:not([inert]):not([inert] *)").join(","),L=function(e,t){if(t=t||{},!e)throw Error("No node provided");return!1!==a.call(e,O)&&E(t,e)};function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=Array(t);i<t;i++)r[i]=e[i];return r}function N(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=U(e))||t){i&&(e=i);var r=0,n=function(){};return{s:n,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:n}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,o=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){o=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(o)throw s}}}}function M(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,r)}return i}function R(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};
1t%2?M(Object(i),!0).forEach(function(t){var r,n;r=t,n=i[t],(r=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t);if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):M(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function U(e,t){if(e){if("string"==typeof e)return P(e,t);var i=({}).toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?P(e,t):void 0}}var B={getActiveTrap:function(e){return(null==e?void 0:e.length)>0?e[e.length-1]:null},activateTrap:function(e,t){t!==B.getActiveTrap(e)&&B.pauseTrap(e);var i=e.indexOf(t);-1===i||e.splice(i,1),e.push(t)},deactivateTrap:function(e,t){var i=e.indexOf(t);-1!==i&&e.splice(i,1),B.unpauseTrap(e)},pauseTrap:function(e){var t=B.getActiveTrap(e);null==t||t._setPausedState(!0)},unpauseTrap:function(e){var t=B.getActiveTrap(e);t&&!t._isManuallyPaused()&&t._setPausedState(!1)}},j=function(e){return(null==e?void 0:e.key)==="Tab"||(null==e?void 0:e.keyCode)===9},q=function(e){return j(e)&&!e.shiftKey},F=function(e){return j(e)&&e.shiftKey},H=function(e){return setTimeout(e,0)},z=function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return"function"==typeof e?e.apply(void 0,i):e},V=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},W=[],G=function(e,t){var i,r=(null==t?void 0:t.document)||document,n=(null==t?void 0:t.trapStack)||W,s=R({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,delayReturnFocus:!0,isolateSubtrees:!1,isKeyForward:q,isKeyBackward:F},t),a={containers:[],containerGroups:[],tabbableGroups:[],adjacentElements:new Set,alreadySilent:new Set,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},o=function(e,t,i){return e&&void 0!==e[t]?e[t]:s[i||t]},l=function(e,t){var i="function"==typeof(null==t?void 0:t.composedPath)?t.composedPath():void 0;return a.containerGroups.findIndex(function(t){var r=t.container,n=t.tabbableNodes;return r.contains(e)||(null==i?void 0:i.includes(r))||n.find(function(t){return t===e})})},u=function(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.hasFallback,a=i.params,o=s[e];if("function"==typeof o&&(o=o.apply(void 0,function(e){if(Array.isArray(e))return P(e)}(t=void 0===a?[]:a)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||U(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())),!0===o&&(o=void 0),!o){if(void 0===o||!1===o)return o;throw Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var l=o;if("string"==typeof o){try{l=r.querySelector(o)}catch(t){throw Error("`".concat(e,'` appears to be an invalid selector; error="').concat(t.message,'"'))}if(!l&&!(void 0!==n&&n))throw Error("`".concat(e,"` as selector refers to no known node"))}return l},d=function(e){var t=e.activeElement;return t?t.shadowRoot&&null!==t.shadowRoot.activeElement?d(t.shadowRoot):t:null},c=function(){var e=u("initialFocus",{hasFallback:!0});if(!1===e)return!1;if(void 0===e||e&&!L(e,s.tabbableOptions)){var t=d(r);if(l(t)>=0)e=t;else{var i=a.tabbableGroups[0];e=i&&i.firstTabbableNode||u("fallbackFocus")}}else null===e&&(e=u("fallbackFocus"));if(!e)throw Error("Your focus-trap needs to have at least one focusable element");return e},h=function(){if(a.containerGroups=a.containers.map(function(e){var t=D(e,s.tabbableOptions),i=I(e,s.tabbableOptions),r=t.length>0?t[0]:void 0,n=t.length>0?t[t.length-1]:void 0,a=i.find(function(e){return A(e)}),o=i.slice().reverse().find(function(e){return A(e)}),l=!!t.find(function(e){return p(e)>0});return{container:e,tabbableNodes:t,focusableNodes:i,posTabIndexesFound:l,firstTabbableNode:r,lastTabbableNode:n,firstDomTabbableNode:a,lastDomTabbableNode:o,nextTabbableNode:function(e){var r=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=t.indexOf(e);return n<0?r?i.slice(i.indexOf(e)+1).find(function(e){return A(e)}):i.slice(0,i.indexOf(e)).reverse().find(function(e){return A(e)}):t[n+(r?1:-1)]}}}),a.tabbableGroups=a.containerGroups.filter(function(e){return e.tabbableNodes.length>0}),a.tabbableGroups.length<=0&&!u("fallbackFocus"))throw Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(a.containerGroups.find(function(e){return e.posTabIndexesFound})&&a.containerGroups.length>1)throw Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},f=function(e){if(!1!==e&&e!==d(document)){if(!e||!e.focus)return void f(c());e.focus({preventScroll:!!s.preventScroll}),a.mostRecentlyFocusedNode=e,e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select&&e.select()}},m=function(e){var t=u("setReturnFocus",{params:[e]});return t||!1!==t&&e},g=function(e){var t=e.target,i=e.event,r=e.isBackward,n=void 0!==r&&r;t=t||V(i),h();var o=null;if(a.tabbableGroups.length>0){var d=l(t,i),c=d>=0?a.containerGroups[d]:void 0;if(d<0)o=n?a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:a.tabbableGroups[0].firstTabbableNode;else if(n){var f=a.tabbableGroups.findIndex(function(e){var i=e.firstTabbableNode;return t===i});if(f<0&&(c.container===t||L(t,s.tabbableOptions)&&!A(t,s.tabbableOptions)&&!c.nextTabbableNode(t,!1))&&(f=d
1),f>=0){var m=0===f?a.tabbableGroups.length-1:f-1,g=a.tabbableGroups[m];o=p(t)>=0?g.lastTabbableNode:g.lastDomTabbableNode}else j(i)||(o=c.nextTabbableNode(t,!1))}else{var y=a.tabbableGroups.findIndex(function(e){var i=e.lastTabbableNode;return t===i});if(y<0&&(c.container===t||L(t,s.tabbableOptions)&&!A(t,s.tabbableOptions)&&!c.nextTabbableNode(t))&&(y=d),y>=0){var v=y===a.tabbableGroups.length-1?0:y+1,_=a.tabbableGroups[v];o=p(t)>=0?_.firstTabbableNode:_.firstDomTabbableNode}else j(i)||(o=c.nextTabbableNode(t))}}else o=u("fallbackFocus");return o},y=function(e){if(!(l(V(e),e)>=0)){if(z(s.clickOutsideDeactivates,e))return void i.deactivate({returnFocus:s.returnFocusOnDeactivate});z(s.allowOutsideClick,e)||e.preventDefault()}},v=function(e){var t=V(e),i=l(t,e)>=0;if(i||t instanceof Document)i&&(a.mostRecentlyFocusedNode=t);else{e.stopImmediatePropagation();var r,n=!0;if(a.mostRecentlyFocusedNode)if(p(a.mostRecentlyFocusedNode)>0){var o=l(a.mostRecentlyFocusedNode),u=a.containerGroups[o].tabbableNodes;if(u.length>0){var d=u.findIndex(function(e){return e===a.mostRecentlyFocusedNode});d>=0&&(s.isKeyForward(a.recentNavEvent)?d+1<u.length&&(r=u[d+1],n=!1):d-1>=0&&(r=u[d-1],n=!1))}}else a.containerGroups.some(function(e){return e.tabbableNodes.some(function(e){return p(e)>0})})||(n=!1);else n=!1;n&&(r=g({target:a.mostRecentlyFocusedNode,isBackward:s.isKeyBackward(a.recentNavEvent)})),r?f(r):f(a.mostRecentlyFocusedNode||c())}a.recentNavEvent=void 0},_=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];a.recentNavEvent=e;var i=g({event:e,isBackward:t});i&&(j(e)&&e.preventDefault(),f(i))},b=function(e){(s.isKeyForward(e)||s.isKeyBackward(e))&&_(e,s.isKeyBackward(e))},T=function(e){((null==e?void 0:e.key)==="Escape"||(null==e?void 0:e.key)==="Esc"||(null==e?void 0:e.keyCode)===27)&&!1!==z(s.escapeDeactivates,e)&&(e.preventDefault(),i.deactivate())},w=function(e){!(l(V(e),e)>=0||z(s.clickOutsideDeactivates,e))&&(z(s.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation()))},S=function(){var e;if(a.active)return B.activateTrap(n,i),s.delayInitialFocus?e=new Promise(function(e){a.delayInitialFocusTimer=H(function(){f(c()),e()})}):f(c()),r.addEventListener("focusin",v,!0),r.addEventListener("mousedown",y,{capture:!0,passive:!1}),r.addEventListener("touchstart",y,{capture:!0,passive:!1}),r.addEventListener("click",w,{capture:!0,passive:!1}),r.addEventListener("keydown",b,{capture:!0,passive:!1}),r.addEventListener("keydown",T),e},E=function(e){a.active&&!a.paused&&i._setSubtreeIsolation(!1),a.adjacentElements.clear(),a.alreadySilent.clear();var t,r=new Set,n=new Set,s=N(e);try{for(s.s();!(t=s.n()).done;){var o=t.value;r.add(o);for(var l="undefined"!=typeof ShadowRoot&&o.getRootNode()instanceof ShadowRoot,u=o;u;){r.add(u);var d=u.parentElement,c=[];d?c=d.children:!d&&l&&(c=u.getRootNode().children,d=u.getRootNode().host,l="undefined"!=typeof ShadowRoot&&d.getRootNode()instanceof ShadowRoot);var h,p=N(c);try{for(p.s();!(h=p.n()).done;){var f=h.value;n.add(f)}}catch(e){p.e(e)}finally{p.f()}u=d}}}catch(e){s.e(e)}finally{s.f()}r.forEach(function(e){n.delete(e)}),a.adjacentElements=n},C=function(){if(a.active)return r.removeEventListener("focusin",v,!0),r.removeEventListener("mousedown",y,!0),r.removeEventListener("touchstart",y,!0),r.removeEventListener("click",w,!0),r.removeEventListener("keydown",b,!0),r.removeEventListener("keydown",T),i},k="undefined"!=typeof window&&"MutationObserver"in window?new MutationObserver(function(e){var t=a.mostRecentlyFocusedNode;t&&e.some(function(e){return Array.from(e.removedNodes).some(function(e){return e===t||"function"==typeof e.contains&&e.contains(t)})})&&a.containers.some(function(e){return null==e?void 0:e.isConnected})&&(h(),f(c()))}):void 0,x=function(){k&&(k.disconnect(),a.active&&!a.paused&&a.containers.map(function(e){k.observe(e,{subtree:!0,childList:!0})}))};return Object.defineProperties(i={get active(){return a.active},get paused(){return a.paused},activate:function(e){if(a.active)return this;var t,s,l=o(e,"onActivate"),u=o(e,"onPostActivate"),c=o(e,"checkCanFocusTrap"),p=B.getActiveTrap(n),f=!1;p&&!p.paused&&(null==(t=p._setSubtreeIsolation)||t.call(p,!1),f=!0);try{c||h(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=d(r),null==l||l({trap:i});var m=function(){c&&h();var e=function(){i._setSubtreeIsolation(!0),x(),null==u||u({trap:i})},t=S();t?t.then(e):e()};if(c)return c(a.containers.concat()).then(m,m),this;m()}catch(e){throw p===B.getActiveTrap(n)&&f&&(null==(s=p._setSubtreeIsolation)||s.call(p,!0)),e}return this},deactivate:function(e){if(!a.active)return this;var t=R({onDeactivate:s.onDeactivate,onPostDeactivate:s.onPostDeactivate,checkCanReturnFocus:s.checkCanReturnFocus},e);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,a.paused||i._setSubtreeIsolation(!1),a.alreadySilent.clear(),
1C(),a.active=!1,a.paused=!1,x(),B.deactivateTrap(n,i);var r=o(t,"onDeactivate"),l=o(t,"onPostDeactivate"),u=o(t,"checkCanReturnFocus"),d=o(t,"delayReturnFocus"),c=o(t,"returnFocus","returnFocusOnDeactivate");null==r||r({trap:i});var h=function(){c&&f(m(a.nodeFocusedBeforeActivation)),null==l||l({trap:i})},p=function(){d&&c?H(h):h()};return c&&u?u(m(a.nodeFocusedBeforeActivation)).then(p,p):p(),this},pause:function(e){return a.active?(a.manuallyPaused=!0,this._setPausedState(!0,e)):this},unpause:function(e){return a.active?(a.manuallyPaused=!1,n[n.length-1]!==this)?this:this._setPausedState(!1,e):this},updateContainerElements:function(e){return a.containers=[].concat(e).filter(Boolean).map(function(e){return"string"==typeof e?r.querySelector(e):e}),s.isolateSubtrees&&E(a.containers),a.active&&(h(),a.paused||i._setSubtreeIsolation(!0)),x(),this}},{_isManuallyPaused:{value:function(){return a.manuallyPaused}},_setPausedState:{value:function(e,t){if(a.paused===e)return this;if(a.paused=e,e){var r=o(t,"onPause"),n=o(t,"onPostPause");null==r||r({trap:i}),C(),i._setSubtreeIsolation(!1),x(),null==n||n({trap:i})}else{var s,l,u=o(t,"onUnpause"),d=o(t,"onPostUnpause");null==u||u({trap:i}),h(),s=function(){i._setSubtreeIsolation(!0),x(),null==d||d({trap:i})},(l=S())?l.then(s):s()}return this}},_setSubtreeIsolation:{value:function(e){s.isolateSubtrees&&a.adjacentElements.forEach(function(t){var i;e?"aria-hidden"===s.isolateSubtrees?(("true"===t.ariaHidden||(null==(i=t.getAttribute("aria-hidden"))?void 0:i.toLowerCase())==="true")&&a.alreadySilent.add(t),t.setAttribute("aria-hidden","true")):((t.inert||t.hasAttribute("inert"))&&a.alreadySilent.add(t),t.setAttribute("inert",!0)):a.alreadySilent.has(t)||("aria-hidden"===s.isolateSubtrees?t.removeAttribute("aria-hidden"):t.removeAttribute("inert"))})}}}),i.updateContainerElements(e),i}},6486:function(e,t,i){e=i.nmd(e),(function(){var r,n="Expected a function",s="__lodash_hash_undefined__",a="__lodash_placeholder__",o=1/0,l=0/0,u=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],d="[object Arguments]",c="[object Array]",h="[object Boolean]",p="[object Date]",f="[object Error]",m="[object Function]",g="[object GeneratorFunction]",y="[object Map]",v="[object Number]",_="[object Object]",b="[object Promise]",T="[object RegExp]",w="[object Set]",S="[object String]",E="[object Symbol]",C="[object WeakMap]",k="[object ArrayBuffer]",x="[object DataView]",D="[object Float32Array]",I="[object Float64Array]",A="[object Int8Array]",O="[object Int16Array]",L="[object Int32Array]",P="[object Uint8Array]",N="[object Uint8ClampedArray]",M="[object Uint16Array]",R="[object Uint32Array]",U=/\b__p \+= '';/g,B=/\b(__p \+=) '' \+/g,j=/(__e\(.*?\)|\b__t\)) \+\n'';/g,q=/&(?:amp|lt|gt|quot|#39);/g,F=/[&<>"']/g,H=RegExp(q.source),z=RegExp(F.source),V=/<%-([\s\S]+?)%>/g,W=/<%([\s\S]+?)%>/g,G=/<%=([\s\S]+?)%>/g,X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Y=/^\w*$/,K=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Q=/[\\^$.*+?()[\]{}|]/g,J=RegExp(Q.source),Z=/^\s+/,ee=/\s/,et=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ei=/\{\n\/\* \[wrapped with (.+)\] \*/,er=/,? & /,en=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,es=/[()=,{}\[\]\/\s]/,ea=/\\(\\)?/g,eo=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,el=/\w*$/,eu=/^[-+]0x[0-9a-f]+$/i,ed=/^0b[01]+$/i,ec=/^\[object .+?Constructor\]$/,eh=/^0o[0-7]+$/i,ep=/^(?:0|[1-9]\d*)$/,ef=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u01
vendor: 4,260 bytes, line 1
17f]/g,em=/($^)/,eg=/['\n\r\u2028\u2029\\]/g,ey="\ud800-\udfff",ev="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",e_="\\u2700-\\u27bf",eb="a-z\\xdf-\\xf6\\xf8-\\xff",eT="A-Z\\xc0-\\xd6\\xd8-\\xde",ew="\\ufe0e\\ufe0f",eS="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",eE="['’]",eC="["+eS+"]",ek="["+ev+"]",ex="["+eb+"]",eD="[^"+ey+eS+"\\d+"+e_+eb+eT+"]",eI="\ud83c[\udffb-\udfff]",eA="[^"+ey+"]",eO="(?:\ud83c[\udde6-\uddff]){2}",eL="[\ud800-\udbff][\udc00-\udfff]",eP="["+eT+"]",eN="\\u200d",eM="(?:"+ex+"|"+eD+")",eR="(?:"+eP+"|"+eD+")",e$="(?:"+eE+"(?:d|ll|m|re|s|t|ve))?",eU="(?:"+eE+"(?:D|LL|M|RE|S|T|VE))?",eB="(?:"+ek+"|"+eI+")?",ej="["+ew+"]?",eq="(?:"+eN+"(?:"+[eA,eO,eL].join("|")+")"+ej+eB+")*",eF=ej+eB+eq,eH="(?:"+["["+e_+"]",eO,eL].join("|")+")"+eF,ez="(?:"+[eA+ek+"?",ek,eO,eL,"["+ey+"]"].join("|")+")",eV=RegExp(eE,"g"),eW=RegExp(ek,"g"),eG=RegExp(eI+"(?="+eI+")|"+ez+eF,"g"),eX=RegExp([eP+"?"+ex+"+"+e$+"(?="+[eC,eP,"$"].join("|")+")",eR+"+"+eU+"(?="+[eC,eP+eM,"$"].join("|")+")",eP+"?"+eM+"+"+e$,eP+"+"+eU,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])|\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])|\\d+",eH].join("|"),"g"),eY=RegExp("["+eN+ey+ev+ew+"]"),eK=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,eQ=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],eJ=-1,eZ={};eZ[D]=eZ[I]=eZ[A]=eZ[O]=eZ[L]=eZ[P]=eZ[N]=eZ[M]=eZ[R]=!0,eZ[d]=eZ[c]=eZ[k]=eZ[h]=eZ[x]=eZ[p]=eZ[f]=eZ[m]=eZ[y]=eZ[v]=eZ[_]=eZ[T]=eZ[w]=eZ[S]=eZ[C]=!1;var e0={};e0[d]=e0[c]=e0[k]=e0[x]=e0[h]=e0[p]=e0[D]=e0[I]=e0[A]=e0[O]=e0[L]=e0[y]=e0[v]=e0[_]=e0[T]=e0[w]=e0[S]=e0[E]=e0[P]=e0[N]=e0[M]=e0[R]=!0,e0[f]=e0[m]=e0[C]=!1;var e1={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},e2=parseFloat,e4=parseInt,e8="object"==typeof i.g&&i.g&&i.g.Object===Object&&i.g,e3="object"==typeof self&&self&&self.Object===Object&&self,e5=e8||e3||Function("return this")(),e6=t&&!t.nodeType&&t,e7=e6&&e&&!e.nodeType&&e,e9=e7&&e7.exports===e6,te=e9&&e8.process,tt=function(){try{var e=e7&&e7.require&&e7.require("util").types;if(e)return e;return te&&te.binding&&te.binding("util")}catch(e){}}(),ti=tt&&tt.isArrayBuffer,tr=tt&&tt.isDate,tn=tt&&tt.isMap,ts=tt&&tt.isRegExp,ta=tt&&tt.isSet,to=tt&&tt.isTypedArray;function tl(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)}function tu(e,t,i,r){for(var n=-1,s=null==e?0:e.length;++n<s;){var a=e[n];t(r,a,i(a),e)}return r}function td(e,t){for(var i=-1,r=null==e?0:e.length;++i<r&&!1!==t(e[i],i,e););return e}function tc(e,t){for(var i=-1,r=null==e?0:e.length;++i<r;)if(!t(e[i],i,e))return!1;return!0}function th(e,t){for(var i=-1,r=null==e?0:e.length,n=0,s=[];++i<r;){var a=e[i];t(a,i,e)&&(s[n++]=a)}return s}function tp(e,t){return!!(null==e?0:e.length)&&tS(e,t,0)>-1}function tf(e,t,i){for(var r=-1,n=null==e?0:e.length;++r<n;)if(i(t,e[r]))return!0;return!1}function tm(e,t){for(var i=-1,r=null==e?0:e.length,n=Array(r);++i<r;)n[i]=t(e[i],i,e);return n}function tg(e,t){for(var i=-1,r=t.length,n=e.length;++i<r;)e[n+i]=t[i];return e}function ty(e,t,i,r){var n=-1,s=null==e?0:e.length;for(r&&s&&(i=e[++n]);++n<s;)i=t(i,e[n],n,e);return i}function tv(e,t,i,r){var n=null==e?0:e.length;for(r&&n&&(i=e[--n]);n--;)i=t(i,e[n],n,e);return i}function t_(e,t){for(var i=-1,r=null==e?0:e.length;++i<r;)if(t(e[i],i,e))return!0;return!1}var tb=tx("length");function tT(e,t,i){var r;return i(e,function(e,i,n){if(t(e,i,n))return r=i,!1}),r}function tw(e,t,i,r){for(var n=e.length,s=i+(r?1:-1);r?s--:++s<n;)if(t(e[s],s,e))return s;return -1}function tS(e,t,i){return t==t?function(e,t,i){for(var r=i-1,n=e.length;++r<n;)if(e[r]===t)return r;return -1}(e,t,i):tw(e,tC,i)}function tE(e,t,i,r){for(var n=i-1,s=e.length;++n<s;
vendor: 4,318 bytes, line 1
1)if(r(e[n],t))return n;return -1}function tC(e){return e!=e}function tk(e,t){var i=null==e?0:e.length;return i?tA(e,t)/i:l}function tx(e){return function(t){return null==t?r:t[e]}}function tD(e){return function(t){return null==e?r:e[t]}}function tI(e,t,i,r,n){return n(e,function(e,n,s){i=r?(r=!1,e):t(i,e,n,s)}),i}function tA(e,t){for(var i,n=-1,s=e.length;++n<s;){var a=t(e[n]);r!==a&&(i=r===i?a:i+a)}return i}function tO(e,t){for(var i=-1,r=Array(e);++i<e;)r[i]=t(i);return r}function tL(e){return e?e.slice(0,tX(e)+1).replace(Z,""):e}function tP(e){return function(t){return e(t)}}function tN(e,t){return tm(t,function(t){return e[t]})}function tM(e,t){return e.has(t)}function tR(e,t){for(var i=-1,r=e.length;++i<r&&tS(t,e[i],0)>-1;);return i}function t$(e,t){for(var i=e.length;i--&&tS(t,e[i],0)>-1;);return i}var tU=tD({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),tB=tD({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function tj(e){return"\\"+e1[e]}function tq(e){return eY.test(e)}function tF(e){var t=-1,i=Array(e.size);return e.forEach(function(e,r){i[++t]=[r,e]}),i}function tH(e,t){return function(i){return e(t(i))}}function tz(e,t){for(var i=-1,r=e.length,n=0,s=[];++i<r;){var o=e[i];(o===t||o===a)&&(e[i]=a,s[n++]=i)}return s}function tV(e){var t=-1,i=Array(e.size);return e.forEach(function(e){i[++t]=e}),i}function tW(e){return tq(e)?function(e){for(var t=eG.lastIndex=0;eG.test(e);)++t;return t}(e):tb(e)}function tG(e){return tq(e)?e.match(eG)||[]:e.split("")}function tX(e){for(var t=e.length;t--&&ee.test(e.charAt(t)););return t}var tY=tD({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),tK=function e(t){var i,ee,ey,ev,e_=(t=null==t?e5:tK.defaults(e5.Object(),t,tK.pick(e5,eQ))).Array,eb=t.Date,eT=t.Error,ew=t.Function,eS=t.Math,eE=t.Object,eC=t.RegExp,ek=t.String,ex=t.TypeError,eD=e_.prototype,eI=ew.prototype,eA=eE.prototype,eO=t["__core-js_shared__"],eL=eI.toString,eP=eA.hasOwnProperty,eN=0,eM=(i=/[^.]+$/.exec(eO&&eO.keys&&eO.keys.IE_PROTO||""))?"Symbol(src)_1."+i:"",eR=eA.toString,e$=eL.call(eE),eU=e5._,eB=eC("^"+eL.call(eP).replace(Q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ej=e9?t.Buffer:r,eq=t.Symbol,eF=t.Uint8Array,eH=ej?ej.allocUnsafe:r,ez=tH(eE.getPrototypeOf,eE),eG=eE.create,eY=eA.propertyIsEnumerable,e1=eD.splice,e8=eq?eq.isConcatSpreadable:r,e3=eq?eq.iterator:r,e6=eq?eq.toStringTag:r,e7=function(){try{var e=nm(eE,"defineProperty");return e({},"",{}),e}catch(e){}}(),te=t.clearTimeout!==e5.clearTimeout&&t.clearTimeout,tt=eb&&eb.now!==e5.Date.now&&eb.now,tb=t.setTimeout!==e5.setTimeout&&t.setTimeout,tD=eS.ceil,tQ=eS.floor,tJ=eE.getOwnPropertySymbols,tZ=ej?ej.isBuffer:r,t0=t.isFinite,t1=eD.join,t2=tH(eE.keys,eE),t4=eS.max,t8=eS.min,t3=eb.now,t5=t.parseInt,t6=eS.random,t7=eD.reverse,t9=nm(t,"DataView"),ie=nm(t,"Map"),it=nm(t,"Promise"),ii=nm(t,"Set"),ir=nm(t,"WeakMap"),is=nm(eE,"create"),ia=ir&&new ir,io={},il=nj(t9),iu=nj(ie),id=nj(it),ic=nj(ii),ih=nj(ir),ip=eq?eq.prototype:r,im=ip?ip.valueOf
1:r,ig=ip?ip.toString:r;function iy(e){if(sY(e)&&!sU(e)&&!(e instanceof iT)){if(e instanceof ib)return e;if(eP.call(e,"__wrapped__"))return nq(e)}return new ib(e)}var iv=function(){function e(){}return function(t){if(!sX(t))return{};if(eG)return eG(t);e.prototype=t;var i=new e;return e.prototype=r,i}}();function i_(){}function ib(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function iT(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=0xffffffff,this.__views__=[]}function iw(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}function iS(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}function iE(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}function iC(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new iE;++t<i;)this.add(e[t])}function ik(e){var t=this.__data__=new iS(e);this.size=t.size}function ix(e,t){var i=sU(e),r=!i&&s$(e),n=!i&&!r&&sF(e),s=!i&&!r&&!n&&s4(e),a=i||r||n||s,o=a?tO(e.length,ek):[],l=o.length;for(var u in e)(t||eP.call(e,u))&&!(a&&("length"==u||n&&("offset"==u||"parent"==u)||s&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||nw(u,l)))&&o.push(u);return o}function iD(e){var t=e.length;return t?e[rh(0,t-1)]:r}iy.templateSettings={escape:V,evaluate:W,interpolate:G,variable:"",imports:{_:iy}},iy.prototype=i_.prototype,iy.prototype.constructor=iy,ib.prototype=iv(i_.prototype),ib.prototype.constructor=ib,iT.prototype=iv(i_.prototype),iT.prototype.constructor=iT,iw.prototype.clear=function(){this.__data__=is?is(null):{},this.size=0},iw.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=!!t,t},iw.prototype.get=function(e){var t=this.__data__;if(is){var i=t[e];return i===s?r:i}return eP.call(t,e)?t[e]:r},iw.prototype.has=function(e){var t=this.__data__;return is?t[e]!==r:eP.call(t,e)},iw.prototype.set=function(e,t){var i=this.__data__;return this.size+=+!this.has(e),i[e]=is&&r===t?s:t,this},iS.prototype.clear=function(){this.__data__=[],this.size=0},iS.prototype.delete=function(e){var t=this.__data__,i=iO(t,e);return!(i<0)&&(i==t.length-1?t.pop():e1.call(t,i,1),--this.size,!0)},iS.prototype.get=function(e){var t=this.__data__,i=iO(t,e);return i<0?r:t[i][1]},iS.prototype.has=function(e){return iO(this.__data__,e)>-1},iS.prototype.set=function(e,t){var i=this.__data__,r=iO(i,e);return r<0?(++this.size,i.push([e,t])):i[r][1]=t,this},iE.prototype.clear=function(){this.size=0,this.__data__={hash:new iw,map:new(ie||iS),string:new iw}},iE.prototype.delete=function(e){var t=np(this,e).delete(e);return this.size-=!!t,t},iE.prototype.get=function(e){return np(this,e).get(e)},iE.prototype.has=function(e){return np(this,e).has(e)},iE.prototype.set=function(e,t){var i=np(this,e),r=i.size;return i.set(e,t),this.size+=+(i.size!=r),this},iC.prototype.add=iC.prototype.push=function(e){return this.__data__.set(e,s),this},iC.prototype.has=function(e){return this.__data__.has(e)};function iI(e,t,i){(r===i||sN(e[t],i))&&(r!==i||t in e)||iN(e,t,i)}function iA(e,t,i){var n=e[t];eP.call(e,t)&&sN(n,i)&&(r!==i||t in e)||iN(e,t,i)}function iO(e,t){for(var i=e.length;i--;)if(sN(e[i][0],t))return i;return -1}function iL(e,t,i,r){return iq(e,function(e,n,s){t(r,e,i(e),s)}),r}function iP(e,t){return e&&rz(t,am(t),e)}function iN(e,t,i){"__proto__"==t&&e7?e7(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}function iM(e,t){for(var i=-1,n=t.length,s=e_(n),a=null==e;++i<n;)s[i]=a?r:ad(e,t[i]);return s}function iR(e,t,i){return e==e&&(r!==i&&(e=e<=i?e:i),r!==t&&(e=e>=t?e:t)),e}function i$(e,t,i,n,s,a){var o,l=1&t,u=2&t,c=4&t;if(i&&(o=s?i(e,n,s,a):i(e)),r!==o)return o;if(!sX(e))return e;var f=sU(e);if(f){if(C=(b=e).length,U=new b.constructor(C),C&&"string"==typeof b[0]&&eP.call(b,"index")&&(U.index=b.index,U.input=b.input),o=U,!l)return rH(e,o)}else{var b,C,U,B,j,q,F,H,z=nv(e),V=z==m||z==g;if(sF(e))return r$(e,l);if(z==_||z==d||V&&!s){if(o=u||V?{}:nb(e),!l){return u?(B=e,j=(H=o)&&rz(e,ag(e),H),rz(B,ny(B),j)):(q=e,F=iP(o,e),rz(q,ng(q),F))}}else{if(!e0[z])return s?e:{};o=function(e,t,i){var r,n,s=e.constructor;switch(t){case k:return rU(e);case h:case p:return new s(+e);case x:return r=i?rU(e.buffer):e.buffer,new e.constructor(r,e.byteOffset,e.byteLength);case D:case I:case A:case O:case L:case P:case N:case M:case R:return rB(e,i);case y:return new s;case v:case S:return new s(e);case T:return(n=new e.constructor(e.source,el.exec(e))).lastIndex=e.lastIndex,n;case w:return new s;case E:return im?eE(im.call(e)):{}}}(e,z,l)}}a||(a=new ik);var W=a.get(e);if(W)return W;a.set(e,o),s0(e)?e.forEach(function(r){o.add(i$(r,t,i,r,e,a))}):sK(e)&&e.forEach(function(r,n){o.set(n,i$(r,t,i,n,e,a))});var G=c?u?nl:no:u?ag:am,X=f?r:G(e);return td(X||e,function(r,n){X&&(r=e[n=r]),iA(o,n,i$(r,t,i,n,e,a))}),o}function iU(e,t,i){var n=i.length;if(null==e)return!n;for(e=eE(e);n--;){var s=i[n],a=t[s],o=e[s];if(r===o&&!(s in e)||!a(o))return!1}return!0}function iB(e,t,i){if("function"!=typeof e)throw new ex(n);return nP(function(){e.apply(r,i)},t)}function ij(e,t,i,r){var n=-1,s=tp,a=!0,o=e.length,l=[],u=t.length;if(!o)return l;i&&(t=tm(t,tP(i))),r?(s=tf,a=!1):t.length>=200&&(s=tM,a=!1,t=new iC(t));e:for(;++n<o;){var d=e[n],c=null==i?d:i(d);if(d=r||0!==d?d:0,a&&c==c){for(var h=u;h--;)if(t[h]===c)continue e;l.push(d)}else s(t,c,r)||l.push(d)}return l}ik.prototype.clear=function(){this.__data__=new iS,this.size=0},ik.prototype.delete=function(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i},ik.prototype.get=function(e){return this.__data__.get(e)},ik.prototype.has=function(e){return this.__data__.has(e)},ik.prototype.set=function(e,t){var i=this.__data__;if(i instanceof iS){var r=i.__data__;if(!ie||r.length<199)return r.push([e,t]),this.size=++i.size,this;i=this.__data__=new iE(r)}
1return i.set(e,t),this.size=i.size,this};var iq=rG(iY),iF=rG(iK,!0);function iH(e,t){var i=!0;return iq(e,function(e,r,n){return i=!!t(e,r,n)}),i}function iz(e,t,i){for(var n=-1,s=e.length;++n<s;){var a=e[n],o=t(a);if(null!=o&&(r===l?o==o&&!s2(o):i(o,l)))var l=o,u=a}return u}function iV(e,t){var i=[];return iq(e,function(e,r,n){t(e,r,n)&&i.push(e)}),i}function iW(e,t,i,r,n){var s=-1,a=e.length;for(i||(i=nT),n||(n=[]);++s<a;){var o=e[s];t>0&&i(o)?t>1?iW(o,t-1,i,r,n):tg(n,o):r||(n[n.length]=o)}return n}var iG=rX(),iX=rX(!0);function iY(e,t){return e&&iG(e,t,am)}function iK(e,t){return e&&iX(e,t,am)}function iQ(e,t){return th(t,function(t){return sV(e[t])})}function iJ(e,t){t=rN(t,e);for(var i=0,n=t.length;null!=e&&i<n;)e=e[nB(t[i++])];return i&&i==n?e:r}function iZ(e,t,i){var r=t(e);return sU(e)?r:tg(r,i(e))}function i0(e){var t;return null==e?r===e?"[object Undefined]":"[object Null]":e6&&e6 in eE(e)?function(e){var t=eP.call(e,e6),i=e[e6];try{e[e6]=r;var n=!0}catch(e){}var s=eR.call(e);return n&&(t?e[e6]=i:delete e[e6]),s}(e):(t=e,eR.call(t))}function i1(e,t){return e>t}function i2(e,t){return null!=e&&eP.call(e,t)}function i4(e,t){return null!=e&&t in eE(e)}function i8(e,t,i){for(var n=i?tf:tp,s=e[0].length,a=e.length,o=a,l=e_(a),u=1/0,d=[];o--;){var c=e[o];o&&t&&(c=tm(c,tP(t))),u=t8(c.length,u),l[o]=!i&&(t||s>=120&&c.length>=120)?new iC(o&&c):r}c=e[0];var h=-1,p=l[0];e:for(;++h<s&&d.length<u;){var f=c[h],m=t?t(f):f;if(f=i||0!==f?f:0,!(p?tM(p,m):n(d,m,i))){for(o=a;--o;){var g=l[o];if(!(g?tM(g,m):n(e[o],m,i)))continue e}p&&p.push(m),d.push(f)}}return d}function i3(e,t,i){t=rN(t,e);var n=null==(e=nA(e,t))?e:e[nB(nJ(t))];return null==n?r:tl(n,e,i)}function i5(e){return sY(e)&&i0(e)==d}function i6(e,t,i,n,s){return e===t||(null!=e&&null!=t&&(sY(e)||sY(t))?function(e,t,i,n,s,a){var o=sU(e),l=sU(t),u=o?c:nv(e),m=l?c:nv(t);u=u==d?_:u,m=m==d?_:m;var g=u==_,b=m==_,C=u==m;if(C&&sF(e)){if(!sF(t))return!1;o=!0,g=!1}if(C&&!g)return a||(a=new ik),o||s4(e)?ns(e,t,i,n,s,a):function(e,t,i,r,n,s,a){switch(i){case x:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case k:if(e.byteLength!=t.byteLength||!s(new eF(e),new eF(t)))break;return!0;case h:case p:case v:return sN(+e,+t);case f:return e.name==t.name&&e.message==t.message;case T:case S:return e==t+"";case y:var o=tF;case w:var l=1&r;if(o||(o=tV),e.size!=t.size&&!l)break;var u=a.get(e);if(u)return u==t;r|=2,a.set(e,t);var d=ns(o(e),o(t),r,n,s,a);return a.delete(e),d;case E:if(im)return im.call(e)==im.call(t)}return!1}(e,t,u,i,n,s,a);if(!(1&i)){var D=g&&eP.call(e,"__wrapped__"),I=b&&eP.call(t,"__wrapped__");
1if(D||I){var A=D?e.value():e,O=I?t.value():t;return a||(a=new ik),s(A,O,i,n,a)}}return!!C&&(a||(a=new ik),function(e,t,i,n,s,a){var o=1&i,l=no(e),u=l.length;if(u!=no(t).length&&!o)return!1;for(var d=u;d--;){var c=l[d];if(!(o?c in t:eP.call(t,c)))return!1}var h=a.get(e),p=a.get(t);if(h&&p)return h==t&&p==e;var f=!0;a.set(e,t),a.set(t,e);for(var m=o;++d<u;){var g=e[c=l[d]],y=t[c];if(n)var v=o?n(y,g,c,t,e,a):n(g,y,c,e,t,a);if(!(r===v?g===y||s(g,y,i,n,a):v)){f=!1;break}m||(m="constructor"==c)}if(f&&!m){var _=e.constructor,b=t.constructor;_!=b&&"constructor"in e&&"constructor"in t&&!("function"==typeof _&&_ instanceof _&&"function"==typeof b&&b instanceof b)&&(f=!1)}return a.delete(e),a.delete(t),f}(e,t,i,n,s,a))}(e,t,i,n,i6,s):e!=e&&t!=t)}function i7(e,t,i,n){var s=i.length,a=s,o=!n;if(null==e)return!a;for(e=eE(e);s--;){var l=i[s];if(o&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++s<a;){var u=(l=i[s])[0],d=e[u],c=l[1];if(o&&l[2]){if(r===d&&!(u in e))return!1}else{var h=new ik;if(n)var p=n(d,c,u,e,t,h);if(!(r===p?i6(c,d,3,n,h):p))return!1}}return!0}function i9(e){var t;return!(!sX(e)||(t=e,eM&&eM in t))&&(sV(e)?eB:ec).test(nj(e))}function re(e){return"function"==typeof e?e:null==e?aq:"object"==typeof e?sU(e)?rs(e[0],e[1]):rn(e):aK(e)}function rt(e){if(!nx(e))return t2(e);var t=[];for(var i in eE(e))eP.call(e,i)&&"constructor"!=i&&t.push(i);return t}function ri(e,t){return e<t}function rr(e,t){var i=-1,r=sj(e)?e_(e.length):[];return iq(e,function(e,n,s){r[++i]=t(e,n,s)}),r}function rn(e){var t=nf(e);return 1==t.length&&t[0][2]?nD(t[0][0],t[0][1]):function(i){return i===e||i7(i,e,t)}}function rs(e,t){var i;return nE(e)&&(i=t)==i&&!sX(i)?nD(nB(e),t):function(i){var n=ad(i,e);return r===n&&n===t?ac(i,e):i6(t,n,3)}}function ra(e,t,i,n,s){e!==t&&iG(t,function(a,o){if(s||(s=new ik),sX(a))!function(e,t,i,n,s,a,o){var l=nO(e,i),u=nO(t,i),d=o.get(u);if(d)return iI(e,i,d);var c=a?a(l,u,i+"",e,t,o):r,h=r===c;if(h){var p=sU(u),f=!p&&sF(u),m=!p&&!f&&s4(u);c=u,p||f||m?sU(l)?c=l:sq(l)?c=rH(l):f?(h=!1,c=r$(u,!0)):m?(h=!1,c=rB(u,!0)):c=[]:sJ(u)||s$(u)?(c=l,s$(l)?c=at(l):(!sX(l)||sV(l))&&(c=nb(u))):h=!1}h&&(o.set(u,c),s(c,u,n,a,o),o.delete(u)),iI(e,i,c)}(e,t,o,i,ra,n,s);else{var l=n?n(nO(e,o),a,o+"",e,t,s):r;r===l&&(l=a),iI(e,o,l)}},ag)}function ro(e,t){var i=e.length;if(i)return nw(t+=t<0?i:0,i)?e[t]:r}function rl(e,t,i){t=t.length?tm(t,function(e){return sU(e)?function(t){return iJ(t,1===e.length?e[0]:e)}:e}):[aq];var r=-1;t=tm(t,tP(nh()));var n=rr(e,function(e,i,n){return{criteria:tm(t,function(t){return t(e)}),index:++r,value:e}}),s=n.length;for(n.sort(function(e,t){return function(e,t,i){for(var r=-1,n=e.criteria,s=t.criteria,a=n.length,o=i.length;++r<a;){var l=rj(n[r],s[r]);if(l){if(r>=o)return l;return l*("desc"==i[r]?-1:1)}}return e.index-t.index}(e,t,i)});s--;)n[s]=n[s].value;return n}function ru(e,t,i){for(var r=-1,n=t.length,s={};++r<n;){var a=t[r],o=iJ(e,a);i(o,a)&&rm(s,rN(a,e),o)}return s}function rd(e,t,i,r){var n=r?tE:tS,s=-1,a=t.length,o=e;for(e===t&&(t=rH(t)),i&&(o=tm(e,tP(i)));++s<a;)for(var l=0,u=t[s],d=i?i(u):u;(l=n(o,d,l,r))>-1;)o!==e&&e1.call(o,l,1),e1.call(e,l,1);return e}function rc(e,t){for(var i=e?t.length:0,r=i-1;i--;){var n=t[i];if(i==r||n!==s){var s=n;nw(n)?e1.call(e,n,1):rk(e,n)}}return e}function rh(e,t){return e+tQ(t6()*(t-e+1))}function rp(e,t){var i="";if(!e||t<1||t>0x1fffffffffffff)return i;do t%2&&(i+=e),(t=tQ(t/2))&&(e+=e);while(t);return i}function rf(e,t){return nN(nI(e,t,aq),e+"")}function rm(e,t,i,n){if(!sX(e))return e;t=rN(t,e);for(var s=-1,a=t.length,o=a-1,l=e;null!=l&&++s<a;){var u=nB(t[s]),d=i;if("__proto__"===u||"constructor"===u||"prototype"===u)break;if(s!=o){var c=l[u];d=n?n(c,u,l):r,r===d&&(d=sX(c)?c:nw(t[s+1])?[]:{})}iA(l,u,d),l=l[u]}return e}var rg=ia?function(e,t){return ia.set(e,t),e}:aq,ry=e7?function(e,t){return e7(e,"toString",{configurable:!0,enumerable:!1,value:aU(t),writable:!0})}:aq;function rv(e,t,i){var r=-1,n=e.length;t<0&&(t=-t>n?0:n+t),(i=i>n?n:i)<0&&(i+=n),n=t>i?0:i-t>>>0,t>>>=0;for(var s=e_(n);++r<n;)s[r]=e[r+t];return s}function r_(e,t){var i;return iq(e,function(e,r,n){return!(i=t(e,r,n))}),!!i}function rb(e,t,i){var r=0,n=null==e?r:e.length;if("number"==typeof t&&t==t&&n<=0x7fffffff){for(;r<n;){var s=r+n>>>1,a=e[s];null!==a&&!s2(a)&&(i?a<=t:a<t)?r=s+1:n=s}return n}return rT(e,t,aq,i)}function rT(e,t,i,n){var s=0,a=null==e?0:e.length;if(0===a)return 0;for(var o=(t=i(t))!=t,l=null===t,u=s2(t),d=r===t;s<a;){var c=tQ((s+a)/2),h=i(e[c]),p=r!==h,f=null===h,m=h==h,g=s2(h);if(o)var y=n||m;else y=d?m&&(n||p):l?m&&p&&(n||!f):u?m&&p&&!f&&(n||!g):!f&&!g&&(n?h<=t:h<t);y?s=c+1:a=c}return t8(a,0xfffffffe)}function rw(e,t){for(var i=-1,r=e.length,n=0,s=[];++i<r;){var a=e[i],o=t?t(a):a;if(!i||!sN(o,l)){var l=o;s[n++]=0===a?0:a}}return s}function rS(e){return"number"==typeof e?e:s2(e)?l:+e}function rE(e){if("string"==typeof e)return e;if(sU(e))return tm(e,rE)+"";if(s2(e))return ig?ig.call(e):"";var t=e+"";return"0"==t&&1/e==-o?"-0":t}function rC(e,t,i){var r=-1,n=tp,s=e.length,a=!0,o=[],l=o;if(i)a=!1,n=tf;else if(s>=200){var u=t?null:r9(e);
vendor: 4,720 bytes, line 1
1if(u)return tV(u);a=!1,n=tM,l=new iC}else l=t?[]:o;e:for(;++r<s;){var d=e[r],c=t?t(d):d;if(d=i||0!==d?d:0,a&&c==c){for(var h=l.length;h--;)if(l[h]===c)continue e;t&&l.push(c),o.push(d)}else n(l,c,i)||(l!==o&&l.push(c),o.push(d))}return o}function rk(e,t){return t=rN(t,e),null==(e=nA(e,t))||delete e[nB(nJ(t))]}function rx(e,t,i,r){return rm(e,t,i(iJ(e,t)),r)}function rD(e,t,i,r){for(var n=e.length,s=r?n:-1;(r?s--:++s<n)&&t(e[s],s,e););return i?rv(e,r?0:s,r?s+1:n):rv(e,r?s+1:0,r?n:s)}function rI(e,t){var i=e;return i instanceof iT&&(i=i.value()),ty(t,function(e,t){return t.func.apply(t.thisArg,tg([e],t.args))},i)}function rA(e,t,i){var r=e.length;if(r<2)return r?rC(e[0]):[];for(var n=-1,s=e_(r);++n<r;)for(var a=e[n],o=-1;++o<r;)o!=n&&(s[n]=ij(s[n]||a,e[o],t,i));return rC(iW(s,1),t,i)}function rO(e,t,i){for(var n=-1,s=e.length,a=t.length,o={};++n<s;){var l=n<a?t[n]:r;i(o,e[n],l)}return o}function rL(e){return sq(e)?e:[]}function rP(e){return"function"==typeof e?e:aq}function rN(e,t){return sU(e)?e:nE(e,t)?[e]:nU(ai(e))}function rM(e,t,i){var n=e.length;return i=r===i?n:i,!t&&i>=n?e:rv(e,t,i)}var rR=te||function(e){return e5.clearTimeout(e)};function r$(e,t){if(t)return e.slice();var i=e.length,r=eH?eH(i):new e.constructor(i);return e.copy(r),r}function rU(e){var t=new e.constructor(e.byteLength);return new eF(t).set(new eF(e)),t}function rB(e,t){var i=t?rU(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}function rj(e,t){if(e!==t){var i=r!==e,n=null===e,s=e==e,a=s2(e),o=r!==t,l=null===t,u=t==t,d=s2(t);if(!l&&!d&&!a&&e>t||a&&o&&u&&!l&&!d||n&&o&&u||!i&&u||!s)return 1;if(!n&&!a&&!d&&e<t||d&&i&&s&&!n&&!a||l&&i&&s||!o&&s||!u)return -1}return 0}function rq(e,t,i,r){for(var n=-1,s=e.length,a=i.length,o=-1,l=t.length,u=t4(s-a,0),d=e_(l+u),c=!r;++o<l;)d[o]=t[o];for(;++n<a;)(c||n<s)&&(d[i[n]]=e[n]);for(;u--;)d[o++]=e[n++];return d}function rF(e,t,i,r){for(var n=-1,s=e.length,a=-1,o=i.length,l=-1,u=t.length,d=t4(s-o,0),c=e_(d+u),h=!r;++n<d;)c[n]=e[n];for(var p=n;++l<u;)c[p+l]=t[l];for(;++a<o;)(h||n<s)&&(c[p+i[a]]=e[n++]);return c}function rH(e,t){var i=-1,r=e.length;for(t||(t=e_(r));++i<r;)t[i]=e[i];return t}function rz(e,t,i,n){var s=!i;i||(i={});for(var a=-1,o=t.length;++a<o;){var l=t[a],u=n?n(i[l],e[l],l,i,e):r;r===u&&(u=e[l]),s?iN(i,l,u):iA(i,l,u)}return i}function rV(e,t){return function(i,r){var n=sU(i)?tu:iL,s=t?t():{};return n(i,e,nh(r,2),s)}}function rW(e){return rf(function(t,i){var n=-1,s=i.length,a=s>1?i[s-1]:r,o=s>2?i[2]:r;for(a=e.length>3&&"function"==typeof a?(s--,a):r,o&&nS(i[0],i[1],o)&&(a=s<3?r:a,s=1),t=eE(t);++n<s;){var l=i[n];l&&e(t,l,n,a)}return t})}function rG(e,t){return function(i,r){if(null==i)return i;if(!sj(i))return e(i,r);for(var n=i.length,s=t?n:-1,a=eE(i);(t?s--:++s<n)&&!1!==r(a[s],s,a););return i}}function rX(e){return function(t,i,r){for(var n=-1,s=eE(t),a=r(t),o=a.length;o--;){var l=a[e?o:++n];if(!1===i(s[l],l,s))break}return t}}function rY(e){return function(t){var i=tq(t=ai(t))?tG(t):r,n=i?i[0]:t.charAt(0),s=i?rM(i,1).join(""):t.slice(1);return n[e]()+s}}function rK(e){return function(t){return ty(aM(ax(t).replace(eV,"")),e,"")}}function rQ(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var i=iv(e.prototype),r=e.apply(i,t);return sX(r)?r:i}}function rJ(e){return function(t,i,n){var s=eE(t);if(!sj(t)){var a=nh(i,3);t=am(t),i=function(e){return a(s[e],e,s)}}var o=e(t,i,n);return o>-1?s[a?t[o]:o]:r}}function rZ(e){return na(function(t){var i=t.length,s=i,a=ib.prototype.thru;for(e&&t.reverse();s--;){var o=t[s];if("function"!=typeof o)throw new ex(n);if(a&&!l&&"wrapper"==nd(o))var l=new ib([],!0)}for(s=l?s:i;++s<i;){var u=nd(o=t[s]),d="wrapper"==u?nu(o):r;l=d&&nC(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?l[nd(d[0])].apply(l,d[3]):1==o.length&&nC(o)?l[u]():l.thru(o)}return function(){var e=arguments,r=e[0];if(l&&1==e.length&&sU(r))return l.plant(r).value();for(var n=0,s=i?t[n].apply(this,e):r;++n<i;)s=t[n].call(this,s);return s}})}function r0(e,t,i,n,s,a,o,l,u,d){var c=128&t,h=1&t,p=2&t,f=24&t,m=512&t,g=p?r:rQ(e);function y(){for(var v=arguments.length,_=e_(v),b=v;b--;)_[b]=arguments[b];if(f)var T=nc(y),w=function(e,t){for(var i=e.length,r=0;i--;)e[i]===t&&++r;return r}(_,T);if(n&&(_=rq(_,n,s,f)),a&&(_=rF(_,a,o,f)),v-=w,f&&v<d){var S=tz(_,T);return r6(e,t,r0,y.placeholder,i,_,S,l,u,d-v)}var E=h?i:this,C=p?E[e]:e;return v=_.length,l?_=function(e,t){for(var i=e.length,n=t8(t.length,i),s=rH(e);
1n--;){var a=t[n];e[n]=nw(a,i)?s[a]:r}return e}(_,l):m&&v>1&&_.reverse(),c&&u<v&&(_.length=u),this&&this!==e5&&this instanceof y&&(C=g||rQ(C)),C.apply(E,_)}return y}function r1(e,t){return function(i,r){var n,s;return n=t(r),s={},iY(i,function(t,i,r){e(s,n(t),i,r)}),s}}function r2(e,t){return function(i,n){var s;if(r===i&&r===n)return t;if(r!==i&&(s=i),r!==n){if(r===s)return n;"string"==typeof i||"string"==typeof n?(i=rE(i),n=rE(n)):(i=rS(i),n=rS(n)),s=e(i,n)}return s}}function r4(e){return na(function(t){return t=tm(t,tP(nh())),rf(function(i){var r=this;return e(t,function(e){return tl(e,r,i)})})})}function r8(e,t){var i=(t=r===t?" ":rE(t)).length;if(i<2)return i?rp(t,e):t;var n=rp(t,tD(e/tW(t)));return tq(t)?rM(tG(n),0,e).join(""):n.slice(0,e)}function r3(e){return function(t,i,n){n&&"number"!=typeof n&&nS(t,i,n)&&(i=n=r),t=s6(t),r===i?(i=t,t=0):i=s6(i),n=r===n?t<i?1:-1:s6(n);for(var s=t,a=i,o=n,l=-1,u=t4(tD((a-s)/(o||1)),0),d=e_(u);u--;)d[e?u:++l]=s,s+=o;return d}}function r5(e){return function(t,i){return("string"!=typeof t||"string"!=typeof i)&&(t=ae(t),i=ae(i)),e(t,i)}}function r6(e,t,i,n,s,a,o,l,u,d){var c=8&t,h=c?o:r,p=c?r:o,f=c?a:r,m=c?r:a;t|=c?32:64,4&(t&=~(c?64:32))||(t&=-4);var g=[e,t,s,f,h,m,p,l,u,d],y=i.apply(r,g);return nC(e)&&nL(y,g),y.placeholder=n,nM(y,e,t)}function r7(e){var t=eS[e];return function(e,i){if(e=ae(e),(i=null==i?0:t8(s7(i),292))&&t0(e)){var r=(ai(e)+"e").split("e");return+((r=(ai(t(r[0]+"e"+(+r[1]+i)))+"e").split("e"))[0]+"e"+(r[1]-i))}return t(e)}}var r9=ii&&1/tV(new ii([,-0]))[1]==o?function(e){return new ii(e)}:aW;function ne(e){return function(t){var i,r,n=nv(t);return n==y?tF(t):n==w?(i=-1,r=Array(t.size),t.forEach(function(e){r[++i]=[e,e]}),r):tm(e(t),function(e){return[e,t[e]]})}}function nt(e,t,i,s,o,l,u,d){var c=2&t;if(!c&&"function"!=typeof e)throw new ex(n);var h=s?s.length:0;if(h||(t&=-97,s=o=r),u=r===u?u:t4(s7(u),0),d=r===d?d:s7(d),h-=o?o.length:0,64&t){var p=s,f=o;s=o=r}var m=c?r:nu(e),g=[e,t,i,s,o,p,f,l,u,d];if(m&&function(e,t){var i=e[1],r=t[1],n=i|r,s=n<131,o=128==r&&8==i||128==r&&256==i&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==i;if(s||o){1&r&&(e[2]=t[2],n|=1&i?0:4);var l=t[3];if(l){var u=e[3];e[3]=u?rq(u,l,t[4]):l,e[4]=u?tz(e[3],a):t[4]}(l=t[5])&&(u=e[5],e[5]=u?rF(u,l,t[6]):l,e[6]=u?tz(e[5],a):t[6]),(l=t[7])&&(e[7]=l),128&r&&(e[8]=null==e[8]?t[8]:t8(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=n}}(g,m),e=g[0],t=g[1],i=g[2],s=g[3],o=g[4],(d=g[9]=g[9]===r?c?0:e.length:t4(g[9]-h,0))||!(24&t)||(t&=-25),t&&1!=t)8==t||16==t?D=function(e,t,i){var n=rQ(e);function s(){for(var a=arguments.length,o=e_(a),l=a,u=nc(s);l--;)o[l]=arguments[l];var d=a<3&&o[0]!==u&&o[a-1]!==u?[]:tz(o,u);return(a-=d.length)<i?r6(e,t,r0,s.placeholder,r,o,d,r,r,i-a):tl(this&&this!==e5&&this instanceof s?n:e,this,o)}return s}(e,t,d):32!=t&&33!=t||o.length?D=r0.apply(r,g):(y=e,v=t,_=i,b=s,T=1&v,w=rQ(y),D=function e(){for(var t=-1,i=arguments.length,r=-1,n=b.length,s=e_(n+i),a=this&&this!==e5&&this instanceof e?w:y;++r<n;)s[r]=b[r];for(;i--;)s[r++]=arguments[++t];return tl(a,T?_:this,s)});else var y,v,_,b,T,w,S,E,C,k,x,D=(S=e,E=t,C=i,k=1&E,x=rQ(S),function e(){return(this&&this!==e5&&this instanceof e?x:S).apply(k?C:this,arguments)});return nM((m?rg:nL)(D,g),e,t)}function ni(e,t,i,n){return r===e||sN(e,eA[i])&&!eP.call(n,i)?t:e}function nr(e,t,i,n,s,a){return sX(e)&&sX(t)&&(a.set(t,e),ra(e,t,r,nr,a),a.delete(t)),e}function nn(e){return sJ(e)?r:e}function ns(e,t,i,n,s,a){var o=1&i,l=e.length,u=t.length;if(l!=u&&!(o&&u>l))return!1;var d=a.get(e),c=a.get(t);if(d&&c)return d==t&&c==e;var h=-1,p=!0,f=2&i?new iC:r;for(a.set(e,t),a.set(t,e);++h<l;){var m=e[h],g=t[h];if(n)var y=o?n(g,m,h,t,e,a):n(m,g,h,e,t,a);if(r!==y){if(y)continue;p=!1;break}if(f){if(!t_(t,function(e,t){if(!tM(f,t)&&(m===e||s(m,e,i,n,a)))return f.push(t)})){p=!1;break}}else if(!(m===g||s(m,g,i,n,a))){p=!1;break}}return a.delete(e),a.delete(t),p}function na(e){return nN(nI(e,r,nG),e+"")}function no(e){return iZ(e,am,ng)}function nl(e){return iZ(e,ag,ny)}var nu=ia?function(e){return ia.get(e)}:aW;
1function nd(e){for(var t=e.name+"",i=io[t],r=eP.call(io,t)?i.length:0;r--;){var n=i[r],s=n.func;if(null==s||s==e)return n.name}return t}function nc(e){return(eP.call(iy,"placeholder")?iy:e).placeholder}function nh(){var e=iy.iteratee||aF;return e=e===aF?re:e,arguments.length?e(arguments[0],arguments[1]):e}function np(e,t){var i,r,n=e.__data__;return("string"==(r=typeof(i=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==i:null===i)?n["string"==typeof t?"string":"hash"]:n.map}function nf(e){for(var t=am(e),i=t.length;i--;){var r,n=t[i],s=e[n];t[i]=[n,s,(r=s)==r&&!sX(r)]}return t}function nm(e,t){var i=null==e?r:e[t];return i9(i)?i:r}var ng=tJ?function(e){return null==e?[]:th(tJ(e=eE(e)),function(t){return eY.call(e,t)})}:aZ,ny=tJ?function(e){for(var t=[];e;)tg(t,ng(e)),e=ez(e);return t}:aZ,nv=i0;function n_(e,t,i){t=rN(t,e);for(var r=-1,n=t.length,s=!1;++r<n;){var a=nB(t[r]);if(!(s=null!=e&&i(e,a)))break;e=e[a]}return s||++r!=n?s:!!(n=null==e?0:e.length)&&sG(n)&&nw(a,n)&&(sU(e)||s$(e))}function nb(e){return"function"!=typeof e.constructor||nx(e)?{}:iv(ez(e))}function nT(e){return sU(e)||s$(e)||!!(e8&&e&&e[e8])}function nw(e,t){var i=typeof e;return!!(t=null==t?0x1fffffffffffff:t)&&("number"==i||"symbol"!=i&&ep.test(e))&&e>-1&&e%1==0&&e<t}function nS(e,t,i){if(!sX(i))return!1;var r=typeof t;return("number"==r?!!(sj(i)&&nw(t,i.length)):"string"==r&&t in i)&&sN(i[t],e)}function nE(e,t){if(sU(e))return!1;var i=typeof e;return!!("number"==i||"symbol"==i||"boolean"==i||null==e||s2(e))||Y.test(e)||!X.test(e)||null!=t&&e in eE(t)}function nC(e){var t=nd(e),i=iy[t];if("function"!=typeof i||!(t in iT.prototype))return!1;if(e===i)return!0;var r=nu(i);return!!r&&e===r[0]}(t9&&nv(new t9(new ArrayBuffer(1)))!=x||ie&&nv(new ie)!=y||it&&nv(it.resolve())!=b||ii&&nv(new ii)!=w||ir&&nv(new ir)!=C)&&(nv=function(e){var t=i0(e),i=t==_?e.constructor:r,n=i?nj(i):"";if(n)switch(n){case il:return x;case iu:return y;case id:return b;case ic:return w;case ih:return C}return t});var nk=eO?sV:a0;function nx(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||eA)}function nD(e,t){return function(i){return null!=i&&i[e]===t&&(r!==t||e in eE(i))}}function nI(e,t,i){return t=t4(r===t?e.length-1:t,0),function(){for(var r=arguments,n=-1,s=t4(r.length-t,0),a=e_(s);++n<s;)a[n]=r[t+n];n=-1;for(var o=e_(t+1);++n<t;)o[n]=r[n];return o[t]=i(a),tl(e,this,o)}}function nA(e,t){return t.length<2?e:iJ(e,rv(t,0,-1))}function nO(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var nL=nR(rg),nP=tb||function(e,t){return e5.setTimeout(e,t)},nN=nR(ry);function nM(e,t,i){var r,n,s,a=t+"";return nN(e,function(e,t){var i=t.length;if(!i)return e;var r=i-1;return t[r]=(i>1?"& ":"")+t[r],t=t.join(i>2?", ":" "),e.replace(et,"{\n/* [wrapped with "+t+"] */\n")}(a,(r=(s=a.match(ei))?s[1].split(er):[],n=i,td(u,function(e){var t="_."+e[0];n&e[1]&&!tp(r,t)&&r.push(t)}),r.sort())))}function nR(e){var t=0,i=0;return function(){var n=t3(),s=16-(n-i);if(i=n,s>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function n$(e,t){var i=-1,n=e.length,s=n-1;for(t=r===t?n:t;++i<t;){var a=rh(i,s),o=e[a];e[a]=e[i],e[i]=o}return e.length=t,e}var nU=(ey=(ee=sD(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(K,function(e,i,r,n){t.push(r?n.replace(ea,"$1"):i||e)}),t},function(e){return 500===ey.size&&ey.clear(),e})).cache,ee);function nB(e){if("string"==typeof e||s2(e))return e;var t=e+"";return"0"==t&&1/e==-o?"-0":t}function nj(e){if(null!=e){try{return eL.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function nq(e){if(e instanceof iT)return e.clone();var t=new ib(e.__wrapped__,e.__chain__);return t.__actions__=rH(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var nF=rf(function(e,t){return sq(e)?ij(e,iW(t,1,sq,!0)):[]}),nH=rf(function(e,t){var i=nJ(t);return sq(i)&&(i=r),sq(e)?ij(e,iW(t,1,sq,!0),nh(i,2)):[]}),nz=rf(function(e,t){var i=nJ(t);return sq(i)&&(i=r),sq(e)?ij(e,iW(t,1,sq,!0),r,i):[]});function nV(e,t,i){var r=null==e?0:e.length;if(!r)return -1;var n=null==i?0:s7(i);return n<0&&(n=t4(r+n,0)),tw(e,nh(t,3),n)}function nW(e,t,i){var n=null==e?0:e.length;if(!n)return -1;var s=n-1;return r!==i&&(s=s7(i),s=i<0?t4(n+s,0):t8(s,n-1)),tw(e,nh(t,3),s,!0)}function nG(e){return(null==e?0:e.length)?iW(e,1):[]}function nX(e){return e&&e.length?e[0]:r}var nY=rf(function(e){var t=tm(e,rL);return t.length&&t[0]===e[0]?i8(t):[]}),nK=rf(function(e){var t=nJ(e),i=tm(e,rL);return t===nJ(i)?t=r:i.pop(),i.length&&i[0]===e[0]?i8(i,nh(t,2)):[]}),nQ=rf(function(e){var t=nJ(e),i=tm(e,rL);return(t="function"==typeof t?t:r)&&i.pop(),i.length&&i[0]===e[0]?i8(i,r,t):[]});function nJ(e){var t=null==e?0:e.length;return t?e[t-1]:r}var nZ=rf(n0);function n0(e,t){return e&&e.length&&t&&t.length?rd(e,t):e}var n1=na(function(e,t){var i=null==e?0:e.length,r=iM(e,t);return rc(e,tm(t,function(e){return nw(e,i)?+e:e}).sort(rj)),r});function n2(e){return null==e?e:t7.call(e)}var n4=rf(function(e){return rC(iW(e,1,sq,!0))}),n8=rf(function(e){var t=nJ(e);return sq(t)&&(t=r),rC(iW(e,1,sq,!0),nh(t,2))}),n3=rf(function(e){var t=nJ(e);return t="function"==typeof t?t:r,rC(iW(e,1,sq,!0),r,t)});function n5(e){if(!(e&&e.length))return[];var t=0;return e=th(e,function(e){if(sq(e))return t=t4(e.length,t),!0}),tO(t,function(t){return tm(e,tx(t))})}function n6(e,t){if(!(e&&e.length))return[];var i=n5(e);return null==t?i:tm(i,function(e){return tl(t,r,e)})}var n7=rf(function(e,t){return sq(e)?ij(e,t):[]}),n9=rf(function(e){return rA(th(e,sq))}),se=rf(function(e){var t=nJ(e);return sq(t)&&(t=r),rA(th(e,sq),nh(t,2))}),st=rf(function(e){var t=nJ(e);return t="function"==typeof t?t:r,rA(th(e,sq),r,t)}),si=rf(n5),sr=rf(function(e){var t=e.length,i=t>1?e[t-1]:r;return i="function"==typeof i?(e.pop(),i):r,n6(e,i)});function sn(e){var t=iy(e);return t.__chain__=!0,t}function ss(e,t){return t(e)}var sa=na(function(e){var t=e.length,i=t?e[0]:0,n=this.__wrapped__,s=function(t){return iM(t,e)};return!(t>1)&&!this.__actions__.length&&n instanceof iT&&nw(i)?((n=n.slice(i,+i+ +!!t)).__actions__.push({func:ss,args:[s],thisArg:r}),new ib(n,this.__chain__).thru(function(e){return t&&!e.length&&e.push(r),e})):this.thru(s)}),so=rV(function(e,t,i){eP.call(e,i)?++e[i]:iN(e,i,1)}),sl=rJ(nV),su=rJ(nW);function sd(e,t){return(sU(e)?td:iq)(e,nh(t,3))}function sc(e,t){return(sU(e)?function(e,t){for(var i=null==e?0:e.length;i--&&!1!==t(e[i],i,e););return e}:iF)(e,nh(t,3))}var sh=rV(function(e,t,i){eP.call(e,i)?e[i].push(t):iN(e,i,[t])}),sp=rf(function(e,t,i){var r=-1,n="function"==typeof t,s=sj(e)?e_(e.length):[];return iq(e,function(e){s[++r]=n?tl(t,e,i):i3(e,t,i)}),s}),sf=rV(function(e,t,i){iN(e,i,t)});function sm(e,t){return(sU(e)?tm:rr)(e,nh(t,3))}var sg=rV(function(e,t,i){e[+!i].push(t)},function(){return[[],[]]}),sy=rf(function(e,t){if(null==e)return[];var i=t.length;return i>1&&nS(e,t[0],t[1])?t=[]:i>2&&nS(t[0],t[1],t[2])&&(t=[t[0]]),rl(e,iW(t,1),[])}),sv=tt||function(){return e5.Date.now()};function s_(e,t,i){return t=i?r:t,t=e&&null==t?e.length:t,nt(e,128,r,r,r,r,t)}
1function sb(e,t){var i;if("function"!=typeof t)throw new ex(n);return e=s7(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=r),i}}var sT=rf(function(e,t,i){var r=1;if(i.length){var n=tz(i,nc(sT));r|=32}return nt(e,r,t,i,n)}),sw=rf(function(e,t,i){var r=3;if(i.length){var n=tz(i,nc(sw));r|=32}return nt(t,r,e,i,n)});function sS(e,t,i){t=i?r:t;var n=nt(e,8,r,r,r,r,r,t);return n.placeholder=sS.placeholder,n}function sE(e,t,i){t=i?r:t;var n=nt(e,16,r,r,r,r,r,t);return n.placeholder=sE.placeholder,n}function sC(e,t,i){var s,a,o,l,u,d,c=0,h=!1,p=!1,f=!0;if("function"!=typeof e)throw new ex(n);function m(t){var i=s,n=a;return s=a=r,c=t,l=e.apply(n,i)}function g(e){var i=e-d,n=e-c;return r===d||i>=t||i<0||p&&n>=o}function y(){var e,i,r,n=sv();if(g(n))return v(n);u=nP(y,(e=n-d,i=n-c,r=t-e,p?t8(r,o-i):r))}function v(e){return(u=r,f&&s)?m(e):(s=a=r,l)}function _(){var e,i=sv(),n=g(i);if(s=arguments,a=this,d=i,n){if(r===u)return c=e=d,u=nP(y,t),h?m(e):l;if(p)return rR(u),u=nP(y,t),m(d)}return r===u&&(u=nP(y,t)),l}return t=ae(t)||0,sX(i)&&(h=!!i.leading,o=(p="maxWait"in i)?t4(ae(i.maxWait)||0,t):o,f="trailing"in i?!!i.trailing:f),_.cancel=function(){r!==u&&rR(u),c=0,s=d=a=u=r},_.flush=function(){return r===u?l:v(sv())},_}var sk=rf(function(e,t){return iB(e,1,t)}),sx=rf(function(e,t,i){return iB(e,ae(t)||0,i)});function sD(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new ex(n);var i=function(){var r=arguments,n=t?t.apply(this,r):r[0],s=i.cache;if(s.has(n))return s.get(n);var a=e.apply(this,r);return i.cache=s.set(n,a)||s,a};return i.cache=new(sD.Cache||iE),i}function sI(e){if("function"!=typeof e)throw new ex(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}sD.Cache=iE;var sA=rf(function(e,t){var i=(t=1==t.length&&sU(t[0])?tm(t[0],tP(nh())):tm(iW(t,1),tP(nh()))).length;return rf(function(r){for(var n=-1,s=t8(r.length,i);++n<s;)r[n]=t[n].call(this,r[n]);return tl(e,this,r)})}),sO=rf(function(e,t){var i=tz(t,nc(sO));return nt(e,32,r,t,i)}),sL=rf(function(e,t){var i=tz(t,nc(sL));return nt(e,64,r,t,i)}),sP=na(function(e,t){return nt(e,256,r,r,r,t)});function sN(e,t){return e===t||e!=e&&t!=t}var sM=r5(i1),sR=r5(function(e,t){return e>=t}),s$=i5(function(){return arguments}())?i5:function(e){return sY(e)&&eP.call(e,"callee")&&!eY.call(e,"callee")},sU=e_.isArray,sB=ti?tP(ti):function(e){return sY(e)&&i0(e)==k};function sj(e){return null!=e&&sG(e.length)&&!sV(e)}function sq(e){return sY(e)&&sj(e)}var sF=tZ||a0,sH=tr?tP(tr):function(e){return sY(e)&&i0(e)==p};function sz(e){if(!sY(e))return!1;var t=i0(e);return t==f||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!sJ(e)}function sV(e){if(!sX(e))return!1;var t=i0(e);return t==m||t==g||"[object AsyncFunction]"==t||"[object Proxy]"==t}function sW(e){return"number"==typeof e&&e==s7(e)}function sG(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=0x1fffffffffffff}function sX(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function sY(e){return null!=e&&"object"==typeof e}var sK=tn?tP(tn):function(e){return sY(e)&&nv(e)==y};function sQ(e){return"number"==typeof e||sY(e)&&i0(e)==v}function sJ(e){if(!sY(e)||i0(e)!=_)return!1;var t=ez(e);if(null===t)return!0;var i=eP.call(t,"constructor")&&t.constructor;return"function"==typeof i&&i instanceof i&&eL.call(i)==e$}var sZ=ts?tP(ts):function(e){return sY(e)&&i0(e)==T},s0=ta?tP(ta):function(e){return sY(e)&&nv(e)==w};function s1(e){return"string"==typeof e||!sU(e)&&sY(e)&&i0(e)==S}function s2(e){return"symbol"==typeof e||sY(e)&&i0(e)==E}var s4=to?tP(to):function(e){return sY(e)&&sG(e.length)&&!!eZ[i0(e)]},s8=r5(ri),s3=r5(function(e,t){return e<=t});function s5(e){if(!e)return[];if(sj(e))return s1(e)?tG(e):rH(e);if(e3&&e[e3]){for(var t,i=e[e3](),r=[];!(t=i.next()).done;)r.push(t.value);return r}var n=nv(e);return(n==y?tF:n==w?tV:aE)(e)}function s6(e){return e?(e=ae(e))===o||e===-o?(e<0?-1:1)*17976931348623157e292:e==e?e:0:0===e?e:0}function s7(e){var t=s6(e),i=t%1;return t==t?i?t-i:t:0}function s9(e){return e?iR(s7(e),0,0xffffffff):0}function ae(e){if("number"==typeof e)return e;if(s2(e))return l;if(sX(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=sX(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=tL(e);var i=ed.test(e);return i||eh.test(e)?e4(e.slice(2),i?2:8):eu.test(e)?l:+e}function at(e){return rz(e,ag(e))}function ai(e){return null==e?"":rE(e)}var ar=rW(function(e,t){if(nx(t)||sj(t))return void rz(t,am(t),e);for(var i in t)eP.call(t,i)&&iA(e,i,t[i])}),an=rW(function(e,t){rz(t,ag(t),e)}),as=rW(function(e,t,i,r){rz(t,ag(t),e,r)}),aa=rW(function(e,t,i,r){rz(t,am(t),e,r)}),ao=na(iM),al=rf(function(e,t){e=eE(e);var i=-1,n=t.length,s=n>2?t[2]:r;for(s&&nS(t[0],t[1],s)&&(n=1);++i<n;)for(var a=t[i],o=ag(a),l=-1,u=o.length;++l<u;){var d=o[l],c=e[d];(r===c||sN(c,eA[d])&&!eP.call(e,d))&&(e[d]=a[d])}return e}),au=rf(function(e){return e.push(r,nr),tl(av,r,e)});function ad(e,t,i){var n=null==e?r:iJ(e,t);return r===n?i:n}function ac(e,t){return null!=e&&n_(e,t,i4)}var ah=r1(function(e,t,i){null!=t&&"function"!=typeof t.toString&&(t=eR.call(t)),e[t]=i},aU(aq)),ap=r1(function(e,t,i){null!=t&&"function"!=typeof t.toString&&(t=eR.call(t)),eP.call(e,t)?e[t].push(i):e[t]=[i]},nh),af=rf(i3);function am(e){return sj(e)?ix(e):rt(e)}function ag(e){return sj(e)?ix(e,!0):function(e){if(!sX(e)){var t=e,i=[];if(null!=t)for(var r in eE(t))i.push(r);return i}var n=nx(e),s=[];for(var a in e)"constructor"==a&&(n||!eP.call(e,a))||s.push(a);return s}(e)}var ay=rW(function(e,t,i){ra(e,t,i)}),av=rW(function(e,t,i,r){ra(e,t,i,r)}),a_=na(function(e,t){var i={};if(null==e)return i;var r=!1;t=tm(t,function(t){return t=rN(t,e),r||(r=t.length>1),t}),rz(e,nl(e),i),r&&(i=i$(i,7,nn));for(var n=t.length;n--;)rk(i,t[n]);return i}),ab=na(function(e,t){return null==e?{}:ru(e,t,function(t,i){return ac(e,i)})});function aT(e,t){if(null==e)return{};var i=tm(nl(e),function(e){return[e]});return t=nh(t),ru(e,i,function(e,i){return t(e,i[0])})}var aw=ne(am),aS=ne(ag);function aE(e){return null==e?[]:tN(e,am(e))}var aC=rK(function(e,t,i){return t=t.toLowerCase(),e+(i?ak(t):t)});function ak(e){return aN(ai(e).toLowerCase())}function ax(e){return(e=ai(e))&&e.replace(ef,tU).replace(eW,"")}var aD=rK(function(e,t,i){return e+(i?"-":"")+t.toLowerCase()}),aI=rK(function(e,t,i){return e+(i?" ":"")+t.toLowerCase()}),aA=rY("toLowerCase"),aO=rK(function(e,t,i){return e+(i?"_":"")+t.toLowerCase()}),aL=rK(function(e,t,i){return e+(i?" ":"")+aN(t)}),aP=rK(function(e,t,i){return e+(i?" ":"")+t.toUpperCase()}),aN=rY("toUpperCase");function aM(e,t,i){if(e=ai(e),t=i?r:t,r===t){var n;return(n=e,eK.test(n))?e.match(eX)||[]:e.match(en)||[]}return e.match(t)||[]}var aR=rf(function(e,t){try{return tl(e,r,t)}catch(e){return sz(e)?e:new eT(e)}}),a$=na(function(e,t){return td(t,function(t){iN(e,t=nB(t),sT(e[t],e))}),e});function aU(e){return function(){return e}}var aB=rZ(),aj=rZ(!0);function aq(e){return e}function aF(e){return re("function"==typeof e?e:i$(e,1))}var aH=rf(function(e,t){return function(i){return i3(i,e,t)}}),az=rf(function(e,t){return function(i){return i3(e,i,t)}});function aV(e,t,i){var r=am(t),n=iQ(t,r);null!=i||sX(t)&&(n.length||!r.length)||(i=t,t=e,e=this,n=iQ(t,am(t)));var s=!(sX(i)&&"chain"in i)||!!i.chain,a=sV(e);return td(n,function(i){var r=t[i];e[i]=r,a&&(e.prototype[i]=function(){var t=this.__chain__;if(s||t){var i=e(this.__wrapped__);return(i.__actions__=rH(this.__actions__)).push({func:r,args:arguments,thisArg:e}),i.__chain__=t,i}return r.apply(e,tg([this.value()],arguments))})}),e}function aW(){}var aG=r4(tm),aX=r4(tc),aY=r4(t_);function aK(e){return nE(e)?tx(nB(e)):function(t){return iJ(t,e)}}var aQ=r3(),aJ=r3(!0);function aZ(){return[]}function a0(){return!1}var a1=r2(function(e,t){return e+t},0),a2=r7("ceil"),a4=r2(function(e,t){return e/t},1),a8=r7("floor"),a3=r2(function(e,t){return e*t},1),a5=r7("round"),a6=r2(function(e,t){return e-t},0);return iy.after=function(e,t){if("function"!=typeof t)throw new ex(n);return e=s7(e),function(){if(--e<1)return t.apply(this,arguments)}},iy.ary=s_,iy.assign=ar,iy.assignIn=an,iy.assignInWith=as,iy.assignWith=aa,iy.at=ao,iy.before=sb,iy.bind=sT,iy.bindAll=a$,iy.bindKey=sw,iy.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return sU(e)?e:[e]},iy.chain=sn,iy.chunk=function(e,t,i){t=(i?nS(e,t,i):r===t)?1:t4(s7(t),0);var n=null==e?0:e.length;if(!n||t<1)return[];for(var s=0,a=0,o=e_(tD(n/t));s<n;)o[a++]=rv(e,s,s+=t);return o},iy.compact=function(e){for(var t=-1,i=null==e?0:e.length,r=0,n=[];++t<i;){var s=e[t];s&&(n[r++]=s)}return n},iy.concat=function(){var e=arguments.length;if(!e)return[];for(var t=e_(e-1),i=arguments[0],r=e;r--;)t[r-1]=arguments[r];return tg(sU(i)?rH(i):[i],iW(t,1))},iy.cond=function(e){var t=null==e?0:e.length,i=nh();
vendor: 14,115 bytes, line 1
1return e=t?tm(e,function(e){if("function"!=typeof e[1])throw new ex(n);return[i(e[0]),e[1]]}):[],rf(function(i){for(var r=-1;++r<t;){var n=e[r];if(tl(n[0],this,i))return tl(n[1],this,i)}})},iy.conforms=function(e){var t,i;return i=am(t=i$(e,1)),function(e){return iU(e,t,i)}},iy.constant=aU,iy.countBy=so,iy.create=function(e,t){var i=iv(e);return null==t?i:iP(i,t)},iy.curry=sS,iy.curryRight=sE,iy.debounce=sC,iy.defaults=al,iy.defaultsDeep=au,iy.defer=sk,iy.delay=sx,iy.difference=nF,iy.differenceBy=nH,iy.differenceWith=nz,iy.drop=function(e,t,i){var n=null==e?0:e.length;return n?rv(e,(t=i||r===t?1:s7(t))<0?0:t,n):[]},iy.dropRight=function(e,t,i){var n=null==e?0:e.length;return n?rv(e,0,(t=n-(t=i||r===t?1:s7(t)))<0?0:t):[]},iy.dropRightWhile=function(e,t){return e&&e.length?rD(e,nh(t,3),!0,!0):[]},iy.dropWhile=function(e,t){return e&&e.length?rD(e,nh(t,3),!0):[]},iy.fill=function(e,t,i,n){var s=null==e?0:e.length;if(!s)return[];i&&"number"!=typeof i&&nS(e,t,i)&&(i=0,n=s);var a=i,o=n,l=e.length;for((a=s7(a))<0&&(a=-a>l?0:l+a),(o=r===o||o>l?l:s7(o))<0&&(o+=l),o=a>o?0:s9(o);a<o;)e[a++]=t;return e},iy.filter=function(e,t){return(sU(e)?th:iV)(e,nh(t,3))},iy.flatMap=function(e,t){return iW(sm(e,t),1)},iy.flatMapDeep=function(e,t){return iW(sm(e,t),o)},iy.flatMapDepth=function(e,t,i){return i=r===i?1:s7(i),iW(sm(e,t),i)},iy.flatten=nG,iy.flattenDeep=function(e){return(null==e?0:e.length)?iW(e,o):[]},iy.flattenDepth=function(e,t){return(null==e?0:e.length)?iW(e,t=r===t?1:s7(t)):[]},iy.flip=function(e){return nt(e,512)},iy.flow=aB,iy.flowRight=aj,iy.fromPairs=function(e){for(var t=-1,i=null==e?0:e.length,r={};++t<i;){var n=e[t];r[n[0]]=n[1]}return r},iy.functions=function(e){return null==e?[]:iQ(e,am(e))},iy.functionsIn=function(e){return null==e?[]:iQ(e,ag(e))},iy.groupBy=sh,iy.initial=function(e){return(null==e?0:e.length)?rv(e,0,-1):[]},iy.intersection=nY,iy.intersectionBy=nK,iy.intersectionWith=nQ,iy.invert=ah,iy.invertBy=ap,iy.invokeMap=sp,iy.iteratee=aF,iy.keyBy=sf,iy.keys=am,iy.keysIn=ag,iy.map=sm,iy.mapKeys=function(e,t){var i={};return t=nh(t,3),iY(e,function(e,r,n){iN(i,t(e,r,n),e)}),i},iy.mapValues=function(e,t){var i={};return t=nh(t,3),iY(e,function(e,r,n){iN(i,r,t(e,r,n))}),i},iy.matches=function(e){return rn(i$(e,1))},iy.matchesProperty=function(e,t){return rs(e,i$(t,1))},iy.memoize=sD,iy.merge=ay,iy.mergeWith=av,iy.method=aH,iy.methodOf=az,iy.mixin=aV,iy.negate=sI,iy.nthArg=function(e){return e=s7(e),rf(function(t){return ro(t,e)})},iy.omit=a_,iy.omitBy=function(e,t){return aT(e,sI(nh(t)))},iy.once=function(e){return sb(2,e)},iy.orderBy=function(e,t,i,n){return null==e?[]:(sU(t)||(t=null==t?[]:[t]),sU(i=n?r:i)||(i=null==i?[]:[i]),rl(e,t,i))},iy.over=aG,iy.overArgs=sA,iy.overEvery=aX,iy.overSome=aY,iy.partial=sO,iy.partialRight=sL,iy.partition=sg,iy.pick=ab,iy.pickBy=aT,iy.property=aK,iy.propertyOf=function(e){return function(t){return null==e?r:iJ(e,t)}},iy.pull=nZ,iy.pullAll=n0,iy.pullAllBy=function(e,t,i){return e&&e.length&&t&&t.length?rd(e,t,nh(i,2)):e},iy.pullAllWith=function(e,t,i){return e&&e.length&&t&&t.length?rd(e,t,r,i):e},iy.pullAt=n1,iy.range=aQ,iy.rangeRight=aJ,iy.rearg=sP,iy.reject=function(e,t){return(sU(e)?th:iV)(e,sI(nh(t,3)))},iy.remove=function(e,t){var i=[];if(!(e&&e.length))return i;var r=-1,n=[],s=e.length;for(t=nh(t,3);++r<s;){var a=e[r];t(a,r,e)&&(i.push(a),n.push(r))}return rc(e,n),i},iy.rest=function(e,t){if("function"!=typeof e)throw new ex(n);return rf(e,t=r===t?t:s7(t))},iy.reverse=n2,iy.sampleSize=function(e,t,i){return t=(i?nS(e,t,i):r===t)?1:s7(t),(sU(e)?function(e,t){return n$(rH(e),iR(t,0,e.length))}:function(e,t){var i=aE(e);return n$(i,iR(t,0,i.length))})(e,t)},iy.set=function(e,t,i){return null==e?e:rm(e,t,i)},iy.setWith=function(e,t,i,n){return n="function"==typeof n?n:r,null==e?e:rm(e,t,i,n)},iy.shuffle=function(e){return(sU(e)?function(e){return n$(rH(e))}:function(e){return n$(aE(e))})(e)},iy.slice=function(e,t,i){var n=null==e?0:e.length;return n?(i&&"number"!=typeof i&&nS(e,t,i)?(t=0,i=n):(t=null==t?0:s7(t),i=r===i?n:s7(i)),rv(e,t,i)):[]},iy.sortBy=sy,iy.sortedUniq=function(e){return e&&e.length?rw(e):[]},iy.sortedUniqBy=function(e,t){return e&&e.length?rw(e,nh(t,2)):[]},iy.split=function(e,t,i){return(i&&"number"!=typeof i&&nS(e,t,i)&&(t=i=r),i=r===i?0xffffffff:i>>>0)?(e=ai(e))&&("string"==typeof t||null!=t&&!sZ(t))&&!(t=rE(t))&&tq(e)?rM(tG(e),0,i):e.split(t,i):[]},iy.spread=function(e,t){if("function"!=typeof e)throw new ex(n);return t=null==t?0:t4(s7(t),0),rf(function(i){var r=i[t],n=rM(i,0,t);return r&&tg(n,r),tl(e,this,n)})},iy.tail=function(e){var t=null==e?0:e.length;return t?rv(e,1,t):[]},iy.take=function(e,t,i){return e&&e.length?rv(e,0,(t=i||r===t?1:s7(t))<0?0:t):[]},iy.takeRight=function(e,t,i){var n=null==e?0:e.length;return n?rv(e,(t=n-(t=i||r===t?1:s7(t)))<0?0:t,n):[]},iy.takeRightWhile=function(e,t){return e&&e.length?rD(e,nh(t,3),!1,!0):[]},iy.takeWhile=function(e,t){return e&&e.length?rD(e,nh(t,3)):[]},iy.tap=function(e,t){return t(e),e},iy.throttle=function(e,t,i){var r=!0,s=!0;if("function"!=typeof e)throw new ex(n);return sX(i)&&(r="leading"in i?!!i.leading:r,s="trailing"in i?!!i.trailing:s),sC(e,t,{leading:r,maxWait:t,trailing:s})},iy.thru=ss,iy.toArray=s5,iy.toPairs=aw,iy.toPairsIn=aS,iy.toPath=function(e){return sU(e)?tm(e,nB):s2(e)?[e]:rH(nU(ai(e)))},iy.toPlainObject=at,iy.transform=function(e,t,i){var r=sU(e),n=r||sF(e)||s4(e);if(t=nh(t,4),null==i){var s=e&&e.constructor;i=n?r?new s:[]:sX(e)&&sV(s)?iv(ez(e)):{}}return(n?td:iY)(e,function(e,r,n){return t(i,e,r,n)}),i},iy.unary=function(e){return s_(e,1)},iy.union=n4,iy.unionBy=n8,iy.unionWith=n3,iy.uniq=function(e){return e&&e.length?rC(e):[]},iy.uniqBy=function(e,t){return e&&e.length?rC(e,nh(t,2)):[]},iy.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?rC(e,r,t):[]},iy.unset=function(e,t){return null==e||rk(e,t)},iy.unzip=n5,iy.unzipWith=n6,iy.update=function(e,t,i){return null==e?e:rx(e,t,rP(i))},iy.updateWith=function(e,t,i,n){return n="function"==typeof n?n:r,null==e?e:rx(e,t,rP(i),n)},iy.values=aE,iy.valuesIn=function(e){return null==e?[]:tN(e,ag(e))},iy.without=n7,iy.words=aM,iy.wrap=function(e,t){return sO(rP(t),e)},iy.xor=n9,iy.xorBy=se,iy.xorWith=st,iy.zip=si,iy.zipObject=function(e,t){return rO(e||[],t||[],iA)},iy.zipObjectDeep=function(e,t){return rO(e||[],t||[],rm)},iy.zipWith=sr,iy.entries=aw,iy.entriesIn=aS,iy.extend=an,iy.extendWith=as,aV(iy,iy),iy.add=a1,iy.attempt=aR,iy.camelCase=aC,iy.capitalize=ak,iy.ceil=a2,iy.clamp=function(e,t,i){return r===i&&(i=t,t=r),r!==i&&(i=(i=ae(i))==i?i:0),r!==t&&(t=(t=ae(t))==t?t:0),iR(ae(e),t,i)},iy.clone=function(e){return i$(e,4)},iy.cloneDeep=function(e){return i$(e,5)},iy.cloneDeepWith=function(e,t){return i$(e,5,t="function"==typeof t?t:r)},iy.cloneWith=function(e,t){return i$(e,4,t="function"==typeof t?t:r)},iy.conformsTo=function(e,t){return null==t||iU(e,t,am(t))},iy.deburr=ax,iy.defaultTo=function(e,t){return null==e||e!=e?t:e},iy.divide=a4,iy.endsWith=function(e,t,i){e=ai(e),t=rE(t);var n=e.length,s=i=r===i?n:iR(s7(i),0,n);return(i-=t.length)>=0&&e.slice(i,s)==t},iy.eq=sN,iy.escape=function(e){return(e=ai(e))&&z.test(e)?e.replace(F,tB):e},iy.escapeRegExp=function(e){return(e=ai(e))&&J.test(e)?e.replace(Q,"\\$&"):e},iy.every=function(e,t,i){var n=sU(e)?tc:iH;return i&&nS(e,t,i)&&(t=r),n(e,nh(t,3))},iy.find=sl,iy.findIndex=nV,iy.findKey=function(e,t){return tT(e,nh(t,3),iY)},iy.findLast=su,iy.findLastIndex=nW,iy.findLastKey=function(e,t){return tT(e,nh(t,3),iK)},iy.floor=a8,iy.forEach=sd,iy.forEachRight=sc,iy.forIn=function(e,t){return null==e?e:iG(e,nh(t,3),ag)},iy.forInRight=function(e,t){return null==e?e:iX(e,nh(t,3),ag)},iy.forOwn=function(e,t){return e&&iY(e,nh(t,3))},iy.forOwnRight=function(e,t){return e&&iK(e,nh(t,3))},iy.get=ad,iy.gt=sM,iy.gte=sR,iy.has=function(e,t){return null!=e&&n_(e,t,i2)},iy.hasIn=ac,iy.head=nX,iy.identity=aq,iy.includes=function(e,t,i,r){e=sj(e)?e:aE(e),i=i&&!r?s7(i):0;var n=e.length;return i<0&&(i=t4(n+i,0)),s1(e)?i<=n&&e.indexOf(t,i)>-1:!!n&&tS(e,t,i)>-1},iy.indexOf=function(e,t,i){var r=null==e?0:e.length;if(!r)return -1;var n=null==i?0:s7(i);return n<0&&(n=t4(r+n,0)),tS(e,t,n)},iy.inRange=function(e,t,i){var n,s,a;return t=s6(t),r===i?(i=t,t=0):i=s6(i),(n=e=ae(e))>=t8(s=t,a=i)&&n<t4(s,a)},iy.invoke=af,iy.isArguments=s$,iy.isArray=sU,iy.isArrayBuffer=sB,iy.isArrayLike=sj,iy.isArrayLikeObject=sq,iy.isBoolean=function(e){return!0===e||!1===e||sY(e)&&i0(e)==h},iy.isBuffer=sF,iy.isDate=sH,iy.isElement=function(e){return sY(e)&&1===e.nodeType&&!sJ(e)},iy.isEmpty=function(e){if(null==e)return!0;if(sj(e)&&(sU(e)||"string"==typeof e||"function"==typeof e.splice||sF(e)||s4(e)||s$(e)))return!e.length;var t=nv(e);if(t==y||t==w)return!e.size;if(nx(e))return!rt(e).length;for(var i in e)if(eP.call(e,i))return!1;return!0},iy.isEqual=function(e,t){return i6(e,t)},iy.isEqualWith=function(e,t,i){var n=(i="function"==typeof i?i:r)?i(e,t):r;return r===n?i6(e,t,r,i):!!n},iy.isError=sz,iy.isFinite=function(e){return"number"==typeof e&&t0(e)},iy.isFunction=sV,iy.isInteger=sW,iy.isLength=sG,iy.isMap=sK,iy.isMatch=function(e,t){return e===t||i7(e,t,nf(t))},iy.isMatchWith=function(e,t,i){return i="function"==typeof i?i:r,i7(e,t,nf(t),i)},iy.isNaN=function(e){return sQ(e)&&e!=+e},iy.isNative=function(e){if(nk(e))throw new eT("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return i9(e)},iy.isNil=function(e){return null==e},iy.isNull=function(e){return null===e},iy.isNumber=sQ,iy.isObject=sX,iy.isObjectLike=sY,iy.isPlainObject=sJ,iy.isRegExp=sZ,iy.isSafeInteger=function(e){return sW(e)&&e>=-0x1fffffffffffff&&e<=0x1fffffffffffff},iy.isSet=s0,iy.isString=s1,iy.isSymbol=s2,iy.isTypedArray=s4,iy.isUndefined=function(e){return r===e},iy.isWeakMap=function(e){return sY(e)&&nv(e)==C},iy.isWeakSet=function(e){return sY(e)&&"[object WeakSet]"==i0(e)},iy.join=function(e,t){return null==e?"":t1.call(e,t)},iy.kebabCase=aD,iy.last=nJ,iy.lastIndexOf=function(e,t,i){var n=null==e?0:e.length;if(!n)return -1;var s=n;return r!==i&&(s=(s=s7(i))<0?t4(n+s,0):t8(s,n-1)),t==t?function(e,t,i){for(var r=i+1;r--&&e[r]!==t;);return r}(e,t,s):tw(e,tC,s,!0)},iy.lowerCase=aI,iy.lowerFirst=aA,iy.lt=s8,iy.lte=s3,iy.max=function(e){return e&&e.length?iz(e,aq,i1):r},iy.maxBy=function(e,t){return e&&e.length?iz(e,nh(t,2),i1):r},iy.mean=function(e){return tk(e,aq)},iy.meanBy=function(e,t){return tk(e,nh(t,2))},iy.min=function(e){return e&&e.length?iz(e,aq,ri):r},iy.minBy=function(e,t){return e&&e.length?iz(e,nh(t,2),ri):r},iy.stubArray=aZ,iy.stubFalse=a0,iy.stubObject=function(){return{}},iy.stubString=function(){return""},iy.stubTrue=function(){return!0},iy.multiply=a3,iy.nth=function(e,t){return e&&e.length?ro(e,s7(t)):r},iy.noConflict=function(){return e5._===this&&(e5._=eU),this},iy.noop=aW,iy.now=sv,iy.pad=function(e,t,i){e=ai(e);var r=(t=s7(t))?tW(e):0;if(!t||r>=t)return e;var n=(t-r)/2;return r8(tQ(n),i)+e+r8(tD(n),i)},iy.padEnd=function(e,t,i){e=ai(e);var r=(t=s7(t))?tW(e):0;return t&&r<t?e+r8(t-r,i):e},iy.padStart=function(e,t,i){e=ai(e);var r=(t=s7(t))?tW(e):0;return t&&r<t?r8(t-r,i)+e:e},iy.parseInt=function(e,t,i){return i||null==t?t=0:t&&(t*=1),t5(ai(e).replace(Z,""),t||0)},iy.random=function(e,t,i){if(i&&"boolean"!=typeof i&&nS(e,t,i)&&(t=i=r),r===i&&("boolean"==typeof t?(i=t,t=r):"boolean"==typeof e&&(i=e,e=r)),r===e&&r===t?(e=0,t=1):(e=s6(e),r===t?(t=e,e=0):t=s6(t)),e>t){var n=e;e=t,t=n}if(i||e%1||t%1){var s=t6();return t8(e+s*(t-e+e2("1e-"+((s+"").length-1))),t)}return rh(e,t)},iy.reduce=function(e,t,i){var r=sU(e)?ty:tI,n=arguments.length<3;return r(e,nh(t,4),i,n,iq)},iy.reduceRight=function(e,t,i){var r=sU(e)?tv:tI,n=arguments.length<3;return r(e,nh(t,4),i,n,iF)},iy.repeat=function(e,t,i){return t=(i?nS(e,t,i):r===t)?1:s7(t),rp(ai(e),t)},iy.replace=function(){var e=arguments,t=ai(e[0]);return e.length<3?t:t.replace(e[1],e[2])},iy.result=function(e,t,i){t=rN(t,e);var n=-1,s=t.length;for(s||(s=1,e=r);++n<s;){var a=null==e?r:e[nB(t[n])];r===a&&(n=s,a=i),e=sV(a)?a.call(e):a}return e},iy.round=a5,iy.runInContext=e,iy.sample=function(e){return(sU(e)?iD:function(e){return iD(aE(e))})(e)},iy.size=function(e){if(null==e)return 0;if(sj(e))return s1(e)?tW(e):e.length;var t=nv(e);return t==y||t==w?e.size:rt(e).length},iy.snakeCase=aO,iy.some=function(e,t,i){var n=sU(e)?t_:r_;return i&&nS(e,t,i)&&(t=r),n(e,nh(t,3))},iy.sortedIndex=function(e,t){return rb(e,t)},iy.sortedIndexBy=function(e,t,i){return rT(e,t,nh(i,2))},iy.sortedIndexOf=function(e,t){var i=null==e?0:e.length;if(i){var r=rb(e,t);if(r<i&&sN(e[r],t))return r}return -1},iy.sortedLastIndex=function(e,t){return rb(e,t,!0)},iy.sortedLastIndexBy=function(e,t,i){return rT(e,t,nh(i,2),!0)},iy.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var i=rb(e,t,!0)-1;if(sN(e[i],t))return i}return -1},iy.startCase=aL,iy.startsWith=function(e,t,i){return e=ai(e),i=null==i?0:iR(s7(i),0,e.length),t=rE(t),e.slice(i,i+t.length)==t},iy.subtract=a6,iy.sum=function(e){return e&&e.length?tA(e,aq):0},iy.sumBy=function(e,t){return e&&e.length?tA(e,nh(t,2)):0},iy.template=function(e,t,i){var n=iy.templateSettings;i&&nS(e,t,i)&&(t=r),e=ai(e),t=as({},t,n,ni);var s,a,o=as({},t.imports,n.imports,ni),l=am(o),u=tN(o,l),d=0,c=t.interpolate||em,h="__p += '",p=eC((t.escape||em).source+"|"+c.source+"|"+(c===G?eo:em).source+"|"+(t.evaluate||em).source+"|$","g"),f="//# sourceURL="+(eP.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++eJ+"]")+"\n";e.replace(p,function(t,i,r,n,o,l){return r||(r=n),h+=e.slice(d,l).replace(eg,tj),i&&(s=!0,h+="' +\n__e("+i+") +\n'"),o&&(a=!0,h+="';\n"+o+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),d=l+t.length,t}),h+="';\n";var m=eP.call(t,"variable")&&t.variable;if(m){if(es.test(m))throw new eT("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(a?h.replace(U,""):h).replace(B,"$1").replace(j,"$1;"),h="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(s?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";
1\n")+h+"return __p\n}";var g=aR(function(){return ew(l,f+"return "+h).apply(r,u)});if(g.source=h,sz(g))throw g;return g},iy.times=function(e,t){if((e=s7(e))<1||e>0x1fffffffffffff)return[];var i=0xffffffff,r=t8(e,0xffffffff);t=nh(t),e-=0xffffffff;for(var n=tO(r,t);++i<e;)t(i);return n},iy.toFinite=s6,iy.toInteger=s7,iy.toLength=s9,iy.toLower=function(e){return ai(e).toLowerCase()},iy.toNumber=ae,iy.toSafeInteger=function(e){return e?iR(s7(e),-0x1fffffffffffff,0x1fffffffffffff):0===e?e:0},iy.toString=ai,iy.toUpper=function(e){return ai(e).toUpperCase()},iy.trim=function(e,t,i){if((e=ai(e))&&(i||r===t))return tL(e);if(!e||!(t=rE(t)))return e;var n=tG(e),s=tG(t),a=tR(n,s),o=t$(n,s)+1;return rM(n,a,o).join("")},iy.trimEnd=function(e,t,i){if((e=ai(e))&&(i||r===t))return e.slice(0,tX(e)+1);if(!e||!(t=rE(t)))return e;var n=tG(e),s=t$(n,tG(t))+1;return rM(n,0,s).join("")},iy.trimStart=function(e,t,i){if((e=ai(e))&&(i||r===t))return e.replace(Z,"");if(!e||!(t=rE(t)))return e;var n=tG(e),s=tR(n,tG(t));return rM(n,s).join("")},iy.truncate=function(e,t){var i=30,n="...";if(sX(t)){var s="separator"in t?t.separator:s;i="length"in t?s7(t.length):i,n="omission"in t?rE(t.omission):n}var a=(e=ai(e)).length;if(tq(e)){var o=tG(e);a=o.length}if(i>=a)return e;var l=i-tW(n);if(l<1)return n;var u=o?rM(o,0,l).join(""):e.slice(0,l);if(r===s)return u+n;if(o&&(l+=u.length-l),sZ(s)){if(e.slice(l).search(s)){var d,c=u;for(s.global||(s=eC(s.source,ai(el.exec(s))+"g")),s.lastIndex=0;d=s.exec(c);)var h=d.index;u=u.slice(0,r===h?l:h)}}else if(e.indexOf(rE(s),l)!=l){var p=u.lastIndexOf(s);p>-1&&(u=u.slice(0,p))}return u+n},iy.unescape=function(e){return(e=ai(e))&&H.test(e)?e.replace(q,tY):e},iy.uniqueId=function(e){var t=++eN;return ai(e)+t},iy.upperCase=aP,iy.upperFirst=aN,iy.each=sd,iy.eachRight=sc,iy.first=nX,aV(iy,(ev={},iY(iy,function(e,t){eP.call(iy.prototype,t)||(ev[t]=e)}),ev),{chain:!1}),iy.VERSION="4.17.21",td(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){iy[e].placeholder=iy}),td(["drop","take"],function(e,t){iT.prototype[e]=function(i){i=r===i?1:t4(s7(i),0);var n=this.__filtered__&&!t?new iT(this):this.clone();return n.__filtered__?n.__takeCount__=t8(i,n.__takeCount__):n.__views__.push({size:t8(i,0xffffffff),type:e+(n.__dir__<0?"Right":"")}),n},iT.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),td(["filter","map","takeWhile"],function(e,t){var i=t+1,r=1==i||3==i;iT.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:nh(e,3),type:i}),t.__filtered__=t.__filtered__||r,t}}),td(["head","last"],function(e,t){var i="take"+(t?"Right":"");iT.prototype[e]=function(){return this[i](1).value()[0]}}),td(["initial","tail"],function(e,t){var i="drop"+(t?"":"Right");iT.prototype[e]=function(){return this.__filtered__?new iT(this):this[i](1)}}),iT.prototype.compact=function(){return this.filter(aq)},iT.prototype.find=function(e){return this.filter(e).head()},iT.prototype.findLast=function(e){return this.reverse().find(e)},iT.prototype.invokeMap=rf(function(e,t){return"function"==typeof e?new iT(this):this.map(function(i){return i3(i,e,t)})}),iT.prototype.reject=function(e){return this.filter(sI(nh(e)))},iT.prototype.slice=function(e,t){e=s7(e);var i=this;return i.__filtered__&&(e>0||t<0)?new iT(i):(e<0?i=i.takeRight(-e):e&&(i=i.drop(e)),r!==t&&(i=(t=s7(t))<0?i.dropRight(-t):i.take(t-e)),i)},iT.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},iT.prototype.toArray=function(){return this.take(0xffffffff)},iY(iT.prototype,function(e,t){var i=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),s=iy[n?"take"+("last"==t?"Right":""):t],a=n||/^find/.test(t);s&&(iy.prototype[t]=function(){var t=this.__wrapped__,o=n?[1]:arguments,l=t instanceof iT,u=o[0],d=l||sU(t),c=function(e){var t=s.apply(iy,tg([e],o));return n&&h?t[0]:t};d&&i&&"function"==typeof u&&1!=u.length&&(l=d=!1);var h=this.__chain__,p=!!this.__actions__.length,f=a&&!h,m=l&&!p;if(!a&&d){t=m?t:new iT(this);var g=e.apply(t,o);return g.__actions__.push({func:ss,args:[c],thisArg:r}),new ib(g,h)}return f&&m?e.apply(this,o):(g=this.thru(c),f?n?g.value()[0]:g.value():g)})}),td(["pop","push","shift","sort","splice","unshift"],function(e){var t=eD[e],i=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);iy.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var n=this.value();return t.apply(sU(n)?n:[],e)}return this[i](function(i){return t.apply(sU(i)?i:[],e)})}}),iY(iT.prototype,function(e,t){var i=iy[t];if(i){var r=i.name+"";eP.call(io,r)||(io[r]=[]),io[r].push({name:t,func:i})}}),io[r0(r,2).name]=[{name:"wrapper",func:r}],iT.prototype.clone=function(){var e=new iT(this.__wrapped__);return e.__actions__=rH(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=rH(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=rH(this.__views__),e},iT.prototype.reverse=function(){if(this.__filtered__){var e=new iT(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e},iT.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,i=sU(e),r=t
1<0,n=i?e.length:0,s=function(e,t,i){for(var r=-1,n=i.length;++r<n;){var s=i[r],a=s.size;switch(s.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=t8(t,e+a);break;case"takeRight":e=t4(e,t-a)}}return{start:e,end:t}}(0,n,this.__views__),a=s.start,o=s.end,l=o-a,u=r?o:a-1,d=this.__iteratees__,c=d.length,h=0,p=t8(l,this.__takeCount__);if(!i||!r&&n==l&&p==l)return rI(e,this.__actions__);var f=[];e:for(;l--&&h<p;){for(var m=-1,g=e[u+=t];++m<c;){var y=d[m],v=y.iteratee,_=y.type,b=v(g);if(2==_)g=b;else if(!b)if(1==_)continue e;else break e}f[h++]=g}return f},iy.prototype.at=sa,iy.prototype.chain=function(){return sn(this)},iy.prototype.commit=function(){return new ib(this.value(),this.__chain__)},iy.prototype.next=function(){this.__values__===r&&(this.__values__=s5(this.value()));var e=this.__index__>=this.__values__.length,t=e?r:this.__values__[this.__index__++];return{done:e,value:t}},iy.prototype.plant=function(e){for(var t,i=this;i instanceof i_;){var n=nq(i);n.__index__=0,n.__values__=r,t?s.__wrapped__=n:t=n;var s=n;i=i.__wrapped__}return s.__wrapped__=e,t},iy.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof iT){var t=e;return this.__actions__.length&&(t=new iT(this)),(t=t.reverse()).__actions__.push({func:ss,args:[n2],thisArg:r}),new ib(t,this.__chain__)}return this.thru(n2)},iy.prototype.toJSON=iy.prototype.valueOf=iy.prototype.value=function(){return rI(this.__wrapped__,this.__actions__)},iy.prototype.first=iy.prototype.head,e3&&(iy.prototype[e3]=function(){return this}),iy}();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(e5._=tK,define(function(){return tK})):e7?((e7.exports=tK)._=tK,e6._=tK):e5._=tK}).call(this)},309:function(e){"use strict";function t(e){return setTimeout(function(){e.trigger("click")},window.brandSettings.toasterDuration||15e3)}let i=function(e){let i=e.find(".close, .close-toaster"),r=t(i);e.off("mouseenter").on("mouseenter",function(){clearTimeout(r)}),e.off("mouseleave").on("mouseleave",function(){r=t(i)})},r=function(e){e.removeClass("d-none"),setTimeout(function(){e.addClass("toaster-animate")},0)},n=function(e){e.addClass("closing"),setTimeout(()=>{e.removeClass("closing toaster-animate").addClass("d-none")},200)};e.exports={initToaster:function(e,t,s){e.on("click",function(){r(s)}),t.on("click",function(){n(s)}),i(s)},openToaster:r,closeToaster:n,closeToasterEvents:i,closeToasterTimeout:t}},9205:function(e){"use strict";let t=$("body");async function i(){let e=t.find(".pdp-image-carousel .pdp-image-item, .ldp-images .ldp-image-item"),i=[];e.each((e,r)=>{let n=parseInt(r.dataset.pswpWidth,10);if(n&&720!==n)return void t.trigger("product:pswImageLoaded");let s=new Promise(function(e){let i=new Image;i.src=$(r).attr("href"),i.onload=()=>{let n=i.width,s=i.height;if($(r).hasClass("pswp-wide-img")){let e=$("body").width();s=i.height*e/i.width/2,n=e/2}r.dataset.pswpWidth=n,r.dataset.pswpHeight=s,t.trigger("product:pswImageLoaded"),e()}});i.push(s)}),i.length>0&&await Promise.all(i)}e.exports={initZoomGallery:function(){i()}}},5047:function(e,t,i){"use strict";e.exports={isRegexPatternValid:(e,t)=>{let i=!1,r=null;try{r=new RegExp(e),i=!0}catch(e){i=!1}return!!i&&r.test(t)},createErrorNotification:e=>{var t=`
2        <div class="alert alert-danger alert-dismissible 'fade show" role="alert">
3            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
4                <span aria-hidden="true">&times;</span>
5            </button>
6            ${e}
7        </div>
8    `;$(".error-messaging").append(t)},detectConnection:()=>{let e=i(423);return new Promise(t=>{new e().then(e=>{t(e)})})},detectIOS:()=>/iPad|iPhone|iPod/.test(navigator.userAgent),isElementOffScreen:e=>{let t=e[0].getBoundingClientRect(),i=$("body");return t.x+t.width<0||t.y+t.height<0||t.x>i.innerWidth()||t.y>i.innerHeight()||t.x<0||t.right>i.innerWidth()}}},7049:function(e,t,i){"use strict";let{get:r,isEmpty:n}=i(6486),s=i(309),a={body:$("body")},o=()=>{a.$recommendedProductCarousel=a.body.find(".frequently-bought-together"),a.$recommendedProductCarousel.hasClass("slick-initialized")||a.$recommendedProductCarousel.slick({dots:!1,arrows:!0,infinite:!1,speed:200,touchThreshold:100,slidesToShow:2.5,slidesToScroll:1,nextArrow:'<button type="button" class="slick-next"><i class="icon icon-arrow-forward icon-size-xl"></i></button>',prevArrow:'<button type="button" class="slick-prev"><i class="icon icon-arrow-back icon-size-xl"></i></button>',responsive:[{breakpoint:window.app.grid.lg,settings:{slidesToShow:2.4,slidesToScroll:1}},{breakpoint:window.app.grid.md,settings:{slidesToShow:1.2,slidesToScroll:1}}]})};e.exports={methods:{initSuccessToaster:()=>{let e="";a.body.on("cart:addSuccessToaster",(t,i)=>{if(t.preventDefault(),t.stopImmediatePropagation(),$(".search-results").length>0)return;let l=!!r(i,"error"),u=r(i,"addedProductToaster",{});if(!n(u)&&!n(u.template)&&!l){let t=$(".product-add-to-cart-success-toaster");t.removeClass("d-none"),"AAL"===window.brandID&&setTimeout(function(){t.addClass("toaster-animate")},0),t.find(".add-to-cart-success-toaster-body").empty().append(u.template);let i=a.body.find(".toaster-backdrop");if(i.length?(i.addClass("show"),i.appendTo("body")):$(".wishlist-page-wrapper").length||a.body.append('<div class="toaster-backdrop modal-backdrop fade show"></div>'),"MTB"===window.brandID){o(),$(document).trigger("reloadConfirmationEinstein");var d,c=$(".einstein-pdp-title").val();$(".einstein-recommended-products-title").text(c);let e=$(".add-to-cart-success-recommendation").find(".reco-product-wrapper").length;$(".product-parentCategory-id").length&&"writing-instruments"!==$(".product-parentCategory-id").val()&&e>0&&$(".experience-component.experience-einstein-einsteinCarouselProduct.add-to-cart-success-recommendation").removeClass("d-none")}d=r(u,"details.atbLabel",""),t.find(".close-toaster").add(".toaster-backdrop").on("click",()=>{t.addClass("closing"),setTimeout(()=>{t.addClass("d-none").removeClass("closing toaster-animate")},window.brandSettings.toasterCloseDelay||0),a.body.find(".toaster-backdrop").remove(),a.body.find(".frequently-bought-together .product").each((e,t)=>{let i=$(t);i.find(".atb-msg-container").addClass("d-none"),i.find(".add-to-cart-global span").text(d)})}),s.closeToasterEvents(t),a.body.on("product:beforeAddToCart",(t,i)=>{e=$(i).attr("data-pid")}),a.body.on("updateAddToCartFormData",(t,i)=>{i.pid=e}),r(u,"details.shouldDisplayRecos")&&"MTB"!==window.brandID&&((e,t)=>{let i=$(".product-add-to-cart-success-toaster");i.spinner().start();let{displayRecosControllerUrl:s}=t;n(s)||$.ajax({url:s,method:"GET"}).then(n=>
8{n.success&&(i.removeClass("d-none"),i.find(".add-to-cart-success-toaster-body").append(n.template),o(),a.body.find(".frequently-bought-together .product").each((i,s)=>{let a=$(s),o=a.find(".add-to-cart-global"),l=r(n,"cart.items",[]).find(e=>e.id===a.attr("data-pid"));l&&r(l,"quantity")===r(l,"quantityOptions.maxOrderQuantity")&&o.attr("disabled",!0),a.attr("data-pid")===e&&(a.find(".atb-msg-container").removeClass("d-none"),o.find("span").text(r(t,"addOneMoreLabel","")))})),i.spinner().stop()}).catch(()=>{i.spinner().stop()})})(e,r(u,"details",{}))}}),a.body.on("removeProduct:success",function(){$(".product-add-to-cart-success-toaster .close-toaster").click()})},initWishlistToaster:()=>{if(0===$(".js-wishlist-with-toaster").length)return;let e=$(".remove-from-wishlist-modal"),t=$(".successful-add-to-wishlist-modal"),i=$(document);$(".remove-from-wishlist").on("click",function(){s.openToaster(e),s.closeToasterEvents(e)}),$(".remove-from-wishlist-modal .close, .remove-from-wishlist-modal .cancel-btn").on("click",function(){s.closeToaster(e)}),i.on("toasterWishlist:close",function(){s.closeToaster(e)}),i.on("toasterWishlist:open",function(){s.openToaster(t),s.closeToasterEvents(t)}),$(".close",t).on("click",function(){s.closeToaster(t)})}}}},1430:function(e,t,i){"use strict";let r=i(4493),n=i(8502);function s(e){return JSON.stringify(e.find(".product-option").map(function(){let e=$(this),t=e.find(".options-select"),i=t.val(),r=t.find('option[value="'+i+'"]').data("value-id");return{optionId:e.data("option-id"),selectedValueId:r}}).toArray())}var a=!1;if($("body").on("select2:select",'[data-attr="size"] select',function(){a=!0}),$("body").on("product:afterAttributeSelect",function(e,t){var i=t&&t.data&&t.data.product;if("MTB"===window.brandID&&window.app&&"function"==typeof window.app.isPDP&&window.app.isPDP()&&i&&i.hasColorAndSize){var r=$(".custom-select.form-control.select-size");if(r.length){if($(".color-attribute .color-size-variation").removeClass("selectable unselectable").addClass("selectable"),r.find("option:selected").length>0&&!a)return void r.prop("selectedIndex",-1).trigger("change");if(a){var n=!!(i.available&&i.readyToOrder);$(".color-size-variation.selected").removeClass("selectable unselectable").addClass(n?"selectable":"unselectable")}a=!1}}}),r.addToCart=function(){let e=$("body");$("body").off("click","button.add-to-cart, button.add-to-cart-global").on("click","button.add-to-cart, button.add-to-cart-global",function(t,i){let a=i?.triggeredBy||t.target,o=i?.stickyAtb||!1,l=$(this),u=n.validate(l,a),d=$(".attribute-size"),c=$(".swatch-value.selected",d);if(d.length&&!c.length)return void $(".select-size-error-msg").removeClass("d-none");if("CHL"===window.brandID){if(0===$("#modal-product-ajax").length&&e.hasClass("pdp-partial-loading")||!l.hasClass("js-add-to-cart"))return}else if(e.hasClass("pdp-partial-loading"))return;if(u)!0===o&&$(a).hasClass("floating-add-to-cart-btn")&&($(".error-msg").addClass("d-none"),$(".attribute label").removeClass("d-none"),$(".variations-overlay").removeClass("d-none")),$.spinner().stop(),t.stopPropagation(),t.stopImmediatePropagation();else{$(a).hasClass("sticky-add-to-cart")&&$(".variations-overlay").addClass("d-none"),e.addClass("pdp-partial-loading"),e.trigger("product:beforeAddToCart",this),$(".set-items").length&&l.hasClass("add-to-cart-global")&&(y=[],$(".product-detail").each(function(){let e=$(this);e.hasClass("product-set-detail")||y.push({pid:e.find(".product-id").text(),qty:e.find(".quantity-select").val(),options:s(e)})}),g=JSON.stringify(y)),m=$("#modal-product-ajax").length?$(l).closest("#modal
8-product-ajax").find(".product-detail").data("pid"):$("#quickViewModal").hasClass("show")&&!$(".product-set").length?$(l).closest(".modal-content").find(".product-quickview").data("pid"):$("#quickviewOverlaySlider").hasClass("active")&&!$(".product-set").length?$(l).data("pid"):$(".product-set-detail").length||$(".product-set").length?$(l).closest(".product-detail").find(".product-id").text():$('.product-detail:not(".bundle-item")').data("pid");var h,p,f,m,g,y,v,_=l.closest(".product-detail");_.length||(_=l.closest(".quick-view-dialog").find(".product-detail")),f=$(".add-to-cart-url").val(),v=$(".quickview-wrapper").hasClass("show")||$("#modal-product-ajax").length?1:r.getQuantitySelected(l);var b=l.data("pagelocation"),T=l.data("pagesticky"),w=!!sessionStorage.getItem("measmerize_recommendation")&&sessionStorage.getItem("measmerize_recommendation"),S={pid:m,pidsObj:g,childProducts:(h=[],$(".bundle-item").each(function(){let e=$(this);h.push({pid:e.find(".product-id").text(),quantity:parseInt(e.find("label.quantity").data("quantity"),10)})}),h.length?JSON.stringify(h):[]),quantity:v,charmProducts:(p=[],$(".slider-charms-popup .select-charm:checked").each(function(){let e=$(this);p.push({pid:e.data().charmId,quantity:parseInt(e.data().quantity,10)})}),p.length?JSON.stringify(p):[]),page_location:b,page_sticky:T,getMeasmerize:w};$(".bundle-item").length||(S.options=s(_)),l.trigger("updateAddToCartFormData",S),f&&$.ajax({url:f,method:"POST",data:S,success:function(t){if(t.error){let e="messages"in t?t.messages[0]:t.message;if(e){$(".quickview-wrapper.show .product-limit-modal").length&&($("body > .product-limit-modal").length||$(".quickview-wrapper.show .product-limit-modal").first().appendTo("body"),$(".quickview-wrapper, .modal-backdrop").remove());let t=$(".product-limit-modal").last();t.find(".modal-body").text(e),t.modal("show")}}else{e.trigger("cart:update",t),e.trigger("product:afterAddToCart",t),e.trigger("cart:addSuccessToaster",t);var i,n=sessionStorage.getItem("add_to_cart_event");sessionStorage.removeItem("add_to_cart_event"),sessionStorage.removeItem("measmerize_recommendation");let r=JSON.parse(n),s=$(".product-personalization-modal"),a=s.data("personalization-type");s.hasClass("show")&&r?.ecommerce?.items?.length>0&&("engraving"===a&&(r.ecommerce.items[0].item_engraved=!0),"embossing"===a&&(r.ecommerce.items[0].item_embossed=!0),r.ecommerce.items[0].item_personalized=!0),window.dataLayer?.push(r),"datalayer"in t&&t.datalayer&&$("body").trigger("gtm:add:event",t)}"dataLayerCart"in t&&t.dataLayerCart&&window.dataLayer?.push(t.dataLayerCart);for(var s=0;s<window.dataLayer?.length;s++)if(window.dataLayer[s].cart){window.dataLayer[s].cart=t.updatedCartData;break}$(".minicart").trigger("count:update",t),i=t.error?"alert-danger":"alert-success",t.newBonusDiscountLineItem&&0!==Object.keys(t.newBonusDiscountLineItem).length?r.methods.editBonusProducts.chooseBonusProducts(t.newBonusDiscountLineItem):(0===$(".add-to-cart-messages").length&&$("body").append('<div class="add-to-cart-messages"></div>'),$(".add-to-cart-messages").append('<div class="alert '+i+' add-to-basket-alert text-center" role="alert">'+t.message+"</div>"),setTimeout(function(){$(".add-to-basket-alert").remove()},5e3)),$.spinner().stop(),e.removeClass("pdp-partial-loading"),r.miniCartReportingUrl(t.reportingURL)},error:function(){$.spinner().stop(),e.removeClass("pdp-partial-loading")}})}}),e.on("product:afterAddToCart",function(t,i){if(i.error){let e=$(".product-limit-modal").last(),t=e.find(".modal-body");i.message?t.text(i.message):i.messages&&t.text(i.messages[0]),e.modal("show")}else e.trigger("minicart:update",i),$(".minicart-overlay-wrapper").addClass("mini-cart-close")})},r.openSizeSelectionDrawer=function(){if($(".pdp-right-wrapper").length&&$(".add-to-wishlist-form.bottom-wishlist-section").is(":visible")){let e=!1;return $(".pdp-right-wrapper .attributes .attribute label").each(function(){$(this).text().toLowerCase().includes("size")&&($(document).trigger("openSlider",{target:"#wishlist-size-selection-slider"}),e=!0)}),e}return!1},!function(){!window.sfmcIdTriggeredGlobal&&(window.sfmcIdTriggeredGlobal=!1,new MutationObserver(()=>{window.sfmcIdTriggeredGlobal||e()}).observe(document,{childList:!0,subtree:!0,once:!0}),window.sfmcIdTriggeredGlobal||e());function e(){if(window.sfmcIdTriggeredGlobal)return;let e=new URLSearchParams(window.location.search).get("sfmc_id");e?.length&&"dataLayer"in window&&window.dataLayer[0]&&(window.dataLayer[0].sfmc_id=e,window.sfmcIdTriggeredGlobal=!0)}}(),!window.triggeredCommFired){var o,l=d("utm_source"),u=(o=l)?o.toLowerCase().trim():"";"n/a"!==u&&-1!==["ot","all_customers","attentive","cybba","email","e-mail","triggered","trigger","triggeredemail","emailtriggered","triggeremail","emailtrigger","sms","mms"].indexOf(u)&&(window.triggeredCommFired=!0,window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"triggered_communication",reference:"rKPI_MTB_10",campaign_name:d("campaign_name"),utm_source:l,utm_medium:d("utm_medium"),utm_campaign:d("utm_campaign"),utm_content:d("utm_c
8ontent")}))}function d(e){return new URLSearchParams(window.location.search).get(e)||"N/A"}e.exports=r},4612:function(e,t,i){"use strict";var r=i(1430);let n=i(6600),s=i(7049),a=i(7059),o=i(9205),l=i(5047);var u=!1;function d(){return $('.js-preorder-message-slot[data-oms-preorder="true"]').length>0}function c(){if(!d())return;let e=$(".js-preorder-edd-trigger").first();if(0===e.length)return;let t={},i=e.data("csrf-token-name");i&&(t[i]=e.data("csrf-token")),$.ajax({url:e.data("action"),method:"POST",data:t,success:function(e){e&&e.renderedTemplate&&$(".js-preorder-message-slot .delivery-date-text-container").html(e.renderedTemplate)}})}function h(e){if(!e)return"";$(".attributes [data-attr*=color]").length&&(u=!0);let t=new URL(e);return u||t.searchParams.append("firstSelection","true"),$(".variations-overlay-content").is(":visible")&&t.searchParams.append("isOverlay","true"),$(".product-quickview").is(":visible")&&t.searchParams.append("enableQuickView","true"),t.searchParams.append("isPDP","true"),u=!0,t.toString()}n.removeEmptyDetailGroups=function(){$(".pdp-attr-group-wrapper .pdp-attr-group").each(function(){var e=$
8(this);e.find(".accordion-body").html()?.trim()?e.removeClass("d-none"):e.addClass("d-none")})},n.updateAttributesAndDetails=function(){$("body").on("product:statusUpdate",function(e,t){var i=$(".product-detail");let r=t.shortDescription,s=parseInt($(".char-limit-count").val(),10),a=i.find(".short-description"),o=r&&s>r.length;i.find(".long-description-wrapper .content, .long-description .content").html(t.longDescription),a.find(".content").toggleClass("truncate-text",!!s),a.find(".view-more-btn").toggleClass("d-none",o),a.find(".full-text").val(r),a.find(".content .text").html(r),n.limitText(),i.find(".description-and-detail .product-attributes").empty().html(t.attributesHtml)})},n.updateProductData=function(){let e=$("body");e.on("product:afterAttributeSelect",function(t,i){let s=i.container,a=i.data,l=a.product;var u,p,f,m=null;a&&a.datalayer&&Array.isArray(a.datalayer)&&l&&!l.readyToOrder&&(a.datalayer=a.datalayer.filter(function(e){return"view_item"!==e.event}));var g=s.data("last-model");if(!g){var y=s.find(".select-model option:selected");y.length&&(g=y.data("attr-value")||y.val(),s.data("last-model",g))}var v="",_=l.variationAttributes.find(function(e){return"model"===e.id});if(_){var b=_.values.find(function(e){return e.selected});v=b?b.value:"",s.data("current-model",v)}var T=l.productName;let w=s.find(".product-name");w.filter(":not(.product-title)").html(T),w.filter(".product-title").find(".product").text(T),"MTB"===window.brandID&&(u=l.id,p=$(".change-recos-product-details").data("url"),$.spinner().start(),$.ajax({url:p,type:"get",data:{pid:u},success:function(e){if(e.length>0){var t=$(".experience-commerce_assets-productRecommendationTypeCarousel .product-carousel-container.brand-mtb");let i=t.find(".product-carousel");i.removeClass("slick-initialized");let r=$("<div>").html(e),n=r.children();n.each(function(e){let t=$(this);if(t.is("script")){let i=n.eq(e+1);i.hasClass("reco-product-wrapper")&&i.append(t)}}),i.html(r.find(".reco-product-wrapper")),i.removeClass("product-carousel-loading").addClass("product-carousel-loaded"),t.find(".product-carousel__title").removeClass("d-none"),$(document).trigger("initProductCarousel",{element:i}),$("body").trigger("initProductCarousel",{element:i}),$.spinner().stop()}},error:function(e){e.responseJSON&&e.responseJSON.redirectUrl&&(window.location.href=e.responseJSON.redirectUrl),$.spinner().stop()}})),$(".pdp-klarna-container").length&&(l.available&&l.readyToOrder?($("klarna-placement").attr("data-purchase-amount",100*l.price.sales.value),$(".pdp-klarna-container").removeClass("d-none")):$(".pdp-klarna-container").addClass("d-none")),"hideProductPrice"in l&&(s.find(".js-price-dependent-row").toggleClass("d-none",l.hideProductPrice),s.find(".js-price-dependent-row-inverse").toggleClass("d-none",!l.hideProductPrice)),(l.hasEmbossing||l.hasEngraving)&&l.available?$(".js-personalization-btn-wrapper").removeClass("d-none"):$(".js-personalization-btn-wrapper").addClass("d-none"),l.notifyMe?($(".notify-me-link:not(.size-selector-notify-me-link)").removeClass("d-none"),$("div.select-size-unavailabe-error-msg").length&&$("div.select-size-unavailabe-error-msg").removeClass("d-none")):($(".notify-me-link:not(.size-selector-notify-me-link)").addClass("d-none"),$("div.select-size-unavailabe-error-msg").length&&$("div.select-size-unavailabe-error-msg").addClass("d-none"));let S=!!window.dataLayer&&window.dataLayer.some(e=>e&&"object"==typeof e&&e["gtm.uniqueEventId"]===a.datalayerItems.uniqueEventId);if(("datalayer"in a||"datalayerItems"in a)&&!S){let e=["size_drop_down","nib_size_guide_select"];if(a.datalayer&&Array.isArray(window.dataLayer)&&a.datalayer.length>0){var E=$(".product-detail").data("last-selected");a.datalayer.forEach(t=>{let i=t.event;e.includes(i)&&("CHL"!==window.brandID||"size_drop_down"!==i||"size"===E)&&window.dataLayer.push(t)})}let t=a.datalayerItems;if(t&&l&&l.readyToOrder){let e={category:"Product",event:"view_item",name:"Product Detail View",reference:"rKPI_P1","gtm.uniqueEventId":t.uniqueEventId},i={currency:t.currency,items:[]};i.items.push(t),e.ecommerce=i,"CHL"===window.brandID&&(e.value=Number(((t.price||0)*(t.quantity||1)).toFixed(2))),window.dataLayer&&window.dataLayer.push(e)}}
8if(!e.hasClass("pdp-partial-loading")){var C=l.images.large;void 0!==s.attr("data-product-container")&&(C=l.images.large.filter(e=>"DAM_BGRD_0002"===e.alt)),C&&function(e,t,i){let r=t.find(".pdp-image-carousel"),n=t.find(".slider-nav"),s=t.find(".shots-navigation"),a=r.hasClass("slick-initialized");if(a?(r.slick("unslick"),r.empty(),n.slick("unslick"),n.empty()):$("> :not(.js-to-exclude-from-carousel)",r).remove(),s.empty(),e&&e.length){var l=i.images&&i.images.small?i.images.small:[];"CHL"===window.brandID&&void 0!==t.attr("data-product-container")&&(l=l.filter(e=>"DAM_BGRD_0002"===e.alt));for(var u=0;u<e.length;u++){var d=(l[u]||e[u]).url,c=e[u].url;0===u&&"MTB"===window.brandID&&1===i.webGLViewSlidePosition.value&&i.webGLViewURL&&r.append(`<a href="${c}" class="pdp-image-row webgl-preview-wrapper js-3d-preview-wrapper" data-3d-url="${i.webGLViewURL}">
9                    <img
10                    src="${d}"
11                    class="js-3d-preview-image img-fluid img img-ratio-${i.imageRatio.x.toFixed(0)}-${i.imageRatio.y.toFixed(0)}"
12                    alt="${i.productName+" - "+Number(u+1)}"
13                    itemprop="image"
14                    srcset="${(l[0]||e[0]).srcSet}"
15                    sizes="${(l[0]||e[0]).sizes}" />
16                </a>`);var h=e[u].hiResScaleWidth||(e[u].scaledVersions&&e[u].scaledVersions[0]?e[u].scaledVersions[0].scaleWidth:720);if(r.append(`<a href="${c}" class="pdp-image-item pswp-wide-img ${0===u||u%2!=0?"pdp-image-row":""}" data-imageposition="${Number(u+1)}" data-pswp-width="${h}" data-pswp-height="${h}">
17                <img src="${d}" class="d-block img-fluid" alt="${i.productName} + ' - ' +  ${Number(e[u].index+1)}" itemprop="image">
18            </a>`),n.append(`<img src="${d}" class="d-block img-fluid" alt="${i.productName} + ' - ' +  ${Number(e[u].index+1)}" itemprop="image">`),s.length&&e.length>1&&(0===u||u%2!=0))if(r.hasClass("pdp-dun-image-carousel")){let t=r.data("shots-resource");s.append(`<li tabindex="0" class="shots-navigation-element ${0===u?"shots-navigation-element-active":""}">${u+1+" "+t+" "+e.length}</li>`)}else s.append(`<li tabindex="0" class="shots-navigation-element ${0===u?"shots-navigation-element-active":""}"></li>`)}o.initZoomGallery()}a||$(".js-to-exclude-from-carousel",r).appendTo(r),$(document).trigger("pdpSlickInit")}(C,s,l)}window.selectionLoading=!0;var k="";if(l.variationAttributes.forEach(function(e){var t='[data-attr="'+e.id+'"]';s.find(t+" .select-"+e.id+" option:first").attr("value","");var i="",r="";e.values.forEach(function(n){var a=("CHL"===window.brandID&&"size"===e.attributeId?$("#modal-add-to-cart-size"):s).find(t+' [data-attr-value="'+n.value+'"]'),o="DUN"===window.brandID?s.find(t+' [aria-describedby="'+n.value+'"]'):null,l=a.closest(".attribute-item").find(".size-selector-notify-me-link");n.selected&&(i=n.url,r=n.description),n.selectable?a.hasClass("js-use-prop-disabled")&&(a.prop("disabled",!1),l.addClass("d-none")):(a.attr("disabled",!1),a.hasClass("js-use-prop-disabled")&&(a.prop("disabled",!0),l.removeClass("d-none")),"DUN"===window.brandID&&(a.hasClass("selectable")?(a.removeClass("selectable"),o.removeClass("selectable")):a.hasClass("unselectable")||(a.addClass("unselectable"),o.addClass("unselectable")))),"DUN"===window.brandID&&n.selectable&&(a.hasClass("selectable")?a.hasClass("unselectable")&&(a.removeClass("unselectable"),o.removeClass("unselectable")):(a.addClass("selectable"),o.addClass("selectable"))),a.toggleClass("hide",!n.hasvariant);let u=a.closest(".attribute-item");u.find(".icon-wrapper").toggleClass("d-none",n.selectable),u.find(".attribute-msg-text").text(n.stockMsg||n.preorderMsg)});let n=i,a=s.find(`${t} .select-${e.id}`);a.first().find(`option[value="${i}"]:not(.no-hide)`).hasClass("hide")&&(n=""),a.val(n).change();var o=s.find(t+" .icon-info");r?o.addClass("active").find(".tooltip").text(r):o.removeClass("active").find(".tooltip").text("");let l=s.find(`[data-attr="${e.id}"] .attribute-btn`);if(i&&e.displayValue){var u=e.displayValue;"AAL"===window.brandID&&(u=u.toLowerCase()),l.addClass("selected").find(".selected-value").text(u)}else l.removeClass("selected").find(".selected-value").text("");
18if($(".notify-error-text").removeClass("d-block"),"color"===e.id&&(k=e.displayValue),"size"===e.id&&"MTB"===window.brandID&&!n){var d=s.data("current-model")||"",c=s.data("last-model")||"";if(d&&c&&d!==c){var h=e.values.find(function(e){return e.selectable});if(h&&h.url)m=h.url;else if(e.values.length>0){var p=e.values[0];p&&p.url&&(m=p.url)}}}}),s.find(".attributes").addClass("active"),0===$(".quickview-wrapper").length){let e=$(".add-to-cart-slider",i.container),t=e.siblings("button.add-to-cart").first();if("charmsHtml"in l&&$(".js-charms-container",s).html(l.charmsHtml),"attrGroupHtml"in l){let e=$(".description-and-detail",s);var x=null,D=e.find(".js-first-load-slot");if(D.length&&(x=D.prop("outerHTML")),e.html(l.attrGroupHtml),null!==x){var I=e.find(".js-slot-preserve");I.length&&I.replaceWith(x)}n.removeEmptyDetailGroups();let t=$(".product-reminder-module",e),i=$('[data-attr="size"] .product-reminder-module');t.length>0&&i.length>0&&i.html(t.html())}if("pdpButtonHtml"in l){if($(".pdp-buttons-wrapper").html(l.pdpButtonHtml),d()){let e=$("<div>").html(l.pdpButtonHtml),t=e.find("button.add-to-cart").first().text().trim(),i=e.find(".js-preorder-message-slot").first();$(".cart-and-ipay-wrapper",s).not(".pdp-buttons-wrapper .cart-and-ipay-wrapper").each(function(){let e=$(this),r=e.find("button.add-to-cart").first();t&&r.length&&r.text(t);let n=e.find(".js-preorder-message-slot").first();n.length&&i.length&&n.html(i.html())}),c()}"CHL"===window.brandID&&($(".add-to-cart-slider").addClass("d-none"),$(".floating-add-to-cart-btn").removeClass("d-none"))}if("CHL"===window.brandID&&"zoomHtml"in l&&$(".js-zoom-container",s).html(l.zoomHtml),"DUN"===window.brandID&&"relatedProductHtml"in l&&$(".related-products-wrapper").html(l.relatedProductHtml),l.available&&l.readyToOrder){if(e.hasClass("active")){e.removeClass("active");let i=$(".attribute-charm").first();if(0===i.length||!i.hasClass("attribute-charm-alphabet")||i.hasClass("selected")){let e=s.find(".js-add-to-cart");("CHL"===window.brandID||e.length?$("button.add-to-cart"):t).click()}}t.data("readyToOrder",!0),$(".add-to-wishlist-form.left-section-wishlist").removeClass("d-none").addClass("animation-active")}$(document).trigger("updateNextSlider"),$('.slider-container.active .slider-close, .modal[data-active="true"] [data-modal-close-trigger]').click(),l.available&&l.readyToOrder&&$(".attribute-charm.attribute-charm-alphabet:not(.selected)").click(),$("body").trigger("product:afterAttributeHtmlUpdated")}if($(".notify-me-link",i.container).data("queryString",a.queryString||""),window.selectionLoading=!1,!function(e){let t=e.product.id,i=$(".remove-from-wishlist-url").val(),r=$("#wishlist-product-ID"),n=JSON.parse(localStorage.getItem("user_wishlist_product_ids")||"[]");r.val(t);let s=r.closest("form");s.length&&(n.includes(t)?(s.find(".wishlist-wrapper").addClass("added-to-wishlist"),s.attr("action",s.attr("action").replace("Wishlist-AddProduct","Wishlist-RemoveProduct")),"AAL"!==window.brandID&&$(".js-delete-from-wishlist").data("href",i+"?pid="+t)):(s.find(".wishlist-wrapper").removeClass("added-to-wishlist"),s.attr("action",s.attr("action").replace("Wishlist-RemoveProduct","Wishlist-AddProduct"))))}(i.data),n.markWishlistIconsFromLocalStorage(i.data.product.id,"pdp"),$(".quickview-wrapper .product-quickview .add-to-wishlist-form, .add-to-wishlist-form").removeClass("not-ready-to-order"),$(".quickview-wrapper .product-quickview .add-to-wishlist-form .icon-heart, .add-to-wishlist-form .icon-heart").attr("data-target","#addToWishlistModal"),window.app.isPDP()&&(f=i.data,document.querySelector('link[rel="canonical"]').href=f.canonicalUrl,"MTB"===window.brandID?window.history.replaceState({},document.title,i.data.canonicalUrl):window.history.pushState({},document.title,i.data.canonicalUrl)),"DUN"===window.brandID)if(l.notifyMe)$(".dun-check-edd-js").addClass("d-none");else{let e=$(".dun-check-edd-js");if(0!==e.length){let t=e.data("action");$.ajax({url:t,method:"POST",success:function(e){e.renderedTemplate&&$(".delivery-date-text-container").html(e.renderedTemplate)}})}}let A=s.find(".description-and-detail .pdp-attr-group-definition .pdp-attr_value.pdp-attr_product-id");A.length&&A.html(l.id);let O=s.find(".description-and-detail .pdp-attr-group-definition .pdp-attr_value.pdp-attr_color");O.length&&(k?O.removeClass("d-none").html(k):O.addClass("d-none").html("")),v&&s.data("last-model",v),m?(window.isAutoSelectingSize=!0,r.attributeSelect(h(m),s)):(window.isAutoSelectingSize=!1,e.removeClass("pdp-p
18artial-loading")),e.trigger("gtm:update:event",{response:a,target:s})})},n.reinitEvents=function(){window.selectionLoading=!1;let e=$(document),t=$("body");var i='[data-attr="color"] button';("AAL"===window.brandID||"CHL"===window.brandID||"DUN"===window.brandID)&&(i='[data-attr="color"] a'),e.off("click",i).on("click",i,function(e){if(e.preventDefault(),$(this).closest(".attribute").find(".error-msg").addClass("d-none"),$(this).closest(".attribute").find("label").removeClass("d-none"),window.selectionLoading)return;let t=$(this);if(t.find(".selected").length||t.attr("disabled"))return;$('[data-attr="color"] button .swatch-circle.selected').removeClass("selected"),t.find(".swatch-circle").addClass("selected");var i=t.closest(".set-item");i.length||(i=t.closest(".product-detail"));let n=t.attr("data-url");void 0!==n&&($(this).addClass("selected-product-attribute"),r.attributeSelect(h(n),i))}),e.off("click",'[data-attr="size"] button').on("click",'[data-attr="size"] button',function(e){e.preventDefault(),$(".select-size-error-msg").addClass("d-none");let i=$(this).closest(".attribute");if(i.find(".error-msg").addClass("d-none"),i.find("label").removeClass("d-none"),window.selectionLoading)return;let n=$(this);if(n.hasClass("notify-me-link")){let e=n.closest(".attribute-item").find("[data-attr-value]");e.length&&(n=e)}if(n.find(".selected").length||n.attr("disabled"))return;$('[data-attr="size"] button .size-value.selected').removeClass("selected"),n.find(".size-value").addClass("selected");var s=n.closest(".set-item");s.length||(s=n.closest(".product-detail")),n.data("url",$('[data-attr="size"] button .size-value.selected').attr("value"));let a=h(n.data("url"));a&&t.addClass("pdp-partial-loading"),r.attributeSelect(a,s)}),e.ajaxError(function(){t.removeClass("pdp-partial-loading")}),$('select[class*="select-"] option:selected').each(function(){let e=$(this),t=e.closest(".select-attribute-wrapper"),i=e.data("description");i&&(t.find(".icon-info").addClass("active"),t.find(".tooltip").text(i))}),e.off("change",'select[class*="select-"], .options-select').on("change",'select[class*="select-"], .options-select',function(e){e.preventDefault();let t=$(this),i=t.next().find(".select2-selection__rendered");if($(".variations-overlay-content").is(":visible")){let e=i.length>0?i.html().trim():"",r=t.data("sync-id");$(`.variations-overlay-content .attributes .attribute .custom-select[data-sync-id="${r}"]`).next().find(".select2-selection__rendered").html(e).trigger("change"),t.closest(".attribute").find("label").removeClass("d-none"),t.closest(".attribute").find(".error-msg").addClass("d-none")}if(window.selectionLoading)return;var n=t.closest(".set-item");n.length||(n="CHL"===window.brandID&&$("#modal-product-ajax").length>0?$("#modal-product-ajax .product-detail"):t.closest(".product-detail"));var s=t.next().find(".select2-selection__rendered");""!==(s=s.length>0&&s.html()?s.html().trim():"")&&(t.closest(".attribute").find(".error-msg").addClass("d-none"),t.closest(".attribute").find("label").removeClass("d-none"));var a=t.closest(".attribute").find("label").attr("for");if(Array.isArray(window.dataLayer)&&"model"===a){let e={category:"Nib Model Guide",event:"nib_model_guide_select",name:"Nib Model Guide Select",reference:"rKPI_MTB_66",nib_model:s};window.dataLayer.push(e)}let o=h(e.currentTarget.value);r.attributeSelect(o,n)}),e.off("change",".quantity-select").on("change",".quantity-select",function(e){if(e.preventDefault(),window.selectionLoading)return;let t=$(this);var i=t.closest(".product-detail");if(i.length||(i=t.closest(".modal-content").find(".product-quickview")),0===$(".bundle-items",i).length){let t=h($(e.currentTarget).find("option:selected").data("url"));r.attributeSelect(t,i)}}),e.on("click",".add-to-cart-slider",function(e){e.preventDefault(),$(this).addClass("active")}),e.on("click",".floating-add-to-cart-btn",function(e){e.preventDefault(),$(".product-detail .pdp-right-wrapper .add-to-cart").trigger("click")}),e.on("updateNextSlider",function(){let e=$(".attribute:not(.attribute-swatch) .selected-value:empty").first().closest(".attribute").children(".slider-container").attr("id")||"";e&&$(".add-to-cart-slider").data("target-slider","#"+e)}),e.trigger("updateNextSlider")},n.availability=r.availability,n.addToCart=r.addToCart,n.seeProductFullDetails=function(){$(document).on("click",".see-full-details-btn",function(e){e.preventDefault();let t=$(".long-description");t.length&&$("html, body").animate({scrollTop:t.offset().top-300},1e3)})},n.imageSlick=function(){document.addEventListener("visibilitychange",()=>{document.hidden||$(".pdp-image-carousel").hasClass("slick-initialized")||setTimeout(()=>{$(document).trigger("pdpSlickInit")},100)}),$(document).on("pdpSlickInit",function(){if(document.hidden)return;$(".pdp-image-carousel").each(function(){$(this).trigger("pdpSlickInit:before");
18var e=$(this),t=e.parent(),i=e.data("width-threshold");if("CHL"===window.brandID){var r=[],n=[];if(e.children().each(function(){var e=$(this);e.hasClass("product-video-wrapper")?n.push(e):r.push(e)}),n.length>0){for(var s=r.length>=2?2:r.length,a=0;a<n.length;a++)r.splice(s+a,0,n[a]);e.empty();for(var o=0;o<r.length;o++)e.append(r[o])}}if(!(i&&$(window).width()>=i)&&!e.hasClass("slick-initialized")&&!e.hasClass("slick-initialized")){let i=e.find(".js-to-exclude-from-carousel");i.length&&i.insertAfter(e);var l={dots:!0,arrows:!0,infinite:!0,speed:500,touchThreshold:100,adaptiveHeight:!1,slidesToShow:e.data("slides-to-show")||1,slidesToScroll:e.data("slides-to-scroll")||1,appendDots:t.find(".pdp-image-progress"),nextArrow:t.find(".slick-next"),prevArrow:t.find(".slick-prev"),responsive:e.data("responsive")||[]},u=t.find(".pdp-image-custom-pagination");if(u.length)e.on("init",function(e,t){var i=t.currentSlide+1,r=t.slideCount;u.text(`${i} / ${r}`)}),e.on("afterChange",function(e,t,i){var r=t.slideCount;u.text(`${i+1} / ${r}`)});else{var d=e.closest(".primary-images");e.on("init",function(e,t){$(".js-custom-pagination-total-slides",d).text("/"+t.slideCount)})}e.slick(l)}});let e=$(".product-video");if(e.length){let t=i(1977).Z,r=$(".video-play-in-carousel");$(".pdp-image-carousel").on("afterChange",function(){if($(".slick-active .video-js").length){let e=t.getPlayer($(this).find(".slick-active .product-video").attr("id"));r.addClass("d-none"),l.detectIOS()?e.playsinline(!0):e.play()}else r.removeClass("d-none")}),r.on("click",function(){let e=$(".video-js").parents(".slick-slide:not(.slick-cloned)").last().data("slick-index");$(".pdp-image-carousel").slick("slickGoTo",e)}),e.each(function(){let e=$(this),i=e.attr("data-settings");try{i=JSON.parse(i)}catch(e){i={}}i.fill=!0;let n=t(e[0],i),s=e.parents(".slick-active"),a=$(".pdp-video-item:last-child:nth-child(2n), .pdp-video-item:first-child");s.length&&(setTimeout(()=>{n.play()},500),r.addClass("d-none")),a.length&&a.find(".video-js").addClass("vjs-fluid")})}}),$(document).trigger("pdpSlickInit")}
18,n.limitText=function(){var e=$(".short-description.content");if(e.hasClass("truncate-text")){var t=$(".full-text").val();t=t&&t.trim();var i=parseInt($(".char-limit-count").val(),10);t.length>i&&(t=t.substring(0,i)+"..."),e.find(".text").html(t)}},n.seeFullDescription=function(){$("body").on("click",".view-more-btn",function(e){var t=$(".short-description.content"),i=$(".full-text").val();e.preventDefault(),t.removeClass("truncate-text"),t.find(".text").html(i),t.find(".view-more-btn").addClass("d-none"),t.find(".view-less-btn").removeClass("d-none")})},n.seeLessDescription=function(){$("body").on("click",".view-less-btn",function(e){var t=$(".short-description.content");e.preventDefault(),t.addClass("truncate-text"),t.find(".view-more-btn").removeClass("d-none"),t.find(".view-less-btn").addClass("d-none"),n.limitText()})},n.checkProductFullDetailsTextHeight=function(){let e=$(".long-description-wrapper .content"),t=parseFloat(e.css("line-height"));e[0]&&e[0].scrollHeight>2*t&&e[0].scrollHeight>=t&&e.addClass("box-shadow")},n.removeProductFromWishlist=function(){$("body").on("click",".successful-add-to-wishlist-modal .close",function(e){e.preventDefault(),$(".successful-add-to-wishlist-modal").modal("hide")})},n.wishlistCancelBtnClick=function(){$("body").on("click",".remove-from-wishlist-modal .cancel-btn",function(){$(this).closest(".product-wrapper").find(".wishlist-wrapper").addClass("added-to-wishlist"),$(".remove-from-wishlist-modal").modal("hide")}),$("body").on("click",".remove-from-wishlist-modal .close",function(e){e.preventDefault(),$(".remove-from-wishlist-modal").modal("hide")})},n.sizeChart=function(){let e=function(){$(".size-chart-overlay .slider-close.close").filter(":visible").first().focus()};$('.size-chart a, .slider-opener[data-target-slider="#size-chart-size"]').off("click").on("click",function(t){t.preventDefault(),window.lastFocusedSizeChartTrigger=this;let i=$(this),r=i.attr("href");var n=i.closest(".product-detail").find(".size-chart-collapsible");n.is(":empty")?$.ajax({url:r,type:"get",dataType:"json",success:function(t){n.append(t.content),n.find("th, td").each(function(){var e=this.textContent.trim();e&&this.setAttribute("aria-label",e),this.setAttribute("tabindex","0")}),t.datalayer&&$("body").trigger("gtm:add:event",t),e()}}):e(),n.addClass("active")});var t=$(".size-chart-collapsible");$("body").on("click touchstart",function(e){$(".size-chart").has(e.target).length<=0&&t.removeClass("active")}),$(document).on("keydown",".size-chart-overlay .slider-close.close, .size-chart-overlay .back-arrow",function(e){("Enter"===e.key||" "===e.key||13===e.keyCode||32===e.keyCode)&&(e.preventDefault(),$(this).click())}),$(document).on("click",".size-chart-overlay .slider-close, .size-chart-overlay .back-arrow",function(){if(window.lastFocusedSizeChartTrigger){let e=window.lastFocusedSizeChartTrigger;window.lastFocusedSizeChartTrigger=null,$(e).focus()}})},n.methods.updateAddToCartEnableDisableOtherElements=function(e){$("button.add-to-cart-global").attr("disabled",e),$("button.js-open-personalization-modal").attr("disabled",e)},n.updateAddToCart=function(){$("body").on("product:updateAddToCart",function(e,t){let i=t.product.notifyMe,r=t.product.restrictedForCurrentLocale,s=t.product.readyToOrder,a=t.product,o=i||r,l=t.$productContainer,u=$(".add-to-cart-slider, .floating-add-to-cart-btn, .js-keep-size-selector",l);if(u.length&&!u.hasClass("js-keep-size-selector"))u.toggleClass("d-none",i||s),$(".add-to-cart-slider , .floating-add-to-cart-btn").length&&(o=o||!s);else if(u.length&&u.hasClass("js-keep-size-selector")){let e=$('#sliter-attribute-size input[name="attribute-radio-size"]:checked');e.length&&e.trigger("change").prop("checked",!1)}if($(".charms-slider-opener",l).length){let e=$(".attribute-charm",l).first();e.hasClass("selected")||(o=!0),$(".charms-slider-opener",l).toggleClass("d-none",i||!s),e.toggleClass("d-none",i)}a.enableAddToCartOnVGChange&&!i&&(o=!1),$("button.add-to-cart, .floating-add-to-cart-btn",l).toggleClass("d-none",o).attr("data-pid",t.product.id),$(".js-personalization-btn-wrapper",l).toggleClass("d-none",o),$(".js-open-personalization-modal",l).attr("data-url",t.product.personalizationUrl),$(".pdp-right-wrapper",l).toggleClass("notifyme-active",i),a.available&&a.readyToOrder?$(".product-service-item-delivery").removeClass("d-none"):$(".product-service-item-delivery").addClass("d-none");let d=$(".product-service-block");d.removeClass("d-none").toggleClass("d-none",0===d.children(":visible").length),"hideProductPrice"in a&&$(".mtb-boutique-slider-wrapper",l).toggleClass("d-none",!0===a.hideProductPrice);var c=$(".product-availability").toArray().every(function(e){return $(e).data("available")&&$(e).data("ready-to-order")});n.methods.updateAddToCartEnableDisableOtherElements(!c)});let e=$(".product-service-block");e.toggleClass("d-none",0===e.children(":visible").length)},n.initSuccessToaster=s.methods.initSuccessToaster,n.initWishlistToaster=s.methods.initWishlistToaster,n.initPreorderEddMessage=function(){c()},n.updateProductBadges=function(){let e=$("body");e.on("product:afterAttributeSelect",function(t,i){let r=i.container,n=i.data.product,s=r.find(".badges-wrapper");if(s.hasClass("dun-badges-wrapper"))n.badgeTag&&s.find(".badge").text(n.badgeTag);else{var a=[];s.empty(),n.badgesToShow&&(s.attr("data-badges-all",n.badgesToShow.join()),a=n.badgesToShow),a.forEach(function(e){var t=$("<span>",{class:"badge",text:e});s.append(t)})}
18window.isAutoSelectingSize||e.removeClass("pdp-partial-loading")})},n.mountMeasMerizemodal=function(){let e=document.getElementById("measmerize-script");e&&e.addEventListener("measmerize.widget.ready",function(){$(".measmerize-link").removeClass("d-none")}),$("body").on("click","#measmerize-link",function(){window.measmerize&&window.measmerize.modal&&"function"==typeof window.measmerize.modal.mount&&window.measmerize.modal.mount()})},n.hoverWishlistForm=a.methods.hoverWishlistForm,n.initAddWishlistForm=a.methods.initAddWishlistForm,n.initRemoveWishlistForm=a.methods.initRemoveWishlistForm,n.productTileRemoveWishlistForm=a.methods.productTileRemoveWishlistForm,n.markWishlistIconsFromLocalStorage=a.methods.markWishlistIconsFromLocalStorage,n.initPhotoswipe=function(){o.initZoomGallery()},e.exports=n},6264:function(e,t,i){"use strict";let r=i(1430),n=i(7577);function s(){let e=$("#quickViewModal");if(0!==e.length&&e.remove(),!($('link[href*="detail.css"]').length>0)){var t=$("[data-detail-css]").first().attr("data-detail-css");t&&$("<link>",{rel:"stylesheet",type:"text/css",href:t}).appendTo("head")}let i=`<!-- Modal -->
19        <div class="modal fade" id="quickViewModal" role="dialog">
20        <span class="enter-message sr-only" ></span>
21        <div class="modal-dialog quick-view-dialog">
22        <!-- Modal content-->
23        <div class="modal-content">
24        <div class="modal-header">
25            <a class="full-pdp-link" href=""></a>
26            <button type="button" class="close pull-right" data-dismiss="modal">
27                <i class="icon icon-close"></i>
28            </button>
29        </div>
30        <div class="modal-body"></div>
31        </div>
32        </div>
33        </div>`;$("body").append(i)}function a(e,t){if(e.find(".pdp-image-carousel .pdp-image-item").length>1){let i=e.find(".quickview-image-custom-pagination"),r=e.find(".swatch-slick"),n=r.find(".swatch-item"),s=r.closest(".attribute-swatch-list"),a=e.find(".attributes-list > div"),o=a.find(".attribute-item "),l=e.find(".slider-nav"),u=e.find(".pdp-image-carousel"),d=e.find(".product-quickview").data("brand");u.hasClass("slick-initialized")&&u.slick("unslick"),l.hasClass("slick-initialized")&&l.slick("unslick"),r.hasClass("slick-initialized")&&r.slick("unslick"),a.hasClass("slick-initialized")&&a.slick("unslick"),("mtb"===d||"chl"===d&&$(window).width()<Number(window.app.grid.lg))&&!u.hasClass("slick-initialized")&&(u.slick({slidesToShow:1,slidesToScroll:1,arrows:!1,fade:!0,infinite:!1,swipeToSlide:!0,dots:"chl"===d,responsive:[{breakpoint:992,settings:{dots:!0}}],asNavFor:t+" .slider-nav"}),l.slick({slidesToShow:5,slidesToScroll:1,asNavFor:t+" .pdp-image-carousel",dots:!1,infinite:!1,vertical:!0,verticalSwiping:!0,swipeToSlide:!0,focusOnSelect:!0,prevArrow:'<div class="slick-prev"><i class="icon icon-prev icon-size-m" aria-hidden="true"></i></div>',nextArrow:'<div class="slick-next"><i class="icon icon-next icon-size-m" aria-hidden="true"></i></div>'}),i.length&&l.on("init afterChange",function(e,t,r){let n="init"===e.type?t.currentSlide+1:r+1,s=t.slideCount;i.text(`${n} / ${s}`)}),u.slick("setPosition"),l.slick("setPosition")),"chl"===d&&$(window).width()<Number(window.app.grid.lg)&&!r.hasClass("slick-initialized")&&n.length>6&&r.slick({slidesToShow:6,slidesToScroll:1,infinite:!1,speed:300,touchThreshold:100,dots:!1,arrows:!0,nextArrow:s.find(".slick-next"),prevArrow:s.find(".slick-prev")}),"chl"===d&&$(window).width()<Number(window.app.grid.lg)&&!a.hasClass("slick-initialized")&&o.length>8&&a.slick({slidesToShow:8,slidesToScroll:1,infinite:!1,speed:300,touchThreshold:100,dots:!1,arrows:!0,prevArrow:'<div class="slick-prev d-flex align-items-center"><i class="icon icon-prev icon-size-m" aria-hidden="true"></i></div>',nextArrow:'<div class="slick-next d-flex align-items-center"><i class="icon icon-next icon-size-m" aria-hidden="true"></i></div>'})}}function o(e){let t="CHL"===window.brandID&&$(window).width()<Number(window.app.grid.lg),i=t?".quickview-overlay-slider-container":"#quickViewModal",r=$(i),n=r.find(t?".quickview-overlay-slider":".modal-body");(t?r:n).spinner().start(),$.ajax({url:e,method:"GET",dataType:"json",success:function(e){let s=(u=e.renderedTemplate,{body:$("<div>").append($.parseHTML(u)).find(".product-quickview")});if(n.empty().html(s.body),r.find(".full-pdp-link").text(e.quickViewFullDetailMsg).attr("href",e.productUrl),r.find(".size-chart").attr("href",e.productUrl),r.find(".enter-message").text(e.enterDialogMessage),r.addClass("quickview-wrapper"),t||r.modal("show"),"CHL"===window.brandID){let e=r.find(".quickview-overlay-slider"),t=e.find("h1.product-name").text(),i=e.find(".price-wrapper");e.find(".attribute-item-label").text("Select your Size");let n=r.find(".slider-wrapper");
33n.find(".product-name").empty().text(t),n.find(".product-price").empty(),i.appendTo(n.find(".product-price"))}"MTB"===window.brandID&&$(".select-size").prop("selectedIndex",0),$("body").trigger("quickview:ready"),r.one("shown.bs.modal",function(){a(r,i)}),r.hasClass("active")&&a(r,i);let o=r.find(".add-to-wishlist-form"),l=JSON.parse(localStorage.getItem("user_wishlist_product_ids")||"[]");if(o.length){let e=o.find('input[name="pid"]').val();l.includes(e)?(o.find(".wishlist-wrapper").addClass("added-to-wishlist"),o.attr("action",o.attr("action").replace("Wishlist-AddProduct","Wishlist-RemoveProduct"))):o.find(".wishlist-wrapper").removeClass("added-to-wishlist")}$(".size-chart a").on("click",function(t){t.preventDefault();var i=$(this).attr("href"),r=$(this).closest(".size-chart").find(".size-chart-collapsible");r.is(":empty")&&$.ajax({url:i,type:"get",dataType:"json",success:function(){r.append(e.content)}}),r.toggleClass("active")});var u,d=$(".size-chart-collapsible");$("body").on("click touchstart",function(e){$(".size-chart").has(e.target).length<=0&&d.removeClass("active")}),$.spinner().stop()},error:function(){$.spinner().stop()}})}e.exports={showQuickview:function(){let e=0;$("body").off("click initQuickviewHotspot",".quickview"),$("body").on("click initQuickviewHotspot",".quickview",function(t){if("initQuickviewHotspot"===t.type){let i=$(this);clearTimeout(e),e=setTimeout(function(){t.preventDefault();let e=i.closest("a.quickview").attr("href");$(t.target).trigger("quickview:show"),s();let r=new URL(e,"http://test.com/");r.searchParams.set("firstSelection","true"),r.searchParams.set("isPDP","true"),o(r.pathname+r.search)},50)}else{let e;t.preventDefault(),"CHL"===window.brandID&&$(window).width()<Number(window.app.grid.lg)&&$(document).trigger("openSlider",{target:"#quickviewOverlaySlider"}),e=$(this).closest("a.quickview").attr("href"),$(t.target).trigger("quickview:show"),s();let i=new URL(e,"http://test.com/");i.searchParams.set("firstSelection","true"),i.searchParams.set("isPDP","true"),o(i.pathname+i.search)}})},focusQuickview:function(){$("body").on("shown.bs.modal","#quickViewModal",function(){$("#quickViewModal .close").focus()})},trapQuickviewFocus:function(){$("body").on("keydown","#quickViewModal",function(e){n.setTabNextFocus({event:e,containerSelector:"#quickViewModal",firstElementSelector:".full-pdp-link",lastElementSelector:".add-to-cart-global"})})},availability:r.availability,showSpinner:function(){$("body").on("product:beforeAddToCart",function(e,t){$(t).closest(".modal-content").spinner().start()})},hideDialog:function(){$("body").on("product:afterAddToCart",function(e,t){if("mtb"!==$(".product-quickview").data("brand"))$("#quickViewModal").modal("hide");else{let e=$(".added-to-cart-message");e.show(),e.closest(".detail-panel").find("button.add-to-cart").html(t.addedProductToaster.details.addOneMoreLabel)}})},beforeUpdateAttribute:function(){$("body").on("product:beforeAttributeSelect",function(){$(".modal.show .modal-content").spinner().start();let e=$(".product-quickview");"chl"===e.data("brand")&&e.find(".select-size-message").addClass("d-none")})},updateAttribute:function(){$("body").on("product:afterAttributeSelect",function(e,t){if(!t.container.closest(".quick-view-dialog").length&&"CHL"===window.brandID)return;let i=$(".modal.show");if(i.find(".modal.show .product-quickview > .bundle-items").length?(i.find(t.container).data("pid",t.data.product.id),i.find(t.container).find(".product-id").text(t.data.product.id)):$(".set-items").length?t.container.find(".product-id").text(t.data.product.id):(i.find(".product-quickview").data("pid",t.data.product.id),i.find(".full-pdp-link").attr("href",t.data.product.selectedProductUrl)),t&&t.data&&t.data.product&&"pdpButtonHtml"in t.data.product&&$(".pdp-buttons-wrapper").html(t.data.product.pdpButtonHtml),window.brandID&&"MTB"===window.brandID.toUpperCase())try{if(t&&t.data&&t.data.product&&t.data.product.images&&t.container){let e=t.data.product,i=e.images.large||[],r=t.container.find(".pdp-image-carousel"),n=t.container.find(".slider-nav");r.length&&(r.hasClass("slick-initialized")&&r.slick("unslick"),r.empty(),n.length&&(n.hasClass("slick-initialized")&&n.slick("unslick"),n.empty()),i.forEac
33h(function(t,i){let s="img-ratio-1-1";e.imageRatio&&"number"==typeof e.imageRatio.x&&"number"==typeof e.imageRatio.y&&(s=`img-ratio-${e.imageRatio.x.toFixed(0)}-${e.imageRatio.y.toFixed(0)}`),r.append(`
34                                    <div class="pdp-image-item ${0===i||i%2!=0?"pdp-image-row":""}">
35                                        <img src="${t.url}" class="d-block img-fluid img ${s}" alt="${e.productName} - ${Number(i+1)}" itemprop="image" />
36                                    </div>
37                                `),n.length&&n.append(`
38                                        <div class="image-item">
39                                            <img src="${t.url}" class="d-block img-fluid img ${s}" alt="${e.productName} - ${Number(i+1)}" itemprop="image" />
40                                        </div>
41                                    `)}))}}catch(e){console.error("Error rebuilding quickview carousels:",e)}setTimeout(function(){let e="CHL"===window.brandID&&$(window).width()<Number(window.app.grid.lg)?".quickview-overlay-slider-container":"#quickViewModal";a($(e),e)},500)})},updateAvailability:function(){$("body").on("product:updateAvailability",function(e,t){$(".product-availability",t.$productContainer).data("ready-to-order",t.product.readyToOrder).data("available",t.product.available).find(".availability-msg").empty().html(t.message);let i=$(t.$productContainer).closest(".quick-view-dialog");if($(".product-availability",i).length){let e=$(".product-availability",i).toArray().every(function(e){return $(e).data("available")}),r=$(".product-availability",i).toArray().every(function(e){return $(e).data("ready-to-order")});$(".global-availability",i).data("ready-to-order",r).data("available",e),$(".global-availability .availability-msg",i).empty().html(r?t.message:t.resources.info_selectforstock)}else $(".global-availability",i).data("ready-to-order",t.product.readyToOrder).data("available",t.product.available).find(".availability-msg").empty().html(t.message)})},showSelectMessage:function(){$("body").on("click",".quick-view-dialog .add-to-cart-slider",function(){let e=$(".product-quickview");"chl"===e.data("brand")&&$(".swatch").length&&e.find(".attribute").each(function(){0===$(this).find(".options-select:checked").length&&e.find(".select-size-message").removeClass("d-none")})})},closeQuickview:function(){$(".cart-page").length>0&&$("body").on("click","#quickViewModal .close",function(){$("body > .modal-backdrop").remove()})}}},8502:function(e){"use strict";e.exports={validate:function(e,t){var i=!1,r=e.parents(".pdp-right-wrapper").find(".attributes .row");return r.find(".error-msg").addClass("d-none"),r.find("label").removeClass("d-none"),$(t).hasClass("sticky-add-to-cart")&&($(".error-msg").addClass("d-none"),r=e.parents(".variations-overlay-content").find(".attributes .row")),r&&r.each(function(){let e=$(this);"color"===e.data("attr")?e.find(".attribute .color-value").hasClass("selected")||(e.find(".error-msg").removeClass("d-none"),e.find("label").addClass("d-none"),i=!0):""===e.find(".attribute .custom-select").val()&&(e.find(".error-msg").removeClass("d-none"),e.find("label").addClass("d-none"),i=!0)}),i}}},7059:function(e,t,i){"use strict";let r=$(document);var n=!1;let s=window.removeFromWishlistURL,a=i(1430),{get:o}=i(6486),l=e=>{if("AAL"!==window.brandID){let t=$(".remove-from-wishlist-url");t.length&&$(".remove-from-wishlist-modal .js-delete-from-wishlist").attr("data-href",t.val()+"?pid="+e.pid)}},u="user_wishlist_product_ids",d=()=>{let e=localStorage.getItem(u);return e?JSON.parse(e):[]},c=e=>{localStorage.setItem(u,JSON.stringify(e))},h=e=>{let t=d();t.includes(e)||(t.push(e),c(t))},p=e=>{let t=d();c(t=t.filter(t=>t!==e))},f=(e=null,t="plp",i=null)=>{let r=JSON.parse(localStorage.getItem("user_wishlist_product_ids")||"[]");if("pdp"===t&&e){let t=$(".product-quickview:visible").length>0?$(".product-quickview:visible"):$("body"),n=t.find(".add-to-wishlist-form .wishlist-wrapper");if(t.find('.add-to-wishlist-form input[name="pid"]').val(e),i&&$(".page-pdp.product-detail").data("pid")!==e)return;r.includes(e)?n.addClass("added-to-wishlist"):n.removeClass("added-to-wishlist")}
41else{$(".add-to-wishlist-form");("pdp"===t?$(".product-quickview:visible .add-to-wishlist-form"):$(".add-to-wishlist-form").not(".product-quickview .add-to-wishlist-form")).each(function(){let e=$(this),t=e.find('input[name="pid"]').val();if(!t||"undefined"===t||"null"===t)return;let i=e.find(".wishlist-wrapper");r.includes(t)?i.addClass("added-to-wishlist"):i.removeClass("added-to-wishlist")})}};e.exports={methods:{hoverWishlistForm:()=>{$(document).on("mouseenter touchstart",".quickview-wrapper .product-quickview .add-to-wishlist-form.not-ready-to-order .icon-heart, .add-to-wishlist-form.right-section-wishlist.not-ready-to-order .icon-heart",function(){$(this).closest(".wishlist-wrapper").hasClass("added-to-wishlist")||($(this).attr("data-tooltip","Please select pen size"),$(this).addClass("show-tooltip"),n=!0)}),$(document).on("mouseleave touchstart",".quickview-wrapper .product-quickview .add-to-wishlist-form.not-ready-to-order .icon-heart, .add-to-wishlist-form.right-section-wishlist.not-ready-to-order .icon-heart",function(){$(this).removeClass("show-tooltip"),n=!1})},initAddWishlistForm:()=>{$(document).on("change",".product-quickview select, .product-quickview .swatch",function(){let e=$(this).closest(".product-quickview");setTimeout(()=>{let t=e.find('input[name="pid"]').val();t&&f(t,"pdp",!0)},200)}),$(document).on("click",".remove-confirmation-wishlist-modal .close",function(){$(".remove-confirmation-wishlist-modal").modal("hide")}),$("body").on("click",".add-to-wishlist-form .icon-heart, .add-to-wishlist-form .minicart-add-to-wishlist, .add-to-wishlist-form .add-to-wishlist-text",function(e,t){let i=$(this),r=i.attr("data-target-slider");if(n){e.stopImmediatePropagation(),e.preventDefault();return}if(r)return;let s=i.closest("form");if(a.openSizeSelectionDrawer()){e.preventDefault(),e.stopImmediatePropagation();return}if(""===$("select.select-size").val()&&$(".add-to-cart-with-bookmark-wrapper").is(":visible"))return void $(".select-size").closest(".attribute").find(".error-msg").removeClass("d-none");e.preventDefault(),e.stopImmediatePropagation();var u=$(".successful-add-to-wishlist-modal");let d=i.data("product-name"),c=i.data("product-image-alt"),p=i.data("product-image-src");u.find(".pdp-image-item img").attr("src",p),u.find(".product-name .product").text(d),u.find(".pdp-image-item img").attr("alt",c);let m=i.closest("[data-pid]").find(".price").prop("outerHTML"),g=i.closest(".add-to-wishlist-form").find(".product-variation-attrs").html();u.find(".product-price").html(m),u.find(".product-attrs").html(g);let y=$(".guest-user").length>0,v=u.find(".view-your-wishlist[data-guest-text]");if(v.length){let e=y?v.data("guestText"):v.data("loginText"),t=$(".wishlist-success-message");t.text(y?t.data("guestText"):t.data("loginText"));let i=new URL(v.attr("href"));i.searchParams.set("isLoginOverlay",$(".guest-user").length>0?"true":"false"),v.attr("href",i.toString()),v.text(e)}let _={};$.each(s.serializeArray(),function(){_[this.name]=this.value||""});let b=s.find('input[name="pid"]').val();b||(b=i.closest("[data-pid]").attr("data-pid")),_.pid=b,o(t,"hasDlEvent")&&(_.hasDlEvent=!0),$.ajax({url:s.attr("action"),type:"POST",data:_,success:function(e){s.find(".wishlist-wrapper").addClass("added-to-wishlist"),s.find(".wishlist-wrapper").removeAttr("data-tracking-click-event");
41let t=o(e,"pid")||o(e,"productId")||b;l({pid:t}),h(t),$(".product-quickview").length?s.closest(".product-quickview").find(".successful-add-to-wishlist-modal").modal("show"):$(".successful-add-to-wishlist-modal").modal("show"),$(".add-to-wishlist-form").find(`input[name="pid"][value="${t}"]`).each(function(){$(this).closest("form").find(".wishlist-wrapper").addClass("added-to-wishlist").removeAttr("data-tracking-click-event")}),f(null,"plp"),$("body").trigger("gtm:add:event",{datalayer:o(e,"datalayer",[])}),$(document).trigger("toasterWishlist:open")},error:function(){}})}),r.off("click touchstart",".add-to-wishlist-form .added-to-wishlist .icon-heart-filled:not(.js-delete-from-wishlist):not(.remove-from-wishlist)").on("click touchstart",".add-to-wishlist-form .added-to-wishlist .icon-heart-filled:not(.js-delete-from-wishlist):not(.remove-from-wishlist)",function(){let e=$(this).data("pid")||$(this).closest("form").find('input[name="pid"]').val(),t=$(".remove-from-wishlist-modal").last();t.length&&e&&(t.attr("data-pid",e),l({pid:e}),t.modal("show"),$(".modal-backdrop").slice(1).remove())}),r.off("click",".wishlist-size-submit").on("click",".wishlist-size-submit",function(e){e.preventDefault();let t=$(this).closest(".notify-me-slider-wrapper").find(".wishlist-size-selection-form"),i=t.find(".custom-product-card").data("pid"),r={};r.pid=i;let n=t.attr("action");$.ajax({url:n,type:"POST",data:r,success:function(e){t.find(".wishlist-wrapper").addClass("added-to-wishlist"),$(".wishlist-size-selection-overlay").removeClass("active slider-animate"),$("body").removeClass("slider-open"),t.find(".wishlist-wrapper").removeAttr("data-tracking-click-event");let r=o(e,"pid")||o(e,"productId")||i;h(r),f(r,"pdp",!0),f(null,"plp")},error:function(){}})})},initRemoveWishlistForm:()=>{$(document).on("click",".js-delete-from-wishlist",function(e){e.preventDefault(),e.stopImmediatePropagation();var t=$(this),i=t.attr("data-href")||t.attr("href"),r=$("#removeFromWishlistModal");"AAL"===window.brandID&&void 0===i&&(i=$(".remove-from-wishlist-url").attr("value")+"?pid="+t.attr("data-pid")),"null"===i&&(i=$(".remove-from-wishlist-url").attr("value")+"?pid="+r.attr("data-pid")),$.ajax({url:i,type:"GET",success:function(e){if(e.success){r.modal("hide"),$(document).trigger("toasterWishlist:close");var t=new URL(i,window.location.origin).searchParams.get("pid"),n=$(".add-to-wishlist-form").find('input[value="'+t+'"]').closest("form");n.find(".wishlist-wrapper").removeClass("added-to-wishlist"),n.find(".wishlist-wrapper").attr("data-tracking-click-event","add_to_wishlist"),n.attr("action",n.attr("action").replace("Wishlist-RemoveProduct","Wishlist-AddProduct")),p(t),f(null,"plp");let e=$("#removeConfirmationishlistModal").last();e&&e.modal("show")}},error:function(){}})})},productTileRemoveWishlistForm:()=>{$(document).off("click",".add-to-wishlist-form .added-to-wishlist .icon-heart-filled:not(.js-delete-from-wishlist):not(.remove-from-wishlist),  .add-to-wishlist-form .added-to-wishlist .remove-from-wishlist-text").on("click",".add-to-wishlist-form .added-to-wishlist .icon-heart-filled:not(.js-delete-from-wishlist):not(.remove-from-wishlist),  .add-to-wishlist-form .added-to-wishlist .remove-from-wishlist-text",function(){var e=$
41(this).closest(".wishlist-wrapper"),t=e.closest("form").find('input[name="pid"]').val();t||(t=$(this).closest("[data-pid]").data("pid"));var i=`${s}?pid=${t}`;i&&t&&$.get(i,function(){e.removeClass("added-to-wishlist"),p(t),f(null,"plp"),$(".wishlist-items-row").length&&window.location.reload(),$("body > .modal-backdrop").remove()})})},markWishlistIconsFromLocalStorage:f,addProductToWishlistStorage:h,removeProductFromWishlistStorage:p,variationUpdateWishlist:()=>{$("body").on("wishlist:updateModals",function(e,{pid:t}){l({pid:t})})},getWishlistFromStorage:d}}},1971:function(e,t,i){"use strict";var r=i(5814);e.exports=function(e,t){return void 0===t&&(t=!1),function(i,n,s){if(i)return void e(i);if(n.statusCode>=400&&n.statusCode<=599){var a=s;if(t)if(r.TextDecoder){var o,l=(void 0===(o=n.headers&&n.headers["content-type"])&&(o=""),o.toLowerCase().split(";").reduce(function(e,t){var i=t.split("="),r=i[0],n=i[1];return"charset"===r.trim()?n.trim():e},"utf-8"));try{a=new TextDecoder(l).decode(s)}catch(e){}}else a=String.fromCharCode.apply(null,new Uint8Array(s));e({cause:a});return}e(null,s)}}},8964:function(e,t,i){"use strict";var r=i(5814),n=i(5297),s=i(4524),a=i(2031),o=i(8112);d.httpHandler=i(1971),d.requestInterceptorsStorage=new a,d.responseInterceptorsStorage=new a,d.retryManager=new o;var l=function(e){var t={};return e&&e.trim().split("\n").forEach(function(e){var i=e.indexOf(":"),r=e.slice(0,i).trim().toLowerCase(),n=e.slice(i+1).trim();void 0===t[r]?t[r]=n:Array.isArray(t[r])?t[r].push(n):t[r]=[t[r],n]}),t};function u(e,t,i){var r=e;return s(t)?(i=t,"string"==typeof e&&(r={uri:e})):r=n({},t,{uri:e}),r.callback=i,r}function d(e,t,i){return c(t=u(e,t,i))}function c(e){if(void 0===e.callback)throw Error("callback argument missing");if(e.requestType&&d.requestInterceptorsStorage.getIsEnabled()){var t,i,r,n={uri:e.uri||e.url,headers:e.headers||{},body:e.body,metadata:e.metadata||{},retry:e.retry,timeout:e.timeout},s=d.requestInterceptorsStorage.execute(e.requestType,n);e.uri=s.uri,e.headers=s.headers,e.body=s.body,e.metadata=s.metadata,e.retry=s.retry,e.timeout=s.timeout}var a=!1,o=function(t,i,r){a||(a=!0,e.callback(t,i,r))};function u(t){if(clearTimeout(r),clearTimeout(e.retryTimeout),t instanceof Error||(t=Error(""+(t||"Unknown XMLHttpRequest Error"))),t.statusCode=0,!i&&d.retryManager.getIsEnabled()&&e.retry&&e.retry.shouldRetry()){e.retryTimeout=setTimeout(function(){e.retry.moveToNextAttempt(),e.xhr=p,c(e)},e.retry.getCurrentFuzzedDelay());return}if(e.requestType&&d.responseInterceptorsStorage.getIsEnabled()){var n={headers:b.headers||{},body:b.body,responseUrl:p.responseURL,responseType:p.responseType},s=d.responseInterceptorsStorage.execute(e.requestType,n);b.body=s.body,b.headers=s.headers}return o(t,b)}function h(){if(!i){clearTimeout(r),clearTimeout(e.retryTimeout);var t=e.useXDR&&void 0===p.status?200:1223===p.status?204:p.status,n=b,s=null;if(0!==t?(n={body:function(){var e=void 0;if(e=p.response?p.response:p.responseText||function(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(e){}return null}(p),_)try{e=JSON.parse(e)}catch(e){}return e}(),statusCode:t,method:m,headers:{},url:f,rawRequest:p},p.getAllResponseHeaders&&(n.headers=l(p.getAllResponseHeaders()))):s=Error("Internal XMLHttpRequest Error"),e.requestType&&d.responseInterceptorsStorage.getIsEnabled()){var a={headers:n.headers||{},body:n.body,responseUrl:p.responseURL,responseType:p.responseType},u=d.responseInterceptorsStorage.execute(e.requestType,a);n.body=u.body,n.headers=u.headers}return o(s,n,n.body)}}var p=e.xhr||null;p||(p=e.cors||e.useXDR?new d.XDomainRequest:new d.XMLHttpRequest);var f=p.url=e.uri||e.url,m=p.method=e.method||"GET",g=e.body||e.data,y=p.headers=e.headers||{},v=!!e.sync,_=!1,b={body:void 0,headers:{},statusCode:0,method:m,url:f,rawRequest:p};if("json"in e&&!1!==e.json&&(_=!0,y.accept||y.Accept||(y.Accept="application/json"),"GET"!==m&&"HEAD"!==m&&(y["content-type"]||y["Content-Type"]||(y["Content-Type"]="application/json"),g=JSON.stringify(!0===e.json?g:e.json))),p.onreadystatechange=function(){4!==p.readyState||d.responseInterceptorsStorage.getIsEnabled()||setTimeout(h,0)},p.onload=h,p.onerror=u,p.onprogress=function(){},p.onabort=function(){i=!0,clearTimeout(e.retryTimeout)},p.ontimeout=u,p.open(m,f,!v,e.username,e.password),v||(p.withCredentials=!!e.withCredentials),!v&&e.t
41imeout>0&&(r=setTimeout(function(){if(!i){i=!0,p.abort("timeout");var e=Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",u(e)}},e.timeout)),p.setRequestHeader)for(t in y)y.hasOwnProperty(t)&&p.setRequestHeader(t,y[t]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(p.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(p),p.send(g||null),p}e.exports=d,e.exports.default=d,d.XMLHttpRequest=r.XMLHttpRequest||function(){},d.XDomainRequest="withCredentials"in new d.XMLHttpRequest?d.XMLHttpRequest:r.XDomainRequest,function(e,t){for(var i=0;i<e.length;i++)t(e[i])}(["get","put","post","patch","head","delete"],function(e){d["delete"===e?"del":e]=function(t,i,r){return(i=u(t,i,r)).method=e.toUpperCase(),c(i)}})},2031:function(e){"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=Array(t);i<t;i++)r[i]=e[i];return r}e.exports=function(){function e(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var i=e.prototype;return i.getIsEnabled=function(){return this.enabled_},i.enable=function(){this.enabled_=!0},i.disable=function(){this.enabled_=!1},i.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},i.addInterceptor=function(e,t){this.typeToInterceptorsMap_.has(e)||this.typeToInterceptorsMap_.set(e,new Set);var i=this.typeToInterceptorsMap_.get(e);return!i.has(t)&&(i.add(t),!0)},i.removeInterceptor=function(e,t){var i=this.typeToInterceptorsMap_.get(e);return!!(i&&i.has(t))&&(i.delete(t),!0)},i.clearInterceptorsByType=function(e){return!!this.typeToInterceptorsMap_.get(e)&&(this.typeToInterceptorsMap_.delete(e),this.typeToInterceptorsMap_.set(e,new Set),!0)},i.clear=function(){return!!this.typeToInterceptorsMap_.size&&(this.typeToInterceptorsMap_=new Map,!0)},i.getForType=function(e){return this.typeToInterceptorsMap_.get(e)||new Set},i.execute=function(e,i){for(var r,n=this.getForType(e),s=function(e,i){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,i){if(e){if("string"==typeof e)return t(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t(e,i)}}(e))){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(n);!(r=s()).done;){var a=r.value;try{i=a(i)}catch(e){}}return i},e}()},8112:function(e){"use strict";var t=function(){function e(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1}var t=e.prototype;return t.getIsEnabled=function(){return this.enabled_},t.enable=function(){this.enabled_=!0},t.disable=function(){this.enabled_=!1},t.reset=function(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1},t.getMaxAttempts=function(){return this.maxAttempts_},t.setMaxAttempts=function(e){this.maxAttempts_=e},t.getDelayFactor=function(){return this.delayFactor_},t.setDelayFactor=function(e){this.delayFactor_=e},t.getFuzzFactor=function(){return this.fuzzFactor_},t.setFuzzFactor=function(e){this.fuzzFactor_=e},t.getInitialDelay=function(){return this.initialDelay_},t.setInitialDelay=function(e){this.initialDelay_=e},t.createRetry=function(e){var t=void 0===e?{}:e,r=t.maxAttempts,n=t.delayFactor,s=t.fuzzFactor,a=t.initialDelay;return new i({maxAttempts:r||this.maxAttempts_,delayFactor:n||this.delayFactor_,fuzzFactor:s||this.fuzzFactor_,initialDelay:a||this.initialDelay_})},e}(),i=function(){function e(e){this.maxAttempts_=e.maxAttempts,this.delayFactor_=e.delayFactor,this.fuzzFactor_=e.fuzzFactor,this.currentDelay_=e.initialDelay,this.currentAttempt_=1}var t=e.prototype;return t.moveToNextAttempt=function(){this.currentAttempt_++;var e=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+e},t.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},t.getCurrentDelay=function(){return this.currentDelay_},t.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},t.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},t.getCurrentFuzzedDelay=function(){var e=this.getCurrentMinPossibleDelay();return e+Math.random()*(this.getCurrentMaxPossibleDelay()-e)},e}();e.exports=t},3423:function(e,t,i){var r,n=void 0!==i.g?i.g:"undefined"!=typeof window?window:{},s=i(3533);"undefined"!=typeof document?r=document:(r=n["__GLOBAL_DOCUMENT_CACHE@4"])||(r=n["__GLOBAL_DOCUMENT_CACHE@4"]=s),e.exports=r},5814:function(e,t,i){e.exports="undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{}},4524:function(e){e.exports=function(e){if(!e)return!1;var i=t.call(e);return"[object Function]"===i||"function"==typeof e&&"[object RegExp]"!==i||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)};var t=Object.prototype.toString},3570:function(e,t,i){var r=i(9311).getUint64;e.exports=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8)},n=12;0===i.version?(i.earliestPresentationTime=t.getUint32(n),i.firstOffset=t.getUint32(n+4),n+=8):(i.earliestPresentationTime=r(e.subarray(n)),i.firstOffset=r(e.subarray(n+8)),n+=16),n+=2;var s=t.getUint16(n);for(n+=2;s>0;n+=12,s--)i.references.push({referenceType:(128&e[n])>>>7,referencedSize:0x7fffffff&t.getUint32(n),subsegmentDuration:t.getUint32(n+4),startsWithSap:!!(128&e[n+8]),sapType:(112&e[n+8])>>>4,sapDeltaTime:0xfffffff&t.getUint32(n+8)});return i}},4577:function(e){var t,i,r,n;t=function(e){return 9e4*e},i=function(e,t){return e*t},r=function(e){return e/9e4},e.exports={ONE_SECOND_IN_TS:9e4,secondsToVideoTs:t,secondsToAudioTs:i,videoTsToSeconds:r,audioTsToSeconds:n=function(e,t){return e/t},audioTsToVideoTs:function(e,i){return t(n(e,i))},videoTsToAudioTs:function(e,t){return i(r(e),t)},metadataTsToSeconds:function(e,t,i){return r(i?e:e-t)}}},9311:function(e){e.exports={getUint64:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.getBigUint64?(t=i.getBigUint64(0))<Number.MAX_SAFE_INTEGER?
41Number(t):t:0x100000000*i.getUint32(0)+i.getUint32(4)},MAX_UINT32:0x100000000}},423:function(e){let t={pingMaxTimeout:5e3,pingFrequency:6e3,pingUrl:`${location.protocol}//network-information-api.surge.sh/1b.txt`};function i(e){return new Promise(async(t,i)=>{if(navigator.connection=navigator.connection||navigator.mozConnection||navigator.webkitConnection,navigator.connection)return t(navigator.connection);let n=new r(e,{onInit:e=>{navigator.connection=Object.assign(e,{addEventListener(e,t){"change"===e&&n.onChangeAddCb(t)},removeEventListener(e,t){"change"===e&&n.onChangeRemoveCb(t)}}),t(navigator.connection)}})})}class r{constructor(e,i){if(this.options=Object.assign({},t,e),this.events=i,this.onChangeFns=[],this.options.pingFrequency-this.options.pingMaxTimeout<300)throw Error("Too little difference between pingFrequency and pingMaxTimeout.Difference must be more than 300ms.");this.prevStatus={},this.ping()}onChangeAddCb(e){-1===this.onChangeFns.indexOf(e)&&this.onChangeFns.push(e)}onChangeRemoveCb(e){let t=this.onChangeFns.indexOf(e);-1!==t&&this.onChangeFns.splice(t,1)}onChangeExecCbs(e){for(let t of this.onChangeFns)t(e)}async ping(){setTimeout(()=>{this.ping()},this.options.pingFrequency);let e=await this.makeRequest();console.log(e);let t=Object.assign({type:"cellular",saveData:!1},e<=1200?{effectiveType:"4g",rtt:300,downlink:1.7}:e<=2e3?{effectiveType:"3g",rtt:500,downlink:.5}:e<=3e3?{effectiveType:"2g",rtt:1500,downlink:.4}:e<=this.options.pingMaxTimeout?{effectiveType:"slow-2g",rtt:3e3,downlink:.2}:{effectiveType:"4g",rtt:300,downlink:1.7,type:"none"});this.prevStatus.effectiveType?(this.prevStatus.effectiveType!==t.effectiveType||this.prevStatus.type!==t.type)&&this.onChangeExecCbs(t):this.events.onInit&&this.events.onInit(t),this.prevStatus=t}
41makeRequest(){return new Promise(e=>{let t=new XMLHttpRequest,i=setTimeout(()=>{t.abort(),console.warn("network information api polyfill: max ping timeout exceed"),e(this.options.pingMaxTimeout+1)},this.options.pingMaxTimeout),r=this.options.pingUrl;r+=-1!==r.indexOf("?")?"&":"?",r+=`v${Math.random()}=${Math.random()}`,t.open("GET",r,!0),t.send();let n=new Date;t.onreadystatechange=()=>{4===t.readyState&&(clearTimeout(i),t.status>=200&&t.status<=599?e(new Date-n):(console.warn(`network information api polyfill: trouble with network. status: ${t.status}`),e(this.options.pingMaxTimeout+1)))}})}}"undefined"!=typeof window&&(window.NetworkInformationApiPolyfill=i),e.exports=i},1977:function(e,t,i){"use strict";let r,n,s,a,o,l;i.d(t,{Z:()=>sL});var u,d,c,h=i(5814),p=i.n(h),f=i(3423),m=i.n(f),g=i(8964),y=i.n(g),v=i(792),_=i.n(v);function b(){return(b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)({}).hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e}).apply(null,arguments)}var T="https://example.com";let w=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=p().location&&p().location.href||"");var i=/^\/\//.test(e),r=!p().location&&!/\/\//i.test(e),n=new URL(t,e=new(p()).URL(e,p().location||T));return r?n.href.slice(T.length):i?n.href.slice(n.protocol.length):n.href};var S=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(i,1),i>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2==arguments.length)for(var i=t.length,r=0;r<i;++r)t[r].call(this,arguments[1]);else for(var n=Array.prototype.slice.call(arguments,1),s=t.length,a=0;a<s;++a)t[a].apply(this,n)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",function(t){e.push(t)})},e}();function E(e){for(var t=p().atob?p().atob(e):Buffer.from(e,"base64").toString("binary"),i=new Uint8Array(t.length),r=0;r<t.length;r++)i[r]=t.charCodeAt(r);return i}class C extends S{constructor(){super(),this.buffer=""}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf("\n");t>-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}let k=function(e){let t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),i={};return t[1]&&(i.length=parseInt(t[1],10)),t[2]&&(i.offset=parseInt(t[2],10)),i},x=function(e){let t,i={};if(!e)return i;let r=e.split(RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),n=r.length;for(;n--;)""!==r[n]&&((t=/([^=]*)=(.*)/.exec(r[n]).slice(1))[0]=t[0].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^['"](.*)['"]$/g,"$1"),i[t[0]]=t[1]);return i},D=e=>{let t=e.split("x"),i={};return t[0]&&(i.width=parseInt(t[0],10)),t[1]&&(i.height=parseInt(t[1],10)),i};class I extends S{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,i;if(0!==(e=e.trim()).length){if("#"!==e[0])return void this.trigger("data",{type:"uri",uri:e});this.tagMappers.reduce((t,i)=>{let r=i(e);return r===e?t:t.concat([r])},[e]).forEach(e=>{for(let t=0;t<this.customParsers.length;t++)if(this.customParsers[t].call(this,e))return;if(0!==e.indexOf("#EXT"))return void this.trigger("data",{type:"comment",text:e.slice(1)});if(e=e.replace("\r",""),t=/^#EXTM3U/.exec(e))return void this.trigger("data",{type:"tag",tagType:"m3u"});if(t=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(e)){i={type:"tag",tagType:"inf"},t[1]&&(i.duration=parseFloat(t[1])),t[2]&&(i.title=t[2]),this.trigger("data",i);return}if(t=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(e)){i={type:"tag",tagType:"targetduration"},t[1]&&(i.duration=parseInt(t[1],10)),this.trigger("data",i);return}if(t=/^#EXT-X-VERSION:([0-9.]*)?/.exec(e)){i={type:"tag",tagType:"version"},t[1]&&(i.version=parseInt(t[1],10)),this.trigger("data",i);return}if(t=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(e)){i={type:"tag",tagType:"media-sequence"},t[1]&&(i.number=parseInt(t[1],10)),this.trigger("data",i);return}if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(e)){i={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(i.number=parseInt(t[1],10)),this.trigger("data",i);return}if(t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(e)){i={type:"tag",tagType:"playlist-type"},t[1]&&(i.playlistType=t[1]),this.trigger("data",i);return}if(t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(e)){i=b(k(t[1]),{type:"tag",tagType:"byterange"}),this.trigger("data",i);return}if(t=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(e)){i={type:"tag",tagType:"allow-cache"},t[1]&&(i.allowed=!/NO/.test(t[1])),this.trigger("data",i);return}if(t=/^#EXT-X-MAP:(.*)$/.exec(e)){if(i={type:"tag",tagType:"map"},t[1]){let e=x(t[1]);e.URI&&(i.uri=e.URI),e.BYTERANGE&&(i.byterange=k(e.BYTERANGE))}this.trigger("data",i);return}if(t=/^#EXT-X-STREAM-INF:(.*)$/.exec(e)){i={type:"tag",tagType:"stream-inf"},t[1]&&(i.attributes=x(t[1]),i.attributes.RESOLUTION&&(i.attributes.RESOLUTION=D(i.attributes.RESOLUTION)),i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes["FRAME-RATE"]&&(i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])),i.attributes["PROGRAM-ID"]&&(i.attributes["PROGRAM-ID"]=parseInt(i.attributes["PROGRAM-ID"],10))),this.trigger("data",i);return}if(t=/^#EXT-X-MEDIA:(.*)$/.exec(e)){i={type:"tag",tagType:"media"},t[1]&&(i.attributes=x(t[1])),this.trigger("data",i);return}if(t=/^#EXT-X-ENDLIST/.exec(e))return void this.trigger("data",{type:"tag",tagType:"endlist"});if(t=/^#EXT-X-DISCONTINUITY/.exec(e))return void this.trigger("data",{type:"tag",tagType:"discontinuity"});if(t=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(e)){i={type:"tag",tagType:"program-date-time"}
41,t[1]&&(i.dateTimeString=t[1],i.dateTimeObject=new Date(t[1])),this.trigger("data",i);return}if(t=/^#EXT-X-KEY:(.*)$/.exec(e)){i={type:"tag",tagType:"key"},t[1]&&(i.attributes=x(t[1]),i.attributes.IV&&("0x"===i.attributes.IV.substring(0,2).toLowerCase()&&(i.attributes.IV=i.attributes.IV.substring(2)),i.attributes.IV=i.attributes.IV.match(/.{8}/g),i.attributes.IV[0]=parseInt(i.attributes.IV[0],16),i.attributes.IV[1]=parseInt(i.attributes.IV[1],16),i.attributes.IV[2]=parseInt(i.attributes.IV[2],16),i.attributes.IV[3]=parseInt(i.attributes.IV[3],16),i.attributes.IV=new Uint32Array(i.attributes.IV))),this.trigger("data",i);return}if(t=/^#EXT-X-START:(.*)$/.exec(e)){i={type:"tag",tagType:"start"},t[1]&&(i.attributes=x(t[1]),i.attributes["TIME-OFFSET"]=parseFloat(i.attributes["TIME-OFFSET"]),i.attributes.PRECISE=/YES/.test(i.attributes.PRECISE)),this.trigger("data",i);return}if(t=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(e)){i={type:"tag",tagType:"cue-out-cont"},t[1]?i.data=t[1]:i.data="",this.trigger("data",i);return}if(t=/^#EXT-X-CUE-OUT:(.*)?$/.exec(e)){i={type:"tag",tagType:"cue-out"},t[1]?i.data=t[1]:i.data="",this.trigger("data",i);return}if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(e)){i={type:"tag",tagType:"cue-in"},t[1]?i.data=t[1]:i.data="",this.trigger("data",i);return}if((t=/^#EXT-X-SKIP:(.*)$/.exec(e))&&t[1]){(i={type:"tag",tagType:"skip"}).attributes=x(t[1]),i.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(i.attributes["SKIPPED-SEGMENTS"]=parseInt(i.attributes["SKIPPED-SEGMENTS"],10)),i.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(i.attributes["RECENTLY-REMOVED-DATERANGES"]=i.attributes["RECENTLY-REMOVED-DATERANGES"].split("	")),this.trigger("data",i);return}if((t=/^#EXT-X-PART:(.*)$/.exec(e))&&t[1]){(i={type:"tag",tagType:"part"}).attributes=x(t[1]),["DURATION"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))}),["INDEPENDENT","GAP"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/.test(i.attributes[e]))}),i.attributes.hasOwnProperty("BYTERANGE")&&(i.attributes.byterange=k(i.attributes.BYTERANGE)),this.trigger("data",i);return}if((t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(e))&&t[1]){(i={type:"tag",tagType:"server-control"}).attributes=x(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/.test(i.attributes[e]))}),this.trigger("data",i);return}if((t=/^#EXT-X-PART-INF:(.*)$/.exec(e))&&t[1]){(i={type:"tag",tagType:"part-inf"}).attributes=x(t[1]),["PART-TARGET"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))}),this.trigger("data",i);return}if((t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(e))&&t[1]){(i={type:"tag",tagType:"preload-hint"}).attributes=x(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(e){if(i.attributes.hasOwnProperty(e)){i.attributes[e]=parseInt(i.attributes[e],10);let t="BYTERANGE-LENGTH"===e?"length":"offset";i.attributes.byterange=i.attributes.byterange||{},i.attributes.byterange[t]=i.attributes[e],delete i.attributes[e]}}),this.trigger("data",i);return}if((t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(e))&&t[1]){(i={type:"tag",tagType:"rendition-report"}).attributes=x(t[1]),["LAST-MSN","LAST-PART"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseInt(i.attributes[e],10))}),this.trigger("data",i);return}if((t=/^#EXT-X-DATERANGE:(.*)$/.exec(e))&&t[1]){(i={type:"tag",tagType:"daterange"}).attributes=x(t[1]),["ID","CLASS"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=String(i.attributes[e]))}),["START-DATE","END-DATE"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=new Date(i.attributes[e]))}),["DURATION","PLANNED-DURATION"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))}),["END-ON-NEXT"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/i.test(i.attributes[e]))}),["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=i.attributes[e].toString(16))});let e=/^X-([A-Z]+-)+[A-Z]+$/;
41for(let t in i.attributes){if(!e.test(t))continue;let r=/[0-9A-Fa-f]{6}/g.test(i.attributes[t]),n=/^\d+(\.\d+)?$/.test(i.attributes[t]);i.attributes[t]=r?i.attributes[t].toString(16):n?parseFloat(i.attributes[t]):String(i.attributes[t])}this.trigger("data",i);return}if(t=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(e))return void this.trigger("data",{type:"tag",tagType:"independent-segments"});if(t=/^#EXT-X-I-FRAMES-ONLY/.exec(e))return void this.trigger("data",{type:"tag",tagType:"i-frames-only"});if(t=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(e)){(i={type:"tag",tagType:"content-steering"}).attributes=x(t[1]),this.trigger("data",i);return}if(t=/^#EXT-X-I-FRAME-STREAM-INF:(.*)$/.exec(e)){(i={type:"tag",tagType:"i-frame-playlist"}).attributes=x(t[1]),i.attributes.URI&&(i.uri=i.attributes.URI),i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes.RESOLUTION&&(i.attributes.RESOLUTION=D(i.attributes.RESOLUTION)),i.attributes["AVERAGE-BANDWIDTH"]&&(i.attributes["AVERAGE-BANDWIDTH"]=parseInt(i.attributes["AVERAGE-BANDWIDTH"],10)),i.attributes["FRAME-RATE"]&&(i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])),this.trigger("data",i);return}if(t=/^#EXT-X-DEFINE:(.*)$/.exec(e)){(i={type:"tag",tagType:"define"}).attributes=x(t[1]),this.trigger("data",i);return}this.trigger("data",{type:"tag",data:e.slice(4)})})}}addParser({expression:e,customType:t,dataParser:i,segment:r}){"function"!=typeof i&&(i=e=>e),this.customParsers.push(n=>{if(e.exec(n))return this.trigger("data",{type:"custom",data:i(n),customType:t,segment:r}),!0})}addTagMapper({expression:e,map:t}){this.tagMappers.push(i=>e.test(i)?t(i):i)}}let A=function(e){let t={};return Object.keys(e).forEach(function(i){t[i.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase())]=e[i]}),t},O=function(e){let{serverControl:t,targetDuration:i,partTargetDuration:r}=e;if(!t)return;let n="#EXT-X-SERVER-CONTROL",s="holdBack",a="partHoldBack",o=i&&3*i,l=r&&2*r;i&&!t.hasOwnProperty(s)&&(t[s]=o,this.trigger("info",{message:`${n} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})),o&&t[s]<o&&(this.trigger("warn",{message:`${n} clamping HOLD-BACK (${t[s]}) to targetDuration * 3 (${o})`}),t[s]=o),r&&!t.hasOwnProperty(a)&&(t[a]=3*r,this.trigger("info",{message:`${n} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${t[a]}).`})),r&&t[a]<l&&(this.trigger("warn",{message:`${n} clamping PART-HOLD-BACK (${t[a]}) to partTargetDuration * 2 (${l}).`}),t[a]=l)};class L extends S{constructor(e={}){let t,i;super(),this.lineStream=new C,this.parseStream=new I,this.lineStream.pipe(this.parseStream),this.mainDefinitions=e.mainDefinitions||{},this.params=new URL(e.uri,"https://a.com").searchParams,this.lastProgramDateTime=null;let r=this,n=[],s={},a=!1,o=function(){},l={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},u=0;this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],iFramePlaylists:[],segments:[]};let d=0,c=0,h={};this.on("end",()=>{!s.uri&&(s.parts||s.preloadHints)&&(!s.map&&t&&(s.map=t),!s.key&&i&&(s.key=i),s.timeline||"number"!=typeof u||(s.timeline=u),this.manifest.preloadSegment=s)}),this.parseStream.on("data",function(e){let p,f;if(r.manifest.definitions){for(let t in r.manifest.definitions)if(e.uri&&(e.uri=e.uri.replace(`{$${t}}`,r.manifest.definitions[t])),e.attributes)for(let i in e.attributes)"string"==typeof e.attributes[i]&&(e.attributes[i]=e.attributes[i].replace(`{$${t}}`,r.manifest.definitions[t]))}({tag(){(({version(){e.version&&(this.manifest.version=e.version)},"allow-cache"(){this.manifest.allowCache=e.allowed,"allowed"in e||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){let t={};"length"in e&&(s.byterange=t,t.length=e.length,"offset"in e||(e.offset=d)),"offset"in e&&(s.byterange=t,t.offset=e.offset),d=t.offset+t.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),e.title&&(s.title=e.title),e.duration>0&&(s.duration=e.duration),0===e.duration&&(s.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=n},key(){if(!e.attributes)return void this.trigger("warn",{message:"ignoring key declaration without attribute list"});if("NONE"===e.attributes.METHOD){i=null;return}if(!e.attributes.URI)return void this.trigger("warn",{message:"ignoring key declaration without URI"});if("com.apple.streamingkeydelivery"===e.attributes.KEYFORMAT){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:e.attributes};return}if("com.microsoft.playready"===e.attributes.KEYFORMAT){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:e.attributes.URI};return}if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===e.attributes.KEYFORMAT)return -1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(e.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===e.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==e.attributes.URI.substring(0,23))?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):e.attributes.KEYID&&"0x"===e.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:e.attributes.KEYFORMAT,keyId:e.attributes.KEYID.substring(2)},pssh:E(e.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"});e.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),i={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI},void 0!==e.attributes.IV&&(i.iv=e.attributes.IV)},"media-sequence"(){if(!isFinite(e.number))return void this.trigger("warn",{message:"ignoring invalid media sequence: "+e.number});this.manifest.mediaSequence=e.number},"discontinuity-sequence"(){if(!isFinite(e.number))return void this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+e.number});this.manifest.discontinuitySequence=e.number,u=e.number},"playlist-type"(){if(!/VOD|EVENT/.test(e.playlistType))return void this.trigger("warn",{message:"ignoring unknown playlist type: "+e.playlist});this.manifest.playlistType=e.playlistType},map(){t={}
41,e.uri&&(t.uri=e.uri),e.byterange&&(t.byterange=e.byterange),i&&(t.key=i)},"stream-inf"(){if(this.manifest.playlists=n,this.manifest.mediaGroups=this.manifest.mediaGroups||l,!e.attributes)return void this.trigger("warn",{message:"ignoring empty stream-inf attributes"});s.attributes||(s.attributes={}),b(s.attributes,e.attributes)},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||l,!(e.attributes&&e.attributes.TYPE&&e.attributes["GROUP-ID"]&&e.attributes.NAME))return void this.trigger("warn",{message:"ignoring incomplete or missing media group"});let t=this.manifest.mediaGroups[e.attributes.TYPE];t[e.attributes["GROUP-ID"]]=t[e.attributes["GROUP-ID"]]||{},p=t[e.attributes["GROUP-ID"]],(f={default:/yes/i.test(e.attributes.DEFAULT)}).default?f.autoselect=!0:f.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(f.language=e.attributes.LANGUAGE),e.attributes.URI&&(f.uri=e.attributes.URI),e.attributes["INSTREAM-ID"]&&(f.instreamId=e.attributes["INSTREAM-ID"]),e.attributes.CHARACTERISTICS&&(f.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(f.forced=/yes/i.test(e.attributes.FORCED)),p[e.attributes.NAME]=f},discontinuity(){u+=1,s.discontinuity=!0,this.manifest.discontinuityStarts.push(n.length)},"program-date-time"(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),s.dateTimeString=e.dateTimeString,s.dateTimeObject=e.dateTimeObject;let{lastProgramDateTime:t}=this;this.lastProgramDateTime=new Date(e.dateTimeString).getTime(),null===t&&this.manifest.segments.reduceRight((e,t)=>(t.programDateTime=e-1e3*t.duration,t.programDateTime),this.lastProgramDateTime)},targetduration(){if(!isFinite(e.duration)||e.duration<0)return void this.trigger("warn",{message:"ignoring invalid target duration: "+e.duration});this.manifest.targetDuration=e.duration,O.call(this,this.manifest)},start(){if(!e.attributes||isNaN(e.attributes["TIME-OFFSET"]))return void this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});this.manifest.start={timeOffset:e.attributes["TIME-OFFSET"],precise:e.attributes.PRECISE}},"cue-out"(){s.cueOut=e.data},"cue-out-cont"(){s.cueOutCont=e.data},"cue-in"(){s.cueIn=e.data},skip(){this.manifest.skip=A(e.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",e.attributes,["SKIPPED-SEGMENTS"])},part(){a=!0;let t=this.manifest.segments.length,i=A(e.attributes);s.parts=s.parts||[],s.parts.push(i),i.byterange&&(i.byterange.hasOwnProperty("offset")||(i.byterange.offset=c),c=i.byterange.offset+i.byterange.length);let r=s.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${r} for segment #${t}`,e.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((e,t)=>{e.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${t} lacks required attribute(s): LAST-PART`})})},"server-control"(){let t=this.manifest.serverControl=A(e.attributes);t.hasOwnProperty("canBlockReload")||(t.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),O.call(this,this.manifest),t.canSkipDateranges&&!t.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){let t=this.manifest.segments.length,i=A(e.attributes),r=i.type&&"PART"===i.type;s.preloadHints=s.preloadHints||[],s.preloadHints.push(i),i.byterange&&!i.byterange.hasOwnProperty("offset")&&(i.byterange.offset=r?c:0,r&&(c=i.byterange.offset+i.byterange.length));let n=s.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${n} for segment #${t}`,e.attributes,["TYPE","URI"]),i.type)for(let e=0;e<s.preloadHints.length-1;e++){let r=s.preloadHints[e];r.type&&r.type===i.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${n} for segment #${t} has the same TYPE ${i.type} as preload hint #${e}`})}},"rendition-report"(){let t=A(e.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(t);let i=this.manifest.renditionReports.length-1,r=["LAST-MSN","URI"];a&&r.push("LAST-PART"),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${i}`,e.attributes,r)},"part-inf"(){this.manifest.partInf=A(e.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",e.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),O.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(A(e.attributes));let t=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${t}`,e.attributes,["ID","START-DATE"]);let i=this.manifest.dateRanges[t];i.endDate&&i.startDate&&new Date(i.endDate)<new Date(i.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"}),i.duration&&i.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),i.plannedDuration&&i.plannedDuration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});let r=!!i.endOnNext;if(r&&!i.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT
41=YES attribute must have a CLASS attribute"}),r&&(i.duration||i.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"}),i.duration&&i.endDate){let e=i.startDate.getTime()+1e3*i.duration;this.manifest.dateRanges[t].endDate=new Date(e)}if(h[i.id]){for(let e in h[i.id])if(i[e]&&JSON.stringify(h[i.id][e])!==JSON.stringify(i[e])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}let e=this.manifest.dateRanges.findIndex(e=>e.id===i.id);this.manifest.dateRanges[e]=b(this.manifest.dateRanges[e],i),h[i.id]=b(h[i.id],i),this.manifest.dateRanges.pop()}else h[i.id]=i},"independent-segments"(){this.manifest.independentSegments=!0},"i-frames-only"(){this.manifest.iFramesOnly=!0,this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering"(){this.manifest.contentSteering=A(e.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",e.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};let t=(e,t)=>{if(e in this.manifest.definitions)return void this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${e}`});this.manifest.definitions[e]=t};if("QUERYPARAM"in e.attributes){if("NAME"in e.attributes||"IMPORT"in e.attributes)return void this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});let i=this.params.get(e.attributes.QUERYPARAM);return i?void t(e.attributes.QUERYPARAM,decodeURIComponent(i)):void this.trigger("error",{message:`EXT-X-DEFINE: No query param ${e.attributes.QUERYPARAM}`})}return"NAME"in e.attributes?"IMPORT"in e.attributes?void this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"}):"VALUE"in e.attributes&&"string"==typeof e.attributes.VALUE?void t(e.attributes.NAME,e.attributes.VALUE):void this.trigger("error",{message:`EXT-X-DEFINE: No value for ${e.attributes.NAME}`}):"IMPORT"in e.attributes?this.mainDefinitions[e.attributes.IMPORT]?void t(e.attributes.IMPORT,this.mainDefinitions[e.attributes.IMPORT]):void this.trigger("error",{message:`EXT-X-DEFINE: No value ${e.attributes.IMPORT} to import, or IMPORT used on main playlist`}):void this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:e.attributes,uri:e.uri,timeline:u}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",e.attributes,["BANDWIDTH","URI"])}})[e.tagType]||o).call(r)},uri(){s.uri=e.uri,n.push(s),!this.manifest.targetDuration||"duration"in s||(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),s.duration=this.manifest.targetDuration),i&&(s.key=i),s.timeline=u,t&&(s.map=t),c=0,null!==this.lastProgramDateTime&&(s.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=1e3*s.duration),s={}},comment(){},custom(){e.segment?(s.custom=s.custom||{},s.custom[e.customType]=e.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[e.customType]=e.data)}})[e.type].call(r)})}requiredCompatibilityversion(e,t){(e<t||!e)&&this.trigger("warn",{message:`manifest must be at least version ${t}`})}warnOnMissingAttributes_(e,t,i){let r=[];i.forEach(function(e){t.hasOwnProperty(e)||r.push(e)}),r.length&&this.trigger("warn",{message:`${e} lacks required attribute(s): ${r.join(", ")}`})}push(e){this.lineStream.push(e)}end(){this.lineStream.push("\n"),this.manifest.dateRanges.length&&null===this.lastProgramDateTime&&this.trigger("warn",{message:"A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"}),this.lastProgramDateTime=null,this.trigger("end")}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}}var P={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^/},N=["video","audio","text"],M=["Video","Audio","Text"],R=function(e){return e?e.replace(/avc1\.(\d+)\.(\d+)/i,function(e,t,i){return"avc1."+("00"+Number(t).toString(16)).slice(-2)+"00"+("00"+Number(i).toString(16)).slice(-2)}):e},U=function(e){void 0===e&&(e="");var t=e.split(","),i=[];return t.forEach(function(e){var t;
41e=e.trim(),N.forEach(function(r){var n=P[r].exec(e.toLowerCase());if(n&&!(n.length<=1)){t=r;var s=e.substring(0,n[1].length),a=e.replace(s,"");i.push({type:s,details:a,mediaType:r})}}),t||i.push({type:e,details:"",mediaType:"unknown"})}),i},B=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var i=e.mediaGroups.AUDIO[t];if(!i)return null;for(var r in i){var n=i[r];if(n.default&&n.playlists)return U(n.playlists[0].attributes.CODECS)}return null},j=function(e){return void 0===e&&(e=""),P.audio.test(e.trim().toLowerCase())},q=function(e){if(e&&"string"==typeof e){var t,i=e.toLowerCase().split(",").map(function(e){return R(e.trim())}),r="video";1===i.length&&j(i[0])?r="audio":1===i.length&&(void 0===(t=i[0])&&(t=""),P.text.test(t.trim().toLowerCase()))&&(r="application");var n="mp4";return i.every(function(e){return P.mp4.test(e)})?n="mp4":i.every(function(e){return P.webm.test(e)})?n="webm":i.every(function(e){return P.ogg.test(e)})&&(n="ogg"),r+"/"+n+';codecs="'+e+'"'}},F=function(e,t){return void 0===e&&(e=""),void 0===t&&(t=!1),p().MediaSource&&p().MediaSource.isTypeSupported&&p().MediaSource.isTypeSupported(q(e))||t&&p().ManagedMediaSource&&p().ManagedMediaSource.isTypeSupported&&p().ManagedMediaSource.isTypeSupported(q(e))||!1},H=function(e){return void 0===e&&(e=""),e.toLowerCase().split(",").every(function(e){e=e.trim();for(var t=0;t<M.length;t++)if(P["muxer"+M[t]].test(e))return!0;return!1})},z="mp4a.40.2",V=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,W=/^application\/dash\+xml/i,G=function(e){return V.test(e)?"hls":W.test(e)?"dash":"application/vnd.videojs.vhs+json"===e?"vhs-json":null},X=function(e){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},Y=function(e){return e instanceof Uint8Array?e:(Array.isArray(e)||X(e)||e instanceof ArrayBuffer||(e="number"!=typeof e||"number"==typeof e&&e!=e?0:[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},K=p().BigInt||Number,Q=[K("0x1"),K("0x100"),K("0x10000"),K("0x1000000"),K("0x100000000"),K("0x10000000000"),K("0x1000000000000"),K("0x100000000000000"),K("0x10000000000000000")];255===(d=new Uint8Array((u=new Uint16Array([65484])).buffer,u.byteOffset,u.byteLength))[0]||d[0];var J=function(e,t){var i=void 0===t?{}:t,r=i.signed,n=i.le,s=void 0!==n&&n;e=Y(e);var a=s?"reduce":"reduceRight",o=(e[a]?e[a]:Array.prototype[a]).call(e,function(t,i,r){var n=s?r:Math.abs(r+1-e.length);return t+K(i)*Q[n]},K(0));if(void 0!==r&&r){var l=Q[e.length]/K(2)-K(1);(o=K(o))>l&&(o-=l,o-=l,o-=K(2))}return Number(o)},Z=function(e,t){var i=(void 0===t?{}:t).le,r=void 0!==i&&i;("bigint"!=typeof e&&"number"!=typeof e||"number"==typeof e&&e!=e)&&(e=0);for(var n=Math.ceil((e=K(e)).toString(2).length/8),s=new Uint8Array(new ArrayBuffer(n)),a=0;a<n;a++){var o=r?a:Math.abs(a+1-s.length);s[o]=Number(e/Q[a]&K(255)),e<0&&(s[o]=Math.abs(~s[o]),s[o]-=0===a?1:2)}return s},ee=function(e){if(!e)return"";e=Array.prototype.slice.call(e);var t=String.fromCharCode.apply(null,Y(e));try{return decodeURIComponent(escape(t))}catch(e){}return t},et=function(e,t){if("string"!=typeof e&&e&&"function"==typeof e.toString&&(e=e.toString()),"string"!=typeof e)return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var i=new Uint8Array(e.length),r=0;r<e.length;r++)i[r]=e.charCodeAt(r);return i},ei=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];if((t=t.filter(function(e){return e&&(e.byteLength||e.length)&&"string"!=typeof e})).length<=1)return Y(t[0]);var r=new Uint8Array(t.reduce(function(e,t,i){return e+(t.byteLength||t.length)},0)),n=0;return t.forEach(function(e){e=Y(e),r.set(e,n),n+=e.byteLength}),r},er=function(e,t,i){var r=void 0===i?{}:i,n=r.offset,s=void 0===n?0:n,a=r.mask,o=void 0===a?[]:a;e=Y(e);var l=(t=Y(t)).every?t.every:Array.prototype.every;return t.length&&e.length-s>=t.length&&l.call(t,function(t,i){return t===(o[i]?o[i]&e[s+i]:e[s+i])})},en=function(e,t,i){t.forEach(function(t){for(var r in e.mediaGroups[t])for(var n in e.mediaGroups[t][r])i(e.mediaGroups[t][r][n],t,r,n)})},es=i(3969);let ea=e=>!!e&&"object"==typeof e,eo=(...e)=>e.reduce((e,t)=>
41("object"!=typeof t||Object.keys(t).forEach(i=>{Array.isArray(e[i])&&Array.isArray(t[i])?e[i]=e[i].concat(t[i]):ea(e[i])&&ea(t[i])?e[i]=eo(e[i],t[i]):e[i]=t[i]}),e),{}),el=e=>Object.keys(e).map(t=>e[t]),eu=e=>e.reduce((e,t)=>e.concat(t),[]),ed=e=>{if(!e.length)return[];let t=[];for(let i=0;i<e.length;i++)t.push(e[i]);return t},ec=({baseUrl:e="",source:t="",range:i="",indexRange:r=""})=>{let n={uri:t,resolvedUri:w(e||"",t)};if(i||r){let e,t=(i||r).split("-"),s=p().BigInt?p().BigInt(t[0]):parseInt(t[0],10),a=p().BigInt?p().BigInt(t[1]):parseInt(t[1],10);s<Number.MAX_SAFE_INTEGER&&"bigint"==typeof s&&(s=Number(s)),a<Number.MAX_SAFE_INTEGER&&"bigint"==typeof a&&(a=Number(a)),"bigint"==typeof(e="bigint"==typeof a||"bigint"==typeof s?p().BigInt(a)-p().BigInt(s)+p().BigInt(1):a-s+1)&&e<Number.MAX_SAFE_INTEGER&&(e=Number(e)),n.byterange={length:e,offset:s}}return n},eh=e=>(e&&"number"!=typeof e&&(e=parseInt(e,10)),isNaN(e))?null:e,ep={static(e){let{duration:t,timescale:i=1,sourceDuration:r,periodDuration:n}=e,s=eh(e.endNumber),a=t/i;return"number"==typeof s?{start:0,end:s}:"number"==typeof n?{start:0,end:n/a}:{start:0,end:r/a}},dynamic(e){let{NOW:t,clientOffset:i,availabilityStartTime:r,timescale:n=1,duration:s,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:l=1/0}=e,u=eh(e.endNumber),d=(t+i)/1e3,c=r+a,h=Math.ceil((d+o-c)*n/s),p=Math.floor((d-c-l)*n/s),f=Math.floor((d-c)*n/s);return{start:Math.max(0,p),end:"number"==typeof u?u:Math.min(h,f)}}},ef=e=>{let{type:t,duration:i,timescale:r=1,periodDuration:n,sourceDuration:s}=e,{start:a,end:o}=ep[t](e),l=((e,t)=>{let i=[];for(let r=e;r<t;r++)i.push(r);return i})(a,o).map(t=>{let{duration:i,timescale:r=1,periodStart:n,startNumber:s=1}=e;return{number:s+t,duration:i/r,timeline:n,time:t*i}});if("static"===t){let e=l.length-1;l[e].duration=("number"==typeof n?n:s)-i/r*e}return l},em=e=>{let{baseUrl:t,initialization:i={},sourceDuration:r,indexRange:n="",periodStart:s,presentationTime:a,number:o=0,duration:l}=e;if(!t)throw Error("NO_BASE_URL");let u=ec({baseUrl:t,source:i.sourceURL,range:i.range}),d=ec({baseUrl:t,source:t,indexRange:n});if(d.map=u,l){let t=ef(e);t.length&&(d.duration=t[0].duration,d.timeline=t[0].timeline)}else r&&(d.duration=r,d.timeline=s);return d.presentationTime=a||s,d.number=o,[d]},eg=(e,t,i)=>{let r,n=e.sidx.map?e.sidx.map:null,s=e.sidx.duration,a=e.timeline||0,o=e.sidx.byterange,l=o.offset+o.length,u=t.timescale,d=t.references.filter(e=>1!==e.referenceType),c=[],h=e.endList?"static":"dynamic",f=e.sidx.timeline,m=f,g=e.mediaSequence||0;r="bigint"==typeof t.firstOffset?p().BigInt(l)+t.firstOffset:l+t.firstOffset;for(let e=0;e<d.length;e++){let o,l=t.references[e],d=l.referencedSize,y=l.subsegmentDuration;o="bigint"==typeof r?r+p().BigInt(d)-p().BigInt(1):r+d-1;let v={baseUrl:i,timescale:u,timeline:a,periodStart:f,presentationTime:m,number:g,duration:y,sourceDuration:s,indexRange:`${r}-${o}`,type:h},_=em(v)[0];n&&(_.map=n),c.push(_),"bigint"==typeof r?r+=p().BigInt(d):r+=d,m+=y/u,g++}return e.segments=c,e},ey=["AUDIO","SUBTITLES"],ev=1/60,e_=e=>{let t;return(t=({timeline:e})=>e,el(e.reduce((e,i)=>(i.forEach(i=>{e[t(i)]=i}),e),{}))).sort((e,t)=>e.timeline>t.timeline?1:-1)},eb=e=>{let t=[];return en(e,ey,(e,i,r,n)=>{t=t.concat(e.playlists||[])}),t},eT=({playlist:e,mediaSequence:t})=>{e.mediaSequence=t,e.segments.forEach((t,i)=>{t.number=e.mediaSequence+i})},ew=e=>{var t;let i;return e&&e.uri+"-"+(i="bigint"==typeof(t=e.byterange).offset||"bigint"==typeof t.length?p().BigInt(t.offset)+p().BigInt(t.length)-p().BigInt(1):t.offset+t.length-1,`${t.offset}-${i}`)},eS=e=>{let t=e.reduce(function(e,t){return e[t.attributes.baseUrl]||(e[t.attributes.baseUrl]=[]),e[t.attributes.baseUrl].push(t),e},{}),i=[];return Object.values(t).forEach(e=>{let t=el(e.reduce((e,t)=>{let i=t.attributes.id+(t.attributes.lang||"");return e[i]?(t.segments&&(t.segments[0]&&(t.segments[0].discontinuity=!0),e[i].segments.push(...t.segments)),t.attributes.contentProtection&&(e[i].attributes.contentProtection=t.attributes.contentProtection)):(e[i]=t,e[i].attributes.timelineStarts=[]),e[i].attributes.timelineStarts.push({start:t.attributes.periodStart,timeline:t.attributes.periodStart}),e},{}));i=i.concat(t)}),i.map(e=>(e.discontinuityStarts=(e.segments||[]).reduce((e,t,i)=>(t.discontinuity&&e.push(i),e),[]),e))},eE=(e,t)=>{let i=ew(e.sidx),r=i&&t[i]&&t[i].sidx;return r&&eg(e,r,e.sidx.resolvedUri),e},eC=({attributes:e,segments:t,sidx:i,discontinuityStarts:r})=>{let n={attributes:{NAME:e.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:e.width,height:e.height},CODECS:e.codecs,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1},uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuityStarts:r,timelineStarts:e.timelineStarts,segments:t};return e.frameRate&&(n.attributes["FRAME-RATE"]=e.frameRate),e.contentProtection&&(n.contentProtection=e.contentProtection),e.serviceLocation&&(n.attributes.serviceLocation=e.serviceLocation),i&&(n.sidx=i),n},ek=({attributes:e})=>"video/mp4"===e.mimeType||"video/webm"===e.mimeType||"video"===e.contentType,ex=({attributes:e})=>"audio/mp4"===e.mimeType||"audio/webm"===e.mimeType||"audio"===e.contentType,eD=({attributes:e})=>"text/vtt"===e.mimeType||"text"===e.contentType,eI=e=>e?Object.keys(e).reduce((t,i)=>{let r=e[i];return t.concat(r.playlists)},[]):[],eA=(e,t,i)=>{let{NOW:r,clientOffset:n,availabilityStartTime:s,timescale:a=1,periodStart:o=0,minimumUpdatePeriod:l=0}=e;return Math.ceil((((r+n)/1e3+l-(s+o))*a-t)/i)},eO=(e,t)=>{let{type:i,minimumUpdatePeriod:r=0,media:n="",sourceDuration:s,timescale:a=1,startNumber:o=1,periodStart:l}=e,u=[],d=-1;for(let c=0;c<t.length;c++){let h,p=t[c],f=p.d,m=p.r||0,g=p.t||0;if(d<0&&(d=g),g&&g>d&&(d=g),m<0){let o=c+1;h=o===t.length?"dynamic"===i&&r>0&&n.indexOf("$Number$")>0?eA(e,d,f):(s*a-d)/f:(t[o].t-d)/f}else h=m+1;let y=o+u.length+h,v=o+u.length;for(;v<y;)u.push({number:v,duration:f/a,time:d,timeline:l}),d+=f,v++}return u},eL=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,eP=(e,t)=>e.replace(eL,(e,i,r,n)=>{if("$$"===e)return"$";if(void 0===t[i])return e;let s=""+t[i];return"RepresentationID"===i||(n=r?parseInt(n,10):1,s.length>=n)?s:`${Array(n-s.length+1).join("0")}${s}`}),eN=(e,t)=>{let i={RepresentationID:e.id,Bandwidth:e.bandwidth||0},{initialization:r={sourceURL:"",range:""}}
41=e,n=ec({baseUrl:e.baseUrl,source:eP(r.sourceURL,i),range:r.range});return(!e.duration&&!t?[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}]:e.duration?ef(e):eO(e,t)).map(t=>{i.Number=t.number,i.Time=t.time;let r=eP(e.media||"",i),s=e.timescale||1,a=e.presentationTimeOffset||0,o=e.periodStart+(t.time-a)/s;return{uri:r,timeline:t.timeline,duration:t.duration,resolvedUri:w(e.baseUrl||"",r),map:n,number:t.number,presentationTime:o}})},eM=(e,t)=>{let i,{duration:r,segmentUrls:n=[],periodStart:s}=e;if(!r&&!t||r&&t)throw Error("SEGMENT_TIME_UNSPECIFIED");let a=n.map(t=>((e,t)=>{let{baseUrl:i,initialization:r={}}=e,n=ec({baseUrl:i,source:r.sourceURL,range:r.range}),s=ec({baseUrl:i,source:t.media,range:t.mediaRange});return s.map=n,s})(e,t));return r&&(i=ef(e)),t&&(i=eO(e,t)),i.map((t,i)=>{if(a[i]){let r=a[i],n=e.timescale||1,o=e.presentationTimeOffset||0;return r.timeline=t.timeline,r.duration=t.duration,r.number=t.number,r.presentationTime=s+(t.time-o)/n,r}}).filter(e=>e)},eR=({attributes:e,segmentInfo:t})=>{let i,r;t.template?(r=eN,i=eo(e,t.template)):t.base?(r=em,i=eo(e,t.base)):t.list&&(r=eM,i=eo(e,t.list));let n={attributes:e};if(!r)return n;let s=r(i,t.segmentTimeline);if(i.duration){let{duration:e,timescale:t=1}=i;i.duration=e/t}else s.length?i.duration=s.reduce((e,t)=>Math.max(e,Math.ceil(t.duration)),0):i.duration=0;return n.attributes=i,n.segments=s,t.base&&i.indexRange&&(n.sidx=s[0],n.segments=[]),n},e$=(e,t)=>ed(e.childNodes).filter(({tagName:e})=>e===t),eU=e=>e.textContent.trim(),eB=e=>{let t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!t)return 0;let[i,r,n,s,a,o]=t.slice(1);return 31536e3*parseFloat(i||0)+2592e3*parseFloat(r||0)+86400*parseFloat(n||0)+3600*parseFloat(s||0)+60*parseFloat(a||0)+parseFloat(o||0)},ej={mediaPresentationDuration:e=>eB(e),availabilityStartTime:e=>{var t;return t=e,/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t)&&(t+="Z"),Date.parse(t)/1e3},minimumUpdatePeriod:e=>eB(e),suggestedPresentationDelay:e=>eB(e),type:e=>e,timeShiftBufferDepth:e=>eB(e),start:e=>eB(e),width:e=>parseInt(e,10),height:e=>parseInt(e,10),bandwidth:e=>parseInt(e,10),frameRate:e=>parseFloat(e.split("/").reduce((e,t)=>e/t)),startNumber:e=>parseInt(e,10),timescale:e=>parseInt(e,10),presentationTimeOffset:e=>parseInt(e,10),duration(e){let t=parseInt(e,10);return isNaN(t)?eB(e):t},d:e=>parseInt(e,10),t:e=>parseInt(e,10),r:e=>parseInt(e,10),presentationTime:e=>parseInt(e,10),DEFAULT:e=>e},eq=e=>e&&e.attributes?ed(e.attributes).reduce((e,t)=>{let i=ej[t.name]||ej.DEFAULT;return e[t.name]=i(t.value),e},{}):{},eF={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},eH=(e,t)=>t.length?eu(e.map(function(e){return t.map(function(t){let i=eU(t),r=w(e.baseUrl,i),n=eo(eq(t),{baseUrl:r});return r!==i&&!n.serviceLocation&&e.serviceLocation&&(n.serviceLocation=e.serviceLocation),n})})):e,ez=e=>{let t=e$(e,"SegmentTemplate")[0],i=e$(e,"SegmentList")[0],r=i&&e$(i,"SegmentURL").map(e=>eo({tag:"SegmentURL"},eq(e))),n=e$(e,"SegmentBase")[0],s=i||t,a=s&&e$(s,"SegmentTimeline")[0],o=i||n||t,l=o&&e$(o,"Initialization")[0],u=t&&eq(t);u&&l?u.initialization=l&&eq(l):u&&u.initialization&&(u.initialization={sourceURL:u.initialization});let d={template:u,segmentTimeline:a&&e$(a,"S").map(e=>eq(e)),list:i&&eo(eq(i),{segmentUrls:r,initialization:eq(l)}),base:n&&eo(eq(n),{initialization:eq(l)})};return Object.keys(d).forEach(e=>{d[e]||delete d[e]}),d},eV=e=>eu(e$(e.node,"EventStream").map(t=>{let i=eq(t),r=i.schemeIdUri;return e$(t,"Event").map(t=>{let n=eq(t),s=n.presentationTime||0,a=i.timescale||1,o=n.duration||0,l=s/a+e.attributes.start;return{schemeIdUri:r,value:i.value,id:n.id,start:l,end:l+o/a,messageData:eU(t)||n.messageData,contentEncoding:i.contentEncoding,presentationTimeOffset:i.presentationTimeOffset||0}})})),eW=e=>{let t,i;if(""===e)throw Error("DASH_EMPTY_MANIFEST");let r=new es.DOMParser;try{i=(t=r.parseFromString(e,"application/xml"))&&"MPD"===t.documentElement.tagName?t.documentElement:null}catch(e){}if(!i||i&&i.getElementsByTagName("parsererror").length>0)throw Error("DASH_INVALID_XML");return i};var eG=i(3570),eX=i.n(eG),eY=Y([73,68,51]),eK=function(e,t){void 0===t&&(t=0);var i=(e=Y(e))[t+5],r=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&i)>>4?r+20:r+10},eQ=function e(t,i){return(void 0===i&&(i=0),(t=Y(t)).length-i<10||!er(t,eY,{offset:i}))?i:(i+=eK(t,i),e(t,i))};
41new Uint8Array([79,112,117,115,72,101,97,100]);var eJ=function(e){return"string"==typeof e?et(e):e},eZ=function(e){e=Y(e);for(var t=[],i=0;e.length>i;){var r=e[i],n=0,s=0,a=e[++s];for(s++;128&a;)n=(127&a)<<7,a=e[s],s++;n+=127&a;for(var o=0;o<c.length;o++){var l=c[o],u=l.id,d=l.parser;if(r===u){t.push(d(e.subarray(s,s+n)));break}}i+=n+s}return t};c=[{id:3,parser:function(e){var t={tag:3,id:e[0]<<8|e[1],flags:e[2],size:3,dependsOnEsId:0,ocrEsId:0,descriptors:[],url:""};if(128&t.flags&&(t.dependsOnEsId=e[t.size]<<8|e[t.size+1],t.size+=2),64&t.flags){var i=e[t.size];t.url=ee(e.subarray(t.size+1,t.size+1+i)),t.size+=i}return 32&t.flags&&(t.ocrEsId=e[t.size]<<8|e[t.size+1],t.size+=2),t.descriptors=eZ(e.subarray(t.size))||[],t}},{id:4,parser:function(e){return{tag:4,oti:e[0],streamType:e[1],bufferSize:e[2]<<16|e[3]<<8|e[4],maxBitrate:e[5]<<24|e[6]<<16|e[7]<<8|e[8],avgBitrate:e[9]<<24|e[10]<<16|e[11]<<8|e[12],descriptors:eZ(e.subarray(13))}}},{id:5,parser:function(e){return{tag:5,bytes:e}}},{id:6,parser:function(e){return{tag:6,bytes:e}}}];var e0=function e(t,i,r){void 0===r&&(r=!1),i=Array.isArray(n=i)?n.map(function(e){return eJ(e)}
41):[eJ(n)],t=Y(t);var n,s=[];if(!i.length)return s;for(var a=0;a<t.length;){var o=(t[a]<<24|t[a+1]<<16|t[a+2]<<8|t[a+3])>>>0,l=t.subarray(a+4,a+8);if(0===o)break;var u=a+o;if(u>t.length){if(r)break;u=t.length}var d=t.subarray(a+8,u);er(l,i[0])&&(1===i.length?s.push(d):s.push.apply(s,e(d,i.slice(1),r))),a=u}return s},e1={EBML:Y([26,69,223,163]),DocType:Y([66,130]),Segment:Y([24,83,128,103]),SegmentInfo:Y([21,73,169,102]),Tracks:Y([22,84,174,107]),Track:Y([174]),TrackNumber:Y([215]),DefaultDuration:Y([35,227,131]),TrackEntry:Y([174]),TrackType:Y([131]),FlagDefault:Y([136]),CodecID:Y([134]),CodecPrivate:Y([99,162]),VideoTrack:Y([224]),AudioTrack:Y([225]),Cluster:Y([31,67,182,117]),Timestamp:Y([231]),TimestampScale:Y([42,215,177]),BlockGroup:Y([160]),BlockDuration:Y([155]),Block:Y([161]),SimpleBlock:Y([163])},e2=[128,64,32,16,8,4,2,1],e4=function(e){for(var t=1,i=0;i<e2.length&&!(e&e2[i]);i++)t++;return t},e8=function(e,t,i,r){void 0===i&&(i=!0),void 0===r&&(r=!1);var n=e4(e[t]),s=e.subarray(t,t+n);return i&&(s=Array.prototype.slice.call(e,t,t+n),s[0]^=e2[n-1]),{length:n,value:J(s,{signed:r}),bytes:s}},e3=function e(t){return"string"==typeof t?t.match(/.{1,2}/g).map(function(t){return e(t)}):"number"==typeof t?Z(t):t},e5=function e(t,i,r){if(r>=i.length)return i.length;var n=e8(i,r,!1);if(er(t.bytes,n.bytes))return r;var s=e8(i,r+n.length);return e(t,i,r+s.length+s.value+n.length)},e6=function e(t,i){i=Array.isArray(r=i)?r.map(function(e){return e3(e)}):[e3(r)],t=Y(t);var r,n=[];if(!i.length)return n;for(var s=0;s<t.length;){var a=e8(t,s,!1),o=e8(t,s+a.length),l=s+a.length+o.length;127===o.value&&(o.value=e5(a,t,l),o.value!==t.length&&(o.value-=l));var u=l+o.value>t.length?t.length:l+o.value,d=t.subarray(l,u);er(i[0],a.bytes)&&(1===i.length?n.push(d):n=n.concat(e(d,i.slice(1)))),s+=a.length+o.length+d.length}return n},e7=Y([0,0,0,1]),e9=Y([0,0,1]),te=Y([0,0,3]),tt=function(e){for(var t=[],i=1;i<e.length-2;)er(e.subarray(i,i+3),te)&&(t.push(i+2),i++),i++;if(0===t.length)return e;var r=e.length-t.length,n=new Uint8Array(r),s=0;for(i=0;i<r;s++,i++)s===t[0]&&(s++,t.shift()),n[i]=e[s];return n},ti=function(e,t,i,r){void 0===r&&(r=1/0),e=Y(e),i=[].concat(i);for(var n,s=0,a=0;s<e.length&&(a<r||n);){var o=void 0;if(er(e.subarray(s),e7)?o=4:er(e.subarray(s),e9)&&(o=3),!o){s++;continue}if(a++,n)return tt(e.subarray(n,s));var l=void 0;"h264"===t?l=31&e[s+o]:"h265"===t&&(l=e[s+o]>>1&63),-1!==i.indexOf(l)&&(n=s+o),s+=o+("h264"===t?1:2)}return e.subarray(0,0)},tr={webm:Y([119,101,98,109]),matroska:Y([109,97,116,114,111,115,107,97]),flac:Y([102,76,97,67]),ogg:Y([79,103,103,83]),ac3:Y([11,119]),riff:Y([82,73,70,70]),avi:Y([65,86,73]),wav:Y([87,65,86,69]),"3gp":Y([102,116,121,112,51,103]),mp4:Y([102,116,121,112]),fmp4:Y([115,116,121,112]),mov:Y([102,116,121,112,113,116]),moov:Y([109,111,111,118]),moof:Y([109,111,111,102])},tn={aac:function(e){var t=eQ(e);return er(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=eQ(e);return er(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){return er(e6(e,[e1.EBML,e1.DocType])[0],tr.webm)},mkv:function(e){return er(e6(e,[e1.EBML,e1.DocType])[0],tr.matroska)},mp4:function(e){return!(tn["3gp"](e)||tn.mov(e))&&(!!(er(e,tr.mp4,{offset:4})||er(e,tr.fmp4,{offset:4})||er(e,tr.moof,{offset:4})||er(e,tr.moov,{offset:4}))||void 0)},mov:function(e){return er(e,tr.mov,{offset:4})},"3gp":function(e){return er(e,tr["3gp"],{offset:4})},ac3:function(e){var t=eQ(e);return er(e,tr.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return 71===e[0];for(var t=0;t+188<e.length&&t<188;){if(71===e[t]&&71===e[t+188])return!0;t+=1}return!1},flac:function(e){var t=eQ(e);return er(e,tr.flac,{offset:t})},ogg:function(e){return er(e,tr.ogg)},avi:function(e){return er(e,tr.riff)&&er(e,tr.avi,{offset:8})},wav:function(e){return er(e,tr.riff)&&er(e,tr.wav,{offset:8})},h264:function(e){return ti(e,"h264",7,3).length},h265:function(e){return ti(e,"h265",[32,33],3).length}},ts=Object.keys(tn).filter(function(e){return"ts"!==e&&"h264"!==e&&"h265"!==e}).concat(["ts","h264","h265"]);ts.forEach(function(e){var t=tn[e];tn[e]=function(e){return t(Y(e))}});var ta=function(e){e=Y(e);for(var t=0;t<ts.length;t++){var i=ts[t];if(tn[i](e))return i}return""},to=i(4577),tl="8.21.0";let tu={},td=function(e,t){return tu[e]=tu[e]||[],t&&(tu[e]=tu[e].concat(t)),tu[e]},tc=function(e,t){let i=td(e).indexOf(t);return!(i<=-1)&&(tu[e]=tu[e].slice(),tu[e].splice(i,1),!0)},th={prefixed:!0},tp=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],tf=tp[0];for(let e=0;e<tp.length;e++)if(tp[e][1]in m()){r=tp[e];break}if(r){for(let e=0;e<r.length;
41e++)th[tf[e]]=r[e];th.prefixed=r[0]!==tf[0]}let tm=[],tg=function e(t,i=":",r=""){let n,s="info";function a(...e){n("log",s,e)}return n=(e,i,n)=>{let s=a.levels[i],o=RegExp(`^(${s})$`),l=t;if("log"!==e&&n.unshift(e.toUpperCase()+":"),r&&(l=`%c${t}`,n.unshift(r)),n.unshift(l+":"),tm){tm.push([].concat(n));let e=tm.length-1e3;tm.splice(0,e>0?e:0)}if(!p().console)return;let u=p().console[e];u||"debug"!==e||(u=p().console.info||p().console.log),u&&s&&o.test(e)&&u[Array.isArray(n)?"apply":"call"](p().console,n)},a.createLogger=(n,s,a)=>{let o=void 0!==s?s:i;return e(`${t} ${o} ${n}`,o,void 0!==a?a:r)},a.createNewLogger=(t,i,r)=>e(t,i,r),a.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:s},a.level=e=>{if("string"==typeof e){if(!a.levels.hasOwnProperty(e))throw Error(`"${e}" in not a valid log level`);s=e}return s},a.history=()=>tm?[].concat(tm):[],a.history.filter=e=>(tm||[]).filter(t=>RegExp(`.*${e}.*`).test(t[0])),a.history.clear=()=>{tm&&(tm.length=0)},a.history.disable=()=>{null!==tm&&(tm.length=0,tm=null)},a.history.enable=()=>{null===tm&&(tm=[])},a.error=(...e)=>n("error",s,e),a.warn=(...e)=>n("warn",s,e),a.debug=(...e)=>n("debug",s,e),a}("VIDEOJS"),ty=tg.createLogger,tv=Object.prototype.toString,t_=function(e){return tw(e)?Object.keys(e):[]};function tb(e,t){t_(e).forEach(i=>t(e[i],i))}function tT(e,t,i=0){return t_(e).reduce((i,r)=>t(i,e[r],r),i)}function tw(e){return!!e&&"object"==typeof e}function tS(e){return tw(e)&&"[object Object]"===tv.call(e)&&e.constructor===Object}function tE(...e){let t={};return e.forEach(e=>{e&&tb(e,(e,i)=>{if(!tS(e)){t[i]=e;return}tS(t[i])||(t[i]={}),t[i]=tE(t[i],e)})}),t}function tC(e={}){let t=[];for(let i in e)if(e.hasOwnProperty(i)){let r=e[i];t.push(r)}return t}function tk(e,t,i,r=!0){let n=i=>Object.defineProperty(e,t,{value:i,enumerable:!0,writable:!0}),s={configurable:!0,enumerable:!0,get(){let e=i();return n(e),e}};return r&&(s.set=n),Object.defineProperty(e,t,s)}var tx=Object.freeze({__proto__:null,each:tb,reduce:tT,isObject:tw,isPlain:tS,merge:tE,values:tC,defineLazyProperty:tk});let tD=!1,tI=null,tA=!1,tO=!1,tL=!1,tP=!1,tN=!1,tM=null,tR=null,t$=!!(p().cast&&p().cast.framework&&p().cast.framework.CastReceiverContext),tU=null,tB=!1,tj=!1,tq=!1,tF=!1,tH=!1,tz=!1,tV=!1,tW=!!(tJ()&&("ontouchstart"in p()||p().navigator.maxTouchPoints||p().DocumentTouch&&p().document instanceof p().DocumentTouch)),tG=p().navigator&&p().navigator.userAgentData;if(tG&&tG.platform&&tG.brands&&(tA="Android"===tG.platform,tL=!!tG.brands.find(e=>"Microsoft Edge"===e.brand),tP=!!tG.brands.find(e=>"Chromium"===e.brand),tN=!tL&&tP,tM=tR=(tG.brands.find(e=>"Chromium"===e.brand)||{}).version||null,tj="Windows"===tG.platform),!tP){let e=p().navigator&&p().navigator.userAgent||"";tD=/iPod/i.test(e),tI=function(){let t=e.match(/OS (\d+)_/i);return t&&t[1]?t[1]:null}(),tA=/Android/i.test(e),n=function(){let t=e.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!t)return null;let i=t[1]&&parseFloat(t[1]),r=t[2]&&parseFloat(t[2]);return i&&r?parseFloat(t[1]+"."+t[2]):i||null}(),tO=/Firefox/i.test(e),tL=/Edg/i.test(e),tP=/Chrome/i.test(e)||/CriOS/i.test(e),tN=!tL&&tP,tM=tR=function(){let t=e.match(/(Chrome|CriOS)\/(\d+)/);return t&&t[2]?parseFloat(t[2]):null}(),tU=function(){let t=/MSIE\s(\d+)\.\d/.exec(e),i=t&&parseFloat(t[1]);return!i&&/Trident\/7.0/i.test(e)&&/rv:11.0/.test(e)&&(i=11),i}(),tH=/Tizen/i.test(e),tz=/Web0S/i.test(e),tV=tH||tz,tB=/Safari/i.test(e)&&!tN&&!tA&&!tL&&!tV,tj=/Windows/i.test(e),tq=/iPad/i.test(e)||tB&&tW&&!/iPhone/i.test(e),tF=/iPhone/i.test(e)&&!tq}let tX=tF||tq||tD,tY=(tB||tX)&&!tN;var tK=Object.freeze({__proto__:null,get IS_IPOD(){return tD},get IOS_VERSION(){return tI},get IS_ANDROID(){return tA},get ANDROID_VERSION(){return n},get IS_FIREFOX(){return tO},get IS_EDGE(){return tL},get IS_CHROMIUM(){return tP},get IS_CHROME(){return tN},get CHROMIUM_VERSION(){return tM},get CHROME_VERSION(){return tR},IS_CHROMECAST_RECEIVER:t$,get IE_VERSION(){return tU},get IS_SAFARI(){return tB},get IS_WINDOWS(){return tj},get IS_IPAD(){return tq},get IS_IPHONE(){return tF},get IS_TIZEN(){return tH},get IS_WEBOS(){return tz},get IS_SMART_TV(){return tV},TOUCH_ENABLED:tW,IS_IOS:tX,IS_ANY_SAFARI:tY});function tQ(e){return"string"==typeof e&&!!e.trim()}function tJ(){return m()===p().document}function tZ(e){return tw(e)&&1===e.nodeType}function t0(){try{return p().parent!==p().self}catch(e){return!0}}function t1(e){return function(t,i){if(!tQ(t))return m()[e](null);tQ(i)&&(i=m().querySelector(i));let r=tZ(i)?i:m();return r[e]&&r[e](t)}}function t2(e="div",t={},i={},r){let n=m().createElement(e);return Object.getOwnPropertyNames(t).forEach(function(e){let i=t[e];"textContent"===e?t4(n,i):(n[e]!==i||"tabIndex"===e)&&(n[e]=i)}
41),Object.getOwnPropertyNames(i).forEach(function(e){n.setAttribute(e,i[e])}),r&&ip(n,r),n}function t4(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function t8(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function t3(e,t){if(t.indexOf(" ")>=0)throw Error("class has illegal whitespace characters");return e.classList.contains(t)}function t5(e,...t){return e.classList.add(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[])),e}function t6(e,...t){return e?(e.classList.remove(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[])),e):(tg.warn("removeClass was called with an element that doesn't exist"),null)}function t7(e,t,i){return"function"==typeof i&&(i=i(e,t)),"boolean"!=typeof i&&(i=void 0),t.split(/\s+/).forEach(t=>e.classList.toggle(t,i)),e}function t9(e,t){Object.getOwnPropertyNames(t).forEach(function(i){let r=t[i];null==r||!1===r?e.removeAttribute(i):e.setAttribute(i,!0===r?"":r)})}function ie(e){let t={},i=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(e&&e.attributes&&e.attributes.length>0){let r=e.attributes;for(let e=r.length-1;e>=0;e--){let n=r[e].name,s=r[e].value;i.includes(n)&&(s=null!==s),t[n]=s}}return t}function it(e,t){return e.getAttribute(t)}function ii(e,t,i){e.setAttribute(t,i)}function ir(e,t){e.removeAttribute(t)}
41function is(){m().body.focus(),m().onselectstart=function(){return!1}}function ia(){m().onselectstart=function(){return!0}}function io(e){if(e&&e.getBoundingClientRect&&e.parentNode){let t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach(e=>{void 0!==t[e]&&(i[e]=t[e])}),i.height||(i.height=parseFloat(i_(e,"height"))),i.width||(i.width=parseFloat(i_(e,"width"))),i}}function il(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};let t=e.offsetWidth,i=e.offsetHeight,r=0,n=0;for(;e.offsetParent&&e!==m()[th.fullscreenElement];)r+=e.offsetLeft,n+=e.offsetTop,e=e.offsetParent;return{left:r,top:n,width:t,height:i}}function iu(e,t){let i={x:0,y:0};if(tX){let t=e;for(;t&&"html"!==t.nodeName.toLowerCase();){let e=i_(t,"transform");if(/^matrix/.test(e)){let t=e.slice(7,-1).split(/,\s/).map(Number);i.x+=t[4],i.y+=t[5]}else if(/^matrix3d/.test(e)){let t=e.slice(9,-1).split(/,\s/).map(Number);i.x+=t[12],i.y+=t[13]}if(t.assignedSlot&&t.assignedSlot.parentElement&&p().WebKitCSSMatrix){let e=p().getComputedStyle(t.assignedSlot.parentElement).transform,r=new(p()).WebKitCSSMatrix(e);i.x+=r.m41,i.y+=r.m42}t=t.parentNode||t.host}}let r={},n=il(t.target),s=il(e),a=s.width,o=s.height,l=t.offsetY-(s.top-n.top),u=t.offsetX-(s.left-n.left);return t.changedTouches&&(u=t.changedTouches[0].pageX-s.left,l=t.changedTouches[0].pageY+s.top,tX&&(u-=i.x,l-=i.y)),r.y=1-Math.max(0,Math.min(1,l/o)),r.x=Math.max(0,Math.min(1,u/a)),r}function id(e){return tw(e)&&3===e.nodeType}function ic(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function ih(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map(e=>("function"==typeof e&&(e=e()),tZ(e)||id(e))?e:"string"==typeof e&&/\S/.test(e)?m().createTextNode(e):void 0).filter(e=>e)}function ip(e,t){return ih(t).forEach(t=>e.appendChild(t)),e}function im(e,t){return ip(ic(e),t)}function ig(e){return void 0===e.button&&void 0===e.buttons||0===e.button&&void 0===e.buttons||"mouseup"===e.type&&0===e.button&&0===e.buttons||"mousedown"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons}let iy=t1("querySelector"),iv=t1("querySelectorAll");function i_(e,t){if(!e||!t)return"";if("function"==typeof p().getComputedStyle){let i;try{i=p().getComputedStyle(e)}catch(e){return""}return i?i.getPropertyValue(t)||i[t]:""}return""}function ib(e){[...m().styleSheets].forEach(t=>{try{let i=[...t.cssRules].map(e=>e.cssText).join(""),r=m().createElement("style");r.textContent=i,e.document.head.appendChild(r)}catch(r){let i=m().createElement("link");i.rel="stylesheet",i.type=t.type,i.media=t.media.mediaText,i.href=t.href,e.document.head.appendChild(i)}})}var iT=Object.freeze({__proto__:null,isReal:tJ,isEl:tZ,isInFrame:t0,createEl:t2,textContent:t4,prependTo:t8,hasClass:t3,addClass:t5,removeClass:t6,toggleClass:t7,setAttributes:t9,getAttributes:ie,getAttribute:it,setAttribute:ii,removeAttribute:ir,blockTextSelection:is,unblockTextSelection:ia,getBoundingClientRect:io,findPosition:il,getPointerPosition:iu,isTextNode:id,emptyEl:ic,normalizeContent:ih,appendContent:ip,insertContent:im,isSingleLeftClick:ig,$:iy,$$:iv,computedStyle:i_,copyStyleSheetsToWindow:ib});let iw=!1,iS=function(){if(!1===s.options.autoSetup)return;let e=Array.prototype.slice.call(m().getElementsByTagName("video")),t=Array.prototype.slice.call(m().getElementsByTagName("audio")),i=Array.prototype.slice.call(m().getElementsByTagName("video-js")),r=e.concat(t,i);if(r&&r.length>0)for(let e=0,t=r.length;e<t;e++){let t=r[e];if(t&&t.getAttribute)void 0===t.player&&null!==t.getAttribute("data-setup")&&s(t);else{iE(1);break}}else iw||iE(1)};function iE(e,t){tJ()&&(t&&(s=t),p().setTimeout(iS,e))}function iC(){iw=!0,p().removeEventListener("load",iC)}tJ()&&("complete"===m().readyState?iC():p().addEventListener("load",iC));let ik=function(e){let t=m().createElement("style");return t.className=e,t},ix=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t};var iD=new WeakMap;let iI=3;function iA(e,t){if(!iD.has(e))return;let i=iD.get(e);0===i.handlers[t].length&&(delete i.handlers[t],e.removeEventListener?e.removeEventListener(t,i.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,i.dispatcher)),Object.getOwnPropertyNames(i.handlers).length<=0&&(delete i.handlers,delete i.dispatcher,delete i.disabled),0===Object.getOwnPropertyNames(i).length&&iD.delete(e)}
41function iO(e,t,i,r){i.forEach(function(i){e(t,i,r)})}function iL(e){if(e.fixed_)return e;function t(){return!0}function i(){return!1}if(!e||!e.isPropagationStopped||!e.isImmediatePropagationStopped){let r=e||p().event;e={};let n=["layerX","layerY","keyLocation","path","webkitMovementX","webkitMovementY","mozPressure","mozInputSource"];for(let t in r)n.includes(t)||"returnValue"===t&&r.preventDefault||(e[t]=r[t]);if(e.target||(e.target=e.srcElement||m()),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){r.preventDefault&&r.preventDefault(),e.returnValue=!1,r.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){r.stopPropagation&&r.stopPropagation(),e.cancelBubble=!0,r.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=i,e.stopImmediatePropagation=function(){r.stopImmediatePropagation&&r.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=i,null!==e.clientX&&void 0!==e.clientX){let t=m().documentElement,i=m().body;e.pageX=e.clientX+(t&&t.scrollLeft||i&&i.scrollLeft||0)-(t&&t.clientLeft||i&&i.clientLeft||0),e.pageY=e.clientY+(t&&t.scrollTop||i&&i.scrollTop||0)-(t&&t.clientTop||i&&i.clientTop||0)}e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e.fixed_=!0,e}let iP=function(){if("boolean"!=typeof a){a=!1;try{let e=Object.defineProperty({},"passive",{get(){a=!0}});p().addEventListener("test",null,e),p().removeEventListener("test",null,e)}catch(e){}}return a},iN=["touchstart","touchmove"];function iM(e,t,i){if(Array.isArray(t))return iO(iM,e,t,i);iD.has(e)||iD.set(e,{});let r=iD.get(e);if(r.handlers||(r.handlers={}),r.handlers[t]||(r.handlers[t]=[]),i.guid||(i.guid=iI++),r.handlers[t].push(i),r.dispatcher||(r.disabled=!1,r.dispatcher=function(t,i){if(r.disabled)return;t=iL(t);let n=r.handlers[t.type];if(n){let r=n.slice(0);for(let n=0,s=r.length;n<s;n++)if(t.isImmediatePropagationStopped())break;else try{r[n].call(e,t,i)}catch(e){tg.error(e)}}}),1===r.handlers[t].length)if(e.addEventListener){let i=!1;iP()&&iN.indexOf(t)>-1&&(i={passive:!0}),e.addEventListener(t,r.dispatcher,i)}else e.attachEvent&&e.attachEvent("on"+t,r.dispatcher)}function iR(e,t,i){if(!iD.has(e))return;let r=iD.get(e);if(!r.handlers)return;if(Array.isArray(t))return iO(iR,e,t,i);let n=function(e,t){r.handlers[t]=[],iA(e,t)};if(void 0===t){for(let t in r.handlers)Object.prototype.hasOwnProperty.call(r.handlers||{},t)&&n(e,t);return}let s=r.handlers[t];if(s){if(!i)return void n(e,t);if(i.guid)for(let e=0;e<s.length;e++)s[e].guid===i.guid&&s.splice(e--,1);iA(e,t)}}function i$(e,t,i){let r=iD.has(e)?iD.get(e):{},n=e.parentNode||e.ownerDocument;if("string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=iL(t),r.dispatcher&&r.dispatcher.call(e,t,i),n&&!t.isPropagationStopped()&&!0===t.bubbles)i$.call(null,n,t,i);else if(!n&&!t.defaultPrevented&&t.target&&t.target[t.type]){iD.has(t.target)||iD.set(t.target,{});let e=iD.get(t.target);t.target[t.type]&&(e.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),e.disabled=!1)}return!t.defaultPrevented}function iU(e,t,i){if(Array.isArray(t))return iO(iU,e,t,i);let r=function(){iR(e,t,r),i.apply(this,arguments)};r.guid=i.guid=i.guid||iI++,iM(e,t,r)}function iB(e,t,i){let r=function(){iR(e,t,r),i.apply(this,arguments)};r.guid=i.guid=i.guid||iI++,iM(e,t,r)}var ij=Object.freeze({__proto__:null,fixEvent:iL,on:iM,off:iR,trigger:i$,one:iU,any:iB});let iq=function(e,t,i){t.guid||(t.guid=iI++);let r=t.bind(e);return r.guid=i?i+"_"+t.guid:t.guid,r},iF=function(e,t){let i=p().performance.now();return function(...r){let n=p().performance.now();n-i>=t&&(e(...r),i=n)}},iH=function(e,t,i,r=p()){let n,s=function(){let s=this,a=arguments,o=function(){n=null,o=null,i||e.apply(s,a)};!n&&i&&e.apply(s,a),r.clearTimeout(n),n=r.setTimeout(o,t)};return s.cancel=()=>{r.clearTimeout(n),n=null},s};var iz=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:30,bind_:iq,throttle:iF,debounce:iH});class iV{on(e,t){let i=this.addEventListener;this.addEventListener=()=>{},iM(this,e,t),this.addEventListener=i}off(e,t){iR(this,e,t)}
41one(e,t){let i=this.addEventListener;this.addEventListener=()=>{},iU(this,e,t),this.addEventListener=i}any(e,t){let i=this.addEventListener;this.addEventListener=()=>{},iB(this,e,t),this.addEventListener=i}trigger(e){let t=e.type||e;"string"==typeof e&&(e={type:t}),e=iL(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),i$(this,e)}queueTrigger(e){o||(o=new Map);let t=e.type||e,i=o.get(this);i||(i=new Map,o.set(this,i));let r=i.get(t);i.delete(t),p().clearTimeout(r);let n=p().setTimeout(()=>{i.delete(t),0===i.size&&(i=null,o.delete(this)),this.trigger(e)},0);i.set(t,n)}}iV.prototype.allowedEvents_={},iV.prototype.addEventListener=iV.prototype.on,iV.prototype.removeEventListener=iV.prototype.off,iV.prototype.dispatchEvent=iV.prototype.trigger;let iW=e=>"function"==typeof e.name?e.name():"string"==typeof e.name?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e,iG=e=>e instanceof iV||!!e.eventBusEl_&&["on","one","off","trigger"].every(t=>"function"==typeof e[t]),iX=e=>"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length,iY=(e,t,i)=>{if(!e||!e.nodeName&&!iG(e))throw Error(`Invalid target for ${iW(t)}#${i}; must be a DOM node or evented object.`)},iK=(e,t,i)=>{if(!iX(e))throw Error(`Invalid event type for ${iW(t)}#${i}; must be a non-empty string or array.`)},iQ=(e,t,i)=>{if("function"!=typeof e)throw Error(`Invalid listener for ${iW(t)}#${i}; must be a function.`)},iJ=(e,t,i)=>{let r,n,s,a=t.length<3||t[0]===e||t[0]===e.eventBusEl_;return a?(r=e.eventBusEl_,t.length>=3&&t.shift(),[n,s]=t):(r=t[0],n=t[1],s=t[2]),iY(r,e,i),iK(n,e,i),iQ(s,e,i),{isTargetingSelf:a,target:r,type:n,listener:s=iq(e,s)}},iZ=(e,t,i,r)=>{iY(e,e,t),e.nodeName?ij[t](e,i,r):e[t](i,r)},i0={on(...e){let{isTargetingSelf:t,target:i,type:r,listener:n}=iJ(this,e,"on");if(iZ(i,"on",r,n),!t){let e=()=>this.off(i,r,n);e.guid=n.guid;let t=()=>this.off("dispose",e);t.guid=n.guid,iZ(this,"on","dispose",e),iZ(i,"on","dispose",t)}},one(...e){let{isTargetingSelf:t,target:i,type:r,listener:n}=iJ(this,e,"one");if(t)iZ(i,"one",r,n);else{let e=(...t)=>{this.off(i,r,e),n.apply(null,t)};e.guid=n.guid,iZ(i,"one",r,e)}},any(...e){let{isTargetingSelf:t,target:i,type:r,listener:n}=iJ(this,e,"any");if(t)iZ(i,"any",r,n);else{let e=(...t)=>{this.off(i,r,e),n.apply(null,t)};e.guid=n.guid,iZ(i,"any",r,e)}},off(e,t,i){!e||iX(e)?iR(this.eventBusEl_,e,t):(iY(e,this,"off"),iK(t,this,"off"),iQ(i,this,"off"),i=iq(this,i),this.off("dispose",i),e.nodeName?(iR(e,t,i),iR(e,"dispose",i)):iG(e)&&(e.off(t,i),e.off("dispose",i)))},trigger(e,t){if(iY(this.eventBusEl_,this,"trigger"),!iX(e&&"string"!=typeof e?e.type:e))throw Error(`Invalid event type for ${iW(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return i$(this.eventBusEl_,e,t)}};function i1(e,t={}){let{eventBusKey:i}=t;if(i){if(!e[i].nodeName)throw Error(`The eventBusKey "${i}" does not refer to an element.`);e.eventBusEl_=e[i]}else e.eventBusEl_=t2("span",{className:"vjs-event-bus"});return Object.assign(e,i0),e.eventedCallbacks&&e.eventedCallbacks.forEach(e=>{e()}),e.on("dispose",()=>{e.off(),[e,e.el_,e.eventBusEl_].forEach(function(e){e&&iD.has(e)&&iD.delete(e)}),p().setTimeout(()=>{e.eventBusEl_=null},0)}),e}let i2={state:{},setState(e){let t;return"function"==typeof e&&(e=e()),tb(e,(e,i)=>{this.state[i]!==e&&((t=t||{})[i]={from:this.state[i],to:e}),this.state[i]=e}),t&&iG(this)&&this.trigger({changes:t,type:"statechanged"}),t}};function i4(e,t){return Object.assign(e,i2),e.state=Object.assign({},e.state,t),"function"==typeof e.handleStateChanged&&iG(e)&&e.on("statechanged",e.handleStateChanged),e}let i8=function(e){return"string"!=typeof e?e:e.replace(/./,e=>e.toLowerCase())},i3=function(e){return"string"!=typeof e?e:e.replace(/./,e=>e.toUpperCase())},i5=function(e,t){return i3(e)===i3(t)};var i6=Object.freeze({__proto__:null,toLowerCase:i8,toTitleCase:i3,titleCaseEquals:i5});class i7{constructor(e,t,i){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=tE({},this.options_),t=this.options_=tE(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){let t=e&&e.id&&e.id()||"no_player";this.id_=`${t}_component_${iI++}`}this.name_=t.name||null,t.el?this.el_=t.el:!1!==t.createEl&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach(e
41=>this.addClass(e)),["on","off","one","any","trigger"].forEach(e=>{this[e]=void 0}),!1!==t.evented&&(i1(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),i4(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,!1!==t.initChildren&&this.initChildren(),this.ready(i),!1!==t.reportTouchActivity&&this.enableTouchActivity()}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let e=this.children_.length-1;e>=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(e){return e&&(this.options_=tE(this.options_,e)),this.options_}el(){return this.el_}createEl(e,t,i){return t2(e,t,i)}localize(e,t,i=e){let r=this.player_.language&&this.player_.language(),n=this.player_.languages&&this.player_.languages(),s=n&&n[r],a=r&&r.split("-")[0],o=n&&n[a],l=i;return s&&s[e]?l=s[e]:o&&o[e]&&(l=o[e]),t&&(l=l.replace(/\{(\d+)\}/g,function(e,i){let r=t[i-1],n=r;return void 0===r&&(n=e),n})),l}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce((e,t)=>e.concat(t),[]);let t=this;for(let i=0;i<e.length;i++)if(!(t=t.getChild(e[i]))||!t.getChild)return;return t}setIcon(e,t=this.el()){if(!this.player_.options_.experimentalSvgIcons)return;let i="http://www.w3.org/2000/svg",r=t2("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),n=m().createElementNS(i,"svg");n.setAttributeNS(null,"viewBox","0 0 512 512");let s=m().createElementNS(i,"use");return n.appendChild(s),s.setAttributeNS(null,"href",`#vjs-icon-${e}`),r.appendChild(n),this.iconIsSet_?t.replaceChild(r,t.querySelector(".vjs-icon-placeholder")):t.appendChild(r),this.iconIsSet_=!0,r}addChild(e,t={},i=this.children_.length){let r,n;if("string"==typeof e){n=i3(e);let i=t.componentClass||n;t.name=n;let s=i7.getComponent(i);if(!s)throw Error(`Component ${i} does not exist`);if("function"!=typeof s)return null;r=new s(this.player_||this,t)}else r=e;if(r.parentComponent_&&r.parentComponent_.removeChild(r),this.children_.splice(i,0,r),r.parentComponent_=this,"function"==typeof r.id&&(this.childIndex_[r.id()]=r),(n=n||r.name&&i3(r.name()))&&(this.childNameIndex_[n]=r,this.childNameIndex_[i8(n)]=r),"function"==typeof r.el&&r.el()){let e=null;this.children_[i+1]&&(this.children_[i+1].el_?e=this.children_[i+1].el_:tZ(this.children_[i+1])&&(e=this.children_[i+1])),this.contentEl().insertBefore(r.el(),e)}return r}removeChild(e){if("string"==typeof e&&(e=this.getChild(e)),!e||!this.children_)return;let t=!1;for(let i=this.children_.length-1;i>=0;i--)if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[i3(e.name())]=null,this.childNameIndex_[i8(e.name())]=null;let i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){let e=this.options_.children;if(e){let t,i=this.options_,r=i7.getComponent("Tech");(t=Array.isArray(e)?e:Object.keys(e)).concat(Object.keys(this.options_).filter(function(e){return!t.some(function(t){return"string"==typeof t?e===t:e===t.name})})).map(t=>{let i,r;return"string"==typeof t?r=e[i=t]||this.options_[i]||{}:(i=t.name,r=t),{name:i,opts:r}}).filter(e=>
41{let t=i7.getComponent(e.opts.componentClass||i3(e.name));return t&&!r.isTech(t)}).forEach(e=>{let t=e.name,r=e.opts;if(void 0!==i[t]&&(r=i[t]),!1===r)return;!0===r&&(r={}),r.playerOptions=this.options_.playerOptions;let n=this.addChild(t,r);n&&(this[t]=n)})}}buildCSSClass(){return""}ready(e,t=!1){if(e){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(e);return}t?e.call(this):this.setTimeout(e,1)}}triggerReady(){this.isReady_=!0,this.setTimeout(function(){let e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)}$(e,t){return iy(e,t||this.contentEl())}$$(e,t){return iv(e,t||this.contentEl())}hasClass(e){return t3(this.el_,e)}addClass(...e){t5(this.el_,...e)}removeClass(...e){t6(this.el_,...e)}toggleClass(e,t){t7(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return it(this.el_,e)}setAttribute(e,t){ii(this.el_,e,t)}removeAttribute(e){ir(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,i){if(void 0!==t){(null===t||t!=t)&&(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:"auto"===t?this.el_.style[e]="":this.el_.style[e]=t+"px",i||this.trigger("componentresize");return}if(!this.el_)return 0;let r=this.el_.style[e],n=r.indexOf("px");return -1!==n?parseInt(r.slice(0,n),10):parseInt(this.el_["offset"+i3(e)],10)}currentDimension(e){let t=0;if("width"!==e&&"height"!==e)throw Error("currentDimension only accepts width or height value");if(0===(t=parseFloat(t=i_(this.el_,e)))||isNaN(t)){let i=`offset${i3(e)}`;t=this.el_[i]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){let e=this.el_.getBoundingClientRect();return{boundingClientRect:{x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},center:{x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2}}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&("Tab"===e.key||this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled||e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e,t=0,i=null;this.on("touchstart",function(r){1===r.touches.length&&(i={pageX:r.touches[0].pageX,pageY:r.touches[0].pageY},t=p().performance.now(),e=!0)}),this.on("touchmove",function(t){if(t.touches.length>1)e=!1;else if(i){let r=t.touches[0].pageX-i.pageX,n=t.touches[0].pageY-i.pageY;Math.sqrt(r*r+n*n)>10&&(e=!1)}});let r=function(){e=!1};this.on("touchleave",r),this.on("touchcancel",r),this.on("touchend",function(r){i=null,!0===e&&p().performance.now()-t<200&&(r.preventDefault(),this.trigger("tap"))})}enableTouchActivity(){let e;if(!this.player()||!this.player().reportUserActivity)return;let t=iq(this.player(),this.player().reportUserActivity);this.on("touchstart",function(){t(),this.clearInterval(e),e=this.setInterval(t,250)});let i=function(i){t(),this.clearInterval(e)};this.on("touchmove",t),this.on("touchend",i),this.on("touchcancel",i)}setTimeout(e,t){var i;return e=iq(this,e),this.clearTimersOnDispose_(),i=p().setTimeout(()=>{this.setTimeoutIds_.has(i)&&this.setTimeoutIds_.delete(i),e()},t),this.setTimeoutIds_.add(i),i}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),p().clearTimeout(e)),e}setInterval(e,t){e=iq(this,e),this.clearTimersOnDispose_();let i=p().setInterval(e,t);return this.setIntervalIds_.add(i),i}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),p().clearInterval(e)),e}requestAnimationFrame(e){var t;return this.clearTimersOnDispose_(),e=iq(this,e),t=p().requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),t=iq(this,t);let i=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,i),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),p().cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEac
41h(([e,t])=>{this[e].forEach((e,i)=>this[t](i))}),this.clearingTimersOnDispose_=!1}))}getIsDisabled(){return!!this.el_.disabled}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){return(e||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){var t;function i(e){let t=p().getComputedStyle(e,null),i=t.getPropertyValue("visibility");return"none"!==t.getPropertyValue("display")&&!["hidden","collapse"].includes(i)}return e||(e=this.el()),!!(function(e){if(e.offsetWidth+e.offsetHeight+e.getBoundingClientRect().height+e.getBoundingClientRect().width===0)return!1;let t={x:e.getBoundingClientRect().left+e.offsetWidth/2,y:e.getBoundingClientRect().top+e.offsetHeight/2};if(t.x<0||t.x>(m().documentElement.clientWidth||p().innerWidth)||t.y<0||t.y>(m().documentElement.clientHeight||p().innerHeight))return!1;let i=m().elementFromPoint(t.x,t.y);for(;i;){if(i===e)return!0;if(!i.parentNode)return!1;i=i.parentNode}}(e)&&i((t=e).parentElement)&&i(t)&&"0"!==t.style.opacity&&"0px"!==p().getComputedStyle(t).height&&"0px"!==p().getComputedStyle(t).width&&1)&&(!e.parentElement||!!(e.tabIndex>=0))}static registerComponent(e,t){if("string"!=typeof e||!e)throw Error(`Illegal component name, "${e}"; must be a non-empty string.`);let i=i7.getComponent("Tech"),r=i&&i.isTech(t),n=i7===t||i7.prototype.isPrototypeOf(t.prototype);if(r||!n){let t;throw t=r?"techs must be registered using Tech.registerTech()":"must be a Component subclass",Error(`Illegal component, "${e}"; ${t}.`)}e=i3(e),i7.components_||(i7.components_={});let s=i7.getComponent("Player");if("Player"===e&&s&&s.players){let e=s.players,t=Object.keys(e);if(e&&t.length>0&&t.map(t=>e[t]).every(Boolean))throw Error("Can not register Player component after player has been created.")}return i7.components_[e]=t,i7.components_[i8(e)]=t,t}static getComponent(e){if(e&&i7.components_)return i7.components_[e]}}function i9(e,t,i,r){var n=i.length-1;if("number"!=typeof r||r<0||r>n)throw Error(`Failed to execute '${e}' on 'TimeRanges': The index provided (${r}) is non-numeric or out of bounds (0-${n}).`);return i[r][t]}function re(e){let t;return t=void 0===e||0===e.length?{length:0,start(){throw Error("This TimeRanges object is empty")},end(){throw Error("This TimeRanges object is empty")}}:{length:e.length,start:i9.bind(null,"start",0,e),end:i9.bind(null,"end",1,e)},p().Symbol&&p().Symbol.iterator&&(t[p().Symbol.iterator]=()=>(e||[]).values()),t}function rt(e,t){return Array.isArray(e)?re(e):void 0===e||void 0===t?re():re([[e,t]])}i7.registerComponent("Component",i7);let ri=function(e,t){let i=Math.floor((e=e<0?0:e)%60),r=Math.floor(e/60%60),n=Math.floor(e/3600),s=Math.floor(t/60%60),a=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(n=r=i="-"),r=(((n=n>0||a>0?n+":":"")||s>=10)&&r<10?"0"+r:r)+":",n+r+(i=i<10?"0"+i:i)},rr=ri;function rn(e){rr=e}function rs(){rr=ri}function ra(e,t=e){return rr(e,t)}var ro=Object.freeze({__proto__:null,createTimeRanges:rt,createTimeRange:rt,setFormatTime:rn,resetFormatTime:rs,formatTime:ra});function rl(e,t){let i,r,n=0;if(!t)return 0;e&&e.length||(e=rt(0,0));for(let s=0;s<e.length;s++)i=e.start(s),(r=e.end(s))>t&&(r=t),n+=r-i;return n/t}function ru(e){if(e instanceof ru)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:tw(e)&&("number"==typeof e.code&&(this.code=e.code),Object.assign(this,e)),this.message||(this.message=ru.defaultMessages[this.code]||"")}function rd(e){return null!=e&&"function"==typeof e.then}function rc(e){rd(e)&&e.then(null,e=>{})}ru.prototype.code=0,ru.prototype.message="",ru.prototype.status=null,ru.prototype.metadata=null,ru.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],ru.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."},ru.MEDIA_ERR_CUSTOM=0,ru.prototype.MEDIA_ERR_CUSTOM=0,ru.MEDIA_ERR_ABORTED=1,ru.prototype.MEDIA_ERR_ABORTED=1,ru.MEDIA_ERR_NETWORK=2,ru.prototype.MEDIA_ERR_NETWORK=2,ru.MEDIA_ERR_DECODE=3,ru.prototype.MEDIA_ERR_DECODE=3,ru.MEDIA_ERR_SRC_NOT_SUPPORTED=4,ru.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4,ru.MEDIA_ERR_ENCRYPTED=5,ru.prototype.MEDIA_ERR_ENCRYPTED=5;let rh=function(e){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((t,i,r)=>
41(e[i]&&(t[i]=e[i]),t),{cues:e.cues&&Array.prototype.map.call(e.cues,function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}})})};var rp=function(e){let t=e.$$("track"),i=Array.prototype.map.call(t,e=>e.track);return Array.prototype.map.call(t,function(e){let t=rh(e.track);return e.src&&(t.src=e.src),t}).concat(Array.prototype.filter.call(e.textTracks(),function(e){return -1===i.indexOf(e)}).map(rh))};let rf="vjs-modal-dialog";class rm extends i7{constructor(e,t){super(e,t),this.handleKeyDown_=e=>this.handleKeyDown(e),this.close_=e=>this.close(e),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=t2("div",{className:`${rf}-content`},{role:"document"}),this.descEl_=t2("p",{className:`${rf}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),t4(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${rf} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(this.opened_){this.options_.fillAlways&&this.fill();return}let e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,!this.options_.fillAlways&&(this.hasBeenOpened_||this.hasBeenFilled_)||this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return"boolean"==typeof e&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;let e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if("boolean"==typeof e){let t=this.closeable_=!!e,i=this.getChild("closeButton");if(t&&!i){let e=this.contentEl_;this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=e,this.on(i,"close",this.close_)}!t&&i&&(this.off(i,"close",this.close_),this.removeChild(i),i.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){let t=this.contentEl(),i=t.parentNode,r=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),im(t,e),this.trigger("modalfill"),r?i.insertBefore(t,r):i.appendChild(t);let n=this.getChild("closeButton");n&&i.appendChild(n.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),ic(this.contentEl()),this.trigger("modalempty")}content(e){return void 0!==e&&(this.content_=e),this.content_}conditionalFocus_(){let e=m().activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){let t;if(this.trigger({type:"modalKeydown",originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),"Escape"===e.key&&this.closeable()){e.preventDefault(),this.close();return}if("Tab"!==e.key)return;let i=this.focusableEls_(),r=this.el_.querySelector(":focus");for(let e=0;e<i.length;e++)if(r===i[e]){t=e;break}m().activeElement===this.el_&&(t=0),e.shiftKey&&0===t?(i[i.length-1].focus(),e.preventDefault()):e.shiftKey||t!==i.length-1||(i[0].focus(),e.preventDefault())}focusableEls_(){let e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,e=>(e instanceof p().HTMLAnchorElement||e instanceof p().HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof p().HTMLInputElement||e instanceof p().HTMLSelectElement||e instanceof p().HTMLTextAreaElement||e instanceof p().HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof p().HTMLIFrameElement||e instanceof p().HTMLObjectElement||e instanceof p().HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable"))}}
41rm.prototype.options_={pauseOnOpen:!0,temporary:!0},i7.registerComponent("ModalDialog",rm);class rg extends iV{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t<e.length;t++)this.addTrack(e[t])}addTrack(e){let t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.tracks_[t]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=()=>{this.trigger({track:e,type:"labelchange",target:this})},iG(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let i=0,r=this.length;i<r;i++)if(this[i]===e){(t=this[i]).off&&t.off(),this.tracks_.splice(i,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})}getTrackById(e){let t=null;for(let i=0,r=this.length;i<r;i++){let r=this[i];if(r.id===e){t=r;break}}return t}}for(let e in rg.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"},rg.prototype.allowedEvents_)rg.prototype["on"+e]=null;let ry=function(e,t){for(let i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].enabled=!1)},rv=function(e,t){for(let i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].selected=!1)};class r_ extends rg{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),-1===["metadata","chapters"].indexOf(e.kind)&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}}class rb{constructor(e){rb.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){let t=this.length||0,i=0,r=e.length;this.cues_=e,this.length_=e.length;let n=function(e){""+e in this||Object.defineProperty(this,""+e,{get(){return this.cues_[e]}})};if(t<r)for(i=t;i<r;i++)n.call(this,i)}getCueById(e){let t=null;for(let i=0,r=this.length;i<r;i++){let r=this[i];if(r.id===e){t=r;break}}return t}}let rT={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},rw={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},rS={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},rE={disabled:"disabled",hidden:"hidden",showing:"showing"};class rC extends iV{constructor(e={}){super();let t={id:e.id||"vjs_track_"+iI++,kind:e.kind||"",language:e.language||""},i=e.label||"";for(let e in t)Object.defineProperty(this,e,{get:()=>t[e],set(){}});Object.defineProperty(this,"label",{get:()=>i,set(e){e!==i&&(i=e,this.trigger("labelchange"))}})}}let rk=function(e){return new URL(e,m().baseURI)},rx=function(e){return new URL(e,m().baseURI).href},rD=function(e){if("string"==typeof e){let t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e);if(t)return t.pop().toLowerCase()}return""},rI=function(e,t=p().location){return rk(e).origin!==t.origin};var rA=Object.freeze({__proto__:null,parseUrl:rk,getAbsoluteURL:rx,getFileExtension:rD,isCrossOrigin:rI});let rO=function(e,t){let i=new(p()).WebVTT.Parser(p(),p().vttjs,p().WebVTT.StringDecoder()),r=[];i.oncue=function(e){t.addCue(e)},i.onparsingerror=function(e){r.push(e)},i.onflush=function(){t.trigger({type:"loadeddata",target:t})},i.parse(e),r.length>0&&(p().console&&p().console.groupCollapsed&&p().console.groupCollapsed(`Text Track parsing errors for ${t.src}`),r.forEach(e=>tg.error(e)),p().console&&p().console.groupEnd&&p().console.groupEnd()),i.flush()},rL=function(e,t){let i={uri:e},r=rI(e);r&&(i.cors=r);let n="use-credentials"===t.tech_.crossOrigin();n&&(i.withCredentials=n),y()(i,iq(this,function(e,i,r){if(e)return tg.error(e,i);t.loaded_=!0,"function"!=typeof p().WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],e=>"vttjserror"===e.type?void tg.error(`vttjs failed to load, stopping trying to process ${t.src}`):rO(r,t)):rO(r,t)}))};class rP extends rC{constructor(e={}
41){if(!e.tech)throw Error("A tech was not provided.");let t=tE(e,{kind:rS[e.kind]||"subtitles",language:e.language||e.srclang||""}),i=rE[t.mode]||"disabled",r=t.default;("metadata"===t.kind||"chapters"===t.kind)&&(i="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=!1!==this.tech_.preloadTextTracks;let n=new rb(this.cues_),s=new rb(this.activeCues_),a=!1;this.timeupdateHandler=iq(this,function(e={}){if(!this.tech_.isDisposed()){if(!this.tech_.isReady_){"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,a&&(this.trigger("cuechange"),a=!1),"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}}),this.tech_.one("dispose",()=>{this.stopTracking()}),"disabled"!==i&&this.startTracking(),Object.defineProperties(this,{default:{get:()=>r,set(){}},mode:{get:()=>i,set(e){rE[e]&&i!==e&&(i=e,this.preload_||"disabled"===i||0!==this.cues.length||rL(this.src,this),this.stopTracking(),"disabled"!==i&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?n:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(0===this.cues.length)return s;let e=this.tech_.currentTime(),t=[];for(let i=0,r=this.cues.length;i<r;i++){let r=this.cues[i];r.startTime<=e&&r.endTime>=e&&t.push(r)}if(a=!1,t.length!==this.activeCues_.length)a=!0;else for(let e=0;e<t.length;e++)-1===this.activeCues_.indexOf(t[e])&&(a=!0);return this.activeCues_=t,s.setCues_(this.activeCues_),s},set(){}}}),t.src?(this.src=t.src,this.preload_||(this.loaded_=!0),(this.preload_||"subtitles"!==t.kind&&"captions"!==t.kind)&&rL(this.src,this)):this.loaded_=!0}startTracking(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)}stopTracking(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)}addCue(e){let t=e;if(!("getCueAsHTML"in t)){for(let i in t=new(p()).vttjs.VTTCue(e.startTime,e.endTime,e.text),e)i in t||(t[i]=e[i]);t.id=e.id,t.originalCue_=e}let i=this.tech_.textTracks();for(let e=0;e<i.length;e++)i[e]!==this&&i[e].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}removeCue(e){let t=this.cues_.length;for(;t--;){let i=this.cues_[t];if(i===e||i.originalCue_&&i.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}}rP.prototype.allowedEvents_={cuechange:"cuechange"};class rN extends rC{constructor(e={}){let t=tE(e,{kind:rw[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"enabled",{get:()=>i,set(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}}class rM extends rC{constructor(e={}){let t=tE(e,{kind:rT[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"selected",{get:()=>i,set(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}}class rR extends iV{constructor(e={}){let t;super();let i=new rP(e);this.kind=i.kind,this.src=i.src,this.srclang=i.language,this.label=i.label,this.default=i.default,Object.defineProperties(this,{readyState:{get:()=>t},track:{get:()=>i}}),t=rR.NONE,i.addEventListener("loadeddata",()=>{t=rR.LOADED,this.trigger({type:"load",target:this})})}}rR.prototype.allowedEvents_={load:"load"},rR.NONE=0,rR.LOADING=1,rR.LOADED=2,rR.ERROR=3;let r$={audio:{ListClass:class extends rg{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){ry(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&ry(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,ry(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}},TrackClass:rN,capitalName:"Audio"},video:{ListClass:class extends rg{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){rv(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let e=0;e<this.length;e++)if(this[e].selected)return e;return -1},set(){}})}addTrack(e){e.selected&&rv(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,rv(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}},TrackClass:rM,capitalName:"Video"},text:{ListClass:r_,TrackClass:rP,capitalName:"Text"}};Object.keys(r$).forEach(function(e){r$[e].getterName=`${e}Tracks`,r$[e].privateName=`${e}Tracks_`});let rU={remoteText:{ListClass:r_,TrackClass:rP,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:class{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,i=e.length;t<i;t++)this.addTrackElement_(e[t])}addTrackElement_(e){let t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.trackElements_[t]}}
vendor: 3,727 bytes, line 41
41),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e)}getTrackElementByTrack_(e){let t;for(let i=0,r=this.trackElements_.length;i<r;i++)if(e===this.trackElements_[i].track){t=this.trackElements_[i];break}return t}removeTrackElement_(e){for(let t=0,i=this.trackElements_.length;t<i;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&"function"==typeof this.trackElements_[t].track.off&&this.trackElements_[t].track.off(),"function"==typeof this.trackElements_[t].off&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}}},TrackClass:rR,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},rB=Object.assign({},r$,rU);rU.names=Object.keys(rU),r$.names=Object.keys(r$),rB.names=[].concat(rU.names).concat(r$.names);class rj extends i7{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=e=>this.onDurationChange(e),this.trackProgress_=e=>this.trackProgress(e),this.trackCurrentTime_=e=>this.trackCurrentTime(e),this.stopTrackingCurrentTime_=e=>this.stopTrackingCurrentTime(e),this.disposeSourceHandler_=e=>this.disposeSourceHandler(e),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),rB.names.forEach(t=>{let i=rB[t];e&&e[i.getterName]&&(this[i.privateName]=e[i.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(t=>{!1===e[`native${t}Tracks`]&&(this[`featuresNative${t}Tracks`]=!1)}),!1===e.nativeCaptions||!1===e.nativeTextTracks?this.featuresNativeTextTracks=!1:(!0===e.nativeCaptions||!0===e.nativeTextTracks)&&(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=!1!==e.preloadTextTracks,this.autoRemoteTextTracks_=new rB.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1)),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(iq(this,function(){let e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return rt(0,0)}bufferedPercent(){return rl(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(r$.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}
41clearTracks(e){(e=[].concat(e)).forEach(e=>{let t=this[`${e}Tracks`]()||[],i=t.length;for(;i--;){let r=t[i];"text"===e&&this.removeRemoteTextTrack(r),t.removeTrack(r)}})}cleanupAutoTextTracks(){let e=this.autoRemoteTextTracks_||[],t=e.length;for(;t--;){let i=e[t];this.removeRemoteTextTrack(i)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return void 0!==e&&(this.error_=new ru(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?rt(0,0):rt()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){r$.names.forEach(e=>{let t=r$[e],i=()=>{this.trigger(`${e}trackchange`)},r=this[t.getterName]();r.addEventListener("removetrack",i),r.addEventListener("addtrack",i),this.on("dispose",()=>{r.removeEventListener("removetrack",i),r.removeEventListener("addtrack",i)})})}addWebVttScript_(){if(!p().WebVTT)if(m().body.contains(this.el())){if(!this.options_["vtt.js"]&&tS(_())&&Object.keys(_()).length>0)return void this.trigger("vttjsloaded");let e=m().createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",()=>{e.onload=null,e.onerror=null}),p().WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){let e=this.textTracks(),t=this.remoteTextTracks(),i=t=>e.addTrack(t.track),r=t=>e.removeTrack(t.track);t.on("addtrack",i),t.on("removetrack",r),this.addWebVttScript_();let n=()=>this.trigger("texttrackchange"),s=()=>{n();for(let t=0;t<e.length;t++){let i=e[t];i.removeEventListener("cuechange",n),"showing"===i.mode&&i.addEventListener("cuechange",n)}};s(),e.addEventListener("change",s),e.addEventListener("addtrack",s),e.addEventListener("removetrack",s),this.on("dispose",function(){t.off("addtrack",i),t.off("removetrack",r),e.removeEventListener("change",s),e.removeEventListener("addtrack",s),e.removeEventListener("removetrack",s);for(let t=0;t<e.length;t++)e[t].removeEventListener("cuechange",n)})}addTextTrack(e,t,i){if(!e)throw Error("TextTrack kind is required but was not provided");return function(e,t,i,r,n={}){let s=e.textTracks();n.kind=t,i&&(n.label=i),r&&(n.language=r),n.tech=e;let a=new rB.text.TrackClass(n);return s.addTrack(a),a}(this,e,t,i)}createRemoteTextTrack(e){let t=tE(e,{tech:this});return new rU.remoteTextEl.TrackClass(t)}addRemoteTextTrack(e={},t){let i=this.createRemoteTextTrack(e);return"boolean"!=typeof t&&(t=!1),this.remoteTextTrackEls().addTrackElement_(i),this.remoteTextTracks().addTrack(i.track),!1===t&&this.ready(()=>this.autoRemoteTextTracks_.addTrack(i.track)),i}removeRemoteTextTrack(e){let t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){let t=iI++;return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())})):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return rj.canPlayType(e.type)}static isTech(e){return e.prototype instanceof rj||e instanceof rj||e===rj}static registerTech(e,t){if(rj.techs_||(rj.techs_={}),!rj.isTech(t))throw Error(`Tech ${e} must be a Tech`);if(!rj.canPlayType)throw Error("Techs must have a static canPlayType method on them");if(!rj.canPlaySource)throw Error("Techs must have a static canPlaySource method on them");return e=i3(e),rj.techs_[e]=t,rj.techs_[i8(e)]=t,"Tech"!==e&&rj.defaultTechOrder_.push(e),t}static getTech(e){if(e){if(rj.techs_&&rj.techs_[e])return rj.techs_[e];
41if(e=i3(e),p()&&p().videojs&&p().videojs[e])return tg.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),p().videojs[e]}}}rB.names.forEach(function(e){let t=rB[e];rj.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}}),rj.prototype.featuresVolumeControl=!0,rj.prototype.featuresMuteControl=!0,rj.prototype.featuresFullscreenResize=!1,rj.prototype.featuresPlaybackRate=!1,rj.prototype.featuresProgressEvents=!1,rj.prototype.featuresSourceset=!1,rj.prototype.featuresTimeupdateEvents=!1,rj.prototype.featuresNativeTextTracks=!1,rj.prototype.featuresVideoFrameCallback=!1,rj.withSourceHandlers=function(e){e.registerSourceHandler=function(t,i){let r=e.sourceHandlers;r||(r=e.sourceHandlers=[]),void 0===i&&(i=r.length),r.splice(i,0,t)},e.canPlayType=function(t){let i,r=e.sourceHandlers||[];for(let e=0;e<r.length;e++)if(i=r[e].canPlayType(t))return i;return""},e.selectSourceHandler=function(t,i){let r=e.sourceHandlers||[];for(let e=0;e<r.length;e++)if(r[e].canHandleSource(t,i))return r[e];return null},e.canPlaySource=function(t,i){let r=e.selectSourceHandler(t,i);return r?r.canHandleSource(t,i):""},["seekable","seeking","duration"].forEach(function(e){let t=this[e];"function"==typeof t&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)})},e.prototype),e.prototype.setSource=function(t){let i=e.selectSourceHandler(t,this.options_);i||(e.nativeSourceHandler?i=e.nativeSourceHandler:tg.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),i!==e.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=i.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},e.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}},i7.registerComponent("Tech",rj),rj.registerTech("Tech",rj),rj.defaultTechOrder_=[];let rq={},rF={},rH={};function rz(e,t,i,r=null){let n="call"+i3(i),s=e.reduce(rX(n),r),a=s===rH,o=a?null:t[i](s);return function(e,t,i,r){for(let n=e.length-1;n>=0;n--){let s=e[n];s[t]&&s[t](r,i)}}(e,i,o,a),o}let rV={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},rW={setCurrentTime:1,setMuted:1,setVolume:1},rG={play:1,pause:1};function rX(e){return(t,i)=>t===rH?rH:i[e]?i[e](t):t}let rY={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"},rK=function(e=""){return rY[rD(e).toLowerCase()]||""},rQ=function(e){if(Array.isArray(e)){let t=[];e.forEach(function(e){Array.isArray(e=rQ(e))?t=t.concat(e):tw(e)&&t.push(e)}),e=t}else e="string"==typeof e&&e.trim()?[rJ({src:e})]:tw(e)&&"string"==typeof e.src&&e.src&&e.src.trim()?[rJ(e)]:[];return e};function rJ(e){if(!e.type){let t=rK(e.src);t&&(e.type=t)}return e}let rZ=tH?10009:tz?461:8,r0={codes:{play:415,pause:19,ff:417,rw:412,back:rZ},names:{415:"play",19:"pause",417:"ff",412:"rw",[rZ]:"back"},isEventKey(e,t){return t=t.toLowerCase(),!!this.names[e.keyCode]&&this.names[e.keyCode]===t},getEventName(e){if(this.names[e.keyCode])return this.names[e.keyCode];if(this.codes[e.code]){let t=this.codes[e.code];return this.names[t]}return null}};class r1 extends iV{constructor(e){super(),this.player_=e,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}start(){!this.isListening_&&(this.player_.on("keydown",this.onKeyDown_),this.player_.on("modalKeydown",this.onKeyDown_),this.player_.on("loadedmetadata",()=>{this.focus(this.updateFocusableComponents()[0])}),this.player_.on("modalclose",()=>{this.refocusComponent()}),this.player_.on("focusin",this.handlePlayerFocus_.bind(this)),this.player_.on("focusout",this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on("aftermodalfill",()=>{this.updateFocusableComponents(),this.focusableComponents.length&&(this.focusableComponents.length>1?this.focusableComponents[1].focus():this.focusableComponents[0].focus())}))}stop(){this.player_.off("keydown",this.onKeyDown_),this.isListening_=!1}onKeyDown_(e){let t=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)){if(this.isPaused_)return;t.preventDefault();let e=t.key.substring(5).toLowerCase();this.move(e)}else if(r0.isEventKey(t,"play")||r0.isEventKey(t,"pause")||r0.isEventKey(t,"ff")||r0.isEventKey(t,"rw")){t.preventDefault();let e=r0.getEventName(t);this.performMediaAction_(e)}else r0.isEventKey(t,"Back")&&e.target&&"function"==typeof e.target.closeable&&e.target.closeable()&&(t.preventDefault(),e.target.close())}performMediaAction_(e){if(this.player_)switch(e){case"play":this.player_.paused()&&this.player_.play();break;case"pause":this.player_.paused()||this.player_.pause();break;case"ff":this.userSeek_(this.player_.currentTime()+5);break;case"rw":this.userSeek_(this.player_.currentTime()-5)}}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(e){let t=e.relatedTarget,i=null,r=this.getCurrentComponent(e.target);t&&(i=!!t.closest(".video-js"),t.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(!e.currentTarget.contains(e.relatedTarget)&&!i||!t)&&(r&&"CloseButton"===r.name()?this.refocusComponent():(this.pause(),r&&r.el()&&(this.lastFocusedComponent_=r)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsF
41ocusable()&&this.resume()}updateFocusableComponents(){let e=this.player_,t=[];function i(e){for(let r of e)r.hasOwnProperty("el_")&&r.getIsFocusable()&&r.getIsAvailableToBeFocused(r.el())&&t.push(r),r.hasOwnProperty("children_")&&r.children_.length>0&&i(r.children_)}return e.children_.forEach(e=>{if(e.hasOwnProperty("el_"))if(e.getIsFocusable&&e.getIsAvailableToBeFocused&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el()))return void t.push(e);else e.hasOwnProperty("children_")&&e.children_.length>0?i(e.children_):e.hasOwnProperty("items")&&e.items.length>0?i(e.items):this.findSuitableDOMChild(e)&&t.push(e);if("ErrorDisplay"===e.name_&&e.opened_){let i=e.el_.querySelector(".vjs-errors-ok-button-container");i&&i.querySelectorAll("button").forEach((e,i)=>{t.push({name:()=>"ModalButton"+(i+1),el:()=>e,getPositions:()=>{let t=e.getBoundingClientRect();return{boundingClientRect:{x:t.x,y:t.y,width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left},center:{x:t.left+t.width/2,y:t.top+t.height/2,width:0,height:0,top:t.top+t.height/2,right:t.left+t.width/2,bottom:t.top+t.height/2,left:t.left+t.width/2}}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:e=>!0,focus:()=>e.focus()})})}}),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(e){return e.el()?function t(i){if(e.getIsFocusable(i)&&e.getIsAvailableToBeFocused(i))return i;for(let e=0;e<i.children.length;e++){let r=t(i.children[e]);if(r)return r}return null}(e.el()):null}getCurrentComponent(e){this.updateFocusableComponents();let t=e||document.activeElement;if(this.focusableComponents.length){for(let e of this.focusableComponents)if(e.el()===t)return e}}add(e){let t=[...this.focusableComponents];e.hasOwnProperty("el_")&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el())&&t.push(e),this.focusableComponents=t,this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}remove(e){for(let t=0;t<this.focusableComponents.length;t++)if(this.focusableComponents[t].name()===e.name()){this.focusableComponents.splice(t,1),this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents});return}}clear(){this.focusableComponents.length>0&&(this.focusableComponents=[],this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents}))}move(e){let t=this.getCurrentComponent();if(!t)return;let i=t.getPositions(),r=this.focusableComponents.filter(r=>r!==t&&this.isInDirection_(i.boundingClientRect,r.getPositions().boundingClientRect,e)),n=this.findBestCandidate_(i.center,r,e);n?this.focus(n):this.trigger({type:"endOfFocusableComponents",direction:e,focu
41sedComponent:t})}findBestCandidate_(e,t,i){let r=1/0,n=null;for(let s of t){let t=s.getPositions().center,a=this.calculateDistance_(e,t,i);a<r&&(r=a,n=s)}return n}isInDirection_(e,t,i){switch(i){case"right":return t.left>=e.right;case"left":return t.right<=e.left;case"down":return t.top>=e.bottom;case"up":return t.bottom<=e.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let e=0;e<this.focusableComponents.length;e++)if(this.focusableComponents[e].name()===this.lastFocusedComponent_.name())return void this.focus(this.focusableComponents[e])}else this.focus(this.updateFocusableComponents()[0])}focus(e){"object"==typeof e&&(e.getIsAvailableToBeFocused(e.el())?e.focus():this.findSuitableDOMChild(e)&&this.findSuitableDOMChild(e).focus())}calculateDistance_(e,t,i){let r,n=Math.abs(e.x-t.x),s=Math.abs(e.y-t.y);switch(i){case"right":case"left":r=n+100*s;break;case"up":r=2*s+.5*n;break;case"down":r=5*s+n;break;default:r=n+s}return r}searchForTrackSelect_(){for(let e of this.updateFocusableComponents())if("TextTrackSelect"===e.constructor.name){this.focus(e);break}}}i7.registerComponent("MediaLoader",class extends i7{constructor(e,t,i){if(super(e,tE({createEl:!1},t),i),t.playerOptions.sources&&0!==t.playerOptions.sources.length)e.src(t.playerOptions.sources);else for(let i=0,r=t.playerOptions.techOrder;i<r.length;i++){let t=i3(r[i]),n=rj.getTech(t);if(t||(n=i7.getComponent(t)),n&&n.isSupported()){e.loadTech_(t);break}}}});class r2 extends i7{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=e=>this.handleMouseOver(e),this.handleMouseOut_=e=>this.handleMouseOut(e),this.handleClick_=e=>this.handleClick(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.emitTapEvents(),this.enable()}createEl(e="div",t={},i={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),"button"===e&&tg.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),i=Object.assign({role:"button"},i),this.tabIndex_=t.tabIndex;let r=t2(e,t,i);return this.player_.options_.experimentalSvgIcons||r.appendChild(t2("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=t2("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(void 0===e)return this.controlText_||"Need Text";let i=this.localize(e);this.controlText_=e,t4(this.controlTextEl_,i),this.nonIconControl||this.player_.options_.noUITitleAttributes||t.setAttribute("title",i)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){" "===e.key||"Enter"===e.key?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}i7.registerComponent("ClickableComponent",r2);class r4 extends r2{constructor(e,t){super(e,t),this.update(),this.update_=e=>this.update(e),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return t2("div",{className:"vjs-poster"})}crossOrigin(e){return void 0===e?this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null:null!==e&&"anonymous"!==e&&"use-credentials"
41!==e?void this.player_.log.warn(`crossOrigin must be null,  "anonymous" or "use-credentials", given "${e}"`):void(this.$("img")&&(this.$("img").crossOrigin=e))}update(e){let t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){if(!e){this.el_.textContent="";return}this.$("img")||this.el_.appendChild(t2("picture",{className:"vjs-poster",tabIndex:-1},{},t2("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?rc(this.player_.play()):this.player_.pause())}}r4.prototype.crossorigin=r4.prototype.crossOrigin,i7.registerComponent("PosterImage",r4);let r8="#222",r3="#ccc",r5={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 r6(e,t){let i;if(4===e.length)i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else if(7===e.length)i=e.slice(1);else throw Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function r7(e,t,i){try{e.style[t]=i}catch(e){return}}function r9(e){return e?`${e}px`:""}i7.registerComponent("TextTrackDisplay",class extends i7{constructor(e,t,i){super(e,t,i);let r=e=>{this.updateDisplayOverlay(),this.updateDisplay(e)};e.on("loadstart",e=>this.toggleDisplay(e)),e.on("texttrackchange",e=>this.updateDisplay(e)),e.on("loadedmetadata",e=>{this.updateDisplayOverlay(),this.preselectTrack(e)}),e.ready(iq(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks)return void this.hide();e.on("fullscreenchange",r),e.on("playerresize",r);let t=p().screen.orientation||p(),i=p().screen.orientation?"change":"orientationchange";t.addEventListener(i,r),e.on("dispose",()=>t.removeEventListener(i,r));let n=this.options_.playerOptions.tracks||[];for(let e=0;e<n.length;e++)this.player_.addRemoteTextTrack(n[e],!0);this.preselectTrack()}))}preselectTrack(){let e,t,i,r={captions:1,subtitles:1},n=this.player_.textTracks(),s=this.player_.cache_.selectedLanguage;for(let a=0;a<n.length;a++){let o=n[a];s&&s.enabled&&s.language&&s.language===o.language&&o.kind in r?o.kind===s.kind?i=o:i||(i=o):s&&!s.enabled?(i=null,e=null,t=null):o.default&&("descriptions"!==o.kind||e?o.kind in r&&!t&&(t=o):e=o)}i?i.mode="showing":t?t.mode="showing":e&&(e.mode="showing")}toggleDisplay(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()}createEl(){return super.createEl("div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})}clearDisplay(){"function"==typeof p().WebVTT&&p().WebVTT.processCues(p(),[],this.el_)}updateDisplay(){let e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){let t=[];for(let i=0;i<e.length;++i){let r=e[i];"showing"===r.mode&&t.push(r)}this.updateForTrack(t);return}let i=null,r=null,n=e.length;for(;n--;){let t=e[n];"showing"===t.mode&&("descriptions"===t.kind?i=t:r=t)}if(r?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(r)):i&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(i)),!p().CSS.supports("inset","10px")){let e=this.el_,t=e.querySelectorAll(".vjs-text-track-cue"),i=this.player_.controlBar.el_.getBoundingClientRect().height,r=this.player_.el_.getBoundingClientRect().height;e.style="",r7(e,"position","relative"),r7(e,"height",r-i+"px"),r7(e,"top","unset"),tV?r7(e,"bottom",r+"px"):r7(e,"bottom","0px"),t.length>0&&t.forEach(e=>{if(e.style.inset){let t=e.style.inset.split(" ");3===t.length&&Object.assign(e.style,{top:t[0],right:t[1],bottom:t[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!p().CSS.supports("inset-inline: 10px"))return;let e=this.player_.currentWidth(),t=this.player_.currentHeight(),i=e/t,r=this.player_.videoWidth()/this.player_.videoHeight(),n=0,s=0;Math.abs(i-r)>.1&&(i>r?n=Math.round((e-t*r)/2):s=Math.round((t-e/r)/2)),r7(this.el_,"insetInline",r9(n)),r7(this.el_,"insetBlock",r9(s))}updateDisplayState(e){let t=this.player_.textTrackSettings.getValues(),i=e.activeCues,r=i.length;for(;r--;){let e=i[r];if(!e)continue;let n=e.displayState;if(t.color&&(n.firstChild.style.color=t.color),t.textOpacity&&r7(n.firstChild,"color",r6(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(n.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&r7(n.firstChild,"backgroundColor",r6(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?r7(n,"backgroundColor",r6(t.windowColor,t.windowOpacity)):n.style.backgroundColor=t.windowColor),t.edgeStyle&&("dropshadow"===t.edgeStyle?n.firstChild.style.textShadow=`2px 2px 3px ${r8}, 2px 2px 4px ${r8}, 2px 2px 5px ${r8}`:"raised"===t.edgeStyle?n.firstChild.style.textShadow=`1px 1px ${r8}, 2px 2px ${r8}, 3px 3px ${r8}`:"depressed"===t.edgeStyle?n.firstChild.style.textShadow=`1px 1px ${r3}, 0 1px ${r3}, -1px -1px ${r8}, 0 -1px ${r8}`:"uniform"===t.edgeStyle&&(n.firstChild.style.textShadow=`0 0 4px ${r8}, 0 0 4px ${r8}, 0 0 4px ${r8}, 0 0 4px ${r8}`)),t.fontPercent&&1!==t.fontPercent){let e=p().parseFloat(n.style.fontSize);n.style.fontSize=e*t.fontPercent+"px",n.style.height="auto",n.style.top="auto"}
41t.fontFamily&&"default"!==t.fontFamily&&("small-caps"===t.fontFamily?n.firstChild.style.fontVariant="small-caps":n.firstChild.style.fontFamily=r5[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),"function"!=typeof p().WebVTT||e.every(e=>!e.activeCues))return;let t=[];for(let i=0;i<e.length;++i){let r=e[i];for(let e=0;e<r.activeCues.length;++e)t.push(r.activeCues[e])}p().WebVTT.processCues(p(),t,this.el_);for(let t=0;t<e.length;++t){let i=e[t];for(let e=0;e<i.activeCues.length;++e){let r=i.activeCues[e].displayState;t5(r,"vjs-text-track-cue","vjs-text-track-cue-"+(i.language?i.language:t)),i.language&&ii(r,"lang",i.language)}this.player_.textTrackSettings&&this.updateDisplayState(i)}}}),i7.registerComponent("LoadingSpinner",class extends i7{createEl(){let e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"Video Player"),i=t2("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[t])}),r=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});return r.appendChild(i),r}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}});class ne extends r2{createEl(e,t={},i={}){e="button",t=Object.assign({className:this.buildCSSClass()},t),i=Object.assign({type:"button"},i);let r=t2(e,t,i);return this.player_.options_.experimentalSvgIcons||r.appendChild(t2("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}addChild(e,t={}){let i=this.constructor.name;return tg.warn(`Adding an actionable (user controllable) child to a Button (${i}) is not supported; use a ClickableComponent instead.`),i7.prototype.addChild.call(this,e,t)}enable(){super.enable(),this.el_.removeAttribute("disabled")}disable(){super.disable(),this.el_.setAttribute("disabled","disabled")}handleKeyDown(e){if(" "===e.key||"Enter"===e.key)return void e.stopPropagation();super.handleKeyDown(e)}}i7.registerComponent("Button",ne);class nt extends ne{constructor(e,t){super(e,t),this.mouseused_=!1,this.setIcon("play"),this.on("mousedown",e=>this.handleMouseDown(e))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){let t=this.player_.play();if(this.mouseused_&&"clientX"in e&&"clientY"in e){rc(t),this.player_.tech(!0)&&this.player_.tech(!0).focus();return}let i=this.player_.getChild("controlBar"),r=i&&i.getChild("playToggle");if(!r)return void this.player_.tech(!0).focus();let n=()=>r.focus();rd(t)?t.then(n,()=>{}):this.setTimeout(n,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}nt.prototype.controlText_="Play Video",i7.registerComponent("BigPlayButton",nt),i7.registerComponent("CloseButton",class extends ne{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){"Escape"===e.key?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}});class ni extends ne{constructor(e,t={}){super(e,t),t.replay=void 0===t.replay||t.replay,this.setIcon("play"),this.on(e,"play",e=>this.handlePlay(e)),this.on(e,"pause",e=>this.handlePause(e)),t.replay&&this.on(e,"ended",e=>this.handleEnded(e))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?rc(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",e=>this.handleSeeked(e))}}ni.prototype.controlText_="Play",i7.registerComponent("PlayToggle",ni);
41class nr extends i7{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],e=>this.update(e)),this.updateTextNode_()}createEl(){let e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),i=t2("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)}\u00a0`},{role:"presentation"});return t.appendChild(i),this.contentEl_=t2("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){(this.player_.options_.enableSmoothSeeking||"seeking"!==e.type)&&this.updateContent(e)}updateTextNode_(e=0){e=ra(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let e=this.textNode_;e&&this.contentEl_.firstChild!==e&&(e=null,tg.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=m().createTextNode(this.formattedTime_),this.textNode_&&(e?this.contentEl_.replaceChild(this.textNode_,e):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}nr.prototype.labelText_="Time",nr.prototype.controlText_="Time",i7.registerComponent("TimeDisplay",nr);class nn extends nr{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;t=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}nn.prototype.labelText_="Current Time",nn.prototype.controlText_="Current Time",i7.registerComponent("CurrentTimeDisplay",nn);class ns extends nr{constructor(e,t){super(e,t);let i=e=>this.updateContent(e);this.on(e,"durationchange",i),this.on(e,"loadstart",i),this.on(e,"loadedmetadata",i)}buildCSSClass(){return"vjs-duration"}updateContent(e){let t=this.player_.duration();this.updateTextNode_(t)}}ns.prototype.labelText_="Duration",ns.prototype.controlText_="Duration",i7.registerComponent("DurationDisplay",ns),i7.registerComponent("TimeDivider",class extends i7{createEl(){let e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),i=super.createEl("span",{textContent:"/"});return t.appendChild(i),e.appendChild(t),e}});class na extends nr{constructor(e,t){super(e,t),this.on(e,"durationchange",e=>this.updateContent(e))}buildCSSClass(){return"vjs-remaining-time"}createEl(){let e=super.createEl();return!1!==this.options_.displayNegative&&e.insertBefore(t2("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){let t;"number"==typeof this.player_.duration()&&(t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t))}}na.prototype.labelText_="Remaining Time",na.prototype.controlText_="Remaining Time",i7.registerComponent("RemainingTimeDisplay",na),i7.registerComponent("LiveDisplay",class extends i7{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",e=>this.updateShowing(e))}createEl(){let e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=t2("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(t2("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")}\u00a0`})),this.contentEl_.appendChild(m().createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}});class no extends ne{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=e=>this.updateLiveEdgeStatus(e),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){let e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=t2("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}function nl(e,t,i){return Math.min(i,Math.max(t,isNaN(e=Number(e))?t:e))}no.prototype.controlText_="Seek to live, currently playing live",i7.registerComponent("SeekToLive",n
41o);var nu=Object.freeze({__proto__:null,clamp:nl});class nd extends i7{constructor(e,t){super(e,t),this.handleMouseDown_=e=>this.handleMouseDown(e),this.handleMouseUp_=e=>this.handleMouseUp(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.handleClick_=e=>this.handleClick(e),this.handleMouseMove_=e=>this.handleMouseMove(e),this.update_=e=>this.update(e),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;let e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},i={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),i=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},i),super.createEl(e,t,i)}handleMouseDown(e){let t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||tN||e.preventDefault(),is(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){let t=this.bar.el_.ownerDocument;ia(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;let e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{let t=this.vertical()?"height":"width";this.bar.el().style[t]=(100*e).toFixed(2)+"%"})),e}getProgress(){return Number(nl(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){let t=iu(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){let t=this.options_.playerOptions.spatialNavigation,i=t&&t.enabled,r=t&&t.horizontalSeek;i?r&&"ArrowLeft"===e.key||!r&&"ArrowDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepBack()):r&&"ArrowRight"===e.key||!r&&"ArrowUp"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e):"ArrowLeft"===e.key||"ArrowDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepBack()):"ArrowUp"===e.key||"ArrowRight"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}i7.registerComponent("Slider",nd);let nc=(e,t)=>nl(e/t*100,0,100).toFixed(2)+"%";i7.registerComponent("LoadProgressBar",class extends i7{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",e=>this.update(e))}createEl(){let e=super.createEl("div",{className:"vjs-load-progress"}),t=t2("span",{className:"vjs-control-text"}),i=t2("span",{textContent:this.localize("Loaded")}),r=m().createTextNode(": ");return this.percentageEl_=t2("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(i),t.appendChild(r),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{let e=this.player_.liveTracker,t=this.player_.buffered(),i=e&&e.isLive()?e.seekableEnd():this.player_.duration(),r=this.player_.bufferedEnd(),n=this.partEls_,s=nc(r,i);this.percent_!==s&&(this.el_.style.width=s,t4(this.percentageEl_,s),this.percent_=s);for(let e=0;e<t.length;e++){let i=t.start(e),s=t.end(e),a=n[e];a||(a=this.el_.appendChild(t2()),n[e]=a),(a.dataset.start!==i||a.dataset.end!==s)&&(a.dataset.start=i,a.dataset.end=s,a.style.left=nc(i,r),a.style.width=nc(s-i,r))}for(let e=n.length;e>t.length;e--)this.el_.removeChild(n[e-1]);n.length=t.length})}}),i7.registerComponent("TimeTooltip",class extends i7{constructor(e,t){super(e,t),this.update=iF(iq(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,i){let r=il(this.el_),n=io(this.player_.el()),s=e.width*t;if(!n||!r)return;let a=e.left-n.left+s,o=e.width-s+(n.right-e.right);o||(o=e.width-s,a=s);let l=r.width/2;a<l?l+=l-a:o<l&&(l=o),l<0?l=0:l>r.width&&(l=r.width),l=Math.round(l),this.el_.style.right=`-${l}px`,this.write(i)}write(e){t4(this.el_,e)}updateTime(e,t,i,r){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let n,s=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){let e=this.player_.liveTracker.liveWindow(),i=e-t*e;n=(i<1?"":"-")+ra(i,e)}else n=ra(i,s);this.update(e,t,n),r&&r()})}});
41class nh extends i7{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=iF(iq(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t){let i=this.getChild("timeTooltip");if(!i)return;let r=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(e,t,r)}}nh.prototype.options_={children:[]},tX||tA||nh.prototype.options_.children.push("timeTooltip"),i7.registerComponent("PlayProgressBar",nh);class np extends i7{constructor(e,t){super(e,t),this.update=iF(iq(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){let i=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,i,()=>{this.el_.style.left=`${e.width*t}px`})}}np.prototype.options_={children:["timeTooltip"]},i7.registerComponent("MouseTimeDisplay",np);class nf extends nd{constructor(e,t){(t=tE(nf.prototype.options_,t)).children=[...t.children];let i=e.options_.disableSeekWhileScrubbingOnMobile&&(tX||tA);(tX||tA)&&!i||t.children.splice(1,0,"mouseTimeDisplay"),super(e,t),this.shouldDisableSeekWhileScrubbingOnMobile_=i,this.pendingSeekTime_=null,this.setEventHandlers_()}setEventHandlers_(){this.update_=iq(this,this.update),this.update=iF(this.update_,30),this.on(this.player_,["durationchange","timeupdate"],this.update),this.on(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in m()&&"visibilityState"in m()&&this.on(m(),"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){"hidden"===m().visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,30))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if("hidden"===m().visibilityState)return;let t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{let e=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),i=this.player_.liveTracker,r=this.player_.duration();i&&i.isLive()&&(r=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.percent_=t),(this.currentTime_!==e||this.duration_!==r)&&(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[ra(e,r),ra(r,r)],"{1} of {2}")),this.currentTime_=e,this.duration_=r),this.bar&&this.bar.update(io(this.el()),this.getProgress())}),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}getPercent(){let e;if(this.pendingSeekTime_)return this.pendingSeekTime_/this.player_.duration();let t=this.getCurrentTime_(),i=this.player_.liveTracker;return i&&i.isLive()?(e=(t-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(e=1)):e=t/this.player_.duration(),e}handleMouseDown(e){ig(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.shouldDisableSeekWhileScrubbingOnMobile_||this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){let i;if(!ig(e)||isNaN(this.player_.duration()))return;t||this.player_.scrubbing()||this.player_.scrubbing(!0);let r=this.calculateDistance(e),n=this.player_.liveTracker;
41if(n&&n.isLive()){if(r>=.99)return void n.seekToLiveEdge();let e=n.seekableStart(),t=n.liveCurrentTime();if((i=e+r*n.liveWindow())>=t&&(i=t),i<=e&&(i=e+.1),i===1/0)return}else(i=r*this.player_.duration())===this.player_.duration()&&(i-=.1);this.shouldDisableSeekWhileScrubbingOnMobile_?this.pendingSeekTime_=i:this.userSeek_(i),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();let e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();let e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.pendingSeekTime_&&(this.userSeek_(this.pendingSeekTime_),this.pendingSeekTime_=null),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?rc(this.player_.play()):this.update_()}stepForward(){this.userSeek_(this.player_.currentTime()+5)}stepBack(){this.userSeek_(this.player_.currentTime()-5)}handleAction(e){this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){let t=this.player_.liveTracker;if(" "===e.key||"Enter"===e.key)e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if("Home"===e.key)e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if("End"===e.key)e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();let i=.1*parseInt(e.key,10);t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*i):this.userSeek_(this.player_.duration()*i)}else"PageDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):"PageUp"===e.key?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["durationchange","timeupdate"],this.update),this.off(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in m()&&"visibilityState"in m()&&this.off(m(),"visibilitychange",this.toggleVisibility_),super.dispose()}}nf.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},i7.registerComponent("SeekBar",nf);class nm extends i7{constructor(e,t){super(e,t),this.handleMouseMove=iF(iq(this,this.handleMouseMove),30),this.throttledHandleMouseSeek=iF(iq(this,this.handleMouseSeek),30),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.handleMouseDownHandler_=e=>this.handleMouseDown(e),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){let t=this.getChild("seekBar");if(!t)return;let i=t.getChild("playProgressBar"),r=t.getChild("mouseTimeDisplay");if(!i&&!r)return;let n=t.el(),s=il(n),a=iu(n,e).x;a=nl(a,0,1),r&&r.update(s,a),i&&i.update(s,t.getProgress())}handleMouseSeek(e){let t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}
41disable(){if(this.children().forEach(e=>e.disable&&e.disable()),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){let e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&rc(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){let e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){let t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){let t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}nm.prototype.options_={children:["seekBar"]},i7.registerComponent("ProgressControl",nm);class ng extends ne{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],e=>this.handlePictureInPictureChange(e)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],e=>this.handlePictureInPictureEnabledChange(e)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){if(!("audio"===this.player_.currentType().substring(0,5)||this.player_.audioPosterMode()||this.player_.audioOnlyMode()))return void this.show();this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()}handlePictureInPictureEnabledChange(){m().pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in p()?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){"function"==typeof m().exitPictureInPicture&&super.show()}}ng.prototype.controlText_="Picture-in-Picture",i7.registerComponent("PictureInPictureToggle",ng);class ny extends ne{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",e=>this.handleFullscreenChange(e)),!1===m()[e.fsApi_.fullscreenEnabled]&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}ny.prototype.controlText_="Fullscreen",i7.registerComponent("FullscreenToggle",ny);let nv=function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})};i7.registerComponent("VolumeLevel",class extends i7{createEl(){let e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}
41),i7.registerComponent("VolumeLevelTooltip",class extends i7{constructor(e,t){super(e,t),this.update=iF(iq(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,i,r){if(!i){let i=io(this.el_),r=io(this.player_.el()),n=e.width*t;if(!r||!i)return;let s=e.left-r.left+n,a=e.width-n+(r.right-e.right),o=i.width/2;s<o?o+=o-s:a<o&&(o=a),o<0?o=0:o>i.width&&(o=i.width),this.el_.style.right=`-${o}px`}this.write(`${r}%`)}write(e){t4(this.el_,e)}updateVolume(e,t,i,r,n){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,i,r.toFixed(0)),n&&n()})}});class n_ extends i7{constructor(e,t){super(e,t),this.update=iF(iq(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,i){this.getChild("volumeLevelTooltip").updateVolume(e,t,i,100*t,()=>{i?this.el_.style.bottom=`${e.height*t}px`:this.el_.style.left=`${e.width*t}px`})}}n_.prototype.options_={children:["volumeLevelTooltip"]},i7.registerComponent("MouseVolumeLevelDisplay",n_);class nb extends nd{constructor(e,t){super(e,t),this.on("slideractive",e=>this.updateLastVolume_(e)),this.on(e,"volumechange",e=>this.updateARIAAttributes(e)),e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){ig(e)&&super.handleMouseDown(e)}handleMouseMove(e){let t=this.getChild("mouseVolumeLevelDisplay");if(t){let i=this.el(),r=io(i),n=this.vertical(),s=iu(i,e);s=nl(s=n?s.y:s.x,0,1),t.update(r,s,n)}ig(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){let t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(100*this.player_.volume())}updateLastVolume_(){let e=this.player_.volume();this.one("sliderinactive",()=>{0===this.player_.volume()&&this.player_.lastVolume_(e)})}}nb.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},tX||tA||nb.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),nb.prototype.playerEvent="volumechange",i7.registerComponent("VolumeBar",nb);class nT extends i7{constructor(e,t={}){t.vertical=t.vertical||!1,(void 0===t.volumeBar||tS(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),nv(this,e),this.throttledHandleMouseMove=iF(iq(this,this.handleMouseMove),30),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.on("mousedown",e=>this.handleMouseDown(e)),this.on("touchstart",e=>this.handleMouseDown(e)),this.on("mousemove",e=>this.handleMouseMove(e)),this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")}),this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){let t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){let t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}nT.prototype.options_={children:["volumeBar"]}
41,i7.registerComponent("VolumeControl",nT);let nw=function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})};class nS extends ne{constructor(e,t){super(e,t),nw(this,e),this.on(e,["loadstart","volumechange"],e=>this.update(e))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){let t=this.player_.volume(),i=this.player_.lastVolume_();0===t?(this.player_.volume(i<.1?.1:i),this.player_.muted(!1)):this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){let e=this.player_.volume(),t=3;this.setIcon("volume-high"),tX&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?(this.setIcon("volume-mute"),t=0):e<.33?(this.setIcon("volume-low"),t=1):e<.67&&(this.setIcon("volume-medium"),t=2),t6(this.el_,[0,1,2,3].reduce((e,t)=>e+`${t?" ":""}vjs-vol-${t}`,"")),t5(this.el_,`vjs-vol-${t}`)}updateControlText_(){let e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)}}nS.prototype.controlText_="Mute",i7.registerComponent("MuteToggle",nS);class nE extends i7{constructor(e,t={}){void 0!==t.inline?t.inline=t.inline:t.inline=!0,(void 0===t.volumeControl||tS(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=e=>this.handleKeyPress(e),this.on(e,["loadstart"],e=>this.volumePanelState_(e)),this.on(this.muteToggle,"keyup",e=>this.handleKeyPress(e)),this.on(this.volumeControl,"keyup",e=>this.handleVolumeControlKeyUp(e)),this.on("keydown",e=>this.handleKeyPress(e)),this.on("mouseover",e=>this.handleMouseOver(e)),this.on("mouseout",e=>this.handleMouseOut(e)),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){"Escape"===e.key&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),iM(m(),"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),iR(m(),"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){"Escape"===e.key&&this.handleMouseOut()}}nE.prototype.options_={children:["muteToggle","volumeControl"]},i7.registerComponent("VolumePanel",nE);class nC extends ne{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){let e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){let t;if(isNaN(this.player_.duration()))return;let i=this.player_.currentTime(),r=this.player_.liveTracker,n=r&&r.isLive()?r.seekableEnd():this.player_.duration();t=i+this.skipTime<=n?i+this.skipTime:n,this.player_.currentTime(t)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}nC.prototype.controlText_="Skip Forward",i7.registerComponent("SkipForward",nC);class nk extends ne{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1}
41 seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){let e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){let t,i=this.player_.currentTime(),r=this.player_.liveTracker,n=r&&r.isLive()&&r.seekableStart();t=n&&i-this.skipTime<=n?n:i>=this.skipTime?i-this.skipTime:0,this.player_.currentTime(t)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}nk.prototype.controlText_="Skip Backward",i7.registerComponent("SkipBackward",nk);class nx extends i7{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",e=>this.handleKeyDown(e)),this.boundHandleBlur_=e=>this.handleBlur(e),this.boundHandleTapClick_=e=>this.handleTapClick(e)}addEventListenerForItem(e){e instanceof i7&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof i7&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){"string"==typeof e&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){let t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){let e=this.options_.contentElType||"ul";this.contentEl_=t2(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");let t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),iM(t,"click",function(e){e.preventDefault(),e.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){let t=e.relatedTarget||m().activeElement;if(!this.children().some(e=>e.el()===t)){let e=this.menuButton_;e&&e.buttonPressed_&&t!==e.el().firstChild&&e.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();let t=this.children();if(!Array.isArray(t))return;let i=t.filter(t=>t.el()===e.target)[0];i&&"CaptionSettingsMenuItem"!==i.name()&&this.menuButton_.focus()}}handleKeyDown(e){"ArrowLeft"===e.key||"ArrowDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepForward()):("ArrowRight"===e.key||"ArrowUp"===e.key)&&(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){let t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}i7.registerComponent("Menu",nx);class nD extends i7{constructor(e,t={}){super(e,t),this.menuButton_=new ne(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");let i=ne.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+i,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;let r=e=>this.handleClick(e);this.handleMenuKeyUp_=e=>this.handleMenuKeyUp(e),this.on(this.menuButton_,"tap",r),this.on(this.menuButton_,"click",r),this.on(this.menuButton_,"keydown",e=>this.handleKeyDown(e)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),iM(m(),"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",e=>this.handleMouseLeave(e)),this.on("keydown",e=>this.handleSubmenuKeyDown(e))}update(){let e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){let e=new nx(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){let t=t2("li",{className:"vjs-menu-title",textContent:i3(this.options_.title),tabIndex:-1}),i=new i7(this.player_,{el:t});e.addItem(i)}if(this.items=this.createItems(),this.items)for(let t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e}createItems(){}createEl(){return super.createEl("div",{className:this.buildWrapperCSSClass()},{})}setIcon(e){super.setIcon(e,this.menuButton_.el_)}buildWrapperCSSClass(){let e="vjs-menu-button";!0===this.options_.inline?e+="-inline":e+="-popup";let t=ne.prototype.buildCSSClass();return`vjs-menu-button ${e} ${t} ${super.buildCSSClass()}`}buildCSSClass(){let e="vjs-menu-button";return!0===this.options_.inline?e+="-inline":e+="-popup",`vjs-menu-button ${e} ${super.buildCSSClass()}`}controlText(e,t=this.menuButton_.el()){return this.menuButton_.controlText(e,t)}dispose(){this.handleMouseLeave(),super.dispose()}handleClick(e){this.buttonPressed_?this.unpressButton():this.pressButton()}handleMouseLeave(e){this.removeClass("vjs-hover"),iR(m(),"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(e){"Escape"===e.key||"Tab"===e.key?(this.buttonPressed_&&this.unpressButton(),e.key):"Up"!==e.key&&("Down"!==e.key||this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)||this.buttonPressed_||(e.preventDefault(),this.pressButton())}handleMenuKeyUp(e){("Escape"===e.key||"Tab"===e.key)&&this.removeClass("vjs-hover")}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e)}
41handleSubmenuKeyDown(e){("Escape"===e.key||"Tab"===e.key)&&(this.buttonPressed_&&this.unpressButton(),e.key)}pressButton(){this.enabled_&&(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),tX&&t0()||this.menu.focus())}unpressButton(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))}disable(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()}enable(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()}}i7.registerComponent("MenuButton",nD);class nI extends nD{constructor(e,t){let i=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),!i)return;let r=iq(this,this.update);i.addEventListener("removetrack",r),i.addEventListener("addtrack",r),i.addEventListener("labelchange",r),this.player_.on("ready",r),this.player_.on("dispose",function(){i.removeEventListener("removetrack",r),i.removeEventListener("addtrack",r),i.removeEventListener("labelchange",r)})}}i7.registerComponent("TrackButton",nI);class nA extends r2{constructor(e,t){super(e,t),this.selectable=t.selectable,this.isSelected_=t.selected||!1,this.multiSelectable=t.multiSelectable,this.selected(this.isSelected_),this.selectable?this.multiSelectable?this.el_.setAttribute("role","menuitemcheckbox"):this.el_.setAttribute("role","menuitemradio"):this.el_.setAttribute("role","menuitem")}createEl(e,t,i){this.nonIconControl=!0;let r=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),i),n=t2("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});return this.player_.options_.experimentalSvgIcons?r.appendChild(n):r.replaceChild(n,r.querySelector(".vjs-icon-placeholder")),r}handleKeyDown(e){["Tab","Escape","ArrowUp","ArrowLeft","ArrowRight","ArrowDown"].includes(e.key)||super.handleKeyDown(e)}handleClick(e){this.selected(!0)}selected(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))}}i7.registerComponent("MenuItem",nA);class nO extends nA{constructor(e,t){let i=t.track,r=e.textTracks();t.label=i.label||i.language||"Unknown",t.selected="showing"===i.mode,super(e,t),this.track=i,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);let n=(...e)=>{this.handleTracksChange.apply(this,e)},s=(...e)=>{this.handleSelectedLanguageChange.apply(this,e)};if(e.on(["loadstart","texttrackchange"],n),r.addEventListener("change",n),r.addEventListener("selectedlanguagechange",s),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],n),r.removeEventListener("change",n),r.removeEventListener("selectedlanguagechange",s)}),void 0===r.onchange){let e;this.on(["tap","click"],function(){if("object"!=typeof p().Event)try{e=new(p()).Event("change")}catch(e){}e||(e=m().createEvent("Event")).initEvent("change",!0,!0),r.dispatchEvent(e)})}this.handleTracksChange()}handleClick(e){let t=this.track,i=this.player_.textTracks();if(super.handleClick(e),i)for(let e=0;e<i.length;e++){let r=i[e];-1!==this.kinds.indexOf(r.kind)&&(r===t?"showing"!==r.mode&&(r.mode="showing"):"disabled"!==r.mode&&(r.mode="disabled"))}}handleTracksChange(e){let t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)}handleSelectedLanguageChange(e){if("showing"===this.track.mode){let e=this.player_.cache_.selectedLanguage;e&&e.enabled&&e.language===this.track.language&&e.kind!==this.track.kind||(this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind})}}dispose(){this.track=null,super.dispose()}}i7.registerComponent("TextTrackMenuItem",nO);class nL extends nO{constructor(e,t){t.track={player:e,kind:t.kind,kinds:t.kinds,default:!1,mode:"disabled"},t.kinds||(t.kinds=[t.kind]),t.label?t.track.label=t.label:t.track.label=t.kinds.join(" and ")+" off",t.selectable=!0,t.multiSelectable=!1,super(e,t)}handleTracksChange(e){let t=this.player().textTracks(),i=!0;for(let e=0,r=t.length;e<r;e++){let r=t[e];if(this.options_.kinds.indexOf(r.kind)>-1&&"showing"===r.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i)}handleSelectedLanguageChange(e){let t=this.player().textTracks(),i=!0;for(let e=0,r=t.length;e<r;e++){let r=t[e];if(["captions","descriptions","subtitles"].indexOf(r.kind)>-1&&"showing"===r.mode){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}i7.registerComponent("OffTextTrackMenuItem",nL);
41class nP extends nI{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=nO){let i;this.label_&&(i=`${this.label_} off`),e.push(new nL(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;let r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let i=0;i<r.length;i++){let n=r[i];if(this.kinds_.indexOf(n.kind)>-1){let i=new t(this.player_,{track:n,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});i.addClass(`vjs-${n.kind}-menu-item`),e.push(i)}}return e}}i7.registerComponent("TextTrackButton",nP);class nN extends nA{constructor(e,t){let i=t.track,r=t.cue,n=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=r.text,t.selected=r.startTime<=n&&n<r.endTime,super(e,t),this.track=i,this.cue=r}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}}i7.registerComponent("ChaptersTrackMenuItem",nN);class nM extends nP{constructor(e,t,i){super(e,t,i),this.setIcon("chapters"),this.selectCurrentItem_=()=>{this.items.forEach(e=>{e.selected(this.track_.activeCues[0]===e.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&"chapters"!==e.track.kind)return;let t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){let e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";let e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){let e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){let i=e[t];if(i.kind===this.kind_)return i}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(i3(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){let e=[];
41if(!this.track_)return e;let t=this.track_.cues;if(!t)return e;for(let i=0,r=t.length;i<r;i++){let r=t[i],n=new nN(this.player_,{track:this.track_,cue:r});e.push(n)}return e}}nM.prototype.kind_="chapters",nM.prototype.controlText_="Chapters",i7.registerComponent("ChaptersButton",nM);class nR extends nP{constructor(e,t,i){super(e,t,i),this.setIcon("audio-description");let r=e.textTracks(),n=iq(this,this.handleTracksChange);r.addEventListener("change",n),this.on("dispose",function(){r.removeEventListener("change",n)})}handleTracksChange(e){let t=this.player().textTracks(),i=!1;for(let e=0,r=t.length;e<r;e++){let r=t[e];if(r.kind!==this.kind_&&"showing"===r.mode){i=!0;break}}i?this.disable():this.enable()}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}}nR.prototype.kind_="descriptions",nR.prototype.controlText_="Descriptions",i7.registerComponent("DescriptionsButton",nR);class n$ extends nP{constructor(e,t,i){super(e,t,i),this.setIcon("subtitles")}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}}n$.prototype.kind_="subtitles",n$.prototype.controlText_="Subtitles",i7.registerComponent("SubtitlesButton",n$);class nU extends nO{constructor(e,t){t.track={player:e,kind:t.kind,label:t.kind+" settings",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="CaptionSettingsMenuItem",super(e,t),this.addClass("vjs-texttrack-settings"),this.controlText(", opens "+t.kind+" settings dialog")}handleClick(e){this.player().getChild("textTrackSettings").open()}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.kind+" settings"),super.handleLanguagechange()}}i7.registerComponent("CaptionSettingsMenuItem",nU);class nB extends nP{constructor(e,t,i){super(e,t,i),this.setIcon("captions")}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new nU(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}}nB.prototype.kind_="captions",nB.prototype.controlText_="Captions",i7.registerComponent("CaptionsButton",nB);class nj extends nO{createEl(e,t,i){let r=super.createEl(e,t,i),n=r.querySelector(".vjs-menu-item-text");return"captions"===this.options_.track.kind&&(this.player_.options_.experimentalSvgIcons?this.setIcon("captions",r):n.appendChild(t2("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(t2("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))),r}}i7.registerComponent("SubsCapsMenuItem",nj);class nq extends nP{constructor(e,t={}){super(e,t),this.label_="subtitles",this.setIcon("subtitles"),["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)>-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(i3(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new nU(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,nj)}}nq.prototype.kinds_=["captions","subtitles"],nq.prototype.controlText_="Subtitles",i7.registerComponent("SubsCapsButton",nq);class nF extends nA{constructor(e,t){let i=t.track,r=e.audioTracks();t.label=i.label||i.language||"Unknown",t.selected=i.enabled,super(e,t),this.track=i,this.addClass(`vjs-${i.kind}-menu-item`);let n=(...e)=>{this.handleTracksChange.apply(this,e)};r.addEventListener("change",n),this.on("dispose",()=>{r.removeEventListener("change",n)})}createEl(e,t,i){let r=super.createEl(e,t,i),n=r.querySelector(".vjs-menu-item-text");return["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0&&(n.appendChild(t2("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(t2("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),r}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){let e=this.player_.audioTracks();for(let t=0;t<e.length;t++){let i=e[t];i!==this.track&&(i.enabled=i===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}}i7.registerComponent("AudioTrackMenuItem",nF);
41class nH extends nI{constructor(e,t={}){t.tracks=e.audioTracks(),super(e,t),this.setIcon("audio")}buildCSSClass(){return`vjs-audio-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-audio-button ${super.buildWrapperCSSClass()}`}createItems(e=[]){this.hideThreshold_=1;let t=this.player_.audioTracks();for(let i=0;i<t.length;i++){let r=t[i];e.push(new nF(this.player_,{track:r,selectable:!0,multiSelectable:!1}))}return e}}nH.prototype.controlText_="Audio Track",i7.registerComponent("AudioTrackButton",nH);class nz extends nA{constructor(e,t){let i=t.rate,r=parseFloat(i,10);t.label=i,t.selected=r===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=i,this.rate=r,this.on(e,"ratechange",e=>this.update(e))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}nz.prototype.contentElType="button",i7.registerComponent("PlaybackRateMenuItem",nz);class nV extends nD{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",e=>this.updateVisibility(e)),this.on(e,"ratechange",e=>this.updateLabel(e)),this.on(e,"playbackrateschange",e=>this.handlePlaybackRateschange(e))}createEl(){let e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=t2("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){let e=this.playbackRates(),t=[];for(let i=e.length-1;i>=0;i--)t.push(new nz(this.player(),{rate:e[i]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){let e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}nV.prototype.controlText_="Playback Rate",i7.registerComponent("PlaybackRateMenuButton",nV);class nW extends i7{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},i={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,i)}}i7.registerComponent("Spacer",nW),i7.registerComponent("CustomControlSpacer",class extends nW{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:"\xa0"})}});class nG extends i7{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}nG.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]},i7.registerComponent("ControlBar",nG);class nX extends rm{constructor(e,t){super(e,t),this.on(e,"error",e=>{this.open(e)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){let e=this.player().error();return e?this.localize(e.message):""}}nX.prototype.options_=Object.assign({},rm.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),i7.registerComponent("ErrorDisplay",nX);class nY extends i7{constructor(e,t={}){super(e,t),this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){return this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim(),t2("select",{id:this.options_.id},{},this.options_.SelectOptions.map(e=>{let t=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${iI++}`)+"-"+e[1].replace(/\W+/g,""),i=t2("option",{id:t,value:this.localize(e[0]),textContent:this.localize(e[1])});return i.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${t}`),i}))}}i7.registerComponent("TextTrackSelect",nY);class nK extends i7{constructor(e,t={}){super(e,t);let i=t2("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});for(let t of(this.el().appendChild(i),this.options_.selects)){let i=this.options_.selectConfigs[t],r=i.className,n=i.id.replace("%s",this.options_.id_),s=null,a=`vjs_select_${iI++}`;if("colors"===this.options_.type){s=t2("span",{className:r});let e=t2("label",{id:n,className:"vjs-label",textContent:this.localize(i.label)});e.setAttribute("for",a),s.appendChild(e)}let o=new nY(e,{SelectOptions:i.options,legendId:this.options_.legendId,id:a,labelId:n});this.addChild(o),"colors"===this.options_.type&&(s.appendChild(o.el()),this.el().appendChild(s))}}createEl(){return t2("fieldset",{className:this.options_.className})}}i7.registerComponent("TextTrackFieldset",nK);
vendor: 12,836 bytes, line 41
41class nQ extends i7{constructor(e,t={}){super(e,t);let i=this.options_.textTrackComponentid,r=new nK(e,{id_:i,legendId:`captions-text-legend-${i}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(r);let n=new nK(e,{id_:i,legendId:`captions-background-${i}`,legendText:this.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(n);let s=new nK(e,{id_:i,legendId:`captions-window-${i}`,legendText:this.localize("Caption Area Background"),className:"vjs-window vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(s)}createEl(){return t2("div",{className:"vjs-track-settings-colors"})}}i7.registerComponent("TextTrackSettingsColors",nQ);class nJ extends i7{constructor(e,t={}){super(e,t);let i=this.options_.textTrackComponentid,r=new nK(e,{id_:i,legendId:`captions-font-size-${i}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(r);let n=new nK(e,{id_:i,legendId:`captions-edge-style-${i}`,legendText:this.localize("Text Edge Style"),className:"vjs-edge-style vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(n);let s=new nK(e,{id_:i,legendId:`captions-font-family-${i}`,legendText:this.localize("Font Family"),className:"vjs-font-family vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(s)}createEl(){return t2("div",{className:"vjs-track-settings-font"})}}i7.registerComponent("TextTrackSettingsFont",nJ);class nZ extends i7{constructor(e,t={}){super(e,t);let i=this.localize("restore all settings to the default values"),r=new ne(e,{controlText:i,className:"vjs-default-button"});r.el().classList.remove("vjs-control","vjs-button"),r.el().textContent=this.localize("Reset"),this.addChild(r);let n=new ne(e,{controlText:i,className:"vjs-done-button"});n.el().classList.remove("vjs-control","vjs-button"),n.el().textContent=this.localize("Done"),this.addChild(n)}createEl(){return t2("div",{className:"vjs-track-settings-controls"})}}i7.registerComponent("TrackSettingsControls",nZ);let n0="vjs-text-track-settings",n1=["#000","Black"],n2=["#00F","Blue"],n4=["#0FF","Cyan"],n8=["#0F0","Green"],n3=["#F0F","Magenta"],n5=["#F00","Red"],n6=["#FFF","White"],n7=["#FF0","Yellow"],n9=["1","Opaque"],se=["0.5","Semi-Transparent"],st=["0","Transparent"],si={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[n1,n6,n5,n8,n2,n7,n3,n4],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[n9,se,st],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[n6,n1,n5,n8,n2,n7,n3,n4],className:"vjs-text-color"},edgeStyle:{selector:".vjs-edge-style > select",id:"",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:e=>"1.00"===e?null:Number(e)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[n9,se],className:"vjs-text-opacity vjs-opacity"},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color",className:"vjs-window-color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[st,se,n9],className:"vjs-window-opacity vjs-opacity"}};function sr(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}si.windowColor.options=si.backgroundColor.options,i7.registerComponent("TextTrackSettings",class extends rm{constructor(e,t){t.temporary=!1,super(e,t),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.renderModalComponents(e),this.endDialog=t2("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")}),this.el().appendChild(this.endDialog),this.setDefaults(),void 0===t.persistTextTrackSettings&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings),this.bindFunctionsToSelectsAndButtons(),this.options_.persistTextTrackSettings&&this.restoreSettings()}renderModalComponents(e){let t=new nQ(e,{textTrackComponentid:this.id_,selectConfigs:si,fieldSets:[["color","textOpacity"],["backgroundColor","backgroundOpacity"],["windowColor","windowOpacity"]]});this.addChild(t);let i=new nJ(e,{textTrackComponentid:this.id_,selectConfigs:si,fieldSets:[["fontPercent"],["edgeStyle"],["fontFamily"]]});this.addChild(i);let r=new nZ(e);this.addChild(r)}bindFunctionsToSelectsAndButtons(){this.on(this.$(".vjs-done-button"),["click","tap"],()=>{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),["click","tap"],()=>{this.setDefaults(),this.updateDisplay()}),tb(si,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})}dispose(){this.endDialog=null,super.dispose()}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return tT(si,(e,t,i)=>{var r,n;let s=(r=this.$(t.selector),n=t.parser,sr(r.options[r.options.selectedIndex].value,n));return void 0!==s&&(e[i]=s),e},{})}setValues(e){tb(si,(t,i)=>{!function(e,t,i){if(t){for(let r=0;r<e.options.length;r++)if(sr(e.options[r].value,i)===t){e.selectedIndex=r;break}}}(this.$(t.selector),e[i],t.parser)})}setDefaults(){tb(si,e=>{let t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(p().localStorage.getItem(n0))}catch(e){tg.warn(e)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;let e=this.getValues();try{Object.keys(e).length?p().localStorage.setItem(n0,JSON.stringify(e)):p().localStorage.removeItem(n0)}catch(e){tg.warn(e)}}updateDisplay(){let e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}}),i7.registerComponent("ResizeManager",class extends i7{constructor(e,t){let i=t.ResizeObserver||p().ResizeObserver;null===t.ResizeObserver&&(i=!1),super(e,tE({createEl:!i,reportTouchActivity:!1},t)),this.ResizeObserver=t.ResizeObserver||p().ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=iH(()=>{this.resizeHandler()},100,!1,this),i?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;let e=this.debouncedHandler_,t=this.unloadListener_=function(){iR(this,"resize",e),iR(this,"unload",t),t=null};iM(this.el_.contentWindow,"unload",t),iM(this.el_.contentWindow,"resize",e)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}});let sn={trackingThreshold:20,liveTolerance:15};i7.registerComponent("LiveTracker",class extends i7{constructor(e,t){super(e,tE(sn,t,{createEl:!1})),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=e=>this.handlePlay(e),this.handleFirstTimeupdate_=e=>this.handleFirstTimeupdate(e),this.handleSeeked_=e=>this.handleSeeked(e),this.seekToLiveEdge_=e=>this.seekToLiveEdge(e),this.reset_(),this.on(this.player_,"durationchange",e=>this.handleDurationchange(e)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){let e=this.player_.seekable();if(!e||!e.length)return;let t=Number(p().performance.now().toFixed(4)),i=-1===this.lastTime_?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+i;let r=this.liveCurrentTime(),n=this.player_.currentTime(),s=this.player_.paused()||this.seekedBehindLive_||Math.abs(r-n)>this.options_.liveTolerance;this.timeupdateSeen_&&r!==1/0||(s=!1),s!==this.behindLiveEdge_&&(this.behindLiveEdge_=s,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,30),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){let e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){let e=this.player_.seekable(),t=[],i=e?e.length:0;for(;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){let e=this.player_.seekable(),t=[],i=e?e.length:0;for(;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0}liveWindow(){let e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){let e=this.seekableEnd();return -1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return"number"==typeof this.trackingInterval_}seekToLiveEdge(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}),i7.registerComponent("TitleBar",class extends i7{constructor(e,t){super(e,t),this.on("statechanged",e=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:t2("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${iI++}`}),description:t2("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${iI++}`})},t2("div",{className:"vjs-title-bar"},{},tC(this.els))}updateDom_(){let e=this.player_.tech_,t=e&&e.el_,i={title:"aria-labelledby",description:"aria-describedby"};
41["title","description"].forEach(e=>{let r=this.state[e],n=this.els[e],s=i[e];ic(n),r&&t4(n,r),t&&(t.removeAttribute(s),r&&t.setAttribute(s,n.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){let e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}});let ss={initialDisplay:4e3,position:[],takeFocus:!1};i7.registerComponent("TransientButton",class extends ne{constructor(e,t){super(e,t=tE(ss,t)),this.controlText(t.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],e=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(" ")}`}createEl(){let e=t2("button",{},{type:"button",class:this.buildCSSClass()},t2("span"));return this.controlTextEl_=e.querySelector("span"),e}show(){super.show(),this.addClass("force-display"),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout(()=>{this.removeClass("force-display")},this.options_.initialDisplay)}hide(){this.removeClass("force-display"),super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout),super.dispose()}});let sa=e=>{let t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;let i=e.$$("source"),r=[],n="";if(!i.length)return!1;for(let e=0;e<i.length;e++){let t=i[e].src;t&&-1===r.indexOf(t)&&r.push(t)}return!!r.length&&(1===r.length&&(n=r[0]),e.triggerSourceset(n),!0)},so=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(e){let t=m().createElement(this.nodeName.toLowerCase());t.innerHTML=e;let i=m().createDocumentFragment();for(;t.childNodes.length;)i.appendChild(t.childNodes[0]);return this.innerText="",p().Element.prototype.appendChild.call(this,i),this.innerHTML}}),sl=(e,t)=>{let i={};for(let r=0;r<e.length&&(!(i=Object.getOwnPropertyDescriptor(e[r],t))||!i.set||!i.get);r++);return i.enumerable=!0,i.configurable=!0,i},su=function(e){let t=e.el();if(t.resetSourceWatch_)return;let i={},r=sl([e.el(),p().HTMLMediaElement.prototype,p().Element.prototype,so],"innerHTML"),n=i=>(...r)=>{let n=i.apply(t,r);return sa(e),n};["append","appendChild","insertAdjacentHTML"].forEach(e=>{t[e]&&(i[e]=t[e],t[e]=n(i[e]))}),Object.defineProperty(t,"innerHTML",tE(r,{set:n(r.set)})),t.resetSourceWatch_=()=>
41{t.resetSourceWatch_=null,Object.keys(i).forEach(e=>{t[e]=i[e]}),Object.defineProperty(t,"innerHTML",r)},e.one("sourceset",t.resetSourceWatch_)},sd=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?rx(p().Element.prototype.getAttribute.call(this,"src")):""},set(e){return p().Element.prototype.setAttribute.call(this,"src",e),e}}),sc=function(e){if(!e.featuresSourceset)return;let t=e.el();if(t.resetSourceset_)return;let i=sl([e.el(),p().HTMLMediaElement.prototype,sd],"src"),r=t.setAttribute,n=t.load;Object.defineProperty(t,"src",tE(i,{set:r=>{let n=i.set.call(t,r);return e.triggerSourceset(t.src),n}})),t.setAttribute=(i,n)=>{let s=r.call(t,i,n);return/src/i.test(i)&&e.triggerSourceset(t.src),s},t.load=()=>{let i=n.call(t);return sa(e)||(e.triggerSourceset(""),su(e)),i},t.currentSrc?e.triggerSourceset(t.currentSrc):sa(e)||su(e),t.resetSourceset_=()=>{t.resetSourceset_=null,t.load=n,t.setAttribute=r,Object.defineProperty(t,"src",i),t.resetSourceWatch_&&t.resetSourceWatch_()}};class sh extends rj{constructor(e,t){super(e,t);let i=e.source,r=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&"VIDEO"===this.el_.tagName,i&&(this.el_.currentSrc!==i.src||e.tag&&3===e.tag.initNetworkState_)?this.setSource(i):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){let e=this.el_.childNodes,t=e.length,i=[];for(;t--;){let n=e[t];"track"===n.nodeName.toLowerCase()&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(n),this.remoteTextTracks().addTrack(n.track),this.textTracks().addTrack(n.track),!r&&!this.el_.hasAttribute("crossorigin")&&rI(n.src)&&(r=!0)):i.push(n))}for(let e=0;e<i.length;e++)this.el_.removeChild(i[e])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&r&&tg.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading."),this.restoreMetadataTracksInIOSNativePlayer_(),(tW||tF)&&!0===e.nativeControlsForTouch&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),sh.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){sc(this)}restoreMetadataTracksInIOSNativePlayer_(){let e,t=this.textTracks(),i=()=>{e=[];for(let i=0;i<t.length;i++){let r=t[i];"metadata"===r.kind&&e.push({track:r,storedMode:r.mode})}};i(),t.addEventListener("change",i),this.on("dispose",()=>t.removeEventListener("change",i));let r=()=>{for(let t=0;t<e.length;t++){let i=e[t];"disabled"===i.track.mode&&i.track.mode!==i.storedMode&&(i.track.mode=i.storedMode)}t.removeEventListener("change",r)};this.on("webkitbeginfullscreen",()=>{t.removeEventListener("change",i),t.removeEventListener("change",r),t.addEventListener("change",r)}),this.on("webkitendfullscreen",()=>{t.removeEventListener("change",i),t.addEventListener("change",i),t.removeEventListener("change",r)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;let i=e.toLowerCase();this[`${i}TracksListeners_`]&&Object.keys(this[`${i}TracksListeners_`]).forEach(e=>{this.el()[`${i}Tracks`].removeEventListener(e,this[`${i}TracksListeners_`][e])}),this[`featuresNative${e}Tracks`]=!t,this[`${i}TracksListeners_`]=null,this.proxyNativeTracksForType_(i)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){let t=r$[e],i=this.el()[t.getterName],r=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!i||!i.addEventListener)return;let n={change:t=>{let i={type:"change",target:r,currentTarget:r,srcElement:r};r.trigger(i),"text"===e&&this[rU.remoteText.getterName]().trigger(i)},addtrack(e){r.addTrack(e.track)},removetrack(e){r.removeTrack(e.track)}},s=function(){let e=[];for(let t=0;t<r.length;t++){let n=!1;for(let e=0;e<i.length;e++)if(i[e]===r[t]){n=!0;break}n||e.push(r[t])}for(;e.length;)r.removeTrack(e.shift())};
41this[t.getterName+"Listeners_"]=n,Object.keys(n).forEach(e=>{let t=n[e];i.addEventListener(e,t),this.on("dispose",r=>i.removeEventListener(e,t))}),this.on("loadstart",s),this.on("dispose",e=>this.off("loadstart",s))}proxyNativeTracks_(){r$.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){let t=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(t,e),sh.disposeMediaElement(e),e=t}else{e=m().createElement("video");let t=tE({},this.options_.tag&&ie(this.options_.tag));tW&&!0===this.options_.nativeControlsForTouch||delete t.controls,t9(e,Object.assign(t,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}void 0!==this.options_.preload&&ii(e,"preload",this.options_.preload),void 0!==this.options_.disablePictureInPicture&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);let t=["loop","muted","playsinline","autoplay"];for(let i=0;i<t.length;i++){let r=t[i],n=this.options_[r];void 0!==n&&(n?ii(e,r,r):ir(e,r),e[r]=n)}return e}handleLateInit_(e){if(0===e.networkState||3===e.networkState)return;if(0===e.readyState){let e=!1,t=function(){e=!0};this.on("loadstart",t);let i=function(){e||this.trigger("loadstart")};this.on("loadedmetadata",i),this.ready(function(){this.off("loadstart",t),this.off("loadedmetadata",i),e||this.trigger("loadstart")});return}let t=["loadstart"];t.push("loadedmetadata"),e.readyState>=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready(function(){t.forEach(function(e){this.trigger(e)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&tY?this.el_.fastSeek(e):this.el_.currentTime=e}catch(e){tg(e,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&tA&&tN&&0===this.el_.currentTime){let e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;let e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)})}supportsFullScreen(){return"function"==typeof this.el_.webkitEnterFullScreen}enterFullScreen(){let e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)rc(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}},0);else try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}}exitFullScreen(){if(!this.el_.webkitDisplayingFullscreen)return void this.trigger("fullscreenerror",Error("The video is not fullscreen"));this.el_.webkitExitFullScreen()}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(void 0===e)return this.el_.src;this.setSrc(e)}addSourceElement(e,t){if(!e)return tg.error("Invalid source URL."),!1;let i={src:e};t&&(i.type=t);let r=t2("source",{},i);return this.el_.appendChild(r),!0}removeSourceElement(e){if(!e)return tg.error("Source URL is required to remove the source element."),!1;for(let t of this.el_.querySelectorAll("source"))if(t.src===e)return this.el_.removeChild(t),!0;return tg.warn(`No matching source element found with src: ${e}`),!1}reset(){sh.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,i):super.addTextTrack(e,t,i)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);let t=m().createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){let i=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(i),i}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){let t=this.$$("track"),i=t.length;for(;i--;)(e===t[i]||e===t[i].track)&&this.el().removeChild(t[i])}}getVideoPlaybackQuality(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();let e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),p().performance&&(e.creationTime=p().performance.now()),e}}tk(sh,"TEST_VID",function(){if(!tJ())return;let e=m().createElement("video"),t=m().createElement("track");return t.kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e}
41),sh.isSupported=function(){try{sh.TEST_VID.volume=.5}catch(e){return!1}return!!(sh.TEST_VID&&sh.TEST_VID.canPlayType)},sh.canPlayType=function(e){return sh.TEST_VID.canPlayType(e)},sh.canPlaySource=function(e,t){return sh.canPlayType(e.type)},sh.canControlVolume=function(){try{let e=sh.TEST_VID.volume;sh.TEST_VID.volume=e/2+.1;let t=e!==sh.TEST_VID.volume;if(t&&tX)return p().setTimeout(()=>{sh&&sh.prototype&&(sh.prototype.featuresVolumeControl=e!==sh.TEST_VID.volume)}),!1;return t}catch(e){return!1}},sh.canMuteVolume=function(){try{let e=sh.TEST_VID.muted;return sh.TEST_VID.muted=!e,sh.TEST_VID.muted?ii(sh.TEST_VID,"muted","muted"):ir(sh.TEST_VID,"muted","muted"),e!==sh.TEST_VID.muted}catch(e){return!1}},sh.canControlPlaybackRate=function(){if(tA&&tN&&tR<58)return!1;try{let e=sh.TEST_VID.playbackRate;return sh.TEST_VID.playbackRate=e/2+.1,e!==sh.TEST_VID.playbackRate}catch(e){return!1}},sh.canOverrideAttributes=function(){try{let e=()=>{};Object.defineProperty(m().createElement("video"),"src",{get:e,set:e}),Object.defineProperty(m().createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(m().createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(m().createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return!1}return!0},sh.supportsNativeTextTracks=function(){return tY||tX&&tN},sh.supportsNativeVideoTracks=function(){return!!(sh.TEST_VID&&sh.TEST_VID.videoTracks)},sh.supportsNativeAudioTracks=function(){return!!(sh.TEST_VID&&sh.TEST_VID.audioTracks)},sh.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function([e,t]){tk(sh.prototype,e,()=>sh[t](),!0)}),sh.prototype.featuresVolumeControl=sh.canControlVolume(),sh.prototype.movingMediaElementInDOM=!tX,sh.prototype.featuresFullscreenResize=!0,sh.prototype.featuresProgressEvents=!0,sh.prototype.featuresTimeupdateEvents=!0,sh.prototype.featuresVideoFrameCallback=!!(sh.TEST_VID&&sh.TEST_VID.requestVideoFrameCallback),sh.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},sh.resetMediaElement=function(e){if(!e)return;let t=e.querySelectorAll("source"),i=t.length;for(;i--;)e.removeChild(t[i]);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(e){sh.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(e){sh.prototype["set"+i3(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(e){sh.prototype[e]=function(){return this.el_[e]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(e){sh.prototype["set"+i3(e)]=function(t){this.el_[e]=t}}),["pause","load","play"].forEach(function(e){sh.prototype[e]=function(){return this.el_[e]()}}),rj.withSourceHandlers(sh),sh.nativeSourceHandler={},sh.nativeSourceHandler.canPlayType=function(e){try{return sh.TEST_VID.canPlayType(e)}catch(e){return""}},sh.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return sh.nativeSourceHandler.canPlayType(e.type);if(e.src){let t=rD(e.src);return sh.nativeSourceHandler.canPlayType(`video/${t}`)}return""},sh.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)},sh.nativeSourceHandler.dispose=function(){},sh.registerSourceHandler(sh.nativeSourceHandler),rj.registerTech("Html5",sh);let sp=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],sf={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},sm=["tiny","xsmall","small","medium","large","xlarge","huge"],sg={};
41sm.forEach(e=>{let t="x"===e.charAt(0)?`x-${e.substring(1)}`:e;sg[e]=`vjs-layout-${t}`});let sy={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class sv extends i7{constructor(e,t,i){if(e.id=e.id||t.id||`vjs_video_${iI++}`,(t=Object.assign(sv.getTagSettings(e),t)).initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){let i=e.closest("[lang]");i&&(t.language=i.getAttribute("lang"))}if(super(null,t,i),this.boundDocumentFullscreenChange_=e=>this.documentFullscreenChange_(e),this.boundFullWindowOnEscKey_=e=>this.fullWindowOnEscKey(e),this.boundUpdateStyleEl_=e=>this.updateStyleEl_(e),this.boundApplyInitTime_=e=>this.applyInitTime_(e),this.boundUpdateCurrentBreakpoint_=e=>this.updateCurrentBreakpoint_(e),this.boundHandleTechClick_=e=>this.handleTechClick_(e),this.boundHandleTechDoubleClick_=e=>this.handleTechDoubleClick_(e),this.boundHandleTechTouchStart_=e=>this.handleTechTouchStart_(e),this.boundHandleTechTouchMove_=e=>this.handleTechTouchMove_(e),this.boundHandleTechTouchEnd_=e=>this.handleTechTouchEnd_(e),this.boundHandleTechTap_=e=>this.handleTechTap_(e),this.boundUpdatePlayerHeightOnAudioOnlyMode_=e=>this.updatePlayerHeightOnAudioOnlyMode_(e),this.isFullscreen_=!1,this.log=ty(this.id_),this.fsApi_=th,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={controlBarHeight:null,playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&ie(e),this.language(this.options_.language),t.languages){let e={};Object.getOwnPropertyNames(t.languages).forEach(function(i){e[i.toLowerCase()]=t.languages[i]}),this.languages_=e}else this.languages_=sv.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach(e=>{if("function"!=typeof this[e])throw Error(`plugin "${e}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),i1(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(iM(m(),this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);let r=tE(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(e=>{this[e](t.plugins[e])}),t.debug&&this.debug(!0),this.options_.playerOptions=r,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){let e=new(p()).DOMParser(
vendor: 17,817 bytes, line 41
41).parseFromString('<svg xmlns="http://www.w3.org/2000/svg">\n  <defs>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-play">\n      <path d="M16 10v28l22-14z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-pause">\n      <path d="M12 38h8V10h-8v28zm16-28v28h8V10h-8z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-audio">\n      <path d="M24 2C14.06 2 6 10.06 6 20v14c0 3.31 2.69 6 6 6h6V24h-8v-4c0-7.73 6.27-14 14-14s14 6.27 14 14v4h-8v16h6c3.31 0 6-2.69 6-6V20c0-9.94-8.06-18-18-18z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-captions">\n      <path d="M38 8H10c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM22 22h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2zm14 0h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-subtitles">\n      <path d="M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-enter">\n      <path d="M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-exit">\n      <path d="M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-play-circle">\n      <path d="M20 33l12-9-12-9v18zm4-29C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-volume-mute">\n      <path d="M33 24c0-3.53-2.04-6.58-5-8.05v4.42l4.91 4.91c.06-.42.09-.85.09-1.28zm5 0c0 1.88-.41 3.65-1.08 5.28l3.03 3.03C41.25 29.82 42 27 42 24c0-8.56-5.99-15.72-14-17.54v4.13c5.78 1.72 10 7.07 10 13.41zM8.55 6L6 8.55 15.45 18H6v12h8l10 10V26.55l8.51 8.51c-1.34 1.03-2.85 1.86-4.51 2.36v4.13a17.94 17.94 0 0 0 7.37-3.62L39.45 42 42 39.45l-18-18L8.55 6zM24 8l-4.18 4.18L24 16.36V8z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-volume-low">\n      <path d="M14 18v12h8l10 10V8L22 18h-8z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-volume-medium">\n      <path d="M37 24c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zm-27-6v12h8l10 10V8L18 18h-8z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-volume-high">\n      <path d="M6 18v12h8l10 10V8L14 18H6zm27 6c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zM28 6.46v4.13c5.78 1.72 10 7.07 10 13.41s-4.22 11.69-10 13.41v4.13c8.01-1.82 14-8.97 14-17.54S36.01 8.28 28 6.46z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-spinner">\n      <path d="M18.8 21l9.53-16.51C26.94 4.18 25.49 4 24 4c-4.8 0-9.19 1.69-12.64 4.51l7.33 12.69.11-.2zm24.28-3c-1.84-5.85-6.3-10.52-11.99-12.68L23.77 18h19.31zm.52 2H28.62l.58 1 9.53 16.5C41.99 33.94 44 29.21 44 24c0-1.37-.14-2.71-.4-4zm-26.53 4l-7.8-13.5C6.01 14.06 4 18.79 4 24c0 1.37.14 2.71.4 4h14.98l-2.31-4zM4.92 30c1.84 5.85 6.3 10.52 11.99 12.68L24.23 30H4.92zm22.54 0l-7.8 13.51c1.4.31 2.85.49 4.34.49 4.8 0 9.19-1.69 12.64-4.51L29.31 26.8 27.46 30z"></path>\n    </symbol>\n    <symbol viewBox="0 0 24 24" id="vjs-icon-hd">\n      <path d="M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 12H9.5v-2h-2v2H6V9h1.5v2.5h2V9H11v6zm2-6h4c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1h-4V9zm1.5 4.5h2v-3h-2v3z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-chapters">\n      <path d="M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z"></path>\n    </symbol>\n    <symbol viewBox="0 0 40 40" id="vjs-icon-downloading">\n      <path d="M18.208 36.875q-3.208-.292-5.979-1.729-2.771-1.438-4.812-3.729-2.042-2.292-3.188-5.229-1.146-2.938-1.146-6.23 0-6.583 4.334-11.416 4.333-4.834 10.833-5.5v3.166q-5.167.75-8.583 4.646Q6.25 14.75 6.25 19.958q0 5.209 3.396 9.104 3.396 3.896 8.562 4.646zM20 28.417L11.542 20l2.083-2.083 4.917 4.916v-11.25h2.916v11.25l4.875-4.916L28.417 20zm1.792 8.458v-3.167q1.833-.25 3.541-.958 1.709-.708 3.167-1.875l2.333 2.292q-1.958 1.583-4.25 2.541-2.291.959-4.791 1.167zm6.791-27.792q-1.541-1.125-3.25-1.854-1.708-.729-3.541-1.021V3.042q2.5.25 4.77 1.208 2.271.958 4.271 2.5zm4.584 21.584l-2.25-2.25q1.166-1.5 1.854-3.209.687-1.708.937-3.541h3.209q-.292 2.5-1.229 4.791-.938 2.292-2.521 4.209zm.541-12.417q-.291-1.833-.958-3.562-.667-1.73-1.833-3.188l2.375-2.208q1.541 1.916 2.458 4.208.917 2.292 1.167 4.75z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-file-download">\n      <path d="M10.8 40.55q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h26.35v-7.7h3.4v7.7q0 1.4-1 2.4t-2.4 1zM24 32.1L13.9 22.05l2.45-2.45 5.95 5.95V7.15h3.4v18.4l5.95-5.95 2.45 2.45z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-done">\n      <path d="M9.8 40.5v-3.45h28.4v3.45zm9.2-9.05L7.4 19.85l2.45-2.35L19 26.65l19.2-19.2 2.4 2.4z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-off">\n      <path d="M4.9 4.75L43.25 43.1 41 45.3l-4.75-4.75q-.05.05-.075.025-.025-.025-.075-.025H10.8q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h22.05l-7-7-1.85 1.8L13.9 21.9l1.85-1.85L2.7 7zm26.75 14.7l2.45 2.45-3.75 3.8-2.45-2.5zM25.7 7.15V21.1l-3.4-3.45V7.15z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-share">\n      <path d="M36 32.17c-1.52 0-2.89.59-3.93 1.54L17.82 25.4c.11-.45.18-.92.18-1.4s-.07-.95-.18-1.4l14.1-8.23c1.07 1 2.5 1.62 4.08 1.62 3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6c0 .48.07.95.18 1.4l-14.1 8.23c-1.07-1-2.5-1.62-4.08-1.62-3.31 0-6 2.69-6 6s2.69 6 6 6c1.58 0 3.01-.62 4.08-1.62l14.25 8.31c-.1.42-.16.86-.16 1.31A5.83 5.83 0 1 0 36 32.17z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-cog">\n      <path d="M38.86 25.95c.08-.64.14-1.29.14-1.95s-.06-1.31-.14-1.95l4.23-3.31c.38-.3.49-.84.24-1.28l-4-6.93c-.25-.43-.77-.61-1.22-.43l-4.98 2.01c-1.03-.79-2.16-1.46-3.38-1.97L29 4.84c-.09-.47-.5-.84-1-.84h-8c-.5 0-.91.37-.99.84l-.75 5.3a14.8 14.8 0 0 0-3.38 1.97L9.9 10.1a1 1 0 0 0-1.22.43l-4 6.93c-.25.43-.14.97.24 1.28l4.22 3.31C9.06 22.69 9 23.34 9 24s.06 1.31.14 1.95l-4.22 3.31c-.38.3-.49.84-.24 1.28l4 6.93c.25.43.77.61 1.22.43l4.98-2.01c1.03.79 2.16 1.46 3.38 1.97l.75 5.3c.08.47.49.84.99.84h8c.5 0 .91-.37.99-.84l.75-5.3a14.8 14.8 0 0 0 3.38-1.97l4.98 2.01a1 1 0 0 0 1.22-.43l4-6.93c.25-.43.14-.97-.24-1.28l-4.22-3.31zM24 31c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-square">\n      <path d="M36 8H12c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h24c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zm0 28H12V12h24v24z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-circle">\n      <circle cx="24" cy="24" r="20"></circle>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-circle-outline">\n      <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-circle-inner-circle">\n      <path d="M24 4C12.97 4 4 12.97 4 24s8.97 20 20 20 20-8.97 20-20S35.03 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16zm6-16c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6 6 2.69 6 6z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-cancel">\n      <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm10 27.17L31.17 34 24 26.83 16.83 34 14 31.17 21.17 24 14 16.83 16.83 14 24 21.17 31.17 14 34 16.83 26.83 24 34 31.17z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-replay">\n      <path d="M24 10V2L14 12l10 10v-8c6.63 0 12 5.37 12 12s-5.37 12-12 12-12-5.37-12-12H8c0 8.84 7.16 16 16 16s16-7.16 16-16-7.16-16-16-16z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-repeat">\n      <path d="M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z"></path>\n    </symbol>\n    <symbol viewBox="0 96 48 48" id="vjs-icon-replay-5">\n      <path d="M17.689 98l-8.697 8.696 8.697 8.697 2.486-2.485-4.32-4.319h1.302c4.93 0 9.071 1.722 12.424 5.165 3.352 3.443 5.029 7.638 5.029 12.584h3.55c0-2.958-.553-5.73-1.658-8.313-1.104-2.583-2.622-4.841-4.555-6.774-1.932-1.932-4.19-3.45-6.773-4.555-2.584-1.104-5.355-1.657-8.313-1.657H15.5l4.615-4.615zm-8.08 21.659v13.861h11.357v5.008H9.609V143h12.7c.834 0 1.55-.298 2.146-.894.596-.597.895-1.31.895-2.145v-7.781c0-.835-.299-1.55-.895-2.147a2.929 2.929 0 0 0-2.147-.894h-8.227v-5.096H25.35v-4.384z"></path>\n    </symbol>\n    <symbol viewBox="0 96 48 48" id="vjs-icon-replay-10">\n      <path d="M42.315 125.63c0-4.997-1.694-9.235-5.08-12.713-3.388-3.479-7.571-5.218-12.552-5.218h-1.315l4.363 4.363-2.51 2.51-8.787-8.786L25.221 97l2.45 2.45-4.662 4.663h1.375c2.988 0 5.788.557 8.397 1.673 2.61 1.116 4.892 2.65 6.844 4.602 1.953 1.953 3.487 4.234 4.602 6.844 1.116 2.61 1.674 5.41 1.674 8.398zM8.183 142v-19.657H3.176V117.8h9.643V142zm13.63 0c-1.156 0-2.127-.393-2.912-1.178-.778-.778-1.168-1.746-1.168-2.902v-16.04c0-1.156.393-2.127 1.178-2.912.779-.779 1.746-1.168 2.902-1.168h7.696c1.156 0 2.126.392 2.911 1.177.779.78 1.168 1.747 1.168 2.903v16.04c0 1.156-.392 2.127-1.177 2.912-.779.779-1.746 1.168-2.902 1.168zm.556-4.636h6.583v-15.02H22.37z"></path>\n    </symbol>\n    <symbol viewBox="0 96 48 48" id="vjs-icon-replay-30">\n      <path d="M26.047 97l-8.733 8.732 8.733 8.733 2.496-2.494-4.336-4.338h1.307c4.95 0 9.108 1.73 12.474 5.187 3.367 3.458 5.051 7.668 5.051 12.635h3.565c0-2.97-.556-5.751-1.665-8.346-1.109-2.594-2.633-4.862-4.574-6.802-1.94-1.941-4.208-3.466-6.803-4.575-2.594-1.109-5.375-1.664-8.345-1.664H23.85l4.634-4.634zM2.555 117.531v4.688h10.297v5.25H5.873v4.687h6.979v5.156H2.555V142H13.36c1.061 0 1.95-.395 2.668-1.186.718-.79 1.076-1.772 1.076-2.94v-16.218c0-1.168-.358-2.149-1.076-2.94-.717-.79-1.607-1.185-2.668-1.185zm22.482.14c-1.149 0-2.11.39-2.885 1.165-.78.78-1.172 1.744-1.172 2.893v15.943c0 1.149.388 2.11 1.163 2.885.78.78 1.745 1.172 2.894 1.172h7.649c1.148 0 2.11-.388 2.884-1.163.78-.78 1.17-1.745 1.17-2.894v-15.943c0-1.15-.386-2.111-1.16-2.885-.78-.78-1.746-1.172-2.894-1.172zm.553 4.518h6.545v14.93H25.59z"></path>\n    </symbol>\n    <symbol viewBox="0 96 48 48" id="vjs-icon-forward-5">\n      <path d="M29.508 97l-2.431 2.43 4.625 4.625h-1.364c-2.965 0-5.742.554-8.332 1.66-2.589 1.107-4.851 2.629-6.788 4.566-1.937 1.937-3.458 4.2-4.565 6.788-1.107 2.59-1.66 5.367-1.66 8.331h3.557c0-4.957 1.68-9.16 5.04-12.611 3.36-3.45 7.51-5.177 12.451-5.177h1.304l-4.326 4.33 2.49 2.49 8.715-8.716zm-9.783 21.61v13.89h11.382v5.018H19.725V142h12.727a2.93 2.93 0 0 0 2.15-.896 2.93 2.93 0 0 0 .896-2.15v-7.798c0-.837-.299-1.554-.896-2.152a2.93 2.93 0 0 0-2.15-.896h-8.245V123h11.29v-4.392z"></path>\n    </symbol>\n    <symbol viewBox="0 96 48 48" id="vjs-icon-forward-10">\n      <path d="M23.119 97l-2.386 2.383 4.538 4.538h-1.339c-2.908 0-5.633.543-8.173 1.63-2.54 1.085-4.76 2.577-6.66 4.478-1.9 1.9-3.392 4.12-4.478 6.66-1.085 2.54-1.629 5.264-1.629 8.172h3.49c0-4.863 1.648-8.986 4.944-12.372 3.297-3.385 7.368-5.078 12.216-5.078h1.279l-4.245 4.247 2.443 2.442 8.55-8.55zm-9.52 21.45v4.42h4.871V142h4.513v-23.55zm18.136 0c-1.125 0-2.066.377-2.824 1.135-.764.764-1.148 1.709-1.148 2.834v15.612c0 1.124.38 2.066 1.139 2.824.764.764 1.708 1.145 2.833 1.145h7.489c1.125 0 2.066-.378 2.824-1.136.764-.764 1.145-1.709 1.145-2.833v-15.612c0-1.125-.378-2.067-1.136-2.825-.764-.764-1.708-1.145-2.833-1.145zm.54 4.42h6.408v14.617h-6.407z"></path>\n    </symbol>\n    <symbol viewBox="0 96 48 48" id="vjs-icon-forward-30">\n      <path d="M25.549 97l-2.437 2.434 4.634 4.635H26.38c-2.97 0-5.753.555-8.347 1.664-2.594 1.109-4.861 2.633-6.802 4.574-1.94 1.94-3.465 4.207-4.574 6.802-1.109 2.594-1.664 5.377-1.664 8.347h3.565c0-4.967 1.683-9.178 5.05-12.636 3.366-3.458 7.525-5.187 12.475-5.187h1.307l-4.335 4.338 2.495 2.494 8.732-8.732zm-11.553 20.53v4.689h10.297v5.249h-6.978v4.688h6.978v5.156H13.996V142h10.808c1.06 0 1.948-.395 2.666-1.186.718-.79 1.077-1.771 1.077-2.94v-16.217c0-1.169-.36-2.15-1.077-2.94-.718-.79-1.605-1.186-2.666-1.186zm21.174.168c-1.149 0-2.11.389-2.884 1.163-.78.78-1.172 1.745-1.172 2.894v15.942c0 1.15.388 2.11 1.162 2.885.78.78 1.745 1.17 2.894 1.17h7.649c1.149 0 2.11-.386 2.885-1.16.78-.78 1.17-1.746 1.17-2.895v-15.942c0-1.15-.387-2.11-1.161-2.885-.78-.78-1.745-1.172-2.894-1.172zm.552 4.516h6.542v14.931h-6.542z"></path>\n    </symbol>\n    <symbol viewBox="0 0 512 512" id="vjs-icon-audio-description">\n      <g fill-rule="evenodd"><path d="M227.29 381.351V162.993c50.38-1.017 89.108-3.028 117.631 17.126 27.374 19.342 48.734 56.965 44.89 105.325-4.067 51.155-41.335 94.139-89.776 98.475-24.085 2.155-71.972 0-71.972 0s-.84-1.352-.773-2.568m48.755-54.804c31.43 1.26 53.208-16.633 56.495-45.386 4.403-38.51-21.188-63.552-58.041-60.796v103.612c-.036 1.466.575 2.22 1.546 2.57"></path><path d="M383.78 381.328c13.336 3.71 17.387-11.06 23.215-21.408 12.722-22.571 22.294-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.226 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M425.154 381.328c13.336 3.71 17.384-11.061 23.215-21.408 12.721-22.571 22.291-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.511c-.586 3.874 2.226 7.315 3.866 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M466.26 381.328c13.337 3.71 17.385-11.061 23.216-21.408 12.722-22.571 22.292-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.225 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894M4.477 383.005H72.58l18.573-28.484 64.169-.135s.065 19.413.065 28.62h48.756V160.307h-58.816c-5.653 9.537-140.85 222.697-140.85 222.697zm152.667-145.282v71.158l-40.453-.27 40.453-70.888z"></path></g>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-next-item">\n      <path d="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-previous-item">\n      <path d="M12 12h4v24h-4zm7 12l17 12V12z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-shuffle">\n      <path d="M21.17 18.34L10.83 8 8 10.83l10.34 10.34 2.83-2.83zM29 8l4.09 4.09L8 37.17 10.83 40l25.09-25.09L40 19V8H29zm.66 18.83l-2.83 2.83 6.26 6.26L29 40h11V29l-4.09 4.09-6.25-6.26z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-cast">\n      <path d="M42 6H6c-2.21 0-4 1.79-4 4v6h4v-6h36v28H28v4h14c2.21 0 4-1.79 4-4V10c0-2.21-1.79-4-4-4zM2 36v6h6c0-3.31-2.69-6-6-6zm0-8v4c5.52 0 10 4.48 10 10h4c0-7.73-6.27-14-14-14zm0-8v4c9.94 0 18 8.06 18 18h4c0-12.15-9.85-22-22-22z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-picture-in-picture-enter">\n      <path d="M38 22H22v11.99h16V22zm8 16V9.96C46 7.76 44.2 6 42 6H6C3.8 6 2 7.76 2 9.96V38c0 2.2 1.8 4 4 4h36c2.2 0 4-1.8 4-4zm-4 .04H6V9.94h36v28.1z"></path>\n    </symbol>\n    <symbol viewBox="0 0 22 18" id="vjs-icon-picture-in-picture-exit">\n      <path d="M18 4H4v10h14V4zm4 12V1.98C22 .88 21.1 0 20 0H2C.9 0 0 .88 0 1.98V16c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H2V1.97h18v14.05z"></path>\n      <path fill="none" d="M-1-3h24v24H-1z"></path>\n    </symbol>\n    <symbol viewBox="0 0 1792 1792" id="vjs-icon-facebook">\n      <path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z"></path>\n    </symbol>\n    <symbol viewBox="0 0 1792 1792" id="vjs-icon-linkedin">\n      <path d="M477 625v991H147V625h330zm21-306q1 73-50.5 122T312 490h-2q-82 0-132-49t-50-122q0-74 51.5-122.5T314 148t133 48.5T498 319zm1166 729v568h-329v-530q0-105-40.5-164.5T1168 862q-63 0-105.5 34.5T999 982q-11 30-11 81v553H659q2-399 2-647t-1-296l-1-48h329v144h-2q20-32 41-56t56.5-52 87-43.5T1285 602q171 0 275 113.5t104 332.5z"></path>\n    </symbol>\n    <symbol viewBox="0 0 1200 1227" id="vjs-icon-twitter">\n      <path d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z"/>\n    </symbol>\n    <symbol viewBox="0 0 1792 1792" id="vjs-icon-tumblr">\n      <path d="M1328 1329l80 237q-23 35-111 66t-177 32q-104 2-190.5-26T787 1564t-95-106-55.5-120-16.5-118V676H452V461q72-26 129-69.5t91-90 58-102 34-99T779 12q1-5 4.5-8.5T791 0h244v424h333v252h-334v518q0 30 6.5 56t22.5 52.5 49.5 41.5 81.5 14q78-2 134-29z"></path>\n    </symbol>\n    <symbol viewBox="0 0 1792 1792" id="vjs-icon-pinterest">\n      <path d="M1664 896q0 209-103 385.5T1281.5 1561 896 1664q-111 0-218-32 59-93 78-164 9-34 54-211 20 39 73 67.5t114 28.5q121 0 216-68.5t147-188.5 52-270q0-114-59.5-214T1180 449t-255-63q-105 0-196 29t-154.5 77-109 110.5-67 129.5T377 866q0 104 40 183t117 111q30 12 38-20 2-7 8-31t8-30q6-23-11-43-51-61-51-151 0-151 104.5-259.5T904 517q151 0 235.5 82t84.5 213q0 170-68.5 289T980 1220q-61 0-98-43.5T859 1072q8-35 26.5-93.5t30-103T927 800q0-50-27-83t-77-33q-62 0-105 57t-43 142q0 73 25 122l-99 418q-17 70-13 177-206-91-333-281T128 896q0-209 103-385.5T510.5 231 896 128t385.5 103T1561 510.5 1664 896z"></path>\n    </symbol>\n  </defs>\n</svg>',"image/svg+xml");if(e.querySelector("parsererror"))
vendor: 1,943 bytes, line 41
41tg.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{let t=e.documentElement;t.style.display="none",this.el_.appendChild(t),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio("audio"===e.nodeName.toLowerCase()),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),t.spatialNavigation&&t.spatialNavigation.enabled&&(this.spatialNavigation=new r1(this),this.addClass("vjs-spatial-navigation-enabled")),tW&&this.addClass("vjs-touch-enabled"),tX||this.addClass("vjs-workinghover"),sv.players[this.id_]=this;let n=tl.split(".")[0];this.addClass(`vjs-v${n}`),this.userActive(!0),this.reportUserActivity(),this.one("play",e=>this.listenForUserActivity_(e)),this.on("keydown",e=>this.handleKeyDown(e)),this.on("languagechange",e=>this.handleLanguagechange(e)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose"),this.off("dispose"),iR(m(),this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),iR(m(),"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),sv.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),rF.hasOwnProperty(this.id())&&delete rF[this.id()],rB.names.forEac
41h(e=>{let t=this[rB[e].getterName]();t&&t.off&&t.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e,t=this.tag,i=this.playerElIngest_=t.parentNode&&t.parentNode.hasAttribute&&t.parentNode.hasAttribute("data-vjs-player"),r="video-js"===this.tag.tagName.toLowerCase();i?e=this.el_=t.parentNode:r||(e=this.el_=super.createEl("div"));let n=ie(t);if(r){for(e=this.el_=t,t=this.tag=m().createElement("video");e.children.length;)t.appendChild(e.firstChild);t3(e,"video-js")||t5(e,"video-js"),e.appendChild(t),i=this.playerElIngest_=e,Object.keys(e).forEach(i=>{try{t[i]=e[i]}catch(e){}})}t.setAttribute("tabindex","-1"),n.tabindex="-1",tN&&tj&&(t.setAttribute("role","application"),n.role="application"),t.removeAttribute("width"),t.removeAttribute("height"),"width"in n&&delete n.width,"height"in n&&delete n.height,Object.getOwnPropertyNames(n).forEach(function(i){r&&"class"===i||e.setAttribute(i,n[i]),r&&t.setAttribute(i,n[i])}),t.playerId=t.id,t.id+="_html5_api",t.className="vjs-tech",t.player=e.player=this,this.addClass("vjs-paused");let s=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter(e=>tK[e]).map(e=>"vjs-device-"+e.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...s),!0!==p().VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=ik("vjs-styles-dimensions");let e=iy(".vjs-styles-defaults"),t=iy("head");t.insertBefore(this.styleEl_,e?e.nextSibling:t.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);let a=t.getElementsByTagName("a");for(let e=0;e<a.length;e++){let t=a.item(e);t5(t,"vjs-hidden"),t.setAttribute("hidden","hidden")}return t.initNetworkState_=t.networkState,t.parentNode&&!i&&t.parentNode.insertBefore(e,t),t8(t,e),this.children_.unshift(t),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=e,e}crossOrigin(e){return void 0===e?this.techGet_("crossOrigin"):null!==e&&"anonymous"!==e&&"use-credentials"!==e?void tg.warn(`crossOrigin must be null,  "anonymous" or "use-credentials", given "${e}"`):void(this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e))}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,t){let i=e+"_";if(void 0===t)return this[i]||0;if(""===t||"auto"===t){this[i]=void 0,this.updateStyleEl_();return}let r=parseFloat(t);if(isNaN(r))return void tg.error(`Improper value "${t}" supplied for for ${e}`);this[i]=r,this.updateStyleEl_()}fluid(e){if(void 0===e)return!!this.fluid_;if(this.fluid_=!!e,iG(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e){var t;this.addClass("vjs-fluid"),this.fill(!1),t=()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)},iG(this)?t():(this.eventedCallbacks||(this.eventedCallbacks=[]),this.eventedCallbacks.push(t))}else this.removeClass("vjs-fluid");this.updateStyleEl_()}fill(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(void 0===e)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){let e,t,i;if(!0===p().VIDEOJS_NO_DYNAMIC_STYLE){let e="number"==typeof this.width_?this.width_:this.options_.width,t="number"==typeof this.height_?this.height_:this.options_.height,i=this.tech_&&this.tech_.el();i&&(e>=0&&(i.width=e),t>=0&&(i.height=t));return}let r=(void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),n=r[1]/r[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/n:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*n,i=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(i),ix(this.styleEl_,`
42      .${i} {
43        width: ${e}px;
44        height: ${t}px;
45      }
46
47      .${i}.vjs-fluid:not(.vjs-audio-only-mode) {
48        padding-top: ${100*n}%;
49      }
50    `)}loadTech_(e,t){var i,r;this.tech_&&this.unloadTech_();let n=i3(e),s=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==n&&this.tag&&(rj.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=n,this.isReady_=!1;let a=this.autoplay();("string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(a=!1);let o={source:t,autoplay:a,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${s}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};
50rB.names.forEach(e=>{let t=rB[e];o[t.getterName]=this[t.privateName]}),Object.assign(o,this.options_[n]),Object.assign(o,this.options_[s]),Object.assign(o,this.options_[e.toLowerCase()]),this.tag&&(o.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(o.startTime=this.cache_.currentTime);let l=rj.getTech(e);if(!l)throw Error(`No Tech named '${n}' exists! '${n}' should be registered using videojs.registerTech()'`);this.tech_=new l(o),this.tech_.ready(iq(this,this.handleTechReady_),!0),i=this.textTracksJson_||[],r=this.tech_,i.forEach(function(e){let t=r.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach(e=>t.addCue(e))}),r.textTracks(),sp.forEach(e=>{this.on(this.tech_,e,t=>this[`handleTech${i3(e)}_`](t))}),Object.keys(sf).forEach(e=>{this.on(this.tech_,e,t=>{if(0===this.tech_.playbackRate()&&this.tech_.seeking())return void this.queuedCallbacks_.push({callback:this[`handleTech${sf[e]}_`].bind(this),event:t});this[`handleTech${sf[e]}_`](t)})}),this.on(this.tech_,"loadstart",e=>this.handleTechLoadStart_(e)),this.on(this.tech_,"sourceset",e=>this.handleTechSourceset_(e)),this.on(this.tech_,"waiting",e=>this.handleTechWaiting_(e)),this.on(this.tech_,"ended",e=>this.handleTechEnded_(e)),this.on(this.tech_,"seeking",e=>this.handleTechSeeking_(e)),this.on(this.tech_,"play",e=>this.handleTechPlay_(e)),this.on(this.tech_,"pause",e=>this.handleTechPause_(e)),this.on(this.tech_,"durationchange",e=>this.handleTechDurationChange_(e)),this.on(this.tech_,"fullscreenchange",(e,t)=>this.handleTechFullscreenChange_(e,t)),this.on(this.tech_,"fullscreenerror",(e,t)=>this.handleTechFullscreenError_(e,t)),this.on(this.tech_,"enterpictureinpicture",e=>this.handleTechEnterPictureInPicture_(e)),this.on(this.tech_,"leavepictureinpicture",e=>this.handleTechLeavePictureInPicture_(e)),this.on(this.tech_,"error",e=>this.handleTechError_(e)),this.on(this.tech_,"posterchange",e=>this.handleTechPosterChange_(e)),this.on(this.tech_,"textdata",e=>this.handleTechTextData_(e)),this.on(this.tech_,"ratechange",e=>this.handleTechRateChange_(e)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===n&&this.tag||t8(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){rB.names.forEach(e=>{let t=rB[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=rp(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return void 0===e&&tg.warn("Using the tech directly can be dangerous. I hope you know 
50what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_}version(){return{"video.js":tl}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()&&this.hasStarted(!1),this.trigger("loadstart"),this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){let t;if(!this.tech_||"string"!=typeof e)return;let i=()=>{let e=this.muted();this.muted(!0);let t=()=>{this.muted(e)};this.playTerminatedQueue_.push(t);let i=this.play();if(rd(i))return i.catch(e=>{throw t(),Error(`Rejection at manualAutoplay. Restoring muted value. ${e||""}`)})};if("any"!==e||this.muted()?t="muted"!==e||this.muted()?this.play():i():rd(t=this.play())&&(t=t.catch(i)),rd(t))return t.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})})}updateSourceCaches_(e=""){let t=e,i="";"string"!=typeof t&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=((e,t)=>{if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;let i=e.cache_.sources.filter(e=>e.src===t);if(i.length)return i[0].type;let r=e.$$("source");for(let e=0;e<r.length;e++){let i=r[e];if(i.type&&i.src&&i.src===t)return i.type}return rK(t)})(this,t)),this.cache_.source=tE({},e,{src:t,type:i});let r=this.cache_.sources.filter(e=>e.src&&e.src===t),n=[],s=this.$$("source"),a=[];for(let e=0;e<s.length;e++){let i=ie(s[e]);n.push(i),i.src&&i.src===t&&a.push(i.src)}a.length&&!r.length?this.cache_.sources=n:r.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let t=e=>this.updateSourceCaches_(e),i=this.currentSource().src,r=e.src;i&&!/^blob:/.test(i)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==i)&&(t=()=>{}),t(r),e.src||this.tech_.any(["sourceset","loadstart"],e=>{if("sourceset"===e.type)return;let t=this.techGet_("currentSrc");this.lastSource_.tech=t,this.updateSourceCaches_(t)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(void 0===e)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");let e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}
50handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(void 0===this.options_||void 0===this.options_.userActions||void 0===this.options_.userActions.click||!1!==this.options_.userActions.click)&&(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.click?this.options_.userActions.click.call(this,e):this.paused()?rc(this.play()):this.pause())}handleTechDoubleClick_(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),t=>t.contains(e.target))||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isInPictureInPicture()&&!m().pictureInPictureElement?this.exitPictureInPicture():this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){let t=e.target.player;if(t&&t!==this)return;let i=this.el(),r=m()[this.fsApi_.fullscreenElement]===i;!r&&i.matches&&(r=i.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(r)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){let e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in rW){var i,r;return i=this.middleware_,r=this.tech_,r[e](i.reduce(rX(e),t))}if(e in rG)return rz(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(e){throw tg(e),e}},!0)}techGet_(e){if(this.tech_&&this.tech_.isReady_){if(e in rV){var t,i;return t=this.middleware_,i=this.tech_,t.reduceRight(rX(e),i[e]())}if(e in rG)return rz(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw tg(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t;if("TypeError"===t.name)throw tg(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t;throw tg(t),t}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=rc){this.playCallbacks_.push(e);let t=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),i=!!(tY||tX);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t){this.waitToPlay_=e=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!t&&i&&this.load();return}let r=this.techGet_("play");
50i&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),null===r?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(r)}runPlayTerminatedQueue_(){let e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(e){e()})}runPlayCallbacks_(e){let t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(t){t(e)})}pause(){this.techCall_("pause")}paused(){return!1!==this.techGet_("paused")}played(){return this.techGet_("played")||rt(0,0)}scrubbing(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){if(void 0===e)return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime;if(e<0&&(e=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",e),this.cache_.initTime=0,isFinite(e)&&(this.cache_.currentTime=Number(e))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return e&&e.length||(e=rt(0,0)),e}seekable(){let e=this.techGet_("seekable");return e&&e.length||(e=rt(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return rl(this.buffered(),this.duration())}bufferedEnd(){let e=this.buffered(),t=this.duration(),i=e.end(e.length-1);return i>t&&(i=t),i}volume(e){let t;if(void 0!==e){t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),t>0&&this.lastVolume_(t);return}return isNaN(t=parseFloat(this.techGet_("volume")))?1:t}muted(e){return void 0!==e?void this.techCall_("setMuted",e):this.techGet_("muted")||!1}defaultMuted(e){return void 0!==e&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(void 0!==e&&0!==e){this.cache_.lastVolume=e;return}return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(void 0!==e){let t=this.isFullscreen_;this.isFullscreen_=!!e,this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();let t=this;return new Promise((i,r)=>{function n(){t.off("fullscreenerror",a),t.off("fullscreenchange",s)}function s(){n(),i()}function a(e,t){n(),r(t)}t.one("fullscreenchange",s),t.one("fullscreenerror",a);let o=t.requestFullscreenHelper_(e);o&&(o.then(n,n),o.then(i,r))})}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(t=e)),this.fsApi_.requestFullscreen){let e=this.el_[this.fsApi_.requestFullscreen](t);return e&&e.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),e}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){let e=this;return new Promise((t,i)=>{function r(){e.off("fullscreenerror",s),e.off("fullscreenchange",n)}function n(){r(),t()}function s(e,t){r(),i(t)}e.one("fullscreenchange",n),e.one("fullscreenerror",s);let a=e.exitFullscreenHelper_();a&&(a.then(r,r),a.then(t,i))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){let e=m()[this.fsApi_.exitFullscreen]();return e&&rc(e.then(()=>this.isFullscreen(!1))),e}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=m().documentElement.style.overflow,iM(m(),"keydown",this.boundFullWindowOnEscKey_),m().documentElement.style.overflow="hidden",t5(m().body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){"Escape"===e.key&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,iR(m(),"keydown",this.boundFullWindowOnEscKey_),m().documentElement.style.overflow=this.docOrigOverflow,t6(m().body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){if(void 0!==e){this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&p().documentPictureInPicture){let e=m().createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(t2("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),p().documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(ib(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:t}),t.addEventListener("pagehide",t=>{let i=t.target.querySelector(".video-js");e.parentNode.replaceChild(i,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in m()&&!1===this.disablePictureInPicture()?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){return p().documentPictureInPicture&&p().documentPictureInPicture.window?(p().documentPictureInPicture.window.close(),Promise.resolve()):"pictureInPictureEnabled"in m()?m().exitPictureInPicture():void 0}handleKeyDown(e){let{userActions:t}=this.options_;t&&t.hotkeys&&((e=>{let t=e.tagName.toLowerCase();return!!e.isContentEditable||("input"===t?-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(e.type):-1!==["textarea"].indexOf(t))})(this.el_.ownerDocument.activeElement)||("function"==typeof t.hotkeys?t.hotkeys.call(this,e):this.handleHotkeys(e)))}handleHotkeys(e){let{fullscreenKey:t=t=>"f"===e.key.toLowerCase(),muteKey:i=t=>"m"===e.key.toLowerCase(),playPauseKey:r=t=>"k"===e.key.toLowerCase()||" "===e.key.toLowerCase()}=this.options_.userActions?this.options_.userActions.hotkeys:{};if(t.call(this,e)){e.preventDefault(),e.stopPropagation();let t=i7.getComponent("FullscreenToggle");!1!==m()[this.fsApi_.fullscreenEnabled]&&t.prototype.handleClick.call(this,e)}else i.call(this,e)?(e.preventDefault(),e.stopPropagation(),i7.getComponent("MuteToggle").prototype.handleClick.call(this,e)):r.call(this,e)&&(e.preventDefault(),e.stopPropagation(),i7.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let i=0,r=this.options_.techOrder;i<r.length;i++){let n=r[i],s=rj.getTech(n);if(s||(s=i7.getComponent(n)),!s){tg.error(`The "${n}" tech is undefined. Skipped browser support check for that tech.`);continue}if(s.isSupported()&&(t=s.canPlayType(e)))return t}return""}selectSource(e){let t,i=this.options_.techOrder.map(e=>[e,rj.getTech(e)]).filter(([e,t])=>t?t.isSupported():(tg.error(`The "${e}" tech is undefined. Skipped browser support check for that tech.`),!1)),r=function(e,t,i){let r;return e.some(e=>
50t.some(t=>{if(r=i(e,t))return!0})),r},n=([e,t],i)=>{if(t.canPlaySource(i,this.options_[e.toLowerCase()]))return{source:i,tech:e}};if(this.options_.sourceOrder)t=r(e,i,(e,t)=>n(t,e));else t=r(i,e,n);return t||!1}handleSrc_(e,t){var i,r,n;if(void 0===e)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();let s=rQ(e);if(!s.length)return void this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);if(this.changingSrc_=!0,t||(this.cache_.sources=s),this.updateSourceCaches_(s[0]),i=this,r=s[0],n=(e,i)=>{var r;if(this.middleware_=i,t||(this.cache_.sources=s),this.updateSourceCaches_(e),this.src_(e))return s.length>1?this.handleSrc_(s.slice(1)):(this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),void this.triggerReady());r=this.tech_,i.forEach(e=>e.setTech&&e.setTech(r))},i.setTimeout(()=>(function e(t={},i=[],r,n,s=[],a=!1){let[o,...l]=i;if("string"==typeof o)e(t,rq[o],r,n,s,a);else if(o){let i=function(e,t){let i=rF[e.id()],r=null;if(null==i)return r=t(e),rF[e.id()]=[[t,r]],r;for(let e=0;e<i.length;e++){let[n,s]=i[e];n===t&&(r=s)}return null===r&&(r=t(e),i.push([t,r])),r}(n,o);if(!i.setSource)return s.push(i),e(t,l,r,n,s,a);i.setSource(Object.assign({},t),function(o,u){if(o)return e(t,l,r,n,s,a);s.push(i),e(u,t.type===u.type?l:rq[u.type],r,n,s,a)})}else l.length?e(t,l,r,n,s,a):a?r(t,s):e(t,rq["*"],r,n,s,!0)})(r,rq[r.type],n,i),1),s.length>1){let e=()=>{this.error(null),this.handleSrc_(s.slice(1),!0)},t=()=>{this.off("error",e)};this.one("error",e),this.one("playing",t),this.resetRetryOnError_=()=>{this.off("error",e),this.off("playing",t)}}}src(e){return this.handleSrc_(e,!1)}src_(e){let t=this.selectSource([e]);return!t||(i5(t.tech,this.techName_)?this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready(()=>{this.changingSrc_=!1})),!1)}addSourceElement(e,t){return!!this.tech_&&this.tech_.addSourceElement(e,t)}removeSourceElement(e){return!!this.tech_&&this.tech_.removeSourceElement(e)}load(){if(this.tech_&&this.tech_.vhs)return void this.src(this.currentSource());this.techCall_("load")}reset(){this.paused()?this.doReset_():rc(this.play().then(()=>this.doReset_()))}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),iG(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);let{currentTimeDisplay:e,durationDisplay:t,progressControl:i,remainingTimeDisplay:r}=this.controlBar||{},{seekBar:n}=i||{};e&&e.updateContent(),t&&t.updateContent(),r&&r.updateContent(),n&&(n.update(),n.loadProgressBar&&n.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){let e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){if(void 0!==e){this.techCall_("setPreload",e),this.options_.preload=e;return}return this.techGet_("preload")}autoplay(e){let t;if(void 0===e)return this.options_.autoplay||!1;"string"==typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"==typeof e?e:"play"),t=!1):e?this.options_.autoplay=!0:this.options_.autoplay=!1,t=void 0===t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return void 0!==e&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){if(void 0!==e){this.techCall_("setLoop",e),this.options_.loop=e;return}return this.techGet_("loop")}poster(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){let e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}
50controls(e){if(void 0===e)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(void 0===e)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(void 0===e)return this.error_||null;if(td("beforeerror").forEach(t=>{let i=t(this,e);if(!(tw(i)&&!Array.isArray(i)||"string"==typeof i||"number"==typeof i||null===i))return void this.log.error("please return a value that MediaError expects in beforeerror hooks");e=i}),this.options_.suppressNotSupportedError&&e&&4===e.code){let t=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),this.one("loadstart",function(){this.off(["click","touchstart"],t)});return}if(null===e){this.error_=null,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new ru(e),this.addClass("vjs-error"),tg.error(`(CODE:${this.error_.code} ${ru.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),td("error").forEach(e=>e(this,this.error_))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}this.tech_&&this.tech_.one("mousemove",function(e){e.stopPropagation(),e.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,i,r,n=iq(this,this.reportUserActivity),s=function(t){n(),this.clearInterval(e)};this.on("mousedown",function(){n(),this.clearInterval(e),e=this.setInterval(n,250)}),this.on("mousemove",function(e){(e.screenX!==t||e.screenY!==i)&&(t=e.screenX,i=e.screenY,n())}),this.on("mouseup",s),this.on("mouseleave",s);let a=this.getChild("controlBar");!a||tX||tA||(a.on("mouseenter",function(e){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),a.on("mouseleave",function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",n),this.on("keyup",n),this.setInterval(function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(r);let e=this.options_.inactivityTimeout;e<=0||(r=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},e))},250)}playbackRate(e){return void 0!==e?void this.techCall_("setPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1}defaultPlaybackRate(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(void 0!==e){this.isAudio_=!!e;return}return!!this.isAudio_}updatePlayerHeightOnAudioOnlyMode_(){let e=this.getChild("ControlBar");e&&this.audioOnlyCache_.controlBarHeight!==e.currentHeight()&&(this.audioOnlyCache_.controlBarHeight=e.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");let e=this.children(),t=this.getChild("ControlBar"),i=t&&t.currentHeight();e.forEach(e=>{e!==t&&e.el_&&!e.hasClass("vjs-hidden")&&(e.hide(),this.audioOnlyCache_.hiddenChildren.push(e))}
50),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=i,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(i),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.off("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if("boolean"!=typeof e||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){let e=[];return this.isInPictureInPicture()&&e.push(this.exitPictureInPicture()),this.isFullscreen()&&e.push(this.exitFullscreen()),this.audioPosterMode()&&e.push(this.audioPosterMode(!1)),Promise.all(e).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){return"boolean"!=typeof e||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e)?this.audioOnlyMode()?this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.disablePosterModeUI_()})}addTextTrack(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),iG(this)&&this.trigger("languagechange"))}languages(){return tE(sv.prototype.options_.languages,this.languages_)}toJSON(){let e=tE(this.options_),t=e.tracks;e.tracks=[];for(let i=0;i<t.length;i++){let r=t[i];(r=tE(r)).player=void 0,e.tracks[i]=r}return e}createModal(e,t){(t=t||{}).content=e||"";let i=new rm(this,t);return this.addChild(i),i.on("dispose",()=>{this.removeChild(i)}),i.open(),i}updateCurrentBreakpoint_(){if(!this.responsive())return;let e=this.currentBreakpoint(),t=this.currentWidth();for(let i=0;i<sm.length;i++){let r=sm[i];if(t<=this.breakpoints_[r]){if(e===r)return;e&&this.removeClass(sg[e]),this.addClass(sg[r]),this.breakpoint_=r;break}}}removeCurrentBreakpoint_(){let e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)}breakpoints(e){return void 0===e||(this.breakpoint_="",this.breakpoints_=Object.assign({},sy,e),this.updateCurrentBreakpoint_()),Object.assign(this.breakpoints_)}responsive(e){if(void 0===e)return this.responsive_;e=!!e;let t=this.responsive_;if(e!==t)return this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return sg[this.breakpoint_]||""}loadMedia(e,t){if(!e||"object"!=typeof e)return;let i=this.crossOrigin();this.reset(),this.cache_.media=tE(e);let{artist:r,artwork:n,description:s,poster:a,src:o,textTracks:l,title:u}=this.cache_.media;!n&&a&&(this.cache_.media.artwork=[{src:a,type:rK(a)}]),i&&this.crossOrigin(i),o&&this.src(o),a&&this.poster(a),Array.isArray(l)&&l.forEach(e=>this.addRemoteTextTrack(e,!1)),this.titleBar&&this.titleBar.update({title:u,description:s||r||""}),this.ready(t)}getMedia(){if(!this.cache_.media){let e=this.poster(),t={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),e=>({kind:e.kind,label:e.label,language:e.language,src:e.src}))};return e&&(t.poster=e,t.artwork=[{src:t.poster,type:rK(t.poster)}]),t}return tE(this.cache_.media)}static getTagSettings(e){let t={sources:[],tracks:[]},i=ie(e),r=i["data-setup"];if(t3(e,"vjs-fill")&&(i.fill=!0),t3(e,"vjs-fluid")&&(i.fluid=!0),null!==r)try{Object.assign(i,JSON.parse(r||"{}"))}catch(e){tg.error("data-setup",e)}if(Object.assign(t,i),e.hasChildNodes()){let i=e.childNodes;for(let e=0,r=i.length;e<r;
vendor: 1,585 bytes, line 50
50e++){let r=i[e],n=r.nodeName.toLowerCase();"source"===n?t.sources.push(ie(r)):"track"===n&&t.tracks.push(ie(r))}}return t}debug(e){if(void 0===e)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)}playbackRates(e){if(void 0===e)return this.cache_.playbackRates;Array.isArray(e)&&e.every(e=>"number"==typeof e)&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}}rB.names.forEach(function(e){let t=rB[e];sv.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}}),sv.prototype.crossorigin=sv.prototype.crossOrigin,sv.players={};let s_=p().navigator;sv.prototype.options_={techOrder:rj.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:s_&&(s_.languages&&s_.languages[0]||s_.userLanguage||s_.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1,disableSeekWhileScrubbingOnMobile:!1}
50,sp.forEach(function(e){sv.prototype[`handleTech${i3(e)}_`]=function(){return this.trigger(e)}}),i7.registerComponent("Player",sv);let sb="plugin",sT="activePlugins_",sw={},sS=e=>sw.hasOwnProperty(e),sE=e=>sS(e)?sw[e]:void 0,sC=(e,t)=>{e[sT]=e[sT]||{},e[sT][t]=!0},sk=(e,t,i)=>{let r=(i?"before":"")+"pluginsetup";e.trigger(r,t),e.trigger(r+":"+t.name,t)},sx=function(e,t){let i=function(){sk(this,{name:e,plugin:t,instance:null},!0);let i=t.apply(this,arguments);return sC(this,e),sk(this,{name:e,plugin:t,instance:i}),i};return Object.keys(t).forEach(function(e){i[e]=t[e]}),i},sD=(e,t)=>(t.prototype.name=e,function(...i){sk(this,{name:e,plugin:t,instance:null},!0);let r=new t(...[this,...i]);return this[e]=()=>r,sk(this,r.getEventHash()),r});class sI{constructor(e){if(this.constructor===sI)throw Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),i1(this),delete this.trigger,i4(this,this.constructor.defaultState),sC(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return i$(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){let{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[sT][e]=!1,this.player=this.state=null,t[e]=sD(e,sw[e])}static isBasic(e){let t="string"==typeof e?sE(e):e;return"function"==typeof t&&!sI.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if("string"!=typeof e)throw Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(sS(e))tg.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(sv.prototype.hasOwnProperty(e))throw Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if("function"!=typeof t)throw Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return sw[e]=t,e!==sb&&(sI.isBasic(t)?sv.prototype[e]=sx(e,t):sv.prototype[e]=sD(e,t)),t}static deregisterPlugin(e){if(e===sb)throw Error("Cannot de-register base plugin.");sS(e)&&(delete sw[e],delete sv.prototype[e])}static getPlugins(e=Object.keys(sw)){let t;return e.forEach(e=>{let i=sE(e);i&&((t=t||{})[e]=i)}),t}static getPluginVersion(e){let t=sE(e);return t&&t.VERSION||""}}function sA(e,t,i,r){var n;let s;return n=`${t} is deprecated and will be removed in ${e}.0; please use ${i} instead.`,s=!1,function(...e){return s||tg.warn(n),s=!0,r.apply(this,e)}}sI.getPlugin=sE,sI.BASE_PLUGIN_NAME=sb,sI.registerPlugin(sb,sI),sv.prototype.usingPlugin=function(e){return!!this[sT]&&!0===this[sT][e]},sv.prototype.hasPlugin=function(e){return!!sS(e)};let sO=e=>0===e.indexOf("#")?e.slice(1):e;function sL(e,t,i){let r=sL.getPlayer(e);if(r)return t&&tg.warn(`Player "${e}" is already initialised. Options will not be applied.`),i&&r.ready(i),r;let n="string"==typeof e?iy("#"+sO(e)):e;if(!tZ(n))throw TypeError("The element or ID supplied is not valid. (videojs)");let s="getRootNode"in n&&n.getRootNode()instanceof p().ShadowRoot?n.getRootNode():n.ownerDocument.body;return n.ownerDocument.defaultView&&s.contains(n)||tg.warn("The element supplied is not included in the DOM"),!0===(t=t||{}).restoreEl&&(t.restoreEl=(n.parentNode&&n.parentNode.hasAttribute&&n.parentNode.hasAttribute("data-vjs-player")?n.parentNode:n).cloneNode(!0)),td("beforesetup").forEach(e=>{let i=e(n,tE(t));if(!tw(i)||Array.isArray(i))return void tg.error("please return an object in beforesetup hooks");t=tE(t,i)}),r=new(i7.getComponent("Player"))(n,t,i),td("setup").forEach(e=>e(r)),r}if(sL.hooks_=tu,sL.hooks=td,sL.hook=function(e,t){td(e,t)},sL.hookOnce=function(e,t){td(e,[].concat(t).map(t=>{let i=(...r)=>(tc(e,i),t(...r));return i}))},sL.removeHook=tc,!0!==p().VIDEOJS_NO_DYNAMIC_STYLE&&tJ()){let e=iy(".vjs-styles-defaults");if(!e){e=ik("vjs-styles-defaults");let t=iy("head");t&&t.insertBefore(e,t.firstChild),ix(e,`
51      .video-js {
52        width: 300px;
53        height: 150px;
54      }
55
56      .vjs-fluid:not(.vjs-audio-only-mode) {
57        padding-top: 56.25%
58      }
59    `)}}iE(1,sL),sL.VERSION=tl,sL.options=sv.prototype.options_,sL.getPlayers=()=>sv.players,sL.getPlayer=e=>{let t,i=sv.players;if("string"==typeof e){let r=sO(e),n=i[r];if(n)return n;t=iy("#"+r)}else t=e;if(tZ(t)){let{player:e,playerId:r}=t;if(e||i[r])return e||i[r]}},sL.getAllPlayers=()=>Object.keys(sv.players).map(e=>
59sv.players[e]).filter(Boolean),sL.players=sv.players,sL.getComponent=i7.getComponent,sL.registerComponent=(e,t)=>(rj.isTech(t)&&tg.warn(`The ${e} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),i7.registerComponent.call(i7,e,t)),sL.getTech=rj.getTech,sL.registerTech=rj.registerTech,sL.use=function(e,t){rq[e]=rq[e]||[],rq[e].push(t)},Object.defineProperty(sL,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(sL.middleware,"TERMINATOR",{value:rH,writeable:!1,enumerable:!0}),sL.browser=tK,sL.obj=tx,sL.mergeOptions=sA(9,"videojs.mergeOptions","videojs.obj.merge",tE),sL.defineLazyProperty=sA(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",tk),sL.bind=sA(9,"videojs.bind","native Function.prototype.bind",iq),sL.registerPlugin=sI.registerPlugin,sL.deregisterPlugin=sI.deregisterPlugin,sL.plugin=(e,t)=>(tg.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),sI.registerPlugin(e,t)),sL.getPlugins=sI.getPlugins,sL.getPlugin=sI.getPlugin,sL.getPluginVersion=sI.getPluginVersion,sL.addLanguage=function(e,t){return e=(""+e).toLowerCase(),sL.options.languages=tE(sL.options.languages,{[e]:t}),sL.options.languages[e]},sL.log=tg,sL.createLogger=ty,sL.time=ro,sL.createTimeRange=sA(9,"videojs.createTimeRange","videojs.time.createTimeRanges",rt),sL.createTimeRanges=sA(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",rt),sL.formatTime=sA(9,"videojs.formatTime","videojs.time.formatTime",ra),sL.setFormatTime=sA(9,"videojs.setFormatTime","videojs.time.setFormatTime",rn),sL.resetFormatTime=sA(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",rs),sL.parseUrl=sA(9,"videojs.parseUrl","videojs.url.parseUrl",rk),sL.isCrossOrigin=sA(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",rI),sL.EventTarget=iV,sL.any=iB,sL.on=iM,sL.one=iU,sL.off=iR,sL.trigger=i$,sL.xhr=y(),sL.TextTrack=rP,sL.AudioTrack=rN,sL.VideoTrack=rM,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(e=>{sL[e]=function(){return tg.warn(`videojs.${e}() is deprecated; use videojs.dom.${e}() instead`),iT[e].apply(null,arguments)}}),sL.computedStyle=sA(9,"videojs.computedStyle","videojs.dom.computedStyle",i_),sL.dom=iT,sL.fn=iz,sL.num=nu,sL.str=i6,sL.url=rA,sL.Error={NetworkBadStatus:"networkbadstatus",NetworkRequestFailed:"networkrequestfailed",NetworkRequestAborted:"networkrequestaborted",NetworkRequestTimeout:"networkrequesttimeout",NetworkBodyParserFailed:"networkbodyparserfailed",StreamingHlsPlaylistParserError:"streaminghlsplaylistparsererror",StreamingDashManifestParserError:"streamingdashmanifestparsererror",StreamingContentSteeringParserError:"streamingcontentsteeringparsererror",StreamingVttParserError:"streamingvttparsererror",StreamingFailedToSelectNextSegment:"streamingfailedtoselectnextsegment",StreamingFailedToDecryptSegment:"streamingfailedtodecryptsegment",StreamingFailedToTransmuxSegment:"streamingfailedtotransmuxsegment",StreamingFailedToAppendSegment:"streamingfailedtoappendsegment",StreamingCodecsChangeError:"streamingcodecschangeerror"};class sP{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get:()=>t.enabled_(),set(e){t.enabled_(e)}}),t}}class sN extends sL.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get:()=>e.selectedIndex_}),Object.defineProperty(e,"length",{get:()=>e.levels_.length}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;let i=this.levels_.length;return t=new sP(e),""+i in this||Object.defineProperty(this,i,{get(){return this.levels_[i]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let i=0,r=this.length;i<r;i++)if(this[i]===e){t=this.levels_.splice(i,1)[0],this.selectedIndex_===i?this.selectedIndex_=-1:this.selectedIndex_>i&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,i=this.length;t<i;t++){let i=this[t];if(i.id===e)return i}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}}for(let e in sN.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"},sN.prototype.allowedEvents_)sN.prototype["on"+e]=null;var sM="4.1.0";let sR=function(e,t){let i=e.qualityLevels,r=new sN,n=function(){r.dispose(),e.qualityLevels=i,e.off("dispose",n)};return e.on("dispose",n),e.qualityLevels=()=>r,e.qualityLevels.VERSION=sM,r},s$=function(e){return sR(this,sL.obj.merge({},e))};sL.registerPlugin("qualityLevels",s$),s$.VERSION=sM;let sU=(e,t)=>t&&t.responseURL&&e!==t.responseURL?t.responseURL:e,sB=e=>sL.log.debug?sL.log.debug.bind(sL,"VHS:",`${e} >`):function(){};function sj(...e){let t=sL.obj||sL;return(t.merge||t.mergeOptions).apply(t,e)}function sq(...e){let t=sL.time||sL;return(t.createTimeRanges||t.createTimeRanges).apply(t,e)}let sF=1/30,sH=1/30*3,sz=function(e,t){let i,r=[];if(e&&e.length)for(i=0;i<e.length;i++)t(e.start(i),e.end(i))&&r.push([e.start(i),e.end(i)]);return sq(r)},sV=function(e,t){return sz(e,function(e,i){return e-sH<=t&&i+sH>=t})},sW=function(e,t){return sz(e,function(e){return e-sF>=t})},sG=function(e){if(e.length<2)return sq();let t=[];for(let i=1;i<e.length;i++){let r=e.end(i-1),n=e.start(i);t.push([r,n])}return sq(t)},sX=function(e,t){let i=null,r=null,n=0,s=[],a=[];if(!e||!e.length||!t||!t.length)return sq();let o=e.length;for(;o--;)s.push({time:e.start(o),type:"start"}),s.push({time:e.end(o),type:"end"});for(o=t.length;o--;)s.push({time:t.start(o),type:"start"}),s.push({time:t.end(o),type:"end"});for(s.sort(function(e,t){return e.time-t.time}),o=0;o<s.length;o++)"start"===s[o].type?2==++n&&(i=s[o].time):"end"===s[o].type&&1==--n&&(r=s[o].time),null!==i&&null!==r&&(a.push([i,r]),i=null,r=null);return sq(a)},sY=e=>{let t=[];if(!e||!e.length)return"";for(let i=0;i<e.length;i++)t.push(e.start(i)+" => "+e.end(i));return t.join(", ")},sK=e=>{let t=[];for(let i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t},sQ=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e||e.length!==t.length)return!0;for(let i=0;i<e.length;i++)if(e.start(i)!==t.start(i)||e.end(i)!==t.end(i))return!0;return!1},sJ=function(e){if(e&&e.length&&e.end)return e.end(e.length-1)},sZ=function(e,t){let i=0;if(!e||!e.length)return i;for(let r=0;r<e.length;r++){let n=e.start(r),s=e.end(r);if(!(t>s)){if(t>n&&t<=s){i+=s-t;continue}i+=s-n}}return i},s0=(e,t)=>{if(!t.preload)return t.duration;let i=0;
59return(t.parts||[]).forEach(function(e){i+=e.duration}),(t.preloadHints||[]).forEach(function(t){"PART"===t.type&&(i+=e.partTargetDuration)}),i},s1=e=>(e.segments||[]).reduce((e,t,i)=>(t.parts?t.parts.forEach(function(r,n){e.push({duration:r.duration,segmentIndex:i,partIndex:n,part:r,segment:t})}):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e),[]),s2=e=>{let t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},s4=({preloadSegment:e})=>{if(!e)return;let{parts:t,preloadHints:i}=e,r=(i||[]).reduce((e,t)=>e+ +("PART"===t.type),0);return r+(t&&t.length?t.length:0)},s8=(e,t)=>{if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;let i=s2(t).length>0;return i&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:i&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},s3=function(e,t){let i=0,r=t-e.mediaSequence,n=e.segments[r];if(n){if(void 0!==n.start)return{result:n.start,precise:!0};if(void 0!==n.end)return{result:n.end-n.duration,precise:!0}}for(;r--;){if(void 0!==(n=e.segments[r]).end)return{result:i+n.end,precise:!0};if(i+=s0(e,n),void 0!==n.start)return{result:i+n.start,precise:!0}}return{result:i,precise:!1}},s5=function(e,t){let i,r=0,n=t-e.mediaSequence;for(;n<e.segments.length;n++){if(void 0!==(i=e.segments[n]).start)return{result:i.start-r,precise:!0};if(r+=s0(e,i),void 0!==i.end)return{result:i.end-r,precise:!0}}return{result:-1,precise:!1}},s6=function(e,t,i){if(void 0===t&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence)return 0;let r=s3(e,t);if(r.precise)return r.result;let n=s5(e,t);return n.precise?n.result:r.result+i},s7=function(e,t,i){if(!e)return 0;if("number"!=typeof i&&(i=0),void 0===t){if(e.totalDuration)return e.totalDuration;if(!e.endList)return p().Infinity}return s6(e,t,i)},s9=function({defaultDuration:e,durationList:t,startIndex:i,endIndex:r}){let n=0;if(i>r&&([i,r]=[r,i]),i<0){for(let t=i;t<Math.min(0,r);t++)n+=e;i=0}for(let e=i;e<r;e++)n+=t[e].duration;return n},ae=function(e,t,i,r){if(!e||!e.segments)return null;if(e.endList)return s7(e);if(null===t)return null;t=t||0;let n=s6(e,e.mediaSequence+e.segments.length,t);return i&&(n-=r="number"==typeof r?r:s8(null,e)),Math.max(0,n)},at=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},ai=function(e){return e.excludeUntil&&e.excludeUntil===1/0},ar=function(e){let t=at(e);return!e.disabled&&!t},an=function(e,t){return t.attributes&&t.attributes[e]},as=(e,t)=>{if(1===e.playlists.length)return!0;let i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter(e=>!!ar(e)&&(e.attributes.BANDWIDTH||0)<i).length},aa=(e,t)=>(!!e||!!t)&&(!!e||!t)&&(!e||!!t)&&(e===t||!!e.id&&!!t.id&&e.id===t.id||!!e.resolvedUri&&!!t.resolvedUri&&e.resolvedUri===t.resolvedUri||!!e.uri&&!!t.uri&&e.uri===t.uri),ao=function(e,t){let i=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{},r=!1;for(let e in i){for(let n in i[e])if(r=t(i[e][n]))break;if(r)break}return!!r},al=e=>{if(!e||!e.playlists||!e.playlists.length)return ao(e,e=>e.playlists&&e.playlists.length||e.uri);for(let t=0;t<e.playlists.length;t++){let i=e.playlists[t],r=i.attributes&&i.attributes.CODECS;if(!(r&&r.split(",").every(e=>j(e)))&&!ao(e,e=>aa(i,e)))return!1}return!0};var au={liveEdgeDelay:s8,duration:s7,seekable:function(e,t,i){let r=t||0,n=ae(e,t,!0,i);return null===n?sq():(n<r&&(n=r),sq(r,n))},getMediaInfoForTime:function({playlist:e,currentTime:t,startingSegmentIndex:i,startingPartIndex:r,startTime:n,exactManifestTimings:s}){let a=t-n,o=s1(e),l=0;for(let e=0;e<o.length;e++){let t=o[e];if(i===t.segmentIndex&&("number"!=typeof r||"number"!=typeof t.partIndex||r===t.partIndex)){l=e;break}}if(a<0){if(l>0)for(let t=l-1;t>=0;t--){let i=o[t];if(a+=i.duration,s){if(a<0)continue}else if(a+sF<=0)continue;return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:n-s9({defaultDuration:e.targetDuration,durationList:o,startIndex:l,endIndex:t})}}return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:t}}if(l<0){for(let i=l;i<0;i++)if((a-=e.targetDuration)<0)return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:t};l=0}for(let t=l;t<o.length;t++){let i=o[t];a-=i.duration;let r=i.duration>sF,u=0===a,d=r&&a+sF>=0;if(!u&&!d||t===o.length-1){if(s){if(a>0)continue}else if(a-sF>=0)continue;return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:n+s9({defaultDuration:e.targetDuration,durationList:o,startIndex:l,endIndex:t})}}}return{segmentIndex:o[o.length-1].segmentIndex,partIndex:o[o.length-1].partIndex,startTime:t}},isEnabled:ar,isDisabled:function(e){return e.disabled},isExcluded:at,isIncompatible:ai,playlistEnd:ae,isAes:function(e){for(let t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},hasAttribute:an,estimateSegmentRequestTime:function(e,t,i,r=0){return an("BANDWIDTH",i)?(e*i.attributes.BANDWIDTH-8*r)/t:NaN},isLowestEnabledRendition:as,isAudioOnly:al,playlistMatch:aa,segmentDurationWithParts:s0};let{log:ad}=sL,ac=(e,t)=>`${e}-${t}`,ah=(e,t,i)=>`placeholder-uri-${e}-${t}-${i}`,ap=(e,t)=>{e.mediaGroups&&["AUDIO","SUBTITLES"].forEach(i=>
59{if(e.mediaGroups[i])for(let r in e.mediaGroups[i])for(let n in e.mediaGroups[i][r])t(e.mediaGroups[i][r][n],i,r,n)})},af=({playlist:e,uri:t,id:i})=>{e.id=i,e.playlistErrors_=0,t&&(e.uri=t),e.attributes=e.attributes||{}},am=(e,t,i=ah)=>{e.uri=t;for(let t=0;t<e.playlists.length;t++)if(!e.playlists[t].uri){let i=`placeholder-uri-${t}`;e.playlists[t].uri=i}let r=al(e);ap(e,(t,n,s,a)=>{if(!t.playlists||!t.playlists.length){if(r&&"AUDIO"===n&&!t.uri)for(let t=0;t<e.playlists.length;t++){let i=e.playlists[t];if(i.attributes&&i.attributes.AUDIO&&i.attributes.AUDIO===s)return}t.playlists=[b({},t)]}t.playlists.forEach(function(t,r){let o=i(n,s,a,t),l=ac(r,o);t.uri?t.resolvedUri=t.resolvedUri||w(e.uri,t.uri):(t.uri=0===r?o:l,t.resolvedUri=t.uri),t.id=t.id||l,t.attributes=t.attributes||{},e.playlists[t.id]=t,e.playlists[t.uri]=t})});let n=e.playlists.length;for(;n--;){let t=e.playlists[n];af({playlist:t,id:ac(n,t.uri)}),t.resolvedUri=w(e.uri,t.uri),e.playlists[t.id]=t,e.playlists[t.uri]=t,t.attributes.BANDWIDTH||ad.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}ap(e,t=>{t.uri&&(t.resolvedUri=w(e.uri,t.uri))})};class ag{constructor(){this.offset_=null,this.pendingDateRanges_=new Map,this.processedDateRanges_=new Map}setOffset(e=[]){if(null!==this.offset_||!e.length)return;let[t]=e;void 0!==t.programDateTime&&(this.offset_=t.programDateTime/1e3)}setPendingDateRanges(e=[]){if(!e.length)return;let[t]=e,i=t.startDate.getTime();this.trimProcessedDateRanges_(i),this.pendingDateRanges_=e.reduce((e,t)=>(e.set(t.id,t),e),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(null===this.offset_)return[];let e={},t=[];for(let i of(this.pendingDateRanges_.forEach((i,r)=>{if(!this.processedDateRanges_.has(r)&&(i.startTime=i.startDate.getTime()/1e3-this.offset_,i.processDateRange=()=>this.processDateRange(i),t.push(i),i.class))if(e[i.class]){let t=e[i.class].push(i);i.classListIndex=t-1}else e[i.class]=[i],i.classListIndex=0}),t)){let t=e[i.class]||[];i.endDate?i.endTime=i.endDate.getTime()/1e3-this.offset_:i.endOnNext&&t[i.classListIndex+1]?i.endTime=t[i.classListIndex+1].startTime:i.duration?i.endTime=i.startTime+i.duration:i.plannedDuration?i.endTime=i.startTime+i.plannedDuration:i.endTime=i.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((t,i)=>{t.startDate.getTime()<e&&this.processedDateRanges_.delete(i)})}}let ay=({requestType:e,request:t,error:i,parseFailure:r})=>{let n=t.status<200||t.status>299,s=t.status>=400&&t.status<=499,a={uri:t.uri,requestType:e};return i&&s?(a.error=b({},i),a.errorType=sL.Error.NetworkRequestFailed):t.aborted?a.errorType=sL.Error.NetworkRequestAborted:t.timedout?a.erroType=sL.Error.NetworkRequestTimeout:(n&&!s||r)&&(a.errorType=r?sL.Error.NetworkBodyParserFailed:sL.Error.NetworkBadStatus,a.status=t.status,a.headers=t.headers),a},{EventTarget:av}=sL,a_=(e,t)=>{if(!e)return t;let i=sj(e,t);if(e.preloadHints&&!t.preloadHints&&delete i.preloadHints,e.parts&&!t.parts)delete i.parts;else if(e.parts&&t.parts)for(let r=0;r<t.parts.length;r++)e.parts&&e.parts[r]&&(i.parts[r]=sj(e.parts[r],t.parts[r]));return!e.skipped&&t.skipped&&(i.skipped=!1),e.preload&&!t.preload&&(i.preload=!1),i},ab=(e,t)=>{!e.resolvedUri&&e.uri&&(e.resolvedUri=w(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=w(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=w(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=w(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach(e=>{e.resolvedUri||(e.resolvedUri=w(t,e.uri))}),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach(e=>{e.resolvedUri||(e.resolvedUri=w(t,e.uri))})},aT=function(e){let t=e.segments||[],i=e.preloadSegment;if(i&&i.parts&&i.parts.length){if(i.preloadHints){for(let e=0;e<i.preloadHints.length;e++)if("MAP"===i.preloadHints[e].type)return t}i.duration=e.targetDuration,i.preload=!0,t.push(i)}return t},aw=(e,t)=>e===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence&&e.preloadSegment===t.preloadSegment,aS=(e,t,i=aw)=>{let r=sj(e,{}),n=r.playlists[t.id];if(!n||i(n,t))return null;t.segments=aT(t);let s=sj(n,t);if(s.preloadSegment&&!t.preloadSegment&&delete s.preloadSegment,n.segments){if(t.skip){t.segments=t.segments||[];for(let e=0;e<t.skip.skippedSegments;e++)t.segments.unshift({skipped:!0})}s.segments=((e,t,i)=>{let r,n=e.slice(),s=t.slice();i=i||0;let a=[];for(let e=0;e<s.length;e++){let t=n[e+i],o=s[e];t?(r=t.map||r,a.push(a_(t,o))):(r&&!o.map&&(o.map=r),a.push(o))}return a})(n.segments,t.segments,t.mediaSequence-n.mediaSequence)}
59s.segments.forEach(e=>{ab(e,s.resolvedUri)});for(let e=0;e<r.playlists.length;e++)r.playlists[e].id===t.id&&(r.playlists[e]=s);return r.playlists[t.id]=s,r.playlists[t.uri]=s,ap(e,(e,i,r,n)=>{if(e.playlists)for(let i=0;i<e.playlists.length;i++)t.id===e.playlists[i].id&&(e.playlists[i]=s)}),r},aE=(e,t)=>{let i=e.segments||[],r=i[i.length-1],n=r&&r.parts&&r.parts[r.parts.length-1],s=n&&n.duration||r&&r.duration;return t&&s?1e3*s:500*(e.partTargetDuration||e.targetDuration||10)},aC=(e,t,i)=>{if(!e)return;let r=[];return e.forEach(e=>{if(!e.attributes)return;let{BANDWIDTH:t,RESOLUTION:i,CODECS:n}=e.attributes;r.push({id:e.id,bandwidth:t,resolution:i,codecs:n})}),{type:t,isLive:i,renditions:r}};class ak extends av{constructor(e,t,i={}){if(super(),!e)throw Error("A non-empty playlist URL or object is required");this.logger_=sB("PlaylistLoader");let{withCredentials:r=!1}=i;this.src=e,this.vhs_=t,this.withCredentials=r,this.addDateRangesToTextTrack_=i.addDateRangesToTextTrack;let n=t.options_;this.customTagParsers=n&&n.customTagParsers||[],this.customTagMappers=n&&n.customTagMappers||[],this.llhls=n&&n.llhls,this.dateRangesStorage_=new ag,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){let e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);let t=this.dateRangesStorage_.getDateRangesToProcess();t.length&&this.addDateRangesToTextTrack_&&this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if("HAVE_METADATA"!==this.state)return;let e=this.media(),t=w(this.main.uri,e.uri);this.llhls&&(t=((e,t)=>{if(t.endList||!t.serverControl)return e;let i={};if(t.serverControl.canBlockReload){let{preloadSegment:e}=t,r=t.mediaSequence+t.segments.length;if(e){let n=e.parts||[],s=s4(t)-1;s>-1&&s!==n.length-1&&(i._HLS_part=s),(s>-1||n.length)&&r--}i._HLS_msn=r}if(t.serverControl&&t.serverControl.canSkipUntil&&(i._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(i).length){let t=new(p()).URL(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(e){i.hasOwnProperty(e)&&t.searchParams.set(e,i[e])}),e=t.toString()}return e})(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},(e,t)=>{if(this.request){if(e)return this.playlistRequestError(this.request,this.media(),"HAVE_METADATA");this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}})}playlistRequestError(e,t,i){let{uri:r,id:n}=t;this.request=null,i&&(this.state=i),this.error={playlist:this.main.playlists[n],status:e.status,message:`HLS playlist request error at URL: ${r}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:ay({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:t}){try{return(({onwarn:e,oninfo:t,manifestString:i,customTagParsers:r=[],customTagMappers:n=[],llhls:s})=>{let a=new L;e&&a.on("warn",e),t&&a.on("info",t),r.forEach(e=>
59a.addParser(e)),n.forEach(e=>a.addTagMapper(e)),a.push(i),a.end();let o=a.manifest;if(!s&&(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(e){o.hasOwnProperty(e)&&delete o[e]}),o.segments&&o.segments.forEach(function(e){["parts","preloadHints"].forEach(function(t){e.hasOwnProperty(t)&&delete e[t]})})),!o.targetDuration){let t=10;o.segments&&o.segments.length&&(t=o.segments.reduce((e,t)=>Math.max(e,t.duration),0)),e&&e({message:`manifest has no targetDuration defaulting to ${t}`}),o.targetDuration=t}let l=s2(o);if(l.length&&!o.partTargetDuration){let t=l.reduce((e,t)=>Math.max(e,t.duration),0);e&&(e({message:`manifest has no partTargetDuration defaulting to ${t}`}),ad.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),o.partTargetDuration=t}return o})({onwarn:({message:t})=>this.logger_(`m3u8-parser warn for ${e}: ${t}`),oninfo:({message:t})=>this.logger_(`m3u8-parser info for ${e}: ${t}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls})}catch(e){this.error=e,this.error.metadata={errorType:sL.Error.StreamingHlsPlaylistParserError,error:e}}}haveMetadata({playlistString:e,playlistObject:t,url:i,id:r}){this.request=null,this.state="HAVE_METADATA";let n={playlistInfo:{type:"media",uri:i}};this.trigger({type:"playlistparsestart",metadata:n});let s=t||this.parseManifest_({url:i,manifestString:e});s.lastRequest=Date.now(),af({playlist:s,uri:i,id:r});let a=aS(this.main,s);this.targetDuration=s.partTargetDuration||s.targetDuration,this.pendingMedia_=null,a?(this.main=a,this.media_=this.main.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(aE(this.media(),!!a)),n.parsedPlaylist=aC(this.main.playlists,n.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:n}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),p().clearTimeout(this.mediaUpdateTimeout),p().clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new ag,this.off()}stopRequest(){if(this.request){let e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw Error("Cannot switch media playlist from "+this.state);if("string"==typeof e){if(!this.main.playlists[e])throw Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(p().clearTimeout(this.finalRenditionTimeout),t){let t=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=p().setTimeout(this.media.bind(this,e,!1),t);return}let i=this.state,r=!this.media_||e.id!==this.media_.id,n=this.main.playlists[e.id];if(n&&n.endList||e.endList&&e.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,r&&(this.trigger("mediachanging"),"HAVE_MAIN_MANIFEST"===i?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(aE(e,!0)),!r)return;if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e;let s={playlistInfo:{type:"media",uri:e.uri}};this.trigger({type:"playlistrequeststart",metadata:s}),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(t,r)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=sU(e.resolvedUri,r),t)return this.playlistRequestError(this.request,e,i);this.trigger({type:"playlistrequestcomplete",metadata:s}),this.haveMetadata({playlistString:r.responseText,url:e.uri,id:e.id}),"HAVE_MAIN_MANIFEST"===i?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&(p().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(p().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);let t=this.media();if(e){let e=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=p().setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},e);return}if(!this.started)return void this.start();t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(p().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=p().setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}
59start(){if(this.started=!0,"object"==typeof this.src){this.src.uri||(this.src.uri=p().location.href),this.src.resolvedUri=this.src.uri,setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}let e={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:e}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},(t,i)=>{if(!this.request)return;if(this.request=null,t)return this.error={status:i.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:i.responseText,code:2,metadata:ay({requestType:i.requestType,request:i,error:t})},"HAVE_NOTHING"===this.state&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=sU(this.src,i),this.trigger({type:"playlistparsestart",metadata:e});let r=this.parseManifest_({manifestString:i.responseText,url:this.src});e.parsedPlaylist=aC(r.playlists,e.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:e}),this.setupInitialPlaylist(r)})}srcUri(){return"string"==typeof this.src?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists){this.main=e,am(this.main,this.srcUri()),e.playlists.forEac
59h(e=>{e.segments=aT(e),e.segments.forEach(t=>{ab(t,e.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0]);return}let t=this.srcUri()||p().location.href;this.main=((e,t)=>{let i=ac(0,t),r={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:p().location.href,resolvedUri:p().location.href,playlists:[{uri:t,id:i,resolvedUri:t,attributes:{}}]};return r.playlists[i]=r.playlists[0],r.playlists[t]=r.playlists[0],r})(0,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){let i=this.main,r=e.ID,n=i.playlists.length;for(;n--;){let s=i.playlists[n];if(s.attributes["PATHWAY-ID"]===r){let a=s.resolvedUri,o=s.id;if(t){let t=this.createCloneURI_(s.resolvedUri,e),a=ac(r,t),o=this.createCloneAttributes_(r,s.attributes),l=this.createClonePlaylist_(s,a,e,o);i.playlists[n]=l,i.playlists[a]=l,i.playlists[t]=l}else i.playlists.splice(n,1);delete i.playlists[o],delete i.playlists[a]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){let i=this.main,r=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{if(i.mediaGroups[e]&&i.mediaGroups[e][r]){for(let t in i.mediaGroups[e])if(t===r){for(let r in i.mediaGroups[e][t])i.mediaGroups[e][t][r].playlists.forEac
59h((e,t)=>{let r=i.playlists[e.id],n=r.id,s=r.resolvedUri;delete i.playlists[n],delete i.playlists[s]});delete i.mediaGroups[e][t]}}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){let i=this.main,r=i.playlists.length,n=this.createCloneURI_(t.resolvedUri,e),s=ac(e.ID,n),a=this.createCloneAttributes_(e.ID,t.attributes),o=this.createClonePlaylist_(t,s,e,a);i.playlists[r]=o,i.playlists[s]=o,i.playlists[n]=o,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){let t=e.ID,i=e["BASE-ID"],r=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(r.mediaGroups[n]&&!r.mediaGroups[n][t]){for(let s in r.mediaGroups[n])if(s===i)for(let i in r.mediaGroups[n][t]={},r.mediaGroups[n][s]){let a=r.mediaGroups[n][s][i];r.mediaGroups[n][t][i]=b({},a);let o=r.mediaGroups[n][t][i],l=this.createCloneURI_(a.resolvedUri,e);o.resolvedUri=l,o.uri=l,o.playlists=[],a.playlists.forEach((s,a)=>{let l=r.playlists[s.id],u=ah(n,t,i),d=ac(t,u);if(l&&!r.playlists[d]){let t=this.createClonePlaylist_(l,d,e),i=t.resolvedUri;r.playlists[d]=t,r.playlists[i]=t}o.playlists[a]=this.createClonePlaylist_(s,d,e)})}}})}createClonePlaylist_(e,t,i,r){let n=this.createCloneURI_(e.resolvedUri,i),s={resolvedUri:n,uri:n,id:t};return e.segments&&(s.segments=[]),r&&(s.attributes=r),sj(e,s)}createCloneURI_(e,t){let i=new URL(e);i.hostname=t["URI-REPLACEMENT"].HOST;let r=t["URI-REPLACEMENT"].PARAMS;for(let e of Object.keys(r))i.searchParams.set(e,r[e]);return i.href}createCloneAttributes_(e,t){let i={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(r=>{t[r]&&(i[r]=e)}),i}getKeyIdSet(e){if(e.contentProtection){let t=new Set;for(let i in e.contentProtection){let r=e.contentProtection[i].attributes.keyId;r&&t.add(r.toLowerCase())}return t}}}let ax=function(e,t,i,r){let n="arraybuffer"===e.responseType?e.response:e.responseText;!t&&n&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=n.byteLength||n.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8e3))),i.headers&&(e.responseHeaders=i.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),t||e.aborted||200===i.statusCode||206===i.statusCode||0===i.statusCode||(t=Error("XHR Failed with a response of: "+(e&&(n||e.responseText)))),r(t,e)},aD=function(){let e=function e(t,i){t=sj({timeout:45e3},t);let r=e.beforeRequest||sL.Vhs.xhr.beforeRequest,n=e._requestCallbackSet||sL.Vhs.xhr._requestCallbackSet||new Set,s=e._responseCallbackSet||sL.Vhs.xhr._responseCallbackSet;r&&"function"==typeof r&&(sL.log.warn("beforeRequest is deprecated, use onRequest instead."),n.add(r));let a=!0===sL.Vhs.xhr.original?sL.xhr:sL.Vhs.xhr,o=((e,t)=>{if(!e||!e.size)return;let i=t;return e.forEach(e=>{i=e(i)}),i})(n,t);n.delete(r);let l=a(o||t,function(e,t){return s&&s.size&&s.forEach(i=>{i(l,e,t)}),ax(l,e,t,i)}),u=l.abort;return l.abort=function(){return l.aborted=!0,u.apply(l,arguments)},l.uri=t.uri,l.requestType=t.requestType,l.requestTime=Date.now(),l};return e.original=!0,e},aI=function(e){return"bytes="+e.offset+"-"+("bigint"==typeof e.offset||"bigint"==typeof e.length?p().BigInt(e.offset)+p().BigInt(e.length)-p().BigInt(1):e.offset+e.length-1)},aA=function(e){let t={};return e.byterange&&(t.Range=aI(e.byterange)),t},aO=function(e,t){let i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")},aL=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},aP=function(e){let t={};return Object.keys(e).forEach(i=>{let r=e[i];X(r)?t[i]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:t[i]=r}),t},aN=function(e){let t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},aM=function(e){return e.resolvedUri},aR=e=>{let t=Array.prototype.slice.call(e),i="";for(let e=0;e<t.length/16;e++)i+=t.slice(16*e,16*e+16).map(aO).join("")+" "+t.slice(16*e,16*e+16).map(aL).join("")+"\n";return i};var a$=Object.freeze({__proto__:null,createTransferableMessage:aP,initSegmentId:aN,segmentKeyId:aM,hexDump:aR,tagDump:({bytes:e})=>aR(e),textRanges:e=>{let t,i="";for(t=0;t<e.length;t++){var r;i+=(r=t,e.start(r)+"-"+e.end(r)+" ")}return i}});let aU=({programTime:e,playlist:t,retryCount:i=2,seekTo:r,pauseAfterSeek:n=!0,tech:s,callback:a})=>{if(!a)throw Error("seekToProgramTime: callback must be provided");
59if(void 0===e||!t||!r)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!t.endList&&!s.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!(e=>{if(!e.segments||0===e.segments.length)return!1;for(let t=0;t<e.segments.length;t++)if(!e.segments[t].dateTimeObject)return!1;return!0})(t))return a({message:"programDateTime tags must be provided in the manifest "+t.resolvedUri});let o=((e,t)=>{let i,r;try{i=new Date(e)}catch(e){return null}if(!t||!t.segments||0===t.segments.length)return null;let n=t.segments[0];if(i<new Date(n.dateTimeObject))return null;for(let e=0;e<t.segments.length-1&&(n=t.segments[e],!(i<new Date(t.segments[e+1].dateTimeObject)));e++);let s=t.segments[t.segments.length-1],a=s.dateTimeObject,o=s.videoTimingInfo?(r=s.videoTimingInfo).transmuxedPresentationEnd-r.transmuxedPresentationStart-r.transmuxerPrependedSeconds:s.duration+.25*s.duration;return i>new Date(a.getTime()+1e3*o)?null:(i>new Date(a)&&(n=s),{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:au.duration(t,t.mediaSequence+t.segments.indexOf(n)),type:n.videoTimingInfo?"accurate":"estimate"})})(e,t);if(!o)return a({message:`${e} was not found in the stream`});let l=o.segment,u=((e,t)=>{let i,r;try{i=new Date(e),r=new Date(t)}catch(e){}let n=i.getTime();return(r.getTime()-n)/1e3})(l.dateTimeObject,e);if("estimate"===o.type)return 0===i?a({message:`${e} is not buffered yet. Try again`}):(r(o.estimatedStart+u),void s.one("seeked",()=>{aU({programTime:e,playlist:t,retryCount:i-1,seekTo:r,pauseAfterSeek:n,tech:s,callback:a})}));let d=l.start+u;s.one("seeked",()=>a(null,s.currentTime())),n&&s.pause(),r(d)},aB=(e,t)=>{if(4===e.readyState)return t()},{EventTarget:aj}=sL,aq=function(e,t){if(!aw(e,t)||e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length)||!e.sidx&&t.sidx||e.sidx&&!t.sidx||e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(!e.segments&&!t.segments)return!0;for(let i=0;i<e.segments.length;i++){let r=e.segments[i],n=t.segments[i];if(r.uri!==n.uri)return!1;if(!r.byterange&&!n.byterange)continue;let s=r.byterange,a=n.byterange;if(s&&!a||!s&&a||s.offset!==a.offset||s.length!==a.length)return!1}return!0},aF=(e,t,i,r)=>{let n=r.attributes.NAME||i;return`placeholder-uri-${e}-${t}-${n}`},aH=(e,t)=>(!!(!e.map&&!t.map)||!!(e.map&&t.map&&e.map.byterange.offset===t.map.byterange.offset&&e.map.byterange.length===t.map.byterange.length))&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length,az=(e,t)=>{let i={};for(let r in e){let n=e[r].sidx;if(n){let e=ew(n);if(!t[e])break;aH(t[e].sidxInfo,n)&&(i[e]=t[e])}}return i};class aV extends aj{constructor(e,t,i={},r){super(),this.isPaused_=!0,this.mainPlaylistLoader_=r||this,r||(this.isMain_=!0);let{withCredentials:n=!1}=i;if(this.vhs_=t,this.withCredentials=n,this.addMetadataToTextTrack=i.addMetadataToTextTrack,!e)throw Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=sB("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}get isPaused(){return this.isPaused_}requestErrored_(e,t,i){return!this.request||((this.request=null,e)?(this.error="object"!=typeof e||e instanceof Error?{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata}:e,i&&(this.state=i),this.trigger("error"),!0):void 0)}addSidxSegments_(e,t,i){let r=e.sidx&&ew(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r]){p().clearTimeout(this.mediaRequest_),this.mediaRequest_=p().setTimeout(()=>i(!1),0);return}let n=sU(e.sidx.resolvedUri),s=(n,s)=>{let a;if(this.requestErrored_(n,s,t))return;let o=this.mainPlaylistLoader_.sidxMapping_,{requestType:l}=s;try{a=eX()(Y(s.response).subarray(8))}catch(e){e.metadata=ay({requestType:l,request:s,parseFailure:!0}),this.requestErrored_(e,s,t);return}return o[r]={sidxInfo:e.sidx,sidx:a},eg(e,a,e.sidx.resolvedUri),i(!0)};this.request=((e,t,i,r)=>{let n,s=[],a=!1,o=function(e,t,r,n){return t.abort(),a=!0,i(e,t,r,n)},l=function(e,t){if(a)return;if(e)return e.metadata=ay({requestType:r,request:t,error:e}),o(e,t,"",s);let i=t.responseText.substring(s&&s.byteLength||0,t.responseText.length);if(s=ei(s,et(i,!0)),n=n||eQ(s),s.length<10||n&&s.length<n+2)return aB(t,()=>o(e,t,"",s));let l=ta(s);return"ts"===l&&s.length<188||!l&&s.length<376?aB(t,()=>o(e,t,"",s)):o(null,t,l,s)},u=t({uri:e,beforeSend(e){e.overrideMimeType("text/plain;
59 charset=x-user-defined"),e.addEventListener("progress",function({total:t,loaded:i}){return ax(e,null,{statusCode:e.status},l)})}},function(e,t){return ax(u,e,t,l)});return u})(n,this.vhs_.xhr,(t,i,r,a)=>{if(t)return s(t,i);if(!r||"mp4"!==r)return s({status:i.status,message:`Unsupported ${r||"unknown"} container type for sidx segment at URL: ${n}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},i);let{offset:o,length:l}=e.sidx.byterange;if(a.length>=l+o)return s(t,{response:a.subarray(o,o+l),status:i.status,uri:i.uri});this.request=this.vhs_.xhr({uri:n,responseType:"arraybuffer",requestType:"dash-sidx",headers:aA({byterange:e.sidx.byterange})},s)},"dash-sidx")}dispose(){this.isPaused_=!0,this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},p().clearTimeout(this.minimumUpdatePeriodTimeout_),p().clearTimeout(this.mediaRequest_),p().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){let e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw Error("Cannot switch media playlist from "+this.state);let t=this.state;if("string"==typeof e){if(!this.mainPlaylistLoader_.main.playlists[e])throw Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}let i=!this.media_||e.id!==this.media_.id;if(i&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,i&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}i&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,i=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,p().clearTimeout(this.mediaRequest_),this.mediaRequest_=null,this.refreshMedia_(t.id),"HAVE_MAIN_MANIFEST"===e?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.isPaused_=!0,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),p().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(p().clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)}load(e){this.isPaused_=!1,p().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;let t=this.media();if(e){let e=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=p().setTimeout(()=>this.load(),e);return}if(!this.started)return void this.start();t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")}start(){if(this.started=!0,!this.isMain_){p().clearTimeout(this.mediaRequest_),this.mediaRequest_=p().setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((e,t)=>{this.haveMain_(),this.hasPendingRequest()||this.media_||this.media(this.mainPlaylistLoader_.main.playlists[0])})}requestMain_(e){let t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:t}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(i,r)=>{if(i){let{requestType:e}=r;i.metadata=ay({requestType:e,request:r,error:i})}if(this.requestErrored_(i,r)){"HAVE_NOTHING"===this.state&&(this.started=!1);return}this.trigger({type:"manifestrequestcomplete",metadata:t});let n=r.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=r.responseText,r.responseHeaders&&r.responseHeaders.date?this.mainLoaded_=Date.parse(r.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=sU(this.mainPlaylistLoader_.srcUrl,r),n){this.handleMain_(),this.syncCl
59ientServerClock_(()=>e(r,n));return}return e(r,n)})}syncClientServerClock_(e){let t=(e=>{let t=e$(e,"UTCTiming")[0];if(!t)return null;let i=eq(t);switch(i.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":i.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":i.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":i.method="DIRECT",i.value=Date.parse(i.value);break;default:throw Error("UNSUPPORTED_UTC_TIMING_SCHEME")}return i})(eW(this.mainPlaylistLoader_.mainXml_));return null===t?(this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()):"DIRECT"===t.method?(this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:w(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(i,r)=>{let n;if(this.request){if(i){let{requestType:t}=r;return this.error.metadata=ay({requestType:t,request:r,error:i}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}n="HEAD"===t.method?r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):this.mainLoaded_:Date.parse(r.responseText),this.mainPlaylistLoader_.clientOffset_=n-Date.now(),e()}}))}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){let e;p().clearTimeout(this.mediaRequest_),this.mediaRequest_=null;let t=this.mainPlaylistLoader_.main,i={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestparsestart",metadata:i});try{e=(({mainXml:e,srcUrl:t,clientOffset:i,sidxMapping:r,previousManifest:n})=>{let s=((e,t={})=>{let i=((e,t={})=>{let{manifestUri:i="",NOW:r=Date.now(),clientOffset:n=0,eventHandler:s=function(){}}=t,a=e$(e,"Period");if(!a.length)throw Error("INVALID_NUMBER_OF_PERIOD");let o=e$(e,"Location"),l=eq(e),u=eH([{baseUrl:i}],e$(e,"BaseURL")),d=e$(e,"ContentSteering");l.type=l.type||"static",l.sourceDuration=l.mediaPresentationDuration||0,l.NOW=r,l.clientOffset=n,o.length&&(l.locations=o.map(eU));let c=[];return a.forEach((e,t)=>{let i=eq(e),r=c[t-1];i.start=(({attributes:e,priorPeriodAttributes:t,mpdType:i})=>"number"==typeof e.start?e.start:t&&"number"==typeof t.start&&"number"==typeof t.duration?t.start+t.duration:t||"static"!==i?null:0)({attributes:i,priorPeriodAttributes:r?r.attributes:null,mpdType:l.type}),c.push({node:e,attributes:i})}),{locations:l.locations,contentSteeringInfo:((e,t)=>{if(e.length>1&&t({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!e.length)return null;let i=eo({serverURL:eU(e[0])},eq(e[0]));return i.queryBeforeStart="true"===i.queryBeforeStart,i})(d,s),representationInfo:eu(c.map((e,t)=>{let i=eH(u,e$(e.node,"BaseURL")),r=eo(l,{periodStart:e.attributes.start});"number"==typeof e.attributes.duration&&(r.periodDuration=e.attributes.duration);let n=e$(e.node,"AdaptationSet"),s=ez(e.node);return eu(n.map(e=>{var t;let n,a=eq(e),o=eH(i,e$(e,"BaseURL")),l=eo(r,a,{role:eq(e$(e,"Role")[0])}),u="urn:scte:dash:cc:cea-608:2015"===(t=eq(e$(e,"Accessibility")[0])).schemeIdUri?("string"!=typeof t.value?[]:t.value.split(";")).map(e=>{let t,i;return i=e,/^CC\d=/.test(e)?[t,i]=e.split("="):/^CC\d$/.test(e)&&(t=e),{channel:t,language:i}}):"urn:scte:dash:cc:cea-708:2015"===t.schemeIdUri?("string"!=typeof t.value?[]:t.value.split(";")).map(e=>{let t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){let[i,r=""]=e.split("=");t.channel=i,t.language=e,r.split(",").forEach(e=>{let[i,r]=e.split(":");"lang"===i?t.language=r:"er"===i?t.easyReader=Number(r):"war"===i?t.aspectRatio=Number(r):"3D"===i&&(t["3D"]=Number(r))})}else t.language=e;return t.channel&&(t.channel="SERVICE"+t.channel),t}):void 0;u&&(l=eo(l,{captionServices:u}));let d=e$(e,"Label")[0];d&&d.childNodes.length&&(l=eo(l,{label:d.childNodes[0].nodeValue.trim()}));let c=e$(e,"ContentProtection").reduce((e,t)=>
59{let i=eq(t);i.schemeIdUri&&(i.schemeIdUri=i.schemeIdUri.toLowerCase());let r=eF[i.schemeIdUri];if(r){e[r]={attributes:i};let n=e$(t,"cenc:pssh")[0];if(n){let t=eU(n);e[r].pssh=t&&E(t)}}return e},{});Object.keys(c).length&&(l=eo(l,{contentProtection:c}));let h=ez(e),p=e$(e,"Representation"),f=eo(s,h);return eu(p.map((n=l,e=>{let t=eH(o,e$(e,"BaseURL")),i=eo(n,eq(e)),r=ez(e);return t.map(e=>({segmentInfo:eo(f,r),attributes:eo(i,e)}))})))}))})),eventStream:eu(c.map(eV))}})(eW(e),t);return(({dashPlaylists:e,locations:t,contentSteering:i,sidxMapping:r={},previousManifest:n,eventStream:s})=>{var a;if(!e.length)return{};let{sourceDuration:o,type:l,suggestedPresentationDelay:u,minimumUpdatePeriod:d}=e[0].attributes,c=eS(e.filter(ek)).map(eC),h=eS(e.filter(ex)),p=eS(e.filter(eD)),f=e.map(e=>e.attributes.captionServices).filter(Boolean),m={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:o,playlists:((e,t={})=>{if(!Object.keys(t).length)return e;for(let i in e)e[i]=eE(e[i],t);return e})(c,r)};d>=0&&(m.minimumUpdatePeriod=1e3*d),t&&(m.locations=t),i&&(m.contentSteering=i),"dynamic"===l&&(m.suggestedPresentationDelay=u),s&&s.length>0&&(m.eventStream=s);let g=0===m.playlists.length,y=h.length?((e,t={},i=!1)=>{let r,n=e.reduce((e,n)=>{let s=n.attributes.role&&n.attributes.role.value||"",a=n.attributes.lang||"",o=n.attributes.label||"main";if(a&&!n.attributes.label){let e=s?` (${s})`:"";o=`${n.attributes.lang}${e}`}e[o]||(e[o]={language:a,autoselect:!0,default:"main"===s,playlists:[],uri:""});let l=eE((({attributes:e,segments:t,sidx:i,mediaSequence:r,discontinuitySequence:n,discontinuityStarts:s},a)=>{let o={attributes:{NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs,"PROGRAM-ID":1},uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuitySequence:n,discontinuityStarts:s,timelineStarts:e.timelineStarts,mediaSequence:r,segments:t};return e.contentProtection&&(o.contentProtection=e.contentProtection),e.serviceLocation&&(o.attributes.serviceLocation=e.serviceLocation),i&&(o.sidx=i),a&&(o.attributes.AUDIO="audio",o.attributes.SUBTITLES="subs"),o})(n,i),t);return e[o].playlists.push(l),void 0===r&&"main"===s&&((r=n).default=!0),e},{});if(!r){let e=Object.keys(n)[0];n[e].default=!0}return n})(h,r,g):null,v=p.length?((e,t={})=>e.reduce((e,i)=>{let r=i.attributes.label||i.attributes.lang||"text",n=i.attributes.lang||"und";return e[r]||(e[r]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),e[r].playlists.push(eE((({attributes:e,segments:t,mediaSequence:i,discontinuityStarts:r,discontinuitySequence:n})=>{void 0===t&&(t=[{uri:e.baseUrl,timeline:e.periodStart,resolvedUri:e.baseUrl||"",duration:e.sourceDuration,number:0}],e.duration=e.sourceDuration);let s={NAME:e.id,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1};e.codecs&&(s.CODECS=e.codecs);let a={attributes:s,uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,timelineStarts:e.timelineStarts,discontinuityStarts:r,discontinuitySequence:n,mediaSequence:i,segments:t};return e.serviceLocation&&(a.attributes.serviceLocation=e.serviceLocation),a})(i),t)),e},{}))(p,r):null,_=c.concat(eI(y),eI(v));return m.timelineStarts=e_(_.map(({timelineStarts:e})=>e)),a=m.timelineStarts,_.forEach(e=>{e.mediaSequence=0,e.discontinuitySequence=a.findIndex(function({timeline:t}){return t===e.timeline}),e.segments&&e.segments.forEach((e,t)=>{e.number=t})}),y&&(m.mediaGroups.AUDIO.audio=y),v&&(m.mediaGroups.SUBTITLES.subs=v),(f.length&&(m.mediaGroups["CLOSED-CAPTIONS"].cc=f.reduce((e,t)=>(t&&t.forEach(t=>{let{channel:i,language:r}=t;e[r]={autoselect:!1,default:!1,instreamId:i,language:r},t.hasOwnProperty("aspectRatio")&&(e[r].aspectRatio=t.aspectRatio),t.hasOwnProperty("easyReader")&&(e[r].easyReader=t.easyReader),t.hasOwnProperty("3D")&&(e[r]["3D"]=t["3D"])}),e),{})),n)?(({oldManifest:e,newManifest:t})=>{let i=e.playlists.concat(eb(e)),r=t.playlists.concat(eb(t));return t.timelineStarts=e_([e.timelineStarts,t.timelineStarts]),(({oldPlaylists:e,newPlaylists:t,timelineStarts:i})=>{t.forEach(t=>{t.discontinuitySequence=i.findIndex(function({timeline:e}){return e===t.timeline});let r=((e,t)=>{for(let i=0;i<e.length;i++)if(e[i].attributes.NAME===t)return e[i];return null})(e,t.attributes.NAME);if(!r||t.sidx)return;let n=t.segments[0],s=r.segments.findIndex(function(e){return Math.abs(e.presentationTime-n.presentationTime)<ev});if(-1===s){eT({playlist:t,mediaSequence:r.mediaSequence+r.segments.length}),t.segments[0].discontinuity=!0,t.discontinuityStarts.unshift(0),(!r.segments.length&&t.timeline>r.timeline||r.segments.length&&t.timeline>r.segments[r.segments.length-1].timeline)&&t.discontinuitySequence--;return}r.segments[s].discontinuity&&!n.discontinuity&&(n.discontinuity=!0,t.discontinuityStarts.unshift(0),t.discontinuitySequence--),eT({playlist:t,mediaSequence:r.segments[s].number})})})({oldPlaylists:i,newPlaylists:r,timelineStarts:t.timelineStarts}),t})({oldManifest:n,newManifest:m}):m})({dashPlaylists:i.representationInfo.map(eR),locations:i.locations,contentSteering:i.contentSteeringInfo,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest,eventStream:i.eventStream})})(e,{manifestUri:t,clientOffset:i,sidxMapping:r,previousManifest:n});return am(s,t,aF),s})({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:t})}catch(e){this.error=e,this.error.metadata={errorType:sL.Error.StreamingDashManifestParserError,error:e},this.trigger("error")}t&&(e=((e,t,i)=>{var r;let n=!0,s=sj(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts});for(let e=0;e<t.playlists.length;e++){let r=t.playlists[e];if(r.sidx){let e=ew(r.sidx);i&&i[e]&&i[e].sidx&&eg(r,i[e].sidx,r.sidx.resolvedUri)}let a=aS(s,r,aq);a&&(s=a,n=!1)}return(ap(t,(e,t,i,r)=>{if(e.playlists&&e.playlists.length){let a=e.playlists[0].id,o=aS(s,e.playlists[0],aq);o&&(r in(s=o).mediaGroups[t][i]||(s.mediaGroups[t][i][r]=e),s.mediaGroups[t][i][r].playlists[0]=s.playlists[a],n=!1)}}),ap(r=s,(e,i,n,s)=>{t.mediaGroups[i][n]&&s in t.mediaGroups[i][n]||delete r.mediaGroups[i][n][s]}),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(n=!1),n)?null:s})(t,e,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=e||t;let r=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(r&&r!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=r),(!t||e&&e.minimumUpdatePeriod!==t.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(e),e){let{duration:t,endList:r}=e,n=[];
59e.playlists.forEach(e=>{n.push({id:e.id,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS})}),i.parsedManifest={duration:t,isLive:!r,renditions:n},this.trigger({type:"manifestparsecomplete",metadata:i})}return!!e}updateMinimumUpdatePeriodTimeout_(){let e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(p().clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;if(0===t&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),"number"!=typeof t||t<=0){t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`);return}this.createMUPTimeout_(t)}createMUPTimeout_(e){let t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=p().setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{if(t){var i,r;let e;this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=(i=this.mainPlaylistLoader_.main,r=this.mainPlaylistLoader_.sidxMapping_,e=az(i.playlists,r),ap(i,(t,i,n,s)=>{if(t.playlists&&t.playlists.length){let i=t.playlists;e=sj(e,az(i,r))}}),e),this.addSidxSegments_(this.media(),this.state,e=>{this.refreshMedia_(this.media().id)})}})}refreshMedia_(e){if(!e)throw Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();let t=this.mainPlaylistLoader_.main.playlists,i=!this.media_||this.media_!==t[e];if(i?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){let e=()=>{this.media().endList||(this.mediaUpdateTimeout=p().setTimeout(()=>{this.trigger("mediaupdatetimeout"),e()},aE(this.media(),!!i)))};e()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){let e=this.mainPlaylistLoader_.main.eventStream.map(e=>({cueTime:e.start,frames:[{data:e.messageData}]}));this.addMetadataToTextTrack("EventStream",e,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){let t=new Set;for(let i in e.contentProtection){let r=e.contentProtection[i].attributes["cenc:default_KID"];r&&t.add(r.replace(/-/g,"").toLowerCase())}return t}}}var aW={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};let aG=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},aX=function(e){try{return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch(i){let t=new BlobBuilder;return t.append(e),URL.createObjectURL(t.getBlob())}},aY=function(e){return function(){let t=aX(e),i=aG(new Worker(t));i.objURL=t;let r=i.terminate;return i.on=i.addEventListener,i.off=i.removeEventListener,i.terminate=function(){return URL.revokeObjectURL(t),r.call(this)},i}},aK=function(e){return`var browserWorkerPolyFill = ${aG.toString()};
60browserWorkerPolyFill(self);
61`+e},aQ=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)};var aJ=aY(aK(aQ(function(){var e,t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},r=function(){this.init=function(){var e={};this.on=function(t,i){e[t]||(e[t]=[]),e[t]=e[t].concat(i)},this.off=function(t,i){var r;return!!e[t]&&(r=e[t].indexOf(i),e[t]=e[t].slice(),e[t].splice(r,1),r>-1)},this.trigger=function(t){var i,r,n,s;if(i=e[t])if(2==arguments.length)for(r=0,n=i.length;r<n;++r)i[r].call(this,arguments[1]);else{for(s=[],r=arguments.length,r=1;r<arguments.length;++r)s.push(arguments[r]);for(r=0,n=i.length;r<n;++r)i[r].apply(this,s)}},this.dispose=function(){e={}}}};r.prototype.pipe=function(e){return this.on("data",function(t){e.push(t)}),this.on("done",function(t){e.flush(t)}),this.on("partialdone",function(t){e.partialFlush(t)}),this.on("endedtimeline",function(t){e.endTimeline(t)}),this.on("reset",function(t){e.reset(t)}),e},r.prototype.push=function(e){this.trigger("data",e)},r.prototype.flush=function(e){this.trigger("done",e)},r.prototype.partialFlush=function(e){this.trigger("partialdone",e)},r.prototype.endTimeline=function(e){this.trigger("endedtimeline",e)},r.prototype.reset=function(e){this.trigger("reset",e)};var n=function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.getBigUint64?(t=i.getBigUint64(0))<Number.MAX_SAFE_INTEGER?
61Number(t):t:0x100000000*i.getUint32(0)+i.getUint32(4)},s=0x100000000,a=s;if(e2={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!=typeof Uint8Array){for(eM in e2)e2.hasOwnProperty(eM)&&(e2[eM]=[eM.charCodeAt(0),eM.charCodeAt(1),eM.charCodeAt(2),eM.charCodeAt(3)]);e4=new Uint8Array([105,115,111,109]),e3=new Uint8Array([97,118,99,49]),e8=new Uint8Array([0,0,0,1]),e5={video:new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),audio:new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0])},e9=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),e7=new Uint8Array([0,0,0,0,0,0,0,0]),tt=te=new Uint8Array([0,0,0,0,0,0,0,0]),ti=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),tr=te,e6=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}eq=function(e){var t,i,r=[],n=0;for(t=1;t<arguments.length;t++)r.push(arguments[t]);for(t=r.length;t--;)n+=r[t].byteLength;for(new DataView((i=new Uint8Array(n+8)).buffer,i.byteOffset,i.byteLength).setUint32(0,i.byteLength),i.set(e,4),t=0,n=8;t<r.length;t++)i.set(r[t],n),n+=r[t].byteLength;return i};eY=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(t[12]=e.samplerate>>>24&255,t[13]=e.samplerate>>>16&255,t[14]=e.samplerate>>>8&255,t[15]=255&e.samplerate),eq(e2.mdhd,t)},eX=function(e){var t;return eq(e2.mdia,eY(e),(t=e.type,eq(e2.hdlr,e5[t])),eF(e))},eF=function(e){return eq(e2.minf,"video"===e.type?eq(e2.vmhd,e6):eq(e2.smhd,e7),eq(e2.dinf,eq(e2.dref,e9)),eQ(e))},eH=function(e){for(var t=e.length,i=[];t--;)i[t]=eW(e[t]);return eq.apply(null,[e2.moov,eV(0xffffffff)].concat(i).concat(ez(e)))},ez=function(e){for(var t=e.length,i=[];t--;)i[t]=e0(e[t]);return eq.apply(null,[e2.mvex].concat(i))},eV=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(0xff000000&e)>>24,(0xff0000&e)>>16,(65280&e)>>8,255&e,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return eq(e2.mvhd,t)},eK=function(e){var t,i,r=e.samples||[],n=new Uint8Array(4+r.length);for(i=0;i<r.length;i++)t=r[i].flags,n[i+4]=t.dependsOn<<4|t.isDependedOn<<2|t.hasRedundancy;return eq(e2.sdtp,n)},eQ=function(e){return eq(e2.stbl,eJ(e),eq(e2.stts,tr),eq(e2.stsc,tt),eq(e2.stsz,ti),eq(e2.stco,te))},eJ=function(e){return eq(e2.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===e.type?eR(e):e$(e))},eR=function(e){var t,i,r=e.sps||[],n=e.pps||[],s=[],a=[];for(t=0;t<r.length;t++)s.push((65280&r[t].byteLength)>>>8),s.push(255&r[t].byteLength),s=s.concat(Array.prototype.slice.call(r[t]));for(t=0;t<n.length;t++)a.push((65280&n[t].byteLength)>>>8),a.push(255&n[t].byteLength),a=a.concat(Array.prototype.slice.call(n[t]));if(i=[e2.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),eq(e2.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([r.length],s,[n.length],a))),eq(e2.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio){var o=e.sarRatio[0],l=e.sarRatio[1];i.push(eq(e2.pasp,new Uint8Array([(0xff000000&o)>>24,(0xff0000&o)>>16,(65280&o)>>8,255&o,(0xff000000&l)>>24,(0xff0000&l)>>16,(65280&l)>>8,255&l])))}return eq.apply(null,i)},e$=function(e){return eq(e2.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),eq(e2.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,e.audioobjecttype<<3|e.samplingfrequencyindex>>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2])))},eG=function(e){var t=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(0xff000000&e.id)>>24,(0xff0000&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(0xff000000&e.duration)>>24,(0xff0000&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return eq(e2.tkhd,t)},eZ=function(e){var t,i,r,n,s,o;return(t=eq(e2.tfhd,new Uint8Array([0,0,0,58,(0xff000000&e.id)>>24,(0xff0000&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),s=Math.floor(e.baseMediaDecodeTime/a),o=Math.floor(e.baseMediaDecodeTime%a),i=eq(e2.tfdt,new Uint8Array([1,0,0,0,s>>>24&255,s>>>16&255,s>>>8&255,255&s,o>>>24&255,o>>>16&255,o>>>8&255,255&o])),"audio"===e.type)?(r=e1(e,92),eq(e2.traf,t,i,r)):(n=eK(e),r=e1(e,n.length+92),eq(e2.traf,t,i,r,n))},eW=function(e){return e.duration=e.duration||0xffffffff,eq(e2.trak,eG(e),eX(e))},e0=function(e){var t=new Uint8Array([0,0,0,0,(0xff000000&e.id)>>24,(0xff0000&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(t[t.length-1]=0),eq(e2.trex,t)},ej=function(e,t){var i=0,r=0,n=0,s=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(r=2),void 0!==e[0].flags&&(n=4),void 0!==e[0].compositionTimeOffset&&(s=8)),[0,0,i|r|n|s,1,(0xff000000&e.length)>>>24,(0xff0000&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(0xff000000&t)>>>24,(0xff0000&t)>>>16,(65280&t)>>>8,255&t]},eB=function(e,t){var i,r,n,s,a,o;for(t+=20+16*(s=e.samples||[]).length,(r=new Uint8Array((n=ej(s,t)).length+16*s.length)).set(n),i=n.length,o=0;o<s.length;o++)a=s[o],r[i++]=(0xff000000&a.duration)>>>24,r[i++]=(0xff0000&a.duration)>>>16,r[i++]=(65280&a.duration)>>>8,r[i++]=255&a.duration,r[i++]=(0xff000000&a.size)>>>24,r[i++]=(0xff0000&a.size)>>>16,r[i++]=(65280&a.size)>>>8,r[i++]=255&a.size,r[i++]=a.flags.isLeading<<2|a.flags.dependsOn,r[i++]=a.flags.isDependedOn<<6|a.flags.hasRedundancy<<4|a.flags.paddingValue<<1|a.flags.isNonSyncSample,r[i++]=61440&a.flags.degradationPriority,r[i++]=15&a.flags.degradationPriority,r[i++]=(0xff000000&a.compositionTimeOffset)>>>24,r[i++]=(0xff0000&a.compositionTimeOffset)>>>16,r[i++]=(65280&a.compositionTimeOffset)>>>8,r[i++]=255&a.compositionTimeOffset;return eq(e2.trun,r)},eU=function(e,t){var i,r,n,s,a,o;for(t+=20+8*(s=e.samples||[]).length,(i=new Uint8Array((n=ej(s,t)).length+8*s.length)).set(n),r=n.length,o=0;o<s.length;o++)a=s[o],i[r++]=(0xff000000&a.duration)>>>24,i[r++]=(0xff0000&a.duration)>>>16,i[r++]=(65280&a.duration)>>>8,i[r++]=255&a.duration,i[r++]=(0xff000000&a.size)>>>24,i[r++]=(0xff0000&a.size)>>>16,i[r++]=(65280&a.size)>>>8,i[r++]=255&a.size;return eq(e2.trun,i)},e1=function(e,t){return"audio"===e.type?eU(e,t):eB(e,t)};var o=function(e,t){var i={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return i.dataOffset=t,i.compositionTimeOffset=e.pts-e.dts,i.duration=e.duration,i.size=4*e.length,i.size+=e.byteLength,e.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i},l=[33,16,5,32,164,27],u=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],d=function(e){for(var t=[];e--;)t.push(0);return t};ts=function(e){return 9e4*e},ta=function(e,t){return e*t},to=function(e){return e/9e4},tl=function(e,t){return e/t};var c=9e4,h=ts,p=to,f=function(e,t){return ts(tl(e,t))},m=function(e,t){return ta(to(e),t)},g=function(e,t,i){return to(i?e:e-t)},y=function(){if(!tn){var e;tn=Object.keys(e={96e3:[l,[227,64],d(154),[56]],88200:[l,[231],d(170),[56]],64e3:[l,[248,192],d(240),[56]],48e3:[l,[255,192],d(268),[55,148,128],d(54),[112]],44100:[l,[255,192],d(268),[55,163,128],d(84),[112]],32e3:[l,[255,192],d(268),[55,234],d(226),[112]],24e3:[l,[255,192],d(268),[55,255,128],d(268),[111,112],d(126),[224]],16e3:[l,[255,192],d(268),[55,255,128],d(268),[111,255],d(269),[223,108],d(195),[1,192]],12e3:[u,d(268),[3,127,248],d(268),[6,255,240],d(268),[13,255,224],d(268),[27,253,128],d(259),[56]],11025:[u,d(268),[3,127,248],d(268),[6,255,240],d(268),[13,255,224],d(268),[27,255,192],d(268),[55,175,128],d(108),[112]],8e3:[u,d(268),[3,121,16],d(47),[7]]}).reduce(function(t,i){return t[i]=new Uint8Array(e[i].reduce(function(e,t){return e.concat(t)},[])),t},{})}return tn},v=function(e){var t,i=0;for(t=0;t<e.length;t++)i+=e[t].data.byteLength;return i},_=function(e){for(var t=0,i={payloadType:-1,payloadSize:0},r=0,n=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)r+=255,t++;for(r+=e[t++];255===e[t];)n+=255,t++;if(n+=e[t++],!i.payload&&4===r){if("GA94"===String.fromCharCode(e[t+3],e[t+4],e[t+5],e[t+6])){i.payloadType=r,i.payloadSize=n,i.payload=e.subarray(t,t+n);break}i.payload=void 0}t+=n,r=0,n=0}return i},b=function(e){return 181!==e.payload[0]||(e.payload[1]<<8|e.payload[2])!=49||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},T=function(e,t){var i,r,n,s,a=[];if(!(64&t[0]))return a;for(i=0,r=31&t[0];i<r;i++)s={type:3&t[(n=3*i)+2],pts:e},4&t[n+2]&&(s.ccData=t[n+3]<<8|t[n+4],a.push(s));return a},w=function(e){for(var t,i,r=e.byteLength,n=[],s=1;s<r-2;)0===e[s]&&0===e[s+1]&&3===e[s+2]?(n.push(s+2),s+=2):s++;if(0===n.length)return e;i=new Uint8Array(t=r-n.length);var a=0;for(s=0;s<t;a++,s++)a===n[0]&&(a++,n.shift()),i[s]=e[a];return i},S=4,E=function(e){e=e||{},E.prototype.init.call(this),this.parse708captions_="boolean"!=typeof e.parse708captions||e.parse708captions,this.captionPackets_=[],this.ccStreams_=[new M(0,0),new M(0,1),new M(1,0),new M(1,1)],this.parse708captions_&&(this.cc708Stream_=new A({captionServices:e.captionServices})),this.reset(),this.ccStreams_.forEach(function(e){e.on("data",this.trigger.bind(this,"data")),e.on("partialdone",this.trigger.bind(this,"partialdone")),e.on("done",this.trigger.bind(this,"done"))},this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};E.prototype=new r,E.prototype.push=function(e){var t,i,r;
61if("sei_rbsp"===e.nalUnitType&&(t=_(e.escapedRBSP)).payload&&t.payloadType===S&&(i=b(t))){if(e.dts<this.latestDts_){this.ignoreNextEqualDts_=!0;return}if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1);return}r=T(e.pts,i),this.captionPackets_=this.captionPackets_.concat(r),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},E.prototype.flushCCStreams=function(e){this.ccStreams_.forEach(function(t){return"flush"===e?t.flush():t.partialFlush()},this)},E.prototype.flushStream=function(e){if(!this.captionPackets_.length)return void this.flushCCStreams(e);this.captionPackets_.forEach(function(e,t){e.presortIndex=t}),this.captionPackets_.sort(function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts}),this.captionPackets_.forEach(function(e){e.type<2?this.dispatchCea608Packet(e):this.dispatchCea708Packet(e)},this),this.captionPackets_.length=0,this.flushCCStreams(e)},E.prototype.flush=function(){return this.flushStream("flush")},E.prototype.partialFlush=function(){return this.flushStream("partialFlush")},E.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(e){e.reset()})},E.prototype.dispatchCea608Packet=function(e){this.setsTextOrXDSActive(e)?this.activeCea608Channel_[e.type]=null:this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},E.prototype.setsChannel1Active=function(e){return(30720&e.ccData)==4096},E.prototype.setsChannel2Active=function(e){return(30720&e.ccData)==6144},E.prototype.setsTextOrXDSActive=function(e){return(28928&e.ccData)==256||(30974&e.ccData)==4138||(30974&e.ccData)==6186},E.prototype.dispatchCea708Packet=function(e){this.parse708captions_&&this.cc708Stream_.push(e)};var C={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},k=function(e){var t=C[e]||e;return 4096&e&&e===t?"":String.fromCharCode(t)},x=function(e){return 32<=e&&e<=127||160<=e&&e<=255},D=function(e){this.windowNum=e,this.reset()};D.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},D.prototype.getText=function(){return this.rows.join("\n")},D.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},D.prototype.newLine=function(e){for(this.rows.length>=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},D.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},D.prototype.addText=function(e){this.rows[this.rowIdx]+=e},D.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var I=function(e,t,i){this.serviceNum=e,this.text="",this.currentWindow=new D(-1),this.windows=[],this.stream=i,"string"==typeof t&&this.createTextDecoder(t)};I.prototype.init=function(e,t){this.startPts=e;for(var i=0;i<8;i++)this.windows[i]=new D(i),"function"==typeof t&&(this.windows[i].beforeRowOverflow=t)},I.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]},I.prototype.createTextDecoder=function(e){if("undefined"==typeof TextDecoder)this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(e)}catch(t){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+e+" encoding. "+t})}};var A=function(e){e=e||{},A.prototype.init.call(this);var t,i=this,r=e.captionServices||{},n={};
61Object.keys(r).forEach(e=>{t=r[e],/^SERVICE/.test(e)&&(n[e]=t.encoding)}),this.serviceEncodings=n,this.current708Packet=null,this.services={},this.push=function(e){3===e.type?i.new708Packet():null===i.current708Packet&&i.new708Packet(),i.add708Bytes(e)}};A.prototype=new r,A.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},A.prototype.add708Bytes=function(e){var t=e.ccData;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(t>>>8),this.current708Packet.data.push(255&t)},A.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,i=null,r=null,n=0,s=t[n++];for(e.seq=s>>6,e.sizeCode=63&s;n<t.length;n++)i=(s=t[n++])>>5,r=31&s,7===i&&r>0&&(i=s=t[n++]),this.pushServiceBlock(i,n,r),r>0&&(n+=r-1)},A.prototype.pushServiceBlock=function(e,t,i){var r,n=t,s=this.current708Packet.data,a=this.services[e];for(a||(a=this.initService(e,n));n<t+i&&n<s.length;n++)x(r=s[n])?n=this.handleText(n,a):24===r?n=this.multiByteCharacter(n,a):16===r?n=this.extendedCommands(n,a):128<=r&&r<=135?n=this.setCurrentWindow(n,a):152<=r&&r<=159?n=this.defineWindow(n,a):136===r?n=this.clearWindows(n,a):140===r?n=this.deleteWindows(n,a):137===r?n=this.displayWindows(n,a):138===r?n=this.hideWindows(n,a):139===r?n=this.toggleWindows(n,a):151===r?n=this.setWindowAttributes(n,a):144===r?n=this.setPenAttributes(n,a):145===r?n=this.setPenColor(n,a):146===r?n=this.setPenLocation(n,a):143===r?a=this.reset(n,a):8===r?a.currentWindow.backspace():12===r?a.currentWindow.clearText():13===r?a.currentWindow.pendingNewLine=!0:14===r?a.currentWindow.clearText():141===r&&n++},A.prototype.extendedCommands=function(e,t){return x(this.current708Packet.data[++e])&&(e=this.handleText(e,t,{isExtended:!0})),e},A.prototype.getPts=function(e){return this.current708Packet.ptsVals[Math.floor(e/2)]},A.prototype.initService=function(e,t){var i,r="SERVICE"+e,n=this;return r in this.serviceEncodings&&(i=this.serviceEncodings[r]),this.services[e]=new I(e,i,n),this.services[e].init(this.getPts(t),function(t){n.flushDisplayed(t,n.services[e])}),this.services[e]},A.prototype.handleText=function(e,t,i){var r,n,s=i&&i.isExtended,a=i&&i.isMultiByte,o=this.current708Packet.data,l=o[e],u=o[e+1],d=t.currentWindow;return a?(n=[l,u],e++):n=[l],r=t.textDecoder_&&!s?t.textDecoder_.decode(new Uint8Array(n)):a?String.fromCharCode(parseInt(n.map(e=>("0"+(255&e).toString(16)).slice(-2)).join(""),16)):k(4096*!!s|l),d.pendingNewLine&&!d.isEmpty()&&d.newLine(this.getPts(e)),d.pendingNewLine=!1,d.addText(r),e},A.prototype.multiByteCharacter=function(e,t){var i=this.current708Packet.data,r=i[e+1],n=i[e+2];return x(r)&&x(n)&&(e=this.handleText(++e,t,{isMultiByte:!0})),e},A.prototype.setCurrentWindow=function(e,t){var i=this.current708Packet.data[e];return t.setCurrentWindow(7&i),e},A.prototype.defineWindow=function(e,t){var i=this.current708Packet.data,r=i[e],n=7&r;t.setCurrentWindow(n);var s=t.currentWindow;return s.visible=(32&(r=i[++e]))>>5,s.rowLock=(16&r)>>4,s.columnLock=(8&r)>>3,s.priority=7&r,s.relativePositioning=(128&(r=i[++e]))>>7,s.anchorVertical=127&r,s.anchorHorizontal=r=i[++e],s.anchorPoint=(240&(r=i[++e]))>>4,s.rowCount=15&r,s.columnCount=63&(r=i[++e]),s.windowStyle=(56&(r=i[++e]))>>3,s.penStyle=7&r,s.virtualRowCount=s.rowCount+1,e},A.prototype.setWindowAttributes=function(e,t){var i=this.current708Packet.data,r=i[e],n=t.currentWindow.winAttr;return n.fillOpacity=(192&(r=i[++e]))>>6,n.fillRed=(48&r)>>4,n.fillGreen=(12&r)>>2,n.fillBlue=3&r,n.borderType=(192&(r=i[++e]))>>6,n.borderRed=(48&r)>>4,n.borderGreen=(12&r)>>2,n.borderBlue=3&r,r=i[++e],n.borderType+=(128&r)>>5,n.wordWrap=(64&r)>>6,n.printDirection=(48&r)>>4,n.scrollDirection=(12&r)>>2,n.justify=3&r,n.effectSpeed=(240&(r=i[++e]))>>4,n.effectDirection=(12&r)>>2,n.displayEffect=3&r,e},A.prototype.flushDisplayed=function(e,t){for(var i=[],r=0;r<8;r++)t.windows[r].visible&&!t.windows[r].isEmpty()&&i.push(t.windows[r].getText());t.endPts=e,t.text=i.join("\n\n"),this.pushCaption(t),t.startPts=e},A.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream
61:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts)},A.prototype.displayWindows=function(e,t){var i=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var n=0;n<8;n++)i&1<<n&&(t.windows[n].visible=1);return e},A.prototype.hideWindows=function(e,t){var i=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var n=0;n<8;n++)i&1<<n&&(t.windows[n].visible=0);return e},A.prototype.toggleWindows=function(e,t){var i=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var n=0;n<8;n++)i&1<<n&&(t.windows[n].visible^=1);return e},A.prototype.clearWindows=function(e,t){var i=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var n=0;n<8;n++)i&1<<n&&t.windows[n].clearText();return e},A.prototype.deleteWindows=function(e,t){var i=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var n=0;n<8;n++)i&1<<n&&t.windows[n].reset();return e},A.prototype.setPenAttributes=function(e,t){var i=this.current708Packet.data,r=i[e],n=t.currentWindow.penAttr;return n.textTag=(240&(r=i[++e]))>>4,n.offset=(12&r)>>2,n.penSize=3&r,n.italics=(128&(r=i[++e]))>>7,n.underline=(64&r)>>6,n.edgeType=(56&r)>>3,n.fontStyle=7&r,e},A.prototype.setPenColor=function(e,t){var i=this.current708Packet.data,r=i[e],n=t.currentWindow.penColor;return n.fgOpacity=(192&(r=i[++e]))>>6,n.fgRed=(48&r)>>4,n.fgGreen=(12&r)>>2,n.fgBlue=3&r,n.bgOpacity=(192&(r=i[++e]))>>6,n.bgRed=(48&r)>>4,n.bgGreen=(12&r)>>2,n.bgBlue=3&r,n.edgeRed=(48&(r=i[++e]))>>4,n.edgeGreen=(12&r)>>2,n.edgeBlue=3&r,e},A.prototype.setPenLocation=function(e,t){var i=this.current708Packet.data,r=i[e],n=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,n.row=15&i[++e],n.column=63&i[++e],e},A.prototype.reset=function(e,t){var i=this.getPts(e);return this.flushDisplayed(i,t),this.initService(t.serviceNum,e)};var O={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},L=function(e){return null===e?"":String.fromCharCode(e=O[e]||e)},P=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],N=function(){for(var e=[],t=15;t--;)e.push({text:"",indent:0,offset:0});return e},M=function(e,t){M.prototype.init.call(this),this.field_=e||0,this.dataChannel_=t||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(e){var t,i,r,n,s;if((t=32639&e.ccData)===this.lastControlCode_){this.lastControlCode_=null;return}if((61440&t)==4096?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),r=t>>>8,n=255&t,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(t===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(t===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=N();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=N();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=N()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(r,n))s=L((r=(3&r)<<8)|n),this[this.mode_](e.pts,s),this.column_++;else if(this.isExtCharacter(r,n))"popOn"===this.mode_?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),s=L((r=(3&r)<<8)|n),this[this.mode_](e.pts,s),this.column_++;else if(this.isMidRowCode(r,n))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,(14&n)==14&&this.addFormatting(e.pts,["i"]),(1&n)==1&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(r,n)){let e=3&n;this.nonDisplayed_[this.row_].offset=e,this.column_+=e}else if(this.isPAC(r,n)){var a=P.indexOf(7968&t);if("rollUp"===this.mode_&&(a-this.rollUpRows_+1<0&&(a=this.rollUpRows_-1),this.setRollUp(e.pts,a)),a!==this.row_&&a>=0&&a<=14&&(this.clearFormatting(e.pts),this.row_=a),1&n&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),(16&t)==16){let e=(14&t)>>1;this.column_=4*e,this.nonDisplayed_[this.row_].indent+=e}this.isColorPAC(n)&&(14&n)==14&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(r)&&(0===n&&(n=null),s=L(r)+L(n),this[this.mode_](e.pts,s),this.column_+=s.length)}};M.prototype=new r,M.prototype.flushDisplayed=function(e){let t=e=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+e+"."})},i=[];this.displayed_.forEach((e,r)=>{if(e&&e.text&&e.text.length){try{e.text=e.text.trim()}catch(e){t(r)}e.text.length&&i.push({text:e.text,line:r+1,position:10+Math.min(70,10*e.indent)+2.5*e.offset})}else null==e&&t(r)}),i.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,content:i,stream:this.name_})},M.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=N(),this.nonDisplayed_=N(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},M.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},M.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},M.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},M.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},M.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},M.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},M.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},M.prototype.isNormalChar=function(e){return e>=32&&e<=127},M.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=N(),this.displayed_=N()),void 0!==t&&t!==this.row_)for(var i=0;i<this.rollUpRows_;i++)this.displayed_[t-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]={text:"",indent:0,offset:0};void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},M.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var i=t.reduce(function(e,t){return e+"<"+t+">"},"");this[this.mode_](e,i)},M.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce(function(e,t){return e+"</"+t+">"},"");this.formatting_=[],this[this.mode_](e,t)}},M.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_].text;i+=t,this.nonDisplayed_[this.row_].text=i},M.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_].text;i+=t,this.displayed_[this.row_].text=i},M.prototype.shiftRowsUp_=function(){var e;
61for(e=0;e<this.topRow_;e++)this.displayed_[e]={text:"",indent:0,offset:0};for(e=this.row_+1;e<15;e++)this.displayed_[e]={text:"",indent:0,offset:0};for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]={text:"",indent:0,offset:0}},M.prototype.paintOn=function(e,t){var i=this.displayed_[this.row_].text;i+=t,this.displayed_[this.row_].text=i};var R=E,U=M,B=A,j={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},q="shared",F=function(e,t){var i=1;for(e>t&&(i=-1);Math.abs(t-e)>0x100000000;)e+=0x200000000*i;return e},H=function(e){var t,i;H.prototype.init.call(this),this.type_=e||q,this.push=function(e){if("metadata"===e.type)return void this.trigger("data",e);(this.type_===q||e.type===this.type_)&&(void 0===i&&(i=e.dts),e.dts=F(e.dts,i),e.pts=F(e.pts,i),t=e.dts,this.trigger("data",e))},this.flush=function(){i=t,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){i=void 0,t=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};H.prototype=new r;var z=(e,t,i)=>{if(!e)return -1;for(var r=i;r<e.length;r++)if(e[r]===t)return r;return -1},V=function(e,t,i){var r,n="";for(r=t;r<i;r++)n+="%"+("00"+e[r].toString(16)).slice(-2);return n},W=function(e,t,i){return decodeURIComponent(V(e,t,i))},G=function(e,t,i){return unescape(V(e,t,i))},X=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},Y={APIC:function(e){var t,i,r=1;!(3!==e.data[0]||(t=z(e.data,0,r))<0)&&(e.mimeType=G(e.data,r,t),r=t+1,e.pictureType=e.data[r],r++,(i=z(e.data,0,r))<0||(e.description=W(e.data,r,i),r=i+1,"--\x3e"===e.mimeType?e.url=G(e.data,r,e.data.length):e.pictureData=e.data.subarray(r,e.data.length)))},"T*":function(e){3===e.data[0]&&(e.value=W(e.data,1,e.data.length).replace(/\0*$/,""),e.values=e.value.split("\0"))},TXXX:function(e){var t;3===e.data[0]&&-1!==(t=z(e.data,0,1))&&(e.description=W(e.data,1,t),e.value=W(e.data,t+1,e.data.length).replace(/\0*$/,""),e.data=e.value)},"W*":function(e){e.url=G(e.data,0,e.data.length).replace(/\0.*$/,"")},WXXX:function(e){var t;3===e.data[0]&&-1!==(t=z(e.data,0,1))&&(e.description=W(e.data,1,t),e.url=G(e.data,t+1,e.data.length).replace(/\0.*$/,""))},PRIV:function(e){var t;for(t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=G(e.data,0,t);break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}},K=function(e){var t,i=10,r=0,n=[];if(!(e.length<10)&&73===e[0]&&68===e[1]&&51===e[2]){r=X(e.subarray(6,10))+10,64&e[5]&&(i+=4,i+=X(e.subarray(10,14)),r-=X(e.subarray(16,20)));do{if((t=X(e.subarray(i+4,i+8)))<1)break;var s={id:String.fromCharCode(e[i],e[i+1],e[i+2],e[i+3]),data:e.subarray(i+10,i+t+10)};s.key=s.id,Y[s.id]?Y[s.id](s):"T"===s.id[0]?Y["T*"](s):"W"===s.id[0]&&Y["W*"](s),n.push(s),i+=10,i+=t}while(i<r);return n}},Q=X,J=Y;(tu=function(e){var t,i={descriptor:e&&e.descriptor},r=0,n=[],s=0;if(tu.prototype.init.call(this),this.dispatchType=j.METADATA_STREAM_TYPE.toString(16),i.descriptor)for(t=0;t<i.descriptor.length;t++)this.dispatchType+=("00"+i.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,i,a,o,l;if("timed-metadata"===e.type){if(e.dataAlignmentIndicator&&(s=0,n.length=0),0===n.length&&(e.data.length<10||73!==e.data[0]||68!==e.data[1]||51!==e.data[2]))return void this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});if(n.push(e),s+=e.data.byteLength,1===n.length&&(r=Q(e.data.subarray(6,10))+10),!(s<r)){for(l=0,t={data:new Uint8Array(r),frames:[],pts:n[0].pts,dts:n[0].dts};l<r;)t.data.set(n[0].data.subarray(0,r-l),l),l+=n[0].data.byteLength,s-=n[0].data.byteLength,n.shift();i=10,64&t.data[5]&&(i+=4,i+=Q(t.data.subarray(10,14)),r-=Q(t.data.subarray(16,20)));do{if((a=Q(t.data.subarray(i+4,i+8)))<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if((o={id:String.fromCharCode(t.data[i],t.data[i+1],t.data[i+2],t.data[i+3]),data:t.data.subarray(i+10,i+a+10)}).key=o.id,J[o.id]?J[o.id](o):"T"===o.id[0]?J["T*"](o):"W"===o.id[0]&&J["W*"](o),"com.apple.streaming.transportStreamTimestamp"===o.owner){var u=o.data,d=(1&u[3])<<30|u[4]<<22|u[5]<<14|u[6]<<6|u[7]>>>2;d*=4,o.timeStamp=d+=3&u[7],void 0===t.pts&&void 0===t.dts&&(t.pts=o.timeStamp,t.dts=o.timeStamp),this.trigger("timestamp",o)}t.frames.push(o),i+=10,i+=a}while(i<r);this.trigger("data",t)}}}}).prototype=new r;var Z=tu;(td=function(){var e=new Uint8Array(188),t=0;td.prototype.init.call(this),this.push=function(i){var r,n=0,s=188;for(t?((r=new Uint8Array(i.byteLength+t)).set(e.subarray(0,t)),r.set(i,t),t=0):r=i;s<r.byteLength;){if(71===r[n]&&71===r[s]){this.trigger("data",r.subarray(n,s)),n+=188,s+=188;continue}n++,s++}n<r.byteLength&&(e.set(r.subarray(n),0),t=r.byteLength-n)},this.flush=function(){188===t&&71===e[0]&&(this.trigger("data",e),t=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){t=0,this.trigger("reset")}}).prototype=new r,(tc=function(){var e,t,i,r;tc.prototype.init.call(this),r=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,r){var n=0;r.payloadUnitStartIndicator&&(n+=e[n]+1),"pat"===r.type?t(e.subarray(n),r):i(e.subarray(n),r)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],r.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=r.pmtPid},i=function(e,t){var i,n;if(1&e[5]){for(r.programMapTable={video:null,audio:null,"timed-metadata":{}},i=3+((15&e[1])<<8|e[2])-4,n=12+((15&e[10])<<8|e[11]);n<i;){var s=e[n],a=(31&e[n+1])<<8|e[n+2];s===j.H264_STREAM_TYPE&&null===r.programMapTable.video?r.programMapTable.video=a:s===j.ADTS_STREAM_TYPE&&null===r.programMapTable.audio?r.programMapTable.audio=a:s===j.METADATA_STREAM_TYPE&&(r.programMapTable["timed-metadata"][a]=s),n+=((15&e[n+3])<<8|e[n+4])+5}t.programMapTable=r.programMapTable}},this.push=function(t){var i={},r=4;if(i.payloadUnitStartIndicator=!!(64&t[1]),i.pid=31&t[1],i.pid<<=8,i.pid|=t[2],(48&t[3])>>>4>1&&(r+=t[r]+1),0===i.pid)i.type="pat",e(t.subarray(r),i),this.trigger("data",i);else if(i.pid===this.pmtPid)for(i.type="pmt",e(t.subarray(r),i),this.trigger("data",i);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());
61else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,r,i]):this.processPes_(t,r,i)},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=j.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=j.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}}).prototype=new r,tc.STREAM_TYPES={h264:27,adts:15},(th=function(){var e,t=this,i=!1,r={data:[],size:0},n={data:[],size:0},s={data:[],size:0},a=function(e,t){var i;let r=e[0]<<16|e[1]<<8|e[2];t.data=new Uint8Array,1===r&&(t.packetLength=6+(e[4]<<8|e[5]),t.dataAlignmentIndicator=(4&e[6])!=0,192&(i=e[7])&&(t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&i&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1)),t.data=e.subarray(9+e[8]))},o=function(e,i,r){var n,s=new Uint8Array(e.size),o={type:i},l=0,u=0,d=!1;if(e.data.length&&!(e.size<9)){for(l=0,o.trackId=e.data[0].pid;l<e.data.length;l++)n=e.data[l],s.set(n.data,u),u+=n.data.byteLength;a(s,o),d="video"===i||o.packetLength<=e.size,(r||d)&&(e.size=0,e.data.length=0),d&&t.trigger("data",o)}};th.prototype.init.call(this),this.push=function(a){({pat:function(){},pes:function(){var e,t;switch(a.streamType){case j.H264_STREAM_TYPE:e=r,t="video";break;case j.ADTS_STREAM_TYPE:e=n,t="audio";break;case j.METADATA_STREAM_TYPE:e=s,t="timed-metadata";break;default:return}a.payloadUnitStartIndicator&&o(e,t,!0),e.data.push(a),e.size+=a.data.byteLength},pmt:function(){var r={type:"metadata",tracks:[]};null!==(e=a.programMapTable).video&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),i=!0,t.trigger("data",r)}})[a.type]()},this.reset=function(){r.size=0,r.data.length=0,n.size=0,n.data.length=0,this.trigger("reset")},this.flushStreams_=function(){o(r,"video"),o(n,"audio"),o(s,"timed-metadata")},this.flush=function(){if(!i&&e){var r={type:"metadata",tracks:[]};null!==e.video&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),t.trigger("data",r)}i=!1,this.flushStreams_(),this.trigger("done")}}).prototype=new r;var ee={PAT_PID:0,MP2T_PACKET_LENGTH:188,TransportPacketStream:td,TransportParseStream:tc,ElementaryStream:th,TimestampRolloverStream:H,CaptionStream:R,Cea608Stream:U,Cea708Stream:B,MetadataStream:Z};for(var et in j)j.hasOwnProperty(et)&&(ee[et]=j[et]);var ei=c,er=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];(tp=function(e){var t,i=0;tp.prototype.init.call(this),this.skipWarn_=function(e,t){this.trigger("log",{level:"warn",message:`adts ski
61ping bytes ${e} to ${t} in frame ${i} outside syncword`})},this.push=function(r){var n,s,a,o,l,u,d=0;if(e||(i=0),"audio"===r.type){for(t&&t.length?((t=new Uint8Array((o=t).byteLength+r.data.byteLength)).set(o),t.set(r.data,o.byteLength)):t=r.data;d+7<t.length;){if(255!==t[d]||(246&t[d+1])!=240){"number"!=typeof n&&(n=d),d++;continue}if("number"==typeof n&&(this.skipWarn_(n,d),n=null),a=(1&~t[d+1])*2,s=(3&t[d+3])<<11|t[d+4]<<3|(224&t[d+5])>>5,u=(l=((3&t[d+6])+1)*1024)*ei/er[(60&t[d+2])>>>2],t.byteLength-d<s)break;this.trigger("data",{pts:r.pts+i*u,dts:r.dts+i*u,sampleCount:l,audioobjecttype:(t[d+2]>>>6&3)+1,channelcount:(1&t[d+2])<<2|(192&t[d+3])>>>6,samplerate:er[(60&t[d+2])>>>2],samplingfrequencyindex:(60&t[d+2])>>>2,samplesize:16,data:t.subarray(d+7+a,d+s)}),i++,d+=s}"number"==typeof n&&(this.skipWarn_(n,d),n=null),t=t.subarray(d)}},this.flush=function(){i=0,this.trigger("done")},this.reset=function(){t=void 0,this.trigger("reset")},this.endTimeline=function(){t=void 0,this.trigger("endedtimeline")}}).prototype=new r;var en=tp,es=function(e){var t=e.byteLength,i=0,r=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+r},this.loadWord=function(){var n=e.byteLength-t,s=new Uint8Array(4),a=Math.min(4,t);if(0===a)throw Error("no bytes available");s.set(e.subarray(n,n+a)),i=new DataView(s.buffer).getUint32(0),r=8*a,t-=a},this.skipBits=function(e){var n;r>e||(e-=r,n=Math.floor(e/8),e-=8*n,t-=n,this.loadWord()),i<<=e,r-=e},this.readBits=function(e){var n=Math.min(r,e),s=i>>>32-n;return((r-=n)>0?i<<=n:t>0&&this.loadWord(),(n=e-n)>0)?s<<n|this.readBits(n):s},this.skipLeadingZeros=function(){var e;for(e=0;e<r;++e)if((i&0x80000000>>>e)!=0)return i<<=e,r-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};(tm=function(){var e,t,i=0;tm.prototype.init.call(this),this.push=function(r){t?((n=new Uint8Array(t.byteLength+r.data.byteLength)).set(t),n.set(r.data,t.byteLength),t=n):t=r.data;for(var n,s=t.byteLength;i<s-3;i++)if(1===t[i+2]){e=i+5;break}for(;e<s;)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}i+3!==e-2&&this.trigger("data",t.subarray(i+3,e-2));do e++;while(1!==t[e]&&e<s);i=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(i+3,e-2)),i=e-2,e+=3;break;default:e+=3}t=t.subarray(i),e-=i,i=0},this.reset=function(){t=null,i=0,this.trigger("reset")},this.flush=function(){t&&t.byteLength>3&&this.trigger("data",t.subarray(i+3)),t=null,i=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}}).prototype=new r,tg={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},(tf=function(){var e,t,i,r,n,s,a,o=new tm;tf.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,i=e.pts,r=e.dts,o.push(e))},o.on("data",function(a){var o={trackId:t,pts:i,dts:r,data:a,nalUnitTypeCode:31&a[0]};switch(o.nalUnitTypeCode){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=n(a.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=n(a.subarray(1)),o.config=s(o.escapedRBSP);break;case 8:o.nalUnitType="pic_parameter_set_rbsp";break;case 9:o.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",o)}),o.on("done",function(){e.trigger("done")}),o.on("partialdone",function(){e.trigger("partialdone")}),o.on("reset",function(){e.trigger("reset")}),o.on("endedtimeline",function(){e.trigger("endedtimeline")}),this.flush=function(){o.flush()},this.partialFlush=function(){o.partialFlush()},this.reset=function(){o.reset()},this.endTimeline=function(){o.endTimeline()},a=function(e,t){var i,r=8,n=8;for(i=0;i<e;i++)0!==n&&(n=(r+t.readExpGolomb()+256)%256),r=0===n?r:n},n=function(e){for(var t,i,r=e.byteLength,n=[],s=1;s<r-2;)0===e[s]&&0===e[s+1]&&3===e[s+2]?(n.push(s+2),s+=2):s++;if(0===n.length)return e;i=new Uint8Array(t=r-n.length);var a=0;for(s=0;s<t;a++,s++)a===n[0]&&(a++,n.shift()),i[s]=e[a];return i},s=function(e){var t,i,r,n,s,o,l,u,d,c,h,p,f=0,m=0,g=0,y=0,v=[1,1];if(i=(t=new es(e)).readUnsignedByte(),n=t.readUnsignedByte(),r=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),tg[i]&&(3===(s=t.readUnsignedExpGolomb())&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(p=0,h=3!==s?8:12;p<h;p++)t.readBoolean()&&(p<6?a(16,t):a(64,t));if(t.skipUnsignedExpGolomb(),0===(o=t.readUnsignedExpGolomb()))t.readUnsignedExpGolomb();else if(1===o)for(t.skipBits(1),t.skipExpGolomb(),t.skipExpGolomb(),l=t.readUnsignedExpGolomb(),p=0;p<l;p++)t.skipExpGolomb();if(t.skipUnsignedExpGolomb(),t.skipBits(1),u=t.readUnsignedExpGolomb(),d=t.readUnsignedExpGolomb(),0===(c=t.readBits(1))&&t.skipBits(1),t.skipBits(1),t.readBoolean()&&(f=t.readUnsignedExpGolomb(),m=t.readUnsignedExpGolomb(),g=t.readUnsignedExpGolomb(),y=t.readUnsignedExpGolomb()),t.readBoolean()&&t.readBoolean()){switch(t.readUnsignedByte()){case 1:v=[1,1];break;case 2:v=[12,11];break;case 3:v=[10,11];break;case 4:v=[16,11];break;case 5:v=[40,33];break;case 6:v=[24,11];break;case 7:v=[20,11];break;case 8:v=[32,11];break;case 9:v=[80,33];break;case 10:v=[18,11];break;case 11:v=[15,11];break;case 12:v=[64,33];break;case 13:v=[160,99];break;case 14:v=[4,3];break;case 15:v=[3,2];break;case 16:v=[2,1];break;case 255:v=[t.readUnsignedByte()<<8|t.readUnsignedByte(),t.readUnsignedByte()<<8|t.readUnsignedByte()]}v&&(v[0],v[1])}return{profileIdc:i,levelIdc:r,profileCompatibility:n,width:(u+1)*16-2*f-2*m,height:(2-c)*(d+1)*16-2*g-2*y,sarRatio:v}}}).prototype=new r;
61var ea=tf,eo=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],el=function(e,t){var i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(i=i>=0?i:0,(16&e[t+5])>>4)?i+20:i+10},eu=function(e,t){return e.length-t<10||73!==e[t]||68!==e[t+1]||51!==e[t+2]?t:(t+=el(e,t),eu(e,t))},ed=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},ec=function(e,t,i){var r,n="";for(r=t;r<i;r++)n+="%"+("00"+e[r].toString(16)).slice(-2);return n},eh={isLikelyAacData:function(e){var t=eu(e,0);return e.length>=t+2&&(255&e[t])==255&&(240&e[t+1])==240&&(22&e[t+1])==16},parseId3TagSize:el,parseAdtsSize:function(e,t){var i=(224&e[t+5])>>5,r=e[t+4]<<3;return 6144&e[t+3]|r|i},parseType:function(e,t){return 73===e[t]&&68===e[t+1]&&51===e[t+2]?"timed-metadata":!0&e[t]&&(240&e[t+1])==240?"audio":null},parseSampleRate:function(e){for(var t=0;t+5<e.length;){if(255!==e[t]||(246&e[t+1])!=240){t++;continue}return eo[(60&e[t+2])>>>2]}return null},parseAacTimestamp:function(e){var t,i,r;t=10,64&e[5]&&(t+=4,t+=ed(e.subarray(10,14)));do{if((i=ed(e.subarray(t+4,t+8)))<1)break;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){r=e.subarray(t+10,t+i+10);for(var n=0;n<r.byteLength;n++)if(0===r[n]){if("com.apple.streaming.transportStreamTimestamp"===unescape(ec(r,0,n))){var s=r.subarray(n+1),a=(1&s[3])<<30|s[4]<<22|s[5]<<14|s[6]<<6|s[7]>>>2;return a*=4,a+=3&s[7]}break}}t+=10,t+=i}while(t<e.byteLength);return null}};(ty=function(){var e=new Uint8Array,t=0;ty.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(i){var r,n,s,a=0,o=0;for(e.length?(s=e.length,(e=new Uint8Array(i.byteLength+s)).set(e.subarray(0,s)),e.set(i,s)):e=i;e.length-o>=3;){if(73===e[o]&&68===e[o+1]&&51===e[o+2]){if(e.length-o<10||(a=eh.parseId3TagSize(e,o),o+a>e.length))break;r={type:"timed-metadata",data:e.subarray(o,o+a)},this.trigger("data",r),o+=a;continue}if((255&e[o])==255&&(240&e[o+1])==240){if(e.length-o<7||(a=eh.parseAdtsSize(e,o),o+a>e.length))break;n={type:"audio",data:e.subarray(o,o+a),pts:t,dts:t},this.trigger("data",n),o+=a;continue}o++}e=e.length-o>0?e.subarray(o):new Uint8Array},this.reset=function(){e=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){e=new Uint8Array,this.trigger("endedtimeline")}}).prototype=new r;var ep=ty,ef=function(e){return eq(e2.mdat,e)},em=function(e,t){for(var i=[],r=t.length;r--;)i[r]=eZ(t[r]);return eq.apply(null,[e2.moof,eq(e2.mfhd,new Uint8Array([0,0,0,0,(0xff000000&e)>>24,(0xff0000&e)>>16,(65280&e)>>8,255&e]))].concat(i))},eg=function(e){var t,i=eq(e2.ftyp,e4,e8,e4,e3),r=eH(e);return(t=new Uint8Array(i.byteLength+r.byteLength)).set(i),t.set(r,i.byteLength),t},ey=function(e){var t,i,r=[],n=[];for(t=0,n.byteLength=0,n.nalCount=0,n.duration=0,r.byteLength=0;t<e.length;t++)"access_unit_delimiter_rbsp"===(i=e[t]).nalUnitType?(r.length&&(r.duration=i.dts-r.dts,n.byteLength+=r.byteLength,n.nalCount+=r.length,n.duration+=r.duration,n.push(r)),(r=[i]).byteLength=i.data.byteLength,r.pts=i.pts,r.dts=i.dts):("slice_layer_without_partitioning_rbsp_idr"===i.nalUnitType&&(r.keyFrame=!0),r.duration=i.dts-r.dts,r.byteLength+=i.data.byteLength,r.push(i));return n.length&&(!r.duration||r.duration<=0)&&(r.duration=n[n.length-1].duration),n.byteLength+=r.byteLength,n.nalCount+=r.length,n.duration+=r.duration,n.push(r),n},ev=function(e){var t,i,r=[],n=[];for(t=0,r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,n.byteLength=0,n.nalCount=0,n.duration=0,n.pts=e[0].pts,n.dts=e[0].dts;t<e.length;t++)(i=e[t]).keyFrame?(r.length&&(n.push(r),n.byteLength+=r.byteLength,n.nalCount+=r.nalCount,n.duration+=r.duration),(r=[i]).nalCount=i.length,r.byteLength=i.byteLength,r.pts=i.pts,r.dts=i.dts,r.duration=i.duration):(r.duration+=i.duration,r.nalCount+=i.length,r.byteLength+=i.byteLength,r.push(i));return n.length&&r.duration<=0&&(r.duration=n[n.length-1].duration),n.byteLength+=r.byteLength,n.nalCount+=r.nalCount,n.duration+=r.duration,n.push(r),n},e_=function(e){var t;return!e[0][0].keyFrame&&e.length>1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},eb=function(e,t){var i,r,n,s,a=t||0,l=[];for(i=0;i<e.length;i++)for(r=0,s=e[i];r<s.length;r++)n=o(s[r],a),a+=n.size,l.push(n);return l},eT=function(e){var t,i,r,n,s,a,o=0,l=new Uint8Array(e.byteLength+4*e.nalCount),u=new DataView(l.buffer);for(t=0;t<e.length;t++)for(i=0,n=e[t];i<n.length;i++)for(r=0,s=n[i];r<s.length;r++)a=s[r],u.setUint32(o,a.data.byteLength),o+=4,l.set(a.data,o),o+=a.data.byteLength;return l},ew=function(e,t,i,r){var n,s,a,o,l=0,u=0,d=0;if(t.length&&(n=f(e.baseMediaDecodeTime,e.samplerate),l=Math.ceil(c/(e.samplerate/1024)),i&&r&&(d=(u=M
61ath.floor((n-Math.max(i,r))/l))*l),!(u<1)&&!(d>c/2))){for((s=y()[e.samplerate])||(s=t[0].data),a=0;a<u;a++)o=t[0],t.splice(0,0,{data:s,dts:o.dts-l,pts:o.pts-l});return e.baseMediaDecodeTime-=Math.floor(m(d,e.samplerate)),d}},eS=function(e){var t,i=[];for(t=0;t<e.length;t++)i.push({size:e[t].data.byteLength,duration:1024});return i},eE=function(e){var t,i,r=0,n=new Uint8Array(v(e));for(t=0;t<e.length;t++)i=e[t],n.set(i.data,r),r+=i.data.byteLength;return n},eC=function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},ek=function(e,t){var i,r=e.minSegmentDts;return t||(r-=e.timelineStartInfo.dts),i=Math.max(0,i=e.timelineStartInfo.baseMediaDecodeTime+r),"audio"===e.type&&(i*=e.samplerate/c,i=Math.floor(i)),i},ex=function(e,t){"number"==typeof t.pts&&(void 0===e.timelineStartInfo.pts&&(e.timelineStartInfo.pts=t.pts),void 0===e.minSegmentPts?e.minSegmentPts=t.pts:e.minSegmentPts=Math.min(e.minSegmentPts,t.pts),void 0===e.maxSegmentPts?e.maxSegmentPts=t.pts:e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)),"number"==typeof t.dts&&(void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),void 0===e.minSegmentDts?e.minSegmentDts=t.dts:e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),void 0===e.maxSegmentDts?e.maxSegmentDts=t.dts:e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts))},eD=eh.isLikelyAacData,eI=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],eA=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],eO=function(e,t){t.stream=e,this.trigger("log",t)},eL=function(e,t){for(var i=Object.keys(t),r=0;r<i.length;r++){var n=i[r];"headOfPipeline"!==n&&t[n].on&&t[n].on("log",eO.bind(e,n))}},eP=function(e,t){var i;if(e.length!==t.length)return!1;for(i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0},eN=function(e,t,i,r,n,s){return{start:{dts:e,pts:e+(i-t)},end:{dts:e+(r-t),pts:e+(n-i)},prependedContentDuration:s,baseMediaDecodeTime:e}};(t_=function(e,t){var i,r=[],n=0,s=0,a=1/0;i=(t=t||{}).firstSequenceNumber||0,t_.prototype.init.call(this),this.push=function(t){ex(e,t),e&&eI.forEach(function(i){e[i]=t[i]}),r.push(t)},this.setEarliestDts=function(e){n=e},this.setVideoBaseMediaDecodeTime=function(e){a=e},this.setAudioAppendStart=function(e){s=e},this.flush=function(){var o,l,u,d,h,p,m,g,y,v;if(0===r.length)return void this.trigger("done","AudioSegmentStream");g=r,y=e,v=n,o=y.minSegmentDts>=v?g:(y.minSegmentDts=1/0,g.filter(function(e){return e.dts>=v&&(y.minSegmentDts=Math.min(y.minSegmentDts,e.dts),y.minSegmentPts=y.minSegmentDts,!0)})),e.baseMediaDecodeTime=ek(e,t.keepOriginalTimestamps),m=ew(e,o,s,a),e.samples=eS(o),u=ef(eE(o)),r=[],d=new Uint8Array((l=em(i,[e])).byteLength+u.byteLength),i++,d.set(l),d.set(u,l.byteLength),eC(e),h=Math.ceil(1024*c/e.samplerate),o.length&&(p=o.length*h,this.trigger("segmentTimingInfo",eN(f(e.baseMediaDecodeTime,e.samplerate),o[0].dts,o[0].pts,o[0].dts+p,o[0].pts+p,m||0)),this.trigger("timingInfo",{start:o[0].pts,end:o[0].pts+p})),this.trigger("data",{track:e,boxes:d}),this.trigger("done","AudioSegmentStream")},this.reset=function(){eC(e),r=[],this.trigger("reset")}}).prototype=new r,(tv=function(e,t){var i,r,n,s=[],a=[];i=(t=t||{}).firstSequenceNumber||0,tv.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){ex(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||r||(r=t.config,e.sps=[t.data],eA.forEach(function(t){e[t]=r[t]},this)),"pic_parameter_set_rbsp"!==t.nalUnitType||n||(n=t.data,e.pps=[t.data]),s.push(t)},this.flush=function(){for(var r,n,o,l,u,d,c,h,p=0;s.length&&"access_unit_delimiter_rbsp"!==s[0].nalUnitType;)s.shift();if(0===s.length){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if((o=ev(ey(s)))[0][0].keyFrame||((n=this.getGopForFusion_(s[0],e))?(p=n.duration,o.unshift(n),o.byteLength+=n.byteLength,o.nalCount+=n.nalCount,o.pts=n.pts,o.dts=n.dts,o.duration+=n.duration):o=e_(o)),a.length){if(!(r=t.alignGopsAtEnd?this.alignGopsAtEnd_(o):this.alignGopsAtStart_(o))){this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),s=[],this.resetStream_
61(),this.trigger("done","VideoSegmentStream");return}eC(e),o=r}ex(e,o),e.samples=eb(o),u=ef(eT(o)),e.baseMediaDecodeTime=ek(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",o.map(function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}})),c=o[0],h=o[o.length-1],this.trigger("segmentTimingInfo",eN(e.baseMediaDecodeTime,c.dts,c.pts,h.dts+h.duration,h.pts+h.duration,p)),this.trigger("timingInfo",{start:o[0].pts,end:o[o.length-1].pts+o[o.length-1].duration}),this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),s=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),d=new Uint8Array((l=em(i,[e])).byteLength+u.byteLength),i++,d.set(l),d.set(u,l.byteLength),this.trigger("data",{track:e,boxes:d}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),s=[],this.gopCache_.length=0,a.length=0,this.trigger("reset")},this.resetStream_=function(){eC(e),r=void 0,n=void 0},this.getGopForFusion_=function(t){var i,r,n,s,a,o=1/0;for(a=0;a<this.gopCache_.length;a++)n=(s=this.gopCache_[a]).gop,e.pps&&eP(e.pps[0],s.pps[0])&&e.sps&&eP(e.sps[0],s.sps[0])&&!(n.dts<e.timelineStartInfo.dts)&&(i=t.dts-n.dts-n.duration)>=-1e4&&i<=45e3&&(!r||o>i)&&(r=s,o=i);return r?r.gop:null},this.alignGopsAtStart_=function(e){var t,i,r,n,s,o,l,u;for(s=e.byteLength,o=e.nalCount,l=e.duration,t=i=0;t<a.length&&i<e.length&&(r=a[t],n=e[i],r.pts!==n.pts);){if(n.pts>r.pts){t++;continue}i++,s-=n.byteLength,o-=n.nalCount,l-=n.duration}return 0===i?e:i===e.length?null:((u=e.slice(i)).byteLength=s,u.duration=l,u.nalCount=o,u.pts=u[0].pts,u.dts=u[0].dts,u)},this.alignGopsAtEnd_=function(e){for(t=a.length-1,i=e.length-1,s=null,o=!1;t>=0&&i>=0;){if(r=a[t],n=e[i],r.pts===n.pts){o=!0;break}if(r.pts>n.pts){t--;continue}t===a.length-1&&(s=i),i--}if(!o&&null===s)return null;if(0===(l=o?i:s))return e;var t,i,r,n,s,o,l,u=e.slice(l),d=u.reduce(function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e},{byteLength:0,duration:0,nalCount:0});return u.byteLength=d.byteLength,u.duration=d.duration,u.nalCount=d.nalCount,u.pts=u[0].pts,u.dts=u[0].dts,u},this.alignGopsWith=function(e){a=e}}).prototype=new r,(tT=function(e,t){this.numberOfTracks=0,this.metadataStream=t,void 0!==(e=e||{}).remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"==typeof e.keepOriginalTimestamps?this.keepOriginalTimestamps=e.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,tT.prototype.init.call(this),this.push=function(e){return e.content||e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):void(this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),"audio"===e.track.type&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes)))}}).prototype=new r,tT.prototype.flush=function(e){var t,i,r,n,s=0,a={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e)return;else if(this.remuxTracks)return;else if(0===this.pendingTracks.length){this.emittedTracks++,this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,eA.forEach(function(e){a.info[e]=this.videoTrack[e]},this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,eI.forEach(function(e){a.info[e]=this.audioTrack[e]},this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?a.type=this.pendingTracks[0].type:a.type="combined",this.emittedTracks+=this.pendingTracks.length,a.initSegment=new Uint8Array((r=eg(this.pendingTracks)).byteLength),a.initSegment.set(r),a.data=new Uint8Array(this.pendingBytes),n=0;n<this.pendingBoxes.length;n++)a.data.set(this.pendingBoxes[n],s),s+=this.pendingBoxes[n].byteLength;for(n=0;n<this.pendingCaptions.length;n++)(t=this.pendingCaptions[n]).startTime=g(t.startPts,o,this.keepOriginalTimestamps),t.endTime=g(t.endPts,o,this.keepOriginalTimestamps),a.captionStream
vendor: 6,926 bytes, line 61
61s[t.stream]=!0,a.captions.push(t);for(n=0;n<this.pendingMetadata.length;n++)(i=this.pendingMetadata[n]).cueTime=g(i.pts,o,this.keepOriginalTimestamps),a.metadata.push(i);for(a.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",a),n=0;n<a.captions.length;n++)t=a.captions[n],this.trigger("caption",t);for(n=0;n<a.metadata.length;n++)i=a.metadata[n],this.trigger("id3Frame",i)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},tT.prototype.setRemux=function(e){this.remuxTracks=e},(tb=function(e){var t,i,r=this,n=!0;tb.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var n={};this.transmuxPipeline_=n,n.type="aac",n.metadataStream=new ee.MetadataStream,n.aacStream=new ep,n.audioTimestampRolloverStream=new ee.TimestampRolloverStream("audio"),n.timedMetadataTimestampRolloverStream=new ee.TimestampRolloverStream("timed-metadata"),n.adtsStream=new en,n.coalesceStream=new tT(e,n.metadataStream),n.headOfPipeline=n.aacStream,n.aacStream.pipe(n.audioTimestampRolloverStream).pipe(n.adtsStream),n.aacStream.pipe(n.timedMetadataTimestampRolloverStream).pipe(n.metadataStream).pipe(n.coalesceStream),n.metadataStream.on("timestamp",function(e){n.aacStream.setTimestamp(e.timeStamp)}),n.aacStream.on("data",function(s){"timed-metadata"!==s.type&&"audio"!==s.type||n.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:r.baseMediaDecodeTime},codec:"adts",type:"audio"},n.coalesceStream.numberOfTracks++,n.audioSegmentStream=new t_(i,e),n.audioSegmentStream.on("log",r.getLogTrigger_("audioSegmentStream")),n.audioSegmentStream.on("timingInfo",r.trigger.bind(r,"audioTimingInfo")),n.adtsStream.pipe(n.audioSegmentStream).pipe(n.coalesceStream),r.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t}))}),n.coalesceStream.on("data",this.trigger.bind(this,"data")),n.coalesceStream.on("done",this.trigger.bind(this,"done")),eL(this,n)},this.setupTsPipeline=function(){var n={};this.transmuxPipeline_=n,n.type="ts",n.metadataStream=new ee.MetadataStream,n.packetStream=new ee.TransportPacketStream,n.parseStream=new ee.TransportParseStream,n.elementaryStream=new ee.ElementaryStream,n.timestampRolloverStream=new ee.TimestampRolloverStream,n.adtsStream=new en,n.h264Stream=new ea,n.captionStream=new ee.CaptionStream(e),n.coalesceStream=new tT(e,n.metadataStream),n.headOfPipeline=n.packetStream,n.packetStream.pipe(n.parseStream).pipe(n.elementaryStream).pipe(n.timestampRolloverStream),n.timestampRolloverStream.pipe(n.h264Stream),n.timestampRolloverStream.pipe(n.adtsStream),n.timestampRolloverStream.pipe(n.metadataStream).pipe(n.coalesceStream),n.h264Stream.pipe(n.captionStream).pipe(n.coalesceStream),n.elementaryStream.on("data",function(s){var a;if("metadata"===s.type){for(a=s.tracks.length;a--;)t||"video"!==s.tracks[a].type?i||"audio"!==s.tracks[a].type||((i=s.tracks[a]).timelineStartInfo.baseMediaDecodeTime=r.baseMediaDecodeTime):(t=s.tracks[a]).timelineStartInfo.baseMediaDecodeTime=r.baseMediaDecodeTime;t&&!n.videoSegmentStream&&(n.coalesceStream.numberOfTracks++,n.videoSegmentStream=new tv(t,e),n.videoSegmentStream.on("log",r.getLogTrigger_("videoSegmentStream")),n.videoSegmentStream.on("timelineStartInfo",function(t){i&&!e.keepOriginalTimestamps&&(i.timelineStartInfo=t,n.audioSegmentStream.setEarliestDts(t.dts-r.baseMediaDecodeTime))}),n.videoSegmentStream.on("processedGopsInfo",r.trigger.bind(r,"gopInfo")),n.videoSegmentStream.on("segmentTimingInfo",r.trigger.bind(r,"videoSegmentTimingInfo")),n.videoSegmentStream.on("baseMediaDecodeTime",function(e){i&&n.audioSegmentStream.setVideoBaseMediaDecodeTime(e)}),n.videoSegmentStream.on("timingInfo",r.trigger.bind(r,"videoTimingInfo")),n.h264Stream.pipe(n.videoSegmentStream).pipe(n.coalesceStream)),i&&!n.audioSegmentStream&&(n.coalesceStream.numberOfTracks++,n.audioSegmentStream=new t_(i,e),n.audioSegmentStream.on("log",r.getLogTrigger_("audioSegmentStream")),n.audioSegmentStream.on("timingInfo",r.trigger.bind(r,"audioTimingInfo")),n.audioSegmentStream.on("segmentTimingInfo",r.trigger.bind(r,"audioSegmentTimingInfo")),n.adtsStream.pipe(n.audioSegmentStream).pipe(n.coalesceStream)),r.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t})}}),n.coalesceStream.on("data",this.trigger.bind(this,"data")),n.coalesceStream.on("id3Frame",function(e){e.dispatchType=n.metadataStream.dispatchType,r.trigger("id3Frame",e)}),n.coalesceStream.on("caption",this.trigger.bind(this,"caption")),n.coalesceStream.on("done",this.trigger.bind(this,"done")),eL(this,n)},this.setBaseMediaDecodeTime=function(r){var n=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=r),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,eC(i),n.audioTimestampRolloverStream&&n.audioTimestampRolloverStream.discontinuity()),t&&(n.videoSegmentStream&&(n.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,eC(t),n.captionStream.reset()),n.timestampRolloverStream&&n.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.setRemux=function(t){var i=this.transmuxPipeline_;e.remux=t,i&&i.coalesceStream&&i.coalesceStream.setRemux(t)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.getLogTrigger_=function(e){var t=this;return function(i){i.stream=e,t.trigger("log",i)}},this.push=function(e){if(n){var t=eD(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),n=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){n=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}}).prototype=new r;var eM,eR,e$,eU,eB,ej,eq,eF,eH,ez,eV,eW,eG,eX,eY,eK,eQ,eJ,eZ,e0,e1,e2,e4,e8,e3,e5,e6,e7,e9,te,tt,ti,tr,tn,ts,ta,to,tl,tu,td,tc,th,tp,tf,tm,tg,ty,tv,t_,tb,tT,tw,tS,tE=tb,tC=function(e){return e>>>0},tk=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),t+=String.fromCharCode(e[2]),t+=String.fromCharCode(e[3])},tx=function(e,t){var i,r,n,s,a,o=[];if(!t.length)return null;for(i=0;i<e.byteLength;)r=tC(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3]),n=tk(e.subarray(i+4,i+8)),s=r>1?i+r:e.byteLength,n===t[0]&&(1===t.length?o.push(e.subarray(i+8,s)):(a=tx(e.subarray(i+8,s),t.slice(1))).length&&(o=o.c
vendor: 9,064 bytes, line 61
61oncat(a))),i=s;return o},tD=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4))};return 1===t.version?t.baseMediaDecodeTime=n(e.subarray(4)):t.baseMediaDecodeTime=tC(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),t},tI=function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:i.getUint32(4)},n=1&r.flags[2],s=2&r.flags[2],a=8&r.flags[2],o=16&r.flags[2],l=32&r.flags[2],u=65536&r.flags[0],d=131072&r.flags[0];return t=8,n&&(t+=4,r.baseDataOffset=i.getUint32(12),t+=4),s&&(r.sampleDescriptionIndex=i.getUint32(t),t+=4),a&&(r.defaultSampleDuration=i.getUint32(t),t+=4),o&&(r.defaultSampleSize=i.getUint32(t),t+=4),l&&(r.defaultSampleFlags=i.getUint32(t)),u&&(r.durationIsEmpty=!0),!n&&d&&(r.baseDataOffsetIsMoof=!0),r},tA=n,tO=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},tL=function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},r=new DataView(e.buffer,e.byteOffset,e.byteLength),n=1&i.flags[2],s=4&i.flags[2],a=1&i.flags[1],o=2&i.flags[1],l=4&i.flags[1],u=8&i.flags[1],d=r.getUint32(4),c=8;for(n&&(i.dataOffset=r.getInt32(c),c+=4),s&&d&&(t={flags:tO(e.subarray(c,c+4))},c+=4,a&&(t.duration=r.getUint32(c),c+=4),o&&(t.size=r.getUint32(c),c+=4),u&&(1===i.version?t.compositionTimeOffset=r.getInt32(c):t.compositionTimeOffset=r.getUint32(c),c+=4),i.samples.push(t),d--);d--;)t={},a&&(t.duration=r.getUint32(c),c+=4),o&&(t.size=r.getUint32(c),c+=4),l&&(t.flags=tO(e.subarray(c,c+4)),c+=4),u&&(1===i.version?t.compositionTimeOffset=r.getInt32(c):t.compositionTimeOffset=r.getUint32(c),c+=4),i.samples.push(t);return i},tP=n,tN=function(e){return new Date(1e3*e-20828448e5)},tM=function(e){var t,i,r=new DataView(e.buffer,e.byteOffset,e.byteLength),n=[];for(t=0;t+4<e.length;t+=i){if(i=r.getUint32(t),t+=4,i<=0){n.push("<span style='color:red;'>MALFORMED DATA</span>");continue}switch(31&e[t]){case 1:n.push("slice_layer_without_partitioning_rbsp");break;case 5:n.push("slice_layer_without_partitioning_rbsp_idr");break;case 6:n.push("sei_rbsp");break;case 7:n.push("seq_parameter_set_rbsp");break;case 8:n.push("pic_parameter_set_rbsp");break;case 9:n.push("access_unit_delimiter_rbsp");break;default:n.push("UNKNOWN NAL - "+e[t]&31)}}return n},tR={avc1:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{dataReferenceIndex:t.getUint16(6),width:t.getUint16(24),height:t.getUint16(26),horizresolution:t.getUint16(28)+t.getUint16(30)/16,vertresolution:t.getUint16(32)+t.getUint16(34)/16,frameCount:t.getUint16(40),depth:t.getUint16(74),config:tw(e.subarray(78,e.byteLength))}},avcC:function(e){var t,i,r,n,s=new DataView(e.buffer,e.byteOffset,e.byteLength),a={configurationVersion:e[0],avcProfileIndication:e[1],profileCompatibility:e[2],avcLevelIndication:e[3],lengthSizeMinusOne:3&e[4],sps:[],pps:[]},o=31&e[5];for(n=0,r=6;n<o;n++)i=s.getUint16(r),r+=2,a.sps.push(new Uint8Array(e.subarray(r,r+i))),r+=i;for(t=e[r],r++,n=0;n<t;n++)i=s.getUint16(r),r+=2,a.pps.push(new Uint8Array(e.subarray(r,r+i))),r+=i;return a},btrt:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{bufferSizeDB:t.getUint32(0),maxBitrate:t.getUint32(4),avgBitrate:t.getUint32(8)}},edts:function(e){return{boxes:tw(e)}},elst:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),r={version:i.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),edits:[]},n=i.getUint32(4);for(t=8;n;n--)0===r.version?(r.edits.push({segmentDuration:i.getUint32(t),mediaTime:i.getInt32(t+4),mediaRate:i.getUint16(t+8)+i.getUint16(t+10)/65536}),t+=12):(r.edits.push({segmentDuration:tP(e.subarray(t)),mediaTime:tP(e.subarray(t+8)),mediaRate:i.getUint16(t+16)+i.getUint16(t+18)/65536}),t+=20);return r},esds:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),esId:e[6]<<8|e[7],streamPriority:31&e[8],decoderConfig:{objectProfileIndication:e[11],streamType:e[12]>>>2&63,bufferSize:e[13]<<16|e[14]<<8|e[15],maxBitrate:e[16]<<24|e[17]<<16|e[18]<<8|e[19],avgBitrate:e[20]<<24|e[21]<<16|e[22]<<8|e[23],decoderConfigDescriptor:{tag:e[24],length:e[25],audioObjectType:e[26]>>>3&31,samplingFrequencyIndex:(7&e[26])<<1|e[27]>>>7&1,channelConfiguration:e[27]>>>3&15}}}},ftyp:function(e){for(var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={majorBrand:tk(e.subarray(0,4)),minorVersion:t.getUint32(4),compatibleBrands:[]},r=8;r<e.byteLength;)i.compatibleBrands.push(tk(e.subarray(r,r+4))),r+=4;return i},dinf:function(e){return{boxes:tw(e)}},dref:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),dataReferences:tw(e.subarray(8))}},hdlr:function(e){var t={version:new DataView(e.buffer,e.byteOffset,e.byteLength).getUint8(0),flags:new Uint8Array(e.subarray(1,4)),handlerType:tk(e.subarray(8,12)),name:""},i=8;for(i=24;i<e.byteLength;i++){if(0===e[i]){i++;break}t.name+=String.fromCharCode(e[i])}return t.name=decodeURIComponent(escape(t.name)),t},mdat:function(e){return{byteLength:e.byteLength,nals:tM(e)}},mdhd:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),r=4,n={version:i.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),language:""};return 1===n.version?(r+=4,n.creationTime=tN(i.getUint32(r)),r+=8,n.modificationTime=tN(i.getUint32(r)),r+=4,n.timescale=i.getUint32(r),r+=8):(n.creationTime=tN(i.getUint32(r)),r+=4,n.modificationTime=tN(i.getUint32(r)),r+=4,n.timescale=i.getUint32(r),r+=4),n.duration=i.getUint32(r),r+=4,t=i.getUint16(r),n.language+=String.fromCharCode((t>>10)+96),n.language+=String.fromCharCode(((992&t)>>5)+96),n.language+=String.fromCharCode((31&t)+96),n},mdia:function(e){return{boxes:tw(e)}},mfhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sequenceNumber:e[4]<<24|e[5]<<16|e[6]<<8|e[7]}},minf:function(e){return{boxes:tw(e)}},mp4a:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={dataReferenceIndex:t.getUint16(6),channelcount:t.getUint16(16),samplesize:t.getUint16(18),samplerate:t.getUint16(24)+t.getUint16(26)/65536};return e.byteLength>28&&(i.streamDescriptor=tw(e.subarray(28))[0]),i},moof:function(e){return{boxes:tw(e)}},moov:function(e){return{boxes:tw(e)}},mvex:function(e){return{boxes:tw(e)}},mvhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=4,r={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};return 1===r.version?(i+=4,r.creationTime=tN(t.getUint32(i)),i+=8,r.modificationTime=tN(t.getUint32(i)),i+=4,r.timescale=t.getUint32(i),i+=8):(r.creationTime=tN(t.getUint32(i)),i+=4,r.modificationTime=tN(t.getUint32(i)),i+=4,r.timescale=t.getUint32(i),i+=4),r.duration=t.getUint32(i),i+=4,r.rate=t.getUint16(i)+t.getUint16(i+2)/16,i+=4,r.volume=t.getUint8(i)+t.getUint8(i+1)/8,i+=12,r.matrix=new Uint32Array(e.subarray(i,i+36)),i+=60,r.nextTrackId=t.getUint32(i),r},pdin:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),rate:t.getUint32(4),initialDelay:t.getUint32(8)}},sdtp:function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]};for(t=4;t<e.byteLength;t++)i.samples.push({dependsOn:(48&e[t])>>4,isDependedOn:(12&e[t])>>2,hasRedundancy:3&e[t]});return i},sidx:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8)},r=12;0===i.version?(i.earliestPresentationTime=t.getUint32(r),i.firstOffset=t.getUint32(r+4),r+=8):(i.earliestPresentationTime=tA(e.subarray(r)),i.firstOffset=tA(e.subarray(r+8)),r+=16),r+=2;var n=t.getUint16(r);for(r+=2;n>0;r+=12,n--)i.references.push({referenceType:(128&e[r])>>>7,referencedSize:0x7fffffff&t.getUint32(r),subsegmentDuration:t.getUint32(r+4),startsWithSap:!!(128&e[r+8]),sapType:(112&e[r+8])>>>4,sapDeltaTime:0xfffffff&t.getUint32(r+8)});return i},smhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),balance:e[4]+e[5]/256}},stbl:function(e){return{boxes:tw(e)}},ctts:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),r={version:i.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),compositionOffsets:[]},n=i.getUint32(4);for(t=8;n;t+=8,n--)r.compositionOffsets.push({sampleCount:i.getUint32(t),sampleOffset:i[0===r.version?"getUint32":"getInt32"](t+4)});return r},stss:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),r={version:i.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),syncSamples:[]},n=i.getUint32(4);for(t=8;n;t+=4,n--)r.syncSamples.push(i.getUint32(t));return r},stco:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),chunkOffsets:[]},n=i.getUint32(4);for(t=8;n;t+=4,n--)r.chunkOffsets.push(i.getUint32(t));return r},stsc:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),r=i.getUint32(4),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleToChunks:[]};for(t=8;r;
61t+=12,r--)n.sampleToChunks.push({firstChunk:i.getUint32(t),samplesPerChunk:i.getUint32(t+4),sampleDescriptionIndex:i.getUint32(t+8)});return n},stsd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleDescriptions:tw(e.subarray(8))}},stsz:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleSize:i.getUint32(4),entries:[]};for(t=12;t<e.byteLength;t+=4)r.entries.push(i.getUint32(t));return r},stts:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),timeToSamples:[]},n=i.getUint32(4);for(t=8;n;t+=8,n--)r.timeToSamples.push({sampleCount:i.getUint32(t),sampleDelta:i.getUint32(t+4)});return r},styp:function(e){return tR.ftyp(e)},tfdt:tD,tfhd:tI,tkhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=4,r={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};return 1===r.version?(i+=4,r.creationTime=tN(t.getUint32(i)),i+=8,r.modificationTime=tN(t.getUint32(i)),i+=4,r.trackId=t.getUint32(i),i+=12):(r.creationTime=tN(t.getUint32(i)),i+=4,r.modificationTime=tN(t.getUint32(i)),i+=4,r.trackId=t.getUint32(i),i+=8),r.duration=t.getUint32(i),i+=12,r.layer=t.getUint16(i),i+=2,r.alternateGroup=t.getUint16(i),i+=2,r.volume=t.getUint8(i)+t.getUint8(i+1)/8,i+=4,r.matrix=new Uint32Array(e.subarray(i,i+36)),i+=36,r.width=t.getUint16(i)+t.getUint16(i+2)/65536,i+=4,r.height=t.getUint16(i)+t.getUint16(i+2)/65536,r},traf:function(e){return{boxes:tw(e)}},trak:function(e){return{boxes:tw(e)}},trex:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:t.getUint32(4),defaultSampleDescriptionIndex:t.getUint32(8),defaultSampleDuration:t.getUint32(12),defaultSampleSize:t.getUint32(16),sampleDependsOn:3&e[20],sampleIsDependedOn:(192&e[21])>>6,sampleHasRedundancy:(48&e[21])>>4,samplePaddingValue:(14&e[21])>>1,sampleIsDifferenceSample:!!(1&e[21]),sampleDegradationPriority:t.getUint16(22)}},trun:tL,"url ":function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4))}},vmhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),graphicsmode:t.getUint16(4),opcolor:new Uint16Array([t.getUint16(6),t.getUint16(8),t.getUint16(10)])}}},t$={inspect:tw=function(e){for(var t,i,r,n,s,a=0,o=[],l=new ArrayBuffer(e.length),u=new Uint8Array(l),d=0;d<e.length;++d)u[d]=e[d];for(t=new DataView(l);a<e.byteLength;)i=t.getUint32(a),r=tk(e.subarray(a+4,a+8)),n=i>1?a+i:e.byteLength,(s=(tR[r]||function(e){return{data:e}})(e.subarray(a+8,n))).size=i,s.type=r,o.push(s),a=n;return o},textify:tS=function(e,t){var i;return i=Array(2*(t=t||0)+1).join(" "),e.map(function(e,r){return i+e.type+"\n"+Object.keys(e).filter(function(e){return"type"!==e&&"boxes"!==e}).map(function(t){var r=i+"  "+t+": ",n=e[t];if(n instanceof Uint8Array||n instanceof Uint32Array){var s=Array.prototype.slice.call(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)).map(function(e){return" "+("00"+e.toString(16)).slice(-2)}).join("").match(/.{1,24}/g);return s?1===s.length?r+"<"+s.join("").slice(1)+">":r+"<\n"+s.map(function(e){return i+"  "+e}).join("\n")+"\n"+i+"  >":r+"<>"}return r+JSON.stringify(n,null,2).split("\n").map(function(e,t){return 0===t?e:i+"  "+e}).join("\n")}).join("\n")+(e.boxes?"\n"+tS(e.boxes,t+1):"")}).join("\n")},parseType:tk,findBox:tx,parseTraf:tR.traf,parseTfdt:tR.tfdt,parseHdlr:tR.hdlr,parseTfhd:tR.tfhd,parseTrun:tR.trun,parseSidx:tR.sidx},tU=function(e){for(var t=0,i=String.fromCharCode(e[0]),r="";"\0"!==i;)r+=i,i=String.fromCharCode(e[++t]);return r+i},tB=function(e,t){var i="\0"!==t.scheme_id_uri,r=0===e&&tj(t.presentation_time_delta)&&i,n=1===e&&tj(t.presentation_time)&&i;return!(e>1)&&r||n},tj=function(e){return void 0!==e||null!==e},tq="undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},tF=function(e){return("00"+e.toString(16)).slice(-2)},tH=function(e){var t,i,r,s,a,o,l,u=4,d=e[0];if(0===d){t=tU(e.subarray(u)),u+=t.length,i=tU(e.subarray(u)),u+=i.length;var c=new DataView(e.buffer);r=c.getUint32(u),u+=4,a=c.getUint32(u),u+=4,o=c.getUint32(u),u+=4,l=c.getUint32(u),u+=4}else if(1===d){var c=new DataView(e.buffer);r=c.getUint32(u),u+=4,s=n(e.subarray(u)),u+=8,o=c.getUint32(u),u+=4,l=c.getUint32(u),u+=4,t=tU(e.subarray(u)),u+=t.length,i=tU(e.subarray(u)),u+=i.length}var h={scheme_id_uri:t,value:i,timescale:r||1,presentation_time:s,presentation_time_delta:a,event_duration:o,id:l,message_data:new Uint8Array(e.subarray(u,e.byteLength))};return tB(d,h)?h:void 0},tz=function(e,t,i,r){return e||0===e?e/t:r+i/t},tV={findBox:tx,parseType:tk,timescale:function(e){return tx(e,["moov","trak"]).reduce(function(e,t){var i,r,n,s;return(i=tx(t,["tkhd"])[0])&&(r=0===i[0]?12:20,n=tC(i[r]<<24|i[r+1]<<16|i[r+2]<<8|i[r+3]),s=tx(t,["mdia","mdhd"])[0])?(r=0===s[0]?12:20,e[n]=tC(s[r]<<24|s[r+1]<<16|s[r+2]<<8|s[r+3]),e):null},{})},startTime:function(e,t){var i=tx(t,["moof","traf"]).reduce(function(t,i){let r;var s,a=tx(i,["tfhd"])[0],o=e[tC(a[4]<<24|a[5]<<16|a[6]<<8|a[7])]||9e4,l=tx(i,["tfdt"])[0],u=new DataView(l.buffer,l.byteOffset,l.byteLength);return"bigint"==typeof(s=1===l[0]?n(l.subarray(4,12)):u.getUint32(4))?r=s/tq.BigInt(o):"number"!=typeof s||isNaN(s)||(r=s/o),r<Number.MAX_SAFE_INTEGER&&(r=Number(r)),r<t&&(t=r),t},1/0);return"bigint"==typeof i||isFinite(i)?i:0},compositionStartTime:function(e,t){var i,r=tx(t,["moof","traf"]),n=0,s=0;if(r&&r.length){var a=tx(r[0],["tfhd"])[0],o=tx(r[0],["trun"])[0],l=tx(r[0],["tfdt"])[0];if(a&&(i=tI(a).trackId),l&&(n=tD(l).baseMediaDecodeTime),o){var u=tL(o);u.samples&&u.samples.length&&(s=u.samples[0].compositionTimeOffset||0)}}var d=e[i]||9e4;"bigint"==typeof n&&(s=tq.BigInt(s),d=tq.BigInt(d));var c=(n+s)/d;return"bigint"==typeof c&&c<Number.MAX_SAFE_INTEGER&&(c=Number(c)),c},videoTrackIds:function(e){var t=tx(e,["moov","trak"]),i=[];return t.forEach(function(e){var t=tx(e,["mdia","hdlr"]),r=tx(e,["tkhd"]);t.forEach(function(e,t){var n,s,a=tk(e.subarray(8,12)),o=r[t];"vide"===a&&(s=0===(n=new DataView(o.buffer,o.byteOffset,o.byteLength)).getUint8(0)?n.getUint32(12):n.getUint32(20),i.push(s))})}),i},tracks:function(t){var i=tx(t,["moov","trak"]),r=[];
61return i.forEach(function(t){var i={},n=tx(t,["tkhd"])[0];n&&(i.id=0===(l=new DataView(n.buffer,n.byteOffset,n.byteLength)).getUint8(0)?l.getUint32(12):l.getUint32(20));var s=tx(t,["mdia","hdlr"])[0];if(s){var a=tk(s.subarray(8,12));"vide"===a?i.type="video":"soun"===a?i.type="audio":i.type=a}var o=tx(t,["mdia","minf","stbl","stsd"])[0];if(o){var l,u,d=o.subarray(8);i.codec=tk(d.subarray(4,8));var c=tx(d,[i.codec])[0];c&&(/^[asm]vc[1-9]$/i.test(i.codec)?"avcC"===tk((u=c.subarray(78)).subarray(4,8))&&u.length>11?(i.codec+=".",i.codec+=tF(u[9]),i.codec+=tF(u[10]),i.codec+=tF(u[11])):i.codec="avc1.4d400d":/^mp4[a,v]$/i.test(i.codec)?"esds"===tk((u=c.subarray(28)).subarray(4,8))&&u.length>20&&0!==u[19]?(i.codec+="."+tF(u[19]),i.codec+="."+tF(u[20]>>>2&63).replace(/^0/,"")):i.codec="mp4a.40.2":i.codec=i.codec.toLowerCase())}var h=tx(t,["mdia","mdhd"])[0];h&&(i.timescale=e(h)),r.push(i)}),r},getTimescaleFromMediaHeader:e=function(e){var t=0===e[0]?12:20;return tC(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])},getEmsgID3:function(e,t=0){return tx(e,["emsg"]).map(e=>{var i=tH(new Uint8Array(e)),r=K(i.message_data);return{cueTime:tz(i.presentation_time,i.timescale,i.presentation_time_delta,t),duration:tz(i.event_duration,i.timescale),frames:r}})}};let{parseTrun:tW}=t$,{findBox:tG}=tV;var tX={getMdatTrafPairs:function(e){var t=tG(e,["moof","traf"]),i=tG(e,["mdat"]),r=[];return i.forEach(function(e,i){var n=t[i];r.push({mdat:e,traf:n})}),r},parseSamples:function(e,t,i){var r=t,n=i.defaultSampleDuration||0,s=i.defaultSampleSize||0,a=i.trackId,o=[];return e.forEach(function(e){var t=tW(e).samples;t.forEach(function(e){void 0===e.duration&&(e.duration=n),void 0===e.size&&(e.size=s),e.trackId=a,e.dts=r,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),"bigint"==typeof r?(e.pts=r+tq.BigInt(e.compositionTimeOffset),r+=tq.BigInt(e.duration)):(e.pts=r+e.compositionTimeOffset,r+=e.duration)}),o=o.concat(t)}),o}},tY=w,{getMdatTrafPairs:tK,parseSamples:tQ}=tX,tJ=function(e,t){for(var i=e,r=0;r<t.length;r++){var n=t[r];if(i<n.size)return n;i-=n.size}return null},tZ=function(e,t,i){var r,n,s,a,o=new DataView(e.buffer,e.byteOffset,e.byteLength),l={logs:[],seiNals:[]};for(n=0;n+4<e.length;n+=s)if(s=o.getUint32(n),n+=4,!(s<=0))switch(31&e[n]){case 6:var u=e.subarray(n+1,n+1+s),d=tJ(n,t);if(r={nalUnitType:"sei_rbsp",size:s,data:u,escapedRBSP:tY(u),trackId:i},d)r.pts=d.pts,r.dts=d.dts,a=d;else if(a)r.pts=a.pts,r.dts=a.dts;else{l.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+n+" for trackId "+i+". See mux.js#223."});break}l.seiNals.push(r)}return l},t0=function(e,t){var i={};return tK(e).forEach(function(e){var r,n=e.mdat,s=e.traf,a=tI(tx(s,["tfhd"])[0]),o=a.trackId,l=tx(s,["tfdt"]),u=l.length>0?tD(l[0]).baseMediaDecodeTime:0,d=tx(s,["trun"]);t===o&&d.length>0&&(r=tZ(n,tQ(d,u,a),o),i[o]||(i[o]={seiNals:[],logs:[]}),i[o].seiNals=i[o].seiNals.concat(r.seiNals),i[o].logs=i[o].logs.concat(r.logs))}),i},t1=function(e,t,i){if(null===t)return null;var r=t0(e,t)[t]||{};return{seiNals:r.seiNals,logs:r.logs,timescale:i}},t2=function(){var e,t,i,r,n,s,a=!1;this.isInitialized=function(){return a},this.init=function(t){e=new R,a=!0,s=!!t&&t.isPartial,e.on("data",function(e){e.startTime=e.startPts/r,e.endTime=e.endPts/r,n.captions.push(e),n.captionStreams[e.stream]=!0}),e.on("log",function(e){n.logs.push(e)})},this.isNewInit=function(e,t){return(!e||0!==e.length)&&(!t||"object"!=typeof t||0!==Object.keys(t).length)&&(i!==e[0]||r!==t[i])},this.parse=function(e,s,a){var o;if(!this.isInitialized()||!s||!a)return null;if(this.isNewInit(s,a))r=a[i=s[0]];else if(null===i||!r)return t.push(e),null;for(;t.length>0;){var l=t.shift();this.parse(l,s,a)}return((o=t1(e,i,r))&&o.logs&&(n.logs=n.logs.concat(o.logs)),null!==o&&o.seiNals)?(this.pushNals(o.seiNals),this.flushStream(),n):n.logs.length?{logs:n.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach(function(t){e.push(t)})},this.flushStream=function(){if(!this.isInitialized())return null;s?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){n.captions=[],n.captionStream
61s={},n.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],i=null,r=null,n?this.clearParsedCaptions():n={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()};let{parseTfdt:t4}=t$,{getTimescaleFromMediaHeader:t8}=tV,{parseSamples:t3,getMdatTrafPairs:t5}=tX;var t6=function(){let e=9e4;this.init=function(t){let i=tx(t,["moov","trak","mdia","mdhd"])[0];i&&(e=t8(i))},this.parseSegment=function(t){let i=[],r=t5(t),n=0;return r.forEach(function(t){let r=t.mdat,s=t.traf,a=tx(s,["tfdt"])[0],o=tx(s,["tfhd"])[0],l=tx(s,["trun"]);if(a&&(n=t4(a).baseMediaDecodeTime),l.length&&o){let t=t3(l,n,o),s=0;t.forEach(function(t){let n=new TextDecoder("utf-8"),a=r.slice(s,s+t.size);if(tx(a,["vtte"])[0]){s+=t.size;return}tx(a,["vttc"]).forEach(function(r){let s,a,o=tx(r,["payl"])[0],l=tx(r,["sttg"])[0],u=t.pts/e,d=(t.pts+t.duration)/e;if(o)try{s=n.decode(o)}catch(e){console.error(e)}if(l)try{a=n.decode(l)}catch(e){console.error(e)}t.duration&&s&&i.push({cueText:s,start:u,end:d,settings:a})}),s+=t.size})}}),i}},t7=function(e){var t=31&e[1];return t<<=8,t|=e[2]},t9=function(e){return!!(64&e[1])},ie=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},it=function(e){switch(e){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},ii={};ii.ts={parseType:function(e,t){var i=t7(e);return 0===i?"pat":i===t?"pmt":t?"pes":null},parsePat:function(e){var t=t9(e),i=4+ie(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},parsePmt:function(e){var t,i={},r=t9(e),n=4+ie(e);if(r&&(n+=e[n]+1),1&e[n+5]){t=3+((15&e[n+1])<<8|e[n+2])-4;for(var s=12+((15&e[n+10])<<8|e[n+11]);s<t;){var a=n+s;i[(31&e[a+1])<<8|e[a+2]]=e[a],s+=((15&e[a+3])<<8|e[a+4])+5}return i}},parsePayloadUnitStartIndicator:t9,parsePesType:function(e,t){switch(t[t7(e)]){case j.H264_STREAM_TYPE:return"video";case j.ADTS_STREAM_TYPE:return"audio";case j.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(e){if(!t9(e))return null;var t,i=4+ie(e);if(i>=e.byteLength)return null;var r=null;return 192&(t=e[i+7])&&((r={}).pts=(14&e[i+9])<<27|(255&e[i+10])<<20|(254&e[i+11])<<12|(255&e[i+12])<<5|(254&e[i+13])>>>3,r.pts*=4,r.pts+=(6&e[i+13])>>>1,r.dts=r.pts,64&t&&(r.dts=(14&e[i+14])<<27|(255&e[i+15])<<20|(254&e[i+16])<<12|(255&e[i+17])<<5|(254&e[i+18])>>>3,r.dts*=4,r.dts+=(6&e[i+18])>>>1)),r},videoPacketContainsKeyFrame:function(e){for(var t,i=4+ie(e),r=e.subarray(i),n=0,s=0,a=!1;s<r.byteLength-3;s++)if(1===r[s+2]){n=s+5;break}for(;n<r.byteLength;)switch(r[n]){case 0:if(0!==r[n-1]){n+=2;break}if(0!==r[n-2]){n++;break}s+3!==n-2&&"slice_layer_without_partitioning_rbsp_idr"===it(31&r[s+3])&&(a=!0);do n++;while(1!==r[n]&&n<r.length);s=n-2,n+=3;break;case 1:if(0!==r[n-1]||0!==r[n-2]){n+=3;break}"slice_layer_without_partitioning_rbsp_idr"===it(31&r[s+3])&&(a=!0),s=n-2,n+=3;break;default:n+=3}return r=r.subarray(s),n-=s,s=0,r&&r.byteLength>3&&"slice_layer_without_partitioning_rbsp_idr"===it(31&r[s+3])&&(a=!0),a}},ii.aac=eh;var ir=c,is=function(e,t){for(var i,r=0,n=188;n<e.byteLength;){if(71===e[r]&&71===e[n]){switch(i=e.subarray(r,n),ii.ts.parseType(i,t.pid)){case"pat":t.pid=ii.ts.parsePat(i);break;case"pmt":var s=ii.ts.parsePmt(i);t.table=t.table||{},Object.keys(s).forEach(function(e){t.table[e]=s[e]})}r+=188,n+=188;continue}r++,n++}},ia=function(e,t,i){for(var r,n,s,a,o,l=0,u=188,d=!1;u<=e.byteLength;){if(71===e[l]&&(71===e[u]||u===e.byteLength)){if(r=e.subarray(l,u),"pes"===ii.ts.parseType(r,t.pid)&&(s=ii.ts.parsePesType(r,t.table),a=ii.ts.parsePayloadUnitStartIndicator(r),"audio"===s&&a&&(o=ii.ts.parsePesTime(r))&&(o.type="audio",i.audio.push(o),d=!0)),d)break;l+=188,u+=188;continue}l++,u++}for(l=(u=e.byteLength)-188,d=!1;l>=0;){if(71===e[l]&&(71===e[u]||u===e.byteLength)){if(r=e.subarray(l,u),"pes"===ii.ts.parseType(r,t.pid)&&(s=ii.ts.parsePesType(r,t.table),a=ii.ts.parsePayloadUnitStartIndicator(r),"audio"===s&&a&&(o=ii.ts.parsePesTime(r))&&(o.type="audio",i.audio.push(o),d=!0)),d)break;l-=188,u-=188;continue}l--,u--}},io=function(e,t,i){for(var r,n,s,a,o,l,u,d,c=0,h=188,p=!1,f={data:[],size:0};h<e.byteLength;){if(71===e[c]&&71===e[h]){if(r=e.subarray(c,h),"pes"===ii.ts.parseType(r,t.pid)&&(s=ii.ts.parsePesType(r,t.table),a=ii.ts.parsePayloadUnitStartIndicator(r),"video"===s)&&(a&&!p&&(o=ii.ts.parsePesTime(r))&&(o.type="video",i.video.push(o),p=!0),!i.firstKeyFrame)){if(a&&0!==f.size){for(l=new Uint8Array(f.size),u=0;f.data.length;)d=f.data.shift(),l.set(d,u),u+=d.byteLength;if(ii.ts.videoPacketContainsKeyFrame(l)){var m=ii.ts.parsePesTime(l);m?(i.firstKeyFrame=m,i.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}f.size=0}f.data.push(r),f.size+=r.byteLength}if(p&&i.firstKeyFrame)break;c+=188,h+=188;continue}c++,h++}for(c=(h=e.byteLength)-188,p=!1;c>=0;){if(71===e[c]&&71===e[h]){if(r=e.subarray(c,h),"pes"===ii.ts.parseType(r,t.pid)&&(s=ii.ts.parsePesType(r,t.table),a=ii.ts.parsePayloadUnitStartIndicator(r),"video"===s&&a&&(o=ii.ts.parsePesTime(r))&&(o.type="video",i.video.push(o),p=!0)),p)break;c-=188,h-=188;continue}c--,h--}},il=function(e,t){if(e.audio&&e.audio.length){var i=t;
61(void 0===i||isNaN(i))&&(i=e.audio[0].dts),e.audio.forEach(function(e){e.dts=F(e.dts,i),e.pts=F(e.pts,i),e.dtsTime=e.dts/ir,e.ptsTime=e.pts/ir})}if(e.video&&e.video.length){var r=t;if((void 0===r||isNaN(r))&&(r=e.video[0].dts),e.video.forEach(function(e){e.dts=F(e.dts,r),e.pts=F(e.pts,r),e.dtsTime=e.dts/ir,e.ptsTime=e.pts/ir}),e.firstKeyFrame){var n=e.firstKeyFrame;n.dts=F(n.dts,r),n.pts=F(n.pts,r),n.dtsTime=n.dts/ir,n.ptsTime=n.pts/ir}}},iu=function(e){for(var t,i=!1,r=0,n=null,s=null,a=0,o=0;e.length-o>=3;){switch(ii.aac.parseType(e,o)){case"timed-metadata":if(e.length-o<10||(a=ii.aac.parseId3TagSize(e,o))>e.length){i=!0;break}null===s&&(t=e.subarray(o,o+a),s=ii.aac.parseAacTimestamp(t)),o+=a;break;case"audio":if(e.length-o<7||(a=ii.aac.parseAdtsSize(e,o))>e.length){i=!0;break}null===n&&(t=e.subarray(o,o+a),n=ii.aac.parseSampleRate(t)),r++,o+=a;break;default:o++}if(i)return null}if(null===n||null===s)return null;var l=ir/n;return{audio:[{type:"audio",dts:s,pts:s},{type:"audio",dts:s+1024*r*l,pts:s+1024*r*l}]}},id=function(e){var t={pid:null,table:null},i={};for(var r in is(e,t),t.table)if(t.table.hasOwnProperty(r))switch(t.table[r]){case j.H264_STREAM_TYPE:i.video=[],io(e,t,i),0===i.video.length&&delete i.video;break;case j.ADTS_STREAM_TYPE:i.audio=[],ia(e,t,i),0===i.audio.length&&delete i.audio}return i},ic=function(e,t){var i;return(i=ii.aac.isLikelyAacData(e)?iu(e):id(e))&&(i.audio||i.video)?(il(i,t),i):null};let ih=function(e,t){t.on("data",function(t){let i=t.initSegment;t.initSegment={data:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength};let r=t.data;t.data=r.buffer,e.postMessage({action:"data",segment:t,byteOffset:r.byteOffset,byteLength:r.byteLength},[t.data])}),t.on("done",function(t){e.postMessage({action:"done"})}),t.on("gopInfo",function(t){e.postMessage({action:"gopInfo",gopInfo:t})}),t.on("videoSegmentTimingInfo",function(t){let i={start:{decode:p(t.start.dts),presentation:p(t.start.pts)},end:{decode:p(t.end.dts),presentation:p(t.end.pts)},baseMediaDecodeTime:p(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=p(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:i})}),t.on("audioSegmentTimingInfo",function(t){let i={start:{decode:p(t.start.dts),presentation:p(t.start.pts)},end:{decode:p(t.end.dts),presentation:p(t.end.pts)},baseMediaDecodeTime:p(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=p(t.prependedContentDuration)),e.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:i})}),t.on("id3Frame",function(t){e.postMessage({action:"id3Frame",id3Frame:t})}),t.on("caption",function(t){e.postMessage({action:"caption",caption:t})}),t.on("trackinfo",function(t){e.postMessage({action:"trackinfo",trackInfo:t})}),t.on("audioTimingInfo",function(t){e.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:p(t.start),end:p(t.end)}})}),t.on("videoTimingInfo",function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:p(t.start),end:p(t.end)}})}),t.on("log",function(t){e.postMessage({action:"log",log:t})})};class ip{constructor(e,t){this.options=t||{},this.self=e,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new tE(this.options),ih(this.self,this.transmuxer)}pushMp4Captions(e){this.captionParser||(this.captionParser=new t2,this.captionParser.init());let t=new Uint8Array(e.data,e.byteOffset,e.byteLength),i=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:"mp4Captions",captions:i&&i.captions||[],logs:i&&i.logs||[],data:t.buffer},[t.buffer])}initMp4WebVttParser(e){this.webVttParser||(this.webVttParser=new t6);let t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.webVttParser.init(t)}getMp4WebVttText(e){this.webVttParser||(this.webVttParser=new t6);let t=new Uint8Array(e.data,e.byteOffset,e.byteLength),i=this.webVttParser.parseSegment(t);this.self.postMessage({action:"getMp4WebVttText",mp4VttCues:i||[],data:t.buffer},[t.buffer])}probeMp4StartTime({timescales:e,data:t}){let i=tV.startTime(e,t);this.self.postMessage({action:"probeMp4StartTime",startTime:i,data:t},[t.buffer])}probeMp4Tracks({data:e}){let t=tV.tracks(e);this.self.postMessage({action:"probeMp4Tracks",tracks:t,data:e},[e.buffer])}probeEmsgID3({data:e,offset:t}){let i=tV.getEmsgID3(e,t);this.self.postMessage({action:"probeEmsgID3",id3Frames:i,emsgData:e},[e.buffer])}probeTs({data:e,baseStartTime:t}){let i=ic(e,"number"!=typeof t||isNaN(t)?void 0:t*c),r=null;i&&((r={hasVideo:i.video&&2===i.video.length||!1,hasAudio:i.audio&&2===i.audio.length||!1}).hasVideo&&(r.videoStart=i.video[0].ptsTime),r.hasAudio&&(r.audioStart=i.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:r,data:e},[e.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(e){let t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)}reset(){this.transmuxer.reset()}setTimestampOffset(e){let t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(h(t)))}setAudioAppendStart(e){this.transmuxer.setAudioAppendStart(Math.ceil(h(e.appendStart)))}setRemux(e){this.transmuxer.setRemux(e.remux)}flush(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())}}self.onmessage=function(e){if("init"===e.data.action&&e.data.options){this.messageHandlers=new ip(self,e.data.options);return}this.messageHandlers||(this.messageHandlers=new ip(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data)}})));let aZ=e=>{let{transmuxer:t,bytes:i,audioAppendStart:r,gopsToAlignWith:n,remux:s,onData:a,onTrackInfo:o,onAudioTimingInfo:l,onVideoTimingInfo:u,onVideoSegmentTimingInfo:d,onAudioSegmentTimingInfo:c,onId3:h,onCaptions:p,onDone:f,onEndedTimeline:m,onTransmuxerLog:g,isEndOfTimeline:y,segment:v,triggerSegmentEventFn:_}=e,b={buffer:[]},T=y;if(t.onmessage=i=>{if(t.currentTransmux===e)"data"===i.data.action&&((e,t,i)=>
61{let{type:r,initSegment:n,captions:s,captionStreams:a,metadata:o,videoFrameDtsTime:l,videoFramePtsTime:u}=e.data.segment;t.buffer.push({captions:s,captionStreams:a,metadata:o});let d=e.data.segment.boxes||{data:e.data.segment.data},c={type:r,data:new Uint8Array(d.data,d.data.byteOffset,d.data.byteLength),initSegment:new Uint8Array(n.data,n.byteOffset,n.byteLength)};void 0!==l&&(c.videoFrameDtsTime=l),void 0!==u&&(c.videoFramePtsTime=u),i(c)})(i,b,a),"trackinfo"===i.data.action&&o(i.data.trackInfo),"gopInfo"===i.data.action&&(b.gopInfo=i.data.gopInfo),"audioTimingInfo"===i.data.action&&l(i.data.audioTimingInfo),"videoTimingInfo"===i.data.action&&u(i.data.videoTimingInfo),"videoSegmentTimingInfo"===i.data.action&&d(i.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===i.data.action&&c(i.data.audioSegmentTimingInfo),"id3Frame"===i.data.action&&h([i.data.id3Frame],i.data.id3Frame.dispatchType),"caption"===i.data.action&&p(i.data.caption),"endedtimeline"===i.data.action&&(T=!1,m()),"log"===i.data.action&&g(i.data.log),"transmuxed"===i.data.type&&(T||(t.onmessage=null,(({transmuxedData:e,callback:t})=>{e.buffer=[],t(e)})({transmuxedData:b,callback:f}),a0(t)))},t.onerror=()=>{f(null,{message:"Received an error message from the transmuxer worker",metadata:{errorType:sL.Error.StreamingFailedToTransmuxSegment,segmentInfo:oP({segment:v})}})},r&&t.postMessage({action:"setAudioAppendStart",appendStart:r}),Array.isArray(n)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:n}),void 0!==s&&t.postMessage({action:"setRemux",remux:s}),i.byteLength){let e=i instanceof ArrayBuffer?i:i.buffer,r=i instanceof ArrayBuffer?0:i.byteOffset;_({type:"segmenttransmuxingstart",segment:v}),t.postMessage({action:"push",data:e,byteOffset:r,byteLength:i.byteLength},[e])}y&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},a0=e=>{e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():aZ(e.currentTransmux))},a1=(e,t)=>{e.postMessage({action:t}),a0(e)};var a2=e=>{((e,t)=>{if(!t.currentTransmux){t.currentTransmux=e,a1(t,e);return}t.transmuxQueue.push(a1.bind(null,t,e))})("reset",e)};let a4=function(e){let t=e.transmuxer,i=e.endAction||e.action,r=e.callback,n=b({},e,{endAction:null,transmuxer:null,callback:null}),s=n=>{n.data.action===i&&(t.removeEventListener("message",s),n.data.data&&(n.data.data=new Uint8Array(n.data.data,e.byteOffset||0,e.byteLength||n.data.data.byteLength),e.data&&(e.data=n.data.data)),r(n.data))};if(t.addEventListener("message",s),e.data){let i=e.data instanceof ArrayBuffer;n.byteOffset=i?0:e.data.byteOffset,n.byteLength=e.data.byteLength;let r=[i?e.data:e.data.buffer];t.postMessage(n,r)}else t.postMessage(n)},a8="wvtt",a3=e=>{e.forEach(e=>{e.abort()})},a5=(e,t)=>{let{requestType:i}=t,r=ay({requestType:i,request:t,error:e});return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:-101,xhr:t,metadata:r}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:-102,xhr:t,metadata:r}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:2,xhr:t,metadata:r}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:2,xhr:t,metadata:r}:null},a6=(e,t,i,r)=>(n,s)=>{let a=s.response,o=a5(n,s);if(o)return i(o,e);if(16!==a.byteLength)return i({status:s.status,message:"Invalid HLS key at URL: "+s.uri,code:2,xhr:s},e);let l=new DataView(a),u=new Uint32Array([l.getUint32(0),l.getUint32(4),l.getUint32(8),l.getUint32(12)]);for(let e=0;e<t.length;e++)t[e].bytes=u;return r({type:"segmentkeyloadcomplete",segment:e,keyInfo:{uri:s.uri}}),i(null,e)},a7=(e,t)=>{let i=ta(e.map.bytes);if("mp4"!==i){let r=e.map.resolvedUri||e.map.uri,n=i||"unknown";return t({internal:!0,message:`Found unsupported ${n} container for initialization segment at URL: ${r}`,code:2,metadata:{mediaType:n}})}a4({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:({tracks:i,data:r})=>(e.map.bytes=r,i.forEach(function(t){(e.map.tracks=e.map.tracks||{},!e.map.tracks[t.type])&&(e.map.tracks[t.type]=t,"number"==typeof t.id&&t.timescale&&(e.map.timescales=e.map.timescales||{},e.map.timescales[t.id]=t.timescale),"text"===t.type&&t.codec===a8&&e.transmuxer.postMessage({action:"initMp4WebVttParser",data:e.map.bytes}))}),t(null))})},a9=({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:c,onTransmuxerLog:h,triggerSegmentEventFn:p})=>{let f=new Uint8Array(t);if(e0(f,["moof"]).length>0){e.isFmp4=!0;let{tracks:n}=e.map;if(n.text&&(!n.audio||!n.video)){var m;d(e,{data:f,type:"text"}
61),m=n.text.codec,m===a8&&a4({action:"getMp4WebVttText",data:e.bytes,transmuxer:e.transmuxer,callback:({data:t,mp4VttCues:i})=>{e.bytes=t,c(null,e,{mp4VttCues:i})}});return}let s={isFmp4:!0,hasVideo:!!n.video,hasAudio:!!n.audio};n.audio&&n.audio.codec&&"enca"!==n.audio.codec&&(s.audioCodec=n.audio.codec),n.video&&n.video.codec&&"encv"!==n.video.codec&&(s.videoCodec=n.video.codec),n.video&&n.audio&&(s.isMuxed=!0),i(e,s);let l=(t,i)=>{d(e,{data:f,type:s.hasAudio&&!s.isMuxed?"audio":"video"}),i&&i.length&&a(e,i),t&&t.length&&o(e,t),c(null,e,{})};a4({action:"probeMp4StartTime",timescales:e.map.timescales,data:f,transmuxer:e.transmuxer,callback:({data:i,startTime:a})=>{t=i.buffer,e.bytes=f=i,s.hasAudio&&!s.isMuxed&&r(e,"audio","start",a),s.hasVideo&&r(e,"video","start",a),a4({action:"probeEmsgID3",data:f,transmuxer:e.transmuxer,offset:a,callback:({emsgData:i,id3Frames:r})=>{if(t=i.buffer,e.bytes=f=i,!n.video||!i.byteLength||!e.transmuxer)return void l(void 0,r);a4({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:e.transmuxer,data:f,timescales:e.map.timescales,trackIds:[n.video.id],callback:i=>{t=i.data.buffer,e.bytes=f=i.data,i.logs.forEach(function(e){h(sj(e,{stream:"mp4CaptionParser"}))}),l(i.captions,r)}})}})}});return}if(!e.transmuxer)return void c(null,e,{});if(void 0===e.container&&(e.container=ta(f)),"ts"!==e.container&&"aac"!==e.container){i(e,{hasAudio:!1,hasVideo:!1}),c(null,e,{});return}(({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:c,onTransmuxerLog:h,triggerSegmentEventFn:p})=>{let f=e.map&&e.map.tracks||{},m=!!(f.audio&&f.video),g=r.bind(null,e,"audio","start"),y=r.bind(null,e,"audio","end"),v=r.bind(null,e,"video","start"),_=r.bind(null,e,"video","end");a4({action:"probeTs",transmuxer:e.transmuxer,data:t,baseStartTime:e.baseStartTime,callback:r=>{e.bytes=t=r.data;let f=r.result;f&&(i(e,{hasAudio:f.hasAudio,hasVideo:f.hasVideo,isMuxed:m}),i=null),(e=>{if(!e.transmuxer.currentTransmux){e.transmuxer.currentTransmux=e,aZ(e);return}e.transmuxer.transmuxQueue.push(e)})({bytes:t,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,remux:m,onData:t=>{t.type="combined"===t.type?"video":t.type,d(e,t)},onTrackInfo:t=>{i&&(m&&(t.isMuxed=!0),i(e,t))},onAudioTimingInfo:e=>{g&&void 0!==e.start&&(g(e.start),g=null),y&&void 0!==e.end&&y(e.end)},onVideoTimingInfo:e=>{v&&void 0!==e.start&&(v(e.start),v=null),_&&void 0!==e.end&&_(e.end)},onVideoSegmentTimingInfo:t=>{p({type:"segmenttransmuxingtiminginfoavailable",segment:e,timingInfo:{pts:{start:t.start.presentation,end:t.end.presentation},dts:{start:t.start.decode,end:t.end.decode}}}),n(t)},onAudioSegmentTimingInfo:t=>{p({type:"segmenttransmuxingtiminginfoavailable",segment:e,timingInfo:{pts:{start:t.start.pts,end:t.end.pts},dts:{start:t.start.dts,end:t.end.dts}}}),s(t)},onId3:(t,i)=>{a(e,t,i)},onCaptions:t=>{o(e,[t])},isEndOfTimeline:l,onEndedTimeline:()=>{u()},onTransmuxerLog:h,onDone:(t,i)=>{c&&(t.type="combined"===t.type?"video":t.type,p({type:"segmenttransmuxingcomplete",segment:e}),c(i,e,t))},segment:e,triggerSegmentEventFn:p})}})})({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:c,onTransmuxerLog:h,triggerSegmentEventFn:p})},oe=function({id:e,key:t,encryptedBytes:i,decryptionWorker:r,segment:n,doneFn:s},a){let o,l=t=>{if(t.data.source===e){r.removeEventListener("message",l);let e=t.data.decrypted;a(new Uint8Array(e.bytes,e.byteOffset,e.byteLength))}};r.onerror=()=>{let e="An error occurred in the decryption worker",t=oP({segment:n});s({message:e,metadata:{error:Error(e),errorType:sL.Error.StreamingFailedToDecryptSegment,segmentInfo:t,keyInfo:{uri:n.key.resolvedUri||n.map.key.resolvedUri}}},n)},r.addEventListener("message",l),o=t.bytes.slice?t.bytes.slice():new Uint32Array(Array.prototype.slice.call(t.bytes)),r.postMessage(aP({source:e,encrypted:i,key:o,iv:t.iv}),[i.buffer,o.buffer])},ot=sB("CodecUtils"),oi=function(e){let t=e.attributes||{};if(t.CODECS)return U(t.CODECS)},or=(e,t)=>
61{let i=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&i.AUDIO&&e.mediaGroups.AUDIO[i.AUDIO]},on=function(e){let t={};return e.forEach(({mediaType:e,type:i,details:r})=>{t[e]=t[e]||[],t[e].push(R(`${i}${r}`))}),Object.keys(t).forEach(function(e){if(t[e].length>1){ot(`multiple ${e} codecs found as attributes: ${t[e].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),t[e]=null;return}t[e]=t[e][0]}),t},os=function(e){let t=0;return e.audio&&t++,e.video&&t++,t},oa=function(e,t){let i=t.attributes||{},r=on(oi(t)||[]);if(or(e,t)&&!r.audio&&!((e,t)=>{if(!or(e,t))return!0;let i=t.attributes||{},r=e.mediaGroups.AUDIO[i.AUDIO];for(let e in r)if(!r[e].uri&&!r[e].playlists)return!0;return!1})(e,t)){let t=on(B(e,i.AUDIO)||[]);t.audio&&(r.audio=t.audio)}return r},oo=sB("PlaylistSelector"),ol=function(e){if(!e||!e.playlist)return;let t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})},ou=function(e,t){if(!e)return"";let i=p().getComputedStyle(e);return i?i[t]:""},od=function(e,t){let i=e.slice();e.sort(function(e,r){let n=t(e,r);return 0===n?i.indexOf(e)-i.indexOf(r):n})},oc=function(e,t){let i,r;return e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||p().Number.MAX_VALUE,t.attributes.BANDWIDTH&&(r=t.attributes.BANDWIDTH),i-(r=r||p().Number.MAX_VALUE)},oh=function(e,t,i,r,n,s){let a,o,l,u;if(!e)return;let d={bandwidth:t,width:i,height:r,limitRenditionByPlayerDimensions:n},c=e.playlists;au.isAudioOnly(e)&&(c=s.getAudioTrackPlaylists_(),d.audioOnly=!0);let h=c.map(e=>{let t=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,i=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return{bandwidth:e.attributes&&e.attributes.BANDWIDTH||p().Number.MAX_VALUE,width:t,height:i,playlist:e}});od(h,(e,t)=>e.bandwidth-t.bandwidth);let f=(h=h.filter(e=>!au.isIncompatible(e.playlist))).filter(e=>au.isEnabled(e.playlist));f.length||(f=h.filter(e=>!au.isDisabled(e.playlist)));let m=f.filter(e=>e.bandwidth*aW.BANDWIDTH_VARIANCE<t),g=m[m.length-1],y=m.filter(e=>e.bandwidth===g.bandwidth)[0];if(!1===n){let e=y||f[0]||h[0];if(e&&e.playlist){let t="sortedPlaylistReps";return y&&(t="bandwidthBestRep"),f[0]&&(t="enabledPlaylistReps"),oo(`choosing ${ol(e)} using ${t} with options`,d),e.playlist}return oo("could not choose a playlist with options",d),null}let v=m.filter(e=>e.width&&e.height);od(v,(e,t)=>e.width-t.width);let _=v.filter(e=>e.width===i&&e.height===r);g=_[_.length-1];let b=_.filter(e=>e.bandwidth===g.bandwidth)[0];if(b||(g=(o=(a=v.filter(e=>e.width>i||e.height>r)).filter(e=>e.width===a[0].width&&e.height===a[0].height))[o.length-1],l=o.filter(e=>e.bandwidth===g.bandwidth)[0]),s.leastPixelDiffSelector){let e=v.map(e=>(e.pixelDiff=Math.abs(e.width-i)+Math.abs(e.height-r),e));od(e,(e,t)=>e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff),u=e[0]}let T=u||l||b||y||f[0]||h[0];if(T&&T.playlist){let e="sortedPlaylistReps";return u?e="leastPixelDiffRep":l?e="resolutionPlusOneRep":b?e="resolutionBestRep":y?e="bandwidthBestRep":f[0]&&(e="enabledPlaylistReps"),oo(`choosing ${ol(T)} using ${e} with options`,d),T.playlist}return oo("could not choose a playlist with options",d),null},op=function(){let e=this.useDevicePixelRatio&&p().devicePixelRatio||1;return isNaN(this.customPixelRatio)||(e=this.customPixelRatio),oh(this.playlists.main,this.systemBandwidth,parseInt(ou(this.tech_.el(),"width"),10)*e,parseInt(ou(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.playlistController_)},of=function(e){let{main:t,currentTime:i,bandwidth:r,duration:n,segmentDuration:s,timeUntilRebuffer:a,currentTimeline:o,syncController:l}=e,u=t.playlists.filter(e=>!au.isIncompatible(e)),d=u.filter(au.isEnabled);d.length||(d=u.filter(e=>!au.isDisabled(e)));let c=d.filter(au.hasAttribute.bind(null,"BANDWIDTH")).map(e=>{let t=l.getSyncPoint(e,n,o,i),u=au.estimateSegmentRequestTime(s,r,e);return{playlist:e,rebufferingImpact:u*(t?1:2)-a}}),h=c.filter(e=>e.rebufferingImpact<=0);return(od(h,(e,t)=>oc(t.playlist,e.playlist)),h.length)?h[0]:(od(c,(e,t)=>
61e.rebufferingImpact-t.rebufferingImpact),c[0]||null)};function om(e){try{return new URL(e).pathname.split("/").slice(-2).join("/")}catch(e){return""}}let og=function(e,t,i){if(!e[i]){t.trigger({type:"usage",name:"vhs-608"});let r=i;/^cc708_/.test(i)&&(r="SERVICE"+i.split("_")[1]);let n=t.textTracks().getTrackById(r);if(n)e[i]=n;else{let n=t.options_.vhs&&t.options_.vhs.captionServices||{},s=i,a=i,o=!1,l=n[r];l&&(s=l.label,a=l.language,o=l.default),e[i]=t.addRemoteTextTrack({kind:"captions",id:r,default:o,label:s,language:a},!1).track}}},oy=function({inbandTextTracks:e,captionArray:t,timestampOffset:i}){if(!t)return;let r=p().WebKitDataCue||p().VTTCue;t.forEach(t=>{let n=t.stream;t.content?t.content.forEach(s=>{let a=new r(t.startTime+i,t.endTime+i,s.text);a.line=s.line,a.align="left",a.position=s.position,a.positionAlign="line-left",e[n].addCue(a)}):e[n].addCue(new r(t.startTime+i,t.endTime+i,t.text))})},ov=function(e){Object.defineProperties(e.frame,{id:{get:()=>(sL.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key)},value:{get:()=>(sL.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data)},privateData:{get:()=>(sL.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data)}})},o_={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},ob=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),oT=(e,t,i)=>{!e.metadataTrack_&&(e.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,sL.browser.IS_ANY_SAFARI||(e.metadataTrack_.inBandMetadataTrackDispatchType=t))},ow=function(e,t,i){let r,n;if(i&&i.cues)for(r=i.cues.length;r--;)(n=i.cues[r]).startTime>=e&&n.endTime<=t&&i.removeCue(n)},oS=function(e){let t=e.cues;if(!t)return;let i={};for(let r=t.length-1;r>=0;r--){let n=t[r],s=`${n.startTime}-${n.endTime}-${n.text}`;i[s]?e.removeCue(n):i[s]=n}},oE=function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;let i=Object.keys(e).sort(),r=Object.keys(t).sort();if(i.length!==r.length)return!1;for(let n=0;n<i.length;n++){let s=i[n];if(s!==r[n]||e[s]!==t[s])return!1}return!0},oC=function(e,t,i){t=t||[];let r=[],n=0;for(let s=0;s<t.length;s++){let a=t[s];if(e===a.timeline&&(r.push(s),(n+=a.duration)>i))return s}return 0===r.length?0:r[r.length-1]},ok=e=>"number"==typeof e&&isFinite(e),ox=1/60,oD=e=>{let{startOfSegment:t,duration:i,segment:r,part:n,playlist:{mediaSequence:s,id:a,segments:o=[]},mediaIndex:l,partIndex:u,timeline:d}=e,c=o.length-1,h="mediaIndex/partIndex increment";e.getMediaInfoForTime?h=`getMediaInfoForTime (${e.getMediaInfoForTime})`:e.isSyncRequest&&(h="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(h+=` with independent ${e.independent}`);let p="number"==typeof u,f=e.segment.uri?"segment":"pre-segment",m=p?s4({preloadSegment:r})-1:0;return`${f} [${s+l}/${s+c}]`+(p?` part [${u}/${m}]`:"")+` segment start/end [${r.start} => ${r.end}]`+(p?` part start/end [${n.start} => ${n.end}]`:"")+` startOfSegment [${t}]`+` duration [${i}]`+` timeline [${d}]`+` selected by [${h}]`+` playlist [${a}]`},oI=e=>`${e}TimingInfo`,oA=({timelineChangeController:e,currentTimeline:t,segmentTimeline:i,loaderType:r,audioDisabled:n})=>{if(t===i)return!1;if("audio"===r){let t=e.lastTimelineChange({type:"main"});return!t||t.to!==i}if("main"===r&&n){let t=e.pendingTimelineChange({type:"audio"});return!t||t.to!==i}return!1},oO=e=>{let t=e.pendingSegment_;if(t&&oA({timelineChangeController:e.timelineChangeController_,currentTimeline:e.currentTimeline_,segmentTimeline:t.timeline,loaderType:e.loaderType_,audioDisabled:e.audioDisabled_})&&(e=>{if(!e)return!1;let t=e.pendingTimelineChange({type:"audio"}),i=e.pendingTimelineChange({type:"main"}),r=t&&i,n=r&&t.to!==i.to;return!!r&&-1!==t.from&&-1!==i.from&&!!n})(e.timelineChangeController_)){if((e=>{let t=e.timelineChangeController_.pendingTimelineChange({type:"audio"}),i=e.timelineChangeController_.pendingTimelineChange({type:"main"});return t&&i&&t.to<i.to})(e))return void e.timelineChangeController_.trigger("audioTimelineBehind");e.timelineChangeController_.trigger("fixBadTimelineChange")}},oL=({segmentDuration:e,maxDuration:t})=>!!e&&Math.round(e)>t+sF,oP=({type:e,segment:t})=>{if(!t)return;let i=!!(t.key||t.map&&t.map.ke),r=!!(t.map&&!t.map.bytes),n=void 0===t.startOfSegment?t.start:t.startOfSegment;return{type:e||t.type,uri:t.resolvedUri||t.uri,start:n,duration:t.duration,isEncrypted:i,isMediaInitialization:r}};class oN extends sL.EventTarget{constructor(e,t={}){if(super(),!e)throw TypeError("Initialization settings are required");if("function"!=typeof e.currentTime)throw TypeError("No currentTime getter specified");if(!e.mediaSource)throw TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={}
61,this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=sB(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(e){e!==this.state_&&(this.logger_(`${this.state_} -> ${e}`),this.state_=e,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():oO(this)}),this.sourceUpdater_.on("codecschange",e=>{this.trigger(b({type:"codecschange"},e))}),"main"===this.loaderType_&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():oO(this)}),"audio"===this.loaderType_&&this.timelineChangeController_.on("timelinechange",e=>{this.trigger(b({type:"timelinechange"},e)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():oO(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():oO(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){var e={remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_};let t=new aJ;t.currentTransmux=null,t.transmuxQueue=[];let i=t.terminate;return t.terminate=()=>(t.currentTransmux=null,t.transmuxQueue.length=0,i.call(t)),t.postMessage({action:"init",options:e}),t}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&p().clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if("WAITING"!==this.state){this.pendingSegment_&&(this.pendingSegment_=null),this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,p().clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)}error(e){return void 0!==e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&a2(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){let e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return sq();if("main"===this.loaderType_){let{hasAudio:t,hasVideo:i,isMuxed:r}=e;if(i&&t&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;let i=aN(e),r=this.initSegments_[i];return t&&!r&&e.bytes&&(this.initSegments_[i]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),r||e}segmentKey(e,t=!1){if(!e)return null;let i=aM(e),r=this.keyCache_[i];this.cacheEncryptionKeys_&&t&&!r&&e.bytes&&(this.keyCache_[i]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});let n={resolvedUri:(r||e).resolvedUri};return r&&(n.bytes=r.bytes),n}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),this.playlist_){if("INIT"===this.state&&this.couldBeginLoading_())return this.init_();this.couldBeginLoading_()&&("READY"===this.state||"INIT"===this.state)&&(this.state="READY")}}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e||this.playlist_&&this.playlist_.endList&&e.endList&&this.playlist_.uri===e.uri)return;let i=this.playlist_,r=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));let n=null;if(i&&(i.id?n=i.id:i.uri&&(n=i.uri)),this.logger_(`playlist update [${n} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update:
62currentTime: ${this.currentTime_()}
63bufferedEnd: ${sJ(this.buffered_())}
64`,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri){null!==this.mediaIndex&&(e.endList||"number"!=typeof e.partTargetDuration?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}let s=e.mediaSequence-i.mediaSequence;if(this.logger_(`live window shift [${s}]`),null!==this.mediaIndex)if(this.mediaIndex-=s,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{let e=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!e.parts||!e.parts.length||!e.parts[this.partIndex])){let e=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=e}}r&&(r.mediaIndex-=s,r.mediaIndex<0?(r.mediaIndex=null,r.partIndex=null):(r.mediaIndex>=0&&(r.segment=e.segments[r.mediaIndex]),r.partIndex>=0&&r.segment.parts&&(r.part=r.segment.parts[r.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e)}pause(){this.checkBufferTimeout_&&(p().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return null===this.checkBufferTimeout_}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}
64resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&a2(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;let e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;"hls"!==this.sourceType_||e||(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,i=()=>{},r=!1){if(t===1/0&&(t=this.duration_()),t<=e)return void this.logger_("skipping remove because end ${end} is <= start ${start}");if(!this.sourceUpdater_||!this.getMediaInfo_())return void this.logger_("skipping remove because no source updater or starting media info");let n=1,s=()=>{0==--n&&i()};for(let i in(r||!this.audioDisabled_)&&(n++,this.sourceUpdater_.removeAudio(e,t,s)),(r||"main"===this.loaderType_)&&(this.gopBuffer_=((e,t,i,r)=>{let n=Math.ceil((t-r)*to.ONE_SECOND_IN_TS),s=Math.ceil((i-r)*to.ONE_SECOND_IN_TS),a=e.slice(),o=e.length;for(;o--&&!(e[o].pts<=s););if(-1===o)return a;let l=o+1;for(;l--&&!(e[l].pts<=n););return l=Math.max(l,0),a.splice(l,o-l+1),a})(this.gopBuffer_,e,t,this.timeMapping_),n++,this.sourceUpdater_.removeVideo(e,t,s)),this.inbandTextTracks_)ow(e,t,this.inbandTextTracks_[i]);ow(e,t,this.segmentMetadataTrack_),s()}monitorBuffer_(){this.checkBufferTimeout_&&p().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=p().setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&p().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=p().setTimeout(this.monitorBufferTick_.bind(this),500)}fillBuffer_(){if(this.sourceUpdater_.updating())return;let e=this.chooseNextRequest_();if(!e)return;let t={segmentInfo:oP({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:t}),"number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,i=this.partIndex){if(!t||!this.mediaSource_)return!1;let r="number"==typeof e&&t.segments[e],n=e+1===t.segments.length,s=!r||!r.parts||i+1===r.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&n&&s}chooseNextRequest_(){let e=this.buffered_(),t=sJ(e)||0,i=sZ(e,this.currentTime_()),r=!this.hasPlayed_()&&i>=1,n=i>=this.goalBufferLength_(),s=this.playlist_.segments;if(!s.length||r||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);let a={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(a.isSyncRequest)a.mediaIndex=oC(this.currentTimeline_,s,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${a.mediaIndex}`);else if(null!==this.mediaIndex){let e=s[this.mediaIndex],i="number"==typeof this.partIndex?this.partIndex:-1;a.startOfSegment=e.end?e.end:t,e.parts&&e.parts[i+1]?(a.mediaIndex=this.mediaIndex,a.partIndex=i+1):a.mediaIndex=this.mediaIndex+1}else{let e,i,r,n=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch:
65For TargetTime: ${n}.
66CurrentTime: ${this.currentTime_()}
67BufferedEnd: ${t}
68Fetch At Buffer: ${this.fetchAtBuffer_}
69`,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){let t=this.getSyncInfoFromMediaSequenceSync_(n);if(!t){let e="No sync info found while using media sequence sync";return this.error({message:e,metadata:{errorType:sL.Error.StreamingFailedToSelectNextSegment,error:Error(e)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${t.start} --> ${t.end})`),e=t.segmentIndex,i=t.partIndex,r=t.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");let t=au.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:n,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});e=t.segmentIndex,i=t.partIndex,r=t.startTime}a.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${n}`:`currentTime ${n}`,a.mediaIndex=e,a.startOfSegment=r,a.partIndex=i,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${a.mediaIndex} `)}let o=s[a.mediaIndex],l=o&&"number"==typeof a.partIndex&&o.parts&&o.parts[a.partIndex];if(!o||"number"==typeof a.partIndex&&!l)return null;"number"!=typeof a.partIndex&&o.parts&&(a.partIndex=0,l=o.parts[0]);let u=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!i&&l&&!u&&!l.independent)if(0===a.partIndex){let e=s[a.mediaIndex-1],t=e.parts&&e.parts.length&&e.parts[e.parts.length-1];t&&t.independent&&(a.mediaIndex-=1,a.partIndex=e.parts.length-1,a.independent="previous segment")}else o.parts[a.partIndex-1].independent&&(a.partIndex-=1,a.independent="previous part");let d=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return a.mediaIndex>=s.length-1&&d&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,a.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(a))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;let t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);let i=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!i)return null;if(!i.isAppended)return i;let r=this.mediaSequenceSync_.getSyncInfoForTime(i.end);return r?(r.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),r):null}generateSegmentInfo_(e){let{independent:t,playlist:i,mediaIndex:r,startOfSegment:n,isSyncRequest:s,partIndex:a,forceTimestampOffset:o,getMediaInfoForTime:l}=e,u=i.segments[r],d="number"==typeof a&&u.parts[a],c={requestId:"segment-loader-"+Math.random(),uri:d&&d.resolvedUri||u.resolvedUri,mediaIndex:r,partIndex:d?a:null,isSyncRequest:s,startOfSegment:n,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:u.timeline,duration:d&&d.duration||u.duration,segment:u,part:d,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:l,independent:t},h=void 0!==o?o:this.isPendingTimestampOffset_;c.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:u.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:h});
69let p=sJ(this.sourceUpdater_.audioBuffered());return"number"==typeof p&&(c.audioAppendStart=p-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(c.gopsToAlignWith=((e,t,i)=>{let r;if(null==t||!e.length)return[];let n=Math.ceil((t-i+3)*to.ONE_SECOND_IN_TS);for(r=0;r<e.length&&!(e[r].pts>n);r++);return e.slice(r)})(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),c}timestampOffsetForSegment_(e){return(({segmentTimeline:e,currentTimeline:t,startOfSegment:i,buffered:r,overrideCheck:n})=>n||e!==t?e<t?i:r.length?r.end(r.length-1):i:null)(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;let t=this.currentTime_(),i=e.bandwidth,r=this.pendingSegment_.duration,n=au.estimateSegmentRequestTime(r,i,this.playlist_,e.bytesReceived),s=function(e,t,i=1){return((e.length?e.end(e.length-1):0)-t)/i}(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=s)return;let a=of({main:this.vhs_.playlists.main,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:s,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!a)return;let o=n-s-a.rebufferingImpact,l=.5;s<=sF&&(l=1),a.playlist&&a.playlist.uri!==this.playlist_.uri&&!(o<l)&&(this.bandwidth=a.playlist.attributes.BANDWIDTH*aW.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${oD(e)}`),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),this.checkForAbort_(t.requestId)||this.trigger("progress")}handleTrackInfo_(e,t){let{hasAudio:i,hasVideo:r}=t,n={segmentInfo:oP({type:this.loaderType_,segment:e}),trackInfo:{hasAudio:i,hasVideo:r}};this.trigger({type:"segmenttransmuxingtrackinfoavailable",metadata:n}),this.earlyAbortWhenNeeded_(e.stats),!(this.checkForAbort_(e.requestId)||this.checkForIllegalMediaSwitch(t))&&(t=t||{},oE(this.currentMediaInfo_,t)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_("trackinfo update",t),this.trigger("trackinfo")),this.checkForAbort_(e.requestId)||(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()?this.processCallQueue_():oO(this)))}handleTimingInfo_(e,t,i,r){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;let n=this.pendingSegment_,s=oI(t);n[s]=n[s]||{},n[s][i]=r,this.logger_(`timinginfo: ${t} - ${i} - ${r}`),this.hasEnoughInfoToAppend_()?this.processCallQueue_():oO(this)}handleCaptions_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(0===t.length)return void this.logger_("SegmentLoader received no captions from a caption event");if(!this.pendingSegment_.hasAppendedData_)return void this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));let i=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),r={};t.forEach(e=>{r[e.stream]=r[e.stream]||{startTime:1/0,captions:[],endTime:0};let t=r[e.stream];t.startTime=Math.min(t.startTime,e.startTime+i),t.endTime=Math.max(t.endTime,e.endTime+i),t.captions.push(e)}),Object.keys(r).forEach(e=>{let{startTime:t,endTime:n,captions:s}=r[e],a=this.inbandTextTracks_;this.logger_(`adding cues from ${t} -> ${n} for ${e}`),og(a,this.vhs_.tech_,e),ow(t,n,a[e]),oy({captionArray:s,inbandTextTracks:a,timestampOffset:i})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,i){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(!this.pendingSegment_.hasAppendedData_)return void this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i));this.addMetadataToTextTrack(i,t,this.duration_())}}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){let e=this.callQueue_;
69this.callQueue_=[],e.forEach(e=>e())}processLoadQueue_(){let e=this.loadQueue_;this.loadQueue_=[],e.forEach(e=>e())}hasEnoughInfoToLoad_(){if("audio"!==this.loaderType_)return!0;let e=this.pendingSegment_;return!!e&&(!this.getCurrentMediaInfo_()||!oA({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;let e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;let{hasAudio:i,hasVideo:r,isMuxed:n}=t;return!(r&&!e.videoTimingInfo||i&&!this.audioDisabled_&&!n&&!e.audioTimingInfo||oA({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){oO(this),this.callQueue_.push(this.handleData_.bind(this,e,t));return}let i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.part||i.segment),"closed"!==this.mediaSource_.readyState){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),i.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[oI(t.type)].start;else{let e,t=this.getCurrentMediaInfo_(),r="main"===this.loaderType_&&t&&t.hasVideo;r&&(e=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:r,firstVideoFrameTimeForData:e,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(i,t.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:"main"===this.loaderType_});let e=this.chooseNextRequest_();if(e.mediaIndex!==i.mediaIndex||e.partIndex!==i.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,t)}}updateAppendInitSegmentStatus(e,t){"main"!==this.loaderType_||"number"!=typeof e.timestampOffset||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:i,playlist:r}){if(i){let e=aN(i);if(this.activeInitSegmentId_===e)return null;t=this.initSegmentForMap(i,!0).bytes,this.activeInitSegmentId_=e}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=r,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i},r){let n=this.sourceUpdater_.audioBuffered(),s=this.sourceUpdater_.videoBuffered();n.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+sK(n).join(", ")),s.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+sK(s).join(", "));let a=n.length?n.start(0):0,o=n.length?n.end(n.length-1):0,l=s.length?s.start(0):0,u=s.length?s.end(s.length-1):0;if(o-a<=1&&u-l<=1){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${i.byteLength}, audio buffer: ${sK(n).join(", ")}, video buffer: ${sK(s).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:i}));let d=this.currentTime_()-1;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${d}`),this.remove(0,d,()=>{this.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=p().setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:i},r){if(r){if(22===r.code)return void this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i});this.logger_("Received non QUOTA_EXCEEDED_ERR on append",r),this.error({message:`${t} append of ${i.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:sL.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:i,data:r,bytes:n}){if(!n){var s;let e,t,a=[r],o=r.byteLength;i&&(a.unshift(i),o+=i.byteLength),t=0,(s={bytes:o,segments:a}
69).bytes&&(e=new Uint8Array(s.bytes),s.segments.forEach(i=>{e.set(i,t),t+=i.byteLength})),n=e}let a={segmentInfo:oP({type:this.loaderType_,segment:e})};this.trigger({type:"segmentappendstart",metadata:a}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:n},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:n}))}handleSegmentTimingInfo_(e,t,i){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;let r=this.pendingSegment_.segment,n=`${e}TimingInfo`;r[n]||(r[n]={}),r[n].transmuxerPrependedSeconds=i.prependedContentDuration||0,r[n].transmuxedPresentationStart=i.start.presentation,r[n].transmuxedDecodeStart=i.start.decode,r[n].transmuxedPresentationEnd=i.end.presentation,r[n].transmuxedDecodeEnd=i.end.decode,r[n].baseMediaDecodeTime=i.baseMediaDecodeTime}appendData_(e,t){let{type:i,data:r}=t;if(!r||!r.byteLength||"audio"===i&&this.audioDisabled_)return;let n=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:n,data:r})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){oO(this),this.loadQueue_.push(()=>{let t=b({},e,{forceTimestampOffset:!0});b(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));let t=this.createSimplifiedSegmentObj_(e),i=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=null!==this.mediaIndex,n=e.timeline!==this.currentTimeline_&&e.timeline>0;this.logger_(`Requesting
70${om(e.uri)}
71${oD(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=(({xhr:e,xhrOptions:t,decryptionWorker:i,segment:r,abortFn:n,progressFn:s,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:d,captionsFn:c,isEndOfTimeline:h,endedTimelineFn:p,dataFn:f,doneFn:m,onTransmuxerLog:g,triggerSegmentEventFn:y})=>{let v=[],_=(({activeXhrs:e,decryptionWorker:t,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:c,onTransmuxerLog:h,triggerSegmentEventFn:p})=>{let f=0,m=!1;return(g,y)=>{if(!m){if(g)return m=!0,a3(e),c(g,y);if((f+=1)===e.length){let f=function(){if(y.encryptedBytes)return(({decryptionWorker:e,segment:t,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:c,onTransmuxerLog:h,triggerSegmentEventFn:p})=>{p({type:"segmentdecryptionstart"}),oe({id:t.requestId,key:t.key,encryptedBytes:t.encryptedBytes,decryptionWorker:e,segment:t,doneFn:c},e=>{t.bytes=e,p({type:"segmentdecryptioncomplete",segment:t}),a9({segment:t,bytes:t.bytes,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:c,onTransmuxerLog:h,triggerSegmentEventFn:p})})})({decryptionWorker:t,segment:y,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:c,onTransmuxerLog:h,triggerSegmentEventFn:p});a9({segment:y,bytes:y.bytes,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:c,onTransmuxerLog:h,triggerSegmentEventFn:p})};if(y.endOfAllRequests=Date.now(),y.map&&y.map.encryptedBytes&&!y.map.bytes)return p({type:"segmentdecryptionstart",segment:y}),oe({decryptionWorker:t,id:y.requestId+"-init",encryptedBytes:y.map.encryptedBytes,key:y.map.
71key,segment:y,doneFn:c},t=>{y.map.bytes=t,p({type:"segmentdecryptioncomplete",segment:y}),a7(y,t=>{if(t)return a3(e),c(t,y);f()})});f()}}}})({activeXhrs:v,decryptionWorker:i,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:d,captionsFn:c,isEndOfTimeline:h,endedTimelineFn:p,dataFn:f,doneFn:m,onTransmuxerLog:g,triggerSegmentEventFn:y});if(r.key&&!r.key.bytes){let i=[r.key];r.map&&!r.map.bytes&&r.map.key&&r.map.key.resolvedUri===r.key.resolvedUri&&i.push(r.map.key);let n=sj(t,{uri:r.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),s=a6(r,i,_,y),a={uri:r.key.resolvedUri};y({type:"segmentkeyloadstart",segment:r,keyInfo:a});let o=e(n,s);v.push(o)}if(r.map&&!r.map.bytes){if(r.map.key&&(!r.key||r.key.resolvedUri!==r.map.key.resolvedUri)){let i=sj(t,{uri:r.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),n=a6(r,[r.map.key],_,y),s={uri:r.map.key.resolvedUri};y({type:"segmentkeyloadstart",segment:r,keyInfo:s});let a=e(i,n);v.push(a)}let i=sj(t,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:aA(r.map),requestType:"segment-media-initialization"}),n=(({segment:e,finishProcessingFn:t,triggerSegmentEventFn:i})=>(r,n)=>{let s=a5(r,n);if(s)return t(s,e);let a=new Uint8Array(n.response);if(i({type:"segmentloaded",segment:e}),e.map.key)return e.map.encryptedBytes=a,t(null,e);e.map.bytes=a,a7(e,function(i){if(i)return i.xhr=n,i.status=n.status,t(i,e);t(null,e)})})({segment:r,finishProcessingFn:_,triggerSegmentEventFn:y});y({type:"segmentloadstart",segment:r});let s=e(i,n);v.push(s)}let b=sj(t,{uri:r.part&&r.part.resolvedUri||r.resolvedUri,responseType:"arraybuffer",headers:aA(r),requestType:"segment"}),T=(({segment:e,finishProcessingFn:t,responseType:i,triggerSegmentEventFn:r})=>(n,s)=>{let a=a5(n,s);if(a)return t(a,e);r({type:"segmentloaded",segment:e});let o="arraybuffer"!==i&&s.responseText?(e=>{let t=new Uint8Array(new ArrayBuffer(e.length));for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t.buffer})(s.responseText.substring(e.lastReachedChar||0)):s.response;return e.stats={bandwidth:s.bandwidth,bytesReceived:s.bytesReceived||0,roundTripTime:s.roundTripTime||0},e.key?e.encryptedBytes=new Uint8Array(o):e.bytes=new Uint8Array(o),t(null,e)})({segment:r,finishProcessingFn:_,responseType:b.responseType,triggerSegmentEventFn:y});y({type:"segmentloadstart",segment:r});let w=e(b,T);w.addEventListener("progress",(({segment:e,progressFn:t,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d})=>i=>{if(!i.target.aborted)return e.stats=sj(e.stats,(e=>{let t=e.target,i={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-t.requestTime||0};return i.bytesReceived=e.loaded,i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8e3),i})(i)),!e.stats.firstBytesReceivedAt&&e.stats.bytesReceived&&(e.stats.firstBytesReceivedAt=Date.now()),t(i,e)})({segment:r,progressFn:s,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:d,captionsFn:c,isEndOfTimeline:h,endedTimelineFn:p,dataFn:f})),v.push(w);let S={};return v.forEach(e=>{e.addEventListener("loadend",(({loadendState:e,abortFn:t})=>i=>{i.target.aborted&&t&&!e.calledAbortFn&&(t(),e.calledAbortFn=!0)})({loadendState:S,abortFn:n}))}),()=>a3(v)})({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:i||r&&n,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:t,level:i,stream:r})=>{this.logger_(`${oD(e)} logged from transmuxer stream ${r} as a ${i}: ${t}`)},triggerSegmentEventFn:({type:e,segment:t,keyInfo:i,trackInfo:r,timingInfo:n})=>{let s={segmentInfo:oP({segment:t})};i&&(s.keyInfo=i),r&&(s.trackInfo=r),n&&(s.timingInfo=n),this.trigger({type:e,metadata:s})}})}trimBackBuffer_(e){var t,i,r;let n,s=(t=this.seekable_(),i=this.currentTime_(),r=this.playlist_.targetDuration||10,n=i-aW.BACK_BUFFER_LENGTH,t.length&&(n=Math.max(n,t.start(0))),Math.min(i-r,n));s>0&&this.remove(0,s)}createSimplifiedSegmentObj_(e){let t=e.segment,i=e.part,r=e.segment.key||e.segment.map&&e.segment.map.key,n=e.segment.map&&!e.segment.map.bytes,s={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:r,isMediaInitialization:n},a=e.playlist.segments[e.mediaIndex-1];if(a&&a.timeline===t.timeline&&(a.videoTimingInfo?s.baseStartTime=a.videoTimingInfo.transmuxedDecodeEnd:a.audioTimingInfo&&(s.baseStartTime=a.audioTimingInfo.transmuxedDecodeEnd)),t.key){let i=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);s.key=this.segmentKey(t.key),s.key.iv=i}return t.map&&(s.map=this.initSegmentForMap(t.map)),s}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e<ox)return void this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record ${ox}`);let i={bandwidthInfo:{from:this.bandwidth,to:t.bandwidth}};this.trigger({type:"bandwidthupdated",metadata:i}),this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime}handleTimeout_(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")}segmentRequestFinished_(e,t,i){if(this.callQueue_.length)return void this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,i));if(this.saveTransferStats_(t.stats),!this.pendingSegment_||t.requestId!==this.pendingSegment_.requestId)return;if(e)return(this.pendingSegment_=null,this.state="READY",-102===e.code)?void 0:(this.pause(),-101===e.code)?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error"));let r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),r.endOfAllRequests=t.endOfAllRequests,i.gopInfo&&(this.gopBuffer_=((e,t,i)=>{if(!t.length)return e;if(i)return t.slice();let r=t[0].pts,n=0;for(;n<e.length&&!(e[n].pts>=r);n++);return e.slice(0,n).concat(t)})(this.gopBuffer_,i.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(r)}setTimeMapping_(e){let t=this.syncController_.mappingForTimeline(e);null!==t&&(this.timeMapping_=t)}updateMediaSecondsLoaded_(e){"number"==typeof e.start&&"number"==typeof e.end?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration}shouldUpdateTransmuxerTimestampOffset_(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())}trueSegmentStart_({currentStart:e,playlist:t,mediaIndex:i,firstVideoFrameTimeForData:r,currentVideoTimestampOffset:n,useVideoTimingInfo:s,videoTimingInfo:a,audioTimingInfo:o}
71){if(void 0!==e)return e;if(!s)return o.start;let l=t.segments[i-1];return 0!==i&&l&&void 0!==l.start&&l.end===r+n?a.start:r}waitForAppendsToComplete_(e){let t=this.getCurrentMediaInfo_(e);if(!t){this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),this.trigger("error");return}let{hasAudio:i,hasVideo:r,isMuxed:n}=t,s="main"===this.loaderType_&&r,a=!this.audioDisabled_&&i&&!n;if(e.waitingOnAppends=0,!e.hasAppendedData_){e.timingInfo||"number"!=typeof e.timestampOffset||(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),this.checkAppendsDone_(e);return}s&&e.waitingOnAppends++,a&&e.waitingOnAppends++,s&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),a&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,0===e.waitingOnAppends&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){var t,i;let r=(t=this.loaderType_,i=this.getCurrentMediaInfo_(),"main"===t&&i&&e?e.hasAudio||e.hasVideo?i.hasVideo&&!e.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&&e.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);return!!r&&(this.error({message:r,playlistExclusionDuration:1/0}),this.trigger("error"),!0)}updateSourceBufferTimestampOffset_(e){if(null===e.timestampOffset||"number"!=typeof e.timingInfo.start||e.changedTimestampOffset||"main"!==this.loaderType_)return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:i}){return this.useDtsForTimestampOffset_?e&&"number"==typeof e.transmuxedDecodeStart?e.transmuxedDecodeStart:t&&"number"==typeof t.transmuxedDecodeStart?t.transmuxedDecodeStart:i.start:i.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};let t=this.getMediaInfo_(),i="main"===this.loaderType_&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;i&&(e.timingInfo.end="number"==typeof i.end?i.end:i.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_){let e={segmentInfo:oP({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:e})}if(!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}let e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_});let t=((e,t)=>{var i;let r;if("hls"!==t)return null;let n=(i={audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo},r=0,["video","audio"].forEach(function(e){let t,n=i[`${e}TimingInfo`];if(!n)return;let{start:s,end:a}=n;"bigint"==typeof s||"bigint"==typeof a?t=p().BigInt(a)-p().BigInt(s):"number"==typeof s&&"number"==typeof a&&(t=a-s),void 0!==t&&t>r&&(r=t)}),"bigint"==typeof r&&r<Number.MAX_SAFE_INTEGER&&(r=Number(r)),r);if(!n)return null;let s=e.playlist.targetDuration,a=oL({segmentDuration:n,maxDuration:2*s}),o=oL({segmentDuration:n,maxDuration:s}),l=`Segment with index ${e.mediaIndex} from playlist ${e.playlist.id} has a duration of ${n} when the reported duration is ${e.duration} and the target duration is ${s}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return a||o?{severity:a?"warn":"info",message:l}:null})(e,this.sourceType_);if(t&&("warn"===t.severity?sL.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_))return void this.logger_(`Throwing away un-appended sync request ${oD(e)}`);this.logger_(`Appended ${oD(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),"main"!==this.loaderType_||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");let i=e.segment,r=e.part,n=i.end&&this.currentTime_()-i.end>3*e.playlist.targetDuration,s=r&&r.end&&this.currentTime_()-r.end>3*e.playlist.partTargetDuration;if(n||s){this.logger_(`bad ${n?"segment":"part"} ${oD(e)}`),this.resetEverything();return}null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_
71(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duration<ox)return void this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record ${ox}`);let t=this.throughput.rate,i=Date.now()-e.endOfAllRequests+1,r=Math.floor(e.byteLength/i*8e3);this.throughput.rate+=(r-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;let t=e.segment,i=t.start,r=t.end;if(!ok(i)||!ok(r))return;ow(i,r,this.segmentMetadataTrack_);let n=p().WebKitDataCue||p().VTTCue,s={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,programDateTime:t.programDateTime,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:i,end:r},a=new n(i,r,JSON.stringify(s));a.value=s,this.segmentMetadataTrack_.addCue(a)}}function oM(){}let oR=function(e){return"string"!=typeof e?e:e.replace(/./,e=>e.toUpperCase())},o$=["video","audio"],oU=(e,t)=>{let i=t[`${e}Buffer`];return i&&i.updating||t.queuePending[e]},oB=(e,t)=>{if(0===t.queue.length)return;let i=0,r=t.queue[i];if("mediaSource"===r.type){t.updating()||"closed"===t.mediaSource.readyState||(t.queue.shift(),r.action(t),r.doneFn&&r.doneFn(),oB("audio",t),oB("video",t));return}if("mediaSource"!==e&&!(!t.ready()||"closed"===t.mediaSource.readyState||oU(e,t))){if(r.type!==e){if(null===(i=((e,t)=>{for(let i=0;i<t.length;i++){let r=t[i];if("mediaSource"===r.type)break;if(r.type===e)return i}return null})(e,t.queue)))return;r=t.queue[i]}if(t.queue.splice(i,1),t.queuePending[e]=r,r.action(e,t),!r.doneFn){t.queuePending[e]=null,oB(e,t);return}}},oj=(e,t)=>{let i=t[`${e}Buffer`],r=oR(e);i&&(i.removeEventListener("updateend",t[`on${r}UpdateEnd_`]),i.removeEventListener("error",t[`on${r}Error_`]),t.codecs[e]=null,t[`${e}Buffer`]=null)},oq=(e,t)=>e&&t&&-1!==Array.prototype.indexOf.call(e.sourceBuffers,t),oF=(e,t)=>(i,r)=>{let n=r[`${i}Buffer`];if(oq(r.mediaSource,n)){r.logger_(`Removing ${e} to ${t} from ${i}Buffer`);try{n.remove(e,t)}catch(n){r.logger_(`Remove ${e} to ${t} from ${i}Buffer failed`)}}},oH=e=>(t,i)=>{let r=i[`${t}Buffer`];oq(i.mediaSource,r)&&(i.logger_(`Setting ${t}timestampOffset to ${e}`),r.timestampOffset=e)},oz=e=>(t,i)=>{e()},oV=({type:e,sourceUpdater:t,action:i,doneFn:r,name:n})=>{t.queue.push({type:e,action:i,doneFn:r,name:n}),oB(e,t)},oW=(e,t)=>i=>{let r=function(e){if(0===e.length)return"Buffered Ranges are empty";let t="Buffered Ranges: \n";for(let i=0;i<e.length;i++){let r=e.start(i),n=e.end(i);t+=`${r} --> ${n}. Duration (${n-r})
72`}return t}(t[`${e}Buffered`]());if(t.logger_(`received "updateend" event for ${e} Source Buffer: `,r),t.queuePending[e]){let i=t.queuePending[e].doneFn;t.queuePending[e]=null,i&&i(t[`${e}Error_`])}oB(e,t)};class oG extends sL.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>oB("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=sB("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=oW("video",this),this.onAudioUpdateEnd_=oW("audio",this),this.onVideoError_=e=>{this.videoError_=e},this.onAudioError_=e=>{this.audioError_=e},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}
72triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){let i,r;oV({type:"mediaSource",sourceUpdater:this,action:(i=e,r=t,e=>{let t=oR(i),n=q(r);e.logger_(`Adding ${i}Buffer with codec ${r} to mediaSource`);let s=e.mediaSource.addSourceBuffer(n);s.addEventListener("updateend",e[`on${t}UpdateEnd_`]),s.addEventListener("error",e[`on${t}Error_`]),e.codecs[i]=r,e[`${i}Buffer`]=s}),name:"addSourceBuffer"})}abort(e){oV({type:e,sourceUpdater:this,action:(e,t)=>{if("open"!==t.mediaSource.readyState)return;let i=t[`${e}Buffer`];if(oq(t.mediaSource,i)){t.logger_(`calling abort on ${e}Buffer`);try{i.abort()}catch(t){sL.log.warn(`Failed to abort on ${e}Buffer`,t)}}},name:"abort"})}removeSourceBuffer(e){let t;if(!this.canRemoveSourceBuffer())return void sL.log.error("removeSourceBuffer is not supported!");oV({type:"mediaSource",sourceUpdater:this,action:(t=e,e=>{let i=e[`${t}Buffer`];if(oj(t,e),oq(e.mediaSource,i)){e.logger_(`Removing ${t}Buffer with codec ${e.codecs[t]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(i)}catch(e){sL.log.warn(`Failed to removeSourceBuffer ${t}Buffer`,e)}}}),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!sL.browser.IS_FIREFOX&&p().MediaSource&&p().MediaSource.prototype&&"function"==typeof p().MediaSource.prototype.removeSourceBuffer}static canChangeType(){return p().SourceBuffer&&p().SourceBuffer.prototype&&"function"==typeof p().SourceBuffer.prototype.changeType}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){let i;if(!this.canChangeType())return void sL.log.error("changeType is not supported!");oV({type:e,sourceUpdater:this,action:(i=t,(e,t)=>{let r=t[`${e}Buffer`],n=q(i);if(!oq(t.mediaSource,r))return;let s=i.substring(0,i.indexOf(".")),a=t.codecs[e];if(a.substring(0,a.indexOf("."))===s)return;let o={codecsChangeInfo:{from:a,to:i}};t.trigger({type:"codecschange",metadata:o}),t.logger_(`changing ${e}Buffer codec from ${a} to ${i}`);try{r.changeType(n),t.codecs[e]=i}catch(i){o.errorType=sL.Error.StreamingCodecsChangeError,o.error=i,i.metadata=o,t.error_=i,t.trigger("error"),sL.log.warn(`Failed to changeType on ${e}Buffer`,i)}}),name:"changeType"})}addOrChangeSourceBuffers(e){if(!e||"object"!=typeof e||0===Object.keys(e).length)throw Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{let i=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,i);this.canChangeType()&&this.changeType(t,i)})}appendBuffer(e,t){let i,r,n,{segmentInfo:s,type:a,bytes:o}=e;if(this.processedAppend_=!0,"audio"===a&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,t]),this.logger_(`delayed audio append of ${o.length} until video append`);return}if(oV({type:a,sourceUpdater:this,action:(i=o,r=s||{mediaIndex:-1},n=t,(e,t)=>{let s=t[`${e}Buffer`];if(oq(t.mediaSource,s)){t.logger_(`Appending segment ${r.mediaIndex}'s ${i.length} bytes to ${e}Buffer`);try{s.appendBuffer(i)}catch(i){t.logger_(`Error with code ${i.code} `+(22===i.code?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${r.mediaIndex} to ${e}Buffer`),t.queuePending[e]=null,n(i)}}}),doneFn:t,name:"appendBuffer"}),"video"===a){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;let e=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${e.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,e.forEach(e=>{this.appendBuffer.apply(this,e)})}}audioBuffered(){return oq(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:sq()}videoBuffered(){return oq(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:sq()}buffered(){let e=oq(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=oq(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():sX(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=oM){let i;oV({type:"mediaSource",sourceUpdater:this,action:(i=e,e=>{e.logger_(`Setting mediaSource duration to ${i}`);try{e.mediaSource.duration=i}catch(e){sL.log.warn("Failed to set media source duration",e)}}),name:"duration",doneFn:t})}endOfStream(e=null,t=oM){let i;"string"!=typeof e&&(e=void 0),oV({type:"mediaSource",sourceUpdater:this,action:(i=e,e=>{if("open"===e.mediaSource.readyState){e.logger_(`Calling mediaSource endOfStream(${i||""})`);try{e.mediaSource.endOfStream(i)}catch(e){sL.log.warn("Failed to call media source endOfStream",e)}}}),name:"endOfStream",doneFn:t})}removeAudio(e,t,i=oM){if(!this.audioBuffered().length||0===this.audioBuffered().end(0))return void i();oV({type:"audio",sourceUpdater:this,action:oF(e,t),doneFn:i,name:"remove"})}removeVideo(e,t,i=oM){if(!this.videoBuffered().length||0===this.videoBuffered().end(0))return void i();oV({type:"video",sourceUpdater:this,action:oF(e,t),doneFn:i,name:"remove"})}updating(){return!!(oU("audio",this)||oU("video",this))}audioTimestampOffset(e){return void 0!==e&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(oV({type:"audio",sourceUpdater:this,action:oH(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return void 0!==e&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(oV({type:"video",sourceUpdater:this,action:oH(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&oV({type:"audio",sourceUpdater:this,action:oz(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&oV({type:"video",sourceUpdater:this,action:oz(e),name:"callback"})}
72dispose(){this.trigger("dispose"),o$.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>oj(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}let oX=e=>decodeURIComponent(escape(String.fromCharCode.apply(null,e))),oY=new Uint8Array("\n\n".split("").map(e=>e.charCodeAt(0)));class oK extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class oQ extends oN{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return sq();let e=this.subtitlesTrack_.cues;return sq([[e[0].startTime,e[e.length-1].startTime]])}initSegmentForMap(e,t=!1){if(!e)return null;let i=aN(e),r=this.initSegments_[i];if(t&&!r&&e.bytes){let t=new Uint8Array(oY.byteLength+e.bytes.byteLength);t.set(e.bytes),t.set(oY,e.bytes.byteLength),this.initSegments_[i]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:t}}return r||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return void 0===e||(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_}remove(e,t){ow(e,t,this.subtitlesTrack_)}fillBuffer_(){let e=this.chooseNextRequest_();if(e){if(null===this.syncController_.timestampOffsetForTimeline(e.timeline)){this.syncController_.one("timestampoffset",()=>{this.state="READY",this.paused()||this.monitorBuffer_()}),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,i){if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){-101===e.code&&this.handleTimeout_(),-102===e.code?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}let r=this.pendingSegment_,n=i.mp4VttCues&&i.mp4VttCues.length;n&&(r.mp4VttCues=i.mp4VttCues),this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");let s=r.segment;if(s.map&&(s.map.bytes=t.map.bytes),r.bytes=t.bytes,"function"!=typeof p().WebVTT&&"function"==typeof this.loadVttJs){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,i),()=>this.stopForError({message:"Error loading vtt.js"}));return}s.requested=!0;try{this.parseVTTCues_(r)}catch(e){this.stopForError({message:e.message,metadata:{errorType:sL.Error.StreamingVttParserError,error:e}});return}if(n||this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=s.duration,r.cues.forEach(e=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new(p()).VTTCue(e.startTime,e.endTime,e.text):e)}),oS(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(e,t){let i=e&&"vtt"===e.type,r=t&&"text"===t.type;i&&r&&super.handleData_(e,t)}updateTimingInfoEnd_(){}parseMp4VttCues_(e){let t=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();
72e.mp4VttCues.forEach(i=>{let r=i.start+t,n=i.end+t,s=new(p()).VTTCue(r,n,i.cueText);i.settings&&i.settings.split(" ").forEach(e=>{let t=e.split(":"),i=t[0],r=t[1];s[i]=isNaN(r)?r:Number(r)}),e.cues.push(s)})}parseVTTCues_(e){let t,i=!1;if("function"!=typeof p().WebVTT)throw new oK;if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},e.mp4VttCues)return void this.parseMp4VttCues_(e);"function"==typeof p().TextDecoder?t=new(p()).TextDecoder("utf8"):(t=p().WebVTT.StringDecoder(),i=!0);let r=new(p()).WebVTT.Parser(p(),p().vttjs,t);if(r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=t=>{e.timestampmap=t},r.onparsingerror=e=>{sL.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){let t=e.segment.map.bytes;i&&(t=oX(t)),r.parse(t)}let n=e.bytes;i&&(n=oX(n)),r.parse(n),r.flush()}updateTimeMapping_(e,t,i){let r=e.segment;if(!t)return;if(!e.cues.length){r.empty=!0;return}let{MPEGTS:n,LOCAL:s}=e.timestampmap,a=n/to.ONE_SECOND_IN_TS-s+t.mapping;if(e.cues.forEach(e=>{let i=e.endTime-e.startTime,r=this.handleRollover_(e.startTime+a,t.time);e.startTime=Math.max(r,0),e.endTime=Math.max(r+i,0)}),!i.syncInfo){let t=e.cues[0].startTime,n=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(t,n-r.duration)}}}handleRollover_(e,t){let i;if(null===t)return e;let r=e*to.ONE_SECOND_IN_TS,n=t*to.ONE_SECOND_IN_TS;for(i=n<r?-0x200000000:0x200000000;Math.abs(r-n)>0x100000000;)r+=i;return r/to.ONE_SECOND_IN_TS}}let oJ=function(e,t){let i=e.cues;for(let e=0;e<i.length;e++){let r=i[e];if(t>=r.adStartTime&&t<=r.adEndTime)return r}return null},oZ=function(e,t,i=0){let r;if(!e.segments)return;let n=i;for(let i=0;i<e.segments.length;i++){let s=e.segments[i];if(r||(r=oJ(t,n+s.duration/2)),r){if("cueIn"in s){r.endTime=n,r.adEndTime=n,n+=s.duration,r=null;continue}if(n<r.endTime){n+=s.duration;continue}r.endTime+=s.duration}else if("cueOut"in s&&((r=new(p()).VTTCue(n,n+s.duration,s.cueOut)).adStartTime=n,r.adEndTime=n+parseFloat(s.cueOut),t.addCue(r)),"cueOutCont"in s){let[e,i]=s.cueOutCont.split("/").map(parseFloat);(r=new(p()).VTTCue(n,n+s.duration,"")).adStartTime=n-e,r.adEndTime=r.adStartTime+i,t.addCue(r)}n+=s.duration}};class o0{constructor({start:e,end:t,segmentIndex:i,partIndex:r=null,appended:n=!1}){this.start_=e,this.end_=t,this.segmentIndex_=i,this.partIndex_=r,this.appended_=n}isInRange(e){return e>=this.start&&e<this.end}markAppended(){this.appended_=!0}resetAppendedStatus(){this.appended_=!1}get isAppended(){return this.appended_}get start(){return this.start_}get end(){return this.end_}get segmentIndex(){return this.segmentIndex_}get partIndex(){return this.partIndex_}}class o1{constructor(e,t=[]){this.segmentSyncInfo_=e,this.partsSyncInfo_=t}get segmentSyncInfo(){return this.segmentSyncInfo_}get partsSyncInfo(){return this.partsSyncInfo_}get hasPartsSyncInfo(){return this.partsSyncInfo_.length>0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class o2{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,t){let{mediaSequence:i,segments:r}=e;if(this.isReliable_=this.isReliablePlaylist_(i,r),this.isReliable_)return this.updateStorage_(r,i,this.calculateBaseTime_(i,r,t))}getSyncInfoForTime(e){for(let{segmentSyncInfo:t,partsSyncInfo:i}of this.storage_.values())if(i.length){for(let t of i)if(t.isInRange(e))return t}else if(t.isInRange(e))return t;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,t,i){let r=new Map,n="\n",s=i,a=t;this.start_=s,e.forEach((e,t)=>{let i=this.storage_.get(a),o=s,l=o+e.duration,u=!!(i&&i.segmentSyncInfo&&i.segmentSyncInfo.isAppended),d=new o0({start:o,end:l,appended:u,segmentIndex:t});e.syncInfo=d;let c=s,h=(e.parts||[]).map((e,r)=>{let s=c,o=c+e.duration,l=!!(i&&i.partsSyncInfo&&i.partsSyncInfo[r]&&i.partsSyncInfo[r].isAppended),u=new o0({start:s,end:o,appended:l,segmentIndex:t,partIndex:r});return c=o,n+=`Media Sequence: ${a}.${r} | Range: ${s} --> ${o} | Appended: ${l}
73`,e.syncInfo=u,u});r.set(a,new o1(d,h)),n+=`${om(e.resolvedUri)} | Media Sequence: ${a} | Range: ${o} --> ${l} | Appended: ${u}
74`,a++,s=l}),this.end_=s,this.storage_=r,this.diagnostics_=n}calculateBaseTime_(e,t,i){if(!this.storage_.size)return 0;if(this.storage_.has(e))return this.storage_.get(e).segmentSyncInfo.start;let r=Math.min(...this.storage_.keys());if(e<r){let i=r-e,n=this.storage_.get(r).segmentSyncInfo.start;for(let e=0;e<i;e++)n-=t[e].duration;return n}return i}isReliablePlaylist_(e,t){return null!=e&&Array.isArray(t)&&t.length}}class o4 extends o2{constructor(e){super(),this.parent_=e}calculateBaseTime_(e,t,i){if(!this.storage_.size){let t=this.parent_.getSyncInfoForMediaSequence(e);return t?t.segmentSyncInfo.start:0}return super.calculateBaseTime_(e,t,i)}}let o8=[{name:"VOD",run:(e,t,i,r,n)=>i!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(e,t,i,r,n,s)=>{let a=e.getMediaSequenceSync(s);if(!a||!a.isReliable)return null;let o=a.getSyncInfoForTime(n);return o?{time:o.start,partIndex:o.partIndex,segmentIndex:o.segmentIndex}:null}},{name:"ProgramDateTime",run:(e,t,i,r,n)=>{if(!Object.keys(e.timelineToDatetimeMappings).length)return null;let s=null,a=null,o=s1(t);n=n||0;for(let i=0;i<o.length;i++){let r=t.endList||0===n?i:o.length-(i+1),l=o[r],u=l.segment,d=e.timelineToDatetimeMappings[u.timeline];if(!d||!u.dateTimeObject)continue;let c=u.dateTimeObject.getTime()/1e3+d;if(u.parts&&"number"==typeof l.partIndex)for(let e=0;e<l.partIndex;e++)c+=u.parts[e].duration;let h=Math.abs(n-c);if(null!==a&&(0===h||a<h))break;a=h,s={time:c,segmentIndex:l.segmentIndex,partIndex:l.partIndex}}return s}},{name:"Segment",run:(e,t,i,r,n)=>{let s=null,a=null;n=n||0;let o=s1(t);for(let e=0;e<o.length;e++){let i=t.endList||0===n?e:o.length-(e+1),l=o[i],u=l.segment,d=l.part&&l.part.start||u&&u.start;if(u.timeline===r&&void 0!==d){let e=Math.abs(n-d);if(null!==a&&a<e)break;(!s||null===a||a>=e)&&(a=e,s={time:d,segmentIndex:l.segmentIndex,partIndex:l.partIndex})}}return s}},{name:"Discontinuity",run:(e,t,i,r,n)=>{let s=null;if(n=n||0,t.discontinuityStarts&&t.discontinuityStarts.length){let i=null;for(let r=0;r<t.discontinuityStarts.length;r++){let a=t.discontinuityStarts[r],o=t.discontinuitySequence+r+1,l=e.discontinuities[o];if(l){let e=Math.abs(n-l.time);if(null!==i&&i<e)break;(!s||null===i||i>=e)&&(i=e,s={time:l.time,segmentIndex:a,partIndex:null})}}}return s}},{name:"Playlist",run:(e,t,i,r,n)=>t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}];class o3 extends sL.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};let t=new o2,i=new o4(t),r=new o4(t);this.mediaSequenceStorage_={main:t,audio:i,vtt:r},this.logger_=sB("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}
74getSyncPoint(e,t,i,r,n){if(t!==1/0)return o8.find(({name:e})=>"VOD"===e).run(this,e,t);let s=this.runStrategies_(e,t,i,r,n);if(!s.length)return null;for(let t of s){let{syncPoint:i,strategy:n}=t,{segmentIndex:s,time:a}=i;if(s<0)continue;let o=a+e.segments[s].duration;if(this.logger_(`Strategy: ${n}. Current time: ${r}. selected segment: ${s}. Time: [${a} -> ${o}]}`),r>=a&&r<o)return this.logger_("Found sync point with exact match: ",i),i}return this.selectSyncPoint_(s,{key:"time",value:r})}getExpiredTime(e,t){if(!e||!e.segments)return null;let i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length)return null;let r=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});return r.segmentIndex>0&&(r.time*=-1),Math.abs(r.time+s9({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,t,i,r,n){let s=[];for(let a=0;a<o8.length;a++){let o=o8[a],l=o.run(this,e,t,i,r,n);l&&(l.strategy=o.name,s.push({strategy:o.name,syncPoint:l}))}return s}selectSyncPoint_(e,t){let i=e[0].syncPoint,r=Math.abs(e[0].syncPoint[t.key]-t.value),n=e[0].strategy;for(let s=1;s<e.length;s++){let a=Math.abs(e[s].syncPoint[t.key]-t.value);a<r&&(r=a,i=e[s].syncPoint,n=e[s].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${n}]: [time:${i.time}, segmentIndex:${i.segmentIndex}`+("number"==typeof i.partIndex?`,partIndex:${i.partIndex}`:"")+"]"),i}saveExpiredSegmentInfo(e,t){let i=t.mediaSequence-e.mediaSequence;if(i>86400)return void sL.log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);for(let r=i-1;r>=0;r--){let i=e.segments[r];if(i&&void 0!==i.start){t.syncInfo={mediaSequence:e.mediaSequence+r,time:i.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){let t=e.segments[0],i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){let i=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),r=e.segment;i&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:r.start}));let n=r.dateTimeObject;r.discontinuity&&t&&n&&(this.timelineToDatetimeMappings[r.timeline]=-(n.getTime()/1e3))}timestampOffsetForTimeline(e){return void 0===this.timelines[e]?null:this.timelines[e].time}mappingForTimeline(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,i){let r,n,s=e.segment,a=e.part,o=this.timelines[e.timeline];if("number"==typeof e.timestampOffset)o={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=o,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${o.time}] [mapping: ${o.mapping}]`)),r=e.startOfSegment,n=t.end+o.mapping;else{if(!o)return!1;r=t.start+o.mapping,n=t.end+o.mapping}return a&&(a.start=r,a.end=n),(!s.start||r<s.start)&&(s.start=r),s.end=n,!0}saveDiscontinuitySyncInfo_(e){let t=e.playlist,i=e.segment;if(i.discontinuity)this.discontinuities[i.timeline]={time:i.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(let r=0;r<t.discontinuityStarts.length;r++){let n=t.discontinuityStarts[r],s=t.discontinuitySequence+r+1,a=n-e.mediaIndex,o=Math.abs(a);if(!this.discontinuities[s]||this.discontinuities[s].accuracy>o){let r;r=a<0?i.start-s9({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:n}):i.end+s9({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:n}),this.discontinuities[s]={time:r,accuracy:o}}}}dispose(){this.trigger("dispose"),this.off()}}class o5 extends sL.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:i}){return"number"==typeof t&&"number"==typeof i&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:i},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:i}){return"number"==typeof t&&"number"==typeof i&&(this.lastTimelineChanges_[e]={type:e,from:t,to:i},delete this.pendingTimelineChanges_[e],this.trigger({type:"timelinechange",metadata:{timelineChangeInfo:{from:t,to:i}}})),this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}var o6=aY(aK(aQ(function(){var e,t,r=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(i,1),i>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2==arguments.length)for(var i=t.length,r=0;r<i;++r)t[r].call(this,arguments[1]);
74else for(var n=Array.prototype.slice.call(arguments,1),s=t.length,a=0;a<s;++a)t[a].apply(this,n)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",function(t){e.push(t)})},e}();let n=function(){let e,t,i,r,n,s,a,o,l=[[[],[],[],[],[]],[[],[],[],[],[]]],u=l[0],d=l[1],c=u[4],h=d[4],p=[],f=[];for(e=0;e<256;e++)f[(p[e]=e<<1^(e>>7)*283)^e]=e;for(t=i=0;!c[t];t^=r||1,i=f[i]||1)for(e=0,s=(s=i^i<<1^i<<2^i<<3^i<<4)>>8^255&s^99,c[t]=s,h[s]=t,o=0x1010101*p[n=p[r=p[t]]]^65537*n^257*r^0x1010100*t,a=257*p[s]^0x1010100*s;e<4;e++)u[e][t]=a=a<<24^a>>>8,d[e][s]=o=o<<24^o>>>8;for(e=0;e<5;e++)u[e]=u[e].slice(0),d[e]=d[e].slice(0);return l},s=null;class a{constructor(e){let t,i,r;s||(s=n()),this._tables=[[s[0][0].slice(),s[0][1].slice(),s[0][2].slice(),s[0][3].slice(),s[0][4].slice()],[s[1][0].slice(),s[1][1].slice(),s[1][2].slice(),s[1][3].slice(),s[1][4].slice()]];let a=this._tables[0][4],o=this._tables[1],l=e.length,u=1;if(4!==l&&6!==l&&8!==l)throw Error("Invalid aes key size");let d=e.slice(0),c=[];for(this._key=[d,c],t=l;t<4*l+28;t++)r=d[t-1],(t%l==0||8===l&&t%l==4)&&(r=a[r>>>24]<<24^a[r>>16&255]<<16^a[r>>8&255]<<8^a[255&r],t%l==0&&(r=r<<8^r>>>24^u<<24,u=u<<1^(u>>7)*283)),d[t]=d[t-l]^r;for(i=0;t;i++,t--)r=d[3&i?t:t-4],t<=4||i<4?c[i]=r:c[i]=o[0][a[r>>>24]]^o[1][a[r>>16&255]]^o[2][a[r>>8&255]]^o[3][a[255&r]]}decrypt(e,t,i,r,n,s){let a,o,l,u,d=this._key[1],c=e^d[0],h=r^d[1],p=i^d[2],f=t^d[3],m=d.length/4-2,g=4,y=this._tables[1],v=y[0],_=y[1],b=y[2],T=y[3],w=y[4];for(u=0;u<m;u++)a=v[c>>>24]^_[h>>16&255]^b[p>>8&255]^T[255&f]^d[g],o=v[h>>>24]^_[p>>16&255]^b[f>>8&255]^T[255&c]^d[g+1],l=v[p>>>24]^_[f>>16&255]^b[c>>8&255]^T[255&h]^d[g+2],f=v[f>>>24]^_[c>>16&255]^b[h>>8&255]^T[255&p]^d[g+3],g+=4,c=a,h=o,p=l;for(u=0;u<4;u++)n[(3&-u)+s]=w[c>>>24]<<24^w[h>>16&255]<<16^w[p>>8&255]<<8^w[255&f]^d[g++],a=c,c=h,h=p,p=f,f=a}}class o extends r{constructor(){super(r),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}let l=function(e){return e<<24|(65280&e)<<8|(0xff0000&e)>>8|e>>>24},u=function(e,t,i){let r,n,s,o,u,d,c,h,p,f=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),m=new a(Array.prototype.slice.call(t)),g=new Uint8Array(e.byteLength),y=new Int32Array(g.buffer);for(p=0,r=i[0],n=i[1],s=i[2],o=i[3];p<f.length;p+=4)u=l(f[p]),d=l(f[p+1]),c=l(f[p+2]),h=l(f[p+3]),m.decrypt(u,d,c,h,y,p),y[p]=l(y[p]^r),y[p+1]=l(y[p+1]^n),y[p+2]=l(y[p+2]^s),y[p+3]=l(y[p+3]^o),r=u,n=d,s=c,o=h;return g};class d{constructor(e,t,i,r){let n=d.STEP,s=new Int32Array(e.buffer),a=new Uint8Array(e.byteLength),u=0;for(this.asyncStream_=new o,this.asyncStream_.push(this.decryptChunk_(s.subarray(u,u+n),t,i,a)),u=n;u<s.length;u+=n)i=new Uint32Array([l(s[u-4]),l(s[u-3]),l(s[u-2]),l(s[u-1])]),this.asyncStream_.push(this.decryptChunk_(s.subarray(u,u+n),t,i,a));this.asyncStream_.push(function(){r(null,a.subarray(0,a.byteLength-a[a.byteLength-1]))})}static get STEP(){return 32e3}decryptChunk_(e,t,i,r){return function(){let n=u(e,t,i);r.set(n,e.byteOffset)}}}var c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},h=("undefined"!=typeof window?window:void 0!==c?c:"undefined"!=typeof self?self:{}).BigInt||Number;h("0x1"),h("0x100"),h("0x10000"),h("0x1000000"),h("0x100000000"),h("0x10000000000"),h("0x1000000000000"),h("0x100000000000000"),h("0x10000000000000000"),255===(t=new Uint8Array((e=new Uint16Array([65484])).buffer,e.byteOffset,e.byteLength))[0]||t[0];let p=function(e){let t={};return Object.keys(e).forEach(i=>{let r=e[i];("function"===ArrayBuffer.isView?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer)?t[i]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:t[i]=r}),t};self.onmessage=function(e){let t=e.data,i=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength);new d(i,new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4),function(e,i){self.postMessage(p({source:t.source,decrypted:i}),[i.buffer])})}})));let o7=e=>{let t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},o9=(e,t)=>{e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},le=(e,t)=>
74{t.activePlaylistLoader=e,e.load()},lt={AUDIO:(e,t)=>()=>{let{mediaTypes:{[e]:i},excludePlaylist:r}=t,n=i.activeTrack(),s=i.activeGroup(),a=(s.filter(e=>e.default)[0]||s[0]).id,o=i.tracks[a];if(n===o)return void r({error:{message:"Problem encountered loading the default audio track."}});for(let e in sL.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),i.tracks)i.tracks[e].enabled=i.tracks[e]===o;i.onTrackChanged()},SUBTITLES:(e,t)=>()=>{let{mediaTypes:{[e]:i}}=t;sL.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");let r=i.activeTrack();r&&(r.mode="disabled"),i.onTrackChanged()}},li={AUDIO:(e,t,i)=>{if(!t)return;let{tech:r,requestOptions:n,segmentLoaders:{[e]:s}}=i;t.on("loadedmetadata",()=>{let e=t.media();s.playlist(e,n),(!r.paused()||e.endList&&"none"!==r.preload())&&s.load()}),t.on("loadedplaylist",()=>{s.playlist(t.media(),n),r.paused()||s.load()}),t.on("error",lt[e](e,i))},SUBTITLES:(e,t,i)=>{let{tech:r,requestOptions:n,segmentLoaders:{[e]:s},mediaTypes:{[e]:a}}=i;t.on("loadedmetadata",()=>{let e=t.media();s.playlist(e,n),s.track(a.activeTrack()),(!r.paused()||e.endList&&"none"!==r.preload())&&s.load()}),t.on("loadedplaylist",()=>{s.playlist(t.media(),n),r.paused()||s.load()}),t.on("error",lt[e](e,i))}},lr={AUDIO:(e,t)=>{let{vhs:i,sourceType:r,segmentLoaders:{[e]:n},requestOptions:s,main:{mediaGroups:a},mediaTypes:{[e]:{groups:o,tracks:l,logger_:u}},mainPlaylistLoader:d}=t,c=al(d.main);for(let n in(!a[e]||0===Object.keys(a[e]).length)&&(a[e]={main:{default:{default:!0}}},c&&(a[e].main.default.playlists=d.main.playlists)),a[e])for(let h in o[n]||(o[n]=[]),a[e][n]){let p,f=a[e][n][h];if(c?(u(`AUDIO group '${n}' label '${h}' is a main playlist`),f.isMainPlaylist=!0,p=null):p="vhs-json"===r&&f.playlists?new ak(f.playlists[0],i,s):f.resolvedUri?new ak(f.resolvedUri,i,s):f.playlists&&"dash"===r?new aV(f.playlists[0],i,s,d):null,f=sj({id:h,playlistLoader:p},f),li[e](e,f.playlistLoader,t),o[n].push(f),void 0===l[h]){let e=new sL.AudioTrack({id:h,kind:o7(f),enabled:!1,language:f.language,default:f.default,label:h});l[h]=e}}n.on("error",lt[e](e,t))},SUBTITLES:(e,t)=>{let{tech:i,vhs:r,sourceType:n,segmentLoaders:{[e]:s},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[e]:{groups:l,tracks:u}},mainPlaylistLoader:d}=t;for(let s in o[e])for(let c in l[s]||(l[s]=[]),o[e][s]){let h;if(!r.options_.useForcedSubtitles&&o[e][s][c].forced)continue;let p=o[e][s][c];if("hls"===n)h=new ak(p.resolvedUri,r,a);else if("dash"===n){if(!p.playlists.filter(e=>e.excludeUntil!==1/0).length)return;h=new aV(p.playlists[0],r,a,d)}else"vhs-json"===n&&(h=new ak(p.playlists?p.playlists[0]:p.resolvedUri,r,a));if(p=sj({id:c,playlistLoader:h},p),li[e](e,p.playlistLoader,t),l[s].push(p),void 0===u[c]){let e=i.addRemoteTextTrack({id:c,kind:"subtitles",default:p.default&&p.autoselect,language:p.language,label:c},!1).track;u[c]=e}}s.on("error",lt[e](e,t))},"CLOSED-CAPTIONS":(e,t)=>{let{tech:i,main:{mediaGroups:r},mediaTypes:{[e]:{groups:n,tracks:s}}}=t;for(let t in r[e])for(let a in n[t]||(n[t]=[]),r[e][t]){let o=r[e][t][a];if(!/^(?:CC|SERVICE)/.test(o.instreamId))continue;let l=i.options_.vhs&&i.options_.vhs.captionServices||{},u={label:a,language:o.language,instreamId:o.instreamId,default:o.default&&o.autoselect};if(l[u.instreamId]&&(u=sj(u,l[u.instreamId])),void 0===u.default&&delete u.default,n[t].push(sj({id:a},o)),void 0===s[a]){let e=i.addRemoteTextTrack({id:u.instreamId,kind:"captions",default:u.default,language:u.language,label:u.label},!1).track;s[a]=e}}}},ln=(e,t)=>{for(let i=0;i<e.length;i++)if(aa(t,e[i])||e[i].playlists&&ln(e[i].playlists,t))return!0;return!1},ls={AUDIO:(e,t)=>()=>{let{mediaTypes:{[e]:{tracks:i}}}=t;for(let e in i)if(i[e].enabled)return i[e];return null},SUBTITLES:(e,t)=>()=>{let{mediaTypes:{[e]:{tracks:i}}}=t;for(let e in i)if("showing"===i[e].mode||"hidden"===i[e].mode)return i[e];return null}};class la{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){1===e&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=w(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(e=>[e.ID,e])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class lo extends sL.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new la,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=sB("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";let i=t.serverUri||t.serverURL;if(!i){this.logger_(`steering manifest URL is ${i}, cannot request steering manifest.`),this.trigger("error");return}if(i.startsWith("data:"))return void this.decodeDataUriManifest_(i.substring(i.indexOf(",")+1));this.steeringManifest.reloadUri=w(e,i),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(e){let t=this.steeringManifest.reloadUri;if(!t)return;let i=e?t:this.getRequestURI(t);if(!i){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}let r={contentSteeringInfo:{uri:i}};this.trigger({type:"contentsteeringloadstart",metadata:r}),this.request_=this.xhr_({uri:i,requestType:"content-steering-manifest"},(e,t)=>{let n;if(e){if(410===t.status){this.logger_(`manifest request 410 ${e}.`),this.logger_(`There will be no more content steering requests to ${i} this session.`),this.excludedSteeringManifestURLs.add(i);return}if(429===t.status){let i=t.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${e}.`),this.logger_(`content steering will retry in ${i} seconds.`),this.startTTLTimeout_(parseInt(i,10));return}this.logger_(`manifest failed to load ${e}.`),this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:r});try{n=JSON.parse(this.request_.responseText)}catch(t){let e={errorType:sL.Error.StreamingContentSteeringParserError,error:t};this.trigger({type:"error",metadata:e})}this.assignSteeringProperties_(n);let s={contentSteeringInfo:r.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:s}),this.startTTLTimeout_()})}
74setProxyServerUrl_(e){let t=new(p()).URL(e),i=new(p()).URL(this.proxyServerUrl_);return i.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(i.toString())}decodeDataUriManifest_(e){let t=JSON.parse(p().atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){let t=new(p()).URL(e),i=this.getPathway(),r=this.getBandwidth_();if(i){let e=`_${this.manifestType_}_pathway`;t.searchParams.set(e,i)}if(r){let e=`_${this.manifestType_}_throughput`;t.searchParams.set(e,r)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),this.trigger("error");return}this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());let t=(e=>{for(let t of e)if(this.availablePathways_.has(t))return t;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==t&&(this.currentPathway=t,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;let t=e=>this.excludedSteeringManifestURLs.has(e);if(this.proxyServerUrl_){let i=this.setProxyServerUrl_(e);if(!t(i))return i}let i=this.setSteeringParams_(e);return t(i)?null:i}startTTLTimeout_(e=this.steeringManifest.ttl){this.ttlTimeout_=p().setTimeout(()=>{this.requestSteeringManifest()},1e3*e)}clearTTLTimeout_(){p().clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new la}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(w(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}let ll=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],lu=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},ld=function({currentPlaylist:e,buffered:t,currentTime:i,nextPlaylist:r,bufferLowWaterLine:n,bufferHighWaterLine:s,duration:a,bufferBasedABR:o,log:l}){if(!r)return sL.log.warn("We received no playlist to switch to. Please check your stream."),!1;let u=`allowing switch ${e&&e.id||"null"} -> ${r.id}`;if(!e)return l(`${u} as current playlist is not set`),!0;if(r.id===e.id)return!1;let d=!!sV(t,i).length;if(!e.endList)return d||"number"!=typeof e.partTargetDuration?(l(`${u} as current playlist is live`),!0):(l(`not ${u} as current playlist is live llhls, but currentTime isn't in buffered.`),!1);let c=sZ(t,i),h=o?aW.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:aW.MAX_BUFFER_LOW_WATER_LINE;if(a<h)return l(`${u} as duration < max low water line (${a} < ${h})`),!0;let p=r.attributes.BANDWIDTH,f=e.attributes.BANDWIDTH;if(p<f&&(!o||c<s)){let e=`${u} as next bandwidth < current bandwidth (${p} < ${f})`;return o&&(e+=` and forwardBuffer < bufferHighWaterLine (${c} < ${s})`),l(e),!0}if((!o||p>f)&&c>=n){let e=`${u} as forwardBuffer >= bufferLowWaterLine (${c} >= ${n})`;return o&&(e+=` and next bandwidth > current bandwidth (${p} > ${f})`),l(e),!0}return l(`not ${u}
74 as no switching criteria met`),!1};class lc extends sL.EventTarget{constructor(e){var t;let i;super(),this.fastQualityChange_=(t=this.fastQualityChange_.bind(this),i=null,(...e)=>{clearTimeout(i),i=setTimeout(()=>{t.apply(null,e)},100)});let{src:r,withCredentials:n,tech:s,bandwidth:a,externVhs:o,useCueTags:u,playlistExclusionDuration:d,enableLowInitialPlaylist:c,sourceType:h,cacheEncryptionKeys:f,bufferBasedABR:m,leastPixelDiffSelector:g,captionServices:y,experimentalUseMMS:v}=e;if(!r)throw Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:_}=e;null==_&&(_=1/0),l=o,this.bufferBasedABR=!!m,this.leastPixelDiffSelector=!!g,this.withCredentials=n,this.tech_=s,this.vhs_=s.vhs,this.player_=e.player_,this.sourceType_=h,this.useCueTags_=u,this.playlistExclusionDuration=d,this.maxPlaylistRetries=_,this.enableLowInitialPlaylist=c,this.usingManagedMediaSource_=!1,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:n,maxPlaylistRetries:_,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=(()=>{let e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:oM,activeTrack:oM,getActiveGroup:oM,onGroupChanged:oM,onTrackChanged:oM,lastTrack_:null,logger_:sB(`MediaGroups[${t}]`)}}),e})(),v&&p().ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new(p()).ManagedMediaSource,this.usingManagedMediaSource_=!0,sL.log("Using ManagedMediaSource")):p().MediaSource&&(this.mediaSource=new(p()).MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.load=this.load.bind(this),this.pause=this.pause.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.mediaSource.addEventListener("startstreaming",this.load),this.mediaSource.addEventListener("endstreaming",this.pause),this.seekable_=sq(),this.hasPlayed_=!1,this.syncController_=new o3(e),this.segmentMetadataTrack_=s.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new o6,this.sourceUpdater_=new oG(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new o5,this.keyStatusMap_=new Map;let b={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:y,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:a,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:f,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_="dash"===this.sourceType_?new aV(r,this.vhs_,sj(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new ak(r,this.vhs_,sj(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new oN(sj(b,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new oN(sj(b,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new oQ(sj(b,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((e,t)=>{function i(){s.off("vttjserror",r),e()}function r(){s.off("vttjsloaded",i),t()}s.one("vttjsloaded",i),s.one("vttjserror",r),s.addWebVttScript_()})}),e),this.contentSteeringController_=new lo(this.vhs_.xhr,()=>this.mainSegmentLoader_.bandwidth),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>
74this.startABRTimer_())),ll.forEach(e=>{this[e+"_"]=lu.bind(this,e)}),this.logger_=sB("pc"),this.triggeredFmp4Usage=!1,"none"===this.tech_.preload()?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;let T="none"===this.tech_.preload()?"play":"loadstart";this.tech_.one(T,()=>{let e=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-e,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){let e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return -1===e||-1===t?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){let t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,i){let r=this.media(),n=r&&(r.id||r.uri),s=e&&(e.id||e.uri);if(n&&n!==s){this.logger_(`switch media ${n} -> ${s} from ${t}`);let i={renditionInfo:{id:s,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:"renditionselected",metadata:i}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,i)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{let t=this.mediaTypes_[e],i=t?t.activeGroup():null,r=this.contentSteeringController_.getPathway();if(i&&r){let t=(i.length?i[0].playlists:i.playlists).filter(e=>e.attributes.serviceLocation===r);t.length&&this.mediaTypes_[e].activePlaylistLoader.media(t[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=p().setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(p().clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){let e,t=this.main(),i=t&&t.playlists||[];if(!t||!t.mediaGroups||!t.mediaGroups.AUDIO)return i;let r=t.mediaGroups.AUDIO,n=Object.keys(r);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)e=this.mediaTypes_.AUDIO.activeTrack();else{let t=r.main||n.length&&r[n[0]];for(let i in t)if(t[i].default){e={label:i};break}}if(!e)return i;let s=[];for(let i in r)if(r[i][e.label]){let n=r[i][e.label];if(n.playlists&&n.playlists.length)s.push.apply(s,n.playlists);else if(n.uri)s.push(n);else if(t.playlists.length)for(let e=0;e<t.playlists.length;e++){let r=t.playlists[e];r.attributes&&r.attributes.AUDIO&&r.attributes.AUDIO===i&&s.push(r)}}return s.length?s:i}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{let e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;as(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,e.endList&&"none"!==this.tech_.preload()&&(this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load()),(e=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{lr[t](t,e)});let{mediaTypes:t,mainPlaylistLoader:i,tech:r,vhs:n,segmentLoaders:{AUDIO:s,main:a}}=e;["AUDIO","SUBTITLES"].forEach(i=>{t[i].activeGroup=t=>{let{mainPlaylistLoader:r,mediaTypes:{[i]:{groups:n}}}=e,s=r.media();if(!s)return null;let a=null;s.attributes[i]&&(a=n[s.attributes[i]]);let o=Object.keys(n);if(!a)if("AUDIO"===i&&o.length>1&&al(e.main))for(let e=0;e<o.length;e++){let t=n[o[e]];if(ln(t,s)){a=t;break}}else n.main?a=n.main:1===o.length&&(a=n[o[0]]);return void 0===t?a:null!==t&&a&&a.filter(e=>e.id===t.id)[0]||null},t[i].activeTrack=ls[i](i,e),t[i].onGroupChanged=()=>{let{segmentLoaders:{[i]:t,main:r},mediaTypes:{[i]:n}}=e,s=n.activeTrack(),a=n.getActiveGroup(),o=n.activePlaylistLoader,l=n.lastGroup_;if((!a||!l||a.id!==l.id)&&(n.lastGroup_=a,n.lastTrack_=s,o9(t,n),a&&!a.isMainPlaylist)){if(!a.playlistLoader){o&&r.resetEverything();return}t.resyncLoader(),le(a.playlistLoader,n)}},t[i].onGroupChanging=()=>{let{segmentLoaders:{[i]:t},mediaTypes:{[i]:r}}=e;r.lastGroup_=null,t.abort(),t.pause()},t[i].onTrackChanged=()=>{let{mainPlaylistLoader:t,segmentLoaders:{[i]:r,main:n},mediaTypes:{[i]:s}}=e,a=s.activeTrack(),o=s.getActiveGroup(),l=s.activePlaylistLoader,u=s.lastTrack_;if((!u||!a||u.id!==a.id)&&(s.lastGroup_=o,s.lastTrack_=a,o9(r,s),o)){if(o.isMainPlaylist){if(!a||!u||a.id===u.id)return;let i=e.vhs.playlistController_,r=i.selectPlaylist();if(i.media()===r)return;s.logger_(`track change. Switching main audio from ${u.id} to ${a.id}`),t.pause(),n.resetEverything(),i.fastQualityChange_(r);return}
74if("AUDIO"===i){if(!o.playlistLoader){n.setAudio(!0),n.resetEverything();return}r.setAudio(!0),n.setAudio(!1)}if(l===o.playlistLoader)return void le(o.playlistLoader,s);r.track&&r.track(a),r.resetEverything(),le(o.playlistLoader,s)}},t[i].getActiveGroup=((e,{mediaTypes:t})=>()=>{let i=t[e].activeTrack();return i?t[e].activeGroup(i):null})(i,e)});let o=t.AUDIO.activeGroup();if(o){let e=(o.filter(e=>e.default)[0]||o[0]).id;t.AUDIO.tracks[e].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged(),t.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),s.setAudio(!0)):a.setAudio(!0)}i.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(e=>t[e].onGroupChanged())}),i.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(e=>t[e].onGroupChanging())});let l=()=>{t.AUDIO.onTrackChanged(),r.trigger({type:"usage",name:"vhs-audio-change"})};for(let e in r.audioTracks().addEventListener("change",l),r.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),n.on("dispose",()=>{r.audioTracks().removeEventListener("change",l),r.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)}),r.clearTracks("audio"),t.AUDIO.tracks)r.audioTracks().addTrack(t.AUDIO.tracks[e])})({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),e),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let e=this.mainPlaylistLoader_.media();if(!e){let t;if(this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_(),this.enableLowInitialPlaylist&&(t=this.selectInitialPlaylist()),t||(t=this.selectPlaylist()),!t||!this.shouldSwitchToMedia_(t)||(this.initialMedia_=t,this.switchMedia_(this.initialMedia_,"initial"),!("vhs-json"===this.sourceType_&&this.initialMedia_.segments)))return;e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)}),this.mainPlaylistLoader_.on("error",()=>{let e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{let e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;as(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,"dash"===this.sourceType_&&this.mainPlaylistLoader_.isPaused&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{let e=this.mainPlaylistLoader_.media();"playlist-unchanged"!==e.lastExcludeReason_&&this.stuckAtPlaylistEnd_(e)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}),["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(e=>{this.mainPlaylistLoader_.on(e,e=>{this.player_.trigger(b({},e))})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),!this.tech_.paused()&&(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){let i=e.mediaGroups||{},r=!0,n=Object.keys(i.AUDIO);for(let e in i.AUDIO)for(let t in i.AUDIO[e])i.AUDIO[e][t].uri||(r=!1);r&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),l.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),n.length&&Object.keys(i.AUDIO[n[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){let t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pen
vendor: 1,322 bytes, line 74
74dingMedia_,i=this.tech_.currentTime(),r=this.bufferLowWaterLine(),n=this.bufferHighWaterLine();return ld({buffered:this.tech_.buffered(),currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{let e=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>
74{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{let e=this.audioSegmentLoader_.pendingSegment_;if(!e||!e.segment||!e.segment.syncInfo)return;let t=e.segment.syncInfo.end+.01;this.tech_.setCurrentTime(t)}),this.timelineChangeController_.on("fixBadTimelineChange",()=>{this.logger_("Fix bad timeline change. Restarting al segment loaders..."),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}),this.mainSegmentLoader_.on("earlyabort",e=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:10}))});let e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();let e=this.getCodecsOrExclude_();e&&this.sourceUpdater_.addOrChangeSourceBuffers(e)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>
74{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}),["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(e=>{this.mainSegmentLoader_.on(e,e=>{this.player_.trigger(b({},e))}),this.audioSegmentLoader_.on(e,e=>{this.player_.trigger(b({},e))}),this.subtitleSegmentLoader_.on(e,e=>{this.player_.trigger(b({},e))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}pause(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}fastQualityChange_(e=this.selectPlaylist()){if(e&&e===this.mainPlaylistLoader_.media())return void this.logger_("skipping fastQualityChange because new media is same as old");this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();let 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))}setupFirstPlay(){let e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList||e.start){let t=this.seekable();if(!t.length)return!1;let i=t.end(0),r=i;if(e.start){let n=e.start.timeOffset;r=n<0?Math.max(i+n,t.start(0)):Math.min(i,n)}this.trigger("firstplay"),this.tech_.setCurrentTime(r)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){let e=this.tech_.play();void 0!==e&&"function"==typeof e.then&&e.then(null,e=>{})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;let e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;let t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){let t=this.mainSegmentLoader_.getCurrentMediaInfo_();e=!t||t.hasVideo?e&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;let t=this.syncController_.getExpiredTime(e,this.duration());if(null===t)return!1;let i=l.Playlist.playlistEnd(e,t),r=this.tech_.currentTime(),n=this.tech_.buffered();if(!n.length)return i-r<=sH;let s=n.end(n.length-1);return s-r<=sH&&i-s<=sH}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:i}){let r;if(e=e||this.mainPlaylistLoader_.media(),i=i||t.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=t,"open"!==this.mediaSource.readyState?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}e.playlistErrors_++;let n=this.mainPlaylistLoader_.main.playlists,s=n.filter(ar),a=1===s.length&&s[0]===e;if(1===n.length&&i!==1/0)return sL.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(a);if(a){if(this.main().contentSteering){let t=this.pathwayAttribute_(e),i=1e3*this.contentSteeringController_.steeringManifest.ttl;this.contentSteeringController_.excludePathway(t),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(t)},i);return}let t=!1;
74n.forEach(i=>{if(i===e)return;let r=i.excludeUntil;void 0!==r&&r!==1/0&&(t=!0,delete i.excludeUntil)}),t&&(sL.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}r=e.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*i,e.excludeUntil=r,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});let o=this.selectPlaylist();if(!o){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}let l=t.internal?this.logger_:sL.log.warn,u=t.message?" "+t.message:"";l(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${u} Switching to playlist ${o.id}.`),o.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),o.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);let d=o.targetDuration/2*1e3||5e3,c="number"==typeof o.lastRequest&&Date.now()-o.lastRequest<=d;return this.switchMedia_(o,"exclude",a||c)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){let i=[],r="all"===e;(r||"main"===e)&&i.push(this.mainPlaylistLoader_);let n=[];(r||"audio"===e)&&n.push("AUDIO"),(r||"subtitle"===e)&&(n.push("CLOSED-CAPTIONS"),n.push("SUBTITLES")),n.forEach(e=>{let t=this.mediaTypes_[e]&&this.mediaTypes_[e].activePlaylistLoader;t&&i.push(t)}),["main","audio","subtitle"].forEach(t=>{let r=this[`${t}SegmentLoader_`];r&&(e===t||"all"===e)&&i.push(r)}),i.forEach(e=>t.forEach(t=>{"function"==typeof e[t]&&e[t]()}))}setCurrentTime(e){let t=sV(this.tech_.buffered(),e);return this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media()&&this.mainPlaylistLoader_.media().segments?t&&t.length?e:void(this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()):0}duration(){if(!this.mainPlaylistLoader_)return 0;let e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:l.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}getSeekableRange_(e,t){let i=e.media();if(!i)return null;let r=this.syncController_.getMediaSequenceSync(t);if(r&&r.isReliable){let e=r.start,t=r.end;if(!isFinite(e)||!isFinite(t))return null;let n=Math.max(0,t-l.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,i));return n<e?null:sq([[e,n]])}let n=this.syncController_.getExpiredTime(i,this.duration());if(null===n)return null;let s=l.Playlist.seekable(i,n,l.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,i));return s.length?s:null}computeFinalSeekable_(e,t){if(!t)return e;let i=e.start(0),r=e.end(0),n=t.start(0),s=t.end(0);return n>r||i>s?e:sq([[Math.max(i,n),Math.min(r,s)]])}onSyncInfoUpdate_(){let e;if(!this.mainPlaylistLoader_)return;let t=this.getSeekableRange_(this.mainPlaylistLoader_,"main");if(!t||this.mediaTypes_.AUDIO.activePlaylistLoader&&!(e=this.getSeekableRange_(this.mediaTypes_.AUDIO.activePlaylistLoader,"audio")))return;let i=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(t,e),!this.seekable_||i&&i.length&&this.seekable_.length&&i.start(0)===this.seekable_.start(0)&&i.end(0)===this.seekable_.end(0))return;this.logger_(`seekable updated [${sY(this.seekable_)}]`);let r={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:r}),this.tech_.trigger("seekablechanged")}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),"open"!==this.mediaSource.readyState){this.updateDuration_=this.updateDuration.bind(this,e),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(e){let e=this.seekable();if(!e.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<e.end(e.length-1))&&this.sourceUpdater_.setDuration(e.end(e.length-1));return}let t=this.tech_.buffered(),i=l.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(i=Math.max(i,t.end(t.length-1))),this.mediaSource.duration!==i&&this.sourceUpdater_.setDuration(i)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e
74=>{let t=this.mediaTypes_[e].groups;for(let e in t)t[e].forEach(e=>{e.playlistLoader&&e.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){let e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!!t&&!!i}getCodecsOrExclude_(){let e,t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},i=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();t.video=t.main;let r=oa(this.main(),i),n={},s=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo&&(n.video=r.video||t.main.videoCodec||"avc1.4d400d"),t.main.isMuxed&&(n.video+=`,${r.audio||t.main.audioCodec||z}`),(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||s)&&(n.audio=r.audio||t.main.audioCodec||t.audio.audioCodec||z,t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4),!n.audio&&!n.video)return void this.excludePlaylist({playlistToExclude:i,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});let a={};if(["video","audio"].forEach(function(i){let r,s;if(n.hasOwnProperty(i)&&(r=t[i].isFmp4,s=n[i],r?!F(s,this.usingManagedMediaSource_):!H(s))){let r=t[i].isFmp4?"browser":"muxer";a[r]=a[r]||[],a[r].push(n[i]),"audio"===i&&(e=r)}}),s&&e&&i.attributes.AUDIO){let t=i.attributes.AUDIO;
74this.main().playlists.forEach(e=>{(e.attributes&&e.attributes.AUDIO)===t&&e!==i&&(e.excludeUntil=1/0)}),this.logger_(`excluding audio group ${t} as ${e} does not support codec(s): "${n.audio}"`)}if(Object.keys(a).length){let e=Object.keys(a).reduce((e,t)=>(e&&(e+=", "),e+=`${t} does not support codec(s): "${a[t].join(",")}"`),"")+".";this.excludePlaylist({playlistToExclude:i,error:{internal:!0,message:e},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){let e=[];if(["video","audio"].forEach(t=>{let i=(U(this.sourceUpdater_.codecs[t]||"")[0]||{}).type,r=(U(n[t]||"")[0]||{}).type;i&&r&&i.toLowerCase()!==r.toLowerCase()&&e.push(`"${this.sourceUpdater_.codecs[t]}" -> "${n[t]}"`)}),e.length)return void this.excludePlaylist({playlistToExclude:i,error:{message:`Codec switching not supported: ${e.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0})}return n}tryToCreateSourceBuffers_(){if("open"!==this.mediaSource.readyState||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;let e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);let t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){let e=this.main().playlists,t=[];Object.keys(e).forEach(i=>{let r=e[i];if(-1!==t.indexOf(r.id))return;t.push(r.id);let n=oa(this.main,r),s=[];!n.audio||H(n.audio)||F(n.audio,this.usingManagedMediaSource_)||s.push(`audio codec ${n.audio}`),!n.video||H(n.video)||F(n.video,this.usingManagedMediaSource_)||s.push(`video codec ${n.video}`),n.text&&"stpp.ttml.im1t"===n.text&&s.push(`text codec ${n.text}`),s.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id} for unsupported: ${s.join(", ")}`))})}excludeIncompatibleVariants_(e){let t=[],i=this.main().playlists,r=on(U(e)),n=os(r),s=r.video&&U(r.video)[0]||null,a=r.audio&&U(r.audio)[0]||null;
74Object.keys(i).forEach(e=>{let r=i[e];if(-1!==t.indexOf(r.id)||r.excludeUntil===1/0)return;t.push(r.id);let o=[],l=oa(this.mainPlaylistLoader_.main,r),u=os(l);if(l.audio||l.video){if(u!==n&&o.push(`codec count "${u}" !== "${n}"`),!this.sourceUpdater_.canChangeType()){let e=l.video&&U(l.video)[0]||null,t=l.audio&&U(l.audio)[0]||null;e&&s&&e.type.toLowerCase()!==s.type.toLowerCase()&&o.push(`video codec "${e.type}" !== "${s.type}"`),t&&a&&t.type.toLowerCase()!==a.type.toLowerCase()&&o.push(`audio codec "${t.type}" !== "${a.type}"`)}o.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id}: ${o.join(" && ")}`))}})}updateAdCues_(e){let t=0,i=this.seekable();i.length&&(t=i.start(0)),oZ(e,this.cueTagsTrack_,t)}goalBufferLength(){let e=this.tech_.currentTime(),t=aW.GOAL_BUFFER_LENGTH,i=aW.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,aW.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,r)}bufferLowWaterLine(){let e=this.tech_.currentTime(),t=aW.BUFFER_LOW_WATER_LINE,i=aW.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,aW.MAX_BUFFER_LOW_WATER_LINE),n=Math.max(t,aW.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?n:r)}bufferHighWaterLine(){return aW.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){oT(this.inbandTextTracks_,"com.apple.streaming",this.tech_),(({inbandTextTracks:e,dateRanges:t})=>{let i=e.metadataTrack_;if(!i)return;let r=p().WebKitDataCue||p().VTTCue;t.forEach(e=>{for(let t of Object.keys(e)){if(ob.has(t))continue;let n=new r(e.startTime,e.endTime,"");n.id=e.id,n.type="com.apple.quicktime.HLS",n.value={key:o_[t],data:e[t]},("scte35Out"===t||"scte35In"===t)&&(n.value.data=new Uint8Array(n.value.data.match(/[\da-f]{2}/gi)).buffer),i.addCue(n)}e.processDateRange()})})({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,i){let r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();oT(this.inbandTextTracks_,e,this.tech_),(({inbandTextTracks:e,metadataArray:t,timestampOffset:i,videoDuration:r})=>{if(!t)return;let n=p().WebKitDataCue||p().VTTCue,s=e.metadataTrack_;if(!s||(t.forEach(e=>{let t=e.cueTime+i;!("number"!=typeof t||p().isNaN(t))&&!(t<0)&&t<1/0&&e.frames&&e.frames.length&&e.frames.forEach(e=>{let i=new n(t,t,e.value||e.url||e.data||"");i.frame=e,i.value=e,ov(i),s.addCue(i)})}),!s.cues||!s.cues.length))return;let a=s.cues,o=[];for(let e=0;e<a.length;e++)a[e]&&o.push(a[e]);let l=o.reduce((e,t)=>{let i=e[t.startTime]||[];return i.push(t),e[t.startTime]=i,e},{}),u=Object.keys(l).sort((e,t)=>Number(e)-Number(t));u.forEach((e,t)=>{let i=l[e],n=isFinite(r)?r:e,s=Number(u[t+1])||n;i.forEach(e=>{e.endTime=s})})})({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:i})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){let e=this.main();if(e.contentSteering){for(let t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));if(this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart)return void this.contentSteeringController_.requestSteeringManifest(!0);this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(e=>{this.contentSteeringController_.on(e,e=>{this.trigger(b({},e))})}),"dash"===this.sourceType_&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{let e=this.main();(this.contentSteeringController_.didDASHTagChange(e.uri,e.contentSteering)||(()=>{let t=this.contentSteeringController_.getAvailablePathways(),i=[];for(let r of e.playlists){let e=r.attributes.serviceLocation;if(e&&(i.push(e),!t.has(e)))return!0}return!i.length&&!!t.size}
74)())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){let e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();let t=this.main().playlists,i=new Set,r=!1;Object.keys(t).forEach(n=>{let s=t[n],a=this.pathwayAttribute_(s),o=a&&e!==a;s.excludeUntil!==1/0||"content-steering"!==s.lastExcludeReason_||o||(delete s.excludeUntil,delete s.lastExcludeReason_,r=!0);let l=!s.excludeUntil&&s.excludeUntil!==1/0;!i.has(s.id)&&o&&l&&(i.add(s.id),s.excludeUntil=1/0,s.lastExcludeReason_="content-steering",this.logger_(`excluding ${s.id} for ${s.lastExcludeReason_}`))}),"DASH"===this.contentSteeringController_.manifestType_&&Object.keys(this.mediaTypes_).forEach(t=>{let i=this.mediaTypes_[t];if(i.activePlaylistLoader){let t=i.activePlaylistLoader.media_;t&&t.attributes.serviceLocation!==e&&(r=!0)}}),r&&this.changeSegmentPathway_()}handlePathwayClones_(){let e=this.main().playlists,t=this.contentSteeringController_.currentPathwayClones,i=this.contentSteeringController_.nextPathwayClones;if(t&&t.size||i&&i.size){for(let[e,r]of t.entries())i.get(e)||(this.mainPlaylistLoader_.updateOrDeleteClone(r),this.contentSteeringController_.excludePathway(e));for(let[r,n]of i.entries()){let i=t.get(r);if(!i){e.filter(e=>
74e.attributes["PATHWAY-ID"]===n["BASE-ID"]).forEach(e=>{this.mainPlaylistLoader_.addClonePathway(n,e)}),this.contentSteeringController_.addAvailablePathway(r);continue}this.equalPathwayClones_(i,n)||(this.mainPlaylistLoader_.updateOrDeleteClone(n,!0),this.contentSteeringController_.addAvailablePathway(r))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...i])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;let i=e["URI-REPLACEMENT"].PARAMS,r=t["URI-REPLACEMENT"].PARAMS;for(let e in i)if(i[e]!==r[e])return!1;for(let e in r)if(i[e]!==r[e])return!1;return!0}changeSegmentPathway_(){let e=this.selectPlaylist();this.pauseLoading(),"DASH"===this.contentSteeringController_.manifestType_&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0,t="non-usable";
74this.mainPlaylistLoader_.main.playlists.forEach(i=>{let r=this.mainPlaylistLoader_.getKeyIdSet(i);r&&r.size&&r.forEach(r=>{let n="usable",s=this.keyStatusMap_.has(r)&&this.keyStatusMap_.get(r)===n,a=i.lastExcludeReason_===t&&i.excludeUntil===1/0;s?s&&a&&(delete i.excludeUntil,delete i.lastExcludeReason_,this.logger_(`enabling playlist ${i.id} because key ID ${r} is ${n}`)):(i.excludeUntil!==1/0&&i.lastExcludeReason_!==t&&(i.excludeUntil=1/0,i.lastExcludeReason_=t,this.logger_(`excluding playlist ${i.id} because the key ID ${r} doesn't exist in the keyStatusMap or is not ${n}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(e=>{let i=e&&e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height<720,r=e.excludeUntil===1/0&&e.lastExcludeReason_===t;i&&r&&(delete e.excludeUntil,sL.log.warn(`enabling non-HD playlist ${e.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){let i=("string"==typeof e?e:Array.from(new Uint8Array(e)).map(e=>e.toString(16).padStart(2,"0")).join("")).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${i} added to the keyStatusMap`),this.keyStatusMap_.set(i,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}class lh{constructor(e,t,i){let r,n,{playlistController_:s}=e,a=s.fastQualityChange_.bind(s);if(t.attributes){let e=t.attributes.RESOLUTION;this.width=e&&e.width,this.height=e&&e.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=oa(s.main(),t),this.playlist=t,this.id=i,this.enabled=(r=e.playlists,n=t.id,e=>{let t=r.main.playlists[n],i=ai(t),s=ar(t);if(void 0===e)return s;e?delete t.disabled:t.disabled=!0;let o={renditionInfo:{id:n,bandwidth:t.attributes.BANDWIDTH,resolution:t.attributes.RESOLUTION,codecs:t.attributes.CODECS},cause:"fast-quality"};return e===s||i||(e?(a(t),r.trigger({type:"renditionenabled",metadata:o})):r.trigger({type:"renditiondisabled",metadata:o})),e})}}let lp=function(e){e.representations=()=>{let t=e.playlistController_.main(),i=al(t)?e.playlistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter(e=>!ai(e)).map((t,i)=>new lh(e,t,t.id)):[]}},lf=["seeking","seeked","pause","playing","error"];class lm extends sL.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=sB("PlaybackWatcher"),this.logger_("initialize");let t=()=>this.monitorCurrentTime_(),i=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),n=()=>this.resetTimeUpdate_(),s=this.playlistController_,a=["main","subtitle","audio"],o={};a.forEach(e=>{o[e]={reset:()=>this.resetSegmentDownloads_(e),updateend:()=>this.checkSegmentDownloads_(e)},s[`${e}SegmentLoader_`].on("appendsdone",o[e].updateend),s[`${e}SegmentLoader_`].on("playlistupdate",o[e].reset),this.tech_.on(["seeked","seeking"],o[e].reset)});let l=e=>{["main","audio"].forEach(t=>{s[`${t}SegmentLoader_`][e]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),l("off"))},this.clearSeekingAppendCheck_=()=>l("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),l("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(lf,n),this.tech_.on("canplay",i),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",r),this.tech_.off(lf,n),this.tech_.off("canplay",i),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),a.forEach(e
74=>{s[`${e}SegmentLoader_`].off("appendsdone",o[e].updateend),s[`${e}SegmentLoader_`].off("playlistupdate",o[e].reset),this.tech_.off(["seeked","seeking"],o[e].reset)}),this.checkCurrentTimeTimeout_&&p().clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&p().clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=p().setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){let t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){let t=this.playlistController_,i=t[`${e}SegmentLoader_`],r=i.buffered_(),n=sQ(this[`${e}Buffered_`],r);if(this[`${e}Buffered_`]=r,n){t.trigger({type:"bufferedrangeschanged",metadata:{bufferedRanges:r}}),this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:i.playlist_&&i.playlist_.id,buffered:sK(r)}),this[`${e}StalledDownloads_`]<10||(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),"subtitle"!==e&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;let e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+sH>=t.end(t.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(sq([this.lastRecordedTime,e]));let t={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:t}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){let e;if(!this.tech_.seeking())return!1;let t=this.seekable(),i=this.tech_.currentTime();if(this.afterSeekableWindow_(t,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(e=t.end(t.length-1)),this.beforeSeekableWindow_(t,i)){let i=t.start(0);e=i+(i===t.end(0)?0:sH)}if(void 0!==e)return this.logger_(`Trying to seek outside of seekable at time ${i} with seekable range ${sY(t)}. Seeking to ${e}.`),this.tech_.setCurrentTime(e),!0;let r=this.playlistController_.sourceUpdater_,n=this.tech_.buffered(),s=r.audioBuffer?r.audioBuffered():null,a=r.videoBuffer?r.videoBuffered():null,o=this.media(),l=o.partTargetDuration?o.partTargetDuration:(o.targetDuration-sF)*2,u=[s,a];for(let e=0;e<u.length;e++)if(u[e]&&sZ(u[e],i)<l)return!1;let d=sW(n,i);return 0!==d.length&&(e=d.start(0)+sH,this.logger_(`Buffered region starts (${d.start(0)})  just beyond seek point (${i}). Seeking to ${e}.`),this.tech_.setCurrentTime(e),!0)}waiting_(){if(this.techWaiting_())return;let e=this.tech_.currentTime(),t=sV(this.tech_.buffered(),e);if(t.length&&e+3<=t.end(0)){this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${t.start(0)} -> ${t.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){let e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){let i=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${i}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}let i=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;let n=sW(r,t);return n.length>0&&(this.logger_(`Stopped at ${t} and seeking to ${n.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0)}afterSeekableWindow_(e,t,i,r=!1){if(!e.length)return!1;let n=e.end(e.length-1)+sH,s=!i.endList,a="number"==typeof i.partTargetDuration;return s&&(a||r)&&(n=e.end(e.length-1)+3*i.targetDuration),t>n}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:i}){let r;if(e){if(e.length&&t.length){let n=sV(e,i-3),s=sV(e,i),a=sV(t,i);a.length&&!s.length&&n.length&&(r={start:n.end(0),end:a.end(0)})}else sW(e,i).length||(r=this.gapFromVideoUnderflow_(e,i));return!!r&&(this.logger_(`Encountered a gap in video from ${r.start} to ${r.end}. Seeking to current time ${i}`),!0)}}skipTheGap_(e){let t=this.tech_.buffered(),i=this.tech_.currentTime(),r=sW(t,i);if(this.resetTimeUpdate_(),0===r.length||i!==e)return;this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",r.start(0)),this.tech_.setCurrentTime(r.start(0)+sF);let n={gapInfo:{from:i,to:r.start(0)}};this.playlistController_.trigger({type:"gapjumped",metadata:n}),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(e,t){let i=sG(e);for(let e=0;e<i.length;e++){let r=i.start(e),n=i.end(e);if(t-r<4&&t-r>2)return{start:r,end:n}}return null}}let lg={errorInterval:30,getSource(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},ly=function(e,t){let i=0,r=0,n=sj(lg,t);e.ready(()=>{e.trigger({type:"usage",name:"vhs-error-reload-initialized"})});let s=function(){r&&e.currentTime(r)},a=function(t){null!=t&&(r=e.duration()!==1/0&&e.currentTime()||0,e.one("loadedmetadata",s),e.src(t),e.trigger({type:"usage",name:"vhs-error-reload"}),e.play())},o=function(){return Date.now()-i<1e3*n.errorInterval?void e.trigger({type:"usage",name:"vhs-error-reload-canceled"}):n.getSource&&"function"==typeof n.getSource?(i=Date.now(),n.getSource.call(e,a)):void sL.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")},l=function(){e.off("loadedmetadata",s),e.off("error",o),e.off("dispose",l)};e.on("error",o),e.on("dispose",l),e.reloadSourceOnError=function(t){l(),ly(e,t)}};var lv="3.16.2";let l_={PlaylistLoader:ak,Playlist:au,utils:a$,STANDARD_PLAYLIST_SELECTOR:op,INITIAL_PLAYLIST_SELECTOR:function(){let e=this.playlists.main.playlists.filter(au.isEnabled);return od(e,(e,t)=>oc(e,t)),e.filter(e=>!!oa(this.playlists.main,e).video)[0]||null},lastBandwidthSelector:op,movingAverageBandwidthSelector:function(e){let t=-1,i=-1;
74if(e<0||e>1)throw Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let r=this.useDevicePixelRatio&&p().devicePixelRatio||1;return isNaN(this.customPixelRatio)||(r=this.customPixelRatio),t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(t=e*this.systemBandwidth+(1-e)*t,i=this.systemBandwidth),oh(this.playlists.main,t,parseInt(ou(this.tech_.el(),"width"),10)*r,parseInt(ou(this.tech_.el(),"height"),10)*r,this.limitRenditionByPlayerDimensions,this.playlistController_)}},comparePlaylistBandwidth:oc,comparePlaylistResolution:function(e,t){let i,r;return(e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||p().Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(r=t.attributes.RESOLUTION.width),i===(r=r||p().Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH)?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-r},xhr:aD()};Object.keys(aW).forEach(e=>{Object.defineProperty(l_,e,{get:()=>(sL.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),aW[e]),set(t){if(sL.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),"number"!=typeof t||t<0)return void sL.log.warn(`value of Vhs.${e} must be greater than or equal to 0`);aW[e]=t}})});let lb="videojs-vhs",lT=function(e,t){let i=t.media(),r=-1;for(let t=0;t<e.length;t++)if(e[t].id===i.id){r=t;break}e.selectedIndex_=r,e.trigger({selectedIndex:r,type:"change"})},lw=function(e,t){t.representations().forEach(t=>{e.addQualityLevel(t)}),lT(e,t.playlists)};l_.canPlaySource=function(){return sL.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};let lS=()=>{if(!p().localStorage)return null;let e=p().localStorage.getItem(lb);if(!e)return null;try{return JSON.parse(e)}catch(e){return null}},lE=(e,t)=>{e._requestCallbackSet||(e._requestCallbackSet=new Set),e._requestCallbackSet.add(t)},lC=(e,t)=>{e._responseCallbackSet||(e._responseCallbackSet=new Set),e._responseCallbackSet.add(t)},lk=(e,t)=>{e._requestCallbackSet&&(e._requestCallbackSet.delete(t),e._requestCallbackSet.size||delete e._requestCallbackSet)},lx=(e,t)=>{e._responseCallbackSet&&(e._responseCallbackSet.delete(t),e._responseCallbackSet.size||delete e._responseCallbackSet)};l_.supportsNativeHls=function(){if(!m()||!m().createElement)return!1;let e=m().createElement("video");return!!sL.getTech("Html5").isSupported()&&["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(t){return/maybe|probably/i.test(e.canPlayType(t))})}(),l_.supportsNativeDash=!!m()&&!!m().createElement&&!!sL.getTech("Html5").isSupported()&&/maybe|probably/i.test(m().createElement("video").canPlayType("application/dash+xml")),l_.supportsTypeNatively=e=>"hls"===e?l_.supportsNativeHls:"dash"===e&&l_.supportsNativeDash,l_.isSupported=function(){return sL.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},l_.xhr.onRequest=function(e){lE(l_.xhr,e)},l_.xhr.onResponse=function(e){lC(l_.xhr,e)},l_.xhr.offRequest=function(e){lk(l_.xhr,e)},l_.xhr.offResponse=function(e){lx(l_.xhr,e)};let lD=sL.getComponent("Component");class lI extends lD{constructor(e,t,i){if(super(t,i.vhs),"number"==typeof i.initialBandwidth&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=sB("VhsHandler"),t.options_&&t.options_.playerId){let e=sL.getPlayer(t.options_.playerId);this.player_=e}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(m(),["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],e=>{let t=m().fullscreenElement||m().webkitFullscreenElement||m().mozFullScreenElement||m().msFullscreenElement;t&&t.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=sj(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.useBandwidthFromLocalStorage=void 0!==this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||
74!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,this.options_.llhls=!1!==this.options_.llhls,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,"number"!=typeof this.options_.playlistExclusionDuration&&(this.options_.playlistExclusionDuration=60),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){let e=lS();e&&e.bandwidth&&(this.options_.bandwidth=e.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),e&&e.throughput&&(this.options_.throughput=e.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}"number"!=typeof this.options_.bandwidth&&(this.options_.bandwidth=aW.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===aW.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(e=>{void 0!==this.source_[e]&&(this.options_[e]=this.source_[e])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio;let t=this.options_.customPixelRatio;"number"==typeof t&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){var i;if(!e)return;this.setOptions_(),this.options_.src=0===(i=this.source_.src).toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")?JSON.parse(i.substring(i.indexOf(",")+1)):i,this.options_.tech=this.tech_,this.options_.externVhs=l_,this.options_.sourceType=G(t),this.options_.seekTo=e=>{this.tech_.setCurrentTime(e)},this.options_.player_=this.player_,this.playlistController_=new lc(this.options_);let r=sj({liveRangeSafeTimeDelta:sH},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new lm(r),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{let e=sL.players[this.tech_.options_.playerId],t=this.playlistController_.error;"object"!=typeof t||t.code?"string"==typeof t&&(t={message:t,code:3}):t.code=3,e.error(t)});let n=this.options_.bufferBasedABR?l_.movingAverageBandwidthSelector(.55):l_.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):n.bind(this),this.playlistController_.selectInitialPlaylist=l_.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(e){this.playlistController_.selectPlaylist=e.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(e){this.playlistController_.mainSegmentLoader_.throughput.rate=e,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let e=this.playlistController_.mainSegmentLoader_.bandwidth,t=p().navigator.connection||p().navigator.mozConnection||p().navigator.webkitConnection;if(this.options_.useNetworkInformationApi&&t){let i=1e3*t.downlink*1e3;e=i>=1e7&&e>=1e7?Math.max(e,i):i}return e},set(e){this.playlistController_.mainSegmentLoader_.bandwidth=e,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){return Math.floor(1/(1/(this.bandwidth||1)+(this.throughput>0?1/this.throughput:0)))},set(){sL.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>sK(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>sK(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&(e=>{if(!p().localStorage)return;let t=lS();t=t?sj(t,e):e;try{p().localStorage.setItem(lb,JSON.stringify(t))}catch(e){return!1}})({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{lp(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=p().URL.createObjectURL(this.playlistController_.mediaSource),(sL.browser.IS_ANY_SAFARI||sL.browser.IS_IOS)&&this.options_.overrideNative&&"hls"===this.options_.sourceType&&"function"==typeof this.tech_.addSourceElement?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){let e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),(({player:e,sourceKeySystems:t,audioMedia:i,mainPlaylists:r})=>{let n,s;if(!e.eme.initializeMediaKeys)return Promise.resolve();let a=(n=i?r.concat([i]):r,s=Object.keys(t),n.reduce((e,t)=>
74{if(!t.contentProtection)return e;let i=s.reduce((e,i)=>{let r=t.contentProtection[i];return r&&r.pssh&&(e[i]={pssh:r.pssh}),e},{});return Object.keys(i).length&&e.push(i),e},[])),o=[],l=[];return a.forEach(t=>{l.push(new Promise((t,i)=>{e.tech_.one("keysessioncreated",t)})),o.push(new Promise((i,r)=>{e.eme.initializeMediaKeys({keySystems:t},e=>{if(e)return void r(e);i()})}))}),Promise.race([Promise.all(o),Promise.race(l)])})({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(e=>{this.logger_("error while creating EME key session",e),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){let e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=(({player:e,sourceKeySystems:t,media:i,audioMedia:r})=>{let n=((e,t,i)=>{if(!e)return e;let r={};t&&t.attributes&&t.attributes.CODECS&&(r=on(U(t.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(r.audio=i.attributes.CODECS);let n=q(r.video),s=q(r.audio),a={};for(let i in e)a[i]={},s&&(a[i].audioContentType=s),n&&(a[i].videoContentType=n),t.contentProtection&&t.contentProtection[i]&&t.contentProtection[i].pssh&&(a[i].pssh=t.contentProtection[i].pssh),"string"==typeof e[i]&&(a[i].url=e[i]);return sj(e,a)})(t,i,r);return!!n&&(e.currentSource().keySystems=n,!n||!!e.eme||(sL.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1))})({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",e=>{this.playlistController_.updatePlaylistByKeyStatus(e.keyId,e.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!t)return void this.playlistController_.sourceUpdater_.initializedEme();this.createKeySessions_()}setupQualityLevels_(){let e=sL.players[this.tech_.options_.playerId];
74e&&e.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{lw(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{lT(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":lv,"mux.js":"7.1.0","mpd-parser":"1.3.1","m3u8-parser":"7.2.0","aes-decrypter":"4.0.2"}}version(){return this.constructor.version()}canChangeType(){return oG.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&p().URL.revokeObjectURL&&(p().URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return(({playlist:e,time:t,callback:i})=>{if(!i)throw Error("getProgramTime: callback must be provided");if(!e||void 0===t)return i({message:"getProgramTime: playlist and time must be provided"});let r=((e,t)=>{let i;if(!t||!t.segments||0===t.segments.length)return null;let r=0;for(let n=0;n<t.segments.length&&!(e<=(r=(i=t.segments[n]).videoTimingInfo?i.videoTimingInfo.transmuxedPresentationEnd:r+i.duration));n++);let n=t.segments[t.segments.length-1];if(n.videoTimingInfo&&n.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>r){if(e>r+.25*n.duration)return null;i=n}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:r-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}})(t,e);if(!r)return i({message:"valid programTime was not found"});if("estimate"===r.type)return i({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:r.estimatedStart});let n={mediaSeconds:t},s=((e,t)=>{if(!t.dateTimeObject)return null;let i=t.videoTimingInfo.transmuxerPrependedSeconds,r=t.videoTimingInfo.transmuxedPresentationStart;return new Date(t.dateTimeObject.getTime()+1e3*(e-(r+i)))})(t,r.segment);return s&&(n.programDateTime=s.toISOString()),i(null,n)})({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=!0,r=2){return aU({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{lE(this.xhr,e)},this.xhr.onResponse=e=>{lC(this.xhr,e)},this.xhr.offRequest=e=>{lk(this.xhr,e)},this.xhr.offResponse=e=>{lx(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(e=>{this.playlistController_.on(e,e=>{this.player_.trigger(b({},e))})}),["gapjumped","playedrangeschanged"].forEach(e=>{this.playbackWatcher_.on(e,e=>{this.player_.trigger(b({},e))})})}}let lA={name:"videojs-http-streaming",VERSION:lv,canHandleSource(e,t={}){let i=sj(sL.options,t);return(!!i.vhs.experimentalUseMMS||!!F("avc1.4d400d,mp4a.40.2",!1))&&lA.canPlayType(e.type,i)},handleSource:(e,t,i={})=>(t.vhs=new lI(e,t,sj(sL.options,i)),t.vhs.xhr=aD(),t.vhs.setupXhrHooks_(),t.vhs.src(e.src,e.type),t.vhs),canPlayType(e,t){let i=G(e);if(!i)return"";let r=lA.getOverrideNative(t);return!l_.supportsTypeNatively(i)||r?"maybe":""},getOverrideNative(e={}){let{vhs:t={}}=e,i=!(sL.browser.IS_ANY_SAFARI||sL.browser.IS_IOS),{overrideNative:r=i}=t;return r}};F("avc1.4d400d,mp4a.40.2",!0)&&sL.getTech("Html5").registerSourceHandler(lA,0),sL.VhsHandler=lI,sL.VhsSourceHandler=lA,sL.Vhs=l_,sL.use||sL.registerComponent("Vhs",l_),sL.options.vhs=sL.options.vhs||{},sL.getPlugin&&sL.getPlugin("reloadSourceOnError")||sL.registerPlugin("reloadSourceOnError",function(e){ly(this,e)})},792:function(e,t,i){var r=i(5814),n=e.exports={WebVTT:i(9094),VTTCue:i(8003),VTTRegion:i(1575)};r.vttjs=n,r.WebVTT=n.WebVTT;var s=n.VTTCue,a=n.VTTRegion,o=r.VTTCue,l=r.VTTRegion;n.shim=function(){r.VTTCue=s,r.VTTRegion=a},n.restore=function(){r.VTTCue=o,r.VTTRegion=l},r.VTTCue||n.shim()},9094:function(e,t,i){var r=i(3423),n=Object.create||function(){function e(){}return function(t){if(1!=arguments.length)throw Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();
74function s(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function a(e){function t(e,t,i,r){return(0|e)*3600+(0|t)*60+(0|i)+(0|r)/1e3}var i=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return i?i[3]?t(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null}function o(){this.values=n(null)}function l(e,t,i,r){var n=r?e.split(r):[e];for(var s in n)if("string"==typeof n[s]){var a=n[s].split(i);2===a.length&&t(a[0].trim(),a[1].trim())}}s.prototype=n(Error.prototype),s.prototype.constructor=s,s.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},o.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var r=0;r<i.length;++r)if(t===i[r]){this.set(e,t);break}},integer:function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},percent:function(e,t){return!!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(t=parseFloat(t))>=0)&&!!(t<=100)&&(this.set(e,t),!0)}};var u=r.createElement&&r.createElement("textarea"),d={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},c={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},h={v:"title",lang:"lang"},p={rt:"ruby"};function f(e,t){for(var i,r=e.document.createElement("div"),n=r,s=[];null!==(i=function(){if(!t)return null;var e,i=t.match(/^([^<]*)(<[^>]*>?)?/);return e=i[1]?i[1]:i[2],t=t.substr(e.length),e}());){if("<"===i[0]){if("/"===i[1]){s.length&&s[s.length-1]===i.substr(2).replace(">","")&&(s.pop(),n=n.parentNode);continue}var o,l,f,m,g=a(i.substr(1,i.length-2));if(g){m=e.document.createProcessingInstruction("timestamp",g),n.appendChild(m);continue}var y=i.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!y||!(m=function(t,i){var r=d[t];if(!r)return null;var n=e.document.createElement(r),s=h[t];return s&&i&&(n[s]=i.trim()),n}(y[1],y[3]))||(l=n,p[(f=m).localName]&&p[f.localName]!==l.localName))continue;if(y[2]){var v=y[2].split(".");v.forEach(function(e){var t=/^bg_/.test(e),i=t?e.slice(3):e;if(c.hasOwnProperty(i)){var r=t?"background-color":"color",n=c[i];m.style[r]=n}}),m.className=v.join(" ")}s.push(y[1]),n.appendChild(m),n=m;continue}n.appendChild(e.document.createTextNode((u.innerHTML=o=i,o=u.textContent,u.textContent="",o)))}return r}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 g(){}function y(e,t,i){g.call(this),this.cue=t,this.cueDiv=f(e,t.text);var r={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:""===t.vertical?"horizontal-tb":"lr"
74===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(r,this.cueDiv),this.div=e.document.createElement("div"),r={direction:function(e){var t=[],i="";if(!e||!e.childNodes)return"ltr";function r(e,t){for(var i=t.childNodes.length-1;i>=0;i--)e.push(t.childNodes[i])}for(r(t,e);i=function e(t){if(!t||!t.length)return null;var i=t.pop(),n=i.textContent||i.innerText;if(n){var s=n.match(/^.*(\n|\r)/);return s?(t.length=0,s[0]):n}return"ruby"===i.tagName?e(t):i.childNodes?(r(t,i),e(t)):void 0}(t);)for(var n=0;n<i.length;n++)if(function(e){for(var t=0;t<m.length;t++){var i=m[t];if(e>=i[0]&&e<=i[1])return!0}return!1}(i.charCodeAt(n)))return"rtl";return"ltr"}(this.cueDiv),writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:"middle"===t.align?"center":t.align,font:i.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(r),this.div.appendChild(this.cueDiv);var n=0;switch(t.positionAlign){case"start":case"line-left":n=t.position;break;case"center":n=t.position-t.size/2;break;case"end":case"line-right":n=t.position-t.size}""===t.vertical?this.applyStyles({left:this.formatStyle(n,"%"),width:this.formatStyle(t.size,"%")}):this.applyStyles({top:this.formatStyle(n,"%"),height:this.formatStyle(t.size,"%")}),this.move=function(e){this.applyStyles({top:this.formatStyle(e.top,"px"),bottom:this.formatStyle(e.bottom,"px"),left:this.formatStyle(e.left,"px"),right:this.formatStyle(e.right,"px"),height:this.formatStyle(e.height,"px"),width:this.formatStyle(e.width,"px")})}}function v(e){var t,i,r,n;if(e.div){i=e.div.offsetHeight,r=e.div.offsetWidth,n=e.div.offsetTop;var s=(s=e.div.childNodes)&&(s=s[0])&&s.getClientRects&&s.getClientRects();e=e.div.getBoundingClientRect(),t=s?Math.max(s[0]&&s[0].height||0,e.height/s.length):0}this.left=e.left,this.right=e.right,this.top=e.top||n,this.height=e.height||i,this.bottom=e.bottom||n+(e.height||i),this.width=e.width||r,this.lineHeight=void 0!==t?t:e.lineHeight}function _(){}g.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},g.prototype.formatStyle=function(e,t){return 0===e?0:e+t},y.prototype=n(g.prototype),y.prototype.constructor=y,v.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},v.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top},v.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++)if(this.overlaps(e[t]))return!0;return!1},v.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},v.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.left<e.left;case"-x":return this.right>e.right;case"+y":return this.top<e.top;case"-y":return this.bottom>e.bottom}},v.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},v.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},v.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,r=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||r,height:e.height||t,bottom:e.bottom||r+(e.height||t),width:e.width||i}},_.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},_.convertCueToDOMTree=function(e,t){return e&&t?f(e,t):null},_.processCues=function(e,t,i){if(!e||!t||!i)return null;for(;i.firstChild;)i.removeChild(i.firstChild);var r,n,s=e.document.createElement("div");if(s.style.position="absolute",s.style.left="0",s.style.right="0",s.style.top="0",s.style.bottom="0",s.style.margin="1.5%",i.appendChild(s),!function(e){for(var t=0;t<e.length;t++)if(e[t].hasBeenReset||!e[t].displayState)return!0;return!1}(t)){for(var a=0;a<t.length;a++)s.appendChild(t[a].displayState);return}for(var o=[],l=v.getSimpleBoxPosition(s),u={font:Math.round(.05*l.height*100)/100+"px sans-serif"},d=0;d<t.length;d++)r=new y(e,n=t[d],u),s.appendChild(r.div),function(e,t,i,r){var n=new v(t),s=t.cue,a=function(e){if("number"==typeof e.line&&(e.snapToLines||e.line>=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return -1;for(var t=e.track,i=t.textTrackList,r=0,n=0;n<i.length&&i[n]!==t;n++)"showing"===i[n].mode&&r++;return -1*++r}(s),o=[];if(s.snapToLines){switch(s.vertical){case"":o=["+y","-y"],l="height";break;case"rl":o=["+x","-x"],l="width";break;case"lr":o=["-x","+x"],l="width"}var l,u=n.lineHeight,d=u*Math.round(a),c=i[l]+u,h=o[0];Math.abs(d)>c&&(d=Math.ceil(c/u)*u*(d<0?-1:1)),a<0&&(d+=""===s.vertical?i.height:i.width,o=o.reverse()),n.move(h,d)}else{var p=n.lineHeight/i.height*100;switch(s.lineAlign){case"center":a-=p/2;break;case"end":a-=p}switch(s.vertical){case"":t.applyStyles({top:t.formatStyle(a,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(a,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(a,"%")})}o=["+y","-x","+x","-y"],n=new v(t)}var f=function(e,t){for(var n,s=new v(e),a=1,o=0;o<t.length;o++){for(;e.overlapsOppositeAxis(i,t[o])||e.within(i)&&e.overlapsAny(r);)e.move(t[o]);if(e.within(i))return e;var l=e.intersectPercentage(i);a>l&&(n=new v(e),a=l),e=new v(s)}return n||s}(n,o);t.move(f.toCSSCompatValues(i))}(0,r,l,o),n.displayState=r.div,o.push(v.getSimpleBoxPosition(r))},_.Parser=function(e,t,i){i||(i=t,t={}),t||(t={}),this.window=e,this.vttjs=t,this.state="INITIAL",this.buffer="",this.decoder=i||new TextDecoder("utf8"),this.regionList=[]},_.Parser.prototype={reportOrThrowError:function(e){if(e instanceof s)this.onparsingerror&&this.onparsingerror(e);else throw e},parse:function(e){var t=this;function i(){for(var e=t.buffer,i=0;i<e.length&&"\r"!==e[i]&&"\n"!==e[i];)++i;var r=e.substr(0,i);return"\r"===e[i]&&++i,"\n"===e[i]&&++i,t.buffer=e.substr(i),r}e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));try{if("INITIAL"===t.state){if(!/\r\n|\n/.test(t.buffer))return this;var r,n=i(),u=n.match(/^WEBVTT([ \t].*)?$/);if(!u||!u[0])throw new s(s.Errors.BadSignature);t.state="HEADER"}for(var d=!1;t.buffer&&/\r\n|\n/.test(t.buffer);)switch(d?d=!1:n=i(),t.state){case"HEADER":/:/.test(n)?(r=n).match(/X-TIMESTAMP-MAP/)?l(r,function(e,i){if("X-TIMESTAMP-MAP"===e){var r;r=new o,l(i,function(e,t){switch(e){case"MPEGT":r.integer(e+"S",t);break;case"LOCA":r.set(e+"L",a(t))}},/[^\d]:/,/,/),t.ontimestampmap&&t.ontimestampmap({MPEGTS:r.get("MPEGTS"),LOCAL:r.get("LOCAL")})}},/=/):l(r,function(e,i){if("Region"===e){var r=new o;if(l(i,function(e,t){switch(e){case"id":r.set(e,t);break;case"width":r.percent(e,t);break;case"lines":r.integer(e,t);break;case"regionanchor":case"viewportanchor":var i=t.split(",");if(2!==i.length)break;var n=new o;if(n.percent("x",i[0]),n.percent("y",i[1]),!n.has("x")||!n.has("y"))break;r.set(e+"X",n.get("x")),r.set(e+"Y",n.get("y"));break;case"scroll":r.alt(e,t,["up"])}}
74,/=/,/\s/),r.has("id")){var n=new(t.vttjs.VTTRegion||t.window.VTTRegion);n.width=r.get("width",100),n.lines=r.get("lines",3),n.regionAnchorX=r.get("regionanchorX",0),n.regionAnchorY=r.get("regionanchorY",100),n.viewportAnchorX=r.get("viewportanchorX",0),n.viewportAnchorY=r.get("viewportanchorY",100),n.scroll=r.get("scroll",""),t.onregion&&t.onregion(n),t.regionList.push({id:r.get("id"),region:n})}}},/:/):n||(t.state="ID");continue;case"NOTE":n||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(n)){t.state="NOTE";break}if(!n)continue;t.cue=new(t.vttjs.VTTCue||t.window.VTTCue)(0,0,"");try{t.cue.align="center"}catch(e){t.cue.align="middle"}if(t.state="CUE",-1===n.indexOf("--\x3e")){t.cue.id=n;continue}case"CUE":try{!function(e,t,i){var r=e;function n(){var t=a(e);if(null===t)throw new s(s.Errors.BadTimeStamp,"Malformed timestamp: "+r);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function u(){e=e.replace(/^\s+/,"")}if(u(),t.startTime=n(),u(),"--\x3e"!==e.substr(0,3))throw new s(s.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+r);e=e.substr(3),u(),t.endTime=n(),u();var d=e,c=new o;l(d,function(e,t){switch(e){case"region":for(var r=i.length-1;r>=0;r--)if(i[r].id===t){c.set(e,i[r].region);break}break;case"vertical":c.alt(e,t,["rl","lr"]);break;case"line":var n=t.split(","),s=n[0];c.integer(e,s),c.percent(e,s)&&c.set("snapToLines",!1),c.alt(e,s,["auto"]),2===n.length&&c.alt("lineAlign",n[1],["start","center","end"]);break;case"position":n=t.split(","),c.percent(e,n[0]),2===n.length&&c.alt("positionAlign",n[1],["start","center","end"]);break;case"size":c.percent(e,t);break;case"align":c.alt(e,t,["start","center","end","left","right"])}},/:/,/\s/),t.region=c.get("region",null),t.vertical=c.get("vertical","");try{t.line=c.get("line","auto")}catch(e){}t.lineAlign=c.get("lineAlign","start"),t.snapToLines=c.get("snapToLines",!0),t.size=c.get("size",100);try{t.align=c.get("align","center")}catch(e){t.align=c.get("align","middle")}try{t.position=c.get("position","auto")}catch(e){t.position=c.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=c.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}(n,t.cue,t.regionList)}catch(e){t.reportOrThrowError(e),t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":var c=-1!==n.indexOf("--\x3e");if(!n||c&&(d=!0)){t.oncue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}t.cue.text&&(t.cue.text+="\n"),t.cue.text+=n.replace(/\u2028/g,"\n").replace(/u2029/g,"\n");continue;case"BADCUE":n||(t.state="ID");continue}}catch(e){t.reportOrThrowError(e),"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){try{if(this.buffer+=this.decoder.decode(),(this.cue||"HEADER"===this.state)&&(this.buffer+="\n\n",this.parse()),"INITIAL"===this.state)throw new s(s.Errors.BadSignature)}catch(e){this.reportOrThrowError(e)}return this.onflush&&this.onflush(),this}},e.exports=_},8003:function(e){var t={"":1,lr:1,rl:1},i={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function r(e){return"string"==typeof e&&!!i[e.toLowerCase()]&&e.toLowerCase()}function n(e,i,n){this.hasBeenReset=!1;var s="",a=!1,o=e,l=i,u=n,d=null,c="",h=!0,p="auto",f="start",m="auto",g="auto",y=100,v="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return s},set:function(e){s=""+e}},pauseOnExit:{enumerable:!0,get:function(){return a}
74,set:function(e){a=!!e}},startTime:{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e)throw TypeError("Start time must be set to a number.");o=e,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return l},set:function(e){if("number"!=typeof e)throw TypeError("End time must be set to a number.");l=e,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return u},set:function(e){u=""+e,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return d},set:function(e){d=e,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return c},set:function(e){var i="string"==typeof e&&!!t[e.toLowerCase()]&&e.toLowerCase();if(!1===i)throw SyntaxError("Vertical: an invalid or illegal direction string was specified.");c=i,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return h},set:function(e){h=!!e,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return p},set:function(e){if("number"!=typeof e&&"auto"!==e)throw SyntaxError("Line: an invalid number or illegal string was specified.");p=e,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return f},set:function(e){var t=r(e);t?(f=t,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return m},set:function(e){if(e<0||e>100)throw Error("Position must be between 0 and 100.");m=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return g},set:function(e){var t=r(e);t?(g=t,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return y},set:function(e){if(e<0||e>100)throw Error("Size must be between 0 and 100.");y=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return v},set:function(e){var t=r(e);if(!t)throw SyntaxError("align: an invalid or illegal alignment string was specified.");v=t,this.hasBeenReset=!0}}}),this.displayState=void 0}n.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},e.exports=n},1575:function(e){var t={"":!0,up:!0};function i(e){return"number"==typeof e&&e>=0&&e<=100}e.exports=function(){var e=100,r=3,n=0,s=100,a=0,o=100,l="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!i(t))throw Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return r},set:function(e){if("number"!=typeof e)throw TypeError("Lines must be set to a number.");r=e}},regionAnchorY:{enumerable:!0,get:function(){return s},set:function(e){if(!i(e))throw Error("RegionAnchorX must be between 0 and 100.");s=e}},regionAnchorX:{enumerable:!0,get:function(){return n},set:function(e){if(!i(e))throw Error("RegionAnchorY must be between 0 and 100.");n=e}},viewportAnchorY:{enumerable:!0,get:function(){return o},set:function(e){if(!i(e))throw Error("ViewportAnchorY must be between 0 and 100.");o=e}},viewportAnchorX:{enumerable:!0,get:function(){return a}
74,set:function(e){if(!i(e))throw Error("ViewportAnchorX must be between 0 and 100.");a=e}},scroll:{enumerable:!0,get:function(){return l},set:function(e){var i="string"==typeof e&&!!t[e.toLowerCase()]&&e.toLowerCase();!1===i?console.warn("Scroll: an invalid or illegal string was specified."):l=i}}})}},7577:function(e){"use strict";e.exports={setTabNextFocus:function(e){if("Tab"===e.event.key||9===e.event.keyCode){var t=$(e.containerSelector+" "+e.firstElementSelector),i=$(e.containerSelector+" "+e.lastElementSelector);if($(e.containerSelector+" "+e.lastElementSelector).is(":disabled")&&(i=$(e.containerSelector+" "+e.nextToLastElementSelector),$(".product-quickview.product-set").length>0)){var r=$(e.containerSelector+" a#fa-link.share-icons");i=r[r.length-1]}e.event.shiftKey?$(":focus").is(t)&&(i.focus(),e.event.preventDefault()):$(":focus").is(i)&&(t.focus(),e.event.preventDefault())}}}},4493:function(e,t,i){"use strict";var r=i(7577),n=window.location;function s(e){return $("#quickViewModal").hasClass("show")&&!$(".product-set").length?$(e).closest(".modal-content").find(".product-quickview").data("pid"):$(".product-set-detail").length||$(".product-set").length?$(e).closest(".product-detail").find(".product-id").text():$('.product-detail:not(".bundle-item")').data("pid")}function a(e){var t;if(e&&$(".set-items").length)t=$(e).closest(".product-detail").find(".quantity-select");else if(e&&$(".product-bundle").length){var i=$(e).closest(".modal-footer").find(".quantity-select"),r=$(e).closest(".bundle-footer").find(".quantity-select");t=void 0===i.val()?r:i}else t=$(".quantity-select");return t}function o(e){return a(e).val()}function l(e,t){e&&($("body").trigger("product:beforeAttributeSelect",{url:e,container:t}),$.ajax({url:e,method:"GET",success:function(e){!function(e,t){var i,r,n,s,a,o,l=t.parents(".choose-bonus-product-dialog").length>0;e.product.variationAttributes&&(i=e.product.variationAttributes,r=e.resources,n=["color"],i.forEach(function(e){var i;n.indexOf(e.id)>-1?e.values.forEach(function(i){var n=t.find('[data-attr="'+e.id+'"] [data-attr-value="'+i.value+'"]'),s=n.parent();i.selected?(n.addClass("selected"),n.siblings(".selected-assistive-text").text(r.assistiveSelectedText)):(n.removeClass("selected"),n.siblings(".selected-assistive-text").empty()),i.url?s.attr("data-url",i.url):s.removeAttr("data-url"),n.removeClass("selectable unselectable"),n.addClass(i.selectable?"selectable":"unselectable")}):(i='[data-attr="'+e.id+'"]',t.find(i+" .select-"+e.id+" option:first").attr("value",e.resetUrl),e.values.forEach(function(e){var r=t.find(i+' [data-attr-value="'+e.value+'"]');r.attr("value",e.url).removeAttr("disabled"),e.selectable||r.attr("disabled",!0)}))}),o="variant"===e.product.productType,l&&o&&(t.parent(".bonus-product-item").data("pid",e.product.id),t.parent(".bonus-product-item").data("ready-to-order",e.product.readyToOrder)));var u=e.product.images.large,d=t.find(".carousel");$(d).carousel("dispose");var c=$(d).attr("id");$(d).empty().append('<ol class="carousel-indicators"></ol><div class="carousel-inner" role="listbox"></div><a class="carousel-control-prev" href="#'+c+'" role="button" data-slide="prev"><span class="fa icon-prev" aria-hidden="true"></span><span class="sr-only">'+$(d).data("prev")+'</span></a><a class="carousel-control-next" href="#'+c+'" role="button" data-slide="next"><span class="fa icon-next" aria-hidden="true"></span><span class="sr-only">'+$(d).data("next")+"</span></a>");for(var h=0;h<u.length;h++)$('<div class="carousel-item"><img src="'+u[h].url+'" class="d-block img-fluid" alt="'+u[h].alt+" image number "+parseInt(u[h].index,10)+'" title="'+u[h].title+'" itemprop="image" /></div>').appendTo($(d).find(".carousel-inner")),$('<li data-target="#'+c+'" data-slide-to="'+h+'" class=""></li>').appendTo($(d).find(".carousel-indicators"));$($(d).find(".carousel-item")).first().addClass("active"),$($(d).find(".carousel-indicators > li")).first().addClass("active"),1===u.length&&$($(d).find('.carousel-indicators, a[class^="carousel-control-"]')).detach(),$(d).carousel(),$($(d).find(".carousel-indicators")).attr("aria-hidden",!0),l||($(".prices .price",t).length?$(".prices .price",t):$(".prices .price")).replaceWith(e.product.price.html),t.find(".promotions").empty().html(e.product.promotionsHtml),s="",a=e.product.availability.messages,e.product.readyToOrder?a.forEach(function(e){s+="<li><div>"+e+"</div></li>"}):s="<li><div>"+e.resources.info_selectforstock+"</div></li>",$(t).trigger("product:updateAvailability",{product:e.product,$productC
74ontainer:t,message:s,resources:e.resources}),l?t.find(".select-bonus-product").trigger("bonusproduct:updateSelectButton",{product:e.product,$productContainer:t}):$("button.add-to-cart, button.add-to-cart-global, button.update-cart-product-global").trigger("product:updateAddToCart",{product:e.product,$productContainer:t}).trigger("product:statusUpdate",e.product),t.find(".main-attributes").empty().html(function(e){if(!e)return"";var t="";return e.forEach(function(e){"mainAttributes"===e.ID&&e.attributes.forEach(function(e){t+='<div class="attribute-values">'+e.label+": "+e.value+"</div>"})}),t}(e.product.attributes))}(e,t),i=e.product.optionsHtml,t.find(".product-options").empty().html(i);var i,r=e.product.quantities;if(t.parent(".bonus-product-item").length<=0){var n=r.map(function(e){var t=e.selected?" selected ":"";return'<option value="'+e.value+'"  data-url="'+e.url+'"'+t+">"+e.value+"</option>"}).join("");a(t).empty().html(n)}$("body").trigger("product:afterAttributeSelect",{data:e,container:t}),$.spinner().stop()},error:function(){$.spinner().stop()}}))}function u(e){var t=$("<div>").append($.parseHTML(e));return{body:t.find(".choice-of-bonus-product"),footer:t.find(".modal-footer").children()}}function d(e){$(".modal-body").spinner().start(),0!==$("#chooseBonusProductModal").length&&$("#chooseBonusProductModal").remove();var t=e.bonusChoiceRuleBased?e.showProductsUrlRuleBased:e.showProductsUrlListBased,i='\x3c!-- Modal --\x3e<div class="modal fade" id="chooseBonusProductModal" tabindex="-1" role="dialog"><span class="enter-message sr-only" ></span><div class="modal-dialog choose-bonus-product-dialog" data-total-qty="'+e.maxBonusItems+'"data-UUID="'+e.uuid+'"data-pliUUID="'+e.pliUUID+'"data-addToCartUrl="'+e.addToCartUrl+'"data-pageStart="0"data-pageSize="'+e.pageSize+'"data-moreURL="'+e.showProductsUrlRuleBased+'"data-bonusChoiceRuleBased="'+e.bonusChoiceRuleBased+'">\x3c!-- Modal content--\x3e<div class="modal-content"><div class="modal-header">    <span class="">'+e.labels.selectprods+'</span>    <button type="button" class="close pull-right" data-dismiss="modal">        <span aria-hidden="true">&times;</span>        <span class="sr-only"> </span>    </button></div><div class="modal-body"></div><div class="modal-footer"></div></div></div></div>';$("body").append(i),$(".modal-body").spinner().start(),$.ajax({url:t,method:"GET",dataType:"json",success:function(e){var t=u(e.renderedTemplate);$("#chooseBonusProductModal .modal-body").empty(),$("#chooseBonusProductModal .enter-message").text(e.enterDialogMessage),$("#chooseBonusProductModal .modal-header .close .sr-only").text(e.closeButtonText),$("#chooseBonusProductModal .modal-body").html(t.body),$("#chooseBonusProductModal .modal-footer").html(t.footer),$("#chooseBonusProductModal").modal("show"),$.spinner().stop()},error:function(){$.spinner().stop()}})}function c(e){return JSON.stringify(e.find(".product-option").map(function(){var e=$
74(this).find(".options-select"),t=e.val(),i=e.find('option[value="'+t+'"]').data("value-id");return{optionId:$(this).data("option-id"),selectedValueId:i}}).toArray())}function h(e){e&&$.ajax({url:e,method:"GET",success:function(){},error:function(){}})}e.exports={attributeSelect:l,methods:{editBonusProducts:function(e){d(e)}},focusChooseBonusProductModal:function(){$("body").on("shown.bs.modal","#chooseBonusProductModal",function(){$("#chooseBonusProductModal").siblings().attr("aria-hidden","true"),$("#chooseBonusProductModal .close").focus()})},onClosingChooseBonusProductModal:function(){$("body").on("hidden.bs.modal","#chooseBonusProductModal",function(){$("#chooseBonusProductModal").siblings().attr("aria-hidden","false")})},trapChooseBonusProductModalFocus:function(){$("body").on("keydown","#chooseBonusProductModal",function(e){r.setTabNextFocus({event:e,containerSelector:"#chooseBonusProductModal",firstElementSelector:".close",lastElementSelector:".add-bonus-products"})})},colorAttribute:function(){$(document).on("click",'[data-attr="color"] button',function(e){if(e.preventDefault(),!$(this).attr("disabled")){var t=$(this).closest(".set-item");t.length||(t=$(this).closest(".product-detail")),l($(this).attr("data-url"),t)}})},selectAttribute:function(){$(document).on("change",'select[class*="select-"], .options-select',function(e){e.preventDefault();var t=$(this).closest(".set-item");t.length||(t=$(this).closest(".product-detail")),l(e.currentTarget.value,t)})},availability:function(){$(document).on("change",".quantity-select",function(e){e.preventDefault();var t=$(this).closest(".product-detail");t.length||(t=$(this).closest(".modal-content").find(".product-quickview")),0===$(".bundle-items",t).length&&l($(e.currentTarget).find("option:selected").data("url"),t)})},addToCart:function(){$(document).on("click","button.add-to-cart, button.add-to-cart-global",function(){$("body").trigger("product:beforeAddToCart",this),$(".set-items").length&&$(this).hasClass("add-to-cart-global")&&(r=[],$(".product-detail").each(function(){$(this).hasClass("product-set-detail")||r.push({pid:$(this).find(".product-id").text(),qty:$(this).find(".quantity-select").val(),options:c($(this))})}),i=JSON.stringify(r));var e,t,i,r,n=s($(this)),a=$(this).closest(".product-detail");a.length||(a=$(this).closest(".quick-view-dialog").find(".product-detail")),t=$(".add-to-cart-url").val();var l={pid:n,pidsObj:i,childProducts:(e=[],$(".bundle-item").each(function(){e.push({pid:$(this).find(".product-id").text(),quantity:parseInt($(this).find("label.quantity").data("quantity"),10)})}),e.length?JSON.stringify(e):[]),quantity:o($(this))};$(".bundle-item").length||(l.options=c(a)),$(this).trigger("updateAddToCartFormData",l),t&&$.ajax({url:t,method:"POST",data:l,success:function(e){var t;$(".minicart").trigger("count:update",e),t=e.error?"alert-danger":"alert-success",e.newBonusDiscountLineItem&&0!==Object.keys(e.newBonusDiscountLineItem).length?d(e.newBonusDiscountLineItem):(0===$(".add-to-cart-messages").length&&$("body").append('<div class="add-to-cart-messages"></div>'),$(".add-to-cart-messages").append('<div class="alert '+t+' add-to-basket-alert text-center" role="alert">'+e.message+"</div>"),setTimeout(function(){$(".add-to-basket-alert").remove()},5e3)),$("body").trigger("product:afterAddToCart",e),$.spinner().stop(),h(e.reportingURL)},error:function(){$.spinner().stop()}})})},selectBonusProduct:function(){$(document).on("click",".select-bonus-product",function(){var e=$
74(this).parents(".choice-of-bonus-product"),t=$(this).data("pid"),i=$(".choose-bonus-product-dialog").data("total-qty"),r=parseInt(e.find(".bonus-quantity-select").val(),10),n=0;$.each($("#chooseBonusProductModal .selected-bonus-products .selected-pid"),function(){n+=$(this).data("qty")}),n+=r;var s=e.find(".product-option").data("option-id"),a=e.find(".options-select option:selected").data("valueId");if(n<=i){var o='<div class="selected-pid row" data-pid="'+t+'"data-qty="'+r+'"data-optionID="'+(s||"")+'"data-option-selected-value="'+(a||"")+'"><div class="col-sm-11 col-9 bonus-product-name" >'+e.find(".product-name").html()+'</div><div class="col-1"><i class="fa fa-times" aria-hidden="true"></i></div></div>';$("#chooseBonusProductModal .selected-bonus-products").append(o),$(".pre-cart-products").html(n),$(".selected-bonus-products .bonus-summary").removeClass("alert-danger")}else $(".selected-bonus-products .bonus-summary").addClass("alert-danger")})},removeBonusProduct:function(){$(document).on("click",".selected-pid",function(){$(this).remove();var e=$("#chooseBonusProductModal .selected-bonus-products .selected-pid"),t=0;e.length&&e.each(function(){t+=parseInt($(this).data("qty"),10)}),$(".pre-cart-products").html(t),$(".selected-bonus-products .bonus-summary").removeClass("alert-danger")})},enableBonusProductSelection:function(){$("body").on("bonusproduct:updateSelectButton",function(e,t){$("button.select-bonus-product",t.$productContainer).attr("disabled",!t.product.readyToOrder||!t.product.available);var i=t.product.id;$("button.select-bonus-product",t.$productContainer).data("pid",i)})},showMoreBonusProducts:function(){$(document).on("click",".show-more-bonus-products",function(){var e=$
74(this).data("url");$(".modal-content").spinner().start(),$.ajax({url:e,method:"GET",success:function(e){var t=u(e);$(".modal-body").append(t.body),$(".show-more-bonus-products:first").remove(),$(".modal-content").spinner().stop()},error:function(){$(".modal-content").spinner().stop()}})})},addBonusProductsToCart:function(){$(document).on("click",".add-bonus-products",function(){var e=$(".choose-bonus-product-dialog .selected-pid"),t="?pids=",i=$(".choose-bonus-product-dialog").data("addtocarturl"),r={bonusProducts:[]};$.each(e,function(){var e=parseInt($(this).data("qty"),10),t=null;e>0&&($(this).data("optionid")&&$(this).data("option-selected-value")&&((t={}).optionId=$(this).data("optionid"),t.productId=$(this).data("pid"),t.selectedValueId=$(this).data("option-selected-value")),r.bonusProducts.push({pid:$(this).data("pid"),qty:e,options:[t]}),r.totalQty=parseInt($(".pre-cart-products").html(),10))}),t+=JSON.stringify(r),t=(t=t+"&uuid="+$(".choose-bonus-product-dialog").data("uuid"))+"&pliuuid="+$(".choose-bonus-product-dialog").data("pliuuid"),$.spinner().start(),$.ajax({url:i+t,method:"POST",success:function(e){$.spinner().stop(),e.error?($("#chooseBonusProductModal").modal("hide"),0===$(".add-to-cart-messages").length&&$("body").append('<div class="add-to-cart-messages"></div>'),$(".add-to-cart-messages").append('<div class="alert alert-danger add-to-basket-alert text-center" role="alert">'+e.errorMessage+"</div>"),setTimeout(function(){$(".add-to-basket-alert").remove()},3e3)):($(".configure-bonus-product-attributes").html(e),$(".bonus-products-step2").removeClass("hidden-xl-down"),$("#chooseBonusProductModal").modal("hide"),0===$(".add-to-cart-messages").length&&$("body").append('<div class="add-to-cart-messages"></div>'),$(".minicart-quantity").html(e.totalQty),$(".add-to-cart-messages").append('<div class="alert alert-success add-to-basket-alert text-center" role="alert">'+e.msgSuccess+"</div>"),setTimeout(function(){$(".add-to-basket-alert").remove(),$(".cart-page").length&&n.reload()},1500))},error:function(){$.spinner().stop()}})})},getPidValue:s,getQuantitySelected:o,miniCartReportingUrl:h}},6600:function(e,t,i){"use strict";var r=i(4493);e.exports={methods:{updateAddToCartEnableDisableOtherElements:function(e){$("button.add-to-cart-global").attr("disabled",e)}},availability:r.availability,addToCart:r.addToCart,updateAttributesAndDetails:function(){$("body").on("product:statusUpdate",function(e,t){var i=$('.product-detail[data-pid="'+t.id+'"]');i.find(".description-and-detail .product-attributes").empty().html(t.attributesHtml),t.shortDescription?(i.find(".description-and-detail .description").removeClass("hidden-xl-down"),i.find(".description-and-detail .description .content").empty().html(t.shortDescription)):i.find(".description-and-detail .description").addClass("hidden-xl-down"),t.longDescription?(i.find(".description-and-detail .details").removeClass("hidden-xl-down"),i.find(".description-and-detail .details .content").empty().html(t.longDescription)):i.find(".description-and-detail .details").addClass("hidden-xl-down")})},showSpinner:function(){$("body").on("product:beforeAddToCart product:beforeAttributeSelect",function(){$.spinner().start()})},updateAttribute:function(){$("body").on("product:afterAttributeSelect",function(e,t){$(".product-detail>.bundle-items").length||$(".product-set-detail").eq(0)?(t.container.data("pid",t.data.product.id),t.container.find(".product-id").text(t.data.product.id)):($(".product-id").text(t.data.product.id),$('.product-detail:not(".bundle-item")').data("pid",t.data.product.id))})},updateAddToCart:function(){$("body").on("product:updateAddToCart",function(t,i){$("button.add-to-cart",i.$productContainer).attr("disabled",!i.product.readyToOrder||!i.product.available);var r=$(".product-availability").toArray().every(function(e){return $(e).data("available")&&$(e).data("ready-to-order")});e.exports.methods.updateAddToCartEnableDisableOtherElements(!r)})},updateAvailability:function(){$("body").on("product:updateAvailability",function(e,t){if($("div.availability",t.$productC
74ontainer).data("ready-to-order",t.product.readyToOrder).data("available",t.product.available),$(".availability-msg",t.$productContainer).empty().html(t.message),$(".global-availability").length){var i=$(".product-availability").toArray().every(function(e){return $(e).data("available")}),r=$(".product-availability").toArray().every(function(e){return $(e).data("ready-to-order")});$(".global-availability").data("ready-to-order",r).data("available",i),$(".global-availability .availability-msg").empty().html(r?t.message:t.resources.info_selectforstock)}})},sizeChart:function(){$(".size-chart a").on("click",function(e){e.preventDefault();var t=$(this).attr("href"),i=$(this).closest(".size-chart").find(".size-chart-collapsible");i.is(":empty")&&$.ajax({url:t,type:"get",dataType:"json",success:function(e){i.append(e.content)}}),i.toggleClass("active")});var e=$(".size-chart-collapsible");$("body").on("click touchstart",function(t){$(".size-chart").has(t.target).length<=0&&e.removeClass("active")})},copyProductLink:function(){$("body").on("click","#fa-link",function(e){e.preventDefault();var t=$("<input>");$("body").append(t),t.val($("#shareUrl").val()).select(),document.execCommand("copy"),t.remove(),$(".copy-link-message").attr("role","alert"),$(".copy-link-message").removeClass("d-none"),setTimeout(function(){$(".copy-link-message").addClass("d-none")},3e3)})},focusChooseBonusProductModal:r.focusChooseBonusProductModal()}},5790:function(e){"use strict";e.exports=function(e){"function"==typeof e?e():"object"==typeof e&&Object.keys(e).forEach(function(t){"function"==typeof e[t]&&e[t]()})}},3724:function(e,t,i){"use strict";let{disableBodyScroll:r,enableBodyScroll:n,clearAllBodyScrollLocks:s}=i(7138),a=i(3348),{nextTick:o}=i(8464),{customEvents:l}=i(1167),{createBehavior:u}=i(2881),d=u("Modal",{updateTriggers(e){if(!this.$node||!this.$node.isConnected)return void this.destroy();let t=e.detail?.node.querySelectorAll(this.querySelectorTrigger);t&&(t?.forEach(e=>{e.removeEventListener("click",this.toggle),e.addEventListener("click",this.toggle)}),this.$triggers?this.$triggers=new Set([...this.$triggers,...t]):this.$triggers=t)},toggle(e){if(!this.$node||!this.$node.isConnected)return void this.destroy();if(e.preventDefault(),e.stopPropagation(),e.currentTarget&&e.currentTarget.dataset&&e.currentTarget.dataset.trackingClickEvent&&e.currentTarget.dataset.trackingEventPayload)try{var t=JSON.parse(e.currentTarget.dataset.trackingEventPayload);window.dataLayer=window.dataLayer||[],window.dataLayer.push({ecommerce:null}),window.dataLayer.push(t)}catch(e){console.error("Error parsing GTM event payload in Modal:",e)}this.modalData.isActive?this.close(e):this.open(e)},close(e){e?.preventDefault(),e?.stopPropagation(),this.modalData.isActive&&(this.$node.removeAttribute("data-active"),this.modalData.focusTrap.deactivate({returnFocus:!0}),this.modalData.isActive=!1,s(),setTimeout(()=>{this.$scroller&&n(this.$scroller),this.$node.dispatchEvent(new CustomEvent(l.MODAL_NODE_CLOSED)),document.dispatchEvent(new CustomEvent(l.MODAL_CLOSED))},200),this.disposeOpenEvents())},openFromOutside(e){if(!this.$node||!this.$node.isConnected)return void this.destroy();e.detail?.modalId!==this.$modalId||this.modalData.isActive||(e.preventDefault(),e.stopPropagation(),this.open())},open(e){this.$node.removeAttribute("data-prevent-reopen");let t=document.querySelector("[data-behavior='Modal'][data-active]")?.id||null;e?.detail?.isReopen||(this.modalData.modalOpenedId=t!==this.$node.getAttribute("id")?t:null),"dialog-remove-from-cart"!==this.$node.getAttribute("id")&&document.dispatchEvent(new CustomEvent(l.MODAL_CLOSE_ALL)),document.dispatchEvent(new CustomEvent(l.MODAL_OPENED)),this.$node.dispatchEvent(new CustomEvent(l.MODAL_NODE_OPENED)),r(this.$scroller,{reserveScrollBarGap:!0}),this.$node.setAttribute("data-init","true"),this.$node.setAttribute("data-active","true"),this.modalData.isActive=!0,o(()=>{this.registerOpenEvents()}),this.modalData.focusTrap.activate()},handleEsc(e){if(!this.$node||!this.$node.isConnected)return void this.destroy();"Escape"===e.key&&this.close()},handleClickOutside(e){this.modalData.isActive&&!this.$focusTrap.contains(e.target)&&this.close(e)},registerOpenEvents(){this.$clickOutside&&(document.addEventListener("click",this.handleClickOutside,!1),this.$node.addEventListener("click",this.handleClickOutside,!1))},disposeOpenEvents(){this.$clickOutside&&(this.$focusTrap.removeEventListener("click",this.handleCloseInside,!1),document.removeEventListener("click",this.handleClickOutside,!1),this.$node.removeEventListener("click",this.handleClickOutside,!1))}},{init(){this.$focusTrap=this.getChild("focus-trap"),this.$scroller=this.getChild("scroller")?this.getChild("scroller"):this.$focusTrap,this.$closeButtons=this.getChildren("close-trigger"),this.$initialFocus=this.getChild("initial-focus"),this.$clickOutside=this.options.panel||this.options.clickoutside,this.$initialFocus||console.warn("No initial focus element found. Add a `h1` with the attribute `data-modal-initial-focus`. The `h1` should also have an id that matches the modal id with `_title` appended"),this.modalData={},this.modalData.focusTrap=a.createFocusTrap(this.$focusTrap,{initialFocus:this.$initialFocus,fallbackFocus:this.$node,clickOutsideDeactivates:this.$clickOutside,onDeactivate:()=>{let e=this.modalData.modalOpenedId||null;setTimeout(()=>{let t=document.getElementById(e);t&&"true"!==this.$node.getAttribute("data-prevent-reopen")&&t.dispatchEvent(new CustomEvent(l.MODAL_NODE_OPEN,{detail:{isReopen:!0}}))},100)}}),this.modalData.isActive=!1,this.$closeButtons&&this.$closeButtons.forEach(e
74=>{e.addEventListener("click",this.close,!1)}),this.$node.addEventListener(l.MODAL_NODE_OPEN,this.open,!1),this.$node.addEventListener(l.MODAL_NODE_TOGGLE,this.toggle,!1),this.$node.addEventListener(l.MODAL_NODE_CLOSE,this.close,!1),document.addEventListener(l.MODAL_OPEN_BY_ID,this.openFromOutside,!1),document.addEventListener(l.MODAL_CLOSE_ALL,this.close,!1),document.addEventListener("keyup",this.handleEsc,!1),this.$modalId=this.$node.getAttribute("id"),this.querySelectorTrigger=`[data-modal-target="#${this.$modalId}"]`,this.$triggers=document.querySelectorAll(this.querySelectorTrigger),this.$triggers?.forEach(e=>{e.addEventListener("click",this.toggle)}),document.addEventListener(l.MODAL_TRIGGER_UPDATED,this.updateTriggers,!1),this.options.open&&this.open()},destroy(){this.close(),this.modalData.isActive=!1,this.$closeButtons&&this.$closeButtons.forEach(e=>{e.removeEventListener("click",this.close)}),this.$node.removeEventListener(l.MODAL_NODE_OPEN,this.open),this.$node.removeEventListener(l.MODAL_NODE_TOGGLE,this.toggle),this.$node.removeEventListener(l.MODAL_NODE_CLOSE,this.close),this.$node.removeEventListener("click",this.handleClickOutside),document.removeEventListener(l.MODAL_OPEN_BY_ID,this.openFromOutside),document.removeEventListener(l.MODAL_CLOSE_ALL,this.close),document.removeEventListener("keyup",this.handleEsc),this.$triggers?.forEach(e=>{e.removeEventListener("click",this.toggle)}),document.removeEventListener(l.MODAL_TRIGGER_UPDATED,this.updateTriggers,!1),this.disposeOpenEvents()}});e.exports=i(4518)("Modal",d)},9477:function(e,t,i){"use strict";let{customEvents:r}=i(1167),{createBehavior:n}=i(2881),s="s-active",a=n("ModalZoom",{addProgress(e){this.arrProgress.push(e),this.progress=Math.max(...this.arrProgress),this.setActiveSlide()},removeProgress(e){this.arrProgress.includes(e)&&this.arrProgress.splice(this.arrProgress.indexOf(e),1),this.progress=Math.max(...this.arrProgress),this.setActiveSlide()},setActiveSlide(){this.$btns.forEach(e=>{Number(e.dataset.index)===this.progress?e.classList.add(s):e.classList.remove(s)})},handleClick(e){let t=e.currentTarget.dataset.index;this.goToSlide(t,!0)},moveSlide(e){let t=e.detail.index;this.goToSlide(t,!1)},loadImages(){this.imagesLoaded||(this.$node.querySelectorAll("img[data-src]").forEach(e=>{e.setAttribute("src",e.getAttribute("data-src")),e.removeAttribute("data-src")}),this.imagesLoaded=!0)},goToSlide(e,t=!0){this.loadImages();let i=parseInt(e,10);if(isNaN(i)||!this.$images||!this.$images[i])return;let r=0;this.$images.forEach((e,t)=>{t<i&&(r+=e.offsetHeight)}),r+=this.$images[i].offsetHeight/2-window.innerHeight/2,this.$modalScroller&&this.$modalScroller.scrollTo({top:Math.max(0,r),left:0,behavior:t?"smooth":"instant"})}},{init(){this.$modalScroller=this.getChild("scroller"),this.$images=this.getChildren("image"),this.$imagesSpy=this.getChildren("spy"),this.$btns=this.getChildren("btn"),this.progress=-1,this.arrProgress=[],this.imagesLoaded=!1,this.$btns.forEach(e=>{e.addEventListener("click",this.handleClick)}),this.observer=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting?this.addProgress(Number(e.target.dataset.index)):this.removeProgress(Number(e.target.dataset.index))})},{root:null,threshold:0}),this.$imagesSpy.forEach(e=>this.observer.observe(e)),document.addEventListener(r.MODAL_ZOOM_MOVE,this.moveSlide)},resized(){},destroy(){this.$btns.forEach(e=>{e.removeEventListener("click",this.handleClick)}),this.$modalScroller.removeEventListener("scroll",this.handleScroll),document.removeEventListener(r.MODAL_ZOOM_MOVE,this.moveSlide),this.observer.disconnect()}});e.exports=i(4518)("ModalZoom",a)},473:function(e,t,i){"use strict";let{customEvents:r}=i(1167),{modalIds:n}=i(9966),{createBehavior:s}=i(2881),a="data-pdpgallery-btn",o=s("PDPGallery",{isZoomInactive(){return this.isBreakpoint("sm")||this.isBreakpoint("md")},openZoom(e){if(this.isZoomInactive())return;let t=e.currentTarget.hasAttribute(a)?e.currentTarget:e.currentTarget.closest(`[${a}]`);e.preventDefault(),e.stopPropagation(),document.dispatchEvent(new CustomEvent(r.MODAL_ZOOM_MOVE,{detail:{index:t.dataset.index}})),document.dispatchEvent(new CustomEvent(r.MODAL_OPEN_BY_ID,{detail:{modalId:n.ZOOM}}))}},{init(){this.$btns=this.getChildren("btn"),this.$btns.forEach(e
74=>{e.addEventListener("click",this.openZoom)})},resized(){},destroy(){this.$btns.forEach(e=>{e.removeEventListener("click",this.openZoom)})}});e.exports=i(4518)("PDPGallery",o)},1571:function(e,t,i){"use strict";let{createBehavior:r}=i(2881),{customEvents:n}=i(1167),s="s-hide-actions",a="s-lock-gallery",o="s-fix-actions",l="--actions-height",u="--header-inner-height",d="--gallery-height",c="--window-scroll-y",h=r("PDPScroll",{isMobileBP(){return this.isBreakpoint("sm")||this.isBreakpoint("md")},initObserver(){this.observer.active||(this.observer=new IntersectionObserver(e=>{this.$cursor.style.opacity=e[0].isIntersecting?"0":"1",this.galleryFullyScrolled=e[0].isIntersecting},{rootMargin:`0px 0px -${this.$header.getBoundingClientRect().height+this.$actions.getBoundingClientRect().height}px 0px`}),this.observer.observe(this.$galleryEnd),this.observer.active=!0)},footerVisible(){document.documentElement.classList.add(s)},footerNotVisible(){document.documentElement.classList.remove(s)},desactiveObserver(){this.observer.active&&(this.observer.unobserve(this.$galleryEnd),this.observer.active=!1)},setSizes(){if(this.isMobile=this.isMobileBP(),!this.isMobile){this.removeEvents(),document.documentElement.style.removeProperty(c),document.documentElement.style.removeProperty(d),document.documentElement.style.removeProperty(u),document.documentElement.style.removeProperty(l),document.documentElement.classList.remove(a),document.documentElement.classList.remove(o),this.locked=!1,this.actionsFixed=!1;return}this.eventsAdded||this.addEvents(),this.galleryHeight=this.$gallery.getBoundingClientRect().height,this.headerTopInitPos=this.$header.getBoundingClientRect().top,this.actionsHeight=this.$actions.getBoundingClientRect().height,this.headerInnerHeight=this.$headerInner.getBoundingClientRect().height,!this.actionsFixed&&this.actionsHeight>0&&(document.documentElement.style.setProperty(l,this.actionsHeight+"px"),document.documentElement.style.setProperty(u,this.headerInnerHeight+"px"),document.documentElement.classList.add(o),this.actionsFixed=!0),this.desactiveObserver(),this.initObserver()},lockHeight(){this.locked||this.galleryFullyScrolled||(this.headerTopInitPos=this.$header.getBoundingClientRect().top,document.documentElement.style.setProperty(c,-1*window.scrollY+"px"),document.documentElement.style.setProperty(d,this.headerTopInitPos+window.scrollY+1+"px"),document.documentElement.classList.add(a),this.scrollLockedAt=window.scrollY,this.locked=!0)},unlockHeight(){this.locked&&window.scrollY<=this.scrollLockedAt&&(this.locked=!1,document.documentElement.classList.remove(a))},addEvents(){this.eventsAdded=!0,this.$header.addEventListener("mouseover",this.lockHeight),this.$header.addEventListener("touchstart",this.lockHeight),this.$actions.addEventListener("mouseover",this.lockHeight),this.$actions.addEventListener("touchstart",this.lockHeight),document.addEventListener(n.FOOTER_VISIBLE,this.footerVisible),document.addEventListener(n.FOOTER_NOT_VISIBLE,this.footerNotVisible),window.addEventListener("scroll",this.unlockHeight),window.addEventListener("resize",this.setSizes)},removeEvents(){this.eventsAdded=!1,this.$header.removeEventListener("mouseover",this.lockHeight),this.$header.removeEventListener("touchstart",this.lockHeight),this.$actions.removeEventListener("mouseover",this.lockHeight),this.$actions.removeEventListener("touchstart",this.lockHeight),document.removeEventListener(n.FOOTER_VISIBLE,this.footerVisible),document.removeEventListener(n.FOOTER_NOT_VISIBLE,this.footerNotVisible),window.removeEventListener("scroll",this.unlockHeight),window.removeEventListener("resize",this.setSizes)}},{init(){this.$gallery=this.getChild("gallery"),this.$header=this.getChild("header"),this.$headerInner=this.getChild("header-inner"),this.$actions=this.getChild("actions"),this.$cursor=this.getChild("cursor"),this.$meta=this.getChild("meta"),this.$content=this.getChild("content"),this.$galleryEnd=this.getChild("gallery-end"),this.eventsInit=!1,this.locked=!1,this.actionsFixed=!1,this.scrollLockedAt=0,this.isMobile=this.isMobileBP(),this.heightDiff=0,this.galleryFullyScrolled=!1,this.observer={active:!1},window.scrollTo(0,0),this.isMobile&&(setTimeout(()=>
74{this.$cursor.style.opacity="1"},500),this.setSizes(),this.addEvents())},resized(){this.isMobile=this.isMobileBP(),this.isMobile&&(this.setSizes(),this.addEvents())},destroy(){this.removeEvents(),this.desactiveObserver()}});e.exports=i(4518)("PDPScroll",h)},2590:function(e,t,i){"use strict";let{createBehavior:r}=i(2881),n=r("SizeGuideTable",{handleChange(e){let t=this.getChild("select");if(t&&e.target===t){let e=t.value;this.getChildren("value").forEach(t=>{t.classList.toggle("hidden",t.dataset.value!==e)})}}},{init(){this.$node.addEventListener("change",this.handleChange)},resized(){},destroy(){this.$node.removeEventListener("change",this.handleChange)}});e.exports=i(4518)("SizeGuideTable",n)},2925:function(e,t,i){"use strict";let{createBehavior:r}=i(2881),{useMotionReduce:n}=i(1150),{pauseVideo:s,setPausedManual:a,unsetPausedManual:o}=i(3536),l="hidden",u=r("VideoBackground",{togglePlay(e){e&&(e.preventDefault(),e.stopPropagation()),this.isPlaying?(this.pause(),a(this.$player,"true")):this.play()},play(){try{this.$player.play(),o(this.$player)}catch(e){console.log(e)}},pause(){s(this.$player)},handlePlay(){this.updatePlayButton(!0)},handlePause(){this.updatePlayButton(!1)},startIntersectionObserver(){this.observer=new IntersectionObserver(this.handleObserver,{threshold:[.05,.95]}),this.observer.observe(this.$player)},handleObserver(e){e.forEach(e=>{e.isIntersecting&&"true"!==this.$player.dataset.pausedManual&&this.play()})},updatePlayButton(e){this.$pauseIcon.classList.toggle(l,!e),this.$playIcon.classList.toggle(l,e),this.$pauseButton.setAttribute("aria-label",e?this.buttonText.pause:this.buttonText.play),this.isPlaying=e},initState(){this.initiated=!1,this.isPlaying=!1,this.isMuted=!0,this.buttonText={play:this.options["text-play"],pause:this.options["text-pause"]}},handleMotionReduceState(e){e?(this.observer?.disconnect(),this.pause()):this.startIntersectionObserver()},initPlayer(){this.initiated=!0;let[e,t]=n(this.handleMotionReduceState);this.handleMotionReduceState(e),this.motionReduceDestroy=t,this.updatePlayButton(!1),this.$player&&(this.$player.preload="metadata",this.$player.removeAttribute("controls"),this.$player.loop=!0,this.$player.addEventListener("play",this.handlePlay),this.$player.addEventListener("pause",this.handlePause)),this.$pauseButton&&(this.$pauseButton.addEventListener("click",this.togglePlay,!1),this.$pauseButton.addEventListener("touchstart",this.togglePlay,{passive:!1})),this.$player&&(this.$player.muted=!0,this.$player.volume=0)}},{init(){this.initState(),this.$player=this.getChild("player"),this.$pauseButton=this.getChild("pause"),this.$playIcon=this.getChild("icon-play"),this.$pauseIcon=this.getChild("icon-pause"),this.initPlayer()},destroy(){this.initiated&&(this.$player&&(this.$player.removeEventListener("play",this.handlePlay),this.$player.removeEventListener("pause",this.handlePause)),this.$pauseButton&&(this.$pauseButton.removeEventListener("click",this.togglePlay),this.$pauseButton.removeEventListener("touchstart",this.togglePlay)),this.motionReduceDestroy(),this.observer?.disconnect())}});e.exports=i(4518)("VideoBackground",u)},6772:function(e){"use strict";function t(e){var t=!0;this.checkValidity&&!this.checkValidity()&&(e&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation()),$(this).find("input:visible, select:visible").each(function(){this.validity.valid||($(this).trigger("invalid",this.validity),$(this).closest(".input-field").removeClass("valid"),t=!1)}));let i=$(this);return t?i.closest("form").removeClass("form-has-errors"):i.closest("form").addClass("form-has-errors"),t}function i(e,t=!1){let r=$(e);r.hasClass("form-has-errors")&&t||r.find(".form-control.is-invalid").removeClass("is-invalid")}e.exports={invalid:function(){$(document).on("invalid","form input, form select",function(e){if(e.preventDefault(),this.setCustomValidity(""),!this.validity.valid){var t=this.validationMessage;$(this).addClass("is-invalid"),this.validity.patternMismatch&&$(this).data("pattern-mismatch")&&(t=$(this).data("pattern-mismatch")),(this.validity.rangeOverflow||this.validity.rangeUnderflow)&&$(this).data("range-error")&&(t=$(this).data("range-error")),(this.validity.tooLong||this.validity.tooShort)&&$(this).data("range-error")&&(t=$(this).data("range-error")),this.validity.valueMissing&&$(this).data("missing-error")&&(t=$(this).data("missing-error")),$(this).parents(".input-field").find(".invali
74d-feedback").html(`<span class="icon icon-error icon--close-14 icon--tiny" aria-hidden="true"></span><span>${t}</span>`)}})},submit:function(){$(document).on("submit","form",function(e){return t.call(this,e)})},buttonClick:function(){$(document).on("click",'form button[type="submit"], form input[type="submit"]',function(){i($(this).parents("form"),!0)})},functions:{validateForm:function(e,i){return t.call(e,i||null)},clearForm:i}}},8464:function(e){"use strict";e.exports.animation={NEXT_TICK_TIMING:16,MODAL_HEADER_TIMING:250,MODAL_TIMING:300},e.exports.nextTick=(t,i=0)=>{setTimeout(()=>{t()},e.exports.animation.NEXT_TICK_TIMING+i)}},1167:function(e){"use strict";e.exports.customEvents={ACCORDION_OPEN:"Accordion:open",ACCORDION_OPENED:"Accordion:opened",ACCORDION_CLOSED:"Accordion:closed",BTN_SELECT_SIZE:"Btn:select-size",BTN_UNSELECT_SIZE:"Btn:unselect-size",CHARM_ADDED:"Charm:added",CHARM_REMOVED:"Charm:removed",CHARM_MAX:"Charm:max",CHARM_AVAILABLE:"Charm:available",DIALOG_NODE_SHOW:"Dialog:node-show",DIALOG_SHOW_BY_ID:"Dialog:show-by-id",DIALOG_HIDE_ALL:"Dialog:hide-all",FOOTER_VISIBLE:"Footer:visible",FOOTER_NOT_VISIBLE:"Footer:not-visible",GIFT_FINDER_FILTER:"GiftFinder:filter",GIFT_FINDER_FILTER_FORYOU:"GiftFinder:filterForYou",MEDIA_STORY_PAUSE:"MediaStory:pause",MEDIA_STORY_PLAY:"MediaStory:play",MODAL_OPENED:"Modal:opened",MODAL_CLOSED:"Modal:closed",MODAL_NODE_OPENED:"Modal:node-opened",MODAL_NODE_CLOSED:"Modal:node-closed",MODAL_NODE_TOGGLE:"Modal:node-toggle",MODAL_NODE_CLOSE:"Modal:node-close",MODAL_OPEN_BY_ID:"Modal:open-by-id",MODAL_CLOSE_ALL:"Modal:close-all",MODAL_TRIGGER_UPDATED:"Modal:trigger-updated",MODAL_HEADER_SEARCH_ACTIVATE:"ModalHeader:search-activate",MODAL_ZOOM_MOVE:"ModalZoom:move",MODAL_LOOKS_MOVE:"ModalLooks:move",NOTIFY_ME_SET_SIZE:"NotifyMe:set-size",PRODUCT_ADDED:"Quantity:product-added",PRODUCT_REMOVED:"Quantity:product-removed",RANGE_INPUT_CHANGE:"RangeInput:change",RANGE_INPUT_SET:"RangeInput:set",TOASTER_NODE_SHOW:"Toaster:node-show",TOASTER_SHOW_BY_ID:"Toaster:show-by-id",TOASTER_SHOW_SUCCESS:"Toaster:show-success",TOASTER_HIDE_ALL:"Toaster:hide-all"}},9966:function(e){"use strict";let t="modal-";e.exports.modalIds={ADD_TO_CART:t+"add-to-cart",CART:t+"cart",CHARMS_INTERACTIVE:t+"charms-interactive",HEADER:t+"header",NOTIFY_ME:t+"notify-me",PERSONALIZATION:t+"personalization",PRODUCT_AJAX:t+"product-ajax",LOOKS:t+"looks",ZOOM:t+"zoom"}},4315:function(e,t,i){"use strict";let r=i(4612),n=i(1430),s=i(2590),a=i(2925),o=i(473),l=i(1571),u=i(3724),d=i(9477),{customEvents:c}=i(1167);function h(e,t){var i=parseInt(t.attr("data-index"),10),r=t.attr("data-name")||"",n=t.attr("data-hint")||"";e.find("[data-pdpmodalvariations-preview]").removeAttr("data-active").eq(i).attr("data-active",""),e.find("[data-pdpmodalvariations-name]").text(r),e.find("[data-pdpmodalvariations-hint]").text(n)}r.swatchSlick=function(){$(".swatch-slick").each(function(){let e=$(this),t=e.find(".swatch-item").length,i=$(window).width(),r=e.closest(".attribute-swatch-list");!e.hasClass("slick-initialized")&&(i<window.app.grid.lg&&t>2||i>=window.app.grid.lg&&t>5)&&e.slick({slidesToShow:5,slidesToScroll:1,infinite:!1,speed:500,touchThreshold:100,dots:!1,arrows:!0,nextArrow:r.find(".slick-next"),prevArrow:r.find(".slick-prev"),responsive:[{breakpoint:window.app.grid.lg,settings:{variableWidth:!0,slidesToShow:5,slidesToScroll:1}},{breakpoint:window.app.grid.md,settings:{variableWidth:!0,slidesToShow:2.5,slidesToScroll:1}}]})})},r.sizeChartBackArrowClick=function(){$(document).on("click",".size-chart-overlay .back-arrow",function(){$(".size-chart-overlay").removeClass("active slider-animate"),$(".pdp-right-wrapper .slider-container").removeClass("kids-size-chart-overlay")})};var p="js-edd-loading";function f(){0!==$(".estimated-delivery-loading").length&&$("body").addClass(p)}function m(){$("body").removeClass(p)}function g(e,t,i){var r=$(".click-edd");if(0!==r.length){var n=r.data("action");if(!n||$(".estimated-delivery.product-service-item-delivery").hasClass("d-none"))return void m();var s=$(".estimated-delivery-default");if(e){if(!1===t)return void m()}else if(s.length&&!s.hasClass("d-none"))return void m();var a=r.data("csrf-token-name"),o=r.data("csrf-token"),l={};a&&o&&(l[a]=o),i&&(l.pid=i),f(),$.ajax({url:n,method:"POST",data:l,success:function(e){if(!e||e.error||!e.shippingMethodsList||!e.shippingMethodsList.length)return void m();if(e.renderedTemplate){$(".delivery-date-text-container").html(e.renderedTemplate.trim()),$(".click-edd").removeClass("d-none"),m();return}var t=e.shippingMethodsList[0],i=t.estimatedDeliveryDays,r=t.estimatedDeliveryDateOnly||i;if(!i)return void m();var n=$(".estimated-delivery-default"),s=$(".estimated-delivery-date"),a=$(".estimated-delivery-preorder");if(n.length&&!n.hasClass("d-none"))return void m();n.addClass("d-none"),e.isPreOrder?(a.find(".preorder-date-value").text(i),a.removeClass("d-none"),s.addClass("d-none")):(s.find(".delivery-date-value").text(r),s.removeClass("d-none"),a.addClass("d-none")),m()},error:function(){m()}})}}r.updateEdd=function(){$("body").on("product:afterAttributeSelect",function(e,t){var i=t&&t.data&&t.data.product||{};g(!0,i.readyToOrder,i.id)})},r.handleAddToCartClick=function(){document.addEventListener("click",function(e){let t=e.target.closest(".add-to-cart-slider");t&&(e.preventDefault(),$(t).addClass("active"))},!0)},r.updateProductBadges=function(){$("body").on("product:afterAttributeSelect",function(e,t){let i=t.container,r=t.data.product,n=$(".add-to-wis
74hlist-form.left-section-wishlist"),s=i.find(".stock-badges-wrapper");var a=[];s.empty(),!r.available||r.badgeAvailableSoon?a.push(s.attr("data-label-oos")):r.badgePreOrder&&a.push(s.attr("data-label-preorder")),a.forEach(function(e){var t=$("<li>",{text:e});s.append(t)});let o=i.find(".text-badges-wrapper");var l=[];o.empty(),r.textTag&&l.push(r.textTag),r.boutiqueExclusive&&l.push(o.attr("data-label-boutique")),l.forEach(function(e){var t=$("<li>",{text:e});o.append(t)}),r.available?n.removeClass("d-none"):n.addClass("d-none")})},r.wishlistToaster=function(){$(document).ajaxSuccess(function(e,t,i){if(!i.url)return;let r=$("#toaster-wishlist");if(!r.length)return;let n="";i.url.indexOf("Wishlist-AddProduct")>-1?n=r.data("msg-add"):i.url.toLowerCase().indexOf("wishlist-removeproduct")>-1&&(n=r.data("msg-remove")),n&&document.dispatchEvent(new CustomEvent(c.TOASTER_SHOW_BY_ID,{detail:{toasterId:"toaster-wishlist",messageText:n}}))})},r.initSizeChart=function(){$("body").on("click",".size-chart a",function(){var e=$(this).attr("href"),t=$(this).attr("data-modal-target");if(t){var i=$(t).find(".size-chart-collapsible");i.length&&i.is(":empty")&&$.ajax({url:e,type:"get",dataType:"json",success:function(e){i.append(e.content),e.datalayer&&$("body").trigger("gtm:add:event",e),void 0!==s&&s.init&&s.init()}})}})},r.updateCustomImages=function(){$("body").on("product:afterAttributeSelect",function(e,t){if(t.data.datalayer&&["size_drop_down","nib_size_guide_select"].indexOf(t.data.datalayer.event)>-1&&!t.data.datalayer.pushed&&("size"===$(".product-detail").data("last-selected")||!$(".product-detail").data("last-selected"))&&(t.data.datalayer.pushed=!0,window.dataLayer.push(t.data.datalayer)),t.data.product&&t.data.product.id){var i=t.data.product.id;$('.add-to-wishlist-form input[name="pid"]').val(i),$(".add-to-wishlist-form .icon-heart-filled").each(function(){var e=$
74(this).attr("data-href");if(e){var t=e.split("?")[0];$(this).attr("data-href",t+"?pid="+i)}})}if(t.data.datalayerItems){var r=t.data.datalayerItems,n=$('button[data-modal-target="#modal-product-details"]');if(n.length){var s=n.attr("data-tracking-event-payload");if(s)try{var h=JSON.parse(s);h&&h.ecommerce&&Array.isArray(h.ecommerce.items)&&(h.ecommerce.items[0]=r,n.attr("data-tracking-event-payload",JSON.stringify(h)))}catch(e){}}}t.data.product&&t.data.product.images&&(t.container.find(".pdp-gallery").replaceWith(t.data.imageCarousel),a.init(),o.init(),l.init()),u.init(),d.init(),$(".add-to-cart-slider").hasClass("active")&&t.data&&t.data.product&&t.data.product.readyToOrder&&setTimeout(function(){let e=$(".add-to-cart.js-add-to-cart").attr("data-tracking-event-payload");if(e)try{let t=JSON.parse(e);t.ecommerce&&Array.isArray(t.ecommerce.items)&&t.ecommerce.items[0]&&(t.ecommerce.items[0].item_location="pop_in_quick_shop");let i=JSON.stringify(t);sessionStorage.setItem("add_to_cart_event",i)}catch(e){}},0),document.dispatchEvent(new CustomEvent(c.MODAL_TRIGGER_UPDATED,{detail:{node:document.body}}));let p=$(".modal-swatch__list"),f=$(".color-attribute"),m=p.find(".modal-swatch__item");if(t.data.product&&t.data.product.color){m.removeClass("product-card--selected");let e=t.data.product.color,i=m.filter(`[data-attr-value="${e}"]`);i.length||(i=m.has(`[data-attr-value="${e}"]`)),i.length||(i=f.filter(`[aria-describedby="${e}"]`).closest(".modal-swatch__item")),i.addClass("product-card--selected")}if(t.data.product&&t.data.product.variationAttributes){let e=t.data.product.variationAttributes[0].displayValue;$(".attributes[data-attr=color] .selected-value").text(e);let i=t.data.product.variationAttributes.find(function(e){return"color"===e.id});if(i&&i.values){$('.pdp-swatch[data-attr="color"] .pdp-swatch__heading-value').text(i.displayValue);let e=$('.pdp-swatch[data-attr="color"] .pdp-swatch__link');i.values.forEach(function(t){let i=m.filter(`[data-attr-value="${t.value}"]`);if(i.length||(i=m.has(`[data-attr-value="${t.value}"]`)),i.length||(i=f.filter(`[aria-describedby="${t.value}"]`).closest(".modal-swatch__item")),i.length){let e=i.find("[data-url]");e.length||(e=i.filter("[data-url]")),e.length&&t.url&&e.attr("data-url",t.url)}let r=e.filter(`[data-attr-value="${t.value}"]`);r.length&&(r.toggleClass("pdp-swatch__link--selected",t.selected),t.url&&r.attr("data-url",t.url))})}}})},r.initSwatchModalClick=function(){$("body").on("click","#modal-swatch .color-attribute",function(e){e.preventDefault(),e.stopImmediatePropagation();var t=$(this);if(t.closest(".modal-swatch__item").hasClass("product-card--selected")||t.attr("disabled"))return;$(".product-detail").data("last-selected","color");var i=$(".product-detail").first();let r=t.attr("data-url");if($("body").data("swatch-change",!0),void 0!==r){let e;n.attributeSelect(((e=new URL(r)).searchParams.append("isPDP","true"),e.toString()),i)}})},g(),r.wishlistToaster(),r.updateCustomImages(),r.handleAddToCartClick(),r.initSwatchModalClick(),r.initSizeChart(),$("body").on("click",".color-attribute, .pdp-swatch__link",function(e){if($(this).hasClass("pdp-swatch__link")){e.preventDefault(),e.stopImmediatePropagation();var t=$(this);if(t.hasClass("pdp-swatch__link--selected")||t.attr("disabled"))return;var i=$(".product-detail, .modals"),r=t.attr("data-url");if(r){$("body").data("swatch-change",!0);let e=r;-1===e.indexOf("isPDP=true")&&(e+=(-1!==e.indexOf("?")?"&":"?")+"isPDP=true"),$(".attributes [data-attr*=color]").length||-1!==e.indexOf("firstSelection")||(e+="&firstSelection=true"),n.attributeSelect(e,i)}}$(".product-detail").data("last-selected","color"),$(".product-detail").data("last-clicked-swatch",$(this))}),$("body").on("change",".radio-size__input, .options-select",function(){$(".product-detail").data("last-selected","size");var e=$(".estimated-delivery.product-service-item-delivery");0===$(".click-edd").length||e.hasClass("d-none")||f()}),$("body").on("product:afterAttributeSelect",function(e,t){t.data.datalayerItems&&"size"!==$(".product-detail").data("last-selected")&&$("body").trigger("gtm:add:event",{datalayer:[{event:"select_color",ecommerce:{currency:window.preloadedData&&window.preloadedData.currency,items:[t.data.datalayerItems]},name:"Product Color Click",reference:"rKPI_CHL_PD2",category:"Product"}]})}),$(document).on("initProductCarousel",function(e,t){if(t&&t.element){var i=$(t.element);$(t.element).closest(".async-reco-carousel").attr("data-item-location","You may also like");var r=i.closest(".einstein-carousel");
74r.length&&r.find(".product-carousel-heading").text().trim().indexOf("Best Sellers")>-1&&i.attr("data-item-location","Best Sellers")}}),r.sizeRadioKeyboard=function(){$(document).on("openSlider",function(e,t){var i=$(t.target).find('[type="radio"]:not(:disabled)');if(i.length){i.attr("tabindex","-1");var r=i.filter(":checked");(r.length?r:i.first()).attr("tabindex","0")}}),$(document).on("keydown",'.slider-container [type="radio"]',function(e){var t=$(this).closest(".slider-container").find('[type="radio"]:not(:disabled)'),i=$(this),r=t.index(i);if("ArrowDown"===e.key||40===e.keyCode){e.preventDefault();var n=t.eq(r+1).length?t.eq(r+1):t.eq(0);i.attr("tabindex","-1"),n.attr("tabindex","0").focus()}else if("ArrowUp"===e.key||38===e.keyCode){e.preventDefault();var s=r>0?t.eq(r-1):t.last();i.attr("tabindex","-1"),s.attr("tabindex","0").focus()}else("Enter"===e.key||13===e.keyCode||" "===e.key||32===e.keyCode)&&(e.preventDefault(),i.prop("checked",!0).trigger("change"))})},r.otherVaritions=function(){$("body").off("click",".js-modal-product-variations-button").on("click",".js-modal-product-variations-button",function(e){e.preventDefault();var t=$(this),i=t.data("url")||t.attr("data-url");i&&($.spinner().start(),t.addClass("active"),$.ajax({url:i,type:"GET",success:function(e){$("#modal-product-variations").remove(),$("body").append(e),u.init(),document.dispatchEvent(new CustomEvent(c.MODAL_OPEN_BY_ID,{detail:{modalId:"modal-product-variations"}}));let t=$("#modal-product-variations").find(".modal-variations__list"),i=t.find(".modal-variations__item").length;t.addClass("slider-active"),i>4&&t.slick({arrows:!0,dots:!1,infinite:!0,swipeToSlide:!0,slidesToShow:4,slidesToScroll:1,speed:500,touchThreshold:10,cssEase:"ease-out",nextArrow:'<button type="button" class="slick-next"><i class="icon icon-arrow-right-icon"></i></button>',prevArrow:'<button type="button" class="slick-prev"><i class="icon icon-arrow-left-icon"></i></button>'}),$.spinner().stop()},error:function(){t.removeClass("active"),$.spinner().stop()}}))}),$("body").off("click","[data-pdpmodalvariations-btn]").on("click","[data-pdpmodalvariations-btn]",function(e){e.preventDefault();
74var t=$(this),i=t.attr("data-link")||"",r=t.closest("#modal-product-variations");r.find("[data-pdpmodalvariations-btn]").removeAttr("data-active"),t.attr("data-active",""),h(r,t),r.find("[data-pdpmodalvariations-link]").attr("href",i)}).on("mouseenter","[data-pdpmodalvariations-btn]",function(){if(window.matchMedia("(hover: hover)").matches){var e=$(this);h(e.closest("#modal-product-variations"),e)}}).on("mouseleave","[data-pdpmodalvariations-btn]",function(){if(window.matchMedia("(hover: hover)").matches){var e=$(this).closest("#modal-product-variations"),t=e.find("[data-pdpmodalvariations-btn][data-active]");t.length>0&&h(e,t)}}),$("body").on("click",".pdp-infos .pdp-swatch__link",function(){$("body").data("swatch-change",!0)}),$("body").on("product:afterAttributeSelect",function(e,t){if(window.isQuickView||!0!==$("body").data("swatch-change")||(window.scrollTo({top:0,behavior:"smooth"}),$("body").removeData("swatch-change")),t.data&&t.data.product){var i=$(".js-modal-product-variations-button"),r=i.attr("data-url")||"";if(r){var n=r.indexOf("pid=")>-1?r.replace(/(pid=)[^&]+/,"$1"+t.data.product.id):r+(r.indexOf("?")>-1?"&":"?")+"pid="+t.data.product.id;i.attr("data-url",n).data("url",n)}var s=t.container.find(".other-varitions");t.data.otherVariationsHtml?(s.empty().append(t.data.otherVariationsHtml),s.removeClass("d-none")):s.addClass("d-none");var a=t.container.find(".other-variations-link");t.data.otherVariationsLinkHtml?(a.empty().append(t.data.otherVariationsLinkHtml),a.removeClass("d-none")):a.addClass("d-none")}})},e.exports=r},5996:function(e,t,i){"use strict";let r=i(8502),n=i(6772),{customEvents:s}=i(1167),a=i(3724);e.exports={init:function(){let e=$(document),t=$("body");t.on("click",".notify-me-link, .notify-me-size-link",function(i){i.preventDefault(),i.stopPropagation(),i.stopImmediatePropagation();let n=$(this);var o=n.data("trackingEventPayload");if(o)try{var l="string"==typeof o?JSON.parse(o):o;window.dataLayer=window.dataLayer||[],window.dataLayer.push({ecommerce:null}),window.dataLayer.push(l)}catch(e){}let u=i.target,d=!1;if(n.hasClass("veirfy-variation")&&(d=r.validate(n,u)),!d){let i=n.data("pid");if(n.hasClass("notify-me-link-pdp")&&(i=$(".product-detail").first().data("pid")),i){let o=n.data("queryString")||"",l=n.closest(".attribute-item").find("[data-attr-value]");if(l.length){let e=l.attr("value");e&&-1!==e.indexOf("?")&&(o=e.split("?")[1]),l.prop("checked",!0).trigger("change")}let d=new URLSearchParams({pid:i});o&&(d=new URLSearchParams(o)),d.set("isPDP","true");let c=`${n.data("action")}?${d.toString()}`;t.addClass("pdp-partial-loading"),$("#modal-add-to-cart-size").attr("data-prevent-reopen","true"),$("#modal-add-to-cart-size .modal__header button").click(),$.spinner().start(),$.ajax({url:c,type:"get",success:function(i){if(n.parent().find(".notify-error-text").text(i.message).toggleClass("d-block",i.error),i.error)r.validate(n,u);else{$("#modal-notify-me").remove(),t.append($.parseHTML(i.renderedTemplate));
74let r=$("#modal-notify-me");document.dispatchEvent(new CustomEvent(s.MODAL_CLOSE_ALL)),a.init(),setTimeout(function(){document.dispatchEvent(new CustomEvent(s.MODAL_OPEN_BY_ID,{detail:{modalId:"modal-notify-me"}}))},200),e.on(s.MODAL_OPENED,function(){"true"===$("#modal-notify-me").attr("data-active")&&$("#modal-notify-me").find(".modal__header button").focus()}),r.on("click",function(e){($(e.target).is("#modal-notify-me")||$(e.target).closest("[data-modal-close-trigger]").length)&&(r.attr("data-active","false"),t.removeClass("slider-open"),setTimeout(function(){r.remove(),n.removeClass("notify-me-open")},400))})}$.spinner().stop(),t.removeClass("pdp-partial-loading")}})}}}),e.on("toasterNotify:open",function(){document.dispatchEvent(new CustomEvent(s.TOASTER_SHOW_BY_ID,{detail:{toasterId:"toaster-notifyme",messageText:$("#toaster-notifyme").data("successMessage")}}))}),$("body").on("click",".notify-me-submit",function(e){e.preventDefault();let i=$(this),r=i.closest("form"),s=i.closest(".notify-me-slider-wrapper"),a=r.find(".notify-me-consent"),o=r.find(".notify-me-consent-error"),l=s.find(".custom-product-card").data("pid"),u=n.functions.validateForm(r.get(0));if(!a.is(":checked"))return void o.addClass("d-block");if(o.removeClass("d-block"),u&&l){s.spinner().start();let e=r.serializeArray(),i={};e.forEach(function(e){i[e.name]=e.value}),i.pid=l,$.ajax({url:r.attr("action"),type:"post",data:i,success:function(e){s.spinner().stop(),"datalayer"in e&&e.datalayer&&t.trigger("gtm:add:event",e),$('.notify-me-open [type="checkbox"]').prop("checked",!0),$(".notify-me-link").removeClass("notify-me-open"),$(document).trigger("toasterNotify:open");let i=s.closest('[data-behavior="Modal"]');i.length?i.get(0).dispatchEvent(new CustomEvent("Modal:node-close")):document.dispatchEvent(new CustomEvent("Modal:close-all"))}})}}),e.on("change",".notify-me-consent",function(){let e=$(this);
74e.is(":checked")&&e.closest(".notify-me-form").find(".notify-me-consent-error").removeClass("d-block")}),e.on("keydown",".notify-me-size-link, .radio-size",function(e){("Enter"===e.key||" "===e.key||13===e.keyCode||32===e.keyCode)&&(e.preventDefault(),e.stopPropagation(),$(this).click())}),e.on(s.MODAL_OPENED,function(){setTimeout(function(){"true"===$("#modal-add-to-cart-size").attr("data-active")&&t.addClass("size-slider-open")},0)}),$(document).on(s.MODAL_CLOSED,function(){setTimeout(function(){t.hasClass("size-slider-open")&&$(".island--pdp .attribute-btn").focus()},0)})}}},9689:function(e,t,i){"use strict";let r=i(6264),{customEvents:n}=i(1167),s=i(2590),a=i(3724);e.exports=Object.assign({},r,{showQuickview:function(){r.showQuickview(),$(document).on("keydown",".modal-quickview, .quickview",function(e){(" "===e.key||"Spacebar"===e.key)&&(e.preventDefault(),this.click())}),$("body").off("click",".modal-quickview").on("click",".modal-quickview",function(e){e.preventDefault();let t=$(this),i=t.attr("href")||t.data("href"),r=$(t.data("modal-target")||"#modal-product-ajax"),s=r.find("[data-modal-scroller]");if(!i)return;$.spinner().start();let o=i+(i.indexOf("?")>-1?"&":"?")+"source=quickshop";$.ajax({url:o,method:"GET",dataType:"json",success:function(e){s.empty().html(e.renderedTemplate);let t=$(".dynamic-size-modal");t.length&&e.variationSizeModalHtml&&t.empty().html(e.variationSizeModalHtml);let i=$(".dynamic-size-chart-modal");i.length&&e.variationSizeChartModalHtml&&i.empty().html(e.variationSizeChartModalHtml),function(e){let t=e.find(".modal-product__card-slider"),i=t.find("[data-slickcarousel-slides]"),r=t.find("[data-slickcarousel-prev]"),n=t.find("[data-slickcarousel-next]"),s=t.find("[data-slickcarousel-dots]");i.length&&"function"==typeof $.fn.slick&&(i.hasClass("slick-initialized")&&i.slick("unslick"),i.children().length>1?(i.slick({dots:!0,appendDots:s,prevArrow:r,nextArrow:n,infinite:!0,speed:300,slidesToShow:1,slidesToScroll:1,touchThreshold:100}),r.show(),n.show(),s.show().removeAttr("inert"),s.off("keydown","button").on("keydown","button",function(e){let t,r=$(this),n=s.find("button"),a=n.index(r);"ArrowRight"===e.key||"ArrowDown"===e.key?(e.preventDefault(),t=(a+1)%n.length):("ArrowLeft"===e.key||"ArrowUp"===e.key)&&(e.preventDefault(),t=(a-1+n.length)%n.length),void 0!==t&&(i.slick("slickGoTo",t),n.eq(t).focus())})):(r.hide(),n.hide(),s.hide().attr("inert","")))}(r),a.init(),document.dispatchEvent(new CustomEvent(n.MODAL_OPEN_BY_ID,{detail:{modalId:"modal-product-ajax"}})),$(document).trigger("wishlist:check"),$.spinner().stop()},error:function(){$.spinner().stop()}})}),$("body").off("click",".add-to-cart-slider").on("click",".add-to-cart-slider",function(e){e.preventDefault(),$(this).addClass("active"),a.init(),document.dispatchEvent(new CustomEvent(n.MODAL_OPEN_BY_ID,{detail:{modalId:"modal-add-to-cart-size"}}))}),$("body").off("click",".size-chart a").on("click",".size-chart a",function(e){let t=$(this);e.preventDefault(),e.stopPropagation();let i=t.attr("href"),r=$(t.attr("data-target-slider")||t.attr("data-modal-target")||"#size-chart-size").find(".size-chart-collapsible");r.empty(),a.init(),document.dispatchEvent(new CustomEvent(n.MODAL_OPEN_BY_ID,{detail:{modalId:"size-chart-size"}})),$("#modal-add-to-cart-size").attr("data-prevent-reopen","true"),r.length&&r.is(":empty")&&$.ajax({url:i,type:"get",dataType:"json",success:function(e){r.append(e.content),r.find("th, td").each(function(){var e=this.textContent.trim();e&&this.setAttribute("aria-label",e),this.setAttribute("tabindex","0")}),e.datalayer&&$("body").trigger("gtm:add:event",e),void 0!==s&&s.init&&s.init()}})}),$("body").on("product:afterAttributeSelect",function(e,t){t.data.product.notifyMe||$("#modal-add-to-cart-size").attr("data-prevent-reopen","true")}),$("body").on("product:afterAddToCart",function(e,t){t&&!t.error&&document.dispatchEvent(new CustomEvent(n.MODAL_CLOSE_ALL))})}})},4518:function(e){"use strict";e.exports=function(e,t){return{init:function(){document.querySelectorAll('[data-behavior~="'+e+'"]').forEach(function(i){var r="a17"+e+"Initialized";if(!i.dataset[r]){var n=new t(i);n&&"function"==typeof n.init&&n.init(),i.dataset[r]="true"}})}}}},2881:function(e,t,i){"use strict";let{isBreakpoint:r}=i(6472),{manageBehaviors:n}=i(3489),s=function(e){for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&delete e[t]};function a(e,t={}){if(!e||!(e instanceof Element))throw Error("Node argument is required");
74return this.$node=this.getChild(e),this.options=Object.assign({intersectionOptions:{rootMargin:"20%"}},t.options||{}),this.__isEnabled=!1,this.__children=t.children,this.__breakpoints=t.breakpoints,this.__abortController=new AbortController,this.customMethodNames.forEach(e=>{this[e]=this.methods[e].bind(this)}),this._binds={},this._data=new Proxy(this._binds,{set:(e,t,i)=>(this.updateBinds(t,i),e[t]=i,!0)}),this.__isIntersecting=!1,this.__intersectionObserver=null,this}a.prototype=Object.freeze({updateBinds(e,t){this.$node.querySelectorAll("[data-"+this.name.toLowerCase()+"-bindel*="+e+"]").forEach(e=>{e.innerHTML=t}),this.$node.querySelectorAll("[data-"+this.name.toLowerCase()+'-bindattr*="'+e+':"]').forEach(i=>{i.dataset[this.name.toLowerCase()+"Bindattr"].split(",").forEach(r=>{(r=r.split(":"))[0]===e&&("class"===r[1]?(this._binds[e]!==t&&i.classList.remove(this._binds[e]),t&&i.classList.add(t)):i.setAttribute(r[1],t))})})},init(){let e=RegExp("^data-"+this.name+"-(.*)","i");for(let t=0;t<this.$node.attributes.length;t++){let i=this.$node.attributes[t],r=e.exec(i.nodeName);null!=r&&r.length>=2&&(this.options[r[1]]&&console.warn(`Ignoring ${r[1]} option, as it already exists on the ${name} behavior. Please choose another name.`),this.options[r[1]]=i.value)}"function"==typeof this.lifecycle?.init&&this.lifecycle.init.call(this),"function"==typeof this.lifecycle?.resized&&(this.__resizedBind=this.__resized.bind(this),window.addEventListener("resized",this.__resizedBind)),("function"==typeof this.lifecycle.mediaQueryUpdated||this.options.media)&&(this.__mediaQueryUpdatedBind=this.__mediaQueryUpdated.bind(this),window.addEventListener("mediaQueryUpdated",this.__mediaQueryUpdatedBind)),this.options.media?this.__toggleEnabled():this.enable(),this.__intersections()},destroy(){this.__abortController.abort(),!0===this.__isEnabled&&this.disable(),"function"==typeof this.lifecycle?.destroy&&this.lifecycle.destroy.call(this),"function"==typeof this.lifecycle.resized&&window.removeEventListener("resized",this.__resizedBind),("function"==typeof this.lifecycle.mediaQueryUpdated||this.options.media)&&window.removeEventListener("mediaQueryUpdated",this.__mediaQueryUpdatedBind),(null!=this.lifecycle.intersectionIn||null!=this.lifecycle.intersectionOut)&&(this.__intersectionObserver.unobserve(this.$node),this.__intersectionObserver.disconnect()),s(this)},getChild(e,t,i=!1){let r;return null!=this.__children&&null!=this.__children[e]?r=this.__children[e]:e instanceof NodeList?(r=e,i=!0):e instanceof Element||e instanceof HTMLDocument||e===window?(r=e,i=!1):(null==t&&(t=this.$node),r=t[i?"querySelectorAll":"querySelector"]("[data-"+this.name.toLowerCase()+"-"+e.toLowerCase()+"]")),r},getChildren(e,t){return this.getChild(e,t,!0)},isEnabled(){return this.__isEnabled},enable(){this.__isEnabled=!0,"function"==typeof this.lifecycle.enabled&&this.lifecycle.enabled.call(this)},disable(){this.__isEnabled=!1,"function"==typeof this.lifecycle.disabled&&this.lifecycle.disabled.call(this)},addSubBehavior(e,t=this.$node,i={}){"string"==typeof e?n.initBehavior(e,t,i):(n.add(e),n.initBehavior(e.prototype.behaviorName,t,i))},isBreakpoint(e){return r(e,this.__breakpoints)},__toggleEnabled(){let e=r(this.options.media,this.__breakpoints);e&&!this.__isEnabled?this.enable():!e&&this.__isEnabled&&this.disable()},__mediaQueryUpdated(e){"function"==typeof this.lifecycle?.mediaQueryUpdated&&this.lifecycle.mediaQueryUpdated.call(this,e),this.options.media&&this.__toggleEnabled()},__resized(e){"function"==typeof this.lifecycle?.resized&&this.lifecycle.resized.call(this,e)},__intersections(){(null!=this.lifecycle.intersectionIn||null!=this.lifecycle.intersectionOut)&&(this.__intersectionObserver=new IntersectionObserver(e=>{e.forEach(e=>{e.target===this.$node&&(e.isIntersecting?this.__isIntersecting||"function"!=typeof this.lifecycle.intersectionIn||(this.__isIntersecting=!0,this.lifecycle.intersectionIn.call(this)):this.__isIntersecting&&"function"==typeof this.lifecycle.intersectionOut&&(this.__isIntersecting=!1,this.lifecycle.intersectionOut.call(this)))})},this.options.intersectionOptions),this.__intersectionObserver.observe(this.$node))}}),e.exports={createBehavior:(e,t={},i={})=>{let r=function(...e){a.apply(this,e)},n=[];
74return Object.keys(t).forEach(e=>{n.push(e)}),r.prototype=Object.create(a.prototype,{name:{get(){return this.behaviorName}},behaviorName:{value:e,writable:!0},lifecycle:{value:i},methods:{value:t},customMethodNames:{value:n}}),r}}},3951:function(e){"use strict";e.exports={getCurrentMediaQuery:function(){return"undefined"==typeof window?"":getComputedStyle(document.documentElement).getPropertyValue("--breakpoint").trim().replace(/"/g,"")}}},6472:function(e,t,i){"use strict";let{getCurrentMediaQuery:r}=i(3951);e.exports={isBreakpoint:function(e,t){if(!e)return console.error("You need to pass a breakpoint name!"),!1;let i=RegExp("\\+$|\\-$"),n=["xs","sm","md","lg","xl","xxl"];window.siteBehaviors&&window.siteBehaviors.breakpoints&&(Array.isArray(window.siteBehaviors.breakpoints)?n=window.siteBehaviors.breakpoints:console.warn("siteBehaviors.breakpoints should be an array. Using defaults.")),t&&(Array.isArray(t)?n=t:console.warn("isBreakpoint breakpoints should be an array. Using defaults."));let s=r(),a=n.indexOf(s),o=i.exec(e),l=!!o&&o[0],u=o?e.slice(0,-1):e,d=n.indexOf(u);return d<0?(console.warn("Unrecognized breakpoint. Supported breakpoints are: "+n.join(", ")),!1):"+"===l&&!!(a>=d)||"-"===l&&!!(a<=d)||!l&&e===s}}},3489:function(e,t,i){"use strict";let r,{createBehavior:n}=i(2881),{getCurrentMediaQuery:s}=i(3951),{isBreakpoint:a}=i(6472),{resized:o}=i(8638),l={dataAttr:"behavior",lazyAttr:"behavior-lazy",intersectionOptions:{rootMargin:"20%"},breakpoints:["xs","sm","md","lg","xl","xxl"],dynamicBehaviors:{}},u=[],d=!1,c={},h=new Map,p=new Map,f=new Map;function m(e,t){return(t=t.toLowerCase().replace(/-([a-zA-Z0-9])/gi,(e,t)=>t.toUpperCase()),e.dataset&&e.dataset[t])?e.dataset[t].split(" ").filter(e=>e):[]}function g(e){"querySelectorAll"in e&&([e,...e.querySelectorAll(`[data-${l.dataAttr}]`)].forEach(e=>{let t=m(e,l.dataAttr);t&&t.forEach(t=>{b(t,e)})}),[e,...e.querySelectorAll(`[data-${l.lazyAttr}]`)].forEach(e=>{let t=m(e,l.lazyAttr),i=new Map;t.forEach(t=>{let r=e.dataset[`${t.toLowerCase()}Lazymedia`];i.set(t,r||!1)}),e!==document&&(p.set(e,i),f.set(e,!1),r.observe(e))}))}function y(e){e.forEach(e=>{if(void 0!==f.get(e)&&!1===f.get(e))return;let t=p.get(e);t&&t.forEach((i,n)=>{(!i||a(i,l.breakpoints))&&(b(n,e),t.delete(n),0===t.size?(r.unobserve(e),p.delete(e)):p.set(e,t))})})}function v(e){e.forEach(e=>{e.isIntersecting?(f.set(e.target,!0),y([e.target])):f.set(e.target,!1)})}function _(){y(Array.from(p.keys()))}function b(e,t,i={}){if(!c[e])return;i={breakpoints:l.breakpoints,...i};let r=h.get(t)||{};if(0===Object.keys(r).length||!r[e]){let n=new c[e](t,i);r[e]=n,h.set(t,r);try{return n.init(),n}catch(i){console.log(`Error in behavior '${e}' on:`,t),console.log(i)}}}function T(e){"function"==typeof e&&e.prototype.behaviorName&&(e={[e.prototype.behaviorName]:e}),"string"==typeof e&&arguments.length>1&&(e={[e]:n(...arguments)});let t=Object.keys(e).filter(e=>-1===u.indexOf(e));t.length&&(u=u.concat(t),t.forEach(t=>{c[t]=e[t]}))}function w(e,t,i,r){let n=h.get(t);if(n&&n[e])if(h.get(t)[e][i])if(r&&"function"==typeof r)return h.get(t)[e][i];else{if(!r)return h.get(t)[e][i];h.get(t)[e][i]=r}else console.warn(`No property '${i}' in behavior '${e}' instance on:`,t);else console.warn(`No behavior '${e}' instance on:`,t)}let S={init:function(e,t={}){l={...l,...t},o(),r=new IntersectionObserver(v,l.intersectionOptions),e&&T(e),g(document),d||(d=!0,new MutationObserver(e=>{e.forEach(e=>{e.removedNodes.forEach(e=>{let t=Array.from(h.keys());t.push(e),t.forEach(t=>{if(e===t||e.contains(t)){let e=h.get(t);e&&Object.keys(e).forEach(e=>{!function(e,t){let i=h.get(t);if(!i||!i[e])return console.warn(`No behavior '${e}' instance on:`,t);i[e].destroy(),delete i[e],0===Object.keys(i).length&&h.delete(t)}(e,t),r.unobserve(t),p.delete(t),f.delete(t)})}})}),e.addedNodes.forEach(e=>{g(e)})})}).observe(document.body,{childList:!0,subtree:!0,attributes:!1,characterData:!1})),window.addEventListener("mediaQueryUpdated",_)},add:function(){arguments&&(T.apply(null,arguments),g(document))},initBehavior:b,get currentBreakpoint(){return s()}};try{"development"===process.env.MODE&&(Object.defineProperty(S,"loaded",{get:()=>u}),S.activeBehaviors=h,S.active=h,S.getBehaviors=function(e){let t=h.get(e);if(t)return t;console.warn("No behaviors on:",e)},S.getProps=function(e,t){let i=h.get(t);if(i&&i[e])return h.get(t)[e];console.warn(`No behavior '${e}' instance on:`,t)},S.getProp=w,S.setProp=w,S.callMethod=w)}catch(e){}e.exports={manageBehaviors:S}},1150:function(e){"use strict";let t=window.matchMedia("(prefers-reduced-motion: reduce)");e.exports={MOTION_REDUCE_MEDIA:t,useMotionReduce:(e=()=>{})=>{let i=()=>{"function"==typeof e&&e(t.matches)};
74return t.addEventListener("change",i),[t.matches,()=>{t.removeEventListener("change",i)}]}}},8638:function(e,t,i){"use strict";let{getCurrentMediaQuery:r}=i(3951);e.exports={resized:function(){var e,t=r();function i(){var e=r();window.dispatchEvent(new CustomEvent("resized",{detail:{breakpoint:e}})),e!==t&&(window.siteBehaviors&&(window.siteBehaviors.currentMediaQuery=e),window.dispatchEvent(new CustomEvent("mediaQueryUpdated",{detail:{breakpoint:e,prevBreakpoint:t}})),t=e)}if(window.addEventListener("resize",function(){clearTimeout(e),e=setTimeout(i,250)}),"function"==typeof ResizeObserver){let e=null;new ResizeObserver(t=>{clearTimeout(e),e=setTimeout(()=>{window.siteBehaviors&&window.siteBehaviors.currentMediaQuery!==r()&&window.dispatchEvent(new Event("resize"))},251)}).observe(document.documentElement)}""===t?window.requestAnimationFrame(i):window.siteBehaviors&&(window.siteBehaviors.currentMediaQuery=t)}}},3536:function(e){"use strict";let t=function(e){return e.currentTime>0&&!e.paused&&!e.ended&&e.readyState>2},i=function(e){e&&t(e)&&e.pause()},r="data-paused-manual";e.exports={isVideoPlaying:t,pauseVideo:i,pauseAllVideos:function(e){e.forEach(e=>{i(e)})},setPausedManual:function(e,t){e&&e.setAttribute(r,t)},unsetPausedManual:function(e){e&&e.removeAttribute(r)}}},3533:function(){},5297:function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)({}).hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(null,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function i(r){var n=t[r];if(void 0!==n)return n.exports;var s=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(s.exports,s,s.exports,i),s.loaded=!0,s.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),i.rv=()=>"1.4.8",i.ruid="[email protected]",(()=>{"use strict";var e=i(5790);$(document).ready(function(){e(i(9689)),e(i(4315)),e(i(5996))})})()})();

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