PageSourceSearch

https://wizionary.com/sites/default/files/js/js_sLo9ErDpYcMuchfhA7…CxHcQ-OpEv1GYKZrLNNNd1g7pudWTeXFJFl_gDCa2GO

js wizionary.com collected 2026-09-26 17:51:12 UTC 771,960 bytes, 59 lines download raw bytes

vendor: 4,517 bytes, lines 1-6
1/* @license MIT https://raw.githubusercontent.com/focus-trap/tabbable/v6.2.0/LICENSE */
2/*!
3* tabbable 6.2.0
4* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
5*/
6!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):(t="undefined"!=typeof globalThis?globalThis:t||self,function(){var n=t.tabbable,o=t.tabbable={};e(o),o.noConflict=function(){return t.tabbable=n,o}}())}(this,(function(t){"use strict";var e=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],n=e.join(","),o="undefined"==typeof Element,r=o?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,i=!o&&Element.prototype.getRootNode?function(t){var e;return null==t||null===(e=t.getRootNode)||void 0===e?void 0:e.call(t)}:function(t){return null==t?void 0:t.ownerDocument},a=function t(e,n){var o;void 0===n&&(n=!0);var r=null==e||null===(o=e.getAttribute)||void 0===o?void 0:o.call(e,"inert");return""===r||"true"===r||n&&e&&t(e.parentNode)},l=function(t,e,o){if(a(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(n));return e&&r.call(t,n)&&i.unshift(t),i=i.filter(o)},u=function t(e,o,i){for(var l=[],u=Array.from(e);u.length;){var d=u.shift();if(!a(d,!1))if("SLOT"===d.tagName){var c=d.assignedElements(),f=t(c.length?c:d.children,!0,i);i.flatten?l.push.apply(l,f):l.push({scopeParent:d,candidates:f})}else{r.call(d,n)&&i.filter(d)&&(o||!e.includes(d))&&l.push(d);var s=d.shadowRoot||"function"==typeof i.getShadowRoot&&i.getShadowRoot(d),p=!a(s,!1)&&(!i.shadowRootFilter||i.shadowRootFilter(d));if(s&&p){var h=t(!0===s?d.children:s.children,!0,i);i.flatten?l.push.apply(l,h):l.push({scopeParent:d,candidates:h})}else u.unshift.apply(u,d.children)}}return l},d=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},c=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||function(t){var e,n=null==t||null===(e=t.getAttribute)||void 0===e?void 0:e.call(t,"contenteditable");return""===n||"true"===n}(t))&&!d(t)?0:t.tabIndex},f=function(t,e){return t.tabIndex===e.tabIndex?t.documentOrder-e.documentOrder:t.tabIndex-e.tabIndex},s=function(t){return"INPUT"===t.tagName},p=function(t){return function(t){return s(t)&&"radio"===t.type}(t)&&!function(t){if(!t.name)return!0;var e,n=t.form||i(t),o=function(t){return n.querySelectorAll('input[type="radio"][name="'+t+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)e=o(window.CSS.escape(t.name));else try{e=o(t.name)}catch(t){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",t.message),!1}var r=function(t,e){for(var n=0;n<t.length;n++)if(t[n].checked&&t[n].form===e)return t[n]}(e,t.form);return!r||r===t}(t)},h=function(t){var e=t.getBoundingClientRect(),n=e.width,o=e.height;return 0===n&&0===o},v=function(t,e){var n=e.displayCheck,o=e.getShadowRoot;if("hidden"===getComputedStyle(t).visibility)return!0;var a=r.call(t,"details>summary:first-of-type")?t.parentElement:t;if(r.call(a,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return h(t)}else{if("function"==typeof o){for(var l=t;t;){var u=t.parentElement,d=i(t);if(u&&!u.shadowRoot&&!0===o(u))return h(t);t=t.assignedSlot?t.assignedSlot:u||d===t.ownerDocument?u:d.host}t=l}if(function(t){var e,n,o,r,a=t&&i(t),l=null===(e=a)||void 0===e?void 0:e.host,u=!1;if(a&&a!==t)for(u=!!(null!==(n=l)&&void 0!==n&&null!==(o=n.ownerDocument)&&void 0!==o&&o.contains(l)||null!=t&&null!==(r=t.ownerDocument)&&void 0!==r&&r.contains(t));!u&&l;){var d,c,f;u=!(null===(c=l=null===(d=a=i(l))||void 0===d?void 0:d.host)||void 0===c||null===(f=c.ownerDocument)||void 0===f||!f.contains(l))}return u}(t))return!t.getClientRects().length;if("legacy-full"!==n)return!0}return!1},b=function(t,e){return!(e.disabled||a(e)||function(t){return s(t)&&"hidden"===t.type}(e)||v(e,t)||function(t){return"DETAILS"===t.tagName&&Array.prototype.slice.apply(t.children).some((function(t){return"SUMMARY"===t.tagName}))}
6(e)||function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var e=t.parentElement;e;){if("FIELDSET"===e.tagName&&e.disabled){for(var n=0;n<e.children.length;n++){var o=e.children.item(n);if("LEGEND"===o.tagName)return!!r.call(e,"fieldset[disabled] *")||!o.contains(t)}return!0}e=e.parentElement}return!1}(e))},m=function(t,e){return!(p(e)||c(e)<0||!b(t,e))},g=function(t){var e=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(e)||e>=0)},y=function t(e){var n=[],o=[];return e.forEach((function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,l=function(t,e){var n=c(t);return n<0&&e&&!d(t)?0:n}(a,i),u=i?t(e.candidates):a;0===l?i?n.push.apply(n,u):n.push(a):o.push({documentOrder:r,tabIndex:l,item:e,isScope:i,content:u})})),o.sort(f).reduce((function(t,e){return e.isScope?t.push.apply(t,e.content):t.push(e.content),t}),[]).concat(n)},w=e.concat("iframe").join(",");t.focusable=function(t,e){return(e=e||{}).getShadowRoot?u([t],e.includeContainer,{filter:b.bind(null,e),flatten:!0,getShadowRoot:e.getShadowRoot}):l(t,e.includeContainer,b.bind(null,e))},t.getTabIndex=c,t.isFocusable=function(t,e){if(e=e||{},!t)throw new Error("No node provided");return!1!==r.call(t,w)&&b(e,t)},t.isTabbable=function(t,e){if(e=e||{},!t)throw new Error("No node provided");return!1!==r.call(t,n)&&m(e,t)},t.tabbable=function(t,e){var n;return n=(e=e||{}).getShadowRoot?u([t],e.includeContainer,{filter:m.bind(null,e),flatten:!1,getShadowRoot:e.getShadowRoot,shadowRootFilter:g}):l(t,e.includeContainer,m.bind(null,e)),y(n)},Object.defineProperty(t,"__esModule",{value:!0})}));
7
8;
9/* @license GPL-2.0-or-later https://www.drupal.org/licensing/faq */
10(function($,Drupal){Drupal.behaviors.AdminDialogsSelector={attach:function(context,settings){let paths=settings.admin_dialogs.paths;let selectors=settings.admin_dialogs.selectors;if(paths)$('a:not(".admin-dialog-processed")').each(function(){let href=$(this).attr('href');for(const path in paths)if(matchRule(href,path)){if(paths[path]!==undefined){$(this).addClass(paths[path]['class'][0]);$(this).attr('data-dialog-options',paths[path]['data-dialog-options']);$(this).attr('data-dialog-type',paths[path]['data-dialog-type']);if(paths[path]['data-dialog-type']=='dialog')$(this).attr('data-dialog-renderer',paths[path]['data-dialog-renderer']);}$(this).addClass('admin-dialog-processed');}});if(selectors)for(var selector in selectors){let element=$(selector+':not(".admin-dialog-selector-processed")');element.each(function(){$(this).addClass(selectors[selector]['class'][0]);$(this).attr('data-dialog-options',selectors[selector]['data-dialog-options']);$(this).attr('data-dialog-type',selectors[selector]['data-dialog-type']);if(selectors[selector]['data-dialog-type']=='dialog')$(this).attr('data-dialog-renderer',selectors[selector]['data-dialog-renderer']);$(this).addClass('admin-dialog-selector-processed');});}}};function matchRule(str,rule){const escapeRegex=(str)=>str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1");return new RegExp("^"+rule.split("*").map(escapeRegex).join(".*")+"$").test(str);}})(jQuery,Drupal);;
11(function(Drupal,once){Drupal.behaviors.customGradients={attach:function(context,settings){once('customGradient','.aside-container .title-desc',context).forEach(function(titleDesc){function updateGradientBasedOnScroll(){if(titleDesc.scrollTop>0){titleDesc.style.webkitMaskImage='linear-gradient(to top, transparent 0%, black 20%, black 80%, transparent 100%)';titleDesc.style.maskImage='linear-gradient(to top, transparent 0%, black 20%, black 80%, transparent 100%)';}else{titleDesc.style.webkitMaskImage='linear-gradient(to top, transparent 0%, black 20%), linear-gradient(to bottom, black 80%, transparent 100%)';titleDesc.style.maskImage='linear-gradient(to top, transparent 0%, black 20%), linear-gradient(to bottom, black 80%, transparent 100%)';}}titleDesc.addEventListener('scroll',updateGradientBasedOnScroll);updateGradientBasedOnScroll();});}};})(Drupal,once);;
12(function($,Drupal){Drupal.theme.progressBar=function(id){const escapedId=Drupal.checkPlain(id);return (`<div id="${escapedId}
vendor: 3,483 bytes, lines 12-14
12" class="progress" aria-live="polite">`+'<div class="progress__label">&nbsp;</div>'+'<div class="progress__track"><div class="progress__bar"></div></div>'+'<div class="progress__percentage"></div>'+'<div class="progress__description">&nbsp;</div>'+'</div>');};Drupal.ProgressBar=function(id,updateCallback,method,errorCallback){this.id=id;this.method=method||'GET';this.updateCallback=updateCallback;this.errorCallback=errorCallback;this.element=$(Drupal.theme('progressBar',id));};$.extend(Drupal.ProgressBar.prototype,{setProgress(percentage,message,label){if(percentage>=0&&percentage<=100){$(this.element).find('div.progress__bar').each(function(){this.style.width=`${percentage}%`;});$(this.element).find('div.progress__percentage').html(`${percentage}%`);}$('div.progress__description',this.element).html(message);$('div.progress__label',this.element).html(label);if(this.updateCallback)this.updateCallback(percentage,message,this);},startMonitoring(uri,delay){this.delay=delay;this.uri=uri;this.sendPing();},stopMonitoring(){clearTimeout(this.timer);this.uri=null;},sendPing(){if(this.timer)clearTimeout(this.timer);if(this.uri){const pb=this;let uri=this.uri;if(!uri.includes('?'))uri+='?';else uri+='&';uri+='_format=json';$.ajax({type:this.method,url:uri,data:'',dataType:'json',success(progress){if(progress.status===0){pb.displayError(progress.data);return;}pb.setProgress(progress.percentage,progress.message,progress.label);pb.timer=setTimeout(()=>{pb.sendPing();},pb.delay);},error(xmlhttp){const e=new Drupal.AjaxError(xmlhttp,pb.uri);pb.displayError(`<pre>${e.message}</pre>`);}});}},displayError(string){const error=$('<div class="messages messages--error"></div>').html(string);$(this.element).before(error).hide();if(this.errorCallback)this.errorCallback(this);}});})(jQuery,Drupal);;
13/* @license MIT https://raw.githubusercontent.com/muicss/loadjs/4.3.0/LICENSE.txt */
14loadjs=function(){var h=function(){},o={},c={},f={};function u(e,n){if(e){var t=f[e];if(c[e]=n,t)for(;t.length;)t[0](e,n),t.splice(0,1)}}function l(e,n){e.call&&(e={success:e}),n.length?(e.error||h)(n):(e.success||h)(e)}function p(t,r,i,s){var o,e,u,n=document,c=i.async,f=(i.numRetries||0)+1,l=i.before||h,a=t.replace(/[\?|#].*$/,""),d=t.replace(/^(css|img|module|nomodule)!/,"");if(s=s||0,/(^css!|\.css$)/.test(a))(u=n.createElement("link")).rel="stylesheet",u.href=d,(o="hideFocus"in u)&&u.relList&&(o=0,u.rel="preload",u.as="style");else if(/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(a))(u=n.createElement("img")).src=d;else if((u=n.createElement("script")).src=d,u.async=void 0===c||c,e="noModule"in u,/^module!/.test(a)){if(!e)return r(t,"l");u.type="module"}else if(/^nomodule!/.test(a)&&e)return r(t,"l");!(u.onload=u.onerror=u.onbeforeload=function(e){var n=e.type[0];if(o)try{u.sheet.cssText.length||(n="e")}catch(e){18!=e.code&&(n="e")}if("e"==n){if((s+=1)<f)return p(t,r,i,s)}else if("preload"==u.rel&&"style"==u.as)return u.rel="stylesheet";r(t,n,e.defaultPrevented)})!==l(t,u)&&n.head.appendChild(u)}function t(e,n,t){var r,i;if(n&&n.trim&&(r=n),i=(r?t:n)||{},r){if(r in o)throw"LoadJS";o[r]=!0}function s(n,t){!function(e,r,n){var t,i,s=(e=e.push?e:[e]).length,o=s,u=[];for(t=function(e,n,t){if("e"==n&&u.push(e),"b"==n){if(!t)return;u.push(e)}--s||r(u)},i=0;i<o;i++)p(e[i],t,n)}(e,function(e){l(i,e),n&&l({success:n,error:t},e),u(r,e)},i)}if(i.returnPromise)return new Promise(s);s()}return t.ready=function(e,n){return function(e,t){e=e.push?e:[e];var n,r,i,s=[],o=e.length,u=o;
14for(n=function(e,n){n.length&&s.push(e),--u||t(s)};o--;)r=e[o],(i=c[r])?n(r,i):(f[r]=f[r]||[]).push(n)}(e,function(e){l(n,e)}),t},t.done=function(e){u(e,[])},t.reset=function(){o={},c={},f={}},t.isDefined=function(e){return e in o},t}();;
15/* @license GPL-2.0-or-later https://www.drupal.org/licensing/faq */
16Drupal.debounce=function(func,wait,immediate){let timeout;let result;return function(...args){const context=this;const later=function(){timeout=null;if(!immediate)result=func.apply(context,args);};const callNow=immediate&&!timeout;clearTimeout(timeout);timeout=setTimeout(later,wait);if(callNow)result=func.apply(context,args);return result;};};;
17(function(Drupal,debounce){let liveElement;const announcements=[];Drupal.behaviors.drupalAnnounce={attach(context){if(!liveElement){liveElement=document.createElement('div');liveElement.id='drupal-live-announce';liveElement.className='visually-hidden';liveElement.setAttribute('aria-live','polite');liveElement.setAttribute('aria-busy','false');document.body.appendChild(liveElement);}}};function announce(){const text=[];let priority='polite';let announcement;const il=announcements.length;for(let i=0;i<il;i++){announcement=announcements.pop();text.unshift(announcement.text);if(announcement.priority==='assertive')priority='assertive';}if(text.length){liveElement.innerHTML='';liveElement.setAttribute('aria-busy','true');liveElement.setAttribute('aria-live',priority);liveElement.innerHTML=text.join('\n');liveElement.setAttribute('aria-busy','false');}}Drupal.announce=function(text,priority){announcements.push({text,priority});return debounce(announce,200)();};})(Drupal,Drupal.debounce);;
18((Drupal)=>{Drupal.Message=class{constructor(messageWrapper=null){if(!messageWrapper)this.messageWrapper=Drupal.Message.defaultWrapper();else this.messageWrapper=messageWrapper;}static defaultWrapper(){let wrapper=document.querySelector('[data-drupal-messages]')||document.querySelector('[data-drupal-messages-fallback]');if(!wrapper){wrapper=document.createElement('div');document.body.appendChild(wrapper);}if(wrapper.hasAttribute('data-drupal-messages-fallback')){wrapper.removeAttribute('data-drupal-messages-fallback');wrapper.classList.remove('hidden');}wrapper.setAttribute('data-drupal-messages','');return wrapper.innerHTML===''?Drupal.Message.messageInternalWrapper(wrapper):wrapper.firstElementChild;}static getMessageTypeLabels(){return {status:Drupal.t('Status message'),error:Drupal.t('Error message'),warning:Drupal.t('Warning message')};}add(message,options={}){if(!options.hasOwnProperty('type'))options.type='status';if(typeof message!=='string')throw new Error('Message must be a string.');Drupal.Message.announce(message,options);options.id=options.id?String(options.id):`${options.type}-${Math.random().toFixed(15).replace('0.','')}`;if(!Drupal.Message.getMessageTypeLabels().hasOwnProperty(options.type)){const {type}=options;throw new Error(`The message type, ${type}, is not present in Drupal.Message.getMessageTypeLabels().`);}this.messageWrapper.appendChild(Drupal.theme('message',{text:message},options));return options.id;}select(id){return this.messageWrapper.querySelector(`[data-drupal-message-id^="${id}"]`);}remove(id){return this.messageWrapper.removeChild(this.select(id));}clear(){this.messageWrapper.querySelectorAll('[data-drupal-message-id]').forEach((message)=>{this.messageWrapper.removeChild(message);});}static announce(message,options){if(!options.priority&&(options.type==='warning'||options.type==='error'))options.priority='assertive';if(options.announce!=='')Drupal.announce(options.announce||message,options.priority);}static messageInternalWrapper(messageWrapper){const innerWrapper=document.createElement('div');innerWrapper.setAttribute('class','messages__wrapper');messageWrapper.insertAdjacentElement('afterbegin',innerWrapper);return innerWrapper;}};Drupal.theme.message=({text},{type,id})=>{const messagesTypes=Drupal.Message.getMessageTypeLabels();const messageWrapper=document.createElement('div');messageWrapper.setAttribute('class',`messages messages--${type}`);messageWrapper.setAttribute('role',type==='error'||type==='warning'?'alert':'status');messageWrapper.setAttribute('data-drupal-message-id',id);messageWrapper.setAttribute('data-drupal-message-type',type);messageWrapper.setAttribute('aria-label',messagesTypes[type]);messageWrapper.innerHTML=`${text}`;return messageWrapper;};})(Drupal);;
19(function($,window,Drupal,drupalSettings,loadjs,{isFocusable,tabbable}){Drupal.behaviors.AJAX={attach(context,settings){function loadAjaxBehavior(base){const elementSettings=settings.ajax[base];if(typeof elementSettings.selector==='undefined')elementSettings.selector=`#${base}`;
19once('drupal-ajax',$(elementSettings.selector)).forEach((el)=>{elementSettings.element=el;elementSettings.base=base;Drupal.ajax(elementSettings);});}Object.keys(settings.ajax||{}).forEach(loadAjaxBehavior);Drupal.ajax.bindAjaxLinks(document.body);once('ajax','.use-ajax-submit').forEach((el)=>{const elementSettings={};elementSettings.url=$(el.form).attr('action');elementSettings.setClick=true;elementSettings.event='click';elementSettings.progress={type:'throbber'};elementSettings.base=el.id;elementSettings.element=el;Drupal.ajax(elementSettings);});},detach(context,settings,trigger){if(trigger==='unload')Drupal.ajax.expired().forEach((instance)=>{Drupal.ajax.instances[instance.instanceIndex]=null;});}};Drupal.AjaxError=function(xmlhttp,uri,customMessage){let statusCode;let statusText;let responseText;if(xmlhttp.status)statusCode=`\n${Drupal.t('An AJAX HTTP error occurred.')}\n${Drupal.t('HTTP Result Code: !status',{'!status':xmlhttp.status})}`;else statusCode=`\n${Drupal.t('An AJAX HTTP request terminated abnormally.')}`;statusCode+=`\n${Drupal.t('Debugging information follows.')}`;const pathText=`\n${Drupal.t('Path: !uri',{'!uri':uri})}`;statusText='';try{statusText=`\n${Drupal.t('StatusText: !statusText',{'!statusText':xmlhttp.statusText.trim()})}`;}catch(e){}responseText='';try{responseText=`\n${Drupal.t('ResponseText: !responseText',{'!responseText':xmlhttp.responseText.trim()})}`;}catch(e){}responseText=responseText.replace(/<("[^"]*"|'[^']*'|[^'">])*>/gi,'');responseText=responseText.replace(/[\n]+\s+/g,'\n');const readyStateText=xmlhttp.status===0?`\n${Drupal.t('ReadyState: !readyState',{'!readyState':xmlhttp.readyState})}`:'';customMessage=customMessage?`\n${Drupal.t('CustomMessage: !customMessage',{'!customMessage':customMessage})}`:'';this.message=statusCode+pathText+statusText+customMessage+responseText+readyStateText;this.name='AjaxError';if(!Drupal.AjaxError.messages)Drupal.AjaxError.messages=new Drupal.Message();Drupal.AjaxError.messages.add(Drupal.t("Oops, something went wrong. Check your browser's developer console for more details."),{type:'error'});};Drupal.AjaxError.prototype=new Error();Drupal.AjaxError.prototype.constructor=Drupal.AjaxError;Drupal.ajax=function(settings){if(arguments.length!==1)throw new Error('Drupal.ajax() function must be called with one configuration object only');const base=settings.base||false;const element=settings.element||false;delete settings.base;delete settings.element;if(!settings.progress&&!element)settings.progress=false;const ajax=new Drupal.Ajax(base,element,settings);ajax.instanceIndex=Drupal.ajax.instances.length;Drupal.ajax.instances.push(ajax);return ajax;};Drupal.ajax.instances=[];Drupal.ajax.expired=function(){return Drupal.ajax.instances.filter((instance)=>instance&&instance.element!==false&&!document.body.contains(instance.element));};Drupal.ajax.bindAjaxLinks=(element)=>{once('ajax','.use-ajax',element).forEach((ajaxLink)=>{const $linkElement=$(ajaxLink);const elementSettings={progress:{type:'throbber'},dialogType:$linkElement.data('dialog-type'),dialog:$linkElement.data('dialog-options'),dialogRenderer:$linkElement.data('dialog-renderer'),base:$linkElement.attr('id'),element:ajaxLink};const href=$linkElement.attr('href');if(href){elementSettings.url=href;elementSettings.event='click';}const httpMethod=$linkElement.data('ajax-http-method');if(httpMethod)elementSettings.httpMethod=httpMethod;Drupal.ajax(elementSettings);});};Drupal.Ajax=function(base,element,elementSettings){const defaults={httpMethod:'POST',event:element?'mousedown':null,keypress:true,selector:base?`#${base}`:null,effect:'none',speed:'none',method:'replaceWith',progress:{type:'throbber',message:Drupal.t('Processing...')},submit:{js:true}};$.extend(this,defaults,elementSettings);this.commands=new Drupal.AjaxCommands();this.instanceIndex=false;if(this.wrapper)this.wrapper=`#${this.wrapper}`;this.element=element;this.preCommandsFocusedElementSelector=null;this.elementSettings=elementSettings;if(this.element?.form)this.$form=$(this.element.form);if(!this.url){const $element=$(this.element);if(this.element.tagName==='A')this.url=$element.attr('href');else{if(this.element&&element.form)this.url=this.$form.attr('action');}}const originalUrl=this.url;this.url=this.url.replace(/\/nojs(\/|$|\?|#)/,'/ajax$1');if(drupalSettings.ajaxTrustedUrl[originalUrl])drupalSettings.ajaxTrustedUrl[this.url]=true;const ajax=this;ajax.options={url:ajax.url,data:ajax.submit,isInProgress(){return ajax.ajaxing;},beforeSerialize(elementSettings,options){return ajax.beforeSerialize(elementSettings,options);},beforeSubmit(formValues,elementSettings,options){ajax.ajaxing=true;ajax.preCommandsFocusedElementSelector=null;return ajax.beforeSubmit(formValues,elementSettings,options);},beforeSend(xmlhttprequest,options){ajax.ajaxing=true;return ajax.beforeSend(xmlhttprequest,options);},success(response,status,xmlhttprequest){ajax.preCommandsFocusedElementSelector=document.activeElement.getAttribute('data-drupal-selector');if(typeof response==='string')response=JSON.parse(response);if(response!==null&&!drupalSettings.ajaxTrustedUrl[ajax.url])if(xmlhttprequest.getResponseHeader('X-Drupal-Ajax-Token')!=='1'){const customMessage=Drupal.t('The response failed verification so will not be processed.');return ajax.error(xmlhttprequest,ajax.url,customMessage);}return (Promise.resolve(ajax.success(response,status)).then(()=>{ajax.ajaxing=false;
19$(document).trigger('ajaxSuccess',[xmlhttprequest,this]);$(document).trigger('ajaxComplete',[xmlhttprequest,this]);if(--$.active===0)$(document).trigger('ajaxStop');}));},error(xmlhttprequest,status,error){ajax.ajaxing=false;},complete(xmlhttprequest,status){if(status==='error'||status==='parsererror')return ajax.error(xmlhttprequest,ajax.url);},dataType:'json',jsonp:false,method:ajax.httpMethod};if(elementSettings.dialog)ajax.options.data.dialogOptions=elementSettings.dialog;if(!ajax.options.url.includes('?'))ajax.options.url+='?';else ajax.options.url+='&';let wrapper=`drupal_${elementSettings.dialogType||'ajax'}`;if(elementSettings.dialogRenderer)wrapper+=`.${elementSettings.dialogRenderer}`;ajax.options.url+=`${Drupal.ajax.WRAPPER_FORMAT}=${wrapper}`;$(ajax.element).on(elementSettings.event,function(event){if(!drupalSettings.ajaxTrustedUrl[ajax.url]&&!Drupal.url.isLocal(ajax.url))throw new Error(Drupal.t('The callback URL is not local and not trusted: !url',{'!url':ajax.url}));return ajax.eventResponse(this,event);});if(elementSettings.keypress)$(ajax.element).on('keypress',function(event){return ajax.keypressResponse(this,event);});if(elementSettings.prevent)$(ajax.element).on(elementSettings.prevent,false);};Drupal.ajax.WRAPPER_FORMAT='_wrapper_format';Drupal.Ajax.AJAX_REQUEST_PARAMETER='_drupal_ajax';Drupal.Ajax.prototype.execute=function(){if(this.ajaxing)return;try{this.beforeSerialize(this.element,this.options);return $.ajax(this.options);}catch(e){this.ajaxing=false;window.alert(`An error occurred while attempting to process ${this.options.url}: ${e.message}`);return $.Deferred().reject();}};Drupal.Ajax.prototype.keypressResponse=function(element,event){const ajax=this;if(event.which===13||(event.which===32&&element.type!=='text'&&element.type!=='textarea'&&element.type!=='tel'&&element.type!=='number')){event.preventDefault();event.stopPropagation();$(element).trigger(ajax.elementSettings.event);}};Drupal.Ajax.prototype.eventResponse=function(element,event){event.preventDefault();event.stopPropagation();const ajax=this;if(ajax.ajaxing)return;try{if(ajax.$form){if(ajax.setClick)element.form.clk=element;ajax.$form.ajaxSubmit(ajax.options);}else{ajax.beforeSerialize(ajax.element,ajax.options);$.ajax(ajax.options);}}catch(e){ajax.ajaxing=false;window.alert(`An error occurred while attempting to process ${ajax.options.url}: ${e.message}`);}};Drupal.Ajax.prototype.beforeSerialize=function(element,options){if(this.$form&&document.body.contains(this.$form.get(0))){const settings=this.settings||drupalSettings;Drupal.detachBehaviors(this.$form.get(0),settings,'serialize');}options.data[Drupal.Ajax.AJAX_REQUEST_PARAMETER]=1;const pageState=drupalSettings.ajaxPageState;options.data['ajax_page_state[theme]']=pageState.theme;options.data['ajax_page_state[theme_token]']=pageState.theme_token;options.data['ajax_page_state[libraries]']=pageState.libraries;};Drupal.Ajax.prototype.beforeSubmit=function(formValues,element,options){};Drupal.Ajax.prototype.beforeSend=function(xmlhttprequest,options){if(this.$form){options.extraData=options.extraData||{};options.extraData.ajax_iframe_upload='1';const v=$.fieldValue(this.element);if(v!==null)options.extraData[this.element.name]=v;}$(this.element).prop('disabled',true);if(!this.progress||!this.progress.type)return;const progressIndicatorMethod=`setProgressIndicator${this.progress.type.slice(0,1).toUpperCase()}${this.progress.type.slice(1).toLowerCase()}`;if(progressIndicatorMethod in this&&typeof this[progressIndicatorMethod]==='function')this[progressIndicatorMethod].call(this);};Drupal.theme.ajaxProgressThrobber=(message)=>{const messageMarkup=typeof message==='string'?Drupal.theme('ajaxProgressMessage',message):'';const throbber='<div class="throbber">&nbsp;</div>';return `<div class="ajax-progress ajax-progress-throbber">${throbber}${messageMarkup}</div>`;};Drupal.theme.ajaxProgressIndicatorFullscreen=()=>'<div class="ajax-progress ajax-progress-fullscreen">&nbsp;</div>';Drupal.theme.ajaxProgressMessage=(message)=>`<div class="message">${message}</div>`;Drupal.theme.ajaxProgressBar=($element)=>$('<div class="ajax-progress ajax-progress-bar"></div>').append($element);Drupal.Ajax.prototype.setProgressIndicatorBar=function(){const progressBar=new Drupal.ProgressBar(`ajax-progress-${this.element.i
19d}`,$.noop,this.progress.method,$.noop);if(this.progress.message)progressBar.setProgress(-1,this.progress.message);if(this.progress.url)progressBar.startMonitoring(this.progress.url,this.progress.interval||1500);this.progress.element=$(Drupal.theme('ajaxProgressBar',progressBar.element));this.progress.object=progressBar;$(this.element).after(this.progress.element);};Drupal.Ajax.prototype.setProgressIndicatorThrobber=function(){this.progress.element=$(Drupal.theme('ajaxProgressThrobber',this.progress.message));if($(this.element).closest('[data-drupal-ajax-container]').length)$(this.element).closest('[data-drupal-ajax-container]').after(this.progress.element);else $(this.element).after(this.progress.element);};Drupal.Ajax.prototype.setProgressIndicatorFullscreen=function(){this.progress.element=$(Drupal.theme('ajaxProgressIndicatorFullscreen'));$('body').append(this.progress.element);};Drupal.Ajax.prototype.commandExecutionQueue=function(response,status){const ajaxCommands=this.commands;return Object.keys(response||{}).reduce((executionQueue,key)=>executionQueue.then(()=>{const {command}=response[key];if(command&&ajaxCommands[command])return ajaxCommands[command](this,response[key],status);}),Promise.resolve());};Drupal.Ajax.prototype.success=function(response,status){if(this.progress.element)$(this.progress.element).remove();if(this.progress.object)this.progress.object.stopMonitoring();$(this.element).prop('disabled',false);const elementParents=$(this.element).parents('[data-drupal-selector]').addBack().toArray();const focusChanged=Object.keys(response||{}).some((key)=>{const {command,method}=response[key];return (command==='focusFirst'||command==='openDialog'||(command==='invoke'&&method==='focus'));});return (this.commandExecutionQueue(response,status).then(()=>{if(!focusChanged){let target=false;if(this.element){if($(this.element).data('refocus-blur')&&this.preCommandsFocusedElementSelector)target=document.querySelector(`[data-drupal-selector="${this.preCommandsFocusedElementSelector}"]`);if(!target&&!$(this.element).data('disable-refocus')){for(let n=elementParents.length-1;!target&&n>=0;n--)target=document.querySelector(`[data-drupal-selector="${elementParents[n].getAttribute('data-drupal-selector')}"]`);}}if(target)$(target).trigger('focus');}if(this.$form&&document.body.contains(this.$form.get(0))){const settings=this.settings||drupalSettings;Drupal.attachBehaviors(this.$form.get(0),settings);}this.settings=null;}).catch((error)=>console.error(Drupal.t('An error occurred during the execution of the Ajax response: !error',{'!error':error}))));};Drupal.Ajax.prototype.getEffect=function(response){const type=response.effect||this.effect;const speed=response.speed||this.speed;const effect={};if(type==='none'){effect.showEffect='show';effect.hideEffect='hide';effect.showSpeed='';}else if(type==='fade'){effect.showEffect='fadeIn';effect.hideEffect='fadeOut';effect.showSpeed=speed;}else{effect.showEffect=`${type}Toggle`;effect.hideEffect=`${type}Toggle`;effect.showSpeed=speed;}return effect;};Drupal.Ajax.prototype.error=function(xmlhttprequest,uri,customMessage){if(this.progress.element)$(this.progress.element).remove();if(this.progress.object)this.progress.object.stopMonitoring();$(this.wrapper).show();$(this.element).prop('disabled',false);if(this.$form&&document.body.contains(this.$form.get(0))){const settings=this.settings||drupalSettings;Drupal.attachBehaviors(this.$form.get(0),settings);}throw new Drupal.AjaxError(xmlhttprequest,uri,customMessage);};Drupal.theme.ajaxWrapperNewContent=($newContent,ajax,response)=>(response.effect||ajax.effect)!=='none'&&$newContent.filter((i)=>!(($newContent[i].nodeName==='#comment'||($newContent[i].nodeName==='#text'&&/^(\s|\n|\r)*$/.test($newContent[i].textContent))))).length>1?Drupal.theme('ajaxWrapperMultipleRootElements',$newContent):$newContent;Drupal.theme.ajaxWrapperMultipleRootElements=($elements)=>$('<div></div>').append($elements);Drupal.AjaxCommands=function(){};Drupal.AjaxCommands.prototype={insert(ajax,response){const $wrapper=response.selector?$(response.selector):$(ajax.wrapper);const method=response.method||ajax.method;const effect=ajax.getEffect(response);const settings=response.settings||ajax.settings||drupalSettings;const parseHTML=(htmlString)=>{const fragment=document.createDocumentFragment();const template=fragment.appendChild(document.createElement('template'));template.innerHTML=htmlString;return template.content.childNodes;};let $newContent=$(parseHTML(response.data));
19$newContent=Drupal.theme('ajaxWrapperNewContent',$newContent,ajax,response);switch(method){case 'html':case 'replaceWith':case 'replaceAll':case 'empty':case 'remove':Drupal.detachBehaviors($wrapper.get(0),settings);break;default:break;}$wrapper[method]($newContent);if(effect.showEffect!=='show')$newContent.hide();const $ajaxNewContent=$newContent.find('.ajax-new-content');if($ajaxNewContent.length){$ajaxNewContent.hide();$newContent.show();$ajaxNewContent[effect.showEffect](effect.showSpeed);}else{if(effect.showEffect!=='show')$newContent[effect.showEffect](effect.showSpeed);}$newContent.each((index,element)=>{if(element.nodeType===Node.ELEMENT_NODE&&document.documentElement.contains(element))Drupal.attachBehaviors(element,settings);});},remove(ajax,response,status){const settings=response.settings||ajax.settings||drupalSettings;$(response.selector).each(function(){Drupal.detachBehaviors(this,settings);}).remove();},changed(ajax,response,status){const $element=$(response.selector);if(!$element.hasClass('ajax-changed')){$element.addClass('ajax-changed');if(response.asterisk)$element.find(response.asterisk).append(` <abbr class="ajax-changed" title="${Drupal.t('Changed')}">*</abbr> `);}},alert(ajax,response,status){window.alert(response.text);},announce(ajax,response){if(response.priority)Drupal.announce(response.text,response.priority);else Drupal.announce(response.text);},redirect(ajax,response,status){window.location=response.url;},css(ajax,response,status){$(response.selector).css(response.argument);},settings(ajax,response,status){const ajaxSettings=drupalSettings.ajax;if(ajaxSettings)Drupal.ajax.expired().forEach((instance)=>{if(instance.selector){const selector=instance.selector.replace('#','');if(selector in ajaxSettings)delete ajaxSettings[selector];}});if(response.merge)$.extend(true,drupalSettings,response.settings);else ajax.settings=response.settings;},data(ajax,response,status){$(response.selector).data(response.name,response.value);},focusFirst(ajax,response,status){let focusChanged=false;const container=document.querySelector(response.selector);if(container){const tabbableElements=tabbable(container);if(tabbableElements.length){tabbableElements[0].focus();focusChanged=true;}else{if(isFocusable(container)){container.focus();focusChanged=true;}}}if(ajax.hasOwnProperty('element')&&!focusChanged)ajax.element.focus();},invoke(ajax,response,status){const $element=$(response.selector);$element[response.method](...response.args);},restripe(ajax,response,status){$(response.selector).find('> tbody > tr:visible, > tr:visible').removeClass('odd even').filter(':even').addClass('odd').end().filter(':odd').addClass('even');},update_build_id(ajax,response,status){document.querySelectorAll(`input[name="form_build_id"][value="${response.old}"]`).forEach((item)=>{item.value=response.new;});},add_css(ajax,response,status){const allUniqueBundleIds=response.data.map(function(style){const uniqueBundleId=style.href;if(!loadjs.isDefined(uniqueBundleId))loadjs(`css!${style.href}`,uniqueBundleId,{before(path,styleEl){Object.keys(style).forEach((attributeKey)=>{styleEl.setAttribute(attributeKey,style[attributeKey]);});}});return uniqueBundleId;});return new Promise((resolve,reject)=>{loadjs.ready(allUniqueBundleIds,{success(){resolve();},error(depsNotFound){const message=Drupal.t(`The following files could not be loaded: @dependencies`,{'@dependencies':depsNotFound.join(', ')});reject(message);}});});},message(ajax,response){const messages=new Drupal.Message(document.querySelector(response.messageWrapperQuerySelector));if(response.clearPrevious)messages.clear();messages.add(response.message,response.messageOptions);},add_js(ajax,response,status){const parentEl=document.querySelector(response.selector||'body');const settings=ajax.settings||drupalSettings;const allUniqueBundleIds=response.data.map((script)=>{const uniqueBundleId=script.src;if(!loadjs.isDefined(uniqueBundleId))loadjs(script.src,uniqueBundleId,{async:false,before(path,scriptEl){Object.keys(script).forEach((attributeKey)=>{scriptEl.setAttribute(attributeKey,script[attributeKey]);});parentEl.appendChild(scriptEl);return false;}});return uniqueBundleId;});return new Promise((resolve,reject)=>{loadjs.ready(allUniqueBundleIds,{success(){Drupal.attachBehaviors(parentEl,settings);resolve();},error(depsNotFound){const message=Drupal.t(`The following files could not be loaded: @dependencies`,{'@dependencies':depsNotFound.join(', ')});reject(message);}});});},scrollTop(ajax,response){const offset=$(response.selector).offset();let scrollTarget=response.selector;while($(scrollTarget).scrollTop()===0&&$(scrollTarget).parent())scrollTarget=$(scrollTarget).parent();if(offset.top-10<$(scrollTarget).scrollTop())scrollTarget.get(0).scrollTo({top:offset.top-10,behavior:'smooth'});}};const stopEvent=(xhr,settings)=>{return (xhr.getResponseHeader('X-Drupal-Ajax-Token')==='1'&&typeof settings.isInProgress==='function'&&settings.isInProgress());};$.extend(true,$.event.special,{ajaxSuccess:{trigger(event,xhr,settings){if(stopEvent(xhr,settings))return false;}},ajaxComplete:{trigger(event,xhr,settings){if(stopEvent(xhr,settings)){$.active++;return false;}}}});})(jQuery,window,Drupal,drupalSettings,loadjs,window.tabbable);;
20(function _($,drupalSettings){setTimeout(()=>{$.ajax({type:'POST',cache:false,url:drupalSettings.statistics.url,data:drupalSettings.statistics.data});});})(jQuery,drupalSettings);;
21(function(Drupal){"use strict";Drupal.behaviors.hideAlert={attach:function(context,settings){var alerts=context.querySelectorAll('.messages--wizionary');
21alerts.forEach(function(alert){setTimeout(function(){alert.remove();},5000);});}};})(Drupal);;
22!function(e,t){let o=!0,n="true"===localStorage.getItem("isHelped"),l=localStorage.getItem("isStaticed"),i;function s(){let e=document.querySelectorAll(".audio-gesture");e.forEach(function(e){let t=e.querySelector("audio");t.muted=o,o&&t.pause()})}function r(e){document.querySelectorAll(".alert-info").forEach(function(e){document.body.removeChild(e)});let t=document.createElement("div");t.classList.add("messages__wrapper","alert-info"),t.textContent=e,document.body.appendChild(t),setTimeout(function(){document.body.contains(t)&&document.body.removeChild(t)},5e3)}function d(){document.body.classList.toggle("muted",o),document.body.classList.toggle("helped",n),document.body.classList.toggle("static",l)}l=null!==l&&"true"===l;let u=document.getElementById("audio-toggle");u&&u.addEventListener("click",function(){o=!o,d(),s(),r(i=o?e.t("Teaser music was turned off."):e.t("All teaser's music was temporarily turned on."))});let a=document.getElementById("help-toggle");a&&a.addEventListener("click",function(){n=!n,localStorage.setItem("isHelped",n),d(),r(i=n?e.t("Tooltips were turned on. Now you can hover over what you want to understand and see its description."):e.t("Tooltips were turned off. No more hover descriptions."))});let c=document.getElementById("fullscreen-toggle");c&&c.addEventListener("click",function(){document.fullscreenElement?document.exitFullscreen&&document.exitFullscreen():document.documentElement.requestFullscreen().catch(e=>{console.error(`Full screen mode cannot be activated: ${e.message}`)})});let y=document.getElementById("movement-toggle");y&&y.addEventListener("click",function(){l=!l,localStorage.setItem("isStaticed",l),d(),r(i=l?e.t("Videos are globally turned off."):e.t("Videos are globally turned on."))}),d(),e.behaviors.gestureControlledPlayer={attach:function(e,n){let l=t("gestureControlledPlayer",".audio-gesture",e);document.body.classList.add("muted",o),s(),window.addEventListener("blur",function(){l.forEach(function(e){let t=e.querySelector("audio");t.pause()})}),window.addEventListener("focus",function(){l.forEach(function(e){let t=e.querySelector("audio");!o&&e.closest(".init-audio-gesture")?.matches(":hover")&&(t.currentTime=0,t.play())})}),l.forEach(function(e){let t=e.querySelector("audio"),n=e.querySelector(".toggle-sound"),l=e.querySelector(".progress-line"),i;l.style.display="none",n.addEventListener("click",function(){o=!o,document.body.classList.toggle("muted",o),l.style.display=o?"block":"none",s(),!o&&e.closest(".init-audio-gesture")?.matches(":hover")&&t.play()}),t.addEventListener("timeupdate",function(){let e=t.currentTime,o=t.duration;l.style.width=e/o*100+"%"}),e.closest(".init-audio-gesture").addEventListener("mouseenter",function(){!o&&t.readyState>=4&&(t.currentTime=0,l.style.display="block",i=setTimeout(function(){e.closest(".init-audio-gesture")?.matches(":hover")&&t.play()},1e3))}),e.closest(".init-audio-gesture").addEventListener("mouseleave",function(){clearTimeout(i),t.pause(),l.style.display="none"})})}}}(Drupal,once);
23;
24(function(Drupal,once){Drupal.behaviors.menu={attach:function(context,settings){once('menuManager','body',context).forEach(()=>{new MenuManager(context).init();});}};class MenuManager{constructor(context){this.body=document.querySelector('body');this.context=context;this.menuClass='menu-collapsed';this.scrolledClass='scrolled';this.submenuLinks=context.querySelectorAll('.submenu-wrapper');this.submenuHoverLinks=context.querySelectorAll('.submenu-wrapper-hover');this.popups=context.querySelectorAll('.popup');}init(){this.initializeMenuState();this.insertMenuStyles();this.handleMenuToggle();this.handleScroll();this.handleSubmenuEvents();this.handleSubmenuHoverEvents();this.handlePopupEvents();this.handleEscapeKey();this.handleClickOutside();}initializeMenuState(){if(localStorage.getItem('menuCollapsed')==='1')this.updateMenuState(true);}insertMenuStyles(){this.removeExistingStyles();const menuCollapsed=localStorage.getItem('menuCollapsed')==='1';const style=document.createElement('style');style.id=menuCollapsed?'menuCollapsedStyles':'menuExpandedStyles';document.head.append(style);}removeExistingStyles(){const existingCollapsedStyle=document.getElementById('menuCollapsedStyles');const existingExpandedStyle=document.getElementById('menuExpandedStyles');if(existingCollapsedStyle)document.head.removeChild(existingCollapsedStyle);if(existingExpandedStyle)document.head.removeChild(existingExpandedStyle);}handleMenuToggle(){const menuToggle=this.context.querySelector('#menu-toggle');
24if(menuToggle)menuToggle.addEventListener('click',()=>{const shouldBeCollapsed=localStorage.getItem('menuCollapsed')!=='1';this.updateMenuState(shouldBeCollapsed);this.insertMenuStyles();});}updateMenuState(isCollapsed){this.body.classList.toggle(this.menuClass,isCollapsed);localStorage.setItem('menuCollapsed',isCollapsed?'1':'0');}handleScroll(){window.addEventListener('scroll',()=>{const shouldAddScrolledClass=window.scrollY>100;this.body.classList.toggle(this.scrolledClass,shouldAddScrolledClass);});}closeAllHoverElements(){this.submenuLinks.forEach((link)=>{this.toggleHoverElement(link.id,false);});if(this.submenuHoverLinks)this.submenuHoverLinks.forEach((link)=>{this.toggleHoverElement(link.id,false);});}isHoverElementVisible(id){const hoverElement=document.getElementById(id+'-hover');return hoverElement?hoverElement.classList.contains('flex'):false;}handleSubmenuEvents(){once('submenu-link','.submenu-wrapper',this.context).forEach((link)=>{link.addEventListener('click',(event)=>{event.preventDefault();const isCurrentlyOpen=this.isHoverElementVisible(link.id);this.closeAllHoverElements();this.toggleHoverElement(link.id,!isCurrentlyOpen);});});}handleSubmenuHoverEvents(){once('submenu-hover-link','.submenu-wrapper-hover',this.context).forEach((link)=>{link.addEventListener('click',(event)=>{event.preventDefault();const isCurrentlyOpen=this.isHoverElementVisible(link.id);this.closeAllHoverElements();this.toggleHoverElement(link.id,!isCurrentlyOpen);});link.addEventListener('mouseenter',()=>{this.closeAllHoverElements();this.toggleHoverElement(link.id,true);});link.addEventListener('mouseleave',()=>{setTimeout(()=>{const hoverElement=document.getElementById(link.id+'-hover');if(hoverElement&&!hoverElement.matches(':hover'))this.toggleHoverElement(link.id,false);},200);});});}toggleHoverElement(id,show){const hoverElement=document.getElementById(id+'-hover');if(hoverElement){hoverElement.classList.toggle('flex',show);hoverElement.classList.toggle('hidden',!show);}}handlePopupEvents(){this.popups.forEach((popup)=>{popup.addEventListener('mouseout',(event)=>{if(!popup.contains(event.relatedTarget))this.closeAllHoverElements();});});}handleEscapeKey(){document.addEventListener('keydown',(event)=>{if(event.key==='Escape')this.closeAllHoverElements();});}handleClickOutside(){document.addEventListener('click',(event)=>{if(!event.target.closest('.submenu-wrapper')&&!event.target.closest('.submenu-wrapper-hover')&&!event.target.closest('[id$="-hover"]'))this.closeAllHoverElements();});}}})(Drupal,once);;
25/* @license MIT https://github.com/floating-ui/floating-ui/blob/@floating-ui/[email protected]/LICENSE */
26!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).FloatingUICore={})}(this,(function(t){"use strict";const e=["top","right","bottom","left"],n=["start","end"],i=e.reduce(((t,e)=>t.concat(e,e+"-"+n[0],e+"-"+n[1])),[]),o=Math.min,r=Math.max,a={left:"right",right:"left",bottom:"top",top:"bottom"},l={start:"end",end:"start"};function s(t,e,n){return r(t,o(e,n))}function f(t,e){return"function"==typeof t?t(e):t}function c(t){return t.split("-")[0]}function u(t){return t.split("-")[1]}function m(t){return"x"===t?"y":"x"}function d(t){return"y"===t?"height":"width"}function g(t){return["top","bottom"].includes(c(t))?"y":"x"}function p(t){return m(g(t))}function h(t,e,n){void 0===n&&(n=!1);const i=u(t),o=p(t),r=d(o);let a="x"===o?i===(n?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[r]>e.floating[r]&&(a=w(a)),[a,w(a)]}function y(t){return t.replace(/start|end/g,(t=>l[t]))}function w(t){return t.replace(/left|right|bottom|top/g,(t=>a[t]))}function x(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function v(t){const{x:e,y:n,width:i,height:o}=t;return{width:i,height:o,top:n,left:e,right:e+i,bottom:n+o,x:e,y:n}}function b(t,e,n){let{reference:i,floating:o}=t;const r=g(e),a=p(e),l=d(a),s=c(e),f="y"===r,m=i.x+i.width/2-o.width/2,h=i.y+i.height/2-o.height/2,y=i[l]/2-o[l]/2;let w;switch(s){case"top":w={x:m,y:i.y-o.height};break;case"bottom":w={x:m,y:i.y+i.height};break;case"right":w={x:i.x+i.width,y:h};break;case"left":w={x:i.x-o.width,y:h};break;default:w={x:i.x,y:i.y}}switch(u(e)){case"start":w[a]-=y*(n&&f?-1:1);break;case"end":w[a]+=y*(n&&f?-1:1)}return w}async function A(t,e){var n;void 0===e&&(e={});
vendor: 9,598 bytes, line 26
26const{x:i,y:o,platform:r,rects:a,elements:l,strategy:s}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:m="floating",altBoundary:d=!1,padding:g=0}=f(e,t),p=x(g),h=l[d?"floating"===m?"reference":"floating":m],y=v(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(h)))||n?h:h.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:s})),w="floating"===m?{x:i,y:o,width:a.floating.width,height:a.floating.height}:a.reference,b=await(null==r.getOffsetParent?void 0:r.getOffsetParent(l.floating)),A=await(null==r.isElement?void 0:r.isElement(b))&&await(null==r.getScale?void 0:r.getScale(b))||{x:1,y:1},R=v(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:b,strategy:s}):w);return{top:(y.top-R.top+p.top)/A.y,bottom:(R.bottom-y.bottom+p.bottom)/A.y,left:(y.left-R.left+p.left)/A.x,right:(R.right-y.right+p.right)/A.x}}function R(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function P(t){return e.some((e=>t[e]>=0))}function D(t){const e=o(...t.map((t=>t.left))),n=o(...t.map((t=>t.top)));return{x:e,y:n,width:r(...t.map((t=>t.right)))-e,height:r(...t.map((t=>t.bottom)))-n}}t.arrow=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:i,placement:r,rects:a,platform:l,elements:c,middlewareData:m}=e,{element:g,padding:h=0}=f(t,e)||{};if(null==g)return{};const y=x(h),w={x:n,y:i},v=p(r),b=d(v),A=await l.getDimensions(g),R="y"===v,P=R?"top":"left",D=R?"bottom":"right",T=R?"clientHeight":"clientWidth",O=a.reference[b]+a.reference[v]-w[v]-a.floating[b],E=w[v]-a.reference[v],L=await(null==l.getOffsetParent?void 0:l.getOffsetParent(g));let k=L?L[T]:0;k&&await(null==l.isElement?void 0:l.isElement(L))||(k=c.floating[T]||a.floating[b]);const C=O/2-E/2,B=k/2-A[b]/2-1,H=o(y[P],B),S=o(y[D],B),F=H,j=k-A[b]-S,z=k/2-A[b]/2+C,M=s(F,z,j),V=!m.arrow&&null!=u(r)&&z!==M&&a.reference[b]/2-(z<F?H:S)-A[b]/2<0,W=V?z<F?z-F:z-j:0;return{[v]:w[v]+W,data:{[v]:M,centerOffset:z-M-W,...V&&{alignmentOffset:W}},reset:V}}}),t.autoPlacement=function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,r;const{rects:a,middlewareData:l,placement:s,platform:m,elements:d}=e,{crossAxis:g=!1,alignment:p,allowedPlacements:w=i,autoAlignment:x=!0,...v}=f(t,e),b=void 0!==p||w===i?function(t,e,n){return(t?[...n.filter((e=>u(e)===t)),...n.filter((e=>u(e)!==t))]:n.filter((t=>c(t)===t))).filter((n=>!t||u(n)===t||!!e&&y(n)!==n))}(p||null,x,w):w,R=await A(e,v),P=(null==(n=l.autoPlacement)?void 0:n.index)||0,D=b[P];if(null==D)return{};const T=h(D,a,await(null==m.isRTL?void 0:m.isRTL(d.floating)));if(s!==D)return{reset:{placement:b[0]}};const O=[R[c(D)],R[T[0]],R[T[1]]],E=[...(null==(o=l.autoPlacement)?void 0:o.overflows)||[],{placement:D,overflows:O}],L=b[P+1];if(L)return{data:{index:P+1,overflows:E},reset:{placement:L}};const k=E.map((t=>{const e=u(t.placement);return[t.placement,e&&g?t.overflows.slice(0,2).reduce(((t,e)=>t+e),0):t.overflows[0],t.overflows]})).sort(((t,e)=>t[1]-e[1])),C=(null==(r=k.filter((t=>t[2].slice(0,u(t[0])?2:3).every((t=>t<=0))))[0])?void 0:r[0])||k[0][0];return C!==s?{data:{index:P+1,overflows:E},reset:{placement:C}}:{}}}},t.computePosition=async(t,e,n)=>{const{placement:i="bottom",strategy:o="absolute",middleware:r=[],platform:a}=n,l=r.filter(Boolean),s=await(null==a.isRTL?void 0:a.isRTL(e));let f=await a.getElementRects({reference:t,floating:e,strategy:o}),{x:c,y:u}=b(f,i,s),m=i,d={},g=0;for(let n=0;n<l.length;n++){const{name:r,fn:p}=l[n],{x:h,y:y,data:w,reset:x}=await p({x:c,y:u,initialPlacement:i,placement:m,strategy:o,middlewareData:d,rects:f,platform:a,elements:{reference:t,floating:e}});c=null!=h?h:c,u=null!=y?y:u,d={...d,[r]:{...d[r],...w}},x&&g<=50&&(g++,"object"==typeof x&&(x.placement&&(m=x.placement),x.rects&&(f=!0===x.rects?await a.getElementRects({reference:t,floating:e,strategy:o}):x.rects),({x:c,y:u}=b(f,m,s))),n=-1)}return{x:c,y:u,placement:m,strategy:o,middlewareData:d}},t.detectOverflow=A,t.flip=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,i;const{placement:o,middlewareData:r,rects:a,initialPlacement:l,platform:s,elements:m}=e,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:x,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:R=!0,...P}=f(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const D=c(o),T=g(l),O=c(l)===l,E=await(null==s.isRTL?void 0:s.isRTL(m.floating)),L=x||(O||!R?[w(l)]:function(t){const e=w(t);return[y(t),e,y(e)]}(l)),k="none"!==b;!x&&k&&L.push(...function(t,e,n,i){const o=u(t);let r=function(t,e,n){const i=["left","right"],o=["right","left"],r=["top","bottom"],a=["bottom","top"];switch(t){case"top":case"bottom":return n?e?o:i:e?i:o;case"left":case"right":return e?r:a;default:return[]}}(c(t),"start"===n,i);return o&&(r=r.map((t=>t+"-"+o)),e&&(r=r.concat(r.map(y)))),r}(l,R,b,E));const C=[l,...L],B=await A(e,P),H=[];let S=(null==(i=r.flip)?void 0:i.overflows)||[];if(d&&H.push(B[D]),p){const t=h(o,a,E);H.push(B[t[0]],B[t[1]])}if(S=[...S,{placement:o,overflows:H}],!H.every((t=>t<=0))){var F,j;const t=((null==(F=r.flip)?void 0:F.index)||0)+1,e=C[t];if(e){var z;const n="alignment"===p&&T!==g(e),i=(null==(z=S[0])?void 0:z.overflows[0])>0;if(!n||i)return{data:{index:t,overflows:S},reset:{placement:e}}}let n=null==(j=S.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:j.placement;if(!n)switch(v){case"bestFit":{var M;const t=null==(M=S.filter((t=>{if(k){const e=g(t.placement);return e===T||"y"===e}return!0})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:M[0];t&&(n=t);break}case"initialPlacement":n=l}if(o!==n)return{reset:{placement:n}}}return{}}}},t.hide=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:i="referenceHidden",...o}=f(t,e);switch(i){case"referenceHidden":{const t=R(await A(e,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:P(t)}}}case"escaped":{const t=R(await A(e,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:t,escaped:P(t)}}}default:return{}}}}},t.inline=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:i,rects:a,platform:l,strategy:s}=e,{padding:u=2,x:m,y:d}=f(t,e),p=Array.from(await(null==l.getClientRects?void 0:l.getClientRects(i.reference))||[]),h=function(t){const e=t.slice().sort(((t,e)=>t.y-e.y)),n=[];let i=null;for(let t=0;t<e.length;t++){const o=e[t];!i||o.y-i.y>i.height/2?n.push([o]):n[n.length-1].push(o),i=o}return n.map((t=>v(D(t))))}(p),y=v(D(p)),w=x(u);const b=await l.getElementRects({reference:{getBoundingClientRect:function(){if(2===h.length&&h[0].left>h[1].right&&null!=m&&null!=d)return h.find((t=>m>t.left-w.left&&m<t.right+w.right&&d>t.top-w.top&&d<t.bottom+w.bottom))||y;if(h.length>=2){if("y"===g(n)){const t=h[0],e=h[h.length-1],i="top"===c(n),o=t.top,r=e.bottom,a=i?t.left:e.left,l=i?t.right:e.right;return{top:o,bottom:r,left:a,right:l,width:l-a,height:r-o,x:a,y:o}}const t="left"===c(n),e=r(...h.map((t=>t.right))),i=o(...h.map((t=>t.left))),a=h.filter((n=>t?n.left===i:n.right===e)),l=a[0].top,s=a[a.length-1].bottom;return{top:l,bottom:s,left:i,right:e,width:e-i,height:s-l,x:i,y:l}}return y}},floating:i.floating,strategy:s});return a.reference.x!==b.reference.x||a.reference.y!==b.reference.y||a.reference.width!==b.reference.width||a.reference.height!==b.reference.height?{reset:{rects:b}}:{}}}},t.limitShift=function(t){return void 0===t&&(t={}),{options:t,fn(e){const{x:n,y:i,placement:o,rects:r,middlewareData:a}=e,{offset:l=0,mainAxis:s=!0,crossAxis:u=!0}=f(t,e),d={x:n,y:i},p=g(o),h=m(p);let y=d[h],w=d[p];const x=f(l,e),v="number"==typeof x?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(s){const t="y"===h?"height":"width",e=r.reference[h]-r.floating[t]+v.mainAxis,n=r.reference[h]+r.reference[t]-v.mainAxis;y<e?y=e:y>n&&(y=n)}if(u){var b,A;const t="y"===h?"width":"height",e=["top","left"].includes(c(o)),n=r.reference[p]-r.floating[t]+(e&&(null==(b=a.offset)?void 0:b[p])||0)+(e?0:v.crossAxis),i=r.reference[p]+r.reference[t]+(e?0:(null==(A=a.offset)?void 0:A[p])||0)-(e?v.crossAxis:0);w<n?w=n:w>i&&(w=i)}return{[h]:y,[p]:w}}}},t.offset=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,i;const{x:o,y:r,placement:a,middlewareData:l}=e,s=await async function(t,e){const{placement:n,platform:i,elements:o}=t,r=await(null==i.isRTL?void 0:i.isRTL(o.floating)),a=c(n),l=u(n),s="y"===g(n),m=["left","top"].includes(a)?-1:1,d=r&&s?-1:1,p=f(e,t);let{mainAxis:h,crossAxis:y,alignmentAxis:w}="number"==typeof p?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&"number"==typeof w&&(y="end"===l?-1*w:w),s?{x:y*d,y:h*m}:{x:h*m,y:y*d}}(e,t);return a===(null==(n=l.offset)?void 0:n.placement)&&null!=(i=l.arrow)&&i.alignmentOffset?{}:{x:o+s.x,y:r+s.y,data:{...s,placement:a}}}}},t.rectToClientRect=v,t.shift=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:o}=e,{mainAxis:r=!0,crossAxis:a=!1,limiter:l={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...u}=f(t,e),d={x:n,y:i},p=await A(e,u),h=g(c(o)),y=m(h);let w=d[y],x=d[h];if(r){const t="y"===y?"bottom":"right";w=s(w+p["y"===y?"top":"left"],w,w-p[t])}if(a){const t="y"===h?"bottom":"right";
vendor: 9,115 bytes, lines 26-28
26x=s(x+p["y"===h?"top":"left"],x,x-p[t])}const v=l.fn({...e,[y]:w,[h]:x});return{...v,data:{x:v.x-n,y:v.y-i,enabled:{[y]:r,[h]:a}}}}}},t.size=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){var n,i;const{placement:a,rects:l,platform:s,elements:m}=e,{apply:d=()=>{},...p}=f(t,e),h=await A(e,p),y=c(a),w=u(a),x="y"===g(a),{width:v,height:b}=l.floating;let R,P;"top"===y||"bottom"===y?(R=y,P=w===(await(null==s.isRTL?void 0:s.isRTL(m.floating))?"start":"end")?"left":"right"):(P=y,R="end"===w?"top":"bottom");const D=b-h.top-h.bottom,T=v-h.left-h.right,O=o(b-h[R],D),E=o(v-h[P],T),L=!e.middlewareData.shift;let k=O,C=E;if(null!=(n=e.middlewareData.shift)&&n.enabled.x&&(C=T),null!=(i=e.middlewareData.shift)&&i.enabled.y&&(k=D),L&&!w){const t=r(h.left,0),e=r(h.right,0),n=r(h.top,0),i=r(h.bottom,0);x?C=v-2*(0!==t||0!==e?t+e:r(h.left,h.right)):k=b-2*(0!==n||0!==i?n+i:r(h.top,h.bottom))}await d({...e,availableWidth:C,availableHeight:k});const B=await s.getDimensions(m.floating);return v!==B.width||b!==B.height?{reset:{rects:!0}}:{}}}}}));
27;
28!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@floating-ui/core")):"function"==typeof define&&define.amd?define(["exports","@floating-ui/core"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).FloatingUIDOM={},t.FloatingUICore)}(this,(function(t,e){"use strict";const n=Math.min,o=Math.max,i=Math.round,r=Math.floor,c=t=>({x:t,y:t});function l(){return"undefined"!=typeof window}function s(t){return a(t)?(t.nodeName||"").toLowerCase():"#document"}function f(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function u(t){var e;return null==(e=(a(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function a(t){return!!l()&&(t instanceof Node||t instanceof f(t).Node)}function d(t){return!!l()&&(t instanceof Element||t instanceof f(t).Element)}function h(t){return!!l()&&(t instanceof HTMLElement||t instanceof f(t).HTMLElement)}function p(t){return!(!l()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof f(t).ShadowRoot)}function g(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=b(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function m(t){return["table","td","th"].includes(s(t))}function y(t){return[":popover-open",":modal"].some((e=>{try{return t.matches(e)}catch(t){return!1}}))}function w(t){const e=x(),n=d(t)?b(t):t;return["transform","translate","scale","rotate","perspective"].some((t=>!!n[t]&&"none"!==n[t]))||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","translate","scale","rotate","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function x(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function v(t){return["html","body","#document"].includes(s(t))}function b(t){return f(t).getComputedStyle(t)}function T(t){return d(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function L(t){if("html"===s(t))return t;const e=t.assignedSlot||t.parentNode||p(t)&&t.host||u(t);return p(e)?e.host:e}function R(t){const e=L(t);return v(e)?t.ownerDocument?t.ownerDocument.body:t.body:h(e)&&g(e)?e:R(e)}function C(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=R(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),c=f(i);if(r){const t=E(c);return e.concat(c,c.visualViewport||[],g(i)?i:[],t&&n?C(t):[])}return e.concat(i,C(i,[],n))}function E(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function S(t){const e=b(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=h(t),c=r?t.offsetWidth:n,l=r?t.offsetHeight:o,s=i(n)!==c||i(o)!==l;return s&&(n=c,o=l),{width:n,height:o,$:s}}function F(t){return d(t)?t:t.contextElement}function O(t){const e=F(t);if(!h(e))return c(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:l}=S(e);let s=(l?i(n.width):n.width)/o,f=(l?i(n.height):n.height)/r;return s&&Number.isFinite(s)||(s=1),f&&Number.isFinite(f)||(f=1),{x:s,y:f}}const D=c(0);function H(t){const e=f(t);return x()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:D}function P(t,n,o,i){void 0===n&&(n=!1),void 0===o&&(o=!1);const r=t.getBoundingClientRect(),l=F(t);let s=c(1);n&&(i?d(i)&&(s=O(i)):s=O(t));const u=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==f(t))&&e}(l,o,i)?H(l):c(0);let a=(r.left+u.x)/s.x,h=(r.top+u.y)/s.y,p=r.width/s.x,g=r.height/s.y;if(l){const t=f(l),e=i&&d(i)?f(i):i;let n=t,o=E(n);for(;o&&i&&e!==n;){const t=O(o),e=o.getBoundingClientRect(),i=b(o),r=e.left+(o.clientLeft+parseFloat(i.paddingLeft))*t.x,c=e.top+(o.clientTop+parseFloat(i.paddingTop))*t.y;a*=t.x,h*=t.y,p*=t.x,g*=t.y,a+=r,h+=c,n=f(o),o=E(n)}}return e.rectToClientRect({width:p,height:g,x:a,y:h})}function W(t,e){const n=T(t).scrollLeft;return e?e.left+n:P(u(t)).left+n}function M(t,e,n){void 0===n&&(n=!1);const o=t.getBoundingClientRect();return{x:o.left+e.scrollLeft-(n?0:W(t,o)),y:o.top+e.scrollTop}}function z(t,n,i){let r;if("viewport"===n)r=function(t,e){const n=f(t),o=u(t),i=n.visualViewport;let r=o.clientWidth,c=o.clientHeight,l=0,s=0;if(i){r=i.width,c=i.height;const t=x();(!t||t&&"fixed"===e)&&(l=i.offsetLeft,s=i.offsetTop)}return{width:r,height:c,x:l,y:s}}(t,i);else if("document"===n)r=function(t){const e=u(t),n=T(t),i=t.ownerDocument.body,r=o(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),c=o(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let l=-n.scrollLeft+W(t);const s=-n.scrollTop;return"rtl"===b(i).direction&&(l+=o(e.clientWidth,i.clientWidth)-r),{width:r,height:c,x:l,y:s}}(u(t));else if(d(n))r=function(t,e){const n=P(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=h(t)?O(t):c(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(n,i);else{const e=H(t);r={x:n.x-e.x,y:n.y-e.y,width:n.width,height:n.height}}return e.rectToClientRect(r)}function A(t,e){const n=L(t);return!(n===e||!d(n)||v(n))&&("fixed"===b(n).position||A(n,e))}function B(t,e,n){const o=h(e),i=u(e),r="fixed"===n,l=P(t,!0,r,e);let f={scrollLeft:0,scrollTop:0};const a=c(0);function d(){a.x=W(i)}if(o||!o&&!r)if(("body"!==s(e)||g(i))&&(f=T(e)),o){const t=P(e,!0,r,e);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else i&&d();r&&!o&&i&&d();const p=!i||o||r?c(0):M(i,f);return{x:l.left+f.scrollLeft-a.x-p.x,y:l.top+f.scrollTop-a.y-p.y,width:l.width,height:l.height}}function V(t){return"static"===b(t).position}function N(t,e){if(!h(t)||"fixed"===b(t).position)return null;if(e)return e(t);let n=t.offsetParent;return u(t)===n&&(n=n.ownerDocument.body),n}function I(t,e){const n=f(t);if(y(t))return n;if(!h(t)){let e=L(t);for(;e&&!v(e);){if(d(e)&&!V(e))return e;e=L(e)}return n}let o=N(t,e);for(;o&&m(o)&&V(o);)o=N(o,e);return o&&v(o)&&V(o)&&!w(o)?n:o||function(t){let e=L(t);for(;h(e)&&!v(e);){if(w(e))return e;if(y(e))return null;e=L(e)}return null}(t)||n}const k={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r="fixed"===i,l=u(o),f=!!e&&y(e.floating);if(o===l||f&&r)return n;let a={scrollLeft:0,scrollTop:0},d=c(1);const p=c(0),m=h(o);if((m||!m&&!r)&&(("body"!==s(o)||g(l))&&(a=T(o)),h(o))){const t=P(o);d=O(o),p.x=t.x+o.clientLeft,p.y=t.y+o.clientTop}const w=!l||m||r?c(0):M(l,a,!0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-a.scrollLeft*d.x+p.x+w.x,y:n.y*d.y-a.scrollTop*d.y+p.y+w.y}},getDocumentElement:u,getClippingRect:function(t){let{element:e,boundary:i,rootBoundary:r,strategy:c}=t;const l=[..."clippingAncestors"===i?y(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=C(t,[],!1).filter((t=>d(t)&&"body"!==s(t))),i=null;const r="fixed"===b(t).position;let c=r?L(t):t;for(;d(c)&&!v(c);){const e=b(c),n=w(c);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&["absolute","fixed"].includes(i.position)||g(c)&&!n&&A(t,c))?o=o.filter((t=>t!==c)):i=e,c=L(c)}return e.set(t,o),o}(e,this._c):[].concat(i),r],f=l[0],u=l.reduce(((t,i)=>{const r=z(e,i,c);return t.top=o(r.top,t.top),t.right=n(r.right,t.right),t.bottom=n(r.bottom,t.bottom),t.left=o(r.left,t.left),t}),z(e,f,c));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}},getOffsetParent:I,getElementRects:async function(t){const e=this.getOffsetParent||I,n=this.getDimensions,o=await n(t.floating);return{reference:B(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=S(t);return{width:e,height:n}},getScale:O,isElement:d,isRTL:function(t){return"rtl"===b(t).direction}};function q(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}const U=e.detectOverflow,j=e.offset,X=e.autoPlacement,Y=e.shift,$=e.flip,_=e.size,G=e.hide,J=e.arrow,K=e.inline,Q=e.limitShift;
28t.arrow=J,t.autoPlacement=X,t.autoUpdate=function(t,e,i,c){void 0===c&&(c={});const{ancestorScroll:l=!0,ancestorResize:s=!0,elementResize:f="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:d=!1}=c,h=F(t),p=l||s?[...h?C(h):[],...C(e)]:[];p.forEach((t=>{l&&t.addEventListener("scroll",i,{passive:!0}),s&&t.addEventListener("resize",i)}));const g=h&&a?function(t,e){let i,c=null;const l=u(t);function s(){var t;clearTimeout(i),null==(t=c)||t.disconnect(),c=null}return function f(u,a){void 0===u&&(u=!1),void 0===a&&(a=1),s();const d=t.getBoundingClientRect(),{left:h,top:p,width:g,height:m}=d;if(u||e(),!g||!m)return;const y={rootMargin:-r(p)+"px "+-r(l.clientWidth-(h+g))+"px "+-r(l.clientHeight-(p+m))+"px "+-r(h)+"px",threshold:o(0,n(1,a))||1};let w=!0;function x(e){const n=e[0].intersectionRatio;if(n!==a){if(!w)return f();n?f(!1,n):i=setTimeout((()=>{f(!1,1e-7)}),1e3)}1!==n||q(d,t.getBoundingClientRect())||f(),w=!1}try{c=new IntersectionObserver(x,{...y,root:l.ownerDocument})}catch(t){c=new IntersectionObserver(x,y)}c.observe(t)}(!0),s}(h,i):null;let m,y=-1,w=null;f&&(w=new ResizeObserver((t=>{let[n]=t;n&&n.target===h&&w&&(w.unobserve(e),cancelAnimationFrame(y),y=requestAnimationFrame((()=>{var t;null==(t=w)||t.observe(e)}))),i()})),h&&!d&&w.observe(h),w.observe(e));let x=d?P(t):null;return d&&function e(){const n=P(t);x&&!q(x,n)&&i();x=n,m=requestAnimationFrame(e)}(),i(),()=>{var t;p.forEach((t=>{l&&t.removeEventListener("scroll",i),s&&t.removeEventListener("resize",i)})),null==g||g(),null==(t=w)||t.disconnect(),w=null,d&&cancelAnimationFrame(m)}},t.computePosition=(t,n,o)=>{const i=new Map,r={platform:k,...o},c={...r.platform,_c:i};return e.computePosition(t,n,{...r,platform:c})},t.detectOverflow=U,t.flip=$,t.getOverflowAncestors=C,t.hide=G,t.inline=K,t.limitShift=Q,t.offset=j,t.platform=k,t.shift=Y,t.size=_}));
29;
30/* @license GPL-2.0-or-later https://www.drupal.org/licensing/faq */
31(function(Drupal,once){'use strict';Drupal.wizionaryFlag=Drupal.wizionaryFlag||{};const flagUtils=Drupal.wizionaryFlag;let activeOverlayWidget=null;if(typeof flagUtils.setTimeout!=='function')flagUtils.setTimeout=(callback,delay,...args)=>setTimeout(callback,delay,...args);if(typeof flagUtils.clearTimeout!=='function')flagUtils.clearTimeout=(timerId)=>clearTimeout(timerId);class FlagAPI{static #base='/wizionary/flag';static #reactionBase='/api/flag';static #token(){return fetch('/session/token').then((r)=>r.text());}static status(type,id){return fetch(`${this.#base}/${encodeURIComponent(type)}/${id}/status`,{credentials:'same-origin',headers:{Accept:'application/json'}}).then((r)=>r.json());}static toggle(type,id){return this.#token().then((token)=>fetch(`${this.#base}/${encodeURIComponent(type)}/${id}`,{method:'POST',credentials:'same-origin',headers:{'X-CSRF-Token':token,'Content-Type':'application/json',Accept:'application/json'}})).then((r)=>r.json());}static reactionStatus(type,entityType,id){return fetch(`${this.#reactionBase}/${encodeURIComponent(type)}/${encodeURIComponent(entityType)}/${id}`,{credentials:'same-origin',headers:{Accept:'application/json'}}).then((r)=>r.json());}static setReaction(type,entityType,id,packId,iconId){return this.#token().then((token)=>fetch(`${this.#reactionBase}/${encodeURIComponent(type)}/${encodeURIComponent(entityType)}/${id}`,{method:'POST',credentials:'same-origin',headers:{'X-CSRF-Token':token,'Content-Type':'application/json',Accept:'application/json'},body:JSON.stringify({pack_id:packId,icon_id:iconId})})).then((r)=>r.json());}}class FlagWidget{constructor(wrapper){this.wrapper=wrapper;this.flagType=wrapper.dataset.flagType;this.entityId=wrapper.dataset.entityId;this.entityType=wrapper.dataset.entityType||null;this.reactionWidget=wrapper.dataset.flagReactionWidget||'';this.hasReactionField=this.reactionWidget!=='';this.supportsReactions=wrapper.dataset.flagReactions==='1'&&this.reactionWidget==='popup';this.overlay=wrapper.querySelector('[data-flag-overlay]');if(this.overlay)this.overlay.setAttribute('aria-hidden',this.overlay.hidden?'true':'false');this.elIcon=wrapper.querySelector('.wiz-flag__icon');const initialIconHtml=this.elIcon?this.elIcon.innerHTML:'';this.defaultIconHtml=this.elIcon?(this.elIcon.dataset.defaultIcon||initialIconHtml):'';this.defaultReactionHtml=initialIconHtml||this.defaultIconHtml;this.currentReactionKey=null;this.reactionOptions=[];this.hoverTimer=null;this.hideTimer=null;this.isFlagged=false;this.hasInteracted=false;this.floatingCleanup=null;const floating=window.FloatingUIDOM||{};this.computePosition=typeof floating.computePosition==='function'?floating.computePosition:null;this.autoUpdate=typeof floating.autoUpdate==='function'?floating.autoUpdate:null;this.floatingMiddleware=[];
31if(typeof floating.offset==='function')this.floatingMiddleware.push(floating.offset(12));if(typeof floating.flip==='function')this.floatingMiddleware.push(floating.flip({fallbackPlacements:['top','bottom']}));if(typeof floating.shift==='function')this.floatingMiddleware.push(floating.shift({padding:8}));this.handleTriggerEnter=this.handleTriggerEnter.bind(this);this.handleTriggerLeave=this.handleTriggerLeave.bind(this);this.handleOverlayEnter=this.handleOverlayEnter.bind(this);this.handleOverlayLeave=this.handleOverlayLeave.bind(this);this.handleFocusOut=this.handleFocusOut.bind(this);this.onDocumentPointerDown=this.onDocumentPointerDown.bind(this);this.updateOverlayPosition=this.updateOverlayPosition.bind(this);this.wrapper.classList.add('is-loading');this.init();}init(){const loadPromise=this.hasReactionField&&this.entityType?this.refreshReaction():FlagAPI.status(this.flagType,this.entityId).then((json)=>{this.applyFlagState({flagged:Boolean(json.flagged),iconHtml:this.defaultIconHtml});});loadPromise.catch((err)=>{console.error('Could not load flag status',err);}).finally(()=>{this.wrapper.classList.remove('is-loading');this.bindClick();if(this.supportsReactions&&this.overlay)this.bindHover();});}bindClick(){if(this.reactionWidget==='list')return;const handleActivation=(event)=>{if(event.target.closest('[data-flag-overlay]'))return;event.preventDefault();if(this.wrapper.classList.contains('is-working'))return;if(this.supportsReactions&&this.entityType){if(this.isFlagged){this.toggleFlag();return;}if(this.reactionOptions.length){this.selectReaction(this.reactionOptions[0]);return;}}this.toggleFlag();};const trigger=this.wrapper.querySelector('a');if(trigger)trigger.addEventListener('click',(event)=>{handleActivation(event);event.stopImmediatePropagation();},true);this.wrapper.addEventListener('click',(event)=>{if(event.defaultPrevented)return;handleActivation(event);});}toggleFlag(){if(this.wrapper.classList.contains('is-working'))return;this.wrapper.classList.add('is-working');this.hasInteracted=true;this.hideOverlay();FlagAPI.toggle(this.flagType,this.entityId).then((json)=>{const flagged=Boolean(json.flagged);if(this.supportsReactions&&flagged&&this.entityType)return this.refreshReaction();this.applyFlagState({flagged,iconHtml:flagged?(this.defaultReactionHtml||this.defaultIconHtml):this.defaultIconHtml});return null;}).catch((err)=>console.error('Flag toggle failed',err)).finally(()=>this.wrapper.classList.remove('is-working'));}bindHover(){if(!this.overlay)return;this.wrapper.addEventListener('mouseenter',this.handleTriggerEnter);this.wrapper.addEventListener('mouseleave',this.handleTriggerLeave);this.wrapper.addEventListener('focusin',this.handleTriggerEnter);this.wrapper.addEventListener('focusout',this.handleFocusOut);this.overlay.addEventListener('mouseenter',this.handleOverlayEnter);this.overlay.addEventListener('mouseleave',this.handleOverlayLeave);this.overlay.addEventListener('focusin',this.handleOverlayEnter);this.overlay.addEventListener('focusout',this.handleFocusOut);}showOverlay(){if(!this.overlay||!this.reactionOptions.length)return;this.clearHoverTimer();this.clearHideTimer();if(activeOverlayWidget&&activeOverlayWidget!==this)activeOverlayWidget.hideOverlay();if(this.isOverlayVisible()){this.updateOverlayPosition();activeOverlayWidget=this;return;}this.overlay.hidden=false;this.overlay.setAttribute('aria-hidden','false');this.wrapper.classList.add('is-overlay-visible');activeOverlayWidget=this;this.updateOverlayPosition();if(this.autoUpdate&&this.computePosition)this.floatingCleanup=this.autoUpdate(this.elIcon||this.wrapper,this.overlay,this.updateOverlayPosition);document.addEventListener('pointerdown',this.onDocumentPointerDown,true);}hideOverlay(){this.clearHoverTimer();this.clearHideTimer();if(!this.overlay)return;this.floatingCleanup?.();this.floatingCleanup=null;this.overlay.hidden=true;this.overlay.setAttribute('aria-hidden','true');this.wrapper.classList.remove('is-overlay-visible');this.overlay.style.removeProperty('left');this.overlay.style.removeProperty('top');this.overlay.style.removeProperty('right');this.overlay.style.removeProperty('bottom');this.overlay.style.removeProperty('--flag-overlay-translate-x');document.removeEventListener('pointerdown',this.onDocumentPointerDown,true);if(activeOverlayWidget===this)activeOverlayWidget=null;}clearHoverTimer(){if(this.hoverTimer){flagUtils.clearTimeout(this.hoverTimer);this.hoverTimer=null;}}clearHideTimer(){if(this.hideTimer){flagUtils.clearTimeout(this.hideTimer);this.hideTimer=null;}}scheduleShow(){this.clearHoverTimer();this.hoverTimer=flagUtils.setTimeout(()=>this.showOverlay(),600);}scheduleHide(){this.clearHideTimer();this.hideTimer=flagUtils.setTimeout(()=>{if(!this.isPointerWithinOverlay())this.hideOverlay();},700);}isOverlayVisible(){return this.wrapper.classList.contains('is-overlay-visible');}isPointerWithinOverlay(){if(!this.overlay)return false;const pointerActive=this.wrapper.matches(':hover')||this.overlay.matches(':hover');const focusActive=this.wrapper.matches(':focus-within')||this.overlay.matches(':focus-within');return pointerActive||focusActive;}handleTriggerEnter(){this.clearHideTimer();if(!this.isOverlayVisible())this.scheduleShow();}handleTriggerLeave(event){const nextTarget=event?.relatedTarget;if(nextTarget&&(this.wrapper.contains(nextTarget)||this.overlay.contains(nextTarget)))return;this.scheduleHide();}handleOverlayEnter(){this.clearHideTimer();}handleOverlayLeave(event){const nextTarget=event?.relatedTarget;if(nextTarget&&(this.overlay.contains(nextTarget)||this.wrapper.contains(nextTarget)))return;this.scheduleHide();}handleFocusOut(event){const nextTarget=event.relatedTarget;if(!nextTarget||(!this.wrapper.contains(nextTarget)&&!this.overlay.contains(nextTarget)))this.scheduleHide();}onDocumentPointerDown(event){if(!this.wrapper.contains(event.target)&&!this.overlay.contains(event.target))this.hideOverlay();}updateOverlayPosition(){if(!this.overlay||!this.computePosition)return;const reference=this.elIcon||this.wrapper;this.computePosition(reference,this.overlay,{placement:'top',middleware:this.floatingMiddleware}).then(({x,y})=>{Object.assign(this.overlay.style,{left:`${x}px`,top:`${y}px`,bottom:'auto',right:'auto',position:'absolute'});this.overlay.style.setProperty('--flag-overlay-translate-x','0');}).catch((err)=>{console.debug('Unable to position flag overlay',err);});}refreshReaction(){if(!this.entityType||!this.hasReactionField)return Promise.resolve();return FlagAPI.reactionStatus(this.flagType,this.entityType,this.entity
31Id).then((json)=>{this.reactionOptions=Array.isArray(json.options)?json.options:[];this.defaultReactionHtml=json.default?.html||this.defaultReactionHtml||this.defaultIconHtml;if(json.reaction&&json.reaction.pack_id&&json.reaction.icon_id)this.currentReactionKey=`${json.reaction.pack_id}:${json.reaction.icon_id}`;else this.currentReactionKey=null;const iconHtml=json.reaction_html||(json.flagged?(this.defaultReactionHtml||this.defaultIconHtml):this.defaultIconHtml);this.applyFlagState({flagged:Boolean(json.flagged),iconHtml});this.populateOverlay();return json;});}populateOverlay(){if(!this.overlay)return;this.overlay.innerHTML='';this.reactionOptions.forEach((option)=>{const key=`${option.pack_id}:${option.icon_id}`;const button=document.createElement('button');button.type='button';button.className='wiz-flag__reaction';const iconWrapper=document.createElement('span');iconWrapper.className='wiz-flag__reaction-icon';if(typeof option.html==='string')iconWrapper.innerHTML=option.html;button.appendChild(iconWrapper);if(key===this.currentReactionKey)button.classList.add('is-active');button.addEventListener('click',(event)=>{event.preventDefault();event.stopPropagation();this.selectReaction(option);});this.overlay.appendChild(button);});}selectReaction(option){if(!this.supportsReactions||!this.entityType)return;if(this.wrapper.classList.contains('is-working'))return;this.wrapper.classList.add('is-working');this.hasInteracted=true;FlagAPI.setReaction(this.flagType,this.entityType,this.entityId,option.pack_id,option.icon_id).then((json)=>{if(json.reaction&&json.reaction.pack_id&&json.reaction.icon_id)this.currentReactionKey=`${json.reaction.pack_id}:${json.reaction.icon_id}`;else this.currentReactionKey=null;const iconHtml=json.reaction_html||(json.flagged?(this.defaultReactionHtml||this.defaultIconHtml):this.defaultIconHtml);this.applyFlagState({flagged:Boolean(json.flagged),iconHtml});if(Array.isArray(json.options))this.reactionOptions=json.options;this.populateOverlay();}).catch((err)=>console.error('Unable to save reaction',err)).finally(()=>{this.wrapper.classList.remove('is-working');this.hideOverlay();});}applyFlagState({flagged,iconHtml}){this.wrapper.classList.toggle('is-flagged',flagged);this.isFlagged=flagged;if(this.elIcon&&typeof iconHtml==='string')this.elIcon.innerHTML=iconHtml;if(!this.hasInteracted||!this.elIcon)return;if(flagged){this.elIcon.classList.remove('shake');this.elIcon.classList.add('boom');flagUtils.setTimeout(()=>this.elIcon.classList.remove('boom'),600);}else{this.elIcon.classList.add('shake');flagUtils.setTimeout(()=>this.elIcon.classList.remove('shake'),500);}}}Drupal.behaviors.wizionaryFlag={attach(context){once('wizionaryFlag','[data-flag-type][data-entity-id]',context).forEach((el)=>new FlagWidget(el));}};})(Drupal,once);;
32!function(e,t){e.behaviors.initializeVideoJS={attach:function(i,s){t("videojs","video.video-js",i).forEach(function(t){var i,s;window.VIDEOJS_NO_DYNAMIC_STYLE=!0,i=this,s=function(){"use strict";var t="8.6.1";let i={},s=function(e,t){return i[e]=i[e]||[],t&&(i[e]=i[e].concat(t)),i[e];};function r(e,t){return !((t=s(e).indexOf(t))<=-1||(i[e]=i[e].slice(),i[e].splice(t,1),0));}let n={prefixed:!0};var a=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],o=a[0];let l;for(let h=0;h<a.length;h++)if(a[h][1] in document){l=a[h];break;}if(l){for(let d=0;d<l.length;d++)n[o[d]]=l[d];n.prefixed=l[0]!==o[0];}let u=[];function c(e){return v(e)?Object.keys(e):[];}let p=function e(t,i=":",s=""){var r,n,a;let o="info",l;function h(...e){l("log",o,e);}return l=(r=t,n=h,a=s,(e,t,i)=>{var s,t=n.levels[t],o=RegExp(`^(${t})$`);let l=r;if("log"!==e&&i.unshift(e.toUpperCase()+":"),a&&(l="%c"+r,i.unshift(a)),i.unshift(l+":"),u&&(u.push([].concat(i)),s=u.length-1e3,u.splice(0,0<s?s:0)),window.console){let h=window.console[e];(h=h||"debug"!==e?h:window.console.info||window.console.log)&&t&&o.test(e)&&h[Array.isArray(i)?"apply":"call"](window.console,i);}}),h.createLogger=(r,n,a)=>e(t+` ${n=void 0!==n?n:i} `+r,n,void 0!==a?a:s),h.createNewLogger=(t,i,s)=>e(t,i,s),h.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:o},h.level=(e)=>{if("string"==typeof e){if(!h.levels.hasOwnProperty(e))throw Error(`"${e}" in not a valid log level`);o=e;}return o;},h.history=()=>u?[].concat(u):[],h.history.filter=(e)=>(u||[]).filter((t)=>RegExp(`.*${e}.*`).test(t[0])),h.history.clear=()=>{u&&(u.length=0);},h.history.disable=()=>{null!==u&&(u.length=0,u=null);},h.history.enable=()=>{null===u&&(u=[]);},h.error=(...e)=>l("error",o,e),h.warn=(...e)=>l("warn",o,e),h.debug=(...e)=>l("debug",o,e),h;}("VIDEOJS"),m=p.createLogger,g=Object.prototype.toString;function f(e,t){c(e).forEach((i)=>t(e[i],i));}function y(e,t,i=0){return c(e).reduce((i,s)=>t(i,e[s],s),i);}function v(e){return !!e&&"object"==typeof e;}function $(e){return v(e)&&"[object Object]"===g.call(e)&&e.constructor===Object;}function _(...e){let t={};return e.forEach((e)=>{e&&f(e,(e,i)=>{$(e)?($(t[i])||(t[i]={}),t[i]=_(t[i],e)):t[i]=e;});}),t;}function b(e={}){var t,i=[];for(let s in e)e.hasOwnProperty(s)&&(t=e[s],i.push(t));return i;}function T(e,t,i,s=!0){let r=(i)=>Object.defineProperty(e,t,{value:i,enumerable:!0,writable:!0});var n={configurable:!0,enumerable:!0,get(){var e=i();return r(e),e;}};return s&&(n.set=r),Object.defineProperty(e,t,n);}var S=Object.freeze({__proto__:null,each:f,reduce:y,isObject:v,isPlain:$,merge:_,values:b,defineLazyProperty:T});let E=!1,k=null,w=!1,C,x=!1,I=!1,L=!1,D=!1,A=null,P=null,O=null,R=!1,N=!1,M=!1,U=!1,B=Boolean(G()&&("ontouchstart" in window||window.navigator.maxTouchPoints||window.DocumentTouch&&window.document instanceof window.DocumentTouch));var F,q=window.navigator&&window.navigator.userAgentData;if(q&&(w="Android"===q.platform,I=Boolean(q.brands.find((e)=>"Microsoft Edge"===e.brand)),L=Boolean(q.brands.find((e)=>"Chromium"===e.brand)),D=!I&&L,A=P=(q.brands.find((e)=>"Chromium"===e.brand)||{}).version||null,N="Windows"===q.platform),!L){let j=window.navigator&&window.navigator.userAgent||"",H;E=/iPod/i.test(j),k=(q=j.match(/OS (\d+)_/i))&&q[1]?q[1]:null,w=/Android/i.test(j),C=(q=j.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i))?(e7=q[1]&&parseFloat(q[1]),F=q[2]&&parseFloat(q[2]),e7&&F?parseFloat(q[1]+"."+q[2]):e7||null):null,x=/Firefox/i.test(j),I=/Edg/i.test(j),L=/Chrome/i.test(j)||/CriOS/i.test(j),D=!I&&L,A=P=(F=j.match(/(Chrome|CriOS)\/(\d+)/))&&F[2]?parseFloat(F[2]):null,O=!(H=(sx=/MSIE\s(\d+)\.\d/.exec(j))&&parseFloat(sx[1]))&&/Trident\/7.0/i.test(j)&&/rv:11.0/.test(j)?11:H,R=/Safari/i.test(j)&&!D&&!w&&!I,N=/Windows/i.test(j),M=/iPad/i.test(j)||R&&B&&!/iPhone/i.test(j),U=/iPhone/i.test(j)&&!M;}let V=U||M||E,z=(R||V)&&!D;function W(e){return "string"==typeof e&&Boolean(e.trim());}function G(){return document===window.document;}function X(e){return v(e)&&1===e.nodeType;}function K(){try{return window.parent!==window.self;}catch(e){return !0;}}function Y(e){return function(t,i){return W(t)?(i=X(i=W(i)?document.querySelector(i):i)?i:document)[e]&&i[e](t):document[e](null);};}function Q(e="div",t={},i={},s){let r=document.createElement(e);return Object.getOwnPropertyNames(t).forEach(function(e){var i=t[e];"textContent"===e?J(r,i):r[e]===i&&"tabIndex"!==e||(r[e]=i);}
32),Object.getOwnPropertyNames(i).forEach(function(e){r.setAttribute(e,i[e]);}),s&&ey(r,s),r;}function J(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e;}function Z(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e);}function ee(e,t){if(0<=t.indexOf(" "))throw Error("class has illegal whitespace characters");return e.classList.contains(t);}function et(e,...t){return e.classList.add(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[])),e;}function ei(e,...t){return e?(e.classList.remove(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[])),e):(p.warn("removeClass was called with an element that doesn't exist"),null);}function es(e,t,i){return "boolean"!=typeof (i="function"==typeof i?i(e,t):i)&&(i=void 0),t.split(/\s+/).forEach((t)=>e.classList.toggle(t,i)),e;}function er(e,t){Object.getOwnPropertyNames(t).forEach(function(i){var s=t[i];null==s||!1===s?e.removeAttribute(i):e.setAttribute(i,!0===s?"":s);});}function en(e){var t={},i=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(e&&e.attributes&&0<e.attributes.length){var s=e.attributes;for(let r=s.length-1;0<=r;r--){var n=s[r].name;let a=s[r].value;i.includes(n)&&(a=null!==a),t[n]=a;}}return t;}function ea(e,t){return e.getAttribute(t);}function eo(e,t,i){e.setAttribute(t,i);}function el(e,t){e.removeAttribute(t);}function eh(){document.body.focus(),document.onselectstart=function(){return !1;};}function ed(){document.onselectstart=function(){return !0;};}function eu(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(eb(e,"height"))),i.width||(i.width=parseFloat(eb(e,"width"))),i;}}function ec(e){if(!e||!e.offsetParent)return {left:0,top:0,width:0,height:0};var t=e.offsetWidth,i=e.offsetHeight;let s=0,r=0;for(;e.offsetParent&&e!==document[n.fullscreenElement];)s+=e.offsetLeft,r+=e.offsetTop,e=e.offsetParent;return {left:s,top:r,width:t,height:i};}function ep(e,t){var i={x:0,y:0};if(V){let s=e;for(;s&&"html"!==s.nodeName.toLowerCase();){var r,n=eb(s,"transform");
32/^matrix/.test(n)?(r=n.slice(7,-1).split(/,\s/).map(Number),i.x+=r[4],i.y+=r[5]):/^matrix3d/.test(n)&&(r=n.slice(9,-1).split(/,\s/).map(Number),i.x+=r[12],i.y+=r[13]),s=s.parentNode;}}var a={},o=ec(t.target),e=ec(e),l=e.width,h=e.height;let d=t.offsetY-(e.top-o.top),u=t.offsetX-(e.left-o.left);return t.changedTouches&&(u=t.changedTouches[0].pageX-e.left,d=t.changedTouches[0].pageY+e.top,V)&&(u-=i.x,d-=i.y),a.y=1-Math.max(0,Math.min(1,d/h)),a.x=Math.max(0,Math.min(1,u/l)),a;}function em(e){return v(e)&&3===e.nodeType;}function eg(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e;}function ef(e){return "function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map((e)=>X(e="function"==typeof e?e():e)||em(e)?e:"string"==typeof e&&/\S/.test(e)?document.createTextNode(e):void 0).filter((e)=>e);}function ey(e,t){return ef(t).forEach((t)=>e.appendChild(t)),e;}function e8(e,t){return ey(eg(e),t);}function ev(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||0===e.button&&1===e.buttons;}q=Object.freeze({__proto__:null,get IS_IPOD(){return E;},get IOS_VERSION(){return k;},get IS_ANDROID(){return w;},get ANDROID_VERSION(){return C;},get IS_FIREFOX(){return x;},get IS_EDGE(){return I;},get IS_CHROMIUM(){return L;},get IS_CHROME(){return D;},get CHROMIUM_VERSION(){return A;},get CHROME_VERSION(){return P;},get IE_VERSION(){return O;},get IS_SAFARI(){return R;},get IS_WINDOWS(){return N;},get IS_IPAD(){return M;},get IS_IPHONE(){return U;},TOUCH_ENABLED:B,IS_IOS:V,IS_ANY_SAFARI:z});let e$=Y("querySelector"),e_=Y("querySelectorAll");function eb(e,t){if(!e||!t||"function"!=typeof window.getComputedStyle)return "";let i;try{i=window.getComputedStyle(e);}catch(s){return "";}return i?i.getPropertyValue(t)||i[t]:"";;}function eT(e){[...document.styleSheets].forEach((t)=>{try{var i=[...t.cssRules].map((e)=>e.cssText).join(""),s=document.createElement("style");s.textContent=i,e.document.head.appendChild(s);}catch(r){(i=document.createElement("link")).rel="stylesheet",i.type=t.type,i.media=t.media.mediaText,i.href=t.href,e.document.head.appendChild(i);}});}var eS=Object.freeze({__proto__:null,isReal:G,isEl:X,isInFrame:K,createEl:Q,textContent:J,prependTo:Z,hasClass:ee,addClass:et,removeClass:ei,toggleClass:es,setAttributes:er,getAttributes:en,getAttribute:ea,setAttribute:eo,removeAttribute:el,blockTextSelection:eh,unblockTextSelection:ed,getBoundingClientRect:eu,findPosition:ec,getPointerPosition:ep,isTextNode:em,emptyEl:eg,normalizeContent:ef,appendContent:ey,insertContent:e8,isSingleLeftClick:ev,$:e$,$$:e_,computedStyle:eb,copyStyleSheetsToWindow:eT});let e0=!1,eE;function ek(){if(!1!==eE.options.autoSetup){var e=Array.prototype.slice.call(document.getElementsByTagName("video")),t=Array.prototype.slice.call(document.getElementsByTagName("audio")),i=Array.prototype.slice.call(document.getElementsByTagName("video-js")),s=e.concat(t,i);if(s&&0<s.length){for(let r=0,n=s.length;r<n;r++){var a=s[r];if(!a||!a.getAttribute){ew(1);break;}void 0===a.player&&null!==a.getAttribute("data-setup")&&eE(a);}}else e0||ew(1);}}function ew(e,t){G()&&(t&&(eE=t),window.setTimeout(ek,e));}function eC(){e0=!0,window.removeEventListener("load",eC);}function ex(e){var t=document.createElement("style");return t.className=e,t;}function e2(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t;}G()&&("complete"===document.readyState?eC():window.addEventListener("load",eC));var eI=new WeakMap();let eL=3;function eD(e,t){var i;eI.has(e)&&(0===(i=eI.get(e)).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)&&eI.delete(e);}function eA(e,t,i,s){i.forEach(function(i){e(t,i,s);});}function eP(e){if(!e.fixed_){if(!e||!e.isPropagationStopped||!e.isImmediatePropagationStopped){var t,i;let s=e||window.event;for(let r in e={},s)"layerX"===r||"layerY"===r||"keyLocation"===r||"webkitMovementX"===r||"webkitMovementY"===r||"path"===r||"returnValue"===r&&s.preventDefault||(e[r]=s[r]);e.target||(e.target=e.srcElement||document),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){s.preventDefault&&s.preventDefault(),e.returnValue=!1,s.returnValue=!1,e.defaultPrevented=!0;},e.defaultPrevented=!1,e.stopPropagation=function(){s.stopPropagation&&s.stopPropagation(),e.cancelBubble=!0,s.cancelBubble=!0,e.isPropagationStopped=n;},e.isPropagationStopped=a,e.stopImmediatePropagation=function(){s.stopImmediatePropagation&&s.stopImmediatePropagation(),e.isImmediatePropagationStopped=n,e.stopPropagation();},e.isImmediatePropagationStopped=a,null!==e.clientX&&void 0!==e.clientX&&(t=document.documentElement,i=document.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);}e.fixed_=!0;}return e;function n(){return !0;}function a(){return !1;}}let e3,e6=["touchstart","touchmove"];function e1(e,t,i){if(Array.isArray(t))return eA(e1,e,t,i);eI.has(e)||eI.set(e,{});let s=eI.get(e);if(s.handlers||(s.handlers={}),s.handlers[t]||(s.handlers[t]=[]),i.guid||(i.guid=eL++),s.handlers[t].push(i),s.dispatcher||(s.disabled=!1,s.dispatcher=function(t,i){if(!s.disabled){t=eP(t);var r=s.handlers[t.type];if(r){var n=r.slice(0);for(let a=0,o=n.length;a<o&&!t.isImmediatePropagationStopped();a++)try{n[a].call(e,t,i);}catch(l){p.error(l);}}}}),1===s.handlers[t].length)if(e.addEventListener){let r=!1;(function(){if("boolean"!=typeof e3){e3=!1;try{var e=Object.defineProperty({},"passive",{get(){e3=!0;}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e);}catch(t){}}return e3;})()&&-1<e6.indexOf(t)&&(r={passive:!0}),e.addEventListener(t,s.dispatcher,r);}else e.attachEvent&&e.attachEvent("on"+t,s.dispatcher);}function e4(e,t,i){if(eI.has(e)){let s=eI.get(e);if(s.handlers){if(Array.isArray(t))return eA(e4,e,t,i);var r=function(e,t){s.handlers[t]=[],eD(e,t);};if(void 0===t){for(let n in s.handlers)Object.prototype.hasOwnProperty.call(s.handlers||{},n)&&r(e,n);}else{var a=s.handlers[t];if(a)if(i){if(i.guid){for(let o=0;o<a.length;o++)a[o].guid===i.guid&&a.splice(o--,1);}eD(e,t);}else r(e,t);}}}}function eO(e,t,i){var s=eI.has(e)?eI.get(e):{},r=e.parentNode||e.ownerDocument;return "string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=eP(t),s.dispatcher&&s.dispatcher.call(e,t,i),r&&!t.isPropagationStopped()&&!0===t.bubbles?eO.call(null,r,t,i):!r&&!t.defaultPrevented&&t.target&&t.target[t.type]&&(eI.has(t.target)||eI.set(t.target,{}),s=eI.get(t.target),t.target[t.type])&&(s.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),s.disabled=!1),!t.defaultPrevented;}function eR(e,t,i){if(Array.isArray(t))return eA(eR,e,t,i);function s(){e4(e,t,s),i.apply(this,arguments);}s.guid=i.guid=i.guid||eL++,e1(e,t,s);}function eN(e,t,i){function s(){e4(e,t,s),i.apply(this,arguments);}s.guid=i.guid=i.guid||eL++,e1(e,t,s);}var eM=Object.freeze({__proto__:null,fixEvent:eP,on:e1,off:e4,trigger:eO,one:eR,any:eN});function eU(e,t,i){return t.guid||(t.guid=eL++),(e=t.bind(e)).guid=i?i+"_"+t.guid:t.guid,e;}function e5(e,t){let i=window.performance.now();return function(...s){var r=window.performance.now();r-i>=t&&(e(...s),i=r);};}function eB(e,t,i,s=window){let r;function n(){let n=this,a=arguments,o=function(){r=null,o=null,i||e.apply(n,a);};!r&&i&&e.apply(n,a),s.clearTimeout(r),r=s.setTimeout(o,t);}return n.cancel=()=>{s.clearTimeout(r),r=null;},n;}var e7=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:30,bind_:eU,throttle:e5,debounce:eB});let eF;class eq{on(e,t){var i=this.addEventListener;this.addEventListener=()=>{},e1(this,e,t),this.addEventListener=i;}off(e,t){e4(this,e,t);}one(e,t){var i=this.addEventListener;this.addEventListener=()=>{},eR(this,e,t),this.addEventListener=i;}any(e,t){var i=this.addEventListener;this.addEventListener=()=>{},eN(this,e,t),this.addEventListener=i;}trigger(e){var t=e.type||e;e=eP(e="string"==typeof e?{type:t}:e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),eO(this,e);}queueTrigger(e){eF=eF||new Map();let t=e.type||e,i=eF.get(this);i||(i=new Map(),eF.set(this,i));var s=i.get(t),s=(i.delete(t),window.clearTimeout(s),window.setTimeout(()=>{i.delete(t),0===i.size&&(i=null,eF.delete(this)),this.trigger(e);},0));i.set(t,s);}}eq.prototype.allowedEvents_={},eq.prototype.addEventListener=eq.prototype.on,eq.prototype.removeEventListener=eq.prototype.off,eq.prototype.dispatchEvent=eq.prototype.trigger;let ej=(e)=>"function"==typeof e.name?e.name():"string"==typeof e.name?e.name:e.name_||(e.constructor&&e.constructor.name?e.constructor.name:typeof e),eH=(e)=>e instanceof eq||!!e.eventBusEl_&&["on","one","off","trigger"].every((t)=>"function"==typeof e[t]),eV=(e)=>"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length,e9=(e,t,i)=>{if(!e||!e.nodeName&&!eH(e))throw Error(`Invalid target for ${ej(t)}#${i}; must be a DOM node or evented object.`);},ez=(e,t,i)=>{if(!eV(e))throw Error(`Invalid event type for ${ej(t)}#${i}; must be a non-empty string or array.`);},eW=(e,t,i)=>{if("function"!=typeof e)throw Error(`Invalid listener for ${ej(t)}#${i}; must be a function.`);},eG=(e,t,i)=>{var s=t.length<3||t[0]===e||t[0]===e.eventBusEl_;let r,n,a;return s?(r=e.eventBusEl_,3<=t.length&&t.shift(),[n,a]=t):[r,n,a]=t,e9(r,e,i),ez(n,e,i),eW(a,e,i),a=eU(e,a),{isTargetingSelf:s,target:r,type:n,listener:a};},eX=(e,t,i,s)=>{e9(e,e,t),e.nodeName?eM[t](e,i,s):e[t](i,s);},eK={on(...e){let {isTargetingSelf:t,target:i,type:s,listener:r}=eG(this,e,"on");
32if(eX(i,"on",s,r),!t){let n=()=>this.off(i,s,r);n.guid=r.guid,(e=()=>this.off("dispose",n)).guid=r.guid,eX(this,"on","dispose",n),eX(i,"on","dispose",e);}},one(...e){let {isTargetingSelf:t,target:i,type:s,listener:r}=eG(this,e,"one");if(t)eX(i,"one",s,r);else{let n=(...e)=>{this.off(i,s,n),r.apply(null,e);};n.guid=r.guid,eX(i,"one",s,n);}},any(...e){let {isTargetingSelf:t,target:i,type:s,listener:r}=eG(this,e,"any");if(t)eX(i,"any",s,r);else{let n=(...e)=>{this.off(i,s,n),r.apply(null,e);};n.guid=r.guid,eX(i,"any",s,n);}},off(e,t,i){!e||eV(e)?e4(this.eventBusEl_,e,t):(e9(e,this,"off"),ez(t,this,"off"),eW(i,this,"off"),i=eU(this,i),this.off("dispose",i),e.nodeName?(e4(e,t,i),e4(e,"dispose",i)):eH(e)&&(e.off(t,i),e.off("dispose",i)));},trigger(e,t){if(e9(this.eventBusEl_,this,"trigger"),eV(e&&"string"!=typeof e?e.type:e))return eO(this.eventBusEl_,e,t);throw Error(`Invalid event type for ${ej(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);}};function eY(e,t={}){if(t=t.eventBusKey){if(!e[t].nodeName)throw Error(`The eventBusKey "${t}" does not refer to an element.`);e.eventBusEl_=e[t];}else e.eventBusEl_=Q("span",{className:"vjs-event-bus"});Object.assign(e,eK),e.eventedCallbacks&&e.eventedCallbacks.forEach((e)=>{e();}),e.on("dispose",()=>{e.off(),[e,e.el_,e.eventBusEl_].forEach(function(e){e&&eI.has(e)&&eI.delete(e);}),window.setTimeout(()=>{e.eventBusEl_=null;},0);});}let eQ={state:{},setState(e){"function"==typeof e&&(e=e());let t;return f(e,(e,i)=>{this.state[i]!==e&&((t=t||{})[i]={from:this.state[i],to:e}),this.state[i]=e;}),t&&eH(this)&&this.trigger({changes:t,type:"statechanged"}),t;}};function eJ(e,t){Object.assign(e,eQ),e.state=Object.assign({},e.state,t),"function"==typeof e.handleStateChanged&&eH(e)&&e.on("statechanged",e.handleStateChanged);}function eZ(e){return "string"!=typeof e?e:e.replace(/./,(e)=>e.toLowerCase());}function te(e){return "string"!=typeof e?e:e.replace(/./,(e)=>e.toUpperCase());}function tt(e,t){return te(e)===te(t);}var ti=Object.freeze({__proto__:null,toLowerCase:eZ,toTitleCase:te,titleCaseEquals:tt}),ts="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function tr(e,t){return e(t={exports:{}},t.exports),t.exports;}var tn=tr(function(e,t){function i(e){var t;return "number"==typeof (e=e&&"object"==typeof e&&(t=e.which||e.keyCode||e.charCode)?t:e)?o[e]:s[(t=String(e)).toLowerCase()]||r[t.toLowerCase()]||(1===t.length?t.charCodeAt(0):void 0);}i.isEventKey=function(e,t){if(e&&"object"==typeof e){if(null!=(e=e.which||e.keyCode||e.charCode))if("string"==typeof t){var i=s[t.toLowerCase()];if(i||(i=r[t.toLowerCase()]))return i===e;}else{if("number"==typeof t)return t===e;}return !1;}};for(var s=(t=e.exports=i).code=t.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},r=t.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91},n=97;n<123;n++)s[String.fromCharCode(n)]=n-32;for(var n=48;n<58;n++)s[n-48]=n;for(n=1;n<13;n++)s["f"+n]=n+111;for(n=0;n<10;n++)s["numpad "+n]=n+96;var a,o=t.names=t.title={};for(n in s)o[s[n]]=n;for(a in r)s[a]=r[a];});tn.code,tn.codes,tn.aliases,tn.names,tn.title;class ta{constructor(e,t,i){!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=_({},this.options_),t=this.options_=_(this.options_,t),this.id_=t.id||t.el&&t.el.id,this.id_||(e=e&&e.id&&e.id()||"no_player",this.id_=e+"_component_"+eL++),this.name_=t.name||null,t.el?this.el_=t.el:!1!==t.createEl&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach((e)=>this.addClass(e)),["on","off","one","any","trigger"].forEach((e)=>{this[e]=void 0;}),!1!==t.evented&&(eY(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),eJ(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)!==t.initChildren&&this.initChildren(),this.ready(i),!1!==t.reportTouchActivity&&this.enableTouchActivity();}on(e,t){}off(e,t){}one(e,t){}any(e,t){}trigger(e,t){}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 t=this.children_.length-1;0<=t;t--)this.children_[t].dispose&&this.children_[t].dispose();}this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null;}}isDisposed(){return Boolean(this.isDisposed_);}player(){return this.player_;}options(e){return e&&(this.options_=_(this.options_,e)),this.options_;}el(){return this.el_;}createEl(e,t,i){return Q(e,t,i);}localize(e,t,i=e){var s=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),n=r&&r[s],s=s&&s.split("-")[0],r=r&&r[s];let a=i;return n&&n[e]?a=n[e]:r&&r[e]&&(a=r[e]),a=t?a.replace(/\{(\d+)\}/g,function(e,i){return void 0===(i=t[i-1])?e:i;}):a;}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)=>
32e.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()){var i,s,r;if(this.player_.options_.experimentalSvgIcons)return r="http://www.w3.org/2000/svg",i=Q("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),(s=document.createElementNS(r,"svg")).setAttributeNS(null,"viewBox","0 0 512 512"),r=document.createElementNS(r,"use"),s.appendChild(r),r.setAttributeNS(null,"href","#vjs-icon-"+e),i.appendChild(s),this.iconIsSet_?t.replaceChild(i,t.querySelector(".vjs-icon-placeholder")):t.appendChild(i),this.iconIsSet_=!0,i;}addChild(e,t={},i=this.children_.length){let s,r;if("string"==typeof e){r=te(e);var n=t.componentClass||r,a=(t.name=r,ta.getComponent(n));if(!a)throw Error(`Component ${n} does not exist`);if("function"!=typeof a)return null;s=new a(this.player_||this,t);}else s=e;if(s.parentComponent_&&s.parentComponent_.removeChild(s),this.children_.splice(i,0,s),s.parentComponent_=this,"function"==typeof s.id&&(this.childIndex_[s.id()]=s),(r=r||s.name&&te(s.name()))&&(this.childNameIndex_[r]=s,this.childNameIndex_[eZ(r)]=s),"function"==typeof s.el&&s.el()){let o=null;this.children_[i+1]&&(this.children_[i+1].el_?o=this.children_[i+1].el_:X(this.children_[i+1])&&(o=this.children_[i+1])),this.contentEl().insertBefore(s.el(),o);}return s;}removeChild(e){if((e="string"==typeof e?this.getChild(e):e)&&this.children_){var t;let i=!1;for(let s=this.children_.length-1;0<=s;s--)if(this.children_[s]===e){i=!0,this.children_.splice(s,1);break;}i&&(e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[te(e.name())]=null,this.childNameIndex_[eZ(e.name())]=null,t=e.el())&&t.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el());}}initChildren(){let e=this.options_.children;if(e){let t=this.options_,i,s=ta.getComponent("Tech");(i=Array.isArray(e)?e:Object.keys(e)).concat(Object.keys(this.options_).filter(function(e){return !i.some(function(t){return "string"==typeof t?e===t:e===t.name;});})).map((t)=>{let i,s;return s="string"==typeof t?e[i=t]||this.options_[i]||{}:(i=t.name,t),{name:i,opts:s};}).filter((e)=>(e=ta.getComponent(e.opts.componentClass||te(e.name)))&&!s.isTech(e)).forEach((e)=>{var i=e.name;let s=e.opts;!1!==(s=void 0!==t[i]?t[i]:s)&&((s=!0===s?{}:s).playerOptions=this.options_.playerOptions,e=this.addChild(i,s))&&(this[i]=e);});}}buildCSSClass(){return "";}ready(e,t=!1){e&&(this.isReady_?t?e.call(this):this.setTimeout(e,1):(this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(e)));}triggerReady(){this.isReady_=!0,this.setTimeout(function(){var e=this.readyQueue_;this.readyQueue_=[],e&&0<e.length&&e.forEach(function(e){e.call(this);},this),this.trigger("ready");},1);}$(e,t){return e$(e,t||this.contentEl());}$$(e,t){return e_(e,t||this.contentEl());}hasClass(e){return ee(this.el_,e);}addClass(...e){et(this.el_,...e);}removeClass(...e){ei(this.el_,...e);}toggleClass(e,t){es(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 ea(this.el_,e);}setAttribute(e,t){eo(this.el_,e,t);}removeAttribute(e){el(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){var s,r;if(void 0===t)return this.el_?-1!==(r=(s=this.el_.style[e]).indexOf("px"))?parseInt(s.slice(0,r),10):parseInt(this.el_["offset"+te(e)],10):0;-1!==(""+(t=null!==t&&t==t?t:0)).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",i||this.trigger("componentresize");}currentDimension(e){let t=0;if("width"!==e&&"height"!==e)throw Error("currentDimension only accepts width or height value");return t=eb(this.el_,e),(0===(t=parseFloat(t))||isNaN(t))&&(e="offset"+te(e),t=this.el_[e]),t;}currentDimensions(){return {width:this.currentDimension("width"),height:this.currentDimension("height")};}currentWidth(){return this.currentDimension("width");}currentHeight(){return this.currentDimension("height");}focus(){this.el_.focus();}blur(){this.el_.blur();}handleKeyDown(e){this.player_&&(tn.isEventKey(e,"Tab")||e.stopPropagation(),this.player_.handleKeyDown(e));}handleKeyPress(e){this.handleKeyDown(e);}emitTapEvents(){let e=0,t=null,i;function s(){i=!1;}this.on("touchstart",function(s){1===s.touches.length&&(t={pageX:s.touches[0].pageX,pageY:s.touches[0].pageY},e=window.performance.now(),i=!0);}),this.on("touchmove",function(e){var s;(1<e.touches.length||t&&10<Math.sqrt((s=e.touches[0].pageX-t.pageX)*s+(e=e.touches[0].pageY-t.pageY)*e))&&(i=!1);}),this.on("touchleave",s),this.on("touchcancel",s),this.on("touchend",function(s){t=null,!0===i&&window.performance.now()-e<200&&(s.preventDefault(),this.trigger("tap"));});}enableTouchActivity(){if(this.player()&&this.player().reportUserActivity){let e=eU(this.player(),this.player().reportUserActivity),t;this.on("touchstart",function(){e(),this.clearInterval(t),t=this.setInterval(e,250);});var i=function(i){e(),this.clearInterval(t);};this.on("touchmove",e),this.on("touchend",i),this.on("touchcancel",i);}}setTimeout(e,t){var i;return e=eU(this,e),this.clearTimersOnDispose_(),i=window.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),window.clearTimeout(e)),e;}setInterval(e,t){return e=eU(this,e),this.clearTimersOnDispose_(),e=window.setInterval(e,t),this.setIntervalIds_.add(e),e;}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),window.clearInterval(e)),e;}requestAnimationFrame(e){var t;return this.clearTimersOnDispose_(),e=eU(this,e),t=window.requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e();}),this.rafIds_.add(t),t;}requestNamedAnimationFrame(e,t){var i;if(!this.namedRafs_.has(e))return this.clearTimersOnDispose_(),t=eU(this,t),i=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e);}),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),window.cancelAnimationFrame(e)),e;}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEac
32h(([e,t])=>{this[e].forEach((e,i)=>this[t](i));}),this.clearingTimersOnDispose_=!1;}));}static registerComponent(e,t){if("string"!=typeof e||!e)throw Error(`Illegal component name, "${e}"; must be a non-empty string.`);var i=ta.getComponent("Tech"),i=i&&i.isTech(t),s=ta===t||ta.prototype.isPrototypeOf(t.prototype);if(i||!s){let r;throw Error(`Illegal component, "${e}"; ${r=i?"techs must be registered using Tech.registerTech()":"must be a Component subclass"}.`);}if(e=te(e),ta.components_||(ta.components_={}),s=ta.getComponent("Player"),"Player"===e&&s&&s.players){let n=s.players;if(i=Object.keys(n),n&&0<i.length&&i.map((e)=>n[e]).every(Boolean))throw Error("Can not register Player component after player has been created.");}return ta.components_[e]=t,ta.components_[eZ(e)]=t;}static getComponent(e){if(e&&ta.components_)return ta.components_[e];}}function to(e,t,i,s){var r=s,n=i.length-1;if("number"!=typeof r||r<0||n<r)throw Error(`Failed to execute '${e}' on 'TimeRanges': The index provided (${r}) is non-numeric or out of bounds (0-${n}).`);return i[s][t];}function tl(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:to.bind(null,"start",0,e),end:to.bind(null,"end",1,e)},window.Symbol&&window.Symbol.iterator&&(t[window.Symbol.iterator]=()=>(e||[]).values()),t;}function th(e,t){return Array.isArray(e)?tl(e):void 0===e||void 0===t?tl():tl([[e,t]]);}function td(e,t){let i=Math.floor((e=e<0?0:e)%60),s=Math.floor(e/60%60),r=Math.floor(e/3600);var n=Math.floor(t/60%60),t=Math.floor(t/3600);return s=(((r=0<(r=isNaN(e)||e===1/0?s=i="-":r)||0<t?r+":":"")||10<=n)&&s<10?"0"+s:s)+":",r+s+(i=i<10?"0"+i:i);}ta.registerComponent("Component",ta);let tu=td;function tc(e){tu=e;}function tp(){tu=td;}function tm(e,t=e){return tu(e,t);}var tg=Object.freeze({__proto__:null,createTimeRanges:th,createTimeRange:th,setFormatTime:tc,resetFormatTime:tp,formatTime:tm});function tf(e,t){var i;let s=0,r;if(!t)return 0;e&&e.length||(e=th(0,0));for(let n=0;n<e.length;n++)i=e.start(n),(r=e.end(n))>t&&(r=t),s+=r-i;return s/t;}function ty(e){if(e instanceof ty)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:v(e)&&("number"==typeof e.code&&(this.code=e.code),Object.assign(this,e)),this.message||(this.message=ty.defaultMessages[this.code]||"");}ty.prototype.code=0,ty.prototype.message="",ty.prototype.status=null,ty.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],ty.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(let t8=0;t8<ty.errorTypes.length;t8++)ty[ty.errorTypes[t8]]=t8,ty.prototype[ty.errorTypes[t8]]=t8;var tv=function(e,t){var i,s=null;try{i=JSON.parse(e,t);}catch(r){s=r;}return [s,i];};function t$(e){return null!=e&&"function"==typeof e.then;}function t_(e){t$(e)&&e.then(null,(e)=>{});}function tb(e){return ["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((t,i,s)=>(e[i]&&(t[i]=e[i]),t),{cues:e.cues&&Array.prototype.map.call(e.cues,function(e){return {startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id};})});}var tT=function(e){var t=e.$$("track");let i=Array.prototype.map.call(t,(e)=>e.track);return Array.prototype.map.call(t,function(e){var t=tb(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(tb));};let tS="vjs-modal-dialog";class t0 extends ta{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_=Q("div",{className:tS+"-content"},{role:"document"}),this.descEl_=Q("p",{className:tS+"-description vjs-control-text",id:this.el().getAttribute("aria-describedby")}),J(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"});}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose();}buildCSSClass(){return tS+" vjs-hidden "+super.buildCSSClass();}label(){return e.t(this.options_.label||"Modal Window");}description(){let t=this.options_.description||e.t("This is a modal window.");return this.closeable()&&(t+=" "+e.t("This modal can be closed by pressing the Escape key or activating the close button.")),t;}open(){var e;this.opened_||(e=this.player(),this.trigger("beforemodalopen"),this.opened_=!0,!this.options_.fillAlways&&(this.hasBeenOpened_||this.hasBeenFilled_)||this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpe
32n&&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(){var e;this.opened_&&(e=this.player(),this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary)&&this.dispose();}closeable(e){if("boolean"==typeof e){var t,e=this.closeable_=!!e;let i=this.getChild("closeButton");e&&!i&&(t=this.contentEl_,this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=t,this.on(i,"close",this.close_)),!e&&i&&(this.off(i,"close",this.close_),this.removeChild(i),i.dispose());}return this.closeable_;}fill(){this.fillWith(this.content());}fillWith(e){var t=this.contentEl(),i=t.parentNode,s=t.nextSibling,e=(this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),e8(t,e),this.trigger("modalfill"),s?i.insertBefore(t,s):i.appendChild(t),this.getChild("closeButton"));e&&i.appendChild(e.el_);}empty(){this.trigger("beforemodalempty"),eg(this.contentEl()),this.trigger("modalempty");}content(e){return void 0!==e&&(this.content_=e),this.content_;}conditionalFocus_(){var e=document.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus());}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null);}handleKeyDown(e){if(e.stopPropagation(),tn.isEventKey(e,"Escape")&&this.closeable())e.preventDefault(),this.close();else{if(tn.isEventKey(e,"Tab")){var t=this.focusableEls_(),i=this.el_.querySelector(":focus");let s;for(let r=0;r<t.length;r++)if(i===t[r]){s=r;break;}document.activeElement===this.el_&&(s=0),e.shiftKey&&0===s?(t[t.length-1].focus(),e.preventDefault()):e.shiftKey||s!==t.length-1||(t[0].focus(),e.preventDefault());}}}focusableEls_(){var e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,(e)=>(e instanceof window.HTMLAnchorElement||e instanceof window.HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof window.HTMLInputElement||e instanceof window.HTMLSelectElement||e instanceof window.HTMLTextAreaElement||e instanceof window.HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof window.HTMLIFrameElement||e instanceof window.HTMLObjectElement||e instanceof window.HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable"));}}t0.prototype.options_={pauseOnOpen:!0,temporary:!0},ta.registerComponent("ModalDialog",t0);class tE extends eq{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});},eH(e)&&e.addEventListener("labelchange",e.labelchange_);}removeTrack(e){let t;for(let i=0,s=this.length;i<s;i++)if(this[i]===e){(t=this[i]).off&&t.off(),this.tracks_.splice(i,1);break;}t&&this.trigger({track:t,type:"removetrack",target:this});}getTrackById(e){let t=null;for(let i=0,s=this.length;i<s;i++){var r=this[i];if(r.id===e){t=r;break;}}return t;}}for(let tk in tE.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"})tE.prototype["on"+tk]=null;function tw(e,t){for(let i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].enabled=!1);}function tC(e,t){for(let i=0;i<e.length;
32i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].selected=!1);}class tx extends tE{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 t2{constructor(e){t2.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_;}});}setCues_(e){var t=this.length||0;let i=0;function s(e){""+e in this||Object.defineProperty(this,""+e,{get(){return this.cues_[e];}});}var r=e.length;if(this.cues_=e,this.length_=e.length,t<r)for(i=t;i<r;i++)s.call(this,i);}getCueById(e){let t=null;for(let i=0,s=this.length;i<s;i++){var r=this[i];if(r.id===e){t=r;break;}}return t;}}let tI={disabled:"disabled",hidden:"hidden",showing:"showing"};class tL extends eq{constructor(e={}){super();let t={id:e.id||"vjs_track_"+eL++,kind:e.kind||"",language:e.language||""},i=e.label||"";for(let s in t)Object.defineProperty(this,s,{get:()=>t[s],set(){}});Object.defineProperty(this,"label",{get:()=>i,set(e){e!==i&&(i=e,this.trigger("labelchange"));}});}}function tD(e){var t=["protocol","hostname","port","pathname","search","hash","host"],i=document.createElement("a"),s=(i.href=e,{});for(let r=0;r<t.length;r++)s[t[r]]=i[t[r]];return "http:"===s.protocol&&(s.host=s.host.replace(/:80$/,"")),"https:"===s.protocol&&(s.host=s.host.replace(/:443$/,"")),s.protocol||(s.protocol=window.location.protocol),s.host||(s.host=window.location.host),s;}function tA(e){var t;return e.match(/^https?:\/\//)||((t=document.createElement("a")).href=e,e=t.href),e;}function tP(e,t=window.location){return (":"===(e=tD(e)).protocol?t:e).protocol+e.host!==t.protocol+t.host;}let t3=function(e){return "string"==typeof e&&(e=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e))?e.pop().toLowerCase():"";};var t6=Object.freeze({__proto__:null,parseUrl:tD,getAbsoluteURL:tA,getFileExtension:t3,isCrossOrigin:tP}),t1="undefined"!=typeof window?window:void 0!==ts?ts:"undefined"!=typeof self?self:{},t4=t1,tO=tr(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,s=arguments[t];for(i in s)Object.prototype.hasOwnProperty.call(s,i)&&(e[i]=s[i]);}return e;},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(this,arguments);}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports;}),tR=(t1=tO)&&t1.__esModule&&Object.prototype.hasOwnProperty.call(t1,"default")?t1.default:t1,tN=function(e){var t;return !!e&&("[object Function]"===(t=tM.call(e))||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt));},tM=Object.prototype.toString;tj.httpHandler=function(e,t){return void 0===t&&(t=!1),function(i,s,r){if(i)e(i);else if(400<=s.statusCode&&s.statusCode<=599){if(i=r,t)if(t4.TextDecoder){var n;s=(void 0===(n=s.headers&&s.headers["content-type"])&&(n=""),n.toLowerCase().split(";").reduce(function(e,t){var t=t.split("="),i=t[0],t=t[1];return "charset"===i.trim()?t.trim():e;},"utf-8"));try{i=new TextDecoder(s).decode(r);}catch(a){}}else i=String.fromCharCode.apply(null,new Uint8Array(r));e({cause:i});}else e(null,r);};};for(var tU=function(e){var t={};return e&&e.trim().split("\n").forEach(function(e){var i=e.indexOf(":"),s=e.slice(0,i).trim().toLowerCase(),e=e.slice(i+1).trim();void 0===t[s]?t[s]=e:Array.isArray(t[s])?t[s].push(e):t[s]=[t[s],e];}),t;},t5=tj,t1=tj,tB=(tj.XMLHttpRequest=t4.XMLHttpRequest||function(){},tj.XDomainRequest=("withCredentials" in new tj.XMLHttpRequest())?tj.XMLHttpRequest:t4.XDomainRequest,["get","put","post","patch","head","delete"]),t7=function(e){tj["delete"===e?"del":e]=function(t,i,s){return (i=tq(t,i,s)).method=e.toUpperCase(),tH(i);};},tF=0;tF<tB.length;tF++)t7(tB[tF]);function tq(e,t,i){var s=e;
32return tN(t)?(i=t,"string"==typeof e&&(s={uri:e})):s=tO({},t,{uri:e}),s.callback=i,s;}function tj(e,t,i){return tH(t=tq(e,t,i));}function tH(e){if(void 0===e.callback)throw Error("callback argument missing");var t=!1,i=function(i,s,r){t||(t=!0,e.callback(i,s,r));};function s(e){return clearTimeout(o),(e=e instanceof Error?e:Error(""+(e||"Unknown XMLHttpRequest Error"))).statusCode=0,i(e,g);}function r(){var t,s,r;if(!a)return clearTimeout(o),t=e.useXDR&&void 0===l.status?200:1223===l.status?204:l.status,s=g,r=null,0!==t?(s={body:function e(){var t=void 0,t=l.response||l.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(i){}return null;}(l);if(m)try{t=JSON.parse(t);}catch(i){}return t;}(),statusCode:t,method:d,headers:{},url:h,rawRequest:l},l.getAllResponseHeaders&&(s.headers=tU(l.getAllResponseHeaders()))):r=Error("Internal XMLHttpRequest Error"),i(r,s,s.body);}var n,a,o,l=e.xhr||null,h=(l=l||new (e.cors||e.useXDR?tj.XDomainRequest:tj.XMLHttpRequest)()).url=e.uri||e.url,d=l.method=e.method||"GET",u=e.body||e.data,c=l.headers=e.headers||{},p=!!e.sync,m=!1,g={body:void 0,headers:{},statusCode:0,method:d,url:h,rawRequest:l};if("json" in e&&!1!==e.json&&(m=!0,c.accept||c.Accept||(c.Accept="application/json"),"GET"!==d)&&"HEAD"!==d&&(c["content-type"]||c["Content-Type"]||(c["Content-Type"]="application/json"),u=JSON.stringify(!0===e.json?u:e.json)),l.onreadystatechange=function(){4===l.readyState&&setTimeout(r,0);},l.onload=r,l.onerror=s,l.onprogress=function(){},l.onabort=function(){a=!0;},l.ontimeout=s,l.open(d,h,!p,e.username,e.password),p||(l.withCredentials=!!e.withCredentials),!p&&0<e.timeout&&(o=setTimeout(function(){var e;a||(a=!0,l.abort("timeout"),(e=Error("XMLHttpRequest timeout")).code="ETIMEDOUT",s(e));},e.timeout)),l.setRequestHeader)for(n in c)c.hasOwnProperty(n)&&l.setRequestHeader(n,c[n]);else{if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return;return 1;}(e.headers))throw Error("Headers cannot be set on an XDomainRequest object");}return "responseType" in e&&(l.responseType=e.responseType),"beforeSend" in e&&"function"==typeof e.beforeSend&&e.beforeSend(l),l.send(u||null),l;}function tV(e,t){var i=new window.WebVTT.Parser(window,window.vttjs,window.WebVTT.StringDecoder());let s=[];i.oncue=function(e){t.addCue(e);},i.onparsingerror=function(e){s.push(e);},i.onflush=function(){t.trigger({type:"loadeddata",target:t});},i.parse(e),0<s.length&&(window.console&&window.console.groupCollapsed&&window.console.groupCollapsed("Text Track parsing errors for "+t.src),s.forEach((e)=>p.error(e)),window.console)&&window.console.groupEnd&&window.console.groupEnd(),i.flush();}function t9(e,t){var i={uri:e};(e=tP(e))&&(i.cors=e),(e="use-credentials"===t.tech_.crossOrigin())&&(i.withCredentials=e),t5(i,eU(this,function(e,i,s){if(e)return p.error(e,i);t.loaded_=!0,"function"!=typeof window.WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],(e)=>{if("vttjserror"!==e.type)return tV(s,t);p.error("vttjs failed to load, stopping trying to process "+t.src);}):tV(s,t);}));}t5.default=t1;class tz extends tL{constructor(e={}){if(!e.tech)throw Error("A tech was not provided.");let t=tI[(e=_(e,{kind:{subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"}[e.kind]||"subtitles",language:e.language||e.srclang||""})).mode]||"disabled",i=e.default,s=("metadata"!==e.kind&&"chapters"!==e.kind||(t="hidden"),super(e),this.tech_=e.tech,this.cues_=[],this.activeCues_=[],this.preload_=!1!==this.tech_.preloadTextTracks,new t2(this.cues_)),r=new t2(this.activeCues_),n=!1;this.timeupdateHandler=eU(this,function(e={}){this.tech_.isDisposed()||(this.tech_.isReady_&&(this.activeCues=this.activeCues,n)&&(this.trigger("cuechange"),n=!1),"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)));}),this.tech_.one("dispose",()=>{this.stopTracking();}),"disabled"!==t&&this.startTracking(),Object.defineProperties(this,{default:{get:()=>i,set(){}},mode:{get:()=>t,set(e){tI[e]&&t!==e&&(t=e,this.preload_||"disabled"===t||0!==this.cues.length||t9(this.src,this),this.stopTracking(),"disabled"!==t&&this.startTracking(),this.trigger("modechange"));}},cues:{get(){return this.loaded_?s:null;},set(){}}
32,activeCues:{get(){if(!this.loaded_)return null;if(0!==this.cues.length){var e=this.tech_.currentTime(),t=[];for(let i=0,s=this.cues.length;i<s;i++){var a=this.cues[i];a.startTime<=e&&a.endTime>=e&&t.push(a);}if(n=!1,t.length!==this.activeCues_.length)n=!0;else{for(let o=0;o<t.length;o++)-1===this.activeCues_.indexOf(t[o])&&(n=!0);}this.activeCues_=t,r.setCues_(this.activeCues_);}return r;},set(){}}}),e.src?(this.src=e.src,this.preload_||(this.loaded_=!0),(this.preload_||"subtitles"!==e.kind&&"captions"!==e.kind)&&t9(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 window.vttjs.VTTCue(e.startTime,e.endTime,e.text),e)i in t||(t[i]=e[i]);t.id=e.id,t.originalCue_=e;}var s=this.tech_.textTracks();for(let r=0;r<s.length;r++)s[r]!==this&&s[r].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_);}removeCue(e){let t=this.cues_.length;for(;t--;){var i=this.cues_[t];if(i===e||i.originalCue_&&i.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break;}}}}tz.prototype.allowedEvents_={cuechange:"cuechange"};class tW extends tL{constructor(e={}){super(e=_(e,{kind:{alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"}[e.kind]||""}));let t=!1;Object.defineProperty(this,"enabled",{get:()=>t,set(e){"boolean"==typeof e&&e!==t&&(t=e,this.trigger("enabledchange"));}}),e.enabled&&(this.enabled=e.enabled),this.loaded_=!0;}}class tG extends tL{constructor(e={}){super(e=_(e,{kind:{alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"}[e.kind]||""}));let t=!1;Object.defineProperty(this,"selected",{get:()=>t,set(e){"boolean"==typeof e&&e!==t&&(t=e,this.trigger("selectedchange"));}}),e.selected&&(this.selected=e.selected);}}class tX extends eq{constructor(e={}){super();let t,i=new tz(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=tX.NONE,i.addEventListener("loadeddata",()=>{t=tX.LOADED,this.trigger({type:"load",target:this});});}}tX.prototype.allowedEvents_={load:"load"},tX.NONE=0,tX.LOADING=1,tX.LOADED=2,tX.ERROR=3;let tK={audio:{ListClass:class extends tE{constructor(e=[]){for(let t=e.length-1;0<=t;t--)if(e[t].enabled){tw(e,e[t]);break;}super(e),this.changing_=!1;}addTrack(e){e.enabled&&tw(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,tw(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:tW,capitalName:"Audio"},video:{ListClass:class extends tE{constructor(e=[]){for(let t=e.length-1;0<=t;t--)if(e[t].selected){tC(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&&tC(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,tC(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:tG,capitalName:"Video"},text:{ListClass:tx,TrackClass:tz,capitalName:"Text"}},tY=(Object.keys(tK).forEach(function(e){tK[e].getterName=e+"Tracks",tK[e].privateName=e+"Tracks_";}),{remoteText:{ListClass:tx,TrackClass:tz,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];}}
32),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e);}getTrackElementByTrack_(e){let t;for(let i=0,s=this.trackElements_.length;i<s;i++)if(e===this.trackElements_[i].track){t=this.trackElements_[i];break;}return t;}removeTrackElement_(e){for(let t=0,i=this.trackElements_.length;t<i;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&"function"==typeof this.trackElements_[t].track.off&&this.trackElements_[t].track.off(),"function"==typeof this.trackElements_[t].off&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break;}}},TrackClass:tX,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}}),tQ=Object.assign({},tK,tY);tY.names=Object.keys(tY),tK.names=Object.keys(tK),tQ.names=[].concat(tY.names).concat(tK.names);var t1=void 0!==ts?ts:"undefined"!=typeof window?window:{},tJ="undefined"!=typeof document?document:(tJ=t1["__GLOBAL_DOCUMENT_CACHE@4"])||(t1["__GLOBAL_DOCUMENT_CACHE@4"]={}),ts=tJ,tZ=Object.create||function(e){if(1!==arguments.length)throw Error("Object.create shim only accepts one parameter.");return ie.prototype=e,new ie();};function ie(){}function it(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message;}function ii(e){function t(e,t,i,s){return 3600*(0|e)+60*(0|t)+(0|i)+(0|s)/1e3;}return (e=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/))?e[3]?t(e[1],e[2],e[3].replace(":",""),e[4]):59<e[1]?t(e[1],e[2],0,e[4]):t(0,e[1],e[2],e[4]):null;}function is(){this.values=tZ(null);}function ir(e,t,i,s){var r,n,a=s?e.split(s):[e];for(r in a)"string"==typeof a[r]&&2===(n=a[r].split(i)).length&&t(n[0].trim(),n[1].trim());}((it.prototype=tZ(Error.prototype)).constructor=it).Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},is.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t);},get:function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t;},has:function(e){return e in this.values;},alt:function(e,t,i){for(var s=0;s<i.length;++s)if(t===i[s]){this.set(e,t);break;}},integer:function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10));},percent:function(e,t){return !!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&0<=(t=parseFloat(t))&&t<=100)&&(this.set(e,t),!0);}};var ia=ts.createElement&&ts.createElement("textarea"),io={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},il={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)"},ih={v:"title",lang:"lang"},id={rt:"ruby"};function iu(e,t){for(var i,s,r,n,a,o,l=e.document.createElement("div"),h=l,d=[];null!==(o=void 0,o=t?(o=(o=t.match(/^([^<]*)(<[^>]*>?)?/))[1]||o[2],t=t.substr(o.length),o):null);)"<"===o[0]?"/"===o[1]?d.length&&d[d.length-1]===o.substr(2).replace(">","")&&(d.pop(),h=h.parentNode):(s=ii(o.substr(1,o.length-2)))?(i=e.document.createProcessingInstruction("timestamp",s),h.appendChild(i)):(s=o.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/))&&(r=s[1],n=s[3],a=void 0,i=(a=io[r])?(a=e.document.createElement(a),(r=ih[r])&&n&&(a[r]=n.trim()),a):null)&&(r=h,id[(n=i).localName]&&id[n.localName]!==r.localName||(s[2]&&((a=s[2].split(".")).forEach(function(e){var t=/^bg_/.test(e),e=t?e.slice(3):e;il.hasOwnProperty(e)&&(e=il[e],i.style[t?"background-color":"color"]=e);}),i.className=a.join(" ")),d.push(s[1]),h.appendChild(i),h=i)):h.appendChild(e.document.createTextNode((n=o,ia.innerHTML=n,n=ia.textContent,ia.textContent="",n)));return l;}var ic=[[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
32],[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 ip(){}function im(e,t,i){ip.call(this),this.cue=t,this.cueDiv=iu(e,t.text);var s={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"},r=(this.applyStyles(s,this.cueDiv),this.div=e.document.createElement("div"),s={direction:function e(t){var i=[],s="";if(t&&t.childNodes)for(n(i,t);s=function e(t){var i,s,r;return t&&t.length?(s=(i=t.pop()).textContent||i.innerText)?(r=s.match(/^.*(\n|\r)/))?r[t.length=0]:s:"ruby"===i.tagName?e(t):i.childNodes?(n(t,i),e(t)):void 0:null;}(i);)for(var r=0;r<s.length;r++)if(function(e){for(var t=0;t<ic.length;t++){var i=ic[t];if(e>=i[0]&&e<=i[1])return 1;}}(s.charCodeAt(r)))return "rtl";return "ltr";function n(e,t){for(var i=t.childNodes.length-1;0<=i;i--)e.push(t.childNodes[i]);}}(this.cueDiv),writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:"middle"===t.align?"center":t.align,font:i.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(s),this.div.appendChild(this.cueDiv),0);switch(t.positionAlign){case "start":case "line-left":r=t.position;break;case "center":r=t.position-t.size/2;break;case "end":case "line-right":r=t.position-t.size;}""===t.vertical?this.applyStyles({left:this.formatStyle(r,"%"),width:this.formatStyle(t.size,"%")}):this.applyStyles({top:this.formatStyle(r,"%"),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 ig(e){var t,i,s,r;e.div&&(t=e.div.offsetHeight,i=e.div.offsetWidth,s=e.div.offsetTop,r=(r=(r=e.div.childNodes)&&r[0])&&r.getClientRects&&r.getClientRects(),e=e.div.getBoundingClientRect(),r=r?Math.max(r[0]&&r[0].height||0,e.height/r.length):0),this.left=e.left,this.right=e.right,this.top=e.top||s,this.height=e.height||t,this.bottom=e.bottom||s+(e.height||t),this.width=e.width||i,this.lineHeight=void 0!==r?r:e.lineHeight;}function iy(e,t,i,s){var r,n=new ig(t),a=t.cue,o=function(e){if("number"==typeof e.line&&(e.snapToLines||0<=e.line&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return -1;for(var t=e.track,i=t.textTrackList,s=0,r=0;r<i.length&&i[r]!==t;r++)"showing"===i[r].mode&&s++;return -1*++s;}(a),l=[];if(a.snapToLines){switch(a.vertical){case "":l=["+y","-y"],r="height";break;case "rl":l=["+x","-x"],r="width";break;case "lr":l=["-x","+x"],r="width";}var h=n.lineHeight,d=h*Math.round(o),u=i[r]+h,c=l[0];Math.abs(d)>u&&(d=d<0?-1:1,d*=Math.ceil(u/h)*h),o<0&&(d+=""===a.vertical?i.height:i.width,l=l.reverse()),n.move(c,d);}else{var p=n.lineHeight/i.height*100;switch(a.lineAlign){case "center":o-=p/2;break;case "end":o-=p;}switch(a.vertical){case "":t.applyStyles({top:t.formatStyle(o,"%")});break;case "rl":t.applyStyles({left:t.formatStyle(o,"%")});break;case "lr":t.applyStyles({right:t.formatStyle(o,"%")});}l=["+y","-x","+x","-y"],n=new ig(t);}u=function(e,t){for(var r,n=new ig(e),a=1,o=0;o<t.length;o++){for(;e.overlapsOppositeAxis(i,t[o])||e.within(i)&&e.overlapsAny(s);)e.move(t[o]);if(e.within(i))return e;var l=e.intersectPercentage(i);l<a&&(r=new ig(e),a=l),e=new ig(n);}return r||n;}(n,l),t.move(u.toCSSCompatValues(i));}function i8(){}ip.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i]);},ip.prototype.formatStyle=function(e,t){return 0===e?0:e+t;},(im.prototype=tZ(ip.prototype)).constructor=im,ig.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;}},ig.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top;},ig.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++)if(this.overlaps(e[t]))return !0;return !1;},ig.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right;},ig.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;}},ig.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);},ig.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};},ig.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,s=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;
32return {left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||s,height:e.height||t,bottom:e.bottom||s+(e.height||t),width:e.width||i};},i8.StringDecoder=function(){return {decode:function(e){if(!e)return "";if("string"!=typeof e)throw Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e));}};},i8.convertCueToDOMTree=function(e,t){return e&&t?iu(e,t):null;},i8.processCues=function(e,t,i){if(!e||!t||!i)return null;for(;i.firstChild;)i.removeChild(i.firstChild);var s=e.document.createElement("div");if(s.style.position="absolute",s.style.left="0",s.style.right="0",s.style.top="0",s.style.bottom="0",s.style.margin="1.5%",i.appendChild(s),function(e){for(var t=0;t<e.length;t++)if(e[t].hasBeenReset||!e[t].displayState)return 1;}(t))for(var r,n,a=[],o=ig.getSimpleBoxPosition(s),l={font:Math.round(.05*o.height*100)/100+"px sans-serif"},h=0;h<t.length;h++)n=t[h],r=new im(e,n,l),s.appendChild(r.div),iy(0,r,o,a),n.displayState=r.div,a.push(ig.getSimpleBoxPosition(r));else for(var d=0;d<t.length;d++)s.appendChild(t[d].displayState);},(i8.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=[];}).prototype={reportOrThrowError:function(e){if(!(e instanceof it))throw e;this.onparsingerror&&this.onparsingerror(e);},parse:function(e){var t=this;function i(){for(var e=t.buffer,i=0;i<e.length&&"\r"!==e[i]&&"\n"!==e[i];)++i;var s=e.substr(0,i);return "\r"===e[i]&&++i,"\n"===e[i]&&++i,t.buffer=e.substr(i),s;}function s(e){e.match(/X-TIMESTAMP-MAP/)?ir(e,function(e,i){var s;"X-TIMESTAMP-MAP"===e&&(e=i,s=new is(),ir(e,function(e,t){switch(e){case "MPEGT":s.integer(e+"S",t);break;case "LOCA":s.set(e+"L",ii(t));}},/[^\d]:/,/,/),t.ontimestampmap)&&t.ontimestampmap({MPEGTS:s.get("MPEGTS"),LOCAL:s.get("LOCAL")});},/=/):ir(e,function(e,i){var s;"Region"===e&&(e=i,s=new is(),ir(e,function(e,t){switch(e){case "id":s.set(e,t);break;case "width":s.percent(e,t);break;case "lines":s.integer(e,t);break;case "regionanchor":case "viewportanchor":var i,r=t.split(",");2===r.length&&((i=new is()).percent("x",r[0]),i.percent("y",r[1]),i.has("x")&&i.has("y"))&&(s.set(e+"X",i.get("x")),s.set(e+"Y",i.get("y")));break;case "scroll":s.alt(e,t,["up"]);}},/=/,/\s/),s.has("id"))&&((e=new (t.vttjs.VTTRegion||t.window.VTTRegion)()).width=s.get("width",100),e.lines=s.get("lines",3),e.regionAnchorX=s.get("regionanchorX",0),e.regionAnchorY=s.get("regionanchorY",100),e.viewportAnchorX=s.get("viewportanchorX",0),e.viewportAnchorY=s.get("viewportanchorY",100),e.scroll=s.get("scroll",""),t.onregion&&t.onregion(e),t.regionList.push({id:s.get("id"),region:e}));},/:/);}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=(r=i()).match(/^WEBVTT([ \t].*)?$/);if(!n||!n[0])throw new it(it.Errors.BadSignature);t.state="HEADER";}for(var a=!1;t.buffer&&/\r\n|\n/.test(t.buffer);)switch(a?a=!1:r=i(),t.state){case "HEADER":/:/.test(r)?s(r):r||(t.state="ID");continue;case "NOTE":r||(t.state="ID");continue;case "ID":if(/^NOTE($|[ \t])/.test(r)){t.state="NOTE";break;}if(!r)continue;t.cue=new (t.vttjs.VTTCue||t.window.VTTCue)(0,0,"");try{t.cue.align="center";}catch(o){t.cue.align="middle";}if(t.state="CUE",-1===r.indexOf("-->")){t.cue.id=r;continue;}case "CUE":try{!function(e,t,i){var s=e;function r(){var t=ii(e);if(null===t)throw new it(it.Errors.BadTimeStamp,"Malformed timestamp: "+s);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t;}function n(){e=e.replace(/^\s+/,"");}if(n(),t.startTime=r(),n(),"-->"!==e.substr(0,3))throw new it(it.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+s);e=e.substr(3),n(),t.endTime=r(),n();var a=e,o=new is();ir(a,function(e,t){switch(e){case "region":for(var s=i.length-1;0<=s;s--)if(i[s].id===t){o.set(e,i[s].region);break;}break;case "vertical":o.alt(e,t,["rl","lr"]);break;case "line":var r=t.split(","),n=r[0];o.integer(e,n),o.percent(e,n)&&o.set("snapToLines",!1),o.alt(e,n,["auto"]),2===r.length&&o.alt("lineAlign",r[1],["start","center","end"]);break;case "position":r=t.split(","),o.percent(e,r[0]),2===r.length&&o.alt("positionAlign",r[1],["start","center","end"]);break;case "size":o.percent(e,t);break;case "align":o.alt(e,t,["start","center","end","left","right"]);}},/:/,/\s/),t.region=o.get("region",null),t.vertical=o.get("vertical","");try{t.line=o.get("line","auto");}catch(l){}t.lineAlign=o.get("lineAlign","start"),t.snapToLines=o.get("snapToLines",!0),t.size=o.get("size",100);try{t.align=o.get("align","center");}catch(h){t.align=o.get("align","middle");}try{t.position=o.get("position","auto");}catch(d){t.position=o.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align);}t.positionAlign=o.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align);}(r,t.cue,t.regionList);}catch(l){t.reportOrThrowError(l),t.cue=null,t.state="BADCUE";continue;}t.state="CUETEXT";continue;case "CUETEXT":var h=-1!==r.indexOf("-->");if(!r||h&&(a=!0)){t.oncue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue;}t.cue.text&&(t.cue.text+="\n"),t.cue.text+=r.replace(/\u2028/g,"\n").replace(/u2029/g,"\n");continue;case "BADCUE":r||(t.state="ID");continue;}}catch(d){t.reportOrThrowError(d),"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE";}return this;},flush:function(){var e=this;try{if(e.buffer+=e.decoder.decode(),(e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state)throw new it(it.Errors.BadSignature);}catch(t){e.reportOrThrowError(t);}return e.onflush&&e.onflush(),this;}};
32var iv=i8,i$={"":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 ib(e){return "string"==typeof e&&!!i_[e.toLowerCase()]&&e.toLowerCase();}function iT(e,t,i){this.hasBeenReset=!1;var s="",r=!1,n=e,a=t,o=i,l=null,h="",d=!0,u="auto",c="start",p="auto",m="auto",g=100,f="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return s;},set:function(e){s=""+e;}},pauseOnExit:{enumerable:!0,get:function(){return r;},set:function(e){r=!!e;}},startTime:{enumerable:!0,get:function(){return n;},set:function(e){if("number"!=typeof e)throw TypeError("Start time must be set to a number.");n=e,this.hasBeenReset=!0;}},endTime:{enumerable:!0,get:function(){return a;},set:function(e){if("number"!=typeof e)throw TypeError("End time must be set to a number.");a=e,this.hasBeenReset=!0;}},text:{enumerable:!0,get:function(){return o;},set:function(e){o=""+e,this.hasBeenReset=!0;}},region:{enumerable:!0,get:function(){return l;},set:function(e){l=e,this.hasBeenReset=!0;}},vertical:{enumerable:!0,get:function(){return h;},set:function(e){if(!1===(e="string"==typeof e&&!!i$[e.toLowerCase()]&&e.toLowerCase()))throw SyntaxError("Vertical: an invalid or illegal direction string was specified.");h=e,this.hasBeenReset=!0;}},snapToLines:{enumerable:!0,get:function(){return d;},set:function(e){d=!!e,this.hasBeenReset=!0;}},line:{enumerable:!0,get:function(){return u;},set:function(e){if("number"!=typeof e&&"auto"!==e)throw SyntaxError("Line: an invalid number or illegal string was specified.");u=e,this.hasBeenReset=!0;}},lineAlign:{enumerable:!0,get:function(){return c;},set:function(e){(e=ib(e))&&(c=e,this.hasBeenReset=!0);}},position:{enumerable:!0,get:function(){return p;},set:function(e){if(e<0||100<e)throw Error("Position must be between 0 and 100.");p=e,this.hasBeenReset=!0;}},positionAlign:{enumerable:!0,get:function(){return m;},set:function(e){(e=ib(e))&&(m=e,this.hasBeenReset=!0);}},size:{enumerable:!0,get:function(){return g;},set:function(e){if(e<0||100<e)throw Error("Size must be between 0 and 100.");g=e,this.hasBeenReset=!0;}},align:{enumerable:!0,get:function(){return f;},set:function(e){if(!(e=ib(e)))throw SyntaxError("align: an invalid or illegal alignment string was specified.");f=e,this.hasBeenReset=!0;}}}),this.displayState=void 0;}iT.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text);};var iS=iT,i0={"":!0,up:!0};function iE(e){return "number"==typeof e&&0<=e&&e<=100;}function ik(){var e=100,t=3,i=0,s=100,r=0,n=100,a="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e;},set:function(t){if(!iE(t))throw Error("Width must be between 0 and 100.");e=t;}},lines:{enumerable:!0,get:function(){return t;},set:function(e){if("number"!=typeof e)throw TypeError("Lines must be set to a number.");t=e;}},regionAnchorY:{enumerable:!0,get:function(){return s;},set:function(e){if(!iE(e))throw Error("RegionAnchorX must be between 0 and 100.");s=e;}},regionAnchorX:{enumerable:!0,get:function(){return i;},set:function(e){if(!iE(e))throw Error("RegionAnchorY must be between 0 and 100.");i=e;}},viewportAnchorY:{enumerable:!0,get:function(){return n;},set:function(e){if(!iE(e))throw Error("ViewportAnchorY must be between 0 and 100.");n=e;}},viewportAnchorX:{enumerable:!0,get:function(){return r;},set:function(e){if(!iE(e))throw Error("ViewportAnchorX must be between 0 and 100.");r=e;}},scroll:{enumerable:!0,get:function(){return a;},set:function(e){!1!==(e="string"==typeof e&&!!i0[e.toLowerCase()]&&e.toLowerCase())&&(a=e);}}});}var iw=tr(function(e){var e=e.exports={WebVTT:iv,VTTCue:iS,VTTRegion:ik},t=(t4.vttjs=e,t4.WebVTT=e.WebVTT,e.VTTCue),i=e.VTTRegion,s=t4.VTTCue,r=t4.VTTRegion;e.shim=function(){t4.VTTCue=t,t4.VTTRegion=i;},e.restore=function(){t4.VTTCue=s,t4.VTTRegion=r;},t4.VTTCue||e.shim();});iw.WebVTT,iw.VTTCue,iw.VTTRegion;class iC extends ta{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)=>
32this.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;}),tQ.names.forEach((t)=>{t=tQ[t],e&&e[t.getterName]&&(this[t.privateName]=e[t.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 tQ.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(eU(this,function(){var e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),1===(this.bufferedPercent_=e)&&this.stopTrackingProgress();}),500);}onDurationChange(e){this.duration_=this.duration();}buffered(){return th(0,0);}bufferedPercent(){return tf(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(tK.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose();}
32clearTracks(e){(e=[].concat(e)).forEach((e)=>{var t=this[e+"Tracks"]()||[];let i=t.length;for(;i--;){var s=t[i];"text"===e&&this.removeRemoteTextTrack(s),t.removeTrack(s);}});}cleanupAutoTextTracks(){var e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){var i=e[t];this.removeRemoteTextTrack(i);}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return void 0!==e&&(this.error_=new ty(e),this.trigger("error")),this.error_;}played(){return this.hasStarted_?th(0,0):th();}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0});}initTrackListeners(){tK.names.forEach((e)=>{var t=tK[e];let i=()=>{this.trigger(e+"trackchange");},s=this[t.getterName]();s.addEventListener("removetrack",i),s.addEventListener("addtrack",i),this.on("dispose",()=>{s.removeEventListener("removetrack",i),s.removeEventListener("addtrack",i);});});}addWebVttScript_(){if(!window.WebVTT)if(document.body.contains(this.el()))if(!this.options_["vtt.js"]&&$(iw)&&0<Object.keys(iw).length)this.trigger("vttjsloaded");else{let e=document.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;}),window.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),s=(t)=>e.removeTrack(t.track),r=(t.on("addtrack",i),t.on("removetrack",s),this.addWebVttScript_(),()=>this.trigger("texttrackchange")),n=()=>{r();for(let t=0;t<e.length;t++){var i=e[t];i.removeEventListener("cuechange",r),"showing"===i.mode&&i.addEventListener("cuechange",r);}};n(),e.addEventListener("change",n),e.addEventListener("addtrack",n),e.addEventListener("removetrack",n),this.on("dispose",function(){t.off("addtrack",i),t.off("removetrack",s),e.removeEventListener("change",n),e.removeEventListener("addtrack",n),e.removeEventListener("removetrack",n);for(let a=0;a<e.length;a++)e[a].removeEventListener("cuechange",r);});}addTextTrack(e,t,i){var s,r,n;if(e)return r={},n=(s=this).textTracks(),r.kind=e,t&&(r.label=t),i&&(r.language=i),r.tech=s,e=new tQ.text.TrackClass(r),n.addTrack(e),e;throw Error("TextTrack kind is required but was not provided");}createRemoteTextTrack(e){return e=_(e,{tech:this}),new tY.remoteTextEl.TrackClass(e);}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){var 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=eL++;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 iC.canPlayType(e.type);}static isTech(e){return e.prototype instanceof iC||e instanceof iC||e===iC;}static registerTech(e,t){if(iC.techs_||(iC.techs_={}),!iC.isTech(t))throw Error(`Tech ${e} must be a Tech`);if(!iC.canPlayType)throw Error("Techs must have a static canPlayType method on them");if(iC.canPlaySource)return e=te(e),iC.techs_[e]=t,iC.techs_[eZ(e)]=t,"Tech"!==e&&iC.defaultTechOrder_.push(e),t;throw Error("Techs must have a static canPlaySource method on them");}static getTech(e){if(e)return iC.techs_&&iC.techs_[e]?iC.techs_[e]:(e=te(e),window&&window.videojs&&window.videojs[e]?(p.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),window.videojs[e]):void 0);}}
32tQ.names.forEach(function(e){let t=tQ[e];iC.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass(),this[t.privateName];};}),iC.prototype.featuresVolumeControl=!0,iC.prototype.featuresMuteControl=!0,iC.prototype.featuresFullscreenResize=!1,iC.prototype.featuresPlaybackRate=!1,iC.prototype.featuresProgressEvents=!1,iC.prototype.featuresSourceset=!1,iC.prototype.featuresTimeupdateEvents=!1,iC.prototype.featuresNativeTextTracks=!1,iC.prototype.featuresVideoFrameCallback=!1,iC.withSourceHandlers=function(e){e.registerSourceHandler=function(t,i){let s=e.sourceHandlers;s=s||(e.sourceHandlers=[]),void 0===i&&(i=s.length),s.splice(i,0,t);},e.canPlayType=function(t){var i,s=e.sourceHandlers||[];for(let r=0;r<s.length;r++)if(i=s[r].canPlayType(t))return i;return "";},e.selectSourceHandler=function(t,i){var s=e.sourceHandlers||[];for(let r=0;r<s.length;r++)if(s[r].canHandleSource(t,i))return s[r];return null;},e.canPlaySource=function(t,i){var s=e.selectSourceHandler(t,i);return s?s.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:p.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);};},ta.registerComponent("Tech",iC),iC.registerTech("Tech",iC),iC.defaultTechOrder_=[];let ix={},i2={},iI={};function iL(e,t,i,s=null){var r="call"+te(i),r=e.reduce(i3(r),s),s=r===iI,t=s?null:t[i](r),n=e,a=i,o=t,l=s;for(let h=n.length-1;0<=h;h--){var d=n[h];d[a]&&d[a](l,o);}return t;}let iD={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},iA={setCurrentTime:1,setMuted:1,setVolume:1},iP={play:1,pause:1};function i3(e){return (t,i)=>t===iI?iI:i[e]?i[e](t):t;}let i6={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"},i1=function(e=""){return i6[(e=t3(e)).toLowerCase()]||"";};function i4(e){var t;return e.type||(t=i1(e.src))&&(e.type=t),e;}ta.registerComponent("MediaLoader",class e extends ta{constructor(e,t,i){if(super(e,_({createEl:!1},t),i),t.playerOptions.sources&&0!==t.playerOptions.sources.length)e.src(t.playerOptions.sources);else{for(let s=0,r=t.playerOptions.techOrder;s<r.length;s++){var n=te(r[s]);let a=iC.getTech(n);if((a=n?a:ta.getComponent(n))&&a.isSupported()){e.loadTech_(n);break;}}}}});class iO extends ta{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={}){return t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),"button"===e&&p.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,e=Q(e,t,i),this.player_.options_.experimentalSvgIcons||e.appendChild(Q("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(e),e;}dispose(){this.controlTextEl_=null,super.dispose();}createControlTextEl(e){return this.controlTextEl_=Q("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_;}controlText(t,i=this.el()){if(void 0===t)return this.controlText_||"Need Text";var s=e.t(t);this.controlText_=t,J(this.controlTextEl_,s),this.nonIconControl||this.player_.options_.noUITitleAttributes||i.setAttribute("title",s);}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){tn.isEventKey(e,"Space")||tn.isEventKey(e,"Enter")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e);}}ta.registerComponent("ClickableComponent",iO);class iR extends iO{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 Q("div",{className:"vjs-poster"});}crossOrigin(e){if(void 0===e)return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;
32null!==e&&"anonymous"!==e&&"use-credentials"!==e?this.player_.log.warn(`crossOrigin must be null,  "anonymous" or "use-credentials", given "${e}"`):this.$("img")&&(this.$("img").crossOrigin=e);}update(e){var t=this.player().poster();this.setSrc(t),t?this.show():this.hide();}setSrc(e){e?(this.$("img")||this.el_.appendChild(Q("picture",{className:"vjs-poster",tabIndex:-1},{},Q("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e):this.el_.textContent="";}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?t_(this.player_.play()):this.player_.pause());}}iR.prototype.crossorigin=iR.prototype.crossOrigin,ta.registerComponent("PosterImage",iR);let iN={default:"default",sized1:"sized1",sized2:"sized2",sized3:"sized3",sized4:"sized4"};function iM(e,t){let i;if(4===e.length)i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");i=e.slice(1);}return "rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")";}function iU(e,t,i){try{e.style[t]=i;}catch(s){}}function i5(e){return e?e+"px":"";}ta.registerComponent("TextTrackDisplay",class e extends ta{constructor(e,t,i){super(e,t,i);let s=(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(eU(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks)this.hide();else{e.on("fullscreenchange",s),e.on("playerresize",s);let t=window.screen.orientation||window,i=window.screen.orientation?"change":"orientationchange";t.addEventListener(i,s),e.on("dispose",()=>t.removeEventListener(i,s));var r=this.options_.playerOptions.tracks||[];for(let n=0;n<r.length;n++)this.player_.addRemoteTextTrack(r[n],!0);this.preselectTrack();}}));}preselectTrack(){var e={captions:1,subtitles:1},t=this.player_.textTracks(),i=this.player_.cache_.selectedLanguage;let s,r,n;for(let a=0;a<t.length;a++){var o=t[a];i&&i.enabled&&i.language&&i.language===o.language&&o.kind in e?n=o.kind!==i.kind&&n||o:i&&!i.enabled?(n=null,s=null,r=null):o.default&&("descriptions"!==o.kind||s?o.kind in e&&!r&&(r=o):s=o);}n?n.mode="showing":r?r.mode="showing":s&&(s.mode="showing");}toggleDisplay(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show();}createEl(){return super.createEl("div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"});}clearDisplay(){"function"==typeof window.WebVTT&&window.WebVTT.processCues(window,[],this.el_);}updateDisplay(){var e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){var i=[];for(let s=0;s<e.length;++s){var r=e[s];"showing"===r.mode&&i.push(r);}this.updateForTrack(i);}else{let n=null,a=null,o=e.length;for(;o--;){var l=e[o];"showing"===l.mode&&("descriptions"===l.kind?n=l:a=l);}a?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(a)):n&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(n));}}updateDisplayOverlay(){if(this.player_.videoHeight()&&window.CSS.supports("inset-inline: 10px")){var e=this.player_.currentWidth(),t=this.player_.currentHeight(),i=e/t,s=this.player_.videoWidth()/this.player_.videoHeight();let r=0,n=0;.1<Math.abs(i-s)&&(s<i?r=Math.round((e-t*s)/2):n=Math.round((t-e/s)/2)),iU(this.el_,"insetInline",i5(r)),iU(this.el_,"insetBlock",i5(n));}}updateDisplayState(e){var t=this.player_.textTrackSettings.getValues(),i=e.activeCues;let s=i.length;for(;s--;){var r,n=i[s];n&&(n=n.displayState,t.color&&(n.firstChild.style.color=t.color),t.textOpacity&&iU(n.firstChild,"color",iM(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(n.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&iU(n.firstChild,"backgroundColor",iM(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?iU(n,"backgroundColor",iM(t.windowColor,t.windowOpacity)):n.style.backgroundColor=t.windowColor),t.edgeStyle&&("dropshadow"===t.edgeStyle?n.firstChild.style.textShadow="2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px #222":"raised"===t.edgeStyle?n.firstChild.style.textShadow="1px 1px #222, 2px 2px #222, 3px 3px #222":"depressed"===t.edgeStyle?n.firstChild.style.textShadow="1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px #222":"uniform"===t.edgeStyle&&(n.firstChild.style.textShadow="0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px #222")),t.fontPercent&&1!==t.fontPercent&&(r=window.parseFloat(n.style.fontSize),n.style.fontSize=r*t.fontPercent+"px",n.style.height="auto",n.style.top="auto"),t.fontFamily)&&"default"!==t.fontFamily&&
32("small-caps"===t.fontFamily?n.firstChild.style.fontVariant="small-caps":n.firstChild.style.fontFamily=iN[t.fontFamily]);}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),"function"==typeof window.WebVTT&&!e.every((e)=>!e.activeCues)){var t=[];for(let i=0;i<e.length;++i){var s=e[i];for(let r=0;r<s.activeCues.length;++r)t.push(s.activeCues[r]);}window.WebVTT.processCues(window,t,this.el_);for(let n=0;n<e.length;++n){var a=e[n];for(let o=0;o<a.activeCues.length;++o){var l=a.activeCues[o].displayState;et(l,"vjs-text-track-cue","vjs-text-track-cue-"+(a.language||n)),a.language&&eo(l,"lang",a.language);}this.player_.textTrackSettings&&this.updateDisplayState(a);}}}}),ta.registerComponent("LoadingSpinner",class t extends ta{createEl(){var t=this.player_.isAudio(),t=e.t(t?"Audio Player":"Video Player"),t=Q("span",{className:"vjs-control-text",textContent:e.t("{1} is loading.",[t])}),i=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});return i.appendChild(t),i;}handleLanguagechange(){this.$(".vjs-control-text").textContent=e.t("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"]);}});class iB extends iO{createEl(e,t={},i={}){return t=Q("button",t=Object.assign({className:this.buildCSSClass()},t),i=Object.assign({type:"button"},i)),this.player_.options_.experimentalSvgIcons||t.appendChild(Q("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(t),t;}addChild(e,t={}){var i=this.constructor.name;return p.warn(`Adding an actionable (user controllable) child to a Button (${i}) is not supported; use a ClickableComponent instead.`),ta.prototype.addChild.call(this,e,t);}enable(){super.enable(),this.el_.removeAttribute("disabled");}disable(){super.disable(),this.el_.setAttribute("disabled","disabled");}handleKeyDown(e){tn.isEventKey(e,"Space")||tn.isEventKey(e,"Enter")?e.stopPropagation():super.handleKeyDown(e);}}ta.registerComponent("Button",iB);class i7 extends iB{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){var t=this.player_.play();if(this.mouseused_&&"clientX" in e&&"clientY" in e)t_(t),this.player_.tech(!0)&&this.player_.tech(!0).focus();else{var e=this.player_.getChild("controlBar");let i=e&&e.getChild("playToggle");i?(e=()=>i.focus(),t$(t)?t.then(e,()=>{}):this.setTimeout(e,1)):this.player_.tech(!0).focus();}}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e);}handleMouseDown(e){this.mouseused_=!0;}}i7.prototype.controlText_="Play Video",ta.registerComponent("BigPlayButton",i7),ta.registerComponent("CloseButton",class extends iB{constructor(t,i){super(t,i),this.setIcon("cancel"),this.controlText(i&&i.controlText||e.t("Close"));}buildCSSClass(){return "vjs-close-button "+super.buildCSSClass();}handleClick(e){this.trigger({type:"close",bubbles:!1});}handleKeyDown(e){tn.isEventKey(e,"Esc")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e);}});class iF extends iB{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()?t_(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));}}iF.prototype.controlText_="Play",ta.registerComponent("PlayToggle",iF);class iq extends ta{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended"],(e)=>this.updateContent(e)),this.updateTextNode_();}createEl(){var t=this.buildCSSClass(),i=super.createEl("div",{className:t+" vjs-time-control vjs-control"}),s=Q("span",{className:"vjs-control-text",textContent:e.t(this.labelText_)+"\xa0"},{role:"presentation"});return i.appendChild(s),this.contentEl_=Q("span",{className:t+"-display"},{role:"presentation"}),i.appendChild(this.contentEl_),i;}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose();}updateTextNode_(e=0){e=tm(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(this.contentEl_){let e=this.textNode_;e&&this.contentEl_.firstChild!==e&&(e=null,p.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_=document.createTextNode(this.formattedTime_),this.textNode_&&(e?this.contentEl_.replaceChild(this.textNode_,e):this.contentEl_.appendChild(this.textNode_));}}));}updateContent(e){}}iq.prototype.labelText_="Time",iq.prototype.controlText_="Time",ta.registerComponent("TimeDisplay",iq);class ij extends iq{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);}}ij.prototype.labelText_="Current Time",ij.prototype.controlText_="Current Time",ta.registerComponent("CurrentTimeDisplay",ij);class iH extends iq{constructor(e,t){super(e,t),t=(e)=>this.updateContent(e),this.on(e,"durationchange",t),this.on(e,"loadstart",t),this.on(e,"loadedmetadata",t);}buildCSSClass(){return "vjs-duration";}updateContent(e){var t=this.player_.duration();this.updateTextNode_(t);}}iH.prototype.labelText_="Duration",iH.prototype.controlText_="Duration",ta.registerComponent("DurationDisplay",iH),ta.registerComponent("TimeDivider",class e extends ta{createEl(){var 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 iV extends iq{constructor(e,t){super(e,t),this.on(e,"durationchange",(e)=>this.updateContent(e));}buildCSSClass(){return "vjs-remaining-time";}createEl(){var e=super.createEl();return !1!==this.options_.displayNegative&&e.insertBefore(Q("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e;}updateContent(e){if("number"==typeof this.player_.duration()){let t;t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t);}}}iV.prototype.labelText_="Remaining Time",iV.prototype.controlText_="Remaining Time",ta.registerComponent("RemainingTimeDisplay",iV),ta.registerComponent("LiveDisplay",class t extends ta{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",(e)=>this.updateShowing(e));}createEl(){var t=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=Q("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(Q("span",{className:"vjs-control-text",textContent:e.t("Stream Type")+"\xa0"})),this.contentEl_.appendChild(document.createTextNode(e.t("LIVE"))),t.appendChild(this.contentEl_),t;}dispose(){this.contentEl_=null,super.dispose();}updateShowing(e){this.player().duration()===1/0?this.show():this.hide();}});class i9 extends iB{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(){var t=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",t),this.textEl_=Q("span",{className:"vjs-seek-to-live-text",textContent:e.t("LIVE")},{"aria-hidden":"true"}),t.appendChild(this.textEl_),t;}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 iz(e,t,i){return Math.min(i,Math.max(t,isNaN(e=Number(e))?t:e));}i9.prototype.controlText_="Seek to live, currently playing live",ta.registerComponent("SeekToLive",i9),t1=Object.freeze({__proto__:null,clamp:iz});class iW extends ta{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)=>
32this.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(){var e;this.enabled()&&(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){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||D||e.preventDefault(),eh(),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){var t=this.bar.el_.ownerDocument;ed(),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){let e=this.getProgress();return e!==this.progress_&&(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{var t=this.vertical()?"height":"width";this.bar.el().style[t]=(100*e).toFixed(2)+"%";})),e;}}getProgress(){return Number(iz(this.getPercent(),0,1).toFixed(4));}calculateDistance(e){return e=ep(this.el_,e),this.vertical()?e.y:e.x;}handleKeyDown(e){tn.isEventKey(e,"Left")||tn.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepBack()):tn.isEventKey(e,"Right")||tn.isEventKey(e,"Up")?(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");}}ta.registerComponent("Slider",iW);let iG=(e,t)=>iz(e/t*100,0,100).toFixed(2)+"%";ta.registerComponent("LoadProgressBar",class t extends ta{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",(e)=>this.update(e));}createEl(){var t=super.createEl("div",{className:"vjs-load-progress"}),i=Q("span",{className:"vjs-control-text"}),s=Q("span",{textContent:e.t("Loaded")}),r=document.createTextNode(": ");return this.percentageEl_=Q("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),t.appendChild(i),i.appendChild(s),i.appendChild(r),i.appendChild(this.percentageEl_),t;}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose();}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{var e=this.player_.liveTracker,t=this.player_.buffered(),e=e&&e.isLive()?e.seekableEnd():this.player_.duration(),i=this.player_.bufferedEnd(),s=this.partEls_,e=iG(i,e);this.percent_!==e&&(this.el_.style.width=e,J(this.percentageEl_,e),this.percent_=e);for(let r=0;r<t.length;r++){var n=t.start(r),a=t.end(r);let o=s[r];o||(o=this.el_.appendChild(Q()),s[r]=o),o.dataset.start===n&&o.dataset.end===a||(o.dataset.start=n,o.dataset.end=a,o.style.left=iG(n,i),o.style.width=iG(a-n,i));}for(let l=s.length;l>t.length;l--)this.el_.removeChild(s[l-1]);s.length=t.length;});}}),ta.registerComponent("TimeTooltip",class e extends ta{constructor(e,t){super(e,t),this.update=e5(eU(this,this.update),30);}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"});}update(e,t,i){var s=ec(this.el_),r=eu(this.player_.el()),t=e.width*t;if(r&&s){var n=e.left-r.left+t,t=e.width-t+(r.right-e.right);let a=s.width/2;n<a?a+=a-n:t<a&&(a=t),a<0?a=0:a>s.width&&(a=s.width),a=Math.round(a),this.el_.style.right=`-${a}px`,this.write(i);}}write(e){J(this.el_,e);}updateTime(e,t,i,s){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let r;var n,a,o=this.player_.duration();r=this.player_.liveTracker&&this.player_.liveTracker.isLive()?((a=(n=this.player_.liveTracker.liveWindow())-t*n)<1?"":"-")+tm(a,n):tm(i,o),this.update(e,t,r),s&&s();});}});class iX extends ta{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=e5(eU(this,this.update),30);}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"});}update(e,t){var i,s=this.getChild("timeTooltip");s&&(i=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),s.updateTime(e,t,i));}}iX.prototype.options_={children:[]},V||w||iX.prototype.options_.children.push("timeTooltip"),ta.registerComponent("PlayProgressBar",iX);class iK extends ta{constructor(e,t){super(e,t),this.update=e5(eU(this,this.update),30);}createEl(){return super.createEl("div",{className:"vjs-mouse-display"});}update(e,t){var i=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,i,()=>{this.el_.style.left=e.width*t+"px";});}}iK.prototype.options_={children:["timeTooltip"]},ta.registerComponent("MouseTimeDisplay",iK);class iY extends iW{constructor(e,t){super(e,t),this.setEventHandlers_();}setEventHandlers_(){this.update_=eU(this,this.update),this.update=e5(this.update_,30),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=(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 document&&"visibilityState" in document&&this.on(document,"visibilitychange",this.toggleVisibility_);}toggleVisibility_(e){"hidden"===document.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":e.t("Progress Bar")});}update(t){if("hidden"!==document.visibilityState){let i=super.update(
32);return this.requestNamedAnimationFrame("SeekBar#update",()=>{var t=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),s=this.player_.liveTracker;let r=this.player_.duration();s&&s.isLive()&&(r=this.player_.liveTracker.liveCurrentTime()),this.percent_!==i&&(this.el_.setAttribute("aria-valuenow",(100*i).toFixed(2)),this.percent_=i),this.currentTime_===t&&this.duration_===r||(this.el_.setAttribute("aria-valuetext",e.t("progress bar timing: currentTime={1} duration={2}",[tm(t,r),tm(r,r)],"{1} of {2}")),this.currentTime_=t,this.duration_=r),this.bar&&this.bar.update(eu(this.el()),this.getProgress());}),i;}}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(){var e=this.getCurrentTime_();let t;var i=this.player_.liveTracker;return i&&i.isLive()?(t=(e-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t;}handleMouseDown(e){ev(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),super.handleMouseDown(e));}handleMouseMove(e,t=!1){if(ev(e)&&!isNaN(this.player_.duration())){t||this.player_.scrubbing()||this.player_.scrubbing(!0);let i;if(t=this.calculateDistance(e),(e=this.player_.liveTracker)&&e.isLive()){if(.99<=t)return void e.seekToLiveEdge();var s=e.seekableStart(),r=e.liveCurrentTime();if((i=(i=(i=s+t*e.liveWindow())>=r?r:i)<=s?s+.1:i)===1/0)return;}else (i=t*this.player_.duration())===this.player_.duration()&&(i-=.1);this.userSeek_(i);}}enable(){super.enable();var e=this.getChild("mouseTimeDisplay");e&&e.show();}disable(){super.disable();var e=this.getChild("mouseTimeDisplay");e&&e.hide();}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?t_(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){var t,i=this.player_.liveTracker;tn.isEventKey(e,"Space")||tn.isEventKey(e,"Enter")?(e.preventDefault(),e.stopPropagation(),this.handleAction(e)):tn.isEventKey(e,"Home")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(0)):tn.isEventKey(e,"End")?(e.preventDefault(),e.stopPropagation(),i&&i.isLive()?this.userSeek_(i.liveCurrentTime()):this.userSeek_(this.player_.duration())):/^[0-9]$/.test(tn(e))?(e.preventDefault(),e.stopPropagation(),t=10*(tn.codes[tn(e)]-tn.codes[0])/100,i&&i.isLive()?this.userSeek_(i.seekableStart()+i.liveWindow()*t):this.userSeek_(this.player_.duration()*t)):tn.isEventKey(e,"PgDn")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):tn.isEventKey(e,"PgUp")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):super.handleKeyDown(e);}dispose(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden" in document&&"visibilityState" in document&&this.off(document,"visibilitychange",this.toggleVisibility_),super.dispose();}}iY.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},V||w||iY.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),ta.registerComponent("SeekBar",iY);class iQ extends ta{constructor(e,t){super(e,t),this.handleMouseMove=e5(eU(this,this.handleMouseMove),30),this.throttledHandleMouseSeek=e5(eU(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){var t,i,s,r,n=this.getChild("seekBar");n&&(t=n.getChild("playProgressBar"),i=n.getChild("mouseTimeDisplay"),t||i)&&(s=ec(r=n.el()),r=iz(r=ep(r,e).x,0,1),i&&i.update(s,r),t)&&t.update(s,n.getProgress());}handleMouseSeek(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e);}enabled(){return this.enabled_;}disable(){var e;
32this.children().forEach((e)=>e.disable&&e.disable()),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())&&(e=this.getChild("seekBar"),this.player_.scrubbing(!1),e.videoWasPlaying)&&t_(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",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0);}removeListenersAddedOnMousedownAndTouchstart(){var e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_);}handleMouseDown(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_);}handleMouseUp(e){var t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart();}}iQ.prototype.options_={children:["seekBar"]},ta.registerComponent("ProgressControl",iQ);class iJ extends iB{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],(e)=>this.handlePictureInPictureChange(e)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],(e)=>this.handlePictureInPictureEnabledChange(e)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable();}buildCSSClass(){return "vjs-picture-in-picture-control vjs-hidden "+super.buildCSSClass();}handlePictureInPictureAudioModeChange(){"audio"===this.player_.currentType().substring(0,5)||this.player_.audioPosterMode()||this.player_.audioOnlyMode()?(this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()):this.show();}handlePictureInPictureEnabledChange(){document.pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture" in window?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 document.exitPictureInPicture&&super.show();}}iJ.prototype.controlText_="Picture-in-Picture",ta.registerComponent("PictureInPictureToggle",iJ);class iZ extends iB{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",(e)=>this.handleFullscreenChange(e)),!1===document[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();}}iZ.prototype.controlText_="Fullscreen",ta.registerComponent("FullscreenToggle",iZ),ta.registerComponent("VolumeLevel",class e extends ta{createEl(){var e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e;}}),ta.registerComponent("VolumeLevelTooltip",class e extends ta{constructor(e,t){super(e,t),this.update=e5(eU(this,this.update),30);}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"});}update(e,t,i,s){if(!i){var i=eu(this.el_),r=eu(this.player_.el()),t=e.width*t;if(!r||!i)return;var n=e.left-r.left+t,t=e.width-t+(r.right-e.right);let a=i.width/2;n<a?a+=a-n:t<a&&(a=t),a<0?a=0:a>i.width&&(a=i.width),this.el_.style.right=`-${a}px`;}this.write(s+"%");}write(e){J(this.el_,e);}updateVolume(e,t,i,s,r){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,i,s.toFixed(0)),r&&r();});}});class se extends ta{constructor(e,t){super(e,t),this.update=e5(eU(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";});}}se.prototype.options_={children:["volumeLevelTooltip"]},ta.registerComponent("MouseVolumeLevelDisplay",se);class st extends iW{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":e.t("Volume Level"),"aria-live":"polite"});}handleMouseDown(e){ev(e)&&super.handleMouseDown(e);}handleMouseMove(e){var t,i,s,r=this.getChild("mouseVolumeLevelDisplay");r&&(t=eu(s=this.el()),i=this.vertical(),s=ep(s,e),s=iz(s=i?s.y:s.x,0,1),r.update(t,s,i)),ev(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){var 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);});}}st.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},V||w||st.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),st.prototype.playerEvent="volumechange",ta.registerComponent("
32VolumeBar",st);class si extends ta{constructor(e,t={}){var i,s;t.vertical=t.vertical||!1,(void 0===t.volumeBar||$(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),i=this,(s=e).tech_&&!s.tech_.featuresVolumeControl&&i.addClass("vjs-hidden"),i.on(s,"loadstart",function(){s.tech_.featuresVolumeControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden");}),this.throttledHandleMouseMove=e5(eU(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){var 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){var 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);}}si.prototype.options_={children:["volumeBar"]},ta.registerComponent("VolumeControl",si);class ss extends iB{constructor(e,t){var i,s;super(e,t),i=this,(s=e).tech_&&!s.tech_.featuresMuteControl&&i.addClass("vjs-hidden"),i.on(s,"loadstart",function(){s.tech_.featuresMuteControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden");}),this.on(e,["loadstart","volumechange"],(e)=>this.update(e));}buildCSSClass(){return "vjs-mute-control "+super.buildCSSClass();}handleClick(e){var 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_(){var e=this.player_.volume();let t=3;this.setIcon("volume-high"),V&&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),ei(this.el_,[0,1,2,3].reduce((e,t)=>e+`${t?" ":""}vjs-vol-`+t,"")),et(this.el_,"vjs-vol-"+t);}updateControlText_(){var e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e);}}ss.prototype.controlText_=e.t("Mute"),ta.registerComponent("MuteToggle",ss);class sr extends ta{constructor(e,t={}){void 0!==t.inline?t.inline=t.inline:t.inline=!0,(void 0===t.volumeControl||$(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){tn.isEventKey(e,"Esc")&&this.muteToggle.focus();}handleMouseOver(e){this.addClass("vjs-hover"),e1(document,"keyup",this.handleKeyPressHandler_);}
32handleMouseOut(e){this.removeClass("vjs-hover"),e4(document,"keyup",this.handleKeyPressHandler_);}handleKeyPress(e){tn.isEventKey(e,"Esc")&&this.handleMouseOut();}}sr.prototype.options_={children:["muteToggle","volumeControl"]},ta.registerComponent("VolumePanel",sr),ta.registerComponent("SkipForward",class extends iB{constructor(t,i){super(t,i),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon("forward-"+this.skipTime),this.controlText(e.t("Skip forward {1} seconds",[this.skipTime])),this.show()):this.hide();}getSkipForwardTime(){var e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward;}buildCSSClass(){return `vjs-skip-forward-${this.getSkipForwardTime()} `+super.buildCSSClass();}handleClick(e){if(!isNaN(this.player_.duration())){var t=this.player_.currentTime(),i=this.player_.liveTracker,i=i&&i.isLive()?i.seekableEnd():this.player_.duration();let s;s=t+this.skipTime<=i?t+this.skipTime:i,this.player_.currentTime(s);}}handleLanguagechange(){this.controlText(e.t("Skip forward {1} seconds",[this.skipTime]));}});class sn extends iB{constructor(t,i){super(t,i),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon("replay-"+this.skipTime),this.controlText(e.t("Skip backward {1} seconds",[this.skipTime])),this.show()):this.hide();}getSkipBackwardTime(){var 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){var t=this.player_.currentTime(),i=this.player_.liveTracker,i=i&&i.isLive()&&i.seekableStart();let s;s=i&&t-this.skipTime<=i?i:t>=this.skipTime?t-this.skipTime:0,this.player_.currentTime(s);}handleLanguagechange(){this.controlText(e.t("Skip backward {1} seconds",[this.skipTime]));}}sn.prototype.controlText_="Skip Backward",ta.registerComponent("SkipBackward",sn);class sa extends ta{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 ta&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_));}removeEventListenerForItem(e){e instanceof ta&&(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){(e=this.addChild(e))&&this.addEventListenerForItem(e);}createEl(){var e=this.options_.contentElType||"ul",e=(this.contentEl_=Q(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu"),super.createEl("div",{append:this.contentEl_,className:"vjs-menu"}));return e.appendChild(this.contentEl_),e1(e,"click",function(e){e.preventDefault(),e.stopImmediatePropagation();}),e;}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose();}handleBlur(e){let t=e.relatedTarget||document.activeElement;this.children().some((e)=>e.el()===t)||(e=this.menuButton_)&&e.buttonPressed_&&t!==e.el().firstChild&&e.unpressButton();}handleTapClick(e){var t;this.menuButton_&&(this.menuButton_.unpressButton(),Array.isArray(t=this.children()))&&(t=t.filter((t)=>t.el()===e.target)[0])&&"CaptionSettingsMenuItem"!==t.name()&&this.menuButton_.focus();}handleKeyDown(e){tn.isEventKey(e,"Left")||tn.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(tn.isEventKey(e,"Right")||tn.isEventKey(e,"Up"))&&(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){var t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),0<t.length&&(e<0?e=0:e>=t.length&&(e=t.length-1),t[this.focusedChild_=e].el_.focus());}}ta.registerComponent("Menu",sa);class so extends ta{constructor(e,t={}){super(e,t),this.menuButton_=new iB(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true"),e=iB.prototype.buildCSSClass(),this.menuButton_.el_.className=this.buildCSSClass()+" "+e,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0,t=(e)=>this.handleClick(e),this.handleMenuKeyUp_=(e)=>this.handleMenuKeyUp(e),this.on(this.menuButton_,"tap",t),this.on(this.menuButton_,"click",t),this.on(this.menuButton_,"keydown",(e)=>this.handleKeyDown(e)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),e1(document,"keyup",this.handleMenuKeyUp_);}),this.on("mouseleave",(e)=>this.handleMouseLeave(e)),this.on("keydown",(e)=>this.handleSubmenuKeyDown(e));}update(){var e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","fal
32se"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"));}createMenu(){var e,t=new sa(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title&&(e=Q("li",{className:"vjs-menu-title",textContent:te(this.options_.title),tabIndex:-1}),e=new ta(this.player_,{el:e}),t.addItem(e)),this.items=this.createItems(),this.items){for(let i=0;i<this.items.length;i++)t.addItem(this.items[i]);}return t;}createItems(){}createEl(){return super.createEl("div",{className:this.buildWrapperCSSClass()},{});}setIcon(e){super.setIcon(e,this.menuButton_.el_);}buildWrapperCSSClass(){let e="vjs-menu-button";return !0===this.options_.inline?e+="-inline":e+="-popup",`vjs-menu-button ${e} ${iB.prototype.buildCSSClass()} `+super.buildCSSClass();}buildCSSClass(){let e="vjs-menu-button";return !0===this.options_.inline?e+="-inline":e+="-popup",`vjs-menu-button ${e} `+super.buildCSSClass();}controlText(e,t=this.menuButton_.el()){return this.menuButton_.controlText(e,t);}dispose(){this.handleMouseLeave(),super.dispose();}handleClick(e){this.buttonPressed_?this.unpressButton():this.pressButton();}handleMouseLeave(e){this.removeClass("vjs-hover"),e4(document,"keyup",this.handleMenuKeyUp_);}focus(){this.menuButton_.focus();}blur(){this.menuButton_.blur();}handleKeyDown(e){tn.isEventKey(e,"Esc")||tn.isEventKey(e,"Tab")?(this.buttonPressed_&&this.unpressButton(),tn.isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus())):(tn.isEventKey(e,"Up")||tn.isEventKey(e,"Down"))&&!this.buttonPressed_&&(e.preventDefault(),this.pressButton());}handleMenuKeyUp(e){(tn.isEventKey(e,"Esc")||tn.isEventKey(e,"Tab"))&&this.removeClass("vjs-hover");}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e);}handleSubmenuKeyDown(e){(tn.isEventKey(e,"Esc")||tn.isEventKey(e,"Tab"))&&(this.buttonPressed_&&this.unpressButton(),tn.isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus()));}pressButton(){this.enabled_&&(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),V&&K()||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();}}ta.registerComponent("MenuButton",so);class sl extends so{constructor(e,t){let i=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),i){let s=eU(this,this.update);i.addEventListener("removetrack",s),i.addEventListener("addtrack",s),i.addEventListener("labelchange",s),this.player_.on("ready",s),this.player_.on("dispose",function(){i.removeEventListener("removetrack",s),i.removeEventListener("addtrack",s),i.removeEventListener("labelchange",s);});}}}ta.registerComponent("TrackButton",sl);let sh=["Tab","Esc","Up","Down","Right","Left"];class sd extends iO{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(t,i,s){return this.nonIconControl=!0,i=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},i),s),s=Q("span",{className:"vjs-menu-item-text",textContent:e.t(this.options_.label)}),this.player_.options_.experimentalSvgIcons?i.appendChild(s):i.replaceChild(s,i.querySelector(".vjs-icon-placeholder")),i;}handleKeyDown(e){sh.some((t)=>tn.isEventKey(e,t))||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","fal
32se"),this.controlText(""),this.isSelected_=!1));}}ta.registerComponent("MenuItem",sd);class su extends sd{constructor(e,t){var i=t.track;let s=e.textTracks(),r=(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),(...e)=>{this.handleTracksChange.apply(this,e);}),n=(...e)=>{this.handleSelectedLanguageChange.apply(this,e);};if(e.on(["loadstart","texttrackchange"],r),s.addEventListener("change",r),s.addEventListener("selectedlanguagechange",n),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],r),s.removeEventListener("change",r),s.removeEventListener("selectedlanguagechange",n);}),void 0===s.onchange){let a;this.on(["tap","click"],function(){if("object"!=typeof window.Event)try{a=new window.Event("change");}catch(e){}a||(a=document.createEvent("Event")).initEvent("change",!0,!0),s.dispatchEvent(a);});}this.handleTracksChange();}handleClick(e){var t=this.track,i=this.player_.textTracks();if(super.handleClick(e),i){for(let s=0;s<i.length;s++){var r=i[s];-1!==this.kinds.indexOf(r.kind)&&(r===t?"showing"!==r.mode&&(r.mode="showing"):"disabled"!==r.mode&&(r.mode="disabled"));}}}handleTracksChange(e){var t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t);}handleSelectedLanguageChange(e){var t;"showing"!==this.track.mode||(t=this.player_.cache_.selectedLanguage)&&t.enabled&&t.language===this.track.language&&t.kind!==this.track.kind||(this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind});}dispose(){this.track=null,super.dispose();}}ta.registerComponent("TextTrackMenuItem",su);class sc extends su{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){var t=this.player().textTracks();let i=!0;for(let s=0,r=t.length;s<r;s++){var n=t[s];if(-1<this.options_.kinds.indexOf(n.kind)&&"showing"===n.mode){i=!1;break;}}i!==this.isSelected_&&this.selected(i);}handleSelectedLanguageChange(e){var t=this.player().textTracks();let i=!0;for(let s=0,r=t.length;s<r;s++){var n=t[s];if(-1<["captions","descriptions","subtitles"].indexOf(n.kind)&&"showing"===n.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();}}ta.registerComponent("OffTextTrackMenuItem",sc);class sp extends sl{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t);}createItems(e=[],t=su){let i;this.label_&&(i=this.label_+" off"),e.push(new sc(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;var s=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let r=0;r<s.length;r++){var n,a=s[r];-1<this.kinds_.indexOf(a.kind)&&((n=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1})).addClass(`vjs-${a.kind}-menu-item`),e.push(n));}return e;}}ta.registerComponent("TextTrackButton",sp);class sm extends sd{constructor(e,t){var i=t.track,s=t.cue,r=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=s.text,t.selected=s.startTime<=r&&r<s.endTime,super(e,t),this.track=i,this.cue=s;}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime);}}ta.registerComponent("ChaptersTrackMenuItem",sm);class sg extends sp{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){e&&e.track&&"chapters"!==e.track.kind||((e=this.findChaptersTrack())!==this.track_?(this.setTrack(e),super.update()):(!this.items||e&&e.cues&&e.cues.length!==this.items.length)&&super.update());}setTrack(e){var t;this.track_!==e&&(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_&&((t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_))&&t.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null),this.track_=e,this.track_)&&(this.track_.mode="hidden",(t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_))&&t.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_));}
32findChaptersTrack(){var e=this.player_.textTracks()||[];for(let t=e.length-1;0<=t;t--){var i=e[t];if(i.kind===this.kind_)return i;}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:e.t(te(this.kind_));}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu();}createItems(){var e=[];if(this.track_){var t=this.track_.cues;if(t){for(let i=0,s=t.length;i<s;i++){var r=t[i],r=new sm(this.player_,{track:this.track_,cue:r});e.push(r);}}}return e;}}sg.prototype.kind_="chapters",sg.prototype.controlText_="Chapters",ta.registerComponent("ChaptersButton",sg);class sf extends sp{constructor(e,t,i){super(e,t,i),this.setIcon("audio-description");let s=e.textTracks(),r=eU(this,this.handleTracksChange);s.addEventListener("change",r),this.on("dispose",function(){s.removeEventListener("change",r);});}handleTracksChange(e){var t=this.player().textTracks();let i=!1;for(let s=0,r=t.length;s<r;s++){var n=t[s];if(n.kind!==this.kind_&&"showing"===n.mode){i=!0;break;}}i?this.disable():this.enable();}buildCSSClass(){return "vjs-descriptions-button "+super.buildCSSClass();}buildWrapperCSSClass(){return "vjs-descriptions-button "+super.buildWrapperCSSClass();}}sf.prototype.kind_="descriptions",sf.prototype.controlText_="Descriptions",ta.registerComponent("DescriptionsButton",sf);class sy extends sp{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();}}sy.prototype.kind_=e.t("Subtitles"),sy.prototype.controlText_=e.t("Subtitles"),ta.registerComponent("SubtitlesButton",sy);class s8 extends su{constructor(t,i){i.track={player:t,kind:i.kind,label:e.t("Settings"),selectable:!1,default:!1,mode:"disabled"},i.selectable=!1,i.name="CaptionSettingsMenuItem",super(t,i),this.addClass("vjs-texttrack-settings"),this.controlText(", opens "+i.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();}}ta.registerComponent("CaptionSettingsMenuItem",s8);class sv extends sp{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(){var e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new s8(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e);}}sv.prototype.kind_="captions",sv.prototype.controlText_="Captions",ta.registerComponent("CaptionsButton",sv);class s$ extends su{createEl(t,i,s){return i=(t=super.createEl(t,i,s)).querySelector(".vjs-menu-item-text"),"captions"===this.options_.track.kind&&(this.player_.options_.experimentalSvgIcons?this.setIcon("captions",t):i.appendChild(Q("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),i.appendChild(Q("span",{className:"vjs-control-text",textContent:" "+e.t("Captions")}))),t;}}ta.registerComponent("SubsCapsMenuItem",s$);class s_ extends sp{constructor(t,i={}){super(t,i),this.label_=e.t("Subtitles"),this.setIcon("subtitles"),-1<["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(te(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 s8(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,s$);}}s_.prototype.kinds_=["captions","subtitles"],s_.prototype.controlText_="Subtitles",ta.registerComponent("SubsCapsButton",s_);class sb extends sd{constructor(e,t){var i=t.track;let s=e.audioTracks(),r=(t.label=i.label||i.language||"Unknown",t.selected=i.enabled,super(e,t),this.track=i,this.addClass(`vjs-${i.kind}-menu-item`),(...e)=>{this.handleTracksChange.apply(this,e);});s.addEventListener("change",r),this.on("dispose",()=>{s.removeEventListener("change",r);});}createEl(t,i,s){return i=(t=super.createEl(t,i,s)).querySelector(".vjs-menu-item-text"),0<=["main-desc","description"].indexOf(this.options_.track.kind)&&(i.appendChild(Q("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),i.appendChild(Q("span",{className:"vjs-control-text",textContent:" "+e.t("Descriptions")}))),t;}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){var t=this.player_.audioTracks();for(let i=0;i<t.length;i++){var s=t[i];s!==this.track&&(s.enabled=s===this.track);}}}handleTracksChange(e){this.selected(this.track.enabled);}}ta.registerComponent("AudioTrackMenuItem",sb);class sT extends sl{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;var t=this.player_.audioTracks();for(let i=0;i<t.length;i++){var s=t[i];e.push(new sb(this.player_,{track:s,selectable:!0,multiSelectable:!1}));}return e;}}sT.prototype.controlText_="Audio Track",ta.registerComponent("AudioTrackButton",sT);class sS extends sd{constructor(e,t){var i=t.rate,s=parseFloat(i,10);t.label=i,t.selected=s===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=i,this.rate=s,this.on(e,"ratechange",(e)=>this.update(e));}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate);}update(e){this.selected(this.player().playbackRate()===this.rate);}}sS.prototype.contentElType="button",ta.registerComponent("PlaybackRateMenuItem",sS);class s0 extends so{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(){var e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=Q("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(){var e=this.playbackRates(),t=[];for(let i=e.length-1;0<=i;i--)t.push(new sS(this.player(),{rate:e[i]+"x"}));return t;}handlePlaybackRateschange(e){this.update();}playbackRates(){var e=this.player();return e.playbackRates&&e.playbackRates()||[];}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&0<this.playbackRates().length;}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden");}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x");}}s0.prototype.controlText_="Playback Rate",ta.registerComponent("PlaybackRateMenuButton",s0);class sE extends ta{buildCSSClass(){return "vjs-spacer "+super.buildCSSClass();}createEl(e="div",t={},i={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,i);}}ta.registerComponent("Spacer",sE),ta.registerComponent("CustomControlSpacer",class extends sE{buildCSSClass(){return "vjs-custom-control-spacer "+super.buildCSSClass();}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:"\xa0"});}});class sk extends ta{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"});}}sk.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]},ta.registerComponent("ControlBar",sk);class sw extends t0{constructor(e,t){super(e,t),this.on(e,"error",(e)=>this.open(e));}buildCSSClass(){return "vjs-error-display "+super.buildCSSClass();}content(){var t=this.player().error();return t?e.t(t.message):"";}}sw.prototype.options_=Object.assign({}
32,t0.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),ta.registerComponent("ErrorDisplay",sw);let sC="vjs-text-track-settings";var sx,tJ=["#000","Black"],ts=["#0f0","Blue"],s2=["#0ff","Cyan"],sI=["#0f0","Green"],sL=["#f0f","Magenta"],sD=["#f00","Red"],sA=["#fff","White"],sP=["#ff0","Yellow"],s3=["1","Opaque"],s6=["0.5","Semi-Transparent"],s1=["0","Transparent"];let s4={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:e.t("Color"),options:[tJ,sA,sD,sI,ts,sP,sL,s2]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:e.t("Opacity"),options:[s3,s6,s1],default:2},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:e.t("Color"),options:[sA,tJ,sD,sI,ts,sP,sL,s2]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:e.t("Text Edge Style"),options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]],default:4},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:e.t("Font"),options:[["default","Text 1"],["sized1","Text 2"],["sized2","Text 3"],["sized3","Text 4"],["sized4","Text 5"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:e.t("Font Size"),options:[["1.00","100%"],["1.25","125%"],["1.50","150%"]],default:window.innerWidth<=980?0:2,parser:(e)=>"1.00"===e?null:Number(e)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:e.t("Opacity"),options:[s3,s6]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:e.t("Color")},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:e.t("Opacity"),options:[s1,s6,s3]}};function sO(e,t){if((e=t?t(e):e)&&"none"!==e)return e;}function sR(e){let t=e.el();if(!t.resetSourceWatch_){let i={},s=s5(e),r=(i)=>(...s)=>(s=i.apply(t,s),sN(e),s);["append","appendChild","insertAdjacentHTML"].forEach((e)=>{t[e]&&(i[e]=t[e],t[e]=r(i[e]));}),Object.defineProperty(t,"innerHTML",_(s,{set:r(s.set)})),t.resetSourceWatch_=()=>
32{t.resetSourceWatch_=null,Object.keys(i).forEach((e)=>{t[e]=i[e];}),Object.defineProperty(t,"innerHTML",s);},e.one("sourceset",t.resetSourceWatch_);}}s4.windowColor.options=s4.backgroundColor.options,ta.registerComponent("TextTrackSettings",class t extends t0{constructor(t,i){i.temporary=!1,super(t,i),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.endDialog=Q("p",{className:"vjs-control-text",textContent:e.t("End of dialog window.")}),this.el().appendChild(this.endDialog),this.setDefaults(),void 0===i.persistTextTrackSettings&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings),this.on(this.$(".vjs-done-button"),"click",()=>{this.saveSettings(),this.close();}),this.on(this.$(".vjs-default-button"),"click",()=>{this.setDefaults(),this.updateDisplay();}),f(s4,(e)=>{this.on(this.$(e.selector),"change",this.updateDisplay);}),this.options_.persistTextTrackSettings&&this.restoreSettings();}dispose(){this.endDialog=null,super.dispose();}createElSelect_(t,i="",s="label"){t=s4[t];let r=t.id.replace("%s",this.id_),n=[i,r].join(" ").trim();return [`<${s} id="${r}" class="${"label"===s?"vjs-label":""}">`,e.t(t.label),`</${s}>`,`<select aria-labelledby="${n}">`].concat(t.options.map((t)=>{var i=r+"-"+t[1].replace(/\W+/g,"");return [`<option id="${i}" value="${t[0]}" `,`aria-labelledby="${n} ${i}">`,e.t(t[1]),"</option>"].join("");})).concat("</select>").join("");}createElFgColor_(){var t="captions-text-legend-"+this.id_;return ['<fieldset class="vjs-fg vjs-track-setting">',`<legend id="${t}">`,e.t("Text"),"</legend>",'<span class="vjs-text-color">',this.createElSelect_("color",t),"</span>",'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",t),"</span>","</fieldset>"].join("");}createElBgColor_(){var t="captions-background-"+this.id_;return ['<fieldset class="vjs-bg vjs-track-setting">',`<legend id="${t}">`,e.t("Text Background"),"</legend>",'<span class="vjs-bg-color">',this.createElSelect_("backgroundColor",t),"</span>",'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",t),"</span>","</fieldset>"].join("");}createElWinColor_(){var t="captions-window-"+this.id_;return ['<fieldset class="vjs-window vjs-track-setting">',`<legend id="${t}">`,e.t("Caption Area Background"),"</legend>",'<span class="vjs-window-color">',this.createElSelect_("windowColor",t),"</span>",'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",t),"</span>","</fieldset>"].join("");}createElColors_(){return Q("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")});}createElFont_(){return Q("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")});}createElControls_(){var t=e.t("restore all settings to the default values");return Q("div",{className:"vjs-track-settings-controls",innerHTML:[`<button type="button" class="vjs-default-button" title="${t}">`,e.t("Reset"),`<span class="vjs-control-text"> ${t}</span>`,"</button>",`<button type="button" class="vjs-done-button">${e.t("Done")}</button>`].join("")});}content(){return [this.createElColors_(),this.createElFont_(),this.createElControls_()];}label(){return e.t("Caption Settings Dialog");}description(){return e.t("Beginning of dialog window. Escape will cancel and close the window.");}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings";}getValues(){return y(s4,(e,t,i)=>{s=this.$(t.selector),t=t.parser;var s=sO(s.options[s.options.selectedIndex].value,t);return void 0!==s&&(e[i]=s),e;},{});}setValues(e){f(s4,(t,i)=>{var s=this.$(t.selector),r=e[i],n=t.parser;if(r){for(let a=0;a<s.options.length;a++)if(sO(s.options[a].value,n)===r){s.selectedIndex=a;break;}}});}setDefaults(){f(s4,(e)=>{var t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t;});}restoreSettings(){let e;try{e=JSON.parse(window.localStorage.getItem(sC));}catch(t){p.warn(t);}e&&this.setValues(e);}saveSettings(){if(this.options_.persistTextTrackSettings){var e=this.getValues();try{Object.keys(e).length?window.localStorage.setItem(sC,JSON.stringify(e)):window.localStorage.removeItem(sC);}catch(t){p.warn(t);}}}updateDisplay(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay();}conditionalBlur_(){this.previouslyActiveEl_=null;var e=this.player_.controlBar,t=e&&e.subsCapsButton,e=e&&e.captionsButton;
32t?t.focus():e&&e.focus();}handleLanguagechange(){this.fill();}}),ta.registerComponent("ResizeManager",class t extends ta{constructor(e,t){let i=t.ResizeObserver||window.ResizeObserver;super(e,_({createEl:!(i=null!==t.ResizeObserver&&i),reportTouchActivity:!1},t)),this.ResizeObserver=t.ResizeObserver||window.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=eB(()=>{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){let e=this.debouncedHandler_,t=this.unloadListener_=function(){e4(this,"resize",e),e4(this,"unload",t),t=null;};e1(this.el_.contentWindow,"unload",t),e1(this.el_.contentWindow,"resize",e);}},this.one("load",this.loadListener_));}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:e.t("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();}}),ta.registerComponent("LiveTracker",class e extends ta{constructor(e,t){super(e,_({trackingThreshold:20,liveTolerance:15},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_(){var e=this.player_.seekable();if(e&&e.length){var e=Number(window.performance.now().toFixed(4)),t=-1===this.lastTime_?0:(e-this.lastTime_)/1e3,e=(this.lastTime_=e,this.pastSeekEnd_=this.pastSeekEnd()+t,this.liveCurrentTime()),t=this.player_.currentTime();let i=this.player_.paused()||this.seekedBehindLive_||Math.abs(e-t)>this.options_.liveTolerance;(i=!!this.timeupdateSeen_&&e!==1/0&&i)!==this.behindLiveEdge_&&(this.behindLiveEdge_=i,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(){var e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&2<e,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(){var e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0;}
32seekableStart(){var e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0;}liveWindow(){var 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(){var 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();}}),ta.registerComponent("TitleBar",class e extends ta{constructor(e,t){super(e,t),this.on("statechanged",(e)=>this.updateDom_()),this.updateDom_();}createEl(){return this.els={title:Q("div",{className:"vjs-title-bar-title",id:"vjs-title-bar-title-"+eL++}),description:Q("div",{className:"vjs-title-bar-description",id:"vjs-title-bar-description-"+eL++})},Q("div",{className:"vjs-title-bar"},{},b(this.els));}updateDom_(){var e=this.player_.tech_;let t=e&&e.el_,i={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach((e)=>{var s=this.state[e],r=this.els[e],e=i[e];eg(r),s&&J(r,s),t&&(t.removeAttribute(e),s)&&t.setAttribute(e,r.id);}),this.state.title||this.state.description?this.show():this.hide();}update(e){this.setState(e);}dispose(){var e=this.player_.tech_,e=e&&e.el_;e&&(e.removeAttribute("aria-labelledby"),e.removeAttribute("aria-describedby")),super.dispose(),this.els=null;}});let sN=(e)=>{var t=e.el();if(t.hasAttribute("src"))e.triggerSourceset(t.src);else{var i=e.$$("source"),s=[];let r="";if(!i.length)return !1;for(let n=0;n<i.length;n++){var a=i[n].src;a&&-1===s.indexOf(a)&&s.push(a);}if(!s.length)return !1;1===s.length&&(r=s[0]),e.triggerSourceset(r);}return !0;},sM=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML;},set(e){for(var t=document.createElement(this.nodeName.toLowerCase()),i=(t.innerHTML=e,document.createDocumentFragment());t.childNodes.length;)i.appendChild(t.childNodes[0]);return this.innerText="",window.Element.prototype.appendChild.call(this,i),this.innerHTML;}}),sU=(e,t)=>{let i={};for(let s=0;s<e.length&&!((i=Object.getOwnPropertyDescriptor(e[s],t))&&i.set&&i.get);s++);return i.enumerable=!0,i.configurable=!0,i;},s5=(e)=>sU([e.el(),window.HTMLMediaElement.prototype,window.Element.prototype,sM],"innerHTML"),sB=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?tA(window.Element.prototype.getAttribute.call(this,"src")):"";},set(e){return window.Element.prototype.setAttribute.call(this,"src",e),e;}});class s7 extends iC{constructor(e,t){super(e,t),t=e.source;let i=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&"VIDEO"===this.el_.tagName,t&&(this.el_.currentSrc!==t.src||e.tag&&3===e.tag.initNetworkState_)?this.setSource(t):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){var s=this.el_.childNodes;let r=s.length;for(var n=[];r--;){var a=s[r];"track"===a.nodeName.toLowerCase()&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(a),this.remoteTextTracks().addTrack(a.track),this.textTracks().addTrack(a.track),i||this.el_.hasAttribute("crossorigin")||!tP(a.src)||(i=!0)):n.push(a));}for(let o=0;o<n.length;o++)this.el_.removeChild(n[o]);}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&i&&p.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_(),(B||U)&&!0===e.nativeControlsForTouch&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady();}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),s7.disposeMediaElement(this.el_),this.options_=null,super.dispose();}setupSourcesetHandling_(){!function e(t){if(t.featuresSourceset){let i=t.el();if(!i.resetSourceset_){var s;s=t;let r=sU([s.el(),window.HTMLMediaElement.prototype,sB],"src"),n=i.setAttribute,a=i.load;Object.defineProperty(i,"src",_(r,{set:(e)=>
32(e=r.set.call(i,e),t.triggerSourceset(i.src),e)})),i.setAttribute=(e,s)=>(s=n.call(i,e,s),/src/i.test(e)&&t.triggerSourceset(i.src),s),i.load=()=>{var e=a.call(i);return sN(t)||(t.triggerSourceset(""),sR(t)),e;},i.currentSrc?t.triggerSourceset(i.currentSrc):sN(t)||sR(t),i.resetSourceset_=()=>{i.resetSourceset_=null,i.load=a,i.setAttribute=n,Object.defineProperty(i,"src",r),i.resetSourceWatch_&&i.resetSourceWatch_();};}}}(this);}restoreMetadataTracksInIOSNativePlayer_(){let e=this.textTracks(),t,i=()=>{t=[];for(let i=0;i<e.length;i++){var s=e[i];"metadata"===s.kind&&t.push({track:s,storedMode:s.mode});}},s=(i(),e.addEventListener("change",i),this.on("dispose",()=>e.removeEventListener("change",i)),()=>{for(let i=0;i<t.length;i++){var r=t[i];"disabled"===r.track.mode&&r.track.mode!==r.storedMode&&(r.track.mode=r.storedMode);}e.removeEventListener("change",s);});this.on("webkitbeginfullscreen",()=>{e.removeEventListener("change",i),e.removeEventListener("change",s),e.addEventListener("change",s);}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",i),e.addEventListener("change",i),e.removeEventListener("change",s);});}overrideNative_(e,t){if(t===this[`featuresNative${e}Tracks`]){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){var t=tK[e];let i=this.el()[t.getterName],s=this[t.getterName]();if(this[`featuresNative${t.capitalName}Tracks`]&&i&&i.addEventListener){let r={change:(t)=>{var i={type:"change",target:s,currentTarget:s,srcElement:s};s.trigger(i),"text"===e&&this[tY.remoteText.getterName]().trigger(i);},addtrack(e){s.addTrack(e.track);},removetrack(e){s.removeTrack(e.track);}},n=function(){var e=[];for(let t=0;t<s.length;t++){let r=!1;for(let n=0;n<i.length;n++)if(i[n]===s[t]){r=!0;break;}r||e.push(s[t]);}for(;e.length;)s.removeTrack(e.shift());};this[t.getterName+"Listeners_"]=r,Object.keys(r).forEach((e)=>{let t=r[e];i.addEventListener(e,t),this.on("dispose",(s)=>i.removeEventListener(e,t));}),this.on("loadstart",n),this.on("dispose",(e)=>this.off("loadstart",n));}}proxyNativeTracks_(){tK.names.forEach((e)=>{this.proxyNativeTracksForType_(e);});}createEl(){let e=this.options_.tag;e&&(this.options_.playerElIngest||this.movingMediaElementInDOM)||(e?(t=e.cloneNode(!0),e.parentNode&&e.parentNode.insertBefore(t,e),s7.disposeMediaElement(e),e=t):(e=document.createElement("video"),t=_({},this.options_.tag&&en(this.options_.tag)),B&&!0===this.options_.nativeControlsForTouch||delete t.controls,er(e,Object.assign(t,{id:this.options_.techId,class:"vjs-tech"}))),e.playerId=this.options_.playerId),void 0!==this.options_.preload&&eo(e,"preload",this.options_.preload),void 0!==this.options_.disablePictureInPicture&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);var t,i=["loop","muted","playsinline","autoplay"];for(let s=0;s<i.length;s++){var r=i[s],n=this.options_[r];void 0!==n&&(n?eo(e,r,r):el(e,r),e[r]=n);}return e;}handleLateInit_(e){if(0!==e.networkState&&3!==e.networkState)if(0===e.readyState){let t=!1,i=function(){t=!0;},s=(this.on("loadstart",i),function(){t||this.trigger("loadstart");});this.on("loadedmetadata",s),this.ready(function(){this.off("loadstart",i),this.off("loadedmetadata",s),t||this.trigger("loadstart");});}else{let r=["loadstart"];r.push("loadedmetadata"),2<=e.readyState&&r.push("loadeddata"),3<=e.readyState&&r.push("canplay"),4<=e.readyState&&r.push("canplaythrough"),this.ready(function(){r.forEach(function(e){this.trigger(e);},this);});}}setScrubbing(e){this.isScrubbing_=e;}scrubbing(){return this.isScrubbing_;}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&z?this.el_.fastSeek(e):this.el_.currentTime=e;}catch(t){p(t,"Video is not ready. (Video.js)");}}duration(){if(this.el_.duration===1/0&&w&&D&&0===this.el_.currentTime){let e=()=>{0<this.el_.currentTime&&(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;}
32proxyWebkitFullscreen_(){if("webkitDisplayingFullscreen" in this.el_){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)t_(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen();}catch(t){this.trigger("fullscreenerror",t);}},0);else try{e.webkitEnterFullScreen();}catch(t){this.trigger("fullscreenerror",t);}}exitFullScreen(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",Error("The video is not fullscreen"));}requestPictureInPicture(){return this.el_.requestPictureInPicture();}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e);}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e);}src(e){if(void 0===e)return this.el_.src;this.setSrc(e);}reset(){s7.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){var t;return this.featuresNativeTextTracks?(t=document.createElement("track"),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):super.createRemoteTextTrack(e);}addRemoteTextTrack(e,t){return e=super.addRemoteTextTrack(e,t),this.featuresNativeTextTracks&&this.el().appendChild(e),e;}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){var t=this.$$("track");let i=t.length;for(;i--;)e!==t[i]&&e!==t[i].track||this.el().removeChild(t[i]);}}getVideoPlaybackQuality(){var e;return "function"==typeof this.el().getVideoPlaybackQuality?this.el().getVideoPlaybackQuality():(e={},void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),window.performance&&(e.creationTime=window.performance.now()),e);}}T(s7,"TEST_VID",function(){var e,t;if(G())return e=document.createElement("video"),(t=document.createElement("track")).kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e;}),s7.isSupported=function(){try{s7.TEST_VID.volume=.5;}catch(e){return !1;}return !(!s7.TEST_VID||!s7.TEST_VID.canPlayType);},s7.canPlayType=function(e){return s7.TEST_VID.canPlayType(e);},s7.canPlaySource=function(e,t){return s7.canPlayType(e.type);},s7.canControlVolume=function(){try{let e=s7.TEST_VID.volume;s7.TEST_VID.volume=e/2+.1;var t=e!==s7.TEST_VID.volume;return t&&V?(window.setTimeout(()=>{s7&&s7.prototype&&(s7.prototype.featuresVolumeControl=e!==s7.TEST_VID.volume);}),!1):t;}catch(i){return !1;}},s7.canMuteVolume=function(){try{var e=s7.TEST_VID.muted;return s7.TEST_VID.muted=!e,s7.TEST_VID.muted?eo(s7.TEST_VID,"muted","muted"):el(s7.TEST_VID,"muted"),e!==s7.TEST_VID.muted;}catch(t){return !1;}},s7.canControlPlaybackRate=function(){if(w&&D&&P<58)return !1;try{var e=s7.TEST_VID.playbackRate;return s7.TEST_VID.playbackRate=e/2+.1,e!==s7.TEST_VID.playbackRate;}catch(t){return !1;}},s7.canOverrideAttributes=function(){try{var e=()=>{};Object.defineProperty(document.createElement("video"),"src",{get:e,set:e}),Object.defineProperty(document.createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(document.createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(document.createElement("audio"),"innerHTML",{get:e,set:e});}catch(t){return !1;}return !0;},s7.supportsNativeTextTracks=function(){return z||V&&D;},s7.supportsNativeVideoTracks=function(){return !(!s7.TEST_VID||!s7.TEST_VID.videoTracks);},s7.supportsNativeAudioTracks=function(){return !(!s7.TEST_VID||!s7.TEST_VID.audioTracks);},s7.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"]].forEac
32h(function([e,t]){T(s7.prototype,e,()=>s7[t](),!0);}),s7.prototype.featuresVolumeControl=s7.canControlVolume(),s7.prototype.movingMediaElementInDOM=!V,s7.prototype.featuresFullscreenResize=!0,s7.prototype.featuresProgressEvents=!0,s7.prototype.featuresTimeupdateEvents=!0,s7.prototype.featuresVideoFrameCallback=!(!s7.TEST_VID||!s7.TEST_VID.requestVideoFrameCallback),s7.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);if(e.removeAttribute("src"),"function"==typeof e.load)try{e.load();}catch(t){}}},s7.resetMediaElement=function(e){if(e){var t=e.querySelectorAll("source");let i=t.length;for(;i--;)e.removeChild(t[i]);if(e.removeAttribute("src"),"function"==typeof e.load)try{e.load();}catch(s){}}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(e){s7.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e);};}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(e){s7.prototype["set"+te(e)]=function(t){(this.el_[e]=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){s7.prototype[e]=function(){return this.el_[e];};}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(e){s7.prototype["set"+te(e)]=function(t){this.el_[e]=t;};}),["pause","load","play"].forEach(function(e){s7.prototype[e]=function(){return this.el_[e]();};}),iC.withSourceHandlers(s7),s7.nativeSourceHandler={},s7.nativeSourceHandler.canPlayType=function(e){try{return s7.TEST_VID.canPlayType(e);}catch(t){return "";}},s7.nativeSourceHandler.canHandleSource=function(e,t){return e.type?s7.nativeSourceHandler.canPlayType(e.type):e.src?(e=t3(e.src),s7.nativeSourceHandler.canPlayType("video/"+e)):"";},s7.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src);},s7.nativeSourceHandler.dispose=function(){},s7.registerSourceHandler(s7.nativeSourceHandler),iC.registerTech("Html5",s7);let sF=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],sq={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},sj=["tiny","xsmall","small","medium","large","xlarge","huge"],sH={},sV=(sj.forEach((e)=>{var t="x"===e.charAt(0)?"x-"+e.substring(1):e;sH[e]="vjs-layout-"+t;}),{tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0});class s9 extends ta{constructor(i,s,r){if(i.id=i.id||s.id||"vjs_video_"+eL++,(s=Object.assign(s9.getTagSettings(i),s)).initChildren=!1,s.createEl=!1,s.evented=!1,s.reportTouchActivity=!1,s.language||(o=i.closest("[lang]"))&&(s.language=o.getAttribute("lang")),super(null,s,r),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.isFullscreen_=!1,this.log=m(this.id_),this.fsApi_=n,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_={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=i,this.tagAttributes=i&&en(i),this.language(this.options_.language),s.languages){let a={};
32Object.getOwnPropertyNames(s.languages).forEach(function(e){a[e.toLowerCase()]=s.languages[e];}),this.languages_=a;}else this.languages_=s9.prototype.options_.languages;this.resetCache_(),this.poster_=s.poster||"",this.controls_=!!s.controls,i.controls=!1,i.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],i.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),s.plugins&&Object.keys(s.plugins).forEach((e)=>{if("function"!=typeof this[e])throw Error(`plugin "${e}" does not exist`);}),this.scrubbing_=!1,this.el_=this.createEl(),eY(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(e1(document,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);var o=_(this.options_),r=(s.plugins&&Object.keys(s.plugins).forEach((e)=>{this[e](s.plugins[e]);}),s.debug&&this.debug(!0),this.options_.playerOptions=o,this.middleware_=[],this.playbackRates(s.playbackRates),s.experimentalSvgIcons&&((r=(new window.DOMParser()
vendor: 8,141 bytes, line 32
32).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-
vendor: 8,220 bytes, line 32
327.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 1
32792 1792" id="vjs-icon-twitter">\n      <path d="M1684 408q-67 98-162 167 1 14 1 42 0 130-38 259.5T1369.5 1125 1185 1335.5t-258 146-323 54.5q-271 0-496-145 35 4 78 4 225 0 401-138-105-2-188-64.5T285 1033q33 5 61 5 43 0 85-11-112-23-185.5-111.5T172 710v-4q68 38 146 41-66-44-105-115t-39-154q0-88 44-163 121 149 294.5 238.5T884 653q-8-38-8-74 0-134 94.5-228.5T1199 256q140 0 236 102 109-21 205-78-37 115-142 178 93-10 186-50z"></path>\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")).querySelector("parsererror")?(p.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null):((o=r.documentElement).style.display="none",this.el_.appendChild(o),this.addClass("vjs-svg-icons-enabled"))),this.initChildren(),this.isAudio("audio"===i.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",e.t("Audio Player")):this.el_.setAttribute("aria-label",e.t("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),B&&this.addClass("vjs-touch-enabled"),V||this.addClass("vjs-workinghover"),s9.players[this.id_]=this,t.split(".")[0]);this.addClass("vjs-v"+r),this.userActive(!0),this.reportUserActivity(),this.one("play",(e)=>this.listenForUserActivity_(e)),this.on("keydown",(e)=>this.handleKeyDown(e)),this.on("languagechange",(e)=>this.handleLanguagechange(e)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode);});}dispose(){var e;
32this.trigger("dispose"),this.off("dispose"),e4(document,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),e4(document,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),s9.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),e=this,i2[e.id()]=null,tQ.names.forEach((e)=>{(e=this[tQ[e].getterName]())&&e.off&&e.off();}),super.dispose({restoreEl:this.options_.restoreEl});}createEl(){let e=this.tag,t,i=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player"),s="video-js"===this.tag.tagName.toLowerCase(),r=(i?t=this.el_=e.parentNode:s||(t=this.el_=super.createEl("div")),en(e));if(s){for(t=this.el_=e,e=this.tag=document.createElement("video");t.children.length;)e.appendChild(t.firstChild);ee(t,"video-js")||et(t,"video-js"),t.appendChild(e),i=this.playerElIngest_=t,Object.keys(t).forEach((i)=>{try{e[i]=t[i];}catch(s){}});}e.setAttribute("tabindex","-1"),r.tabindex="-1",D&&N&&(e.setAttribute("role","application"),r.role="application"),e.removeAttribute("width"),e.removeAttribute("height"),"width" in r&&delete r.width,"height" in r&&delete r.height,Object.getOwnPropertyNames(r).forEach(function(i){s&&"class"===i||t.setAttribute(i,r[i]),s&&e.setAttribute(i,r[i]);}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",(e.player=t.player=this).addClass("vjs-paused"),!0!==window.VIDEOJS_NO_DYNAMIC_STYLE&&(this.styleEl_=ex("vjs-styles-dimensions"),n=e$(".vjs-styles-defaults"),(a=e$("head")).insertBefore(this.styleEl_,n?n.nextSibling:a.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);var n,a,o=e.getElementsByTagName("a");for(let l=0;l<o.length;l++){var h=o.item(l);et(h,"vjs-hidden"),h.setAttribute("hidden","hidden");}return e.initNetworkState_=e.networkState,e.parentNode&&!i&&e.parentNode.insertBefore(t,e),Z(e,t),this.children_.unshift(e),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=t;}crossOrigin(e){if(void 0===e)return this.techGet_("crossOrigin");null!==e&&"anonymous"!==e&&"use-credentials"!==e?p.warn(`crossOrigin must be null,  "anonymous" or "use-credentials", given "${e}"`):(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){var i,s=e+"_";if(void 0===t)return this[s]||0;""===t||"auto"===t?(this[s]=void 0,this.updateStyleEl_()):(i=parseFloat(t),isNaN(i)?p.error(`Improper value "${t}" supplied for for `+e):(this[s]=i,this.updateStyleEl_()));}fluid(e){var t;if(void 0===e)return !!this.fluid_;this.fluid_=!!e,eH(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),e=this,t=()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_);},eH(e)?t():(e.eventedCallbacks||(e.eventedCallbacks=[]),e.eventedCallbacks.push(t))):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_(){if(!0===window.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;var i=this.tech_&&this.tech_.el();i&&(0<=e&&(i.width=e),0<=t)&&(i.height=t);}else{let s,r,n,a;i=(i=(n=void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:0<this.videoWidth()?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"))[1]/i[0],s=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/i:this.videoWidth()||300,r=void 0!==this.height_?this.height_:s*i,a=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(a),e2(this.styleEl_,`
33      .${a} {
34        width: ${s}px;
35        height: ${r}px;
36      }
37
38      .${a}.vjs-fluid:not(.vjs-audio-only-mode) {
39        padding-top: ${100*i}%;
40      }
41    `);}}loadTech_(e,t){this.tech_&&this.unloadTech_();var i,s,r=te(e),n=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==r&&this.tag&&(iC.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=r,this.isReady_=!1;let a=this.autoplay(),o={source:t,autoplay:a="string"!=typeof this.autoplay()&&(!0!==this.autoplay()||!this.options_.normalizeAutoplay)&&a,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+`_${n}_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};
41if(tQ.names.forEach((e)=>{o[(e=tQ[e]).getterName]=this[e.privateName];}),Object.assign(o,this.options_[r]),Object.assign(o,this.options_[n]),Object.assign(o,this.options_[e.toLowerCase()]),this.tag&&(o.tag=this.tag),t&&t.src===this.cache_.src&&0<this.cache_.currentTime&&(o.startTime=this.cache_.currentTime),!(n=iC.getTech(e)))throw Error(`No Tech named '${r}' exists! '${r}' should be registered using videojs.registerTech()'`);this.tech_=new n(o),this.tech_.ready(eU(this,this.handleTechReady_),!0),i=this.textTracksJson_||[],s=this.tech_,i.forEach(function(e){let t=s.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach((e)=>t.addCue(e));}),s.textTracks(),sF.forEach((e)=>{this.on(this.tech_,e,(t)=>this[`handleTech${te(e)}_`](t));}),Object.keys(sq).forEach((e)=>{this.on(this.tech_,e,(t)=>{0===this.tech_.playbackRate()&&this.tech_.seeking()?this.queuedCallbacks_.push({callback:this[`handleTech${sq[e]}_`].bind(this),event:t}):this[`handleTech${sq[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"===r&&this.tag||Z(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null);}unloadTech_(){tQ.names.forEach((e)=>{this[(e=tQ[e]).privateName]=this[e.getterName]();}),this.textTracksJson_=tT(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&&p.warn("Using the tech directly can be dangerous. I hope you know 
41what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_;}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){if(this.tech_&&"string"==typeof e){var t=()=>{let e=this.muted(),t=(this.muted(!0),()=>{this.muted(e);});this.playTerminatedQueue_.push(t);var i=this.play();if(t$(i))return i.catch((e)=>{throw t(),Error("Rejection at manualAutoplay. Restoring muted value. "+(e||""));});};let i;if("any"!==e||this.muted()?i="muted"!==e||this.muted()?this.play():t():t$(i=this.play())&&(i=i.catch(t)),t$(i))return i.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;var i=e.cache_.sources.filter((e)=>e.src===t);if(i.length)return i[0].type;var s=e.$$("source");for(let r=0;r<s.length;r++){var n=s[r];if(n.type&&n.src&&n.src===t)return n.type;}return i1(t);})(this,t)),this.cache_.source=_({},e,{src:t,type:i});var e=this.cache_.sources.filter((e)=>e.src&&e.src===t),s=[],r=this.$$("source"),n=[];for(let a=0;a<r.length;a++){var o=en(r[a]);s.push(o),o.src&&o.src===t&&n.push(o.src);}n.length&&!e.length?this.cache_.sources=s:e.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t;}handleTechSourceset_(e){if(!this.changingSrc_){let t=(e)=>this.updateSourceCaches_(e);var i=this.currentSource().src,s=e.src;(t=!i||/^blob:/.test(i)||!/^blob:/.test(s)||this.lastSource_&&(this.lastSource_.tech===s||this.lastSource_.player===i)?t:()=>{})(s),e.src||this.tech_.any(["sourceset","loadstart"],(e)=>{"sourceset"!==e.type&&(e=this.techGet_("currentSrc"),this.lastSource_.tech=e,this.updateSourceCaches_(e));});}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_(){0<this.tech_.playbackRate()&&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");}
41handleTechSeeked_(){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()?t_(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.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){if(!(e=e.target.player)||e===this){e=this.el();let t=document[this.fsApi_.fullscreenElement]===e;!t&&e.matches&&(t=e.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(t);}}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_(){var e=this.tech_.error();e&&this.error(e);}handleTechTextData_(){let e=1<arguments.length?arguments[1]:null;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(){var i;if(e in iA)return i=this.middleware_,this.tech_[e](i.reduce(i3(e),t));if(e in iP)return iL(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t);}catch(s){throw p(s),s;}},!0);}techGet_(e){if(this.tech_&&this.tech_.isReady_){var t,i;if(e in iD)return t=this.middleware_,i=this.tech_,t.reduceRight(i3(e),i[e]());if(e in iP)return iL(this.middleware_,this.tech_,e);try{return this.tech_[e]();}catch(s){throw void 0===this.tech_[e]?p(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,s):"TypeError"===s.name?(p(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,s),this.tech_.isReady_=!1):p(s),s;}}}play(){return new Promise((e)=>{this.play_(e);});}play_(e=t_){this.playCallbacks_.push(e);var t,e=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc())),i=Boolean(z||V);this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),this.isReady_&&e?(t=this.techGet_("play"),i&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),null===t?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(t)):(this.waitToPlay_=(e)=>{this.play_();},this.one(["ready","loadstart"],this.waitToPlay_),!e&&i&&this.load());}runPlayTerminatedQueue_(){var e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(e){e();});}runPlayCallbacks_(e){var 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")||th(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;e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),this.cache_.initTime=0,isFinite(e)&&(this.cache_.currentTime=Number(e))):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_));}applyInitTime_(){this.currentTime(this.cache_.initTime);}duration(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=(e=parseFloat(e))<0?1/0:e)!==this.cache_.duration&&((this.cache_.duration=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:th(0,0);}bufferedPercent(){return tf(this.buffered(),this.duration());}bufferedEnd(){var e=this.buffered(),t=this.duration();let i=e.end(e.length-1);return i>t?t:i;}volume(e){let t;if(void 0===e)return t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t;t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),0<t&&this.lastVolume_(t);}muted(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e);}defaultMuted(e){return void 0!==e&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1;}lastVolume_(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e;}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1;}isFullscreen(e){var t;if(void 0===e)return this.isFullscreen_;t=this.isFullscreen_,this.isFullscreen_=Boolean(e),this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();let t=this;return new Promise((i,s)=>{function r(){t.off("fullscreenerror",a),t.off("fullscreenchange",n);}function n(){r(),i();}function a(e,t){r(),s(t);}t.one("fullscreenchange",n),t.one("fullscreenerror",a);var o=t.requestFullscreenHelper_(e);o&&(o.then(r,r),o.then(i,s));});}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(t=e)),this.fsApi_.requestFullscreen)return (e=this.el_[this.fsApi_.requestFullscreen](t))&&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 s(){e.off("fullscreenerror",n),e.off("fullscreenchange",r);}function r(){s(),t();}function n(e,t){s(),i(t);}e.one("fullscreenchange",r),e.one("fullscreenerror",n);var a=e.exitFullscreenHelper_();a&&(a.then(s,s),a.then(t,i));});}exitFullscreenHelper_(){var e;if(this.fsApi_.requestFullscreen)return (e=document[this.fsApi_.exitFullscreen]())&&t_(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=document.documentElement.style.overflow,e1(document,"keydown",this.boundFullWindowOnEscKey_),document.documentElement.style.overflow="hidden",et(document.body,"vjs-full-window"),this.trigger("enterFullWindow");}fullWindowOnEscKey(e){tn.isEventKey(e,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen());}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,e4(document,"keydown",this.boundFullWindowOnEscKey_),document.documentElement.style.overflow=this.docOrigOverflow,ei(document.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)return !!this.isInPictureInPicture_;this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_();}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&window.documentPictureInPicture){let t=document.createElement(this.el().tagName);return t.classList=this.el().classList,t.classList.add("vjs-pip-container"),this.posterImage&&t.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&t.appendChild(this.titleBar.el().cloneNode(!0)),t.appendChild(Q("p",{className:"vjs-pip-text"},{},e.t("Playing in picture-in-picture"))),window.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then((e)=>(eT(e),this.el_.parentNode.insertBefore(t,this.el_),e.document.body.appendChild(this.el_),e.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger("enterpictureinpicture"),e.addEventListener("pagehide",(e)=>{e=e.target.querySelector(".video-js"),t.parentNode.replaceChild(e,t),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture");}),e));}return "pictureInPictureEnabled" in document&&!1===this.disablePictureInPicture()?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available");}exitPictureInPicture(){return window.documentPictureInPicture&&window.documentPictureInPicture.window?(window.documentPictureInPicture.window.close(),Promise.resolve()):"pictureInPictureEnabled" in document?document.exitPictureInPicture():void 0;}handleKeyDown(e){var t,i,s=this.options_.userActions;s&&s.hotkeys&&(i=(t=this.el_.ownerDocument.activeElement).tagName.toLowerCase(),t.isContentEditable||("input"===i?-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(t.type):-1!==["textarea"].indexOf(i))||("function"==typeof s.hotkeys?s.hotkeys.call(this,e):this.handleHotkeys(e)));}handleHotkeys(e){var {fullscreenKey:t=(e)=>tn.isEventKey(e,"f"),muteKey:i=(e)=>tn.isEventKey(e,"m"),playPauseKey:s=(e)=>tn.isEventKey(e,"k")||tn.isEventKey(e,"Space")}=this.options_.userActions?this.options_.userActions.hotkeys:{};t.call(this,e)?(e.preventDefault(),e.stopPropagation(),t=ta.getComponent("FullscreenToggle"),!1!==document[this.fsApi_.fullscreenEnabled]&&t.prototype.handleClick.call(this,e)):i.call(this,e)?(e.preventDefault(),e.stopPropagation(),ta.getComponent("MuteToggle").prototype.handleClick.call(this,e)):s.call(this,e)&&(e.preventDefault(),e.stopPropagation(),ta.getComponent("PlayToggle").prototype.handleClick.call(this,e));}canPlayType(e){var t;for(let i=0,s=this.options_.techOrder;i<s.length;i++){var r=s[i];let n=iC.getTech(r);if(n=n||ta.getComponent(r)){if(n.isSupported()&&(t=n.canPlayType(e)))return t;}else p.error(`The "${r}" tech is undefined. Skipped browser support check for that tech.`);}return "";}selectSource(e){function t(e,t,i){let s;return e.some((e)=>t.some((t)=>{if(s=i(e,t))return !0;})),s;}var i=this.options_.techOrder.map((e)=>[e,iC.getTech(e)]).filter(([e,t])=>t?t.isSupported():(p.error(`The "${e}" tech is undefined. Skipped browser support check for that tech.`),!1));let s;var r,n=([e,t],i)=>{if(t.canPlaySource(i,this.options_[e.toLowerCase()]))return {source:i,tech:e};};return (s=this.options_.sourceOrder?t(e,i,(r=n,(e,t)=>r(t,e))):t(i,e,n))||!1;}handleSrc_(e,t){if(void 0===e)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();let i=function e(t){if(Array.isArray(t)){let i=[];t.forEach(function(t){Array.isArray(t=e(t))?i=i.concat(t):v(t)&&i.push(t);}),t=i;}else t="string"==typeof t&&t.trim()?[i4({src:t})]:v(t)&&"string"==typeof t.src&&t.src&&t.src.trim()?[i4(t)]:[];return t;}(e);if(i.length){if(this.changingSrc_=!0,t||(this.cache_.sources=i),this.updateSourceCaches_(i[0]),function e(t,i,s){t.setTimeout(()=>(function e(t={},i=[],s,r,n=[],a=!1){let [o,...l]=i;if("string"==typeof o)e(t,ix[o],s,r,n,a);else if(o){let h=function e(t,i){var s=i2[t.id()];let r=null;if(null==s)r=i(t),i2[t.id()]=[[i,r]];else{for(let n=0;n<s.length;n++){var [a,o]=s[n];
41a===i&&(r=o);}null===r&&(r=i(t),s.push([i,r]));}return r;}(r,o);if(!h.setSource)return n.push(h),e(t,l,s,r,n,a);h.setSource(Object.assign({},t),function(i,o){if(i)return e(t,l,s,r,n,a);n.push(h),e(o,t.type===o.type?l:ix[o.type],s,r,n,a);});}else l.length?e(t,l,s,r,n,a):a?s(t,n):e(t,ix["*"],s,r,n,!0);})(i,ix[i.type],s,t),1);}(this,i[0],(e,s)=>{var r;if(this.middleware_=s,t||(this.cache_.sources=i),this.updateSourceCaches_(e),this.src_(e))return 1<i.length?this.handleSrc_(i.slice(1)):(this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage});},0),void this.triggerReady());r=this.tech_,s.forEach((e)=>e.setTech&&e.setTech(r));}),1<i.length){let s=()=>{this.error(null),this.handleSrc_(i.slice(1),!0);},r=()=>{this.off("error",s);};this.one("error",s),this.one("playing",r),this.resetRetryOnError_=()=>{this.off("error",s),this.off("playing",r);};}}else this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage});},0);}src(e){return this.handleSrc_(e,!1);}src_(e){var t=this.selectSource([e]);return !t||(tt(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);}load(){this.tech_&&this.tech_.vhs?this.src(this.currentSource()):this.techCall_("load");}reset(){this.paused()?this.doReset_():t_(this.play().then(()=>this.doReset_()));}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),eH(this)&&this.trigger("playerreset");}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_();}resetProgressBar_(){this.currentTime(0);var {currentTimeDisplay:e,durationDisplay:t,progressControl:i,remainingTimeDisplay:s}=this.controlBar||{},i=(i||{}).seekBar;e&&e.updateContent(),t&&t.updateContent(),s&&s.updateContent(),i&&(i.update(),i.loadProgressBar)&&i.loadProgressBar.update();}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_();}resetVolumeBar_(){this.volume(1),this.trigger("volumechange");}currentSources(){var 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)return this.techGet_("preload");this.techCall_("setPreload",e),this.options_.preload=e;}autoplay(e){if(void 0===e)return this.options_.autoplay||!1;let t;"string"==typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"==typeof e?e:"play"),t=!1):this.options_.autoplay=!!e,t=void 0===t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t);}playsinline(e){return void 0!==e&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline");}loop(e){if(void 0===e)return this.techGet_("loop");this.techCall_("setLoop",e),this.options_.loop=e;}poster(e){if(void 0===e)return this.poster_;(e=e||"")!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"));}handleTechPosterChange_(){var e;(!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster&&(e=this.tech_.poster()||"")!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"));}controls(e){if(void 0===e)return !!this.controls_;this.controls_!==(e=!!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.removeTechControl
41sListeners_()));}usingNativeControls(e){if(void 0===e)return !!this.usingNativeControls_;this.usingNativeControls_!==(e=!!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(s("beforeerror").forEach((t)=>{v(t=t(this,e))&&!Array.isArray(t)||"string"==typeof t||"number"==typeof t||null===t?e=t:this.log.error("please return a value that MediaError expects in beforeerror hooks");}),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);});}else null===e?(this.error_=null,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close()):(this.error_=new ty(e),this.addClass("vjs-error"),p.error(`(CODE:${this.error_.code} ${ty.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),s("error").forEach((e)=>e(this,this.error_)));}reportUserActivity(e){this.userActivity_=!0;}userActive(e){if(void 0===e)return this.userActive_;(e=!!e)!==this.userActive_&&(this.userActive_=e,this.userActive_?(this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive")):(this.tech_&&this.tech_.one("mousemove",function(e){e.stopPropagation(),e.preventDefault();}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")));}listenForUserActivity_(){let e,t,i,s=eU(this,this.reportUserActivity);function r(t){s(),this.clearInterval(e);}this.on("mousedown",function(){s(),this.clearInterval(e),e=this.setInterval(s,250);}),this.on("mousemove",function(e){e.screenX===t&&e.screenY===i||(t=e.screenX,i=e.screenY,s());}),this.on("mouseup",r),this.on("mouseleave",r);var n=this.getChild("controlBar");!n||V||w||(n.on("mouseenter",function(e){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0;}),n.on("mouseleave",function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout;})),this.on("keydown",s),this.on("keyup",s);let a;this.setInterval(function(){var e;this.userActivity_&&(this.userActivity_=!1,this.userActive(!0),this.clearTimeout(a),(e=this.options_.inactivityTimeout)<=0||(a=this.setTimeout(function(){this.userActivity_||this.userActive(!1);},e)));},250);}playbackRate(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e);}defaultPlaybackRate(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1;}isAudio(e){if(void 0===e)return !!this.isAudio_;this.isAudio_=!!e;}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");var e=this.children();let t=this.getChild("ControlBar");var i=t&&t.currentHeight();e.forEach((e)=>{e!==t&&e.el_&&!e.hasClass("vjs-hidden")&&(e.hide(),this.audioOnlyCache_.hiddenChildren.push(e));}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.height(i),this.trigger("audioonlymodechange");}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.audioOnlyCache_.hiddenChildren.forEach((e)=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange");}audioOnlyMode(e){return "boolean"!=typeof e||e===this.audioOnlyMode_?this.audioOnlyMode_:(this.audioOnlyMode_=e)?(e=[],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_())):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)?(this.audioOnlyMode()?this.audioOnlyMode(!1):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 t=e.track;if(t=t||e,this.tech_)return this.tech_.removeRemoteTextTrack(t);}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality");}
41videoWidth(){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(),eH(this))&&this.trigger("languagechange");}languages(){return _(s9.prototype.options_.languages,this.languages_);}toJSON(){var e=_(this.options_),t=e.tracks;e.tracks=[];for(let i=0;i<t.length;i++){var s=t[i];(s=_(s)).player=void 0,e.tracks[i]=s;}return e;}createModal(e,t){(t=t||{}).content=e||"";let i=new t0(this,t);return this.addChild(i),i.on("dispose",()=>{this.removeChild(i);}),i.open(),i;}updateCurrentBreakpoint_(){if(this.responsive()){var e=this.currentBreakpoint(),t=this.currentWidth();for(let i=0;i<sj.length;i++){var s=sj[i];if(t<=this.breakpoints_[s]){if(e===s)return;e&&this.removeClass(sH[e]),this.addClass(sH[s]),this.breakpoint_=s;break;}}}}removeCurrentBreakpoint_(){var e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e);}breakpoints(e){return void 0!==e&&(this.breakpoint_="",this.breakpoints_=Object.assign({},sV,e),this.updateCurrentBreakpoint_()),Object.assign(this.breakpoints_);}responsive(e){return void 0===e?this.responsive_:(e=Boolean(e))!==this.responsive_?((this.responsive_=e)?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e):void 0;}currentBreakpoint(){return this.breakpoint_;}currentBreakpointClass(){return sH[this.breakpoint_]||"";}loadMedia(e,t){var i,s,r,n,a,o,l;e&&"object"==typeof e&&(i=this.crossOrigin(),{artist:e,artwork:s,description:r,poster:n,src:a,textTracks:o,title:l}=(this.reset(),this.cache_.media=_(e),this.cache_.media),!s&&n&&(this.cache_.media.artwork=[{src:n,type:i1(n)}]),i&&this.crossOrigin(i),a&&this.src(a),n&&this.poster(n),Array.isArray(o)&&o.forEach((e)=>this.addRemoteTextTrack(e,!1)),this.titleBar&&this.titleBar.update({title:l,description:r||e||""}),this.ready(t));}getMedia(){var e,t;return this.cache_.media?_(this.cache_.media):(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}))},e&&(t.poster=e,t.artwork=[{src:t.poster,type:i1(t.poster)}]),t);}static getTagSettings(e){var t,i={sources:[],tracks:[]},s=en(e),r=s["data-setup"];if(ee(e,"vjs-fill")&&(s.fill=!0),ee(e,"vjs-fluid")&&(s.fluid=!0),null!==r&&([r,t]=tv(r||"{}"),r&&p.error(r),Object.assign(s,t)),Object.assign(i,s),e.hasChildNodes()){var n=e.childNodes;for(let a=0,o=n.length;a<o;a++){var l=n[a],h=l.nodeName.toLowerCase();"source"===h?i.sources.push(en(l)):"track"===h&&i.tracks.push(en(l));}}return i;}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"));}}tQ.names.forEach(function(e){let t=tQ[e];s9.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass(),this[t.privateName]);};}),s9.prototype.crossorigin=s9.prototype.crossOrigin,s9.players={},sA=window.navigator,s9.prototype.options_={techOrder:iC.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:sA&&(sA.languages&&sA.languages[0]||sA.userLanguage||sA.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1},["ended","seeking","seekable","networkState","readyState"].forEach(function(e){s9.prototype[e]=function(){return this.techGet_(e);};}
41),sF.forEach(function(e){s9.prototype[`handleTech${te(e)}_`]=function(){return this.trigger(e);};}),ta.registerComponent("Player",s9);let sz="plugin",sW="activePlugins_",sG={},sX=(e)=>sG.hasOwnProperty(e),sK=(e)=>sX(e)?sG[e]:void 0,sY=(e,t)=>{e[sW]=e[sW]||{},e[sW][t]=!0;},sQ=(e,t,i)=>{i=(i?"before":"")+"pluginsetup",e.trigger(i,t),e.trigger(i+":"+t.name,t);},sJ=(e,t)=>(t.prototype.name=e,function(...i){sQ(this,{name:e,plugin:t,instance:null},!0);let s=new t(this,...i);return this[e]=()=>s,sQ(this,s.getEventHash()),s;});class sZ{constructor(e){if(this.constructor===sZ)throw Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),eY(this),delete this.trigger,eJ(this,this.constructor.defaultState),sY(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 eO(this.eventBusEl_,e,this.getEventHash(t));}handleStateChanged(e){}dispose(){var {name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[sW][e]=!1,this.player=this.state=null,t[e]=sJ(e,sG[e]);}static isBasic(e){return "function"==typeof (e="string"==typeof e?sK(e):e)&&!sZ.prototype.isPrototypeOf(e.prototype);}static registerPlugin(e,t){if("string"!=typeof e)throw Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(sX(e))p.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else{if(s9.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 sG[e]=t,e!==sz&&(sZ.isBasic(t)?s9.prototype[e]=function e(t,i){function s(){sQ(this,{name:t,plugin:i,instance:null},!0);var e=i.apply(this,arguments);return sY(this,t),sQ(this,{name:t,plugin:i,instance:e}),e;}
41return Object.keys(i).forEach(function(e){s[e]=i[e];}),s;}(e,t):s9.prototype[e]=sJ(e,t)),t;}static deregisterPlugin(e){if(e===sz)throw Error("Cannot de-register base plugin.");sX(e)&&(delete sG[e],delete s9.prototype[e]);}static getPlugins(e=Object.keys(sG)){let t;return e.forEach((e)=>{var i=sK(e);i&&((t=t||{})[e]=i);}),t;}static getPluginVersion(e){return (e=sK(e))&&e.VERSION||"";}}function re(e,t,i,s){var r=t+` is deprecated and will be removed in ${e}.0; please use ${i} instead.`,n=s;let a=!1;return function(...e){return a||p.warn(r),a=!0,n.apply(this,e);};;}sZ.getPlugin=sK,sZ.BASE_PLUGIN_NAME=sz,sZ.registerPlugin(sz,sZ),s9.prototype.usingPlugin=function(e){return !!this[sW]&&!0===this[sW][e];},s9.prototype.hasPlugin=function(e){return !!sX(e);};let rt=(e)=>0===e.indexOf("#")?e.slice(1):e;function ri(e,t,i){let r=ri.getPlayer(e);if(r)t&&p.warn(`Player "${e}" is already initialised. Options will not be applied.`),i&&r.ready(i);else{let n="string"==typeof e?e$("#"+rt(e)):e;if(!X(n))throw TypeError("The element or ID supplied is not valid. (videojs)");e="getRootNode" in n&&n.getRootNode() instanceof window.ShadowRoot?n.getRootNode():n.ownerDocument.body,r=new (e=(n.ownerDocument.defaultView&&e.contains(n)||p.warn("The element supplied is not included in the DOM"),!0===(t=t||{}).restoreEl&&(t.restoreEl=(n.parentNode&&n.parentNode.hasAttribute("data-vjs-player")?n.parentNode:n).cloneNode(!0)),s("beforesetup").forEach((e)=>{e=e(n,_(t)),!v(e)||Array.isArray(e)?p.error("please return an object in beforesetup hooks"):t=_(t,e);}),ta.getComponent("Player")))(n,t,i),s("setup").forEach((e)=>e(r));}return r;}ri.hooks_=i,ri.hooks=s,ri.hook=function(e,t){s(e,t);},ri.hookOnce=function(e,t){s(e,[].concat(t).map((t)=>{let i=(...s)=>(r(e,i),t(...s));return i;}));},ri.removeHook=r,!0!==window.VIDEOJS_NO_DYNAMIC_STYLE&&G()&&!(tJ=e$(".vjs-styles-defaults"))&&(tJ=ex("vjs-styles-defaults"),(sD=e$("head"))&&sD.insertBefore(tJ,sD.firstChild),e2(tJ,`
42      .video-js {
43        width: 300px;
44        height: 150px;
45      }
46
47      .vjs-fluid:not(.vjs-audio-only-mode) {
48        padding-top: 56.25%
49      }
50    `)),ew(1,ri),ri.VERSION=t,ri.options=s9.prototype.options_,ri.getPlayers=()=>s9.players,ri.getPlayer=(e)=>{var t=s9.players;let i;if("string"==typeof e){var s=rt(e),r=t[s];if(r)return r;i=e$("#"+s);}else i=e;if(X(i)){var {player:r,playerId:s}=i;if(r||t[s])return r||t[s];}},ri.getAllPlayers=()=>Object.keys(s9.players).map((e)=>s9.players[e]).filter(Boolean),ri.players=s9.players,ri.getComponent=ta.getComponent,ri.registerComponent=(e,t)=>(iC.isTech(t)&&p.warn(`The ${e} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),ta.registerComponent.call(ta,e,t)),ri.getTech=iC.getTech,ri.registerTech=iC.registerTech,ri.use=function(e,t){ix[e]=ix[e]||[],ix[e].push(t);},Object.defineProperty(ri,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(ri.middleware,"TERMINATOR",{value:iI,writeable:!1,enumerable:!0}),ri.browser=q,ri.obj=S,ri.mergeOptions=re(9,"videojs.mergeOptions","videojs.obj.merge",_),ri.defineLazyProperty=re(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",T),ri.bind=re(9,"videojs.bind","native Function.prototype.bind",eU),ri.registerPlugin=sZ.registerPlugin,ri.deregisterPlugin=sZ.deregisterPlugin,ri.plugin=(e,t)=>(p.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),sZ.registerPlugin(e,t)),ri.getPlugins=sZ.getPlugins,ri.getPlugin=sZ.getPlugin,ri.getPluginVersion=sZ.getPluginVersion,ri.addLanguage=function(e,t){return e=(""+e).toLowerCase(),ri.options.languages=_(ri.options.languages,{[e]:t}),ri.options.languages[e];},ri.log=p,ri.createLogger=m,ri.time=tg,ri.createTimeRange=re(9,"videojs.createTimeRange","videojs.time.createTimeRanges",th),ri.createTimeRanges=re(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",th),ri.formatTime=re(9,"videojs.formatTime","videojs.time.formatTime",tm),ri.setFormatTime=re(9,"videojs.setFormatTime","videojs.time.setFormatTime",tc),ri.resetFormatTime=re(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",tp),ri.parseUrl=re(9,"videojs.parseUrl","videojs.url.parseUrl",tD),ri.isCrossOrigin=re(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",tP),ri.EventTarget=eq,ri.any=eN,ri.on=e1,ri.one=eR,ri.off=e4,ri.trigger=eO,ri.xhr=t5,ri.TextTrack=tz,ri.AudioTrack=tW,ri.VideoTrack=tG,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach((e)=>{ri[e]=function(){return p.warn(`videojs.${e}() is deprecated; use videojs.dom.${e}() instead`),eS[e].apply(null,arguments);};}),ri.computedStyle=re(9,"videojs.computedStyle","videojs.dom.computedStyle",eb),ri.dom=eS,ri.fn=e7,ri.num=t1,ri.str=ti,ri.url=t6,tr(function(e,t){e.exports=function(e){var t,i=(t=e)&&"object"==typeof t&&"default" in t?t:{default:t};class s{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 r extends i.default.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 s(e),""+i in this||Object.defineProperty(this,i,{get(){return this.levels_[i];}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t;}removeQualityLevel(e){let t=null;for(let i=0,s=this.length;i<s;i++)if(this[i]===e){t=this.levels_.splice(i,1)[0],this.selectedIndex_===i?this.selectedIndex_=-1:this.selectedIndex_>i&&this.selectedIndex_--;break;}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t;}getQualityLevelById(e){for(let t=0,i=this.length;t<i;t++){let s=this[t];if(s.id===e)return s;}return null;}dispose(){this.selectedIndex_=-1,this.levels_.length=0;}}for(let n in r.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"},r.prototype.allowedEvents_)r.prototype["on"+n]=null;var a="4.0.0";let o=function(e,t){let i=e.qualityLevels,s=new r(),n=function(){s.dispose(),e.qualityLevels=i,e.off("dispose",n);};return e.on("dispose",n),e.qualityLevels=()=>s,e.qualityLevels.VERSION=a,s;},l=function(e){return o(this,i.default.obj.merge({},e));};return i.default.registerPlugin("qualityLevels",l),l.VERSION=a,l;}(ri);});var rs=tr(function(e,t){var i,s,r,n,a;i=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,s=/^(?=([^\/?#]*))\1([^]*)$/,r=/(?:\/|^)\.(?=\/)/g,n=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,a={buildAbsoluteURL:function(e,t,i){if(i=i||{},e=e.trim(),!(t=t.trim())){if(!i.alwaysNormalize)return e;var r=a.parseURL(e);if(r)return r.path=a.normalizePath(r.path),a.buildURLFromParts(r);throw Error("Error trying to parse base URL.");}if(!(r=a.parseURL(t)))throw Error("Error trying to parse relative URL.");
50if(r.scheme)return i.alwaysNormalize?(r.path=a.normalizePath(r.path),a.buildURLFromParts(r)):t;if(!(t=a.parseURL(e)))throw Error("Error trying to parse base URL.");!t.netLoc&&t.path&&"/"!==t.path[0]&&(e=s.exec(t.path),t.netLoc=e[1],t.path=e[2]),t.netLoc&&!t.path&&(t.path="/");var n,e={scheme:t.scheme,netLoc:r.netLoc,path:null,params:r.params,query:r.query,fragment:r.fragment};return r.netLoc||(e.netLoc=t.netLoc,"/"!==r.path[0]&&(r.path?(n=(n=t.path).substring(0,n.lastIndexOf("/")+1)+r.path,e.path=a.normalizePath(n)):(e.path=t.path,r.params||(e.params=t.params,r.query)||(e.query=t.query)))),null===e.path&&(e.path=i.alwaysNormalize?a.normalizePath(r.path):r.path),a.buildURLFromParts(e);},parseURL:function(e){return (e=i.exec(e))?{scheme:e[1]||"",netLoc:e[2]||"",path:e[3]||"",params:e[4]||"",query:e[5]||"",fragment:e[6]||""}:null;},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(r,"");e.length!==(e=e.replace(n,"")).length;);return e.split("").reverse().join("");},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment;}},e.exports=a;}),rr="http://example.com",sI=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){return !!this.listeners[e]&&(t=this.listeners[e].indexOf(t),this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(t,1),-1<t);},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,s=0;s<i;++s)t[s].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),n=t.length,a=0;a<n;++a)t[a].apply(this,r);},t.dispose=function(){this.listeners={};},t.pipe=function(e){this.on("data",function(t){e.push(t);});},e;}();function rn(e){var e=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),t={};return e[1]&&(t.length=parseInt(e[1],10)),e[2]&&(t.offset=parseInt(e[2],10)),t;}function ra(e){var t={};if(e){var i,s=e.split(RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))'));let r=s.length;for(;r--;)""!==s[r]&&((i=/([^=]*)=(.*)/.exec(s[r]).slice(1))[0]=i[0].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^['"](.*)['"]$/g,"$1"),t[i[0]]=i[1]);}return t;}function ro(e){let t={};return Object.keys(e).forEach(function(i){t[i.toLowerCase().replace(/-(\w)/g,(e)=>e[1].toUpperCase())]=e[i];}),t;}function rl(e){var t,i,s,r,n,{serverControl:e,targetDuration:a,partTargetDuration:o}=e;e&&(t="#EXT-X-SERVER-CONTROL",i="holdBack",s="partHoldBack",r=a&&3*a,n=o&&2*o,a&&!e.hasOwnProperty(i)&&(e[i]=r,this.trigger("info",{message:t+` defaulting HOLD-BACK to targetDuration * 3 (${r}).`})),r&&e[i]<r&&(this.trigger("warn",{message:t+` clamping HOLD-BACK (${e[i]}) to targetDuration * 3 (${r})`}),e[i]=r),o&&!e.hasOwnProperty(s)&&(e[s]=3*o,this.trigger("info",{message:t+` defaulting PART-HOLD-BACK to partTargetDuration * 3 (${e[s]}).`})),o)&&e[s]<n&&(this.trigger("warn",{message:t+` clamping PART-HOLD-BACK (${e[s]}) to partTargetDuration * 2 (${n}).`}),e[s]=n);}class rh extends sI{constructor(){super(),this.lineStream=new class e extends sI{constructor(){super(),this.buffer="";}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf("\n");-1<t;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1);}}(),this.parseStream=new class e extends sI{constructor(){super(),this.customParsers=[],this.tagMappers=[];}push(e){let t,i;0!==(e=e.trim()).length&&("#"!==e[0]?this.trigger("data",{type:"uri",uri:e}):this.tagMappers.reduce((t,i)=>(i=i(e))===e?t:t.concat([i]),[e]).forEach((e)=>{for(let s=0;s<this.customParsers.length;s++)if(this.customParsers[s].call(this,e))return;if(0!==e.indexOf("#EXT"))this.trigger("data",{type:"comment",text:e.slice(1)});else if(e=e.replace("\r",""),t=/^#EXTM3U/.exec(e))this.trigger("data",{type:"tag",tagType:"m3u"});else 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);else 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);else 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);else 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);else 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);else if(t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(e))i={type:"tag",tagType:"playlist-type"},t[1]&&(i.playlistType=t[1]),this.trigger("data",i);else if(t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(e))i=tR(rn(t[1]),{type:"tag",tagType:"byterange"}),this.trigger("data",i);else 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);else if(t=/^#EXT-X-MAP:(.*)$/.exec(e))i={type:"tag",tagType:"map"},t[1]&&((n=ra(t[1])).URI&&(i.uri=n.URI),n.BYTERANGE)&&(i.byterange=rn(n.BYTERANGE)),this.trigger("data",i);else if(t=/^#EXT-X-STREAM-INF:(.*)$/.exec(e))i={type:"tag",tagType:"stream-inf"},t[1]&&(i.attributes=ra(t[1]),i.attributes.RESOLUTION&&(n={},(r=i.attributes.RESOLUTION.split("x"))[0]&&(n.width=parseInt(r[0],10)),r[1]&&(n.height=parseInt(r[1],10)),i.attributes.RESOLUTION=n),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);else if(t=/^#EXT-X-MEDIA:(.*)$/.exec(e))i={type:"tag",tagType:"media"},t[1]&&(i.attributes=ra(t[1])),this.trigger("data",i);else if(t=/^#EXT-X-ENDLIST/.exec(e))this.trigger("data",{type:"tag",tagType:"endlist"});else if(t=/^#EXT-X-DISCONTINUITY/.exec(e))this.trigger("data",{type:"tag",tagType:"discontinuity"});else if(t=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(e))i={type:"tag",tagType:"program-date-time"}
50,t[1]&&(i.dateTimeString=t[1],i.dateTimeObject=new Date(t[1])),this.trigger("data",i);else if(t=/^#EXT-X-KEY:(.*)$/.exec(e))i={type:"tag",tagType:"key"},t[1]&&(i.attributes=ra(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);else if(t=/^#EXT-X-START:(.*)$/.exec(e))i={type:"tag",tagType:"start"},t[1]&&(i.attributes=ra(t[1]),i.attributes["TIME-OFFSET"]=parseFloat(i.attributes["TIME-OFFSET"]),i.attributes.PRECISE=/YES/.test(i.attributes.PRECISE)),this.trigger("data",i);else 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);else 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);else 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);else if((t=/^#EXT-X-SKIP:(.*)$/.exec(e))&&t[1])(i={type:"tag",tagType:"skip"}).attributes=ra(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);else if((t=/^#EXT-X-PART:(.*)$/.exec(e))&&t[1])(i={type:"tag",tagType:"part"}).attributes=ra(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=rn(i.attributes.BYTERANGE)),this.trigger("data",i);else if((t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(e))&&t[1])(i={type:"tag",tagType:"server-control"}).attributes=ra(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);else if((t=/^#EXT-X-PART-INF:(.*)$/.exec(e))&&t[1])(i={type:"tag",tagType:"part-inf"}).attributes=ra(t[1]),["PART-TARGET"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]));}),this.trigger("data",i);else if((t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(e))&&t[1])(i={type:"tag",tagType:"preload-hint"}).attributes=ra(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(e){var t;i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseInt(i.attributes[e],10),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);else if((t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(e))&&t[1])(i={type:"tag",tagType:"rendition-report"}).attributes=ra(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);else if((t=/^#EXT-X-DATERANGE:(.*)$/.exec(e))&&t[1]){(i={type:"tag",tagType:"daterange"}).attributes=ra(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));});var r,n,a,o,l=/^X-([A-Z]+-)+[A-Z]+$/;for(let h in i.attributes)l.test(h)&&(a=/[0-9A-Fa-f]{6}/g.test(i.attributes[h]),o=/^\d+(\.\d+)?$/.test(i.attributes[h]),i.attributes[h]=a?i.attributes[h].toString(16):(o?parseFloat:String)(i.attributes[h]));this.trigger("data",i);}else (t=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(e))?this.trigger("data",{type:"tag",tagType:"independent-segments"}):(t=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(e))?((i={type:"tag",tagType:"content-steering"}).attributes=ra(t[1]),this.trigger("data",i)):this.trigger("data",{type:"tag",data:e.slice(4)});}));}addParser({expression:e,customType:t,dataParser:i,segment:s}){"function"!=typeof i&&(i=(e)=>e),this.customParsers.push((r)=>{if(e.exec(r))return this.trigger("data",{type:"custom",data:i(r),customType:t,segment:s}),!0;});}addTagMapper({expression:e,map:t}){this.tagMappers.push((i)=>e.test(i)?t(i):i);}}(),this.lineStream.pipe(this.parseStream),this.lastProgramDateTime=null;let e=this,t=[],i={},s,r,n=!1,a={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},o=0,l=(this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],segments:[]},0),h=0,d={};this.on("end",()=>
50{!i.uri&&(i.parts||i.preloadHints)&&(!i.map&&s&&(i.map=s),!i.key&&r&&(i.key=r),i.timeline||"number"!=typeof o||(i.timeline=o),this.manifest.preloadSegment=i);}),this.parseStream.on("data",function(u){let c,p;({tag(){(({version(){u.version&&(this.manifest.version=u.version);},"allow-cache"(){this.manifest.allowCache=u.allowed,"allowed" in u||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0);},byterange(){var e={};"length" in u&&((i.byterange=e).length=u.length,"offset" in u||(u.offset=l)),"offset" in u&&((i.byterange=e).offset=u.offset),l=e.offset+e.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"})),u.title&&(i.title=u.title),0<u.duration&&(i.duration=u.duration),0===u.duration&&(i.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=t;},key(){if(u.attributes)if("NONE"===u.attributes.METHOD)r=null;else if(u.attributes.URI)if("com.apple.streamingkeydelivery"===u.attributes.KEYFORMAT)this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:u.attributes};else if("com.microsoft.playready"===u.attributes.KEYFORMAT)this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:u.attributes.URI};else{if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===u.attributes.KEYFORMAT)return -1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(u.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===u.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==u.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):u.attributes.KEYID&&"0x"===u.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void (this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:u.attributes.KEYFORMAT,keyId:u.attributes.KEYID.substring(2)},pssh:function e(t){for(var i=window.atob?window.atob(t):Buffer.from(t,"base64").toString("binary"),s=new Uint8Array(i.length),r=0;r<i.length;r++)s[r]=i.charCodeAt(r);return s;}(u.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}));u.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),r={method:u.attributes.METHOD||"AES-128",uri:u.attributes.URI},void 0!==u.attributes.IV&&(r.iv=u.attributes.IV);}else this.trigger("warn",{message:"ignoring key declaration without URI"});else this.trigger("warn",{message:"ignoring key declaration without attribute list"});},"media-sequence"(){isFinite(u.number)?this.manifest.mediaSequence=u.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+u.number});},"discontinuity-sequence"(){isFinite(u.number)?(this.manifest.discontinuitySequence=u.number,o=u.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+u.number});},"playlist-type"(){/VOD|EVENT/.test(u.playlistType)?this.manifest.playlistType=u.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+u.playlist});},map(){s={},u.uri&&(s.uri=u.uri),u.byterange&&(s.byterange=u.byterange),r&&(s.key=r);},"stream-inf"(){this.manifest.playlists=t,this.manifest.mediaGroups=this.manifest.mediaGroups||a,u.attributes?(i.attributes||(i.attributes={}),tR(i.attributes,u.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"});},media(){var e;this.manifest.mediaGroups=this.manifest.mediaGroups||a,u.attributes&&u.attributes.TYPE&&u.attributes["GROUP-ID"]&&u.attributes.NAME?((e=this.manifest.mediaGroups[u.attributes.TYPE])[u.attributes["GROUP-ID"]]=e[u.attributes["GROUP-ID"]]||{},c=e[u.attributes["GROUP-ID"]],(p={default:/yes/i.test(u.attributes.DEFAULT)}).default?p.autoselect=!0:p.autoselect=/yes/i.test(u.attributes.AUTOSELECT),u.attributes.LANGUAGE&&(p.language=u.attributes.LANGUAGE),u.attributes.URI&&(p.uri=u.attributes.URI),u.attributes["INSTREAM-ID"]&&(p.instreamId=u.attributes["INSTREAM-ID"]),u.attributes.CHARACTERISTICS&&(p.characteristics=u.attributes.CHARACTERISTICS),u.attributes.FORCED&&(p.forced=/yes/i.test(u.attributes.FORCED)),c[u.attributes.NAME]=p):this.trigger("warn",{message:"ignoring incomplete or missing media group"});},discontinuity(){o+=1,i.discontinuity=!0,this.manifest.discontinuityStarts.push(t.length);},"program-date-time"(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=u.dateTimeString,this.manifest.dateTimeObject=u.dateTimeObject),i.dateTimeString=u.dateTimeString,i.dateTimeObject=u.dateTimeObject;var e=this.lastProgramDateTime;this.lastProgramDateTime=new Date(u.dateTimeString).getTime(),null===e&&this.manifest.segments.reduceRight((e,t)=>(t.programDateTime=e-1e3*t.duration,t.programDateTime),this.lastProgramDateTime);},targetduration(){!isFinite(u.duration)||u.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+u.duration}):(this.manifest.targetDuration=u.duration,rl.call(this,this.manifest));},start(){!u.attributes||isNaN(u.attributes["TIME-OFFSET"])?this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"}):this.manifest.start={timeOffset:u.attributes["TIME-OFFSET"],precise:u.attributes.PRECISE};},"cue-out"(){i.cueOut=u.data;},"cue-out-cont"(){i.cueOutCont=u.data;},"cue-in"(){i.cueIn=u.data;},skip(){this.manifest.skip=ro(u.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",u.attributes,["SKIPPED-SEGMENTS"]);},part(){n=!0;var e=this.manifest.segments.length,t=ro(u.attributes),t=(i.parts=i.parts||[],i.parts.push(t),t.byterange&&(t.byterange.hasOwnProperty("offset")||(t.byterange.offset=h),h=t.byterange.offset+t.byterange.length),i.parts.length-1);this.warnOnMissingAttributes_(`#EXT-X-PART #${t} for segment #`+e,u.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEac
50h((e,t)=>{e.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${t} lacks required attribute(s): LAST-PART`});});},"server-control"(){var e=this.manifest.serverControl=ro(u.attributes);e.hasOwnProperty("canBlockReload")||(e.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),rl.call(this,this.manifest),e.canSkipDateranges&&!e.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"(){var e=this.manifest.segments.length,t=ro(u.attributes),s=t.type&&"PART"===t.type,r=(i.preloadHints=i.preloadHints||[],i.preloadHints.push(t),!t.byterange||t.byterange.hasOwnProperty("offset")||(t.byterange.offset=s?h:0,s&&(h=t.byterange.offset+t.byterange.length)),i.preloadHints.length-1);if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${r} for segment #`+e,u.attributes,["TYPE","URI"]),t.type){for(let n=0;n<i.preloadHints.length-1;n++){var a=i.preloadHints[n];a.type&&a.type===t.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${r} for segment #${e} has the same TYPE ${t.type} as preload hint #`+n});}}},"rendition-report"(){var e=ro(u.attributes),e=(this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(e),this.manifest.renditionReports.length-1),t=["LAST-MSN","URI"];n&&t.push("LAST-PART"),this.warnOnMissingAttributes_("#EXT-X-RENDITION-REPORT #"+e,u.attributes,t);},"part-inf"(){this.manifest.partInf=ro(u.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",u.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),rl.call(this,this.manifest);},daterange(){this.manifest.dateRanges.push(ro(u.attributes));var e=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_("#EXT-X-DATERANGE #"+e,u.attributes,["ID","START-DATE"]);let t=this.manifest.dateRanges[e];t.endDate&&t.startDate&&new Date(t.endDate)<new Date(t.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"}),t.duration&&t.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),t.plannedDuration&&t.plannedDuration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});var i=!!t.endOnNext;if(i&&!t.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute"}),i&&(t.duration||t.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"}),t.duration&&t.endDate&&(i=t.startDate.getTime()+1e3*t.duration,this.manifest.dateRanges[e].endDate=new Date(i)),d[t.id]){for(let s in d[t.id])if(t[s]&&JSON.stringify(d[t.id][s])!==JSON.stringify(t[s])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break;}e=this.manifest.dateRanges.findIndex((e)=>e.id===t.id),this.manifest.dateRanges[e]=tR(this.manifest.dateRanges[e],t),d[t.id]=tR(d[t.id],t),this.manifest.dateRanges.pop();}else d[t.id]=t;},"independent-segments"(){this.manifest.independentSegments=!0;},"content-steering"(){this.manifest.contentSteering=ro(u.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",u.attributes,["SERVER-URI"]);}})[u.tagType]||function(){}).call(e);},uri(){i.uri=u.uri,t.push(i),!this.manifest.targetDuration||"duration" in i||(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),i.duration=this.manifest.targetDuration),r&&(i.key=r),i.timeline=o,s&&(i.map=s),h=0,null!==this.lastProgramDateTime&&(i.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=1e3*i.duration),i={};},comment(){},custom(){u.segment?(i.custom=i.custom||{},i.custom[u.customType]=u.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[u.customType]=u.data);}})[u.type].call(e);});}warnOnMissingAttributes_(e,t,i){let s=[];
50i.forEach(function(e){t.hasOwnProperty(e)||s.push(e);}),s.length&&this.trigger("warn",{message:e+" lacks required attribute(s): "+s.join(", ")});}push(e){this.lineStream.push(e);}end(){this.lineStream.push("\n"),this.manifest.dateRanges.length&&null===this.lastProgramDateTime&&this.trigger("warn",{message:"A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"}),this.lastProgramDateTime=null,this.trigger("end");}addParser(e){this.parseStream.addParser(e);}addTagMapper(e){this.parseStream.addTagMapper(e);}}function rd(e){return rf.audio.test((e=void 0===e?"":e).trim().toLowerCase());}function ru(e){return void 0===e&&(e=""),window.MediaSource&&window.MediaSource.isTypeSupported&&window.MediaSource.isTypeSupported(r_(e))||!1;}function rc(e){return (e=void 0===e?"":e).toLowerCase().split(",").every(function(e){e=e.trim();for(var t=0;t<r8.length;t++)if(rf["muxer"+r8[t]].test(e))return !0;return !1;});}function rp(e){return rT.test(e)?"hls":rS.test(e)?"dash":"application/vnd.videojs.vhs+json"===e?"vhs-json":null;}function rm(e,t){if("string"!=typeof (e="string"!=typeof e&&e&&"function"==typeof e.toString?e.toString():e))return new Uint8Array();t||(e=unescape(encodeURIComponent(e)));for(var i=new Uint8Array(e.length),s=0;s<e.length;s++)i[s]=e.charCodeAt(s);return i;}function rg(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=window.location&&window.location.href||"");var i="function"==typeof window.URL,s=/^\/\//.test(e),r=!window.location&&!/\/\//i.test(e);return i?e=new window.URL(e,window.location||r2):/\/\//i.test(e)||(e=rs.buildAbsoluteURL(window.location&&window.location.href||"",e)),i?(i=new URL(t,e),r?i.href.slice(r2.length):s?i.href.slice(i.protocol.length):i.href):rs.buildAbsoluteURL(e,t);}var rf={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^/},ry=["video","audio","text"],r8=["Video","Audio","Text"],rv=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);});},r$=function(e){var e=(e=void 0===e?"":e).split(","),t=[];return e.forEach(function(e){var i;e=e.trim(),ry.forEach(function(s){var r,n=rf[s].exec(e.toLowerCase());!n||n.length<=1||(i=s,n=e.substring(0,n[1].length),r=e.replace(n,""),t.push({type:n,details:r,mediaType:s}));}),i||t.push({type:e,details:"",mediaType:"unknown"});}),t;},r_=function(e){var t,i,s;if(e&&"string"==typeof e)return i="video",1===(t=e.toLowerCase().split(",").map(function(e){return rv(e.trim());})).length&&rd(t[0])?i="audio":1===t.length&&(s=t[0],rf.text.test((s=void 0===s?"":s).trim().toLowerCase()))&&(i="application"),s="mp4",t.every(function(e){return rf.mp4.test(e);})?s="mp4":t.every(function(e){return rf.webm.test(e);})?s="webm":t.every(function(e){return rf.ogg.test(e);})&&(s="ogg"),i+"/"+s+';codecs="'+e+'"';},rb="mp4a.40.2",rT=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,rS=/^application\/dash\+xml/i,r0=function(e){return "function"===ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer;},rE=function(e){return e instanceof Uint8Array?e:(Array.isArray(e)||r0(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));},rk=window.BigInt||Number,rw=[rk("0x1"),rk("0x100"),rk("0x10000"),rk("0x1000000"),rk("0x100000000"),rk("0x10000000000"),rk("0x1000000000000"),rk("0x100000000000000"),rk("0x10000000000000000")],rC=(ts=new Uint16Array([65484]),255!==(ts=new Uint8Array(ts.buffer,ts.byteOffset,ts.byteLength))[0]&&ts[0],function(e,t){var t=void 0===t?{}:t,i=t.signed,i=void 0!==i&&i,t=t.le,s=void 0!==t&&t,t=(e=rE(e),s?"reduce":"reduceRight"),t=(e[t]||Array.prototype[t]).call(e,function(t,i,r){return r=s?r:Math.abs(r+1-e.length),t+rk(i)*rw[r];},rk(0));return i&&(i=rw[e.length]/rk(2)-rk(1))<(t=rk(t))&&(t=(t=t-i-i)-rk(2)),Number(t);}),rx=function(e,t,i){var i=void 0===i?{}:i,s=i.offset,r=void 0===s?0:s,s=i.mask,n=void 0===s?[]:s,i=(e=rE(e),(t=rE(t)).every||Array.prototype.every);return t.length&&e.length-r>=t.length&&i.call(t,function(t,i){return t===(n[i]?n[i]&e[r+i]:e[r+i]);});},r2="http://example.com";function rI(e,t){return (t=void 0===t?Object:t)&&"function"==typeof t.freeze?t.freeze(e):e;}var rL=rI({HTML:"text/html",isHTML:function(e){return e===rL.HTML;},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),rD=rI({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===rD.HTML;},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"}),rA={assign:function(e,t){if(null===e||"object"!=typeof e)throw TypeError("target is not an object");for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e;},find:function(e,t,i){if(void 0===i&&(i=Array.prototype),e&&"function"==typeof i.find)return i.find.call(e,t);for(var s=0;s<e.length;s++)if(Object.prototype.hasOwnProperty.call(e,s)){var r=e[s];if(t.call(void 0,r,s,e))return r;}},freeze:rI,MIME_TYPE:rL,NAMESPACE:rD},rP=rA.find,r3=rA.NAMESPACE;function r6(e){return ""!==e;}function r1(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e;}function r4(e){return e?Object.keys((e=e?e.split(/[\t\n\f\r ]+/).filter(r6):[]).reduce(r1,{})):[];}function rO(e,t){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);}function rR(e,t){var i=e.prototype;function s(){}i instanceof t||(s.prototype=t.prototype,rO(i,s=new s()),e.prototype=i=s),i.constructor!=e&&(i.constructor=e);}var sP={},sL=(sP.ELEMENT_NODE=1,sP.ATTRIBUTE_NODE=2,sP.TEXT_NODE=3,sP.CDATA_SECTION_NODE=4,sP.ENTITY_REFERENCE_NODE=5,sP.ENTITY_NODE=6,sP.PROCESSING_INSTRUCTION_NODE=7,sP.COMMENT_NODE=8,sP.DOCUMENT_NODE=9,sP.DOCUMENT_TYPE_NODE=10,sP.DOCUMENT_FRAGMENT_NODE=11,sP.NOTATION_NODE=12,{}),rN={},rM=(sL.INDEX_SIZE_ERR=(rN[1]="Index size error",1),sL.DOMSTRING_SIZE_ERR=(rN[2]="DOMString size error",2),sL.HIERARCHY_REQUEST_ERR=(rN[3]="Hierarchy request error",3)),rU=(sL.WRONG_DOCUMENT_ERR=(rN[4]="Wrong document",4),sL.INVALID_CHARACTER_ERR=(rN[5]="Invalid character",5),sL.NO_DATA_ALLOWED_ER
50R=(rN[6]="No data allowed",6),sL.NO_MODIFICATION_ALLOWED_ERR=(rN[7]="No modification allowed",7),sL.NOT_FOUND_ERR=(rN[8]="Not found",8));function r5(e,t){var i;return t instanceof Error?i=t:(i=this,Error.call(this,rN[e]),this.message=rN[e],Error.captureStackTrace&&Error.captureStackTrace(this,r5)),i.code=e,t&&(this.message=this.message+": "+t),i;}function rB(){}function r7(e,t){this._node=e,this._refresh=t,rF(this);}function rF(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var i=e._refresh(e._node);if(nT(e,"length",i.length),!e.$$length||i.length<e.$$length)for(var s=i.length;(s in e);s++)Object.prototype.hasOwnProperty.call(e,s)&&delete e[s];rO(i,e),e._inc=t;}}function rq(){}function rj(e,t){for(var i=e.length;i--;)if(e[i]===t)return i;}function rH(e,t,i,s){s?t[rj(t,s)]=i:t[t.length++]=i,e&&(t=(i.ownerElement=e).ownerDocument)&&(s&&rK(t,e,s),s=e,e=i,(i=t)&&i._inc++,e.namespaceURI===r3.XMLNS)&&(s._nsMap[e.prefix?e.localName:""]=e.value);}function rV(e,t,i){var s=rj(t,i);if(!(0<=s))throw new r5(rU,Error(e.tagName+"@"+i));for(var r,n=t.length-1;s<n;)t[s]=t[++s];t.length=n,e&&(r=e.ownerDocument)&&(rK(r,e,i),i.ownerElement=null);}function r9(){}function rz(){}function rW(e){return ("<"==e?"&lt;":">"==e&&"&gt;")||("&"==e?"&amp;":'"'==e&&"&quot;")||"&#"+e.charCodeAt()+";";}function rG(e,t){if(t(e))return 1;if(e=e.firstChild)do if(rG(e,t))return 1;while(e=e.nextSibling);}function rX(){this.ownerDocument=this;}function rK(e,t,i){e&&e._inc++,i.namespaceURI===r3.XMLNS&&delete t._nsMap[i.prefix?i.localName:""];}function rY(e,t,i){if(e&&e._inc){e._inc++;var s=t.childNodes;if(i)s[s.length++]=i;else{for(var r=t.firstChild,n=0;r;)r=(s[n++]=r).nextSibling;s.length=n,delete s[s.length];}}}function rQ(e,t){var i=t.previousSibling,s=t.nextSibling;return i?i.nextSibling=s:e.firstChild=s,s?s.previousSibling=i:e.lastChild=i,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,rY(e.ownerDocument,e),t;}function rJ(e){return e&&e.nodeType===rz.DOCUMENT_TYPE_NODE;}function rZ(e){return e&&e.nodeType===rz.ELEMENT_NODE;}function ne(e){return e&&e.nodeType===rz.TEXT_NODE;}function nt(e,t){var i,e=e.childNodes||[];if(!rP(e,rZ)&&!rJ(t))return i=rP(e,rJ),!(t&&i&&e.indexOf(i)>e.indexOf(t));}function ni(e,t){var i,e=e.childNodes||[];if(!rP(e,function(e){return rZ(e)&&e!==t;}))return i=rP(e,rJ),!(t&&i&&e.indexOf(i)>e.indexOf(t));}function ns(e,t,i){var s=e.childNodes||[],r=t.childNodes||[];
50if(t.nodeType===rz.DOCUMENT_FRAGMENT_NODE){var n=r.filter(rZ);if(1<n.length||rP(r,ne))throw new r5(rM,"More than one element or text in fragment");if(1===n.length&&!nt(e,i))throw new r5(rM,"Element in fragment can not be inserted before doctype");}if(rZ(t)&&!nt(e,i))throw new r5(rM,"Only one element can be added and only after doctype");if(rJ(t)){if(rP(s,rJ))throw new r5(rM,"Only one doctype is allowed");if(r=rP(s,rZ),i&&s.indexOf(r)<s.indexOf(i))throw new r5(rM,"Doctype can only be inserted before an element");if(!i&&r)throw new r5(rM,"Doctype can not be appended since element is present");}}function nr(e,t,i){var s=e.childNodes||[],r=t.childNodes||[];if(t.nodeType===rz.DOCUMENT_FRAGMENT_NODE){var n=r.filter(rZ);if(1<n.length||rP(r,ne))throw new r5(rM,"More than one element or text in fragment");if(1===n.length&&!ni(e,i))throw new r5(rM,"Element in fragment can not be inserted before doctype");}if(rZ(t)&&!ni(e,i))throw new r5(rM,"Only one element can be added and only after doctype");if(rJ(t)){if(rP(s,function(e){return rJ(e)&&e!==i;}))throw new r5(rM,"Only one doctype is allowed");if(r=rP(s,rZ),i&&s.indexOf(r)<s.indexOf(i))throw new r5(rM,"Doctype can only be inserted before an element");}}function nn(e,t,i,s){if(function e(t,i,s){var r;if(!(r=t)||r.nodeType!==rz.DOCUMENT_NODE&&r.nodeType!==rz.DOCUMENT_FRAGMENT_NODE&&r.nodeType!==rz.ELEMENT_NODE)throw new r5(rM,"Unexpected parent node type "+t.nodeType);if(s&&s.parentNode!==t)throw new r5(rU,"child not in parent");if(!(r=i)||!(rZ(r)||ne(r)||rJ(r)||r.nodeType===rz.DOCUMENT_FRAGMENT_NODE||r.nodeType===rz.COMMENT_NODE||r.nodeType===rz.PROCESSING_INSTRUCTION_NODE)||rJ(i)&&t.nodeType!==rz.DOCUMENT_NODE)throw new r5(rM,"Unexpected node type "+i.nodeType+" for parent node type "+t.nodeType);}(e,t,i),e.nodeType===rz.DOCUMENT_NODE&&(s||ns)(e,t,i),(s=t.parentNode)&&s.removeChild(t),11===t.nodeType){var r=t.firstChild;if(null==r)return t;var n=t.lastChild;}else r=n=t;for(s=i?i.previousSibling:e.lastChild,r.previousSibling=s,n.nextSibling=i,s?s.nextSibling=r:e.firstChild=r,null==i?e.lastChild=n:i.previousSibling=n;r.parentNode=e,r!==n&&(r=r.nextSibling););return rY(e.ownerDocument||e,e),11==t.nodeType&&(t.firstChild=t.lastChild=null),t;}function na(){this._nsMap={};}function no(){}function nl(){}function nh(){}function nd(){}function nu(){}function nc(){}function np(){}function nm(){}function ng(){}function nf(){}function ny(){}function n8(){}function nv(e,t){var i,s=[],r=9==this.nodeType&&this.documentElement||this,n=r.prefix,a=r.namespaceURI;return nb(this,s,e,t,i=a&&null==n&&null==r.lookupPrefix(a)?[{namespace:a,prefix:null}]:i),s.join("");}function n$(e,t,i){var s=e.prefix||"",r=e.namespaceURI;if(r&&("xml"!==s||r!==r3.XML)&&r!==r3.XMLNS){for(var n=i.length;n--;){var a=i[n];if(a.prefix===s)return a.namespace!==r;}return 1;}}function n_(e,t,i){e.push(" ",t,'="',i.replace(/[<>&"\t\n\r]/g,rW),'"');}function nb(e,t,i,s,r){if(r=r||[],s){if(!(e=s(e)))return;if("string"==typeof e)return void t.push(e);}switch(e.nodeType){case 1:var n=e.attributes,a=n.length,o=e.firstChild,l=e.tagName,h=l;if(!(i=r3.isHTML(e.namespaceURI)||i)&&!e.prefix&&e.namespaceURI){for(var d,u=0;u<n.length;u++)if("xmlns"===n.item(u).name){d=n.item(u).value;break;}if(!d)for(var c=r.length-1;0<=c;c--)if(""===(p=r[c]).prefix&&p.namespace===e.namespaceURI){d=p.namespace;break;}if(d!==e.namespaceURI)for(var p,c=r.length-1;0<=c;c--)if((p=r[c]).namespace===e.namespaceURI){p.prefix&&(h=p.prefix+":"+l);break;}}t.push("<",h);for(var m=0;m<a;m++)"xmlns"==(g=n.item(m)).prefix?r.push({prefix:g.localName,namespace:g.value}):"xmlns"==g.nodeName&&r.push({prefix:"",namespace:g.value});for(var g,f,y,m=0;m<a;m++)n$(g=n.item(m),0,r)&&(n_(t,(f=g.prefix||"")?"xmlns:"+f:"xmlns",y=g.namespaceURI),r.push({prefix:f,namespace:y})),nb(g,t,i,s,r);if(l===h&&n$(e,0,r)&&(n_(t,(f=e.prefix||"")?"xmlns:"+f:"xmlns",y=e.namespaceURI),r.push({prefix:f,namespace:y})),o||i&&!/^(?:meta|link|img|br|hr|input)$/i.test(l)){if(t.push(">"),i&&/^script$/i.test(l))for(;o;)o.data?t.push(o.data):nb(o,t,i,s,r.slice()),o=o.nextSibling;else for(;o;)nb(o,t,i,s,r.slice()),o=o.nextSibling;t.push("</",h,">");}else t.push("/>");return;case 9:case 11:for(o=e.firstChild;o;)nb(o,t,i,s,r.slice()),o=o.nextSibling;return;case 2:return n_(t,e.name,e.value);case 3:return t.push(e.data.replace(/[<&>]/g,rW));
50case 4:return t.push("<![CDATA[",e.data,"]]>");case 8:return t.push("<!--",e.data,"-->");case 10:var v=e.publicId,$=e.systemId;return t.push("<!DOCTYPE ",e.name),void (v?(t.push(" PUBLIC ",v),$&&"."!=$&&t.push(" ",$),t.push(">")):$&&"."!=$?t.push(" SYSTEM ",$,">"):((v=e.internalSubset)&&t.push(" [",v,"]"),t.push(">")));case 7:return t.push("<?",e.target," ",e.data,"?>");case 5:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName);}}function nT(e,t,i){e[t]=i;}sL.NOT_SUPPORTED_ERR=(rN[9]="Not supported",9),sL.INUSE_ATTRIBUTE_ERR=(rN[10]="Attribute in use",10),sL.INVALID_STATE_ERR=(rN[11]="Invalid state",11),sL.SYNTAX_ERR=(rN[12]="Syntax error",12),sL.INVALID_MODIFICATION_ERR=(rN[13]="Invalid modification",13),sL.NAMESPACE_ERR=(rN[14]="Invalid namespace",14),sL.INVALID_ACCESS_ERR=(rN[15]="Invalid access",15),r5.prototype=Error.prototype,rO(sL,r5),rB.prototype={length:0,item:function(e){return 0<=e&&e<this.length?this[e]:null;},toString:function(e,t){for(var i=[],s=0;s<this.length;s++)nb(this[s],i,e,t);return i.join("");},filter:function(e){return Array.prototype.filter.call(this,e);},indexOf:function(e){return Array.prototype.indexOf.call(this,e);}},r7.prototype.item=function(e){return rF(this),this[e]||null;},rR(r7,rB),rq.prototype={length:0,item:rB.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var i=this[t];if(i.nodeName==e)return i;}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new r5(10);return t=this.getNamedItem(e.nodeName),rH(this._ownerElement,this,e,t),t;},setNamedItemNS:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new r5(10);return t=this.getNamedItemNS(e.namespaceURI,e.localName),rH(this._ownerElement,this,e,t),t;},removeNamedItem:function(e){return e=this.getNamedItem(e),rV(this._ownerElement,this,e),e;},removeNamedItemNS:function(e,t){return e=this.getNamedItemNS(e,t),rV(this._ownerElement,this,e),e;},getNamedItemNS:function(e,t){for(var i=this.length;i--;){var s=this[i];if(s.localName==t&&s.namespaceURI==e)return s;}return null;}},r9.prototype={hasFeature:function(e,t){return !0;},createDocument:function(e,t,i){var s=new rX();return s.implementation=this,s.childNodes=new rB(),s.doctype=i||null,i&&s.appendChild(i),t&&(i=s.createElementNS(e,t),s.appendChild(i)),s;},createDocumentType:function(e,t,i){var s=new nc();return s.name=e,s.nodeName=e,s.publicId=t||"",s.systemId=i||"",s;}},rz.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return nn(this,e,t);},replaceChild:function(e,t){nn(this,e,t,nr),t&&this.removeChild(t);},removeChild:function(e){return rQ(this,e);},appendChild:function(e){return this.insertBefore(e,null);},hasChildNodes:function(){return null!=this.firstChild;},cloneNode:function(e){return function e(t,i,s){var r,n=new i.constructor();for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&"object"!=typeof (r=i[a])&&r!=n[a]&&(n[a]=r);switch(i.childNodes&&(n.childNodes=new rB()),n.ownerDocument=t,n.nodeType){case 1:var o=i.attributes,l=n.attributes=new rq(),h=o.length;l._ownerElement=n;for(var d=0;d<h;d++)n.setAttributeNode(e(t,o.item(d),!0));break;case 2:s=!0;}if(s)for(var u=i.firstChild;u;)n.appendChild(e(t,u,s)),u=u.nextSibling;return n;}(this.ownerDocument||this,this,e);},normalize:function(){for(var e=this.firstChild;e;){var t=e.nextSibling;t&&3==t.nodeType&&3==e.nodeType?(this.removeChild(t),e.appendData(t.data)):(e.normalize(),e=t);}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t);},hasAttributes:function(){return 0<this.attributes.length;},lookupPrefix:function(e){for(var t=this;t;){var i=t._nsMap;if(i)for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s)&&i[s]===e)return s;t=2==t.nodeType?t.ownerDocument:t.parentNode;}return null;},lookupNamespaceURI:function(e){for(var t=this;t;){var i=t._nsMap;if(i&&Object.prototype.hasOwnProperty.call(i,e))return i[e];t=2==t.nodeType?t.ownerDocument:t.parentNode;}return null;},isDefaultNamespace:function(e){return null==this.lookupPrefix(e);}},rO(sP,rz),rO(sP,rz.prototype),rX.prototype={nodeName:"#document",nodeType:9,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(11==e.nodeType)for(var i=e.firstChild;i;){var s=i.nextSibling;this.insertBefore(i,t),i=s;}else nn(this,e,t),null===(e.ownerDocument=this).documentElement&&1===e.nodeType&&(this.documentElement=e);return e;},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),rQ(this,e);},replaceChild:function(e,t){nn(this,e,t,nr),e.ownerDocument=this,t&&this.removeChild(t),rZ(e)&&(this.documentElement=e);},importNode:function(e,t){return function e(t,i,s){var r;switch(i.nodeType){case 1:(r=i.cloneNode(!1)).ownerDocument=t;case 11:break;case 2:s=!0;}if((r=r||i.cloneNode(!1)).ownerDocument=t,r.parentNode=null,s)for(var n=i.firstChild;n;)r.appendChild(e(t,n,s)),n=n.nextSibling;return r;}(this,e,t);},getElementById:function(e){var t=null;return rG(this.documentElement,function(i){if(1==i.nodeType&&i.getAttribute("id")==e)return t=i,!0;}),t;},getElementsByClassName:function(e){var t=r4(e);return new r7(this,function(i){var s=[];return 0<t.length&&rG(i.documentElement,function(r){var n,a,o;r!==i&&1===r.nodeType&&(n=r.getAttribute("class"))&&((a=e===n)||(n=r4(n),a=t.every((o=n,function(e){return o&&-1!==o.indexOf(e);}))),a)&&s.push(r);}),s;});},createElement:function(e){var t=new na();return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new rB(),(t.attributes=new rq())._ownerElement=t;},createDocumentFragment:function(){var e=new nf();return e.ownerDocument=this,e.childNodes=new rB(),e;},createTextNode:function(e){var t=new nh();return t.ownerDocument=this,t.appendData(e),t;},createComment:function(e){var t=new nd();return t.ownerDocument=this,t.appendData(e),t;},createCDATASection:function(e){var t=new nu();return t.ownerDocument=this,t.appendData(e),t;},createProcessingInstruction:function(e,t){var i=new ny();return i.ownerDocument=this,i.tagName=i.nodeName=i.target=e,i.nodeValue=i.data=t,i;},createAttribute:function(e){var t=new no();return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t;},createEntityReference:function(e){var t=new ng();return t.ownerDocument=this,t.nodeName=e,t;},createElementNS:function(e,t){var i=new na(),s=t.split(":"),r=i.attributes=new rq();return i.childNodes=new rB(),i.ownerDocument=this,i.nodeName=t,i.tagName=t,i.namespaceURI=e,2==s.length?(i.prefix=s[0],i.localName=s[1]):i.localName=t,r._ownerElement=i;},createAttributeNS:function(e,t){var i=new no(),s=t.split(":");return i.ownerDocument=this,i.nodeName=t,i.name=t,i.namespaceURI=e,i.specified=!0,2==s.length?(i.prefix=s[0],i.localName=s[1]):i.localName=t,i;}},rR(rX,rz),rX.prototype.getElementsByTagName=(na.prototype={nodeType:1,hasAttribute:function(e){return null!=this.getAttributeNode(e);},getAttribute:function(e){return (e=this.getAttributeNode(e))&&e.value||"";},getAttributeNode:function(e){return this.attributes.getNamedItem(e);},setAttribute:function(e,t){(e=this.ownerDocument.createAttribute(e)).value=e.nodeValue=""+t,this.setAttributeNode(e);},removeAttribute:function(e){(e=this.getAttributeNode(e))&&this.removeAttributeNode(e);},appendChild:function(e){var t;return 11===e.nodeType?this.insertBefore(e,null):(t=this,e.parentNode&&e.parentNode.removeChild(e),e.parentNode=t,e.previousSibling=t.lastChild,e.nextSibling=null,e.previousSibling?e.previousSibling.nextSibling=e:t.firstChild=e,t.last
50Child=e,rY(t.ownerDocument,t,e),e);},setAttributeNode:function(e){return this.attributes.setNamedItem(e);},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e);},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName);},removeAttributeNS:function(e,t){(e=this.getAttributeNodeNS(e,t))&&this.removeAttributeNode(e);},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t);},getAttributeNS:function(e,t){return (e=this.getAttributeNodeNS(e,t))&&e.value||"";},setAttributeNS:function(e,t,i){(e=this.ownerDocument.createAttributeNS(e,t)).value=e.nodeValue=""+i,this.setAttributeNode(e);},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t);},getElementsByTagName:function(e){return new r7(this,function(t){var i=[];return rG(t,function(s){s===t||1!=s.nodeType||"*"!==e&&s.tagName!=e||i.push(s);}),i;});},getElementsByTagNameNS:function(e,t){return new r7(this,function(i){var s=[];return rG(i,function(r){r===i||1!==r.nodeType||"*"!==e&&r.namespaceURI!==e||"*"!==t&&r.localName!=t||s.push(r);}),s;});}}).getElementsByTagName,rX.prototype.getElementsByTagNameNS=na.prototype.getElementsByTagNameNS,rR(na,rz),no.prototype.nodeType=2,rR(no,rz),nl.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t);},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length;},insertData:function(e,t){this.replaceData(e,0,t);},appendChild:function(e){throw Error(rN[rM]);},deleteData:function(e,t){this.replaceData(e,t,"");},replaceData:function(e,t,i){var s=this.data.substring(0,e),e=this.data.substring(e+t);this.nodeValue=this.data=i=s+i+e,this.length=i.length;}},rR(nl,rz),nh.prototype={nodeName:"#text",nodeType:3,splitText:function(e){var t=(i=this.data).substring(e),i=i.substring(0,e),e=(this.data=this.nodeValue=i,this.length=i.length,this.ownerDocument.createTextNode(t));return this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling),e;}},rR(nh,nl),nd.prototype={nodeName:"#comment",nodeType:8},rR(nd,nl),nu.prototype={nodeName:"#cdata-section",nodeType:4},rR(nu,nl),nc.prototype.nodeType=10,rR(nc,rz),np.prototype.nodeType=12,rR(np,rz),nm.prototype.nodeType=6,rR(nm,rz),ng.prototype.nodeType=5,rR(ng,rz),nf.prototype.nodeName="#document-fragment",nf.prototype.nodeType=11,rR(nf,rz),ny.prototype.nodeType=7,rR(ny,rz),n8.prototype.serializeToString=function(e,t,i){return nv.call(e,t,i);},rz.prototype.toString=nv;try{Object.defineProperty&&(Object.defineProperty(r7.prototype,"length",{get:function(){return rF(this),this.$$length;}}),Object.defineProperty(rz.prototype,"textContent",{get:function(){return function e(t){switch(t.nodeType){case 1:case 11: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 1:case 11: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;}}}),nT=function(e,t,i){e["$$"+t]=i;});}catch(nS){}var s2={DocumentType:nc,DOMException:r5,DOMImplementation:r9,Element:na,Node:rz,NodeList:rB,XMLSerializer:n8},n0=tr(function(e,t){var i=rA.freeze;t.XML_ENTITIES=i({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),t.HTML_ENTITIES=i({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
50sime:"⋍",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
50:"⅛",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:"â
50‹–",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:"â
50‹ ",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
50isht:"⥽",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
50pace:"  ",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;}),nE=(n0.XML_ENTITIES,n0.HTML_ENTITIES,n0.entityMap,rA.NAMESPACE),s1=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,s6=RegExp("[\\-\\.0-9"+s1.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),nk=RegExp("^"+s1.source+s6.source+"*(?::"+s1.source+s6.source+"*)?$"),nw=0,nC=1,nx=2,n2=3,nI=4,nL=5,nD=6,nA=7;function nP(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,nP);}function n3(){}function n6(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t;}function n1(e,t,i){for(var s=e.tagName,r=null,n=e.length;n--;){var a=e[n],o=a.qName,l=a.value,o=0<(d=o.indexOf(":"))?(h=a.prefix=o.slice(0,d),u=o.slice(d+1),"xmlns"===h&&u):(h=null,"xmlns"===(u=o)&&"");a.localName=u,!1!==o&&(null==r&&(r={},n4(i,i={})),i[o]=r[o]=l,a.uri=nE.XMLNS,t.startPrefixMapping(o,l));}for(var h,n=e.length;n--;)(h=(a=e[n]).prefix)&&("xml"===h&&(a.uri=nE.XML),"xmlns"!==h)&&(a.uri=i[h||""]);var d,u=0<(d=s.indexOf(":"))?(h=e.prefix=s.slice(0,d),e.localName=s.slice(d+1)):(h=null,e.localName=s),c=e.uri=i[h||""];if(t.startElement(c,u,s,e),!e.closed)return e.currentNSMap=i,e.localNSMap=r,1;if(t.endElement(c,u,s),r)for(h in r)Object.prototype.hasOwnProperty.call(r,h)&&t.endPrefixMapping(h);}function n4(e,t){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);}function nO(){this.attributeNames={};}(nP.prototype=Error()).name=nP.name,n3.prototype={parse:function(e,t,i){var s=this.domBuilder;s.startDocument(),n4(t,t={}),function(e,t,i,s,r){function n(e){var t=e.slice(1,-1);return Object.hasOwnProperty.call(i,t)?i[t]:"#"===t.charAt(0)?65535<(t=parseInt(t.substr(1).replace("x","0x")))?String.fromCharCode(55296+((t-=65536)>>
5010),56320+(1023&t)):String.fromCharCode(t):(r.error("entity not found:"+e),e);}function a(t){var i;m<t&&(i=e.substring(m,t).replace(/&#?\w+;/g,n),u&&o(m),s.characters(i,0,t-m),m=t);}function o(t,i){for(;h<=t&&(i=d.exec(e));)h=(l=i.index)+i[0].length,u.lineNumber++;u.columnNumber=t-l+1;}for(var l=0,h=0,d=/.*(?:\r\n?|\n)|.*$/g,u=s.locator,c=[{currentNSMap:t}],p={},m=0;;){try{var g,f,y=e.indexOf("<",m);if(y<0)return e.substr(m).match(/^\s*$/)||(f=(g=s.doc).createTextNode(e.substr(m)),g.appendChild(f),s.currentElement=f);switch(m<y&&a(y),e.charAt(y+1)){case "/":var v=e.indexOf(">",y+3),$=e.substring(y+2,v).replace(/[ \t\n\r]+$/g,""),_=c.pop(),b=(v<0?($=e.substring(y+2).replace(/[\s<].*/,""),r.error("end tag name: "+$+" is not complete:"+_.tagName),v=y+1+$.length):$.match(/\s</)&&($=$.replace(/[\s<].*/,""),r.error("end tag name: "+$+" maybe not complete"),v=y+1+$.length),_.localNSMap),T=_.tagName==$;if(T||_.tagName&&_.tagName.toLowerCase()==$.toLowerCase()){if(s.endElement(_.uri,_.localName,$),b)for(var S in b)Object.prototype.hasOwnProperty.call(b,S)&&s.endPrefixMapping(S);T||r.fatalError("end tag name: "+$+" is not match the current start tagName:"+_.tagName);}else c.push(_);v++;break;case "?":u&&o(y),v=function(e,t,i){var s=e.indexOf("?>",t);return s&&(e=e.substring(t,s).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/))?(e[0].length,i.processingInstruction(e[1],e[2]),s+2):-1;}(e,y,s);break;case "!":u&&o(y),v=function(e,t,i,s){if("-"===e.charAt(t+2))return "-"===e.charAt(t+3)?(n=e.indexOf("-->",t+4),t<n?(i.comment(e,t+4,n-t-4),n+3):(s.error("Unclosed comment"),-1)):-1;if("CDATA["==e.substr(t+3,6))return n=e.indexOf("]]>",t+9),i.startCDATA(),i.characters(e,t+9,n-t-9),i.endCDATA(),n+3;var r,s=function(e,t){var i,s=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(r.lastIndex=t,r.exec(e);i=r.exec(e);)if(s.push(i),i[1])return s;}(e,t),n=s.length;return 1<n&&/!doctype/i.test(s[0][0])?(e=s[1][0],r=t=!1,3<n&&(/^public$/i.test(s[2][0])?(t=s[3][0],r=4<n&&s[4][0]):/^system$/i.test(s[2][0])&&(r=s[3][0])),s=s[n-1],i.startDTD(e,t,r),i.endDTD(),s.index+s[0].length):-1;}(e,y,s,r);break;default:u&&o(y);var E=new nO(),k=c[c.length-1].currentNSMap,v=function(e,t,i,s,r,n){function a(e,t,s){i.attributeNames.hasOwnProperty(e)&&n.fatalError("Attribute "+e+" redefined"),i.addValue(e,t.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,r),s);}for(var o,l=++t,h=nw;;){var d=e.charAt(l);switch(d){case "=":if(h===nC)o=e.slice(t,l);else{if(h!==nx)throw Error("attribute equal must after attrName");}h=n2;break;
50case "'":case '"':if(h===n2||h===nC){if(h===nC&&(n.warning('attribute value must after "="'),o=e.slice(t,l)),t=l+1,!(0<(l=e.indexOf(d,t))))throw Error("attribute value no end '"+d+"' match");u=e.slice(t,l),a(o,u,t-1);}else{if(h!=nI)throw Error('attribute value must after "="');u=e.slice(t,l),a(o,u,t),n.warning('attribute "'+o+'" missed start quot('+d+")!!"),t=l+1;}h=nL;break;case "/":switch(h){case nw:i.setTagName(e.slice(t,l));case nL:case nD:case nA:h=nA,i.closed=!0;case nI:case nC:break;case nx:i.closed=!0;break;default:throw Error("attribute invalid close char('/')");}break;case "":return n.error("unexpected end of input"),h==nw&&i.setTagName(e.slice(t,l)),l;case ">":switch(h){case nw:i.setTagName(e.slice(t,l));case nL:case nD:case nA:break;case nI:case nC:"/"===(u=e.slice(t,l)).slice(-1)&&(i.closed=!0,u=u.slice(0,-1));case nx:h===nx&&(u=o),h==nI?(n.warning('attribute "'+u+'" missed quot(")!'),a(o,u,t)):(nE.isHTML(s[""])&&u.match(/^(?:disabled|checked|selected)$/i)||n.warning('attribute "'+u+'" missed value!! "'+u+'" instead!!'),a(u,u,t));break;case n2:throw Error("attribute value missed!!");}return l;case "\x80":d=" ";default:if(d<=" ")switch(h){case nw:i.setTagName(e.slice(t,l)),h=nD;break;case nC:o=e.slice(t,l),h=nx;break;case nI:var u=e.slice(t,l);n.warning('attribute "'+u+'" missed quot(")!!'),a(o,u,t);case nL:h=nD;}else switch(h){case nx:i.tagName,nE.isHTML(s[""])&&o.match(/^(?:disabled|checked|selected)$/i)||n.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),a(o,o,t),t=l,h=nC;break;case nL:n.warning('attribute space is required"'+o+'"!!');case nD:h=nC,t=l;break;case n2:h=nI,t=l;break;case nA:throw Error("elements closed character '/' and '>' must be connected to");}}l++;}}(e,y,E,k,n,r),w=E.length;if(!E.closed&&function(e,t,i,s){var r=s[i];return null==r&&((r=e.lastIndexOf("</"+i+">"))<t&&(r=e.lastIndexOf("</"+i)),s[i]=r),r<t;}(e,v,E.tagName,p)&&(E.closed=!0,i.nbsp||r.warning("unclosed xml attribute")),u&&w){for(var C=n6(u,{}),x=0;x<w;x++){var I=E[x];o(I.offset),I.locator=n6(u,{});}s.locator=C,n1(E,s,k)&&c.push(E),s.locator=u;}else n1(E,s,k)&&c.push(E);nE.isHTML(E.uri)&&!E.closed?v=function(e,t,i,s,r){if(/^(?:script|textarea)$/i.test(i)){var n=e.indexOf("</"+i+">",t),e=e.substring(t+1,n);if(/[&<]/.test(e))return /^script$/i.test(i)||(e=e.replace(/&#?\w+;/g,s)),r.characters(e,0,e.length),n;}return t+1;}(e,v,E.tagName,n,s):v++;}}catch(L){if(L instanceof nP)throw L;r.error("element parse error: "+L),v=-1;}m<v?m=v:a(Math.max(y,m)+1);}}(e,t,i,s,this.errorHandler),s.endDocument();}},nO.prototype={setTagName:function(e){if(!nk.test(e))throw Error("invalid tagName:"+e);this.tagName=e;},addValue:function(e,t,i){if(!nk.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;}};var s3={XMLReader:n3,ParseError:nP},nR=s2.DOMImplementation,nN=rA.NAMESPACE,nM=s3.ParseError,nU=s3.XMLReader;function n5(e){return e.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n");}function nB(e){this.options=e||{locator:{}};}function n7(){this.cdata=!1;}function nF(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber;}function nq(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 nj(e,t){(e.currentElement||e.doc).appendChild(t);}nB.prototype.parseFromString=function(e,t){var i=this.options,s=new nU(),r=i.domBuilder||new n7(),n=i.errorHandler,a=i.locator,o=i.xmlns||{},t=/\/x?html?$/.test(t),l=t?n0.HTML_ENTITIES:n0.XML_ENTITIES,n=(a&&r.setDocumentLocator(a),s.errorHandler=function(e,t,i){if(!e){if(t instanceof n7)return t;e=t;}var s={},r=e instanceof Function;function n(t){var n=e[t];!n&&r&&(n=2==e.length?function(i){e(t,i);}:e),s[t]=n?function(e){n("[xmldom "+t+"]	"+e+function e(t){if(t)return "\n@"+(t.systemId||"")+"#[line:"+t.lineNumber+",col:"+t.columnNumber+"]";}(i));}:function(){};}return i=i||{},n("warning"),n("error"),n("fatalError"),s;}(n,r,a),s.domBuilder=i.domBuilder||r,t&&(o[""]=nN.HTML),o.xml=o.xml||nN.XML,i.normalizeLineEndings||n5);return e&&"string"==typeof e?s.parse(n(e),o,l):s.errorHandler.error("invalid doc source"),r.doc;},n7.prototype={startDocument:function(){this.doc=(new nR()).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId);},startElement:function(e,t,i,s){var r=this.doc,n=r.createElementNS(e,i||t),a=s.length;nj(this,n),this.currentElement=n,this.locator&&nF(this.locator,n);for(var o=0;o<a;o++){var e=s.getURI(o),l=s.getValue(o),i=s.getQName(o),h=r.createAttributeNS(e,i);this.locator&&nF(s.getLocator(o),h),h.value=h.nodeValue=l,n.setAttributeNode(h);}},endElement:function(e,t,i){var s=this.currentElement;s.tagName,this.currentElement=s.parentNode;},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){e=this.doc.createProcessingInstruction(e,t),this.locator&&nF(this.locator,e),nj(this,e);},ignorableWhitespace:function(e,t,i){},characters:function(e,t,i){var s;(e=nq.apply(this,arguments))&&(s=this.cdata?this.doc.createCDATASection(e):this.doc.createTextNode(e),this.currentElement?this.currentElement.appendChild(s):/^\s*$/.test(e)&&this.doc.appendChild(s),this.locator)&&nF(this.locator,s);},skippedEntity:function(e){},endDocument:function(){this.doc.normalize();},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0);},comment:function(e,t,i){e=nq.apply(this,arguments),e=this.doc.createComment(e),this.locator&&nF(this.locator,e),nj(this,e);},startCDATA:function(){this.cdata=!0;},endCDATA:function(){this.cdata=!1;},startDTD:function(e,t,i){var s=this.doc.implementation;s&&s.createDocumentType&&(s=s.createDocumentType(e,t,i),this.locator&&nF(this.locator,s),nj(this,s),this.doc.doctype=s);},warning:function(e){},error:function(e){},fatalError:function(e){throw new nM(e,this.locator);}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(e){n7.prototype[e]=function(){return null;};});var nH=nB;let nV=(e)=>!!e&&"object"==typeof e,n9=(...e)=>e.reduce((e,t)=>
50("object"==typeof t&&Object.keys(t).forEach((i)=>{Array.isArray(e[i])&&Array.isArray(t[i])?e[i]=e[i].concat(t[i]):nV(e[i])&&nV(t[i])?e[i]=n9(e[i],t[i]):e[i]=t[i];}),e),{}),nz=(e)=>Object.keys(e).map((t)=>e[t]),nW=(e)=>e.reduce((e,t)=>e.concat(t),[]),nG=(e)=>{if(!e.length)return [];var t=[];for(let i=0;i<e.length;i++)t.push(e[i]);return t;};var nX={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",INVALID_NUMBER_OF_CONTENT_STEERING:"INVALID_NUMBER_OF_CONTENT_STEERING",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",MISSING_SEGMENT_INFORMATION:"MISSING_SEGMENT_INFORMATION",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};let nK=({baseUrl:e="",source:t="",range:i="",indexRange:s=""})=>{if(e={uri:t,resolvedUri:rg(e||"",t)},i||s){t=(i||s).split("-");let r=window.BigInt?window.BigInt(t[0]):parseInt(t[0],10),n=window.BigInt?window.BigInt(t[1]):parseInt(t[1],10);r<Number.MAX_SAFE_INTEGER&&"bigint"==typeof r&&(r=Number(r)),n<Number.MAX_SAFE_INTEGER&&"bigint"==typeof n&&(n=Number(n));let a;"bigint"==typeof (a="bigint"==typeof n||"bigint"==typeof r?window.BigInt(n)-window.BigInt(r)+window.BigInt(1):n-r+1)&&a<Number.MAX_SAFE_INTEGER&&(a=Number(a)),e.byterange={length:a,offset:r};}return e;},nY=(e)=>(e&&"number"!=typeof e&&(e=parseInt(e,10)),isNaN(e)?null:e),nQ={static(e){var {duration:t,timescale:i=1,sourceDuration:s,periodDuration:r}=e,e=nY(e.endNumber),t=t/i;return "number"==typeof e?{start:0,end:e}:"number"==typeof r?{start:0,end:r/t}:{start:0,end:s/t};},dynamic(e){var {NOW:t,clientOffset:i,availabilityStartTime:s,timescale:r=1,duration:n,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:l=1/0}=e,e=nY(e.endNumber),t=(t+i)/1e3,i=s+a,s=Math.ceil((t+o-i)*r/n),a=Math.floor((t-i-l)*r/n),o=Math.floor((t-i)*r/n);return {start:Math.max(0,a),end:"number"==typeof e?e:Math.min(s,o)};}},nJ=(e)=>{var t,{type:i,duration:s,timescale:r=1,periodDuration:n,sourceDuration:a}=e,{start:o,end:l}=nQ[i](e),o=((e,t)=>{var i=[];for(let s=e;s<t;s++)i.push(s);return i;})(o,l).map((t=e,(e)=>{var {duration:i,timescale:s=1,periodStart:r,startNumber:n=1}=t;return {number:n+e,duration:i/s,timeline:r,time:e*i};}));return "static"===i&&(o[l=o.length-1].duration=("number"==typeof n?n:a)-s/r*l),o;},nZ=(e)=>{var {baseUrl:t,initialization:i={},sourceDuration:s,indexRange:r="",periodStart:n,presentationTime:a,number:o=0,duration:l}=e;if(t)return i=nK({baseUrl:t,source:i.sourceURL,range:i.range}),(t=nK({baseUrl:t,source:t,indexRange:r})).map=i,l?(r=nJ(e)).length&&(t.duration=r[0].duration,t.timeline=r[0].timeline):s&&(t.duration=s,t.timeline=n),t.presentationTime=a||n,t.number=o,[t];throw Error(nX.NO_BASE_URL);},ae=(e,t,i)=>{var s=e.sidx.map||null,r=e.sidx.duration,n=e.timeline||0,a=e.sidx.byterange,a=a.offset+a.length,o=t.timescale,l=t.references.filter((e)=>1!==e.referenceType),h=[],d=e.endList?"static":"dynamic",u=e.sidx.timeline;let c=u,p=e.mediaSequence||0,m;m="bigint"==typeof t.firstOffset?window.BigInt(a)+t.firstOffset:a+t.firstOffset;for(let g=0;g<l.length;g++){var f=t.references[g],y=f.referencedSize,f=f.subsegmentDuration;let v;v="bigint"==typeof m?m+window.BigInt(y)-window.BigInt(1):m+y-1;var $=m+"-"+v,$={baseUrl:i,timescale:o,timeline:n,periodStart:u,presentationTime:c,number:p,duration:f,sourceDuration:r,indexRange:$,type:d},$=nZ($)[0];s&&($.map=s),h.push($),"bigint"==typeof m?m+=window.BigInt(y):m+=y,c+=f/o,p++;}return e.segments=h,e;},at=["AUDIO","SUBTITLES"],ai=(e)=>{var t;return t=({timeline:e})=>e,nz(e.reduce((e,i)=>(i.forEach((i)=>{e[t(i)]=i;}),e),{})).sort((e,t)=>e.timeline>t.timeline?1:-1);},as=(e)=>{var t,i;let s=[];return t=e,e=at,i=(e,t,i,r)=>{s=s.concat(e.playlists||[]);},e.forEach(function(e){for(var s in t.mediaGroups[e])for(var r in t.mediaGroups[e][s])i(t.mediaGroups[e][s][r],e,s,r);}),s;},ar=({playlist:e,mediaSequence:t})=>{e.mediaSequence=t,e.segments.forEach((t,i)=>{t.number=e.mediaSequence+i;});},an=({oldManifest:e,newManifest:t})=>{var i,s,r=e.playlists.concat(as(e)),n=t.playlists.concat(as(t));return t.timelineStarts=ai([e.timelineStarts,t.timelineStarts]),{oldPlaylists:i,newPlaylists:e,timelineStarts:s}={oldPlaylists:r,newPlaylists:n,timelineStarts:t.timelineStarts},e.forEach((e)=>{e.discontinuitySequence=s.findIndex(function({timeline:t}){return t===e.timeline;});var t=((e,t)=>{for(let i=0;i<e.length;i++)if(e[i].attributes.NAME===t)return e[i];return null;})(i,e.attributes.NAME);if(t&&!e.sidx){let r=e.segments[0];var n=t.segments.findIndex(function(e){return Math.abs(e.presentationTime-r.presentationTime)<1/60;});-1===n?(ar({playlist:e,mediaSequence:t.mediaSequence+t.segments.length}),e.segments[0].discontinuity=!0,e.discontinuityStarts.unshift(0),(!t.segments.length&&e.timeline>t.timeline||t.segments.length&&e.timeline>t.segments[t.segments.length-1].timeline)&&e.discontinuitySequence--):(t.segments[n].discontinuity&&!r.discontinuity&&(r.discontinuity=!0,e.discontinuityStarts.unshift(0),e.discontinuitySequence--),ar({playlist:e,mediaSequence:t.segments[n].number}));}}),t;},aa=(e)=>{var t;let i;return e&&e.uri+"-"+(i="bigint"==typeof (t=e.byterange).offset||"bigint"==typeof t.length?window.BigInt(t.offset)+window.BigInt(t.length)-window.BigInt(1):t.offset+t.length-1,t.offset+"-"+i);},ao=(e)=>{e=e.reduce(function(e,t){return e[t.attributes.baseUrl]||(e[t.attributes.baseUrl]=[]),e[t.attributes.baseUrl].push(t),e;},{});let t=[];return Object.values(e).forEach((e)=>{e=nz(e.reduce((e,t)=>
50{var 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;},{})),t=t.concat(e);}),t.map((e)=>{var t,i;return e.discontinuityStarts=(t=e.segments||[],i="discontinuity",t.reduce((e,t,s)=>(t[i]&&e.push(s),e),[])),e;});},al=(e,t)=>{var i=aa(e.sidx),t=i&&t[i]&&t[i].sidx;return t&&ae(e,t,e.sidx.resolvedUri),e;},ah=(e,t={})=>e.reduce((e,i)=>{var s,r,n,a,o=i.attributes.label||i.attributes.lang||"text";return e[o]||(e[o]={language:o,default:!1,autoselect:!1,playlists:[],uri:""}),e[o].playlists.push(al(({attributes:o,segments:i,mediaSequence:s,discontinuityStarts:r,discontinuitySequence:n}=i,void 0===i&&(i=[{uri:o.baseUrl,timeline:o.periodStart,resolvedUri:o.baseUrl||"",duration:o.sourceDuration,number:0}],o.duration=o.sourceDuration),a={NAME:o.id,BANDWIDTH:o.bandwidth,"PROGRAM-ID":1},o.codecs&&(a.CODECS=o.codecs),a={attributes:a,uri:"",endList:"static"===o.type,timeline:o.periodStart,resolvedUri:o.baseUrl||"",targetDuration:o.duration,timelineStarts:o.timelineStarts,discontinuityStarts:r,discontinuitySequence:n,mediaSequence:s,segments:i},o.serviceLocation&&(a.attributes.serviceLocation=o.serviceLocation),a),t)),e;},{}),ad=({attributes:e,segments:t,sidx:i,discontinuityStarts:s})=>(s={attributes:{NAME:e.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:e.width,height:e.height},CODECS:e.codecs,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1},uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuityStarts:s,timelineStarts:e.timelineStarts,segments:t},e.frameRate&&(s.attributes["FRAME-RATE"]=e.frameRate),e.contentProtection&&(s.contentProtection=e.contentProtection),e.serviceLocation&&(s.attributes.serviceLocation=e.serviceLocation),i&&(s.sidx=i),s),au=({attributes:e})=>"video/mp4"===e.mimeType||"video/webm"===e.mimeType||"video"===e.contentType,ac=({attributes:e})=>"audio/mp4"===e.mimeType||"audio/webm"===e.mimeType||"audio"===e.contentType,ap=({attributes:e})=>"text/vtt"===e.mimeType||"text"===e.contentType,am=(e)=>e?Object.keys(e).reduce((t,i)=>(i=e[i],t.concat(i.playlists)),[]):[],ag=({dashPlaylists:e,locations:t,contentSteering:i,sidxMapping:s={},previousManifest:r,eventStream:n})=>{var a,o,l,h,d,u,c,p;return e.length?({sourceDuration:h,type:u,suggestedPresentationDelay:c,minimumUpdatePeriod:d}=e[0].attributes,a=ao(e.filter(au)).map(ad),o=ao(e.filter(ac)),l=ao(e.filter(ap)),e=e.map((e)=>e.attributes.captionServices).filter(Boolean),h={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:h,playlists:((e,t={})=>{if(Object.keys(t).length){for(let i in e)e[i]=al(e[i],t);}return e;})(a,s)},0<=d&&(h.minimumUpdatePeriod=1e3*d),t&&(h.locations=t),i&&(h.contentSteering=i),"dynamic"===u&&(h.suggestedPresentationDelay=c),n&&0<n.length&&(h.eventStream=n),d=0===h.playlists.length,t=o.length?((e,t={},i)=>{let s;return e=e.reduce((e,r)=>{var n=r.attributes.role&&r.attributes.role.value||"",a=r.attributes.lang||"";let o=r.attributes.label||"main";return e[o=a&&!r.attributes.label?r.attributes.lang+(n?` (${n})`:""):o]||(e[o]={language:a,autoselect:!0,default:"main"===n,playlists:[],uri:""}),a=al((({attributes:e,segments:t,sidx:i,mediaSequence:s,discontinuitySequence:r,discontinuityStarts:n},a)=>(r={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:r,discontinuityStarts:n,timelineStarts:e.timelineStarts,mediaSequence:s,segments:t},e.contentProtection&&(r.contentProtection=e.contentProtection),e.serviceLocation&&(r.attributes.serviceLocation=e.serviceLocation),i&&(r.sidx=i),a&&(r.attributes.AUDIO="audio",r.attributes.SUBTITLES="subs"),r))(r,i),t),e[o].playlists.push(a),void 0===s&&"main"===n&&((s=r).default=!0),e;},{}),s||(e[Object.keys(e)[0]].default=!0),e;})(o,s,d):null,i=l.length?ah(l,s):null,c=(u=a.concat(am(t),am(i))).map(({timelineStarts:e})=>e),h.timelineStarts=ai(c),p=h.timelineStarts,u.forEach((e)=>{e.mediaSequence=0,e.discontinuitySequence=p.findIndex(function({timeline:t}){return t===e.timeline;}
50),e.segments&&e.segments.forEach((e,t)=>{e.number=t;});}),t&&(h.mediaGroups.AUDIO.audio=t),i&&(h.mediaGroups.SUBTITLES.subs=i),e.length&&(h.mediaGroups["CLOSED-CAPTIONS"].cc=e.reduce((e,t)=>(t&&t.forEach((t)=>{var {channel:i,language:s}=t;e[s]={autoselect:!1,default:!1,instreamId:i,language:s},t.hasOwnProperty("aspectRatio")&&(e[s].aspectRatio=t.aspectRatio),t.hasOwnProperty("easyReader")&&(e[s].easyReader=t.easyReader),t.hasOwnProperty("3D")&&(e[s]["3D"]=t["3D"]);}),e),{})),r?an({oldManifest:r,newManifest:h}):h):{};},af=(e,t)=>{var {type:i,minimumUpdatePeriod:s=0,media:r="",sourceDuration:n,timescale:a=1,startNumber:o=1,periodStart:l}=e,h=[];let d=-1;for(let u=0;u<t.length;u++){var c=t[u],p=c.d,m=c.r||0,c=c.t||0;d<0&&(d=c),c&&c>d&&(d=c);let g;g=m<0?(c=u+1)===t.length?"dynamic"===i&&0<s&&0<r.indexOf("$Number$")?((e,t,i)=>{var {NOW:e,clientOffset:s,availabilityStartTime:r,timescale:n=1,periodStart:a=0,minimumUpdatePeriod:o=0}=e;return Math.ceil((((e+s)/1e3+o-(r+a))*n-t)/i);})(e,d,p):(n*a-d)/p:(t[c].t-d)/p:m+1;var f=o+h.length+g;let y=o+h.length;for(;y<f;)h.push({number:y,duration:p/a,time:d,timeline:l}),d+=p,y++;}return h;},ay=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,a8=(e,t)=>{var i;return e.replace(ay,(i=t,(e,t,s,r)=>"$$"===e?"$":void 0===i[t]?e:(e=""+i[t],"RepresentationID"===t||(r=s?parseInt(r,10):1)<=e.length?e:Array(r-e.length+1).join("0")+e)));},av=(e,t)=>{let i={RepresentationID:e.id,Bandwidth:e.bandwidth||0};var {initialization:s={sourceURL:"",range:""}}
50=e;let r=nK({baseUrl:e.baseUrl,source:a8(s.sourceURL,i),range:s.range});return s=t,((t=e).duration||s?t.duration?nJ(t):af(t,s):[{number:t.startNumber||1,duration:t.sourceDuration,time:0,timeline:t.periodStart}]).map((t)=>{i.Number=t.number,i.Time=t.time;var s=a8(e.media||"",i),n=e.timescale||1,a=e.presentationTimeOffset||0,a=e.periodStart+(t.time-a)/n;return {uri:s,timeline:t.timeline,duration:t.duration,resolvedUri:rg(e.baseUrl||"",s),map:r,number:t.number,presentationTime:a};});},a$=(e,t)=>{let {duration:i,segmentUrls:s=[],periodStart:r}=e;if(!i&&!t||i&&t)throw Error(nX.SEGMENT_TIME_UNSPECIFIED);let n=s.map((t)=>{var {baseUrl:i,initialization:s={}}=i=e,s=nK({baseUrl:i,source:s.sourceURL,range:s.range});return (i=nK({baseUrl:i,source:t.media,range:t.mediaRange})).map=s,i;}),a;return i&&(a=nJ(e)),(a=t?af(e,t):a).map((t,i)=>{var s,a;if(n[i])return i=n[i],s=e.timescale||1,a=e.presentationTimeOffset||0,i.timeline=t.timeline,i.duration=t.duration,i.number=t.number,i.presentationTime=r+(t.time-a)/s,i;}).filter((e)=>e);},a_=({attributes:e,segmentInfo:t})=>{let i,s;t.template?(s=av,i=n9(e,t.template)):t.base?(s=nZ,i=n9(e,t.base)):t.list&&(s=a$,i=n9(e,t.list));var r,n,a,e={attributes:e};return s&&(r=s(i,t.segmentTimeline),i.duration?({duration:n,timescale:a=1}=i,i.duration=n/a):r.length?i.duration=r.reduce((e,t)=>Math.max(e,Math.ceil(t.duration)),0):i.duration=0,e.attributes=i,e.segments=r,t.base)&&i.indexRange&&(e.sidx=r[0],e.segments=[]),e;},ab=(e)=>e.map(a_),aT=(e,t)=>nG(e.childNodes).filter(({tagName:e})=>e===t),aS=(e)=>e.textContent.trim(),a0=(e)=>{var t,i,s,r,n,e=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);return e?([e,t,i,s,r,n]=e.slice(1),31536e3*parseFloat(e||0)+2592e3*parseFloat(t||0)+86400*parseFloat(i||0)+3600*parseFloat(s||0)+60*parseFloat(r||0)+parseFloat(n||0)):0;},aE={mediaPresentationDuration:(e)=>a0(e),availabilityStartTime:(e)=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(e)&&(e+="Z"),Date.parse(e)/1e3),minimumUpdatePeriod:(e)=>a0(e),suggestedPresentationDelay:(e)=>a0(e),type:(e)=>e,timeShiftBufferDepth:(e)=>a0(e),start:(e)=>a0(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){var t=parseInt(e,10);return isNaN(t)?a0(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},ak=(e)=>e&&e.attributes?nG(e.attributes).reduce((e,t)=>{var i=aE[t.name]||aE.DEFAULT;return e[t.name]=i(t.value),e;},{}):{},aw={"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"},aC=(e,t)=>t.length?nW(e.map(function(e){return t.map(function(t){var i=aS(t),s=rg(e.baseUrl,i),t=n9(ak(t),{baseUrl:s});return s!==i&&!t.serviceLocation&&e.serviceLocation&&(t.serviceLocation=e.serviceLocation),t;});})):e,ax=(e)=>{var t=aT(e,"SegmentTemplate")[0],i=aT(e,"SegmentList")[0],s=i&&aT(i,"SegmentURL").map((e)=>n9({tag:"SegmentURL"},ak(e))),e=aT(e,"SegmentBase")[0],r=i||t,r=r&&aT(r,"SegmentTimeline")[0],n=i||e||t,n=n&&aT(n,"Initialization")[0],t=t&&ak(t);t&&n?t.initialization=n&&ak(n):t&&t.initialization&&(t.initialization={sourceURL:t.initialization});let a={template:t,segmentTimeline:r&&aT(r,"S").map((e)=>ak(e)),list:i&&n9(ak(i),{segmentUrls:s,initialization:ak(n)}),base:e&&n9(ak(e),{initialization:ak(n)})};return Object.keys(a).forEach((e)=>{a[e]||delete a[e];}),a;},a2=(e)=>nW(aT(e.node,"EventStream").map((t)=>{let i=ak(t),s=i.schemeIdUri;return aT(t,"Event").map((t)=>{var r=ak(t),n=r.presentationTime||0,a=i.timescale||1,o=r.duration||0,n=n/a+e.attributes.start;return {schemeIdUri:s,value:i.value,id:r.id,start:n,end:n+o/a,messageData:aS(t)||r.messageData,contentEncoding:i.contentEncoding,presentationTimeOffset:i.presentationTimeOffset||0};});})),aI=(e,t,i)=>(s)=>{var r=ak(s),n=aC(t,aT(s,"BaseURL")),a=aT(s,"Role")[0],a={role:ak(a)};let o=n9(e,r,a);var l,h,d,r=aT(s,"Accessibility")[0],r="urn:scte:dash:cc:cea-608:2
50015"===(a=ak(r)).schemeIdUri?("string"!=typeof a.value?[]:a.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"===a.schemeIdUri?("string"!=typeof a.value?[]:a.value.split(";")).map((e)=>{var t,i;let s={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};return /=/.test(e)?([t,i=""]=e.split("="),s.channel=t,s.language=e,i.split(",").forEach((e)=>{var [e,t]=e.split(":");"lang"===e?s.language=t:"er"===e?s.easyReader=Number(t):"war"===e?s.aspectRatio=Number(t):"3D"===e&&(s["3D"]=Number(t));})):s.language=e,s.channel&&(s.channel="SERVICE"+s.channel),s;}):void 0,a=(r&&(o=n9(o,{captionServices:r})),aT(s,"Label")[0]),a=(a&&a.childNodes.length&&(o=n9(o,{label:r=a.childNodes[0].nodeValue.trim()})),aT(s,"ContentProtection").reduce((e,t)=>{var i=ak(t),s=(i.schemeIdUri&&(i.schemeIdUri=i.schemeIdUri.toLowerCase()),aw[i.schemeIdUri]);return s&&(e[s]={attributes:i},i=aT(t,"cenc:pssh")[0])&&(t=aS(i),e[s].pssh=t&&function e(t){for(var i=window.atob?window.atob(t):Buffer.from(t,"base64").toString("binary"),s=new Uint8Array(i.length),r=0;r<i.length;r++)s[r]=i.charCodeAt(r);return s;}(t)),e;},{})),r=(Object.keys(a).length&&(o=n9(o,{contentProtection:a})),ax(s)),a=aT(s,"Representation"),s=n9(i,r);return nW(a.map((l=o,h=n,d=s,(e)=>{var t=aT(e,"BaseURL"),t=aC(h,t);let i=n9(l,ak(e)),s=ax(e);return t.map((e)=>({segmentInfo:n9(d,s),attributes:n9(i,e)}));})));},aL=(e,t={})=>{var {manifestUri:t="",NOW:i=Date.now(),clientOffset:s=0,eventHandler:r=function(){}}=t,n=aT(e,"Period");if(!n.length)throw Error(nX.INVALID_NUMBER_OF_PERIOD);var a=aT(e,"Location");let o=ak(e);var l,h,t=aC([{baseUrl:t}],aT(e,"BaseURL")),e=aT(e,"ContentSteering");o.type=o.type||"static",o.sourceDuration=o.mediaPresentationDuration||0,o.NOW=i,o.clientOffset=s,a.length&&(o.locations=a.map(aS));let d=[];return n.forEach((e,t)=>{var i,s,r=ak(e),t=d[t-1];r.start=({attributes:t,priorPeriodAttributes:i,mpdType:s}={attributes:r,priorPeriodAttributes:t?t.attributes:null,mpdType:o.type},"number"==typeof t.start?t.start:i&&"number"==typeof i.start&&"number"==typeof i.duration?i.start+i.duration:i||"static"!==s?null:0),d.push({node:e,attributes:r});}),{locations:o.locations,contentSteeringInfo:(i=r,1<(s=e).length&&i({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),s.length?((i=n9({serverURL:aS(s[0])},ak(s[0]))).queryBeforeStart="true"===i.queryBeforeStart,i):null),representationInfo:nW(d.map((l=o,h=t,(e,t)=>{var i=aC(h,aT(e.node,"BaseURL")),s=n9(l,{periodStart:e.attributes.start}),r=("number"==typeof e.attributes.duration&&(s.periodDuration=e.attributes.duration),aT(e.node,"AdaptationSet")),e=ax(e.node);return nW(r.map(aI(s,i,e)));}))),eventStream:nW(d.map(a2))};},aD=(e)=>{if(""===e)throw Error(nX.DASH_EMPTY_MANIFEST);var t,i=new nH();let s;try{s=(t=i.parseFromString(e,"application/xml"))&&"MPD"===t.documentElement.tagName?t.documentElement:null;}catch(r){}if(!s||s&&0<s.getElementsByTagName("parsererror").length)throw Error(nX.DASH_INVALID_XML);return s;},aA=(e)=>{if(e=aD(e),!(e=aT(e,"UTCTiming")[0]))return null;var t=ak(e);switch(t.schemeIdUri){case "urn:mpeg:dash:utc:http-head:2014":case "urn:mpeg:dash:utc:http-head:2012":t.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":t.method="GET";break;case "urn:mpeg:dash:utc:direct:2014":case "urn:mpeg:dash:utc:direct:2012":t.method="DIRECT",t.value=Date.parse(t.value);break;default:throw Error(nX.UNSUPPORTED_UTC_TIMING_SCHEME);}return t;};function aP(e,t){var i,s,r;return void 0===t&&(t=0),(e=rE(e)).length-t<10||!rx(e,aM,{offset:t})?t:(t+=(void 0===(s=t)&&(s=0),r=(i=rE(i=e))[s+5],i=i[s+6]<<21|i[s+7]<<14|i[s+8]<<7|i[s+9],(16&r)>>4?20+i:10+i),aP(e,t));}function a3(e){return "string"==typeof e?rm(e):e;}function a6(e,t,i){var s;return i>=t.length?t.length:(s=a7(t,i,!1),rx(e.bytes,s.bytes)?i:a6(e,t,i+(e=a7(t,i+s.length)).length+e.value+s.length));}function a1(e,t){t=Array.isArray(i=t)?i.map(function(e){return aF(e);}):[aF(i)],e=rE(e);var i,s=[];if(t.length)for(var r=0;r<e.length;){var n=a7(e,r,!1),a=a7(e,r+n.length),o=r+n.length+a.length,l=(127===a.value&&(
50a.value=a6(n,e,o),a.value!==e.length)&&(a.value-=o),o+a.value>e.length?e.length:o+a.value),o=e.subarray(o,l);rx(t[0],n.bytes)&&(1===t.length?s.push(o):s=s.concat(a1(o,t.slice(1)))),r+=n.length+a.length+o.length;}return s;}function a4(e,t,i,s){void 0===s&&(s=1/0),e=rE(e),i=[].concat(i);for(var r,n=0,a=0;n<e.length&&(a<s||r);){var o=void 0;if(rx(e.subarray(n),aq)?o=4:rx(e.subarray(n),aj)&&(o=3),o){if(a++,r)return aV(e.subarray(r,n));var l=void 0;"h264"===t?l=31&e[n+o]:"h265"===t&&(l=e[n+o]>>1&63),-1!==i.indexOf(l)&&(r=n+o),n+=o+("h264"===t?1:2);}else n++;}return e.subarray(0,0);}function aO(e){e=rE(e);for(var t=0;t<aW.length;t++){var i=aW[t];if(aG[i](e))return i;}return "";}var aR=function(e){var t,e=new DataView(e.buffer,e.byteOffset,e.byteLength);return e.getBigUint64?(t=e.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(t):t:4294967296*e.getUint32(0)+e.getUint32(4);},aN=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8)},s=12,r=(0===i.version?(i.earliestPresentationTime=t.getUint32(s),i.firstOffset=t.getUint32(s+4),s+=8):(i.earliestPresentationTime=aR(e.subarray(s)),i.firstOffset=aR(e.subarray(s+8)),s+=16),t.getUint16(s+=2));for(s+=2;0<r;s+=12,r--)i.references.push({referenceType:(128&e[s])>>>7,referencedSize:2147483647&t.getUint32(s),subsegmentDuration:t.getUint32(s+4),startsWithSap:!!(128&e[s+8]),sapType:(112&e[s+8])>>>4,sapDeltaTime:268435455&t.getUint32(s+8)});return i;},aM=rE([73,68,51]),aU={EBML:rE([26,69,223,163]),DocType:rE([66,130]),Segment:rE([24,83,128,103]),SegmentInfo:rE([21,73,169,102]),Tracks:rE([22,84,174,107]),Track:rE([174]),TrackNumber:rE([215]),DefaultDuration:rE([35,227,131]),TrackEntry:rE([174]),TrackType:rE([131]),FlagDefault:rE([136]),CodecID:rE([134]),CodecPrivate:rE([99,162]),VideoTrack:rE([224]),AudioTrack:rE([225]),Cluster:rE([31,67,182,117]),Timestamp:rE([231]),TimestampScale:rE([42,215,177]),BlockGroup:rE([160]),BlockDuration:rE([155]),Block:rE([161]),SimpleBlock:rE([163])},a5=[128,64,32,16,8,4,2,1],aB=function(e){for(var t=1,i=0;i<a5.length&&!(e&a5[i]);i++)t++;return t;},a7=function(e,t,i,s){void 0===i&&(i=!0),void 0===s&&(s=!1);var r=aB(e[t]),n=e.subarray(t,t+r);return i&&((n=Array.prototype.slice.call(e,t,t+r))[0]^=a5[r-1]),{length:r,value:rC(n,{signed:s}),bytes:n};},aF=function e(t){return "string"==typeof t?t.match(/.{1,2}/g).map(e):"number"==typeof t?function e(t,i){for(var s=void 0!==(i=(void 0===i?{}:i).le)&&i,r=Math.ceil((i=t=rk(t="bigint"!=typeof t&&"number"!=typeof t||"number"==typeof t&&t!=t?0:t)).toString(2).length/8),n=new Uint8Array(new ArrayBuffer(r)),a=0;a<r;a++){var o=s?a:Math.abs(a+1-n.length);n[o]=Number(t/rw[a]&rk(255)),t<0&&(n[o]=Math.abs(~n[o]),n[o]-=0===a?1:2);}return n;}(t):t;},aq=rE([0,0,0,1]),aj=rE([0,0,1]),aH=rE([0,0,3]),aV=function(e){for(var t=[],i=1;i<e.length-2;)rx(e.subarray(i,i+3),aH)&&(t.push(i+2),i++),i++;if(0===t.length)return e;for(var s=e.length-t.length,r=new Uint8Array(s),n=0,i=0;i<s;n++,i++)n===t[0]&&(n++,t.shift()),r[i]=e[n];return r;},a9={webm:rE([119,101,98,109]),matroska:rE([109,97,116,114,111,115,107,97]),flac:rE([102,76,97,67]),ogg:rE([79,103,103,83]),ac3:rE([11,119]),riff:rE([82,73,70,70]),avi:rE([65,86,73]),wav:rE([87,65,86,69]),"3gp":rE([102,116,121,112,51,103]),mp4:rE([102,116,121,112]),fmp4:rE([115,116,121,112]),mov:rE([102,116,121,112,113,116]),moov:rE([109,111,111,118]),moof:rE([109,111,111,102])},az={aac:function(e){var t=aP(e);return rx(e,[255,16],{offset:t,mask:[255,22]});},mp3:function(e){var t=aP(e);return rx(e,[255,2],{offset:t,mask:[255,6]});},webm:function(e){return e=a1(e,[aU.EBML,aU.DocType])[0],rx(e,a9.webm);},mkv:function(e){return e=a1(e,[aU.EBML,aU.DocType])[0],rx(e,a9.matroska);},mp4:function(e){return !az["3gp"](e)&&!az.mov(e)&&(!!(rx(e,a9.mp4,{offset:4})||rx(e,a9.fmp4,{offset:4})||rx(e,a9.moof,{offset:4})||rx(e,a9.moov,{offset:4}))||void 0);},mov:function(e){return rx(e,a9.mov,{offset:4});},"3gp":function(e){return rx(e,a9["3gp"],{offset:4});},ac3:function(e){var t=aP(e);return rx(e,a9.ac3,{offset:t});},ts:function(e){if(e.length<189&&1<=e.length)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=aP(e);return rx(e,a9.flac,{offset:t});},ogg:function(e){return rx(e,a9.ogg);},avi:function(e){return rx(e,a9.riff)&&rx(e,a9.avi,{offset:8});},wav:function(e){return rx(e,a9.riff)&&rx(e,a9.wav,{offset:8});},h264:function(e){return a4(e,"h264",7,3).length;},h265:function(e){return a4(e,"h265",[32,33],3).length;}},aW=Object.keys(az).filter(function(e){return "ts"!==e&&"h264"!==e&&"h265"!==e;}).concat(["ts","h264","h265"]),aG=(aW.forEach(function(e){var t=az[e];az[e]=function(e){return t(rE(e));};}),az);let aX=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=window.location&&window.location.href||"");var i="function"==typeof window.URL,s=/^\/\//.test(e),r=!window.location&&!/\/\//i.test(e);return i?e=new window.URL(e,window.location||rr):/\/\//i.test(e)||(e=rs.buildAbsoluteURL(window.location&&window.location.href||"",e)),i?(i=new URL(t,e),r?i.href.slice(rr.length):s?i.href.slice(i.protocol.length):i.href):rs.buildAbsoluteURL(e,t);},aK=(e,t)=>t&&t.responseURL&&e!==t.responseURL?t.responseURL:e,aY=(e)=>ri.log.debug?ri.log.debug.bind(ri,"VHS:",e+" >"):function(){};function aQ(...e){var t=ri.obj||ri;return (t.merge||t.mergeOptions).apply(t,e);}function aJ(...e){var t=ri.time||ri;return (t.createTimeRanges||t.createTimeRanges).apply(t,e);}function aZ(e,t){return oo(e,function(e,i){return e-oa<=t&&i+oa>=t;});}function oe(e,t){return oo(e,function(e){return e-on>=t;});}function ot(e){if(e&&e.length&&e.end)return e.end(e.length-1);}function oi(e,t){let i=0;if(e&&e.length){for(let s=0;s<e.length;s++){var r=e.start(s),n=e.end(s);n<t||(i+=r<t&&t<=n?n-t:n-r);}}return i;}function os({defaultDuration:e,durationList:t,startIndex:i,endIndex:s}){let r=0;if(s<i&&([i,s]=[s,i]),i<0){for(let n=i;n<Math.min(0,s);n++)r+=e;i=0;}for(let a=i;a<s;a++)r+=t[a].duration;return r;}function or(e,t,i,s){if(!e||!e.segments)return null;if(e.endList)return o8(e);if(null===t)return null;t=t||0;let r=oy(e,e.mediaSequence+e.segments.length,t);return i&&(s="number"==typeof s?s:om(null,e),r-=s),Math.max(0,r);}let on=1/30,oa=3*on,oo=function(e,t){var i=[];let s;if(e&&e.length)for(s=0;s<e.length;s++)t(e.start(s),e.end(s))&&i.push([e.start(s),e.end(s)]);return aJ(i);},ol=(e)=>{var 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(", ");},oh=(e)=>{var t=[];for(let i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t;},od=(e,t)=>{if(!t.preload)return t.duration;let i=0;
50return (t.parts||[]).forEach(function(e){i+=e.duration;}),(t.preloadHints||[]).forEach(function(t){"PART"===t.type&&(i+=e.partTargetDuration);}),i;},ou=(e)=>(e.segments||[]).reduce((e,t,i)=>(t.parts?t.parts.forEach(function(s,r){e.push({duration:s.duration,segmentIndex:i,partIndex:r,part:s,segment:t});}):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e),[]),oc=(e)=>(e=e.segments&&e.segments.length&&e.segments[e.segments.length-1])&&e.parts||[],op=({preloadSegment:e})=>{var t;if(e)return {parts:e,preloadHints:t}=e,(t||[]).reduce((e,t)=>e+("PART"===t.type?1:0),0)+(e&&e.length?e.length:0);},om=(e,t)=>t.endList?0:e&&e.suggestedPresentationDelay?e.suggestedPresentationDelay:(e=0<oc(t).length)&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:e&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0,og=function(e,t){let i=0,s=t-e.mediaSequence,r=e.segments[s];if(r){if(void 0!==r.start)return {result:r.start,precise:!0};if(void 0!==r.end)return {result:r.end-r.duration,precise:!0};}for(;s--;){if(void 0!==(r=e.segments[s]).end)return {result:i+r.end,precise:!0};if(i+=od(e,r),void 0!==r.start)return {result:i+r.start,precise:!0};}return {result:i,precise:!1};},of=function(e,t){var i;let s=0,r=t-e.mediaSequence;for(;r<e.segments.length;r++){if(void 0!==(i=e.segments[r]).start)return {result:i.start-s,precise:!0};if(s+=od(e,i),void 0!==i.end)return {result:i.end-s,precise:!0};}return {result:-1,precise:!1};},oy=function(e,t,i){var s;return (t=void 0===t?e.mediaSequence+e.segments.length:t)<e.mediaSequence?0:(s=og(e,t)).precise?s.result:(e=of(e,t)).precise?e.result:s.result+i;},o8=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 window.Infinity;}return oy(e,t,i);};function ov(e){return e.excludeUntil&&e.excludeUntil>Date.now();}function o$(e){return e.excludeUntil&&e.excludeUntil===1/0;}function o_(e){var t=ov(e);return !e.disabled&&!t;}function ob(e,t){return t.attributes&&t.attributes[e];}function oT(e,t){var i=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{};let s=!1;for(let r in i){for(let n in i[r])if(s=t(i[r][n]))break;if(s)break;}return !!s;}let oS=(e,t)=>{if(1===e.playlists.length)return !0;let i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter((e)=>!!o_(e)&&(e.attributes.BANDWIDTH||0)<i).length;},o0=(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)),oE=(e)=>{if(!e||!e.playlists||!e.playlists.length)return oT(e,(e)=>e.playlists&&e.playlists.length||e.uri);for(let t=0;t<e.playlists.length;t++){let i=e.playlists[t];var s=i.attributes&&i.attributes.CODECS;if((!s||!s.split(",").every((e)=>rd(e)))&&!(s=oT(e,(e)=>o0(i,e))))return !1;}return !0;};var ok={liveEdgeDelay:om,duration:o8,seekable:function(e,t,i){var s=t||0;let r=or(e,t,!0,i);return null===r?aJ():aJ(s,r=r<s?s:r);},getMediaInfoForTime:function({playlist:e,currentTime:t,startingSegmentIndex:i,startingPartIndex:s,startTime:r,exactManifestTimings:n}){let a=t-r;var o=ou(e);let l=0;for(let h=0;h<o.length;h++){var d=o[h];if(i===d.segmentIndex&&("number"!=typeof s||"number"!=typeof d.partIndex||s===d.partIndex)){l=h;break;}}if(a<0){if(0<l){for(let u=l-1;0<=u;u--){var c=o[u];if(a+=c.duration,n){if(a<0)continue;}else{if(a+on<=0)continue;}return {partIndex:c.partIndex,segmentIndex:c.segmentIndex,startTime:r-os({defaultDuration:e.targetDuration,durationList:o,startIndex:l,endIndex:u})};}}return {partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:t};}if(l<0){for(let p=l;p<0;p++)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 m=l;m<o.length;m++){var g=o[m];if(a-=g.duration,n){if(0<a)continue;}else{if(0<=a-on)continue;}return {partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:r+os({defaultDuration:e.targetDuration,durationList:o,startIndex:l,endIndex:m})};}return {segmentIndex:o[o.length-1].segmentIndex,partIndex:o[o.length-1].partIndex,startTime:t};},isEnabled:o_,isDisabled:function(e){return e.disabled;},isExcluded:ov,isIncompatible:o$,playlistEnd:or,isAes:function(e){for(let t=0;t<e.segments.length;t++)if(e.segments[t].key)return !0;return !1;},hasAttribute:ob,estimateSegmentRequestTime:function(e,t,i,s=0){return ob("BANDWIDTH",i)?(e*i.attributes.BANDWIDTH-8*s)/t:NaN;},isLowestEnabledRendition:oS,isAudioOnly:oE,playlistMatch:o0,segmentDurationWithParts:od};let ow=ri.log,oC=(e,t)=>e+"-"+t,ox=(e,t)=>{e.mediaGroups&&["AUDIO","SUBTITLES"].forEach((i)=>{if(e.mediaGroups[i]){for(let s in e.mediaGroups[i]){for(let r in e.mediaGroups[i][s])t(e.mediaGroups[i][s][r],i,s,r);}}});},o2=({playlist:e,uri:t,id:i}
50)=>{e.id=i,e.playlistErrors_=0,t&&(e.uri=t),e.attributes=e.attributes||{};},oI=(e,t,i=(e,t,i)=>`placeholder-uri-${e}-${t}-`+i)=>{e.uri=t;for(let s=0;s<e.playlists.length;s++)e.playlists[s].uri||(n="placeholder-uri-"+s,e.playlists[s].uri=n);let r=oE(e);ox(e,(t,s,n,a)=>{if(!t.playlists||!t.playlists.length){if(r&&"AUDIO"===s&&!t.uri){for(let o=0;o<e.playlists.length;o++){var l=e.playlists[o];if(l.attributes&&l.attributes.AUDIO&&l.attributes.AUDIO===n)return;}}t.playlists=[tR({},t)];}t.playlists.forEach(function(t,r){var o=i(s,n,a,t),l=oC(r,o);t.uri?t.resolvedUri=t.resolvedUri||aX(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;});});var n,a,o=e;let l=o.playlists.length;for(;l--;){var h=o.playlists[l];o2({playlist:h,id:oC(l,h.uri)}),h.resolvedUri=aX(o.uri,h.uri),o.playlists[h.id]=h,(o.playlists[h.uri]=h).attributes.BANDWIDTH||ow.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.");};a=e,ox(a,(e)=>{e.uri&&(e.resolvedUri=aX(a.uri,e.uri));});};class oL{constructor(){this.offset_=null,this.pendingDateRanges_=new Map(),this.processedDateRanges_=new Map();}setOffset(e=[]){null===this.offset_&&e.length&&([e]=e,void 0!==e.programDateTime)&&(this.offset_=e.programDateTime/1e3);}setPendingDateRanges(e=[]){var t;e.length&&([t]=e,t=t.startDate.getTime(),this.trimProcessedDateRanges_(t),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,s)=>{this.processedDateRanges_.has(s)||(i.startTime=i.startDate.getTime()/1e3-this.offset_,i.processDateRange=()=>this.processDateRange(i),t.push(i),i.class&&(e[i.class]?(s=e[i.class].push(i),i.classListIndex=s-1):(e[i.class]=[i],i.classListIndex=0)));}),t)){var s=e[i.class]||[];i.endDate?i.endTime=i.endDate.getTime()/1e3-this.offset_:i.endOnNext&&s[i.classListIndex+1]?i.endTime=s[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);});}}function oD(e){var t=e.segments||[],i=e.preloadSegment;if(i&&i.parts&&i.parts.length){if(i.preloadHints){for(let s=0;s<i.preloadHints.length;s++)if("MAP"===i.preloadHints[s].type)return t;}i.duration=e.targetDuration,i.preload=!0,t.push(i);}return t;}sA=ri.EventTarget;let oA=(e,t)=>{if(!e)return t;var i=aQ(e,t);if(e.preloadHints&&!t.preloadHints&&delete i.preloadHints,e.parts&&!t.parts)delete i.parts;else{if(e.parts&&t.parts){for(let s=0;s<t.parts.length;s++)e.parts&&e.parts[s]&&(i.parts[s]=aQ(e.parts[s],t.parts[s]));}}return !e.skipped&&t.skipped&&(i.skipped=!1),e.preload&&!t.preload&&(i.preload=!1),i;},oP=(e,t)=>{!e.resolvedUri&&e.uri&&(e.resolvedUri=aX(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=aX(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=aX(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=aX(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach((e)=>{e.resolvedUri||(e.resolvedUri=aX(t,e.uri));}),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach((e)=>{e.resolvedUri||(e.resolvedUri=aX(t,e.uri));});},o3=(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,o6=(e,t,i=o3)=>{var s=aQ(e,{}),r=s.playlists[t.id];if(!r||i(r,t))return null;t.segments=oD(t);let n=aQ(r,t);if(n.preloadSegment&&!t.preloadSegment&&delete n.preloadSegment,r.segments){if(t.skip){t.segments=t.segments||[];for(let a=0;a<t.skip.skippedSegments;a++)t.segments.unshift({skipped:!0});}n.segments=((e,t,i)=>{var s=e.slice(),r=t.slice(),n=(i=i||0,[]);let a;for(let o=0;o<r.length;o++){var l=s[o+i],h=r[o];l?(a=l.map||a,n.push(oA(l,h))):(a&&!h.map&&(h.map=a),n.push(h));}return n;})(r.segments,t.segments,t.mediaSequence-r.mediaSequence);}
50n.segments.forEach((e)=>{oP(e,n.resolvedUri);});for(let o=0;o<s.playlists.length;o++)s.playlists[o].id===t.id&&(s.playlists[o]=n);return s.playlists[t.id]=n,s.playlists[t.uri]=n,ox(e,(e,i,s,r)=>{if(e.playlists){for(let a=0;a<e.playlists.length;a++)t.id===e.playlists[a].id&&(e.playlists[a]=n);}}),s;},o1=(e,t)=>{var i=e.segments||[],i=i[i.length-1],s=i&&i.parts&&i.parts[i.parts.length-1],s=s&&s.duration||i&&i.duration;return t&&s?1e3*s:500*(e.partTargetDuration||e.targetDuration||10);};class o4 extends sA{constructor(e,t,i={}){if(super(),!e)throw Error("A non-empty playlist URL or object is required");this.logger_=aY("PlaylistLoader");var {withCredentials:s=!1}=i,e=(this.src=e,this.vhs_=t,this.withCredentials=s,this.addDateRangesToTextTrack_=i.addDateRangesToTextTrack,t.options_);this.customTagParsers=e&&e.customTagParsers||[],this.customTagMappers=e&&e.customTagMappers||[],this.llhls=e&&e.llhls,this.dateRangesStorage_=new oL(),this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this));}handleLoadedPlaylist_(){var e=this.media();e&&(this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges),(e=this.dateRangesStorage_.getDateRangesToProcess()).length)&&this.addDateRangesToTextTrack_&&this.addDateRangesToTextTrack_(e);}handleMediaupdatetimeout_(){if("HAVE_METADATA"===this.state){var e=this.media();let t=aX(this.main.uri,e.uri);this.llhls&&(t=((e,t)=>{if(!t.endList&&t.serverControl){let i={};if(t.serverControl.canBlockReload){var s,r=t.preloadSegment;let n=t.mediaSequence+t.segments.length;r&&(r=r.parts||[],-1<(s=op(t)-1)&&s!=r.length-1&&(i._HLS_part=s),-1<s||r.length)&&n--,i._HLS_msn=n;}if(t.serverControl&&t.serverControl.canSkipUntil&&(i._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(i).length){let a=new window.URL(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(e){i.hasOwnProperty(e)&&a.searchParams.set(e,i[e]);}),e=a.toString();}}return e;})(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials},(e,t)=>{if(this.request)return e?this.playlistRequestError(this.request,this.media(),"HAVE_METADATA"):void this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id});});}}playlistRequestError(e,t,i){var {uri:t,id:s}=t;this.request=null,i&&(this.state=i),this.error={playlist:this.main.playlists[s],status:e.status,message:`HLS playlist request error at URL: ${t}.`,responseText:e.responseText,code:500<=e.status?4:2},this.trigger("error");}parseManifest_({url:e,manifestString:t}){var [{onwarn:t,oninfo:i,manifestString:s,customTagParsers:r=[],customTagMappers:n=[],llhls:a}]=[{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}];let o=new rh(),l=(t&&o.on("warn",t),i&&o.on("info",i),r.forEach((e)=>
50o.addParser(e)),n.forEach((e)=>o.addTagMapper(e)),o.push(s),o.end(),o.manifest);if(a||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(e){l.hasOwnProperty(e)&&delete l[e];}),l.segments&&l.segments.forEach(function(e){["parts","preloadHints"].forEach(function(t){e.hasOwnProperty(t)&&delete e[t];});})),!l.targetDuration){let h=10;l.segments&&l.segments.length&&(h=l.segments.reduce((e,t)=>Math.max(e,t.duration),0)),t&&t("manifest has no targetDuration defaulting to "+h),l.targetDuration=h;}return (i=oc(l)).length&&!l.partTargetDuration&&(r=i.reduce((e,t)=>Math.max(e,t.duration),0),t&&(t("manifest has no partTargetDuration defaulting to "+r),ow.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.")),l.partTargetDuration=r),l;;}haveMetadata({playlistString:e,playlistObject:t,url:i,id:s}){this.request=null,this.state="HAVE_METADATA",(t=t||this.parseManifest_({url:i,manifestString:e})).lastRequest=Date.now(),o2({playlist:t,uri:i,id:s}),e=o6(this.main,t),this.targetDuration=t.partTargetDuration||t.targetDuration,this.pendingMedia_=null,e?(this.main=e,this.media_=this.main.playlists[s]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(o1(this.media(),!!e)),this.trigger("loadedplaylist");}dispose(){this.trigger("dispose"),this.stopRequest(),window.clearTimeout(this.mediaUpdateTimeout),window.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new oL(),this.off();}stopRequest(){var e;this.request&&(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(window.clearTimeout(this.finalRenditionTimeout),t)t=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3,this.finalRenditionTimeout=window.setTimeout(this.media.bind(this,e,!1),t);else{let i=this.state;var t=!this.media_||e.id!==this.media_.id,s=this.main.playlists[e.id];if(s&&s.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,t&&(this.trigger("mediachanging"),"HAVE_MAIN_MANIFEST"===i?this.trigger("loadedmetadata"):this.trigger("mediachange"));else{if(this.updateMediaUpdateTimeout_(o1(e,!0)),t){if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null;}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},(t,s)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=aK(e.resolvedUri,s),t)return this.playlistRequestError(this.request,e,i);this.haveMetadata({playlistString:s.responseText,url:e.uri,id:e.id}),"HAVE_MAIN_MANIFEST"===i?this.trigger("loadedmetadata"):this.trigger("mediachange");}});}}}}pause(){this.mediaUpdateTimeout&&(window.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&&(window.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var t=this.media();e?(e=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3,this.mediaUpdateTimeout=window.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load();},e)):this.started?t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start();}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(window.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=window.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e);},e));}start(){this.started=!0,"object"==typeof this.src?(this.src.uri||(this.src.uri=window.location.href),this.src.resolvedUri=this.src.uri,setTimeout(()=>{this.setupInitialPlaylist(this.src);},0)):this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},(e,t)=>{if(this.request){if(this.request=null,e)return this.error={status:t.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:t.responseText,code:2},"HAVE_NOTHING"===this.state&&(this.started=!1),this.trigger("error");this.src=aK(this.src,t),e=this.parseManifest_({manifestString:t.responseText,url:this.src}),this.setupInitialPlaylist(e);}});}srcUri(){return "string"==typeof this.src?this.src:this.src.uri;}setupInitialPlaylist(e){var t,i,s,r;this.state="HAVE_MAIN_MANIFEST",e.playlists?(this.main=e,oI(this.main,this.srcUri()),e.playlists.forEac
50h((e)=>{e.segments=oD(e),e.segments.forEach((t)=>{oP(t,e.resolvedUri);});}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0])):(t=this.srcUri()||window.location.href,this.main=(s=oC(0,i=t),(r={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:window.location.href,resolvedUri:window.location.href,playlists:[{uri:i,id:s,resolvedUri:i,attributes:{}}]}).playlists[s]=r.playlists[0],r.playlists[i]=r.playlists[0],r),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata"));}}function oO(e,t,i,s){var r="arraybuffer"===e.responseType?e.response:e.responseText;!t&&r&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=r.byteLength||r.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),s(t=t||e.aborted||200===i.statusCode||206===i.statusCode||0===i.statusCode?t:Error("XHR Failed with a response of: "+(e&&(r||e.responseText))),e);}function oR(){function e(t,i){t=aQ({timeout:45e3},t);var s=e.beforeRequest||ri.Vhs.xhr.beforeRequest,r=e._requestCallbackSet||ri.Vhs.xhr._requestCallbackSet||new Set();let n=e._responseCallbackSet||ri.Vhs.xhr._responseCallbackSet;s&&"function"==typeof s&&(ri.log.warn("beforeRequest is deprecated, use onRequest instead."),r.add(s));var a=!0===ri.Vhs.xhr.original?oF:ri.Vhs.xhr,o=((e,t)=>{if(e&&e.size){let i=t;return e.forEach((e)=>{i=e(i);}),i;}})(r,t);r.delete(s);let l=a(o||t,function(e,t){var s,r,a,o;return s=n,r=l,a=e,o=t,s&&s.size&&s.forEach((e)=>{e(r,a,o);}),oO(l,e,t,i);}),h=l.abort;return l.abort=function(){return l.aborted=!0,h.apply(l,arguments);},l.uri=t.uri,l.requestTime=Date.now(),l;}return e.original=!0,e;}function oN(e){var t,i={};let s;return e.byterange&&(i.Range="bytes="+(t=e.byterange).offset+"-"+(s="bigint"==typeof t.offset||"bigint"==typeof t.length?window.BigInt(t.offset)+window.BigInt(t.length)-window.BigInt(1):t.offset+t.length-1)),i;}function oM(e,t){return e=e.toString(16),"00".substring(0,2-e.length)+e+(t%2?" ":"");}function oU(e){return 32<=e&&e<126?String.fromCharCode(e):".";}function o5(e){let t={};return Object.keys(e).forEach((i)=>{var s=e[i];r0(s)?t[i]={bytes:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength}:t[i]=s;}),t;}function oB(e){var t=e.byterange||{length:1/0,offset:0};return [t.length,t.offset,e.resolvedUri].join(",");}function o7(e){return e.resolvedUri;}let oF=ri.xhr,oq=(e)=>{var t,i,s=Array.prototype.slice.call(e);let r="";for(let n=0;n<s.length/16;n++)r+=(t=s.slice(16*n,16*n+16).map(oM).join(""))+" "+(i=s.slice(16*n,16*n+16).map(oU).join(""))+"\n";return r;};sD=Object.freeze({__proto__:null,createTransferableMessage:o5,initSegmentId:oB,segmentKeyId:o7,hexDump:oq,tagDump:({bytes:e})=>oq(e),textRanges(e){var t,i;let s="",r;for(r=0;r<e.length;r++)s+=(t=e,i=r,t.start(i)+"-"+t.end(i)+" ");return s;}});let oj=(e)=>e.transmuxedPresentationEnd-e.transmuxedPresentationStart-e.transmuxerPrependedSeconds,oH=({playlist:e,time:t,callback:i})=>{var s,r;if(i)return e&&void 0!==t?(e=((e,t)=>{if(!t||!t.segments||0===t.segments.length)return null;let i=0,s;for(let r=0;r<t.segments.length&&!(e<=(i=(s=t.segments[r]).videoTimingInfo?s.videoTimingInfo.transmuxedPresentationEnd:i+s.duration));r++);var n=t.segments[t.segments.length-1];if(n.videoTimingInfo&&n.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>i){if(e>i+.25*n.duration)return null;s=n;}return {segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:i-s.duration,type:s.videoTimingInfo?"accurate":"estimate"};})(t,e))?"estimate"===e.type?i({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:e.estimatedStart}):(s={mediaSeconds:t},(r=(e=e.segment).dateTimeObject?(r=e.videoTimingInfo.transmuxerPrependedSeconds,t-=e.videoTimingInfo.transmuxedPresentationStart+r,new Date(e.dateTimeObject.getTime()+1e3*t)):null)&&(s.programDateTime=r.toISOString()),i(null,s)):i({message:"valid programTime was not found"}):i({message:"getProgramTime: playlist and time must be provided"});throw Error("getProgramTime: callback must be provided");},oV=({programTime:e,playlist:t,retryCount:i=2,seekTo:s,pauseAfterSeek:r=!0,tech:n,callback:a})=>{var o,l,h;if(a)return void 0!==e&&t&&s?t.endList||n.hasStarted_?((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)?(h=((e,t)=>{let i;try{i=new Date(e);}catch(s){return null;}if(!t||!t.segments||0===t.segments.length)return null;let r=t.segments[0];if(i<new Date(r.dateTimeObject))return null;for(let n=0;n<t.segments.length-1&&(r=t.segments[n],!(i<new Date(t.segments[n+1].dateTimeObject)));n++);var e=t.segments[t.segments.length-1],a=e.dateTimeObject,o=e.videoTimingInfo?oj(e.videoTimingInfo):e.duration+.25*e.duration,o=new Date(a.getTime()+1e3*o);return i>o?null:{segment:r=i>new Date(a)?e:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:ok.duration(t,t.mediaSequence+t.segments.indexOf(r)),type:r.videoTimingInfo?"accurate":"estimate"};})(e,t))?(l=((e,t)=>{let i,s;try{i=new Date(e),s=new Date(t);}catch(r){}return e=i.getTime(),(s.getTime()-e)/1e3;}
50)((o=h.segment).dateTimeObject,e),"estimate"===h.type?0===i?a({message:e+" is not buffered yet. Try again"}):(s(h.estimatedStart+l),void n.one("seeked",()=>{oV({programTime:e,playlist:t,retryCount:i-1,seekTo:s,pauseAfterSeek:r,tech:n,callback:a});})):(h=o.start+l,n.one("seeked",()=>a(null,n.currentTime())),r&&n.pause(),void s(h))):a({message:e+" was not found in the stream"}):a({message:"programDateTime tags must be provided in the manifest "+t.resolvedUri}):a({message:"player must be playing a live stream to start buffering"}):a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});throw Error("seekToProgramTime: callback must be provided");},o9=(e,t)=>{if(4===e.readyState)return t();},oz=(e,t,i)=>{let s=[],r,n=!1;function a(e,t,s,r){return t.abort(),n=!0,i(e,t,s,r);}function o(e,t){var i;if(!n)return e?a(e,t,"",s):(i=t.responseText.substring(s&&s.byteLength||0,t.responseText.length),s=function(){for(var e,t,i,s=arguments.length,r=Array(s),n=0;n<s;n++)r[n]=arguments[n];return (r=r.filter(function(e){return e&&(e.byteLength||e.length)&&"string"!=typeof e;})).length<=1?rE(r[0]):(e=r.reduce(function(e,t,i){return e+(t.byteLength||t.length);},0),t=new Uint8Array(e),i=0,r.forEach(function(e){e=rE(e),t.set(e,i),i+=e.byteLength;}),t);}(s,rm(i,!0)),r=r||aP(s),s.length<10||r&&s.length<r+2||"ts"===(i=aO(s))&&s.length<188||!i&&s.length<376?o9(t,()=>a(e,t,"",s)):a(null,t,i,s));}let l=t({uri:e,beforeSend(e){e.overrideMimeType("text/plain; charset=x-user-defined"),e.addEventListener("progress",function({}){return oO(e,null,{statusCode:e.status},o);});}},function(e,t){return oO(l,e,t,o);});return l;};function oW(e,t){if(!o3(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){for(let i=0;i<e.segments.length;i++){var s=e.segments[i],r=t.segments[i];if(s.uri!==r.uri||(s.byterange||r.byterange)&&(s=s.byterange,r=r.byterange,s&&!r||!s&&r||s.offset!==r.offset||s.length!==r.length))return !1;}}return !0;}tJ=ri.EventTarget;let oG=(e,t,i,s)=>`placeholder-uri-${e}-${t}-`+(s.attributes.NAME||i),oX=({mainXml:e,srcUrl:t,clientOffset:i,sidxMapping:s,previousManifest:r})=>(i={manifestUri:t,clientOffset:i,sidxMapping:s,previousManifest:r},e=aL(aD(e),i),s=ab(e.representationInfo),r=ag({dashPlaylists:s,locations:e.locations,contentSteering:e.contentSteeringInfo,sidxMapping:i.sidxMapping,previousManifest:i.previousManifest,eventStream:e.eventStream}),oI(r,t,oG),r),oK=(e,t,i)=>{let s=!0,r=aQ(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts});for(let n=0;n<t.playlists.length;n++){var a,o,l=t.playlists[n],h=(l.sidx&&(h=aa(l.sidx),i)&&i[h]&&i[h].sidx&&ae(l,i[h].sidx,l.sidx.resolvedUri),o6(r,l,oW));h&&(r=h,s=!1);}return ox(t,(e,t,i,n)=>{var a,o;e.playlists&&e.playlists.length&&(a=e.playlists[0].id,o=o6(r,e.playlists[0],oW))&&(n in (r=o).mediaGroups[t][i]||(r.mediaGroups[t][i][n]=e),r.mediaGroups[t][i][n].playlists[0]=r.playlists[a],s=!1);}),a=r,o=t,ox(a,(e,t,i,s)=>{s in o.mediaGroups[t][i]||delete a.mediaGroups[t][i][s];}),(s=t.minimumUpdatePeriod===e.minimumUpdatePeriod&&s)?null:r;},oY=(e,t)=>(Boolean(!e.map&&!t.map)||Boolean(e.map&&t.map&&e.map.byterange.offset===t.map.byterange.offset&&e.map.byterange.length===t.map.byterange.length))&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length,oQ=(e,t)=>{var i={};for(let s in e){var r=e[s].sidx;if(r){var n=aa(r);if(!t[n])break;oY(t[n].sidxInfo,r)&&(i[n]=t[n]);}}return i;};class oJ extends tJ{constructor(e,t,i={},s){super(),this.mainPlaylistLoader_=s||this,s||(this.isMain_=!0);var {withCredentials:s=!1}=i;if(this.vhs_=t,this.withCredentials=s,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.media().attributes.serviceLocation||this.refreshMedia_(this.media().id);}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=aY("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e;}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}:e,i&&(this.state=i),this.trigger("error"),!0):void 0);}addSidxSegments_(e,t,i){let s=e.sidx&&aa(e.sidx);if(e.sidx&&s&&!this.mainPlaylistLoader_.sidxMapping_[s]){let r=aK(e.sidx.resolvedUri),n=(r,n)=>{if(!this.requestErrored_(r,n,t)){r=this.mainPlaylistLoader_.sidxMapping_;let a;try{a=aN(rE(n.response).subarray(8));}catch(o){return void this.requestErrored_(o,n,t);}return r[s]={sidxInfo:e.sidx,sidx:a},ae(e,a,e.sidx.resolvedUri),i(!0);}};this.request=oz(r,this.vhs_.xhr,(t,i,s,a)=>{var o,l;return t?n(t,i):s&&"mp4"===s?({offset:o,length:l}=e.sidx.byterange,a.length>=l+o?n(t,{response:a.subarray(o,o+l),status:i.status,uri:i.uri}):void (this.request=this.vhs_.xhr({uri:r,responseType:"arraybuffer",headers:oN({byterange:e.sidx.byterange})},n))):n({status:i.status,message:`Unsupported ${s||"unknown"} container type for sidx segment at URL: `+r,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},i);});}else this.mediaRequest_=window.setTimeout(()=>i(!1),0);}dispose(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},window.clearTimeout(this.minimumUpdatePeriodTimeout_),window.clearTimeout(this.mediaRequest_),window.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(){var e;this.request&&(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];}var i=!this.media_||e.id!==this.media_.id;i&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList?(this.state="HAVE_METADATA",this.media_=e,i&&(this.trigger("mediachanging"),this.trigger("mediachange"))):i&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,(i)=>{this.haveMetadata({startingState:t,playlist:e});}));}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,this.mediaRequest_=null,this.refreshMedia_(t.id),"HAVE_MAIN_MANIFEST"===e?this.trigger("loadedmetadata"):this.trigger("mediachange");}pause(){this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),window.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(window.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1);}load(e){window.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var t=this.media();e?(e=t?t.targetDuration/2*1e3:5e3,this.mediaUpdateTimeout=window.setTimeout(()=>this.load(),e)):this.started?t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start();}start(){this.started=!0,this.isMain_?this.requestMain_((e,t)=>
50{this.haveMain_(),this.hasPendingRequest()||this.media_||this.media(this.mainPlaylistLoader_.main.playlists[0]);}):this.mediaRequest_=window.setTimeout(()=>this.haveMain_(),0);}requestMain_(e){this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},(t,i)=>{if(this.requestErrored_(t,i))"HAVE_NOTHING"===this.state&&(this.started=!1);else{let s=i.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=i.responseText,i.responseHeaders&&i.responseHeaders.date?this.mainLoaded_=Date.parse(i.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=aK(this.mainPlaylistLoader_.srcUrl,i),!s)return e(i,s);this.handleMain_(),this.syncClientServerClock_(()=>e(i,s));}});}syncClientServerClock_(e){let t=aA(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:aX(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials},(i,s)=>{if(this.request){if(i)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();let r;r="HEAD"===t.method?s.responseHeaders&&s.responseHeaders.date?Date.parse(s.responseHeaders.date):this.mainLoaded_:Date.parse(s.responseText),this.mainPlaylistLoader_.clientOffset_=r-Date.now(),e();}}));}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_);}handleMain_(){this.mediaRequest_=null;var e=this.mainPlaylistLoader_.main;let t=oX({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e});e&&(t=oK(e,t,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=t||e;var i=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];return i&&i!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=i),(!e||t&&t.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(t),Boolean(t);}updateMinimumUpdatePeriodTimeout_(){var e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(window.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;0===t&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),"number"!=typeof t||t<=0?t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`):this.createMUPTimeout_(t);}createMUPTimeout_(e){let t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=window.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e);},e);}refreshXml_(){this.requestMain_((e,t)=>{var i,s;let r;t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=(i=this.mainPlaylistLoader_.main,s=this.mainPlaylistLoader_.sidxMapping_,r=oQ(i.playlists,s),ox(i,(e,t,i,n)=>{e.playlists&&e.playlists.length&&(r=aQ(r,oQ(e=e.playlists,s)));}),r),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_();var t=this.mainPlaylistLoader_.main.playlists;let i=!this.media_||this.media_!==t[e];if(i?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){let s=()=>{this.media().endList||(this.mediaUpdateTimeout=window.setTimeout(()=>{this.trigger("mediaupdatetimeout"),s();},o1(this.media(),Boolean(i))));};s();}this.trigger("loadedplaylist");}addEventStreamToMetadataTrack_(e){e&&this.mainPlaylistLoader_.main.eventStream&&(e=this.mainPlaylistLoader_.main.eventStream.map((e)=>({cueTime:e.start,frames:[{data:e.messageData}]})),this.addMetadataToTextTrack("EventStream",e,this.mainPlaylistLoader_.main.duration));}}var oZ={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};function le(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e;}let lt=(e)=>{var t=new Uint8Array(new ArrayBuffer(e.length));for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t.buffer;};function li(e){return function(){let t=function(e){try{return URL.createObjectURL(new Blob([e],{type:"application/javascript"}));}catch(t){var i=new BlobBuilder();return i.append(e),URL.createObjectURL(i.getBlob());}}(e);var i=le(new Worker(t));i.objURL=t;let s=i.terminate;return i.on=i.addEventListener,i.off=i.removeEventListener,i.terminate=function(){return URL.revokeObjectURL(t),s.call(this);},i;};}function ls(e){return `var browserWorkerPolyFill = ${le.toString()};
51browserWorkerPolyFill(self);
52`+e;}function lr(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1);}var ln=li(ls(lr(function(){function e(){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){return !!e[t]&&(i=e[t].indexOf(i),e[t]=e[t].slice(),e[t].splice(i,1),-1<i);},this.trigger=function(t){var i,s,r,n=e[t];if(n)if(2===arguments.length)for(s=n.length,i=0;i<s;++i)n[i].call(this,arguments[1]);else{for(r=[],i=arguments.length,i=1;i<arguments.length;++i)r.push(arguments[i]);for(s=n.length,i=0;i<s;++i)n[i].apply(this,r);}},this.dispose=function(){e={};};};}var t,i,s,r,n,a,o,l,h,d,u,c,p,m,g,f,y,v,$,_,b,T,S,E,k,w,C,x,I,L,D,A,P,O,R,N,M,U="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},B=(e.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;},e.prototype.push=function(e){this.trigger("data",e);},e.prototype.flush=function(e){this.trigger("done",e);},e.prototype.partialFlush=function(e){this.trigger("partialdone",e);},e.prototype.endTimeline=function(e){this.trigger("endedtimeline",e);},e.prototype.reset=function(e){this.trigger("reset",e);},e),F={getUint64:function(e){var t,e=new DataView(e.buffer,e.byteOffset,e.byteLength);return e.getBigUint64?(t=e.getBigUint64(0))<Number.MAX_SAFE_INTEGER?
vendor: 11,391 bytes, line 52
52Number(t):t:4294967296*e.getUint32(0)+e.getUint32(4);},MAX_UINT32:4294967296},q=F.MAX_UINT32;if(b={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(var j in b)b.hasOwnProperty(j)&&(b[j]=[j.charCodeAt(0),j.charCodeAt(1),j.charCodeAt(2),j.charCodeAt(3)]);T=new Uint8Array([105,115,111,109]),E=new Uint8Array([97,118,99,49]),S=new Uint8Array([0,0,0,1]),ee=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]),ei=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]),k={video:ee,audio:ei},x=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),C=new Uint8Array([0,0,0,0,0,0,0,0]),L=I=new Uint8Array([0,0,0,0,0,0,0,0]),D=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),A=I,w=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]);}function H(e,t){var i=et();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;}function V(e){for(var t=[];e--;)t.push(0);return t;}function z(e){e=e||{},z.prototype.init.call(this),this.parse708captions_="boolean"!=typeof e.parse708captions||e.parse708captions,this.captionPackets_=[],this.ccStreams_=[new e$(0,0),new e$(0,1),new e$(1,0),new e$(1,1)],this.parse708captions_&&(this.cc708Stream_=new ef({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")));}function W(e){return 32<=e&&e<=127||160<=e&&e<=255;}function G(e){this.windowNum=e,this.reset();}function X(e,t,i){this.serviceNum=e,this.text="",this.currentWindow=new G(-1),this.windows=[],this.stream=i,"string"==typeof t&&this.createTextDecoder(t);}function K(e){return null===e?"":String.fromCharCode(e=ey[e]||e);}function Y(){for(var e=[],t=e8+1;t--;)e.push({text:"",indent:0,offset:0});return e;}function Q(e,t){var i=1;for(t<e&&(i=-1);Math.abs(t-e)>eS;)e+=i*eT;return e;}function J(e){var t,i;J.prototype.init.call(this),this.type_=e||"shared",this.push=function(e){"shared"!==this.type_&&e.type!==this.type_||(void 0===i&&(i=e.dts),e.dts=Q(e.dts,i),e.pts=Q(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(){t=i=void 0;},this.reset=function(){this.discontinuity(),this.trigger("reset");};}t=function(e){for(var t,i=[],s=0,r=1;r<arguments.length;r++)i.push(arguments[r]);for(r=i.length;r--;)s+=i[r].byteLength;for(t=new Uint8Array(s+8),new DataView(t.buffer,t.byteOffset,t.byteLength).setUint32(0,t.byteLength),t.set(e,4),r=0,s=8;r<i.length;r++)t.set(i[r],s),s+=i[r].byteLength;return t;},i=function(){return t(b.dinf,t(b.dref,x));},s=function(e){return t(b.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]));},m=function(e){return t(b.hdlr,k[e]);},p=function(e){var i=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&&(i[12]=e.samplerate>>>24&255,i[13]=e.samplerate>>>16&255,i[14]=e.samplerate>>>8&255,i[15]=255&e.samplerate),t(b.mdhd,i);},c=function(e){return t(b.mdia,p(e),m(e.type),a(e));},n=function(e){return t(b.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]));},a=function(e){return t(b.minf,"video"===e.type?t(b.vmhd,w):t(b.smhd,C),i(),f(e));},l=function(e){for(var i=e.length,s=[];i--;)s[i]=$(e[i]);return t.apply(null,[b.mvex].concat(s));},h=function(e){return e=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]),t(b.mvhd,e);},g=function(e){for(var i,s=e.samples||[],r=new Uint8Array(4+s.length),n=0;n<s.length;n++)i=s[n].flags,r[n+4]=i.dependsOn<<4|i.isDependedOn<<2|i.hasRedundancy;return t(b.sdtp,r);},f=function(e){return t(b.stbl,y(e),t(b.stts,A),t(b.stsc,L),t(b.stsz,D),t(b.stco,I));},y=function(e){return t(b.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),("video"===e.type?P:O)(e));},P=function(e){for(var i,s,r=e.sps||[],n=e.pps||[],a=[],o=[],l=0;l<r.length;l++)a.push((65280&r[l].byteLength)>>>8),a.push(255&r[l].byteLength),a=a.concat(Array.prototype.slice.call(r[l]));for(l=0;l<n.length;l++)o.push((65280&n[l].byteLength)>>>8),o.push(255&n[l].byteLength),o=o.concat(Array.prototype.slice.call(n[l]));return i=[b.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]),t(b.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([r.length],a,[n.length],o))),t(b.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio&&(s=e.sarRatio[0],e=e.sarRatio[1],i.push(t(b.pasp,new Uint8Array([(4278190080&s)>>24,(16711680&s)>>16,(65280&s)>>8,255&s,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e])))),t.apply(null,i);},O=function(e){return t(b.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),s(e));},u=function(e){return e=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]),t(b.tkhd,e);},v=function(e){var i,s=t(b.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),r=Math.floor(e.baseMediaDecodeTime/q),n=Math.floor(e.baseMediaDecodeTime%q),r=t(b.tfdt,new Uint8Array([1,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r,n>>>24&255,n>>>16&255,n>>>8&255,255&n]));return "audio"===e.type?(i=_(e,92),t(b.traf,s,r,i)):(n=g(e),i=_(e,n.length+92),t(b.traf,s,r,i,n));},d=function(e){return e.duration=e.duration||4294967295,t(b.trak,u(e),c(e));},$=function(e){var i=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return "video"!==e.type&&(i[i.length-1]=0),t(b.trex,i);},R=function(e,t){var i=0,s=0,r=0,n=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(s=2),void 0!==e[0].flags&&(r=4),void 0!==e[0].compositionTimeOffset)&&(n=8),[0,0,i|s|r|n,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t];},N=function(e,i){var s,r,n,a,o=e.samples||[];for(i+=20+16*o.length,e=R(o,i),(r=new Uint8Array(e.length+16*o.length)).set(e),s=e.length,a=0;a<o.length;a++)n=o[a],r[s++]=(4278190080&n.duration)>>>24,r[s++]=(16711680&n.duration)>>>16,r[s++]=(65280&n.duration)>>>8,r[s++]=255&n.duration,r[s++]=(4278190080&n.size)>>>24,r[s++]=(16711680&n.size)>>>16,r[s++]=(65280&n.size)>>>8,r[s++]=255&n.size,r[s++]=n.flags.isLeading<<2|n.flags.dependsOn,r[s++]=n.flags.isDependedOn<<6|n.flags.hasRedundancy<<4|n.flags.paddingValue<<1|n.flags.isNonSyncSample,r[s++]=61440&n.flags.degradationPriority,r[s++]=15&n.flags.degradationPriority,r[s++]=(4278190080&n.compositionTimeOffset)>>>24,r[s++]=(16711680&n.compositionTimeOffset)>>>16,r[s++]=(65280&n.compositionTimeOffset)>>>8,r[s++]=255&n.compositionTimeOffset;return t(b.trun,r);},M=function(e,i){var s,r,n,a,o=e.samples||[];for(i+=20+8*o.length,e=R(o,i),(s=new Uint8Array(e.length+8*o.length)).set(e),r=e.length,a=0;a<o.length;a++)n=o[a],s[r++]=(4278190080&n.duration)>>>24,s[r++]=(16711680&n.duration)>>>16,s[r++]=(65280&n.duration)>>>8,s[r++]=255&n.duration,s[r++]=(4278190080&n.size)>>>24,s[r++]=(16711680&n.size)>>>16,s[r++]=(65280&n.size)>>>8,s[r++]=255&n.size;return t(b.trun,s);},_=function(e,t){return ("audio"===e.type?M:N)(e,t);};var Z,ee={ftyp:r=function(){return t(b.ftyp,T,S,T,E);},mdat:function(e){return t(b.mdat,e);},moof:function(e,i){for(var s=[],r=i.length;r--;)s[r]=v(i[r]);return t.apply(null,[b.moof,n(e)].concat(s));},moov:o=function(e){for(var i=e.length,s=[];i--;)s[i]=d(e[i]);return t.apply(null,[b.moov,h(4294967295)].concat(s).concat(l(e)));},initSegment:function(e){var t=r(),e=o(e),i=new Uint8Array(t.byteLength+e.byteLength);return i.set(t),i.set(e,t.byteLength),i;}},et=function(){return {size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};},ei={groupNalsIntoFrames:function(e){var t,i,s=[],r=[];for(r.byteLength=0,r.nalCount=0,t=s.byteLength=r.duration=0;t<e.length;t++)"access_unit_delimiter_rbsp"===(i=e[t]).nalUnitType?(s.length&&(s.duration=i.dts-s.dts,r.byteLength+=s.byteLength,r.nalCount+=s.length,r.duration+=s.duration,r.push(s)),(s=[i]).byteLength=i.data.byteLength,s.pts=i.pts,s.dts=i.dts):("slice_layer_without_partitioning_rbsp_idr"===i.nalUnitType&&(s.keyFrame=!0),s.duration=i.dts-s.dts,s.byteLength+=i.data.byteLength,s.push(i));return r.length&&(!s.duration||s.duration<=0)&&(s.duration=r[r.length-1].duration),r.byteLength+=s.byteLength,r.nalCount+=s.length,r.duration+=s.duration,r.push(s),r;},groupFramesIntoGops:function(e){var t,i,s=[],r=[];for(s.byteLength=0,s.nalCount=0,s.duration=0,s.pts=e[0].pts,s.dts=e[0].dts,r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,t=0;t<e.length;t++)(i=e[t]).keyFrame?(s.length&&(r.push(s),r.byteLength+=s.byteLength,r.nalCount+=s.nalCount,r.duration+=s.duration),(s=[i]).nalCount=i.length,s.byteLength=i.byteLength,s.pts=i.pts,s.dts=i.dts,s.duration=i.duration):(s.duration+=i.duration,s.nalCount+=i.length,s.byteLength+=i.byteLength,s.push(i));return r.length&&s.duration<=0&&(s.duration=r[r.length-1].duration),r.byteLength+=s.byteLength,r.nalCount+=s.nalCount,r.duration+=s.duration,r.push(s),r;},extendFirstKeyFrame:function(e){var t;return !e[0][0].keyFrame&&1<e.length&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e;},generateSampleTable:function(e,t){for(var i,s,r,n=t||0,a=[],o=0;o<e.length;o++)for(s=e[o],i=0;i<s.length;i++)r=s[i],n+=(r=H(r,n)).size,a.push(r);return a;},concatenateNalData:function(e){for(var t,i,s,r,n,a=0,o=e.byteLength,l=e.nalCount,h=new Uint8Array(o+4*l),d=new DataView(
52h.buffer),u=0;u<e.length;u++)for(s=e[u],t=0;t<s.length;t++)for(r=s[t],i=0;i<r.length;i++)n=r[i],d.setUint32(a,n.data.byteLength),h.set(n.data,a+=4),a+=n.data.byteLength;return h;},generateSampleTableForFrame:function(e,t){var i=[],e=H(e,t||0);return i.push(e),i;},concatenateNalDataForFrame:function(e){for(var t,i=0,s=e.byteLength,r=e.length,n=new Uint8Array(s+4*r),a=new DataView(n.buffer),o=0;o<e.length;o++)t=e[o],a.setUint32(i,t.data.byteLength),n.set(t.data,i+=4),i+=t.data.byteLength;return n;}},es=[33,16,5,32,164,27],er=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],en=function(e){return 9e4*e;},ea=function(e,t){return e*t;},eo=function(e){return e/9e4;},el=function(e,t){return e/t;},eh={ONE_SECOND_IN_TS:9e4,secondsToVideoTs:en,secondsToAudioTs:ea,videoTsToSeconds:eo,audioTsToSeconds:el,audioTsToVideoTs:function(e,t){return e/t*9e4;},videoTsToAudioTs:function(e,t){return e/9e4*t;},metadataTsToSeconds:function(e,t,i){return eo(i?e:e-t);}},ed=function(){var e,t;return Z||(Z=Object.keys(t=e={96e3:[es,[227,64],V(154),[56]],88200:[es,[231],V(170),[56]],64e3:[es,[248,192],V(240),[56]],48e3:[es,[255,192],V(268),[55,148,128],V(54),[112]],44100:[es,[255,192],V(268),[55,163,128],V(84),[112]],32e3:[es,[255,192],V(268),[55,234],V(226),[112]],24e3:[es,[255,192],V(268),[55,255,128],V(268),[111,112],V(126),[224]],16e3:[es,[255,192],V(268),[55,255,128],V(268),[111,255],V(269),[223,108],V(195),[1,192]],12e3:[er,V(268),[3,127,248],V(268),[6,255,240],V(268),[13,255,224],V(268),[27,253,128],V(259),[56]],11025:[er,V(268),[3,127,248],V(268),[6,255,240],V(268),[13,255,224],V(268),[27,255,192],V(268),[55,175,128],V(108),[112]],8e3:[er,V(268),[3,121,16],V(47),[7]]}).reduce(function(e,i){return e[i]=new Uint8Array(t[i].reduce(function(e,t){return e.concat(t);},[])),e;},{})),Z;},eu=eh,en={prefixWithSilence:function(e,t,i,s){var r,n,a,o,l,h=0,d=0;if(t.length&&(n=eu.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),r=Math.ceil(eu.ONE_SECOND_IN_TS/(e.samplerate/1024)),i&&s&&(n-=Math.max(i,s),d=(h=Math.floor(n/r))*r),!(h<1||d>eu.ONE_SECOND_IN_TS/2))){for(a=(a=ed()[e.samplerate])||t[0].data,o=0;o<h;o++)l=t[0],t.splice(0,0,{data:a,dts:l.dts-r,pts:l.pts-r});return e.baseMediaDecodeTime-=Math.floor(eu.videoTsToAudioTs(d,e.samplerate)),d;}},trimAdtsFramesByEarliestDts:function(e,t,i){return t.minSegmentDts>=i?e:(t.minSegmentDts=1/0,e.filter(function(e){return e.dts>=i&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0);}));},generateSampleTable:function(e){for(var t,i=[],s=0;s<e.length;s++)i.push({size:(t=e[s]).data.byteLength,duration:1024});return i;},concatenateFrameData:function(e){for(var t,i=0,s=new Uint8Array(function(e){for(var t=0,i=0;i<e.length;i++)t+=e[i].data.byteLength;return t;}(e)),r=0;r<e.length;r++)t=e[r],s.set(t.data,i),i+=t.data.byteLength;return s;}},ec=eh.ONE_SECOND_IN_TS,ea={clearDtsInfo:function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts;},calculateTrackBaseMediaDecodeTime:function(e,t){var i=e.minSegmentDts;return t||(i-=e.timelineStartInfo.dts),t=e.timelineStartInfo.baseMediaDecodeTime,t+=i,t=Math.max(0,t),"audio"===e.type&&(t*=e.samplerate/ec,t=Math.floor(t)),t;},collectDtsInfo:function(e,t){"number"==typeof t.pts&&(void 0===e.timelineStartInfo.pts&&(e.timelineStartInfo.pts=t.pts),void 0===e.minSegmentPts?e.minSegmentPts=t.pts:e.minSegmentPts=Math.min(e.minSegmentPts,t.pts),void 0===e.maxSegmentPts?e.maxSegmentPts=t.pts:e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)),"number"==typeof t.dts&&(void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),void 0===e.minSegmentDts?e.minSegmentDts=t.dts:e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),void 0===e.maxSegmentDts?e.maxSegmentDts=t.dts:e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts));}},el={parseSei:function(e){for(var t=0,i={payloadType:-1,payloadSize:0},s=0,r=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)s+=255,t++;for(s+=e[t++];255===e[t];)r+=255,t++;if(r+=e[t++],!i.payload&&4===s){if("GA94"===String.fromCharCode(e[t+3],e[t+4],e[t+5],e[t+6])){i.payloadType=s,i.payloadSize=r,i.payload=e.subarray(t,t+r);break;}i.payload=void 0;}t+=r,r=s=0;}return i;},parseUserData:function(e){return 181!==e.payload[0]||49!=(e.payload[1]<<8|e.payload[2])||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1);},parseCaptionPackets:function(e,t){var i,s,r,n,a=[];if(64&t[0])for(s=31&t[0],i=0;i<s;i++)n={type:3&t[2+(r=3*i)],pts:e},4&t[2+r]&&(n.ccData=t[3+r]<<8|t[4+r],a.push(n));return a;},discardEmulationPreventionBytes:function(e){for(var t=e.byteLength,i=[],s=1;s<t-2;)0===e[s]&&0===e[s+1]&&3===e[s+2]?(i.push(s+2),s+=2):s++;if(0===i.length)return e;for(var r=t-i.length,n=new Uint8Array(r),a=0,s=0;s<r;a++,s++)a===i[0]&&(a++,i.shift()),n[s]=e[a];return n;},USER_DATA_REGISTERED_ITU_T_T35:4},ep=B,em=el,eg=((z.prototype=new ep()).push=function(e){var t;
52"sei_rbsp"===e.nalUnitType&&(t=em.parseSei(e.escapedRBSP)).payload&&t.payloadType===em.USER_DATA_REGISTERED_ITU_T_T35&&(t=em.parseUserData(t))&&(e.dts<this.latestDts_?this.ignoreNextEqualDts_=!0:e.dts===this.latestDts_&&this.ignoreNextEqualDts_?(this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1)):(t=em.parseCaptionPackets(e.pts,t),this.captionPackets_=this.captionPackets_.concat(t),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts));},z.prototype.flushCCStreams=function(e){this.ccStreams_.forEach(function(t){return "flush"===e?t.flush():t.partialFlush();},this);},z.prototype.flushStream=function(e){this.captionPackets_.length&&(this.captionPackets_.forEach(function(e,t){e.presortIndex=t;}),this.captionPackets_.sort(function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts;}),this.captionPackets_.forEach(function(e){e.type<2?this.dispatchCea608Packet(e):this.dispatchCea708Packet(e);},this),this.captionPackets_.length=0),this.flushCCStreams(e);},z.prototype.flush=function(){return this.flushStream("flush");},z.prototype.partialFlush=function(){return this.flushStream("partialFlush");},z.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(e){e.reset();});},z.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);},z.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData);},z.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData);},z.prototype.setsTextOrXDSActive=function(e){return 256==(28928&e.ccData)||4138==(30974&e.ccData)||6186==(30974&e.ccData);},z.prototype.dispatchCea708Packet=function(e){this.parse708captions_&&this.cc708Stream_.push(e);},{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}),ef=(G.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;},G.prototype.getText=function(){return this.rows.join("\n");},G.prototype.clearText=function(){this.rows=[""],this.rowIdx=0;},G.prototype.newLine=function(e){for(this.rows.length>=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),0<this.rows.length&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--;},G.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0];},G.prototype.addText=function(e){this.rows[this.rowIdx]+=e;},G.prototype.backspace=function(){var e;this.isEmpty()||(e=this.rows[this.rowIdx],this.rows[this.rowIdx]=e.substr(0,e.length-1));},X.prototype.init=function(e,t){this.startPts=e;for(var i=0;i<8;i++)this.windows[i]=new G(i),"function"==typeof t&&(this.windows[i].beforeRowOverflow=t);},X.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e];},X.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});}},function(e){e=e||{},ef.prototype.init.call(this);var t,i=this,s=e.captionServices||{},r={};
52Object.keys(s).forEach((e)=>{t=s[e],/^SERVICE/.test(e)&&(r[e]=t.encoding);}),this.serviceEncodings=r,this.current708Packet=null,this.services={},this.push=function(e){(3===e.type||null===i.current708Packet)&&i.new708Packet(),i.add708Bytes(e);};}),ey=(ef.prototype=new ep(),ef.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]};},ef.prototype.add708Bytes=function(e){var t=e.ccData,i=t>>>8,t=255&t;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(i),this.current708Packet.data.push(t);},ef.prototype.push708Packet=function(){var e,t=this.current708Packet,i=t.data,s=null,r=0,n=i[r++];for(t.seq=n>>6,t.sizeCode=63&n;r<i.length;r++)e=31&(n=i[r++]),7==(s=n>>5)&&0<e&&(s=i[r++]),this.pushServiceBlock(s,r,e),0<e&&(r+=e-1);},ef.prototype.pushServiceBlock=function(e,t,i){for(var s,r=t,n=this.current708Packet.data,a=(a=this.services[e])||this.initService(e,r);r<t+i&&r<n.length;r++)W(s=n[r])?r=this.handleText(r,a):24===s?r=this.multiByteCharacter(r,a):16===s?r=this.extendedCommands(r,a):128<=s&&s<=135?r=this.setCurrentWindow(r,a):152<=s&&s<=159?r=this.defineWindow(r,a):136===s?r=this.clearWindows(r,a):140===s?r=this.deleteWindows(r,a):137===s?r=this.displayWindows(r,a):138===s?r=this.hideWindows(r,a):139===s?r=this.toggleWindows(r,a):151===s?r=this.setWindowAttributes(r,a):144===s?r=this.setPenAttributes(r,a):145===s?r=this.setPenColor(r,a):146===s?r=this.setPenLocation(r,a):143===s?a=this.reset(r,a):8===s?a.currentWindow.backspace():12===s?a.currentWindow.clearText():13===s?a.currentWindow.pendingNewLine=!0:14===s?a.currentWindow.clearText():141===s&&r++;},ef.prototype.extendedCommands=function(e,t){return e=W(this.current708Packet.data[++e])?this.handleText(e,t,{isExtended:!0}):e;},ef.prototype.getPts=function(e){return this.current708Packet.ptsVals[Math.floor(e/2)];},ef.prototype.initService=function(e,t){var i,s="SERVICE"+e,r=this;return s in this.serviceEncodings&&(i=this.serviceEncodings[s]),this.services[e]=new X(e,i,r),this.services[e].init(this.getPts(t),function(t){r.flushDisplayed(t,r.services[e]);}),this.services[e];},ef.prototype.handleText=function(e,t,i){var s,r=i&&i.isExtended,i=i&&i.isMultiByte,n=this.current708Packet.data,a=r?4096:0,o=n[e],n=n[e+1],l=t.currentWindow;return i?(s=[o,n],e++):s=[o],i=t.textDecoder_&&!r?t.textDecoder_.decode(new Uint8Array(s)):i?String.fromCharCode(parseInt(n=s.map((e)=>("0"+(255&e).toString(16)).slice(-2)).join(""),16)):(t=eg[r=a|o]||r,4096&r&&r===t?"":String.fromCharCode(t)),l.pendingNewLine&&!l.isEmpty()&&l.newLine(this.getPts(e)),l.pendingNewLine=!1,l.addText(i),e;},ef.prototype.multiByteCharacter=function(e,t){var i=this.current708Packet.data,s=i[e+1],i=i[e+2];return e=W(s)&&W(i)?this.handleText(++e,t,{isMultiByte:!0}):e;},ef.prototype.setCurrentWindow=function(e,t){var i=this.current708Packet.data[e];return t.setCurrentWindow(7&i),e;},ef.prototype.defineWindow=function(e,t){var i=this.current708Packet.data,s=i[e],t=(t.setCurrentWindow(7&s),t.currentWindow),s=i[++e];return t.visible=(32&s)>>5,t.rowLock=(16&s)>>4,t.columnLock=(8&s)>>3,t.priority=7&s,s=i[++e],t.relativePositioning=(128&s)>>7,t.anchorVertical=127&s,s=i[++e],t.anchorHorizontal=s,s=i[++e],t.anchorPoint=(240&s)>>4,t.rowCount=15&s,s=i[++e],t.columnCount=63&s,s=i[++e],t.windowStyle=(56&s)>>3,t.penStyle=7&s,t.virtualRowCount=t.rowCount+1,e;},ef.prototype.setWindowAttributes=function(e,t){var i=this.current708Packet.data,t=(i[e],t.currentWindow.winAttr),s=i[++e];return t.fillOpacity=(192&s)>>6,t.fillRed=(48&s)>>4,t.fillGreen=(12&s)>>2,t.fillBlue=3&s,s=i[++e],t.borderType=(192&s)>>6,t.borderRed=(48&s)>>4,t.borderGreen=(12&s)>>2,t.borderBlue=3&s,s=i[++e],t.borderType+=(128&s)>>5,t.wordWrap=(64&s)>>6,t.printDirection=(48&s)>>4,t.scrollDirection=(12&s)>>2,t.justify=3&s,s=i[++e],t.effectSpeed=(240&s)>>4,t.effectDirection=(12&s)>>2,t.displayEffect=3&s,e;},ef.prototype.flushDisplayed=function(e,t){for(var i=[],s=0;s<8;s++)t.windows[s].visible&&!t.windows[s].isEmpty()&&i.push(t.windows[s].getText());t.endPts=e,t.text=i.join("\n\n"),this.pushCaption(t),t.startPts=e;},ef.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream
vendor: 14,292 bytes, line 52
52:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts);},ef.prototype.displayWindows=function(e,t){var i=this.current708Packet.data[++e],s=this.getPts(e);this.flushDisplayed(s,t);for(var r=0;r<8;r++)i&1<<r&&(t.windows[r].visible=1);return e;},ef.prototype.hideWindows=function(e,t){var i=this.current708Packet.data[++e],s=this.getPts(e);this.flushDisplayed(s,t);for(var r=0;r<8;r++)i&1<<r&&(t.windows[r].visible=0);return e;},ef.prototype.toggleWindows=function(e,t){var i=this.current708Packet.data[++e],s=this.getPts(e);this.flushDisplayed(s,t);for(var r=0;r<8;r++)i&1<<r&&(t.windows[r].visible^=1);return e;},ef.prototype.clearWindows=function(e,t){var i=this.current708Packet.data[++e],s=this.getPts(e);this.flushDisplayed(s,t);for(var r=0;r<8;r++)i&1<<r&&t.windows[r].clearText();return e;},ef.prototype.deleteWindows=function(e,t){var i=this.current708Packet.data[++e],s=this.getPts(e);this.flushDisplayed(s,t);for(var r=0;r<8;r++)i&1<<r&&t.windows[r].reset();return e;},ef.prototype.setPenAttributes=function(e,t){var i=this.current708Packet.data,t=(i[e],t.currentWindow.penAttr),s=i[++e];return t.textTag=(240&s)>>4,t.offset=(12&s)>>2,t.penSize=3&s,s=i[++e],t.italics=(128&s)>>7,t.underline=(64&s)>>6,t.edgeType=(56&s)>>3,t.fontStyle=7&s,e;},ef.prototype.setPenColor=function(e,t){var i=this.current708Packet.data,t=(i[e],t.currentWindow.penColor),s=i[++e];return t.fgOpacity=(192&s)>>6,t.fgRed=(48&s)>>4,t.fgGreen=(12&s)>>2,t.fgBlue=3&s,s=i[++e],t.bgOpacity=(192&s)>>6,t.bgRed=(48&s)>>4,t.bgGreen=(12&s)>>2,t.bgBlue=3&s,s=i[++e],t.edgeRed=(48&s)>>4,t.edgeGreen=(12&s)>>2,t.edgeBlue=3&s,e;},ef.prototype.setPenLocation=function(e,t){var i=this.current708Packet.data,s=(i[e],t.currentWindow.penLoc);return t.currentWindow.pendingNewLine=!0,t=i[++e],s.row=15&t,t=i[++e],s.column=63&t,e;},ef.prototype.reset=function(e,t){var i=this.getPts(e);return this.flushDisplayed(i,t),this.initService(t.serviceNum,e);},{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}),e8=14,ev=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],e$=function(e,t){e$.prototype.init.call(this),this.field_=e||0,this.dataChannel_=t||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,i,s,r,n=32639&e.ccData;n===this.lastControlCode_?this.lastControlCode_=null:(4096==(61440&n)?this.lastControlCode_=n:n!==this.PADDING_&&(this.lastControlCode_=null),t=n>>>8,i=255&n,n!==this.PADDING_&&(n===this.RESUME_CAPTION_LOADING_?this.mode_="popOn":n===this.END_OF_CAPTION_?(this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),r=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=r,this.startPts_=e.pts):n===this.ROLL_UP_2_ROWS_?(this.rollUpRows_=2,this.setRollUp(e.pts)):n===this.ROLL_UP_3_ROWS_?(this.rollUpRows_=3,this.setRollUp(e.pts)):n===this.ROLL_UP_4_ROWS_?(this.rollUpRows_=4,this.setRollUp(e.pts)):n===this.CARRIAGE_RETURN_?(this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts):n===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):n===this.ERASE_DISPLAYED_MEMORY_?(this.flushDisplayed(e.pts),this.displayed_=Y()):n===this.ERASE_NON_DISPLAYED_MEMORY_?this.nonDisplayed_=Y():n===this.RESUME_DIRECT_CAPTIONING_?("paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=Y()),this.mode_="paintOn",this.startPts_=e.pts):this.isSpecialCharacter(t,i)?(s=K((t=(3&t)<<8)|i),this[this.mode_](e.pts,s),this.column_++):this.isExtCharacter(t,i)?("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=K((t=(3&t)<<8)|i),this[this.mode_](e.pts,s),this.column_++):this.isMidRowCode(t,i)?(this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14==(14&i)&&this.addFormatting(e.pts,["i"]),1==(1&i)&&this.addFormatting(e.pts,["u"])):this.isOffsetControlCode(t,i)?(this.nonDisplayed_[this.row_].offset=r=3&i,this.column_+=r):this.isPAC(t,i)?(r=ev.indexOf(7968&n),"rollUp"===this.mode_&&(r-this.rollUpRows_+1<0&&(r=this.rollUpRows_-1),this.setRollUp(e.pts,r)),r!==this.row_&&(this.clearFormatting(e.pts),this.row_=r),1&i&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16==(16&n)&&(this.column_=4*(r=(14&n)>>1),this.nonDisplayed_[this.row_].indent+=r),this.isColorPAC(i)&&14==(14&i)&&this.addFormatting(e.pts,["i"])):this.isNormalChar(t)&&(0===i&&(i=null),s=K(t),s+=K(i),this[this.mode_](e.pts,s),this.column_+=s.length)));};},ep=(e$.prototype=new ep(),e$.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,s)=>{if(e&&e.text&&e.text.length){try{e.text=e.text.trim();}catch(r){t(s);}e.text.length&&i.push({text:e.text,line:s+1,position:10+Math.min(70,10*e.indent)+2.5*e.offset});}else null==e&&t(s);}),i.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,content:i,stream:this.name_});},e$.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Y(),this.nonDisplayed_=Y(),this.lastControlCode_=null,this.column_=0,this.row_=e8,this.rollUpRows_=2,this.formatting_=[];},e$.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_;},e$.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&48<=t&&t<=63;},e$.prototype.isExtCharacter=function(e,t){return (e===this.EXT_+1||e===this.EXT_+2)&&32<=t&&t<=63;},e$.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&32<=t&&t<=47;},e$.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&33<=t&&t<=35;},e$.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&64<=t&&t<=127;},e$.prototype.isColorPAC=function(e){return 64<=e&&e<=79||96<=e&&e<=127;},e$.prototype.isNormalChar=function(e){return 32<=e&&e<=127;},e$.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=e8,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=Y(),this.displayed_=Y()),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;},e$.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t),t=t.reduce(function(e,t){return e+"<"+t+">";},""),this[this.mode_](e,t);},e$.prototype.clearFormatting=function(e){var t;this.formatting_.length&&(t=this.formatting_.reverse().reduce(function(e,t){return e+"</"+t+">";},""),this.formatting_=[],this[this.mode_](e,t));},e$.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_].text;this.nonDisplayed_[this.row_].text=i+=t;},e$.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_].text;this.displayed_[this.row_].text=i+=t;},e$.prototype.shiftRowsUp_=function(){for(var e=0;e<this.topRow_;e++)this.displayed_[e]={text:"",indent:0,offset:0};for(e=this.row_+1;e<e8+1;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};},e$.prototype.paintOn=function(e,t){var i=this.displayed_[this.row_].text;this.displayed_[this.row_].text=i+=t;},{CaptionStream:z,Cea608Stream:e$,Cea708Stream:ef}),e_={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},eb=B,eT=8589934592,eS=4294967296;function e0(e,t,i){for(var s="",r=t;r<i;r++)s+="%"+("00"+e[r].toString(16)).slice(-2);return s;}function eE(e,t,i){return decodeURIComponent(e0(e,t,i));}function ek(e,t,i){return unescape(e0(e,t,i));}function ew(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3];}J.prototype=new eb();var eC,ex,e2,eb=J,eI=(e,t,i)=>{if(e)for(var s=i;s<e.length;s++)if(e[s]===t)return s;return -1;},eL={APIC:function(e){var t,i=1;3!==e.data[0]||(t=eI(e.data,0,1))<0||(e.mimeType=ek(e.data,1,t),e.pictureType=e.data[i=t+1],(t=eI(e.data,0,++i))<0)||(e.description=eE(e.data,i,t),i=t+1,"-->"===e.mimeType?e.url=ek(e.data,i,e.data.length):e.pictureData=e.data.subarray(i,e.data.length));},"T*":function(e){3===e.data[0]&&(e.value=eE(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=eI(e.data,0,1))&&(e.description=eE(e.data,1,t),e.value=eE(e.data,t+1,e.data.length).replace(/\0*$/,""),e.data=e.value);},"W*":function(e){e.url=ek(e.data,0,e.data.length).replace(/\0.*$/,"");},WXXX:function(e){var t;3===e.data[0]&&-1!==(t=eI(e.data,0,1))&&(e.description=eE(e.data,1,t),e.url=ek(e.data,t+1,e.data.length).replace(/\0.*$/,""));},PRIV:function(e){for(var t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=ek(e.data,0,t);break;}e.privateData=e.data.subarray(t+1),e.data=e.privateData;}},eD={parseId3Frames:function(e){var t,i=10,s=0,r=[];if(!(e.length<10||73!==e[0]||68!==e[1]||51!==e[2])){s=ew(e.subarray(6,10)),s+=10,64&e[5]&&(i=(i+=4)+ew(e.subarray(10,14)),s-=ew(e.subarray(16,20)));do{if((t=ew(e.subarray(i+4,i+8)))<1)break;var n={id:String.fromCharCode(e[i],e[i+1],e[i+2],e[i+3]),data:e.subarray(i+10,i+t+10)};}while(n.key=n.id,eL[n.id]?eL[n.id](n):"T"===n.id[0]?eL["T*"](n):"W"===n.id[0]&&eL["W*"](n),r.push(n),(i=i+10+t)<s);return r;}},parseSyncSafeInteger:ew,frameParsers:eL},eA=B,eP=e_,e3=eD,e6=function(e){var t,i={descriptor:e&&e.descriptor},s=0,r=[],n=0;if(e6.prototype.init.call(this),this.dispatchType=eP.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,h,d;if("timed-metadata"===e.type)if(e.dataAlignmentIndicator&&(n=0,r.length=0),0===r.length&&(e.data.length<10||73!==e.data[0]||68!==e.data[1]||51!==e.data[2]))this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});else{if(r.push(e),n+=e.data.byteLength,1===r.length&&(s=e3.parseSyncSafeInteger(e.data.subarray(6,10)),s+=10),!(n<s)){for(t={data:new Uint8Array(s),frames:[],pts:r[0].pts,dts:r[0].dts},o=0;o<s;)t.data.set(r[0].data.subarray(0,s-o),o),o+=r[0].data.byteLength,n-=r[0].data.byteLength,r.shift();i=10,64&t.data[5]&&(i=(i+=4)+e3.parseSyncSafeInteger(t.data.subarray(10,14)),s-=e3.parseSyncSafeInteger(t.data.subarray(16,20)));do if((a=e3.parseSyncSafeInteger(t.data.subarray(i+4,i+8)))<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break;}while((d={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=d.id,e3.frameParsers[d.id]?e3.frameParsers[d.id](d):"T"===d.id[0]?e3.frameParsers["T*"](d):"W"===d.id[0]&&e3.frameParsers["W*"](d),"com.apple.streaming.transportStreamTimestamp"===d.owner&&(h=(1&(l=d.data)[3])<<30|l[4]<<22|l[5]<<14|l[6]<<6|l[7]>>>2,h=(h*=4)+(3&l[7]),d.timeStamp=h,void 0===t.pts&&void 0===t.dts&&(t.pts=d.timeStamp,t.dts=d.timeStamp),this.trigger("timestamp",d)),t.frames.push(d),(i=i+10+a)<s);this.trigger("data",t);}}};},eA=(e6.prototype=new eA(),e6),e1=B,e4=ep,eO=e_,eR=function(){var e=new Uint8Array(188),t=0;eR.prototype.init.call(this),this.push=function(i){var s,r=0,n=188;for(t?((s=new Uint8Array(i.byteLength+t)).set(e.subarray(0,t)),s.set(i,t),t=0):s=i;n<s.byteLength;)71===s[r]&&71===s[n]?(this.trigger("data",s.subarray(r,n)),r+=188,n+=188):(r++,n++);r<s.byteLength&&(e.set(s.subarray(r),0),t=s.byteLength-r);},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");};},eN=(eR.prototype=new e1(),(eC=function(){var e,t,i,s;eC.prototype.init.call(this),(s=this).packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,s){var r=0;s.payloadUnitStartIndicator&&(r+=e[r]+1),("pat"===s.type?t:i)(e.subarray(r),s);},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],s.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=s.pmtPid;},i=function(e,t){var i,r;if(1&e[5]){for(s.programMapTable={video:null,audio:null,"timed-metadata":{}},i=3+((15&e[1])<<8|e[2])-4,r=12+((15&e[10])<<8|e[11]);r<i;){var n=e[r],a=(31&e[r+1])<<8|e[r+2];n===eO.H264_STREAM_TYPE&&null===s.programMapTable.video?s.programMapTable.video=a:n===eO.ADTS_STREAM_TYPE&&null===s.programMapTable.audio?s.programMapTable.audio=a:n===eO.METADATA_STREAM_TYPE&&(s.programMapTable["timed-metadata"][a]=n),r+=5+((15&e[r+3])<<8|e[r+4]);}t.programMapTable=s.programMapTable;}},this.push=function(t){var i={},s=4;if(i.payloadUnitStartIndicator=!!(64&t[1]),i.pid=31&t[1],i.pid<<=8,i.pid|=t[2],1<(48&t[3])>>>4&&(s+=t[s]+1),0===i.pid)i.type="pat",e(t.subarray(s),i),this.trigger("data",i);else if(i.pid===this.pmtPid)for(i.type="pmt",e(t.subarray(s),i),this.trigger("data",i);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());
52else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,s,i]):this.processPes_(t,s,i);},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=eO.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=eO.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 e1(),eC.STREAM_TYPES={h264:27,adts:15},(ex=function(){function e(e,t,s){var r,n=new Uint8Array(e.size),a={type:t},l=0,h=0;if(e.data.length&&!(e.size<9)){for(a.trackId=e.data[0].pid,l=0;l<e.data.length;l++)r=e.data[l],n.set(r.data,h),h+=r.data.byteLength;o(n,a),t="video"===t||a.packetLength<=e.size,(s||t)&&(e.size=0,e.data.length=0),t&&i.trigger("data",a);}}var t,i=this,s=!1,r={data:[],size:0},n={data:[],size:0},a={data:[],size:0},o=function(e,t){var i=e[0]<<16|e[1]<<8|e[2];t.data=new Uint8Array(),1==i&&(t.packetLength=6+(e[4]<<8|e[5]),t.dataAlignmentIndicator=0!=(4&e[6]),192&(i=e[7])&&(t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&i)&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1),t.data=e.subarray(9+e[8]));};ex.prototype.init.call(this),this.push=function(o){({pat:function(){},pes:function(){var t,i;switch(o.streamType){case eO.H264_STREAM_TYPE:t=r,i="video";break;case eO.ADTS_STREAM_TYPE:t=n,i="audio";break;case eO.METADATA_STREAM_TYPE:t=a,i="timed-metadata";break;default:return;}o.payloadUnitStartIndicator&&e(t,i,!0),t.data.push(o),t.size+=o.data.byteLength;},pmt:function(){var e={type:"metadata",tracks:[]};null!==(t=o.programMapTable).video&&e.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+t.video,codec:"avc",type:"video"}),null!==t.audio&&e.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+t.audio,codec:"adts",type:"audio"}),s=!0,i.trigger("data",e);}})[o.type]();},this.reset=function(){r.size=0,r.data.length=0,n.size=0,n.data.length=0,this.trigger("reset");},this.flushStreams_=function(){e(r,"video"),e(n,"audio"),e(a,"timed-metadata");},this.flush=function(){var e;!s&&t&&(e={type:"metadata",tracks:[]},null!==t.video&&e.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+t.video,codec:"avc",type:"video"}),null!==t.audio&&e.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+t.audio,codec:"adts",type:"audio"}),i.trigger("data",e)),s=!1,this.flushStreams_(),this.trigger("done");};}).prototype=new e1(),{PAT_PID:0,MP2T_PACKET_LENGTH:188,TransportPacketStream:eR,TransportParseStream:eC,ElementaryStream:ex,TimestampRolloverStream:eb,CaptionStream:e4.CaptionStream,Cea608Stream:e4.Cea608Stream,Cea708Stream:e4.Cea708Stream,MetadataStream:eA});for(e2 in eO)eO.hasOwnProperty(e2)&&(eN[e2]=eO[e2]);var eM,eU,e1=eN,eb=B,e5=eh.ONE_SECOND_IN_TS,eB=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],e7=function(e){var t,i=0;e7.prototype.init.call(this),this.skipWarn_=function(e,t){this.trigger("log",{level:"warn",message:`adts ski
52ping bytes ${e} to ${t} in frame ${i} outside syncword`});},this.push=function(s){var r,n,a,o,l,h,d=0;if(e||(i=0),"audio"===s.type){for(t&&t.length?(a=t,(t=new Uint8Array(a.byteLength+s.data.byteLength)).set(a),t.set(s.data,a.byteLength)):t=s.data;d+7<t.length;)if(255!==t[d]||240!=(246&t[d+1]))"number"!=typeof h&&(h=d),d++;else{if("number"==typeof h&&(this.skipWarn_(h,d),h=null),n=2*(1&~t[d+1]),r=(3&t[d+3])<<11|t[d+4]<<3|(224&t[d+5])>>5,l=(o=1024*(1+(3&t[d+6])))*e5/eB[(60&t[d+2])>>>2],t.byteLength-d<r)break;this.trigger("data",{pts:s.pts+i*l,dts:s.dts+i*l,sampleCount:o,audioobjecttype:1+(t[d+2]>>>6&3),channelcount:(1&t[d+2])<<2|(192&t[d+3])>>>6,samplerate:eB[(60&t[d+2])>>>2],samplingfrequencyindex:(60&t[d+2])>>>2,samplesize:16,data:t.subarray(d+7+n,d+r)}),i++,d+=r;}"number"==typeof h&&(this.skipWarn_(h,d),h=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");};},e4=(e7.prototype=new eb(),e7),eA=B,eF=function(e){var t=e.byteLength,i=0,s=0;this.length=function(){return 8*t;},this.bitsAvailable=function(){return 8*t+s;},this.loadWord=function(){var r=e.byteLength-t,n=new Uint8Array(4),a=Math.min(4,t);if(0===a)throw Error("no bytes available");n.set(e.subarray(r,r+a)),i=new DataView(n.buffer).getUint32(0),s=8*a,t-=a;},this.skipBits=function(e){var r;e<s||(e=(e-=s)-8*(r=Math.floor(e/8)),t-=r,this.loadWord()),i<<=e,s-=e;},this.readBits=function(e){var r=Math.min(s,e),n=i>>>32-r;return 0<(s-=r)?i<<=r:0<t&&this.loadWord(),0<(r=e-r)?n<<r|this.readBits(r):n;},this.skipLeadingZeros=function(){for(var e=0;e<s;++e)if(0!=(i&2147483648>>>e))return i<<=e,s-=e,e;return this.loadWord(),e+this.skipLeadingZeros();},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros());},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros());},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1;},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1);},this.readBoolean=function(){return 1===this.readBits(1);},this.readUnsignedByte=function(){return this.readBits(8);},this.loadWord();},eq=function(){var e,t,i=0;eq.prototype.init.call(this),this.push=function(s){for(var r,n=(t=t?((r=new Uint8Array(t.byteLength+s.data.byteLength)).set(t),r.set(s.data,t.byteLength),r):s.data).byteLength;i<n-3;i++)if(1===t[i+2]){e=i+5;break;}for(;e<n;)switch(t[e]){case 0:if(0!==t[e-1])e+=2;else if(0!==t[e-2])e++;else{for(i+3!==e-2&&this.trigger("data",t.subarray(i+3,e-2));1!==t[++e]&&e<n;);i=e-2,e+=3;}break;case 1:0!==t[e-1]||0!==t[e-2]||(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&&3<t.byteLength&&this.trigger("data",t.subarray(i+3)),t=null,i=0,this.trigger("done");},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline");};};function ej(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3];}eq.prototype=new eA(),eU={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},(eM=function(){var e,t,i,s,r,n,a,o=new eq();eM.prototype.init.call(this),(e=this).push=function(e){"video"===e.type&&(t=e.trackId,i=e.pts,s=e.dts,o.push(e));},o.on("data",function(a){var o={trackId:t,pts:i,dts:s,data:a,nalUnitTypeCode:31&a[0]};switch(o.nalUnitTypeCode){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=r(a.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=r(a.subarray(1)),o.config=n(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){for(var i=8,s=8,r=0;r<e;r++)i=0===(s=0!==s?(i+t.readExpGolomb()+256)%256:s)?i:s;},r=function(e){for(var t=e.byteLength,i=[],s=1;s<t-2;)0===e[s]&&0===e[s+1]&&3===e[s+2]?(i.push(s+2),s+=2):s++;if(0===i.length)return e;for(var r=t-i.length,n=new Uint8Array(r),a=0,s=0;s<r;a++,s++)a===i[0]&&(a++,i.shift()),n[s]=e[a];return n;},n=function(e){var t,i,s,r,n,o,l=0,h=0,d=0,u=0,c=[1,1],p=new eF(e),e=p.readUnsignedByte(),m=p.readUnsignedByte(),g=p.readUnsignedByte();if(p.skipUnsignedExpGolomb(),eU[e]&&(3===(i=p.readUnsignedExpGolomb())&&p.skipBits(1),p.skipUnsignedExpGolomb(),p.skipUnsignedExpGolomb(),p.skipBits(1),p.readBoolean()))for(n=3!==i?8:12,o=0;o<n;o++)p.readBoolean()&&a(o<6?16:64,p);if(p.skipUnsignedExpGolomb(),0===(i=p.readUnsignedExpGolomb()))p.readUnsignedExpGolomb();else{if(1===i)for(p.skipBits(1),p.skipExpGolomb(),p.skipExpGolomb(),t=p.readUnsignedExpGolomb(),o=0;o<t;o++)p.skipExpGolomb();}if(p.skipUnsignedExpGolomb(),p.skipBits(1),i=p.readUnsignedExpGolomb(),s=p.readUnsignedExpGolomb(),0===(r=p.readBits(1))&&p.skipBits(1),p.skipBits(1),p.readBoolean()&&(l=p.readUnsignedExpGolomb(),h=p.readUnsignedExpGolomb(),d=p.readUnsignedExpGolomb(),u=p.readUnsignedExpGolomb()),p.readBoolean()&&p.readBoolean()){switch(p.readUnsignedByte()){case 1:c=[1,1];break;case 2:c=[12,11];break;case 3:c=[10,11];break;case 4:c=[16,11];break;case 5:c=[40,33];break;case 6:c=[24,11];break;case 7:c=[20,11];break;case 8:c=[32,11];break;case 9:c=[80,33];break;case 10:c=[18,11];break;case 11:c=[15,11];break;case 12:c=[64,33];break;case 13:c=[160,99];break;case 14:c=[4,3];break;case 15:c=[3,2];break;case 16:c=[2,1];break;case 255:c=[p.readUnsignedByte()<<8|p.readUnsignedByte(),p.readUnsignedByte()<<8|p.readUnsignedByte()];}c&&(c[0],c[1]);}return {profileIdc:e,levelIdc:g,profileCompatibility:m,width:16*(i+1)-2*l-2*h,height:(2-r)*(s+1)*16-2*d-2*u,s
52arRatio:c};};}).prototype=new eA();var eb=eM,eH=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],eV=function(e,t){var i=0<=(i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9])?i:0;return (16&e[t+5])>>4?20+i:10+i;},e9=function(e,t){return e.length-t<10||73!==e[t]||68!==e[t+1]||51!==e[t+2]?t:(t+=eV(e,t),e9(e,t));},ez=function(e,t,i){for(var s="",r=t;r<i;r++)s+="%"+("00"+e[r].toString(16)).slice(-2);return s;},eA={isLikelyAacData:function(e){var t=e9(e,0);return e.length>=t+2&&255==(255&e[t])&&240==(240&e[t+1])&&16==(22&e[t+1]);},parseId3TagSize:eV,parseAdtsSize:function(e,t){var i=(224&e[t+5])>>5,s=e[t+4]<<3;return 6144&e[t+3]|s|i;},parseType:function(e,t){return 73===e[t]&&68===e[t+1]&&51===e[t+2]?"timed-metadata":!0&e[t]&&240==(240&e[t+1])?"audio":null;},parseSampleRate:function(e){for(var t=0;t+5<e.length;){if(255===e[t]&&240==(246&e[t+1]))return eH[(60&e[t+2])>>>2];t++;}return null;},parseAacTimestamp:function(e){var t,i=10;64&e[5]&&(i=(i+=4)+ej(e.subarray(10,14)));do{if((t=ej(e.subarray(i+4,i+8)))<1)break;if("PRIV"===String.fromCharCode(e[i],e[i+1],e[i+2],e[i+3]))for(var s,r,n=e.subarray(i+10,i+t+10),a=0;a<n.byteLength;a++)if(0===n[a]){if("com.apple.streaming.transportStreamTimestamp"===unescape(ez(n,0,a)))return r=(1&(s=n.subarray(a+1))[3])<<30|s[4]<<22|s[5]<<14|s[6]<<6|s[7]>>>2,(r*=4)+(3&s[7]);break;}}while((i=i+10+t)<e.byteLength);return null;}},eW=B,eG=eA,eX=function(){var e=new Uint8Array(),t=0;eX.prototype.init.call(this),this.setTimestamp=function(e){t=e;},this.push=function(i){var s,r,n=0,a=0;for(e.length?(r=e.length,(e=new Uint8Array(i.byteLength+r)).set(e.subarray(0,r)),e.set(i,r)):e=i;3<=e.length-a;)if(73===e[a]&&68===e[a+1]&&51===e[a+2]){if(e.length-a<10||a+(n=eG.parseId3TagSize(e,a))>e.length)break;s={type:"timed-metadata",data:e.subarray(a,a+n)},this.trigger("data",s),a+=n;}else if(255==(255&e[a])&&240==(240&e[a+1])){if(e.length-a<7||a+(n=eG.parseAdtsSize(e,a))>e.length)break;s={type:"audio",data:e.subarray(a,a+n),pts:t,dts:t},this.trigger("data",s),a+=n;}else a++;e=0<(r=e.length-a)?e.subarray(a):new Uint8Array();},this.reset=function(){e=new Uint8Array(),this.trigger("reset");},this.endTimeline=function(){e=new Uint8Array(),this.trigger("endedtimeline");};};function eK(e,t){for(var i=Object.keys(t),s=0;s<i.length;s++){var r=i[s];"headOfPipeline"!==r&&t[r].on&&t[r].on("log",tm.bind(e,r));}}function eY(e,t){var i;if(e.length===t.length){for(i=0;i<e.length;i++)if(e[i]!==t[i])return;return 1;}}function eQ(e,t,i,s,r,n){return {start:{dts:e,pts:e+(i-t)},end:{dts:e+(s-t),pts:e+(r-i)},prependedContentDuration:n,baseMediaDecodeTime:e};}eX.prototype=new eW();var eJ,eZ,te,eW=B,tt=ee,ti=ei,ts=en,tr=ea,tn=e1,ta=eh,to=e4,tl=eb,th=eX,td=eA.isLikelyAacData,tu=eh.ONE_SECOND_IN_TS,tc=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],tp=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],tm=function(e,t){t.stream=e,this.trigger("log",t);},tg=function(e,t){var i=[],s=0,r=0,n=1/0,a=(t=t||{}).firstSequenceNumber||0;tg.prototype.init.call(this),this.push=function(t){tr.collectDtsInfo(e,t),e&&tc.forEach(function(i){e[i]=t[i];}),i.push(t);},this.setEarliestDts=function(e){s=e;},this.setVideoBaseMediaDecodeTime=function(e){n=e;},this.setAudioAppendStart=function(e){r=e;},this.flush=function(){var o,l,h,d,u;0!==i.length&&(o=ts.trimAdtsFramesByEarliestDts(i,e,s),e.baseMediaDecodeTime=tr.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),u=ts.prefixWithSilence(e,o,r,n),e.samples=ts.generateSampleTable(o),h=tt.mdat(ts.concatenateFrameData(o)),i=[],d=tt.moof(a,[e]),l=new Uint8Array(d.byteLength+h.byteLength),a++,l.set(d),l.set(h,d.byteLength),tr.clearDtsInfo(e),h=Math.ceil(1024*tu/e.samplerate),o.length&&(d=o.length*h,this.trigger("segmentTimingInfo",eQ(ta.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),o[0].dts,o[0].pts,o[0].dts+d,o[0].pts+d,u||0)),this.trigger("timingInfo",{start:o[0].pts,end:o[0].pts+d})),this.trigger("data",{track:e,boxes:l})),this.trigger("done","AudioSegmentStream");},this.reset=function(){tr.clearDtsInfo(e),i=[],this.trigger("reset");};};function tf(e){var t="";return (t+=String.fromCharCode(e[0]))+String.fromCharCode(e[1])+String.fromCharCode(e[2])+String.fromCharCode(e[3]);}function ty(e,t){var i,s,r,n=[];if(!t.length)return null;for(i=0;i<e.byteLength;)s=tT(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3]),r=tS(e.subarray(i+4,i+8)),s=1<s?i+s:e.byteLength,r===t[0]&&(1===t.length?n.push(e.subarray(i+8,s)):(r=ty(e.subarray(i+8,s),t.slice(1))).length&&(n=n.concat(r))),i=s;return n;}function t8(e){return (31&e[1])<<8|e[2];}function tv(e){return !!(64&e[1]);}function t$(e){var t=0;return 1<(48&e[3])>>>4&&(t+=e[4]+1),t;}function t_(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;}}tg.prototype=new eW(),(eJ=function(e,t){var i,s,r=[],n=[],a=(t=t||{}).firstSequenceNumber||0;eJ.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){tr.collectDtsInfo(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||i||(i=t.config,e.sps=[t.data],tp.forEach(function(t){e[t]=i[t];},this)),"pic_parameter_set_rbsp"!==t.nalUnitType||s||(s=t.data,e.pps=[t.data]),r.push(t);},this.flush=function(){for(var i,s,o,l=0;r.length&&"access_unit_delimiter_rbsp"!==r[0].nalUnitType;)r.shift();if(0!==r.length){if(i=ti.groupNalsIntoFrames(r),(i=ti.groupFramesIntoGops(i))[0][0].keyFrame||((h=this.getGopForFusion_(r[0],e))?(l=h.duration,i.unshift(h),i.byteLength+=h.byteLength,i.nalCount+=h.nalCount,i.pts=h.pts,i.dts=h.dts,i.duration+=h.duration):i=ti.extendFirstKeyFrame(i)),n.length){var h=t.alignGopsAtEnd?this.alignGopsAtEnd_(i):this.alignGopsAtStart_(i);if(!h)return this.gopCache_.unshift({gop:i.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),r=[],this.resetStream_
52(),void this.trigger("done","VideoSegmentStream");tr.clearDtsInfo(e),i=h;}tr.collectDtsInfo(e,i),e.samples=ti.generateSampleTable(i),h=tt.mdat(ti.concatenateNalData(i)),e.baseMediaDecodeTime=tr.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",i.map(function(e){return {pts:e.pts,dts:e.dts,byteLength:e.byteLength};})),s=i[0],o=i[i.length-1],this.trigger("segmentTimingInfo",eQ(e.baseMediaDecodeTime,s.dts,s.pts,o.dts+o.duration,o.pts+o.duration,l)),this.trigger("timingInfo",{start:i[0].pts,end:i[i.length-1].pts+i[i.length-1].duration}),this.gopCache_.unshift({gop:i.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),r=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),s=tt.moof(a,[e]),o=new Uint8Array(s.byteLength+h.byteLength),a++,o.set(s),o.set(h,s.byteLength),this.trigger("data",{track:e,boxes:o});}this.resetStream_(),this.trigger("done","VideoSegmentStream");},this.reset=function(){this.resetStream_(),r=[],this.gopCache_.length=0,n.length=0,this.trigger("reset");},this.resetStream_=function(){tr.clearDtsInfo(e),s=i=void 0;},this.getGopForFusion_=function(t){for(var i,s,r,n=1/0,a=0;a<this.gopCache_.length;a++)s=(r=this.gopCache_[a]).gop,e.pps&&eY(e.pps[0],r.pps[0])&&e.sps&&eY(e.sps[0],r.sps[0])&&(s.dts<e.timelineStartInfo.dts||-1e4<=(s=t.dts-s.dts-s.duration)&&s<=45e3&&(!i||s<n)&&(i=r,n=s));return i?i.gop:null;},this.alignGopsAtStart_=function(e){for(var t,i,s,r,a=e.byteLength,o=e.nalCount,l=e.duration,h=t=0;h<n.length&&t<e.length&&(i=n[h],s=e[t],i.pts!==s.pts);)s.pts>i.pts?h++:(t++,a-=s.byteLength,o-=s.nalCount,l-=s.duration);return 0===t?e:t===e.length?null:((r=e.slice(t)).byteLength=a,r.duration=l,r.nalCount=o,r.pts=r[0].pts,r.dts=r[0].dts,r);},this.alignGopsAtEnd_=function(e){for(var t,i,s,r,a=n.length-1,o=e.length-1,l=null,h=!1;0<=a&&0<=o;){if(t=n[a],i=e[o],t.pts===i.pts){h=!0;break;}t.pts>i.pts?a--:(a===n.length-1&&(l=o),o--);}return h||null!==l?0===(s=h?o:l)?e:(r=(s=e.slice(s)).reduce(function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e;},{byteLength:0,duration:0,nalCount:0}),s.byteLength=r.byteLength,s.duration=r.duration,s.nalCount=r.nalCount,s.pts=s[0].pts,s.dts=s[0].dts,s):null;},this.alignGopsWith=function(e){n=e;};}).prototype=new eW(),((te=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,te.prototype.init.call(this),this.push=function(e){return e.content||e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),void ("audio"===e.track.type&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes))));};}).prototype=new eW()).flush=function(e){var t,i,s,r=0,n={captions:[],captionStreams:{},metadata:[],info:{}},a=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e||this.remuxTracks)return;if(0===this.pendingTracks.length)return this.emittedTracks++,void (this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0));}if(this.videoTrack?(a=this.videoTrack.timelineStartInfo.pts,tp.forEach(function(e){n.info[e]=this.videoTrack[e];},this)):this.audioTrack&&(a=this.audioTrack.timelineStartInfo.pts,tc.forEach(function(e){n.info[e]=this.audioTrack[e];},this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?n.type=this.pendingTracks[0].type:n.type="combined",this.emittedTracks+=this.pendingTracks.length,e=tt.initSegment(this.pendingTracks),n.initSegment=new Uint8Array(e.byteLength),n.initSegment.set(e),n.data=new Uint8Array(this.pendingBytes),s=0;s<this.pendingBoxes.length;s++)n.data.set(this.pendingBoxes[s],r),r+=this.pendingBoxes[s].byteLength;for(s=0;s<this.pendingCaptions.length;s++)(t=this.pendingCaptions[s]).startTime=ta.metadataTsToSeconds(t.startPts,a,this.keepOriginalTimestamps),t.endTime=ta.metadataTsToSeconds(t.endPts,a,this.keepOriginalTimestamps),n.captionStream
52s[t.stream]=!0,n.captions.push(t);for(s=0;s<this.pendingMetadata.length;s++)(i=this.pendingMetadata[s]).cueTime=ta.metadataTsToSeconds(i.pts,a,this.keepOriginalTimestamps),n.metadata.push(i);for(n.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",n),s=0;s<n.captions.length;s++)t=n.captions[s],this.trigger("caption",t);for(s=0;s<n.metadata.length;s++)i=n.metadata[s],this.trigger("id3Frame",i);}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);},te.prototype.setRemux=function(e){this.remuxTracks=e;},(eZ=function(e){var t,i,s=this,r=!0;eZ.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var r={};(this.transmuxPipeline_=r).type="aac",r.metadataStream=new tn.MetadataStream(),r.aacStream=new th(),r.audioTimestampRolloverStream=new tn.TimestampRolloverStream("audio"),r.timedMetadataTimestampRolloverStream=new tn.TimestampRolloverStream("timed-metadata"),r.adtsStream=new to(),r.coalesceStream=new te(e,r.metadataStream),r.headOfPipeline=r.aacStream,r.aacStream.pipe(r.audioTimestampRolloverStream).pipe(r.adtsStream),r.aacStream.pipe(r.timedMetadataTimestampRolloverStream).pipe(r.metadataStream).pipe(r.coalesceStream),r.metadataStream.on("timestamp",function(e){r.aacStream.setTimestamp(e.timeStamp);}),r.aacStream.on("data",function(n){"timed-metadata"!==n.type&&"audio"!==n.type||r.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:s.baseMediaDecodeTime},codec:"adts",type:"audio"},r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new tg(i,e),r.audioSegmentStream.on("log",s.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",s.trigger.bind(s,"audioTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream),s.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t}));}),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("done",this.trigger.bind(this,"done")),eK(this,r);},this.setupTsPipeline=function(){var r={};(this.transmuxPipeline_=r).type="ts",r.metadataStream=new tn.MetadataStream(),r.packetStream=new tn.TransportPacketStream(),r.parseStream=new tn.TransportParseStream(),r.elementaryStream=new tn.ElementaryStream(),r.timestampRolloverStream=new tn.TimestampRolloverStream(),r.adtsStream=new to(),r.h264Stream=new tl(),r.captionStream=new tn.CaptionStream(e),r.coalesceStream=new te(e,r.metadataStream),r.headOfPipeline=r.packetStream,r.packetStream.pipe(r.parseStream).pipe(r.elementaryStream).pipe(r.timestampRolloverStream),r.timestampRolloverStream.pipe(r.h264Stream),r.timestampRolloverStream.pipe(r.adtsStream),r.timestampRolloverStream.pipe(r.metadataStream).pipe(r.coalesceStream),r.h264Stream.pipe(r.captionStream).pipe(r.coalesceStream),r.elementaryStream.on("data",function(n){var a;if("metadata"===n.type){for(a=n.tracks.length;a--;)t||"video"!==n.tracks[a].type?i||"audio"!==n.tracks[a].type||((i=n.tracks[a]).timelineStartInfo.baseMediaDecodeTime=s.baseMediaDecodeTime):(t=n.tracks[a]).timelineStartInfo.baseMediaDecodeTime=s.baseMediaDecodeTime;t&&!r.videoSegmentStream&&(r.coalesceStream.numberOfTracks++,r.videoSegmentStream=new eJ(t,e),r.videoSegmentStream.on("log",s.getLogTrigger_("videoSegmentStream")),r.videoSegmentStream.on("timelineStartInfo",function(t){i&&!e.keepOriginalTimestamps&&(i.timelineStartInfo=t,r.audioSegmentStream.setEarliestDts(t.dts-s.baseMediaDecodeTime));}),r.videoSegmentStream.on("processedGopsInfo",s.trigger.bind(s,"gopInfo")),r.videoSegmentStream.on("segmentTimingInfo",s.trigger.bind(s,"videoSegmentTimingInfo")),r.videoSegmentStream.on("baseMediaDecodeTime",function(e){i&&r.audioSegmentStream.setVideoBaseMediaDecodeTime(e);}),r.videoSegmentStream.on("timingInfo",s.trigger.bind(s,"videoTimingInfo")),r.h264Stream.pipe(r.videoSegmentStream).pipe(r.coalesceStream)),i&&!r.audioSegmentStream&&(r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new tg(i,e),r.audioSegmentStream.on("log",s.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",s.trigger.bind(s,"audioTimingInfo")),r.audioSegmentStream.on("segmentTimingInfo",s.trigger.bind(s,"audioSegmentTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream)),s.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t});}}),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("id3Frame",function(e){e.dispatchType=r.metadataStream.dispatchType,s.trigger("id3Frame",e);}),r.coalesceStream.on("caption",this.trigger.bind(this,"caption")),r.coalesceStream.on("done",this.trigger.bind(this,"done")),eK(this,r);},this.setBaseMediaDecodeTime=function(s){var r=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=s),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,tr.clearDtsInfo(i),r.audioTimestampRolloverStream)&&r.audioTimestampRolloverStream.discontinuity(),t&&(r.videoSegmentStream&&(r.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,tr.clearDtsInfo(t),r.captionStream.reset()),r.timestampRolloverStream&&r.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){var t;r&&((t=td(e))&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),r=!1),this.transmuxPipeline_.headOfPipeline.push(e);},this.flush=function(){r=!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 eW();var tb=eZ,B=function(e){return e>>>0;},en=function(e){return ("00"+e.toString(16)).slice(-2);},tT=B,tS=tf,t0=B,tE=F.getUint64,tk=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]};},ea="undefined"!=typeof window?window:void 0!==U?U:"undefined"!=typeof self?self:{},e1=ea,tw=el.discardEmulationPreventionBytes,tC=ep.CaptionStream,tx=ty,t2=function e(t){var i={version:t[0],flags:new Uint8Array(t.subarray(1,4))};return i.baseMediaDecodeTime=1===i.version?tE(t.subarray(4)):t0(t[4]<<24|t[5]<<16|t[6]<<8|t[7]),i;},tI=function e(t){var i,s={version:t[0],flags:new Uint8Array(t.subarray(1,4)),samples:[]},r=new DataView(t.buffer,t.byteOffset,t.byteLength),n=1&s.flags[2],a=4&s.flags[2],o=1&s.flags[1],l=2&s.flags[1],h=4&s.flags[1],d=8&s.flags[1],u=r.getUint32(4),c=8;for(n&&(s.dataOffset=r.getInt32(c),c+=4),a&&u&&(i={flags:tk(t.subarray(c,c+4))},c+=4,o&&(i.duration=r.getUint32(c),c+=4),l&&(i.size=r.getUint32(c),c+=4),d&&(i.compositionTimeOffset=1===s.version?r.getInt32(c):r.getUint32(c),c+=4),s.samples.push(i),u--);u--;)i={},o&&(i.duration=r.getUint32(c),c+=4),l&&(i.size=r.getUint32(c),c+=4),h&&(i.flags=tk(t.subarray(c,c+4)),c+=4),d&&(i.compositionTimeOffset=1===s.version?r.getInt32(c):r.getUint32(c),c+=4),s.samples.push(i);return s;},tL=function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),s=1&(t={version:t[0],flags:new Uint8Array(t.subarray(1,4)),trackId:i.getUint32(4)}).flags[2],r=2&t.flags[2],n=8&t.flags[2],a=16&t.flags[2],o=32&t.flags[2],l=65536&t.flags[0],h=131072&t.flags[0],d=8;return s&&(d+=4,t.baseDataOffset=i.getUint32(12),d+=4),r&&(t.sampleDescriptionIndex=i.getUint32(d),d+=4),n&&(t.defaultSampleDuration=i.getUint32(d),d+=4),a&&(t.defaultSampleSize=i.getUint32(d),d+=4),o&&(t.defaultSampleFlags=i.getUint32(d)),l&&(t.durationIsEmpty=!0),!s&&h&&(t.baseDataOffsetIsMoof=!0),t;},tD=e1,tA=function(e,t){var i=tx(e,["moof","traf"]),e=tx(e,["mdat"]),s={},r=[];return e.forEach(function(e,t){t=i[t],r.push({mdat:e,traf:t});}),r.forEach(function(e){var i,r,n,a,o,l=e.mdat,e=e.traf,h=tx(e,["tfhd"]),h=tL(h[0]),d=h.trackId,u=tx(e,["tfdt"]),u=0<u.length?t2(u[0]).baseMediaDecodeTime:0,e=tx(e,["trun"]);t===d&&0<e.length&&(i=u,r=h.defaultSampleDuration||0,n=h.defaultSampleSize||0,a=h.trackId,o=[],e.forEach(function(e){(e=tI(e).samples).forEac
52h(function(e){void 0===e.duration&&(e.duration=r),void 0===e.size&&(e.size=n),e.trackId=a,e.dts=i,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),"bigint"==typeof i?(e.pts=i+tD.BigInt(e.compositionTimeOffset),i+=tD.BigInt(e.duration)):(e.pts=i+e.compositionTimeOffset,i+=e.duration);}),o=o.concat(e);}),u=function(e,t,i){for(var s,r,n=new DataView(e.buffer,e.byteOffset,e.byteLength),a={logs:[],seiNals:[]},o=0;o+4<e.length;o+=s)if(s=n.getUint32(o),o+=4,!(s<=0))switch(31&e[o]){case 6:var l=e.subarray(o+1,o+1+s),h=function(e,t){for(var i=e,s=0;s<t.length;s++){var r=t[s];if(i<r.size)return r;i-=r.size;}return null;}(o,t),l={nalUnitType:"sei_rbsp",size:s,data:l,escapedRBSP:tw(l),trackId:i};if(h)l.pts=h.pts,l.dts=h.dts,r=h;else{if(!r){a.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+o+" for trackId "+i+". See mux.js#223."});break;}l.pts=r.pts,l.dts=r.dts;}a.seiNals.push(l);}return a;}(l,o,d),s[d]||(s[d]={seiNals:[],logs:[]}),s[d].seiNals=s[d].seiNals.concat(u.seiNals),s[d].logs=s[d].logs.concat(u.logs));}),s;},tP=function(){var e,t,i,s,r,n,a=!1;this.isInitialized=function(){return a;},this.init=function(t){e=new tC(),a=!0,n=!!t&&t.isPartial,e.on("data",function(e){e.startTime=e.startPts/s,e.endTime=e.endPts/s,r.captions.push(e),r.captionStreams[e.stream]=!0;}),e.on("log",function(e){r.logs.push(e);});},this.isNewInit=function(e,t){return !(e&&0===e.length||t&&"object"==typeof t&&0===Object.keys(t).length||i===e[0]&&s===t[i]);},this.parse=function(e,n,a){var o,l;if(!this.isInitialized()||!n||!a)return null;if(this.isNewInit(n,a))s=a[i=n[0]];else{if(null===i||!s)return t.push(e),null;}for(;0<t.length;){var h=t.shift();this.parse(h,n,a);}return l=s,(o=null===(o=i)?null:{seiNals:(e=tA(e,o)[o]||{}).seiNals,logs:e.logs,timescale:l})&&o.logs&&(r.logs=r.logs.concat(o.logs)),null!==o&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),r):r.logs.length?{logs:r.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;n?e.partialFlush():e.flush();},this.clearParsedCaptions=function(){r.captions=[],r.captionStreams={},r.logs=[];},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset();},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream();},this.reset=function(){t=[],s=i=null,r?this.clearParsedCaptions():r={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream();},this.reset();},t3=function(e){for(var t=0,i=String.fromCharCode(e[t]),s="";"\0"!==i;)s+=i,i=String.fromCharCode(e[++t]);return s+i;},t6=F.getUint64,t1=function(e){return void 0!==e||null!==e;},t4=B,tO=en,tR=ty,tN=tf,tM={parseEmsgBox:function(e){var t,i,s,r,n,a,o,l=4,h=e[0],d=(0===h?(l=(l+=(r=t3(e.subarray(l))).length)+(n=t3(e.subarray(l))).length,s=(d=new DataView(e.buffer)).getUint32(l),o=d.getUint32(l+=4),t=d.getUint32(l+=4),i=d.getUint32(l+=4),l+=4):1===h&&(s=(d=new DataView(e.buffer)).getUint32(l),a=t6(e.subarray(l+=4)),t=d.getUint32(l+=8),i=d.getUint32(l+=4),l=(l=(l+=4)+(r=t3(e.subarray(l))).length)+(n=t3(e.subarray(l))).length),{scheme_id_uri:r,value:n,timescale:s||1,presentation_time:a,presentation_time_delta:o,event_duration:t,id:i,message_data:new Uint8Array(e.subarray(l,e.byteLength))});return n="\0"!==(r=d).scheme_id_uri,a=0===(s=h)&&t1(r.presentation_time_delta)&&n,o=1===s&&t1(r.presentation_time)&&n,!(1<s)&&a||o?d:void 0;},scaleTime:function(e,t,i,s){return e||0===e?e/t:s+i/t;}},tU=F.getUint64,t5=e1,tB=eD.parseId3Frames,t7=function(e){var t=0===e[0]?12:20;return t4(e[t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t]);},tF=function(e){var e=tR(e,["moov","trak"]),t=[];return e.forEach(function(e){var i,s={},r=tR(e,["tkhd"])[0],n=(r&&(n=(r=new DataView(r.buffer,r.byteOffset,r.byteLength)).getUint8(0),s.id=0===n?r.getUint32(12):r.getUint32(20)),tR(e,["mdia","hdlr"])[0]),n=(n&&(r=tN(n.subarray(8,12)),s.type="vide"===r?"video":"soun"===r?"audio":r),tR(e,["mdia","minf","stbl","stsd"])[0]),r=(n&&(r=n.subarray(8),s.codec=tN(r.subarray(4,8)),n=tR(r,[s.codec])[0])&&(/^[asm]vc[1-9]$/i.test(s.codec)?"avcC"===tN((i=n.subarray(78)).subarray(4,8))&&11<i.length?(s.codec+=".",s.codec+=tO(i[9]),s.codec+=tO(i[10]),s.codec+=tO(i[11])):s.codec="avc1.4d400d":/^mp4[a,v]$/i.test(s.codec)?"esds"===tN((i=n.subarray(28)).subarray(4,8))&&20<i.length&&0!==i[19]?(s.codec+="."+tO(i[19]),s.codec+="."+tO(i[20]>>>2&63).replace(/^0/,"")):s.codec="mp4a.40.2":s.codec=s.codec.toLowerCase()),tR(e,["mdia","mdhd"])[0]);r&&(s.timescale=t7(r)),t.push(s);}),t;},tq=e_,tj=e_,tH=Q,tV={},t9=(tV.ts={parseType:function(e,t){return 0===(e=t8(e))?"pat":e===t?"pmt":t?"pes":null;},parsePat:function(e){var t=tv(e),i=4+t$(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11];},parsePmt:function(e){var t={},i=tv(e),s=4+t$(e);if(i&&(s+=e[s]+1),1&e[s+5]){for(var r=3+((15&e[s+1])<<8|e[s+2])-4,n=12+((15&e[s+10])<<8|e[s+11]);n<r;){var a=s+n;t[(31&e[a+1])<<8|e[a+2]]=e[a],n+=5+((15&e[a+3])<<8|e[a+4]);}return t;}},parsePayloadUnitStartIndicator:tv,parsePesType:function(e,t){switch(t[t8(e)]){case tq.H264_STREAM_TYPE:return "video";case tq.ADTS_STREAM_TYPE:return "audio";case tq.METADATA_STREAM_TYPE:return "timed-metadata";default:return null;}},parsePesTime:function(e){var t,i,s;return !tv(e)||(t=4+t$(e))>=e.byteLength?null:(i=null,192&(s=e[t+7])&&((i={}).pts=(14&e[t+9])<<27|(255&e[t+10])<<20|(254&e[t+11])<<12|(255&e[t+12])<<5|(254&e[t+13])>>>3,i.pts*=4,i.pts+=(6&e[t+13])>>>1,i.dts=i.pts,64&s)&&(i.dts=(14&e[t+14])<<27|(255&e[t+15])<<20|(254&e[t+16])<<12|(255&e[t+17])<<5|(254&e[t+18])>>>3,i.dts*=4,i.dts+=(6&e[t+18])>>>1),i);},videoPacketContainsKeyFrame:function(e){for(var t=4+t$(e),i=e.subarray(t),s=0,r=0,n=!1;r<i.byteLength-3;r++)if(1===i[r+2]){s=r+5;break;}for(;s<i.byteLength;)switch(i[s]){case 0:if(0!==i[s-1])s+=2;else if(0!==i[s-2])s++;else{for(r+3!==s-2&&"slice_layer_without_partitioning_rbsp_idr"===t_(31&i[r+3])&&(n=!0);1!==i[++s]&&s<i.length;);r=s-2,s+=3;}break;case 1:0!==i[s-1]||0!==i[s-2]||("slice_layer_without_partitioning_rbsp_idr"===t_(31&i[r+3])&&(n=!0),r=s-2),s+=3;break;default:s+=3;}return i=i.subarray(r),s-=r,r=0,n=!!i&&3<i.byteLength&&"slice_layer_without_partitioning_rbsp_idr"===t_(31&i[r+3])||n;}},tV.aac=eA,eh.ONE_SECOND_IN_TS),tz=function(e,t){for(var i,s=0,r=188;r<e.byteLength;)if(71===e[s]&&71===e[r]){switch(i=e.subarray(s,r),tV.ts.parseType(i,t.pid)){case "pat":t.pid=tV.ts.parsePat(i);break;case "pmt":var n=tV.ts.parsePmt(i);t.table=t.table||{}
52,Object.keys(n).forEach(function(e){t.table[e]=n[e];});}s+=188,r+=188;}else s++,r++;},tW=function(e,t,i){for(var s,r,n,a,o=0,l=188,h=!1;l<=e.byteLength;)if(71!==e[o]||71!==e[l]&&l!==e.byteLength)o++,l++;else{if(s=e.subarray(o,l),"pes"===tV.ts.parseType(s,t.pid)&&(r=tV.ts.parsePesType(s,t.table),n=tV.ts.parsePayloadUnitStartIndicator(s),"audio"===r)&&n&&(a=tV.ts.parsePesTime(s))&&(a.type="audio",i.audio.push(a),h=!0),h)break;o+=188,l+=188;}for(o=(l=e.byteLength)-188,h=!1;0<=o;)if(71!==e[o]||71!==e[l]&&l!==e.byteLength)o--,l--;else{if(s=e.subarray(o,l),"pes"===tV.ts.parseType(s,t.pid)&&(r=tV.ts.parsePesType(s,t.table),n=tV.ts.parsePayloadUnitStartIndicator(s),"audio"===r)&&n&&(a=tV.ts.parsePesTime(s))&&(a.type="audio",i.audio.push(a),h=!0),h)break;o-=188,l-=188;}},tG=function(e,t,i){for(var s,r,n,a,o,l,h,d,u=0,c=188,p=!1,m={data:[],size:0};c<e.byteLength;)if(71===e[u]&&71===e[c]){if(s=e.subarray(u,c),"pes"===tV.ts.parseType(s,t.pid)&&(r=tV.ts.parsePesType(s,t.table),n=tV.ts.parsePayloadUnitStartIndicator(s),"video"===r&&(n&&!p&&(a=tV.ts.parsePesTime(s))&&(a.type="video",i.video.push(a),p=!0),!i.firstKeyFrame))){if(n&&0!==m.size){for(o=new Uint8Array(m.size),l=0;m.data.length;)h=m.data.shift(),o.set(h,l),l+=h.byteLength;tV.ts.videoPacketContainsKeyFrame(o)&&(d=tV.ts.parsePesTime(o))&&(i.firstKeyFrame=d,i.firstKeyFrame.type="video"),m.size=0;}m.data.push(s),m.size+=s.byteLength;}if(p&&i.firstKeyFrame)break;u+=188,c+=188;}else u++,c++;for(u=(c=e.byteLength)-188,p=!1;0<=u;)if(71===e[u]&&71===e[c]){if(s=e.subarray(u,c),"pes"===tV.ts.parseType(s,t.pid)&&(r=tV.ts.parsePesType(s,t.table),n=tV.ts.parsePayloadUnitStartIndicator(s),"video"===r)&&n&&(a=tV.ts.parsePesTime(s))&&(a.type="video",i.video.push(a),p=!0),p)break;u-=188,c-=188;}else u--,c--;},tX=function(e,t){var i,s,r,e=(tV.aac.isLikelyAacData(e)?function(e){for(var t,i,s=!1,r=0,n=null,a=null,o=0,l=0;3<=e.length-l;){switch(tV.aac.parseType(e,l)){case "timed-metadata":e.length-l<10?s=!0:(o=tV.aac.parseId3TagSize(e,l))>e.length?s=!0:(null===a&&(t=e.subarray(l,l+o),a=tV.aac.parseAacTimestamp(t)),l+=o);break;case "audio":e.length-l<7?s=!0:(o=tV.aac.parseAdtsSize(e,l))>e.length?s=!0:(null===n&&(t=e.subarray(l,l+o),n=tV.aac.parseSampleRate(t)),r++,l+=o);break;default:l++;}if(s)return null;}return null===n||null===a?null:{audio:[{type:"audio",dts:a,pts:a},{type:"audio",dts:a+1024*r*(i=t9/n),pts:a+1024*r*i}]};}:function(e){var t,i={pid:null,table:null},s={};for(t in tz(e,i),i.table)if(i.table.hasOwnProperty(t))switch(i.table[t]){case tj.H264_STREAM_TYPE:s.video=[],tG(e,i,s),0===s.video.length&&delete s.video;break;case tj.ADTS_STREAM_TYPE:s.audio=[],tW(e,i,s),0===s.audio.length&&delete s.audio;}return s;})(e);return e&&(e.audio||e.video)?((i=e).audio&&i.audio.length&&((void 0===(s=t)||isNaN(s))&&(s=i.audio[0].dts),i.audio.forEach(function(e){e.dts=tH(e.dts,s),e.pts=tH(e.pts,s),e.dtsTime=e.dts/t9,e.ptsTime=e.pts/t9;})),i.video&&i.video.length&&((void 0===(r=t)||isNaN(r))&&(r=i.video[0].dts),i.video.forEach(function(e){e.dts=tH(e.dts,r),e.pts=tH(e.pts,r),e.dtsTime=e.dts/t9,e.ptsTime=e.pts/t9;}),i.firstKeyFrame)&&((t=i.firstKeyFrame).dts=tH(t.dts,r),t.pts=tH(t.pts,r),t.dtsTime=t.dts/t9,t.ptsTime=t.pts/t9),e):null;};class tK{constructor(e,t){this.options=t||{},this.self=e,this.init();}init(){var e,t;this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new tb(this.options),e=this.self,(t=this.transmuxer).on("data",function(t){var i=t.initSegment,i=(t.initSegment={data:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength},t.data);t.data=i.buffer,e.postMessage({action:"data",segment:t,byteOffset:i.byteOffset,byteLength:i.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){var i={start:{decode:eh.videoTsToSeconds(t.start.dts),presentation:eh.videoTsToSeconds(t.start.pts)},end:{decode:eh.videoTsToSeconds(t.end.dts),presentation:eh.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:eh.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=eh.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:i});}),t.on("audioSegmentTimingInfo",function(t){var i={start:{decode:eh.videoTsToSeconds(t.start.dts),presentation:eh.videoTsToSeconds(t.start.pts)},end:{decode:eh.videoTsToSeconds(t.end.dts),presentation:eh.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:eh.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=eh.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:i});}),t.on("id3Frame",function(t){e.postMessage({action:"id3Frame",id3Frame:t});}),t.on("caption",function(t){e.postMessage({action:"caption",caption:t});}),t.on("trackinfo",function(t){e.postMessage({action:"trackinfo",trackInfo:t});}),t.on("audioTimingInfo",function(t){e.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:eh.videoTsToSeconds(t.start),end:eh.videoTsToSeconds(t.end)}});}),t.on("videoTimingInfo",function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:eh.videoTsToSeconds(t.start),end:eh.videoTsToSeconds(t.end)}});}),t.on("log",function(t){e.postMessage({action:"log",log:t});});}pushMp4Captions(e){this.captionParser||(this.captionParser=new tP(),this.captionParser.init());var t=new Uint8Array(e.data,e.byteOffset,e.byteLength),e=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:"mp4Captions",captions:e&&e.captions||[],logs:e&&e.logs||[],data:t.buffer},[t.buffer]);}probeMp4StartTime({timescales:e,data:t}){var i,s;e=(i=e,"bigint"==typeof (s=tR(s=t,["moof","traf"]).reduce(function(e,t){var s=tR(t,["tfhd"])[0],s=t4(s[4]<<24|s[5]<<16|s[6]<<8|s[7]),s=i[s]||9e4,t=tR(t,["tfdt"])[0],r=new DataView(t.buffer,t.byteOffset,t.byteLength),t=1===t[0]?tU(t.subarray(4,12)):r.getUint32(4);let n;return "bigint"==typeof t?n=t/t5.BigInt(s):"number"!=typeof t||isNaN(t)||(n=t/s),e=(n=n<Number.MAX_SAFE_INTEGER?
52Number(n):n)<e?n:e;},1/0))||isFinite(s)?s:0),this.self.postMessage({action:"probeMp4StartTime",startTime:e,data:t},[t.buffer]);}probeMp4Tracks({data:e}){var t=tF(e);this.self.postMessage({action:"probeMp4Tracks",tracks:t,data:e},[e.buffer]);}probeEmsgID3({data:e,offset:t}){t=function(e,t=0){return tR(e,["emsg"]).map((e)=>{var e=tM.parseEmsgBox(new Uint8Array(e)),i=tB(e.message_data);return {cueTime:tM.scaleTime(e.presentation_time,e.timescale,e.presentation_time_delta,t),duration:tM.scaleTime(e.event_duration,e.timescale),frames:i};});}(e,t),this.self.postMessage({action:"probeEmsgID3",id3Frames:t,emsgData:e},[e.buffer]);}probeTs({data:e,baseStartTime:t}){t="number"!=typeof t||isNaN(t)?void 0:t*eh.ONE_SECOND_IN_TS;let i=null;(t=tX(e,t))&&((i={hasVideo:t.video&&2===t.video.length||!1,hasAudio:t.audio&&2===t.audio.length||!1}).hasVideo&&(i.videoStart=t.video[0].ptsTime),i.hasAudio)&&(i.audioStart=t.audio[0].ptsTime),this.self.postMessage({action:"probeTs",result:i,data:e},[e.buffer]);}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions();}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions();}push(e){e=new Uint8Array(e.data,e.byteOffset,e.byteLength),this.transmuxer.push(e);}reset(){this.transmuxer.reset();}setTimestampOffset(e){e=e.timestampOffset||0,this.transmuxer.setBaseMediaDecodeTime(Math.round(eh.secondsToVideoTs(e)));}setAudioAppendStart(e){this.transmuxer.setAudioAppendStart(Math.ceil(eh.secondsToVideoTs(e.appendStart)));}setRemux(e){this.transmuxer.setRemux(e.remux);}flush(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"});}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"});}alignGopsWith(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice());}}self.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new tK(self,e.data.options):(this.messageHandlers||(this.messageHandlers=new tK(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data));};})));let la=(e,t,i)=>{var {type:s,initSegment:r,captions:n,captionStreams:a,metadata:o,videoFrameDtsTime:l,videoFramePtsTime:h}=e.data.segment,t=(t.buffer.push({captions:n,captionStreams:a,metadata:o}),e.data.segment.boxes||{data:e.data.segment.data}),n={type:s,data:new Uint8Array(t.data,t.data.byteOffset,t.data.byteLength),initSegment:new Uint8Array(r.data,r.byteOffset,r.byteLength)};void 0!==l&&(n.videoFrameDtsTime=l),void 0!==h&&(n.videoFramePtsTime=h),i(n);},lo=({transmuxedData:e,callback:t})=>{e.buffer=[],t(e);},ll=(e,t)=>
52{t.gopInfo=e.data.gopInfo;},lh=(e)=>{var t,i;let {transmuxer:s,bytes:r,audioAppendStart:n,gopsToAlignWith:a,remux:o,onData:l,onTrackInfo:h,onAudioTimingInfo:d,onVideoTimingInfo:u,onVideoSegmentTimingInfo:c,onAudioSegmentTimingInfo:p,onId3:m,onCaptions:g,onDone:f,onEndedTimeline:y,onTransmuxerLog:v,isEndOfTimeline:$}=e,_={buffer:[]},b=$;s.onmessage=(t)=>{s.currentTransmux!==e||("data"===t.data.action&&la(t,_,l),"trackinfo"===t.data.action&&h(t.data.trackInfo),"gopInfo"===t.data.action&&ll(t,_),"audioTimingInfo"===t.data.action&&d(t.data.audioTimingInfo),"videoTimingInfo"===t.data.action&&u(t.data.videoTimingInfo),"videoSegmentTimingInfo"===t.data.action&&c(t.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===t.data.action&&p(t.data.audioSegmentTimingInfo),"id3Frame"===t.data.action&&m([t.data.id3Frame],t.data.id3Frame.dispatchType),"caption"===t.data.action&&g(t.data.caption),"endedtimeline"===t.data.action&&(b=!1,y()),"log"===t.data.action&&v(t.data.log),"transmuxed"!==t.data.type)||b||(s.onmessage=null,lo({transmuxedData:_,callback:f}),ld(s));},n&&s.postMessage({action:"setAudioAppendStart",appendStart:n}),Array.isArray(a)&&s.postMessage({action:"alignGopsWith",gopsToAlignWith:a}),void 0!==o&&s.postMessage({action:"setRemux",remux:o}),r.byteLength&&(t=r instanceof ArrayBuffer?r:r.buffer,i=r instanceof ArrayBuffer?0:r.byteOffset,s.postMessage({action:"push",data:t,byteOffset:i,byteLength:r.byteLength},[t])),$&&s.postMessage({action:"endTimeline"}),s.postMessage({action:"flush"});},ld=(e)=>{e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():lh(e.currentTransmux));},lu=(e,t)=>{e.postMessage({action:t}),ld(e);},lc=(e,t)=>{t.currentTransmux?t.transmuxQueue.push(lu.bind(null,t,e)):(t.currentTransmux=e,lu(t,e));},lp=(e)=>{e.transmuxer.currentTransmux?e.transmuxer.transmuxQueue.push(e):(e.transmuxer.currentTransmux=e,lh(e));};var lm=(e)=>{lc("reset",e);},lg=(e)=>{let t=new ln(),i=(t.currentTransmux=null,t.transmuxQueue=[],t.terminate);return t.terminate=()=>(t.currentTransmux=null,t.transmuxQueue.length=0,i.call(t)),t.postMessage({action:"init",options:e}),t;};function lf(e){let t=e.transmuxer,i=e.endAction||e.action,s=e.callback;var r,n=tR({},e,{endAction:null,transmuxer:null,callback:null});let a=(r)=>{r.data.action===i&&(t.removeEventListener("message",a),r.data.data&&(r.data.data=new Uint8Array(r.data.data,e.byteOffset||0,e.byteLength||r.data.data.byteLength),e.data)&&(e.data=r.data.data),s(r.data));};t.addEventListener("message",a),e.data?(r=e.data instanceof ArrayBuffer,n.byteOffset=r?0:e.data.byteOffset,n.byteLength=e.data.byteLength,r=[r?e.data:e.data.buffer],t.postMessage(n,r)):t.postMessage(n);}function ly(e){let t=0;return e.audio&&t++,e.video&&t++,t;}function l8(e,t){var i=t.attributes||{},s=lA(function(e){if((e=e.attributes||{}).CODECS)return r$(e.CODECS);}(t)||[]);return !lD(e,t)||s.audio||((e,t)=>{if(!lD(e,t))return !0;var t=t.attributes||{},i=e.mediaGroups.AUDIO[t.AUDIO];for(let s in i)if(!i[s].uri&&!i[s].playlists)return !0;return !1;})(e,t)||(t=lA(function(e,t){if(e.mediaGroups.AUDIO&&t){var i=e.mediaGroups.AUDIO[t];if(i)for(var s in i)if((s=i[s]).default&&s.playlists)return r$(s.playlists[0].attributes.CODECS);}return null;}(e,i.AUDIO)||[])).audio&&(s.audio=t.audio),s;}function lv(e,t){return (e=e&&window.getComputedStyle(e))?e[t]:"";}function l$(e,t){let i,s;return (i=(i=e.attributes.BANDWIDTH?e.attributes.BANDWIDTH:i)||window.Number.MAX_VALUE)-(s=(s=t.attributes.BANDWIDTH?t.attributes.BANDWIDTH:s)||window.Number.MAX_VALUE);}let l_={FAILURE:2,TIMEOUT:-101,ABORTED:-102},lb=(e)=>{e.forEach((e)=>{e.abort();});},lT=(e)=>({bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}),lS=(e)=>{var t=e.target,t={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-t.requestTime||0};return t.bytesReceived=e.loaded,t.bandwidth=Math.floor(t.bytesReceived/t.roundTripTime*8e3),t;},l0=(e,t)=>t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:l_.TIMEOUT,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:l_.ABORTED,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:l_.FAILURE,xhr:t}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:l_.FAILURE,xhr:t}:null,lE=(e,t,i)=>(s,r)=>{var n=r.response,s=l0(s,r);if(s)return i(s,e);if(16!==n.byteLength)return i({status:r.status,message:"Invalid HLS key at URL: "+r.uri,code:l_.FAILURE,xhr:r},e);var s=new DataView(n),a=new Uint32Array([s.getUint32(0),s.getUint32(4),s.getUint32(8),s.getUint32(12)]);for(let o=0;o<t.length;o++)t[o].bytes=a;return i(null,e);},lk=(e,t)=>{var i,s=aO(e.map.bytes);if("mp4"!==s)return t({internal:!0,message:`Found unsupported ${s||"unknown"} container for initialization segment at URL: `+(i=e.map.resolvedUri||e.map.uri),code:l_.FAILURE});lf({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:({tracks:i,data:s})=>
52(e.map.bytes=s,i.forEach(function(t){e.map.tracks=e.map.tracks||{},e.map.tracks[t.type]||"number"==typeof (e.map.tracks[t.type]=t).id&&t.timescale&&(e.map.timescales=e.map.timescales||{},e.map.timescales[t.id]=t.timescale);}),t(null))});},lw=({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:h,dataFn:d,doneFn:u,onTransmuxerLog:c})=>{var p=e.map&&e.map.tracks||{};let m=Boolean(p.audio&&p.video),g=s.bind(null,e,"audio","start"),f=s.bind(null,e,"audio","end"),y=s.bind(null,e,"video","start"),v=s.bind(null,e,"video","end");lf({action:"probeTs",transmuxer:e.transmuxer,data:t,baseStartTime:e.baseStartTime,callback(s){e.bytes=t=s.data,(s=s.result)&&(i(e,{hasAudio:s.hasAudio,hasVideo:s.hasVideo,isMuxed:m}),i=null),lp({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),f&&void 0!==e.end&&f(e.end);},onVideoTimingInfo(e){y&&void 0!==e.start&&(y(e.start),y=null),v&&void 0!==e.end&&v(e.end);},onVideoSegmentTimingInfo(e){r(e);},onAudioSegmentTimingInfo(e){n(e);},onId3(t,i){a(e,t,i);},onCaptions(t){o(e,[t]);},isEndOfTimeline:l,onEndedTimeline(){h();},onTransmuxerLog:c,onDone(t){u&&(t.type="combined"===t.type?"video":t.type,u(null,e,t));}});}});},lC=({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:h,dataFn:d,doneFn:u,onTransmuxerLog:c})=>{let p=new Uint8Array(t);if(0<function e(t,i,s){void 0===s&&(s=!1),i=Array.isArray(r=i)?r.map(a3):[a3(r)],t=rE(t);var r,n=[];if(i.length)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;if((o=a+o)>t.length){if(s)break;o=t.length;}var h=t.subarray(a+8,o);rx(l,i[0])&&(1===i.length?n.push(h):n.push.apply(n,e(h,i.slice(1),s))),a=o;}return n;}(y=p,["moof"]).length){e.isFmp4=!0;let m=e.map.tracks,g={isFmp4:!0,hasVideo:!!m.video,hasAudio:!!m.audio},f=(m.audio&&m.audio.codec&&"enca"!==m.audio.codec&&(g.audioCodec=m.audio.codec),m.video&&m.video.codec&&"encv"!==m.video.codec&&(g.videoCodec=m.video.codec),m.video&&m.audio&&(g.isMuxed=!0),i(e,g),(t,i)=>{d(e,{data:p,type:g.hasAudio&&!g.isMuxed?"audio":"video"}),i&&i.length&&a(e,i),t&&t.length&&o(e,t),u(null,e,{});});lf({action:"probeMp4StartTime",timescales:e.map.timescales,data:p,transmuxer:e.transmuxer,callback({data:i,startTime:r}){t=i.buffer,e.bytes=p=i,g.hasAudio&&!g.isMuxed&&s(e,"audio","start",r),g.hasVideo&&s(e,"video","start",r),lf({action:"probeEmsgID3",data:p,transmuxer:e.transmuxer,offset:r,callback({emsgData:i,id3Frames:s}){t=i.buffer,e.bytes=p=i,m.video&&i.byteLength&&e.transmuxer?lf({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:e.transmuxer,data:p,timescales:e.map.timescales,trackIds:[m.video.id],callback(i){t=i.data.buffer,e.bytes=p=i.data,i.logs.forEach(function(e){c(aQ(e,{stream:"mp4CaptionParser"}));}),f(i.captions,s);}}):f(void 0,s);}});}});}else{var y;e.transmuxer?(void 0===e.container&&(e.container=aO(p)),"ts"!==e.container&&"aac"!==e.container?(i(e,{hasAudio:!1,hasVideo:!1}),u(null,e,{})):lw({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:h,dataFn:d,doneFn:u,onTransmuxerLog:c})):u(null,e,{});}},lx=function({id:e,key:t,encryptedBytes:i,decryptionWorker:s},r){let n=(t)=>{t.data.source===e&&(s.removeEventListener("message",n),t=t.data.decrypted,r(new Uint8Array(t.bytes,t.byteOffset,t.byteLength)));};s.addEventListener("message",n);let a;a=t.bytes.slice?t.bytes.slice():new Uint32Array(Array.prototype.slice.call(t.bytes)),s.postMessage(o5({source:e,encrypted:i,key:a,iv:t.iv}),[i.buffer,a.buffer]);},l2=({decryptionWorker:e,segment:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:h,dataFn:d,doneFn:u,onTransmuxerLog:c})=>{lx({id:t.requestId,key:t.key,encryptedBytes:t.encryptedBytes,decryptionWorker:e},(e)=>{t.bytes=e,lC({segment:t,bytes:t.bytes,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:h,dataFn:d,doneFn:u,onTransmuxerLog:c});});},lI=({xhr:e,xhrOptions:t,decryptionWorker:i,segment:s,abortFn:r,progressFn:n,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:h,id3Fn:d,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:p,dataFn:m,doneFn:g,onTransmuxerLog:f})=>{let y=[];var v,$,i=(({activeXhrs:e,decryptionWorker:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:h,dataFn:d,doneFn:u,onTransmuxerLog:c})=>{let p=0,m=!1;return (g,f)=>{if(!m){if(g)return m=!0,lb(e),u(g,f);if((p+=1)===e.length){let y=function(){if(f.encryptedBytes)return l2({decryptionWorker:t,segment:f,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:h,dataFn:d,doneFn:u,onTransmuxerLog:c});lC({segment:f,bytes:f.bytes,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:h,dataFn:d,doneFn:u,onTransmuxerLog:c});};if(f.endOfAllRequests=Date.now(),f.map&&f.map.encryptedBytes&&!f.map.bytes)return lx({decryptionWorker:t,id:f.requestId+"-init",encryptedBytes:f.map.encryptedBytes,key:f.map.key},(t)=>{f.map.bytes=t,lk(f,(t)=>{if(t)return lb(e),u(t,f);y();});});y();}}};})({activeXhrs:y,decryptionWorker:i,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:h,id3Fn:d,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:p,dataFn:m,doneFn:g,onTransmuxerLog:f}),u=(s.key&&!s.key.bytes&&(a=[s.key],s.map&&!s.map.bytes&&s.map.key&&s.map.key.resolvedUri===s.key.resolvedUri&&a.push(s.map.
52key),o=e(aQ(t,{uri:s.key.resolvedUri,responseType:"arraybuffer"}),lE(s,a,i)),y.push(o)),s.map&&!s.map.bytes&&(!s.map.key||s.key&&s.key.resolvedUri===s.map.key.resolvedUri||(l=e(aQ(t,{uri:s.map.key.resolvedUri,responseType:"arraybuffer"}),lE(s,[s.map.key],i)),y.push(l)),h=aQ(t,{uri:s.map.resolvedUri,responseType:"arraybuffer",headers:oN(s.map)}),{segment:v,finishProcessingFn:$}={segment:s,finishProcessingFn:i},d=e(h,(e,t)=>{var e=l0(e,t);return e?$(e,v):(e=new Uint8Array(t.response),v.map.key?(v.map.encryptedBytes=e,$(null,v)):(v.map.bytes=e,void lk(v,function(e){if(e)return e.xhr=t,e.status=t.status,$(e,v);$(null,v);})));}),y.push(d)),aQ(t,{uri:s.part&&s.part.resolvedUri||s.resolvedUri,responseType:"arraybuffer",headers:oN(s)}));({segment:_,finishProcessingFn:b,responseType:T}={segment:s,finishProcessingFn:i,responseType:u.responseType});var _,b,T,S,E,c=e(u,(e,t)=>{var e=l0(e,t);return e?b(e,_):(e="arraybuffer"!==T&&t.responseText?lt(t.responseText.substring(_.lastReachedChar||0)):t.response,_.stats=lT(t),_.key?_.encryptedBytes=new Uint8Array(e):_.bytes=new Uint8Array(e),b(null,_));});c.addEventListener("progress",({segment:S,progressFn:E}={segment:s,progressFn:n},(e)=>{if(!e.target.aborted)return S.stats=aQ(S.stats,lS(e)),!S.stats.firstBytesReceivedAt&&S.stats.bytesReceived&&(S.stats.firstBytesReceivedAt=Date.now()),E(e,S);})),y.push(c);let k={};return y.forEach((e)=>{var t,i;e.addEventListener("loadend",({loadendState:t,abortFn:i}={loadendState:k,abortFn:r},(e)=>{e.target.aborted&&i&&!t.calledAbortFn&&(i(),t.calledAbortFn=!0);}));}),()=>lb(y);},lL=aY("CodecUtils"),lD=(e,t)=>(t=t.attributes||{},e&&e.mediaGroups&&e.mediaGroups.AUDIO&&t.AUDIO&&e.mediaGroups.AUDIO[t.AUDIO]),lA=function(e){let t={};return e.forEach(({mediaType:e,type:i,details:s})=>{t[e]=t[e]||[],t[e].push(rv(""+i+s));}),Object.keys(t).forEach(function(e){1<t[e].length?(lL(`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):t[e]=t[e][0];}),t;},lP=aY("PlaylistSelector"),l3=function(e){var t;if(e&&e.playlist)return JSON.stringify({id:(t=e.playlist).id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""});},l6=function(e,t){let i=e.slice();e.sort(function(e,s){var r=t(e,s);return 0===r?i.indexOf(e)-i.indexOf(s):r;});};function l1(e,t,i,s,r,n){if(e){var a={bandwidth:t,width:i,height:s,limitRenditionByPlayerDimensions:r};let o=e.playlists,l=(ok.isAudioOnly(e)&&(o=n.getAudioTrackPlaylists_(),a.audioOnly=!0),o.map((e)=>{var 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||window.Number.MAX_VALUE,width:t,height:i,playlist:e};})),h=(l6(l,(e,t)=>e.bandwidth-t.bandwidth),(l=l.filter((e)=>
52!ok.isIncompatible(e.playlist))).filter((e)=>ok.isEnabled(e.playlist))),d=(e=(h=h.length?h:l.filter((e)=>!ok.isDisabled(e.playlist))).filter((e)=>e.bandwidth*oZ.BANDWIDTH_VARIANCE<t))[e.length-1];var u=e.filter((e)=>e.bandwidth===d.bandwidth)[0];if(!1===r){let c=u||h[0]||l[0];if(c&&c.playlist){let p=u?"bandwidthBestRep":"sortedPlaylistReps";return h[0]&&(p="enabledPlaylistReps"),lP(`choosing ${l3(c)} using ${p} with options`,a),c.playlist;}}else{var m,r=e.filter((e)=>e.width&&e.height),e=(l6(r,(e,t)=>e.width-t.width),r.filter((e)=>e.width===i&&e.height===s)),e=(d=e[e.length-1],e.filter((e)=>e.bandwidth===d.bandwidth)[0]);let g,f;e||(d=(m=(g=r.filter((e)=>e.width>i||e.height>s)).filter((e)=>e.width===g[0].width&&e.height===g[0].height))[m.length-1],f=m.filter((e)=>e.bandwidth===d.bandwidth)[0]);let y;n.leastPixelDiffSelector&&(l6(m=r.map((e)=>(e.pixelDiff=Math.abs(e.width-i)+Math.abs(e.height-s),e)),(e,t)=>e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff),y=m[0]);let v=y||f||e||u||h[0]||l[0];if(v&&v.playlist){let $="sortedPlaylistReps";return y?$="leastPixelDiffRep":f?$="resolutionPlusOneRep":e?$="resolutionBestRep":u?$="bandwidthBestRep":h[0]&&($="enabledPlaylistReps"),lP(`choosing ${l3(v)} using ${$} with options`,a),v.playlist;}}return lP("could not choose a playlist with options",a),null;}}function l4(){var e=this.useDevicePixelRatio&&window.devicePixelRatio||1;return l1(this.playlists.main,this.systemBandwidth,parseInt(lv(this.tech_.el(),"width"),10)*e,parseInt(lv(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.playlistController_);}function lO(e,t,i){var s;let r;if(i&&i.cues)for(r=i.cues.length;r--;)(s=i.cues[r]).startTime>=e&&s.endTime<=t&&i.removeCue(s);}let lR=({inbandTextTracks:e,metadataArray:t,timestampOffset:i,videoDuration:s})=>{if(t){let r=window.WebKitDataCue||window.VTTCue,n=e.metadataTrack_;if(n&&(t.forEach((e)=>{let t=e.cueTime+i;!("number"!=typeof t||window.isNaN(t)||t<0)&&t<1/0&&e.frames&&e.frames.length&&e.frames.forEach((e)=>{var i,s=new r(t,t,e.value||e.url||e.data||"");s.frame=e,s.value=e,Object.defineProperties((i=s).frame,{id:{get:()=>(ri.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),i.value.key)},value:{get:()=>(ri.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),i.value.data)},privateData:{get:()=>(ri.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),i.value.data)}}),n.addCue(s);});}),n.cues)&&n.cues.length){var a=n.cues,o=[];for(let l=0;l<a.length;l++)a[l]&&o.push(a[l]);let h=o.reduce((e,t)=>{var i=e[t.startTime]||[];return i.push(t),e[t.startTime]=i,e;},{}),d=Object.keys(h).sort((e,t)=>Number(e)-Number(t));d.forEach((e,t)=>{var e=h[e],i=isFinite(s)?s:0;let r=Number(d[t+1])||i;e.forEach((e)=>{e.endTime=r;});});}}},lN={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"},lM=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),lU=(e,t,i)=>{e.metadataTrack_||(e.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,ri.browser.IS_ANY_SAFARI)||(e.metadataTrack_.inBandMetadataTrackDispatchType=t);},l5=(e)=>"number"==typeof e&&isFinite(e),lB=(e)=>{var {startOfSegment:t,duration:i,segment:s,part:r,playlist:{mediaSequence:n,id:a,segments:o=[]},mediaIndex:l,partIndex:h,timeline:d}=e,o=o.length-1;let u="mediaIndex/partIndex increment";e.getMediaInfoForTime?u=`getMediaInfoForTime (${e.getMediaInfoForTime})`:e.isSyncRequest&&(u="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(u+=" with independent "+e.independent);var c="number"==typeof h,e=e.segment.uri?"segment":"pre-segment",p=c?op({preloadSegment:s})-1:0;return e+` [${n+l}/${n+o}]`+(c?` part [${h}/${p}]`:"")+` segment start/end [${s.start} => ${s.end}]`+(c?` part start/end [${r.start} => ${r.end}]`:"")+` startOfSegment [${t}]`+` duration [${i}]`+` timeline [${d}]`+` selected by [${u}]`+` playlist [${a}]`;},l7=(e)=>e+"TimingInfo",lF=(e,t)=>e.length?e.end(e.length-1):t,lq=({timelineChangeController:e,currentTimeline:t,segmentTimeline:i,loaderType:s,audioDisabled:r})=>!(t===i||("audio"===s?(t=e.lastTimelineChange({type:"main"}))&&t.to===i:"main"!==s||!r||(t=e.pendingTimelineChange({type:"audio"}))&&t.to===i)),lj=({segmentDuration:e,maxDuration:t})=>!!e&&Math.round(e)>t+on,lH=(e,t)=>{var i,s,r,n;let a;return "hls"===t&&(t=(n={audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo},a=0,["video","audio"].forEach(function(e){if(e=n[e+"TimingInfo"]){var {start:e,end:t}=e;let i;"bigint"==typeof e||"bigint"==typeof t?i=window.BigInt(t)-window.BigInt(e):"number"==typeof e&&"number"==typeof t&&(i=t-e),void 0!==i&&i>a&&(a=i);}}
52),a="bigint"==typeof a&&a<Number.MAX_SAFE_INTEGER?Number(a):a))&&(s=lj({segmentDuration:t,maxDuration:2*(i=e.playlist.targetDuration)}),r=lj({segmentDuration:t,maxDuration:i}),t=`Segment with index ${e.mediaIndex} from playlist ${e.playlist.id} has a duration of ${t} when the reported duration is ${e.duration} and the target duration is ${i}. 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`,s||r)?{severity:s?"warn":"info",message:t}:null;};class lV extends ri.EventTarget{constructor(e,t=0){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.calculateTimestampOffsetForEachSegment_=e.calculateTimestampOffsetForEachSegment,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1);}),this.fetchAtBuffer_=!1,this.replaceSegmentsUntil_=-1,this.logger_=aY(`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_();}),"main"===this.loaderType_&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_();}),"audio"===this.loaderType_&&this.timelineChangeController_.on("timelinechange",()=>{this.hasEnoughInfoToLoad_()&&this.processLoadQueue_(),this.hasEnoughInfoToAppend_()&&this.processCallQueue_();});}createTransmuxer_(){return lg({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_});}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0;}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&window.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(){"WAITING"!==this.state?this.pendingSegment_&&(this.pendingSegment_=null):(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,window.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null;}checkForAbort_(e){return "APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e
52:(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_&&lm(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended");}buffered_(){var e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return aJ();if("main"===this.loaderType_){var {hasAudio:e,hasVideo:t,isMuxed:i}=e;if(t&&e&&!this.audioDisabled_&&!i)return this.sourceUpdater_.buffered();if(t)return this.sourceUpdater_.videoBuffered();}return this.sourceUpdater_.audioBuffered();}initSegmentForMap(e,t=!1){if(!e)return null;var i=oB(e);let s=this.initSegments_[i];return t&&!s&&e.bytes&&(this.initSegments_[i]=s={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),s||e;}segmentKey(e,t=!1){if(!e)return null;var i=o7(e);let s=this.keyCache_[i];return this.cacheEncryptionKeys_&&t&&!s&&e.bytes&&(this.keyCache_[i]=s={resolvedUri:e.resolvedUri,bytes:e.bytes}),t={resolvedUri:(s||e).resolvedUri},s&&(t.bytes=s.bytes),t;}couldBeginLoading_(){return this.playlist_&&!this.paused();}load(){if(this.monitorBuffer_(),this.playlist_)return "INIT"===this.state&&this.couldBeginLoading_()?this.init_():void (this.couldBeginLoading_()&&("READY"===this.state||"INIT"===this.state)&&(this.state="READY"));}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_();}playlist(e,t={}){if(e){var i,s=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(s&&(s.id?n=s.id:s.uri&&(n=s.uri)),this.logger_(`playlist update [${n} => ${e.id||e.uri}]`),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();s&&s.uri===e.uri?(t=e.mediaSequence-s.mediaSequence,this.logger_(`live window shift [${t}]`),null!==this.mediaIndex&&(this.mediaIndex-=t,this.mediaIndex<0?(this.mediaIndex=null,this.partIndex=null):(i=this.playlist_.segments[this.mediaIndex],!this.partIndex||i.parts&&i.parts.length&&i.parts[this.partIndex]||(i=this.mediaIndex,this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=i))),r&&(r.mediaIndex-=t,r.mediaIndex<0?(r.mediaIndex=null,r.partIndex=null):(0<=r.mediaIndex&&(r.segment=e.segments[r.mediaIndex]),0<=r.partIndex&&r.segment.parts&&(r.part=r.segment.parts[r.partIndex]))),this.syncController_.saveExpiredSegmentInfo(s,e)):(null!==this.mediaIndex&&(e.endList||"number"!=typeof e.partTargetDuration?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate"));}}pause(){this.checkBufferTimeout_&&(window.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null);}paused(){return null===this.checkBufferTimeout_;}resetLoaderProperties(){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0};}resetEverything(e){this.resetLoaderProperties(),this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}));}resetLoader(){this.fetchAtBuffer_=!1,this.resyncLoader();}resyncLoader(){this.transmuxer_&&lm(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"});}remove(e,t,i=()=>{},s=!1){if((t=t===1/0?this.duration_():t)<=e)this.logger_("skipping remove because end ${end} is <= start ${start}");else if(this.sourceUpdater_&&this.getMediaInfo_()){let r=1;var n=()=>{0==--r&&i();};for(let a in !s&&this.audioDisabled_||(r++,this.sourceUpdater_.removeAudio(e,t,n)),(s||"main"===this.loaderType_)&&(this.gopBuffer_=((e,t,i,s)=>{var r=Math.ceil((t-s)*9e4),n=Math.ceil((i-s)*9e4),t=e.slice();let a=e.length;for(;a--&&!(e[a].pts<=n););if(-1!==a){let o=a+1;for(;o--&&!(e[o].pts<=r););o=Math.max(o,0),t.splice(o,a-o+1);}return t;})(this.gopBuffer_,e,t,this.timeMapping_),r++,this.sourceUpdater_.removeVideo(e,t,n)),this.inbandTextTracks_)lO(e,t,this.inbandTextTracks_[a]);lO(e,t,this.segmentMetadataTrack_),n();}else this.logger_("skipping remove because no source updater or starting media info");}monitorBuffer_(){this.checkBufferTimeout_&&window.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=window.setTimeout(this.monitorBufferTick_.bind(this),1);}monitorBufferTick_(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&window.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=window.setTimeout(this.monitorBufferTick_.bind(this),500);}fillBuffer_(){var e;
52this.sourceUpdater_.updating()||(e=this.chooseNextRequest_())&&("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){var s;return !(!t||!this.mediaSource_)&&(s="number"==typeof e&&t.segments[e],e=e+1===t.segments.length,i=!s||!s.parts||i+1===s.parts.length,t.endList)&&"open"===this.mediaSource_.readyState&&e&&i;}chooseNextRequest_(){var e=this.buffered_(),t=ot(e)||0,e=oi(e,this.currentTime_()),i=!this.hasPlayed_()&&1<=e,s=e>=this.goalBufferLength_(),r=this.playlist_.segments;if(!r.length||i||s)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_()),(i={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)}).isSyncRequest?i.mediaIndex=function(e,t,i){t=t||[];var s=[];let r=0;for(let n=0;n<t.length;n++){var a=t[n];if(e===a.timeline&&(s.push(n),(r+=a.duration)>i))return n;}return 0===s.length?0:s[s.length-1];}(this.currentTimeline_,r,t):null!==this.mediaIndex?(s=r[this.mediaIndex],a="number"==typeof this.partIndex?this.partIndex:-1,i.startOfSegment=s.end||t,s.parts&&s.parts[a+1]?(i.mediaIndex=this.mediaIndex,i.partIndex=a+1):i.mediaIndex=this.mediaIndex+1):({segmentIndex:s,startTime:a,partIndex:o}=ok.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?t:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),i.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+t:"currentTime "+this.currentTime_(),i.mediaIndex=s,i.startOfSegment=a,i.partIndex=o);let n=(t=r[i.mediaIndex])&&"number"==typeof i.partIndex&&t.parts&&t.parts[i.partIndex];if(!t||"number"==typeof i.partIndex&&!n)return null;"number"!=typeof i.partIndex&&t.parts&&(i.partIndex=0,n=t.parts[0]);var a,o,s=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments,e=(e||!n||s||n.independent||(0===i.partIndex?(o=(a=r[i.mediaIndex-1]).parts&&a.parts.length&&a.parts[a.parts.length-1])&&o.independent&&(--i.mediaIndex,i.partIndex=a.parts.length-1,i.independent="previous segment"):t.parts[i.partIndex-1].independent&&(--i.partIndex,i.independent="previous part")),this.mediaSource_&&"ended"===this.mediaSource_.readyState);return i.mediaIndex>=r.length-1&&e&&!this.seeking_()?null:this.generateSegmentInfo_(i);}generateSegmentInfo_(e){var {independent:e,playlist:t,mediaIndex:i,startOfSegment:s,isSyncRequest:r,partIndex:n,forceTimestampOffset:a,getMediaInfoForTime:o}=e,l=t.segments[i],h="number"==typeof n&&l.parts[n],i={requestId:"segment-loader-"+Math.random(),uri:h&&h.resolvedUri||l.resolvedUri,mediaIndex:i,partIndex:h?n:null,isSyncRequest:r,startOfSegment:s,playlist:t,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:l.timeline,duration:h&&h.duration||l.duration,segment:l,part:h,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:o,independent:e},n=void 0!==a?a:this.isPendingTimestampOffset_,r=(i.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:l.timeline,currentTimeline:this.currentTimeline_,startOfSegment:s,buffered:this.buffered_(),calculateTimestampOffsetForEachSegment:this.calculateTimestampOffsetForEachSegment_,overrideCheck:n}),ot(this.sourceUpdater_.audioBuffered()));return "number"==typeof r&&(i.audioAppendStart=r-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(i.gopsToAlignWith=((e,t,i)=>{if(null==t||!e.length)return [];var s=Math.ceil((t-i+3)*9e4);let r;for(r=0;r<e.length&&!(e[r].pts>s);r++);return e.slice(r);})(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),i;}timestampOffsetForSegment_(e){var t,i,s,r,n;return {segmentTimeline:e,currentTimeline:t,startOfSegment:i,buffered:s,calculateTimestampOffsetForEachSegment:r,overrideCheck:n}=e,r?lF(s,i):n||e!==t?e<t?i:lF(s,i):null;}earlyAbortWhenNeeded_(e){if(!this.vhs_.tech_.paused()&&this.xhrOptions_.timeout&&this.playlist_.attributes.BANDWIDTH&&!(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)){var t=this.currentTime_(),i=e.bandwidth,s=this.pendingSegment_.duration,e=ok.estimateSegmentRequestTime(s,i,this.playlist_,e.bytesReceived),r=([r,n,a=1]=[this.buffered_(),t,this.vhs_.tech_.playbackRate()],((r.length?r.end(r.length-1):0)-n)/a-1);if(!(e<=r)){var n=function(e){let {main:t,currentTime:i,bandwidth:s,duration:r,segmentDuration:n,timeUntilRebuffer:a,currentTimeline:o,syncController:l}=e,h=(e=t.playlists.filter((e)=>
52!ok.isIncompatible(e))).filter(ok.isEnabled);var e=(h=h.length?h:e.filter((e)=>!ok.isDisabled(e))).filter(ok.hasAttribute.bind(null,"BANDWIDTH")).map((e)=>{var t=l.getSyncPoint(e,r,o,i)?1:2;return {playlist:e,rebufferingImpact:ok.estimateSegmentRequestTime(n,s,e)*t-a};}),d=e.filter((e)=>e.rebufferingImpact<=0);return l6(d,(e,t)=>l$(t.playlist,e.playlist)),d.length?d[0]:(l6(e,(e,t)=>e.rebufferingImpact-t.rebufferingImpact),e[0]||null);}({main:this.vhs_.playlists.main,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:s,timeUntilRebuffer:r,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(n){var a=e-r-n.rebufferingImpact;let o=.5;r<=on&&(o=1),!n.playlist||n.playlist.uri===this.playlist_.uri||a<o||(this.bandwidth=n.playlist.attributes.BANDWIDTH*oZ.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"));}}}}handleAbort_(e){this.logger_("Aborting "+lB(e)),this.mediaRequestsAborted+=1;}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),this.checkForAbort_(t.requestId)||this.trigger("progress");}handleTrackInfo_(e,t){this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||this.checkForIllegalMediaSwitch(t)||(function(e,t){if(!e&&!t||!e&&t||e&&!t)return !1;if(e!==t){var i=Object.keys(e).sort(),s=Object.keys(t).sort();if(i.length!==s.length)return !1;for(let r=0;r<i.length;r++){var n=i[r];if(n!==s[r]||e[n]!==t[n])return !1;}}return !0;}(this.currentMediaInfo_,t=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_());}handleTimingInfo_(e,t,i,s){var r;this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||((e=this.pendingSegment_)[r=l7(t)]=e[r]||{},e[r][i]=s,this.logger_(`timinginfo: ${t} - ${i} - `+s),this.hasEnoughInfoToAppend_()&&this.processCallQueue_());}handleCaptions_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId))if(0===t.length)this.logger_("SegmentLoader received no captions from a caption event");else if(this.pendingSegment_.hasAppendedData_){let i=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),s={};t.forEach((e)=>{s[e.stream]=s[e.stream]||{startTime:1/0,captions:[],endTime:0};var t=s[e.stream];t.startTime=Math.min(t.startTime,e.startTime+i),t.endTime=Math.max(t.endTime,e.endTime+i),t.captions.push(e);}),Object.keys(s).forEach((e)=>{var {startTime:t,endTime:r,captions:n}=s[e],a=this.inbandTextTracks_,o=(this.logger_(`adding cues from ${t} -> ${r} for `+e),a),l=this.vhs_.tech_,h=e;if(!o[h]){l.trigger({type:"usage",name:"vhs-608"});let d=h;/^cc708_/.test(h)&&(d="SERVICE"+h.split("_")[1]);var u=l.textTracks().getTrackById(d);if(u)o[h]=u;else{let c=h,p=h,m=!1;(u=(l.options_.vhs&&l.options_.vhs.captionServices||{})[d])&&(c=u.label,p=u.language,m=u.default),o[h]=l.addRemoteTextTrack({kind:"captions",id:d,default:m,label:c,language:p},!1).track;}}lO(t,r,a[e]);var {inbandTextTracks:g,captionArray:u,timestampOffset:f}={captionArray:n,inbandTextTracks:a,timestampOffset:i};if(u){let y=window.WebKitDataCue||window.VTTCue;u.forEach((e)=>{let t=e.stream;e.content?e.content.forEach((i)=>{var s=new y(e.startTime+f,e.endTime+f,i.text);s.line=i.line,s.align="left",s.position=i.position,s.positionAlign="line-left",g[t].addCue(s);}):g[t].addCue(new y(e.startTime+f,e.endTime+f,e.text));});}}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"});}else this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));}handleId3_(e,t,i){this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||(this.pendingSegment_.hasAppendedData_?this.addMetadataToTextTrack(i,t,this.duration_()):this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i)));}processMetadataQueue_(){this.metadataQueue_.id3.forEach((e)=>e()),this.metadataQueue_.caption.forEach((e)=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[];}processCallQueue_(){var e=this.callQueue_;this.callQueue_=[],e.forEach((e)=>e());}processLoadQueue_(){var e=this.loadQueue_;this.loadQueue_=[],e.forEach((e)=>e());}hasEnoughInfoToLoad_(){var e;return "audio"!==this.loaderType_||!(!(e=this.pendingSegment_)||this.getCurrentMediaInfo_()&&lq({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_(){var e,t,i,s;
52return !!this.sourceUpdater_.ready()&&!(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_||(e=this.pendingSegment_,t=this.getCurrentMediaInfo_(),!e)||!t||({hasAudio:t,hasVideo:i,isMuxed:s}=t,i&&!e.videoTimingInfo)||t&&!this.audioDisabled_&&!s&&!e.audioTimingInfo||lq({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))if(this.callQueue_.length||!this.hasEnoughInfoToAppend_())this.callQueue_.push(this.handleData_.bind(this,e,t));else{var 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[l7(t.type)].start;else{e=this.getCurrentMediaInfo_();let s;(e="main"===this.loaderType_&&e&&e.hasVideo)&&(s=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:e,firstVideoFrameTimeForData:s,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo});}if(this.updateAppendInitSegmentStatus(i,t.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){if(this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:"main"===this.loaderType_}),(e=this.chooseNextRequest_()).mediaIndex!==i.mediaIndex||e.partIndex!==i.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending");}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,t);}}}updateAppendInitSegmentStatus(e,t){"main"!==this.loaderType_||"number"!=typeof e.timestampOffset||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0);}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:i,playlist:s}){if(i){var r=oB(i);if(this.activeInitSegmentId_===r)return null;t=this.initSegmentForMap(i,!0).bytes,this.activeInitSegmentId_=r;}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=s,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null;}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i},s){var r=this.sourceUpdater_.audioBuffered(),n=this.sourceUpdater_.videoBuffered(),a=(1<r.length&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+oh(r).join(", ")),1<n.length&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+oh(n).join(", ")),r.length?r.start(0):0),o=r.length?r.end(r.length-1):0,l=n.length?n.start(0):0,h=n.length?n.end(n.length-1):0;o-a<=1&&h-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: ${oh(r).join(", ")}, video buffer: ${oh(n).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error")):(this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:i})),o=this.currentTime_()-1,this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+o),this.remove(0,o,()=>{this.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=window.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_();},1e3);},!0));}handleAppendError_({segmentInfo:e,type:t,bytes:i},s){s&&(22===s.code?this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i}):(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",s),this.error(`${t} append of ${i.length}b failed for segment #${e.mediaIndex} in playlist `+e.playlist.id),this.trigger("appenderror")));}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:i,data:s,bytes:r}){if(!r){var n,a=[s];let o=s.byteLength,l,h;i&&(a.unshift(i),o+=i.byteLength),r=(l=0,(n={bytes:o,segments:a}
52).bytes&&(h=new Uint8Array(n.bytes),n.segments.forEach((e)=>{h.set(e,l),l+=e.byteLength;})),h);}this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:r},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:r}));}handleSegmentTimingInfo_(e,t,i){this.pendingSegment_&&t===this.pendingSegment_.requestId&&((t=this.pendingSegment_.segment)[e+="TimingInfo"]||(t[e]={}),t[e].transmuxerPrependedSeconds=i.prependedContentDuration||0,t[e].transmuxedPresentationStart=i.start.presentation,t[e].transmuxedDecodeStart=i.start.decode,t[e].transmuxedPresentationEnd=i.end.presentation,t[e].transmuxedDecodeEnd=i.end.decode,t[e].baseMediaDecodeTime=i.baseMediaDecodeTime);}appendData_(e,t){var {type:i,data:s}=t;s&&s.byteLength&&("audio"===i&&this.audioDisabled_||(t=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null}),this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:t,data:s})));}loadSegment_(e){this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(e):this.loadQueue_.push(()=>{var t=tR({},e,{forceTimestampOffset:!0});tR(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,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}));var t=this.createSimplifiedSegmentObj_(e),i=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),s=null!==this.mediaIndex,r=e.timeline!==this.currentTimeline_&&0<e.timeline,i=i||s&&r;this.logger_("Requesting "+lB(e)),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=lI({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,endedTimelineFn:()=>{this.logger_("received endedtimeline callback");},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:t,level:i,stream:s})=>{this.logger_(lB(e)+` logged from transmuxer stream ${s} as a ${i}: `+t);}});}trimBackBuffer_(e){let t;var i,s,r,n=(i=this.seekable_(),s=this.currentTime_(),r=this.playlist_.targetDuration||10,t=s-oZ.BACK_BUFFER_LENGTH,i.length&&(t=Math.max(t,i.start(0))),Math.min(s-r,t));0<n&&this.remove(0,n);}createSimplifiedSegmentObj_(e){var t=e.segment,i=e.part,i={resolvedUri:(i||t).resolvedUri,byterange:(i||t).byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},s=e.playlist.segments[e.mediaIndex-1];return s&&s.timeline===t.timeline&&(s.videoTimingInfo?i.baseStartTime=s.videoTimingInfo.transmuxedDecodeEnd:s.audioTimingInfo&&(i.baseStartTime=s.audioTimingInfo.transmuxedDecodeEnd)),t.key&&(s=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]),i.key=this.segmentKey(t.key),i.key.iv=s),t.map&&(i.map=this.initSegmentForMap(t.map)),i;}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime);}saveBandwidthRelatedStats_(e,t){this.pendingSegment_.byteLength=t.bytesReceived,e<1/60?this.logger_("Ignoring segment's bandwidth because its duration of "+e+" is less than the min to record "+1/60):(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)this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,i));else{if(this.saveTransferStats_(t.stats),this.pendingSegment_&&t.requestId===this.pendingSegment_.requestId){if
52(e)return this.pendingSegment_=null,this.state="READY",e.code===l_.ABORTED?void 0:(this.pause(),e.code===l_.TIMEOUT?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error")));e=this.pendingSegment_,this.saveBandwidthRelatedStats_(e.duration,t.stats),e.endOfAllRequests=t.endOfAllRequests,i.gopInfo&&(this.gopBuffer_=((e,t,i)=>{if(!t.length)return e;if(i)return t.slice();var s=t[0].pts;let r=0;for(;r<e.length&&!(e[r].pts>=s);r++);return e.slice(0,r).concat(t);})(this.gopBuffer_,i.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(e);}}}setTimeMapping_(e){null!==(e=this.syncController_.mappingForTimeline(e))&&(this.timeMapping_=e);}updateMediaSecondsLoaded_(e){"number"==typeof e.start&&"number"==typeof e.end?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration;}shouldUpdateTransmuxerTimestampOffset_(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset());}trueSegmentStart_({currentStart:e,playlist:t,mediaIndex:i,firstVideoFrameTimeForData:s,currentVideoTimestampOffset:r,useVideoTimingInfo:n,videoTimingInfo:a,audioTimingInfo:o}){return void 0!==e?e:n?(e=t.segments[i-1],0!==i&&e&&void 0!==e.start&&e.end===s+r?a.start:s):o.start;}waitForAppendsToComplete_(e){var t,i,s=this.getCurrentMediaInfo_(e);s?({hasAudio:s,hasVideo:i,isMuxed:t}=s,i="main"===this.loaderType_&&i,s=!this.audioDisabled_&&s&&!t,e.waitingOnAppends=0,e.hasAppendedData_?(i&&e.waitingOnAppends++,s&&e.waitingOnAppends++,i&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),s&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))):(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))):(this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),this.trigger("error"));}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,0===e.waitingOnAppends&&this.handleAppendsDone_());}checkForIllegalMediaSwitch(e){i=this.loaderType_,t=this.getCurrentMediaInfo_();var t,i="main"===i&&t&&e?e.hasAudio||e.hasVideo?t.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.":!t.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 !!i&&(this.error({message:i,playlistExclusionDuration:1/0}),this.trigger("error"),!0);}updateSourceBufferTimestampOffset_(e){if(null!==e.timestampOffset&&"number"==typeof e.timingInfo.start&&!e.changedTimestampOffset&&"main"===this.loaderType_){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||{};var t=this.getMediaInfo_(),t="main"===this.loaderType_&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;t&&(e.timingInfo.end="number"==typeof t.end?t.end:t.start+e.duration);}handleAppendsDone_(){var e,t,i;this.pendingSegment_&&this.trigger("appendsdone"),this.pendingSegment_?(e=this.pendingSegment_,this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_}),(t=lH(e,this.sourceType_))&&("warn"===t.severity?ri.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_)?this.logger_("Throwing away un-appended sync request "+lB(e)):(this.logger_("Appended "+lB(e)),this.addSegmentMetadataCue_(e),this.currentTime_()>=this.replaceSegmentsUntil_&&(this.replaceSegmentsUntil_=-1,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"),t=e.segment,i=e.part,t
52=t.end&&this.currentTime_()-t.end>3*e.playlist.targetDuration,i=i&&i.end&&this.currentTime_()-i.end>3*e.playlist.partTargetDuration,t||i?(this.logger_(`bad ${t?"segment":"part"} `+lB(e)),this.resetEverything()):(null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()))):(this.state="READY",this.paused()||this.monitorBuffer_());}recordThroughput_(e){var t,i;e.duration<1/60?this.logger_("Ignoring segment's throughput because its duration of "+e.duration+" is less than the min to record "+1/60):(t=this.throughput.rate,i=Date.now()-e.endOfAllRequests+1,e=Math.floor(e.byteLength/i*8e3),this.throughput.rate+=(e-t)/++this.throughput.count);}addSegmentMetadataCue_(e){var t,i,s,r;this.segmentMetadataTrack_&&(t=(r=e.segment).start,i=r.end,l5(t))&&l5(i)&&(lO(t,i,this.segmentMetadataTrack_),s=window.WebKitDataCue||window.VTTCue,r={custom:r.custom,dateTimeObject:r.dateTimeObject,dateTimeString:r.dateTimeString,programDateTime:r.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:t,end:i},(e=new s(t,i,JSON.stringify(r))).value=r,this.segmentMetadataTrack_.addCue(e));}set replaceSegmentsUntil(e){this.logger_("Replacing currently buffered segments until "+e),this.replaceSegmentsUntil_=e;}}function l9(){}function lz(e){return "string"!=typeof e?e:e.replace(/./,(e)=>e.toUpperCase());}let lW=["video","audio"],lG=(e,t)=>{var i=t[e+"Buffer"];return i&&i.updating||t.queuePending[e];},lX=(e,t)=>{if(0!==t.queue.length){let i=0,s=t.queue[i];if("mediaSource"===s.type)t.updating()||"closed"===t.mediaSource.readyState||(t.queue.shift(),s.action(t),s.doneFn&&s.doneFn(),lX("audio",t),lX("video",t));else{if("mediaSource"!==e&&t.ready()&&"closed"!==t.mediaSource.readyState&&!lG(e,t)){if(s.type!==e){if(null===(i=((e,t)=>{for(let i=0;i<t.length;i++){var s=t[i];if("mediaSource"===s.type)break;if(s.type===e)return i;}return null;})(e,t.queue)))return;s=t.queue[i];}t.queue.splice(i,1),(t.queuePending[e]=s).action(e,t),s.doneFn||(t.queuePending[e]=null,lX(e,t));}}}},lK=(e,t)=>{var i=t[e+"Buffer"],s=lz(e);i&&(i.removeEventListener("updateend",t[`on${s}UpdateEnd_`]),i.removeEventListener("error",t[`on${s}Error_`]),t.codecs[e]=null,t[e+"Buffer"]=null);},lY=(e,t)=>e&&t&&-1!==Array.prototype.indexOf.call(e.sourceBuffers,t),lQ={appendBuffer:(e,t,i)=>(s,r)=>{var n=r[s+"Buffer"];if(lY(r.mediaSource,n)){r.logger_(`Appending segment ${t.mediaIndex}'s ${e.length} bytes to ${s}Buffer`);try{n.appendBuffer(e);}catch(a){r.logger_(`Error with code ${a.code} `+(22===a.code?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${t.mediaIndex} to ${s}Buffer`),r.queuePending[s]=null,i(a);}}},remove:(e,t)=>(i,s)=>{var r=s[i+"Buffer"];if(lY(s.mediaSource,r)){s.logger_(`Removing ${e} to ${t} from ${i}Buffer`);try{r.remove(e,t);}catch(n){s.logger_(`Remove ${e} to ${t} from ${i}Buffer failed`);}}},timestampOffset:(e)=>(t,i)=>{var s=i[t+"Buffer"];lY(i.mediaSource,s)&&(i.logger_(`Setting ${t}timestampOffset to `+e),s.timestampOffset=e);},callback:(e)=>(t,i)=>{e();},endOfStream:(e)=>(t)=>{if("open"===t.mediaSource.readyState){t.logger_(`Calling mediaSource endOfStream(${e||""})`);try{t.mediaSource.endOfStream(e);}catch(i){ri.log.warn("Failed to call media source endOfStream",i);}}},duration:(e)=>(t)=>{t.logger_("Setting mediaSource duration to "+e);try{t.mediaSource.duration=e;}catch(i){ri.log.warn("Failed to set media source duration",i);}},abort:()=>(e,t)=>{if("open"===t.mediaSource.readyState){var i=t[e+"Buffer"];if(lY(t.mediaSource,i)){t.logger_(`calling abort on ${e}Buffer`);try{i.abort();}catch(s){ri.log.warn(`Failed to abort on ${e}Buffer`,s);}}}},addSourceBuffer:(e,t)=>(i)=>{var s=lz(e),r=r_(t),r=(i.logger_(`Adding ${e}Buffer with codec ${t} to mediaSource`),i.mediaSource.addSourceBuffer(r));r.addEventListener("updateend",i[`on${s}UpdateEnd_`]),r.addEventListener("error",i[`on${s}Error_`]),i.codecs[e]=t,i[e+"Buffer"]=r;},removeSourceBuffer:(e)=>(t)=>{var i=t[e+"Buffer"];
52if(lK(e,t),lY(t.mediaSource,i)){t.logger_(`Removing ${e}Buffer with codec ${t.codecs[e]} from mediaSource`);try{t.mediaSource.removeSourceBuffer(i);}catch(s){ri.log.warn(`Failed to removeSourceBuffer ${e}Buffer`,s);}}},changeType:(e)=>(t,i)=>{var s=i[t+"Buffer"],r=r_(e);lY(i.mediaSource,s)&&i.codecs[t]!==e&&(i.logger_(`changing ${t}Buffer codec from ${i.codecs[t]} to `+e),s.changeType(r),i.codecs[t]=e);}},lJ=({type:e,sourceUpdater:t,action:i,doneFn:s,name:r})=>{t.queue.push({type:e,action:i,doneFn:s,name:r}),lX(e,t);},lZ=(e,t)=>(i)=>{var s=function(e){let t="";for(let i=0;i<e.length;i++){var s=e.start(i),r=e.end(i);t.length&&(t+="\n"),t+=`[${r-s}](${s} -> ${r})`;}return t||"empty";}(t[e+"Buffered"]());t.logger_(e+` source buffer update end. Buffered:
53`,s),t.queuePending[e]&&(s=t.queuePending[e].doneFn,t.queuePending[e]=null,s)&&s(t[e+"Error_"]),lX(e,t);};class he extends ri.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>lX("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=aY("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=lZ("video",this),this.onAudioUpdateEnd_=lZ("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());}
53triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"));}addSourceBuffer(e,t){lJ({type:"mediaSource",sourceUpdater:this,action:lQ.addSourceBuffer(e,t),name:"addSourceBuffer"});}abort(e){lJ({type:e,sourceUpdater:this,action:lQ.abort(e),name:"abort"});}removeSourceBuffer(e){this.canRemoveSourceBuffer()?lJ({type:"mediaSource",sourceUpdater:this,action:lQ.removeSourceBuffer(e),name:"removeSourceBuffer"}):ri.log.error("removeSourceBuffer is not supported!");}canRemoveSourceBuffer(){return !ri.browser.IS_FIREFOX&&window.MediaSource&&window.MediaSource.prototype&&"function"==typeof window.MediaSource.prototype.removeSourceBuffer;}static canChangeType(){return window.SourceBuffer&&window.SourceBuffer.prototype&&"function"==typeof window.SourceBuffer.prototype.changeType;}canChangeType(){return this.constructor.canChangeType();}changeType(e,t){this.canChangeType()?lJ({type:e,sourceUpdater:this,action:lQ.changeType(t),name:"changeType"}):ri.log.error("changeType is not supported!");}addOrChangeSourceBuffers(e){if(!e||"object"!=typeof e||0===Object.keys(e).length)throw Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach((t)=>{var i=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,i);this.canChangeType()&&this.changeType(t,i);});}appendBuffer(e,t){var {segmentInfo:i,type:s,bytes:r}=e;this.processedAppend_=!0,"audio"===s&&this.videoBuffer&&!this.videoAppendQueued_?(this.delayedAudioAppendQueue_.push([e,t]),this.logger_(`delayed audio append of ${r.length} until video append`)):(e=t,lJ({type:s,sourceUpdater:this,action:lQ.appendBuffer(r,i||{mediaIndex:-1},e),doneFn:t,name:"appendBuffer"}),"video"===s&&(this.videoAppendQueued_=!0,this.delayedAudioAppendQueue_.length)&&(r=this.delayedAudioAppendQueue_.slice(),this.logger_(`queuing delayed audio ${r.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,r.forEach((e)=>{this.appendBuffer.apply(this,e);})));}audioBuffered(){return lY(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered||aJ();}videoBuffered(){return lY(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered||aJ();}buffered(){var e=lY(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=lY(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;if(t&&!e)return this.audioBuffered();if(e&&!t)return this.videoBuffered();var i=this.audioBuffered(),s=this.videoBuffered();let r=null,n=null,a=0;var o=[],l=[];if(!(i&&i.length&&s&&s.length))return aJ();let h=i.length;for(;h--;)o.push({time:i.start(h),type:"start"}),o.push({time:i.end(h),type:"end"});for(h=s.length;h--;)o.push({time:s.start(h),type:"start"}),o.push({time:s.end(h),type:"end"});for(o.sort(function(e,t){return e.time-t.time;}),h=0;h<o.length;h++)"start"===o[h].type?2==++a&&(r=o[h].time):"end"===o[h].type&&1==--a&&(n=o[h].time),null!==r&&null!==n&&(l.push([r,n]),r=null,n=null);return aJ(l);;}setDuration(e,t=l9){lJ({type:"mediaSource",sourceUpdater:this,action:lQ.duration(e),name:"duration",doneFn:t});}endOfStream(e=null,t=l9){"string"!=typeof e&&(e=void 0),lJ({type:"mediaSource",sourceUpdater:this,action:lQ.endOfStream(e),name:"endOfStream",doneFn:t});}removeAudio(e,t,i=l9){this.audioBuffered().length&&0!==this.audioBuffered().end(0)?lJ({type:"audio",sourceUpdater:this,action:lQ.remove(e,t),doneFn:i,name:"remove"}):i();}removeVideo(e,t,i=l9){this.videoBuffered().length&&0!==this.videoBuffered().end(0)?lJ({type:"video",sourceUpdater:this,action:lQ.remove(e,t),doneFn:i,name:"remove"}):i();}updating(){return !(!lG("audio",this)&&!lG("video",this));}audioTimestampOffset(e){return void 0!==e&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(lJ({type:"audio",sourceUpdater:this,action:lQ.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_;}videoTimestampOffset(e){return void 0!==e&&this.videoBuffer&&this.videoTimestampOffset!==e&&(lJ({type:"video",sourceUpdater:this,action:lQ.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_;}audioQueueCallback(e){this.audioBuffer&&lJ({type:"audio",sourceUpdater:this,action:lQ.callback(e),name:"callback"});}videoQueueCallback(e){this.videoBuffer&&lJ({type:"video",sourceUpdater:this,action:lQ.callback(e),name:"callback"});}dispose(){this.trigger("dispose"),lW.forEach((e)=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[e+"QueueCallback"](()=>lK(e,this));}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off();}}let ht=(e)=>
53decodeURIComponent(escape(String.fromCharCode.apply(null,e))),hi=new Uint8Array("\n\n".split("").map((e)=>e.charCodeAt(0)));class hs extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.");}}let hr=[{name:"VOD",run:(e,t,i,s,r)=>i!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"ProgramDateTime",run(e,t,i,s,r){if(!Object.keys(e.timelineToDatetimeMappings).length)return null;let n=null,a=null;var o=ou(t);r=r||0;for(let l=0;l<o.length;l++){var h=o[t.endList||0===r?l:o.length-(l+1)],d=h.segment,u=e.timelineToDatetimeMappings[d.timeline];if(u&&d.dateTimeObject){let c=d.dateTimeObject.getTime()/1e3+u;if(d.parts&&"number"==typeof h.partIndex){for(let p=0;p<h.partIndex;p++)c+=d.parts[p].duration;}if(u=Math.abs(r-c),null!==a&&(0===u||a<u))break;a=u,n={time:c,segmentIndex:h.segmentIndex,partIndex:h.partIndex};}}return n;}},{name:"Segment",run(e,t,i,s,r){let n=null,a=null;r=r||0;var o=ou(t);for(let l=0;l<o.length;l++){var h=o[t.endList||0===r?l:o.length-(l+1)],d=h.segment,u=h.part&&h.part.start||d&&d.start;if(d.timeline===s&&void 0!==u){if(d=Math.abs(r-u),null!==a&&a<d)break;(!n||null===a||a>=d)&&(a=d,n={time:u,segmentIndex:h.segmentIndex,partIndex:h.partIndex});}}return n;}},{name:"Discontinuity",run(e,t,i,s,r){let n=null;if(r=r||0,t.discontinuityStarts&&t.discontinuityStarts.length){let a=null;for(let o=0;o<t.discontinuityStarts.length;o++){var l=t.discontinuityStarts[o],h=t.discontinuitySequence+o+1,h=e.discontinuities[h];if(h){var d=Math.abs(r-h.time);if(null!==a&&a<d)break;(!n||null===a||a>=d)&&(a=d,n={time:h.time,segmentIndex:l,partIndex:null});}}}return n;}},{name:"Playlist",run:(e,t,i,s,r)=>t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}];class hn extends ri.EventTarget{constructor(e=0){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={},this.logger_=aY("SyncController");}getSyncPoint(e,t,i,s){return (e=this.runStrategies_(e,t,i,s)).length?this.selectSyncPoint_(e,{key:"time",value:s}):null;}getExpiredTime(e,t){return e&&e.segments&&(t=this.runStrategies_(e,t,e.discontinuitySequence,0)).length?(0<(t=this.selectSyncPoint_(t,{key:"segmentIndex",value:0})).segmentIndex&&(t.time*=-1),Math.abs(t.time+os({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:t.segmentIndex,endIndex:0}))):null;}runStrategies_(e,t,i,s){var r=[];for(let n=0;n<hr.length;n++){var a=hr[n],o=a.run(this,e,t,i,s);o&&(o.strategy=a.name,r.push({strategy:a.name,syncPoint:o}));}return r;}selectSyncPoint_(e,t){let i=e[0].syncPoint,s=Math.abs(e[0].syncPoint[t.key]-t.value),r=e[0].strategy;for(let n=1;n<e.length;n++){var a=Math.abs(e[n].syncPoint[t.key]-t.value);a<s&&(s=a,i=e[n].syncPoint,r=e[n].strategy);}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${r}]: [time:${i.time}, segmentIndex:`+i.segmentIndex+("number"==typeof i.partIndex?",partIndex:"+i.partIndex:"")+"]"),i;}saveExpiredSegmentInfo(e,t){var i=t.mediaSequence-e.mediaSequence;if(86400<i)ri.log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);else{for(let s=i-1;0<=s;s--){var r=e.segments[s];if(r&&void 0!==r.start){t.syncInfo={mediaSequence:e.mediaSequence+s,time:r.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break;}}}}setDateTimeMappingForStart(e){var t;this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject&&(t=(e=e.segments[0]).dateTimeObject.getTime()/1e3,this.timelineToDatetimeMappings[e.timeline]=-t);}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){var i=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),s=e.segment,i=(i&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:s.start})),s.dateTimeObject);s.discontinuity&&t&&i&&(this.timelineToDatetimeMappings[s.timeline]=-i.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){var s=e.segment,r=e.part;let n=this.timelines[e.timeline],a,o;if("number"==typeof e.timestampOffset)n={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=n,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${n.time}] [mapping: ${n.mapping}]`)),a=e.startOfSegment;else{if(!n)return !1;a=t.start+n.mapping;}return o=t.end+n.mapping,r&&(r.start=a,r.end=o),(!s.start||a<s.start)&&(s.start=a),s.end=o,!0;}saveDiscontinuitySyncInfo_(e){var t=e.playlist,i=e.segment;if(i.discontinuity)this.discontinuities[i.timeline]={time:i.start,accuracy:0};else{if(t.discontinuityStarts&&t.discontinuityStarts.length){for(let s=0;s<t.discontinuityStarts.length;s++){var r=t.discontinuityStarts[s],n=t.discontinuitySequence+s+1,a=r-e.mediaIndex,o=Math.abs(a);if(!this.discontinuities[n]||this.discontinuities[n].accuracy>o){let l;l=a<0?i.start-os({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:r}):i.end+os({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:r}),this.discontinuities[n]={time:l,accuracy:o};}}}}}dispose(){this.trigger("dispose"),this.off();}}class ha extends ri.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("timelinechange")),this.lastTimelineChanges_[e];}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off();}}var ho=li(ls(lr(function(){var e=function(){function e(){this.listeners={};}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t);},t.off=function(e,t){return !!this.listeners[e]&&(t=this.listeners[e].indexOf(t),this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(t,1),-1<t);},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,s=0;s<i;++s)t[s].call(this,arguments[1]);
53else for(var r=Array.prototype.slice.call(arguments,1),n=t.length,a=0;a<n;++a)t[a].apply(this,r);},t.dispose=function(){this.listeners={};},t.pipe=function(e){this.on("data",function(t){e.push(t);});},e;}();let t=null;class i{constructor(e){t=t||function(){var e=[[[],[],[],[],[]],[[],[],[],[],[]]],t=e[0],i=e[1],s=t[4],r=i[4];let n,a,o;var l,h,d,u,c=[],p=[];let m,g;for(n=0;n<256;n++)p[(c[n]=n<<1^283*(n>>7))^n]=n;for(a=o=0;!s[a];a^=l||1,o=p[o]||1)for(u=(u=o^o<<1^o<<2^o<<3^o<<4)>>8^255&u^99,g=16843009*(d=c[h=c[l=c[r[s[a]=u]=a]]])^65537*h^257*l^16843008*a,m=257*c[u]^16843008*u,n=0;n<4;n++)t[n][a]=m=m<<24^m>>>8,i[n][u]=g=g<<24^g>>>8;for(n=0;n<5;n++)t[n]=t[n].slice(0),i[n]=i[n].slice(0);return e;}(),this._tables=[[t[0][0].slice(),t[0][1].slice(),t[0][2].slice(),t[0][3].slice(),t[0][4].slice()],[t[1][0].slice(),t[1][1].slice(),t[1][2].slice(),t[1][3].slice(),t[1][4].slice()]];let i,s,r;var n=this._tables[0][4],a=this._tables[1],o=e.length;let l=1;if(4!==o&&6!==o&&8!==o)throw Error("Invalid aes key size");var h=e.slice(0),d=[];for(this._key=[h,d],i=o;i<4*o+28;i++)r=h[i-1],(i%o==0||8===o&&i%o==4)&&(r=n[r>>>24]<<24^n[r>>16&255]<<16^n[r>>8&255]<<8^n[255&r],i%o==0)&&(r=r<<8^r>>>24^l<<24,l=l<<1^283*(l>>7)),h[i]=h[i-o]^r;for(s=0;i;s++,i--)r=h[3&s?i:i-4],i<=4||s<4?d[s]=r:d[s]=a[0][n[r>>>24]]^a[1][n[r>>16&255]]^a[2][n[r>>8&255]]^a[3][n[255&r]];}decrypt(e,t,i,s,r,n){var a,o,l=this._key[1];let h=e^l[0],d=s^l[1],u=i^l[2],c=t^l[3],p;var m=l.length/4-2;let g,f=4;var e=this._tables[1],y=e[0],v=e[1],$=e[2],_=e[3],b=e[4];for(g=0;g<m;g++)p=y[h>>>24]^v[d>>16&255]^$[u>>8&255]^_[255&c]^l[f],a=y[d>>>24]^v[u>>16&255]^$[c>>8&255]^_[255&h]^l[f+1],o=y[u>>>24]^v[c>>16&255]^$[h>>8&255]^_[255&d]^l[f+2],c=y[c>>>24]^v[h>>16&255]^$[d>>8&255]^_[255&u]^l[f+3],f+=4,h=p,d=a,u=o;for(g=0;g<4;g++)r[(3&-g)+n]=b[h>>>24]<<24^b[d>>16&255]<<16^b[u>>8&255]<<8^b[255&c]^l[f++],p=h,h=d,d=u,u=c,c=p;}}function s(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24;}class r{constructor(t,i,n,a){var o=r.STEP,l=new Int32Array(t.buffer);let h=new Uint8Array(t.byteLength),d=0;for(this.asyncStream_=new class t extends e{constructor(){super(e),this.jobs=[],this.delay=1,this.timeout_=null;}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null;}push(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay));}}(),this.asyncStream_.push(this.decryptChunk_(l.subarray(d,d+o),i,n,h)),d=o;d<l.length;d+=o)n=new Uint32Array([s(l[d-4]),s(l[d-3]),s(l[d-2]),s(l[d-1])]),this.asyncStream_.push(this.decryptChunk_(l.subarray(d,d+o),i,n,h));this.asyncStream_.push(function(){var e;a(null,(e=h).subarray(0,e.byteLength-e[e.byteLength-1]));});}static get STEP(){return 32e3;}decryptChunk_(e,t,r,n){return function(){var a=function(e,t,r){var n,a,o,l,h=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),d=new i(Array.prototype.slice.call(t)),t=new Uint8Array(e.byteLength),u=new Int32Array(t.buffer);let c,p,m,g,f;for(c=r[0],p=r[1],m=r[2],g=r[3],f=0;f<h.length;f+=4)n=s(h[f]),a=s(h[f+1]),o=s(h[f+2]),l=s(h[f+3]),d.decrypt(n,a,o,l,u,f),u[f]=s(u[f]^c),u[f+1]=s(u[f+1]^p),u[f+2]=s(u[f+2]^m),u[f+3]=s(u[f+3]^g),c=n,p=a,m=o,g=l;return t;}(e,t,r);n.set(a,e.byteOffset);};}}var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n="undefined"!=typeof window?window:void 0!==n?n:"undefined"!=typeof self?self:{},n=n.BigInt||Number;n("0x1"),n("0x100"),n("0x10000"),n("0x1000000"),n("0x100000000"),n("0x10000000000"),n("0x1000000000000"),n("0x100000000000000"),n("0x10000000000000000"),n=new Uint16Array([65484]),255!==(n=new Uint8Array(n.buffer,n.byteOffset,n.byteLength))[0]&&n[0],self.onmessage=function(e){let t=e.data;var e=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),i=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),s=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new r(e,i,s,function(e,i){self.postMessage(function e(t){let i={};return Object.keys(t).forEach((e)=>{var s,r=t[e];s=r,("function"===ArrayBuffer.isView?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer)?i[e]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:i[e]=r;}),i;}({source:t.source,decrypted:i}),[i.buffer]);});};})));let hl=(e,t)=>{e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null);},hh=(e,t)=>{(t.activePlaylistLoader=e).load();},hd={AUDIO:(e,t)=>
53()=>{var {mediaTypes:{[e]:i},excludePlaylist:s}=t,r=i.activeTrack(),n=i.activeGroup(),n=(n.filter((e)=>e.default)[0]||n[0]).id,a=i.tracks[n];if(r===a)s({error:{message:"Problem encountered loading the default audio track."}});else{for(let o in ri.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),i.tracks)i.tracks[o].enabled=i.tracks[o]===a;i.onTrackChanged();}},SUBTITLES:(e,t)=>()=>{var {[e]:i}=t.mediaTypes,s=(ri.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),i.activeTrack());s&&(s.mode="disabled"),i.onTrackChanged();}},hu={AUDIO(e,t,i){if(!t)return;let {tech:s,requestOptions:r,segmentLoaders:{[e]:n}}=i;t.on("loadedmetadata",()=>{var e=t.media();n.playlist(e,r),(!s.paused()||e.endList&&"none"!==s.preload())&&n.load();}),t.on("loadedplaylist",()=>{n.playlist(t.media(),r),s.paused()||n.load();}),t.on("error",hd[e](e,i));},SUBTITLES(e,t,i){let {tech:s,requestOptions:r,segmentLoaders:{[e]:n},mediaTypes:{[e]:a}}=i;t.on("loadedmetadata",()=>{var e=t.media();n.playlist(e,r),n.track(a.activeTrack()),(!s.paused()||e.endList&&"none"!==s.preload())&&n.load();}),t.on("loadedplaylist",()=>{n.playlist(t.media(),r),s.paused()||n.load();}),t.on("error",hd[e](e,i));}},hc={AUDIO(e,t){var i,{vhs:s,sourceType:r,segmentLoaders:{[e]:n},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[e]:{groups:l,tracks:h,logger_:d}},mainPlaylistLoader:u}=t,c=oE(u.main);for(let p in o[e]&&0!==Object.keys(o[e]).length||(o[e]={main:{default:{default:!0}}},c&&(o[e].main.default.playlists=u.main.playlists)),o[e]){for(let m in l[p]||(l[p]=[]),o[e][p]){let g=o[e][p][m],f;f=c?(d(`AUDIO group '${p}' label '${m}' is a main playlist`),g.isMainPlaylist=!0,null):"vhs-json"===r&&g.playlists?new o4(g.playlists[0],s,a):g.resolvedUri?new o4(g.resolvedUri,s,a):g.playlists&&"dash"===r?new oJ(g.playlists[0],s,a,u):null,g=aQ({id:m,playlistLoader:f},g),hu[e](e,g.playlistLoader,t),l[p].push(g),void 0===h[m]&&(i=new ri.AudioTrack({id:m,kind:((e)=>{let t=e.default?"main":"alternative";return e.characteristics&&0<=e.characteristics.indexOf("public.accessibility.describes-video")?"main-desc":t;})(g),enabled:!1,language:g.language,default:g.default,label:m}),h[m]=i);}}n.on("error",hd[e](e,t));},SUBTITLES(e,t){var i,{tech:s,vhs:r,sourceType:n,segmentLoaders:{[e]:a},requestOptions:o,main:{mediaGroups:l},mediaTypes:{[e]:{groups:h,tracks:d}},mainPlaylistLoader:u}=t;for(let c in l[e]){for(let p in h[c]||(h[c]=[]),l[e][c])if(r.options_.useForcedSubtitles||!l[e][c][p].forced){let m=l[e][c][p],g;if("hls"===n)g=new o4(m.resolvedUri,r,o);else if("dash"===n){if(!m.playlists.filter((e)=>e.excludeUntil!==1/0).length)return;g=new oJ(m.playlists[0],r,o,u);}else "vhs-json"===n&&(g=new o4(m.playlists?m.playlists[0]:m.resolvedUri,r,o));m=aQ({id:p,playlistLoader:g},m),hu[e](e,m.playlistLoader,t),h[c].push(m),void 0===d[p]&&(i=s.addRemoteTextTrack({id:p,kind:"subtitles",default:m.default&&m.autoselect,language:m.language,label:p},!1).track,d[p]=i);}}a.on("error",hd[e](e,t));},"CLOSED-CAPTIONS"(e,t){var {tech:i,main:{mediaGroups:s},mediaTypes:{[e]:{groups:r,tracks:n}}}=t;for(let a in s[e]){for(let o in r[a]||(r[a]=[]),s[e][a]){var l=s[e][a][o];if(/^(?:CC|SERVICE)/.test(l.instreamId)){var h=i.options_.vhs&&i.options_.vhs.captionServices||{};let d={label:o,language:l.language,instreamId:l.instreamId,default:l.default&&l.autoselect};void 0===(d=h[d.instreamId]?aQ(d,h[d.instreamId]):d).default&&delete d.default,r[a].push(aQ({id:o}
53,l)),void 0===n[o]&&(h=i.addRemoteTextTrack({id:d.instreamId,kind:"captions",default:d.default,language:d.language,label:d.label},!1).track,n[o]=h);}}}}},hp=(e,t)=>{for(let i=0;i<e.length;i++)if(o0(t,e[i])||e[i].playlists&&hp(e[i].playlists,t))return !0;return !1;},hm={AUDIO:(e,t)=>()=>{var {[e]:{tracks:i}}=t.mediaTypes;for(let s in i)if(i[s].enabled)return i[s];return null;},SUBTITLES:(e,t)=>()=>{var {[e]:{tracks:i}}=t.mediaTypes;for(let s in i)if("showing"===i[s].mode||"hidden"===i[s].mode)return i[s];return null;}},hg=(e)=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((t)=>{hc[t](t,e);});let {mediaTypes:t,mainPlaylistLoader:i,tech:s,vhs:r,segmentLoaders:{AUDIO:n,main:a}}=e;["AUDIO","SUBTITLES"].forEach((i)=>{var s,r,n,a,o,l,h,d,u,c;t[i].activeGroup=(s=i,r=e,(e)=>{var {mainPlaylistLoader:t,mediaTypes:{[s]:{groups:i}}}=r,n=t.media();if(!n)return null;let a=null;n.attributes[s]&&(a=i[n.attributes[s]]);var o=Object.keys(i);if(!a)if("AUDIO"===s&&1<o.length&&oE(r.main)){for(let l=0;l<o.length;l++){var h=i[o[l]];if(hp(h,n)){a=h;break;}}}else i.main?a=i.main:1===o.length&&(a=i[o[0]]);return void 0===e?a:null!==e&&a&&a.filter((t)=>t.id===e.id)[0]||null;}),t[i].activeTrack=hm[i](i,e),t[i].onGroupChanged=(n=i,a=e,()=>{var {segmentLoaders:{[n]:e,main:t},mediaTypes:{[n]:i}}=a,s=i.activeTrack(),r=i.getActiveGroup(),o=i.activePlaylistLoader,l=i.lastGroup_;r&&l&&r.id===l.id||(i.lastGroup_=r,i.lastTrack_=s,hl(e,i),r&&!r.isMainPlaylist&&(r.playlistLoader?(e.resyncLoader(),hh(r.playlistLoader,i)):o&&t.resetEverything()));}),t[i].onGroupChanging=(o=i,l=e,()=>{var {segmentLoaders:{[o]:e},mediaTypes:{[o]:t}}=l;t.lastGroup_=null,e.abort(),e.pause();}),t[i].onTrackChanged=(h=i,d=e,()=>{var e,t,{mainPlaylistLoader:i,segmentLoaders:{[h]:s,main:r},mediaTypes:{[h]:n}}=d,a=n.activeTrack(),o=n.getActiveGroup(),l=n.activePlaylistLoader,u=n.lastTrack_;if((!u||!a||u.id!==a.id)&&(n.lastGroup_=o,n.lastTrack_=a,hl(s,n),o)){if(o.isMainPlaylist)return a&&u&&a.id!==u.id&&(t=(e=d.vhs.playlistController_).selectPlaylist(),e.media()!==t)?(n.logger_(`track change. Switching main audio from ${u.id} to `+a.id),i.pause(),r.resetEverything(),void e.fastQualityChange_(t)):void 0;if("AUDIO"===h){if(!o.playlistLoader)return r.setAudio(!0),void r.resetEverything();s.setAudio(!0),r.setAudio(!1);}l===o.playlistLoader||(s.track&&s.track(a),s.resetEverything()),hh(o.playlistLoader,n);}}),t[i].getActiveGroup=([u,c]=[i,e.mediaTypes],()=>{var e=c[u].activeTrack();return e?c[u].activeGroup(e):null;});});var o=t.AUDIO.activeGroup();o&&(o=(o.filter((e)=>e.default)[0]||o[0]).id,t.AUDIO.tracks[o].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged(),(t.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),n):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(),s.trigger({type:"usage",name:"vhs-audio-change"});};for(let h in s.audioTracks().addEventListener("change",l),s.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),r.on("dispose",()=>{s.audioTracks().removeEventListener("change",l),s.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged);}),s.clearTracks("audio"),t.AUDIO.tracks)s.audioTracks().addTrack(t.AUDIO.tracks[h]);};class hf{constructor(){this.priority_=[];}set version(e){1===e&&(this.version_=e);}set ttl(e){this.ttl_=e||300;}set reloadUri(e){e&&(this.reloadUri_=aX(this.reloadUri_,e));}set priority(e){e&&e.length&&(this.priority_=e);}get version(){return this.version_;}get ttl(){return this.ttl_;}get reloadUri(){return this.reloadUri_;}get priority(){return this.priority_;}}class hy extends ri.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.availablePathways_=new Set(),this.excludedPathways_=new Set(),this.steeringManifest=new hf(),this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set(),this.logger_=aY("Content Steering"),this.xhr_=e,this.getBandwidth_=t;}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";var i=t.serverUri||t.serverURL;i?i.startsWith("data:")?this.decodeDataUriManifest_(i.substring(i.indexOf(",")+1)):(this.steeringManifest.reloadUri=this.queryBeforeStart?i:aX(e,i),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart||!1,this.proxyServerUrl_=t.proxyServerURL||null,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering"),this.queryBeforeStart&&this.requestSteeringManifest(this.steeringManifest.reloadUri)):(this.logger_(`steering manifest URL is ${i}, cannot request steering manifest.`),this.trigger("error"));}requestSteeringManifest(e){var t=this.steeringManifest.reloadUri;if(e||t){let i=e||this.getRequestURI(t);i?this.request_=this.xhr_({uri:i},(e,t)=>{if(e)return 410===t.status?(this.logger_(`manifest request 410 ${e}.`),this.logger_(`There will be no more content steering requests to ${i} this session.`),void this.excludedSteeringManifestURLs.add(i)):429===t.status?(t=t.responseHeaders["retry-after"],this.logger_(`manifest request 429 ${e}.`),this.logger_(`content steering will retry in ${t} seconds.`),void this.startTTLTimeout_(parseInt(t,10))):(this.logger_(`manifest failed to load ${e}.`),void this.startTTLTimeout_());t=JSON.parse(this.request_.responseText),this.startTTLTimeout_(),this.assignSteeringProperties_(t);}):(this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose());}}setProxyServerUrl_(e){var e=new window.URL(e),t=new window.URL(this.proxyServerUrl_);return t.searchParams.set("url",encodeURI(e.toString())),this.setSteeringParams_(t.toString());}decodeDataUriManifest_(e){e=JSON.parse(window.atob(e)),this.assignSteeringProperties_(e);}setSteeringParams_(e){var t,e=new window.URL(e),i=this.getPathway(),s=this.getBandwidth_();return i&&(t=`_${this.manifestType_}_pathway`,e.searchParams.set(t,i)),s&&(t=`_${this.manifestType_}
53_throughput`,e.searchParams.set(t,s)),e.toString();}assignSteeringProperties_(e){var t;this.steeringManifest.version=e.VERSION,this.steeringManifest.version?(this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose()),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"))):(this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),this.trigger("error"));}getPathway(){return this.currentPathway||this.defaultPathway;}getRequestURI(e){if(!e)return null;var t=(e)=>this.excludedSteeringManifestURLs.has(e);if(this.proxyServerUrl_){var i=this.setProxyServerUrl_(e);if(!t(i))return i;}return t(i=this.setSteeringParams_(e))?null:i;}startTTLTimeout_(e=this.steeringManifest.ttl){this.ttlTimeout_=window.setTimeout(()=>{this.requestSteeringManifest();},1e3*e);}clearTTLTimeout_(){window.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.excludedPathways_=new Set(),this.steeringManifest=new hf();}addAvailablePathway(e){e&&this.availablePathways_.add(e);}clearAvailablePathways(){this.availablePathways_.clear();}excludePathway(e){return this.availablePathways_.delete(e);}}let h8;class hv extends ri.EventTarget{constructor(e){super();let {src:t,withCredentials:i,tech:s,bandwidth:r,externVhs:n,useCueTags:a,playlistExclusionDuration:o,enableLowInitialPlaylist:l,sourceType:h,cacheEncryptionKeys:d,bufferBasedABR:u,leastPixelDiffSelector:c,captionServices:p}=e;if(!t)throw Error("A non-empty playlist URL or JSON manifest string is required");let m=e.maxPlaylistRetries;null!=m||(m=1/0),h8=n,this.bufferBasedABR=Boolean(u),this.leastPixelDiffSelector=Boolean(c),this.withCredentials=i,this.tech_=s,this.vhs_=s.vhs,this.sourceType_=h,this.useCueTags_=a,this.playlistExclusionDuration=o,this.maxPlaylistRetries=m,this.enableLowInitialPlaylist=l,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:i,maxPlaylistRetries:m,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:l9,activeTrack:l9,getActiveGroup:l9,onGroupChanged:l9,onTrackChanged:l9,lastTrack_:null,logger_:aY(`MediaGroups[${t}]`)};}),e;})(),this.mediaSource=new window.MediaSource(),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.seekable_=aJ(),this.hasPlayed_=!1,this.syncController_=new hn(e),this.segmentMetadataTrack_=s.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new ho(),this.sourceUpdater_=new he(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new ha();var g={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,calculateTimestampOffsetForEachSegment:e.calculateTimestampOffsetForEachSegment,captionServices:p,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:r,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:d,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)},g=(this.mainPlaylistLoader_="dash"===this.sourceType_?new oJ(t,this.vhs_,aQ(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new o4(t,this.vhs_,aQ(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new lV(aQ(g,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new lV(aQ(g,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new class e extends lV{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.loaderType_="subtitle",this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1;}createTransmuxer_(){return null;}buffered_(){var e;return this.subtitlesTrack_&&this.subtitlesTrack_.cues&&this.subtitlesTrack_.cues.length?aJ([[(e=this.subtitlesTrack_.cues)[0].startTime,e[e.length-1].startTime]]):aJ();}initSegmentForMap(e,t=!1){if(!e)return null;var i=oB(e);let s=this.initSegments_[i];return t&&!s&&e.bytes&&(t=hi.byteLength+e.bytes.byteLength,(t=new Uint8Array(t)).set(e.bytes),t.set(hi,e.bytes.byteLength),this.initSegments_[i]=s={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:t}),s||e;}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused();}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_();}track(e){return void 0!==e&&(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_())&&this.init_(),this.subtitlesTrack_;}remove(e,t){lO(e,t,this.subtitlesTrack_);}fillBuffer_(){var e=this.chooseNextRequest_();e&&(null===this.syncController_.timestampOffsetForTimeline(e.timeline)?(this.syncController_.one("timestampoffset",()=>{this.state="READY",this.paused()||this.monitorBuffer_();}),this.state="WAITING_ON_TIMELINE"):this.loadSegment_(e));}timestampOffsetForSegment_(){return null;}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_());}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break;}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest});}return e;}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error");}segmentRequestFinished_(e,t,i){if(this.subtitlesTrack_)if(this.saveTransferStats_(t.stats),this.pendingSegment_)if(e)e.code===l_.TIMEOUT&&this.handleTimeout_(),e.code===l_.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);else{var s=this.pendingSegment_,r=(this.saveBandwidthRelatedStats_(s.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending"),s.segment);if(r.map&&(r.map.bytes=t.map.bytes),s.bytes=t.bytes,"function"!=typeof window.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"}));else{r.requested=!0;try{this.parseVTTCues_(s);}catch(n){return void this.stopForError({message:n.message});}if(this.updateTimeMapping_(s,this.syncController_.timelines[s.timeline],this.playlist_),s.cues.length?s.timingInfo={start:s.cues[0].startTime,end:s.cues[s.cues.length-1].endTime}:s.timingInfo={start:s.startOfSegment,end:s.startOfSegment+s.duration},s.isSyncRequest)this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";else{s.byteLength=s.bytes.byteLength,this.mediaSecondsLoaded+=r.duration,s.cues.forEac
53h((e)=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new window.VTTCue(e.startTime,e.endTime,e.text):e);});var a=this.subtitlesTrack_,o=a.cues;if(o){var l={};for(let h=o.length-1;0<=h;h--){var d=o[h],u=`${d.startTime}-${d.endTime}-`+d.text;l[u]?a.removeCue(d):l[u]=d;}}this.handleAppendsDone_();}}}else this.state="READY",this.mediaRequestsAborted+=1;else this.state="READY";}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(e){let t,i=!1;if("function"!=typeof window.WebVTT)throw new hs();"function"==typeof window.TextDecoder?t=new window.TextDecoder("utf8"):(t=window.WebVTT.StringDecoder(),i=!0);var s=new window.WebVTT.Parser(window,window.vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},s.oncue=e.cues.push.bind(e.cues),s.ontimestampmap=(t)=>{e.timestampmap=t;},s.onparsingerror=(e)=>{ri.log.warn("Error encountered when parsing cues: "+e.message);},e.segment.map){let r=e.segment.map.bytes;i&&(r=ht(r)),s.parse(r);}let n=e.bytes;i&&(n=ht(n)),s.parse(n),s.flush();}updateTimeMapping_(e,t,i){var s=e.segment;if(t)if(e.cues.length){var r=e.timestampmap;let n=r.MPEGTS/9e4-r.LOCAL+t.mapping;e.cues.forEach((e)=>{e.startTime+=n,e.endTime+=n;}),i.syncInfo||(r=e.cues[0].startTime,t=e.cues[e.cues.length-1].startTime,i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(r,t-s.duration)});}else s.empty=!0;}}(aQ(g,{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 hy(this.vhs_.xhr,()=>this.mainSegmentLoader_.bandwidth),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"].forEach((e)=>{this[e+"_"]=(function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e];}).bind(this,e);}),this.logger_=aY("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,"none"===this.tech_.preload()?"play":"loadstart");this.tech_.one(g,()=>{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_(){var e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return -1===e||-1===t?-1:e+t;}timeToLoadedData_(){return this.timeToLoadedData__;}checkABR_(e="abr"){var t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e);}switchMedia_(e,t,i){var s=this.media(),s=s&&(s.id||s.uri),r=e.id||e.uri;s&&s!==r&&(this.logger_(`switch media ${s} -> ${r} from `+t),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+t})),this.mainPlaylistLoader_.media(e,i);}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((e)=>{var t=this.mediaTypes_[e],t=t?t.activeGroup():null;let i=this.contentSteeringController_.getPathway();t&&i&&(t=(t.length?t[0]:t).playlists.filter((e)=>e.attributes.serviceLocation===i)).length&&this.mediaTypes_[e].activePlaylistLoader.media(t[0]);});}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=window.setInterval(()=>this.checkABR_(),250);}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(window.clearInterval(this.abrTimer_),this.abrTimer_=null);}getAudioTrackPlaylists_(){var e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;var i=e.mediaGroups.AUDIO,s=Object.keys(i);let r;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)r=this.mediaTypes_.AUDIO.activeTrack();else{var n=i.main||s.length&&i[s[0]];for(let a in n)if(n[a].default){r={label:a};break;}}if(!r)return t;var o=[];for(let l in i)if(i[l][r.label]){var h=i[l][r.label];if(h.playlists&&h.playlists.length)o.push.apply(o,h.playlists);else if(h.uri)o.push(h);else{if(e.playlists.length){for(let d=0;d<e.playlists.length;d++){var u=e.playlists[d];u.attributes&&u.attributes.AUDIO&&u.attributes.AUDIO===l&&o.push(u);}}}}return o.length?o:t;}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{var e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;oS(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()),hg({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();
53if(!e){this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let t;if(!(t=(t=this.enableLowInitialPlaylist?this.selectInitialPlaylist():t)||this.selectPlaylist())||!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",()=>{var 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",()=>{var e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;oS(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0});}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{var 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"});});}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load());}triggerPresenceUsage_(e,t){var i=e.mediaGroups||{};let s=!0;for(let r in e=Object.keys(i.AUDIO),i.AUDIO){for(let n in i.AUDIO[r])i.AUDIO[r][n].uri||(s=!1);}s&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),h8.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),e.length&&1<Object.keys(i.AUDIO[e[0]]).length&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"});}shouldSwitchToMedia_(e){var t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,i=this.tech_.currentTime(),s=this.bufferLowWaterLine(),r=this.bufferHighWaterLine(),{currentPlaylist:i,buffered:t,currentTime:e,nextPlaylist:s,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:a,bufferBasedABR:o,log:l}={buffered:this.tech_.buffered(),currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:s,bufferHighWaterLine:r,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_};if(s){var h=`allowing switch ${i&&i.id||"null"} -> `+s.id;if(!i)return l(h+" as current playlist is not set"),!0;if(s.id!==i.id){var d=Boolean(aZ(t,e).length);if(!i.endList)return d||"number"!=typeof i.partTargetDuration?(l(h+" as current playlist is live"),!0):(l(`not ${h} as current playlist is live llhls, but currentTime isn't in buffered.`),!1);if(d=oi(t,e),a<(t=o?oZ.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:oZ.MAX_BUFFER_LOW_WATER_LINE))return l(h+` as duration < max low water line (${a} < ${t})`),!0;if((e=s.attributes.BANDWIDTH)<(a=i.attributes.BANDWIDTH)&&(!o||d<n)){let u=h+` as next bandwidth < current bandwidth (${e} < ${a})`;return o&&(u+=` and forwardBuffer < bufferHighWaterLine (${d} < ${n})`),l(u),!0;}if((!o||a<e)&&r<=d){let c=h+` as forwardBuffer >= bufferLowWaterLine (${d} >= ${r})`;return o&&(c+=` and next bandwidth > current bandwidth (${e} > ${a})`),l(c),!0;}l(`not ${h} as no switching criteria met`);}}else ri.log.warn("We received no playlist to switch to. Please check your stream.");return !1;}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",()=>{var 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",()=>
53{this.logger_("main segment loader ended"),this.onEndOfStream();}),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}));});var e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();var e=this.getCodecsOrExclude_();e&&this.sourceUpdater_.addOrChangeSourceBuffers(e);};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0);}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0);}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream();});}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();}fastQualityChange_(e=this.selectPlaylist()){e===this.mainPlaylistLoader_.media()?this.logger_("skipping fastQualityChange because new media is same as old"):(this.switchMedia_(e,"fast-quality"),this.resetMainLoaderReplaceSegments());}resetMainLoaderReplaceSegments(){var e=this.tech_.buffered(),e=e.end(e.length-1);this.mainSegmentLoader_.replaceSegmentsUntil=e,this.mainSegmentLoader_.resetLoaderProperties(),this.mainSegmentLoader_.resetLoader();}play(){var e;if(!this.setupFirstPlay())return this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load(),e=this.tech_.seekable(),this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0)?this.tech_.setCurrentTime(e.end(e.length-1)):void 0;}setupFirstPlay(){var e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return !1;if(!e.endList||e.start){var t=this.seekable();if(!t.length)return !1;var i=t.end(0);let s=i;e.start&&(s=(e=e.start.timeOffset)<0?Math.max(i+e,t.start(0)):Math.min(i,e)),this.trigger("firstplay"),this.tech_.setCurrentTime(s);}return this.hasPlayed_=!0,this.load(),!0;}handleSourceOpen_(){var e;this.tryToCreateSourceBuffers_(),this.tech_.autoplay()&&void 0!==(e=this.tech_.play())&&"function"==typeof e.then&&e.then(null,(e)=>{}),this.trigger("sourceopen");}handleSourceEnded_(){var e,t;this.inbandTextTracks_.metadataTrack_&&(e=this.inbandTextTracks_.metadataTrack_.cues)&&e.length&&(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(){var e;let t=this.mainSegmentLoader_.ended_;this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=((e=this.mainSegmentLoader_.getCurrentMediaInfo_())&&!e.hasVideo||t)&&this.audioSegmentLoader_.ended_),t&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream());}stuckAtPlaylistEnd_(e){var t,i;return !!this.seekable().length&&null!==(t=this.syncController_.getExpiredTime(e,this.duration()))&&(e=h8.Playlist.playlistEnd(e,t),t=this.tech_.currentTime(),(i=this.tech_.buffered()).length?(i=i.end(i.length-1))-t<=oa&&e-i<=oa:e-t<=oa);}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:i}){if(e=e||this.mainPlaylistLoader_.media(),i=i||t.playlistExclusionDuration||this.playlistExclusionDuration,e){e.playlistErrors_++;var s=this.mainPlaylistLoader_.main.playlists,r=s.filter(o_),r=1===r.length&&r[0]===e;if(1===s.length&&i!==1/0)return ri.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(r);if(r){if(this.main().contentSteering){let n=this.pathwayAttribute_(e);var a=1e3*this.contentSteeringController_.steeringManifest.ttl;return this.contentSteeringController_.excludePathway(n),this.excludeThenChangePathway_(),void setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(n);},a);}let o=!1;
53s.forEach((t)=>{var i;t!==e&&void 0!==(i=t.excludeUntil)&&i!==1/0&&(o=!0,delete t.excludeUntil);}),o&&(ri.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"));}let l;if(l=e.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*i,e.excludeUntil=l,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"}),a=this.selectPlaylist())return s=t.internal?this.logger_:ri.log.warn,i=t.message?" "+t.message:"",s(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.`+i+` Switching to playlist ${a.id}.`),a.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),a.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]),s=a.targetDuration/2*1e3||5e3,i="number"==typeof a.lastRequest&&Date.now()-a.lastRequest<=s,this.switchMedia_(a,"exclude",r||i);this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");}else this.error=t,"open"!==this.mediaSource.readyState?this.trigger("error"):this.sourceUpdater_.endOfStream("network");}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_();}delegateLoaders_(e,t){let i=[];var s="all"===e,r=((s||"main"===e)&&i.push(this.mainPlaylistLoader_),[]);(s||"audio"===e)&&r.push("AUDIO"),(s||"subtitle"===e)&&(r.push("CLOSED-CAPTIONS"),r.push("SUBTITLES")),r.forEach((e)=>{(e=this.mediaTypes_[e]&&this.mediaTypes_[e].activePlaylistLoader)&&i.push(e);}),["main","audio","subtitle"].forEach((t)=>{var s=this[t+"SegmentLoader_"];s&&(e===t||"all"===e)&&i.push(s);}),i.forEach((e)=>t.forEach((t)=>{"function"==typeof e[t]&&e[t]();}));}setCurrentTime(e){var t=aZ(this.tech_.buffered(),e);return this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media()&&this.mainPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.resetEverything(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.resetEverything(),void this.load()):0;}duration(){var e;return this.mainPlaylistLoader_&&(e=this.mainPlaylistLoader_.media())?e.endList?this.mediaSource?this.mediaSource.duration:h8.Playlist.duration(e):1/0:0;}seekable(){return this.seekable_;}onSyncInfoUpdate_(){let e;if(this.mainPlaylistLoader_){var t=this.mainPlaylistLoader_.media();if(t){var i=this.syncController_.getExpiredTime(t,this.duration());if(null!==i){var s=this.mainPlaylistLoader_.main,r=h8.Playlist.seekable(t,i,h8.Playlist.liveEdgeDelay(s,t));if(0!==r.length){if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(i=this.syncController_.getExpiredTime(t,this.duration()))||0===(e=h8.Playlist.seekable(t,i,h8.Playlist.liveEdgeDelay(s,t))).length))return;let n,a;this.seekable_&&this.seekable_.length&&(n=this.seekable_.end(0),a=this.seekable_.start(0)),!e||e.start(0)>r.end(0)||r.start(0)>e.end(0)?this.seekable_=r:this.seekable_=aJ([[(e.start(0)>r.start(0)?e:r).start(0),(e.end(0)<r.end(0)?e:r).end(0)]]),this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===n&&this.seekable_.start(0)===a||(this.logger_(`seekable updated [${ol(this.seekable_)}]`),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_);else{if(e)return (e=this.seekable()).length?void ((isNaN(this.mediaSource.duration)||this.mediaSource.duration<e.end(e.length-1))&&this.sourceUpdater_.setDuration(e.end(e.length-1))):void 0;e=this.tech_.buffered();let t=h8.Playlist.duration(this.mainPlaylistLoader_.media());0<e.length&&(t=Math.max(t,e.end(e.length-1))),this.mediaSource.duration!==t&&this.sourceUpdater_.setDuration(t);}}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach((e)=>{var t=this.mediaTypes_[e].groups;
53for(let i in t)t[i].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_(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),e=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return t&&e;}getCodecsOrExclude_(){let e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;var i=l8(this.main(),t);let s={};var r=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(s.video=i.video||e.main.videoCodec||"avc1.4d400d"),e.main.isMuxed&&(s.video+=","+(i.audio||e.main.audioCodec||rb)),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||r)&&(s.audio=i.audio||e.main.audioCodec||e.audio.audioCodec||rb,e.audio.isFmp4=(e.main.hasAudio&&!e.main.isMuxed?e.main:e.audio).isFmp4),s.audio||s.video){let n={},a;if(["video","audio"].forEach(function(t){var i,r;s.hasOwnProperty(t)&&!((i=e[t].isFmp4)?ru:rc)(r=s[t])&&(n[i=e[t].isFmp4?"browser":"muxer"]=n[i]||[],n[i].push(s[t]),"audio"===t&&(a=i));}),r&&a&&t.attributes.AUDIO){let o=t.attributes.AUDIO;
53this.main().playlists.forEach((e)=>{(e.attributes&&e.attributes.AUDIO)===o&&e!==t&&(e.excludeUntil=1/0);}),this.logger_(`excluding audio group ${o} as ${a} does not support codec(s): "${s.audio}"`);}if(!Object.keys(n).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){let l=[];if(["video","audio"].forEach((e)=>{var t=(r$(this.sourceUpdater_.codecs[e]||"")[0]||{}).type,i=(r$(s[e]||"")[0]||{}).type;t&&i&&t.toLowerCase()!==i.toLowerCase()&&l.push(`"${this.sourceUpdater_.codecs[e]}" -> "${s[e]}"`);}),l.length)return void this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${l.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});}return s;}i=Object.keys(n).reduce((e,t)=>(e&&(e+=", "),e+=`${t} does not support codec(s): "${n[t].join(",")}"`),"")+".",this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:i},playlistExclusionDuration:1/0});}else this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});}tryToCreateSourceBuffers_(){var e;"open"!==this.mediaSource.readyState||this.sourceUpdater_.hasCreatedSourceBuffers()||this.areMediaTypesKnown_()&&(e=this.getCodecsOrExclude_())&&(this.sourceUpdater_.createSourceBuffers(e),e=[e.video,e.audio].filter(Boolean).join(","),this.excludeIncompatibleVariants_(e));}excludeUnsupportedVariants_(){let e=this.main().playlists,t=[];Object.keys(e).forEach((i)=>{var s,r,i=e[i];-1===t.indexOf(i.id)&&(t.push(i.id),r=[],!(s=l8(this.main,i)).audio||rc(s.audio)||ru(s.audio)||r.push("audio codec "+s.audio),!s.video||rc(s.video)||ru(s.video)||r.push("video codec "+s.video),s.text&&"stpp.ttml.im1t"===s.text&&r.push("text codec "+s.text),r.length)&&(i.excludeUntil=1/0,this.logger_(`excluding ${i.id} for unsupported: `+r.join(", ")));});}excludeIncompatibleVariants_(e){let t=[],i=this.main().playlists;e=lA(r$(e));let s=ly(e),r=e.video&&r$(e.video)[0]||null,n=e.audio&&r$(e.audio)[0]||null;
53Object.keys(i).forEach((e)=>{var a,o,l,e=i[e];-1===t.indexOf(e.id)&&e.excludeUntil!==1/0&&(t.push(e.id),a=[],l=l8(this.mainPlaylistLoader_.main,e),o=ly(l),l.audio||l.video)&&(o!==s&&a.push(`codec count "${o}" !== "${s}"`),this.sourceUpdater_.canChangeType()||(o=l.video&&r$(l.video)[0]||null,l=l.audio&&r$(l.audio)[0]||null,o&&r&&o.type.toLowerCase()!==r.type.toLowerCase()&&a.push(`video codec "${o.type}" !== "${r.type}"`),l&&n&&l.type.toLowerCase()!==n.type.toLowerCase()&&a.push(`audio codec "${l.type}" !== "${n.type}"`)),a.length)&&(e.excludeUntil=1/0,this.logger_(`excluding ${e.id}: `+a.join(" && ")));});}updateAdCues_(e){let t=0;var i=this.seekable(),[s,r,i=0]=(i.length&&(t=i.start(0)),[e,this.cueTagsTrack_,t]);if(s.segments){let n=i,a;for(let o=0;o<s.segments.length;o++){var l,h,d=s.segments[o];if(a=a||function(e,t){var i=e.cues;for(let s=0;s<i.length;s++){var r=i[s];if(t>=r.adStartTime&&t<=r.adEndTime)return r;}return null;}(r,n+d.duration/2)){if("cueIn" in d){a.endTime=n,a.adEndTime=n,n+=d.duration,a=null;continue;}if(n<a.endTime){n+=d.duration;continue;}a.endTime+=d.duration;}else "cueOut" in d&&((a=new window.VTTCue(n,n+d.duration,d.cueOut)).adStartTime=n,a.adEndTime=n+parseFloat(d.cueOut),r.addCue(a)),"cueOutCont" in d&&([l,h]=d.cueOutCont.split("/").map(parseFloat),(a=new window.VTTCue(n,n+d.duration,"")).adStartTime=n-l,a.adEndTime=a.adStartTime+h,r.addCue(a));n+=d.duration;}}}goalBufferLength(){var e=this.tech_.currentTime(),t=oZ.GOAL_BUFFER_LENGTH,i=oZ.GOAL_BUFFER_LENGTH_RATE,s=Math.max(t,oZ.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,s);}bufferLowWaterLine(){var e=this.tech_.currentTime(),t=oZ.BUFFER_LOW_WATER_LINE,i=oZ.BUFFER_LOW_WATER_LINE_RATE,s=Math.max(t,oZ.MAX_BUFFER_LOW_WATER_LINE),r=Math.max(t,oZ.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?r:s);}bufferHighWaterLine(){return oZ.BUFFER_HIGH_WATER_LINE;}addDateRangesToTextTrack_(e){lU(this.inbandTextTracks_,"com.apple.streaming",this.tech_);var {inbandTextTracks:e,dateRanges:t}={inbandTextTracks:this.inbandTextTracks_,dateRanges:e};let i=e.metadataTrack_;if(i){let s=window.WebKitDataCue||window.VTTCue;t.forEach((e)=>{for(let t of Object.keys(e)){var r;lM.has(t)||((r=new s(e.startTime,e.endTime,"")).id=e.id,r.type="com.apple.quicktime.HLS",r.value={key:lN[t],data:e[t]},"scte35Out"!==t&&"scte35In"!==t||(r.value.data=new Uint8Array(r.value.data.match(/[\da-f]{2}/gi)).buffer),i.addCue(r));}e.processDateRange();});};}addMetadataToTextTrack(e,t,i){var s=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();lU(this.inbandTextTracks_,e,this.tech_),lR({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:s,videoDuration:i});}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation;}initContentSteeringController_(){var e=this.main();if(e.contentSteering){let t=(e)=>{for(let t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering);};t(e),this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),"dash"===this.sourceType_&&this.mainPlaylistLoader_.on("mediaupdatetimeout",()=>{this.mainPlaylistLoader_.refreshMedia_(this.mainPlaylistLoader_.media().id),this.contentSteeringController_.abort(),this.contentSteeringController_.clearTTLTimeout_(),this.contentSteeringController_.clearAvailablePathways(),t(this.main());}),this.contentSteeringController_.queryBeforeStart||this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest();});}}excludeThenChangePathway_(){let e=this.contentSteeringController_.getPathway();if(e){let t=this.main().playlists,i=new Set(),s=!1;Object.keys(t).forEach((r)=>{var r=t[r],n=this.pathwayAttribute_(r),n=n&&e!==n,a=(r.excludeUntil!==1/0||"content-steering"!==r.lastExcludeReason_||n||(delete r.excludeUntil,delete r.lastExcludeReason_,s=!0),!r.excludeUntil&&r.excludeUntil!==1/0);!i.has(r.id)&&n&&a&&(i.add(r.id),r.excludeUntil=1/0,r.lastExcludeReason_="content-steering",this.logger_(`excluding ${r.id} for `+r.lastExcludeReason_));}),"DASH"===this.contentSteeringController_.manifestType_&&Object.keys(this.mediaTypes_).forEach((t)=>{var t=this.mediaTypes_[t];t.activePlaylistLoader&&(t=t.activePlaylistLoader.media_)&&t.attributes.serviceLocation!==e&&(s=!0);}),s&&this.changeSegmentPathway_();}}changeSegmentPathway_(){var e=this.selectPlaylist();this.pauseLoading(),"DASH"===this.contentSteeringController_.manifestType_&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering");}}class h${constructor(e,t,i){var s,r,n,a,o=e.playlistController_,l=o.fastQualityChange_.bind(o);t.attributes&&(s=t.attributes.RESOLUTION,this.width=s&&s.width,this.height=s&&s.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]),this.codecs=l8(o.main(),t),this.playlist=t,this.id=i,this.enabled=(r=e.playlists,n=t.id,a=l,(e)=>{var t=r.main.playlists[n],i=o$(t),s=o_(t);return void 0===e?s:(e?delete t.disabled:t.disabled=!0,e===s||i||(a(),e?r.trigger("renditionenabled"):r.trigger("renditiondisabled")),e);});}}let h_=["seeking","seeked","pause","playing","error"];class hb{constructor(e){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.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=aY("PlaybackWatcher"),this.logger_("initialize");let t=()=>this.monitorCurrentTime_(),i=()=>this.monitorCurrentTime_(),s=()=>this.techWaiting_(),r=()=>this.resetTimeUpdate_(),n=this.playlistController_,a=["main","subtitle","audio"],o={}
53,l=(a.forEach((e)=>{o[e]={reset:()=>this.resetSegmentDownloads_(e),updateend:()=>this.checkSegmentDownloads_(e)},n[e+"SegmentLoader_"].on("appendsdone",o[e].updateend),n[e+"SegmentLoader_"].on("playlistupdate",o[e].reset),this.tech_.on(["seeked","seeking"],o[e].reset);}),(e)=>{["main","audio"].forEach((t)=>{n[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",s),this.tech_.on(h_,r),this.tech_.on("canplay",i),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",s),this.tech_.off(h_,r),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)=>{n[e+"SegmentLoader_"].off("appendsdone",o[e].updateend),n[e+"SegmentLoader_"].off("playlistupdate",o[e].reset),this.tech_.off(["seeked","seeking"],o[e].reset);}),this.checkCurrentTimeTimeout_&&window.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_();};}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&window.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=window.setTimeout(this.monitorCurrentTime_.bind(this),250);}resetSegmentDownloads_(e){var t=this.playlistController_[e+"SegmentLoader_"];0<this[e+"StalledDownloads_"]&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[e+"StalledDownloads_"]=0,this[e+"Buffered_"]=t.buffered_();}checkSegmentDownloads_(e){var t=this.playlistController_,i=t[e+"SegmentLoader_"],s=i.buffered_(),r=function(e,t){if(e!==t){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;}(this[e+"Buffered_"],s);this[e+"Buffered_"]=s,r?this.resetSegmentDownloads_(e):(this[e+"StalledDownloads_"]++,this.logger_(`found #${this[e+"StalledDownloads_"]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:i.playlist_&&i.playlist_.id,buffered:oh(s)}),this[e+"StalledDownloads_"]<10||(this.logger_(e+" loader stalled download exclusion"),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),"subtitle"!==e&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0})));}checkCurrentTime_(){var e,t;if(!this.tech_.paused()&&!this.tech_.seeking())return e=this.tech_.currentTime(),t=this.tech_.buffered(),this.lastRecordedTime===e&&(!t.length||e+oa>=t.end(t.length-1))?this.techWaiting_():void (5<=this.consecutiveUpdates&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e));}resetTimeUpdate_(){this.consecutiveUpdates=0;}fixesBadSeeks_(){if(!this.tech_.seeking())return !1;var e=this.seekable(),t=this.tech_.currentTime();let i;if(this.afterSeekableWindow_(e,t,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(i=s=e.end(e.length-1)),this.beforeSeekableWindow_(e,t)&&(i=(s=e.start(0))+(s===e.end(0)?0:oa)),void 0!==i)this.logger_(`Trying to seek outside of seekable at time ${t} with seekable range ${ol(e)}. Seeking to `+i+".");else{var s=this.playlistController_.sourceUpdater_,e=this.tech_.buffered(),r=s.audioBuffer?s.audioBuffered():null,s=s.videoBuffer?s.videoBuffered():null,n=this.media(),a=n.partTargetDuration||2*(n.targetDuration-on),o=[r,s];for(let l=0;l<o.length;l++)if(o[l]&&oi(o[l],t)<a)return !1;if(0===(n=oe(e,t)).length)return !1;i=n.start(0)+oa,this.logger_(`Buffered region starts (${n.start(0)})  just beyond seek point (${t}). Seeking to ${i}.`);}return this.tech_.setCurrentTime(i),!0;}waiting_(){var e,t;this.techWaiting_()||(e=this.tech_.currentTime(),(t=aZ(t=this.tech_.buffered(),e)).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"})));}techWaiting_(){var e,t=this.seekable(),i=this.tech_.currentTime();
53return !!this.tech_.seeking()||(this.beforeSeekableWindow_(t,i)?(t=t.end(t.length-1),this.logger_(`Fell out of live window at time ${i}. Seeking to live point (seekable end) `+t),this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0):(t=this.tech_.vhs.playlistController_.sourceUpdater_,e=this.tech_.buffered(),this.videoUnderflow_({audioBuffered:t.audioBuffered(),videoBuffered:t.videoBuffered(),currentTime:i})?(this.resetTimeUpdate_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0):0<(t=oe(e,i)).length&&(this.logger_(`Stopped at ${i} and seeking to `+t.start(0)),this.resetTimeUpdate_(),this.skipTheGap_(i),!0)));}afterSeekableWindow_(e,t,i,s=!1){if(!e.length)return !1;let r=e.end(e.length-1)+oa;var n=!i.endList,a="number"==typeof i.partTargetDuration;return t>(r=n&&(a||s)?e.end(e.length-1)+3*i.targetDuration:r);}beforeSeekableWindow_(e,t){return !!(e.length&&0<e.start(0)&&t<e.start(0)-this.liveRangeSafeTimeDelta);}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:i}){if(e){var s,r;let n;return e.length&&t.length?(s=aZ(e,i-3),r=aZ(e,i),(t=aZ(t,i)).length&&!r.length&&s.length&&(n={start:s.end(0),end:t.end(0)})):oe(e,i).length||(n=this.gapFromVideoUnderflow_(e,i)),!!n&&(this.logger_(`Encountered a gap in video from ${n.start} to ${n.end}. Seeking to current time `+i),!0);}}skipTheGap_(e){var t=this.tech_.buffered(),i=this.tech_.currentTime(),t=oe(t,i);this.resetTimeUpdate_(),0!==t.length&&i===e&&(this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",t.start(0)),this.tech_.setCurrentTime(t.start(0)+on),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}));}gapFromVideoUnderflow_(e,t){var i=function(e){if(e.length<2)return aJ();var t=[];for(let i=1;i<e.length;i++){var s=e.end(i-1),r=e.start(i);t.push([s,r]);}return aJ(t);}(e);for(let s=0;s<i.length;s++){var r=i.start(s),n=i.end(s);if(t-r<4&&2<t-r)return {start:r,end:n};}return null;}}let hT={errorInterval:30,getSource(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource());}},hS=function(e,t){let i=0,s=0;function r(t){null!=t&&(s=e.duration()!==1/0&&e.currentTime()||0,e.one("loadedmetadata",l),e.src(t),e.trigger({type:"usage",name:"vhs-error-reload"}),e.play());}function n(){if(Date.now()-i<1e3*o.errorInterval)e.trigger({type:"usage",name:"vhs-error-reload-canceled"});else{if(o.getSource&&"function"==typeof o.getSource)return i=Date.now(),o.getSource.call(e,r);ri.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");}}function a(){e.off("loadedmetadata",l),e.off("error",n),e.off("dispose",a);}let o=aQ(hT,t),l=(e.ready(()=>{e.trigger({type:"usage",name:"vhs-error-reload-initialized"});}),function(){s&&e.currentTime(s);});e.on("error",n),e.on("dispose",a),e.reloadSourceOnError=function(t){a(),hS(e,t);};};function h0(e,t){var i=t.media();let s=-1;for(let r=0;r<e.length;r++)if(e[r].id===i.id){s=r;break;}e.selectedIndex_=s,e.trigger({selectedIndex:s,type:"change"});}let hE={PlaylistLoader:o4,Playlist:ok,utils:sD,STANDARD_PLAYLIST_SELECTOR:l4,INITIAL_PLAYLIST_SELECTOR:function(){var e=this.playlists.main.playlists.filter(ok.isEnabled),e=(l6(e,(e,t)=>l$(e,t)),e.filter((e)=>
53!!l8(this.playlists.main,e).video));return e[0]||null;},lastBandwidthSelector:l4,movingAverageBandwidthSelector:function(e){let t=-1,i=-1;if(e<0||1<e)throw Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var s=this.useDevicePixelRatio&&window.devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),0<this.systemBandwidth&&this.systemBandwidth!==i&&(t=e*this.systemBandwidth+(1-e)*t,i=this.systemBandwidth),l1(this.playlists.main,t,parseInt(lv(this.tech_.el(),"width"),10)*s,parseInt(lv(this.tech_.el(),"height"),10)*s,this.limitRenditionByPlayerDimensions,this.playlistController_);};},comparePlaylistBandwidth:l$,comparePlaylistResolution:function(e,t){let i,s;return (i=(i=e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width?e.attributes.RESOLUTION.width:i)||window.Number.MAX_VALUE)===(s=(s=t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width?t.attributes.RESOLUTION.width:s)||window.Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-s;},xhr:oR()},hk=(Object.keys(oZ).forEach((e)=>{Object.defineProperty(hE,e,{get:()=>(ri.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),oZ[e]),set(t){ri.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),"number"!=typeof t||t<0?ri.log.warn(`value of Vhs.${e} must be greater than or equal to 0`):oZ[e]=t;}});}),"videojs-vhs"),hw=(hE.canPlaySource=function(){return ri.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.");},({player:e,sourceKeySystems:t,audioMedia:i,mainPlaylists:s})=>{if(!e.eme.initializeMediaKeys)return Promise.resolve();var r,i=i?s.concat([i]):s,i=(s=i,r=Object.keys(t),s.reduce((e,t)=>{var i;return t.contentProtection&&Object.keys(i=r.reduce((e,i)=>{var s=t.contentProtection[i];return s&&s.pssh&&(e[i]={pssh:s.pssh}),e;},{})).length&&e.push(i),e;},[]));let n=[],a=[];return i.forEach((t)=>{a.push(new Promise((t,i)=>{e.tech_.one("keysessioncreated",t);})),n.push(new Promise((i,s)=>{e.eme.initializeMediaKeys({keySystems:t},(e)=>{e?s(e):i();});}));}),Promise.race([Promise.all(n),Promise.race(a)]);}),hC=({player:e,sourceKeySystems:t,media:i,audioMedia:s})=>!(!(t=((e,t,i)=>{if(!e)return e;let s={};t&&t.attributes&&t.attributes.CODECS&&(s=lA(r$(t.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(s.audio=i.attributes.CODECS);var r=r_(s.video),n=r_(s.audio),a={};for(let o in e)a[o]={},n&&(a[o].audioContentType=n),r&&(a[o].videoContentType=r),t.contentProtection&&t.contentProtection[o]&&t.contentProtection[o].pssh&&(a[o].pssh=t.contentProtection[o].pssh),"string"==typeof e[o]&&(a[o].url=e[o]);return aQ(e,a);})(t,i,s))||(e.currentSource().keySystems=t)&&!e.eme&&(ri.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),1)),hx=()=>{if(!window.localStorage)return null;var e=window.localStorage.getItem(hk);if(!e)return null;try{return JSON.parse(e);}catch(t){return null;}},h2=(e,t)=>{e._requestCallbackSet||(e._requestCallbackSet=new Set()),e._requestCallbackSet.add(t);},hI=(e,t)=>{e._responseCallbackSet||(e._responseCallbackSet=new Set()),e._responseCallbackSet.add(t);},hL=(e,t)=>{e._requestCallbackSet&&(e._requestCallbackSet.delete(t),e._requestCallbackSet.size||delete e._requestCallbackSet);},hD=(e,t)=>{e._responseCallbackSet&&(e._responseCallbackSet.delete(t),e._responseCallbackSet.size||delete e._responseCallbackSet);};hE.supportsNativeHls=function(){if(!document||!document.createElement)return !1;let e=document.createElement("video");return !!ri.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));});}(),hE.supportsNativeDash=!!(document&&document.createElement&&ri.getTech("Html5").isSupported())&&/maybe|probably/i.test(document.createElement("video").canPlayType("application/dash+xml")),hE.supportsTypeNatively=(e)=>"hls"===e?hE.supportsNativeHls:"dash"===e&&hE.supportsNativeDash,hE.isSupported=function(){return ri.log.warn("VHS is no longer a tech. Please remove it from your player'
53s techOrder.");},hE.xhr.onRequest=function(e){h2(hE.xhr,e);},hE.xhr.onResponse=function(e){hI(hE.xhr,e);},hE.xhr.offRequest=function(e){hL(hE.xhr,e);},hE.xhr.offResponse=function(e){hD(hE.xhr,e);};class hA extends ri.getComponent("Component"){constructor(e,t,i){if(super(t,i.vhs),"number"==typeof i.initialBandwidth&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=aY("VhsHandler"),t.options_&&t.options_.playerId&&(i=ri.getPlayer(t.options_.playerId),this.player_=i),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(document,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],(e)=>{var t=document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement;t&&t.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_();}),this.on(this.tech_,"seeking",function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime());}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading();}),this.on(this.tech_,"play",this.play);}setOptions_(){var 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||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.calculateTimestampOffsetForEachSegment=this.options_.calculateTimestampOffsetForEachSegment||!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&&((e=hx())&&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=oZ.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===oZ.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","calculateTimestampOffsetForEachSegment","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;}src(e,t){e&&(this.setOptions_(),this.options_.src=0===(e=this.source_.src).toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")?JSON.parse(e.substring(e.indexOf(",")+1)):e,this.options_.tech=this.tech_,this.options_.externVhs=hE,this.options_.sourceType=rp(t),this.options_.seekTo=(e)=>{this.tech_.setCurrentTime(e);},this.playlistController_=new hv(this.options_),e=aQ({liveRangeSafeTimeDelta:oa},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_}),this.playbackWatcher_=new hb(e),this.playlistController_.on("error",()=>{var e=ri.players[this.tech_.options_.playerId];let t=this.playlistController_.error;"object"!=typeof t||t.code?"string"==typeof t&&(t={message:t,code:3}):t.code=3,e.error(t);}),t=this.options_.bufferBasedABR?hE.movingAverageBandwidthSelector(.55):hE.STANDARD_PLAYLIST_SELECTOR,this.playlistController_.selectPlaylist=(this.selectPlaylist||t).bind(this),this.playlistController_.selectInitialPlaylist=hE.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;var t=window.navigator.connection||window.navigator.mozConnection||window.navigator.webkitConnection;return this.options_.useNetworkInformationApi&&t&&(e=1e7<=(t=1e3*t.downlink*1e3)&&1e7<=e?Math.max(e,t):t),e;},set(e){this.playlistController_.mainSegmentLoader_.bandwidth=e,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0};}},systemBandwidth:{get(){let e;return Math.floor(1/(1/(this.bandwidth||1)+(e=0<this.throughput?1/this.throughput:0)));},set(){ri.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:()=>oh(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:()=>oh(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",()=>{if(this.options_.useBandwidthFromLocalStorage){var e={bandwidth:this.bandwidth,throughput:Math.round(this.throughput)};if(window.localStorage){var t=(t=hx())?aQ(t,e):e;try{window.localStorage.setItem(hk,JSON.stringify(t));}catch(i){return;}}}}),this.playlistController_.on("selectedinitialmedia",()=>{var e;(e=this).representations=()=>{var t=e.playlistController_.main(),t=oE(t)?e.playlistController_.getAudioTrackPlaylists_():t.playlists;return t?t.filter((e)=>
53!o$(e)).map((t,i)=>new h$(e,t,t.id)):[];};}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_();}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress");}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0;}),this.setupQualityLevels_(),this.tech_.el())&&(this.mediaSourceUrl_=window.URL.createObjectURL(this.playlistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_));}createKeySessions_(){var e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),hw({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_(){var e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,e=hC({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});this.player_.tech_.on("keystatuschange",(e)=>{if("output-restricted"===e.status&&(e=this.playlistController_.main())&&e.playlists){let t=[];
53e.playlists.forEach((e)=>{e&&e.attributes&&e.attributes.RESOLUTION&&720<=e.attributes.RESOLUTION.height&&(!e.excludeUntil||e.excludeUntil<1/0)&&(e.excludeUntil=1/0,t.push(e));}),t.length&&(ri.log.warn('DRM keystatus changed to "output-restricted." Removing the following HD playlists that will most likely fail to play and clearing the buffer. This may be due to HDCP restrictions on the stream and the capabilities of the current device.',...t),this.playlistController_.mainSegmentLoader_.resetEverything(),this.playlistController_.fastQualityChange_());}}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),e?this.createKeySessions_():this.playlistController_.sourceUpdater_.initializedEme();}setupQualityLevels_(){var e=ri.players[this.tech_.options_.playerId];e&&e.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{var e,t;e=this.qualityLevels_,(t=this).representations().forEach((t)=>{e.addQualityLevel(t);}),h0(e,t.playlists);}),this.playlists.on("mediachange",()=>{h0(this.qualityLevels_,this.playlists);}));}static version(){return {"@videojs/http-streaming":"3.7.0","mux.js":"7.0.1","mpd-parser":"1.2.2","m3u8-parser":"7.1.0","aes-decrypter":"4.0.1"};}version(){return this.constructor.version();}canChangeType(){return he.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_&&window.URL.revokeObjectURL&&(window.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose();}convertToProgramTime(e,t){return oH({playlist:this.playlistController_.media(),time:e,callback:t});}seekToProgramTime(e,t,i=!0,s=2){return oV({programTime:e,playlist:this.playlistController_.media(),retryCount:s,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t});}setupXhrHooks_(){this.xhr.onRequest=(e)=>{h2(this.xhr,e);},this.xhr.onResponse=(e)=>{hI(this.xhr,e);},this.xhr.offRequest=(e)=>{hL(this.xhr,e);},this.xhr.offResponse=(e)=>{hD(this.xhr,e);},this.player_.trigger("xhr-hooks-ready");}}let hP={name:"videojs-http-streaming",VERSION:"3.7.0",canHandleSource:(e,t={})=>(t=aQ(ri.options,t),hP.canPlayType(e.type,t)),handleSource:(e,t,i={})=>(i=aQ(ri.options,i),t.vhs=new hA(e,t,i),t.vhs.xhr=oR(),t.vhs.setupXhrHooks_(),t.vhs.src(e.src,e.type),t.vhs),canPlayType:(e,t)=>(e=rp(e))&&(t=hP.getOverrideNative(t),!hE.supportsTypeNatively(e)||t)?"maybe":"",getOverrideNative(e={}){var {vhs:e={}}=e,t=!(ri.browser.IS_ANY_SAFARI||ri.browser.IS_IOS),{overrideNative:e=t}=e;return e;}};return ru("avc1.4d400d,mp4a.40.2")&&ri.getTech("Html5").registerSourceHandler(hP,0),ri.VhsHandler=hA,ri.VhsSourceHandler=hP,ri.Vhs=hE,ri.use||ri.registerComponent("Vhs",hE),ri.options.vhs=ri.options.vhs||{},ri.getPlugin&&ri.getPlugin("reloadSourceOnError")||ri.registerPlugin("reloadSourceOnError",function(e){hS(this,e);}),ri;},"object"==typeof exports&&"undefined"!=typeof module?module.exports=s():"function"==typeof define&&define.amd?define(s):(i="undefined"!=typeof globalThis?globalThis:i||self).videojs=s();});}};}(Drupal,once);;
54(function(Drupal){'use strict';Drupal.wizionaryMdn=Drupal.wizionaryMdn||{};function setLocalStorage(name,value){localStorage.setItem(name,value);}function getLocalStorage(name){return localStorage.getItem(name);}function isStaticMode(){return getLocalStorage('isStaticed')==='true';}Drupal.wizionaryMdn.utils={setLocalStorage,getLocalStorage,isStaticMode};})(Drupal);;
55(function(Drupal){'use strict';Drupal.wizionaryMdn=Drupal.wizionaryMdn||{};const {setLocalStorage,isStaticMode}=Drupal.wizionaryMdn.utils;class VideoPlayer{constructor(){this.players=[];this.currentIndex=0;this.uuids=[];this.activePlayerIndex=0;this.attachEventListeners();}isStaticMode(){return isStaticMode();}toggleStaticMode(){const isStatic=!this.isStaticMode();
55this.players.forEach((player)=>{if(isStatic)player.pause();else player.play();});setLocalStorage('isStaticed',String(isStatic));}loadVideo(index){const videoSrc=`https://gfx.wizionary.com/${this.uuids[index]}/playlist.m3u8`;const activePlayer=this.players[this.activePlayerIndex];const nextPlayerIndex=(this.activePlayerIndex+1)%this.players.length;const nextPlayer=this.players[nextPlayerIndex];nextPlayer.src({type:'application/x-mpegURL',src:videoSrc});if(this.uuids.length===1)nextPlayer.loop(true);else nextPlayer.loop(false);nextPlayer.one('loadedmetadata',()=>{this.playNext(activePlayer,nextPlayer);if(this.uuids.length>1){const nextIndex=index+1>=this.uuids.length?0:index+1;nextPlayer.one('ended',()=>{this.loadVideo(nextIndex);});}});}playNext(activePlayer,nextPlayer){nextPlayer.play();this.activePlayerIndex=(this.activePlayerIndex+1)%this.players.length;this.currentIndex=(this.currentIndex+1)%this.uuids.length;}removeComponents(player){const componentsToRemove=['BigPlayButton','ControlBar','TextTrackDisplay','TextTrackSettings','PosterImage','ErrorDisplay'];componentsToRemove.forEach((component)=>player.removeChild(component));}addPlayer(element){if(!element)return;const opts={disablePictureInPicture:true,loop:false,muted:true,fill:true,autoplay:!this.isStaticMode(),fluid:true};let player=(window.videojs&&(window.videojs.getPlayer(element)||window.videojs(element,opts)));if(!player)return;try{player.ready(()=>this.removeComponents(player));}catch(e){}if(!this.players.includes(player))this.players.push(player);if(this.players.length===1)this.setupInitialVideoStream(element);const movementToggle=document.querySelector('#movement-toggle');
55if(movementToggle)movementToggle.addEventListener('click',()=>{if(!this.isStaticMode())player.play();else player.pause();setLocalStorage('isStaticed',String(this.isStaticMode()));});}setupInitialVideoStream(element){const figure=element.closest('.video');if(figure&&figure.dataset.stream){this.uuids=figure.dataset.stream.split(',');if(!this.isStaticMode())this.loadVideo(0);}}attachEventListeners(){const observer=new IntersectionObserver((entries)=>{entries.forEach((entry)=>{const player=this.players.find((p)=>p.el()===entry.target);if(player)if(entry.isIntersecting){player.muted(this.isStaticMode());player.play().catch((error)=>console.error('Error auto-playing video:',error));}else{player.pause();player.currentTime(0);}});},{root:null,rootMargin:'0px',threshold:0.5});this.players.forEach((player)=>{observer.observe(player.el());});}}Drupal.wizionaryMdn.VideoPlayer=VideoPlayer;})(Drupal);;
56(function(Drupal){'use strict';Drupal.wizionaryMdn=Drupal.wizionaryMdn||{};const {isStaticMode}=Drupal.wizionaryMdn.utils;const KARAOKE_NEXT_PREP_WINDOW=3;const NEXT_LINE_BASE_SCALE=0.86;const NEXT_LINE_MAX_SCALE=1.05;const CURRENT_LINE_GRAY_TARGET={r:168,g:168,b:168};class MusicPlayer{constructor(element,context,videoPlayerInstance){this.element=element;this.context=context;this.videoPlayerInstance=videoPlayerInstance;this.player=videojs.getPlayer(element)||this.initializePlayer(element);this.primaryHlsSource=this.getPrimaryHlsSource();this.hlsRecoveryAttempted=false;this.hlsRecoveryTimer=null;this.disableCaptionFade=this.detectCaptionFadeDisabled();this.karaokeOverlay=null;this.karaokeLines={};this.karaokeActiveTrack=null;this.karaokeAvailable=false;this.karaokeActive=false;this.karaokeLastCueIndex=null;this.karaokeLastRenderedSignature=null;this._karaokeProgressFrame=null;this._karaokeProgressTarget=null;this.findVideoWrapper();this.initializeKaraokeSupport();this.setup();this.setupFullscreenModeSync();}getPrimaryHlsSource(){try{const source=this.element&&this.element.querySelector&&this.element.querySelector('source[type="application/x-mpegURL"]');return source?source.getAttribute('src'):'';}catch(e){return '';}}buildCacheBustedStreamUrl(url){if(!url)return '';try{const withBase=new URL(url,window.location.href);withBase.searchParams.set('_wiz_hls_retry',String(Date.now()));return withBase.toString();}catch(e){const separator=url.indexOf('?')===-1?'?':'&';return `${url}${separator}_wiz_hls_retry=${Date.now()}`;}}attemptHlsRecovery(){if(this.hlsRecoveryAttempted||!this.primaryHlsSource||!this.player)return;this.hlsRecoveryAttempted=true;const resumePlayback=!this.player.paused();if(this.hlsRecoveryTimer){try{window.clearTimeout(this.hlsRecoveryTimer);}catch(e){}this.hlsRecoveryTimer=null;}this.hlsRecoveryTimer=window.setTimeout(()=>{const retryUrl=this.buildCacheBustedStreamUrl(this.primaryHlsSource);if(!retryUrl)return;try{if(typeof this.player.error==='function')this.player.error(null);this.player.src({type:'application/x-mpegURL',src:retryUrl});this.player.one('loadedmetadata',()=>{if(!resumePlayback)return;try{this.player.play().catch(()=>{});}catch(e){}});}catch(e){}},350);}initializePlayer(element){let player=videojs(element,{disablePictureInPicture:true,loop:false,fluid:true,controlBar:{pictureInPictureToggle:false},html5:{nativeTextTracks:false}});const componentsToRemove=['PosterImage','ErrorDisplay','TitleBar','LoadingSpinner'];componentsToRemove.forEach((component)=>player.removeChild(component));player.controlBar.fullscreenToggle.hide();return player;}detectCaptionFadeDisabled(){try{const audioFigure=this.element.closest('figure.audio');return !!(audioFigure&&audioFigure.classList.contains('disable-fadein'));}catch(e){return false;}}setup(){this.modifyVideoWrapper();this.registerComponents();this.playerReadyActions();this.bindPlayerEvents();}setupFullscreenModeSync(){if(typeof document==='undefined')return;if(this._fullscreenChangeHandler){this.updateBodyFullscreenClass();return;}this._fullscreenChangeHandler=()=>{this.updateBodyFullscreenClass();};const fullscreenEvents=['fullscreenchange','webkitfullscreenchange','mozfullscreenchange','MSFullscreenChange'];
56fullscreenEvents.forEach((eventName)=>{try{document.addEventListener(eventName,this._fullscreenChangeHandler);}catch(e){}});this.updateBodyFullscreenClass();}updateBodyFullscreenClass(){if(typeof document==='undefined'||!document.body)return;const fullscreenElement=document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement;document.body.classList.toggle('fullscreen-mode',!!fullscreenElement);}stopKaraokeProgressLoop(){if(typeof window!=='undefined'&&typeof window.cancelAnimationFrame==='function'&&this._karaokeProgressFrame)try{window.cancelAnimationFrame(this._karaokeProgressFrame);}catch(e){}this._karaokeProgressFrame=null;this._karaokeProgressTarget=null;}computeNextCuePrepProgress(currentTime,upcomingStart){if(!Number.isFinite(upcomingStart)||!Number.isFinite(currentTime))return 0;const windowStart=upcomingStart-KARAOKE_NEXT_PREP_WINDOW;const effectiveStart=Math.max(0,windowStart);if(currentTime<=effectiveStart)return 0;if(currentTime>=upcomingStart)return 1;const span=upcomingStart-effectiveStart;if(span<=0)return 1;return Math.min(1,(currentTime-effectiveStart)/span);}getLineBaseColorChannels(line){if(!line||typeof window==='undefined'||typeof window.getComputedStyle!=='function')return null;try{if(line.dataset&&line.dataset.baseColorRgb){const cached=line.dataset.baseColorRgb.split(',').map((part)=>parseFloat(part));if(cached.length>=3&&cached.slice(0,3).every((value)=>Number.isFinite(value)))return {r:cached[0],g:cached[1],b:cached[2]};}const computed=window.getComputedStyle(line);if(!computed)return null;const colorString=computed.color;const match=colorString&&colorString.match(/rgba?\(([^)]+)\)/);if(!match)return null;const parts=match[1].split(',').map((part)=>parseFloat(part.trim()));if(parts.length<3)return null;const [r,g,b]=parts;if(![r,g,b].every((value)=>Number.isFinite(value)))return null;if(line.dataset)line.dataset.baseColorRgb=`${r},${g},${b}`;return {r,g,b};}catch(e){return null;}}resetCurrentLineFade(line){if(!line||!line.style)return;try{line.style.color='';}catch(e){}if(line.dataset)delete line.dataset.currentFadeApplied;}applyCurrentLineFade(line,progress,hasUpcoming){if(!line||!line.style)return;if(!hasUpcoming||!(progress>0)){this.resetCurrentLineFade(line);return;}const clamped=Math.min(Math.max(progress,0),1);const base=this.getLineBaseColorChannels(line);if(!base)return;const target=CURRENT_LINE_GRAY_TARGET;const mix=(component)=>{const baseValue=base[component];const targetValue=target[component];if(!Number.isFinite(baseValue)||!Number.isFinite(targetValue))return baseValue;return baseValue+((targetValue-baseValue)*clamped);};const r=Math.round(Math.min(Math.max(mix('r'),0),255));const g=Math.round(Math.min(Math.max(mix('g'),0),255));const b=Math.round(Math.min(Math.max(mix('b'),0),255));const colorValue=`rgb(${r}, ${g}, ${b})`;try{if(line.style.color!==colorValue)line.style.color=colorValue;}catch(e){}if(line.dataset)line.dataset.currentFadeApplied='1';}resetNextLineScale(line){if(!line||!line.style)return;try{line.style.removeProperty('--karaoke-next-scale');}catch(e){}if(line.dataset)delete line.dataset.nextScaleApplied;}applyNextLinePreScale(line,progress,hasUpcoming){if(!line||!line.style)return;if(!hasUpcoming||!(progress>0)){this.resetNextLineScale(line);return;}const clamped=Math.min(Math.max(progress,0),1);const baseScale=NEXT_LINE_BASE_SCALE;const targetScale=NEXT_LINE_MAX_SCALE;const scale=baseScale+((targetScale-baseScale)*clamped);try{line.style.setProperty('--karaoke-next-scale',scale.toFixed(4));}catch(e){}if(line.dataset)line.dataset.nextScaleApplied='1';}resetKaraokeLineDynamicState(line,role){if(!line)return;if(!role||role==='current')this.resetCurrentLineFade(line);if(!role||role==='next')this.resetNextLineScale(line);}updateKaraokeLineCueWindowVisuals(target,currentTime){if(!target)return;const {line,upcomingLine,upcomingStart}=target;const hasUpcoming=Number.isFinite(upcomingStart);const prepProgress=this.computeNextCuePrepProgress(currentTime,upcomingStart);if(line)this.applyCurrentLineFade(line,prepProgress,hasUpcoming);if(upcomingLine)this.applyNextLinePreScale(upcomingLine,prepProgress,hasUpcoming);}startKaraokeProgressLoop(lineElement,cueStart,targetEnd,upcomingLine,upcomingCueStart){if(!lineElement||!Number.isFinite(cueStart)||!Number.isFinite(targetEnd)){if(lineElement)try{lineElement.style.removeProperty('--karaoke-progress');}catch(e){}this.stopKaraokeProgressLoop();return;}if(targetEnd<=cueStart)targetEnd=cueStart+0.001;this.stopKaraokeProgressLoop();this._karaokeProgressTarget={line:lineElement,start:cueStart,end:targetEnd,upcomingLine:upcomingLine||null,upcomingStart:Number.isFinite(upcomingCueStart)?upcomingCueStart:null};const canAnimate=typeof window!=='undefined'&&typeof window.requestAnimationFrame==='function';const step=()=>{const target=this._karaokeProgressTarget;if(!target||!this.karaokeActive){this.stopKaraokeProgressLoop();return;}const {line,start,end}=target;const isConnected=line&&(typeof line.isConnected==='boolean'?line.isConnected:!!(line.ownerDocument&&line.ownerDocument.body&&line.ownerDocument.body.contains(line)));if(!line||!isConnected||!this.player||typeof this.player.currentTime!=='function'){this.stopKaraokeProgressLoop();return;}const duration=end-start;let progress=0;let currentTime=start;if(typeof this.player.currentTime==='function')try{currentTime=this.player.currentTime();}catch(e){currentTime=start;}if(duration>0)progress=(currentTime-start)/duration;if(progress<0)progress=0;else{if(progress>1)progress=1;}try{line.style.setProperty('--karaoke-progress',`${(progress*100).toFixed(3)}%`);}catch(e){}this.updateKaraokeLineCueWindowVisuals(target,currentTime);if(!canAnimate){this._karaokeProgressFrame=null;this._karaokeProgressTarget=null;return;}try{this._karaokeProgressFrame=window.requestAnimationFrame(step);}catch(e){this._karaokeProgressFrame=null;}};step();}checkIfVideoStarted(){if(this.player.currentTime()>0)document.body.classList.add('player-started');else document.body.classList.remove('player-started');}findVideoWrapper(){const mediaWrapper=this.element.closest('.media_wrapper');if(mediaWrapper){this.videoWrapper=mediaWrapper.querySelector('.video');if(this.videoWrapper&&this.videoPlayerInstance)this.videoWrapper.videoPlayerInstance=this.videoPlayerInstance;}if(!this.videoWrapper)console.error('Element .video nebyl nalezen v rámci .media_wrapper.');}modifyVideoWrapper(){document.addEventListener('DOMContentLoaded',()=>{if(this.videoWrapper){var isStatic=isStaticMode();if(isStatic)this.videoWrapper.classList.add('static-mode');else this.videoWrapper.classList.remove('static-mode');}});}registerComponents(){const player=this.player;const musicPlayerInstance=this;class StopButton extends videojs.getComponent('Button'){constructor(player,options){super(player,options);this.controlText(Drupal.t('Stop'));}createEl(){var el=super.createEl('button',{className:'vjs-control vjs-button vjs-stop-button'});return el;}handleClick(event){player.pause();player.currentTime(0);document.body.classList.remove('player-playing');}}videojs.registerComponent('StopButton',StopButton);class MovementToggleButton extends videojs.getComponent('Button'){constructor(player,options,videoWrapper){super(player,options);this.videoWrapper=videoWrapper;this.controlText('Toggle Movement');}createEl(){var el=super.createEl('button',{className:'vjs-movement-toggle-button vjs-control vjs-svg-icon',innerHTML:'<svg viewBox="0 0 24 24" width="25" height="25" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="10" y1="15" x2="10" y2="9"></line><line x1="14" y1="15" x2="14" y2="9"></line></svg>'});return el;}handleClick(event){var isStatic=!this.videoWrapper.videoPlayerInstance.isStaticMode();this.videoWrapper.classList.toggle('static-mode');this.videoWrapper.videoPlayerInstance.toggleStaticMode();localStorage.setItem('isStaticed',String(isStatic));}}videojs.registerComponent('MovementToggleButton',MovementToggleButton);class GrayscaleButton extends videojs.getComponent('Button'){constructor(player,options,videoWrapper){super(player,options);this.videoWrapper=videoWrapper;this.controlText('Grayscale');}createEl(){var el=super.createEl('button',{className:'vjs-grayscale-button vjs-control vjs-svg-icon',innerHTML:'<svg viewBox="0 0 24 24" width="25" height="25" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg>'});return el;}handleClick(event){this.videoWrapper.classList.toggle('gray-mode');}}videojs.registerComponent('GrayscaleButton',GrayscaleButton);class BlurButton extends videojs.getComponent('Button'){constructor(player,options,videoWrapper){super(player,options);this.videoWrapper=videoWrapper;this.controlText(Drupal.t('Blur Mode'));}createEl(){var el=super.createEl('button',{className:'vjs-blur-button vjs-control vjs-svg-icon',innerHTML:'<svg viewBox="0 0 24 24" width="25" height="25" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2.69l5.66 5.66a8 8 0 1 1-11.31 0z"></path></svg>'});return el;}handleClick(event){this.videoWrapper.classList.toggle('blur-mode');}}videojs.registerComponent('BlurButton',BlurButton);class KaraokeButton extends videojs.getComponent('Button'){constructor(player,options){super(player,options);this.controlText(Drupal.t('Karaoke Mode'));}createEl(){const el=super.createEl('button',{className:'vjs-karaoke-button vjs-control vjs-svg-icon'});el.innerHTML='<svg viewBox="0 0 32 32" width="25" height="25" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"><path class="st0" d="M27,31H5c-1.1,0-2-0.9-2-2V16h26v13C29,30.1,28.1,31,27,31z"/><path class="st0" d="M23.5,1.1L2.8,8.7c-1,0.4-1.6,1.5-1.2,2.6L3,15l24.4
56-8.9l-1.4-3.8C25.7,1.3,24.5,0.8,23.5,1.1z"/><line class="st0" x1="3" y1="21" x2="29" y2="21"/></svg>';el.setAttribute('aria-pressed','false');return el;}handleClick(event){if(this.hasClass&&this.hasClass('vjs-disabled'))return;musicPlayerInstance.toggleKaraokeMode();}}videojs.registerComponent('KaraokeButton',KaraokeButton);class WidescreenButton extends videojs.getComponent('Button'){constructor(player,options){super(player,options);this.controlText('Widescreen');}createEl(){var el=super.createEl('button',{className:'vjs-fullscreen-control vjs-control vjs-button'});el.innerHTML='<span aria-hidden="true" class="vjs-icon-placeholder"></span>';return el;}handleClick(event){const syncBodyClass=()=>{musicPlayerInstance.updateBodyFullscreenClass();};const exitFullscreen=document.exitFullscreen||document.webkitExitFullscreen||document.mozCancelFullScreen||document.msExitFullscreen;const requestFullscreen=document.documentElement&&(document.documentElement.requestFullscreen||document.documentElement.webkitRequestFullscreen||document.documentElement.mozRequestFullScreen||document.documentElement.msRequestFullscreen);const isFullscreen=!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement);const handleResult=(result,errorMessage)=>{if(typeof Promise==='undefined'){syncBodyClass();return;}Promise.resolve(result).then(syncBodyClass).catch((err)=>{if(err&&err.name)console.error(`${errorMessage}: ${err.message} (${err.name})`);else if(err)console.error(`${errorMessage}: ${err}`);else console.error(errorMessage);syncBodyClass();});};if(isFullscreen){if(exitFullscreen)try{const result=exitFullscreen.call(document);handleResult(result,'Error attempting to exit full-screen mode');}catch(err){console.error(`Error attempting to exit full-screen mode: ${err.message} (${err.name})`);syncBodyClass();}else syncBodyClass();return;}if(requestFullscreen)try{const result=requestFullscreen.call(document.documentElement);handleResult(result,'Error attempting to enable full-screen mode');}catch(err){console.error(`Error attempting to enable full-screen mode: ${err.message} (${err.name})`);syncBodyClass();}else syncBodyClass();}}videojs.registerComponent('WidescreenButton',WidescreenButton);}playerReadyActions(){this.player.ready(()=>{this.addControlButtons();this.loadCaptions();this.customizeTextTrackSettings();this.mountKaraokeOverlay();const bigPlayButton=this.player.getChild('BigPlayButton');if(bigPlayButton){const el=bigPlayButton.el();el.removeAttribute('title');const playerInstance=this.player;const togglePlayback=(event)=>{if(event&&typeof event.preventDefault==='function')event.preventDefault();if(playerInstance.paused())playerInstance.play();else playerInstance.pause();};bigPlayButton.handleClick=function(event){togglePlayback(event);};}const controlBar=this.player.getChild('controlBar');if(controlBar)controlBar.addClass('accent_light');const playButton=document.querySelector('#play');if(playButton)playButton.addEventListener('click',()=>{this.player.play();});const params=new URLSearchParams(window.location.search);if(params.get('autoplay')==='true')this.player.play();});this.initIntersectionObserver();}initIntersectionObserver(){if(!document.body.classList.contains('path-taxonomy'))return;const observerOptions={root:null,rootMargin:'0px',threshold:0.5};this.observer=new IntersectionObserver((entries)=>{entries.forEach((entry)=>{if(entry.isIntersecting)this.player.play().catch((error)=>{});else{this.player.pause();this.player.currentTime(0);}});},observerOptions);this.observer.observe(this.player.el());}bindPlayerEvents(){const player=this.player;player.on('error',()=>{if(!this.primaryHlsSource)return;let currentSource='';try{const srcObj=(typeof player.currentSource==='function')?player.currentSource():null;currentSource=srcObj&&srcObj.src?srcObj.src:'';}catch(e){}const hlsSelected=currentSource.includes('.m3u8')||!currentSource;if(hlsSelected)this.attemptHlsRecovery();});player.on('play',()=>{document.body.classList.add('player-playing');document.body.classList.remove('reached-the-end');try{const ttList=(typeof this.player.textTracks==='function')?this.player.textTracks():null;const currentLang=(window.drupalSettings&&window.drupalSettings.path&&window.drupalSettings.path.currentLanguage)?String(window.drupalSettings.path.currentLanguage).toLowerCase():(window.location.pathname.split('/')[1]||'').toLowerCase();if(ttList&&typeof ttList.length==='number'){for(let i=0;i<ttList.length;i++){const tt=ttList[i];if(!tt||(tt.kind!=='captions'&&tt.kind!=='subtitles'))continue;const lang=String(tt.language||'').toLowerCase();try{tt.mode=(lang===currentLang||(!lang&&i===0))?'showing':'disabled';}catch(e){}}}}catch(e){}this.syncActiveKaraokeTrack();});player.on('ended',()=>{document.body.classList.add('reached-the-end');document.body.classList.remove('player-playing');this.updateKaraokeDisplay();});player.on('timeupdate',()=>{this.checkIfVideoStarted();this.updateKaraokeDisplay();});player.on('seeked',()=>this.updateKaraokeDisplay());player.on('loadedmetadata',()=>this.syncActiveKaraokeTrack());}addControlButtons(){const player=this.player;const controlBar=player.getChild('controlBar');let leftGroup=controlBar.getChild('vjs-control-group-left');if(!leftGroup)leftGroup=controlBar.addChild('Component',{name:'vjs-control-group-left',className:'vjs-control-group vjs-control-group-left'},0);this.createAndAddButton('StopButton',leftGroup);let rightGroup=controlBar.getChild('vjs-control-group-right');
56if(!rightGroup)rightGroup=controlBar.addChild('Component',{name:'vjs-control-group-right',className:'vjs-control-group vjs-control-group-right'});this.createAndAddButton('MovementToggleButton',rightGroup);this.createAndAddButton('BlurButton',rightGroup);this.createAndAddButton('GrayscaleButton',rightGroup);this.createAndAddButton('KaraokeButton',rightGroup);this.createAndAddButton('WidescreenButton',rightGroup);const captionsButton=controlBar.getChild('SubsCapsButton');if(captionsButton)rightGroup.el().appendChild(captionsButton.el());controlBar.children().forEach((child)=>{if(child!==leftGroup&&child!==rightGroup&&child!==captionsButton)leftGroup.addChild(child);});const volumePanel=controlBar.getChild('volumePanel');if(volumePanel)leftGroup.addChild(volumePanel);}createAndAddButton(buttonName,group){const ButtonComponent=videojs.getComponent(buttonName);if(ButtonComponent){const button=new ButtonComponent(this.player,{},this.videoWrapper);if(group)group.el().appendChild(button.el());else this.player.controlBar.addChild(button);if(buttonName==='KaraokeButton'){this.karaokeButton=button;this.updateKaraokeButtonState();}}}customizeTextTrackSettings(){const player=this.player;if(!player||typeof player.getChild!=='function')return;const settingsComponent=player.getChild('TextTrackSettings');if(!settingsComponent||typeof settingsComponent.el!=='function')return;if(settingsComponent._wizionaryCaptionTweaksInit)return;settingsComponent._wizionaryCaptionTweaksInit=true;const translate=(text)=>(typeof Drupal!=='undefined'&&Drupal.t?Drupal.t(text):text);if(settingsComponent.options_)settingsComponent.options_.persistTextTrackSettings=false;const originalGetValues=typeof settingsComponent.getValues==='function'?settingsComponent.getValues.bind(settingsComponent):null;const originalSaveSettings=typeof settingsComponent.saveSettings==='function'?settingsComponent.saveSettings.bind(settingsComponent):null;const colorOptions=[{value:'#F5F5F5',label:translate('White')},{value:'#FFD60A',label:translate('Yellow')}];const fontOptions=[{value:'sceneDefault',label:'Aetherion',css:'sans-serif'},{value:'systemUi',label:'Machina',css:'system-ui, sans-serif'},{value:'verdana',label:'Veridona',css:'"Verdana", sans-serif'},{value:'tahoma',label:'Thaloma',css:'"Tahoma", sans-serif'},{value:'trebuchetMs',label:'Trebuchetis',css:'"Trebuchet MS", "Helvetica Neue", Arial, sans-serif'},{value:'georgia',label:'Georiana',css:'"Georgia", serif'},{value:'cursive',label:'Callidora',css:'cursive'},{value:'fantasy',label:'Drakonis',css:'fantasy'}];const allowedColorValues=colorOptions.map((option)=>option.value);const allowedFontValues=fontOptions.map((option)=>option.value);const fontCssMap=fontOptions.reduce((acc,option)=>{acc[option.value]=option.css;return acc;},{});const storageKey='vjs-text-track-settings';const sanitizeState=(values)=>{const defaults={color:colorOptions[0].value,fontFamily:'sceneDefault',textOpacity:'1',fontPercent:'1.00',bgColor:'',bgOpacity:'0',windowColor:'',windowOpacity:'0',edgeStyle:''};const normalized=Object.assign({},values||{});if(normalized.fgColor&&!normalized.color)normalized.color=normalized.fgColor;delete normalized.fgColor;const state=Object.assign({},defaults,normalized);if(!allowedColorValues.includes(state.color))state.color=defaults.color;if(!allowedFontValues.includes(state.fontFamily))state.fontFamily=defaults.fontFamily;let fontPercentValue=state.fontPercent;if(typeof fontPercentValue!=='string')fontPercentValue=String(fontPercentValue);const numericFontPercent=parseFloat(fontPercentValue);if(!Number.isFinite(numericFontPercent)||numericFontPercent<=0)state.fontPercent=defaults.fontPercent;else state.fontPercent=fontPercentValue;state.bgColor='';state.bgOpacity='0';state.windowColor='';state.windowOpacity='0';state.edgeStyle='';return state;};const readStoredState=()=>{let stored={};try{const raw=window.localStorage.getItem(storageKey);stored=raw?JSON.parse(raw):{};}catch(e){stored={};}if(!stored||typeof stored!=='object')stored={};return sanitizeState(stored);};let state=readStoredState();const persistState=()=>{try{window.localStorage.setItem(storageKey,JSON.stringify(state));}catch(e){}};const getComponentValues=()=>{let componentValues={};if(originalGetValues)try{componentValues=originalGetValues();}catch(e){componentValues={};}componentValues=sanitizeState(Object.assign({},state,componentValues));componentValues.backgroundColor='';componentValues.backgroundOpacity='0';componentValues.windowColor='';componentValues.windowOpacity='0';componentValues.edgeStyle='';componentValues.color=state.color;componentValues.fontPercent=state.fontPercent;componentValues.fontFamily='default';return componentValues;};const applyStateToKaraokeOverlay=()=>{const overlay=this&&this.karaokeOverlay?this.karaokeOverlay:null;if(!overlay||!overlay.style)return;const colorValue=(typeof state.color==='string')?state.color:'';if(colorValue)overlay.style.setProperty('--karaoke-text-color',colorValue);else overlay.style.removeProperty('--karaoke-text-color');const fontCss=(state.fontFamily&&fontCssMap[state.fontFamily])?fontCssMap[state.fontFamily]:'';if(fontCss)overlay.style.setProperty('--karaoke-font-family',fontCss);else overlay.style.removeProperty('--karaoke-font-family');const fontPercent=parseFloat(state.fontPercent);if(Number.isFinite(fontPercent)&&fontPercent>0)overlay.style.setProperty('--karaoke-font-scale',String(fontPercent));else overlay.style.removeProperty('--karaoke-font-scale');};this._applyKaraokeCaptionPreferences=applyStateToKaraokeOverlay;const applyStateToDisplay=()=>
56{const display=player.el&&player.el().querySelector?player.el().querySelector('.vjs-text-track-display'):null;if(display){display.style.color=state.color;const displayFontPercent=parseFloat(state.fontPercent);if(Number.isFinite(displayFontPercent)&&displayFontPercent>0)display.style.fontSize=`${displayFontPercent*100}%`;else display.style.removeProperty('font-size');if(state.fontFamily&&fontCssMap[state.fontFamily])display.style.fontFamily=fontCssMap[state.fontFamily];else display.style.removeProperty('font-family');const cueNodes=display.querySelectorAll('.vjs-text-track-cue');cueNodes.forEach((cue)=>{const cueElement=cue&&cue.firstChild&&cue.firstChild.style?cue.firstChild:cue;if(cue&&cue.style)cue.style.backgroundColor='transparent';if(cueElement&&cueElement.style){cueElement.style.color=state.color;if(state.fontFamily&&fontCssMap[state.fontFamily])cueElement.style.fontFamily=fontCssMap[state.fontFamily];else cueElement.style.removeProperty('font-family');cueElement.style.removeProperty('font-size');}});}const modal=settingsComponent.el?settingsComponent.el():null;if(modal){const preview=modal.querySelector('.vjs-caption-settings-preview-text');if(preview){preview.style.color=state.color;const previewFontPercent=parseFloat(state.fontPercent);if(Number.isFinite(previewFontPercent)&&previewFontPercent>0)preview.style.fontSize=`${previewFontPercent*100}%`;else preview.style.removeProperty('font-size');if(state.fontFamily&&fontCssMap[state.fontFamily])preview.style.fontFamily=fontCssMap[state.fontFamily];else preview.style.removeProperty('font-family');}}applyStateToKaraokeOverlay();};const hideSetting=(modal,selector)=>{modal.querySelectorAll(selector).forEach((el)=>{const container=el.closest('.vjs-track-setting')||el;if(container)container.style.display='none';});};const syncSelectValue=(selectEl,value,fallback)=>{if(!selectEl)return;selectEl.value=value;if(selectEl.value!==value)selectEl.value=fallback;};const applyStateToModal=(modal)=>{if(!modal)return;hideSetting(modal,'.vjs-bg-color');hideSetting(modal,'.vjs-bg-opacity');hideSetting(modal,'.vjs-window-color');hideSetting(modal,'.vjs-window-opacity');hideSetting(modal,'.vjs-edge-style');const colorSelect=modal.querySelector('.vjs-text-color select, .vjs-text-color > select, .vjs-fg-color select');if(colorSelect){colorSelect.innerHTML='';colorOptions.forEach((option)=>{const optionEl=document.createElement('option');optionEl.value=option.value;optionEl.textContent=option.label;colorSelect.appendChild(optionEl);});syncSelectValue(colorSelect,state.color,colorOptions[0].value);if(colorSelect._wizChangeHandler)colorSelect.removeEventListener('change',colorSelect._wizChangeHandler);colorSelect._wizChangeHandler=()=>{const next=allowedColorValues.includes(colorSelect.value)?colorSelect.value:colorOptions[0].value;if(state.color!==next){state.color=next;persistState();applyStateToDisplay();}};colorSelect.addEventListener('change',colorSelect._wizChangeHandler);}const fontSelect=modal.querySelector('.vjs-font-family select, .vjs-font-family > select');if(fontSelect){fontSelect.innerHTML='';fontOptions.forEach((option)=>{const optionEl=document.createElement('option');optionEl.value=option.value;optionEl.textContent=option.label;fontSelect.appendChild(optionEl);});syncSelectValue(fontSelect,state.fontFamily,'sceneDefault');if(fontSelect._wizChangeHandler)fontSelect.removeEventListener('change',fontSelect._wizChangeHandler);fontSelect._wizChangeHandler=()=>{const next=allowedFontValues.includes(fontSelect.value)?fontSelect.value:'sceneDefault';if(state.fontFamily!==next){state.fontFamily=next;persistState();applyStateToDisplay();}};fontSelect.addEventListener('change',fontSelect._wizChangeHandler);}const fontSizeSelect=modal.querySelector('.vjs-font-percent select, .vjs-font-percent > select');if(fontSizeSelect){syncSelectValue(fontSizeSelect,state.fontPercent,'1.00');if(fontSizeSelect._wizChangeHandler)fontSizeSelect.removeEventListener('change',fontSizeSelect._wizChangeHandler);fontSizeSelect._wizChangeHandler=()=>{const rawValue=fontSizeSelect.value;const numericValue=parseFloat(rawValue);const next=(Number.isFinite(numericValue)&&numericValue>0)?rawValue:'1.00';if(state.fontPercent!==next){state.fontPercent=next;persistState();applyStateToDisplay();}};fontSizeSelect.addEventListener('change',fontSizeSelect._wizChangeHandler);}const resetButton=modal.querySelector('.vjs-reset-button');if(resetButton&&!resetButton._wizHandler){resetButton._wizHandler=()=>{state=sanitizeState({});persistState();applyStateToModal(modal);applyStateToDisplay();};resetButton.addEventListener('click',resetButton._wizHandler);}const doneButton=modal.querySelector('.vjs-done-button');if(doneButton&&!doneButton._wizHandler){doneButton._wizHandler=()=>{persistState();applyStateToDisplay();};doneButton.addEventListener('click',doneButton._wizHandler);}applyStateToDisplay();};settingsComponent.getValues=()=>getComponentValues();settingsComponent.setValues=(values)=>{state=sanitizeState(Object.assign({},state,values||{}));persistState();applyStateToModal(settingsComponent.el());applyStateToDisplay();};settingsComponent.restoreSettings=()=>{state=readStoredState();applyStateToModal(settingsComponent.el());applyStateToDisplay();};settingsComponent.saveSettings=()=>{persistState();if(originalSaveSettings&&settingsComponent.options_&&settingsComponent.options_.persistTextTrackSettings)originalSaveSettings();};persistState();applyStateToDisplay();const initializeModal=()=>{if(!settingsComponent.el||!settingsComponent.el())return;try{settingsComponent.setValues(state);}catch(e){}};initializeModal();if(typeof settingsComponent.on==='function')settingsComponent.on('modalopen',initializeModal);const reapply=()=>{state=sanitizeState(state);applyStateToDisplay();};player.on('loadedmetadata',reapply);player.on('texttrackchange',reapply);this.mountKaraokeOverlay();}loadCaptions(){const player=this.player;const videoEl=this.element;const tech=player.tech_;const isNativeText=!!(tech&&tech.featuresNativeTextTracks);const currentLang=(window.drupalSettings&&window.drupalSettings.path&&window.drupalSettings.path.currentLanguage)?String(window.drupalSettings.path.currentLanguage).toLowerCase():(window.location.pathname.split('/')[1]||'').toLowerCase();const registerDomTracksWithPlayer=()=>{try{const pageOrigin=window.location.origin;
56const playerEl=(typeof player.el==='function')?player.el():null;const techEl=player&&player.tech_&&typeof player.tech_.el==='function'?player.tech_.el():null;let tracksInDom=[];try{if(videoEl&&videoEl.querySelectorAll)tracksInDom=tracksInDom.concat(Array.from(videoEl.querySelectorAll('track[kind="captions"], track[kind="subtitles"]')));if(playerEl&&playerEl.querySelectorAll)tracksInDom=tracksInDom.concat(Array.from(playerEl.querySelectorAll('track[kind="captions"], track[kind="subtitles"]')));if(techEl&&techEl.querySelectorAll)tracksInDom=tracksInDom.concat(Array.from(techEl.querySelectorAll('track[kind="captions"], track[kind="subtitles"]')));}catch(e){}const seen=new Set();tracksInDom=tracksInDom.filter((tr)=>{const src=tr.getAttribute&&tr.getAttribute('src')||'';if(!src)return true;if(seen.has(src))return false;seen.add(src);return true;});if(!tracksInDom.length){this.setKaraokeAvailable(false);return false;}this.setKaraokeAvailable(true);const needsXOrigin=tracksInDom.some((tr)=>{const src=tr.getAttribute('src')||'';if(!src)return false;try{return new URL(src,pageOrigin).origin!==pageOrigin;}catch(e){return false;}});if(needsXOrigin&&!videoEl.hasAttribute('crossorigin'))videoEl.setAttribute('crossorigin','anonymous');let matched=false;tracksInDom.forEach((tr)=>tr.removeAttribute('default'));for(const tr of tracksInDom){const lang=String(tr.getAttribute('srclang')||'').toLowerCase();if(lang&&lang===currentLang){tr.setAttribute('default','');matched=true;break;}}if(!matched&&tracksInDom[0])tracksInDom[0].setAttribute('default','');const remoteEls=(typeof player.remoteTextTrackEls==='function')?player.remoteTextTrackEls():null;const remoteSrcs=[];if(remoteEls&&typeof remoteEls.length==='number'){for(let i=0;i<remoteEls.length;i++){const el=remoteEls[i];const src=el&&el.getAttribute?(el.getAttribute('src')||''):'';if(src)remoteSrcs.push(src);}}tracksInDom.forEach((tr)=>{const src=tr.getAttribute('src')||'';if(!src||remoteSrcs.includes(src))return;const kind=(tr.getAttribute('kind')||'captions');const srclang=tr.getAttribute('srclang')||'';const label=tr.getAttribute('label')||srclang||'CC';const isDefault=tr.hasAttribute('default');try{player.addRemoteTextTrack({kind,src,srclang,label,default:isDefault},false);}catch(e){}});return true;}catch(e){return false;}};const observeTrackInsertions=()=>{try{const mo=new MutationObserver((mutations)=>{let added=false;mutations.forEach((m)=>{m.addedNodes&&Array.from(m.addedNodes).forEach((node)=>{if(node&&node.nodeType===1&&node.tagName&&node.tagName.toLowerCase()==='track'){const kind=(node.getAttribute('kind')||'').toLowerCase();if(kind==='captions'||kind==='subtitles')added=true;}});});if(added)registerDomTracksWithPlayer();});mo.observe(videoEl,{childList:true});this._tracksObserver=mo;}catch(e){}};const hadTracks=registerDomTracksWithPlayer();observeTrackInsertions();const ttList=(typeof player.textTracks==='function')?player.textTracks():null;const playerEl=(typeof player.el==='function')?player.el():null;if(ttList&&typeof ttList.length==='number'){let hasAny=false;for(let i=0;i<ttList.length;i++){const tt=ttList[i];if(!tt||(tt.kind!=='captions'&&tt.kind!=='subtitles'))continue;hasAny=true;this._wireCaptionTrackEvents(tt,player,isNativeText);const lang=String(tt.language||'').toLowerCase();try{tt.mode=(lang===currentLang||(!lang&&i===0))?'showing':'disabled';}catch(e){}}this.setKaraokeAvailable(hasAny);try{const rEls=(typeof player.remoteTextTrackEls==='function')?player.remoteTextTrackEls():null;}catch(e){}if(!hasAny){const onMeta=()=>{const list2=player.textTracks();for(let j=0;j<list2.length;j++){const t2=list2[j];if(!t2||(t2.kind!=='captions'&&t2.kind!=='subtitles'))continue;this._wireCaptionTrackEvents(t2,player,isNativeText);}this.syncActiveKaraokeTrack();};try{player.one('loadedmetadata',onMeta);}catch(e){}}}this.syncActiveKaraokeTrack();try{player.on&&player.on('texttrackchange',()=>this.syncActiveKaraokeTrack());}catch(e){}}_wireCaptionTrackEvents(track,player,isNativeText){const videoWrapper=this.videoWrapper;const musicPlayerInstance=this;const updateCaptionsActive=()=>{try{if(!videoWrapper)return;const anyActive=track.activeCues&&track.activeCues.length>0;videoWrapper.classList.toggle('captions-active',!!anyActive);}catch(e){}};const disableFade=!!this.disableCaptionFade;if(isNativeText){try{track.addEventListener&&track.addEventListener('cuechange',()=>{updateCaptionsActive();musicPlayerInstance.handleKaraokeCueChange(track);});}catch(e){}return;}const onLoaded=()=>{musicPlayerInstance.applyCueTimingPreferenceToTrack(track);let previousCue=null;updateCaptionsActive();musicPlayerInstance.handleKaraokeCueChange(track);track.oncuechange=function(){const activeCues=this.activeCues||[];
56if(activeCues.length>0){const cue=activeCues[0];if(previousCue!==cue){if(previousCue&&previousCue.displayState)try{previousCue.displayState.classList.remove('fadeOut');previousCue.displayState.classList.remove('fadeOutQuick');}catch(e){}if(!disableFade&&musicPlayerInstance.isCaptionFadeEnabled()){const timeUntilCueEnd=(cue.endTime-player.currentTime())*1000;const cueDuration=cue.endTime-cue.startTime;const timeoutDuration=cueDuration<5?800:2000;const fadeOutClass=cueDuration<5?'fadeOutQuick':'fadeOut';setTimeout(()=>{try{if(!musicPlayerInstance.isCaptionFadeEnabled()){if(cue&&cue.displayState){cue.displayState.classList.remove('fadeOut');cue.displayState.classList.remove('fadeOutQuick');}return;}const stillActive=Array.from(this.activeCues||[]).includes(cue);if(stillActive&&cue.displayState)cue.displayState.classList.add(fadeOutClass);}catch(e){}},Math.max(0,timeUntilCueEnd-timeoutDuration));}else{if(cue&&cue.displayState)try{cue.displayState.classList.remove('fadeOut');cue.displayState.classList.remove('fadeOutQuick');}catch(e){}}previousCue=cue;}}else{if(previousCue&&previousCue.displayState){try{previousCue.displayState.classList.remove('fadeOut');previousCue.displayState.classList.remove('fadeOutQuick');}catch(e){}previousCue=null;}}updateCaptionsActive();musicPlayerInstance.handleKaraokeCueChange(track);};};try{track.addEventListener('loadeddata',onLoaded);}catch(e){}try{track.addEventListener('load',onLoaded);}catch(e){}try{track.addEventListener('cuechange',()=>musicPlayerInstance.handleKaraokeCueChange(track));}catch(e){}try{track.addEventListener('modechange',()=>musicPlayerInstance.handleKaraokeCueChange(track,true));}catch(e){}}isCaptionFadeEnabled(){return !this.disableCaptionFade&&!this.karaokeActive;}applyCueTimingPreferenceToTrack(track){if(!track||(track.kind!=='captions'&&track.kind!=='subtitles'))return;const cues=track.cues||track.cues_||[];const useAdjustedTiming=this.isCaptionFadeEnabled();for(let i=0;i<cues.length;i++){const cue=cues[i];if(!cue)continue;const originalStart=typeof cue.__wizOriginalStart==='number'?cue.__wizOriginalStart:cue.startTime;const originalEnd=typeof cue.__wizOriginalEnd==='number'?cue.__wizOriginalEnd:cue.endTime;if(typeof cue.__wizOriginalStart!=='number')cue.__wizOriginalStart=originalStart;if(typeof cue.__wizOriginalEnd!=='number')cue.__wizOriginalEnd=originalEnd;let targetStart=originalStart;let targetEnd=originalEnd;if(useAdjustedTiming){const isFirstCue=(i===0);if(isFirstCue)targetStart=Math.max(0,originalStart+0.3);else targetStart=Math.max(0,originalStart-0.3);targetEnd=Math.max(0,originalEnd-0.3);if(targetEnd<=targetStart)targetEnd=targetStart+0.01;}try{cue.startTime=targetStart;}catch(e){}try{cue.endTime=targetEnd;}catch(e){}if(!useAdjustedTiming&&cue.displayState)try{cue.displayState.classList.remove('fadeOut');cue.displayState.classList.remove('fadeOutQuick');}catch(e){}}}refreshCueTimingForAllTracks(){if(!this.player||typeof this.player.textTracks!=='function')return;const list=this.player.textTracks();if(!list||typeof list.length!=='number')return;for(let i=0;i<list.length;i++){const track=list[i];if(!track)continue;this.applyCueTimingPreferenceToTrack(track);}}initializeKaraokeSupport(){try{const audioFigure=this.element.closest('figure.audio');if(!audioFigure)return;this.karaokeOverlay=audioFigure.querySelector('[data-role="karaoke-overlay"]');if(!this.karaokeOverlay)return;this.karaokeLines={previous:this.karaokeOverlay.querySelector('[data-line="previous"]'),current:this.karaokeOverlay.querySelector('[data-line="current"]'),next:this.karaokeOverlay.querySelector('[data-line="next"]')};this.karaokeOverlay.setAttribute('aria-hidden','true');if(typeof this._applyKaraokeCaptionPreferences==='function')try{this._applyKaraokeCaptionPreferences();}catch(e){}this.mountKaraokeOverlay();this.karaokeOverlay.addEventListener('click',(event)=>{if(!this.karaokeActive)return;const target=event.target.closest('[data-line][data-start]');if(!target)return;event.preventDefault();const start=parseFloat(target.getAttribute('data-start'));if(!Number.isFinite(start))return;try{this.player.currentTime(Math.max(0,start+0.01));this.updateKaraokeDisplay();}catch(e){}});}catch(e){}}mountKaraokeOverlay(){if(!this.karaokeOverlay||!this.player||typeof this.player.el!=='function')return;
56try{const playerElement=this.player.el();if(!playerElement)return;let targetParent=playerElement;let referenceNode=null;const textTrackSettings=playerElement.querySelector('.vjs-text-track-settings');if(textTrackSettings&&playerElement.contains(textTrackSettings)){targetParent=textTrackSettings.parentNode;referenceNode=textTrackSettings.nextSibling;}if(!targetParent)return;const currentParent=this.karaokeOverlay.parentNode;const needsMove=currentParent!==targetParent||(referenceNode!==this.karaokeOverlay.nextSibling&&referenceNode!==this.karaokeOverlay);if(needsMove)targetParent.insertBefore(this.karaokeOverlay,referenceNode);}catch(e){}}updateKaraokeButtonState(){if(!this.karaokeButton||typeof this.karaokeButton.el!=='function')return;const el=this.karaokeButton.el();if(!el)return;const disabled=!this.karaokeAvailable;el.classList.toggle('vjs-disabled',disabled);el.setAttribute('aria-disabled',disabled?'true':'false');el.setAttribute('aria-pressed',this.karaokeActive?'true':'false');}setKaraokeAvailable(available){this.karaokeAvailable=!!available;if(!this.karaokeAvailable&&this.karaokeActive)this.toggleKaraokeMode(false);this.updateKaraokeButtonState();}toggleKaraokeMode(forceState){if(!this.karaokeOverlay||!this.karaokeAvailable)return;const audioFigure=this.element.closest('figure.audio');const shouldEnable=typeof forceState==='boolean'?forceState:!this.karaokeActive;this.karaokeActive=shouldEnable;if(audioFigure)audioFigure.classList.toggle('karaoke-mode',this.karaokeActive);this.karaokeOverlay.classList.toggle('is-active',this.karaokeActive);this.karaokeOverlay.setAttribute('aria-hidden',this.karaokeActive?'false':'true');this.updateKaraokeButtonState();this.refreshCueTimingForAllTracks();if(!this.karaokeActive){this.clearKaraokeDisplay();return;}this.syncActiveKaraokeTrack();this.updateKaraokeDisplay();}handleKaraokeCueChange(track,fromModeChange=false){if(!track||(track.kind!=='captions'&&track.kind!=='subtitles'))return;if(fromModeChange&&track.mode!=='showing'&&this.karaokeActiveTrack===track){this.karaokeActiveTrack=null;this.updateKaraokeDisplay();return;}if(track.mode==='showing')this.karaokeActiveTrack=track;this.updateKaraokeDisplay(track);}syncActiveKaraokeTrack(){if(!this.karaokeActive||!this.player||typeof this.player.textTracks!=='function'){this.updateKaraokeDisplay();return;}const list=this.player.textTracks();let activeTrack=null;if(list&&typeof list.length==='number'){for(let i=0;i<list.length;i++){const tt=list[i];if(!tt||(tt.kind!=='captions'&&tt.kind!=='subtitles'))continue;if(tt.mode==='showing'){activeTrack=tt;break;}}}this.karaokeActiveTrack=activeTrack;this.setKaraokeAvailable(!!activeTrack||this.karaokeAvailable);this.updateKaraokeDisplay(activeTrack);}clearKaraokeDisplay(){if(!this.karaokeOverlay)return;this.stopKaraokeProgressLoop();this.karaokeLastCueIndex=null;this.karaokeLastRenderedSignature=null;Object.values(this.karaokeLines||{}).forEach((line)=>{if(!line)return;this.resetKaraokeLineDynamicState(line);line.innerHTML='';line.removeAttribute('data-start');line.removeAttribute('data-end');line.style.removeProperty('--karaoke-progress');line.classList.add('karaoke-line--empty');});}updateKaraokeDisplay(preferredTrack){if(!this.karaokeActive||!this.karaokeOverlay)return;const track=preferredTrack||this.karaokeActiveTrack;if(!track||track.mode!=='showing'){this.clearKaraokeDisplay();return;}this.karaokeActiveTrack=track;const cuesList=[];const rawCues=track.cues||track.cues_||[];for(let i=0;i<rawCues.length;i++)cuesList.push(rawCues[i]);if(!cuesList.length){this.clearKaraokeDisplay();return;}const activeCues=track.activeCues||[];const getOriginalStart=(cue)=>typeof cue.__wizOriginalStart==='number'?cue.__wizOriginalStart:cue.startTime;const getOriginalEnd=(cue)=>typeof cue.__wizOriginalEnd==='number'?cue.__wizOriginalEnd:cue.endTime;const time=this.player?this.player.currentTime():0;let currentCue=activeCues.length?activeCues[0]:null;if(!currentCue){for(let i=0;i<cuesList.length;i++){const cue=cuesList[i];const start=getOriginalStart(cue);const end=getOriginalEnd(cue);if(time>=start&&time<end){currentCue=cue;break;}}}let currentIndex=currentCue?cuesList.indexOf(currentCue):-1;let previousIndex=-1;let nextIndex=-1;for(let i=0;i<cuesList.length;i++){const cue=cuesList[i];const start=getOriginalStart(cue);const end=getOriginalEnd(cue);if(time<start){nextIndex=i;previousIndex=i-1;break;}if(time>=start&&time<end){currentIndex=i;previousIndex=i-1;nextIndex=i+1;break;}previousIndex=i;nextIndex=i+1;}if(nextIndex>=cuesList.length)nextIndex=-1;const HOLD_TOLERANCE=0.05;const hadRenderedCue=typeof this.karaokeLastCueIndex==='number';const upcomingCue=nextIndex>=0?cuesList[nextIndex]:null;const upcomingStart=upcomingCue?getOriginalStart(upcomingCue):Infinity;const previousCueCandidate=previousIndex>=0?cuesList[previousIndex]:null;let displayIndex=currentIndex;if(displayIndex===-1)if(previousCueCandidate&&time<upcomingStart-HOLD_TOLERANCE)displayIndex=previousIndex;else if(upcomingCue)if(!hadRenderedCue||time+HOLD_TOLERANCE>=upcomingStart)displayIndex=nextIndex;else if(previousCueCandidate)displayIndex=previousIndex;else displayIndex=nextIndex;else{if(previousCueCandidate)displayIndex=previousIndex;}if(displayIndex>=cuesList.length)displayIndex=-1;const previousCue=displayIndex>
560?cuesList[displayIndex-1]:null;const displayedCurrentCue=displayIndex>=0?cuesList[displayIndex]:null;const nextCue=displayIndex>=0&&displayIndex+1<cuesList.length?cuesList[displayIndex+1]:nextIndex>=0?cuesList[nextIndex]:null;const nextCueStart=nextCue?getOriginalStart(nextCue):null;const signatureParts=[previousCue,displayedCurrentCue,nextCue].map((cue)=>{if(!cue)return '_';const start=typeof cue.__wizOriginalStart==='number'?cue.__wizOriginalStart:cue.startTime;const end=typeof cue.__wizOriginalEnd==='number'?cue.__wizOriginalEnd:cue.endTime;return `${start}-${end}-${cue.text||''}`;});const signature=signatureParts.join('|');const signatureChanged=signature!==this.karaokeLastRenderedSignature;let effectiveIndex=displayIndex;let direction='none';const assignLine=(lineElement,cue,role)=>{if(!lineElement)return;this.resetKaraokeLineDynamicState(lineElement,role);if(cue){const originalStart=typeof cue.__wizOriginalStart==='number'?cue.__wizOriginalStart:cue.startTime;const originalEnd=typeof cue.__wizOriginalEnd==='number'?cue.__wizOriginalEnd:cue.endTime;lineElement.innerHTML=cue.text||'';lineElement.setAttribute('data-start',originalStart);lineElement.setAttribute('data-end',originalEnd);lineElement.classList.remove('karaoke-line--empty');}else{lineElement.innerHTML='';lineElement.removeAttribute('data-start');lineElement.removeAttribute('data-end');lineElement.classList.add('karaoke-line--empty');}};if(signatureChanged){this.karaokeLastRenderedSignature=signature;if(typeof this.karaokeLastCueIndex==='number'&&effectiveIndex!==-1)if(effectiveIndex>this.karaokeLastCueIndex)direction='forward';else{if(effectiveIndex<this.karaokeLastCueIndex)direction='backward';}if(effectiveIndex!==-1)this.karaokeLastCueIndex=effectiveIndex;else this.karaokeLastCueIndex=null;assignLine(this.karaokeLines.previous,previousCue,'previous');assignLine(this.karaokeLines.current,displayedCurrentCue,'current');assignLine(this.karaokeLines.next,nextCue,'next');}let currentCueStart=null;let currentCueEnd=null;let currentProgressTargetEnd=null;if(displayedCurrentCue){currentCueStart=getOriginalStart(displayedCurrentCue);currentCueEnd=getOriginalEnd(displayedCurrentCue);let nextStartCandidate=null;if(nextCue)nextStartCandidate=getOriginalStart(nextCue);if(Number.isFinite(nextStartCandidate)&&(nextStartCandidate>currentCueStart))currentProgressTargetEnd=nextStartCandidate;else currentProgressTargetEnd=currentCueEnd;if(!Number.isFinite(currentProgressTargetEnd)||currentProgressTargetEnd<=currentCueStart)currentProgressTargetEnd=currentCueEnd;}if(this.karaokeLines.previous)try{this.karaokeLines.previous.style.removeProperty('--karaoke-progress');}catch(e){}if(this.karaokeLines.next)try{this.karaokeLines.next.style.removeProperty('--karaoke-progress');}catch(e){}const canAnimate=typeof window!=='undefined'&&typeof window.requestAnimationFrame==='function';if(signatureChanged)if(displayedCurrentCue&&this.karaokeLines.current){const cueStart=currentCueStart;let progressEnd=currentProgressTargetEnd;if(!Number.isFinite(progressEnd))progressEnd=cueStart+0.001;if(canAnimate)this.startKaraokeProgressLoop(this.karaokeLines.current,cueStart,progressEnd,this.karaokeLines.next,nextCueStart);else{let progress=0;if(progressEnd>cueStart)progress=(time-cueStart)/(progressEnd-cueStart);if(progress<0)progress=0;else{if(progress>1)progress=1;}try{this.karaokeLines.current.style.setProperty('--karaoke-progress',`${(progress*100).toFixed(3)}%`);}catch(e){}this.updateKaraokeLineCueWindowVisuals({line:this.karaokeLines.current,upcomingLine:this.karaokeLines.next,upcomingStart:nextCueStart},time);}}else{this.stopKaraokeProgressLoop();if(this.karaokeLines.current)try{this.karaokeLines.current.style.removeProperty('--karaoke-progress');}catch(e){}if(this.karaokeLines.next)this.resetNextLineScale(this.karaokeLines.next);}if(!canAnimate&&!signatureChanged&&this.karaokeLines.current&&displayedCurrentCue){const cueStart=currentCueStart;let progressEnd=currentProgressTargetEnd;if(!Number.isFinite(progressEnd))progressEnd=cueStart+0.001;let progress=0;if(progressEnd>cueStart)progress=(time-cueStart)/(progressEnd-cueStart);if(progress<0)progress=0;else{if(progress>1)progress=1;}try{this.karaokeLines.current.style.setProperty('--karaoke-progress',`${(progress*100).toFixed(3)}%`);}catch(e){}this.updateKaraokeLineCueWindowVisuals({line:this.karaokeLines.current,upcomingLine:this.karaokeLines.next,upcomingStart:nextCueStart},time);}else{if(!displayedCurrentCue&&this.karaokeLines.next)this.resetNextLineScale(this.karaokeLines.next);}if(signatureChanged&&direction!=='none')this.animateKaraokeTransition(direction);}animateKaraokeTransition(direction){if(!this.karaokeOverlay||!this.karaokeLines)return;try{if(typeof window!=='undefined'&&window.matchMedia&&window.matchMedia('(prefers-reduced-motion: reduce)').matches)return;}catch(e){}const animations={forward:{previous:{keyframes:[{transform:'translateY(20%) scale(0.98)',opacity:0.85},{transform:'translateY(-6%) scale(0.9)',opacity:0.7},{transform:'translateY(0) scale(0.86)',opacity:0.8}]},current:{keyframes:[{transform:'translateY(70%) scale(0.92)',opacity:0.2},{transform:'translateY(-12%) scale(1)',opacity:1},{transform:'translateY(0) scale(1)',opacity:1}]},next:{keyframes:[{transform:'translateY(140%) scale(0.9)',opacity:0}
56,{transform:'translateY(40%) scale(0.9)',opacity:0.55},{transform:'translateY(0) scale(0.86)',opacity:0.6}]}},backward:{previous:{keyframes:[{transform:'translateY(-140%) scale(0.9)',opacity:0},{transform:'translateY(-40%) scale(0.9)',opacity:0.55},{transform:'translateY(0) scale(0.86)',opacity:0.65}]},current:{keyframes:[{transform:'translateY(-70%) scale(0.92)',opacity:0.25},{transform:'translateY(12%) scale(1)',opacity:1},{transform:'translateY(0) scale(1)',opacity:1}]},next:{keyframes:[{transform:'translateY(-20%) scale(0.98)',opacity:0.85},{transform:'translateY(6%) scale(0.9)',opacity:0.72},{transform:'translateY(0) scale(0.86)',opacity:0.8}]}}};const spec=animations[direction];if(!spec)return;const animationOptions={duration:320,easing:'cubic-bezier(0.33, 1, 0.68, 1)'};const lines=this.karaokeLines;Object.keys(spec).forEach((role)=>{const line=lines[role];if(!line||typeof line.animate!=='function')return;const {keyframes}=spec[role];try{line.animate(keyframes,animationOptions);}catch(e){}});}}Drupal.wizionaryMdn.MusicPlayer=MusicPlayer;})(Drupal);;
57(function(Drupal,drupalSettings){'use strict';Drupal.wizionaryMdn=Drupal.wizionaryMdn||{};Drupal.wizionaryMdn.addNextEpisodeFeature=function(player){const nodeId=drupalSettings?.wizionary?.currentNodeId;if(!nodeId)return;player.ready(()=>{const controlBar=player.getChild('controlBar');if(!controlBar)return;const fetchShortsNext=()=>fetch(`/wizionary/node-suggestions/shorts-next?current=${nodeId}`).then((r)=>r.ok?r.json():[]).then((items)=>{if(!items||!items.length)return null;const urls=items.map((it)=>it&&it.id?`/node/${it.id}`:null).filter(Boolean).slice(0,2);return urls.length?urls:null;}).catch(()=>null);fetch(`/api/next-episodes/${nodeId}`).then((resp)=>resp.json()).then(async(data)=>{let episodes=data.episodes||[];const groupUrl=data.groupUrl||null;const premiere=data.premiere||null;let shortFallback=null;if(!groupUrl){shortFallback=await fetchShortsNext();if(!shortFallback)return;}const addAutoplay=(url)=>{try{const u=new URL(url,window.location.origin);u.searchParams.set('autoplay','true');return u.toString();}catch(e){return url+(url.includes('?')?'&':'?')+'autoplay=true';}};const overlay=document.createElement('div');overlay.className='vjs-next-episode-overlay';if(groupUrl&&episodes.length>0){const heading=document.createElement('div');heading.className='next-episode-heading';heading.textContent=Drupal.t(episodes.length===1?'Next Episode':'Where will you go next?');overlay.appendChild(heading);episodes.forEach((ep)=>{const item=document.createElement('a');item.href=addAutoplay(ep.url);item.className='vjs-next-episode-item';if(ep.thumbnail){const thumb=document.createElement('span');thumb.className='next-episode-thumb';const img=document.createElement('img');img.src=ep.thumbnail;img.alt=ep.title||'';img.loading='lazy';img.decoding='async';thumb.appendChild(img);item.appendChild(thumb);}const text=document.createElement('div');text.className='next-episode-text';const title=document.createElement('div');title.className='next-episode-title';title.innerHTML=`<span>${ep.number}</span> <span>${ep.title}</span>`;text.appendChild(title);const summary=document.createElement('div');summary.className='next-episode-summary';summary.textContent=ep.summary;text.appendChild(summary);item.appendChild(text);overlay.appendChild(item);});player.el().appendChild(overlay);const button=document.createElement('button');button.className='vjs-next-episode-button vjs-control vjs-button';button.type='button';button.title=Drupal.t('Next Episode');button.setAttribute('aria-disabled','false');const icon=document.createElement('span');icon.className='vjs-icon-placeholder';icon.setAttribute('aria-hidden','true');button.appendChild(icon);const label=document.createElement('span');label.className='vjs-control-text';label.setAttribute('aria-live','polite');label.textContent=Drupal.t('Next Episode');button.appendChild(label);let rightGroup=controlBar.getChild('vjs-control-group-right');if(!rightGroup)rightGroup=controlBar.addChild('Component',{name:'vjs-control-group-right',className:'vjs-control-group vjs-control-group-right'});rightGroup.el().appendChild(button);button.addEventListener('click',(e)=>{e.stopPropagation();const visible=overlay.classList.toggle('is-visible');if(visible){actionOverlay.classList.remove('is-visible');stopCountdown();}});}const actionOverlay=document.createElement('div');actionOverlay.className='vjs-next-episode-overlay vjs-next-episode-overlay--actions';const actions=document.createElement('div');actions.className='next-episode-actions';
57let countdownTimer=null;const stopCountdown=()=>{if(countdownTimer){window.clearInterval(countdownTimer);countdownTimer=null;}};const startCountdown=(url)=>{let seconds=7;const progress=actions.querySelector('.next-episode-progress');const counter=actions.querySelector('.next-episode-countdown');countdownTimer=window.setInterval(()=>{seconds-=1;if(progress)progress.style.width=`${((7-seconds)/7)*100}%`;if(counter)counter.textContent=` (${seconds})`;if(seconds<=0){stopCountdown();window.location.href=url;}},1000);};let nextUrlWithoutAutoplay=null;if(episodes.length===1){const keep=document.createElement('button');keep.type='button';keep.className='next-episode-keep';keep.textContent=Drupal.t('Watch Again');keep.addEventListener('click',()=>{actionOverlay.classList.remove('is-visible');stopCountdown();player.currentTime(0);player.play();});actions.appendChild(keep);nextUrlWithoutAutoplay=episodes[0].url;const next=document.createElement('a');next.href=nextUrlWithoutAutoplay;next.className='next-episode-autoplay bg-primary';const label=document.createElement('span');label.className='next-episode-label';label.textContent=Drupal.t('Next Episode');next.appendChild(label);const countdown=document.createElement('span');countdown.className='next-episode-countdown';countdown.textContent=' (7)';next.appendChild(countdown);const progress=document.createElement('span');progress.className='next-episode-progress';next.appendChild(progress);next.addEventListener('click',()=>{stopCountdown();});actions.appendChild(next);}else{if(groupUrl){if(premiere){const premiereEl=document.createElement('div');premiereEl.className='next-episode-premiere';premiereEl.textContent=premiere;actions.appendChild(premiereEl);}const back=document.createElement('a');back.href=groupUrl;back.className='group-link bg-primary';back.textContent=Drupal.t('Go to story page');actions.appendChild(back);}}actionOverlay.appendChild(actions);player.el().appendChild(actionOverlay);document.addEventListener('click',(e)=>{if(overlay.classList.contains('is-visible')&&!overlay.contains(e.target)&&!e.target.closest('.vjs-next-episode-button'))overlay.classList.remove('is-visible');if(actionOverlay.classList.contains('is-visible')&&!actionOverlay.contains(e.target)){actionOverlay.classList.remove('is-visible');stopCountdown();}});if(groupUrl)player.on('ended',()=>{if(episodes.length>1)overlay.classList.add('is-visible');else{actionOverlay.classList.add('is-visible');if(episodes.length===1&&nextUrlWithoutAutoplay)startCountdown(nextUrlWithoutAutoplay);}});else{if(shortFallback){const shortsOverlay=document.createElement('div');shortsOverlay.className='vjs-next-episode-overlay vjs-next-episode-overlay--actions';const container=document.createElement('div');container.className='next-episode-actions';const suggestions=Array.isArray(shortFallback)?shortFallback:[shortFallback];suggestions.slice(0,2).forEach((url)=>{const holder=document.createElement('div');const nid=(url||'').split('/').pop();const targetId=`wiz-next-short-${nid}-${Date.now()}-${Math.floor(Math.random()*1000)}`;holder.id=targetId;holder.innerHTML='<div class="front-story-loading" aria-hidden="true"></div>';holder.classList.add('story-suggestion-wrapper');container.appendChild(holder);const loadSuggestion=()=>{try{if(Drupal&&Drupal.ajax){const targetSelector=`#${targetId}`;const ajax=Drupal.ajax({url:`/wizionary/node-suggestions/node-display/${nid}?mode=suggestion&target=${encodeURIComponent(targetSelector)}`,base:targetId,element:holder,progress:{type:'throbber'}});const jqXHR=ajax.execute();if(jqXHR&&jqXHR.always)jqXHR.always(()=>{});}else fetch(`/wizionary/node-suggestions/node-display/${nid}?mode=suggestion`).then((res)=>res.ok?res.text():'').then((html)=>{holder.innerHTML=html;if(Drupal&&Drupal.attachBehaviors)Drupal.attachBehaviors(holder);});}catch(e){}};loadSuggestion();});shortsOverlay.appendChild(container);player.el().appendChild(shortsOverlay);player.on('ended',()=>{shortsOverlay.classList.add('is-visible');});document.addEventListener('click',(e)=>{if(shortsOverlay.classList.contains('is-visible')&&!shortsOverlay.contains(e.target))shortsOverlay.classList.remove('is-visible');});}}});});};})(Drupal,drupalSettings);;
58(function(Drupal,drupalSettings,once){'use strict';Drupal.behaviors.videojsPlayer={attach:function(context){const VideoPlayer=Drupal.wizionaryMdn.VideoPlayer;const MusicPlayer=Drupal.wizionaryMdn.MusicPlayer;const addNextEpisodeFeature=Drupal.wizionaryMdn.addNextEpisodeFeature;const VideoPlayerConst=new VideoPlayer();once('mediaWrapper','.media_wrapper',context).forEach((wrapper)=>{const videoElement=wrapper.querySelector('.video-js.full');const videoPlayerInstance=new VideoPlayer();if(videoElement)videoPlayerInstance.addPlayer(videoElement);const musicElement=wrapper.querySelector('.video-js.story');if(musicElement){new MusicPlayer(musicElement,context,videoPlayerInstance);addNextEpisodeFeature(videojs(musicElement));}});once('videojsPlayer','.frontpage .video-js.full',context).forEach((element)=>{VideoPlayerConst.addPlayer(element);});once('videoCycleWrapper','.video-cycle',context).forEach((wrapper)=>{if(wrapper.hasAttribute('data-cgt-managed')||wrapper.classList.contains('cgt-managed'))return;const containers=Array.from(wrapper.querySelectorAll('.video-js.full'));if(!containers.length)return;const urls=containers.map((el)=>el.querySelector('source[type="application/x-mpegURL"]')).filter(
58Boolean).map((src)=>src.getAttribute('src')).filter(Boolean);const hostEl=containers[0];containers.slice(1).forEach((el)=>{try{el.remove();}catch(e){}});const player=(window.videojs&&(window.videojs.getPlayer(hostEl)||window.videojs(hostEl)));if(!player)return;try{player.loop(false);}catch(e){}if(urls.length<=1){try{player.loop(true);}catch(e){}player.on('ended',()=>{try{player.currentTime(0);player.play();}catch(e){}});return;}let idx=0;const setSrcAndPlay=(i)=>{const src=urls[i%urls.length];try{player.pause();player.currentTime(0);player.src({type:'application/x-mpegURL',src});player.one('loadedmetadata',()=>{try{player.play();}catch(e){}});}catch(e){}};player.on('ended',()=>{idx=(idx+1)%urls.length;setSrcAndPlay(idx);});const utils=(Drupal&&Drupal.wizionaryMdn&&Drupal.wizionaryMdn.utils)?Drupal.wizionaryMdn.utils:null;const shouldAutoplay=!utils||(typeof utils.isStaticMode==='function'?!utils.isStaticMode():true);const start=()=>setSrcAndPlay(0);if(shouldAutoplay)if(typeof player.ready==='function')player.ready(start);else start();});}};})(Drupal,drupalSettings,once);;
59(function(Drupal,once){Drupal.behaviors.adjustMarginOnScroll={attach:function(context,settings){once('adjustMarginOnScroll','.layout-region-node-secondary .layout-region__content',context).forEach(function(targetElement){var initialScrollY=window.scrollY;var initialMarginTop=Math.max(4-initialScrollY/16,0);targetElement.style.marginTop=initialMarginTop+'rem';window.addEventListener('scroll',function(){var scrollY=window.scrollY;var newMarginTop=Math.max(4-scrollY/16,0);targetElement.style.marginTop=newMarginTop+'rem';});});}};})(Drupal,once);(function(Drupal,once){Drupal.behaviors.adjustAdminToolbarOnScroll={attach:function(context,settings){once('adjustAdminToolbarOnScroll','aside#admin-toolbar',context).forEach(function(adminToolbar){var popoverWrapper=adminToolbar.querySelector('.toolbar-popover__wrapper');function setInitialTop(){var initialScrollY=window.scrollY;var initialTop=Math.max(4-initialScrollY/16,0);adminToolbar.style.top=initialTop+'rem';if(popoverWrapper)popoverWrapper.style.top=initialTop+'rem';}setInitialTop();window.addEventListener('scroll',function(){var scrollY=window.scrollY;var newTop=Math.max(4-scrollY/16,0);adminToolbar.style.top=newTop+'rem';if(popoverWrapper)popoverWrapper.style.top=newTop+'rem';});});}};})(Drupal,once);;

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.