Files
goodtube/js/assets.min.js
2024-07-11 08:54:51 +10:00

2 lines
676 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Sweetalert2=t()}(this,(function(){"use strict";function e(e,t,i){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:i;throw TypeError("Private element is not present on this object")}function t(t,i){return t.get(e(t,i))}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(i=function(){return!!e})()}function n(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,"string");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function a(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,n(r.key),r)}}function o(e,t,i){return t&&a(e.prototype,t),i&&a(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function d(){return(d="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=l(e)););return e}(e,t);if(n){var r=Object.getOwnPropertyDescriptor(n,t);return r.get?r.get.call(arguments.length<3?e:i):r.value}}).apply(this,arguments)}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,s,a,o=[],l=!0,u=!1;try{if(s=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=s.call(i)).done)&&(o.push(n.value),o.length!==t);l=!0);}catch(e){u=!0,r=e}finally{try{if(!l&&null!=i.return&&(a=i.return(),Object(a)!==a))return}finally{if(u)throw r}}return o}}(e,t)||h(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){if(e){if("string"==typeof e)return p(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?p(e,t):void 0}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i<t;i++)n[i]=e[i];return n}var m={},f="swal2-",g=["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","default-outline","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error"].reduce((function(e,t){return e[t]=f+t,e}),{}),y=["success","warning","info","question","error"].reduce((function(e,t){return e[t]=f+t,e}),{}),v="SweetAlert2:",_=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},b=function(e){console.warn("".concat(v," ").concat("object"===r(e)?e.join(" "):e))},w=function(e){console.error("".concat(v," ").concat(e))},T=[],S=function(e){return"function"==typeof e?e():e},E=function(e){return e&&"function"==typeof e.toPromise},k=function(e){return E(e)?e.toPromise():Promise.resolve(e)},C=function(e){return e&&Promise.resolve(e)===e},x=function(){return document.body.querySelector(".".concat(g.container))},I=function(e){var t=x();return t?t.querySelector(e):null},A=function(e){return I(".".concat(e))},P=function(){return A(g.popup)},O=function(){return A(g.icon)},L=function(){return A(g.title)},D=function(){return A(g["html-container"])},M=function(){return A(g.image)},N=function(){return A(g["progress-steps"])},R=function(){return A(g["validation-message"])},U=function(){return I(".".concat(g.actions," .").concat(g.confirm))},B=function(){return I(".".concat(g.actions," .").concat(g.cancel))},j=function(){return I(".".concat(g.actions," .").concat(g.deny))},F=function(){return I(".".concat(g.loader))},q=function(){return A(g.actions)},H=function(){return A(g.footer)},V=function(){return A(g["timer-progress-bar"])},$=function(){return A(g.close)},W=function(){var e=P();if(!e)return[];var t,i=Array.from(e.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')).sort((function(e,t){var i=parseInt(e.getAttribute("tabindex")||"0"),n=parseInt(t.getAttribute("tabindex")||"0");return i>n?1:i<n?-1:0})),n=Array.from(e.querySelectorAll('\n a[href],\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n [tabindex="0"],\n [contenteditable],\n audio[controls],\n video[controls],\n summary\n')).filter((function(e){return"-1"!==e.getAttribute("tabindex")}));return(function(e){if(Array.isArray(e))return p(e)}(t=new Set(i.concat(n)))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||h(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).filter((function(e){return ue(e)}))},z=function(){return K(document.body,g.shown)&&!K(document.body,g["toast-shown"])&&!K(document.body,g["no-backdrop"])},G=function(){var e=P();return!!e&&K(e,g.toast)},X=function(e,t){if(e.textContent="",t){var i=(new DOMParser).parseFromString(t,"text/html"),n=i.querySelector("head");n&&Array.from(n.childNodes).forEach((function(t){e.appendChild(t)}));var r=i.querySelector("body");r&&Array.from(r.childNodes).forEach((function(t){t instanceof HTMLVideoElement||t instanceof HTMLAudioElement?e.appendChild(t.cloneNode(!0)):e.appendChild(t)}))}},K=function(e,t){if(!t)return!1;for(var i=t.split(/\s+/),n=0;n<i.length;n++)if(!e.classList.contains(i[n]))return!1;return!0},Q=function(e,t,i){if(function(e,t){Array.from(e.classList).forEach((function(i){Object.values(g).includes(i)||Object.values(y).includes(i)||Object.values(t.showClass||{}).includes(i)||e.classList.remove(i)}))}(e,t),t.customClass&&t.customClass[i]){if("string"!=typeof t.customClass[i]&&!t.customClass[i].forEach)return void b("Invalid type of customClass.".concat(i,'! Expected string or iterable object, got "').concat(r(t.customClass[i]),'"'));ee(e,t.customClass[i])}},Y=function(e,t){if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(".".concat(g.popup," > .").concat(g[t]));case"checkbox":return e.querySelector(".".concat(g.popup," > .").concat(g.checkbox," input"));case"radio":return e.querySelector(".".concat(g.popup," > .").concat(g.radio," input:checked"))||e.querySelector(".".concat(g.popup," > .").concat(g.radio," input:first-child"));case"range":return e.querySelector(".".concat(g.popup," > .").concat(g.range," input"));default:return e.querySelector(".".concat(g.popup," > .").concat(g.input))}},J=function(e){if(e.focus(),"file"!==e.type){var t=e.value;e.value="",e.value=t}},Z=function(e,t,i){e&&t&&("string"==typeof t&&(t=t.split(/\s+/).filter(Boolean)),t.forEach((function(t){Array.isArray(e)?e.forEach((function(e){i?e.classList.add(t):e.classList.remove(t)})):i?e.classList.add(t):e.classList.remove(t)})))},ee=function(e,t){Z(e,t,!0)},te=function(e,t){Z(e,t,!1)},ie=function(e,t){for(var i=Array.from(e.children),n=0;n<i.length;n++){var r=i[n];if(r instanceof HTMLElement&&K(r,t))return r}},ne=function(e,t,i){i==="".concat(parseInt(i))&&(i=parseInt(i)),i||0===parseInt(i)?e.style.setProperty(t,"number"==typeof i?"".concat(i,"px"):i):e.style.removeProperty(t)},re=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"flex";e&&(e.style.display=t)},se=function(e){e&&(e.style.display="none")},ae=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"block";e&&new MutationObserver((function(){le(e,e.innerHTML,t)})).observe(e,{childList:!0,subtree:!0})},oe=function(e,t,i,n){var r=e.querySelector(t);r&&r.style.setProperty(i,n)},le=function(e,t){t?re(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"flex"):se(e)},ue=function(e){return!(!e||!(e.offsetWidth||e.offsetHeight||e.getClientRects().length))},de=function(e){return e.scrollHeight>e.clientHeight},ce=function(e){var t=window.getComputedStyle(e),i=parseFloat(t.getPropertyValue("animation-duration")||"0"),n=parseFloat(t.getPropertyValue("transition-duration")||"0");return i>0||n>0},he=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=V();i&&ue(i)&&(t&&(i.style.transition="none",i.style.width="100%"),setTimeout((function(){i.style.transition="width ".concat(e/1e3,"s linear"),i.style.width="0%"}),10))},pe=function(){return"undefined"==typeof window||"undefined"==typeof document},me='\n <div aria-labelledby="'.concat(g.title,'" aria-describedby="').concat(g["html-container"],'" class="').concat(g.popup,'" tabindex="-1">\n <button type="button" class="').concat(g.close,'"></button>\n <ul class="').concat(g["progress-steps"],'"></ul>\n <div class="').concat(g.icon,'"></div>\n <img class="').concat(g.image,'" />\n <h2 class="').concat(g.title,'" id="').concat(g.title,'"></h2>\n <div class="').concat(g["html-container"],'" id="').concat(g["html-container"],'"></div>\n <input class="').concat(g.input,'" id="').concat(g.input,'" />\n <input type="file" class="').concat(g.file,'" />\n <div class="').concat(g.range,'">\n <input type="range" />\n <output></output>\n </div>\n <select class="').concat(g.select,'" id="').concat(g.select,'"></select>\n <div class="').concat(g.radio,'"></div>\n <label class="').concat(g.checkbox,'">\n <input type="checkbox" id="').concat(g.checkbox,'" />\n <span class="').concat(g.label,'"></span>\n </label>\n <textarea class="').concat(g.textarea,'" id="').concat(g.textarea,'"></textarea>\n <div class="').concat(g["validation-message"],'" id="').concat(g["validation-message"],'"></div>\n <div class="').concat(g.actions,'">\n <div class="').concat(g.loader,'"></div>\n <button type="button" class="').concat(g.confirm,'"></button>\n <button type="button" class="').concat(g.deny,'"></button>\n <button type="button" class="').concat(g.cancel,'"></button>\n </div>\n <div class="').concat(g.footer,'"></div>\n <div class="').concat(g["timer-progress-bar-container"],'">\n <div class="').concat(g["timer-progress-bar"],'"></div>\n </div>\n </div>\n').replace(/(^|\n)\s*/g,""),fe=function(){m.currentInstance.resetValidationMessage()},ge=function(e,t){e instanceof HTMLElement?t.appendChild(e):"object"===r(e)?ye(e,t):e&&X(t,e)},ye=function(e,t){e.jquery?ve(t,e):X(t,e.toString())},ve=function(e,t){if(e.textContent="",0 in t)for(var i=0;i in t;i++)e.appendChild(t[i].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},_e=function(){if(pe())return!1;var e=document.createElement("div");return void 0!==e.style.webkitAnimation?"webkitAnimationEnd":void 0!==e.style.animation&&"animationend"}();function be(e,t,i){var n=_(t);le(e,i["show".concat(n,"Button")],"inline-block"),X(e,i["".concat(t,"ButtonText")]||""),e.setAttribute("aria-label",i["".concat(t,"ButtonAriaLabel")]||""),e.className=g[t],Q(e,i,"".concat(t,"Button"))}var we={innerParams:new WeakMap,domCache:new WeakMap},Te=["input","file","range","select","radio","checkbox","textarea"],Se=function(e){var t=Ce(e.input);"object"===r(e.customClass)&&ee(t,e.customClass.input)},Ee=function(e,t){e.placeholder&&!t.inputPlaceholder||(e.placeholder=t.inputPlaceholder)},ke=function(e,t,i){if(i.inputLabel){var n=document.createElement("label"),s=g["input-label"];n.setAttribute("for",e.id),n.className=s,"object"===r(i.customClass)&&ee(n,i.customClass.inputLabel),n.innerText=i.inputLabel,t.insertAdjacentElement("beforebegin",n)}},Ce=function(e){return ie(P(),g[e]||g.input)},xe=function(e,t){["string","number"].includes(r(t))?e.value="".concat(t):C(t)||b('Unexpected type of inputValue! Expected "string", "number" or "Promise", got "'.concat(r(t),'"'))},Ie={};Ie.text=Ie.email=Ie.password=Ie.number=Ie.tel=Ie.url=Ie.search=Ie.date=Ie["datetime-local"]=Ie.time=Ie.week=Ie.month=function(e,t){return xe(e,t.inputValue),ke(e,e,t),Ee(e,t),e.type=t.input,e},Ie.file=function(e,t){return ke(e,e,t),Ee(e,t),e},Ie.range=function(e,t){var i=e.querySelector("input"),n=e.querySelector("output");return xe(i,t.inputValue),i.type=t.input,xe(n,t.inputValue),ke(i,e,t),e},Ie.select=function(e,t){if(e.textContent="",t.inputPlaceholder){var i=document.createElement("option");X(i,t.inputPlaceholder),i.value="",i.disabled=!0,i.selected=!0,e.appendChild(i)}return ke(e,e,t),e},Ie.radio=function(e){return e.textContent="",e},Ie.checkbox=function(e,t){var i=Y(P(),"checkbox");return i.value="1",i.checked=Boolean(t.inputValue),X(e.querySelector("span"),t.inputPlaceholder),i},Ie.textarea=function(e,t){return xe(e,t.inputValue),Ee(e,t),ke(e,e,t),setTimeout((function(){if("MutationObserver"in window){var i=parseInt(window.getComputedStyle(P()).width);new MutationObserver((function(){if(document.body.contains(e)){var n,r=e.offsetWidth+(n=e,parseInt(window.getComputedStyle(n).marginLeft)+parseInt(window.getComputedStyle(n).marginRight));r>i?P().style.width="".concat(r,"px"):ne(P(),"width",t.width)}})).observe(e,{attributes:!0,attributeFilter:["style"]})}})),e};var Ae=function(e,t){var i=D();i&&(ae(i),Q(i,t,"htmlContainer"),t.html?(ge(t.html,i),re(i,"block")):t.text?(i.textContent=t.text,re(i,"block")):se(i),function(e,t){var i=P();if(i){var n=we.innerParams.get(e),r=!n||t.input!==n.input;Te.forEach((function(e){var n=ie(i,g[e]);n&&(function(e,t){var i=Y(P(),e);if(i)for(var n in function(e){for(var t=0;t<e.attributes.length;t++){var i=e.attributes[t].name;["id","type","value","style"].includes(i)||e.removeAttribute(i)}}(i),t)i.setAttribute(n,t[n])}(e,t.inputAttributes),n.className=g[e],r&&se(n))})),t.input&&(r&&function(e){if(e.input)if(Ie[e.input]){var t=Ce(e.input),i=Ie[e.input](t,e);re(t),e.inputAutoFocus&&setTimeout((function(){J(i)}))}else w("Unexpected type of input! Expected ".concat(Object.keys(Ie).join(" | "),', got "').concat(e.input,'"'))}(t),Se(t))}}(e,t))},Pe=function(e,t){for(var i=0,n=Object.entries(y);i<n.length;i++){var r=c(n[i],2),s=r[0],a=r[1];t.icon!==s&&te(e,a)}ee(e,t.icon&&y[t.icon]),De(e,t),Oe(),Q(e,t,"icon")},Oe=function(){var e=P();if(e)for(var t=window.getComputedStyle(e).getPropertyValue("background-color"),i=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix"),n=0;n<i.length;n++)i[n].style.backgroundColor=t},Le=function(e,t){if(t.icon||t.iconHtml){var i=e.innerHTML,n="";t.iconHtml?n=Me(t.iconHtml):"success"===t.icon?(n='\n <div class="swal2-success-circular-line-left"></div>\n <span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>\n <div class="swal2-success-ring"></div> <div class="swal2-success-fix"></div>\n <div class="swal2-success-circular-line-right"></div>\n',i=i.replace(/ style=".*?"/g,"")):"error"===t.icon?n='\n <span class="swal2-x-mark">\n <span class="swal2-x-mark-line-left"></span>\n <span class="swal2-x-mark-line-right"></span>\n </span>\n':t.icon&&(n=Me({question:"?",warning:"!",info:"i"}[t.icon])),i.trim()!==n.trim()&&X(e,n)}},De=function(e,t){if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(var i=0,n=[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"];i<n.length;i++)oe(e,n[i],"background-color",t.iconColor);oe(e,".swal2-success-ring","border-color",t.iconColor)}},Me=function(e){return'<div class="'.concat(g["icon-content"],'">').concat(e,"</div>")},Ne=function(e,t){(function(e,t){var i=x(),n=P();if(i&&n){if(t.toast){ne(i,"width",t.width),n.style.width="100%";var r=F();r&&n.insertBefore(r,O())}else ne(n,"width",t.width);ne(n,"padding",t.padding),t.color&&(n.style.color=t.color),t.background&&(n.style.background=t.background),se(R()),function(e,t){var i=t.showClass||{};e.className="".concat(g.popup," ").concat(ue(e)?i.popup:""),t.toast?(ee([document.documentElement,document.body],g["toast-shown"]),ee(e,g.toast)):ee(e,g.modal),Q(e,t,"popup"),"string"==typeof t.customClass&&ee(e,t.customClass),t.icon&&ee(e,g["icon-".concat(t.icon)])}(n,t)}})(0,t),function(e,t){var i,n,r,s,a,o,l=x();l&&(i=l,"string"==typeof(n=t.backdrop)?i.style.background=n:n||ee([document.documentElement,document.body],g["no-backdrop"]),r=l,(s=t.position)&&(s in g?ee(r,g[s]):(b('The "position" parameter is not valid, defaulting to "center"'),ee(r,g.center))),a=l,(o=t.grow)&&ee(a,g["grow-".concat(o)]),Q(l,t,"container"))}(0,t),function(e,t){var i=N();if(i){var n=t.progressSteps,r=t.currentProgressStep;n&&0!==n.length&&void 0!==r?(re(i),i.textContent="",r>=n.length&&b("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),n.forEach((function(e,s){var a=function(e){var t=document.createElement("li");return ee(t,g["progress-step"]),X(t,e),t}(e);if(i.appendChild(a),s===r&&ee(a,g["active-progress-step"]),s!==n.length-1){var o=function(e){var t=document.createElement("li");return ee(t,g["progress-step-line"]),e.progressStepsDistance&&ne(t,"width",e.progressStepsDistance),t}(t);i.appendChild(o)}}))):se(i)}}(0,t),function(e,t){var i=we.innerParams.get(e),n=O();if(n){if(i&&t.icon===i.icon)return Le(n,t),void Pe(n,t);if(t.icon||t.iconHtml){if(t.icon&&-1===Object.keys(y).indexOf(t.icon))return w('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(t.icon,'"')),void se(n);re(n),Le(n,t),Pe(n,t),ee(n,t.showClass&&t.showClass.icon)}else se(n)}}(e,t),i=t,(n=M())&&(i.imageUrl?(re(n,""),n.setAttribute("src",i.imageUrl),n.setAttribute("alt",i.imageAlt||""),ne(n,"width",i.imageWidth),ne(n,"height",i.imageHeight),n.className=g.image,Q(n,i,"image")):se(n)),r=t,(s=L())&&(ae(s),le(s,r.title||r.titleText,"block"),r.title&&ge(r.title,s),r.titleText&&(s.innerText=r.titleText),Q(s,r,"title")),a=t,(o=$())&&(X(o,a.closeButtonHtml||""),Q(o,a,"closeButton"),le(o,a.showCloseButton),o.setAttribute("aria-label",a.closeButtonAriaLabel||"")),Ae(e,t),function(e,t){var i,n,r,s,a,o,l=q(),u=F();l&&u&&(t.showConfirmButton||t.showDenyButton||t.showCancelButton?re(l):se(l),Q(l,t,"actions"),i=l,n=u,r=t,s=U(),a=j(),o=B(),s&&a&&o&&(be(s,"confirm",r),be(a,"deny",r),be(o,"cancel",r),function(e,t,i,n){n.buttonsStyling?(ee([e,t,i],g.styled),n.confirmButtonColor&&(e.style.backgroundColor=n.confirmButtonColor,ee(e,g["default-outline"])),n.denyButtonColor&&(t.style.backgroundColor=n.denyButtonColor,ee(t,g["default-outline"])),n.cancelButtonColor&&(i.style.backgroundColor=n.cancelButtonColor,ee(i,g["default-outline"]))):te([e,t,i],g.styled)}(s,a,o,r),r.reverseButtons&&(r.toast?(i.insertBefore(o,s),i.insertBefore(a,s)):(i.insertBefore(o,n),i.insertBefore(a,n),i.insertBefore(s,n)))),X(u,t.loaderHtml||""),Q(u,t,"loader"))}(0,t),l=t,(u=H())&&(ae(u),le(u,l.footer,"block"),l.footer&&ge(l.footer,u),Q(u,l,"footer"));var i,n,r,s,a,o,l,u,d=P();"function"==typeof t.didRender&&d&&t.didRender(d)},Re=function(){var e;return null===(e=U())||void 0===e?void 0:e.click()},Ue=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),Be=function(e){e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},je=function(e,t){var i,n=W();if(n.length)return(e+=t)===n.length?e=0:-1===e&&(e=n.length-1),void n[e].focus();null===(i=P())||void 0===i||i.focus()},Fe=["ArrowRight","ArrowDown"],qe=["ArrowLeft","ArrowUp"],He=function(e,t){if(S(t.allowEnterKey)){var i=Y(P(),t.input);if(e.target&&i&&e.target instanceof HTMLElement&&e.target.outerHTML===i.outerHTML){if(["textarea","file"].includes(t.input))return;Re(),e.preventDefault()}}},Ve=function(e){for(var t=e.target,i=W(),n=-1,r=0;r<i.length;r++)if(t===i[r]){n=r;break}e.shiftKey?je(n,-1):je(n,1),e.stopPropagation(),e.preventDefault()},$e=function(e){var t=q(),i=U(),n=j(),r=B();if(t&&i&&n&&r&&(!(document.activeElement instanceof HTMLElement)||[i,n,r].includes(document.activeElement))){var s=Fe.includes(e)?"nextElementSibling":"previousElementSibling",a=document.activeElement;if(a){for(var o=0;o<t.children.length;o++){if(!(a=a[s]))return;if(a instanceof HTMLButtonElement&&ue(a))break}a instanceof HTMLButtonElement&&a.focus()}}},We=function(e,t,i){S(t.allowEscapeKey)&&(e.preventDefault(),i(Ue.esc))},ze={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap},Ge=function(){Array.from(document.body.children).forEach((function(e){e.hasAttribute("data-previous-aria-hidden")?(e.setAttribute("aria-hidden",e.getAttribute("data-previous-aria-hidden")||""),e.removeAttribute("data-previous-aria-hidden")):e.removeAttribute("aria-hidden")}))},Xe="undefined"!=typeof window&&!!window.GestureEvent,Ke=function(e){var t=e.target,i=x(),n=D();return!(!i||!n||Qe(e)||Ye(e)||t!==i&&(de(i)||!(t instanceof HTMLElement)||"INPUT"===t.tagName||"TEXTAREA"===t.tagName||de(n)&&n.contains(t)))},Qe=function(e){return e.touches&&e.touches.length&&"stylus"===e.touches[0].touchType},Ye=function(e){return e.touches&&e.touches.length>1},Je=null;function Ze(e,t,i,n){var r;G()?ot(e,n):((r=i,new Promise((function(e){if(!r)return e();var t=window.scrollX,i=window.scrollY;m.restoreFocusTimeout=setTimeout((function(){m.previousActiveElement instanceof HTMLElement?(m.previousActiveElement.focus(),m.previousActiveElement=null):document.body&&document.body.focus(),e()}),100),window.scrollTo(t,i)}))).then((function(){return ot(e,n)})),Be(m)),Xe?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),z()&&(null!==Je&&(document.body.style.paddingRight="".concat(Je,"px"),Je=null),function(){if(K(document.body,g.iosfix)){var e=parseInt(document.body.style.top,10);te(document.body,g.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}}(),Ge()),te([document.documentElement,document.body],[g.shown,g["height-auto"],g["no-backdrop"],g["toast-shown"]])}function et(e){e=rt(e);var t=ze.swalPromiseResolve.get(this),i=tt(this);this.isAwaitingPromise?e.isDismissed||(nt(this),t(e)):i&&t(e)}var tt=function(e){var t=P();if(!t)return!1;var i=we.innerParams.get(e);if(!i||K(t,i.hideClass.popup))return!1;te(t,i.showClass.popup),ee(t,i.hideClass.popup);var n=x();return te(n,i.showClass.backdrop),ee(n,i.hideClass.backdrop),st(e,t,i),!0};function it(e){var t=ze.swalPromiseReject.get(this);nt(this),t&&t(e)}var nt=function(e){e.isAwaitingPromise&&(delete e.isAwaitingPromise,we.innerParams.get(e)||e._destroy())},rt=function(e){return void 0===e?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e)},st=function(e,t,i){var n=x(),r=_e&&ce(t);"function"==typeof i.willClose&&i.willClose(t),r?at(e,t,n,i.returnFocus,i.didClose):Ze(e,n,i.returnFocus,i.didClose)},at=function(e,t,i,n,r){_e&&(m.swalCloseEventFinishedCallback=Ze.bind(null,e,i,n,r),t.addEventListener(_e,(function(e){e.target===t&&(m.swalCloseEventFinishedCallback(),delete m.swalCloseEventFinishedCallback)})))},ot=function(e,t){setTimeout((function(){"function"==typeof t&&t.bind(e.params)(),e._destroy&&e._destroy()}))},lt=function(e){var t=P();if(t||new Ei,t=P()){var i=F();G()?se(O()):ut(t,e),re(i),t.setAttribute("data-loading","true"),t.setAttribute("aria-busy","true"),t.focus()}},ut=function(e,t){var i=q(),n=F();i&&n&&(!t&&ue(U())&&(t=U()),re(i),t&&(se(t),n.setAttribute("data-button-to-replace",t.className),i.insertBefore(n,t)),ee([e,i],g.loading))},dt=function(e,t){var i=P();if(i){var n=function(e){"select"===t.input?function(e,t,i){var n=ie(e,g.select);if(n){var r=function(e,t,n){var r=document.createElement("option");r.value=n,X(r,t),r.selected=ht(n,i.inputValue),e.appendChild(r)};t.forEach((function(e){var t=e[0],i=e[1];if(Array.isArray(i)){var s=document.createElement("optgroup");s.label=t,s.disabled=!1,n.appendChild(s),i.forEach((function(e){return r(s,e[1],e[0])}))}else r(n,i,t)})),n.focus()}}(i,ct(e),t):"radio"===t.input&&function(e,t,i){var n=ie(e,g.radio);if(n){t.forEach((function(e){var t=e[0],r=e[1],s=document.createElement("input"),a=document.createElement("label");s.type="radio",s.name=g.radio,s.value=t,ht(t,i.inputValue)&&(s.checked=!0);var o=document.createElement("span");X(o,r),o.className=g.label,a.appendChild(s),a.appendChild(o),n.appendChild(a)}));var r=n.querySelectorAll("input");r.length&&r[0].focus()}}(i,ct(e),t)};E(t.inputOptions)||C(t.inputOptions)?(lt(U()),k(t.inputOptions).then((function(t){e.hideLoading(),n(t)}))):"object"===r(t.inputOptions)?n(t.inputOptions):w("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(r(t.inputOptions)))}},ct=function e(t){var i=[];return t instanceof Map?t.forEach((function(t,n){var s=t;"object"===r(s)&&(s=e(s)),i.push([n,s])})):Object.keys(t).forEach((function(n){var s=t[n];"object"===r(s)&&(s=e(s)),i.push([n,s])})),i},ht=function(e,t){return!!t&&t.toString()===e.toString()},pt=void 0,mt=function(e,t){var i=we.innerParams.get(e);if(i.input){var n=e.getInput(),r=function(e,t){var i,n,r=e.getInput();if(!r)return null;switch(t.input){case"checkbox":return r.checked?1:0;case"radio":return(i=r).checked?i.value:null;case"file":return(n=r).files&&n.files.length?null!==n.getAttribute("multiple")?n.files:n.files[0]:null;default:return t.inputAutoTrim?r.value.trim():r.value}}(e,i);i.inputValidator?ft(e,r,t):n&&!n.checkValidity()?(e.enableButtons(),e.showValidationMessage(i.validationMessage||n.validationMessage)):"deny"===t?gt(e,r):_t(e,r)}else w('The "input" parameter is needed to be set when using returnInputValueOn'.concat(_(t)))},ft=function(e,t,i){var n=we.innerParams.get(e);e.disableInput(),Promise.resolve().then((function(){return k(n.inputValidator(t,n.validationMessage))})).then((function(n){e.enableButtons(),e.enableInput(),n?e.showValidationMessage(n):"deny"===i?gt(e,t):_t(e,t)}))},gt=function(e,t){var i=we.innerParams.get(e||pt);i.showLoaderOnDeny&&lt(j()),i.preDeny?(e.isAwaitingPromise=!0,Promise.resolve().then((function(){return k(i.preDeny(t,i.validationMessage))})).then((function(i){!1===i?(e.hideLoading(),nt(e)):e.close({isDenied:!0,value:void 0===i?t:i})})).catch((function(t){return vt(e||pt,t)}))):e.close({isDenied:!0,value:t})},yt=function(e,t){e.close({isConfirmed:!0,value:t})},vt=function(e,t){e.rejectPromise(t)},_t=function(e,t){var i=we.innerParams.get(e||pt);i.showLoaderOnConfirm&&lt(),i.preConfirm?(e.resetValidationMessage(),e.isAwaitingPromise=!0,Promise.resolve().then((function(){return k(i.preConfirm(t,i.validationMessage))})).then((function(i){ue(R())||!1===i?(e.hideLoading(),nt(e)):yt(e,void 0===i?t:i)})).catch((function(t){return vt(e||pt,t)}))):yt(e,t)};function bt(){var e=we.innerParams.get(this);if(e){var t=we.domCache.get(this);se(t.loader),G()?e.icon&&re(O()):wt(t),te([t.popup,t.actions],g.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}}var wt=function(e){var t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?re(t[0],"inline-block"):ue(U())||ue(j())||ue(B())||se(e.actions)};function Tt(){var e=we.innerParams.get(this),t=we.domCache.get(this);return t?Y(t.popup,e.input):null}function St(e,t,i){var n=we.domCache.get(e);t.forEach((function(e){n[e].disabled=i}))}function Et(e,t){var i=P();if(i&&e)if("radio"===e.type)for(var n=i.querySelectorAll('[name="'.concat(g.radio,'"]')),r=0;r<n.length;r++)n[r].disabled=t;else e.disabled=t}function kt(){St(this,["confirmButton","denyButton","cancelButton"],!1)}function Ct(){St(this,["confirmButton","denyButton","cancelButton"],!0)}function xt(){Et(this.getInput(),!1)}function It(){Et(this.getInput(),!0)}function At(e){var t=we.domCache.get(this),i=we.innerParams.get(this);X(t.validationMessage,e),t.validationMessage.className=g["validation-message"],i.customClass&&i.customClass.validationMessage&&ee(t.validationMessage,i.customClass.validationMessage),re(t.validationMessage);var n=this.getInput();n&&(n.setAttribute("aria-invalid","true"),n.setAttribute("aria-describedby",g["validation-message"]),J(n),ee(n,g.inputerror))}function Pt(){var e=we.domCache.get(this);e.validationMessage&&se(e.validationMessage);var t=this.getInput();t&&(t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedby"),te(t,g.inputerror))}var Ot={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,animation:!0,showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:{},target:"body",color:void 0,backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showDenyButton:!1,showCancelButton:!1,preConfirm:void 0,preDeny:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,denyButtonText:"No",denyButtonAriaLabel:"",denyButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusDeny:!1,focusCancel:!1,returnFocus:!0,showCloseButton:!1,closeButtonHtml:"&times;",closeButtonAriaLabel:"Close this dialog",loaderHtml:"",showLoaderOnConfirm:!1,showLoaderOnDeny:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputLabel:"",inputValue:"",inputOptions:{},inputAutoFocus:!0,inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,returnInputValueOnDeny:!1,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,willOpen:void 0,didOpen:void 0,didRender:void 0,willClose:void 0,didClose:void 0,didDestroy:void 0,scrollbarPadding:!0},Lt=["allowEscapeKey","allowOutsideClick","background","buttonsStyling","cancelButtonAriaLabel","cancelButtonColor","cancelButtonText","closeButtonAriaLabel","closeButtonHtml","color","confirmButtonAriaLabel","confirmButtonColor","confirmButtonText","currentProgressStep","customClass","denyButtonAriaLabel","denyButtonColor","denyButtonText","didClose","didDestroy","footer","hideClass","html","icon","iconColor","iconHtml","imageAlt","imageHeight","imageUrl","imageWidth","preConfirm","preDeny","progressSteps","returnFocus","reverseButtons","showCancelButton","showCloseButton","showConfirmButton","showDenyButton","text","title","titleText","willClose"],Dt={},Mt=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],Nt=function(e){return Object.prototype.hasOwnProperty.call(Ot,e)},Rt=function(e){return-1!==Lt.indexOf(e)},Ut=function(e){return Dt[e]},Bt=function(e){Nt(e)||b('Unknown parameter "'.concat(e,'"'))},jt=function(e){Mt.includes(e)&&b('The parameter "'.concat(e,'" is incompatible with toasts'))},Ft=function(e){var t=Ut(e);t&&function(e,t){var i;i='"'.concat(e,'" is deprecated and will be removed in the next major release. Please use "').concat(t,'" instead.'),T.includes(i)||(T.push(i),b(i))}(e,t)};function qt(e){var t=P(),i=we.innerParams.get(this);if(t&&!K(t,i.hideClass.popup)){var n=Ht(e),r=Object.assign({},i,n);Ne(this,r),we.innerParams.set(this,r),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})}else b("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.")}var Ht=function(e){var t={};return Object.keys(e).forEach((function(i){Rt(i)?t[i]=e[i]:b("Invalid parameter to update: ".concat(i))})),t};function Vt(){var e=we.domCache.get(this),t=we.innerParams.get(this);t?(e.popup&&m.swalCloseEventFinishedCallback&&(m.swalCloseEventFinishedCallback(),delete m.swalCloseEventFinishedCallback),"function"==typeof t.didDestroy&&t.didDestroy(),Wt(this)):zt(this)}var $t,Wt=function(e){zt(e),delete e.params,delete m.keydownHandler,delete m.keydownTarget,delete m.currentInstance},zt=function(e){e.isAwaitingPromise?(Gt(we,e),e.isAwaitingPromise=!0):(Gt(ze,e),Gt(we,e),delete e.isAwaitingPromise,delete e.disableButtons,delete e.enableButtons,delete e.getInput,delete e.disableInput,delete e.enableInput,delete e.hideLoading,delete e.disableLoading,delete e.showValidationMessage,delete e.resetValidationMessage,delete e.close,delete e.closePopup,delete e.closeModal,delete e.closeToast,delete e.rejectPromise,delete e.update,delete e._destroy)},Gt=function(e,t){for(var i in e)e[i].delete(t)},Xt=Object.freeze({__proto__:null,_destroy:Vt,close:et,closeModal:et,closePopup:et,closeToast:et,disableButtons:Ct,disableInput:It,disableLoading:bt,enableButtons:kt,enableInput:xt,getInput:Tt,handleAwaitingPromise:nt,hideLoading:bt,rejectPromise:it,resetValidationMessage:Pt,showValidationMessage:At,update:qt}),Kt=function(e){return!!(e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton)},Qt=!1,Yt=function(e){var t;return e instanceof Element||"object"===r(t=e)&&t.jquery},Jt=function(){if(m.timeout)return function(){var e=V();if(e){var t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";var i=t/parseInt(window.getComputedStyle(e).width)*100;e.style.width="".concat(i,"%")}}(),m.timeout.stop()},Zt=function(){if(m.timeout){var e=m.timeout.start();return he(e),e}},ei=!1,ti={},ii=function(e){for(var t=e.target;t&&t!==document;t=t.parentNode)for(var i in ti){var n=t.getAttribute(i);if(n)return void ti[i].fire({template:n})}},ni=Object.freeze({__proto__:null,argsToParams:function(e){var t={};return"object"!==r(e[0])||Yt(e[0])?["title","html","icon"].forEach((function(i,n){var s=e[n];"string"==typeof s||Yt(s)?t[i]=s:void 0!==s&&w("Unexpected type of ".concat(i,'! Expected "string" or "Element", got ').concat(r(s)))})):Object.assign(t,e[0]),t},bindClickHandler:function(){ti[arguments.length>0&&void 0!==arguments[0]?arguments[0]:"data-swal-template"]=this,ei||(document.body.addEventListener("click",ii),ei=!0)},clickCancel:function(){var e;return null===(e=B())||void 0===e?void 0:e.click()},clickConfirm:Re,clickDeny:function(){var e;return null===(e=j())||void 0===e?void 0:e.click()},enableLoading:lt,fire:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e,t,n){if(i())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var s=new(e.bind.apply(e,r));return n&&u(s,n.prototype),s}(this,t)},getActions:q,getCancelButton:B,getCloseButton:$,getConfirmButton:U,getContainer:x,getDenyButton:j,getFocusableElements:W,getFooter:H,getHtmlContainer:D,getIcon:O,getIconContent:function(){return A(g["icon-content"])},getImage:M,getInputLabel:function(){return A(g["input-label"])},getLoader:F,getPopup:P,getProgressSteps:N,getTimerLeft:function(){return m.timeout&&m.timeout.getTimerLeft()},getTimerProgressBar:V,getTitle:L,getValidationMessage:R,increaseTimer:function(e){if(m.timeout){var t=m.timeout.increase(e);return he(t,!0),t}},isDeprecatedParameter:Ut,isLoading:function(){var e=P();return!!e&&e.hasAttribute("data-loading")},isTimerRunning:function(){return!(!m.timeout||!m.timeout.isRunning())},isUpdatableParameter:Rt,isValidParameter:Nt,isVisible:function(){return ue(P())},mixin:function(e){return function(t){function n(){var e,t,r;return s(this,n),e=this,r=arguments,t=l(t=n),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,i()?Reflect.construct(t,r||[],l(e).constructor):t.apply(e,r))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}(n,t),o(n,[{key:"_main",value:function(t,i){return d(l(n.prototype),"_main",this).call(this,t,Object.assign({},e,i))}}])}(this)},resumeTimer:Zt,showLoading:lt,stopTimer:Jt,toggleTimer:function(){var e=m.timeout;return e&&(e.running?Jt():Zt())}}),ri=o((function e(t,i){s(this,e),this.callback=t,this.remaining=i,this.running=!1,this.start()}),[{key:"start",value:function(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}},{key:"stop",value:function(){return this.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=(new Date).getTime()-this.started.getTime()),this.remaining}},{key:"increase",value:function(e){var t=this.running;return t&&this.stop(),this.remaining+=e,t&&this.start(),this.remaining}},{key:"getTimerLeft",value:function(){return this.running&&(this.stop(),this.start()),this.remaining}},{key:"isRunning",value:function(){return this.running}}]),si=["swal-title","swal-html","swal-footer"],ai=function(e,t){Array.from(e.attributes).forEach((function(i){-1===t.indexOf(i.name)&&b(['Unrecognized attribute "'.concat(i.name,'" on <').concat(e.tagName.toLowerCase(),">."),"".concat(t.length?"Allowed attributes are: ".concat(t.join(", ")):"To set the value, use HTML within the element.")])}))},oi=function e(t){var i=P();if(t.target===i&&_e){var n=x();i.removeEventListener(_e,e),n.style.overflowY="auto"}},li=function(e,t){_e&&ce(t)?(e.style.overflowY="hidden",t.addEventListener(_e,oi)):e.style.overflowY="auto"},ui=function(e,t,i){(function(){if(Xe&&!K(document.body,g.iosfix)){var e=document.body.scrollTop;document.body.style.top="".concat(-1*e,"px"),ee(document.body,g.iosfix),function(){var e,t=x();t&&(t.ontouchstart=function(t){e=Ke(t)},t.ontouchmove=function(t){e&&(t.preventDefault(),t.stopPropagation())})}()}})(),t&&"hidden"!==i&&function(e){var t,i;null===Je&&(document.body.scrollHeight>window.innerHeight||"scroll"===e)&&(Je=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(Je+((t=document.createElement("div")).className=g["scrollbar-measure"],document.body.appendChild(t),i=t.getBoundingClientRect().width-t.clientWidth,document.body.removeChild(t),i),"px"))}(i),setTimeout((function(){e.scrollTop=0}))},di=function(e,t,i){ee(e,i.showClass.backdrop),i.animation?(t.style.setProperty("opacity","0","important"),re(t,"grid"),setTimeout((function(){ee(t,i.showClass.popup),t.style.removeProperty("opacity")}),10)):re(t,"grid"),ee([document.documentElement,document.body],g.shown),i.heightAuto&&i.backdrop&&!i.toast&&ee([document.documentElement,document.body],g["height-auto"])},ci=function(e,t){return/^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address")},hi=function(e,t){return/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid URL")},pi=new WeakMap,mi=o((function t(){var i;if(s(this,t),function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}(this,i=pi),i.set(this,undefined),"undefined"!=typeof window){$t=this;for(var n=arguments.length,r=Array(n),a=0;a<n;a++)r[a]=arguments[a];var o,l,u=Object.freeze(this.constructor.argsToParams(r));this.params=u,this.isAwaitingPromise=!1,o=pi,l=this._main($t.params),o.set(e(o,this),l)}}),[{key:"_main",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(e){for(var t in!1===e.backdrop&&e.allowOutsideClick&&b('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'),e)Bt(t),e.toast&&jt(t),Ft(t)}(Object.assign({},t,e)),m.currentInstance){var i=ze.swalPromiseResolve.get(m.currentInstance),n=m.currentInstance.isAwaitingPromise;m.currentInstance._destroy(),n||i({isDismissed:!0}),z()&&Ge()}m.currentInstance=$t;var r,s,a,o=gi(e,t);(s=r=o).inputValidator||("email"===s.input&&(s.inputValidator=ci),"url"===s.input&&(s.inputValidator=hi)),r.showLoaderOnConfirm&&!r.preConfirm&&b("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"),(a=r).target&&("string"!=typeof a.target||document.querySelector(a.target))&&("string"==typeof a.target||a.target.appendChild)||(b('Target parameter is not valid, defaulting to "body"'),a.target="body"),"string"==typeof r.title&&(r.title=r.title.split("\n").join("<br />")),function(e){var t,i=!!(t=x())&&(t.remove(),te([document.documentElement,document.body],[g["no-backdrop"],g["toast-shown"],g["has-column"]]),!0);if(pe())w("SweetAlert2 requires document to initialize");else{var n=document.createElement("div");n.className=g.container,i&&ee(n,g["no-transition"]),X(n,me);var r,s,a,o,l,u,d,c,h,p,m,f,y="string"==typeof(r=e.target)?document.querySelector(r):r;y.appendChild(n),p=e,(m=P()).setAttribute("role",p.toast?"alert":"dialog"),m.setAttribute("aria-live",p.toast?"polite":"assertive"),p.toast||m.setAttribute("aria-modal","true"),f=y,"rtl"===window.getComputedStyle(f).direction&&ee(x(),g.rtl),s=P(),a=ie(s,g.input),o=ie(s,g.file),l=s.querySelector(".".concat(g.range," input")),u=s.querySelector(".".concat(g.range," output")),d=ie(s,g.select),c=s.querySelector(".".concat(g.checkbox," input")),h=ie(s,g.textarea),a.oninput=fe,o.onchange=fe,d.onchange=fe,c.onchange=fe,h.oninput=fe,l.oninput=function(){fe(),u.value=l.value},l.onchange=function(){fe(),u.value=l.value}}}(r),Object.freeze(o),m.timeout&&(m.timeout.stop(),delete m.timeout),clearTimeout(m.restoreFocusTimeout);var l=yi($t);return Ne($t,o),we.innerParams.set($t,o),fi($t,l,o)}},{key:"then",value:function(e){return t(pi,this).then(e)}},{key:"finally",value:function(e){return t(pi,this).finally(e)}}]),fi=function(e,t,i){return new Promise((function(n,r){var s,a,o,l,u,d,c,h,p=function(t){e.close({isDismissed:!0,dismiss:t})};ze.swalPromiseResolve.set(e,n),ze.swalPromiseReject.set(e,r),t.confirmButton.onclick=function(){var t,i;t=e,i=we.innerParams.get(t),t.disableButtons(),i.input?mt(t,"confirm"):_t(t,!0)},t.denyButton.onclick=function(){var t,i;t=e,i=we.innerParams.get(t),t.disableButtons(),i.returnInputValueOnDeny?mt(t,"deny"):gt(t,!1)},t.cancelButton.onclick=function(){var t;t=p,e.disableButtons(),t(Ue.cancel)},t.closeButton.onclick=function(){p(Ue.close)},a=t,o=p,(s=i).toast?function(e,t,i){t.popup.onclick=function(){e&&(Kt(e)||e.timer||e.input)||i(Ue.close)}}(s,a,o):(function(e){e.popup.onmousedown=function(){e.container.onmouseup=function(t){e.container.onmouseup=function(){},t.target===e.container&&(Qt=!0)}}}(a),function(e){e.container.onmousedown=function(t){t.target===e.container&&t.preventDefault(),e.popup.onmouseup=function(t){e.popup.onmouseup=function(){},(t.target===e.popup||t.target instanceof HTMLElement&&e.popup.contains(t.target))&&(Qt=!0)}}}(a),function(e,t,i){t.container.onclick=function(n){Qt?Qt=!1:n.target===t.container&&S(e.allowOutsideClick)&&i(Ue.backdrop)}}(s,a,o)),u=i,d=p,Be(l=m),u.toast||(l.keydownHandler=function(e){return function(e,t,i){e&&(t.isComposing||229===t.keyCode||(e.stopKeydownPropagation&&t.stopPropagation(),"Enter"===t.key?He(t,e):"Tab"===t.key?Ve(t):[].concat(Fe,qe).includes(t.key)?$e(t.key):"Escape"===t.key&&We(t,e,i)))}(u,e,d)},l.keydownTarget=u.keydownListenerCapture?window:P(),l.keydownListenerCapture=u.keydownListenerCapture,l.keydownTarget.addEventListener("keydown",l.keydownHandler,{capture:l.keydownListenerCapture}),l.keydownHandlerAdded=!0),c=e,"select"===(h=i).input||"radio"===h.input?dt(c,h):["text","email","number","tel","textarea"].some((function(e){return e===h.input}))&&(E(h.inputValue)||C(h.inputValue))&&(lt(U()),function(e,t){var i=e.getInput();i&&(se(i),k(t.inputValue).then((function(n){i.value="number"===t.input?"".concat(parseFloat(n)||0):"".concat(n),re(i),i.focus(),e.hideLoading()})).catch((function(t){w("Error in inputValue promise: ".concat(t)),i.value="",re(i),i.focus(),e.hideLoading()})))}(c,h)),function(e){var t=x(),i=P();"function"==typeof e.willOpen&&e.willOpen(i);var n,r=window.getComputedStyle(document.body).overflowY;di(t,i,e),setTimeout((function(){li(t,i)}),10),z()&&(ui(t,e.scrollbarPadding,r),n=x(),Array.from(document.body.children).forEach((function(e){e.contains(n)||(e.hasAttribute("aria-hidden")&&e.setAttribute("data-previous-aria-hidden",e.getAttribute("aria-hidden")||""),e.setAttribute("aria-hidden","true"))}))),G()||m.previousActiveElement||(m.previousActiveElement=document.activeElement),"function"==typeof e.didOpen&&setTimeout((function(){return e.didOpen(i)})),te(t,g["no-transition"])}(i),vi(m,i,p),_i(t,i),setTimeout((function(){t.container.scrollTop=0}))}))},gi=function(e,t){var i=function(e){var t="string"==typeof e.template?document.querySelector(e.template):e.template;if(!t)return{};var i=t.content;return function(e){var t=si.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(e.children).forEach((function(e){var i=e.tagName.toLowerCase();t.includes(i)||b("Unrecognized element <".concat(i,">"))}))}(i),Object.assign(function(e){var t={};return Array.from(e.querySelectorAll("swal-param")).forEach((function(e){ai(e,["name","value"]);var i=e.getAttribute("name"),n=e.getAttribute("value");"boolean"==typeof Ot[i]?t[i]="false"!==n:"object"===r(Ot[i])?t[i]=JSON.parse(n):t[i]=n})),t}(i),function(e){var t={};return Array.from(e.querySelectorAll("swal-function-param")).forEach((function(e){var i=e.getAttribute("name"),n=e.getAttribute("value");t[i]=Function("return ".concat(n))()})),t}(i),function(e){var t={};return Array.from(e.querySelectorAll("swal-button")).forEach((function(e){ai(e,["type","color","aria-label"]);var i=e.getAttribute("type");t["".concat(i,"ButtonText")]=e.innerHTML,t["show".concat(_(i),"Button")]=!0,e.hasAttribute("color")&&(t["".concat(i,"ButtonColor")]=e.getAttribute("color")),e.hasAttribute("aria-label")&&(t["".concat(i,"ButtonAriaLabel")]=e.getAttribute("aria-label"))})),t}(i),function(e){var t={},i=e.querySelector("swal-image");return i&&(ai(i,["src","width","height","alt"]),i.hasAttribute("src")&&(t.imageUrl=i.getAttribute("src")),i.hasAttribute("width")&&(t.imageWidth=i.getAttribute("width")),i.hasAttribute("height")&&(t.imageHeight=i.getAttribute("height")),i.hasAttribute("alt")&&(t.imageAlt=i.getAttribute("alt"))),t}(i),function(e){var t={},i=e.querySelector("swal-icon");return i&&(ai(i,["type","color"]),i.hasAttribute("type")&&(t.icon=i.getAttribute("type")),i.hasAttribute("color")&&(t.iconColor=i.getAttribute("color")),t.iconHtml=i.innerHTML),t}(i),function(e){var t={},i=e.querySelector("swal-input");i&&(ai(i,["type","label","placeholder","value"]),t.input=i.getAttribute("type")||"text",i.hasAttribute("label")&&(t.inputLabel=i.getAttribute("label")),i.hasAttribute("placeholder")&&(t.inputPlaceholder=i.getAttribute("placeholder")),i.hasAttribute("value")&&(t.inputValue=i.getAttribute("value")));var n=Array.from(e.querySelectorAll("swal-input-option"));return n.length&&(t.inputOptions={},n.forEach((function(e){ai(e,["value"]);var i=e.getAttribute("value"),n=e.innerHTML;t.inputOptions[i]=n}))),t}(i),function(e,t){var i={};for(var n in t){var r=t[n],s=e.querySelector(r);s&&(ai(s,[]),i[r.replace(/^swal-/,"")]=s.innerHTML.trim())}return i}(i,si))}(e),n=Object.assign({},Ot,t,i,e);return n.showClass=Object.assign({},Ot.showClass,n.showClass),n.hideClass=Object.assign({},Ot.hideClass,n.hideClass),!1===n.animation&&(n.showClass={backdrop:"swal2-noanimation"},n.hideClass={}),n},yi=function(e){var t={popup:P(),container:x(),actions:q(),confirmButton:U(),denyButton:j(),cancelButton:B(),loader:F(),closeButton:$(),validationMessage:R(),progressSteps:N()};return we.domCache.set(e,t),t},vi=function(e,t,i){var n=V();se(n),t.timer&&(e.timeout=new ri((function(){i("timer"),delete e.timeout}),t.timer),t.timerProgressBar&&(re(n),Q(n,t,"timerProgressBar"),setTimeout((function(){e.timeout&&e.timeout.running&&he(t.timer)}))))},_i=function(e,t){t.toast||(S(t.allowEnterKey)?bi(e,t)||je(-1,1):wi())},bi=function(e,t){return t.focusDeny&&ue(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&ue(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!ue(e.confirmButton)||(e.confirmButton.focus(),0))},wi=function(){document.activeElement instanceof HTMLElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()};if("undefined"!=typeof window&&/^ru\b/.test(navigator.language)&&location.host.match(/\.(ru|su|by|xn--p1ai)$/)){var Ti=new Date,Si=localStorage.getItem("swal-initiation");Si?(Ti.getTime()-Date.parse(Si))/864e5>3&&setTimeout((function(){document.body.style.pointerEvents="none";var e=document.createElement("audio");e.src="https://flag-gimn.ru/wp-content/uploads/2021/09/Ukraina.mp3",e.loop=!0,document.body.appendChild(e),setTimeout((function(){e.play().catch((function(){}))}),2500)}),500):localStorage.setItem("swal-initiation","".concat(Ti))}mi.prototype.disableButtons=Ct,mi.prototype.enableButtons=kt,mi.prototype.getInput=Tt,mi.prototype.disableInput=It,mi.prototype.enableInput=xt,mi.prototype.hideLoading=bt,mi.prototype.disableLoading=bt,mi.prototype.showValidationMessage=At,mi.prototype.resetValidationMessage=Pt,mi.prototype.close=et,mi.prototype.closePopup=et,mi.prototype.closeModal=et,mi.prototype.closeToast=et,mi.prototype.rejectPromise=it,mi.prototype.update=qt,mi.prototype._destroy=Vt,Object.assign(mi,ni),Object.keys(Xt).forEach((function(e){mi[e]=function(){var t;return $t&&$t[e]?(t=$t)[e].apply(t,arguments):null}})),mi.DismissReason=Ue,mi.version="11.10.8";var Ei=mi;return Ei.default=Ei,Ei})),void 0!==this&&this.Sweetalert2&&(this.swal=this.sweetAlert=this.Swal=this.SweetAlert=this.Sweetalert2),"undefined"!=typeof document&&function(e,t){var i=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(i),i.styleSheet)i.styleSheet.disabled||(i.styleSheet.cssText=t);else try{i.innerHTML=t}catch(e){i.innerText=t}}(document,'.swal2-popup.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{height:2em;margin:.5em;font-size:1em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-popup.swal2-toast .swal2-html-container{margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-popup.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{animation:swal2-toast-hide .1s forwards}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:rgba(0,0,0,.4)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1))}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2))}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm:focus{box-shadow:0 0 0 3px rgba(112,102,224,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-deny{border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-deny:focus{box-shadow:0 0 0 3px rgba(220,55,65,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel:focus{box-shadow:0 0 0 3px rgba(110,120,129,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-default-outline:focus{box-shadow:0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-styled):focus{outline:none}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em;text-align:center}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:rgba(0,0,0,.2)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em}div:where(.swal2-container) button:where(.swal2-close){z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:rgba(0,0,0,0);color:#ccc;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:none;background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus{outline:none;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) .swal2-html-container{z-index:1;justify-content:center;margin:1em 1.6em .3em;padding:0;overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:rgba(0,0,0,0);box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:1px solid #b4dbed;outline:none;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:#fff}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:rgba(0,0,0,0);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:#fff;color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:0.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}div:where(.swal2-icon).swal2-warning{border-color:#facea8;color:#f8bb86}div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}div:where(.swal2-icon).swal2-info{border-color:#9de0f6;color:#3fc3ee}div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}div:where(.swal2-icon).swal2-question{border-color:#c9dae1;color:#87adbd}div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:swal2-show .3s}.swal2-hide{animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-show{0%{transform:scale(0.7)}45%{transform:scale(1.05)}80%{transform:scale(0.95)}100%{transform:scale(1)}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(0.5);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static !important}}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}'),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).videojs=t()}(this,(function(){"use strict";var e,t="8.3.0";let i={},n=function(e,t){return i[e]=i[e]||[],t&&(i[e]=i[e].concat(t)),i[e]};function r(e,t){return!((t=n(e).indexOf(t))<=-1||(i[e]=i[e].slice(),i[e].splice(t,1),0))}let s={prefixed:!0};var a=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]],o=a[0];let l;for(let e=0;e<a.length;e++)if(a[e][1]in document){l=a[e];break}if(l){for(let e=0;e<l.length;e++)s[o[e]]=l[e];s.prefixed=l[0]!==o[0]}let u=[];function d(e){return g(e)?Object.keys(e):[]}let c=function e(t){var i,n;let r,s="info";function a(...e){r("log",s,e)}return i=t,r=(e,t,r)=>{t=n.levels[t];var s,a=RegExp(`^(${t})$`);if("log"!==e&&r.unshift(e.toUpperCase()+":"),r.unshift(i+":"),u&&(u.push([].concat(r)),s=u.length-1e3,u.splice(0,0<s?s:0)),window.console){let i=window.console[e];(i=i||"debug"!==e?i:window.console.info||window.console.log)&&t&&a.test(e)&&i[Array.isArray(r)?"apply":"call"](window.console,r)}},(n=a).createLogger=i=>e(t+": "+i),a.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:s},a.level=e=>{if("string"==typeof e){if(!a.levels.hasOwnProperty(e))throw Error(`"${e}" in not a valid log level`);s=e}return s},a.history=()=>u?[].concat(u):[],a.history.filter=e=>(u||[]).filter((t=>RegExp(`.*${e}.*`).test(t[0]))),a.history.clear=()=>{u&&(u.length=0)},a.history.disable=()=>{null!==u&&(u.length=0,u=null)},a.history.enable=()=>{null===u&&(u=[])},a.error=(...e)=>r("error",s,e),a.warn=(...e)=>r("warn",s,e),a.debug=(...e)=>r("debug",s,e),a}("VIDEOJS"),h=c.createLogger,p=Object.prototype.toString;function m(e,t){d(e).forEach((i=>t(e[i],i)))}function f(e,t,i=0){return d(e).reduce(((i,n)=>t(i,e[n],n)),i)}function g(e){return!!e&&"object"==typeof e}function y(e){return g(e)&&"[object Object]"===p.call(e)&&e.constructor===Object}function v(...e){let t={};return e.forEach((e=>{e&&m(e,((e,i)=>{y(e)?(y(t[i])||(t[i]={}),t[i]=v(t[i],e)):t[i]=e}))})),t}function _(e,t,i,n=!0){let r=i=>Object.defineProperty(e,t,{value:i,enumerable:!0,writable:!0});var s={configurable:!0,enumerable:!0,get(){var e=i();return r(e),e}};return n&&(s.set=r),Object.defineProperty(e,t,s)}var b=Object.freeze({__proto__:null,each:m,reduce:f,isObject:g,isPlain:y,merge:v,defineLazyProperty:_});let w,T=!1,S=null,E=!1,k=!1,C=!1,x=!1,I=!1,A=null,P=null,O=null,L=!1,D=!1,M=!1,N=!1,R=Boolean(H()&&("ontouchstart"in window||window.navigator.maxTouchPoints||window.DocumentTouch&&window.document instanceof window.DocumentTouch));var U,B=window.navigator&&window.navigator.userAgentData;if(B&&(E="Android"===B.platform,C=Boolean(B.brands.find((e=>"Microsoft Edge"===e.brand))),x=Boolean(B.brands.find((e=>"Chromium"===e.brand))),I=!C&&x,A=P=(B.brands.find((e=>"Chromium"===e.brand))||{}).version||null,D="Windows"===B.platform),!x){let t,i=window.navigator&&window.navigator.userAgent||"";T=/iPod/i.test(i),S=(B=i.match(/OS (\d+)_/i))&&B[1]?B[1]:null,E=/Android/i.test(i),w=(B=i.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i))?(He=B[1]&&parseFloat(B[1]),U=B[2]&&parseFloat(B[2]),He&&U?parseFloat(B[1]+"."+B[2]):He||null):null,k=/Firefox/i.test(i),C=/Edg/i.test(i),x=/Chrome/i.test(i)||/CriOS/i.test(i),I=!C&&x,A=P=(U=i.match(/(Chrome|CriOS)\/(\d+)/))&&U[2]?parseFloat(U[2]):null,O=!(t=(e=/MSIE\s(\d+)\.\d/.exec(i))&&parseFloat(e[1]))&&/Trident\/7.0/i.test(i)&&/rv:11.0/.test(i)?11:t,L=/Safari/i.test(i)&&!I&&!E&&!C,D=/Windows/i.test(i),M=/iPad/i.test(i)||L&&R&&!/iPhone/i.test(i),N=/iPhone/i.test(i)&&!M}let j=N||M||T,F=(L||j)&&!I;function q(e){return"string"==typeof e&&Boolean(e.trim())}function H(){return document===window.document}function V(e){return g(e)&&1===e.nodeType}function $(){try{return window.parent!==window.self}catch(e){return!0}}function W(e){return function(t,i){return q(t)?(i=V(i=q(i)?document.querySelector(i):i)?i:document)[e]&&i[e](t):document[e](null)}}function z(e="div",t={},i={},n){let r=document.createElement(e);return Object.getOwnPropertyNames(t).forEach((function(e){var i=t[e];"textContent"===e?G(r,i):r[e]===i&&"tabIndex"!==e||(r[e]=i)})),Object.getOwnPropertyNames(i).forEach((function(e){r.setAttribute(e,i[e])})),n&&he(r,n),r}function G(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function X(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function K(e,t){if(0<=t.indexOf(" "))throw Error("class has illegal whitespace characters");return e.classList.contains(t)}function Q(e,...t){return e.classList.add(...t.reduce(((e,t)=>e.concat(t.split(/\s+/))),[])),e}function Y(e,...t){return e?(e.classList.remove(...t.reduce(((e,t)=>e.concat(t.split(/\s+/))),[])),e):(c.warn("removeClass was called with an element that doesn't exist"),null)}function J(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 Z(e,t){Object.getOwnPropertyNames(t).forEach((function(i){var n=t[i];null==n||!1===n?e.removeAttribute(i):e.setAttribute(i,!0===n?"":n)}))}function ee(e){var t={};if(e&&e.attributes&&0<e.attributes.length){var i=e.attributes;for(let r=i.length-1;0<=r;r--){var n=i[r].name;let s=i[r].value;"boolean"!=typeof e[n]&&-1===",autoplay,controls,playsinline,loop,muted,default,defaultMuted,".indexOf(","+n+",")||(s=null!==s),t[n]=s}}return t}function te(e,t){return e.getAttribute(t)}function ie(e,t,i){e.setAttribute(t,i)}function ne(e,t){e.removeAttribute(t)}function re(){document.body.focus(),document.onselectstart=function(){return!1}}function se(){document.onselectstart=function(){return!0}}function ae(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(ye(e,"height"))),i.width||(i.width=parseFloat(ye(e,"width"))),i}}function oe(e){if(!e||!e.offsetParent)return{left:0,top:0,width:0,height:0};var t=e.offsetWidth,i=e.offsetHeight;let n=0,r=0;for(;e.offsetParent&&e!==document[s.fullscreenElement];)n+=e.offsetLeft,r+=e.offsetTop,e=e.offsetParent;return{left:n,top:r,width:t,height:i}}function le(e,t){var i={x:0,y:0};if(j){let t=e;for(;t&&"html"!==t.nodeName.toLowerCase();){var n,r=ye(t,"transform");/^matrix/.test(r)?(n=r.slice(7,-1).split(/,\s/).map(Number),i.x+=n[4],i.y+=n[5]):/^matrix3d/.test(r)&&(n=r.slice(9,-1).split(/,\s/).map(Number),i.x+=n[12],i.y+=n[13]),t=t.parentNode}}var s={},a=oe(t.target),o=(e=oe(e)).width,l=e.height;let u=t.offsetY-(e.top-a.top),d=t.offsetX-(e.left-a.left);return t.changedTouches&&(d=t.changedTouches[0].pageX-e.left,u=t.changedTouches[0].pageY+e.top,j)&&(d-=i.x,u-=i.y),s.y=1-Math.max(0,Math.min(1,u/l)),s.x=Math.max(0,Math.min(1,d/o)),s}function ue(e){return g(e)&&3===e.nodeType}function de(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function ce(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map((e=>V(e="function"==typeof e?e():e)||ue(e)?e:"string"==typeof e&&/\S/.test(e)?document.createTextNode(e):void 0)).filter((e=>e))}function he(e,t){return ce(t).forEach((t=>e.appendChild(t))),e}function pe(e,t){return he(de(e),t)}function me(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}B=Object.freeze({__proto__:null,get IS_IPOD(){return T},get IOS_VERSION(){return S},get IS_ANDROID(){return E},get ANDROID_VERSION(){return w},get IS_FIREFOX(){return k},get IS_EDGE(){return C},get IS_CHROMIUM(){return x},get IS_CHROME(){return I},get CHROMIUM_VERSION(){return A},get CHROME_VERSION(){return P},get IE_VERSION(){return O},get IS_SAFARI(){return L},get IS_WINDOWS(){return D},get IS_IPAD(){return M},get IS_IPHONE(){return N},TOUCH_ENABLED:R,IS_IOS:j,IS_ANY_SAFARI:F});let fe=W("querySelector"),ge=W("querySelectorAll");function ye(e,t){if(!e||!t||"function"!=typeof window.getComputedStyle)return"";{let i;try{i=window.getComputedStyle(e)}catch(e){return""}return i?i.getPropertyValue(t)||i[t]:""}}var ve=Object.freeze({__proto__:null,isReal:H,isEl:V,isInFrame:$,createEl:z,textContent:G,prependTo:X,hasClass:K,addClass:Q,removeClass:Y,toggleClass:J,setAttributes:Z,getAttributes:ee,getAttribute:te,setAttribute:ie,removeAttribute:ne,blockTextSelection:re,unblockTextSelection:se,getBoundingClientRect:ae,findPosition:oe,getPointerPosition:le,isTextNode:ue,emptyEl:de,normalizeContent:ce,appendContent:he,insertContent:pe,isSingleLeftClick:me,$:fe,$$:ge,computedStyle:ye});let _e,be=!1;function we(){if(!1!==_e.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")),n=e.concat(t,i);if(n&&0<n.length)for(let e=0,t=n.length;e<t;e++){var r=n[e];if(!r||!r.getAttribute){Te(1);break}void 0===r.player&&null!==r.getAttribute("data-setup")&&_e(r)}else be||Te(1)}}function Te(e,t){H()&&(t&&(_e=t),window.setTimeout(we,e))}function Se(){be=!0,window.removeEventListener("load",Se)}function Ee(e){var t=document.createElement("style");return t.className=e,t}function ke(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t}H()&&("complete"===document.readyState?Se():window.addEventListener("load",Se));var Ce=new WeakMap;let xe=3;function Ie(e,t){var i;Ce.has(e)&&(0===(i=Ce.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)&&Ce.delete(e)}function Ae(e,t,i,n){i.forEach((function(i){e(t,i,n)}))}function Pe(e){if(!e.fixed_){if(!e||!e.isPropagationStopped||!e.isImmediatePropagationStopped){var t,i;let s=e||window.event;for(let t in e={},s)"layerX"===t||"layerY"===t||"keyLocation"===t||"webkitMovementX"===t||"webkitMovementY"===t||"path"===t||"returnValue"===t&&s.preventDefault||(e[t]=s[t]);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=r,e.stopImmediatePropagation=function(){s.stopImmediatePropagation&&s.stopImmediatePropagation(),e.isImmediatePropagationStopped=n,e.stopPropagation()},e.isImmediatePropagationStopped=r,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 r(){return!1}}let Oe,Le=["touchstart","touchmove"];function De(e,t,i){if(Array.isArray(t))return Ae(De,e,t,i);Ce.has(e)||Ce.set(e,{});let n=Ce.get(e);if(n.handlers||(n.handlers={}),n.handlers[t]||(n.handlers[t]=[]),i.guid||(i.guid=xe++),n.handlers[t].push(i),n.dispatcher||(n.disabled=!1,n.dispatcher=function(t,i){if(!n.disabled){t=Pe(t);var r=n.handlers[t.type];if(r){var s=r.slice(0);for(let n=0,r=s.length;n<r&&!t.isImmediatePropagationStopped();n++)try{s[n].call(e,t,i)}catch(e){c.error(e)}}}}),1===n.handlers[t].length)if(e.addEventListener){let i=!1;(function(){if("boolean"!=typeof Oe){Oe=!1;try{var e=Object.defineProperty({},"passive",{get(){Oe=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){}}return Oe})()&&-1<Le.indexOf(t)&&(i={passive:!0}),e.addEventListener(t,n.dispatcher,i)}else e.attachEvent&&e.attachEvent("on"+t,n.dispatcher)}function Me(e,t,i){if(Ce.has(e)){let s=Ce.get(e);if(s.handlers){if(Array.isArray(t))return Ae(Me,e,t,i);var n=function(e,t){s.handlers[t]=[],Ie(e,t)};if(void 0===t)for(let t in s.handlers)Object.prototype.hasOwnProperty.call(s.handlers||{},t)&&n(e,t);else{var r=s.handlers[t];if(r)if(i){if(i.guid)for(let e=0;e<r.length;e++)r[e].guid===i.guid&&r.splice(e--,1);Ie(e,t)}else n(e,t)}}}}function Ne(e,t,i){var n=Ce.has(e)?Ce.get(e):{},r=e.parentNode||e.ownerDocument;return"string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=Pe(t),n.dispatcher&&n.dispatcher.call(e,t,i),r&&!t.isPropagationStopped()&&!0===t.bubbles?Ne.call(null,r,t,i):!r&&!t.defaultPrevented&&t.target&&t.target[t.type]&&(Ce.has(t.target)||Ce.set(t.target,{}),n=Ce.get(t.target),t.target[t.type])&&(n.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),n.disabled=!1),!t.defaultPrevented}function Re(e,t,i){if(Array.isArray(t))return Ae(Re,e,t,i);function n(){Me(e,t,n),i.apply(this,arguments)}n.guid=i.guid=i.guid||xe++,De(e,t,n)}function Ue(e,t,i){function n(){Me(e,t,n),i.apply(this,arguments)}n.guid=i.guid=i.guid||xe++,De(e,t,n)}var Be=Object.freeze({__proto__:null,fixEvent:Pe,on:De,off:Me,trigger:Ne,one:Re,any:Ue});function je(e,t,i){return t.guid||(t.guid=xe++),(e=t.bind(e)).guid=i?i+"_"+t.guid:t.guid,e}function Fe(e,t){let i=window.performance.now();return function(...n){var r=window.performance.now();r-i>=t&&(e(...n),i=r)}}function qe(e,t,i,n=window){let r;function s(){let s=this,a=arguments,o=function(){r=null,o=null,i||e.apply(s,a)};!r&&i&&e.apply(s,a),n.clearTimeout(r),r=n.setTimeout(o,t)}return s.cancel=()=>{n.clearTimeout(r),r=null},s}var He=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:30,bind_:je,throttle:Fe,debounce:qe});let Ve;class $e{on(e,t){var i=this.addEventListener;this.addEventListener=()=>{},De(this,e,t),this.addEventListener=i}off(e,t){Me(this,e,t)}one(e,t){var i=this.addEventListener;this.addEventListener=()=>{},Re(this,e,t),this.addEventListener=i}any(e,t){var i=this.addEventListener;this.addEventListener=()=>{},Ue(this,e,t),this.addEventListener=i}trigger(e){var t=e.type||e;e=Pe(e="string"==typeof e?{type:t}:e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Ne(this,e)}queueTrigger(e){Ve=Ve||new Map;let t=e.type||e,i=Ve.get(this);i||(i=new Map,Ve.set(this,i));var n=i.get(t);i.delete(t),window.clearTimeout(n),n=window.setTimeout((()=>{i.delete(t),0===i.size&&(i=null,Ve.delete(this)),this.trigger(e)}),0);i.set(t,n)}}$e.prototype.allowedEvents_={},$e.prototype.addEventListener=$e.prototype.on,$e.prototype.removeEventListener=$e.prototype.off,$e.prototype.dispatchEvent=$e.prototype.trigger;let We=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),ze=e=>e instanceof $e||!!e.eventBusEl_&&["on","one","off","trigger"].every((t=>"function"==typeof e[t])),Ge=e=>"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length,Xe=(e,t,i)=>{if(!e||!e.nodeName&&!ze(e))throw Error(`Invalid target for ${We(t)}#${i}; must be a DOM node or evented object.`)},Ke=(e,t,i)=>{if(!Ge(e))throw Error(`Invalid event type for ${We(t)}#${i}; must be a non-empty string or array.`)},Qe=(e,t,i)=>{if("function"!=typeof e)throw Error(`Invalid listener for ${We(t)}#${i}; must be a function.`)},Ye=(e,t,i)=>{var n=t.length<3||t[0]===e||t[0]===e.eventBusEl_;let r,s,a;return n?(r=e.eventBusEl_,3<=t.length&&t.shift(),[s,a]=t):[r,s,a]=t,Xe(r,e,i),Ke(s,e,i),Qe(a,e,i),a=je(e,a),{isTargetingSelf:n,target:r,type:s,listener:a}},Je=(e,t,i,n)=>{Xe(e,e,t),e.nodeName?Be[t](e,i,n):e[t](i,n)},Ze={on(...e){let{isTargetingSelf:t,target:i,type:n,listener:r}=Ye(this,e,"on");if(Je(i,"on",n,r),!t){let t=()=>this.off(i,n,r);t.guid=r.guid,(e=()=>this.off("dispose",t)).guid=r.guid,Je(this,"on","dispose",t),Je(i,"on","dispose",e)}},one(...e){let{isTargetingSelf:t,target:i,type:n,listener:r}=Ye(this,e,"one");if(t)Je(i,"one",n,r);else{let e=(...t)=>{this.off(i,n,e),r.apply(null,t)};e.guid=r.guid,Je(i,"one",n,e)}},any(...e){let{isTargetingSelf:t,target:i,type:n,listener:r}=Ye(this,e,"any");if(t)Je(i,"any",n,r);else{let e=(...t)=>{this.off(i,n,e),r.apply(null,t)};e.guid=r.guid,Je(i,"any",n,e)}},off(e,t,i){!e||Ge(e)?Me(this.eventBusEl_,e,t):(Xe(e,this,"off"),Ke(t,this,"off"),Qe(i,this,"off"),i=je(this,i),this.off("dispose",i),e.nodeName?(Me(e,t,i),Me(e,"dispose",i)):ze(e)&&(e.off(t,i),e.off("dispose",i)))},trigger(e,t){if(Xe(this.eventBusEl_,this,"trigger"),Ge(e&&"string"!=typeof e?e.type:e))return Ne(this.eventBusEl_,e,t);throw Error(`Invalid event type for ${We(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`)}};function et(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_=z("span",{className:"vjs-event-bus"});Object.assign(e,Ze),e.eventedCallbacks&&e.eventedCallbacks.forEach((e=>{e()})),e.on("dispose",(()=>{e.off(),[e,e.el_,e.eventBusEl_].forEach((function(e){e&&Ce.has(e)&&Ce.delete(e)})),window.setTimeout((()=>{e.eventBusEl_=null}),0)}))}let tt={state:{},setState(e){let t;return"function"==typeof e&&(e=e()),m(e,((e,i)=>{this.state[i]!==e&&((t=t||{})[i]={from:this.state[i],to:e}),this.state[i]=e})),t&&ze(this)&&this.trigger({changes:t,type:"statechanged"}),t}};function it(e,t){Object.assign(e,tt),e.state=Object.assign({},e.state,t),"function"==typeof e.handleStateChanged&&ze(e)&&e.on("statechanged",e.handleStateChanged)}function nt(e){return"string"!=typeof e?e:e.replace(/./,(e=>e.toLowerCase()))}function rt(e){return"string"!=typeof e?e:e.replace(/./,(e=>e.toUpperCase()))}function st(e,t){return rt(e)===rt(t)}var at=Object.freeze({__proto__:null,toLowerCase:nt,toTitleCase:rt,titleCaseEquals:st}),ot="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function lt(e,t){return e(t={exports:{}},t.exports),t.exports}var ut=lt((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]:n[(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=n[t.toLowerCase()];if(i||(i=r[t.toLowerCase()]))return i===e}else if("number"==typeof t)return t===e;return!1}};for(var n=(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},s=97;s<123;s++)n[String.fromCharCode(s)]=s-32;for(s=48;s<58;s++)n[s-48]=s;for(s=1;s<13;s++)n["f"+s]=s+111;for(s=0;s<10;s++)n["numpad "+s]=s+96;var a,o=t.names=t.title={};for(s in n)o[n[s]]=s;for(a in r)n[a]=r[a]}));ut.code,ut.codes,ut.aliases,ut.names,ut.title;class dt{constructor(e,t,i){!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=v({},this.options_),t=this.options_=v(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_"+xe++),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&&(et(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),it(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){}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let e=this.children_.length-1;0<=e;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return Boolean(this.isDisposed_)}player(){return this.player_}options(e){return e&&(this.options_=v(this.options_,e)),this.options_}el(){return this.el_}createEl(e,t,i){return z(e,t,i)}localize(e,t,i=e){var n=this.player_.language&&this.player_.language(),r=(s=this.player_.languages&&this.player_.languages())&&s[n],s=(n=n&&n.split("-")[0],s&&s[n]);let a=i;return r&&r[e]?a=r[e]:s&&s[e]&&(a=s[e]),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)=>e.concat(t)),[]);let t=this;for(let i=0;i<e.length;i++)if(!(t=t.getChild(e[i]))||!t.getChild)return;return t}addChild(e,t={},i=this.children_.length){let n,r;if("string"==typeof e){r=rt(e);var s=t.componentClass||r,a=(t.name=r,dt.getComponent(s));if(!a)throw Error(`Component ${s} does not exist`);if("function"!=typeof a)return null;n=new a(this.player_||this,t)}else n=e;if(n.parentComponent_&&n.parentComponent_.removeChild(n),this.children_.splice(i,0,n),n.parentComponent_=this,"function"==typeof n.id&&(this.childIndex_[n.id()]=n),(r=r||n.name&&rt(n.name()))&&(this.childNameIndex_[r]=n,this.childNameIndex_[nt(r)]=n),"function"==typeof n.el&&n.el()){let e=null;this.children_[i+1]&&(this.children_[i+1].el_?e=this.children_[i+1].el_:V(this.children_[i+1])&&(e=this.children_[i+1])),this.contentEl().insertBefore(n.el(),e)}return n}removeChild(e){if((e="string"==typeof e?this.getChild(e):e)&&this.children_){var t;let i=!1;for(let t=this.children_.length-1;0<=t;t--)if(this.children_[t]===e){i=!0,this.children_.splice(t,1);break}i&&(e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[rt(e.name())]=null,this.childNameIndex_[nt(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,i=this.options_,n=dt.getComponent("Tech");(t=Array.isArray(e)?e:Object.keys(e)).concat(Object.keys(this.options_).filter((function(e){return!t.some((function(t){return"string"==typeof t?e===t:e===t.name}))}))).map((t=>{let i,n;return n="string"==typeof t?e[i=t]||this.options_[i]||{}:(i=t.name,t),{name:i,opts:n}})).filter((e=>(e=dt.getComponent(e.opts.componentClass||rt(e.name)))&&!n.isTech(e))).forEach((e=>{var t=e.name;let n=e.opts;!1!==(n=void 0!==i[t]?i[t]:n)&&((n=!0===n?{}:n).playerOptions=this.options_.playerOptions,e=this.addChild(t,n))&&(this[t]=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 fe(e,t||this.contentEl())}$$(e,t){return ge(e,t||this.contentEl())}hasClass(e){return K(this.el_,e)}addClass(...e){Q(this.el_,...e)}removeClass(...e){Y(this.el_,...e)}toggleClass(e,t){J(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 te(this.el_,e)}setAttribute(e,t){ie(this.el_,e,t)}removeAttribute(e){ne(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 n,r;if(void 0===t)return this.el_?-1!==(r=(n=this.el_.style[e]).indexOf("px"))?parseInt(n.slice(0,r),10):parseInt(this.el_["offset"+rt(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=ye(this.el_,e),(0===(t=parseFloat(t))||isNaN(t))&&(e="offset"+rt(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_&&(ut.isEventKey(e,"Tab")||e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e,t=0,i=null;function n(){e=!1}this.on("touchstart",(function(n){1===n.touches.length&&(i={pageX:n.touches[0].pageX,pageY:n.touches[0].pageY},t=window.performance.now(),e=!0)})),this.on("touchmove",(function(t){var n;(1<t.touches.length||i&&10<Math.sqrt((n=t.touches[0].pageX-i.pageX)*n+(t=t.touches[0].pageY-i.pageY)*t))&&(e=!1)})),this.on("touchleave",n),this.on("touchcancel",n),this.on("touchend",(function(n){i=null,!0===e&&window.performance.now()-t<200&&(n.preventDefault(),this.trigger("tap"))}))}enableTouchActivity(){if(this.player()&&this.player().reportUserActivity){let t,i=je(this.player(),this.player().reportUserActivity);this.on("touchstart",(function(){i(),this.clearInterval(t),t=this.setInterval(i,250)}));var e=function(e){i(),this.clearInterval(t)};this.on("touchmove",i),this.on("touchend",e),this.on("touchcancel",e)}}setTimeout(e,t){var i;return e=je(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=je(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=je(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=je(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"]].forEach((([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=(i=dt.getComponent("Tech"))&&i.isTech(t),n=dt===t||dt.prototype.isPrototypeOf(t.prototype);if(i||!n){let t;throw Error(`Illegal component, "${e}"; ${t=i?"techs must be registered using Tech.registerTech()":"must be a Component subclass"}.`)}if(e=rt(e),dt.components_||(dt.components_={}),n=dt.getComponent("Player"),"Player"===e&&n&&n.players){let e=n.players;if(i=Object.keys(e),e&&0<i.length&&i.map((t=>e[t])).every(Boolean))throw Error("Can not register Player component after player has been created.")}return dt.components_[e]=t,dt.components_[nt(e)]=t}static getComponent(e){if(e&&dt.components_)return dt.components_[e]}}function ct(e,t,i,n){var r=n,s=i.length-1;if("number"!=typeof r||r<0||s<r)throw Error(`Failed to execute '${e}' on 'TimeRanges': The index provided (${r}) is non-numeric or out of bounds (0-${s}).`);return i[n][t]}function ht(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:ct.bind(null,"start",0,e),end:ct.bind(null,"end",1,e)},window.Symbol&&window.Symbol.iterator&&(t[window.Symbol.iterator]=()=>(e||[]).values()),t}function pt(e,t){return Array.isArray(e)?ht(e):void 0===e||void 0===t?ht():ht([[e,t]])}function mt(e,t){let i=Math.floor((e=e<0?0:e)%60),n=Math.floor(e/60%60),r=Math.floor(e/3600);var s=Math.floor(t/60%60);t=Math.floor(t/3600);return n=(((r=0<(r=isNaN(e)||e===1/0?n=i="-":r)||0<t?r+":":"")||10<=s)&&n<10?"0"+n:n)+":",r+n+(i<10?"0"+i:i)}dt.registerComponent("Component",dt);let ft=mt;function gt(e){ft=e}function yt(){ft=mt}function vt(e,t=e){return ft(e,t)}var _t=Object.freeze({__proto__:null,createTimeRanges:pt,createTimeRange:pt,setFormatTime:gt,resetFormatTime:yt,formatTime:vt});function bt(e,t){var i;let n,r=0;if(!t)return 0;e&&e.length||(e=pt(0,0));for(let s=0;s<e.length;s++)i=e.start(s),(n=e.end(s))>t&&(n=t),r+=n-i;return r/t}function wt(e){if(e instanceof wt)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:g(e)&&("number"==typeof e.code&&(this.code=e.code),Object.assign(this,e)),this.message||(this.message=wt.defaultMessages[this.code]||"")}wt.prototype.code=0,wt.prototype.message="",wt.prototype.status=null,wt.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],wt.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 e=0;e<wt.errorTypes.length;e++)wt[wt.errorTypes[e]]=e,wt.prototype[wt.errorTypes[e]]=e;function Tt(e){return null!=e&&"function"==typeof e.then}function St(e){Tt(e)&&e.then(null,(e=>{}))}function Et(e){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(((t,i,n)=>(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}}))})}let kt="vjs-modal-dialog";class Ct extends dt{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_=z("div",{className:kt+"-content"},{role:"document"}),this.descEl_=z("p",{className:kt+"-description vjs-control-text",id:this.el().getAttribute("aria-describedby")}),G(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 kt+" vjs-hidden "+super.buildCSSClass()}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){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_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0)}opened(e){return"boolean"==typeof e&&this[e?"open":"close"](),this.opened_}close(){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,n=t.nextSibling;(e=(this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),pe(t,e),this.trigger("modalfill"),n?i.insertBefore(t,n):i.appendChild(t),this.getChild("closeButton")))&&i.appendChild(e.el_)}empty(){this.trigger("beforemodalempty"),de(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(),ut.isEventKey(e,"Escape")&&this.closeable())e.preventDefault(),this.close();else if(ut.isEventKey(e,"Tab")){var t=this.focusableEls_(),i=this.el_.querySelector(":focus");let n;for(let e=0;e<t.length;e++)if(i===t[e]){n=e;break}document.activeElement===this.el_&&(n=0),e.shiftKey&&0===n?(t[t.length-1].focus(),e.preventDefault()):e.shiftKey||n!==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")))}}Ct.prototype.options_={pauseOnOpen:!0,temporary:!0},dt.registerComponent("ModalDialog",Ct);class xt extends $e{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})},ze(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let i=0,n=this.length;i<n;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 n=0,r=this.length;n<r;n++){var i=this[n];if(i.id===e){t=i;break}}return t}}for(let e in xt.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"})xt.prototype["on"+e]=null;function It(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 At(e,t){for(let i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].selected=!1)}class Pt extends xt{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 Ot{constructor(e){Ot.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){var t=this.length||0;let i=0;function n(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++)n.call(this,i)}getCueById(e){let t=null;for(let n=0,r=this.length;n<r;n++){var i=this[n];if(i.id===e){t=i;break}}return t}}let Lt={disabled:"disabled",hidden:"hidden",showing:"showing"};class Dt extends $e{constructor(e={}){super();let t={id:e.id||"vjs_track_"+xe++,kind:e.kind||"",language:e.language||""},i=e.label||"";for(let e in t)Object.defineProperty(this,e,{get:()=>t[e],set(){}});Object.defineProperty(this,"label",{get:()=>i,set(e){e!==i&&(i=e,this.trigger("labelchange"))}})}}function Mt(e){var t=["protocol","hostname","port","pathname","search","hash","host"],i=document.createElement("a"),n=(i.href=e,{});for(let e=0;e<t.length;e++)n[t[e]]=i[t[e]];return"http:"===n.protocol&&(n.host=n.host.replace(/:80$/,"")),"https:"===n.protocol&&(n.host=n.host.replace(/:443$/,"")),n.protocol||(n.protocol=window.location.protocol),n.host||(n.host=window.location.host),n}function Nt(e){var t;return e.match(/^https?:\/\//)||((t=document.createElement("a")).href=e,e=t.href),e}function Rt(e,t=window.location){return(":"===(e=Mt(e)).protocol?t:e).protocol+e.host!==t.protocol+t.host}let Ut=function(e){return"string"==typeof e&&(e=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e))?e.pop().toLowerCase():""};var Bt=Object.freeze({__proto__:null,parseUrl:Mt,getAbsoluteURL:Nt,getFileExtension:Ut,isCrossOrigin:Rt}),jt=zt="undefined"!=typeof window?window:void 0!==ot?ot:"undefined"!=typeof self?self:{},Ft=lt((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,n=arguments[t];for(i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[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})),qt=(zt=Ft)&&zt.__esModule&&Object.prototype.hasOwnProperty.call(zt,"default")?zt.default:zt,Ht=function(e){var t;return!!e&&("[object Function]"===(t=Vt.call(e))||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt))},Vt=Object.prototype.toString;Yt.httpHandler=function(e,t){return void 0===t&&(t=!1),function(i,n,r){if(i)e(i);else if(400<=n.statusCode&&n.statusCode<=599){if(i=r,t)if(jt.TextDecoder){var s;void 0===(s=n.headers&&n.headers["content-type"])&&(s=""),n=s.toLowerCase().split(";").reduce((function(e,t){var i=(t=t.split("="))[0];t=t[1];return"charset"===i.trim()?t.trim():e}),"utf-8");try{i=new TextDecoder(n).decode(r)}catch(e){}}else i=String.fromCharCode.apply(null,new Uint8Array(r));e({cause:i})}else e(null,r)}};for(var $t=function(e){var t={};return e&&e.trim().split("\n").forEach((function(e){var i=e.indexOf(":"),n=e.slice(0,i).trim().toLowerCase();e=e.slice(i+1).trim();void 0===t[n]?t[n]=e:Array.isArray(t[n])?t[n].push(e):t[n]=[t[n],e]})),t},Wt=Yt,zt=Yt,Gt=(Yt.XMLHttpRequest=jt.XMLHttpRequest||function(){},Yt.XDomainRequest="withCredentials"in new Yt.XMLHttpRequest?Yt.XMLHttpRequest:jt.XDomainRequest,["get","put","post","patch","head","delete"]),Xt=function(e){Yt["delete"===e?"del":e]=function(t,i,n){return(i=Qt(t,i,n)).method=e.toUpperCase(),Jt(i)}},Kt=0;Kt<Gt.length;Kt++)Xt(Gt[Kt]);function Qt(e,t,i){var n=e;return Ht(t)?(i=t,"string"==typeof e&&(n={uri:e})):n=Ft({},t,{uri:e}),n.callback=i,n}function Yt(e,t,i){return Jt(t=Qt(e,t,i))}function Jt(e){if(void 0===e.callback)throw Error("callback argument missing");var t=!1,i=function(i,n,r){t||(t=!0,e.callback(i,n,r))};function n(e){return clearTimeout(o),(e=e instanceof Error?e:Error(""+(e||"Unknown XMLHttpRequest Error"))).statusCode=0,i(e,f)}function r(){var t,n,r;if(!a)return clearTimeout(o),t=e.useXDR&&void 0===l.status?200:1223===l.status?204:l.status,n=f,r=null,0!==t?(n={body:function(){var e=void 0;e=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(e){}return null}(l);if(m)try{e=JSON.parse(e)}catch(e){}return e}(),statusCode:t,method:d,headers:{},url:u,rawRequest:l},l.getAllResponseHeaders&&(n.headers=$t(l.getAllResponseHeaders()))):r=Error("Internal XMLHttpRequest Error"),i(r,n,n.body)}var s,a,o,l=e.xhr||null,u=(l=l||new(e.cors||e.useXDR?Yt.XDomainRequest:Yt.XMLHttpRequest)).url=e.uri||e.url,d=l.method=e.method||"GET",c=e.body||e.data,h=l.headers=e.headers||{},p=!!e.sync,m=!1,f={body:void 0,headers:{},statusCode:0,method:d,url:u,rawRequest:l};if("json"in e&&!1!==e.json&&(m=!0,h.accept||h.Accept||(h.Accept="application/json"),"GET"!==d)&&"HEAD"!==d&&(h["content-type"]||h["Content-Type"]||(h["Content-Type"]="application/json"),c=JSON.stringify(!0===e.json?c:e.json)),l.onreadystatechange=function(){4===l.readyState&&setTimeout(r,0)},l.onload=r,l.onerror=n,l.onprogress=function(){},l.onabort=function(){a=!0},l.ontimeout=n,l.open(d,u,!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",n(e))}),e.timeout)),l.setRequestHeader)for(s in h)h.hasOwnProperty(s)&&l.setRequestHeader(s,h[s]);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(c||null),l}function Zt(e,t){var i=new window.WebVTT.Parser(window,window.vttjs,window.WebVTT.StringDecoder());let n=[];i.oncue=function(e){t.addCue(e)},i.onparsingerror=function(e){n.push(e)},i.onflush=function(){t.trigger({type:"loadeddata",target:t})},i.parse(e),0<n.length&&(window.console&&window.console.groupCollapsed&&window.console.groupCollapsed("Text Track parsing errors for "+t.src),n.forEach((e=>c.error(e))),window.console)&&window.console.groupEnd&&window.console.groupEnd(),i.flush()}function ei(e,t){var i={uri:e};(e=Rt(e))&&(i.cors=e),(e="use-credentials"===t.tech_.crossOrigin())&&(i.withCredentials=e),Wt(i,je(this,(function(e,i,n){if(e)return c.error(e,i);t.loaded_=!0,"function"!=typeof window.WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],(e=>{if("vttjserror"!==e.type)return Zt(n,t);c.error("vttjs failed to load, stopping trying to process "+t.src)})):Zt(n,t)})))}Wt.default=zt;class ti extends Dt{constructor(e={}){if(!e.tech)throw Error("A tech was not provided.");let t=Lt[(e=v(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,n=("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 Ot(this.cues_)),r=new Ot(this.activeCues_),s=!1;this.timeupdateHandler=je(this,(function(e={}){this.tech_.isDisposed()||(this.tech_.isReady_&&(this.activeCues=this.activeCues,s)&&(this.trigger("cuechange"),s=!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){Lt[e]&&t!==e&&(t=e,this.preload_||"disabled"===t||0!==this.cues.length||ei(this.src,this),this.stopTracking(),"disabled"!==t&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?n:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(0!==this.cues.length){var e=this.tech_.currentTime(),t=[];for(let n=0,r=this.cues.length;n<r;n++){var i=this.cues[n];i.startTime<=e&&i.endTime>=e&&t.push(i)}if(s=!1,t.length!==this.activeCues_.length)s=!0;else for(let e=0;e<t.length;e++)-1===this.activeCues_.indexOf(t[e])&&(s=!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)&&ei(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(window.vttjs&&!(e instanceof window.vttjs.VTTCue)){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 i=this.tech_.textTracks();for(let e=0;e<i.length;e++)i[e]!==this&&i[e].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}removeCue(e){let t=this.cues_.length;for(;t--;){var i=this.cues_[t];if(i===e||i.originalCue_&&i.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}}ti.prototype.allowedEvents_={cuechange:"cuechange"};class ii extends Dt{constructor(e={}){super(e=v(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 ni extends Dt{constructor(e={}){super(e=v(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 ri extends $e{constructor(e={}){super();let t,i=new ti(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=ri.NONE,i.addEventListener("loadeddata",(()=>{t=ri.LOADED,this.trigger({type:"load",target:this})}))}}ri.prototype.allowedEvents_={load:"load"},ri.NONE=0,ri.LOADING=1,ri.LOADED=2,ri.ERROR=3;let si={audio:{ListClass:class extends xt{constructor(e=[]){for(let t=e.length-1;0<=t;t--)if(e[t].enabled){It(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&It(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,It(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:ii,capitalName:"Audio"},video:{ListClass:class extends xt{constructor(e=[]){for(let t=e.length-1;0<=t;t--)if(e[t].selected){At(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&&At(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,At(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:ni,capitalName:"Video"},text:{ListClass:Pt,TrackClass:ti,capitalName:"Text"}},ai=(Object.keys(si).forEach((function(e){si[e].getterName=e+"Tracks",si[e].privateName=e+"Tracks_"})),{remoteText:{ListClass:Pt,TrackClass:ti,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]}}),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e)}getTrackElementByTrack_(e){let t;for(let i=0,n=this.trackElements_.length;i<n;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:ri,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}}),oi=Object.assign({},si,ai);ai.names=Object.keys(ai),si.names=Object.keys(si),oi.names=[].concat(ai.names).concat(si.names);zt=void 0!==ot?ot:"undefined"!=typeof window?window:{},ot=Gn="undefined"!=typeof document?document:(Gn=zt["__GLOBAL_DOCUMENT_CACHE@4"])||(zt["__GLOBAL_DOCUMENT_CACHE@4"]={});var li=Object.create||function(e){if(1!==arguments.length)throw Error("Object.create shim only accepts one parameter.");return ui.prototype=e,new ui};function ui(){}function di(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function ci(e){function t(e,t,i,n){return 3600*(0|e)+60*(0|t)+(0|i)+(0|n)/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 hi(){this.values=li(null)}function pi(e,t,i,n){var r,s,a=n?e.split(n):[e];for(r in a)"string"==typeof a[r]&&2===(s=a[r].split(i)).length&&t(s[0].trim(),s[1].trim())}((di.prototype=li(Error.prototype)).constructor=di).Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},hi.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 n=0;n<i.length;++n)if(t===i[n]){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 mi=ot.createElement&&ot.createElement("textarea"),fi={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},gi={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)"},yi={v:"title",lang:"lang"},vi={rt:"ruby"};function _i(e,t){for(var i,n,r,s,a,o,l=e.document.createElement("div"),u=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(),u=u.parentNode):(n=ci(o.substr(1,o.length-2)))?(i=e.document.createProcessingInstruction("timestamp",n),u.appendChild(i)):(n=o.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/))&&(r=n[1],s=n[3],a=void 0,i=(a=fi[r])?(a=e.document.createElement(a),(r=yi[r])&&s&&(a[r]=s.trim()),a):null)&&(r=u,vi[(s=i).localName]&&vi[s.localName]!==r.localName||(n[2]&&((a=n[2].split(".")).forEach((function(e){var t=/^bg_/.test(e);e=t?e.slice(3):e;gi.hasOwnProperty(e)&&(e=gi[e],i.style[t?"background-color":"color"]=e)})),i.className=a.join(" ")),d.push(n[1]),u.appendChild(i),u=i)):u.appendChild(e.document.createTextNode((s=o,mi.innerHTML=s,s=mi.textContent,mi.textContent="",s)));return l}var bi=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function wi(){}function Ti(e,t,i){wi.call(this),this.cue=t,this.cueDiv=_i(e,t.text);var n={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(n,this.cueDiv),this.div=e.document.createElement("div"),n={direction:function(e){var t=[],i="";if(e&&e.childNodes)for(r(t,e);i=function e(t){var i,n,s;return t&&t.length?(n=(i=t.pop()).textContent||i.innerText)?(s=n.match(/^.*(\n|\r)/))?s[t.length=0]:n:"ruby"===i.tagName?e(t):i.childNodes?(r(t,i),e(t)):void 0:null}(t);)for(var n=0;n<i.length;n++)if(function(e){for(var t=0;t<bi.length;t++){var i=bi[t];if(e>=i[0]&&e<=i[1])return 1}}(i.charCodeAt(n)))return"rtl";return"ltr";function r(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(n),this.div.appendChild(this.cueDiv),0);switch(t.positionAlign){case"start":r=t.position;break;case"center":r=t.position-t.size/2;break;case"end":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 Si(e){var t,i,n,r;e.div&&(t=e.div.offsetHeight,i=e.div.offsetWidth,n=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||n,this.height=e.height||t,this.bottom=e.bottom||n+(e.height||t),this.width=e.width||i,this.lineHeight=void 0!==r?r:e.lineHeight}function Ei(e,t,i,n){var r,s=new Si(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,n=0,r=0;r<i.length&&i[r]!==t;r++)"showing"===i[r].mode&&n++;return-1*++n}(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 u=s.lineHeight,d=u*Math.round(o),c=i[r]+u,h=l[0];Math.abs(d)>c&&(d=d<0?-1:1,d*=Math.ceil(c/u)*u),o<0&&(d+=""===a.vertical?i.height:i.width,l=l.reverse()),s.move(h,d)}else{var p=s.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"],s=new Si(t)}c=function(e,t){for(var r,s=new Si(e),a=1,o=0;o<t.length;o++){for(;e.overlapsOppositeAxis(i,t[o])||e.within(i)&&e.overlapsAny(n);)e.move(t[o]);if(e.within(i))return e;var l=e.intersectPercentage(i);l<a&&(r=new Si(e),a=l),e=new Si(s)}return r||s}(s,l),t.move(c.toCSSCompatValues(i))}function ki(){}wi.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},wi.prototype.formatStyle=function(e,t){return 0===e?0:e+t},(Ti.prototype=li(wi.prototype)).constructor=Ti,Si.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}},Si.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top},Si.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++)if(this.overlaps(e[t]))return!0;return!1},Si.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},Si.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}},Si.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)},Si.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}},Si.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,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i}},ki.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},ki.convertCueToDOMTree=function(e,t){return e&&t?_i(e,t):null},ki.processCues=function(e,t,i){if(!e||!t||!i)return null;for(;i.firstChild;)i.removeChild(i.firstChild);var n=e.document.createElement("div");if(n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin="1.5%",i.appendChild(n),function(e){for(var t=0;t<e.length;t++)if(e[t].hasBeenReset||!e[t].displayState)return 1}(t))for(var r,s,a=[],o=Si.getSimpleBoxPosition(n),l={font:Math.round(.05*o.height*100)/100+"px sans-serif"},u=0;u<t.length;u++)r=new Ti(e,s=t[u],l),n.appendChild(r.div),Ei(0,r,o,a),s.displayState=r.div,a.push(Si.getSimpleBoxPosition(r));else for(var d=0;d<t.length;d++)n.appendChild(t[d].displayState)},(ki.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 di))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 n=e.substr(0,i);return"\r"===e[i]&&++i,"\n"===e[i]&&++i,t.buffer=e.substr(i),n}function n(e){e.match(/X-TIMESTAMP-MAP/)?pi(e,(function(e,i){var n;"X-TIMESTAMP-MAP"===e&&(e=i,n=new hi,pi(e,(function(e,t){switch(e){case"MPEGT":n.integer(e+"S",t);break;case"LOCA":n.set(e+"L",ci(t))}}),/[^\d]:/,/,/),t.ontimestampmap)&&t.ontimestampmap({MPEGTS:n.get("MPEGTS"),LOCAL:n.get("LOCAL")})}),/=/):pi(e,(function(e,i){var n;"Region"===e&&(e=i,n=new hi,pi(e,(function(e,t){switch(e){case"id":n.set(e,t);break;case"width":n.percent(e,t);break;case"lines":n.integer(e,t);break;case"regionanchor":case"viewportanchor":var i,r=t.split(",");2===r.length&&((i=new hi).percent("x",r[0]),i.percent("y",r[1]),i.has("x")&&i.has("y"))&&(n.set(e+"X",i.get("x")),n.set(e+"Y",i.get("y")));break;case"scroll":n.alt(e,t,["up"])}}),/=/,/\s/),n.has("id"))&&((e=new(t.vttjs.VTTRegion||t.window.VTTRegion)).width=n.get("width",100),e.lines=n.get("lines",3),e.regionAnchorX=n.get("regionanchorX",0),e.regionAnchorY=n.get("regionanchorY",100),e.viewportAnchorX=n.get("viewportanchorX",0),e.viewportAnchorY=n.get("viewportanchorY",100),e.scroll=n.get("scroll",""),t.onregion&&t.onregion(e),t.regionList.push({id:n.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,s=(r=i()).match(/^WEBVTT([ \t].*)?$/);if(!s||!s[0])throw new di(di.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)?n(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(e){t.cue.align="middle"}if(t.state="CUE",-1===r.indexOf("--\x3e")){t.cue.id=r;continue}case"CUE":try{!function(e,t,i){var n=e;function r(){var t=ci(e);if(null===t)throw new di(di.Errors.BadTimeStamp,"Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function s(){e=e.replace(/^\s+/,"")}if(s(),t.startTime=r(),s(),"--\x3e"!==e.substr(0,3))throw new di(di.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);e=e.substr(3),s(),t.endTime=r(),s();var a=e,o=new hi;pi(a,(function(e,t){switch(e){case"region":for(var n=i.length-1;0<=n;n--)if(i[n].id===t){o.set(e,i[n].region);break}break;case"vertical":o.alt(e,t,["rl","lr"]);break;case"line":var r=t.split(","),s=r[0];o.integer(e,s),o.percent(e,s)&&o.set("snapToLines",!1),o.alt(e,s,["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(e){}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(e){t.align=o.get("align","middle")}try{t.position=o.get("position","auto")}catch(e){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(e){t.reportOrThrowError(e),t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":var o=-1!==r.indexOf("--\x3e");if(!r||o&&(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(e){t.reportOrThrowError(e),"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var e=this;try{if(e.buffer+=e.decoder.decode(),(e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state)throw new di(di.Errors.BadSignature)}catch(t){e.reportOrThrowError(t)}return e.onflush&&e.onflush(),this}};var Ci=ki,xi={"":1,lr:1,rl:1},Ii={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function Ai(e){return"string"==typeof e&&!!Ii[e.toLowerCase()]&&e.toLowerCase()}function Pi(e,t,i){this.hasBeenReset=!1;var n="",r=!1,s=e,a=t,o=i,l=null,u="",d=!0,c="auto",h="start",p="auto",m="auto",f=100,g="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return n},set:function(e){n=""+e}},pauseOnExit:{enumerable:!0,get:function(){return r},set:function(e){r=!!e}},startTime:{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e)throw TypeError("Start time must be set to a number.");s=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 u},set:function(e){if(!1===(e="string"==typeof e&&!!xi[e.toLowerCase()]&&e.toLowerCase()))throw SyntaxError("Vertical: an invalid or illegal direction string was specified.");u=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 c},set:function(e){if("number"!=typeof e&&"auto"!==e)throw SyntaxError("Line: an invalid number or illegal string was specified.");c=e,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return h},set:function(e){(e=Ai(e))&&(h=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=Ai(e))&&(m=e,this.hasBeenReset=!0)}},size:{enumerable:!0,get:function(){return f},set:function(e){if(e<0||100<e)throw Error("Size must be between 0 and 100.");f=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return g},set:function(e){if(!(e=Ai(e)))throw SyntaxError("align: an invalid or illegal alignment string was specified.");g=e,this.hasBeenReset=!0}}}),this.displayState=void 0}Pi.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var Oi=Pi,Li={"":!0,up:!0};function Di(e){return"number"==typeof e&&0<=e&&e<=100}function Mi(){var e=100,t=3,i=0,n=100,r=0,s=100,a="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!Di(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 n},set:function(e){if(!Di(e))throw Error("RegionAnchorX must be between 0 and 100.");n=e}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!Di(e))throw Error("RegionAnchorY must be between 0 and 100.");i=e}},viewportAnchorY:{enumerable:!0,get:function(){return s},set:function(e){if(!Di(e))throw Error("ViewportAnchorY must be between 0 and 100.");s=e}},viewportAnchorX:{enumerable:!0,get:function(){return r},set:function(e){if(!Di(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&&!!Li[e.toLowerCase()]&&e.toLowerCase())&&(a=e)}}})}var Ni=lt((function(e){e=e.exports={WebVTT:Ci,VTTCue:Oi,VTTRegion:Mi};var t=(jt.vttjs=e,jt.WebVTT=e.WebVTT,e.VTTCue),i=e.VTTRegion,n=jt.VTTCue,r=jt.VTTRegion;e.shim=function(){jt.VTTCue=t,jt.VTTRegion=i},e.restore=function(){jt.VTTCue=n,jt.VTTRegion=r},jt.VTTCue||e.shim()}));Ni.WebVTT,Ni.VTTCue,Ni.VTTRegion;class Ri extends dt{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=e=>this.onDurationChange(e),this.trackProgress_=e=>this.trackProgress(e),this.trackCurrentTime_=e=>this.trackCurrentTime(e),this.stopTrackingCurrentTime_=e=>this.stopTrackingCurrentTime(e),this.disposeSourceHandler_=e=>this.disposeSourceHandler(e),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",(function(){this.hasStarted_=!0})),this.on("loadstart",(function(){this.hasStarted_=!1})),oi.names.forEach((t=>{t=oi[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 oi.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(je(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 pt(0,0)}bufferedPercent(){return bt(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(si.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){(e=[].concat(e)).forEach((e=>{var t=this[e+"Tracks"]()||[];let i=t.length;for(;i--;){var n=t[i];"text"===e&&this.removeRemoteTextTrack(n),t.removeTrack(n)}}))}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 wt(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?pt(0,0):pt()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){si.names.forEach((e=>{var t=si[e];let i=()=>{this.trigger(e+"trackchange")},n=this[t.getterName]();n.addEventListener("removetrack",i),n.addEventListener("addtrack",i),this.on("dispose",(()=>{n.removeEventListener("removetrack",i),n.removeEventListener("addtrack",i)}))}))}addWebVttScript_(){if(!window.WebVTT)if(document.body.contains(this.el()))if(!this.options_["vtt.js"]&&y(Ni)&&0<Object.keys(Ni).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),n=t=>e.removeTrack(t.track),r=(t.on("addtrack",i),t.on("removetrack",n),this.addWebVttScript_(),()=>this.trigger("texttrackchange")),s=()=>{r();for(let i=0;i<e.length;i++){var t=e[i];t.removeEventListener("cuechange",r),"showing"===t.mode&&t.addEventListener("cuechange",r)}};s(),e.addEventListener("change",s),e.addEventListener("addtrack",s),e.addEventListener("removetrack",s),this.on("dispose",(function(){t.off("addtrack",i),t.off("removetrack",n),e.removeEventListener("change",s),e.removeEventListener("addtrack",s),e.removeEventListener("removetrack",s);for(let t=0;t<e.length;t++)e[t].removeEventListener("cuechange",r)}))}addTextTrack(e,t,i){var n,r,s;if(e)return r={},s=(n=this).textTracks(),r.kind=e,t&&(r.label=t),i&&(r.language=i),r.tech=n,e=new oi.text.TrackClass(r),s.addTrack(e),e;throw Error("TextTrack kind is required but was not provided")}createRemoteTextTrack(e){return e=v(e,{tech:this}),new ai.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=xe++;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 Ri.canPlayType(e.type)}static isTech(e){return e.prototype instanceof Ri||e instanceof Ri||e===Ri}static registerTech(e,t){if(Ri.techs_||(Ri.techs_={}),!Ri.isTech(t))throw Error(`Tech ${e} must be a Tech`);if(!Ri.canPlayType)throw Error("Techs must have a static canPlayType method on them");if(Ri.canPlaySource)return e=rt(e),Ri.techs_[e]=t,Ri.techs_[nt(e)]=t,"Tech"!==e&&Ri.defaultTechOrder_.push(e),t;throw Error("Techs must have a static canPlaySource method on them")}static getTech(e){if(e)return Ri.techs_&&Ri.techs_[e]?Ri.techs_[e]:(e=rt(e),window&&window.videojs&&window.videojs[e]?(c.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)}}oi.names.forEach((function(e){let t=oi[e];Ri.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}})),Ri.prototype.featuresVolumeControl=!0,Ri.prototype.featuresMuteControl=!0,Ri.prototype.featuresFullscreenResize=!1,Ri.prototype.featuresPlaybackRate=!1,Ri.prototype.featuresProgressEvents=!1,Ri.prototype.featuresSourceset=!1,Ri.prototype.featuresTimeupdateEvents=!1,Ri.prototype.featuresNativeTextTracks=!1,Ri.prototype.featuresVideoFrameCallback=!1,Ri.withSourceHandlers=function(e){e.registerSourceHandler=function(t,i){let n=e.sourceHandlers;n=n||(e.sourceHandlers=[]),void 0===i&&(i=n.length),n.splice(i,0,t)},e.canPlayType=function(t){var i,n=e.sourceHandlers||[];for(let e=0;e<n.length;e++)if(i=n[e].canPlayType(t))return i;return""},e.selectSourceHandler=function(t,i){var n=e.sourceHandlers||[];for(let e=0;e<n.length;e++)if(n[e].canHandleSource(t,i))return n[e];return null},e.canPlaySource=function(t,i){var n=e.selectSourceHandler(t,i);return n?n.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:c.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)}},dt.registerComponent("Tech",Ri),Ri.registerTech("Tech",Ri),Ri.defaultTechOrder_=[];let Ui={},Bi={},ji={};function Fi(e,t,i,n=null){var r="call"+rt(i),s=(r=e.reduce($i(r),n),e),a=i,o=t=(n=r===ji)?null:t[i](r),l=n;for(let e=s.length-1;0<=e;e--){var u=s[e];u[a]&&u[a](l,o)}return t}let qi={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},Hi={setCurrentTime:1,setMuted:1,setVolume:1},Vi={play:1,pause:1};function $i(e){return(t,i)=>t===ji?ji:i[e]?i[e](t):t}let Wi={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"},zi=function(e=""){return Wi[(e=Ut(e)).toLowerCase()]||""};function Gi(e){var t;return e.type||(t=zi(e.src))&&(e.type=t),e}dt.registerComponent("MediaLoader",class extends dt{constructor(e,t,i){if(super(e,v({createEl:!1},t),i),t.playerOptions.sources&&0!==t.playerOptions.sources.length)e.src(t.playerOptions.sources);else for(let i=0,r=t.playerOptions.techOrder;i<r.length;i++){var n=rt(r[i]);let t=Ri.getTech(n);if((t=n?t:dt.getComponent(n))&&t.isSupported()){e.loadTech_(n);break}}}});class Xi extends dt{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&&c.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=z(e,t,i)).appendChild(z("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(e),e}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=z("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(void 0===e)return this.controlText_||"Need Text";var i=this.localize(e);this.controlText_=e,G(this.controlTextEl_,i),this.nonIconControl||this.player_.options_.noUITitleAttributes||t.setAttribute("title",i)}buildCSSClass(){return"vjs-control vjs-button "+super.buildCSSClass()}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){ut.isEventKey(e,"Space")||ut.isEventKey(e,"Enter")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}dt.registerComponent("ClickableComponent",Xi);class Ki extends Xi{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 z("div",{className:"vjs-poster"})}crossOrigin(e){if(void 0===e)return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;null!==e&&"anonymous"!==e&&"use-credentials"!==e?this.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(z("picture",{className:"vjs-poster",tabIndex:-1},{},z("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()?St(this.player_.play()):this.player_.pause())}}Ki.prototype.crossorigin=Ki.prototype.crossOrigin,dt.registerComponent("PosterImage",Ki);let Qi={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Yi(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 Ji(e,t,i){try{e.style[t]=i}catch(e){}}dt.registerComponent("TextTrackDisplay",class extends dt{constructor(e,t,i){super(e,t,i);let n=e=>this.updateDisplay(e);e.on("loadstart",(e=>this.toggleDisplay(e))),e.on("texttrackchange",n),e.on("loadedmetadata",(e=>this.preselectTrack(e))),e.ready(je(this,(function(){if(e.tech_&&e.tech_.featuresNativeTextTracks)this.hide();else{e.on("fullscreenchange",n),e.on("playerresize",n);let i=window.screen.orientation||window,r=window.screen.orientation?"change":"orientationchange";i.addEventListener(r,n),e.on("dispose",(()=>i.removeEventListener(r,n)));var t=this.options_.playerOptions.tracks||[];for(let e=0;e<t.length;e++)this.player_.addRemoteTextTrack(t[e],!0);this.preselectTrack()}})))}preselectTrack(){var e={captions:1,subtitles:1},t=this.player_.textTracks(),i=this.player_.cache_.selectedLanguage;let n,r,s;for(let o=0;o<t.length;o++){var a=t[o];i&&i.enabled&&i.language&&i.language===a.language&&a.kind in e?s=a.kind!==i.kind&&s||a:i&&!i.enabled?(s=null,n=null,r=null):a.default&&("descriptions"!==a.kind||n?a.kind in e&&!r&&(r=a):n=a)}s?s.mode="showing":r?r.mode="showing":n&&(n.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 t=0;t<e.length;++t){var n=e[t];"showing"===n.mode&&i.push(n)}this.updateForTrack(i)}else{let t=null,i=null,n=e.length;for(;n--;){var r=e[n];"showing"===r.mode&&("descriptions"===r.kind?t=r:i=r)}i?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(i)):t&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(t))}}updateDisplayState(e){var t=this.player_.textTrackSettings.getValues(),i=e.activeCues;let n=i.length;for(;n--;){var r,s=i[n];s&&(s=s.displayState,t.color&&(s.firstChild.style.color=t.color),t.textOpacity&&Ji(s.firstChild,"color",Yi(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(s.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&Ji(s.firstChild,"backgroundColor",Yi(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?Ji(s,"backgroundColor",Yi(t.windowColor,t.windowOpacity)):s.style.backgroundColor=t.windowColor),t.edgeStyle&&("dropshadow"===t.edgeStyle?s.firstChild.style.textShadow="2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px #222":"raised"===t.edgeStyle?s.firstChild.style.textShadow="1px 1px #222, 2px 2px #222, 3px 3px #222":"depressed"===t.edgeStyle?s.firstChild.style.textShadow="1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px #222":"uniform"===t.edgeStyle&&(s.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(s.style.fontSize),s.style.fontSize=r*t.fontPercent+"px",s.style.height="auto",s.style.top="auto"),t.fontFamily)&&"default"!==t.fontFamily&&("small-caps"===t.fontFamily?s.firstChild.style.fontVariant="small-caps":s.firstChild.style.fontFamily=Qi[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),"function"==typeof window.WebVTT&&!e.every((e=>!e.activeCues))){var t=[];for(let n=0;n<e.length;++n){var i=e[n];for(let e=0;e<i.activeCues.length;++e)t.push(i.activeCues[e])}window.WebVTT.processCues(window,t,this.el_);for(let t=0;t<e.length;++t){var n=e[t];for(let e=0;e<n.activeCues.length;++e){var r=n.activeCues[e].displayState;Q(r,"vjs-text-track-cue","vjs-text-track-cue-"+(n.language||t)),n.language&&ie(r,"lang",n.language)}this.player_.textTrackSettings&&this.updateDisplayState(n)}}}}),dt.registerComponent("LoadingSpinner",class extends dt{createEl(){var e=this.player_.isAudio(),t=(e=this.localize(e?"Audio Player":"Video Player"),e=z("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[e])}),super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"}));return t.appendChild(e),t}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}});class Zi extends Xi{createEl(e,t={},i={}){return(t=z("button",t=Object.assign({className:this.buildCSSClass()},t),i=Object.assign({type:"button"},i))).appendChild(z("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(t),t}addChild(e,t={}){var i=this.constructor.name;return c.warn(`Adding an actionable (user controllable) child to a Button (${i}) is not supported; use a ClickableComponent instead.`),dt.prototype.addChild.call(this,e,t)}enable(){super.enable(),this.el_.removeAttribute("disabled")}disable(){super.disable(),this.el_.setAttribute("disabled","disabled")}handleKeyDown(e){ut.isEventKey(e,"Space")||ut.isEventKey(e,"Enter")?e.stopPropagation():super.handleKeyDown(e)}}dt.registerComponent("Button",Zi);class en extends Zi{constructor(e,t){super(e,t),this.mouseused_=!1,this.on("mousedown",(e=>this.handleMouseDown(e)))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){var t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY)St(t),this.player_.tech(!0)&&this.player_.tech(!0).focus();else{let i=(e=this.player_.getChild("controlBar"))&&e.getChild("playToggle");i?(e=()=>i.focus(),Tt(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}}en.prototype.controlText_="Play Video",dt.registerComponent("BigPlayButton",en),dt.registerComponent("CloseButton",class extends Zi{constructor(e,t){super(e,t),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return"vjs-close-button "+super.buildCSSClass()}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){ut.isEventKey(e,"Esc")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}});class tn extends Zi{constructor(e,t={}){super(e,t),t.replay=void 0===t.replay||t.replay,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()?St(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.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",(e=>this.handleSeeked(e)))}}tn.prototype.controlText_="Play",dt.registerComponent("PlayToggle",tn);class nn extends dt{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended"],(e=>this.updateContent(e))),this.updateTextNode_()}createEl(){var e=this.buildCSSClass(),t=super.createEl("div",{className:e+" vjs-time-control vjs-control"}),i=z("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+" "},{role:"presentation"});return t.appendChild(i),this.contentEl_=z("span",{className:e+"-display"},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}updateTextNode_(e=0){e=vt(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,c.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){}}nn.prototype.labelText_="Time",nn.prototype.controlText_="Time",dt.registerComponent("TimeDisplay",nn);class rn extends nn{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)}}rn.prototype.labelText_="Current Time",rn.prototype.controlText_="Current Time",dt.registerComponent("CurrentTimeDisplay",rn);class sn extends nn{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)}}sn.prototype.labelText_="Duration",sn.prototype.controlText_="Duration",dt.registerComponent("DurationDisplay",sn),dt.registerComponent("TimeDivider",class extends dt{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 an extends nn{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(z("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if("number"==typeof this.player_.duration()){let e;e=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(e)}}}an.prototype.labelText_="Remaining Time",an.prototype.controlText_="Remaining Time",dt.registerComponent("RemainingTimeDisplay",an),dt.registerComponent("LiveDisplay",class extends dt{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",(e=>this.updateShowing(e)))}createEl(){var e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=z("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(z("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+" "})),this.contentEl_.appendChild(document.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}});class on extends Zi{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 e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=z("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}function ln(e,t,i){return Math.min(i,Math.max(t,isNaN(e=Number(e))?t:e))}on.prototype.controlText_="Seek to live, currently playing live",dt.registerComponent("SeekToLive",on),zt=Object.freeze({__proto__:null,clamp:ln});class un extends dt{constructor(e,t){super(e,t),this.handleMouseDown_=e=>this.handleMouseDown(e),this.handleMouseUp_=e=>this.handleMouseUp(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.handleClick_=e=>this.handleClick(e),this.handleMouseMove_=e=>this.handleMouseMove(e),this.update_=e=>this.update(e),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){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||I||e.preventDefault(),re(),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;se(),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(ln(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){return e=le(this.el_,e),this.vertical()?e.y:e.x}handleKeyDown(e){ut.isEventKey(e,"Left")||ut.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepBack()):ut.isEventKey(e,"Right")||ut.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")}}dt.registerComponent("Slider",un);let dn=(e,t)=>ln(e/t*100,0,100).toFixed(2)+"%";dt.registerComponent("LoadProgressBar",class extends dt{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",(e=>this.update(e)))}createEl(){var e=super.createEl("div",{className:"vjs-load-progress"}),t=z("span",{className:"vjs-control-text"}),i=z("span",{textContent:this.localize("Loaded")}),n=document.createTextNode(": ");return this.percentageEl_=z("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(i),t.appendChild(n),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",(()=>{var e=this.player_.liveTracker,t=this.player_.buffered(),i=(e=e&&e.isLive()?e.seekableEnd():this.player_.duration(),this.player_.bufferedEnd()),n=this.partEls_;e=dn(i,e);this.percent_!==e&&(this.el_.style.width=e,G(this.percentageEl_,e),this.percent_=e);for(let e=0;e<t.length;e++){var r=t.start(e),s=t.end(e);let a=n[e];a||(a=this.el_.appendChild(z()),n[e]=a),a.dataset.start===r&&a.dataset.end===s||(a.dataset.start=r,a.dataset.end=s,a.style.left=dn(r,i),a.style.width=dn(s-r,i))}for(let e=n.length;e>t.length;e--)this.el_.removeChild(n[e-1]);n.length=t.length}))}}),dt.registerComponent("TimeTooltip",class extends dt{constructor(e,t){super(e,t),this.update=Fe(je(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,i){var n=oe(this.el_),r=ae(this.player_.el());t=e.width*t;if(r&&n){var s=e.left-r.left+t;t=e.width-t+(r.right-e.right);let a=n.width/2;s<a?a+=a-s:t<a&&(a=t),a<0?a=0:a>n.width&&(a=n.width),a=Math.round(a),this.el_.style.right=`-${a}px`,this.write(i)}}write(e){G(this.el_,e)}updateTime(e,t,i,n){this.requestNamedAnimationFrame("TimeTooltip#updateTime",(()=>{let r;var s,a,o=this.player_.duration();r=this.player_.liveTracker&&this.player_.liveTracker.isLive()?((a=(s=this.player_.liveTracker.liveWindow())-t*s)<1?"":"-")+vt(a,s):vt(i,o),this.update(e,t,r),n&&n()}))}});class cn extends dt{constructor(e,t){super(e,t),this.update=Fe(je(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t){var i,n=this.getChild("timeTooltip");n&&(i=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),n.updateTime(e,t,i))}}cn.prototype.options_={children:[]},j||E||cn.prototype.options_.children.push("timeTooltip"),dt.registerComponent("PlayProgressBar",cn);class hn extends dt{constructor(e,t){super(e,t),this.update=Fe(je(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"}))}}hn.prototype.options_={children:["timeTooltip"]},dt.registerComponent("MouseTimeDisplay",hn);class pn extends un{constructor(e,t){super(e,t),this.setEventHandlers_()}setEventHandlers_(){this.update_=je(this,this.update),this.update=Fe(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":this.localize("Progress Bar")})}update(e){if("hidden"!==document.visibilityState){let e=super.update();return this.requestNamedAnimationFrame("SeekBar#update",(()=>{var t=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),i=this.player_.liveTracker;let n=this.player_.duration();i&&i.isLive()&&(n=this.player_.liveTracker.liveCurrentTime()),this.percent_!==e&&(this.el_.setAttribute("aria-valuenow",(100*e).toFixed(2)),this.percent_=e),this.currentTime_===t&&this.duration_===n||(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[vt(t,n),vt(n,n)],"{1} of {2}")),this.currentTime_=t,this.duration_=n),this.bar&&this.bar.update(ae(this.el()),this.getProgress())})),e}}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){me(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(me(e)){let r;if(t||this.player_.scrubbing()||this.player_.scrubbing(!0),t=this.calculateDistance(e),(e=this.player_.liveTracker)&&e.isLive()){if(.99<=t)return void e.seekToLiveEdge();var i=e.seekableStart(),n=e.liveCurrentTime();if((r=(r=(r=i+t*e.liveWindow())>=n?n:r)<=i?i+.1:r)===1/0)return}else(r=t*this.player_.duration())===this.player_.duration()&&(r-=.1);this.userSeek_(r)}}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?St(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;ut.isEventKey(e,"Space")||ut.isEventKey(e,"Enter")?(e.preventDefault(),e.stopPropagation(),this.handleAction(e)):ut.isEventKey(e,"Home")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(0)):ut.isEventKey(e,"End")?(e.preventDefault(),e.stopPropagation(),i&&i.isLive()?this.userSeek_(i.liveCurrentTime()):this.userSeek_(this.player_.duration())):/^[0-9]$/.test(ut(e))?(e.preventDefault(),e.stopPropagation(),t=10*(ut.codes[ut(e)]-ut.codes[0])/100,i&&i.isLive()?this.userSeek_(i.seekableStart()+i.liveWindow()*t):this.userSeek_(this.player_.duration()*t)):ut.isEventKey(e,"PgDn")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):ut.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()}}pn.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},j||E||pn.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),dt.registerComponent("SeekBar",pn);class mn extends dt{constructor(e,t){super(e,t),this.handleMouseMove=Fe(je(this,this.handleMouseMove),30),this.throttledHandleMouseSeek=Fe(je(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,n,r,s=this.getChild("seekBar");s&&(t=s.getChild("playProgressBar"),i=s.getChild("mouseTimeDisplay"),t||i)&&(n=oe(r=s.el()),r=ln(r=le(r,e).x,0,1),i&&i.update(n,r),t)&&t.update(n,s.getProgress())}handleMouseSeek(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){var e;this.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)&&St(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()}}mn.prototype.options_={children:["seekBar"]},dt.registerComponent("ProgressControl",mn);class fn extends Zi{constructor(e,t){super(e,t),this.on(e,["enterpictureinpicture","leavepictureinpicture"],(e=>this.handlePictureInPictureChange(e))),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],(e=>this.handlePictureInPictureEnabledChange(e))),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],(()=>{"audio"===e.currentType().substring(0,5)||e.audioPosterMode()||e.audioOnlyMode()?(e.isInPictureInPicture()&&e.exitPictureInPicture(),this.hide()):this.show()})),this.disable()}buildCSSClass(){return"vjs-picture-in-picture-control "+super.buildCSSClass()}handlePictureInPictureEnabledChange(){document.pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in window?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}}fn.prototype.controlText_="Picture-in-Picture",dt.registerComponent("PictureInPictureToggle",fn);class gn extends Zi{constructor(e,t){super(e,t),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.controlText("Fullscreen")}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}gn.prototype.controlText_="Fullscreen",dt.registerComponent("FullscreenToggle",gn),dt.registerComponent("VolumeLevel",class extends dt{createEl(){var e=super.createEl("div",{className:"vjs-volume-level"});return e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}),dt.registerComponent("VolumeLevelTooltip",class extends dt{constructor(e,t){super(e,t),this.update=Fe(je(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,i,n){if(!i){i=ae(this.el_);var r=ae(this.player_.el());t=e.width*t;if(!r||!i)return;var s=e.left-r.left+t;t=e.width-t+(r.right-e.right);let n=i.width/2;s<n?n+=n-s:t<n&&(n=t),n<0?n=0:n>i.width&&(n=i.width),this.el_.style.right=`-${n}px`}this.write(n+"%")}write(e){G(this.el_,e)}updateVolume(e,t,i,n,r){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",(()=>{this.update(e,t,i,n.toFixed(0)),r&&r()}))}});class yn extends dt{constructor(e,t){super(e,t),this.update=Fe(je(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"}))}}yn.prototype.options_={children:["volumeLevelTooltip"]},dt.registerComponent("MouseVolumeLevelDisplay",yn);class vn extends un{constructor(e,t){super(e,t),this.on("slideractive",(e=>this.updateLastVolume_(e))),this.on(e,"volumechange",(e=>this.updateARIAAttributes(e))),e.ready((()=>this.updateARIAAttributes()))}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){me(e)&&super.handleMouseDown(e)}handleMouseMove(e){var t,i,n,r=this.getChild("mouseVolumeLevelDisplay");r&&(t=ae(n=this.el()),i=this.vertical(),n=le(n,e),n=ln(n=i?n.y:n.x,0,1),r.update(t,n,i)),me(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)}))}}vn.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},j||E||vn.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),vn.prototype.playerEvent="volumechange",dt.registerComponent("VolumeBar",vn);class _n extends dt{constructor(e,t={}){var i,n;t.vertical=t.vertical||!1,(void 0===t.volumeBar||y(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),i=this,(n=e).tech_&&!n.tech_.featuresVolumeControl&&i.addClass("vjs-hidden"),i.on(n,"loadstart",(function(){n.tech_.featuresVolumeControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")})),this.throttledHandleMouseMove=Fe(je(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)}}_n.prototype.options_={children:["volumeBar"]},dt.registerComponent("VolumeControl",_n);class bn extends Zi{constructor(e,t){var i,n;super(e,t),i=this,(n=e).tech_&&!n.tech_.featuresMuteControl&&i.addClass("vjs-hidden"),i.on(n,"loadstart",(function(){n.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;j&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2),Y(this.el_,[0,1,2,3].reduce(((e,t)=>e+(t?" ":"")+"vjs-vol-"+t),"")),Q(this.el_,"vjs-vol-"+t)}updateControlText_(){var e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)}}bn.prototype.controlText_="Mute",dt.registerComponent("MuteToggle",bn);class wn extends dt{constructor(e,t={}){void 0!==t.inline?t.inline=t.inline:t.inline=!0,(void 0===t.volumeControl||y(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){ut.isEventKey(e,"Esc")&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),De(document,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),Me(document,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){ut.isEventKey(e,"Esc")&&this.handleMouseOut()}}wn.prototype.options_={children:["muteToggle","volumeControl"]},dt.registerComponent("VolumePanel",wn),dt.registerComponent("SkipForward",class extends Zi{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.controlText(this.localize("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){var t=this.player_.currentTime(),i=(i=this.player_.liveTracker)&&i.isLive()?i.seekableEnd():this.player_.duration();let n;n=t+this.skipTime<=i?t+this.skipTime:i,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}});class Tn extends Zi{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.controlText(this.localize("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,i=this.player_.currentTime();let n;n=(t=(t=this.player_.liveTracker)&&t.isLive()&&t.seekableStart())&&i-this.skipTime<=t?t:i>=this.skipTime?i-this.skipTime:0,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}Tn.prototype.controlText_="Skip Backward",dt.registerComponent("SkipBackward",Tn);class Sn extends dt{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 dt&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof dt&&(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";return(e=(this.contentEl_=z(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu"),super.createEl("div",{append:this.contentEl_,className:"vjs-menu"}))).appendChild(this.contentEl_),De(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){ut.isEventKey(e,"Left")||ut.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(ut.isEventKey(e,"Right")||ut.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())}}dt.registerComponent("Menu",Sn);class En extends dt{constructor(e,t={}){super(e,t),this.menuButton_=new Zi(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true"),e=Zi.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(),De(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","false"),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 Sn(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title&&(e=z("li",{className:"vjs-menu-title",textContent:rt(this.options_.title),tabIndex:-1}),e=new dt(this.player_,{el:e}),t.addItem(e)),this.items=this.createItems(),this.items)for(let e=0;e<this.items.length;e++)t.addItem(this.items[e]);return t}createItems(){}createEl(){return super.createEl("div",{className:this.buildWrapperCSSClass()},{})}buildWrapperCSSClass(){let e="vjs-menu-button";return!0===this.options_.inline?e+="-inline":e+="-popup",`vjs-menu-button ${e} ${Zi.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"),Me(document,"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(e){ut.isEventKey(e,"Esc")||ut.isEventKey(e,"Tab")?(this.buttonPressed_&&this.unpressButton(),ut.isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus())):(ut.isEventKey(e,"Up")||ut.isEventKey(e,"Down"))&&!this.buttonPressed_&&(e.preventDefault(),this.pressButton())}handleMenuKeyUp(e){(ut.isEventKey(e,"Esc")||ut.isEventKey(e,"Tab"))&&this.removeClass("vjs-hover")}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e)}handleSubmenuKeyDown(e){(ut.isEventKey(e,"Esc")||ut.isEventKey(e,"Tab"))&&(this.buttonPressed_&&this.unpressButton(),ut.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"),j&&$()||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()}}dt.registerComponent("MenuButton",En);class kn extends En{constructor(e,t){let i=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),i){let e=je(this,this.update);i.addEventListener("removetrack",e),i.addEventListener("addtrack",e),i.addEventListener("labelchange",e),this.player_.on("ready",e),this.player_.on("dispose",(function(){i.removeEventListener("removetrack",e),i.removeEventListener("addtrack",e),i.removeEventListener("labelchange",e)}))}}}dt.registerComponent("TrackButton",kn);let Cn=["Tab","Esc","Up","Down","Right","Left"];class xn extends Xi{constructor(e,t){super(e,t),this.selectable=t.selectable,this.isSelected_=t.selected||!1,this.multiSelectable=t.multiSelectable,this.selected(this.isSelected_),this.selectable?this.multiSelectable?this.el_.setAttribute("role","menuitemcheckbox"):this.el_.setAttribute("role","menuitemradio"):this.el_.setAttribute("role","menuitem")}createEl(e,t,i){return this.nonIconControl=!0,(t=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),i)).replaceChild(z("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)}),t.querySelector(".vjs-icon-placeholder")),t}handleKeyDown(e){Cn.some((t=>ut.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","false"),this.controlText(""),this.isSelected_=!1))}}dt.registerComponent("MenuItem",xn);class In extends xn{constructor(e,t){var i=t.track;let n=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)}),s=(...e)=>{this.handleSelectedLanguageChange.apply(this,e)};if(e.on(["loadstart","texttrackchange"],r),n.addEventListener("change",r),n.addEventListener("selectedlanguagechange",s),this.on("dispose",(function(){e.off(["loadstart","texttrackchange"],r),n.removeEventListener("change",r),n.removeEventListener("selectedlanguagechange",s)})),void 0===n.onchange){let e;this.on(["tap","click"],(function(){if("object"!=typeof window.Event)try{e=new window.Event("change")}catch(e){}e||(e=document.createEvent("Event")).initEvent("change",!0,!0),n.dispatchEvent(e)}))}this.handleTracksChange()}handleClick(e){var t=this.track,i=this.player_.textTracks();if(super.handleClick(e),i)for(let e=0;e<i.length;e++){var n=i[e];-1!==this.kinds.indexOf(n.kind)&&(n===t?"showing"!==n.mode&&(n.mode="showing"):"disabled"!==n.mode&&(n.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()}}dt.registerComponent("TextTrackMenuItem",In);class An extends In{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 e=0,r=t.length;e<r;e++){var n=t[e];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 e=0,r=t.length;e<r;e++){var n=t[e];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()}}dt.registerComponent("OffTextTrackMenuItem",An);class Pn extends kn{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=In){let i;this.label_&&(i=this.label_+" off"),e.push(new An(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;var n=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let i=0;i<n.length;i++){var r,s=n[i];-1<this.kinds_.indexOf(s.kind)&&((r=new t(this.player_,{track:s,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1})).addClass(`vjs-${s.kind}-menu-item`),e.push(r))}return e}}dt.registerComponent("TextTrackButton",Pn);class On extends xn{constructor(e,t){var i=t.track,n=t.cue,r=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=n.text,t.selected=n.startTime<=r&&r<n.endTime,super(e,t),this.track=i,this.cue=n}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}}dt.registerComponent("ChaptersTrackMenuItem",On);class Ln extends Pn{constructor(e,t,i){super(e,t,i),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_))}findChaptersTrack(){var e=this.player_.textTracks()||[];for(let i=e.length-1;0<=i;i--){var t=e[i];if(t.kind===this.kind_)return t}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(rt(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 n=0,r=t.length;n<r;n++){var i=t[n];i=new On(this.player_,{track:this.track_,cue:i});e.push(i)}}return e}}Ln.prototype.kind_="chapters",Ln.prototype.controlText_="Chapters",dt.registerComponent("ChaptersButton",Ln);class Dn extends Pn{constructor(e,t,i){super(e,t,i);let n=e.textTracks(),r=je(this,this.handleTracksChange);n.addEventListener("change",r),this.on("dispose",(function(){n.removeEventListener("change",r)}))}handleTracksChange(e){var t=this.player().textTracks();let i=!1;for(let e=0,r=t.length;e<r;e++){var n=t[e];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()}}Dn.prototype.kind_="descriptions",Dn.prototype.controlText_="Descriptions",dt.registerComponent("DescriptionsButton",Dn);class Mn extends Pn{constructor(e,t,i){super(e,t,i)}buildCSSClass(){return"vjs-subtitles-button "+super.buildCSSClass()}buildWrapperCSSClass(){return"vjs-subtitles-button "+super.buildWrapperCSSClass()}}Mn.prototype.kind_="subtitles",Mn.prototype.controlText_="Subtitles",dt.registerComponent("SubtitlesButton",Mn);class Nn extends In{constructor(e,t){t.track={player:e,kind:t.kind,label:t.kind+" settings",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="CaptionSettingsMenuItem",super(e,t),this.addClass("vjs-texttrack-settings"),this.controlText(", opens "+t.kind+" settings dialog")}handleClick(e){this.player().getChild("textTrackSettings").open()}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.kind+" settings"),super.handleLanguagechange()}}dt.registerComponent("CaptionSettingsMenuItem",Nn);class Rn extends Pn{constructor(e,t,i){super(e,t,i)}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 Nn(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}}Rn.prototype.kind_="captions",Rn.prototype.controlText_="Captions",dt.registerComponent("CaptionsButton",Rn);class Un extends In{createEl(e,t,i){return t=(e=super.createEl(e,t,i)).querySelector(".vjs-menu-item-text"),"captions"===this.options_.track.kind&&(t.appendChild(z("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),t.appendChild(z("span",{className:"vjs-control-text",textContent:" "+this.localize("Captions")}))),e}}dt.registerComponent("SubsCapsMenuItem",Un);class Bn extends Pn{constructor(e,t={}){super(e,t),this.label_="subtitles",-1<["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)&&(this.label_="captions"),this.menuButton_.controlText(rt(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 Nn(this.player_,{kind:this.label_})),this.hideThreshold_+=1),super.createItems(e,Un)}}Bn.prototype.kinds_=["captions","subtitles"],Bn.prototype.controlText_="Subtitles",dt.registerComponent("SubsCapsButton",Bn);class jn extends xn{constructor(e,t){var i=t.track;let n=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)});n.addEventListener("change",r),this.on("dispose",(()=>{n.removeEventListener("change",r)}))}createEl(e,t,i){return t=(e=super.createEl(e,t,i)).querySelector(".vjs-menu-item-text"),"main-desc"===this.options_.track.kind&&(t.appendChild(z("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),t.appendChild(z("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),e}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){var t=this.player_.audioTracks();for(let e=0;e<t.length;e++){var i=t[e];i!==this.track&&(i.enabled=i===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}}dt.registerComponent("AudioTrackMenuItem",jn);class Fn extends kn{constructor(e,t={}){t.tracks=e.audioTracks(),super(e,t)}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 n=0;n<t.length;n++){var i=t[n];e.push(new jn(this.player_,{track:i,selectable:!0,multiSelectable:!1}))}return e}}Fn.prototype.controlText_="Audio Track",dt.registerComponent("AudioTrackButton",Fn);class qn extends xn{constructor(e,t){var i=t.rate,n=parseFloat(i,10);t.label=i,t.selected=n===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=i,this.rate=n,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)}}qn.prototype.contentElType="button",dt.registerComponent("PlaybackRateMenuItem",qn);class Hn extends En{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_=z("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 qn(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")}}Hn.prototype.controlText_="Playback Rate",dt.registerComponent("PlaybackRateMenuButton",Hn);class Vn extends dt{buildCSSClass(){return"vjs-spacer "+super.buildCSSClass()}createEl(e="div",t={},i={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,i)}}dt.registerComponent("Spacer",Vn),dt.registerComponent("CustomControlSpacer",class extends Vn{buildCSSClass(){return"vjs-custom-control-spacer "+super.buildCSSClass()}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}});class $n extends dt{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}$n.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},"exitPictureInPicture"in document&&$n.prototype.options_.children.splice($n.prototype.options_.children.length-1,0,"pictureInPictureToggle"),dt.registerComponent("ControlBar",$n);class Wn extends Ct{constructor(e,t){super(e,t),this.on(e,"error",(e=>this.open(e)))}buildCSSClass(){return"vjs-error-display "+super.buildCSSClass()}content(){var e=this.player().error();return e?this.localize(e.message):""}}Wn.prototype.options_=Object.assign({},Ct.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),dt.registerComponent("ErrorDisplay",Wn);let zn="vjs-text-track-settings";var Gn,Xn=["#F00","Red"],Kn=["#FFF","White"];let Qn={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Gn=["#000","Black"],Kn,Xn,kr=["#0F0","Green"],ot=["#00F","Blue"],ds=["#FF0","Yellow"],cs=["#F0F","Magenta"],na=["#0FF","Cyan"]]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[fa=["1","Opaque"],oa=["0.5","Semi-Transparent"],aa=["0","Transparent"]]},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Kn,Gn,Xn,kr,ot,ds,cs,na]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:e=>"1.00"===e?null:Number(e)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[fa,oa]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[aa,oa,fa]}};function Yn(e,t){if((e=t?t(e):e)&&"none"!==e)return e}function Jn(e){let t=e.el();if(!t.resetSourceWatch_){let i={},n=ir(e),r=i=>(...n)=>(n=i.apply(t,n),Zn(e),n);["append","appendChild","insertAdjacentHTML"].forEach((e=>{t[e]&&(i[e]=t[e],t[e]=r(i[e]))})),Object.defineProperty(t,"innerHTML",v(n,{set:r(n.set)})),t.resetSourceWatch_=()=>{t.resetSourceWatch_=null,Object.keys(i).forEach((e=>{t[e]=i[e]})),Object.defineProperty(t,"innerHTML",n)},e.one("sourceset",t.resetSourceWatch_)}}Qn.windowColor.options=Qn.backgroundColor.options,dt.registerComponent("TextTrackSettings",class extends Ct{constructor(e,t){t.temporary=!1,super(e,t),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.endDialog=z("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")}),this.el().appendChild(this.endDialog),this.setDefaults(),void 0===t.persistTextTrackSettings&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings),this.on(this.$(".vjs-done-button"),"click",(()=>{this.saveSettings(),this.close()})),this.on(this.$(".vjs-default-button"),"click",(()=>{this.setDefaults(),this.updateDisplay()})),m(Qn,(e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})),this.options_.persistTextTrackSettings&&this.restoreSettings()}dispose(){this.endDialog=null,super.dispose()}createElSelect_(e,t="",i="label"){let n=(e=Qn[e]).id.replace("%s",this.id_),r=[t,n].join(" ").trim();return[`<${i} id="${n}" class="${"label"===i?"vjs-label":""}">`,this.localize(e.label),`</${i}>`,`<select aria-labelledby="${r}">`].concat(e.options.map((e=>{var t=n+"-"+e[1].replace(/\W+/g,"");return[`<option id="${t}" value="${e[0]}" `,`aria-labelledby="${r} ${t}">`,this.localize(e[1]),"</option>"].join("")}))).concat("</select>").join("")}createElFgColor_(){var e="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg vjs-track-setting">',`<legend id="${e}">`,this.localize("Text"),"</legend>",'<span class="vjs-text-color">',this.createElSelect_("color",e),"</span>",'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",e),"</span>","</fieldset>"].join("")}createElBgColor_(){var e="captions-background-"+this.id_;return['<fieldset class="vjs-bg vjs-track-setting">',`<legend id="${e}">`,this.localize("Text Background"),"</legend>",'<span class="vjs-bg-color">',this.createElSelect_("backgroundColor",e),"</span>",'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",e),"</span>","</fieldset>"].join("")}createElWinColor_(){var e="captions-window-"+this.id_;return['<fieldset class="vjs-window vjs-track-setting">',`<legend id="${e}">`,this.localize("Caption Area Background"),"</legend>",'<span class="vjs-window-color">',this.createElSelect_("windowColor",e),"</span>",'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",e),"</span>","</fieldset>"].join("")}createElColors_(){return z("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})}createElFont_(){return z("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 e=this.localize("restore all settings to the default values");return z("div",{className:"vjs-track-settings-controls",innerHTML:[`<button type="button" class="vjs-default-button" title="${e}">`,this.localize("Reset"),`<span class="vjs-control-text"> ${e}</span>`,"</button>",`<button type="button" class="vjs-done-button">${this.localize("Done")}</button>`].join("")})}content(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return f(Qn,((e,t,i)=>{n=this.$(t.selector),t=t.parser;var n=Yn(n.options[n.options.selectedIndex].value,t);return void 0!==n&&(e[i]=n),e}),{})}setValues(e){m(Qn,((t,i)=>{var n=this.$(t.selector),r=e[i],s=t.parser;if(r)for(let e=0;e<n.options.length;e++)if(Yn(n.options[e].value,s)===r){n.selectedIndex=e;break}}))}setDefaults(){m(Qn,(e=>{var t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t}))}restoreSettings(){let e;try{e=JSON.parse(window.localStorage.getItem(zn))}catch(e){c.warn(e)}e&&this.setValues(e)}saveSettings(){if(this.options_.persistTextTrackSettings){var e=this.getValues();try{Object.keys(e).length?window.localStorage.setItem(zn,JSON.stringify(e)):window.localStorage.removeItem(zn)}catch(e){c.warn(e)}}}updateDisplay(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}conditionalBlur_(){this.previouslyActiveEl_=null;var e=(t=this.player_.controlBar)&&t.subsCapsButton,t=t&&t.captionsButton;e?e.focus():t&&t.focus()}handleLanguagechange(){this.fill()}}),dt.registerComponent("ResizeManager",class extends dt{constructor(e,t){let i=t.ResizeObserver||window.ResizeObserver;super(e,v({createEl:!(i=null!==t.ResizeObserver&&i),reportTouchActivity:!1},t)),this.ResizeObserver=t.ResizeObserver||window.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=qe((()=>{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(){Me(this,"resize",e),Me(this,"unload",t),t=null};De(this.el_.contentWindow,"unload",t),De(this.el_.contentWindow,"resize",e)}},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}}),dt.registerComponent("LiveTracker",class extends dt{constructor(e,t){super(e,v({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_(){if((e=this.player_.seekable())&&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}seekableStart(){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()}}),dt.registerComponent("TitleBar",class extends dt{constructor(e,t){super(e,t),this.on("statechanged",(e=>this.updateDom_())),this.updateDom_()}createEl(){return this.els={title:z("div",{className:"vjs-title-bar-title",id:"vjs-title-bar-title-"+xe++}),description:z("div",{className:"vjs-title-bar-description",id:"vjs-title-bar-description-"+xe++})},z("div",{className:"vjs-title-bar"},{},Object.values(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 n=this.state[e],r=this.els[e];e=i[e];de(r),n&&G(r,n),t&&(t.removeAttribute(e),n)&&t.setAttribute(e,r.id)})),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){var e;(e=(e=this.player_.tech_)&&e.el_)&&(e.removeAttribute("aria-labelledby"),e.removeAttribute("aria-describedby")),super.dispose(),this.els=null}});let Zn=e=>{var t=e.el();if(t.hasAttribute("src"))e.triggerSourceset(t.src);else{var i=e.$$("source"),n=[];let t="";if(!i.length)return!1;for(let e=0;e<i.length;e++){var r=i[e].src;r&&-1===n.indexOf(r)&&n.push(r)}if(!n.length)return!1;1===n.length&&(t=n[0]),e.triggerSourceset(t)}return!0},er=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}}),tr=(e,t)=>{let i={};for(let n=0;n<e.length&&!((i=Object.getOwnPropertyDescriptor(e[n],t))&&i.set&&i.get);n++);return i.enumerable=!0,i.configurable=!0,i},ir=e=>tr([e.el(),window.HTMLMediaElement.prototype,window.Element.prototype,er],"innerHTML"),nr=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?Nt(window.Element.prototype.getAttribute.call(this,"src")):""},set(e){return window.Element.prototype.setAttribute.call(this,"src",e),e}});class rr extends Ri{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 n=this.el_.childNodes;let e=n.length;for(var r=[];e--;){var s=n[e];"track"===s.nodeName.toLowerCase()&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(s),this.remoteTextTracks().addTrack(s.track),this.textTracks().addTrack(s.track),i||this.el_.hasAttribute("crossorigin")||!Rt(s.src)||(i=!0)):r.push(s))}for(let e=0;e<r.length;e++)this.el_.removeChild(r[e])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&i&&c.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_(),(R||N)&&!0===e.nativeControlsForTouch&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),rr.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){!function(e){if(e.featuresSourceset){let t=e.el();if(!t.resetSourceset_){let i=tr([e.el(),window.HTMLMediaElement.prototype,nr],"src"),n=t.setAttribute,r=t.load;Object.defineProperty(t,"src",v(i,{set:n=>(n=i.set.call(t,n),e.triggerSourceset(t.src),n)})),t.setAttribute=(i,r)=>(r=n.call(t,i,r),/src/i.test(i)&&e.triggerSourceset(t.src),r),t.load=()=>{var i=r.call(t);return Zn(e)||(e.triggerSourceset(""),Jn(e)),i},t.currentSrc?e.triggerSourceset(t.currentSrc):Zn(e)||Jn(e),t.resetSourceset_=()=>{t.resetSourceset_=null,t.load=r,t.setAttribute=n,Object.defineProperty(t,"src",i),t.resetSourceWatch_&&t.resetSourceWatch_()}}}}(this)}restoreMetadataTracksInIOSNativePlayer_(){let e,t=this.textTracks(),i=()=>{e=[];for(let n=0;n<t.length;n++){var i=t[n];"metadata"===i.kind&&e.push({track:i,storedMode:i.mode})}},n=(i(),t.addEventListener("change",i),this.on("dispose",(()=>t.removeEventListener("change",i))),()=>{for(let t=0;t<e.length;t++){var i=e[t];"disabled"===i.track.mode&&i.track.mode!==i.storedMode&&(i.track.mode=i.storedMode)}t.removeEventListener("change",n)});this.on("webkitbeginfullscreen",(()=>{t.removeEventListener("change",i),t.removeEventListener("change",n),t.addEventListener("change",n)})),this.on("webkitendfullscreen",(()=>{t.removeEventListener("change",i),t.addEventListener("change",i),t.removeEventListener("change",n)}))}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=si[e];let i=this.el()[t.getterName],n=this[t.getterName]();if(this[`featuresNative${t.capitalName}Tracks`]&&i&&i.addEventListener){let r={change:t=>{var i={type:"change",target:n,currentTarget:n,srcElement:n};n.trigger(i),"text"===e&&this[ai.remoteText.getterName]().trigger(i)},addtrack(e){n.addTrack(e.track)},removetrack(e){n.removeTrack(e.track)}},s=function(){var e=[];for(let t=0;t<n.length;t++){let r=!1;for(let e=0;e<i.length;e++)if(i[e]===n[t]){r=!0;break}r||e.push(n[t])}for(;e.length;)n.removeTrack(e.shift())};this[t.getterName+"Listeners_"]=r,Object.keys(r).forEach((e=>{let t=r[e];i.addEventListener(e,t),this.on("dispose",(n=>i.removeEventListener(e,t)))})),this.on("loadstart",s),this.on("dispose",(e=>this.off("loadstart",s)))}}proxyNativeTracks_(){si.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),rr.disposeMediaElement(e),e=t):(e=document.createElement("video"),t=v({},this.options_.tag&&ee(this.options_.tag)),R&&!0===this.options_.nativeControlsForTouch||delete t.controls,Z(e,Object.assign(t,{id:this.options_.techId,class:"vjs-tech"}))),e.playerId=this.options_.playerId),void 0!==this.options_.preload&&ie(e,"preload",this.options_.preload),void 0!==this.options_.disablePictureInPicture&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);var t,i=["loop","muted","playsinline","autoplay"];for(let t=0;t<i.length;t++){var n=i[t],r=this.options_[n];void 0!==r&&(r?ie(e,n,n):ne(e,n),e[n]=r)}return e}handleLateInit_(e){if(0!==e.networkState&&3!==e.networkState)if(0===e.readyState){let e=!1,t=function(){e=!0},i=(this.on("loadstart",t),function(){e||this.trigger("loadstart")});this.on("loadedmetadata",i),this.ready((function(){this.off("loadstart",t),this.off("loadedmetadata",i),e||this.trigger("loadstart")}))}else{let t=["loadstart"];t.push("loadedmetadata"),2<=e.readyState&&t.push("loadeddata"),3<=e.readyState&&t.push("canplay"),4<=e.readyState&&t.push("canplaythrough"),this.ready((function(){t.forEach((function(e){this.trigger(e)}),this)}))}}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&F?this.el_.fastSeek(e):this.el_.currentTime=e}catch(e){c(e,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&E&&I&&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}proxyWebkitFullscreen_(){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)St(this.el_.play()),this.setTimeout((function(){e.pause();try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}}),0);else try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}}exitFullScreen(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",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(){rr.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)}}_(rr,"TEST_VID",(function(){var e,t;if(H())return e=document.createElement("video"),(t=document.createElement("track")).kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e})),rr.isSupported=function(){try{rr.TEST_VID.volume=.5}catch(e){return!1}return!(!rr.TEST_VID||!rr.TEST_VID.canPlayType)},rr.canPlayType=function(e){return rr.TEST_VID.canPlayType(e)},rr.canPlaySource=function(e,t){return rr.canPlayType(e.type)},rr.canControlVolume=function(){try{let t=rr.TEST_VID.volume;rr.TEST_VID.volume=t/2+.1;var e=t!==rr.TEST_VID.volume;return e&&j?(window.setTimeout((()=>{rr&&rr.prototype&&(rr.prototype.featuresVolumeControl=t!==rr.TEST_VID.volume)})),!1):e}catch(e){return!1}},rr.canMuteVolume=function(){try{var e=rr.TEST_VID.muted;return rr.TEST_VID.muted=!e,rr.TEST_VID.muted?ie(rr.TEST_VID,"muted","muted"):ne(rr.TEST_VID,"muted"),e!==rr.TEST_VID.muted}catch(e){return!1}},rr.canControlPlaybackRate=function(){if(E&&I&&P<58)return!1;try{var e=rr.TEST_VID.playbackRate;return rr.TEST_VID.playbackRate=e/2+.1,e!==rr.TEST_VID.playbackRate}catch(e){return!1}},rr.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(e){return!1}return!0},rr.supportsNativeTextTracks=function(){return F||j&&I},rr.supportsNativeVideoTracks=function(){return!(!rr.TEST_VID||!rr.TEST_VID.videoTracks)},rr.supportsNativeAudioTracks=function(){return!(!rr.TEST_VID||!rr.TEST_VID.audioTracks)},rr.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach((function([e,t]){_(rr.prototype,e,(()=>rr[t]()),!0)})),rr.prototype.featuresVolumeControl=rr.canControlVolume(),rr.prototype.movingMediaElementInDOM=!j,rr.prototype.featuresFullscreenResize=!0,rr.prototype.featuresProgressEvents=!0,rr.prototype.featuresTimeupdateEvents=!0,rr.prototype.featuresVideoFrameCallback=!(!rr.TEST_VID||!rr.TEST_VID.requestVideoFrameCallback),rr.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(e){}}},rr.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(e){}}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach((function(e){rr.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}})),["muted","defaultMuted","autoplay","loop","playsinline"].forEach((function(e){rr.prototype["set"+rt(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){rr.prototype[e]=function(){return this.el_[e]}})),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach((function(e){rr.prototype["set"+rt(e)]=function(t){this.el_[e]=t}})),["pause","load","play"].forEach((function(e){rr.prototype[e]=function(){return this.el_[e]()}})),Ri.withSourceHandlers(rr),rr.nativeSourceHandler={},rr.nativeSourceHandler.canPlayType=function(e){try{return rr.TEST_VID.canPlayType(e)}catch(e){return""}},rr.nativeSourceHandler.canHandleSource=function(e,t){return e.type?rr.nativeSourceHandler.canPlayType(e.type):e.src?(e=Ut(e.src),rr.nativeSourceHandler.canPlayType("video/"+e)):""},rr.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)},rr.nativeSourceHandler.dispose=function(){},rr.registerSourceHandler(rr.nativeSourceHandler),Ri.registerTech("Html5",rr);let sr=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],ar={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},or=["tiny","xsmall","small","medium","large","xlarge","huge"],lr={},ur=(or.forEach((e=>{var t="x"===e.charAt(0)?"x-"+e.substring(1):e;lr[e]="vjs-layout-"+t})),{tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0});class dr extends dt{constructor(e,i,n){if(e.id=e.id||i.id||"vjs_video_"+xe++,(i=Object.assign(dr.getTagSettings(e),i)).initChildren=!1,i.createEl=!1,i.evented=!1,i.reportTouchActivity=!1,i.language||(r=e.closest("[lang]"))&&(i.language=r.getAttribute("lang")),super(null,i,n),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=h(this.id_),this.fsApi_=s,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=e,this.tagAttributes=e&&ee(e),this.language(this.options_.language),i.languages){let e={};Object.getOwnPropertyNames(i.languages).forEach((function(t){e[t.toLowerCase()]=i.languages[t]})),this.languages_=e}else this.languages_=dr.prototype.options_.languages;this.resetCache_(),this.poster_=i.poster||"",this.controls_=!!i.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),i.plugins&&Object.keys(i.plugins).forEach((e=>{if("function"!=typeof this[e])throw Error(`plugin "${e}" does not exist`)})),this.scrubbing_=!1,this.el_=this.createEl(),et(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(De(document,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);var r=v(this.options_);i.plugins&&Object.keys(i.plugins).forEach((e=>{this[e](i.plugins[e])})),i.debug&&this.debug(!0),this.options_.playerOptions=r,this.middleware_=[],this.playbackRates(i.playbackRates),this.initChildren(),this.isAudio("audio"===e.nodeName.toLowerCase()),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),R&&this.addClass("vjs-touch-enabled"),j||this.addClass("vjs-workinghover"),dr.players[this.id_]=this,n=t.split(".")[0];this.addClass("vjs-v"+n),this.userActive(!0),this.reportUserActivity(),this.one("play",(e=>this.listenForUserActivity_(e))),this.on("keydown",(e=>this.handleKeyDown(e))),this.on("languagechange",(e=>this.handleLanguagechange(e))),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",(()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)}))}dispose(){this.trigger("dispose"),this.off("dispose"),Me(document,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Me(document,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),dr.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),Bi[this.id()]=null,oi.names.forEach((e=>{(e=this[oi[e].getterName]())&&e.off&&e.off()})),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e,t=this.tag,i=this.playerElIngest_=t.parentNode&&t.parentNode.hasAttribute&&t.parentNode.hasAttribute("data-vjs-player"),n="video-js"===this.tag.tagName.toLowerCase(),r=(i?e=this.el_=t.parentNode:n||(e=this.el_=super.createEl("div")),ee(t));if(n){for(e=this.el_=t,t=this.tag=document.createElement("video");e.children.length;)t.appendChild(e.firstChild);K(e,"video-js")||Q(e,"video-js"),e.appendChild(t),i=this.playerElIngest_=e,Object.keys(e).forEach((i=>{try{t[i]=e[i]}catch(e){}}))}t.setAttribute("tabindex","-1"),r.tabindex="-1",I&&D&&(t.setAttribute("role","application"),r.role="application"),t.removeAttribute("width"),t.removeAttribute("height"),"width"in r&&delete r.width,"height"in r&&delete r.height,Object.getOwnPropertyNames(r).forEach((function(i){n&&"class"===i||e.setAttribute(i,r[i]),n&&t.setAttribute(i,r[i])})),t.playerId=t.id,t.id+="_html5_api",t.className="vjs-tech",(t.player=e.player=this).addClass("vjs-paused"),!0!==window.VIDEOJS_NO_DYNAMIC_STYLE&&(this.styleEl_=Ee("vjs-styles-dimensions"),s=fe(".vjs-styles-defaults"),(a=fe("head")).insertBefore(this.styleEl_,s?s.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 s,a,o=t.getElementsByTagName("a");for(let e=0;e<o.length;e++){var l=o.item(e);Q(l,"vjs-hidden"),l.setAttribute("hidden","hidden")}return t.initNetworkState_=t.networkState,t.parentNode&&!i&&t.parentNode.insertBefore(e,t),X(t,e),this.children_.unshift(t),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=e}crossOrigin(e){if(void 0===e)return this.techGet_("crossOrigin");null!==e&&"anonymous"!==e&&"use-credentials"!==e?c.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,n=e+"_";if(void 0===t)return this[n]||0;""===t||"auto"===t?(this[n]=void 0,this.updateStyleEl_()):(i=parseFloat(t),isNaN(i)?c.error(`Improper value "${t}" supplied for for `+e):(this[n]=i,this.updateStyleEl_()))}fluid(e){var t;if(void 0===e)return!!this.fluid_;this.fluid_=!!e,ze(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),t=()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)},ze(e=this)?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 t="number"==typeof this.width_?this.width_:this.options_.width,i="number"==typeof this.height_?this.height_:this.options_.height;var e=this.tech_&&this.tech_.el();e&&(0<=t&&(e.width=t),0<=i)&&(e.height=i)}else{let t,i,n,r;e=(e=(n=void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:0<this.videoWidth()?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"))[1]/e[0],t=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/e:this.videoWidth()||300,i=void 0!==this.height_?this.height_:t*e,r=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(r),ke(this.styleEl_,`\n .${r} {\n width: ${t}px;\n height: ${i}px;\n }\n\n .${r}.vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: ${100*e}%;\n }\n `)}}loadTech_(e,t){this.tech_&&this.unloadTech_();var i,n,r=rt(e),s=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==r&&this.tag&&(Ri.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()+`_${s}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};if(oi.names.forEach((e=>{o[(e=oi[e]).getterName]=this[e.privateName]})),Object.assign(o,this.options_[r]),Object.assign(o,this.options_[s]),Object.assign(o,this.options_[e.toLowerCase()]),this.tag&&(o.tag=this.tag),t&&t.src===this.cache_.src&&0<this.cache_.currentTime&&(o.startTime=this.cache_.currentTime),!(s=Ri.getTech(e)))throw Error(`No Tech named '${r}' exists! '${r}' should be registered using videojs.registerTech()'`);this.tech_=new s(o),this.tech_.ready(je(this,this.handleTechReady_),!0),i=this.textTracksJson_||[],n=this.tech_,i.forEach((function(e){let t=n.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach((e=>t.addCue(e)))})),n.textTracks(),sr.forEach((e=>{this.on(this.tech_,e,(t=>this[`handleTech${rt(e)}_`](t)))})),Object.keys(ar).forEach((e=>{this.on(this.tech_,e,(t=>{0===this.tech_.playbackRate()&&this.tech_.seeking()?this.queuedCallbacks_.push({callback:this[`handleTech${ar[e]}_`].bind(this),event:t}):this[`handleTech${ar[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||X(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){oi.names.forEach((e=>{this[(e=oi[e]).privateName]=this[e.getterName]()})),this.textTracksJson_=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=Et(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(Et))}(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&&c.warn("Using the tech directly can be dangerous. I hope you know what 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(Tt(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():Tt(i=this.play())&&(i=i.catch(t)),Tt(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 n=e.$$("source");for(let e=0;e<n.length;e++){var r=n[e];if(r.type&&r.src&&r.src===t)return r.type}return zi(t)})(this,t)),this.cache_.source=v({},e,{src:t,type:i});e=this.cache_.sources.filter((e=>e.src&&e.src===t));var n=[],r=this.$$("source"),s=[];for(let e=0;e<r.length;e++){var a=ee(r[e]);n.push(a),a.src&&a.src===t&&s.push(a.src)}s.length&&!e.length?this.cache_.sources=n:e.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let n=e=>this.updateSourceCaches_(e);var t=this.currentSource().src,i=e.src;(n=!t||/^blob:/.test(t)||!/^blob:/.test(i)||this.lastSource_&&(this.lastSource_.tech===i||this.lastSource_.player===t)?n:()=>{})(i),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")}handleTechSeeked_(){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()?St(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):!t&&e.msMatchesSelector&&(t=e.msMatchesSelector(":"+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();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 Hi)return i=this.middleware_,this.tech_[e](i.reduce($i(e),t));if(e in Vi)return Fi(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(e){throw c(e),e}}),!0)}techGet_(e){if(this.tech_&&this.tech_.isReady_){var t,i;if(e in qi)return t=this.middleware_,i=this.tech_,t.reduceRight($i(e),i[e]());if(e in Vi)return Fi(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){throw void 0===this.tech_[e]?c(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t):"TypeError"===t.name?(c(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1):c(t),t}}}play(){return new Promise((e=>{this.play_(e)}))}play_(e=St){this.playCallbacks_.push(e);e=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc()));var t,i=Boolean(F||j);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")||pt(0,0)}scrubbing(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){return void 0!==e?(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),void(this.cache_.initTime=0)):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_))):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)}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:pt(0,0)}bufferedPercent(){return bt(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,parseFloat(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,n)=>{function r(){t.off("fullscreenerror",a),t.off("fullscreenchange",s)}function s(){r(),i()}function a(e,t){r(),n(t)}t.one("fullscreenchange",s),t.one("fullscreenerror",a);var o=t.requestFullscreenHelper_(e);o&&(o.then(r,r),o.then(i,n))}))}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()&&1==!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){let e=this;return new Promise(((t,i)=>{function n(){e.off("fullscreenerror",s),e.off("fullscreenchange",r)}function r(){n(),t()}function s(e,t){n(),i(t)}e.one("fullscreenchange",r),e.one("fullscreenerror",s);var a=e.exitFullscreenHelper_();a&&(a.then(n,n),a.then(t,i))}))}exitFullscreenHelper_(){var e;if(this.fsApi_.requestFullscreen)return(e=document[this.fsApi_.exitFullscreen]())&&St(e.then((()=>this.isFullscreen(!1)))),e;this.tech_.supportsFullScreen()&&1==!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=document.documentElement.style.overflow,De(document,"keydown",this.boundFullWindowOnEscKey_),document.documentElement.style.overflow="hidden",Q(document.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){ut.isEventKey(e,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,Me(document,"keydown",this.boundFullWindowOnEscKey_),document.documentElement.style.overflow=this.docOrigOverflow,Y(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 e=document.createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(z("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),window.documentPictureInPicture.requestWindow({initialAspectRatio:this.videoWidth()/this.videoHeight(),copyStyleSheets:!0}).then((t=>(this.el_.parentNode.insertBefore(e,this.el_),t.document.body.append(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger("enterpictureinpicture"),t.addEventListener("unload",(t=>{t=t.target.querySelector(".video-js"),e.replaceWith(t),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")})),t)))}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,n=this.options_.userActions;n&&n.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 n.hotkeys?n.hotkeys.call(this,e):this.handleHotkeys(e)))}handleHotkeys(e){var{fullscreenKey:t=e=>ut.isEventKey(e,"f"),muteKey:i=e=>ut.isEventKey(e,"m"),playPauseKey:n=e=>ut.isEventKey(e,"k")||ut.isEventKey(e,"Space")}=this.options_.userActions?this.options_.userActions.hotkeys:{};t.call(this,e)?(e.preventDefault(),e.stopPropagation(),t=dt.getComponent("FullscreenToggle"),!1!==document[this.fsApi_.fullscreenEnabled]&&t.prototype.handleClick.call(this,e)):i.call(this,e)?(e.preventDefault(),e.stopPropagation(),dt.getComponent("MuteToggle").prototype.handleClick.call(this,e)):n.call(this,e)&&(e.preventDefault(),e.stopPropagation(),dt.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){var t;for(let n=0,r=this.options_.techOrder;n<r.length;n++){var i=r[n];let s=Ri.getTech(i);if(s=s||dt.getComponent(i)){if(s.isSupported()&&(t=s.canPlayType(e)))return t}else c.error(`The "${i}" tech is undefined. Skipped browser support check for that tech.`)}return""}selectSource(e){function t(e,t,i){let n;return e.some((e=>t.some((t=>{if(n=i(e,t))return!0})))),n}var i=this.options_.techOrder.map((e=>[e,Ri.getTech(e)])).filter((([e,t])=>t?t.isSupported():(c.error(`The "${e}" tech is undefined. Skipped browser support check for that tech.`),!1)));let n;var r,s=([e,t],i)=>{if(t.canPlaySource(i,this.options_[e.toLowerCase()]))return{source:i,tech:e}};return(n=this.options_.sourceOrder?t(e,i,(r=s,(e,t)=>r(t,e))):t(i,e,s))||!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):g(t)&&i.push(t)})),t=i}else t="string"==typeof t&&t.trim()?[Gi({src:t})]:g(t)&&"string"==typeof t.src&&t.src&&t.src.trim()?[Gi(t)]:[];return t}(e);if(i.length){if(this.changingSrc_=!0,t||(this.cache_.sources=i),this.updateSourceCaches_(i[0]),function(e,t,i){e.setTimeout((()=>function e(t={},i=[],n,r,s=[],a=!1){let[o,...l]=i;if("string"==typeof o)e(t,Ui[o],n,r,s,a);else if(o){let i=function(e,t){var i=Bi[e.id()];let n=null;if(null==i)n=t(e),Bi[e.id()]=[[t,n]];else{for(let e=0;e<i.length;e++){var[r,s]=i[e];r===t&&(n=s)}null===n&&(n=t(e),i.push([t,n]))}return n}(r,o);if(!i.setSource)return s.push(i),e(t,l,n,r,s,a);i.setSource(Object.assign({},t),(function(o,u){if(o)return e(t,l,n,r,s,a);s.push(i),e(u,t.type===u.type?l:Ui[u.type],n,r,s,a)}))}else l.length?e(t,l,n,r,s,a):a?n(t,s):e(t,Ui["*"],n,r,s,!0)}(t,Ui[t.type],i,e)),1)}(this,i[0],((e,n)=>{var r;if(this.middleware_=n,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_,n.forEach((e=>e.setTech&&e.setTech(r)))})),1<i.length){let e=()=>{this.error(null),this.handleSrc_(i.slice(1),!0)},t=()=>{this.off("error",e)};this.one("error",e),this.one("playing",t),this.resetRetryOnError_=()=>{this.off("error",e),this.off("playing",t)}}}else this.setTimeout((function(){this.error({code:4,message:this.options_.notSupportedMessage})}),0)}src(e){return this.handleSrc_(e,!1)}src_(e){var t=this.selectSource([e]);return!t||(st(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.techCall_("load")}reset(){this.paused()?this.doReset_():St(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_(),ze(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);var{currentTimeDisplay:e,durationDisplay:t,progressControl:i,remainingTimeDisplay:n}=this.controlBar||{},i=(i||{}).seekBar;e&&e.updateContent(),t&&t.updateContent(),n&&n.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):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.removeTechControlsListeners_()))}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(n("beforeerror").forEach((t=>{g(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_=e,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close()):(this.error_=new wt(e),this.addClass("vjs-error"),c.error(`(CODE:${this.error_.code} ${wt.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),n("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,n=je(this,this.reportUserActivity);function r(t){n(),this.clearInterval(e)}this.on("mousedown",(function(){n(),this.clearInterval(e),e=this.setInterval(n,250)})),this.on("mousemove",(function(e){e.screenX===t&&e.screenY===i||(t=e.screenX,i=e.screenY,n())})),this.on("mouseup",r),this.on("mouseleave",r);var s=this.getChild("controlBar");let a;!s||j||E||(s.on("mouseenter",(function(e){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0})),s.on("mouseleave",(function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout}))),this.on("keydown",n),this.on("keyup",n),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")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),ze(this))&&this.trigger("languagechange")}languages(){return v(dr.prototype.options_.languages,this.languages_)}toJSON(){var e=v(this.options_),t=e.tracks;e.tracks=[];for(let n=0;n<t.length;n++){var i=t[n];(i=v(i)).player=void 0,e.tracks[n]=i}return e}createModal(e,t){(t=t||{}).content=e||"";let i=new Ct(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 n=0;n<or.length;n++){var i=or[n];if(t<=this.breakpoints_[i]){if(e===i)return;e&&this.removeClass(lr[e]),this.addClass(lr[i]),this.breakpoint_=i;break}}}}removeCurrentBreakpoint_(){var e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)}breakpoints(e){return void 0!==e&&(this.breakpoint_="",this.breakpoints_=Object.assign({},ur,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 lr[this.breakpoint_]||""}loadMedia(e,t){var i,n,r,s,a,o;e&&"object"==typeof e&&(this.reset(),this.cache_.media=v(e),({artist:e,artwork:i,description:n,poster:r,src:s,textTracks:a,title:o}=this.cache_.media),!i&&r&&(this.cache_.media.artwork=[{src:r,type:zi(r)}]),s&&this.src(s),r&&this.poster(r),Array.isArray(a)&&a.forEach((e=>this.addRemoteTextTrack(e,!1))),this.titleBar&&this.titleBar.update({title:o,description:n||e||""}),this.ready(t))}getMedia(){var e,t;return this.cache_.media?v(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:zi(t.poster)}]),t)}static getTagSettings(e){var t,i={sources:[],tracks:[]},n=ee(e),r=n["data-setup"];if(K(e,"vjs-fill")&&(n.fill=!0),K(e,"vjs-fluid")&&(n.fluid=!0),null!==r&&([r,t]=function(e,t){var i,n=null;try{i=JSON.parse(e,t)}catch(e){n=e}return[n,i]}(r||"{}"),r&&c.error(r),Object.assign(n,t)),Object.assign(i,n),e.hasChildNodes()){var s=e.childNodes;for(let e=0,t=s.length;e<t;e++){var a=s[e],o=a.nodeName.toLowerCase();"source"===o?i.sources.push(ee(a)):"track"===o&&i.tracks.push(ee(a))}}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"))}}oi.names.forEach((function(e){let t=oi[e];dr.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}})),dr.prototype.crossorigin=dr.prototype.crossOrigin,dr.players={},Kn=window.navigator,dr.prototype.options_={techOrder:Ri.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:Kn&&(Kn.languages&&Kn.languages[0]||Kn.userLanguage||Kn.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){dr.prototype[e]=function(){return this.techGet_(e)}})),sr.forEach((function(e){dr.prototype[`handleTech${rt(e)}_`]=function(){return this.trigger(e)}})),dt.registerComponent("Player",dr);let cr="plugin",hr="activePlugins_",pr={},mr=e=>pr.hasOwnProperty(e),fr=e=>mr(e)?pr[e]:void 0,gr=(e,t)=>{e[hr]=e[hr]||{},e[hr][t]=!0},yr=(e,t,i)=>{i=(i?"before":"")+"pluginsetup",e.trigger(i,t),e.trigger(i+":"+t.name,t)},vr=(e,t)=>(t.prototype.name=e,function(...i){yr(this,{name:e,plugin:t,instance:null},!0);let n=new t(this,...i);return this[e]=()=>n,yr(this,n.getEventHash()),n});class _r{constructor(e){if(this.constructor===_r)throw Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),et(this),delete this.trigger,it(this,this.constructor.defaultState),gr(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 Ne(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[hr][e]=!1,this.player=this.state=null,t[e]=vr(e,pr[e])}static isBasic(e){return"function"==typeof(e="string"==typeof e?fr(e):e)&&!_r.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(mr(e))c.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(dr.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 pr[e]=t,e!==cr&&(_r.isBasic(t)?dr.prototype[e]=function(e,t){function i(){yr(this,{name:e,plugin:t,instance:null},!0);var i=t.apply(this,arguments);return gr(this,e),yr(this,{name:e,plugin:t,instance:i}),i}return Object.keys(t).forEach((function(e){i[e]=t[e]})),i}(e,t):dr.prototype[e]=vr(e,t)),t}static deregisterPlugin(e){if(e===cr)throw Error("Cannot de-register base plugin.");mr(e)&&(delete pr[e],delete dr.prototype[e])}static getPlugins(e=Object.keys(pr)){let t;return e.forEach((e=>{var i=fr(e);i&&((t=t||{})[e]=i)})),t}static getPluginVersion(e){return(e=fr(e))&&e.VERSION||""}}function br(e,t,i,n){{var r=t+` is deprecated and will be removed in ${e}.0; please use ${i} instead.`,s=n;let a=!1;return function(...e){return a||c.warn(r),a=!0,s.apply(this,e)}}}_r.getPlugin=fr,_r.BASE_PLUGIN_NAME=cr,_r.registerPlugin(cr,_r),dr.prototype.usingPlugin=function(e){return!!this[hr]&&!0===this[hr][e]},dr.prototype.hasPlugin=function(e){return!!mr(e)};let wr=e=>0===e.indexOf("#")?e.slice(1):e;function Tr(e,t,i){let r=Tr.getPlayer(e);if(r)t&&c.warn(`Player "${e}" is already initialised. Options will not be applied.`),i&&r.ready(i);else{let s="string"==typeof e?fe("#"+wr(e)):e;if(!V(s))throw TypeError("The element or ID supplied is not valid. (videojs)");s.ownerDocument.defaultView&&s.ownerDocument.body.contains(s)||c.warn("The element supplied is not included in the DOM"),!0===(t=t||{}).restoreEl&&(t.restoreEl=(s.parentNode&&s.parentNode.hasAttribute("data-vjs-player")?s.parentNode:s).cloneNode(!0)),n("beforesetup").forEach((e=>{!g(e=e(s,v(t)))||Array.isArray(e)?c.error("please return an object in beforesetup hooks"):t=v(t,e)})),r=new(e=dt.getComponent("Player"))(s,t,i),n("setup").forEach((e=>e(r)))}return r}Tr.hooks_=i,Tr.hooks=n,Tr.hook=function(e,t){n(e,t)},Tr.hookOnce=function(e,t){n(e,[].concat(t).map((t=>{let i=(...n)=>(r(e,i),t(...n));return i})))},Tr.removeHook=r,!0!==window.VIDEOJS_NO_DYNAMIC_STYLE&&H()&&!(Gn=fe(".vjs-styles-defaults"))&&(Gn=Ee("vjs-styles-defaults"),(Xn=fe("head"))&&Xn.insertBefore(Gn,Xn.firstChild),ke(Gn,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: 56.25%\n }\n ")),Te(1,Tr),Tr.VERSION=t,Tr.options=dr.prototype.options_,Tr.getPlayers=()=>dr.players,Tr.getPlayer=e=>{var t=dr.players;let i;if("string"==typeof e){var n,r;if(r=t[n=wr(e)])return r;i=fe("#"+n)}else i=e;if(V(i)){var{player:r,playerId:n}=i;if(r||t[n])return r||t[n]}},Tr.getAllPlayers=()=>Object.keys(dr.players).map((e=>dr.players[e])).filter(Boolean),Tr.players=dr.players,Tr.getComponent=dt.getComponent,Tr.registerComponent=(e,t)=>{Ri.isTech(t)&&c.warn(`The ${e} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),dt.registerComponent.call(dt,e,t)},Tr.getTech=Ri.getTech,Tr.registerTech=Ri.registerTech,Tr.use=function(e,t){Ui[e]=Ui[e]||[],Ui[e].push(t)},Object.defineProperty(Tr,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(Tr.middleware,"TERMINATOR",{value:ji,writeable:!1,enumerable:!0}),Tr.browser=B,Tr.obj=b,Tr.mergeOptions=br(9,"videojs.mergeOptions","videojs.obj.merge",v),Tr.defineLazyProperty=br(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",_),Tr.bind=br(9,"videojs.bind","native Function.prototype.bind",je),Tr.registerPlugin=_r.registerPlugin,Tr.deregisterPlugin=_r.deregisterPlugin,Tr.plugin=(e,t)=>(c.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),_r.registerPlugin(e,t)),Tr.getPlugins=_r.getPlugins,Tr.getPlugin=_r.getPlugin,Tr.getPluginVersion=_r.getPluginVersion,Tr.addLanguage=function(e,t){return e=(""+e).toLowerCase(),Tr.options.languages=v(Tr.options.languages,{[e]:t}),Tr.options.languages[e]},Tr.log=c,Tr.createLogger=h,Tr.time=_t,Tr.createTimeRange=br(9,"videojs.createTimeRange","videojs.time.createTimeRanges",pt),Tr.createTimeRanges=br(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",pt),Tr.formatTime=br(9,"videojs.formatTime","videojs.time.formatTime",vt),Tr.setFormatTime=br(9,"videojs.setFormatTime","videojs.time.setFormatTime",gt),Tr.resetFormatTime=br(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",yt),Tr.parseUrl=br(9,"videojs.parseUrl","videojs.url.parseUrl",Mt),Tr.isCrossOrigin=br(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",Rt),Tr.EventTarget=$e,Tr.any=Ue,Tr.on=De,Tr.one=Re,Tr.off=Me,Tr.trigger=Ne,Tr.xhr=Wt,Tr.TextTrack=ti,Tr.AudioTrack=ii,Tr.VideoTrack=ni,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach((e=>{Tr[e]=function(){return c.warn(`videojs.${e}() is deprecated; use videojs.dom.${e}() instead`),ve[e].apply(null,arguments)}})),Tr.computedStyle=br(9,"videojs.computedStyle","videojs.dom.computedStyle",ye),Tr.dom=ve,Tr.fn=He,Tr.num=zt,Tr.str=at,Tr.url=Bt,lt((function(e,t){/*! @name videojs-contrib-quality-levels @version 3.0.0 @license Apache-2.0 */e.exports=function(e){var t,i=(t=e)&&"object"==typeof t&&"default"in t?t:{default:t};class n{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}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;let i=this.levels_.length;return t=new n(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,n=this.length;i<n;i++)if(this[i]===e){t=this.levels_.splice(i,1)[0],this.selectedIndex_===i?this.selectedIndex_=-1:this.selectedIndex_>i&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,i=this.length;t<i;t++){let i=this[t];if(i.id===e)return i}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}}for(let e in r.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"},r.prototype.allowedEvents_)r.prototype["on"+e]=null;var s="3.0.0";let a=i.default.registerPlugin||i.default.plugin,o=function(e){return function(e,t){let i=e.qualityLevels,n=new r,a=function(){n.dispose(),e.qualityLevels=i,e.off("dispose",a)};return e.on("dispose",a),e.qualityLevels=()=>n,e.qualityLevels.VERSION=s,n}(this,i.default.mergeOptions({},e))};return a("qualityLevels",o),o.VERSION=s,o}(Tr)}));var Sr=lt((function(e,t){var i,n,r,s,a;i=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,n=/^(?=([^\/?#]*))\1([^]*)$/,r=/(?:\/|^)\.(?=\/)/g,s=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/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.");if(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=n.exec(t.path),t.netLoc=e[1],t.path=e[2]),t.netLoc&&!t.path&&(t.path="/");var s;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?(s=(s=t.path).substring(0,s.lastIndexOf("/")+1)+r.path,e.path=a.normalizePath(s)):(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(s,"")).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})),Er="http://example.com",kr=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,n=0;n<i;++n)t[n].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),s=t.length,a=0;a<s;++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 Cr(e){var t={};return(e=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""))[1]&&(t.length=parseInt(e[1],10)),e[2]&&(t.offset=parseInt(e[2],10)),t}function xr(e){var t={};if(e){var i,n=e.split(RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))'));let r=n.length;for(;r--;)""!==n[r]&&((i=/([^=]*)=(.*)/.exec(n[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 Ir(e){let t={};return Object.keys(e).forEach((function(i){t[i.toLowerCase().replace(/-(\w)/g,(e=>e[1].toUpperCase()))]=e[i]})),t}function Ar(e){var t,i,n,r,s,{serverControl:e,targetDuration:a,partTargetDuration:o}=e;e&&(t="#EXT-X-SERVER-CONTROL",i="holdBack",n="partHoldBack",r=a&&3*a,s=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(n)&&(e[n]=3*o,this.trigger("info",{message:t+` defaulting PART-HOLD-BACK to partTargetDuration * 3 (${e[n]}).`})),o)&&e[n]<s&&(this.trigger("warn",{message:t+` clamping PART-HOLD-BACK (${e[n]}) to partTargetDuration * 2 (${s}).`}),e[n]=s)}class Pr extends kr{constructor(){super(),this.lineStream=new/*! @name m3u8-parser @version 6.0.0 @license Apache-2.0 */class extends kr{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 extends kr{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=>{var n,r;for(let t=0;t<this.customParsers.length;t++)if(this.customParsers[t].call(this,e))return;0!==e.indexOf("#EXT")?this.trigger("data",{type:"comment",text:e.slice(1)}):(e=e.replace("\r",""),(t=/^#EXTM3U/.exec(e))?this.trigger("data",{type:"tag",tagType:"m3u"}):(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)):(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)):(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)):(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)):(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)):(t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(e))?(i={type:"tag",tagType:"playlist-type"},t[1]&&(i.playlistType=t[1]),this.trigger("data",i)):(t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(e))?(i=qt(Cr(t[1]),{type:"tag",tagType:"byterange"}),this.trigger("data",i)):(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)):(t=/^#EXT-X-MAP:(.*)$/.exec(e))?(i={type:"tag",tagType:"map"},t[1]&&((r=xr(t[1])).URI&&(i.uri=r.URI),r.BYTERANGE)&&(i.byterange=Cr(r.BYTERANGE)),this.trigger("data",i)):(t=/^#EXT-X-STREAM-INF:(.*)$/.exec(e))?(i={type:"tag",tagType:"stream-inf"},t[1]&&(i.attributes=xr(t[1]),i.attributes.RESOLUTION&&(r={},(n=i.attributes.RESOLUTION.split("x"))[0]&&(r.width=parseInt(n[0],10)),n[1]&&(r.height=parseInt(n[1],10)),i.attributes.RESOLUTION=r),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)):(t=/^#EXT-X-MEDIA:(.*)$/.exec(e))?(i={type:"tag",tagType:"media"},t[1]&&(i.attributes=xr(t[1])),this.trigger("data",i)):(t=/^#EXT-X-ENDLIST/.exec(e))?this.trigger("data",{type:"tag",tagType:"endlist"}):(t=/^#EXT-X-DISCONTINUITY/.exec(e))?this.trigger("data",{type:"tag",tagType:"discontinuity"}):(t=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(e))?(i={type:"tag",tagType:"program-date-time"},t[1]&&(i.dateTimeString=t[1],i.dateTimeObject=new Date(t[1])),this.trigger("data",i)):(t=/^#EXT-X-KEY:(.*)$/.exec(e))?(i={type:"tag",tagType:"key"},t[1]&&(i.attributes=xr(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)):(t=/^#EXT-X-START:(.*)$/.exec(e))?(i={type:"tag",tagType:"start"},t[1]&&(i.attributes=xr(t[1]),i.attributes["TIME-OFFSET"]=parseFloat(i.attributes["TIME-OFFSET"]),i.attributes.PRECISE=/YES/.test(i.attributes.PRECISE)),this.trigger("data",i)):(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)):(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)):(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)):(t=/^#EXT-X-SKIP:(.*)$/.exec(e))&&t[1]?((i={type:"tag",tagType:"skip"}).attributes=xr(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("\t")),this.trigger("data",i)):(t=/^#EXT-X-PART:(.*)$/.exec(e))&&t[1]?((i={type:"tag",tagType:"part"}).attributes=xr(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=Cr(i.attributes.BYTERANGE)),this.trigger("data",i)):(t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(e))&&t[1]?((i={type:"tag",tagType:"server-control"}).attributes=xr(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)):(t=/^#EXT-X-PART-INF:(.*)$/.exec(e))&&t[1]?((i={type:"tag",tagType:"part-inf"}).attributes=xr(t[1]),["PART-TARGET"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))})),this.trigger("data",i)):(t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(e))&&t[1]?((i={type:"tag",tagType:"preload-hint"}).attributes=xr(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)):(t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(e))&&t[1]?((i={type:"tag",tagType:"rendition-report"}).attributes=xr(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)):this.trigger("data",{type:"tag",data:e.slice(4)}))})))}addParser({expression:e,customType:t,dataParser:i,segment:n}){"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:n}),!0}))}addTagMapper({expression:e,map:t}){this.tagMappers.push((i=>e.test(i)?t(i):i))}},this.lineStream.pipe(this.parseStream);let e,t,i=this,n=[],r={},s=!1,a={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},o=0,l=(this.manifest={allowCache:!0,discontinuityStarts:[],segments:[]},0),u=0;this.on("end",(()=>{!r.uri&&(r.parts||r.preloadHints)&&(!r.map&&e&&(r.map=e),!r.key&&t&&(r.key=t),r.timeline||"number"!=typeof o||(r.timeline=o),this.manifest.preloadSegment=r)})),this.parseStream.on("data",(function(d){let c,h;({tag(){({version(){d.version&&(this.manifest.version=d.version)},"allow-cache"(){this.manifest.allowCache=d.allowed,"allowed"in d||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){var e={};"length"in d&&((r.byterange=e).length=d.length,"offset"in d||(d.offset=l)),"offset"in d&&((r.byterange=e).offset=d.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"})),0<d.duration&&(r.duration=d.duration),0===d.duration&&(r.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=n},key(){if(d.attributes)if("NONE"===d.attributes.METHOD)t=null;else if(d.attributes.URI)if("com.apple.streamingkeydelivery"===d.attributes.KEYFORMAT)this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:d.attributes};else if("com.microsoft.playready"===d.attributes.KEYFORMAT)this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:d.attributes.URI};else{if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===d.attributes.KEYFORMAT)return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(d.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===d.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==d.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):d.attributes.KEYID&&"0x"===d.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:d.attributes.KEYFORMAT,keyId:d.attributes.KEYID.substring(2)},pssh:function(e){for(var t=window.atob?window.atob(e):Buffer.from(e,"base64").toString("binary"),i=new Uint8Array(t.length),n=0;n<t.length;n++)i[n]=t.charCodeAt(n);return i}(d.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}));d.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),t={method:d.attributes.METHOD||"AES-128",uri:d.attributes.URI},void 0!==d.attributes.IV&&(t.iv=d.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(d.number)?this.manifest.mediaSequence=d.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+d.number})},"discontinuity-sequence"(){isFinite(d.number)?(this.manifest.discontinuitySequence=d.number,o=d.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+d.number})},"playlist-type"(){/VOD|EVENT/.test(d.playlistType)?this.manifest.playlistType=d.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+d.playlist})},map(){e={},d.uri&&(e.uri=d.uri),d.byterange&&(e.byterange=d.byterange),t&&(e.key=t)},"stream-inf"(){this.manifest.playlists=n,this.manifest.mediaGroups=this.manifest.mediaGroups||a,d.attributes?(r.attributes||(r.attributes={}),qt(r.attributes,d.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media(){var e;this.manifest.mediaGroups=this.manifest.mediaGroups||a,d.attributes&&d.attributes.TYPE&&d.attributes["GROUP-ID"]&&d.attributes.NAME?((e=this.manifest.mediaGroups[d.attributes.TYPE])[d.attributes["GROUP-ID"]]=e[d.attributes["GROUP-ID"]]||{},c=e[d.attributes["GROUP-ID"]],(h={default:/yes/i.test(d.attributes.DEFAULT)}).default?h.autoselect=!0:h.autoselect=/yes/i.test(d.attributes.AUTOSELECT),d.attributes.LANGUAGE&&(h.language=d.attributes.LANGUAGE),d.attributes.URI&&(h.uri=d.attributes.URI),d.attributes["INSTREAM-ID"]&&(h.instreamId=d.attributes["INSTREAM-ID"]),d.attributes.CHARACTERISTICS&&(h.characteristics=d.attributes.CHARACTERISTICS),d.attributes.FORCED&&(h.forced=/yes/i.test(d.attributes.FORCED)),c[d.attributes.NAME]=h):this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity(){o+=1,r.discontinuity=!0,this.manifest.discontinuityStarts.push(n.length)},"program-date-time"(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=d.dateTimeString,this.manifest.dateTimeObject=d.dateTimeObject),r.dateTimeString=d.dateTimeString,r.dateTimeObject=d.dateTimeObject},targetduration(){!isFinite(d.duration)||d.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+d.duration}):(this.manifest.targetDuration=d.duration,Ar.call(this,this.manifest))},start(){!d.attributes||isNaN(d.attributes["TIME-OFFSET"])?this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"}):this.manifest.start={timeOffset:d.attributes["TIME-OFFSET"],precise:d.attributes.PRECISE}},"cue-out"(){r.cueOut=d.data},"cue-out-cont"(){r.cueOutCont=d.data},"cue-in"(){r.cueIn=d.data},skip(){this.manifest.skip=Ir(d.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",d.attributes,["SKIPPED-SEGMENTS"])},part(){s=!0;var e=this.manifest.segments.length,t=Ir(d.attributes);r.parts=r.parts||[],r.parts.push(t),t.byterange&&(t.byterange.hasOwnProperty("offset")||(t.byterange.offset=u),u=t.byterange.offset+t.byterange.length),t=r.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${t} for segment #`+e,d.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(((e,t)=>{e.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${t} lacks required attribute(s): LAST-PART`})}))},"server-control"(){var e=this.manifest.serverControl=Ir(d.attributes);e.hasOwnProperty("canBlockReload")||(e.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),Ar.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=Ir(d.attributes),i=t.type&&"PART"===t.type,n=(r.preloadHints=r.preloadHints||[],r.preloadHints.push(t),!t.byterange||t.byterange.hasOwnProperty("offset")||(t.byterange.offset=i?u:0,i&&(u=t.byterange.offset+t.byterange.length)),r.preloadHints.length-1);if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${n} for segment #`+e,d.attributes,["TYPE","URI"]),t.type)for(let i=0;i<r.preloadHints.length-1;i++){var s=r.preloadHints[i];s.type&&s.type===t.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${n} for segment #${e} has the same TYPE ${t.type} as preload hint #`+i})}},"rendition-report"(){var e=Ir(d.attributes),t=(e=(this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(e),this.manifest.renditionReports.length-1),["LAST-MSN","URI"]);s&&t.push("LAST-PART"),this.warnOnMissingAttributes_("#EXT-X-RENDITION-REPORT #"+e,d.attributes,t)},"part-inf"(){this.manifest.partInf=Ir(d.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",d.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),Ar.call(this,this.manifest)}}[d.tagType]||function(){}).call(i)},uri(){r.uri=d.uri,n.push(r),!this.manifest.targetDuration||"duration"in r||(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),r.duration=this.manifest.targetDuration),t&&(r.key=t),r.timeline=o,e&&(r.map=e),u=0,r={}},comment(){},custom(){d.segment?(r.custom=r.custom||{},r.custom[d.customType]=d.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[d.customType]=d.data)}})[d.type].call(i)}))}warnOnMissingAttributes_(e,t,i){let n=[];i.forEach((function(e){t.hasOwnProperty(e)||n.push(e)})),n.length&&this.trigger("warn",{message:e+" lacks required attribute(s): "+n.join(", ")})}push(e){this.lineStream.push(e)}end(){this.lineStream.push("\n"),this.trigger("end")}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}}function Or(e){return Ur.audio.test((e=void 0===e?"":e).trim().toLowerCase())}function Lr(e){return void 0===e&&(e=""),window.MediaSource&&window.MediaSource.isTypeSupported&&window.MediaSource.isTypeSupported(Hr(e))||!1}function Dr(e){return(e=void 0===e?"":e).toLowerCase().split(",").every((function(e){e=e.trim();for(var t=0;t<jr.length;t++)if(Ur["muxer"+jr[t]].test(e))return!0;return!1}))}function Mr(e){return $r.test(e)?"hls":Wr.test(e)?"dash":"application/vnd.videojs.vhs+json"===e?"vhs-json":null}function Nr(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),n=0;n<e.length;n++)i[n]=e.charCodeAt(n);return i}function Rr(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,n=/^\/\//.test(e),r=!window.location&&!/\/\//i.test(e);return i?e=new window.URL(e,window.location||Jr):/\/\//i.test(e)||(e=Sr.buildAbsoluteURL(window.location&&window.location.href||"",e)),i?(i=new URL(t,e),r?i.href.slice(Jr.length):n?i.href.slice(i.protocol.length):i.href):Sr.buildAbsoluteURL(e,t)}var Ur={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^/},Br=["video","audio","text"],jr=["Video","Audio","Text"],Fr=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)}))},qr=function(e){e=(e=void 0===e?"":e).split(",");var t=[];return e.forEach((function(e){var i;e=e.trim(),Br.forEach((function(n){var r,s=Ur[n].exec(e.toLowerCase());!s||s.length<=1||(i=n,s=e.substring(0,s[1].length),r=e.replace(s,""),t.push({type:s,details:r,mediaType:n}))})),i||t.push({type:e,details:"",mediaType:"unknown"})})),t},Hr=function(e){var t,i,n;if(e&&"string"==typeof e)return i="video",1===(t=e.toLowerCase().split(",").map((function(e){return Fr(e.trim())}))).length&&Or(t[0])?i="audio":1===t.length&&(n=t[0],Ur.text.test((n=void 0===n?"":n).trim().toLowerCase()))&&(i="application"),n="mp4",t.every((function(e){return Ur.mp4.test(e)}))?n="mp4":t.every((function(e){return Ur.webm.test(e)}))?n="webm":t.every((function(e){return Ur.ogg.test(e)}))&&(n="ogg"),i+"/"+n+';codecs="'+e+'"'},Vr="mp4a.40.2",$r=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,Wr=/^application\/dash\+xml/i,zr=function(e){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},Gr=function(e){return e instanceof Uint8Array?e:(Array.isArray(e)||zr(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))},Xr=window.BigInt||Number,Kr=[Xr("0x1"),Xr("0x100"),Xr("0x10000"),Xr("0x1000000"),Xr("0x100000000"),Xr("0x10000000000"),Xr("0x1000000000000"),Xr("0x100000000000000"),Xr("0x10000000000000000")],Qr=(ot=new Uint16Array([65484]),255!==(ot=new Uint8Array(ot.buffer,ot.byteOffset,ot.byteLength))[0]&&ot[0],function(e,t){var i=void 0!==(i=(t=void 0===t?{}:t).signed)&&i,n=void 0!==(t=t.le)&&t;e=Gr(e),t=n?"reduce":"reduceRight",t=(e[t]||Array.prototype[t]).call(e,(function(t,i,r){return r=n?r:Math.abs(r+1-e.length),t+Xr(i)*Kr[r]}),Xr(0));return i&&(i=Kr[e.length]/Xr(2)-Xr(1))<(t=Xr(t))&&(t=(t=t-i-i)-Xr(2)),Number(t)}),Yr=function(e,t,i){var n,r=void 0===(n=(i=void 0===i?{}:i).offset)?0:n,s=void 0===(n=i.mask)?[]:n;e=Gr(e),i=(t=Gr(t)).every||Array.prototype.every;return t.length&&e.length-r>=t.length&&i.call(t,(function(t,i){return t===(s[i]?s[i]&e[r+i]:e[r+i])}))},Jr="http://example.com";function Zr(e,t){return(t=void 0===t?Object:t)&&"function"==typeof t.freeze?t.freeze(e):e}var es=Zr({HTML:"text/html",isHTML:function(e){return e===es.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),ts=Zr({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===ts.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"}),is={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 n=0;n<e.length;n++)if(Object.prototype.hasOwnProperty.call(e,n)){var r=e[n];if(t.call(void 0,r,n,e))return r}},freeze:Zr,MIME_TYPE:es,NAMESPACE:ts},ns=is.find,rs=is.NAMESPACE;function ss(e){return""!==e}function as(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function os(e){return e?Object.keys((e=e?e.split(/[\t\n\f\r ]+/).filter(ss):[]).reduce(as,{})):[]}function ls(e,t){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}function us(e,t){var i=e.prototype;function n(){}i instanceof t||(n.prototype=t.prototype,ls(i,n=new n),e.prototype=i=n),i.constructor!=e&&(i.constructor=e)}var ds,cs=((ds={}).ELEMENT_NODE=1,ds.ATTRIBUTE_NODE=2,ds.TEXT_NODE=3,ds.CDATA_SECTION_NODE=4,ds.ENTITY_REFERENCE_NODE=5,ds.ENTITY_NODE=6,ds.PROCESSING_INSTRUCTION_NODE=7,ds.COMMENT_NODE=8,ds.DOCUMENT_NODE=9,ds.DOCUMENT_TYPE_NODE=10,ds.DOCUMENT_FRAGMENT_NODE=11,ds.NOTATION_NODE=12,{}),hs={},ps=(cs.INDEX_SIZE_ERR=(hs[1]="Index size error",1),cs.DOMSTRING_SIZE_ERR=(hs[2]="DOMString size error",2),cs.HIERARCHY_REQUEST_ERR=(hs[3]="Hierarchy request error",3)),ms=(cs.WRONG_DOCUMENT_ERR=(hs[4]="Wrong document",4),cs.INVALID_CHARACTER_ERR=(hs[5]="Invalid character",5),cs.NO_DATA_ALLOWED_ERR=(hs[6]="No data allowed",6),cs.NO_MODIFICATION_ALLOWED_ERR=(hs[7]="No modification allowed",7),cs.NOT_FOUND_ERR=(hs[8]="Not found",8));function fs(e,t){var i;return t instanceof Error?i=t:(i=this,Error.call(this,hs[e]),this.message=hs[e],Error.captureStackTrace&&Error.captureStackTrace(this,fs)),i.code=e,t&&(this.message=this.message+": "+t),i}function gs(){}function ys(e,t){this._node=e,this._refresh=t,vs(this)}function vs(e){var t,i=e._node._inc||e._node.ownerDocument._inc;e._inc!=i&&(t=e._refresh(e._node),ia(e,"length",t.length),ls(t,e),e._inc=i)}function _s(){}function bs(e,t){for(var i=e.length;i--;)if(e[i]===t)return i}function ws(e,t,i,n){n?t[bs(t,n)]=i:t[t.length++]=i,e&&(t=(i.ownerElement=e).ownerDocument)&&(n&&Is(t,e,n),n=e,e=i,(i=t)&&i._inc++,e.namespaceURI===rs.XMLNS)&&(n._nsMap[e.prefix?e.localName:""]=e.value)}function Ts(e,t,i){var n=bs(t,i);if(!(0<=n))throw new fs(ms,Error(e.tagName+"@"+i));for(var r,s=t.length-1;n<s;)t[n]=t[++n];t.length=s,e&&(r=e.ownerDocument)&&(Is(r,e,i),i.ownerElement=null)}function Ss(){}function Es(){}function ks(e){return("<"==e?"&lt;":">"==e&&"&gt;")||("&"==e?"&amp;":'"'==e&&"&quot;")||"&#"+e.charCodeAt()+";"}function Cs(e,t){if(t(e))return 1;if(e=e.firstChild)do{if(Cs(e,t))return 1}while(e=e.nextSibling)}function xs(){this.ownerDocument=this}function Is(e,t,i){e&&e._inc++,i.namespaceURI===rs.XMLNS&&delete t._nsMap[i.prefix?i.localName:""]}function As(e,t,i){if(e&&e._inc){e._inc++;var n=t.childNodes;if(i)n[n.length++]=i;else{for(var r=t.firstChild,s=0;r;)r=(n[s++]=r).nextSibling;n.length=s,delete n[n.length]}}}function Ps(e,t){var i=t.previousSibling,n=t.nextSibling;return i?i.nextSibling=n:e.firstChild=n,n?n.previousSibling=i:e.lastChild=i,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,As(e.ownerDocument,e),t}function Os(e){return e&&e.nodeType===Es.DOCUMENT_TYPE_NODE}function Ls(e){return e&&e.nodeType===Es.ELEMENT_NODE}function Ds(e){return e&&e.nodeType===Es.TEXT_NODE}function Ms(e,t){var i;e=e.childNodes||[];if(!ns(e,Ls)&&!Os(t))return i=ns(e,Os),!(t&&i&&e.indexOf(i)>e.indexOf(t))}function Ns(e,t){var i;e=e.childNodes||[];if(!ns(e,(function(e){return Ls(e)&&e!==t})))return i=ns(e,Os),!(t&&i&&e.indexOf(i)>e.indexOf(t))}function Rs(e,t,i){var n=e.childNodes||[],r=t.childNodes||[];if(t.nodeType===Es.DOCUMENT_FRAGMENT_NODE){var s=r.filter(Ls);if(1<s.length||ns(r,Ds))throw new fs(ps,"More than one element or text in fragment");if(1===s.length&&!Ms(e,i))throw new fs(ps,"Element in fragment can not be inserted before doctype")}if(Ls(t)&&!Ms(e,i))throw new fs(ps,"Only one element can be added and only after doctype");if(Os(t)){if(ns(n,Os))throw new fs(ps,"Only one doctype is allowed");if(r=ns(n,Ls),i&&n.indexOf(r)<n.indexOf(i))throw new fs(ps,"Doctype can only be inserted before an element");if(!i&&r)throw new fs(ps,"Doctype can not be appended since element is present")}}function Us(e,t,i){var n=e.childNodes||[],r=t.childNodes||[];if(t.nodeType===Es.DOCUMENT_FRAGMENT_NODE){var s=r.filter(Ls);if(1<s.length||ns(r,Ds))throw new fs(ps,"More than one element or text in fragment");if(1===s.length&&!Ns(e,i))throw new fs(ps,"Element in fragment can not be inserted before doctype")}if(Ls(t)&&!Ns(e,i))throw new fs(ps,"Only one element can be added and only after doctype");if(Os(t)){if(ns(n,(function(e){return Os(e)&&e!==i})))throw new fs(ps,"Only one doctype is allowed");if(r=ns(n,Ls),i&&n.indexOf(r)<n.indexOf(i))throw new fs(ps,"Doctype can only be inserted before an element")}}function Bs(e,t,i,n){if(function(e,t,i){var n;if(!(n=e)||n.nodeType!==Es.DOCUMENT_NODE&&n.nodeType!==Es.DOCUMENT_FRAGMENT_NODE&&n.nodeType!==Es.ELEMENT_NODE)throw new fs(ps,"Unexpected parent node type "+e.nodeType);if(i&&i.parentNode!==e)throw new fs(ms,"child not in parent");if(!(n=t)||!(Ls(n)||Ds(n)||Os(n)||n.nodeType===Es.DOCUMENT_FRAGMENT_NODE||n.nodeType===Es.COMMENT_NODE||n.nodeType===Es.PROCESSING_INSTRUCTION_NODE)||Os(t)&&e.nodeType!==Es.DOCUMENT_NODE)throw new fs(ps,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)}(e,t,i),e.nodeType===Es.DOCUMENT_NODE&&(n||Rs)(e,t,i),(n=t.parentNode)&&n.removeChild(t),11===t.nodeType){var r=t.firstChild;if(null==r)return t;var s=t.lastChild}else r=s=t;for(n=i?i.previousSibling:e.lastChild,r.previousSibling=n,s.nextSibling=i,n?n.nextSibling=r:e.firstChild=r,null==i?e.lastChild=s:i.previousSibling=s;r.parentNode=e,r!==s&&(r=r.nextSibling););return As(e.ownerDocument||e,e),11==t.nodeType&&(t.firstChild=t.lastChild=null),t}function js(){this._nsMap={}}function Fs(){}function qs(){}function Hs(){}function Vs(){}function $s(){}function Ws(){}function zs(){}function Gs(){}function Xs(){}function Ks(){}function Qs(){}function Ys(){}function Js(e,t){var i,n=[],r=9==this.nodeType&&this.documentElement||this,s=r.prefix,a=r.namespaceURI;return ta(this,n,e,t,i=a&&null==s&&null==r.lookupPrefix(a)?[{namespace:a,prefix:null}]:i),n.join("")}function Zs(e,t,i){var n=e.prefix||"",r=e.namespaceURI;if(r&&("xml"!==n||r!==rs.XML)&&r!==rs.XMLNS){for(var s=i.length;s--;){var a=i[s];if(a.prefix===n)return a.namespace!==r}return 1}}function ea(e,t,i){e.push(" ",t,'="',i.replace(/[<>&"\t\n\r]/g,ks),'"')}function ta(e,t,i,n,r){if(r=r||[],n){if(!(e=n(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case 1:var s=e.attributes,a=s.length,o=e.firstChild,l=e.tagName,u=l;if(!(i=rs.isHTML(e.namespaceURI)||i)&&!e.prefix&&e.namespaceURI){for(var d,c=0;c<s.length;c++)if("xmlns"===s.item(c).name){d=s.item(c).value;break}if(!d)for(var h=r.length-1;0<=h;h--)if(""===(p=r[h]).prefix&&p.namespace===e.namespaceURI){d=p.namespace;break}if(d!==e.namespaceURI){var p;for(h=r.length-1;0<=h;h--)if((p=r[h]).namespace===e.namespaceURI){p.prefix&&(u=p.prefix+":"+l);break}}}t.push("<",u);for(var m=0;m<a;m++)"xmlns"==(f=s.item(m)).prefix?r.push({prefix:f.localName,namespace:f.value}):"xmlns"==f.nodeName&&r.push({prefix:"",namespace:f.value});var f,g,y;for(m=0;m<a;m++)Zs(f=s.item(m),0,r)&&(ea(t,(g=f.prefix||"")?"xmlns:"+g:"xmlns",y=f.namespaceURI),r.push({prefix:g,namespace:y})),ta(f,t,i,n,r);if(l===u&&Zs(e,0,r)&&(ea(t,(g=e.prefix||"")?"xmlns:"+g:"xmlns",y=e.namespaceURI),r.push({prefix:g,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):ta(o,t,i,n,r.slice()),o=o.nextSibling;else for(;o;)ta(o,t,i,n,r.slice()),o=o.nextSibling;t.push("</",u,">")}else t.push("/>");return;case 9:case 11:for(o=e.firstChild;o;)ta(o,t,i,n,r.slice()),o=o.nextSibling;return;case 2:return ea(t,e.name,e.value);case 3:return t.push(e.data.replace(/[<&>]/g,ks));case 4:return t.push("<![CDATA[",e.data,"]]>");case 8:return t.push("\x3c!--",e.data,"--\x3e");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 ia(e,t,i){e[t]=i}cs.NOT_SUPPORTED_ERR=(hs[9]="Not supported",9),cs.INUSE_ATTRIBUTE_ERR=(hs[10]="Attribute in use",10),cs.INVALID_STATE_ERR=(hs[11]="Invalid state",11),cs.SYNTAX_ERR=(hs[12]="Syntax error",12),cs.INVALID_MODIFICATION_ERR=(hs[13]="Invalid modification",13),cs.NAMESPACE_ERR=(hs[14]="Invalid namespace",14),cs.INVALID_ACCESS_ERR=(hs[15]="Invalid access",15),fs.prototype=Error.prototype,ls(cs,fs),gs.prototype={length:0,item:function(e){return this[e]||null},toString:function(e,t){for(var i=[],n=0;n<this.length;n++)ta(this[n],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)}},ys.prototype.item=function(e){return vs(this),this[e]},us(ys,gs),_s.prototype={length:0,item:gs.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 fs(10);return t=this.getNamedItem(e.nodeName),ws(this._ownerElement,this,e,t),t},setNamedItemNS:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new fs(10);return t=this.getNamedItemNS(e.namespaceURI,e.localName),ws(this._ownerElement,this,e,t),t},removeNamedItem:function(e){return e=this.getNamedItem(e),Ts(this._ownerElement,this,e),e},removeNamedItemNS:function(e,t){return e=this.getNamedItemNS(e,t),Ts(this._ownerElement,this,e),e},getNamedItemNS:function(e,t){for(var i=this.length;i--;){var n=this[i];if(n.localName==t&&n.namespaceURI==e)return n}return null}},Ss.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,i){var n=new xs;return n.implementation=this,n.childNodes=new gs,n.doctype=i||null,i&&n.appendChild(i),t&&(i=n.createElementNS(e,t),n.appendChild(i)),n},createDocumentType:function(e,t,i){var n=new Ws;return n.name=e,n.nodeName=e,n.publicId=t||"",n.systemId=i||"",n}},Es.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 Bs(this,e,t)},replaceChild:function(e,t){Bs(this,e,t,Us),t&&this.removeChild(t)},removeChild:function(e){return Ps(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return function e(t,i,n){var r,s=new i.constructor;for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&"object"!=typeof(r=i[a])&&r!=s[a]&&(s[a]=r);switch(i.childNodes&&(s.childNodes=new gs),s.ownerDocument=t,s.nodeType){case 1:var o=i.attributes,l=s.attributes=new _s,u=o.length;l._ownerElement=s;for(var d=0;d<u;d++)s.setAttributeNode(e(t,o.item(d),!0));break;case 2:n=!0}if(n)for(var c=i.firstChild;c;)s.appendChild(e(t,c,n)),c=c.nextSibling;return s}(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 n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&i[n]===e)return n;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)}},ls(ds,Es),ls(ds,Es.prototype),xs.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 n=i.nextSibling;this.insertBefore(i,t),i=n}else Bs(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),Ps(this,e)},replaceChild:function(e,t){Bs(this,e,t,Us),e.ownerDocument=this,t&&this.removeChild(t),Ls(e)&&(this.documentElement=e)},importNode:function(e,t){return function e(t,i,n){var r;switch(i.nodeType){case 1:(r=i.cloneNode(!1)).ownerDocument=t;case 11:break;case 2:n=!0}if((r=r||i.cloneNode(!1)).ownerDocument=t,r.parentNode=null,n)for(var s=i.firstChild;s;)r.appendChild(e(t,s,n)),s=s.nextSibling;return r}(this,e,t)},getElementById:function(e){var t=null;return Cs(this.documentElement,(function(i){if(1==i.nodeType&&i.getAttribute("id")==e)return t=i,!0})),t},getElementsByClassName:function(e){var t=os(e);return new ys(this,(function(i){var n=[];return 0<t.length&&Cs(i.documentElement,(function(r){var s,a,o;r!==i&&1===r.nodeType&&(s=r.getAttribute("class"))&&((a=e===s)||(s=os(s),a=t.every((o=s,function(e){return o&&-1!==o.indexOf(e)}))),a)&&n.push(r)})),n}))},createElement:function(e){var t=new js;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new gs,(t.attributes=new _s)._ownerElement=t},createDocumentFragment:function(){var e=new Ks;return e.ownerDocument=this,e.childNodes=new gs,e},createTextNode:function(e){var t=new Hs;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new Vs;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new $s;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var i=new Qs;return i.ownerDocument=this,i.tagName=i.target=e,i.nodeValue=i.data=t,i},createAttribute:function(e){var t=new Fs;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new Xs;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var i=new js,n=t.split(":"),r=i.attributes=new _s;return i.childNodes=new gs,i.ownerDocument=this,i.nodeName=t,i.tagName=t,i.namespaceURI=e,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,r._ownerElement=i},createAttributeNS:function(e,t){var i=new Fs,n=t.split(":");return i.ownerDocument=this,i.nodeName=t,i.name=t,i.namespaceURI=e,i.specified=!0,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,i}},us(xs,Es),xs.prototype.getElementsByTagName=(js.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.lastChild=e,As(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 ys(this,(function(t){var i=[];return Cs(t,(function(n){n===t||1!=n.nodeType||"*"!==e&&n.tagName!=e||i.push(n)})),i}))},getElementsByTagNameNS:function(e,t){return new ys(this,(function(i){var n=[];return Cs(i,(function(r){r===i||1!==r.nodeType||"*"!==e&&r.namespaceURI!==e||"*"!==t&&r.localName!=t||n.push(r)})),n}))}}).getElementsByTagName,xs.prototype.getElementsByTagNameNS=js.prototype.getElementsByTagNameNS,us(js,Es),Fs.prototype.nodeType=2,us(Fs,Es),qs.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(hs[ps])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,i){var n=this.data.substring(0,e);e=this.data.substring(e+t);this.nodeValue=this.data=i=n+i+e,this.length=i.length}},us(qs,Es),Hs.prototype={nodeName:"#text",nodeType:3,splitText:function(e){var t=(i=this.data).substring(e),i=i.substring(0,e);this.data=this.nodeValue=i,this.length=i.length,e=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling),e}},us(Hs,qs),Vs.prototype={nodeName:"#comment",nodeType:8},us(Vs,qs),$s.prototype={nodeName:"#cdata-section",nodeType:4},us($s,qs),Ws.prototype.nodeType=10,us(Ws,Es),zs.prototype.nodeType=12,us(zs,Es),Gs.prototype.nodeType=6,us(Gs,Es),Xs.prototype.nodeType=5,us(Xs,Es),Ks.prototype.nodeName="#document-fragment",Ks.prototype.nodeType=11,us(Ks,Es),Qs.prototype.nodeType=7,us(Qs,Es),Ys.prototype.serializeToString=function(e,t,i){return Js.call(e,t,i)},Es.prototype.toString=Js;try{Object.defineProperty&&(Object.defineProperty(ys.prototype,"length",{get:function(){return vs(this),this.$$length}}),Object.defineProperty(Es.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}}}),ia=function(e,t,i){e["$$"+t]=i})}catch(e){}var na={DocumentType:Ws,DOMException:fs,DOMImplementation:Ss,Element:js,Node:Es,NodeList:gs,XMLSerializer:Ys},ra=lt((function(e,t){var i=is.freeze;t.XML_ENTITIES=i({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),t.HTML_ENTITIES=i({lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",times:"×",divide:"÷",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"",lowast:"",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"",cap:"∩",cup:"",int:"∫",there4:"∴",sim:"",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",ensp:"",emsp:"",thinsp:"",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"",mdash:"—",lsquo:"",rsquo:"",sbquo:"",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"",Prime:"″",lsaquo:"",rsaquo:"",oline:"‾",euro:"€",trade:"™",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}),t.entityMap=t.HTML_ENTITIES})),sa=(ra.XML_ENTITIES,ra.HTML_ENTITIES,ra.entityMap,is.NAMESPACE),aa=/[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]/,oa=RegExp("[\\-\\.0-9"+aa.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),la=RegExp("^"+aa.source+oa.source+"*(?::"+aa.source+oa.source+"*)?$");function ua(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,ua)}function da(){}function ca(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function ha(e,t,i){for(var n=e.tagName,r=null,s=e.length;s--;){var a=e[s],o=a.qName,l=a.value;o=0<(d=o.indexOf(":"))?(u=a.prefix=o.slice(0,d),c=o.slice(d+1),"xmlns"===u&&c):(u=null,"xmlns"===(c=o)&&"");a.localName=c,!1!==o&&(null==r&&(r={},pa(i,i={})),i[o]=r[o]=l,a.uri=sa.XMLNS,t.startPrefixMapping(o,l))}var u;for(s=e.length;s--;)(u=(a=e[s]).prefix)&&("xml"===u&&(a.uri=sa.XML),"xmlns"!==u)&&(a.uri=i[u||""]);var d,c=0<(d=n.indexOf(":"))?(u=e.prefix=n.slice(0,d),e.localName=n.slice(d+1)):(u=null,e.localName=n),h=e.uri=i[u||""];if(t.startElement(h,c,n,e),!e.closed)return e.currentNSMap=i,e.localNSMap=r,1;if(t.endElement(h,c,n),r)for(u in r)Object.prototype.hasOwnProperty.call(r,u)&&t.endPrefixMapping(u)}function pa(e,t){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}function ma(){this.attributeNames={}}(ua.prototype=Error()).name=ua.name,da.prototype={parse:function(e,t,i){var n=this.domBuilder;n.startDocument(),pa(t,t={}),function(e,t,i,n,r){function s(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)>>10),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,s),c&&o(m),n.characters(i,0,t-m),m=t)}function o(t,i){for(;u<=t&&(i=d.exec(e));)u=(l=i.index)+i[0].length,c.lineNumber++;c.columnNumber=t-l+1}for(var l=0,u=0,d=/.*(?:\r\n?|\n)|.*$/g,c=n.locator,h=[{currentNSMap:t}],p={},m=0;;){try{var f,g,y=e.indexOf("<",m);if(y<0)return e.substr(m).match(/^\s*$/)||(g=(f=n.doc).createTextNode(e.substr(m)),f.appendChild(g),n.currentElement=g);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,""),b=h.pop(),w=(v<0?(_=e.substring(y+2).replace(/[\s<].*/,""),r.error("end tag name: "+_+" is not complete:"+b.tagName),v=y+1+_.length):_.match(/\s</)&&(_=_.replace(/[\s<].*/,""),r.error("end tag name: "+_+" maybe not complete"),v=y+1+_.length),b.localNSMap),T=b.tagName==_;if(T||b.tagName&&b.tagName.toLowerCase()==_.toLowerCase()){if(n.endElement(b.uri,b.localName,_),w)for(var S in w)Object.prototype.hasOwnProperty.call(w,S)&&n.endPrefixMapping(S);T||r.fatalError("end tag name: "+_+" is not match the current start tagName:"+b.tagName)}else h.push(b);v++;break;case"?":c&&o(y),v=function(e,t,i){var n=e.indexOf("?>",t);return n&&(e=e.substring(t,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/))?(e[0].length,i.processingInstruction(e[1],e[2]),n+2):-1}(e,y,n);break;case"!":c&&o(y),v=function(e,t,i,n){if("-"===e.charAt(t+2))return"-"===e.charAt(t+3)?t<(s=e.indexOf("--\x3e",t+4))?(i.comment(e,t+4,s-t-4),s+3):(n.error("Unclosed comment"),-1):-1;if("CDATA["==e.substr(t+3,6))return s=e.indexOf("]]>",t+9),i.startCDATA(),i.characters(e,t+9,s-t-9),i.endCDATA(),s+3;n=function(e,t){var i,n=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(r.lastIndex=t,r.exec(e);i=r.exec(e);)if(n.push(i),i[1])return n}(e,t);var r,s=n.length;return 1<s&&/!doctype/i.test(n[0][0])?(e=n[1][0],r=t=!1,3<s&&(/^public$/i.test(n[2][0])?(t=n[3][0],r=4<s&&n[4][0]):/^system$/i.test(n[2][0])&&(r=n[3][0])),n=n[s-1],i.startDTD(e,t,r),i.endDTD(),n.index+n[0].length):-1}(e,y,n,r);break;default:c&&o(y);var E=new ma,k=h[h.length-1].currentNSMap,C=(v=function(e,t,i,n,r,s){function a(e,t,n){i.attributeNames.hasOwnProperty(e)&&s.fatalError("Attribute "+e+" redefined"),i.addValue(e,t.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,r),n)}for(var o,l=++t,u=0;;){var d=e.charAt(l);switch(d){case"=":if(1===u)o=e.slice(t,l);else if(2!==u)throw Error("attribute equal must after attrName");u=3;break;case"'":case'"':if(3===u||1===u){if(1===u&&(s.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");a(o,c=e.slice(t,l),t-1)}else{if(4!=u)throw Error('attribute value must after "="');a(o,c=e.slice(t,l),t),s.warning('attribute "'+o+'" missed start quot('+d+")!!"),t=l+1}u=5;break;case"/":switch(u){case 0:i.setTagName(e.slice(t,l));case 5:case 6:case 7:u=7,i.closed=!0;case 4:case 1:case 2:break;default:throw Error("attribute invalid close char('/')")}break;case"":return s.error("unexpected end of input"),0==u&&i.setTagName(e.slice(t,l)),l;case">":switch(u){case 0:i.setTagName(e.slice(t,l));case 5:case 6:case 7:break;case 4:case 1:"/"===(c=e.slice(t,l)).slice(-1)&&(i.closed=!0,c=c.slice(0,-1));case 2:2===u&&(c=o),4==u?(s.warning('attribute "'+c+'" missed quot(")!'),a(o,c,t)):(sa.isHTML(n[""])&&c.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+c+'" missed value!! "'+c+'" instead!!'),a(c,c,t));break;case 3:throw Error("attribute value missed!!")}return l;case"€":d=" ";default:if(d<=" ")switch(u){case 0:i.setTagName(e.slice(t,l)),u=6;break;case 1:o=e.slice(t,l),u=2;break;case 4:var c=e.slice(t,l);s.warning('attribute "'+c+'" missed quot(")!!'),a(o,c,t);case 5:u=6}else switch(u){case 2:i.tagName,sa.isHTML(n[""])&&o.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),a(o,o,t),t=l,u=1;break;case 5:s.warning('attribute space is required"'+o+'"!!');case 6:u=1,t=l;break;case 3:u=4,t=l;break;case 7:throw Error("elements closed character '/' and '>' must be connected to")}}l++}}(e,y,E,k,s,r),E.length);if(!E.closed&&function(e,t,i,n){var r=n[i];return null==r&&((r=e.lastIndexOf("</"+i+">"))<t&&(r=e.lastIndexOf("</"+i)),n[i]=r),r<t}(e,v,E.tagName,p)&&(E.closed=!0,i.nbsp||r.warning("unclosed xml attribute")),c&&C){for(var x=ca(c,{}),I=0;I<C;I++){var A=E[I];o(A.offset),A.locator=ca(c,{})}n.locator=x,ha(E,n,k)&&h.push(E),n.locator=c}else ha(E,n,k)&&h.push(E);sa.isHTML(E.uri)&&!E.closed?v=function(e,t,i,n,r){if(/^(?:script|textarea)$/i.test(i)){var s=e.indexOf("</"+i+">",t);e=e.substring(t+1,s);if(/[&<]/.test(e))return/^script$/i.test(i)||(e=e.replace(/&#?\w+;/g,n)),r.characters(e,0,e.length),s}return t+1}(e,v,E.tagName,s,n):v++}}catch(e){if(e instanceof ua)throw e;r.error("element parse error: "+e),v=-1}m<v?m=v:a(Math.max(y,m)+1)}}(e,t,i,n,this.errorHandler),n.endDocument()}},ma.prototype={setTagName:function(e){if(!la.test(e))throw Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,i){if(!la.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 fa={XMLReader:da,ParseError:ua},ga=na.DOMImplementation,ya=is.NAMESPACE,va=fa.ParseError,_a=fa.XMLReader;function ba(e){return e.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function wa(e){this.options=e||{locator:{}}}function Ta(){this.cdata=!1}function Sa(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function Ea(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 ka(e,t){(e.currentElement||e.doc).appendChild(t)}wa.prototype.parseFromString=function(e,t){var i=this.options,n=new _a,r=i.domBuilder||new Ta,s=i.errorHandler,a=i.locator,o=i.xmlns||{},l=(t=/\/x?html?$/.test(t))?ra.HTML_ENTITIES:ra.XML_ENTITIES;a&&r.setDocumentLocator(a),n.errorHandler=function(e,t,i){if(!e){if(t instanceof Ta)return t;e=t}var n={},r=e instanceof Function;function s(t){var s=e[t];!s&&r&&(s=2==e.length?function(i){e(t,i)}:e),n[t]=s?function(e){s("[xmldom "+t+"]\t"+e+function(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}(i))}:function(){}}return i=i||{},s("warning"),s("error"),s("fatalError"),n}(s,r,a),n.domBuilder=i.domBuilder||r,t&&(o[""]=ya.HTML),o.xml=o.xml||ya.XML,s=i.normalizeLineEndings||ba;return e&&"string"==typeof e?n.parse(s(e),o,l):n.errorHandler.error("invalid doc source"),r.doc},Ta.prototype={startDocument:function(){this.doc=(new ga).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,i,n){var r=this.doc,s=r.createElementNS(e,i||t),a=n.length;ka(this,s),this.currentElement=s,this.locator&&Sa(this.locator,s);for(var o=0;o<a;o++){e=n.getURI(o);var l=n.getValue(o),u=(i=n.getQName(o),r.createAttributeNS(e,i));this.locator&&Sa(n.getLocator(o),u),u.value=u.nodeValue=l,s.setAttributeNode(u)}},endElement:function(e,t,i){var n=this.currentElement;n.tagName,this.currentElement=n.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){e=this.doc.createProcessingInstruction(e,t),this.locator&&Sa(this.locator,e),ka(this,e)},ignorableWhitespace:function(e,t,i){},characters:function(e,t,i){var n;(e=Ea.apply(this,arguments))&&(n=this.cdata?this.doc.createCDATASection(e):this.doc.createTextNode(e),this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(e)&&this.doc.appendChild(n),this.locator)&&Sa(this.locator,n)},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,i){e=Ea.apply(this,arguments),e=this.doc.createComment(e),this.locator&&Sa(this.locator,e),ka(this,e)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,i){var n=this.doc.implementation;n&&n.createDocumentType&&(n=n.createDocumentType(e,t,i),this.locator&&Sa(this.locator,n),ka(this,n),this.doc.doctype=n)},warning:function(e){},error:function(e){},fatalError:function(e){throw new va(e,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(e){Ta.prototype[e]=function(){return null}}));var Ca=wa;/*! @name mpd-parser @version 1.0.1 @license Apache-2.0 */let xa=e=>!!e&&"object"==typeof e,Ia=(...e)=>e.reduce(((e,t)=>("object"==typeof t&&Object.keys(t).forEach((i=>{Array.isArray(e[i])&&Array.isArray(t[i])?e[i]=e[i].concat(t[i]):xa(e[i])&&xa(t[i])?e[i]=Ia(e[i],t[i]):e[i]=t[i]})),e)),{}),Aa=e=>Object.keys(e).map((t=>e[t])),Pa=e=>e.reduce(((e,t)=>e.concat(t)),[]),Oa=e=>{if(!e.length)return[];var t=[];for(let i=0;i<e.length;i++)t.push(e[i]);return t};var La="INVALID_NUMBER_OF_PERIOD",Da="DASH_EMPTY_MANIFEST",Ma="DASH_INVALID_XML",Na="NO_BASE_URL",Ra="SEGMENT_TIME_UNSPECIFIED",Ua="UNSUPPORTED_UTC_TIMING_SCHEME";let Ba=({baseUrl:e="",source:t="",range:i="",indexRange:n=""})=>{if(e={uri:t,resolvedUri:Rr(e||"",t)},i||n){t=(i||n).split("-");let r,s=window.BigInt?window.BigInt(t[0]):parseInt(t[0],10),a=window.BigInt?window.BigInt(t[1]):parseInt(t[1],10);s<Number.MAX_SAFE_INTEGER&&"bigint"==typeof s&&(s=Number(s)),a<Number.MAX_SAFE_INTEGER&&"bigint"==typeof a&&(a=Number(a)),"bigint"==typeof(r="bigint"==typeof a||"bigint"==typeof s?window.BigInt(a)-window.BigInt(s)+window.BigInt(1):a-s+1)&&r<Number.MAX_SAFE_INTEGER&&(r=Number(r)),e.byterange={length:r,offset:s}}return e},ja=e=>(e&&"number"!=typeof e&&(e=parseInt(e,10)),isNaN(e)?null:e),Fa={static(e){var{duration:t,timescale:i=1,sourceDuration:n,periodDuration:r}=e,t=t/i;return"number"==typeof(e=ja(e.endNumber))?{start:0,end:e}:"number"==typeof r?{start:0,end:r/t}:{start:0,end:n/t}},dynamic(e){var{NOW:t,clientOffset:i,availabilityStartTime:n,timescale:r=1,duration:s,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:l=1/0}=e,t=(e=ja(e.endNumber),(t+i)/1e3),i=n+a,n=Math.ceil((t+o-i)*r/s),a=Math.floor((t-i-l)*r/s),o=Math.floor((t-i)*r/s);return{start:Math.max(0,a),end:"number"==typeof e?e:Math.min(n,o)}}},qa=e=>{var t,{type:i,duration:n,timescale:r=1,periodDuration:s,sourceDuration:a}=e,{start:o,end:l}=Fa[i](e),o=((e,t)=>{var i=[];for(let n=e;n<t;n++)i.push(n);return i})(o,l).map((t=e,e=>{var{duration:i,timescale:n=1,periodStart:r,startNumber:s=1}=t;return{number:s+e,duration:i/n,timeline:r,time:e*i}}));return"static"===i&&(o[l=o.length-1].duration=("number"==typeof s?s:a)-n/r*l),o},Ha=e=>{var{baseUrl:t,initialization:i={},sourceDuration:n,indexRange:r="",periodStart:s,presentationTime:a,number:o=0,duration:l}=e;if(t)return i=Ba({baseUrl:t,source:i.sourceURL,range:i.range}),(t=Ba({baseUrl:t,source:t,indexRange:r})).map=i,l?(r=qa(e)).length&&(t.duration=r[0].duration,t.timeline=r[0].timeline):n&&(t.duration=n,t.timeline=s),t.presentationTime=a||s,t.number=o,[t];throw Error(Na)},Va=(e,t,i)=>{var n=e.sidx.map||null,r=e.sidx.duration,s=e.timeline||0,a=(a=e.sidx.byterange).offset+a.length,o=t.timescale,l=t.references.filter((e=>1!==e.referenceType)),u=[],d=e.endList?"static":"dynamic",c=e.sidx.timeline;let h,p=c,m=e.mediaSequence||0;h="bigint"==typeof t.firstOffset?window.BigInt(a)+t.firstOffset:a+t.firstOffset;for(let e=0;e<l.length;e++){var f=(g=t.references[e]).referencedSize,g=g.subsegmentDuration;let a;a="bigint"==typeof h?h+window.BigInt(f)-window.BigInt(1):h+f-1;var y=Ha(y={baseUrl:i,timescale:o,timeline:s,periodStart:c,presentationTime:p,number:m,duration:g,sourceDuration:r,indexRange:y=h+"-"+a,type:d})[0];n&&(y.map=n),u.push(y),h+="bigint"==typeof h?window.BigInt(f):f,p+=g/o,m++}return e.segments=u,e},$a=["AUDIO","SUBTITLES"],Wa=e=>{var t;return t=({timeline:e})=>e,Aa(e.reduce(((e,i)=>(i.forEach((i=>{e[t(i)]=i})),e)),{})).sort(((e,t)=>e.timeline>t.timeline?1:-1))},za=e=>{var t,i;let n=[];return t=e,i=(e,t,i,r)=>{n=n.concat(e.playlists||[])},(e=$a).forEach((function(e){for(var n in t.mediaGroups[e])for(var r in t.mediaGroups[e][n])i(t.mediaGroups[e][n][r])})),n},Ga=({playlist:e,mediaSequence:t})=>{e.mediaSequence=t,e.segments.forEach(((t,i)=>{t.number=e.mediaSequence+i}))},Xa=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)},Ka=e=>Aa(e.reduce(((e,t)=>{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}),{})).map((e=>{var t;return e.discontinuityStarts=(t=e.segments||[],t.reduce(((e,t,i)=>(t.discontinuity&&e.push(i),e)),[])),e})),Qa=(e,t)=>{var i=Xa(e.sidx);return(t=i&&t[i]&&t[i].sidx)&&Va(e,t,e.sidx.resolvedUri),e},Ya=({attributes:e,segments:t,sidx:i,discontinuityStarts:n})=>(n={attributes:{NAME:e.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:e.width,height:e.height},CODECS:e.codecs,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1},uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:"",targetDuration:e.duration,discontinuityStarts:n,timelineStarts:e.timelineStarts,segments:t},e.frameRate&&(n.attributes["FRAME-RATE"]=e.frameRate),e.contentProtection&&(n.contentProtection=e.contentProtection),i&&(n.sidx=i),n),Ja=({attributes:e})=>"video/mp4"===e.mimeType||"video/webm"===e.mimeType||"video"===e.contentType,Za=({attributes:e})=>"audio/mp4"===e.mimeType||"audio/webm"===e.mimeType||"audio"===e.contentType,eo=({attributes:e})=>"text/vtt"===e.mimeType||"text"===e.contentType,to=e=>e?Object.keys(e).reduce(((t,i)=>(i=e[i],t.concat(i.playlists))),[]):[],io=({dashPlaylists:e,locations:t,sidxMapping:i={},previousManifest:n})=>{var r,s,a,o,l,u,d,c;return e.length?(({sourceDuration:a,type:l,suggestedPresentationDelay:u,minimumUpdatePeriod:o}=e[0].attributes),r=Ka(e.filter(Ja)).map(Ya),d=Ka(e.filter(Za)),s=Ka(e.filter(eo)),e=e.map((e=>e.attributes.captionServices)).filter(Boolean),a={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:((e,t={})=>{if(Object.keys(t).length)for(let i in e)e[i]=Qa(e[i],t);return e})(r,i)},0<=o&&(a.minimumUpdatePeriod=1e3*o),t&&(a.locations=t),"dynamic"===l&&(a.suggestedPresentationDelay=u),o=0===a.playlists.length,t=d.length?((e,t={},i)=>{let n;return e=e.reduce(((e,r)=>{var s=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+(s?` (${s})`:""):o]||(e[o]={language:a,autoselect:!0,default:"main"===s,playlists:[],uri:""}),a=Qa((({attributes:e,segments:t,sidx:i,mediaSequence:n,discontinuitySequence:r,discontinuityStarts:s},a)=>(r={attributes:{NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs,"PROGRAM-ID":1},uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:"",targetDuration:e.duration,discontinuitySequence:r,discontinuityStarts:s,timelineStarts:e.timelineStarts,mediaSequence:n,segments:t},e.contentProtection&&(r.contentProtection=e.contentProtection),i&&(r.sidx=i),a&&(r.attributes.AUDIO="audio",r.attributes.SUBTITLES="subs"),r))(r,i),t),e[o].playlists.push(a),void 0===n&&"main"===s&&((n=r).default=!0),e}),{}),n||(e[Object.keys(e)[0]].default=!0),e})(d,i,o):null,l=s.length?((e,t={})=>e.reduce(((e,i)=>{var n,r,s,a,o=i.attributes.lang||"text";return e[o]||(e[o]={language:o,default:!1,autoselect:!1,playlists:[],uri:""}),e[o].playlists.push(Qa((({attributes:o,segments:i,mediaSequence:n,discontinuityStarts:r,discontinuitySequence:s}=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),{attributes:a,uri:"",endList:"static"===o.type,timeline:o.periodStart,resolvedUri:o.baseUrl||"",targetDuration:o.duration,timelineStarts:o.timelineStarts,discontinuityStarts:r,discontinuitySequence:s,mediaSequence:n,segments:i}),t)),e}),{}))(s,i):null,d=(u=r.concat(to(t),to(l))).map((({timelineStarts:e})=>e)),a.timelineStarts=Wa(d),c=a.timelineStarts,u.forEach((e=>{e.mediaSequence=0,e.discontinuitySequence=c.findIndex((function({timeline:t}){return t===e.timeline})),e.segments&&e.segments.forEach(((e,t)=>{e.number=t}))})),t&&(a.mediaGroups.AUDIO.audio=t),l&&(a.mediaGroups.SUBTITLES.subs=l),e.length&&(a.mediaGroups["CLOSED-CAPTIONS"].cc=e.reduce(((e,t)=>(t&&t.forEach((t=>{var{channel:i,language:n}=t;e[n]={autoselect:!1,default:!1,instreamId:i,language:n},t.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=t.aspectRatio),t.hasOwnProperty("easyReader")&&(e[n].easyReader=t.easyReader),t.hasOwnProperty("3D")&&(e[n]["3D"]=t["3D"])})),e)),{})),n?(({oldManifest:e,newManifest:t})=>{var i,n,r=e.playlists.concat(za(e)),s=t.playlists.concat(za(t));return t.timelineStarts=Wa([e.timelineStarts,t.timelineStarts]),({oldPlaylists:i,newPlaylists:e,timelineStarts:n}={oldPlaylists:r,newPlaylists:s,timelineStarts:t.timelineStarts}),e.forEach((e=>{e.discontinuitySequence=n.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 i=e.segments[0];var r=t.segments.findIndex((function(e){return Math.abs(e.presentationTime-i.presentationTime)<1/60}));-1===r?(Ga({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[r].discontinuity&&!i.discontinuity&&(i.discontinuity=!0,e.discontinuityStarts.unshift(0),e.discontinuitySequence--),Ga({playlist:e,mediaSequence:t.segments[r].number}))}})),t})({oldManifest:n,newManifest:a}):a):{}},no=(e,t)=>{var{type:i,minimumUpdatePeriod:n=0,media:r="",sourceDuration:s,timescale:a=1,startNumber:o=1,periodStart:l}=e,u=[];let d=-1;for(let f=0;f<t.length;f++){var c=(p=t[f]).d,h=p.r||0,p=p.t||0;let g;d<0&&(d=p),p&&p>d&&(d=p),g=h<0?(p=f+1)===t.length?"dynamic"===i&&0<n&&0<r.indexOf("$Number$")?((e,t,i)=>{var{NOW:e,clientOffset:n,availabilityStartTime:r,timescale:s=1,periodStart:a=0,minimumUpdatePeriod:o=0}=e;return Math.ceil((((e+n)/1e3+o-(r+a))*s-t)/i)})(e,d,c):(s*a-d)/c:(t[p].t-d)/c:h+1;var m=o+u.length+g;let y=o+u.length;for(;y<m;)u.push({number:y,duration:c/a,time:d,timeline:l}),d+=c,y++}return u},ro=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,so=(e,t)=>{var i;return e.replace(ro,(i=t,(e,t,n,r)=>"$$"===e?"$":void 0===i[t]?e:(e=""+i[t],"RepresentationID"===t||(r=n?parseInt(r,10):1)<=e.length?e:Array(r-e.length+1).join("0")+e)))},ao=(e,t)=>{let i={RepresentationID:e.id,Bandwidth:e.bandwidth||0};var{initialization:n={sourceURL:"",range:""}}=e;let r=Ba({baseUrl:e.baseUrl,source:so(n.sourceURL,i),range:n.range});return n=t,((t=e).duration||n?t.duration?qa(t):no(t,n):[{number:t.startNumber||1,duration:t.sourceDuration,time:0,timeline:t.periodStart}]).map((t=>{i.Number=t.number,i.Time=t.time;var n=so(e.media||"",i),s=e.timescale||1,a=e.presentationTimeOffset||0;a=e.periodStart+(t.time-a)/s;return{uri:n,timeline:t.timeline,duration:t.duration,resolvedUri:Rr(e.baseUrl||"",n),map:r,number:t.number,presentationTime:a}}))},oo=(e,t)=>{let{duration:i,segmentUrls:n=[],periodStart:r}=e;if(!i&&!t||i&&t)throw Error(Ra);let s,a=n.map((t=>{var{baseUrl:i,initialization:n={}}=i=e,n=Ba({baseUrl:i,source:n.sourceURL,range:n.range});return(i=Ba({baseUrl:i,source:t.media,range:t.mediaRange})).map=n,i}));return i&&(s=qa(e)),(s=t?no(e,t):s).map(((t,i)=>{var n,s;if(a[i])return i=a[i],n=e.timescale||1,s=e.presentationTimeOffset||0,i.timeline=t.timeline,i.duration=t.duration,i.number=t.number,i.presentationTime=r+(t.time-s)/n,i})).filter((e=>e))},lo=({attributes:e,segmentInfo:t})=>{let i,n;t.template?(n=ao,i=Ia(e,t.template)):t.base?(n=Ha,i=Ia(e,t.base)):t.list&&(n=oo,i=Ia(e,t.list));var r,s,a;e={attributes:e};return n&&(r=n(i,t.segmentTimeline),i.duration?(({duration:s,timescale:a=1}=i),i.duration=s/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},uo=(e,t)=>Oa(e.childNodes).filter((({tagName:e})=>e===t)),co=e=>e.textContent.trim(),ho=e=>{var t,i,n,r,s;return(e=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e))?([e,t,i,n,r,s]=e.slice(1),31536e3*parseFloat(e||0)+2592e3*parseFloat(t||0)+86400*parseFloat(i||0)+3600*parseFloat(n||0)+60*parseFloat(r||0)+parseFloat(s||0)):0},po={mediaPresentationDuration:e=>ho(e),availabilityStartTime:e=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(e)&&(e+="Z"),Date.parse(e)/1e3),minimumUpdatePeriod:e=>ho(e),suggestedPresentationDelay:e=>ho(e),type:e=>e,timeShiftBufferDepth:e=>ho(e),start:e=>ho(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)?ho(e):t},d:e=>parseInt(e,10),t:e=>parseInt(e,10),r:e=>parseInt(e,10),DEFAULT:e=>e},mo=e=>e&&e.attributes?Oa(e.attributes).reduce(((e,t)=>{var i=po[t.name]||po.DEFAULT;return e[t.name]=i(t.value),e}),{}):{},fo={"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"},go=(e,t)=>t.length?Pa(e.map((function(e){return t.map((function(t){return Rr(e,co(t))}))}))):e,yo=e=>{var t=uo(e,"SegmentTemplate")[0],i=uo(e,"SegmentList")[0],n=i&&uo(i,"SegmentURL").map((e=>Ia({tag:"SegmentURL"},mo(e)))),r=(e=uo(e,"SegmentBase")[0],(r=i||t)&&uo(r,"SegmentTimeline")[0]),s=(s=i||e||t)&&uo(s,"Initialization")[0];(t=t&&mo(t))&&s?t.initialization=s&&mo(s):t&&t.initialization&&(t.initialization={sourceURL:t.initialization});let a={template:t,segmentTimeline:r&&uo(r,"S").map((e=>mo(e))),list:i&&Ia(mo(i),{segmentUrls:n,initialization:mo(s)}),base:e&&Ia(mo(e),{initialization:mo(s)})};return Object.keys(a).forEach((e=>{a[e]||delete a[e]})),a},vo=(e,t={})=>{var{manifestUri:t="",NOW:i=Date.now(),clientOffset:n=0}=t,r=uo(e,"Period");if(!r.length)throw Error(La);var s=uo(e,"Location");let a=mo(e);var o,l;t=go([t],uo(e,"BaseURL"));a.type=a.type||"static",a.sourceDuration=a.mediaPresentationDuration||0,a.NOW=i,a.clientOffset=n,s.length&&(a.locations=s.map(co));let u=[];return r.forEach(((e,t)=>{var i,n,r=mo(e);t=u[t-1];r.start=(({attributes:t,priorPeriodAttributes:i,mpdType:n}={attributes:r,priorPeriodAttributes:t?t.attributes:null,mpdType:a.type}),"number"==typeof t.start?t.start:i&&"number"==typeof i.start&&"number"==typeof i.duration?i.start+i.duration:i||"static"!==n?null:0),u.push({node:e,attributes:r})})),{locations:a.locations,representationInfo:Pa(u.map((o=a,l=t,(e,t)=>{var i=go(l,uo(e.node,"BaseURL")),n=Ia(o,{periodStart:e.attributes.start}),r=("number"==typeof e.attributes.duration&&(n.periodDuration=e.attributes.duration),uo(e.node,"AdaptationSet"));e=yo(e.node);return Pa(r.map(((e,t,i)=>n=>{var r=mo(n),s=go(t,uo(n,"BaseURL")),a=uo(n,"Role")[0];a={role:mo(a)};let o=Ia(e,r,a);var l,u,d;return r=uo(n,"Accessibility")[0],r="urn:scte:dash:cc:cea-608:2015"===(a=mo(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 n={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};return/=/.test(e)?([t,i=""]=e.split("="),n.channel=t,n.language=e,i.split(",").forEach((e=>{var[e,t]=e.split(":");"lang"===e?n.language=t:"er"===e?n.easyReader=Number(t):"war"===e?n.aspectRatio=Number(t):"3D"===e&&(n["3D"]=Number(t))}))):n.language=e,n.channel&&(n.channel="SERVICE"+n.channel),n})):void 0,r&&(o=Ia(o,{captionServices:r})),(a=uo(n,"Label")[0])&&a.childNodes.length&&(o=Ia(o,{label:r=a.childNodes[0].nodeValue.trim()})),a=uo(n,"ContentProtection").reduce(((e,t)=>{var i=mo(t),n=(i.schemeIdUri&&(i.schemeIdUri=i.schemeIdUri.toLowerCase()),fo[i.schemeIdUri]);return n&&(e[n]={attributes:i},i=uo(t,"cenc:pssh")[0])&&(t=co(i),e[n].pssh=t&&function(e){for(var t=window.atob?window.atob(e):Buffer.from(e,"base64").toString("binary"),i=new Uint8Array(t.length),n=0;n<t.length;n++)i[n]=t.charCodeAt(n);return i}(t)),e}),{}),Object.keys(a).length&&(o=Ia(o,{contentProtection:a})),r=yo(n),a=uo(n,"Representation"),n=Ia(i,r),Pa(a.map((l=o,u=s,d=n,e=>{var t=uo(e,"BaseURL");t=go(u,t);let i=Ia(l,mo(e)),n=yo(e);return t.map((e=>({segmentInfo:Ia(d,n),attributes:Ia(i,{baseUrl:e})})))})))})(n,i,e)))})))}},_o=e=>{if(""===e)throw Error(Da);var t,i=new Ca;let n;try{n=(t=i.parseFromString(e,"application/xml"))&&"MPD"===t.documentElement.tagName?t.documentElement:null}catch(e){}if(!n||n&&0<n.getElementsByTagName("parsererror").length)throw Error(Ma);return n};function bo(e,t){var i,n,r;return void 0===t&&(t=0),(e=Gr(e)).length-t<10||!Yr(e,xo,{offset:t})?t:bo(e,t+=(void 0===(n=t)&&(n=0),r=(i=Gr(i=e))[n+5],i=i[n+6]<<21|i[n+7]<<14|i[n+8]<<7|i[n+9],(16&r)>>4?20+i:10+i))}function wo(e){return"string"==typeof e?Nr(e):e}function To(e,t,i){var n;return i>=t.length?t.length:(n=Po(t,i,!1),Yr(e.bytes,n.bytes)?i:To(e,t,i+(e=Po(t,i+n.length)).length+e.value+n.length))}function So(e,t){t=Array.isArray(i=t)?i.map((function(e){return Oo(e)})):[Oo(i)],e=Gr(e);var i,n=[];if(t.length)for(var r=0;r<e.length;){var s=Po(e,r,!1),a=Po(e,r+s.length),o=r+s.length+a.length,l=(127===a.value&&(a.value=To(s,e,o),a.value!==e.length)&&(a.value-=o),o+a.value>e.length?e.length:o+a.value);o=e.subarray(o,l);Yr(t[0],s.bytes)&&(1===t.length?n.push(o):n=n.concat(So(o,t.slice(1)))),r+=s.length+a.length+o.length}return n}function Eo(e,t,i,n){void 0===n&&(n=1/0),e=Gr(e),i=[].concat(i);for(var r,s=0,a=0;s<e.length&&(a<n||r);){var o=void 0;if(Yr(e.subarray(s),Lo)?o=4:Yr(e.subarray(s),Do)&&(o=3),o){if(a++,r)return No(e.subarray(r,s));var l=void 0;"h264"===t?l=31&e[s+o]:"h265"===t&&(l=e[s+o]>>1&63),-1!==i.indexOf(l)&&(r=s+o),s+=o+("h264"===t?1:2)}else s++}return e.subarray(0,0)}function ko(e){e=Gr(e);for(var t=0;t<Bo.length;t++){var i=Bo[t];if(jo[i](e))return i}return""}var Co=function(e){var t;return(e=new DataView(e.buffer,e.byteOffset,e.byteLength)).getBigUint64?(t=e.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(t):t:4294967296*e.getUint32(0)+e.getUint32(4)},xo=Gr([73,68,51]),Io={EBML:Gr([26,69,223,163]),DocType:Gr([66,130]),Segment:Gr([24,83,128,103]),SegmentInfo:Gr([21,73,169,102]),Tracks:Gr([22,84,174,107]),Track:Gr([174]),TrackNumber:Gr([215]),DefaultDuration:Gr([35,227,131]),TrackEntry:Gr([174]),TrackType:Gr([131]),FlagDefault:Gr([136]),CodecID:Gr([134]),CodecPrivate:Gr([99,162]),VideoTrack:Gr([224]),AudioTrack:Gr([225]),Cluster:Gr([31,67,182,117]),Timestamp:Gr([231]),TimestampScale:Gr([42,215,177]),BlockGroup:Gr([160]),BlockDuration:Gr([155]),Block:Gr([161]),SimpleBlock:Gr([163])},Ao=[128,64,32,16,8,4,2,1],Po=function(e,t,i,n){void 0===i&&(i=!0),void 0===n&&(n=!1);var r=function(e){for(var t=1,i=0;i<Ao.length&&!(e&Ao[i]);i++)t++;return t}(e[t]),s=e.subarray(t,t+r);return i&&((s=Array.prototype.slice.call(e,t,t+r))[0]^=Ao[r-1]),{length:r,value:Qr(s,{signed:n}),bytes:s}},Oo=function e(t){return"string"==typeof t?t.match(/.{1,2}/g).map(e):"number"==typeof t?function(e,t){for(var i=void 0!==(t=(void 0===t?{}:t).le)&&t,n=Math.ceil((t=e=Xr(e="bigint"!=typeof e&&"number"!=typeof e||"number"==typeof e&&e!=e?0:e)).toString(2).length/8),r=new Uint8Array(new ArrayBuffer(n)),s=0;s<n;s++){var a=i?s:Math.abs(s+1-r.length);r[a]=Number(e/Kr[s]&Xr(255)),e<0&&(r[a]=Math.abs(~r[a]),r[a]-=0===s?1:2)}return r}(t):t},Lo=Gr([0,0,0,1]),Do=Gr([0,0,1]),Mo=Gr([0,0,3]),No=function(e){for(var t=[],i=1;i<e.length-2;)Yr(e.subarray(i,i+3),Mo)&&(t.push(i+2),i++),i++;if(0===t.length)return e;var n=e.length-t.length,r=new Uint8Array(n),s=0;for(i=0;i<n;s++,i++)s===t[0]&&(s++,t.shift()),r[i]=e[s];return r},Ro={webm:Gr([119,101,98,109]),matroska:Gr([109,97,116,114,111,115,107,97]),flac:Gr([102,76,97,67]),ogg:Gr([79,103,103,83]),ac3:Gr([11,119]),riff:Gr([82,73,70,70]),avi:Gr([65,86,73]),wav:Gr([87,65,86,69]),"3gp":Gr([102,116,121,112,51,103]),mp4:Gr([102,116,121,112]),fmp4:Gr([115,116,121,112]),mov:Gr([102,116,121,112,113,116]),moov:Gr([109,111,111,118]),moof:Gr([109,111,111,102])},Uo={aac:function(e){var t=bo(e);return Yr(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=bo(e);return Yr(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){return e=So(e,[Io.EBML,Io.DocType])[0],Yr(e,Ro.webm)},mkv:function(e){return e=So(e,[Io.EBML,Io.DocType])[0],Yr(e,Ro.matroska)},mp4:function(e){return!Uo["3gp"](e)&&!Uo.mov(e)&&(!!(Yr(e,Ro.mp4,{offset:4})||Yr(e,Ro.fmp4,{offset:4})||Yr(e,Ro.moof,{offset:4})||Yr(e,Ro.moov,{offset:4}))||void 0)},mov:function(e){return Yr(e,Ro.mov,{offset:4})},"3gp":function(e){return Yr(e,Ro["3gp"],{offset:4})},ac3:function(e){var t=bo(e);return Yr(e,Ro.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=bo(e);return Yr(e,Ro.flac,{offset:t})},ogg:function(e){return Yr(e,Ro.ogg)},avi:function(e){return Yr(e,Ro.riff)&&Yr(e,Ro.avi,{offset:8})},wav:function(e){return Yr(e,Ro.riff)&&Yr(e,Ro.wav,{offset:8})},h264:function(e){return Eo(e,"h264",7,3).length},h265:function(e){return Eo(e,"h265",[32,33],3).length}},Bo=Object.keys(Uo).filter((function(e){return"ts"!==e&&"h264"!==e&&"h265"!==e})).concat(["ts","h264","h265"]),jo=(Bo.forEach((function(e){var t=Uo[e];Uo[e]=function(e){return t(Gr(e))}})),Uo);/*! @name @videojs/http-streaming @version 3.0.2 @license Apache-2.0 */let Fo=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,n=/^\/\//.test(e),r=!window.location&&!/\/\//i.test(e);return i?e=new window.URL(e,window.location||Er):/\/\//i.test(e)||(e=Sr.buildAbsoluteURL(window.location&&window.location.href||"",e)),i?(i=new URL(t,e),r?i.href.slice(18):n?i.href.slice(i.protocol.length):i.href):Sr.buildAbsoluteURL(e,t)},qo=(e,t)=>t&&t.responseURL&&e!==t.responseURL?t.responseURL:e,Ho=e=>Tr.log.debug?Tr.log.debug.bind(Tr,"VHS:",e+" >"):function(){};function Vo(...e){var t=Tr.obj||Tr;return(t.merge||t.mergeOptions).apply(t,e)}function $o(...e){var t=Tr.time||Tr;return(t.createTimeRanges||t.createTimeRanges).apply(t,e)}function Wo(e,t){return Zo(e,(function(e,i){return e-Jo<=t&&i+Jo>=t}))}function zo(e,t){return Zo(e,(function(e){return e-Yo>=t}))}function Go(e){if(e&&e.length&&e.end)return e.end(e.length-1)}function Xo(e,t){let i=0;if(e&&e.length)for(let s=0;s<e.length;s++){var n=e.start(s),r=e.end(s);r<t||(i+=n<t&&t<=r?r-t:r-n)}return i}function Ko({defaultDuration:e,durationList:t,startIndex:i,endIndex:n}){let r=0;if(n<i&&([i,n]=[n,i]),i<0){for(let t=i;t<Math.min(0,n);t++)r+=e;i=0}for(let e=i;e<n;e++)r+=t[e].duration;return r}function Qo(e,t,i,n){if(!e||!e.segments)return null;if(e.endList)return ll(e);if(null===t)return null;t=t||0;let r=ol(e,e.mediaSequence+e.segments.length,t);return i&&(r-=n="number"==typeof n?n:al(null,e)),Math.max(0,r)}let Yo=1/30,Jo=3*Yo,Zo=function(e,t){var i=[];let n;if(e&&e.length)for(n=0;n<e.length;n++)t(e.start(n),e.end(n))&&i.push([e.start(n),e.end(n)]);return $o(i)},el=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(", ")},tl=e=>{var t=[];for(let i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t},il=(e,t)=>{if(!t.preload)return t.duration;let i=0;return(t.parts||[]).forEach((function(e){i+=e.duration})),(t.preloadHints||[]).forEach((function(t){"PART"===t.type&&(i+=e.partTargetDuration)})),i},nl=e=>(e.segments||[]).reduce(((e,t,i)=>(t.parts?t.parts.forEach((function(n,r){e.push({duration:n.duration,segmentIndex:i,partIndex:r,part:n,segment:t})})):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e)),[]),rl=e=>(e=e.segments&&e.segments.length&&e.segments[e.segments.length-1])&&e.parts||[],sl=({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)},al=(e,t)=>t.endList?0:e&&e.suggestedPresentationDelay?e.suggestedPresentationDelay:(e=0<rl(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,ol=function(e,t,i){var n;return(t=void 0===t?e.mediaSequence+e.segments.length:t)<e.mediaSequence?0:(n=function(e,t){let i=0,n=t-e.mediaSequence,r=e.segments[n];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(;n--;){if(void 0!==(r=e.segments[n]).end)return{result:i+r.end,precise:!0};if(i+=il(e,r),void 0!==r.start)return{result:i+r.start,precise:!0}}return{result:i,precise:!1}}(e,t)).precise?n.result:(e=function(e,t){var i;let n=0,r=t-e.mediaSequence;for(;r<e.segments.length;r++){if(void 0!==(i=e.segments[r]).start)return{result:i.start-n,precise:!0};if(n+=il(e,i),void 0!==i.end)return{result:i.end-n,precise:!0}}return{result:-1,precise:!1}}(e,t)).precise?e.result:n.result+i},ll=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 ol(e,t,i)};function ul(e){return e.excludeUntil&&e.excludeUntil>Date.now()}function dl(e){return e.excludeUntil&&e.excludeUntil===1/0}function cl(e){var t=ul(e);return!e.disabled&&!t}function hl(e,t){return t.attributes&&t.attributes[e]}function pl(e,t){var i=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{};let n=!1;for(let e in i){for(let r in i[e])if(n=t(i[e][r]))break;if(n)break}return!!n}let ml=(e,t)=>{if(1===e.playlists.length)return!0;let i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter((e=>!!cl(e)&&(e.attributes.BANDWIDTH||0)<i)).length},fl=(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)),gl=e=>{if(!e||!e.playlists||!e.playlists.length)return pl(e,(e=>e.playlists&&e.playlists.length||e.uri));for(let i=0;i<e.playlists.length;i++){let n=e.playlists[i];var t=n.attributes&&n.attributes.CODECS;if(!(t&&t.split(",").every((e=>Or(e)))||(t=pl(e,(e=>fl(n,e))))))return!1}return!0};var yl={liveEdgeDelay:al,duration:ll,seekable:function(e,t,i){var n=t||0;return null===(e=Qo(e,t,!0,i))?$o():$o(n,e)},getMediaInfoForTime:function({playlist:e,currentTime:t,startingSegmentIndex:i,startingPartIndex:n,startTime:r,exactManifestTimings:s}){let a=t-r;var o=nl(e);let l=0;for(let e=0;e<o.length;e++){var u=o[e];if(i===u.segmentIndex&&("number"!=typeof n||"number"!=typeof u.partIndex||n===u.partIndex)){l=e;break}}if(a<0){if(0<l)for(let t=l-1;0<=t;t--){var d=o[t];if(a+=d.duration,s){if(a<0)continue}else if(a+Yo<=0)continue;return{partIndex:d.partIndex,segmentIndex:d.segmentIndex,startTime:r-Ko({defaultDuration:e.targetDuration,durationList:o,startIndex:l,endIndex:t})}}return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:t}}if(l<0){for(let i=l;i<0;i++)if((a-=e.targetDuration)<0)return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:t};l=0}for(let t=l;t<o.length;t++){var c=o[t];if(a-=c.duration,s){if(0<a)continue}else if(0<=a-Yo)continue;return{partIndex:c.partIndex,segmentIndex:c.segmentIndex,startTime:r+Ko({defaultDuration:e.targetDuration,durationList:o,startIndex:l,endIndex:t})}}return{segmentIndex:o[o.length-1].segmentIndex,partIndex:o[o.length-1].partIndex,startTime:t}},isEnabled:cl,isDisabled:function(e){return e.disabled},isExcluded:ul,isIncompatible:dl,playlistEnd:Qo,isAes:function(e){for(let t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},hasAttribute:hl,estimateSegmentRequestTime:function(e,t,i,n=0){return hl("BANDWIDTH",i)?(e*i.attributes.BANDWIDTH-8*n)/t:NaN},isLowestEnabledRendition:ml,isAudioOnly:gl,playlistMatch:fl,segmentDurationWithParts:il};let vl=Tr.log,_l=(e,t)=>e+"-"+t,bl=(e,t)=>{e.mediaGroups&&["AUDIO","SUBTITLES"].forEach((i=>{if(e.mediaGroups[i])for(let n in e.mediaGroups[i])for(let r in e.mediaGroups[i][n])t(e.mediaGroups[i][n][r],i,n,r)}))},wl=({playlist:e,uri:t,id:i})=>{e.id=i,e.playlistErrors_=0,t&&(e.uri=t),e.attributes=e.attributes||{}},Tl=(e,t,i=(e,t,i)=>`placeholder-uri-${e}-${t}-`+i)=>{e.uri=t;for(let t=0;t<e.playlists.length;t++)e.playlists[t].uri||(r="placeholder-uri-"+t,e.playlists[t].uri=r);let n=gl(e);bl(e,((t,r,s,a)=>{if(!t.playlists||!t.playlists.length){if(n&&"AUDIO"===r&&!t.uri)for(let t=0;t<e.playlists.length;t++){var o=e.playlists[t];if(o.attributes&&o.attributes.AUDIO&&o.attributes.AUDIO===s)return}t.playlists=[qt({},t)]}t.playlists.forEach((function(t,n){var o=i(r,s,a,t),l=_l(n,o);t.uri?t.resolvedUri=t.resolvedUri||Fo(e.uri,t.uri):(t.uri=0===n?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 r,s,a=e;let t=a.playlists.length;for(;t--;){var o=a.playlists[t];wl({playlist:o,id:_l(t,o.uri)}),o.resolvedUri=Fo(a.uri,o.uri),a.playlists[o.id]=o,(a.playlists[o.uri]=o).attributes.BANDWIDTH||vl.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}}bl(s=e,(e=>{e.uri&&(e.resolvedUri=Fo(s.uri,e.uri))}))};function Sl(e){var t=e.segments||[],i=e.preloadSegment;if(i&&i.parts&&i.parts.length){if(i.preloadHints)for(let e=0;e<i.preloadHints.length;e++)if("MAP"===i.preloadHints[e].type)return t;i.duration=e.targetDuration,i.preload=!0,t.push(i)}return t}Kn=Tr.EventTarget;let El=(e,t)=>{if(!e)return t;var i=Vo(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 n=0;n<t.parts.length;n++)e.parts&&e.parts[n]&&(i.parts[n]=Vo(e.parts[n],t.parts[n]));return!e.skipped&&t.skipped&&(i.skipped=!1),e.preload&&!t.preload&&(i.preload=!1),i},kl=(e,t)=>{!e.resolvedUri&&e.uri&&(e.resolvedUri=Fo(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=Fo(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=Fo(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=Fo(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach((e=>{e.resolvedUri||(e.resolvedUri=Fo(t,e.uri))})),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach((e=>{e.resolvedUri||(e.resolvedUri=Fo(t,e.uri))}))},Cl=(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,xl=(e,t,i=Cl)=>{var n=Vo(e,{}),r=n.playlists[t.id];if(!r||i(r,t))return null;t.segments=Sl(t);let s=Vo(r,t);if(s.preloadSegment&&!t.preloadSegment&&delete s.preloadSegment,r.segments){if(t.skip){t.segments=t.segments||[];for(let e=0;e<t.skip.skippedSegments;e++)t.segments.unshift({skipped:!0})}s.segments=((e,t,i)=>{var n=e.slice(),r=t.slice(),s=(i=i||0,[]);let a;for(let e=0;e<r.length;e++){var o=n[e+i],l=r[e];o?(a=o.map||a,s.push(El(o,l))):(a&&!l.map&&(l.map=a),s.push(l))}return s})(r.segments,t.segments,t.mediaSequence-r.mediaSequence)}s.segments.forEach((e=>{kl(e,s.resolvedUri)}));for(let e=0;e<n.playlists.length;e++)n.playlists[e].id===t.id&&(n.playlists[e]=s);return n.playlists[t.id]=s,n.playlists[t.uri]=s,bl(e,((e,i,n,r)=>{if(e.playlists)for(let i=0;i<e.playlists.length;i++)t.id===e.playlists[i].id&&(e.playlists[i]=s)})),n},Il=(e,t)=>{var i,n=(n=(i=(i=e.segments||[])[i.length-1])&&i.parts&&i.parts[i.parts.length-1])&&n.duration||i&&i.duration;return t&&n?1e3*n:500*(e.partTargetDuration||e.targetDuration||10)};class Al extends Kn{constructor(e,t,i={}){if(super(),!e)throw Error("A non-empty playlist URL or object is required");this.logger_=Ho("PlaylistLoader");var{withCredentials:i=!1}=i;this.src=e,this.vhs_=t,this.withCredentials=i,e=t.options_;this.customTagParsers=e&&e.customTagParsers||[],this.customTagMappers=e&&e.customTagMappers||[],this.llhls=e&&e.llhls,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_)}handleMediaupdatetimeout_(){if("HAVE_METADATA"===this.state){var e=this.media();let t=Fo(this.main.uri,e.uri);this.llhls&&(t=((e,t)=>{if(!t.endList&&t.serverControl){let r={};if(t.serverControl.canBlockReload){var i,n=t.preloadSegment;let e=t.mediaSequence+t.segments.length;n&&(n=n.parts||[],-1<(i=sl(t)-1)&&i!=n.length-1&&(r._HLS_part=i),-1<i||n.length)&&e--,r._HLS_msn=e}if(t.serverControl&&t.serverControl.canSkipUntil&&(r._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(r).length){let t=new window.URL(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach((function(e){r.hasOwnProperty(e)&&t.searchParams.set(e,r[e])})),e=t.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:n}=t;this.request=null,i&&(this.state=i),this.error={playlist:this.main.playlists[n],status:e.status,message:`HLS playlist request error at URL: ${t}.`,responseText:e.responseText,code:500<=e.status?4:2},this.trigger("error")}parseManifest_({url:e,manifestString:t}){{var[{onwarn:t,oninfo:i,manifestString:n,customTagParsers:r=[],customTagMappers:s=[],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 Pr,l=(t&&o.on("warn",t),i&&o.on("info",i),r.forEach((e=>o.addParser(e))),s.forEach((e=>o.addTagMapper(e))),o.push(n),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 e=10;l.segments&&l.segments.length&&(e=l.segments.reduce(((e,t)=>Math.max(e,t.duration)),0)),t&&t("manifest has no targetDuration defaulting to "+e),l.targetDuration=e}return(i=rl(l)).length&&!l.partTargetDuration&&(r=i.reduce(((e,t)=>Math.max(e,t.duration)),0),t&&(t("manifest has no partTargetDuration defaulting to "+r),vl.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:n}){this.request=null,this.state="HAVE_METADATA",(t=t||this.parseManifest_({url:i,manifestString:e})).lastRequest=Date.now(),wl({playlist:t,uri:i,id:n}),e=xl(this.main,t),this.targetDuration=t.partTargetDuration||t.targetDuration,this.pendingMedia_=null,e?(this.main=e,this.media_=this.main.playlists[n]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Il(this.media(),!!e)),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),window.clearTimeout(this.mediaUpdateTimeout),window.clearTimeout(this.finalRenditionTimeout),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 n=this.state;t=!this.media_||e.id!==this.media_.id;var i=this.main.playlists[e.id];if(i&&i.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"===n?this.trigger("loadedmetadata"):this.trigger("mediachange"));else if(this.updateMediaUpdateTimeout_(Il(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,i)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=qo(e.resolvedUri,i),t)return this.playlistRequestError(this.request,e,n);this.haveMetadata({playlistString:i.responseText,url:e.uri,id:e.id}),"HAVE_MAIN_MANIFEST"===n?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=qo(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,n,r;this.state="HAVE_MAIN_MANIFEST",e.playlists?(this.main=e,Tl(this.main,this.srcUri()),e.playlists.forEach((e=>{e.segments=Sl(e),e.segments.forEach((t=>{kl(t,e.resolvedUri)}))})),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0])):(t=this.srcUri()||window.location.href,this.main=(n=_l(0,i=t),(r={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:window.location.href,resolvedUri:window.location.href,playlists:[{uri:i,id:n,resolvedUri:i,attributes:{}}]}).playlists[n]=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 Pl(e,t,i,n){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),n(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 Ol(){function e(t,i){t=Vo({timeout:45e3},t);var n=e.beforeRequest||Tr.Vhs.xhr.beforeRequest;n&&"function"==typeof n&&(n=n(t))&&(t=n);let r=(!0===Tr.Vhs.xhr.original?Bl:Tr.Vhs.xhr)(t,(function(e,t){return Pl(r,e,t,i)})),s=r.abort;return r.abort=function(){return r.aborted=!0,s.apply(r,arguments)},r.uri=t.uri,r.requestTime=Date.now(),r}return e.original=!0,e}function Ll(e){var t,i={};let n;return e.byterange&&(i.Range="bytes="+(t=e.byterange).offset+"-"+(n="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 Dl(e,t){return e=e.toString(16),"00".substring(0,2-e.length)+e+(t%2?" ":"")}function Ml(e){return 32<=e&&e<126?String.fromCharCode(e):"."}function Nl(e){let t={};return Object.keys(e).forEach((i=>{var n=e[i];zr(n)?t[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:t[i]=n})),t}function Rl(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")}function Ul(e){return e.resolvedUri}let Bl=Tr.xhr,jl=e=>{var t=Array.prototype.slice.call(e);let i="";for(let e=0;e<t.length/16;e++)i+=t.slice(16*e,16*e+16).map(Dl).join("")+" "+t.slice(16*e,16*e+16).map(Ml).join("")+"\n";return i};Xn=Object.freeze({__proto__:null,createTransferableMessage:Nl,initSegmentId:Rl,segmentKeyId:Ul,hexDump:jl,tagDump:({bytes:e})=>jl(e),textRanges(e){var t,i;let n,r="";for(n=0;n<e.length;n++)r+=(i=n,(t=e).start(i)+"-"+t.end(i)+" ");return r}});let Fl=({programTime:e,playlist:t,retryCount:i=2,seekTo:n,pauseAfterSeek:r=!0,tech:s,callback:a})=>{var o,l,u;if(a)return void 0!==e&&t&&n?t.endList||s.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)?(u=((e,t)=>{let i;try{i=new Date(e)}catch(e){return null}if(!t||!t.segments||0===t.segments.length)return null;let n=t.segments[0];if(i<n.dateTimeObject)return null;for(let e=0;e<t.segments.length-1&&(n=t.segments[e],!(i<t.segments[e+1].dateTimeObject));e++);var r=(e=t.segments[t.segments.length-1]).dateTimeObject,s=e.videoTimingInfo?(e=>e.transmuxedPresentationEnd-e.transmuxedPresentationStart-e.transmuxerPrependedSeconds)(e.videoTimingInfo):e.duration+.25*e.duration;return i>(s=new Date(r.getTime()+1e3*s))?null:{segment:n=i>r?e:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:yl.duration(t,t.mediaSequence+t.segments.indexOf(n)),type:n.videoTimingInfo?"accurate":"estimate"}})(e,t))?(l=((e,t)=>{let i,n;try{i=new Date(e),n=new Date(t)}catch(e){}return e=i.getTime(),(n.getTime()-e)/1e3})((o=u.segment).dateTimeObject,e),"estimate"===u.type?0===i?a({message:e+" is not buffered yet. Try again"}):(n(u.estimatedStart+l),void s.one("seeked",(()=>{Fl({programTime:e,playlist:t,retryCount:i-1,seekTo:n,pauseAfterSeek:r,tech:s,callback:a})}))):(u=o.start+l,s.one("seeked",(()=>a(null,s.currentTime()))),r&&s.pause(),void n(u))):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")};function ql(e,t){if(!Cl(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 r=0;r<e.segments.length;r++){var i=e.segments[r],n=t.segments[r];if(i.uri!==n.uri||(i.byterange||n.byterange)&&(i=i.byterange,n=n.byterange,i&&!n||!i&&n||i.offset!==n.offset||i.length!==n.length))return!1}return!0}Gn=Tr.EventTarget;let Hl=(e,t,i,n)=>`placeholder-uri-${e}-${t}-`+(n.attributes.NAME||i),Vl=({mainXml:e,srcUrl:t,clientOffset:i,sidxMapping:n,previousManifest:r})=>(i={manifestUri:t,clientOffset:i,sidxMapping:n,previousManifest:r},n=(e=>e.map(lo))((e=vo(_o(e),i)).representationInfo),r=io({dashPlaylists:n,locations:e.locations,sidxMapping:i.sidxMapping,previousManifest:i.previousManifest}),Tl(r,t,Hl),r),$l=(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,Wl=(e,t)=>{var i={};for(let s in e){var n=e[s].sidx;if(n){var r=Xa(n);if(!t[r])break;$l(t[r].sidxInfo,n)&&(i[r]=t[r])}}return i};class zl extends Gn{constructor(e,t,i={},n){super(),this.mainPlaylistLoader_=n||this,n||(this.isMain_=!0);var{withCredentials:n=!1}=i;if(this.vhs_=t,this.withCredentials=n,!e)throw Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",(()=>{this.refreshXml_()})),this.on("mediaupdatetimeout",(()=>{this.refreshMedia_(this.media().id)})),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=Ho("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 n=e.sidx&&Xa(e.sidx);if(e.sidx&&n&&!this.mainPlaylistLoader_.sidxMapping_[n]){let r=qo(e.sidx.resolvedUri),s=(r,s)=>{if(!this.requestErrored_(r,s,t)){let a;r=this.mainPlaylistLoader_.sidxMapping_;try{a=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8)},n=12,r=(0===i.version?(i.earliestPresentationTime=t.getUint32(n),i.firstOffset=t.getUint32(n+4),n+=8):(i.earliestPresentationTime=Co(e.subarray(n)),i.firstOffset=Co(e.subarray(n+8)),n+=16),t.getUint16(n+=2));for(n+=2;0<r;n+=12,r--)i.references.push({referenceType:(128&e[n])>>>7,referencedSize:2147483647&t.getUint32(n),subsegmentDuration:t.getUint32(n+4),startsWithSap:!!(128&e[n+8]),sapType:(112&e[n+8])>>>4,sapDeltaTime:268435455&t.getUint32(n+8)});return i}(Gr(s.response).subarray(8))}catch(e){return void this.requestErrored_(e,s,t)}return r[n]={sidxInfo:e.sidx,sidx:a},Va(e,a,e.sidx.resolvedUri),i(!0)}};this.request=((e,t,i)=>{let n,r=[],s=!1;function a(e,t,n,r){return t.abort(),s=!0,i(e,t,n,r)}function o(e,t){var i;if(!s)return e?a(e,t,"",r):(i=t.responseText.substring(r&&r.byteLength||0,t.responseText.length),r=function(){for(var e,t,i,n=arguments.length,r=Array(n),s=0;s<n;s++)r[s]=arguments[s];return(r=r.filter((function(e){return e&&(e.byteLength||e.length)&&"string"!=typeof e}))).length<=1?Gr(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=Gr(e),t.set(e,i),i+=e.byteLength})),t)}(r,Nr(i,!0)),n=n||bo(r),r.length<10||n&&r.length<n+2||"ts"===(i=ko(r))&&r.length<188||!i&&r.length<376?((e,t)=>{if(4===e.readyState)return t()})(t,(()=>a(e,t,"",r))):a(null,t,i,r))}let l=t({uri:e,beforeSend(e){e.overrideMimeType("text/plain; charset=x-user-defined"),e.addEventListener("progress",(function({}){return Pl(e,null,{statusCode:e.status},o)}))}},(function(e,t){return Pl(l,e,t,o)}));return l})(r,this.vhs_.xhr,((t,i,n,a)=>{var o,l;return t?s(t,i):n&&"mp4"===n?(({offset:o,length:l}=e.sidx.byterange),a.length>=l+o?s(t,{response:a.subarray(o,o+l),status:i.status,uri:i.uri}):void(this.request=this.vhs_.xhr({uri:r,responseType:"arraybuffer",headers:Ll({byterange:e.sidx.byterange})},s))):s({status:i.status,message:`Unsupported ${n||"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)=>{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 t=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=qo(this.mainPlaylistLoader_.srcUrl,i),!t)return e(i,t);this.handleMain_(),this.syncClientServerClock_((()=>e(i,t)))}}))}syncClientServerClock_(e){let t=(e=>{if(e=_o(e),!(e=uo(e,"UTCTiming")[0]))return null;var t=mo(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(Ua)}return t})(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:Fo(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials},((i,n)=>{if(this.request){if(i)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();let r;r="HEAD"===t.method?n.responseHeaders&&n.responseHeaders.date?Date.parse(n.responseHeaders.date):this.mainLoaded_:Date.parse(n.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=Vl({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e});e&&(t=((e,t,i)=>{let n=!0,r=Vo(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts});for(let e=0;e<t.playlists.length;e++){var s,a,o=t.playlists[e],l=(o.sidx&&(l=Xa(o.sidx),i)&&i[l]&&i[l].sidx&&Va(o,i[l].sidx,o.sidx.resolvedUri),xl(r,o,ql));l&&(r=l,n=!1)}return bl(t,((e,t,i,s)=>{var a,o;e.playlists&&e.playlists.length&&(a=e.playlists[0].id,o=xl(r,e.playlists[0],ql))&&(s in(r=o).mediaGroups[t][i]||(r.mediaGroups[t][i][s]=e),r.mediaGroups[t][i][s].playlists[0]=r.playlists[a],n=!1)})),a=t,bl(s=r,((e,t,i,n)=>{n in a.mediaGroups[t][i]||delete s.mediaGroups[t][i][n]})),(n=t.minimumUpdatePeriod===e.minimumUpdatePeriod&&n)?null:r})(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_(),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,n;let r;t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=(i=this.mainPlaylistLoader_.main,n=this.mainPlaylistLoader_.sidxMapping_,r=Wl(i.playlists,n),bl(i,((e,t,i,s)=>{e.playlists&&e.playlists.length&&(r=Vo(r,Wl(e=e.playlists,n)))})),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 e=()=>{this.media().endList||(this.mediaUpdateTimeout=window.setTimeout((()=>{this.trigger("mediaupdatetimeout"),e()}),Il(this.media(),Boolean(i))))};e()}this.trigger("loadedplaylist")}}var Gl={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 Xl(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e}function Kl(e){return function(){let t=function(e){try{return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch(i){var t=new BlobBuilder;return t.append(e),URL.createObjectURL(t.getBlob())}}(e);var i=Xl(new Worker(t));i.objURL=t;let n=i.terminate;return i.on=i.addEventListener,i.off=i.removeEventListener,i.terminate=function(){return URL.revokeObjectURL(t),n.call(this)},i}}function Ql(e){return`var browserWorkerPolyFill = ${Xl.toString()};\nbrowserWorkerPolyFill(self);\n`+e}function Yl(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)}var Jl=Kl(Ql(Yl((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,n,r,s=e[t];if(s)if(2===arguments.length)for(n=s.length,i=0;i<n;++i)s[i].call(this,arguments[1]);else{for(r=[],i=arguments.length,i=1;i<arguments.length;++i)r.push(arguments[i]);for(n=s.length,i=0;i<n;++i)s[i].apply(this,r)}},this.dispose=function(){e={}}}}var t,i,n,r,s,a,o,l,u,d,c,h,p,m,f,g,y,v,_,b,w,T,S,E,k,C,x,I,A,P,O,L,D,M,N,R,U,B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},j=(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=function(e){var t;return(e=new DataView(e.buffer,e.byteOffset,e.byteLength)).getBigUint64?(t=e.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(t):t:4294967296*e.getUint32(0)+e.getUint32(4)},q=4294967296;if(w={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 H in w)w.hasOwnProperty(H)&&(w[H]=[H.charCodeAt(0),H.charCodeAt(1),H.charCodeAt(2),H.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]),ie=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:ie},I=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),x=new Uint8Array([0,0,0,0,0,0,0,0]),P=A=new Uint8Array([0,0,0,0,0,0,0,0]),O=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),L=A,C=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}function V(e,t){var i=te();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 $(e){for(var t=[];e--;)t.push(0);return t}function W(e){e=e||{},W.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 fe({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 z(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=ge[e]||e)}function Q(){for(var e=[],t=ye+1;t--;)e.push("");return e}function Y(e,t){var i=1;for(t<e&&(i=-1);Math.abs(t-e)>Se;)e+=i*Te;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=Y(e.dts,i),e.pts=Y(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=[],n=0,r=1;r<arguments.length;r++)i.push(arguments[r]);for(r=i.length;r--;)n+=i[r].byteLength;for(t=new Uint8Array(n+8),new DataView(t.buffer,t.byteOffset,t.byteLength).setUint32(0,t.byteLength),t.set(e,4),r=0,n=8;r<i.length;r++)t.set(i[r],n),n+=i[r].byteLength;return t},i=function(){return t(w.dinf,t(w.dref,I))},n=function(e){return t(w.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(w.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(w.mdhd,i)},h=function(e){return t(w.mdia,p(e),m(e.type),a(e))},s=function(e){return t(w.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},a=function(e){return t(w.minf,"video"===e.type?t(w.vmhd,C):t(w.smhd,x),i(),g(e))},l=function(e){for(var i=e.length,n=[];i--;)n[i]=_(e[i]);return t.apply(null,[w.mvex].concat(n))},u=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(w.mvhd,e)},f=function(e){for(var i,n=e.samples||[],r=new Uint8Array(4+n.length),s=0;s<n.length;s++)i=n[s].flags,r[s+4]=i.dependsOn<<4|i.isDependedOn<<2|i.hasRedundancy;return t(w.sdtp,r)},g=function(e){return t(w.stbl,y(e),t(w.stts,L),t(w.stsc,P),t(w.stsz,O),t(w.stco,A))},y=function(e){return t(w.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),("video"===e.type?D:M)(e))},D=function(e){for(var i,n,r=e.sps||[],s=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<s.length;l++)o.push((65280&s[l].byteLength)>>>8),o.push(255&s[l].byteLength),o=o.concat(Array.prototype.slice.call(s[l]));return i=[w.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(w.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([r.length],a,[s.length],o))),t(w.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio&&(n=e.sarRatio[0],e=e.sarRatio[1],i.push(t(w.pasp,new Uint8Array([(4278190080&n)>>24,(16711680&n)>>16,(65280&n)>>8,255&n,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e])))),t.apply(null,i)},M=function(e){return t(w.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),n(e))},c=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(w.tkhd,e)},v=function(e){var i,n=t(w.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),s=Math.floor(e.baseMediaDecodeTime%q);r=t(w.tfdt,new Uint8Array([1,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r,s>>>24&255,s>>>16&255,s>>>8&255,255&s]));return"audio"===e.type?(i=b(e,92),t(w.traf,n,r,i)):(s=f(e),i=b(e,s.length+92),t(w.traf,n,r,i,s))},d=function(e){return e.duration=e.duration||4294967295,t(w.trak,c(e),h(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(w.trex,i)},N=function(e,t){var i=0,n=0,r=0,s=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(n=2),void 0!==e[0].flags&&(r=4),void 0!==e[0].compositionTimeOffset)&&(s=8),[0,0,i|n|r|s,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]},R=function(e,i){var n,r,s,a,o=e.samples||[];for(i+=20+16*o.length,e=N(o,i),(r=new Uint8Array(e.length+16*o.length)).set(e),n=e.length,a=0;a<o.length;a++)s=o[a],r[n++]=(4278190080&s.duration)>>>24,r[n++]=(16711680&s.duration)>>>16,r[n++]=(65280&s.duration)>>>8,r[n++]=255&s.duration,r[n++]=(4278190080&s.size)>>>24,r[n++]=(16711680&s.size)>>>16,r[n++]=(65280&s.size)>>>8,r[n++]=255&s.size,r[n++]=s.flags.isLeading<<2|s.flags.dependsOn,r[n++]=s.flags.isDependedOn<<6|s.flags.hasRedundancy<<4|s.flags.paddingValue<<1|s.flags.isNonSyncSample,r[n++]=61440&s.flags.degradationPriority,r[n++]=15&s.flags.degradationPriority,r[n++]=(4278190080&s.compositionTimeOffset)>>>24,r[n++]=(16711680&s.compositionTimeOffset)>>>16,r[n++]=(65280&s.compositionTimeOffset)>>>8,r[n++]=255&s.compositionTimeOffset;return t(w.trun,r)},U=function(e,i){var n,r,s,a,o=e.samples||[];for(i+=20+8*o.length,e=N(o,i),(n=new Uint8Array(e.length+8*o.length)).set(e),r=e.length,a=0;a<o.length;a++)s=o[a],n[r++]=(4278190080&s.duration)>>>24,n[r++]=(16711680&s.duration)>>>16,n[r++]=(65280&s.duration)>>>8,n[r++]=255&s.duration,n[r++]=(4278190080&s.size)>>>24,n[r++]=(16711680&s.size)>>>16,n[r++]=(65280&s.size)>>>8,n[r++]=255&s.size;return t(w.trun,n)},b=function(e,t){return("audio"===e.type?U:R)(e,t)};var Z,ee={ftyp:r=function(){return t(w.ftyp,T,S,T,E)},mdat:function(e){return t(w.mdat,e)},moof:function(e,i){for(var n=[],r=i.length;r--;)n[r]=v(i[r]);return t.apply(null,[w.moof,s(e)].concat(n))},moov:o=function(e){for(var i=e.length,n=[];i--;)n[i]=d(e[i]);return t.apply(null,[w.moov,u(4294967295)].concat(n).concat(l(e)))},initSegment:function(e){var t=r(),i=(e=o(e),new Uint8Array(t.byteLength+e.byteLength));return i.set(t),i.set(e,t.byteLength),i}},te=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},ie={groupNalsIntoFrames:function(e){var t,i,n=[],r=[];for(r.byteLength=0,r.nalCount=0,t=n.byteLength=r.duration=0;t<e.length;t++)"access_unit_delimiter_rbsp"===(i=e[t]).nalUnitType?(n.length&&(n.duration=i.dts-n.dts,r.byteLength+=n.byteLength,r.nalCount+=n.length,r.duration+=n.duration,r.push(n)),(n=[i]).byteLength=i.data.byteLength,n.pts=i.pts,n.dts=i.dts):("slice_layer_without_partitioning_rbsp_idr"===i.nalUnitType&&(n.keyFrame=!0),n.duration=i.dts-n.dts,n.byteLength+=i.data.byteLength,n.push(i));return r.length&&(!n.duration||n.duration<=0)&&(n.duration=r[r.length-1].duration),r.byteLength+=n.byteLength,r.nalCount+=n.length,r.duration+=n.duration,r.push(n),r},groupFramesIntoGops:function(e){var t,i,n=[],r=[];for(n.byteLength=0,n.nalCount=0,n.duration=0,n.pts=e[0].pts,n.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?(n.length&&(r.push(n),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration),(n=[i]).nalCount=i.length,n.byteLength=i.byteLength,n.pts=i.pts,n.dts=i.dts,n.duration=i.duration):(n.duration+=i.duration,n.nalCount+=i.length,n.byteLength+=i.byteLength,n.push(i));return r.length&&n.duration<=0&&(n.duration=r[r.length-1].duration),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration,r.push(n),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,n,r,s=t||0,a=[],o=0;o<e.length;o++)for(n=e[o],i=0;i<n.length;i++)s+=(r=V(r=n[i],s)).size,a.push(r);return a},concatenateNalData:function(e){for(var t,i,n,r,s,a=0,o=e.byteLength,l=e.nalCount,u=new Uint8Array(o+4*l),d=new DataView(u.buffer),c=0;c<e.length;c++)for(n=e[c],t=0;t<n.length;t++)for(r=n[t],i=0;i<r.length;i++)s=r[i],d.setUint32(a,s.data.byteLength),u.set(s.data,a+=4),a+=s.data.byteLength;return u},generateSampleTableForFrame:function(e,t){var i=[];e=V(e,t||0);return i.push(e),i},concatenateNalDataForFrame:function(e){for(var t,i=0,n=e.byteLength,r=e.length,s=new Uint8Array(n+4*r),a=new DataView(s.buffer),o=0;o<e.length;o++)t=e[o],a.setUint32(i,t.data.byteLength),s.set(t.data,i+=4),i+=t.data.byteLength;return s}},ne=[33,16,5,32,164,27],re=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],se=function(e){return 9e4*e},ae=function(e,t){return e*t},oe=function(e){return e/9e4},le=function(e,t){return e/t},ue={ONE_SECOND_IN_TS:9e4,secondsToVideoTs:se,secondsToAudioTs:ae,videoTsToSeconds:oe,audioTsToSeconds:le,audioTsToVideoTs:function(e,t){return e/t*9e4},videoTsToAudioTs:function(e,t){return e/9e4*t},metadataTsToSeconds:function(e,t,i){return oe(i?e:e-t)}},de=ue,ce=(se={prefixWithSilence:function(e,t,i,n){var r,s,a,o,l,u=0,d=0;if(t.length&&(s=de.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),r=Math.ceil(de.ONE_SECOND_IN_TS/(e.samplerate/1024)),i&&n&&(s-=Math.max(i,n),d=(u=Math.floor(s/r))*r),!(u<1||d>de.ONE_SECOND_IN_TS/2))){for(a=(a=function(){var e;return Z||(Z=Object.keys(e={96e3:[ne,[227,64],$(154),[56]],88200:[ne,[231],$(170),[56]],64e3:[ne,[248,192],$(240),[56]],48e3:[ne,[255,192],$(268),[55,148,128],$(54),[112]],44100:[ne,[255,192],$(268),[55,163,128],$(84),[112]],32e3:[ne,[255,192],$(268),[55,234],$(226),[112]],24e3:[ne,[255,192],$(268),[55,255,128],$(268),[111,112],$(126),[224]],16e3:[ne,[255,192],$(268),[55,255,128],$(268),[111,255],$(269),[223,108],$(195),[1,192]],12e3:[re,$(268),[3,127,248],$(268),[6,255,240],$(268),[13,255,224],$(268),[27,253,128],$(259),[56]],11025:[re,$(268),[3,127,248],$(268),[6,255,240],$(268),[13,255,224],$(268),[27,255,192],$(268),[55,175,128],$(108),[112]],8e3:[re,$(268),[3,121,16],$(47),[7]]}).reduce((function(t,i){return t[i]=new Uint8Array(e[i].reduce((function(e,t){return e.concat(t)}),[])),t}),{})),Z}()[e.samplerate])||t[0].data,o=0;o<u;o++)l=t[0],t.splice(0,0,{data:a,dts:l.dts-r,pts:l.pts-r});return e.baseMediaDecodeTime-=Math.floor(de.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=0;i<e.length;i++)t.push({size:e[i].data.byteLength,duration:1024});return t},concatenateFrameData:function(e){for(var t,i=0,n=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],n.set(t.data,i),i+=t.data.byteLength;return n}},ue.ONE_SECOND_IN_TS),he=(ae={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/ce,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))}},le={parseSei:function(e){for(var t=0,i={payloadType:-1,payloadSize:0},n=0,r=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)n+=255,t++;for(n+=e[t++];255===e[t];)r+=255,t++;if(r+=e[t++],!i.payload&&4===n){if("GA94"===String.fromCharCode(e[t+3],e[t+4],e[t+5],e[t+6])){i.payloadType=n,i.payloadSize=r,i.payload=e.subarray(t,t+r);break}i.payload=void 0}t+=r,r=n=0}return i},parseUserData:function(e){return 181!==e.payload[0]||49!=(e.payload[1]<<8|e.payload[2])||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},parseCaptionPackets:function(e,t){var i,n,r,s,a=[];if(64&t[0])for(n=31&t[0],i=0;i<n;i++)s={type:3&t[2+(r=3*i)],pts:e},4&t[2+r]&&(s.ccData=t[3+r]<<8|t[4+r],a.push(s));return a},discardEmulationPreventionBytes:function(e){for(var t=e.byteLength,i=[],n=1;n<t-2;)0===e[n]&&0===e[n+1]&&3===e[n+2]?(i.push(n+2),n+=2):n++;if(0===i.length)return e;var r=t-i.length,s=new Uint8Array(r),a=0;for(n=0;n<r;a++,n++)a===i[0]&&(a++,i.shift()),s[n]=e[a];return s},USER_DATA_REGISTERED_ITU_T_T35:4},j),pe=le,me=((W.prototype=new he).push=function(e){var t;"sei_rbsp"===e.nalUnitType&&(t=pe.parseSei(e.escapedRBSP)).payload&&t.payloadType===pe.USER_DATA_REGISTERED_ITU_T_T35&&(t=pe.parseUserData(t))&&(e.dts<this.latestDts_?this.ignoreNextEqualDts_=!0:e.dts===this.latestDts_&&this.ignoreNextEqualDts_?(this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1)):(t=pe.parseCaptionPackets(e.pts,t),this.captionPackets_=this.captionPackets_.concat(t),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts))},W.prototype.flushCCStreams=function(e){this.ccStreams_.forEach((function(t){return"flush"===e?t.flush():t.partialFlush()}),this)},W.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)},W.prototype.flush=function(){return this.flushStream("flush")},W.prototype.partialFlush=function(){return this.flushStream("partialFlush")},W.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach((function(e){e.reset()}))},W.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)},W.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},W.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)},W.prototype.setsTextOrXDSActive=function(e){return 256==(28928&e.ccData)||4138==(30974&e.ccData)||6186==(30974&e.ccData)},W.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}),fe=(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||{},fe.prototype.init.call(this);var t,i=this,n=e.captionServices||{},r={};Object.keys(n).forEach((e=>{t=n[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)}}),ge=(fe.prototype=new he,fe.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},fe.prototype.add708Bytes=function(e){var t=(i=e.ccData)>>>8,i=255&i;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(t),this.current708Packet.data.push(i)},fe.prototype.push708Packet=function(){var e,t=this.current708Packet,i=t.data,n=null,r=0,s=i[r++];for(t.seq=s>>6,t.sizeCode=63&s;r<i.length;r++)e=31&(s=i[r++]),7==(n=s>>5)&&0<e&&(n=i[r++]),this.pushServiceBlock(n,r,e),0<e&&(r+=e-1)},fe.prototype.pushServiceBlock=function(e,t,i){for(var n,r=t,s=this.current708Packet.data,a=(a=this.services[e])||this.initService(e,r);r<t+i&&r<s.length;r++)z(n=s[r])?r=this.handleText(r,a):24===n?r=this.multiByteCharacter(r,a):16===n?r=this.extendedCommands(r,a):128<=n&&n<=135?r=this.setCurrentWindow(r,a):152<=n&&n<=159?r=this.defineWindow(r,a):136===n?r=this.clearWindows(r,a):140===n?r=this.deleteWindows(r,a):137===n?r=this.displayWindows(r,a):138===n?r=this.hideWindows(r,a):139===n?r=this.toggleWindows(r,a):151===n?r=this.setWindowAttributes(r,a):144===n?r=this.setPenAttributes(r,a):145===n?r=this.setPenColor(r,a):146===n?r=this.setPenLocation(r,a):143===n?a=this.reset(r,a):8===n?a.currentWindow.backspace():12===n?a.currentWindow.clearText():13===n?a.currentWindow.pendingNewLine=!0:14===n?a.currentWindow.clearText():141===n&&r++},fe.prototype.extendedCommands=function(e,t){return z(this.current708Packet.data[++e])?this.handleText(e,t,{isExtended:!0}):e},fe.prototype.getPts=function(e){return this.current708Packet.ptsVals[Math.floor(e/2)]},fe.prototype.initService=function(e,t){var i,n="SERVICE"+e,r=this;return n in this.serviceEncodings&&(i=this.serviceEncodings[n]),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]},fe.prototype.handleText=function(e,t,i){var n,r=i&&i.isExtended,s=(i=i&&i.isMultiByte,r?4096:0),a=(o=this.current708Packet.data)[e],o=o[e+1],l=t.currentWindow;o=t.textDecoder_&&!r?(i?(n=[a,o],e++):n=[a],t.textDecoder_.decode(new Uint8Array(n))):(i=me[r=s|a]||r,4096&r&&r===i?"":String.fromCharCode(i));return l.pendingNewLine&&!l.isEmpty()&&l.newLine(this.getPts(e)),l.pendingNewLine=!1,l.addText(o),e},fe.prototype.multiByteCharacter=function(e,t){var i=(n=this.current708Packet.data)[e+1],n=n[e+2];return z(i)&&z(n)?this.handleText(++e,t,{isMultiByte:!0}):e},fe.prototype.setCurrentWindow=function(e,t){var i=this.current708Packet.data[e];return t.setCurrentWindow(7&i),e},fe.prototype.defineWindow=function(e,t){var i=this.current708Packet.data,n=i[e];t.setCurrentWindow(7&n),t=t.currentWindow,n=i[++e];return t.visible=(32&n)>>5,t.rowLock=(16&n)>>4,t.columnLock=(8&n)>>3,t.priority=7&n,n=i[++e],t.relativePositioning=(128&n)>>7,t.anchorVertical=127&n,n=i[++e],t.anchorHorizontal=n,n=i[++e],t.anchorPoint=(240&n)>>4,t.rowCount=15&n,n=i[++e],t.columnCount=63&n,n=i[++e],t.windowStyle=(56&n)>>3,t.penStyle=7&n,t.virtualRowCount=t.rowCount+1,e},fe.prototype.setWindowAttributes=function(e,t){var i=this.current708Packet.data,n=(t=(i[e],t.currentWindow.winAttr),i[++e]);return t.fillOpacity=(192&n)>>6,t.fillRed=(48&n)>>4,t.fillGreen=(12&n)>>2,t.fillBlue=3&n,n=i[++e],t.borderType=(192&n)>>6,t.borderRed=(48&n)>>4,t.borderGreen=(12&n)>>2,t.borderBlue=3&n,n=i[++e],t.borderType+=(128&n)>>5,t.wordWrap=(64&n)>>6,t.printDirection=(48&n)>>4,t.scrollDirection=(12&n)>>2,t.justify=3&n,n=i[++e],t.effectSpeed=(240&n)>>4,t.effectDirection=(12&n)>>2,t.displayEffect=3&n,e},fe.prototype.flushDisplayed=function(e,t){for(var i=[],n=0;n<8;n++)t.windows[n].visible&&!t.windows[n].isEmpty()&&i.push(t.windows[n].getText());t.endPts=e,t.text=i.join("\n\n"),this.pushCaption(t),t.startPts=e},fe.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts)},fe.prototype.displayWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<<r&&(t.windows[r].visible=1);return e},fe.prototype.hideWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<<r&&(t.windows[r].visible=0);return e},fe.prototype.toggleWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<<r&&(t.windows[r].visible^=1);return e},fe.prototype.clearWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<<r&&t.windows[r].clearText();return e},fe.prototype.deleteWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<<r&&t.windows[r].reset();return e},fe.prototype.setPenAttributes=function(e,t){var i=this.current708Packet.data,n=(t=(i[e],t.currentWindow.penAttr),i[++e]);return t.textTag=(240&n)>>4,t.offset=(12&n)>>2,t.penSize=3&n,n=i[++e],t.italics=(128&n)>>7,t.underline=(64&n)>>6,t.edgeType=(56&n)>>3,t.fontStyle=7&n,e},fe.prototype.setPenColor=function(e,t){var i=this.current708Packet.data,n=(t=(i[e],t.currentWindow.penColor),i[++e]);return t.fgOpacity=(192&n)>>6,t.fgRed=(48&n)>>4,t.fgGreen=(12&n)>>2,t.fgBlue=3&n,n=i[++e],t.bgOpacity=(192&n)>>6,t.bgRed=(48&n)>>4,t.bgGreen=(12&n)>>2,t.bgBlue=3&n,n=i[++e],t.edgeRed=(48&n)>>4,t.edgeGreen=(12&n)>>2,t.edgeBlue=3&n,e},fe.prototype.setPenLocation=function(e,t){var i=this.current708Packet.data,n=(i[e],t.currentWindow.penLoc);return t.currentWindow.pendingNewLine=!0,t=i[++e],n.row=15&t,t=i[++e],n.column=63&t,e},fe.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}),ye=14,ve=[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,n,r,s=32639&e.ccData;s===this.lastControlCode_?this.lastControlCode_=null:(4096==(61440&s)?this.lastControlCode_=s:s!==this.PADDING_&&(this.lastControlCode_=null),t=s>>>8,i=255&s,s!==this.PADDING_&&(s===this.RESUME_CAPTION_LOADING_?this.mode_="popOn":s===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):s===this.ROLL_UP_2_ROWS_?(this.rollUpRows_=2,this.setRollUp(e.pts)):s===this.ROLL_UP_3_ROWS_?(this.rollUpRows_=3,this.setRollUp(e.pts)):s===this.ROLL_UP_4_ROWS_?(this.rollUpRows_=4,this.setRollUp(e.pts)):s===this.CARRIAGE_RETURN_?(this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts):s===this.BACKSPACE_?"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1):s===this.ERASE_DISPLAYED_MEMORY_?(this.flushDisplayed(e.pts),this.displayed_=Q()):s===this.ERASE_NON_DISPLAYED_MEMORY_?this.nonDisplayed_=Q():s===this.RESUME_DIRECT_CAPTIONING_?("paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=Q()),this.mode_="paintOn",this.startPts_=e.pts):this.isSpecialCharacter(t,i)?(n=K((t=(3&t)<<8)|i),this[this.mode_](e.pts,n),this.column_++):this.isExtCharacter(t,i)?("popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),n=K((t=(3&t)<<8)|i),this[this.mode_](e.pts,n),this.column_++):this.isMidRowCode(t,i)?(this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,!(14&~i)&&this.addFormatting(e.pts,["i"]),!(1&~i)&&this.addFormatting(e.pts,["u"])):this.isOffsetControlCode(t,i)?this.column_+=3&i:this.isPAC(t,i)?(r=ve.indexOf(7968&s),"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&~s)&&(this.column_=4*((14&s)>>1)),this.isColorPAC(i)&&!(14&~i)&&this.addFormatting(e.pts,["i"])):this.isNormalChar(t)&&(0===i&&(i=null),n=K(t),n+=K(i),this[this.mode_](e.pts,n),this.column_+=n.length)))}},be=(he=(_e.prototype=new he,_e.prototype.flushDisplayed=function(e){var t=this.displayed_.map((function(e,t){try{return e.trim()}catch(e){return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+t+"."}),""}}),this).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},_e.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Q(),this.nonDisplayed_=Q(),this.lastControlCode_=null,this.column_=0,this.row_=ye,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_=ye,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=Q(),this.displayed_=Q()),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]="";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_];this.nonDisplayed_[this.row_]=i+=t},_e.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_];this.displayed_[this.row_]=i+=t},_e.prototype.shiftRowsUp_=function(){for(var e=0;e<this.topRow_;e++)this.displayed_[e]="";for(e=this.row_+1;e<ye+1;e++)this.displayed_[e]="";for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]=""},_e.prototype.paintOn=function(e,t){var i=this.displayed_[this.row_];this.displayed_[this.row_]=i+=t},{CaptionStream:W,Cea608Stream:_e,Cea708Stream:fe}),{H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21}),we=j,Te=8589934592,Se=4294967296;function Ee(e,t,i){for(var n="",r=t;r<i;r++)n+="%"+("00"+e[r].toString(16)).slice(-2);return n}function ke(e,t,i){return decodeURIComponent(Ee(e,t,i))}function Ce(e,t,i){return unescape(Ee(e,t,i))}function xe(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]}J.prototype=new we;we=J;var Ie,Ae,Pe,Oe=(e,t,i)=>{if(e)for(var n=i;n<e.length;n++)if(e[n]===t)return n;return-1},Le={APIC:function(e){var t,i=1;3!==e.data[0]||(t=Oe(e.data,0,1))<0||(e.mimeType=Ce(e.data,1,t),e.pictureType=e.data[i=t+1],(t=Oe(e.data,0,++i))<0)||(e.description=ke(e.data,i,t),i=t+1,"--\x3e"===e.mimeType?e.url=Ce(e.data,i,e.data.length):e.pictureData=e.data.subarray(i,e.data.length))},"T*":function(e){3===e.data[0]&&(e.value=ke(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=Oe(e.data,0,1))&&(e.description=ke(e.data,1,t),e.value=ke(e.data,t+1,e.data.length).replace(/\0*$/,""),e.data=e.value)},"W*":function(e){e.url=Ce(e.data,0,e.data.length).replace(/\0.*$/,"")},WXXX:function(e){var t;3===e.data[0]&&-1!==(t=Oe(e.data,0,1))&&(e.description=ke(e.data,1,t),e.url=Ce(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=Ce(e.data,0,t);break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}},De={parseId3Frames:function(e){var t,i=10,n=0,r=[];if(!(e.length<10||73!==e[0]||68!==e[1]||51!==e[2])){n=xe(e.subarray(6,10)),n+=10,64&e[5]&&(i=(i+=4)+xe(e.subarray(10,14)),n-=xe(e.subarray(16,20)));do{if((t=xe(e.subarray(i+4,i+8)))<1)break;var s={id:String.fromCharCode(e[i],e[i+1],e[i+2],e[i+3]),data:e.subarray(i+10,i+t+10)}}while(s.key=s.id,Le[s.id]?Le[s.id](s):"T"===s.id[0]?Le["T*"](s):"W"===s.id[0]&&Le["W*"](s),r.push(s),(i=i+10+t)<n);return r}},parseSyncSafeInteger:xe,frameParsers:Le},Me=j,Ne=be,Re=De,Ue=function(e){var t,i={descriptor:e&&e.descriptor},n=0,r=[],s=0;if(Ue.prototype.init.call(this),this.dispatchType=Ne.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,u,d;if("timed-metadata"===e.type)if(e.dataAlignmentIndicator&&(s=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),s+=e.data.byteLength,1===r.length&&(n=Re.parseSyncSafeInteger(e.data.subarray(6,10)),n+=10),!(s<n)){for(t={data:new Uint8Array(n),frames:[],pts:r[0].pts,dts:r[0].dts},o=0;o<n;)t.data.set(r[0].data.subarray(0,n-o),o),o+=r[0].data.byteLength,s-=r[0].data.byteLength,r.shift();i=10,64&t.data[5]&&(i=(i+=4)+Re.parseSyncSafeInteger(t.data.subarray(10,14)),n-=Re.parseSyncSafeInteger(t.data.subarray(16,20)));do{if((a=Re.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,Re.frameParsers[d.id]?Re.frameParsers[d.id](d):"T"===d.id[0]?Re.frameParsers["T*"](d):"W"===d.id[0]&&Re.frameParsers["W*"](d),"com.apple.streaming.transportStreamTimestamp"===d.owner&&(u=(1&(l=d.data)[3])<<30|l[4]<<22|l[5]<<14|l[6]<<6|l[7]>>>2,u=(u*=4)+(3&l[7]),d.timeStamp=u,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)<n);this.trigger("data",t)}}},Be=(De=(Ue.prototype=new Me,Ue),Me=j,he),je=be,Fe=function(){var e=new Uint8Array(188),t=0;Fe.prototype.init.call(this),this.push=function(i){var n,r=0,s=188;for(t?((n=new Uint8Array(i.byteLength+t)).set(e.subarray(0,t)),n.set(i,t),t=0):n=i;s<n.byteLength;)71===n[r]&&71===n[s]?(this.trigger("data",n.subarray(r,s)),r+=188,s+=188):(r++,s++);r<n.byteLength&&(e.set(n.subarray(r),0),t=n.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")}},qe=(Fe.prototype=new Me,(Ie=function(){var e,t,i,n;Ie.prototype.init.call(this),(n=this).packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,n){var r=0;n.payloadUnitStartIndicator&&(r+=e[r]+1),("pat"===n.type?t:i)(e.subarray(r),n)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],n.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=n.pmtPid},i=function(e,t){var i,r;if(1&e[5]){for(n.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 s=e[r],a=(31&e[r+1])<<8|e[r+2];s===je.H264_STREAM_TYPE&&null===n.programMapTable.video?n.programMapTable.video=a:s===je.ADTS_STREAM_TYPE&&null===n.programMapTable.audio?n.programMapTable.audio=a:s===je.METADATA_STREAM_TYPE&&(n.programMapTable["timed-metadata"][a]=s),r+=5+((15&e[r+3])<<8|e[r+4])}t.programMapTable=n.programMapTable}},this.push=function(t){var i={},n=4;if(i.payloadUnitStartIndicator=!!(64&t[1]),i.pid=31&t[1],i.pid<<=8,i.pid|=t[2],1<(48&t[3])>>>4&&(n+=t[n]+1),0===i.pid)i.type="pat",e(t.subarray(n),i),this.trigger("data",i);else if(i.pid===this.pmtPid)for(i.type="pmt",e(t.subarray(n),i),this.trigger("data",i);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,n,i]):this.processPes_(t,n,i)},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=je.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=je.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 Me,Ie.STREAM_TYPES={h264:27,adts:15},(Ae=function(){function e(e,t,n){var r,s=new Uint8Array(e.size),a={type:t},l=0,u=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],s.set(r.data,u),u+=r.data.byteLength;o(s,a),t="video"===t||a.packetLength<=e.size,(n||t)&&(e.size=0,e.data.length=0),t&&i.trigger("data",a)}}var t,i=this,n=!1,r={data:[],size:0},s={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=!!(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]))};Ae.prototype.init.call(this),this.push=function(o){({pat:function(){},pes:function(){var t,i;switch(o.streamType){case je.H264_STREAM_TYPE:t=r,i="video";break;case je.ADTS_STREAM_TYPE:t=s,i="audio";break;case je.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"}),n=!0,i.trigger("data",e)}})[o.type]()},this.reset=function(){r.size=0,r.data.length=0,s.size=0,s.data.length=0,this.trigger("reset")},this.flushStreams_=function(){e(r,"video"),e(s,"audio"),e(a,"timed-metadata")},this.flush=function(){var e;!n&&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)),n=!1,this.flushStreams_(),this.trigger("done")}}).prototype=new Me,{PAT_PID:0,MP2T_PACKET_LENGTH:188,TransportPacketStream:Fe,TransportParseStream:Ie,ElementaryStream:Ae,TimestampRolloverStream:we,CaptionStream:Be.CaptionStream,Cea608Stream:Be.Cea608Stream,Cea708Stream:Be.Cea708Stream,MetadataStream:De});for(Pe in je)je.hasOwnProperty(Pe)&&(qe[Pe]=je[Pe]);Me=qe,we=j;var He,Ve,$e=ue.ONE_SECOND_IN_TS,We=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],ze=function(e){var t,i=0;ze.prototype.init.call(this),this.skipWarn_=function(e,t){this.trigger("log",{level:"warn",message:`adts skiping bytes ${e} to ${t} in frame ${i} outside syncword`})},this.push=function(n){var r,s,a,o,l,u,d=0;if(e||(i=0),"audio"===n.type){for(t&&t.length?(a=t,(t=new Uint8Array(a.byteLength+n.data.byteLength)).set(a),t.set(n.data,a.byteLength)):t=n.data;d+7<t.length;)if(255!==t[d]||240!=(246&t[d+1]))"number"!=typeof u&&(u=d),d++;else{if("number"==typeof u&&(this.skipWarn_(u,d),u=null),s=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])))*$e/We[(60&t[d+2])>>>2],t.byteLength-d<r)break;this.trigger("data",{pts:n.pts+i*l,dts:n.dts+i*l,sampleCount:o,audioobjecttype:1+(t[d+2]>>>6&3),channelcount:(1&t[d+2])<<2|(192&t[d+3])>>>6,samplerate:We[(60&t[d+2])>>>2],samplingfrequencyindex:(60&t[d+2])>>>2,samplesize:16,data:t.subarray(d+7+s,d+r)}),i++,d+=r}"number"==typeof u&&(this.skipWarn_(u,d),u=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")}},Ge=(Be=(ze.prototype=new we,ze),De=j,function(e){var t=e.byteLength,i=0,n=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+n},this.loadWord=function(){var r=e.byteLength-t,s=new Uint8Array(4),a=Math.min(4,t);if(0===a)throw Error("no bytes available");s.set(e.subarray(r,r+a)),i=new DataView(s.buffer).getUint32(0),n=8*a,t-=a},this.skipBits=function(e){var r;e<n||(e=(e-=n)-8*(r=Math.floor(e/8)),t-=r,this.loadWord()),i<<=e,n-=e},this.readBits=function(e){var r=Math.min(n,e),s=i>>>32-r;return 0<(n-=r)?i<<=r:0<t&&this.loadWord(),0<(r=e-r)?s<<r|this.readBits(r):s},this.skipLeadingZeros=function(){for(var e=0;e<n;++e)if(i&2147483648>>>e)return i<<=e,n-=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()}),Xe=function(){var e,t,i=0;Xe.prototype.init.call(this),this.push=function(n){for(var r,s=(t=t?((r=new Uint8Array(t.byteLength+n.data.byteLength)).set(t),r.set(n.data,t.byteLength),r):n.data).byteLength;i<s-3;i++)if(1===t[i+2]){e=i+5;break}for(;e<s;)switch(t[e]){case 0:if(0!==t[e-1])e+=2;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<s;);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 Ke(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]}Xe.prototype=new De,Ve={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},(He=function(){var e,t,i,n,r,s,a,o=new Xe;He.prototype.init.call(this),(e=this).push=function(e){"video"===e.type&&(t=e.trackId,i=e.pts,n=e.dts,o.push(e))},o.on("data",(function(a){var o={trackId:t,pts:i,dts:n,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=s(o.escapedRBSP);break;case 8:o.nalUnitType="pic_parameter_set_rbsp";break;case 9:o.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",o)})),o.on("done",(function(){e.trigger("done")})),o.on("partialdone",(function(){e.trigger("partialdone")})),o.on("reset",(function(){e.trigger("reset")})),o.on("endedtimeline",(function(){e.trigger("endedtimeline")})),this.flush=function(){o.flush()},this.partialFlush=function(){o.partialFlush()},this.reset=function(){o.reset()},this.endTimeline=function(){o.endTimeline()},a=function(e,t){for(var i=8,n=8,r=0;r<e;r++)i=0===(n=0!==n?(i+t.readExpGolomb()+256)%256:n)?i:n},r=function(e){for(var t=e.byteLength,i=[],n=1;n<t-2;)0===e[n]&&0===e[n+1]&&3===e[n+2]?(i.push(n+2),n+=2):n++;if(0===i.length)return e;var r=t-i.length,s=new Uint8Array(r),a=0;for(n=0;n<r;a++,n++)a===i[0]&&(a++,i.shift()),s[n]=e[a];return s},s=function(e){var t,i,n,r,s,o,l=0,u=0,d=0,c=0,h=[1,1],p=new Ge(e),m=(e=p.readUnsignedByte(),p.readUnsignedByte()),f=p.readUnsignedByte();if(p.skipUnsignedExpGolomb(),Ve[e]&&(3===(i=p.readUnsignedExpGolomb())&&p.skipBits(1),p.skipUnsignedExpGolomb(),p.skipUnsignedExpGolomb(),p.skipBits(1),p.readBoolean()))for(s=3!==i?8:12,o=0;o<s;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(),n=p.readUnsignedExpGolomb(),0===(r=p.readBits(1))&&p.skipBits(1),p.skipBits(1),p.readBoolean()&&(l=p.readUnsignedExpGolomb(),u=p.readUnsignedExpGolomb(),d=p.readUnsignedExpGolomb(),c=p.readUnsignedExpGolomb()),p.readBoolean()&&p.readBoolean()){switch(p.readUnsignedByte()){case 1:h=[1,1];break;case 2:h=[12,11];break;case 3:h=[10,11];break;case 4:h=[16,11];break;case 5:h=[40,33];break;case 6:h=[24,11];break;case 7:h=[20,11];break;case 8:h=[32,11];break;case 9:h=[80,33];break;case 10:h=[18,11];break;case 11:h=[15,11];break;case 12:h=[64,33];break;case 13:h=[160,99];break;case 14:h=[4,3];break;case 15:h=[3,2];break;case 16:h=[2,1];break;case 255:h=[p.readUnsignedByte()<<8|p.readUnsignedByte(),p.readUnsignedByte()<<8|p.readUnsignedByte()]}h&&(h[0],h[1])}return{profileIdc:e,levelIdc:f,profileCompatibility:m,width:16*(i+1)-2*l-2*u,height:(2-r)*(n+1)*16-2*d-2*c,sarRatio:h}}}).prototype=new De;we=He;var Qe=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],Ye=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},Je=function(e,t){return e.length-t<10||73!==e[t]||68!==e[t+1]||51!==e[t+2]?t:(t+=Ye(e,t),Je(e,t))},Ze=function(e,t,i){for(var n="",r=t;r<i;r++)n+="%"+("00"+e[r].toString(16)).slice(-2);return n},et=(De={isLikelyAacData:function(e){var t=Je(e,0);return e.length>=t+2&&!(255&~e[t])&&!(240&~e[t+1])&&16==(22&e[t+1])},parseId3TagSize:Ye,parseAdtsSize:function(e,t){var i=(224&e[t+5])>>5,n=e[t+4]<<3;return 6144&e[t+3]|n|i},parseType:function(e,t){return 73===e[t]&&68===e[t+1]&&51===e[t+2]?"timed-metadata":!0&e[t]&&!(240&~e[t+1])?"audio":null},parseSampleRate:function(e){for(var t=0;t+5<e.length;){if(255===e[t]&&240==(246&e[t+1]))return Qe[(60&e[t+2])>>>2];t++}return null},parseAacTimestamp:function(e){var t,i=10;64&e[5]&&(i=(i+=4)+Ke(e.subarray(10,14)));do{if((t=Ke(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 n,r,s=e.subarray(i+10,i+t+10),a=0;a<s.byteLength;a++)if(0===s[a]){if("com.apple.streaming.transportStreamTimestamp"===unescape(Ze(s,0,a)))return r=(1&(n=s.subarray(a+1))[3])<<30|n[4]<<22|n[5]<<14|n[6]<<6|n[7]>>>2,(r*=4)+(3&n[7]);break}}while((i=i+10+t)<e.byteLength);return null}},j),tt=De,it=function(){var e=new Uint8Array,t=0;it.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(i){var n,r,s=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+(s=tt.parseId3TagSize(e,a))>e.length)break;n={type:"timed-metadata",data:e.subarray(a,a+s)},this.trigger("data",n),a+=s}else if(255&~e[a]||240&~e[a+1])a++;else{if(e.length-a<7||a+(s=tt.parseAdtsSize(e,a))>e.length)break;n={type:"audio",data:e.subarray(a,a+s),pts:t,dts:t},this.trigger("data",n),a+=s}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 nt(e,t){for(var i=Object.keys(t),n=0;n<i.length;n++){var r=i[n];"headOfPipeline"!==r&&t[r].on&&t[r].on("log",Tt.bind(e,r))}}function rt(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 st(e,t,i,n,r,s){return{start:{dts:e,pts:e+(i-t)},end:{dts:e+(n-t),pts:e+(r-i)},prependedContentDuration:s,baseMediaDecodeTime:e}}it.prototype=new et;et=j;var at,ot,lt,ut=ee,dt=ie,ct=se,ht=ae,pt=Me,mt=ue,ft=Be,gt=we,yt=it,vt=De.isLikelyAacData,_t=ue.ONE_SECOND_IN_TS,bt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],wt=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Tt=function(e,t){t.stream=e,this.trigger("log",t)},St=function(e,t){var i=[],n=0,r=0,s=1/0,a=(t=t||{}).firstSequenceNumber||0;St.prototype.init.call(this),this.push=function(t){ht.collectDtsInfo(e,t),e&&bt.forEach((function(i){e[i]=t[i]})),i.push(t)},this.setEarliestDts=function(e){n=e},this.setVideoBaseMediaDecodeTime=function(e){s=e},this.setAudioAppendStart=function(e){r=e},this.flush=function(){var o,l,u,d,c;0!==i.length&&(o=ct.trimAdtsFramesByEarliestDts(i,e,n),e.baseMediaDecodeTime=ht.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),c=ct.prefixWithSilence(e,o,r,s),e.samples=ct.generateSampleTable(o),u=ut.mdat(ct.concatenateFrameData(o)),i=[],d=ut.moof(a,[e]),l=new Uint8Array(d.byteLength+u.byteLength),a++,l.set(d),l.set(u,d.byteLength),ht.clearDtsInfo(e),u=Math.ceil(1024*_t/e.samplerate),o.length&&(d=o.length*u,this.trigger("segmentTimingInfo",st(mt.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),o[0].dts,o[0].pts,o[0].dts+d,o[0].pts+d,c||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(){ht.clearDtsInfo(e),i=[],this.trigger("reset")}};function Et(e){var t="";return(t+=String.fromCharCode(e[0]))+String.fromCharCode(e[1])+String.fromCharCode(e[2])+String.fromCharCode(e[3])}function kt(e,t){var i,n,r,s=[];if(!t.length)return null;for(i=0;i<e.byteLength;)n=Ot(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3]),r=Lt(e.subarray(i+4,i+8)),n=1<n?i+n:e.byteLength,r===t[0]&&(1===t.length?s.push(e.subarray(i+8,n)):(r=kt(e.subarray(i+8,n),t.slice(1))).length&&(s=s.concat(r))),i=n;return s}function Ct(e){return(31&e[1])<<8|e[2]}function xt(e){return!!(64&e[1])}function It(e){var t=0;return 1<(48&e[3])>>>4&&(t+=e[4]+1),t}function At(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}}St.prototype=new et,(at=function(e,t){var i,n,r=[],s=[],a=(t=t||{}).firstSequenceNumber||0;at.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){ht.collectDtsInfo(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||i||(i=t.config,e.sps=[t.data],wt.forEach((function(t){e[t]=i[t]}),this)),"pic_parameter_set_rbsp"!==t.nalUnitType||n||(n=t.data,e.pps=[t.data]),r.push(t)},this.flush=function(){for(var i,n,o,l=0;r.length&&"access_unit_delimiter_rbsp"!==r[0].nalUnitType;)r.shift();if(0!==r.length){if(i=dt.groupNalsIntoFrames(r),(i=dt.groupFramesIntoGops(i))[0][0].keyFrame||((u=this.getGopForFusion_(r[0],e))?(l=u.duration,i.unshift(u),i.byteLength+=u.byteLength,i.nalCount+=u.nalCount,i.pts=u.pts,i.dts=u.dts,i.duration+=u.duration):i=dt.extendFirstKeyFrame(i)),s.length){var u=t.alignGopsAtEnd?this.alignGopsAtEnd_(i):this.alignGopsAtStart_(i);if(!u)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_(),void this.trigger("done","VideoSegmentStream");ht.clearDtsInfo(e),i=u}ht.collectDtsInfo(e,i),e.samples=dt.generateSampleTable(i),u=ut.mdat(dt.concatenateNalData(i)),e.baseMediaDecodeTime=ht.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",i.map((function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}}))),n=i[0],o=i[i.length-1],this.trigger("segmentTimingInfo",st(e.baseMediaDecodeTime,n.dts,n.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),n=ut.moof(a,[e]),o=new Uint8Array(n.byteLength+u.byteLength),a++,o.set(n),o.set(u,n.byteLength),this.trigger("data",{track:e,boxes:o})}this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),r=[],this.gopCache_.length=0,s.length=0,this.trigger("reset")},this.resetStream_=function(){ht.clearDtsInfo(e),n=i=void 0},this.getGopForFusion_=function(t){for(var i,n,r,s=1/0,a=0;a<this.gopCache_.length;a++)n=(r=this.gopCache_[a]).gop,e.pps&&rt(e.pps[0],r.pps[0])&&e.sps&&rt(e.sps[0],r.sps[0])&&(n.dts<e.timelineStartInfo.dts||-1e4<=(n=t.dts-n.dts-n.duration)&&n<=45e3&&(!i||n<s)&&(i=r,s=n));return i?i.gop:null},this.alignGopsAtStart_=function(e){for(var t,i,n,r,a=e.byteLength,o=e.nalCount,l=e.duration,u=t=0;u<s.length&&t<e.length&&(i=s[u],n=e[t],i.pts!==n.pts);)n.pts>i.pts?u++:(t++,a-=n.byteLength,o-=n.nalCount,l-=n.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,n,r,a=s.length-1,o=e.length-1,l=null,u=!1;0<=a&&0<=o;){if(t=s[a],i=e[o],t.pts===i.pts){u=!0;break}t.pts>i.pts?a--:(a===s.length-1&&(l=o),o--)}return u||null!==l?0===(n=u?o:l)?e:(r=(n=e.slice(n)).reduce((function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e}),{byteLength:0,duration:0,nalCount:0}),n.byteLength=r.byteLength,n.duration=r.duration,n.nalCount=r.nalCount,n.pts=n[0].pts,n.dts=n[0].dts,n):null},this.alignGopsWith=function(e){s=e}}).prototype=new et,((lt=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,lt.prototype.init.call(this),this.push=function(e){return 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 et).flush=function(e){var t,i,n,r=0,s={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,wt.forEach((function(e){s.info[e]=this.videoTrack[e]}),this)):this.audioTrack&&(a=this.audioTrack.timelineStartInfo.pts,bt.forEach((function(e){s.info[e]=this.audioTrack[e]}),this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?s.type=this.pendingTracks[0].type:s.type="combined",this.emittedTracks+=this.pendingTracks.length,e=ut.initSegment(this.pendingTracks),s.initSegment=new Uint8Array(e.byteLength),s.initSegment.set(e),s.data=new Uint8Array(this.pendingBytes),n=0;n<this.pendingBoxes.length;n++)s.data.set(this.pendingBoxes[n],r),r+=this.pendingBoxes[n].byteLength;for(n=0;n<this.pendingCaptions.length;n++)(t=this.pendingCaptions[n]).startTime=mt.metadataTsToSeconds(t.startPts,a,this.keepOriginalTimestamps),t.endTime=mt.metadataTsToSeconds(t.endPts,a,this.keepOriginalTimestamps),s.captionStreams[t.stream]=!0,s.captions.push(t);for(n=0;n<this.pendingMetadata.length;n++)(i=this.pendingMetadata[n]).cueTime=mt.metadataTsToSeconds(i.pts,a,this.keepOriginalTimestamps),s.metadata.push(i);for(s.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",s),n=0;n<s.captions.length;n++)t=s.captions[n],this.trigger("caption",t);for(n=0;n<s.metadata.length;n++)i=s.metadata[n],this.trigger("id3Frame",i)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},lt.prototype.setRemux=function(e){this.remuxTracks=e},(ot=function(e){var t,i,n=this,r=!0;ot.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 pt.MetadataStream,r.aacStream=new yt,r.audioTimestampRolloverStream=new pt.TimestampRolloverStream("audio"),r.timedMetadataTimestampRolloverStream=new pt.TimestampRolloverStream("timed-metadata"),r.adtsStream=new ft,r.coalesceStream=new lt(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(s){"timed-metadata"!==s.type&&"audio"!==s.type||r.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:n.baseMediaDecodeTime},codec:"adts",type:"audio"},r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new St(i,e),r.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t}))})),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("done",this.trigger.bind(this,"done")),nt(this,r)},this.setupTsPipeline=function(){var r={};(this.transmuxPipeline_=r).type="ts",r.metadataStream=new pt.MetadataStream,r.packetStream=new pt.TransportPacketStream,r.parseStream=new pt.TransportParseStream,r.elementaryStream=new pt.ElementaryStream,r.timestampRolloverStream=new pt.TimestampRolloverStream,r.adtsStream=new ft,r.h264Stream=new gt,r.captionStream=new pt.CaptionStream(e),r.coalesceStream=new lt(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(s){var a;if("metadata"===s.type){for(a=s.tracks.length;a--;)t||"video"!==s.tracks[a].type?i||"audio"!==s.tracks[a].type||((i=s.tracks[a]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime):(t=s.tracks[a]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime;t&&!r.videoSegmentStream&&(r.coalesceStream.numberOfTracks++,r.videoSegmentStream=new at(t,e),r.videoSegmentStream.on("log",n.getLogTrigger_("videoSegmentStream")),r.videoSegmentStream.on("timelineStartInfo",(function(t){i&&!e.keepOriginalTimestamps&&(i.timelineStartInfo=t,r.audioSegmentStream.setEarliestDts(t.dts-n.baseMediaDecodeTime))})),r.videoSegmentStream.on("processedGopsInfo",n.trigger.bind(n,"gopInfo")),r.videoSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"videoSegmentTimingInfo")),r.videoSegmentStream.on("baseMediaDecodeTime",(function(e){i&&r.audioSegmentStream.setVideoBaseMediaDecodeTime(e)})),r.videoSegmentStream.on("timingInfo",n.trigger.bind(n,"videoTimingInfo")),r.h264Stream.pipe(r.videoSegmentStream).pipe(r.coalesceStream)),i&&!r.audioSegmentStream&&(r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new St(i,e),r.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),r.audioSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"audioSegmentTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream)),n.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,n.trigger("id3Frame",e)})),r.coalesceStream.on("caption",this.trigger.bind(this,"caption")),r.coalesceStream.on("done",this.trigger.bind(this,"done")),nt(this,r)},this.setBaseMediaDecodeTime=function(n){var r=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=n),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,ht.clearDtsInfo(i),r.audioTimestampRolloverStream)&&r.audioTimestampRolloverStream.discontinuity(),t&&(r.videoSegmentStream&&(r.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,ht.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=vt(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 et;var Pt=ot,Ot=(j=function(e){return e>>>0},se=function(e){return("00"+e.toString(16)).slice(-2)},j),Lt=Et,Dt=j,Mt=F,Nt=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]}},Rt=(Me=ae="undefined"!=typeof window?window:void 0!==B?B:"undefined"!=typeof self?self:{},le.discardEmulationPreventionBytes),Ut=he.CaptionStream,Bt=kt,jt=Me,Ft=function(e,t){var i=Bt(e,["moof","traf"]),n=(e=Bt(e,["mdat"]),{}),r=[];return e.forEach((function(e,t){t=i[t],r.push({mdat:e,traf:t})})),r.forEach((function(e){var i,r,s,a,o,l=e.mdat,u=(e=e.traf,function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=1&(e={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:t.getUint32(4)}).flags[2],n=2&e.flags[2],r=8&e.flags[2],s=16&e.flags[2],a=32&e.flags[2],o=65536&e.flags[0],l=131072&e.flags[0],u=8;return i&&(u+=4,e.baseDataOffset=t.getUint32(12),u+=4),n&&(e.sampleDescriptionIndex=t.getUint32(u),u+=4),r&&(e.defaultSampleDuration=t.getUint32(u),u+=4),s&&(e.defaultSampleSize=t.getUint32(u),u+=4),a&&(e.defaultSampleFlags=t.getUint32(u)),o&&(e.durationIsEmpty=!0),!i&&l&&(e.baseDataOffsetIsMoof=!0),e}((u=Bt(e,["tfhd"]))[0])),d=u.trackId,c=0<(c=Bt(e,["tfdt"])).length?function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4))};return t.baseMediaDecodeTime=1===t.version?Mt(e.subarray(4)):Dt(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),t}(c[0]).baseMediaDecodeTime:0;e=Bt(e,["trun"]);t===d&&0<e.length&&(i=c,r=u.defaultSampleDuration||0,s=u.defaultSampleSize||0,a=u.trackId,o=[],e.forEach((function(e){(e=function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=1&i.flags[2],s=4&i.flags[2],a=1&i.flags[1],o=2&i.flags[1],l=4&i.flags[1],u=8&i.flags[1],d=n.getUint32(4),c=8;for(r&&(i.dataOffset=n.getInt32(c),c+=4),s&&d&&(t={flags:Nt(e.subarray(c,c+4))},c+=4,a&&(t.duration=n.getUint32(c),c+=4),o&&(t.size=n.getUint32(c),c+=4),u&&(t.compositionTimeOffset=1===i.version?n.getInt32(c):n.getUint32(c),c+=4),i.samples.push(t),d--);d--;)t={},a&&(t.duration=n.getUint32(c),c+=4),o&&(t.size=n.getUint32(c),c+=4),l&&(t.flags=Nt(e.subarray(c,c+4)),c+=4),u&&(t.compositionTimeOffset=1===i.version?n.getInt32(c):n.getUint32(c),c+=4),i.samples.push(t);return i}(e).samples).forEach((function(e){void 0===e.duration&&(e.duration=r),void 0===e.size&&(e.size=s),e.trackId=a,e.dts=i,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),"bigint"==typeof i?(e.pts=i+jt.BigInt(e.compositionTimeOffset),i+=jt.BigInt(e.duration)):(e.pts=i+e.compositionTimeOffset,i+=e.duration)})),o=o.concat(e)})),c=function(e,t,i){for(var n,r,s=new DataView(e.buffer,e.byteOffset,e.byteLength),a={logs:[],seiNals:[]},o=0;o+4<e.length;o+=n)if(n=s.getUint32(o),o+=4,!(n<=0))switch(31&e[o]){case 6:var l=e.subarray(o+1,o+1+n),u=function(e,t){for(var i=e,n=0;n<t.length;n++){var r=t[n];if(i<r.size)return r;i-=r.size}return null}(o,t);l={nalUnitType:"sei_rbsp",size:n,data:l,escapedRBSP:Rt(l),trackId:i};if(u)l.pts=u.pts,l.dts=u.dts,r=u;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),n[d]||(n[d]={seiNals:[],logs:[]}),n[d].seiNals=n[d].seiNals.concat(c.seiNals),n[d].logs=n[d].logs.concat(c.logs))})),n},qt=function(){var e,t,i,n,r,s,a=!1;this.isInitialized=function(){return a},this.init=function(t){e=new Ut,a=!0,s=!!t&&t.isPartial,e.on("data",(function(e){e.startTime=e.startPts/n,e.endTime=e.endPts/n,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]&&n===t[i])},this.parse=function(e,s,a){var o,l;if(!this.isInitialized()||!s||!a)return null;if(this.isNewInit(s,a))n=a[i=s[0]];else if(null===i||!n)return t.push(e),null;for(;0<t.length;){var u=t.shift();this.parse(u,s,a)}return l=n,(o=null===(o=i)?null:{seiNals:(e=Ft(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;s?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=[],n=i=null,r?this.clearParsedCaptions():r={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},Ht=j,Vt=se,$t=kt,Wt=Et,zt=F,Gt=Me,Xt=function(e){e=$t(e,["moov","trak"]);var t=[];return e.forEach((function(e){var i,n,r={},s=((s=((n=$t(e,["tkhd"])[0])&&(s=(n=new DataView(n.buffer,n.byteOffset,n.byteLength)).getUint8(0),r.id=0===s?n.getUint32(12):n.getUint32(20)),$t(e,["mdia","hdlr"])[0]))&&(n=Wt(s.subarray(8,12)),r.type="vide"===n?"video":"soun"===n?"audio":n),$t(e,["mdia","minf","stbl","stsd"])[0]);(n=(s&&(n=s.subarray(8),r.codec=Wt(n.subarray(4,8)),s=$t(n,[r.codec])[0])&&(/^[asm]vc[1-9]$/i.test(r.codec)?"avcC"===Wt((i=s.subarray(78)).subarray(4,8))&&11<i.length?(r.codec+=".",r.codec+=Vt(i[9]),r.codec+=Vt(i[10]),r.codec+=Vt(i[11])):r.codec="avc1.4d400d":/^mp4[a,v]$/i.test(r.codec)?"esds"===Wt((i=s.subarray(28)).subarray(4,8))&&20<i.length&&0!==i[19]?(r.codec+="."+Vt(i[19]),r.codec+="."+Vt(i[20]>>>2&63).replace(/^0/,"")):r.codec="mp4a.40.2":r.codec=r.codec.toLowerCase()),$t(e,["mdia","mdhd"])[0]))&&(r.timescale=function(e){var t=0===e[0]?12:20;return Ht(e[t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])}(n)),t.push(r)})),t},Kt=be,Qt=be,Yt=Y,Jt={},Zt=(Jt.ts={parseType:function(e,t){return 0===(e=Ct(e))?"pat":e===t?"pmt":t?"pes":null},parsePat:function(e){var t=xt(e),i=4+It(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},parsePmt:function(e){var t={},i=xt(e),n=4+It(e);if(i&&(n+=e[n]+1),1&e[n+5]){for(var r=3+((15&e[n+1])<<8|e[n+2])-4,s=12+((15&e[n+10])<<8|e[n+11]);s<r;){var a=n+s;t[(31&e[a+1])<<8|e[a+2]]=e[a],s+=5+((15&e[a+3])<<8|e[a+4])}return t}},parsePayloadUnitStartIndicator:xt,parsePesType:function(e,t){switch(t[Ct(e)]){case Kt.H264_STREAM_TYPE:return"video";case Kt.ADTS_STREAM_TYPE:return"audio";case Kt.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(e){var t,i,n;return!xt(e)||(t=4+It(e))>=e.byteLength?null:(i=null,192&(n=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&n)&&(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+It(e),i=e.subarray(t),n=0,r=0,s=!1;r<i.byteLength-3;r++)if(1===i[r+2]){n=r+5;break}for(;n<i.byteLength;)switch(i[n]){case 0:if(0!==i[n-1])n+=2;else if(0!==i[n-2])n++;else{for(r+3!==n-2&&"slice_layer_without_partitioning_rbsp_idr"===At(31&i[r+3])&&(s=!0);1!==i[++n]&&n<i.length;);r=n-2,n+=3}break;case 1:0!==i[n-1]||0!==i[n-2]||("slice_layer_without_partitioning_rbsp_idr"===At(31&i[r+3])&&(s=!0),r=n-2),n+=3;break;default:n+=3}return i=i.subarray(r),n-=r,r=0,!!i&&3<i.byteLength&&"slice_layer_without_partitioning_rbsp_idr"===At(31&i[r+3])||s}},Jt.aac=De,ue.ONE_SECOND_IN_TS),ei=function(e,t,i){for(var n,r,s,a,o=0,l=188,u=!1;l<=e.byteLength;)if(71!==e[o]||71!==e[l]&&l!==e.byteLength)o++,l++;else{if(n=e.subarray(o,l),"pes"===Jt.ts.parseType(n,t.pid)&&(r=Jt.ts.parsePesType(n,t.table),s=Jt.ts.parsePayloadUnitStartIndicator(n),"audio"===r)&&s&&(a=Jt.ts.parsePesTime(n))&&(a.type="audio",i.audio.push(a),u=!0),u)break;o+=188,l+=188}for(o=(l=e.byteLength)-188,u=!1;0<=o;)if(71!==e[o]||71!==e[l]&&l!==e.byteLength)o--,l--;else{if(n=e.subarray(o,l),"pes"===Jt.ts.parseType(n,t.pid)&&(r=Jt.ts.parsePesType(n,t.table),s=Jt.ts.parsePayloadUnitStartIndicator(n),"audio"===r)&&s&&(a=Jt.ts.parsePesTime(n))&&(a.type="audio",i.audio.push(a),u=!0),u)break;o-=188,l-=188}},ti=function(e,t,i){for(var n,r,s,a,o,l,u,d,c=0,h=188,p=!1,m={data:[],size:0};h<e.byteLength;)if(71===e[c]&&71===e[h]){if(n=e.subarray(c,h),"pes"===Jt.ts.parseType(n,t.pid)&&(r=Jt.ts.parsePesType(n,t.table),s=Jt.ts.parsePayloadUnitStartIndicator(n),"video"===r&&(s&&!p&&(a=Jt.ts.parsePesTime(n))&&(a.type="video",i.video.push(a),p=!0),!i.firstKeyFrame))){if(s&&0!==m.size){for(o=new Uint8Array(m.size),l=0;m.data.length;)u=m.data.shift(),o.set(u,l),l+=u.byteLength;Jt.ts.videoPacketContainsKeyFrame(o)&&(d=Jt.ts.parsePesTime(o))&&(i.firstKeyFrame=d,i.firstKeyFrame.type="video"),m.size=0}m.data.push(n),m.size+=n.byteLength}if(p&&i.firstKeyFrame)break;c+=188,h+=188}else c++,h++;for(c=(h=e.byteLength)-188,p=!1;0<=c;)if(71===e[c]&&71===e[h]){if(n=e.subarray(c,h),"pes"===Jt.ts.parseType(n,t.pid)&&(r=Jt.ts.parsePesType(n,t.table),s=Jt.ts.parsePayloadUnitStartIndicator(n),"video"===r)&&s&&(a=Jt.ts.parsePesTime(n))&&(a.type="video",i.video.push(a),p=!0),p)break;c-=188,h-=188}else c--,h--},ii=function(e,t){var i,n,r;e=(Jt.aac.isLikelyAacData(e)?function(e){for(var t,i,n=!1,r=0,s=null,a=null,o=0,l=0;3<=e.length-l;){switch(Jt.aac.parseType(e,l)){case"timed-metadata":e.length-l<10||(o=Jt.aac.parseId3TagSize(e,l))>e.length?n=!0:(null===a&&(t=e.subarray(l,l+o),a=Jt.aac.parseAacTimestamp(t)),l+=o);break;case"audio":e.length-l<7||(o=Jt.aac.parseAdtsSize(e,l))>e.length?n=!0:(null===s&&(t=e.subarray(l,l+o),s=Jt.aac.parseSampleRate(t)),r++,l+=o);break;default:l++}if(n)return null}return null===s||null===a?null:{audio:[{type:"audio",dts:a,pts:a},{type:"audio",dts:a+1024*r*(i=Zt/s),pts:a+1024*r*i}]}}:function(e){var t,i={pid:null,table:null},n={};for(t in function(e,t){for(var i,n=0,r=188;r<e.byteLength;)if(71===e[n]&&71===e[r]){switch(i=e.subarray(n,r),Jt.ts.parseType(i,t.pid)){case"pat":t.pid=Jt.ts.parsePat(i);break;case"pmt":var s=Jt.ts.parsePmt(i);t.table=t.table||{},Object.keys(s).forEach((function(e){t.table[e]=s[e]}))}n+=188,r+=188}else n++,r++}(e,i),i.table)if(i.table.hasOwnProperty(t))switch(i.table[t]){case Qt.H264_STREAM_TYPE:n.video=[],ti(e,i,n),0===n.video.length&&delete n.video;break;case Qt.ADTS_STREAM_TYPE:n.audio=[],ei(e,i,n),0===n.audio.length&&delete n.audio}return n})(e);return e&&(e.audio||e.video)?((i=e).audio&&i.audio.length&&((void 0===(n=t)||isNaN(n))&&(n=i.audio[0].dts),i.audio.forEach((function(e){e.dts=Yt(e.dts,n),e.pts=Yt(e.pts,n),e.dtsTime=e.dts/Zt,e.ptsTime=e.pts/Zt}))),i.video&&i.video.length&&((void 0===(r=t)||isNaN(r))&&(r=i.video[0].dts),i.video.forEach((function(e){e.dts=Yt(e.dts,r),e.pts=Yt(e.pts,r),e.dtsTime=e.dts/Zt,e.ptsTime=e.pts/Zt})),i.firstKeyFrame)&&((t=i.firstKeyFrame).dts=Yt(t.dts,r),t.pts=Yt(t.pts,r),t.dtsTime=t.dts/Zt,t.ptsTime=t.pts/Zt),e):null};class ni{constructor(e,t){this.options=t||{},this.self=e,this.init()}init(){var e,t;this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Pt(this.options),e=this.self,(t=this.transmuxer).on("data",(function(t){var i=t.initSegment;t.initSegment={data:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength},i=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:ue.videoTsToSeconds(t.start.dts),presentation:ue.videoTsToSeconds(t.start.pts)},end:{decode:ue.videoTsToSeconds(t.end.dts),presentation:ue.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:ue.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=ue.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:i})})),t.on("audioSegmentTimingInfo",(function(t){var i={start:{decode:ue.videoTsToSeconds(t.start.dts),presentation:ue.videoTsToSeconds(t.start.pts)},end:{decode:ue.videoTsToSeconds(t.end.dts),presentation:ue.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:ue.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=ue.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:ue.videoTsToSeconds(t.start),end:ue.videoTsToSeconds(t.end)}})})),t.on("videoTimingInfo",(function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:ue.videoTsToSeconds(t.start),end:ue.videoTsToSeconds(t.end)}})})),t.on("log",(function(t){e.postMessage({action:"log",log:t})}))}pushMp4Captions(e){this.captionParser||(this.captionParser=new qt,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,n;i=e,e="bigint"==typeof(n=$t(n=t,["moof","traf"]).reduce((function(e,t){var n=$t(t,["tfhd"])[0],r=(n=Ht(n[4]<<24|n[5]<<16|n[6]<<8|n[7]),n=i[n]||9e4,t=$t(t,["tfdt"])[0],new DataView(t.buffer,t.byteOffset,t.byteLength));let s;return"bigint"==typeof(t=1===t[0]?zt(t.subarray(4,12)):r.getUint32(4))?s=t/Gt.BigInt(n):"number"!=typeof t||isNaN(t)||(s=t/n),(s=s<Number.MAX_SAFE_INTEGER?Number(s):s)<e?s:e}),1/0))||isFinite(n)?n:0,this.self.postMessage({action:"probeMp4StartTime",startTime:e,data:t},[t.buffer])}probeMp4Tracks({data:e}){var t=Xt(e);this.self.postMessage({action:"probeMp4Tracks",tracks:t,data:e},[e.buffer])}probeTs({data:e,baseStartTime:t}){t="number"!=typeof t||isNaN(t)?void 0:t*ue.ONE_SECOND_IN_TS;let i=null;(t=ii(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(ue.secondsToVideoTs(e)))}setAudioAppendStart(e){this.transmuxer.setAudioAppendStart(Math.ceil(ue.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 ni(self,e.data.options):(this.messageHandlers||(this.messageHandlers=new ni(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}}))));let Zl=e=>{var t,i;let{transmuxer:n,bytes:r,audioAppendStart:s,gopsToAlignWith:a,remux:o,onData:l,onTrackInfo:u,onAudioTimingInfo:d,onVideoTimingInfo:c,onVideoSegmentTimingInfo:h,onAudioSegmentTimingInfo:p,onId3:m,onCaptions:f,onDone:g,onEndedTimeline:y,onTransmuxerLog:v,isEndOfTimeline:_}=e,b={buffer:[]},w=_;n.onmessage=t=>{n.currentTransmux!==e||("data"===t.data.action&&((e,t,i)=>{var{type:n,initSegment:r,captions:s,captionStreams:a,metadata:o,videoFrameDtsTime:l,videoFramePtsTime:u}=e.data.segment,s=(t.buffer.push({captions:s,captionStreams:a,metadata:o}),t=e.data.segment.boxes||{data:e.data.segment.data},{type:n,data:new Uint8Array(t.data,t.data.byteOffset,t.data.byteLength),initSegment:new Uint8Array(r.data,r.byteOffset,r.byteLength)});void 0!==l&&(s.videoFrameDtsTime=l),void 0!==u&&(s.videoFramePtsTime=u),i(s)})(t,b,l),"trackinfo"===t.data.action&&u(t.data.trackInfo),"gopInfo"===t.data.action&&((e,t)=>{t.gopInfo=e.data.gopInfo})(t,b),"audioTimingInfo"===t.data.action&&d(t.data.audioTimingInfo),"videoTimingInfo"===t.data.action&&c(t.data.videoTimingInfo),"videoSegmentTimingInfo"===t.data.action&&h(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&&f(t.data.caption),"endedtimeline"===t.data.action&&(w=!1,y()),"log"===t.data.action&&v(t.data.log),"transmuxed"!==t.data.type)||w||(n.onmessage=null,(({transmuxedData:e,callback:t})=>{e.buffer=[],t(e)})({transmuxedData:b,callback:g}),eu(n))},s&&n.postMessage({action:"setAudioAppendStart",appendStart:s}),Array.isArray(a)&&n.postMessage({action:"alignGopsWith",gopsToAlignWith:a}),void 0!==o&&n.postMessage({action:"setRemux",remux:o}),r.byteLength&&(t=r instanceof ArrayBuffer?r:r.buffer,i=r instanceof ArrayBuffer?0:r.byteOffset,n.postMessage({action:"push",data:t,byteOffset:i,byteLength:r.byteLength},[t])),_&&n.postMessage({action:"endTimeline"}),n.postMessage({action:"flush"})},eu=e=>{e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():Zl(e.currentTransmux))},tu=(e,t)=>{e.postMessage({action:t}),eu(e)};var iu=e=>{((e,t)=>{t.currentTransmux?t.transmuxQueue.push(tu.bind(null,t,e)):(t.currentTransmux=e,tu(t,e))})("reset",e)};function nu(e){let t=e.transmuxer,i=e.endAction||e.action,n=e.callback;var r,s=qt({},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),n(r.data))};t.addEventListener("message",a),e.data?(r=e.data instanceof ArrayBuffer,s.byteOffset=r?0:e.data.byteOffset,s.byteLength=e.data.byteLength,r=[r?e.data:e.data.buffer],t.postMessage(s,r)):t.postMessage(s)}function ru(e){let t=0;return e.audio&&t++,e.video&&t++,t}function su(e,t){var i=t.attributes||{},n=wu(function(e){if((e=e.attributes||{}).CODECS)return qr(e.CODECS)}(t)||[]);return!bu(e,t)||n.audio||((e,t)=>{if(!bu(e,t))return!0;t=t.attributes||{};var i=e.mediaGroups.AUDIO[t.AUDIO];for(let e in i)if(!i[e].uri&&!i[e].playlists)return!0;return!1})(e,t)||(t=wu(function(e,t){if(e.mediaGroups.AUDIO&&t){var i=e.mediaGroups.AUDIO[t];if(i)for(var n in i)if((n=i[n]).default&&n.playlists)return qr(n.playlists[0].attributes.CODECS)}return null}(e,i.AUDIO)||[])).audio&&(n.audio=t.audio),n}function au(e,t){return(e=e&&window.getComputedStyle(e))?e[t]:""}function ou(e,t){let i,n;return(i=(i=e.attributes.BANDWIDTH?e.attributes.BANDWIDTH:i)||window.Number.MAX_VALUE)-((n=t.attributes.BANDWIDTH?t.attributes.BANDWIDTH:n)||window.Number.MAX_VALUE)}let lu=2,uu=-101,du=-102,cu=e=>{e.forEach((e=>{e.abort()}))},hu=(e,t)=>t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:uu,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:du,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:lu,xhr:t}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:lu,xhr:t}:null,pu=(e,t,i)=>(n,r)=>{var s=r.response;if(n=hu(n,r))return i(n,e);if(16!==s.byteLength)return i({status:r.status,message:"Invalid HLS key at URL: "+r.uri,code:lu,xhr:r},e);n=new DataView(s);var a=new Uint32Array([n.getUint32(0),n.getUint32(4),n.getUint32(8),n.getUint32(12)]);for(let e=0;e<t.length;e++)t[e].bytes=a;return i(null,e)},mu=(e,t)=>{var i=ko(e.map.bytes);if("mp4"!==i)return t({internal:!0,message:`Found unsupported ${i||"unknown"} container for initialization segment at URL: `+(e.map.resolvedUri||e.map.uri),code:lu});nu({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:({tracks:i,data:n})=>(e.map.bytes=n,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))})},fu=({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:c,onTransmuxerLog:h})=>{var p=e.map&&e.map.tracks||{};let m=Boolean(p.audio&&p.video),f=n.bind(null,e,"audio","start"),g=n.bind(null,e,"audio","end"),y=n.bind(null,e,"video","start"),v=n.bind(null,e,"video","end");nu({action:"probeTs",transmuxer:e.transmuxer,data:t,baseStartTime:e.baseStartTime,callback(n){e.bytes=t=n.data,(n=n.result)&&(i(e,{hasAudio:n.hasAudio,hasVideo:n.hasVideo,isMuxed:m}),i=null,n.hasAudio&&!m&&f(n.audioStart),n.hasVideo&&y(n.videoStart),f=null,y=null),(e=>{e.transmuxer.currentTransmux?e.transmuxer.transmuxQueue.push(e):(e.transmuxer.currentTransmux=e,Zl(e))})({bytes:t,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,remux:m,onData(t){t.type="combined"===t.type?"video":t.type,d(e,t)},onTrackInfo(t){i&&(m&&(t.isMuxed=!0),i(e,t))},onAudioTimingInfo(e){f&&void 0!==e.start&&(f(e.start),f=null),g&&void 0!==e.end&&g(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){s(e)},onId3(t,i){a(e,t,i)},onCaptions(t){o(e,[t])},isEndOfTimeline:l,onEndedTimeline(){u()},onTransmuxerLog:h,onDone(t){c&&(t.type="combined"===t.type?"video":t.type,c(null,e,t))}})}})},gu=({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:c,onTransmuxerLog:h})=>{let p=new Uint8Array(t);if(0<function e(t,i,n){void 0===n&&(n=!1),i=Array.isArray(r=i)?r.map(wo):[wo(r)],t=Gr(t);var r,s=[];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(n)break;o=t.length}var u=t.subarray(a+8,o);Yr(l,i[0])&&(1===i.length?s.push(u):s.push.apply(s,e(u,i.slice(1),n))),a=o}return s}(p,["moof"]).length){e.isFmp4=!0;let r=e.map.tracks,s={isFmp4:!0,hasVideo:!!r.video,hasAudio:!!r.audio},a=(r.audio&&r.audio.codec&&"enca"!==r.audio.codec&&(s.audioCodec=r.audio.codec),r.video&&r.video.codec&&"encv"!==r.video.codec&&(s.videoCodec=r.video.codec),r.video&&r.audio&&(s.isMuxed=!0),i(e,s),t=>{d(e,{data:p,type:s.hasAudio&&!s.isMuxed?"audio":"video"}),t&&t.length&&o(e,t),c(null,e,{})});nu({action:"probeMp4StartTime",timescales:e.map.timescales,data:p,transmuxer:e.transmuxer,callback({data:i,startTime:o}){t=i.buffer,e.bytes=p=i,s.hasAudio&&!s.isMuxed&&n(e,"audio","start",o),s.hasVideo&&n(e,"video","start",o),r.video&&i.byteLength&&e.transmuxer?nu({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:e.transmuxer,data:p,timescales:e.map.timescales,trackIds:[r.video.id],callback(i){t=i.data.buffer,e.bytes=p=i.data,i.logs.forEach((function(e){h(Vo(e,{stream:"mp4CaptionParser"}))})),a(i.captions)}}):a()}})}else{e.transmuxer?(void 0===e.container&&(e.container=ko(p)),"ts"!==e.container&&"aac"!==e.container?(i(e,{hasAudio:!1,hasVideo:!1}),c(null,e,{})):fu({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:c,onTransmuxerLog:h})):c(null,e,{})}},yu=function({id:e,key:t,encryptedBytes:i,decryptionWorker:n},r){let s,a=t=>{t.data.source===e&&(n.removeEventListener("message",a),t=t.data.decrypted,r(new Uint8Array(t.bytes,t.byteOffset,t.byteLength)))};n.addEventListener("message",a),s=t.bytes.slice?t.bytes.slice():new Uint32Array(Array.prototype.slice.call(t.bytes)),n.postMessage(Nl({source:e,encrypted:i,key:s,iv:t.iv}),[i.buffer,s.buffer])},vu=({xhr:e,xhrOptions:t,decryptionWorker:i,segment:n,abortFn:r,progressFn:s,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:d,captionsFn:c,isEndOfTimeline:h,endedTimelineFn:p,dataFn:m,doneFn:f,onTransmuxerLog:g})=>{let y=[];var v,_;i=(({activeXhrs:e,decryptionWorker:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:c,onTransmuxerLog:h})=>{let p=0,m=!1;return(f,g)=>{if(!m){if(f)return m=!0,cu(e),c(f,g);if((p+=1)===e.length){let p=function(){if(g.encryptedBytes)return(({decryptionWorker:e,segment:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:c,onTransmuxerLog:h})=>{yu({id:t.requestId,key:t.key,encryptedBytes:t.encryptedBytes,decryptionWorker:e},(e=>{t.bytes=e,gu({segment:t,bytes:t.bytes,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:c,onTransmuxerLog:h})}))})({decryptionWorker:t,segment:g,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:c,onTransmuxerLog:h});gu({segment:g,bytes:g.bytes,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:c,onTransmuxerLog:h})};if(g.endOfAllRequests=Date.now(),g.map&&g.map.encryptedBytes&&!g.map.bytes)return yu({decryptionWorker:t,id:g.requestId+"-init",encryptedBytes:g.map.encryptedBytes,key:g.map.key},(t=>{g.map.bytes=t,mu(g,(t=>{if(t)return cu(e),c(t,g);p()}))}));p()}}}})({activeXhrs:y,decryptionWorker:i,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:d,captionsFn:c,isEndOfTimeline:h,endedTimelineFn:p,dataFn:m,doneFn:f,onTransmuxerLog:g}),n.key&&!n.key.bytes&&(a=[n.key],n.map&&!n.map.bytes&&n.map.key&&n.map.key.resolvedUri===n.key.resolvedUri&&a.push(n.map.key),o=e(Vo(t,{uri:n.key.resolvedUri,responseType:"arraybuffer"}),pu(n,a,i)),y.push(o)),n.map&&!n.map.bytes&&(!n.map.key||n.key&&n.key.resolvedUri===n.map.key.resolvedUri||(l=e(Vo(t,{uri:n.map.key.resolvedUri,responseType:"arraybuffer"}),pu(n,[n.map.key],i)),y.push(l)),u=Vo(t,{uri:n.map.resolvedUri,responseType:"arraybuffer",headers:Ll(n.map)}),({segment:v,finishProcessingFn:_}={segment:n,finishProcessingFn:i}),d=e(u,((e,t)=>(e=hu(e,t))?_(e,v):(e=new Uint8Array(t.response),v.map.key?(v.map.encryptedBytes=e,_(null,v)):(v.map.bytes=e,void mu(v,(function(e){if(e)return e.xhr=t,e.status=t.status,_(e,v);_(null,v)})))))),y.push(d)),c=Vo(t,{uri:n.part&&n.part.resolvedUri||n.resolvedUri,responseType:"arraybuffer",headers:Ll(n)});({segment:b,finishProcessingFn:w,responseType:T}={segment:n,finishProcessingFn:i,responseType:c.responseType});var b,w,T,S,E;h=e(c,((e,t)=>(e=hu(e,t))?w(e,b):(e="arraybuffer"!==T&&t.responseText?(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})(t.responseText.substring(b.lastReachedChar||0)):t.response,b.stats=(e=>({bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}))(t),b.key?b.encryptedBytes=new Uint8Array(e):b.bytes=new Uint8Array(e),w(null,b))));h.addEventListener("progress",(({segment:S,progressFn:E}={segment:n,progressFn:s}),e=>{if(!e.target.aborted)return S.stats=Vo(S.stats,(e=>{var t=e.target;return(t={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-t.requestTime||0}).bytesReceived=e.loaded,t.bandwidth=Math.floor(t.bytesReceived/t.roundTripTime*8e3),t})(e)),!S.stats.firstBytesReceivedAt&&S.stats.bytesReceived&&(S.stats.firstBytesReceivedAt=Date.now()),E(e,S)})),y.push(h);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)}))})),()=>cu(y)},_u=Ho("CodecUtils"),bu=(e,t)=>(t=t.attributes||{},e&&e.mediaGroups&&e.mediaGroups.AUDIO&&t.AUDIO&&e.mediaGroups.AUDIO[t.AUDIO]),wu=function(e){let t={};return e.forEach((({mediaType:e,type:i,details:n})=>{t[e]=t[e]||[],t[e].push(Fr(""+i+n))})),Object.keys(t).forEach((function(e){1<t[e].length?(_u(`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},Tu=Ho("PlaylistSelector"),Su=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||""})},Eu=function(e,t){let i=e.slice();e.sort((function(e,n){var r=t(e,n);return 0===r?i.indexOf(e)-i.indexOf(n):r}))};function ku(e,t,i,n,r,s){if(e){var a={bandwidth:t,width:i,height:n,limitRenditionByPlayerDimensions:r};let u=e.playlists,d=(yl.isAudioOnly(e)&&(u=s.getAudioTrackPlaylists_(),a.audioOnly=!0),u.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}}))),c=(Eu(d,((e,t)=>e.bandwidth-t.bandwidth)),(d=d.filter((e=>!yl.isIncompatible(e.playlist)))).filter((e=>yl.isEnabled(e.playlist)))),h=(e=(c=c.length?c:d.filter((e=>!yl.isDisabled(e.playlist)))).filter((e=>e.bandwidth*Gl.BANDWIDTH_VARIANCE<t)))[e.length-1];var o=e.filter((e=>e.bandwidth===h.bandwidth))[0];if(!1===r){let e=o||c[0]||d[0];if(e&&e.playlist){let t=o?"bandwidthBestRep":"sortedPlaylistReps";return c[0]&&(t="enabledPlaylistReps"),Tu(`choosing ${Su(e)} using ${t} with options`,a),e.playlist}}else{var l;r=e.filter((e=>e.width&&e.height)),e=(Eu(r,((e,t)=>e.width-t.width)),r.filter((e=>e.width===i&&e.height===n)));let t,u,p;(e=(h=e[e.length-1],e.filter((e=>e.bandwidth===h.bandwidth))[0]))||(h=(l=(t=r.filter((e=>e.width>i||e.height>n))).filter((e=>e.width===t[0].width&&e.height===t[0].height)))[l.length-1],u=l.filter((e=>e.bandwidth===h.bandwidth))[0]),s.leastPixelDiffSelector&&(Eu(l=r.map((e=>(e.pixelDiff=Math.abs(e.width-i)+Math.abs(e.height-n),e))),((e,t)=>e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff)),p=l[0]);let m=p||u||e||o||c[0]||d[0];if(m&&m.playlist){let t="sortedPlaylistReps";return p?t="leastPixelDiffRep":u?t="resolutionPlusOneRep":e?t="resolutionBestRep":o?t="bandwidthBestRep":c[0]&&(t="enabledPlaylistReps"),Tu(`choosing ${Su(m)} using ${t} with options`,a),m.playlist}}return Tu("could not choose a playlist with options",a),null}}function Cu(){var e=this.useDevicePixelRatio&&window.devicePixelRatio||1;return ku(this.playlists.main,this.systemBandwidth,parseInt(au(this.tech_.el(),"width"),10)*e,parseInt(au(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.playlistController_)}function xu(e,t,i){var n;let r;if(i&&i.cues)for(r=i.cues.length;r--;)(n=i.cues[r]).startTime>=e&&n.endTime<=t&&i.removeCue(n)}let Iu=e=>"number"==typeof e&&isFinite(e),Au=e=>{var{startOfSegment:t,duration:i,segment:n,part:r,playlist:{mediaSequence:s,id:a,segments:o=[]},mediaIndex:l,partIndex:u,timeline:d}=e,o=o.length-1;let c="mediaIndex/partIndex increment";e.getMediaInfoForTime?c=`getMediaInfoForTime (${e.getMediaInfoForTime})`:e.isSyncRequest&&(c="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(c+=" with independent "+e.independent);var h="number"==typeof u,p=(e=e.segment.uri?"segment":"pre-segment",h?sl({preloadSegment:n})-1:0);return e+` [${s+l}/${s+o}]`+(h?` part [${u}/${p}]`:"")+` segment start/end [${n.start} => ${n.end}]`+(h?` part start/end [${r.start} => ${r.end}]`:"")+` startOfSegment [${t}]`+` duration [${i}]`+` timeline [${d}]`+` selected by [${c}]`+` playlist [${a}]`},Pu=e=>e+"TimingInfo",Ou=({timelineChangeController:e,currentTimeline:t,segmentTimeline:i,loaderType:n,audioDisabled:r})=>!(t===i||("audio"===n?(t=e.lastTimelineChange({type:"main"}))&&t.to===i:"main"!==n||!r||(t=e.pendingTimelineChange({type:"audio"}))&&t.to===i)),Lu=({segmentDuration:e,maxDuration:t})=>!!e&&Math.round(e)>t+Yo;class Du extends Tr.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.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,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_=11<=Tr.browser.IE_VERSION,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",(()=>{this.isEndOfStream_()||(this.ended_=!1)})),this.fetchAtBuffer_=!1,this.logger_=Ho(`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(e=>{let t=new Jl,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})({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:(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_&&iu(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){var e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return $o();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=Rl(e);let n=this.initSegments_[i];return t&&!n&&e.bytes&&(this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),n||e}segmentKey(e,t=!1){if(!e)return null;var i=Ul(e);let n=this.keyCache_[i];return this.cacheEncryptionKeys_&&t&&!n&&e.bytes&&(this.keyCache_[i]=n={resolvedUri:e.resolvedUri,bytes:e.bytes}),t={resolvedUri:(n||e).resolvedUri},n&&(t.bytes=n.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,n=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 s=null;if(n&&(n.id?s=n.id:n.uri&&(s=n.uri)),this.logger_(`playlist update [${s} => ${e.id||e.uri}]`),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();n&&n.uri===e.uri?(t=e.mediaSequence-n.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(n,e)):(null!==this.mediaIndex&&(e.endList?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_}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.resyncLoader()}resyncLoader(){this.transmuxer_&&iu(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=()=>{},n=!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 s=1;var r=()=>{0==--s&&i()};for(let i in!n&&this.audioDisabled_||(s++,this.sourceUpdater_.removeAudio(e,t,r)),(n||"main"===this.loaderType_)&&(this.gopBuffer_=((e,t,i,n)=>{var r=Math.ceil(9e4*(t-n)),s=Math.ceil(9e4*(i-n));t=e.slice();let a=e.length;for(;a--&&!(e[a].pts<=s););if(-1!==a){let i=a+1;for(;i--&&!(e[i].pts<=r););i=Math.max(i,0),t.splice(i,a-i+1)}return t})(this.gopBuffer_,e,t,this.timeMapping_),s++,this.sourceUpdater_.removeVideo(e,t,r)),this.inbandTextTracks_)xu(e,t,this.inbandTextTracks_[i]);xu(e,t,this.segmentMetadataTrack_),r()}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;this.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 n;return!(!t||!this.mediaSource_)&&(n="number"==typeof e&&t.segments[e],e=e+1===t.segments.length,i=!n||!n.parts||i+1===n.parts.length,t.endList)&&"open"===this.mediaSource_.readyState&&e&&i}chooseNextRequest_(){var e=Go(t=this.buffered_())||0,t=Xo(t,this.currentTime_()),i=!this.hasPlayed_()&&1<=t,n=t>=this.goalBufferLength_(),r=this.playlist_.segments;if(!r.length||i||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var s;(i={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)}).isSyncRequest?i.mediaIndex=function(e,t,i){t=t||[];var n=[];let r=0;for(let a=0;a<t.length;a++){var s=t[a];if(e===s.timeline&&(n.push(a),(r+=s.duration)>i))return a}return 0===n.length?0:n[n.length-1]}(this.currentTimeline_,r,e):null!==this.mediaIndex?(n=r[this.mediaIndex],s="number"==typeof this.partIndex?this.partIndex:-1,i.startOfSegment=n.end||e,n.parts&&n.parts[s+1]?(i.mediaIndex=this.mediaIndex,i.partIndex=s+1):i.mediaIndex=this.mediaIndex+1):(({segmentIndex:n,startTime:s,partIndex:o}=yl.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?e:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time})),i.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+e:"currentTime "+this.currentTime_(),i.mediaIndex=n,i.startOfSegment=s,i.partIndex=o),e=r[i.mediaIndex];let a=e&&"number"==typeof i.partIndex&&e.parts&&e.parts[i.partIndex];if(!e||"number"==typeof i.partIndex&&!a)return null;"number"!=typeof i.partIndex&&e.parts&&(i.partIndex=0,a=e.parts[0]),t||!a||a.independent||(0===i.partIndex?(s=(n=r[i.mediaIndex-1]).parts&&n.parts.length&&n.parts[n.parts.length-1])&&s.independent&&(--i.mediaIndex,i.partIndex=n.parts.length-1,i.independent="previous segment"):e.parts[i.partIndex-1].independent&&(--i.partIndex,i.independent="previous part"));var o=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return i.mediaIndex>=r.length-1&&o&&!this.seeking_()?null:this.generateSegmentInfo_(i)}generateSegmentInfo_(e){var t,{independent:e,playlist:i,mediaIndex:n,startOfSegment:r,isSyncRequest:t,partIndex:s,forceTimestampOffset:a,getMediaInfoForTime:o}=e,l=i.segments[n],u="number"==typeof s&&l.parts[s],n={requestId:"segment-loader-"+Math.random(),uri:u&&u.resolvedUri||l.resolvedUri,mediaIndex:n,partIndex:u?s:null,isSyncRequest:t,startOfSegment:r,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:l.timeline,duration:u&&u.duration||l.duration,segment:l,part:u,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:o,independent:e},s=void 0!==a?a:this.isPendingTimestampOffset_;return"number"==typeof(t=(n.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:l.timeline,currentTimeline:this.currentTimeline_,startOfSegment:r,buffered:this.buffered_(),overrideCheck:s}),Go(this.sourceUpdater_.audioBuffered())))&&(n.audioAppendStart=t-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(n.gopsToAlignWith=((e,t,i)=>{if(null==t||!e.length)return[];var n=Math.ceil(9e4*(t-i+3));let r;for(r=0;r<e.length&&!(e[r].pts>n);r++);return e.slice(r)})(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),n}timestampOffsetForSegment_(e){var t,i,n,r;return({segmentTimeline:e,currentTimeline:t,startOfSegment:i,buffered:n,overrideCheck:r}=e),r||e!==t?e<t||!n.length?i:n.end(n.length-1):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,n=this.pendingSegment_.duration,r=(e=yl.estimateSegmentRequestTime(n,i,this.playlist_,e.bytesReceived),[r,s,a=1]=[this.buffered_(),t,this.vhs_.tech_.playbackRate()],((r.length?r.end(r.length-1):0)-s)/a-1);if(!(e<=r)){var s=function(e){let{main:t,currentTime:i,bandwidth:n,duration:r,segmentDuration:s,timeUntilRebuffer:a,currentTimeline:o,syncController:l}=e,u=(e=t.playlists.filter((e=>!yl.isIncompatible(e)))).filter(yl.isEnabled);e=(u=u.length?u:e.filter((e=>!yl.isDisabled(e)))).filter(yl.hasAttribute.bind(null,"BANDWIDTH")).map((e=>{var t=l.getSyncPoint(e,r,o,i)?1:2;return{playlist:e,rebufferingImpact:yl.estimateSegmentRequestTime(s,n,e)*t-a}}));var d=e.filter((e=>e.rebufferingImpact<=0));return Eu(d,((e,t)=>ou(t.playlist,e.playlist))),d.length?d[0]:(Eu(e,((e,t)=>e.rebufferingImpact-t.rebufferingImpact)),e[0]||null)}({main:this.vhs_.playlists.main,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:n,timeUntilRebuffer:r,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(s){var a=e-r-s.rebufferingImpact;let t=.5;r<=Yo&&(t=1),!s.playlist||s.playlist.uri===this.playlist_.uri||a<t||(this.bandwidth=s.playlist.attributes.BANDWIDTH*Gl.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}}}}handleAbort_(e){this.logger_("Aborting "+Au(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(),n=Object.keys(t).sort();if(i.length!==n.length)return!1;for(let s=0;s<i.length;s++){var r=i[s];if(r!==n[s]||e[r]!==t[r])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,n){var r;this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||((e=this.pendingSegment_)[r=Pu(t)]=e[r]||{},e[r][i]=n,this.logger_(`timinginfo: ${t} - ${i} - `+n),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 e=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),i={};t.forEach((t=>{i[t.stream]=i[t.stream]||{startTime:1/0,captions:[],endTime:0};var n=i[t.stream];n.startTime=Math.min(n.startTime,t.startTime+e),n.endTime=Math.max(n.endTime,t.endTime+e),n.captions.push(t)})),Object.keys(i).forEach((t=>{var{startTime:n,endTime:r,captions:s}=i[t],a=this.inbandTextTracks_,o=(this.logger_(`adding cues from ${n} -> ${r} for `+t),a),l=this.vhs_.tech_,u=t;if(!o[u]){l.trigger({type:"usage",name:"vhs-608"});let e=u;var d;if(/^cc708_/.test(u)&&(e="SERVICE"+u.split("_")[1]),d=l.textTracks().getTrackById(e))o[u]=d;else{let t=u,i=u,n=!1;(d=(l.options_.vhs&&l.options_.vhs.captionServices||{})[e])&&(t=d.label,i=d.language,n=d.default),o[u]=l.addRemoteTextTrack({kind:"captions",id:e,default:n,label:t,language:i},!1).track}}xu(n,r,a[t]);var{inbandTextTracks:c,captionArray:d,timestampOffset:h}={captionArray:s,inbandTextTracks:a,timestampOffset:e};if(d){let e=window.WebKitDataCue||window.VTTCue;d.forEach((t=>{c[t.stream].addCue(new e(t.startTime+h,t.endTime+h,t.text))}))}})),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}else this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t))}handleId3_(e,t,i){var n,r,s,a;this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||(this.pendingSegment_.hasAppendedData_?(n=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),r=this.inbandTextTracks_,s=i,a=this.vhs_.tech_,r.metadataTrack_||(r.metadataTrack_=a.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,r.metadataTrack_.inBandMetadataTrackDispatchType=s),(({inbandTextTracks:e,metadataArray:t,timestampOffset:i,videoDuration:n})=>{if(t){let a=window.WebKitDataCue||window.VTTCue,o=e.metadataTrack_;if(o&&(t.forEach((e=>{let t=e.cueTime+i;!("number"!=typeof t||window.isNaN(t)||t<0)&&t<1/0&&e.frames.forEach((e=>{var i,n=new a(t,t,e.value||e.url||e.data||"");n.frame=e,n.value=e,Object.defineProperties((i=n).frame,{id:{get:()=>(Tr.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),i.value.key)},value:{get:()=>(Tr.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),i.value.data)},privateData:{get:()=>(Tr.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),i.value.data)}}),o.addCue(n)}))})),o.cues)&&o.cues.length){var r=o.cues,s=[];for(let e=0;e<r.length;e++)r[e]&&s.push(r[e]);let e=s.reduce(((e,t)=>{var i=e[t.startTime]||[];return i.push(t),e[t.startTime]=i,e}),{}),t=Object.keys(e).sort(((e,t)=>Number(e)-Number(t)));t.forEach(((i,r)=>{i=e[i];let s=Number(t[r+1])||n;i.forEach((e=>{e.endTime=s}))}))}}})({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:n,videoDuration: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_()&&Ou({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,n;return!!this.sourceUpdater_.ready()&&!(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_||(e=this.pendingSegment_,t=this.getCurrentMediaInfo_(),!e)||!t||(({hasAudio:t,hasVideo:i,isMuxed:n}=t),i&&!e.videoTimingInfo)||t&&!this.audioDisabled_&&!n&&!e.audioTimingInfo||Ou({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[Pu(t.type)].start;else{let t;e=this.getCurrentMediaInfo_(),(e="main"===this.loaderType_&&e&&e.hasVideo)&&(t=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:t,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:n}){if(i){var r=Rl(i);if(this.activeInitSegmentId_===r)return null;t=this.initSegmentForMap(i,!0).bytes,this.activeInitSegmentId_=r}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=n,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i},n){var r=this.sourceUpdater_.audioBuffered(),s=this.sourceUpdater_.videoBuffered(),a=(1<r.length&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+tl(r).join(", ")),1<s.length&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+tl(s).join(", ")),r.length?r.start(0):0),o=r.length?r.end(r.length-1):0,l=s.length?s.start(0):0,u=s.length?s.end(s.length-1):0;o-a<=1&&u-l<=1?(this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${i.byteLength}, audio buffer: ${tl(r).join(", ")}, video buffer: ${tl(s).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},n){n&&(22===n.code?this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i}):(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",n),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:n,bytes:r}){if(!r){var s,a=[n];let e,t,o=n.byteLength;i&&(a.unshift(i),o+=i.byteLength),e=0,(s={bytes:o,segments:a}).bytes&&(t=new Uint8Array(s.bytes),s.segments.forEach((i=>{t.set(i,e),e+=i.byteLength}))),r=t}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:n}=t;n&&n.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:n})))}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=qt({},e,{forceTimestampOffset:!0});qt(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),n=null!==this.mediaIndex,r=e.timeline!==this.currentTimeline_&&0<e.timeline;i=i||n&&r;this.logger_("Requesting "+Au(e)),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=vu({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:n})=>{this.logger_(Au(e)+` logged from transmuxer stream ${n} as a ${i}: `+t)}})}trimBackBuffer_(e){let t;var i,n,r,s=(i=this.seekable_(),n=this.currentTime_(),r=this.playlist_.targetDuration||10,t=n-Gl.BACK_BUFFER_LENGTH,i.length&&(t=Math.max(t,i.start(0))),Math.min(n-r,t));0<s&&this.remove(0,s)}createSimplifiedSegmentObj_(e){var t=e.segment,i={resolvedUri:((i=e.part)||t).resolvedUri,byterange:(i||t).byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},n=e.playlist.segments[e.mediaIndex-1];return n&&n.timeline===t.timeline&&(n.videoTimingInfo?i.baseStartTime=n.videoTimingInfo.transmuxedDecodeEnd:n.audioTimingInfo&&(i.baseStartTime=n.audioTimingInfo.transmuxedDecodeEnd)),t.key&&(n=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]),i.key=this.segmentKey(t.key),i.key.iv=n),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(e)return this.pendingSegment_=null,this.state="READY",e.code===du?void 0:(this.pause(),e.code===uu?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 n=t[0].pts;let r=0;for(;r<e.length&&!(e[r].pts>=n);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:n,currentVideoTimestampOffset:r,useVideoTimingInfo:s,videoTimingInfo:a,audioTimingInfo:o}){return void 0!==e?e:s?(e=t.segments[i-1],0!==i&&e&&void 0!==e.start&&e.end===n+r?a.start:n):o.start}waitForAppendsToComplete_(e){var t,i,n=this.getCurrentMediaInfo_(e);n?(({hasAudio:n,hasVideo:i,isMuxed:t}=n),i="main"===this.loaderType_&&i,n=!this.audioDisabled_&&n&&!t,e.waitingOnAppends=0,e.hasAppendedData_?(i&&e.waitingOnAppends++,n&&e.waitingOnAppends++,i&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),n&&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)&&(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=((e,t)=>{var i,n,r,s;let a;return"hls"===t&&(s={audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo},a=0,["video","audio"].forEach((function(e){if(e=s[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)}})),t=a="bigint"==typeof a&&a<Number.MAX_SAFE_INTEGER?Number(a):a)&&(n=Lu({segmentDuration:t,maxDuration:2*(i=e.playlist.targetDuration)}),r=Lu({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`,n||r)?{severity:n?"warn":"info",message:t}:null})(e,this.sourceType_))&&("warn"===t.severity?Tr.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 "+Au(e)):(this.logger_("Appended "+Au(e)),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),"main"!==this.loaderType_||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate"),t=e.segment,i=e.part,t=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"} `+Au(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,n,r;this.segmentMetadataTrack_&&(t=(r=e.segment).start,i=r.end,Iu(t))&&Iu(i)&&(xu(t,i,this.segmentMetadataTrack_),n=window.WebKitDataCue||window.VTTCue,r={custom:r.custom,dateTimeObject:r.dateTimeObject,dateTimeString:r.dateTimeString,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:t,end:i},(e=new n(t,i,JSON.stringify(r))).value=r,this.segmentMetadataTrack_.addCue(e))}}function Mu(){}function Nu(e){return"string"!=typeof e?e:e.replace(/./,(e=>e.toUpperCase()))}let Ru=["video","audio"],Uu=(e,t)=>{var i=t[e+"Buffer"];return i&&i.updating||t.queuePending[e]},Bu=(e,t)=>{if(0!==t.queue.length){let i=0,n=t.queue[i];if("mediaSource"===n.type)t.updating()||"closed"===t.mediaSource.readyState||(t.queue.shift(),n.action(t),n.doneFn&&n.doneFn(),Bu("audio",t),Bu("video",t));else if("mediaSource"!==e&&t.ready()&&"closed"!==t.mediaSource.readyState&&!Uu(e,t)){if(n.type!==e){if(null===(i=((e,t)=>{for(let n=0;n<t.length;n++){var i=t[n];if("mediaSource"===i.type)break;if(i.type===e)return n}return null})(e,t.queue)))return;n=t.queue[i]}t.queue.splice(i,1),(t.queuePending[e]=n).action(e,t),n.doneFn||(t.queuePending[e]=null,Bu(e,t))}}},ju=(e,t)=>{var i=t[e+"Buffer"],n=Nu(e);i&&(i.removeEventListener("updateend",t[`on${n}UpdateEnd_`]),i.removeEventListener("error",t[`on${n}Error_`]),t.codecs[e]=null,t[e+"Buffer"]=null)},Fu=(e,t)=>e&&t&&-1!==Array.prototype.indexOf.call(e.sourceBuffers,t),qu=(e,t,i)=>(n,r)=>{var s=r[n+"Buffer"];if(Fu(r.mediaSource,s)){r.logger_(`Appending segment ${t.mediaIndex}'s ${e.length} bytes to ${n}Buffer`);try{s.appendBuffer(e)}catch(e){r.logger_(`Error with code ${e.code} `+(22===e.code?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${t.mediaIndex} to ${n}Buffer`),r.queuePending[n]=null,i(e)}}},Hu=(e,t)=>(i,n)=>{var r=n[i+"Buffer"];if(Fu(n.mediaSource,r)){n.logger_(`Removing ${e} to ${t} from ${i}Buffer`);try{r.remove(e,t)}catch(r){n.logger_(`Remove ${e} to ${t} from ${i}Buffer failed`)}}},Vu=e=>(t,i)=>{var n=i[t+"Buffer"];Fu(i.mediaSource,n)&&(i.logger_(`Setting ${t}timestampOffset to `+e),n.timestampOffset=e)},$u=e=>(t,i)=>{e()},Wu=e=>t=>{if("open"===t.mediaSource.readyState){t.logger_(`Calling mediaSource endOfStream(${e||""})`);try{t.mediaSource.endOfStream(e)}catch(e){Tr.log.warn("Failed to call media source endOfStream",e)}}},zu=e=>t=>{t.logger_("Setting mediaSource duration to "+e);try{t.mediaSource.duration=e}catch(e){Tr.log.warn("Failed to set media source duration",e)}},Gu=()=>(e,t)=>{if("open"===t.mediaSource.readyState){var i=t[e+"Buffer"];if(Fu(t.mediaSource,i)){t.logger_(`calling abort on ${e}Buffer`);try{i.abort()}catch(t){Tr.log.warn(`Failed to abort on ${e}Buffer`,t)}}}},Xu=(e,t)=>i=>{var n=Nu(e),r=Hr(t);(r=(i.logger_(`Adding ${e}Buffer with codec ${t} to mediaSource`),i.mediaSource.addSourceBuffer(r))).addEventListener("updateend",i[`on${n}UpdateEnd_`]),r.addEventListener("error",i[`on${n}Error_`]),i.codecs[e]=t,i[e+"Buffer"]=r},Ku=e=>t=>{var i=t[e+"Buffer"];if(ju(e,t),Fu(t.mediaSource,i)){t.logger_(`Removing ${e}Buffer with codec ${t.codecs[e]} from mediaSource`);try{t.mediaSource.removeSourceBuffer(i)}catch(t){Tr.log.warn(`Failed to removeSourceBuffer ${e}Buffer`,t)}}},Qu=e=>(t,i)=>{var n=i[t+"Buffer"],r=Hr(e);Fu(i.mediaSource,n)&&i.codecs[t]!==e&&(i.logger_(`changing ${t}Buffer codec from ${i.codecs[t]} to `+e),n.changeType(r),i.codecs[t]=e)},Yu=({type:e,sourceUpdater:t,action:i,doneFn:n,name:r})=>{t.queue.push({type:e,action:i,doneFn:n,name:r}),Bu(e,t)},Ju=(e,t)=>i=>{var n;t.queuePending[e]&&(n=t.queuePending[e].doneFn,t.queuePending[e]=null,n)&&n(t[e+"Error_"]),Bu(e,t)};class Zu extends Tr.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>Bu("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=Ho("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=Ju("video",this),this.onAudioUpdateEnd_=Ju("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())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){Yu({type:"mediaSource",sourceUpdater:this,action:Xu(e,t),name:"addSourceBuffer"})}abort(e){Yu({type:e,sourceUpdater:this,action:Gu(e),name:"abort"})}removeSourceBuffer(e){this.canRemoveSourceBuffer()?Yu({type:"mediaSource",sourceUpdater:this,action:Ku(e),name:"removeSourceBuffer"}):Tr.log.error("removeSourceBuffer is not supported!")}canRemoveSourceBuffer(){return!Tr.browser.IE_VERSION&&!Tr.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()?Yu({type:e,sourceUpdater:this,action:Qu(t),name:"changeType"}):Tr.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:n,bytes:r}=e;this.processedAppend_=!0,"audio"===n&&this.videoBuffer&&!this.videoAppendQueued_?(this.delayedAudioAppendQueue_.push([e,t]),this.logger_(`delayed audio append of ${r.length} until video append`)):(Yu({type:n,sourceUpdater:this,action:qu(r,i||{mediaIndex:-1},e=t),doneFn:t,name:"appendBuffer"}),"video"===n&&(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 Fu(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered||$o()}videoBuffered(){return Fu(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered||$o()}buffered(){var e=Fu(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=Fu(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;if(t&&!e)return this.audioBuffered();if(e&&!t)return this.videoBuffered();{var i=this.audioBuffered(),n=this.videoBuffered();let e=null,t=null,a=0;var r=[],s=[];if(!(i&&i.length&&n&&n.length))return $o();let o=i.length;for(;o--;)r.push({time:i.start(o),type:"start"}),r.push({time:i.end(o),type:"end"});for(o=n.length;o--;)r.push({time:n.start(o),type:"start"}),r.push({time:n.end(o),type:"end"});for(r.sort((function(e,t){return e.time-t.time})),o=0;o<r.length;o++)"start"===r[o].type?2==++a&&(e=r[o].time):"end"===r[o].type&&1==--a&&(t=r[o].time),null!==e&&null!==t&&(s.push([e,t]),e=null,t=null);return $o(s)}}setDuration(e,t=Mu){Yu({type:"mediaSource",sourceUpdater:this,action:zu(e),name:"duration",doneFn:t})}endOfStream(e=null,t=Mu){"string"!=typeof e&&(e=void 0),Yu({type:"mediaSource",sourceUpdater:this,action:Wu(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,i=Mu){this.audioBuffered().length&&0!==this.audioBuffered().end(0)?Yu({type:"audio",sourceUpdater:this,action:Hu(e,t),doneFn:i,name:"remove"}):i()}removeVideo(e,t,i=Mu){this.videoBuffered().length&&0!==this.videoBuffered().end(0)?Yu({type:"video",sourceUpdater:this,action:Hu(e,t),doneFn:i,name:"remove"}):i()}updating(){return!(!Uu("audio",this)&&!Uu("video",this))}audioTimestampOffset(e){return void 0!==e&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(Yu({type:"audio",sourceUpdater:this,action:Vu(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return void 0!==e&&this.videoBuffer&&this.videoTimestampOffset!==e&&(Yu({type:"video",sourceUpdater:this,action:Vu(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&Yu({type:"audio",sourceUpdater:this,action:$u(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&Yu({type:"video",sourceUpdater:this,action:$u(e),name:"callback"})}dispose(){this.trigger("dispose"),Ru.forEach((e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[e+"QueueCallback"]((()=>ju(e,this)))})),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}let ed=e=>decodeURIComponent(escape(String.fromCharCode.apply(null,e))),td=new Uint8Array("\n\n".split("").map((e=>e.charCodeAt(0))));class id extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}let nd=[{name:"VOD",run:(e,t,i,n,r)=>i!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"ProgramDateTime",run(e,t,i,n,r){if(!Object.keys(e.timelineToDatetimeMappings).length)return null;let s=null,a=null;var o=nl(t);r=r||0;for(let i=0;i<o.length;i++){var l=o[t.endList||0===r?i:o.length-(i+1)],u=l.segment,d=e.timelineToDatetimeMappings[u.timeline];if(d&&u.dateTimeObject){let e=u.dateTimeObject.getTime()/1e3+d;if(u.parts&&"number"==typeof l.partIndex)for(let t=0;t<l.partIndex;t++)e+=u.parts[t].duration;if(d=Math.abs(r-e),null!==a&&(0===d||a<d))break;a=d,s={time:e,segmentIndex:l.segmentIndex,partIndex:l.partIndex}}}return s}},{name:"Segment",run(e,t,i,n,r){let s=null,a=null;r=r||0;var o=nl(t);for(let e=0;e<o.length;e++){var l=o[t.endList||0===r?e:o.length-(e+1)],u=l.segment,d=l.part&&l.part.start||u&&u.start;if(u.timeline===n&&void 0!==d){if(u=Math.abs(r-d),null!==a&&a<u)break;(!s||null===a||a>=u)&&(a=u,s={time:d,segmentIndex:l.segmentIndex,partIndex:l.partIndex})}}return s}},{name:"Discontinuity",run(e,t,i,n,r){let s=null;if(r=r||0,t.discontinuityStarts&&t.discontinuityStarts.length){let i=null;for(let n=0;n<t.discontinuityStarts.length;n++){var a=t.discontinuityStarts[n],o=t.discontinuitySequence+n+1;if(o=e.discontinuities[o]){var l=Math.abs(r-o.time);if(null!==i&&i<l)break;(!s||null===i||i>=l)&&(i=l,s={time:o.time,segmentIndex:a,partIndex:null})}}}return s}},{name:"Playlist",run:(e,t,i,n,r)=>t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}];class rd extends Tr.EventTarget{constructor(e=0){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={},this.logger_=Ho("SyncController")}getSyncPoint(e,t,i,n){return(e=this.runStrategies_(e,t,i,n)).length?this.selectSyncPoint_(e,{key:"time",value:n}):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+Ko({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:t.segmentIndex,endIndex:0}))):null}runStrategies_(e,t,i,n){var r=[];for(let o=0;o<nd.length;o++){var s=nd[o],a=s.run(this,e,t,i,n);a&&(a.strategy=s.name,r.push({strategy:s.name,syncPoint:a}))}return r}selectSyncPoint_(e,t){let i=e[0].syncPoint,n=Math.abs(e[0].syncPoint[t.key]-t.value),r=e[0].strategy;for(let a=1;a<e.length;a++){var s=Math.abs(e[a].syncPoint[t.key]-t.value);s<n&&(n=s,i=e[a].syncPoint,r=e[a].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)Tr.log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);else for(let r=i-1;0<=r;r--){var n=e.segments[r];if(n&&void 0!==n.start){t.syncInfo={mediaSequence:e.mediaSequence+r,time:n.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),n=e.segment;i&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:n.start})),i=n.dateTimeObject;n.discontinuity&&t&&i&&(this.timelineToDatetimeMappings[n.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 n=e.segment,r=e.part;let s,a,o=this.timelines[e.timeline];if("number"==typeof e.timestampOffset)o={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=o,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${o.time}] [mapping: ${o.mapping}]`)),s=e.startOfSegment;else{if(!o)return!1;s=t.start+o.mapping}return a=t.end+o.mapping,r&&(r.start=s,r.end=a),(!n.start||s<n.start)&&(n.start=s),n.end=a,!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 o=0;o<t.discontinuityStarts.length;o++){var n=t.discontinuityStarts[o],r=t.discontinuitySequence+o+1,s=n-e.mediaIndex,a=Math.abs(s);if(!this.discontinuities[r]||this.discontinuities[r].accuracy>a){let o;o=s<0?i.start-Ko({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:n}):i.end+Ko({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:n}),this.discontinuities[r]={time:o,accuracy:a}}}}dispose(){this.trigger("dispose"),this.off()}}class sd extends Tr.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 ad=Kl(Ql(Yl((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,n=0;n<i;++n)t[n].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),s=t.length,a=0;a<s;++a)t[a].apply(this,r)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}();/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */let t=null;class i{constructor(e){let i,n,r;t=t||function(){var e=[[[],[],[],[],[]],[[],[],[],[],[]]],t=e[0],i=e[1],n=t[4],r=i[4];let s,a,o;var l,u,d,c=[],h=[];let p,m;for(s=0;s<256;s++)h[(c[s]=s<<1^283*(s>>7))^s]=s;for(a=o=0;!n[a];a^=l||1,o=h[o]||1)for(d=(d=o^o<<1^o<<2^o<<3^o<<4)>>8^255&d^99,m=16843009*c[u=c[l=c[r[n[a]=d]=a]]]^65537*u^257*l^16843008*a,p=257*c[d]^16843008*d,s=0;s<4;s++)t[s][a]=p=p<<24^p>>>8,i[s][d]=m=m<<24^m>>>8;for(s=0;s<5;s++)t[s]=t[s].slice(0),i[s]=i[s].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()]];var s=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 u=e.slice(0),d=[];for(this._key=[u,d],i=o;i<4*o+28;i++)r=u[i-1],(i%o==0||8===o&&i%o==4)&&(r=s[r>>>24]<<24^s[r>>16&255]<<16^s[r>>8&255]<<8^s[255&r],i%o==0)&&(r=r<<8^r>>>24^l<<24,l=l<<1^283*(l>>7)),u[i]=u[i-o]^r;for(n=0;i;n++,i--)r=u[3&n?i:i-4],d[n]=i<=4||n<4?r:a[0][s[r>>>24]]^a[1][s[r>>16&255]]^a[2][s[r>>8&255]]^a[3][s[255&r]]}decrypt(e,t,i,n,r,s){var a,o,l=this._key[1];let u,d=e^l[0],c=n^l[1],h=i^l[2],p=t^l[3];var m=l.length/4-2;let f,g=4;var y=(e=this._tables[1])[0],v=e[1],_=e[2],b=e[3],w=e[4];for(f=0;f<m;f++)u=y[d>>>24]^v[c>>16&255]^_[h>>8&255]^b[255&p]^l[g],a=y[c>>>24]^v[h>>16&255]^_[p>>8&255]^b[255&d]^l[g+1],o=y[h>>>24]^v[p>>16&255]^_[d>>8&255]^b[255&c]^l[g+2],p=y[p>>>24]^v[d>>16&255]^_[c>>8&255]^b[255&h]^l[g+3],g+=4,d=u,c=a,h=o;for(f=0;f<4;f++)r[(3&-f)+s]=w[d>>>24]<<24^w[c>>16&255]<<16^w[h>>8&255]<<8^w[255&p]^l[g++],u=d,d=c,c=h,h=p,p=u}}function n(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24}class r{constructor(t,i,s,a){var o=r.STEP,l=new Int32Array(t.buffer);let u=new Uint8Array(t.byteLength),d=0;for(this.asyncStream_=new class 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,s,u)),d=o;d<l.length;d+=o)s=new Uint32Array([n(l[d-4]),n(l[d-3]),n(l[d-2]),n(l[d-1])]),this.asyncStream_.push(this.decryptChunk_(l.subarray(d,d+o),i,s,u));this.asyncStream_.push((function(){var e;/*! @name aes-decrypter @version 4.0.1 @license Apache-2.0 */a(null,(e=u).subarray(0,e.byteLength-e[e.byteLength-1]))}))}static get STEP(){return 32e3}decryptChunk_(e,t,r,s){return function(){var a=function(e,t,r){var s,a,o,l,u=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),d=new i(Array.prototype.slice.call(t)),c=(t=new Uint8Array(e.byteLength),new Int32Array(t.buffer));let h,p,m,f,g;for(h=r[0],p=r[1],m=r[2],f=r[3],g=0;g<u.length;g+=4)s=n(u[g]),a=n(u[g+1]),o=n(u[g+2]),l=n(u[g+3]),d.decrypt(s,a,o,l,c,g),c[g]=n(c[g]^h),c[g+1]=n(c[g+1]^p),c[g+2]=n(c[g+2]^m),c[g+3]=n(c[g+3]^f),h=s,p=a,m=o,f=l;return t}(e,t,r);s.set(a,e.byteOffset)}}}var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};(s=(s="undefined"!=typeof window?window:void 0!==s?s:"undefined"!=typeof self?self:{}).BigInt||Number)("0x1"),s("0x100"),s("0x10000"),s("0x1000000"),s("0x100000000"),s("0x10000000000"),s("0x1000000000000"),s("0x100000000000000"),s("0x10000000000000000"),s=new Uint16Array([65484]),255!==(s=new Uint8Array(s.buffer,s.byteOffset,s.byteLength))[0]&&s[0],self.onmessage=function(e){let t=e.data;e=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength);var i=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),n=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new r(e,i,n,(function(e,i){self.postMessage(function(e){let t={};return Object.keys(e).forEach((i=>{var n,r=e[i];n=r,("function"===ArrayBuffer.isView?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer)?t[i]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:t[i]=r})),t}({source:t.source,decrypted:i}),[i.buffer])}))}}))));let od,ld=(e,t)=>{e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},ud=(e,t)=>{(t.activePlaylistLoader=e).load()},dd={AUDIO:(e,t)=>()=>{var{segmentLoaders:{[e]:i},mediaTypes:{[e]:n},excludePlaylist:r}=t,i=(ld(i,n),n.activeTrack()),s=((s=n.activeGroup()).filter((e=>e.default))[0]||s[0]).id,a=n.tracks[s];if(i===a)r({error:{message:"Problem encountered loading the default audio track."}});else{for(let e in Tr.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),n.tracks)n.tracks[e].enabled=n.tracks[e]===a;n.onTrackChanged()}},SUBTITLES:(e,t)=>()=>{var i,{segmentLoaders:{[e]:i},mediaTypes:{[e]:n}}=t;(i=(Tr.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),ld(i,n),n.activeTrack()))&&(i.mode="disabled"),n.onTrackChanged()}},cd={AUDIO(e,t,i){if(!t)return;let{tech:n,requestOptions:r,segmentLoaders:{[e]:s}}=i;t.on("loadedmetadata",(()=>{var e=t.media();s.playlist(e,r),(!n.paused()||e.endList&&"none"!==n.preload())&&s.load()})),t.on("loadedplaylist",(()=>{s.playlist(t.media(),r),n.paused()||s.load()})),t.on("error",dd[e](e,i))},SUBTITLES(e,t,i){let{tech:n,requestOptions:r,segmentLoaders:{[e]:s},mediaTypes:{[e]:a}}=i;t.on("loadedmetadata",(()=>{var e=t.media();s.playlist(e,r),s.track(a.activeTrack()),(!n.paused()||e.endList&&"none"!==n.preload())&&s.load()})),t.on("loadedplaylist",(()=>{s.playlist(t.media(),r),n.paused()||s.load()})),t.on("error",dd[e](e,i))}},hd={AUDIO(e,t){var i,{vhs:n,sourceType:r,segmentLoaders:{[e]:s},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[e]:{groups:l,tracks:u,logger_:d}},mainPlaylistLoader:c}=t,h=gl(c.main);for(let s in o[e]&&0!==Object.keys(o[e]).length||(o[e]={main:{default:{default:!0}}},h&&(o[e].main.default.playlists=c.main.playlists)),o[e])for(let p in l[s]||(l[s]=[]),o[e][s]){let m,f=o[e][s][p];m=h?(d(`AUDIO group '${s}' label '${p}' is a main playlist`),f.isMainPlaylist=!0,null):"vhs-json"===r&&f.playlists?new Al(f.playlists[0],n,a):f.resolvedUri?new Al(f.resolvedUri,n,a):f.playlists&&"dash"===r?new zl(f.playlists[0],n,a,c):null,f=Vo({id:p,playlistLoader:m},f),cd[e](e,f.playlistLoader,t),l[s].push(f),void 0===u[p]&&(i=new Tr.AudioTrack({id:p,kind:(e=>{let t=e.default?"main":"alternative";return e.characteristics&&0<=e.characteristics.indexOf("public.accessibility.describes-video")?"main-desc":t})(f),enabled:!1,language:f.language,default:f.default,label:p}),u[p]=i)}s.on("error",dd[e](e,t))},SUBTITLES(e,t){var i,{tech:n,vhs:r,sourceType:s,segmentLoaders:{[e]:a},requestOptions:o,main:{mediaGroups:l},mediaTypes:{[e]:{groups:u,tracks:d}},mainPlaylistLoader:c}=t;for(let a in l[e])for(let h in u[a]||(u[a]=[]),l[e][a])if(!l[e][a][h].forced){let p,m=l[e][a][h];if("hls"===s)p=new Al(m.resolvedUri,r,o);else if("dash"===s){if(!m.playlists.filter((e=>e.excludeUntil!==1/0)).length)return;p=new zl(m.playlists[0],r,o,c)}else"vhs-json"===s&&(p=new Al(m.playlists?m.playlists[0]:m.resolvedUri,r,o));m=Vo({id:h,playlistLoader:p},m),cd[e](e,m.playlistLoader,t),u[a].push(m),void 0===d[h]&&(i=n.addRemoteTextTrack({id:h,kind:"subtitles",default:m.default&&m.autoselect,language:m.language,label:h},!1).track,d[h]=i)}a.on("error",dd[e](e,t))},"CLOSED-CAPTIONS"(e,t){var{tech:i,main:{mediaGroups:n},mediaTypes:{[e]:{groups:r,tracks:s}}}=t;for(let t in n[e])for(let l in r[t]||(r[t]=[]),n[e][t]){var a=n[e][t][l];if(/^(?:CC|SERVICE)/.test(a.instreamId)){var o=i.options_.vhs&&i.options_.vhs.captionServices||{};let e={label:l,language:a.language,instreamId:a.instreamId,default:a.default&&a.autoselect};void 0===(e=o[e.instreamId]?Vo(e,o[e.instreamId]):e).default&&delete e.default,r[t].push(Vo({id:l},a)),void 0===s[l]&&(o=i.addRemoteTextTrack({id:e.instreamId,kind:"captions",default:e.default,language:e.language,label:e.label},!1).track,s[l]=o)}}}},pd=(e,t)=>{for(let i=0;i<e.length;i++)if(fl(t,e[i])||e[i].playlists&&pd(e[i].playlists,t))return!0;return!1},md={AUDIO:(e,t)=>()=>{var{[e]:{tracks:i}}=t.mediaTypes;for(let e in i)if(i[e].enabled)return i[e];return null},SUBTITLES:(e,t)=>()=>{var{[e]:{tracks:i}}=t.mediaTypes;for(let e in i)if("showing"===i[e].mode||"hidden"===i[e].mode)return i[e];return null}};class fd extends Tr.EventTarget{constructor(e){super();let{src:t,withCredentials:i,tech:n,bandwidth:r,externVhs:s,useCueTags:a,playlistExclusionDuration:o,enableLowInitialPlaylist:l,sourceType:u,cacheEncryptionKeys:d,bufferBasedABR:c,leastPixelDiffSelector:h,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),od=s,this.bufferBasedABR=Boolean(c),this.leastPixelDiffSelector=Boolean(h),this.withCredentials=i,this.tech_=n,this.vhs_=n.vhs,this.sourceType_=u,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:Mu,activeTrack:Mu,getActiveGroup:Mu,onGroupChanged:Mu,onTrackChanged:Mu,lastTrack_:null,logger_:Ho(`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_=$o(),this.hasPlayed_=!1,this.syncController_=new rd(e),this.segmentMetadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new ad,this.sourceUpdater_=new Zu(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new sd;var f={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,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};this.mainPlaylistLoader_=new("dash"===this.sourceType_?zl:Al)(t,this.vhs_,this.requestOptions_),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new Du(Vo(f,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new Du(Vo(f,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new class extends Du{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?$o([[(e=this.subtitlesTrack_.cues)[0].startTime,e[e.length-1].startTime]]):$o()}initSegmentForMap(e,t=!1){if(!e)return null;var i=Rl(e);let n=this.initSegments_[i];return t&&!n&&e.bytes&&(t=td.byteLength+e.bytes.byteLength,(t=new Uint8Array(t)).set(e.bytes),t.set(td,e.bytes.byteLength),this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:t}),n||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){xu(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===uu&&this.handleTimeout_(),e.code===du?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);else{var n=this.pendingSegment_,r=(this.saveBandwidthRelatedStats_(n.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending"),n.segment);if(r.map&&(r.map.bytes=t.map.bytes),n.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_(n)}catch(e){return void this.stopForError({message:e.message})}if(this.updateTimeMapping_(n,this.syncController_.timelines[n.timeline],this.playlist_),n.cues.length?n.timingInfo={start:n.cues[0].startTime,end:n.cues[n.cues.length-1].endTime}:n.timingInfo={start:n.startOfSegment,end:n.startOfSegment+n.duration},n.isSyncRequest)this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";else{n.byteLength=n.bytes.byteLength,this.mediaSecondsLoaded+=r.duration,n.cues.forEach((e=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new window.VTTCue(e.startTime,e.endTime,e.text):e)}));var s=this.subtitlesTrack_,a=s.cues;if(a)for(let e=0;e<a.length;e++){var o=[];let t=0;for(let i=0;i<a.length;i++)a[e].startTime===a[i].startTime&&a[e].endTime===a[i].endTime&&a[e].text===a[i].text&&1<++t&&o.push(a[i]);o.length&&o.forEach((e=>s.removeCue(e)))}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 id;"function"==typeof window.TextDecoder?t=new window.TextDecoder("utf8"):(t=window.WebVTT.StringDecoder(),i=!0);var n=new window.WebVTT.Parser(window,window.vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},n.oncue=e.cues.push.bind(e.cues),n.ontimestampmap=t=>{e.timestampmap=t},n.onparsingerror=e=>{Tr.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){let t=e.segment.map.bytes;i&&(t=ed(t)),n.parse(t)}let r=e.bytes;i&&(r=ed(r)),n.parse(r),n.flush()}updateTimeMapping_(e,t,i){var n=e.segment;if(t)if(e.cues.length){var r=e.timestampmap;let s=r.MPEGTS/9e4-r.LOCAL+t.mapping;e.cues.forEach((e=>{e.startTime+=s,e.endTime+=s})),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-n.duration)})}else n.empty=!0}}(Vo(f,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise(((e,t)=>{function i(){n.off("vttjserror",r),e()}function r(){n.off("vttjsloaded",i),t()}n.one("vttjsloaded",i),n.one("vttjserror",r),n.addWebVttScript_()}))}),e),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_=Ho("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,f="none"===this.tech_.preload()?"play":"loadstart";this.tech_.one(f,(()=>{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 n=(n=this.media())&&(n.id||n.uri),r=e.id||e.uri;n&&n!==r&&(this.logger_(`switch media ${n} -> ${r} from `+t),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+t})),this.mainPlaylistLoader_.media(e,i)}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,n=Object.keys(i);let r;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)r=this.mediaTypes_.AUDIO.activeTrack();else{var s=i.main||n.length&&i[n[0]];for(let e in s)if(s[e].default){r={label:e};break}}if(!r)return t;var a=[];for(let t in i)if(i[t][r.label]){var o=i[t][r.label];if(o.playlists&&o.playlists.length)a.push.apply(a,o.playlists);else if(o.uri)a.push(o);else if(e.playlists.length)for(let i=0;i<e.playlists.length;i++){var l=e.playlists[i];l.attributes&&l.attributes.AUDIO&&l.attributes.AUDIO===t&&a.push(l)}}return a.length?a:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",(()=>{var e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;ml(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,e.endList&&"none"!==this.tech_.preload()&&(this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load()),(e=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((t=>{hd[t](t,e)}));let{mediaTypes:t,mainPlaylistLoader:i,tech:n,vhs:r,segmentLoaders:{AUDIO:s,main:a}}=e;["AUDIO","SUBTITLES"].forEach((i=>{var n,r,s,a,o,l,u,d,c,h;t[i].activeGroup=(n=i,r=e,e=>{var{mainPlaylistLoader:t,mediaTypes:{[n]:{groups:i}}}=r,s=t.media();if(!s)return null;let a=null;s.attributes[n]&&(a=i[s.attributes[n]]);var o=Object.keys(i);if(!a)if("AUDIO"===n&&1<o.length&&gl(r.main))for(let e=0;e<o.length;e++){var l=i[o[e]];if(pd(l,s)){a=l;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=md[i](i,e),t[i].onGroupChanged=(s=i,a=e,()=>{var{segmentLoaders:{[s]:e,main:t},mediaTypes:{[s]:i}}=a,n=i.activeTrack(),r=i.getActiveGroup(),o=i.activePlaylistLoader,l=i.lastGroup_;r&&l&&r.id===l.id||(i.lastGroup_=r,i.lastTrack_=n,ld(e,i),r&&!r.isMainPlaylist&&(r.playlistLoader?(e.resyncLoader(),ud(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=(u=i,d=e,()=>{var e,t,{mainPlaylistLoader:i,segmentLoaders:{[u]:n,main:r},mediaTypes:{[u]:s}}=d,a=s.activeTrack(),o=s.getActiveGroup(),l=s.activePlaylistLoader,c=s.lastTrack_;if((!c||!a||c.id!==a.id)&&(s.lastGroup_=o,s.lastTrack_=a,ld(n,s),o)){if(o.isMainPlaylist)return a&&c&&a.id!==c.id&&(t=(e=d.vhs.playlistController_).selectPlaylist(),e.media()!==t)?(s.logger_(`track change. Switching main audio from ${c.id} to `+a.id),i.pause(),r.resetEverything(),void e.fastQualityChange_(t)):void 0;if("AUDIO"===u){if(!o.playlistLoader)return r.setAudio(!0),void r.resetEverything();n.setAudio(!0),r.setAudio(!1)}l===o.playlistLoader||(n.track&&n.track(a),n.resetEverything()),ud(o.playlistLoader,s)}}),t[i].getActiveGroup=([c,h]=[i,e.mediaTypes],()=>{var e=h[c].activeTrack();return e?h[c].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),s):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(),n.trigger({type:"usage",name:"vhs-audio-change"})};for(let e in n.audioTracks().addEventListener("change",l),n.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),r.on("dispose",(()=>{n.audioTracks().removeEventListener("change",l),n.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)})),n.clearTracks("audio"),t.AUDIO.tracks)n.audioTracks().addTrack(t.AUDIO.tracks[e])})({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),e),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",(()=>{this.trigger("selectedinitialmedia")}))})),this.mainPlaylistLoader_.on("loadedplaylist",(()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let e=this.mainPlaylistLoader_.media();if(!e){let t;if(this.excludeUnsupportedVariants_(),!(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;ml(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 n=!0;for(let t in e=Object.keys(i.AUDIO),i.AUDIO)for(let e in i.AUDIO[t])i.AUDIO[t][e].uri||(n=!1);n&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),od.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(),n=this.bufferLowWaterLine(),r=this.bufferHighWaterLine(),{currentPlaylist:i,buffered:t,currentTime:e,nextPlaylist:n,bufferLowWaterLine:r,bufferHighWaterLine:s,duration:a,bufferBasedABR:o,log:l}={buffered:this.tech_.buffered(),currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:n,bufferHighWaterLine:r,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_};if(n){var u=`allowing switch ${i&&i.id||"null"} -> `+n.id;if(!i)return l(u+" as current playlist is not set"),!0;if(n.id!==i.id){var d=Boolean(Wo(t,e).length);if(!i.endList)return d||"number"!=typeof i.partTargetDuration?(l(u+" as current playlist is live"),!0):(l(`not ${u} as current playlist is live llhls, but currentTime isn't in buffered.`),!1);if(d=Xo(t,e),a<(t=o?Gl.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Gl.MAX_BUFFER_LOW_WATER_LINE))return l(u+` as duration < max low water line (${a} < ${t})`),!0;if((e=n.attributes.BANDWIDTH)<(a=i.attributes.BANDWIDTH)&&(!o||d<s)){let t=u+` as next bandwidth < current bandwidth (${e} < ${a})`;return o&&(t+=` and forwardBuffer < bufferHighWaterLine (${d} < ${s})`),l(t),!0}if((!o||a<e)&&r<=d){let t=u+` as forwardBuffer >= bufferLowWaterLine (${d} >= ${r})`;return o&&(t+=` and next bandwidth > current bandwidth (${e} > ${a})`),l(t),!0}l(`not ${u} as no switching criteria met`)}}else Tr.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",(()=>{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:120}))}));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.mainSegmentLoader_.resetEverything((()=>{Tr.browser.IE_VERSION||Tr.browser.IS_EDGE?this.tech_.setCurrentTime(this.tech_.currentTime()+.04):this.tech_.setCurrentTime(this.tech_.currentTime())})))}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){let e=this.seekable();if(!e.length)return!1;if(Tr.browser.IE_VERSION&&0===this.tech_.readyState())return this.tech_.one("loadedmetadata",(()=>{this.trigger("firstplay"),this.tech_.setCurrentTime(e.end(0)),this.hasPlayed_=!0})),!1;this.trigger("firstplay"),this.tech_.setCurrentTime(e.end(0))}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=od.Playlist.playlistEnd(e,t),t=this.tech_.currentTime(),(i=this.tech_.buffered()).length?(i=i.end(i.length-1))-t<=Jo&&e-i<=Jo:e-t<=Jo)}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 n=1===(n=(s=this.mainPlaylistLoader_.main.playlists).filter(cl)).length&&n[0]===e;if(1===s.length&&i!==1/0)return Tr.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(n);if(n){let t=!1;s.forEach((i=>{var n;i!==e&&void 0!==(n=i.excludeUntil)&&n!==1/0&&(t=!0,delete i.excludeUntil)})),t&&(Tr.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let a;var r,s;if(a=e.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*i,e.excludeUntil=a,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"}),s=this.selectPlaylist())return i=t.internal?this.logger_:Tr.log.warn,r=t.message?" "+t.message:"",i(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.`+r+` Switching to playlist ${s.id}.`),s.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),s.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]),i=s.targetDuration/2*1e3||5e3,r="number"==typeof s.lastRequest&&Date.now()-s.lastRequest<=i,this.switchMedia_(s,"exclude",n||r);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 n="all"===e,r=((n||"main"===e)&&i.push(this.mainPlaylistLoader_),[]);(n||"audio"===e)&&r.push("AUDIO"),(n||"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 n=this[t+"SegmentLoader_"];n&&(e===t||"all"===e)&&i.push(n)})),i.forEach((e=>t.forEach((t=>{"function"==typeof e[t]&&e[t]()}))))}setCurrentTime(e){var t=Wo(this.tech_.buffered(),e);return this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media()&&this.mainPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0}duration(){var e;return this.mainPlaylistLoader_&&(e=this.mainPlaylistLoader_.media())?e.endList?this.mediaSource?this.mediaSource.duration:od.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 n=this.mainPlaylistLoader_.main,r=od.Playlist.seekable(t,i,od.Playlist.liveEdgeDelay(n,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=od.Playlist.seekable(t,i,od.Playlist.liveEdgeDelay(n,t))).length))return;let s,a;this.seekable_&&this.seekable_.length&&(s=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_=$o([[(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)===s&&this.seekable_.start(0)===a||(this.logger_(`seekable updated [${el(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=od.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.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach((e=>{var t=this.mediaTypes_[e].groups;for(let e in t)t[e].forEach((e=>{e.playlistLoader&&e.playlistLoader.dispose()}))})),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){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=su(this.main(),t);let n={};var r=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(n.video=i.video||e.main.videoCodec||"avc1.4d400d"),e.main.isMuxed&&(n.video+=","+(i.audio||e.main.audioCodec||Vr)),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||r)&&(n.audio=i.audio||e.main.audioCodec||e.audio.audioCodec||Vr,e.audio.isFmp4=(e.main.hasAudio&&!e.main.isMuxed?e.main:e.audio).isFmp4),n.audio||n.video){let s,a={};if(["video","audio"].forEach((function(t){var i;n.hasOwnProperty(t)&&!((i=e[t].isFmp4)?Lr:Dr)(n[t])&&(a[i=e[t].isFmp4?"browser":"muxer"]=a[i]||[],a[i].push(n[t]),"audio"===t&&(s=i))})),r&&s&&t.attributes.AUDIO){let e=t.attributes.AUDIO;this.main().playlists.forEach((i=>{(i.attributes&&i.attributes.AUDIO)===e&&i!==t&&(i.excludeUntil=1/0)})),this.logger_(`excluding audio group ${e} as ${s} does not support codec(s): "${n.audio}"`)}if(!Object.keys(a).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){let e=[];if(["video","audio"].forEach((t=>{var i=(qr(this.sourceUpdater_.codecs[t]||"")[0]||{}).type,r=(qr(n[t]||"")[0]||{}).type;i&&r&&i.toLowerCase()!==r.toLowerCase()&&e.push(`"${this.sourceUpdater_.codecs[t]}" -> "${n[t]}"`)})),e.length)return void this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${e.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0})}return n}i=Object.keys(a).reduce(((e,t)=>(e&&(e+=", "),e+`${t} does not support codec(s): "${a[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 n,r;i=e[i];-1===t.indexOf(i.id)&&(t.push(i.id),r=[],!(n=su(this.main,i)).audio||Dr(n.audio)||Lr(n.audio)||r.push("audio codec "+n.audio),!n.video||Dr(n.video)||Lr(n.video)||r.push("video codec "+n.video),n.text&&"stpp.ttml.im1t"===n.text&&r.push("text codec "+n.text),r.length)&&(i.excludeUntil=1/0,this.logger_(`excluding ${i.id} for unsupported: `+r.join(", ")))}))}excludeIncompatibleVariants_(e){let t=[],i=this.main().playlists,n=ru(e=wu(qr(e))),r=e.video&&qr(e.video)[0]||null,s=e.audio&&qr(e.audio)[0]||null;Object.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=[],o=ru(l=su(this.mainPlaylistLoader_.main,e)),l.audio||l.video)&&(o!==n&&a.push(`codec count "${o}" !== "${n}"`),this.sourceUpdater_.canChangeType()||(o=l.video&&qr(l.video)[0]||null,l=l.audio&&qr(l.audio)[0]||null,o&&r&&o.type.toLowerCase()!==r.type.toLowerCase()&&a.push(`video codec "${o.type}" !== "${r.type}"`),l&&s&&l.type.toLowerCase()!==s.type.toLowerCase()&&a.push(`audio codec "${l.type}" !== "${s.type}"`)),a.length)&&(e.excludeUntil=1/0,this.logger_(`excluding ${e.id}: `+a.join(" && ")))}))}updateAdCues_(e){let t=0;var i=this.seekable(),[n,r,i=0]=(i.length&&(t=i.start(0)),[e,this.cueTagsTrack_,t]);if(n.segments){let e,t=i;for(let i=0;i<n.segments.length;i++){var s,a,o=n.segments[i];if(e=e||function(e,t){var i=e.cues;for(let e=0;e<i.length;e++){var n=i[e];if(t>=n.adStartTime&&t<=n.adEndTime)return n}return null}(r,t+o.duration/2)){if("cueIn"in o){e.endTime=t,e.adEndTime=t,t+=o.duration,e=null;continue}if(t<e.endTime){t+=o.duration;continue}e.endTime+=o.duration}else"cueOut"in o&&((e=new window.VTTCue(t,t+o.duration,o.cueOut)).adStartTime=t,e.adEndTime=t+parseFloat(o.cueOut),r.addCue(e)),"cueOutCont"in o&&([s,a]=o.cueOutCont.split("/").map(parseFloat),(e=new window.VTTCue(t,t+o.duration,"")).adStartTime=t-s,e.adEndTime=e.adStartTime+a,r.addCue(e));t+=o.duration}}}goalBufferLength(){var e=this.tech_.currentTime(),t=Gl.GOAL_BUFFER_LENGTH,i=Gl.GOAL_BUFFER_LENGTH_RATE,n=Math.max(t,Gl.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,n)}bufferLowWaterLine(){var e=this.tech_.currentTime(),t=Gl.BUFFER_LOW_WATER_LINE,i=Gl.BUFFER_LOW_WATER_LINE_RATE,n=Math.max(t,Gl.MAX_BUFFER_LOW_WATER_LINE),r=Math.max(t,Gl.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?r:n)}bufferHighWaterLine(){return Gl.BUFFER_HIGH_WATER_LINE}}class gd{constructor(e,t,i){var n,r,s,a,o=e.playlistController_,l=o.fastQualityChange_.bind(o);t.attributes&&(n=t.attributes.RESOLUTION,this.width=n&&n.width,this.height=n&&n.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]),this.codecs=su(o.main(),t),this.playlist=t,this.id=i,this.enabled=(r=e.playlists,s=t.id,a=l,e=>{var t=r.main.playlists[s],i=dl(t),n=cl(t);return void 0===e?n:(e?delete t.disabled:t.disabled=!0,e===n||i||(a(),e?r.trigger("renditionenabled"):r.trigger("renditiondisabled")),e)})}}let yd=["seeking","seeked","pause","playing","error"];class vd{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_=Ho("PlaybackWatcher"),this.logger_("initialize");let t=()=>this.monitorCurrentTime_(),i=()=>this.monitorCurrentTime_(),n=()=>this.techWaiting_(),r=()=>this.resetTimeUpdate_(),s=this.playlistController_,a=["main","subtitle","audio"],o={},l=(a.forEach((e=>{o[e]={reset:()=>this.resetSegmentDownloads_(e),updateend:()=>this.checkSegmentDownloads_(e)},s[e+"SegmentLoader_"].on("appendsdone",o[e].updateend),s[e+"SegmentLoader_"].on("playlistupdate",o[e].reset),this.tech_.on(["seeked","seeking"],o[e].reset)})),e=>{["main","audio"].forEach((t=>{s[t+"SegmentLoader_"][e]("appended",this.seekingAppendCheck_)}))});this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),l("off"))},this.clearSeekingAppendCheck_=()=>l("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),l("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",n),this.tech_.on(yd,r),this.tech_.on("canplay",i),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",n),this.tech_.off(yd,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=>{s[e+"SegmentLoader_"].off("appendsdone",o[e].updateend),s[e+"SegmentLoader_"].off("playlistupdate",o[e].reset),this.tech_.off(["seeked","seeking"],o[e].reset)})),this.checkCurrentTimeTimeout_&&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_"],n=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_"],n);this[e+"Buffered_"]=n,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:tl(n)}),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+Jo>=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=n=e.end(e.length-1)),this.beforeSeekableWindow_(e,t)&&(i=(n=e.start(0))+(n===e.end(0)?0:Jo)),void 0!==i)this.logger_(`Trying to seek outside of seekable at time ${t} with seekable range ${el(e)}. Seeking to `+i+".");else{var n=this.playlistController_.sourceUpdater_,r=(e=this.tech_.buffered(),n.audioBuffer?n.audioBuffered():null),s=(n=n.videoBuffer?n.videoBuffered():null,this.media()),a=s.partTargetDuration||2*(s.targetDuration-Yo),o=[r,n];for(let e=0;e<o.length;e++)if(o[e]&&Xo(o[e],t)<a)return!1;if(0===(s=zo(e,t)).length)return!1;i=s.start(0)+Jo,this.logger_(`Buffered region starts (${s.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=Wo(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();return!!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=zo(e,i)).length&&(this.logger_(`Stopped at ${i} and seeking to `+t.start(0)),this.resetTimeUpdate_(),this.skipTheGap_(i),!0)))}afterSeekableWindow_(e,t,i,n=!1){if(!e.length)return!1;let r=e.end(e.length-1)+Jo;return t>(!i.endList&&n?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 n,r;let s;return e.length&&t.length?(n=Wo(e,i-3),r=Wo(e,i),(t=Wo(t,i)).length&&!r.length&&n.length&&(s={start:n.end(0),end:t.end(0)})):zo(e,i).length||(s=this.gapFromVideoUnderflow_(e,i)),!!s&&(this.logger_(`Encountered a gap in video from ${s.start} to ${s.end}. Seeking to current time `+i),!0)}}skipTheGap_(e){var t=this.tech_.buffered(),i=this.tech_.currentTime();t=zo(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)+Yo),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}))}gapFromVideoUnderflow_(e,t){var i=function(e){if(e.length<2)return $o();var t=[];for(let r=1;r<e.length;r++){var i=e.end(r-1),n=e.start(r);t.push([i,n])}return $o(t)}(e);for(let e=0;e<i.length;e++){var n=i.start(e),r=i.end(e);if(t-n<4&&2<t-n)return{start:n,end:r}}return null}}let _d={errorInterval:30,getSource(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},bd=function(e,t){let i=0,n=0;function r(t){null!=t&&(n=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 s(){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);Tr.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}}function a(){e.off("loadedmetadata",l),e.off("error",s),e.off("dispose",a)}let o=Vo(_d,t),l=(e.ready((()=>{e.trigger({type:"usage",name:"vhs-error-reload-initialized"})})),function(){n&&e.currentTime(n)});e.on("error",s),e.on("dispose",a),e.reloadSourceOnError=function(t){a(),bd(e,t)}};function wd(e,t){var i=t.media();let n=-1;for(let t=0;t<e.length;t++)if(e[t].id===i.id){n=t;break}e.selectedIndex_=n,e.trigger({selectedIndex:n,type:"change"})}let Td={PlaylistLoader:Al,Playlist:yl,utils:Xn,STANDARD_PLAYLIST_SELECTOR:Cu,INITIAL_PLAYLIST_SELECTOR:function(){var e=this.playlists.main.playlists.filter(yl.isEnabled);Eu(e,((e,t)=>ou(e,t))),e=e.filter((e=>!!su(this.playlists.main,e).video));return e[0]||null},lastBandwidthSelector:Cu,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 n=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),ku(this.playlists.main,t,parseInt(au(this.tech_.el(),"width"),10)*n,parseInt(au(this.tech_.el(),"height"),10)*n,this.limitRenditionByPlayerDimensions,this.playlistController_)}},comparePlaylistBandwidth:ou,comparePlaylistResolution:function(e,t){let i,n;return(i=(i=e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width?e.attributes.RESOLUTION.width:i)||window.Number.MAX_VALUE)===(n=(n=t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width?t.attributes.RESOLUTION.width:n)||window.Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-n},xhr:Ol()},Sd=(Object.keys(Gl).forEach((e=>{Object.defineProperty(Td,e,{get:()=>(Tr.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),Gl[e]),set(t){Tr.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),"number"!=typeof t||t<0?Tr.log.warn(`value of Vhs.${e} must be greater than or equal to 0`):Gl[e]=t}})})),"videojs-vhs"),Ed=(Td.canPlaySource=function(){return Tr.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},({player:e,sourceKeySystems:t,audioMedia:i,mainPlaylists:n})=>{if(!e.eme.initializeMediaKeys)return Promise.resolve();var r;i=i?n.concat([i]):n,n=i,r=Object.keys(t),i=n.reduce(((e,t)=>{var i;return t.contentProtection&&Object.keys(i=r.reduce(((e,i)=>{var n=t.contentProtection[i];return n&&n.pssh&&(e[i]={pssh:n.pssh}),e}),{})).length&&e.push(i),e}),[]);let s=[],a=[];return i.forEach((t=>{a.push(new Promise(((t,i)=>{e.tech_.one("keysessioncreated",t)}))),s.push(new Promise(((i,n)=>{e.eme.initializeMediaKeys({keySystems:t},(e=>{e?n(e):i()}))})))})),Promise.race([Promise.all(s),Promise.race(a)])}),kd=()=>{if(!window.localStorage)return null;var e=window.localStorage.getItem(Sd);if(!e)return null;try{return JSON.parse(e)}catch(e){return null}};Td.supportsNativeHls=function(){if(!document||!document.createElement)return!1;let e=document.createElement("video");return!!Tr.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))}))}(),Td.supportsNativeDash=!!(document&&document.createElement&&Tr.getTech("Html5").isSupported())&&/maybe|probably/i.test(document.createElement("video").canPlayType("application/dash+xml")),Td.supportsTypeNatively=e=>"hls"===e?Td.supportsNativeHls:"dash"===e&&Td.supportsNativeDash,Td.isSupported=function(){return Tr.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};class Cd extends(Tr.getComponent("Component")){constructor(e,t,i){if(super(t,i.vhs),"number"==typeof i.initialBandwidth&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=Ho("VhsHandler"),t.options_&&t.options_.playerId&&(i=Tr.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_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=!1!==this.options_.llhls,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,"number"!=typeof this.options_.playlistExclusionDuration&&(this.options_.playlistExclusionDuration=300),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage&&((e=kd())&&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=Gl.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Gl.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach((e=>{void 0!==this.source_[e]&&(this.options_[e]=this.source_[e])})),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio}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=Td,this.options_.sourceType=Mr(t),this.options_.seekTo=e=>{this.tech_.setCurrentTime(e)},this.playlistController_=new fd(this.options_),e=Vo({liveRangeSafeTimeDelta:Jo},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_}),this.playbackWatcher_=new vd(e),this.playlistController_.on("error",(()=>{var e=Tr.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?Td.movingAverageBandwidthSelector(.55):Td.STANDARD_PLAYLIST_SELECTOR,this.playlistController_.selectPlaylist=(this.selectPlaylist||t).bind(this),this.playlistController_.selectInitialPlaylist=Td.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(){Tr.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:()=>tl(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:()=>tl(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=kd())?Vo(t,e):e;try{window.localStorage.setItem(Sd,JSON.stringify(t))}catch(e){return}}}})),this.playlistController_.on("selectedinitialmedia",(()=>{var e;(e=this).representations=()=>{var t=e.playlistController_.main();return(t=gl(t)?e.playlistController_.getAudioTrackPlaylists_():t.playlists)?t.filter((e=>!dl(e))).map(((t,i)=>new gd(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"),Ed({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=(({player:e,sourceKeySystems:t,media:i,audioMedia:n})=>!(!(t=((e,t,i)=>{if(!e)return e;let n={};t&&t.attributes&&t.attributes.CODECS&&(n=wu(qr(t.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(n.audio=i.attributes.CODECS);var r=Hr(n.video),s=Hr(n.audio),a={};for(let i in e)a[i]={},s&&(a[i].audioContentType=s),r&&(a[i].videoContentType=r),t.contentProtection&&t.contentProtection[i]&&t.contentProtection[i].pssh&&(a[i].pssh=t.contentProtection[i].pssh),"string"==typeof e[i]&&(a[i].url=e[i]);return Vo(e,a)})(t,i,n))||(e.currentSource().keySystems=t)&&!e.eme&&(Tr.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),1)))({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});this.player_.tech_.on("keystatuschange",(e=>{if("output-restricted"===e.status&&(e=this.playlistController_.main())&&e.playlists){let t=[];e.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&&(Tr.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_.fastQualityChange_())}})),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),11!==Tr.browser.IE_VERSION&&e?this.createKeySessions_():this.playlistController_.sourceUpdater_.initializedEme()}setupQualityLevels_(){var e=Tr.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)})),wd(e,t.playlists)})),this.playlists.on("mediachange",(()=>{wd(this.qualityLevels_,this.playlists)})))}static version(){return{"@videojs/http-streaming":"3.0.2","mux.js":"6.3.0","mpd-parser":"1.0.1","m3u8-parser":"6.0.0","aes-decrypter":"4.0.1"}}version(){return this.constructor.version()}canChangeType(){return Zu.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(({playlist:e,time:t,callback:i})=>{var n,r;if(i)return e&&void 0!==t?(e=((e,t)=>{if(!t||!t.segments||0===t.segments.length)return null;let i,n=0;for(let r=0;r<t.segments.length&&!(e<=(n=(i=t.segments[r]).videoTimingInfo?i.videoTimingInfo.transmuxedPresentationEnd:n+i.duration));r++);var r=t.segments[t.segments.length-1];if(r.videoTimingInfo&&r.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>n){if(e>n+.25*r.duration)return null;i=r}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:n-i.duration,type:i.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}):(n={mediaSeconds:t},(r=(e=e.segment).dateTimeObject?(r=e.videoTimingInfo.transmuxerPrependedSeconds,t-=e.videoTimingInfo.transmuxedPresentationStart+r,new Date(e.dateTimeObject.getTime()+1e3*t)):null)&&(n.programDateTime=r.toISOString()),i(null,n)):i({message:"valid programTime was not found"}):i({message:"getProgramTime: playlist and time must be provided"});throw Error("getProgramTime: callback must be provided")})({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=!0,n=2){return Fl({programTime:e,playlist:this.playlistController_.media(),retryCount:n,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}}let xd={name:"videojs-http-streaming",VERSION:"3.0.2",canHandleSource:(e,t={})=>(t=Vo(Tr.options,t),xd.canPlayType(e.type,t)),handleSource:(e,t,i={})=>(i=Vo(Tr.options,i),t.vhs=new Cd(e,t,i),t.vhs.xhr=Ol(),t.vhs.src(e.src,e.type),t.vhs),canPlayType:(e,t)=>(e=Mr(e))&&(t=xd.getOverrideNative(t),!Td.supportsTypeNatively(e)||t)?"maybe":"",getOverrideNative(e={}){var{vhs:e={}}=e,t=!(Tr.browser.IS_ANY_SAFARI||Tr.browser.IS_IOS),{overrideNative:e=t}=e;return e}};return Lr("avc1.4d400d,mp4a.40.2")&&Tr.getTech("Html5").registerSourceHandler(xd,0),Tr.VhsHandler=Cd,Tr.VhsSourceHandler=xd,Tr.Vhs=Td,Tr.use||Tr.registerComponent("Vhs",Td),Tr.options.vhs=Tr.options.vhs||{},Tr.getPlugin&&Tr.getPlugin("reloadSourceOnError")||Tr.registerPlugin("reloadSourceOnError",(function(e){bd(this,e)})),Tr})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("video.js")):"function"==typeof define&&define.amd?define(["video.js"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).videojsHlsQualitySelector=t(e.videojs)}(this,(function(e){"use strict";var t,i=(t=e)&&"object"==typeof t&&"default"in t?t:{default:t};let n=i.default.getComponent("MenuButton"),r=i.default.getComponent("Menu");i.default.getComponent("Component"),i.default.dom;class s extends n{constructor(e){super(e,{title:e.localize("Quality"),name:"QualityButton"})}createItems(){return[]}createMenu(){let e=new r(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.items=this.createItems(),this.items)for(let t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e}}let a=i.default.getComponent("MenuItem");class o extends a{constructor(e,t,i,n){super(e,{label:t.label,selectable:!0,selected:t.selected||!1}),this.item=t,this.qualityButton=i,this.plugin=n}handleClick(){for(let e=0;e<this.qualityButton.items.length;++e)this.qualityButton.items[e].selected(!1);this.plugin.setQuality(this.item.value),this.selected(!0)}}let l=i.default.getPlugin("plugin");class u extends l{constructor(e,t){super(e),this.options=i.default.obj.merge({},t),this.player.ready((()=>{this.player.qualityLevels&&(this.player.addClass("vjs-hls-quality-selector"),this.createQualityButton(),this.bindPlayerEvents())}))}bindPlayerEvents(){this.player.qualityLevels().on("addqualitylevel",this.onAddQualityLevel.bind(this))}createQualityButton(){let e=this.player;this._qualityButton=new s(e);let t=e.controlBar.children().length-2,i=e.controlBar.addChild(this._qualityButton,{componentClass:"qualitySelector"},this.options.placementIndex||t);if(i.addClass("vjs-quality-selector"),this.options.displayCurrentQuality)this.setButtonInnerText(e.localize("Auto"));else{let e=` ${this.options.vjsIconClass||"vjs-icon-hd"}`;i.menuButton_.$(".vjs-icon-placeholder").className+=e}i.removeClass("vjs-hidden")}setButtonInnerText(e){this._qualityButton.menuButton_.$(".vjs-icon-placeholder").innerHTML=e}getQualityMenuItem(e){let t=this.player;return new o(t,e,this._qualityButton,this)}onAddQualityLevel(){let e=this.player.qualityLevels().levels_||[],t=[];for(let i=0;i<e.length;++i){let{width:n,height:r}=e[i],s=n>r?r:n;if(s&&!t.filter((e=>e.item&&e.item.value===s)).length){let e=this.getQualityMenuItem.call(this,{label:s+"p",value:s});t.push(e)}}t.sort(((e,t)=>"object"!=typeof e||"object"!=typeof t?-1:e.item.value<t.item.value?1:e.item.value>t.item.value?-1:0)),t.push(this.getQualityMenuItem.call(this,{label:this.player.localize("Auto"),value:"auto",selected:!0})),this._qualityButton&&(this._qualityButton.createItems=()=>t,this._qualityButton.update())}setQuality(e){let t=this.player.qualityLevels();this._currentQuality=e,this.options.displayCurrentQuality&&this.setButtonInnerText("auto"===e?this.player.localize("Auto"):`${e}p`);for(let i=0;i<t.length;++i){let{width:n,height:r}=t[i],s=n>r?r:n;t[i].enabled=s===e||"auto"===e}this._qualityButton.unpressButton();for(let e=0;e<this._qualityButton.items.length;++e)this._qualityButton.items[e].item.value==this._currentQuality?this._qualityButton.items[e].selected(!0):this._qualityButton.items[e].selected(!1)}getCurrentQuality(){return this._currentQuality||"auto"}}return u.VERSION="2.0.0",i.default.registerPlugin("hlsQualitySelector",u),u})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("video.js")):"function"==typeof define&&define.amd?define(["video.js"],t):e.videojsVttThumbnails=t(e.videojs)}(this,(function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e,function(){function e(e){this.value=e}function t(t){var i,n;function r(i,n){try{var a=t[i](n),o=a.value;o instanceof e?Promise.resolve(o.value).then((function(e){r("next",e)}),(function(e){r("throw",e)})):s(a.done?"return":"normal",a.value)}catch(e){s("throw",e)}}function s(e,t){switch(e){case"return":i.resolve({value:t,done:!0});break;case"throw":i.reject(t);break;default:i.resolve({value:t,done:!1})}(i=i.next)?r(i.key,i.arg):n=null}this._invoke=function(e,t){return new Promise((function(s,a){var o={key:e,arg:t,resolve:s,reject:a,next:null};n?n=n.next=o:(i=n=o,r(e,t))}))},"function"!=typeof t.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(t.prototype[Symbol.asyncIterator]=function(){return this}),t.prototype.next=function(e){return this._invoke("next",e)},t.prototype.throw=function(e){return this._invoke("throw",e)},t.prototype.return=function(e){return this._invoke("return",e)}}();var t={},i={},n=e.registerPlugin||e.plugin,r=function(i){var n=this;this.ready((function(){!function(e,t){e.addClass("vjs-vtt-thumbnails"),e.vttThumbnails=new s(e,t)}(n,e.mergeOptions(t,i))}))},s=function(){function t(e,i){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),this.player=e,this.options=i,this.listenForDurationChange(),this.initializeThumbnails(),this.registeredEvents={},this}return t.prototype.src=function(e){this.resetPlugin(),this.options.src=e,this.initializeThumbnails()},t.prototype.detach=function(){this.resetPlugin()},t.prototype.resetPlugin=function(){this.thumbnailHolder&&this.thumbnailHolder.parentNode.removeChild(this.thumbnailHolder),this.progressBar&&this.progressBar.removeEventListener("mouseenter",this.registeredEvents.progressBarMouseEnter),this.progressBar&&this.progressBar.removeEventListener("mouseleave",this.registeredEvents.progressBarMouseLeave),this.progressBar&&this.progressBar.removeEventListener("mousemove",this.registeredEvents.progressBarMouseMove),delete this.registeredEvents.progressBarMouseEnter,delete this.registeredEvents.progressBarMouseLeave,delete this.registeredEvents.progressBarMouseMove,delete this.progressBar,delete this.vttData,delete this.thumbnailHolder,delete this.timeHolder,delete this.lastStyle},t.prototype.listenForDurationChange=function(){this.player.on("durationchange",(function(){}))},t.prototype.initializeThumbnails=function(){var e=this;if(this.options.src){var t=this.getBaseUrl(),i=this.getFullyQualifiedUrl(this.options.src,t);this.getVttFile(i).then((function(t){e.vttData=e.processVtt(t),e.setupThumbnailElement(),e.options.hasOwnProperty("preloadStrategy")&&e.preload(e.vttData)}))}},t.prototype.getBaseUrl=function(){return[window.location.protocol,"//",window.location.hostname,window.location.port?":"+window.location.port:"",window.location.pathname].join("").split(/([^\/]*)$/gi).shift()},t.prototype.getVttFile=function(e){var t=this;return new Promise((function(i,n){var r=new XMLHttpRequest;r.data={resolve:i},r.addEventListener("load",t.vttFileLoaded),r.open("GET",e),r.send()}))},t.prototype.vttFileLoaded=function(){this.data.resolve(this.responseText)},t.prototype.preload=function(e){var t=this;e.forEach((function(e){return t.setImageInCacheForItem(e)}))},t.prototype.setupThumbnailElement=function(e){var t=this,i=this.player.$(".vjs-mouse-display");this.progressBar=this.player.$(".vjs-progress-control");var n=document.createElement("div");n.setAttribute("class","vjs-vtt-thumbnail-display"),this.progressBar.appendChild(n),this.thumbnailHolder=n;var r=document.createElement("time");r.setAttribute("class","vjs-vtt-thumbnail-time"),this.thumbnailHolder.appendChild(r),this.timeHolder=r,i&&i.classList.add("vjs-hidden"),this.registeredEvents.progressBarMouseEnter=function(){return t.onBarMouseenter()},this.registeredEvents.progressBarMouseLeave=function(){return t.onBarMouseleave()},this.progressBar.addEventListener("mouseenter",this.registeredEvents.progressBarMouseEnter),this.progressBar.addEventListener("mouseleave",this.registeredEvents.progressBarMouseLeave)},t.prototype.onBarMouseenter=function(){var e=this;this.mouseMoveCallback=function(t){e.onBarMousemove(t)},this.registeredEvents.progressBarMouseMove=this.mouseMoveCallback,this.progressBar.addEventListener("mousemove",this.registeredEvents.progressBarMouseMove),this.showThumbnailHolder()},t.prototype.onBarMouseleave=function(){this.registeredEvents.progressBarMouseMove&&this.progressBar.removeEventListener("mousemove",this.registeredEvents.progressBarMouseMove),this.hideThumbnailHolder()},t.prototype.getXCoord=function(e,t){var i=e.getBoundingClientRect(),n=document.documentElement;return t-(i.left+(window.pageXOffset||n.scrollLeft||0))},t.prototype.onBarMousemove=function(t){this.updateThumbnailStyle(e.dom.getPointerPosition(this.progressBar,t).x,this.progressBar.offsetWidth)},t.prototype.setImageInCacheForItem=function(e){if(e.css.url&&!i[e.css.url]){var t=new Image;t.src=e.css.url,i[e.css.url]=t}},t.prototype.getStyleForTime=function(e){for(var t=0;t<this.vttData.length;++t){var i=this.vttData[t];if(e>=i.start&&e<i.end)return this.setImageInCacheForItem(i),i.css}},t.prototype.showThumbnailHolder=function(){this.thumbnailHolder.style.opacity="1"},t.prototype.hideThumbnailHolder=function(){this.thumbnailHolder.style.opacity="0"},t.prototype.updateThumbnailStyle=function(e,t){var i=this.player.duration(),n=e*i,r=this.getStyleForTime(n),s=new Date(1e3*Math.round(n)).toISOString().substr(11,8);if(s=i>3599?s:s.substring(3),this.timeHolder.innerText=s,!r)return this.hideThumbnailHolder();var a=e*t,o=parseInt(this.thumbnailHolder.offsetWidth)/2,l=t-(a+o),u=a-o;if(u>0&&l>0?this.thumbnailHolder.style.transform="translateX("+(a-o)+"px)":u<=0?this.thumbnailHolder.style.transform="translateX(0px)":l<=0&&(this.thumbnailHolder.style.transform="translateX("+(a+l-o)+"px)"),!this.lastStyle||this.lastStyle!==r)for(var d in this.lastStyle=r,r)r.hasOwnProperty(d)&&(this.thumbnailHolder.style[d]=r[d])},t.prototype.processVtt=function(e){var t=this,i=[];return e.split(/[\r\n][\r\n]/i).forEach((function(e){if(e.match(/([0-9]{2}:)?([0-9]{2}:)?[0-9]{2}(.[0-9]{3})?( ?--> ?)([0-9]{2}:)?([0-9]{2}:)?[0-9]{2}(.[0-9]{3})?[\r\n]{1}.*/gi)){var n=e.split(/[\r\n]/i),r=n[0].split(/ ?--> ?/i),s=r[0],a=r[1],o=n[1],l=t.getVttCss(o);i.push({start:t.getSecondsFromTimestamp(s),end:t.getSecondsFromTimestamp(a),css:l})}})),i},t.prototype.getFullyQualifiedUrl=function(e,t){return e.indexOf("//")>=0?e:0===t.indexOf("//")?[t.replace(/\/$/gi,""),this.trim(e,"/")].join("/"):t.indexOf("//")>0?[this.trim(t,"/"),this.trim(e,"/")].join("/"):e},t.prototype.getPropsFromDef=function(e){var t=e.split(/#xywh=/i),i=t[0],n=t[1].match(/[0-9]+/gi);return{x:n[0],y:n[1],w:n[2],h:n[3],image:i}},t.prototype.getVttCss=function(e){var t,i={};if(t=this.options.baseUrl?this.options.baseUrl:this.options.src.indexOf("//")>=0?this.options.src.split(/([^\/]*)$/gi).shift():this.getBaseUrl()+this.options.src.split(/([^\/]*)$/gi).shift(),!(e=this.getFullyQualifiedUrl(e,t)).match(/#xywh=/i))return i.background='url("'+e+'")',i.url=e,i;var n=this.getPropsFromDef(e);return i.background='url("'+n.image+'") no-repeat -'+n.x+"px -"+n.y+"px",i.width=n.w+"px",i.height=n.h+"px",i.url=n.image,i},t.prototype.doconstructTimestamp=function(e){var t=e.split("."),i=t[0].split(":");return{milliseconds:parseInt(t[1])||0,seconds:parseInt(i.pop())||0,minutes:parseInt(i.pop())||0,hours:parseInt(i.pop())||0}},t.prototype.getSecondsFromTimestamp=function(e){var t=this.doconstructTimestamp(e);return parseInt(3600*t.hours+60*t.minutes+t.seconds+t.milliseconds/1e3)},t.prototype.trim=function(e,t){var i=" \n\r\t\f\v  \u2028\u2029 ",n=0,r=0;for(e+="",t&&(i=(t+"").replace(/([[\]().?/*{}+$^:])/g,"$1")),n=e.length,r=0;r<n;r++)if(-1===i.indexOf(e.charAt(r))){e=e.substring(r);break}for(r=(n=e.length)-1;r>=0;r--)if(-1===i.indexOf(e.charAt(r))){e=e.substring(0,r+1);break}return-1===i.indexOf(e.charAt(0))?e:""},t}();return n("vttThumbnails",r),r.VERSION="1.2.0",r})),function e(t,i,n){function r(a,o){if(!i[a]){if(!t[a]){var l="function"==typeof require&&require;if(!o&&l)return l(a,!0);if(s)return s(a,!0);throw(l=Error("Cannot find module '"+a+"'")).code="MODULE_NOT_FOUND",l}l=i[a]={exports:{}},t[a][0].call(l.exports,(function(e){return r(t[a][1][e]||e)}),l,l.exports,e,t,i,n)}return i[a].exports}for(var s="function"==typeof require&&require,a=0;a<n.length;a++)r(n[a]);return r}({1:[function(e,t,i){t.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},{}],2:[function(e,t,i){var n=e("../internals/is-object");t.exports=function(e){if(!n(e))throw TypeError(String(e)+" is not an object");return e}},{"../internals/is-object":33}],3:[function(e,t,i){var n=e("../internals/to-indexed-object"),r=e("../internals/to-length"),s=e("../internals/to-absolute-index");e=function(e){return function(t,i,a){var o,l=n(t),u=r(l.length),d=s(a,u);if(e&&i!=i){for(;d<u;)if((o=l[d++])!=o)return!0}else for(;d<u;d++)if((e||d in l)&&l[d]===i)return e||d||0;return!e&&-1}};t.exports={includes:e(!0),indexOf:e(!1)}},{"../internals/to-absolute-index":55,"../internals/to-indexed-object":56,"../internals/to-length":58}],4:[function(e,t,i){var n=e("../internals/function-bind-context"),r=e("../internals/indexed-object"),s=e("../internals/to-object"),a=e("../internals/to-length"),o=e("../internals/array-species-create"),l=[].push;e=function(e){var t=1==e,i=2==e,u=3==e,d=4==e,c=6==e,h=7==e,p=5==e||c;return function(m,f,g,y){for(var v,_,b=s(m),w=r(b),T=n(f,g,3),S=a(w.length),E=0,k=(y=y||o,t?y(m,S):i||h?y(m,0):void 0);E<S;E++)if((p||E in w)&&(_=T(v=w[E],E,b),e))if(t)k[E]=_;else if(_)switch(e){case 3:return!0;case 5:return v;case 6:return E;case 2:l.call(k,v)}else switch(e){case 4:return!1;case 7:l.call(k,v)}return c?-1:u||d?d:k}};t.exports={forEach:e(0),map:e(1),filter:e(2),some:e(3),every:e(4),find:e(5),findIndex:e(6),filterOut:e(7)}},{"../internals/array-species-create":6,"../internals/function-bind-context":20,"../internals/indexed-object":28,"../internals/to-length":58,"../internals/to-object":59}],5:[function(e,t,i){var n=e("../internals/fails"),r=e("../internals/well-known-symbol"),s=e("../internals/engine-v8-version"),a=r("species");t.exports=function(e){return 51<=s||!n((function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},{"../internals/engine-v8-version":16,"../internals/fails":19,"../internals/well-known-symbol":63}],6:[function(e,t,i){var n=e("../internals/is-object"),r=e("../internals/is-array"),s=e("../internals/well-known-symbol")("species");t.exports=function(e,t){var i;return new(void 0===(i=r(e)&&("function"==typeof(i=e.constructor)&&(i===Array||r(i.prototype))||n(i)&&null===(i=i[s]))?void 0:i)?Array:i)(0===t?0:t)}},{"../internals/is-array":31,"../internals/is-object":33,"../internals/well-known-symbol":63}],7:[function(e,t,i){var n={}.toString;t.exports=function(e){return n.call(e).slice(8,-1)}},{}],8:[function(e,t,i){var n=e("../internals/has"),r=e("../internals/own-keys"),s=e("../internals/object-get-own-property-descriptor"),a=e("../internals/object-define-property");t.exports=function(e,t){for(var i=r(t),o=a.f,l=s.f,u=0;u<i.length;u++){var d=i[u];n(e,d)||o(e,d,l(t,d))}}},{"../internals/has":24,"../internals/object-define-property":39,"../internals/object-get-own-property-descriptor":40,"../internals/own-keys":47}],9:[function(e,t,i){e=e("../internals/fails"),t.exports=!e((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},{"../internals/fails":19}],10:[function(e,t,i){var n=e("../internals/descriptors"),r=e("../internals/object-define-property"),s=e("../internals/create-property-descriptor");t.exports=n?function(e,t,i){return r.f(e,t,s(1,i))}:function(e,t,i){return e[t]=i,e}},{"../internals/create-property-descriptor":11,"../internals/descriptors":12,"../internals/object-define-property":39}],11:[function(e,t,i){t.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},{}],12:[function(e,t,i){e=e("../internals/fails"),t.exports=!e((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},{"../internals/fails":19}],13:[function(e,t,i){var n=e("../internals/global"),r=(e=e("../internals/is-object"),n.document),s=e(r)&&e(r.createElement);t.exports=function(e){return s?r.createElement(e):{}}},{"../internals/global":23,"../internals/is-object":33}],14:[function(e,t,i){var n=e("../internals/classof-raw");e=e("../internals/global");t.exports="process"==n(e.process)},{"../internals/classof-raw":7,"../internals/global":23}],15:[function(e,t,i){e=e("../internals/get-built-in"),t.exports=e("navigator","userAgent")||""},{"../internals/get-built-in":22}],16:[function(e,t,i){var n,r,s=e("../internals/global");e=e("../internals/engine-user-agent");(s=(s=(s=s.process)&&s.versions)&&s.v8)?r=(n=s.split("."))[0]+n[1]:e&&(!(n=e.match(/Edge\/(\d+)/))||74<=n[1])&&(n=e.match(/Chrome\/(\d+)/))&&(r=n[1]),t.exports=r&&+r},{"../internals/engine-user-agent":15,"../internals/global":23}],17:[function(e,t,i){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},{}],18:[function(e,t,i){var n=e("../internals/global"),r=e("../internals/object-get-own-property-descriptor").f,s=e("../internals/create-non-enumerable-property"),a=e("../internals/redefine"),o=e("../internals/set-global"),l=e("../internals/copy-constructor-properties"),u=e("../internals/is-forced");t.exports=function(e,t){var i,d,c,h=e.target,p=e.global,m=e.stat,f=p?n:m?n[h]||o(h,{}):(n[h]||{}).prototype;if(f)for(i in t){if(d=t[i],c=e.noTargetGet?(c=r(f,i))&&c.value:f[i],!u(p?i:h+(m?".":"#")+i,e.forced)&&void 0!==c){if(typeof d==typeof c)continue;l(d,c)}(e.sham||c&&c.sham)&&s(d,"sham",!0),a(f,i,d,e)}}},{"../internals/copy-constructor-properties":8,"../internals/create-non-enumerable-property":10,"../internals/global":23,"../internals/is-forced":32,"../internals/object-get-own-property-descriptor":40,"../internals/redefine":49,"../internals/set-global":51}],19:[function(e,t,i){t.exports=function(e){try{return!!e()}catch(e){return!0}}},{}],20:[function(e,t,i){var n=e("../internals/a-function");t.exports=function(e,t,i){if(n(e),void 0===t)return e;switch(i){case 0:return function(){return e.call(t)};case 1:return function(i){return e.call(t,i)};case 2:return function(i,n){return e.call(t,i,n)};case 3:return function(i,n,r){return e.call(t,i,n,r)}}return function(){return e.apply(t,arguments)}}},{"../internals/a-function":1}],21:[function(e,t,i){"use strict";var n=e("../internals/a-function"),r=e("../internals/is-object"),s=[].slice,a={};t.exports=Function.bind||function(e){var t=n(this),i=s.call(arguments,1),o=function(){var n=i.concat(s.call(arguments));return this instanceof o?function(e,t,i){if(!(t in a)){for(var n=[],r=0;r<t;r++)n[r]="a["+r+"]";a[t]=Function("C,a","return new C("+n.join(",")+")")}return a[t](e,i)}(t,n.length,n):t.apply(e,n)};return r(t.prototype)&&(o.prototype=t.prototype),o}},{"../internals/a-function":1,"../internals/is-object":33}],22:[function(e,t,i){function n(e){return"function"==typeof e?e:void 0}var r=e("../internals/path"),s=e("../internals/global");t.exports=function(e,t){return arguments.length<2?n(r[e])||n(s[e]):r[e]&&r[e][t]||s[e]&&s[e][t]}},{"../internals/global":23,"../internals/path":48}],23:[function(e,t,i){(function(e){(function(){function i(e){return e&&e.Math==Math&&e}t.exports=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof e&&e)||function(){return this}()||Function("return this")()}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],24:[function(e,t,i){var n=e("../internals/to-object"),r={}.hasOwnProperty;t.exports=function(e,t){return r.call(n(e),t)}},{"../internals/to-object":59}],25:[function(e,t,i){t.exports={}},{}],26:[function(e,t,i){e=e("../internals/get-built-in"),t.exports=e("document","documentElement")},{"../internals/get-built-in":22}],27:[function(e,t,i){var n=e("../internals/descriptors"),r=e("../internals/fails"),s=e("../internals/document-create-element");t.exports=!n&&!r((function(){return 7!=Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a}))},{"../internals/descriptors":12,"../internals/document-create-element":13,"../internals/fails":19}],28:[function(e,t,i){var n=e("../internals/fails"),r=e("../internals/classof-raw"),s="".split;t.exports=n((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==r(e)?s.call(e,""):Object(e)}:Object},{"../internals/classof-raw":7,"../internals/fails":19}],29:[function(e,t,i){e=e("../internals/shared-store");var n=Function.toString;"function"!=typeof e.inspectSource&&(e.inspectSource=function(e){return n.call(e)}),t.exports=e.inspectSource},{"../internals/shared-store":53}],30:[function(e,t,i){var n,r,s,a,o,l,u,d,c=e("../internals/native-weak-map"),h=e("../internals/global"),p=e("../internals/is-object"),m=e("../internals/create-non-enumerable-property"),f=e("../internals/has"),g=e("../internals/shared-store"),y=e("../internals/shared-key"),v=(e=e("../internals/hidden-keys"),"Object already initialized");h=h.WeakMap;u=c?(r=(n=g.state||(g.state=new h)).get,s=n.has,a=n.set,o=function(e,t){if(s.call(n,e))throw TypeError(v);return t.facade=e,a.call(n,e,t),t},l=function(e){return r.call(n,e)||{}},function(e){return s.call(n,e)}):(e[d=y("state")]=!0,o=function(e,t){if(f(e,d))throw TypeError(v);return t.facade=e,m(e,d,t),t},l=function(e){return f(e,d)?e[d]:{}},function(e){return f(e,d)}),t.exports={set:o,get:l,has:u,enforce:function(e){return u(e)?l(e):o(e,{})},getterFor:function(e){return function(t){var i;if(!p(t)||(i=l(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return i}}}},{"../internals/create-non-enumerable-property":10,"../internals/global":23,"../internals/has":24,"../internals/hidden-keys":25,"../internals/is-object":33,"../internals/native-weak-map":36,"../internals/shared-key":52,"../internals/shared-store":53}],31:[function(e,t,i){var n=e("../internals/classof-raw");t.exports=Array.isArray||function(e){return"Array"==n(e)}},{"../internals/classof-raw":7}],32:[function(e,t,i){var n=e("../internals/fails"),r=/#|\.prototype\./,s=(e=function(e,t){return(e=a[s(e)])==l||e!=o&&("function"==typeof t?n(t):!!t)},e.normalize=function(e){return String(e).replace(r,".").toLowerCase()}),a=e.data={},o=e.NATIVE="N",l=e.POLYFILL="P";t.exports=e},{"../internals/fails":19}],33:[function(e,t,i){t.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},{}],34:[function(e,t,i){t.exports=!1},{}],35:[function(e,t,i){var n=e("../internals/engine-is-node"),r=e("../internals/engine-v8-version");e=e("../internals/fails");t.exports=!!Object.getOwnPropertySymbols&&!e((function(){return!Symbol.sham&&(n?38===r:37<r&&r<41)}))},{"../internals/engine-is-node":14,"../internals/engine-v8-version":16,"../internals/fails":19}],36:[function(e,t,i){var n=e("../internals/global");e=e("../internals/inspect-source"),n=n.WeakMap;t.exports="function"==typeof n&&/native code/.test(e(n))},{"../internals/global":23,"../internals/inspect-source":29}],37:[function(e,t,i){function n(){}function r(e){return"<script>"+e+"</"+p+">"}var s,a=e("../internals/an-object"),o=e("../internals/object-define-properties"),l=e("../internals/enum-bug-keys"),u=e("../internals/hidden-keys"),d=e("../internals/html"),c=e("../internals/document-create-element"),h=(e=e("../internals/shared-key"),"prototype"),p="script",m=e("IE_PROTO"),f=function(){try{s=document.domain&&new ActiveXObject("htmlfile")}catch(e){}f=s?((e=s).write(r("")),e.close(),t=e.parentWindow.Object,e=null,t):((i=c("iframe")).style.display="none",d.appendChild(i),i.src=String("javascript:"),(i=i.contentWindow.document).open(),i.write(r("document.F=Object")),i.close(),i.F);for(var e,t,i,n=l.length;n--;)delete f[h][l[n]];return f()};u[m]=!0,t.exports=Object.create||function(e,t){var i;return null!==e?(n[h]=a(e),i=new n,n[h]=null,i[m]=e):i=f(),void 0===t?i:o(i,t)}},{"../internals/an-object":2,"../internals/document-create-element":13,"../internals/enum-bug-keys":17,"../internals/hidden-keys":25,"../internals/html":26,"../internals/object-define-properties":38,"../internals/shared-key":52}],38:[function(e,t,i){var n=e("../internals/descriptors"),r=e("../internals/object-define-property"),s=e("../internals/an-object"),a=e("../internals/object-keys");t.exports=n?Object.defineProperties:function(e,t){s(e);for(var i,n=a(t),o=n.length,l=0;l<o;)r.f(e,i=n[l++],t[i]);return e}},{"../internals/an-object":2,"../internals/descriptors":12,"../internals/object-define-property":39,"../internals/object-keys":45}],39:[function(e,t,i){var n=e("../internals/descriptors"),r=e("../internals/ie8-dom-define"),s=e("../internals/an-object"),a=e("../internals/to-primitive"),o=Object.defineProperty;i.f=n?o:function(e,t,i){if(s(e),t=a(t,!0),s(i),r)try{return o(e,t,i)}catch(e){}if("get"in i||"set"in i)throw TypeError("Accessors not supported");return"value"in i&&(e[t]=i.value),e}},{"../internals/an-object":2,"../internals/descriptors":12,"../internals/ie8-dom-define":27,"../internals/to-primitive":60}],40:[function(e,t,i){var n=e("../internals/descriptors"),r=e("../internals/object-property-is-enumerable"),s=e("../internals/create-property-descriptor"),a=e("../internals/to-indexed-object"),o=e("../internals/to-primitive"),l=e("../internals/has"),u=e("../internals/ie8-dom-define"),d=Object.getOwnPropertyDescriptor;i.f=n?d:function(e,t){if(e=a(e),t=o(t,!0),u)try{return d(e,t)}catch(e){}if(l(e,t))return s(!r.f.call(e,t),e[t])}},{"../internals/create-property-descriptor":11,"../internals/descriptors":12,"../internals/has":24,"../internals/ie8-dom-define":27,"../internals/object-property-is-enumerable":46,"../internals/to-indexed-object":56,"../internals/to-primitive":60}],41:[function(e,t,i){var n=e("../internals/object-keys-internal"),r=e("../internals/enum-bug-keys").concat("length","prototype");i.f=Object.getOwnPropertyNames||function(e){return n(e,r)}},{"../internals/enum-bug-keys":17,"../internals/object-keys-internal":44}],42:[function(e,t,i){i.f=Object.getOwnPropertySymbols},{}],43:[function(e,t,i){var n=e("../internals/has"),r=e("../internals/to-object"),s=e("../internals/shared-key"),a=(e=e("../internals/correct-prototype-getter"),s("IE_PROTO")),o=Object.prototype;t.exports=e?Object.getPrototypeOf:function(e){return e=r(e),n(e,a)?e[a]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?o:null}},{"../internals/correct-prototype-getter":9,"../internals/has":24,"../internals/shared-key":52,"../internals/to-object":59}],44:[function(e,t,i){var n=e("../internals/has"),r=e("../internals/to-indexed-object"),s=e("../internals/array-includes").indexOf,a=e("../internals/hidden-keys");t.exports=function(e,t){var i,o=r(e),l=0,u=[];for(i in o)!n(a,i)&&n(o,i)&&u.push(i);for(;t.length>l;)n(o,i=t[l++])&&(~s(u,i)||u.push(i));return u}},{"../internals/array-includes":3,"../internals/has":24,"../internals/hidden-keys":25,"../internals/to-indexed-object":56}],45:[function(e,t,i){var n=e("../internals/object-keys-internal"),r=e("../internals/enum-bug-keys");t.exports=Object.keys||function(e){return n(e,r)}},{"../internals/enum-bug-keys":17,"../internals/object-keys-internal":44}],46:[function(e,t,i){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,s=r&&!n.call({1:2},1);i.f=s?function(e){return!!(e=r(this,e))&&e.enumerable}:n},{}],47:[function(e,t,i){var n=e("../internals/get-built-in"),r=e("../internals/object-get-own-property-names"),s=e("../internals/object-get-own-property-symbols"),a=e("../internals/an-object");t.exports=n("Reflect","ownKeys")||function(e){var t=r.f(a(e)),i=s.f;return i?t.concat(i(e)):t}},{"../internals/an-object":2,"../internals/get-built-in":22,"../internals/object-get-own-property-names":41,"../internals/object-get-own-property-symbols":42}],48:[function(e,t,i){e=e("../internals/global"),t.exports=e},{"../internals/global":23}],49:[function(e,t,i){var n=e("../internals/global"),r=e("../internals/create-non-enumerable-property"),s=e("../internals/has"),a=e("../internals/set-global"),o=e("../internals/inspect-source"),l=(e=e("../internals/internal-state")).get,u=e.enforce,d=String(String).split("String");(t.exports=function(e,t,i,o){var l=!!o&&!!o.unsafe,c=!!o&&!!o.enumerable,h=!!o&&!!o.noTargetGet;"function"==typeof i&&("string"!=typeof t||s(i,"name")||r(i,"name",t),(o=u(i)).source||(o.source=d.join("string"==typeof t?t:""))),e!==n?(l?!h&&e[t]&&(c=!0):delete e[t],c?e[t]=i:r(e,t,i)):c?e[t]=i:a(t,i)})(Function.prototype,"toString",(function(){return"function"==typeof this&&l(this).source||o(this)}))},{"../internals/create-non-enumerable-property":10,"../internals/global":23,"../internals/has":24,"../internals/inspect-source":29,"../internals/internal-state":30,"../internals/set-global":51}],50:[function(e,t,i){t.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},{}],51:[function(e,t,i){var n=e("../internals/global"),r=e("../internals/create-non-enumerable-property");t.exports=function(e,t){try{r(n,e,t)}catch(i){n[e]=t}return t}},{"../internals/create-non-enumerable-property":10,"../internals/global":23}],52:[function(e,t,i){var n=e("../internals/shared"),r=e("../internals/uid"),s=n("keys");t.exports=function(e){return s[e]||(s[e]=r(e))}},{"../internals/shared":54,"../internals/uid":61}],53:[function(e,t,i){var n=e("../internals/global"),r=e("../internals/set-global");e=n[e="__core-js_shared__"]||r(e,{});t.exports=e},{"../internals/global":23,"../internals/set-global":51}],54:[function(e,t,i){var n=e("../internals/is-pure"),r=e("../internals/shared-store");(t.exports=function(e,t){return r[e]||(r[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.11.0",mode:n?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},{"../internals/is-pure":34,"../internals/shared-store":53}],55:[function(e,t,i){var n=e("../internals/to-integer"),r=Math.max,s=Math.min;t.exports=function(e,t){return(e=n(e))<0?r(e+t,0):s(e,t)}},{"../internals/to-integer":57}],56:[function(e,t,i){var n=e("../internals/indexed-object"),r=e("../internals/require-object-coercible");t.exports=function(e){return n(r(e))}},{"../internals/indexed-object":28,"../internals/require-object-coercible":50}],57:[function(e,t,i){var n=Math.ceil,r=Math.floor;t.exports=function(e){return isNaN(e=+e)?0:(0<e?r:n)(e)}},{}],58:[function(e,t,i){var n=e("../internals/to-integer"),r=Math.min;t.exports=function(e){return 0<e?r(n(e),9007199254740991):0}},{"../internals/to-integer":57}],59:[function(e,t,i){var n=e("../internals/require-object-coercible");t.exports=function(e){return Object(n(e))}},{"../internals/require-object-coercible":50}],60:[function(e,t,i){var n=e("../internals/is-object");t.exports=function(e,t){var i,r;if(!n(e))return e;if(t&&"function"==typeof(i=e.toString)&&!n(r=i.call(e))||"function"==typeof(i=e.valueOf)&&!n(r=i.call(e))||!t&&"function"==typeof(i=e.toString)&&!n(r=i.call(e)))return r;throw TypeError("Can't convert object to primitive value")}},{"../internals/is-object":33}],61:[function(e,t,i){var n=0,r=Math.random();t.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++n+r).toString(36)}},{}],62:[function(e,t,i){e=e("../internals/native-symbol"),t.exports=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},{"../internals/native-symbol":35}],63:[function(e,t,i){var n=e("../internals/global"),r=e("../internals/shared"),s=e("../internals/has"),a=e("../internals/uid"),o=e("../internals/native-symbol"),l=(e=e("../internals/use-symbol-as-uid"),r("wks")),u=n.Symbol,d=e?u:u&&u.withoutSetter||a;t.exports=function(e){return s(l,e)&&(o||"string"==typeof l[e])||(o&&s(u,e)?l[e]=u[e]:l[e]=d("Symbol."+e)),l[e]}},{"../internals/global":23,"../internals/has":24,"../internals/native-symbol":35,"../internals/shared":54,"../internals/uid":61,"../internals/use-symbol-as-uid":62}],64:[function(e,t,i){"use strict";var n=e("../internals/export"),r=e("../internals/array-iteration").map;n({target:"Array",proto:!0,forced:!e("../internals/array-method-has-species-support")("map")},{map:function(e){return r(this,e,1<arguments.length?arguments[1]:void 0)}})},{"../internals/array-iteration":4,"../internals/array-method-has-species-support":5,"../internals/export":18}],65:[function(e,t,i){var n=e("../internals/export"),r=e("../internals/get-built-in"),s=e("../internals/a-function"),a=e("../internals/an-object"),o=e("../internals/is-object"),l=e("../internals/object-create"),u=e("../internals/function-bind"),d=(e=e("../internals/fails"),r("Reflect","construct")),c=e((function(){function e(){}return!(d((function(){}),[],e)instanceof e)})),h=!e((function(){d((function(){}))}));n({target:"Reflect",stat:!0,forced:e=c||h,sham:e},{construct:function(e,t){s(e),a(t);var i=arguments.length<3?e:s(arguments[2]);if(h&&!c)return d(e,t,i);if(e==i){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var n=[null];return n.push.apply(n,t),new(u.apply(e,n))}return i=l(o(n=i.prototype)?n:Object.prototype),n=Function.apply.call(e,i,t),o(n)?n:i}})},{"../internals/a-function":1,"../internals/an-object":2,"../internals/export":18,"../internals/fails":19,"../internals/function-bind":21,"../internals/get-built-in":22,"../internals/is-object":33,"../internals/object-create":37}],66:[function(e,t,i){var n=e("../internals/export"),r=e("../internals/is-object"),s=e("../internals/an-object"),a=e("../internals/has"),o=e("../internals/object-get-own-property-descriptor"),l=e("../internals/object-get-prototype-of");n({target:"Reflect",stat:!0},{get:function e(t,i){var n,u=arguments.length<3?t:arguments[2];return s(t)===u?t[i]:(n=o.f(t,i))?a(n,"value")?n.value:void 0===n.get?void 0:n.get.call(u):r(n=l(t))?e(n,i,u):void 0}})},{"../internals/an-object":2,"../internals/export":18,"../internals/has":24,"../internals/is-object":33,"../internals/object-get-own-property-descriptor":40,"../internals/object-get-prototype-of":43}],67:[function(e,t,i){(function(e){(function(){var n,r,s,a;n=this,r=function(){var t="object"==typeof self&&self.self===self&&self||"object"==typeof e&&e.global===e&&e||Function("return this")()||{},i=Array.prototype,n=Object.prototype,r="undefined"!=typeof Symbol?Symbol.prototype:null,s=i.push,a=i.slice,o=n.toString,l=n.hasOwnProperty,u="undefined"!=typeof ArrayBuffer,d="undefined"!=typeof DataView,c=Array.isArray,h=Object.keys,p=Object.create,m=u&&ArrayBuffer.isView,f=isNaN,g=isFinite,y=!{toString:null}.propertyIsEnumerable("toString"),v=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];function _(e,t){return t=null==t?e.length-1:+t,function(){for(var i=Math.max(arguments.length-t,0),n=Array(i),r=0;r<i;r++)n[r]=arguments[r+t];switch(t){case 0:return e.call(this,n);case 1:return e.call(this,arguments[0],n);case 2:return e.call(this,arguments[0],arguments[1],n)}var s=Array(t+1);for(r=0;r<t;r++)s[r]=arguments[r];return s[t]=n,e.apply(this,s)}}function b(e){var t=typeof e;return"function"==t||"object"==t&&!!e}function w(e){return void 0===e}function T(e){return!0===e||!1===e||"[object Boolean]"===o.call(e)}function S(e){var t="[object "+e+"]";return function(e){return o.call(e)===t}}var E=S("String"),k=S("Number"),C=S("Date"),x=S("RegExp"),I=S("Error"),A=S("Symbol"),P=S("ArrayBuffer"),O=S("Function"),L=t.document&&t.document.childNodes,D=O="function"!=typeof/./&&"object"!=typeof Int8Array&&"function"!=typeof L?function(e){return"function"==typeof e}:O,M=S("Object"),N=d&&M(new DataView(new ArrayBuffer(8))),R="undefined"!=typeof Map&&M(new Map),U=S("DataView"),B=N?function(e){return null!=e&&D(e.getInt8)&&P(e.buffer)}:U,j=c||S("Array");function F(e,t){return null!=e&&l.call(e,t)}var q=S("Arguments");!function(){q(arguments)||(q=function(e){return F(e,"callee")})}();var H=q;function V(e){return k(e)&&f(e)}function $(e){return function(){return e}}function W(e){return function(t){return"number"==typeof(t=e(t))&&0<=t&&t<=9007199254740991}}function z(e){return function(t){return null==t?void 0:t[e]}}var G=z("byteLength"),X=W(G),K=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/,Q=u?function(e){return m?m(e)&&!B(e):X(e)&&K.test(o.call(e))}:$(!1),Y=z("length");function J(e,t){t=function(e){for(var t={},i=e.length,n=0;n<i;++n)t[e[n]]=!0;return{contains:function(e){return t[e]},push:function(i){return t[i]=!0,e.push(i)}}}(t);var i=v.length,r=e.constructor,s=D(r)&&r.prototype||n,a="constructor";for(F(e,a)&&!t.contains(a)&&t.push(a);i--;)(a=v[i])in e&&e[a]!==s[a]&&!t.contains(a)&&t.push(a)}function Z(e){if(!b(e))return[];if(h)return h(e);var t,i=[];for(t in e)F(e,t)&&i.push(t);return y&&J(e,i),i}function ee(e,t){var i=Z(t),n=i.length;if(null==e)return!n;for(var r=Object(e),s=0;s<n;s++){var a=i[s];if(t[a]!==r[a]||!(a in r))return!1}return!0}function te(e){return e instanceof te?e:this instanceof te?void(this._wrapped=e):new te(e)}function ie(e){return new Uint8Array(e.buffer||e,e.byteOffset||0,G(e))}te.VERSION="1.13.1",te.prototype.valueOf=te.prototype.toJSON=te.prototype.value=function(){return this._wrapped},te.prototype.toString=function(){return String(this._wrapped)};var ne="[object DataView]";function re(e){if(!b(e))return[];var t,i=[];for(t in e)i.push(t);return y&&J(e,i),i}function se(e){var t=Y(e);return function(i){if(null==i)return!1;var n=re(i);if(Y(n))return!1;for(var r=0;r<t;r++)if(!D(i[e[r]]))return!1;return e!==le||!D(i[ae])}}var ae="forEach",oe=(St=["clear","delete"]).concat(ae,Tt=["get","has","set"]),le=St.concat(Tt),ue=["add"].concat(St,ae,"has"),de=R?se(oe):S("Map"),ce=R?se(le):S("WeakMap"),he=R?se(ue):S("Set"),pe=S("WeakSet");function me(e){for(var t=Z(e),i=t.length,n=Array(i),r=0;r<i;r++)n[r]=e[t[r]];return n}function fe(e){for(var t={},i=Z(e),n=0,r=i.length;n<r;n++)t[e[i[n]]]=i[n];return t}function ge(e){var t,i=[];for(t in e)D(e[t])&&i.push(t);return i.sort()}function ye(e,t){return function(i){var n=arguments.length;if(t&&(i=Object(i)),n<2||null==i)return i;for(var r=1;r<n;r++)for(var s=arguments[r],a=e(s),o=a.length,l=0;l<o;l++){var u=a[l];t&&void 0!==i[u]||(i[u]=s[u])}return i}}var ve=ye(re),_e=ye(Z),be=ye(re,!0);function we(e){if(!b(e))return{};if(p)return p(e);var t=function(){};return t.prototype=e,e=new t,t.prototype=null,e}function Te(e){return b(e)?j(e)?e.slice():ve({},e):e}function Se(e){return j(e)?e:[e]}function Ee(e){return te.toPath(e)}function ke(e,t){for(var i=t.length,n=0;n<i;n++){if(null==e)return;e=e[t[n]]}return i?e:void 0}function Ce(e,t,i){return w(t=ke(e,Ee(t)))?i:t}function xe(e){return e}function Ie(e){return e=_e({},e),function(t){return ee(t,e)}}function Ae(e){return e=Ee(e),function(t){return ke(t,e)}}function Pe(e,t,i){if(void 0===t)return e;switch(null==i?3:i){case 1:return function(i){return e.call(t,i)};case 3:return function(i,n,r){return e.call(t,i,n,r)};case 4:return function(i,n,r,s){return e.call(t,i,n,r,s)}}return function(){return e.apply(t,arguments)}}function Oe(e,t,i){return null==e?xe:D(e)?Pe(e,t,i):(b(e)&&!j(e)?Ie:Ae)(e)}function Le(e,t){return Oe(e,t,1/0)}function De(e,t,i){return te.iteratee!==Le?te.iteratee(e,t):Oe(e,t,i)}function Me(){}function Ne(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))}te.toPath=Se,te.iteratee=Le;var Re=Date.now||function(){return(new Date).getTime()};function Ue(e){function t(t){return e[t]}var i="(?:"+Z(e).join("|")+")",n=RegExp(i),r=RegExp(i,"g");return function(e){return n.test(e=null==e?"":""+e)?e.replace(r,t):e}}var Be={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},je=Ue(Be),Fe=Ue(fe(Be)),qe=te.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},He=/(.)^/,Ve={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},$e=/\\|'|\r|\n|\u2028|\u2029/g;function We(e){return"\\"+Ve[e]}var ze=/^\s*(\w|\$)+\s*$/,Ge=0;function Xe(e,t,i,n,r){return n instanceof t?(i=we(e.prototype),b(r=e.apply(i,r))?r:i):e.apply(i,r)}var Ke=_((function(e,t){var i=Ke.placeholder,n=function(){for(var r=0,s=t.length,a=Array(s),o=0;o<s;o++)a[o]=t[o]===i?arguments[r++]:t[o];for(;r<arguments.length;)a.push(arguments[r++]);return Xe(e,n,this,this,a)};return n}));Ke.placeholder=te;var Qe=_((function(e,t,i){if(!D(e))throw TypeError("Bind must be called on a function");var n=_((function(r){return Xe(e,n,t,this,i.concat(r))}));return n})),Ye=W(Y);function Je(e,t,i,n){if(n=n||[],t||0===t){if(t<=0)return n.concat(e)}else t=1/0;for(var r=n.length,s=0,a=Y(e);s<a;s++){var o=e[s];if(Ye(o)&&(j(o)||H(o)))if(1<t)Je(o,t-1,i,n),r=n.length;else for(var l=0,u=o.length;l<u;)n[r++]=o[l++];else i||(n[r++]=o)}return n}var Ze=_((function(e,t){var i=(t=Je(t,!1,!1)).length;if(i<1)throw Error("bindAll must be passed function names");for(;i--;){var n=t[i];e[n]=Qe(e[n],e)}return e})),et=_((function(e,t,i){return setTimeout((function(){return e.apply(null,i)}),t)})),tt=Ke(et,te,1);function it(e){return function(){return!e.apply(this,arguments)}}function nt(e,t){var i;return function(){return 0<--e&&(i=t.apply(this,arguments)),e<=1&&(t=null),i}}function rt(e,t,i){t=De(t,i);for(var n,r=Z(e),s=0,a=r.length;s<a;s++)if(t(e[n=r[s]],n,e))return n}function st(e){return function(t,i,n){i=De(i,n);for(var r=Y(t),s=0<e?0:r-1;0<=s&&s<r;s+=e)if(i(t[s],s,t))return s;return-1}}t=Ke(nt,2);var at=st(1);L=st(-1);function ot(e,t,i,n){for(var r=(i=De(i,n,1))(t),s=0,a=Y(e);s<a;){var o=Math.floor((s+a)/2);i(e[o])<r?s=o+1:a=o}return s}function lt(e,t,i){return function(n,r,s){var o=0,l=Y(n);if("number"==typeof s)0<e?o=0<=s?s:Math.max(s+l,o):l=0<=s?Math.min(s+1,l):s+l+1;else if(i&&s&&l)return n[s=i(n,r)]===r?s:-1;if(r!=r)return 0<=(s=t(a.call(n,o,l),V))?s+o:-1;for(s=0<e?o:l-1;0<=s&&s<l;s+=e)if(n[s]===r)return s;return-1}}var ut=lt(1,at,ot);O=lt(-1,L);function dt(e,t,i){if(void 0!==(i=(Ye(e)?at:rt)(e,t,i))&&-1!==i)return e[i]}function ct(e,t,i){if(t=Pe(t,i),Ye(e))for(r=0,s=e.length;r<s;r++)t(e[r],r,e);else for(var n=Z(e),r=0,s=n.length;r<s;r++)t(e[n[r]],n[r],e);return e}function ht(e,t,i){t=De(t,i);for(var n=!Ye(e)&&Z(e),r=(n||e).length,s=Array(r),a=0;a<r;a++){var o=n?n[a]:a;s[a]=t(e[o],o,e)}return s}function pt(e){return function(t,i,n,r){var s=3<=arguments.length;return function(t,i,n,r){var s=!Ye(t)&&Z(t),a=(s||t).length,o=0<e?0:a-1;for(r||(n=t[s?s[o]:o],o+=e);0<=o&&o<a;o+=e){var l=s?s[o]:o;n=i(n,t[l],l,t)}return n}(t,Pe(i,r,4),n,s)}}function mt(e,t,i){var n=[];return t=De(t,i),ct(e,(function(e,i,r){t(e,i,r)&&n.push(e)})),n}function ft(e,t,i){t=De(t,i);for(var n=!Ye(e)&&Z(e),r=(n||e).length,s=0;s<r;s++){var a=n?n[s]:s;if(!t(e[a],a,e))return!1}return!0}function gt(e,t,i){t=De(t,i);for(var n=!Ye(e)&&Z(e),r=(n||e).length,s=0;s<r;s++){var a=n?n[s]:s;if(t(e[a],a,e))return!0}return!1}function yt(e,t,i,n){return Ye(e)||(e=me(e)),0<=ut(e,t,i="number"!=typeof i||n?0:i)}function vt(e,t){return ht(e,Ae(t))}function _t(e,t,i){var n,r,s=-1/0,a=-1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var o=0,l=(e=Ye(e)?e:me(e)).length;o<l;o++)null!=(n=e[o])&&s<n&&(s=n);else t=De(t,i),ct(e,(function(e,i,n){(a<(r=t(e,i,n))||r===-1/0&&s===-1/0)&&(s=e,a=r)}));return s}function bt(e,t,i){if(null==t||i)return(e=Ye(e)?e:me(e))[Ne(e.length-1)];var n=(Ye(e)?Te:me)(e);e=Y(n);t=Math.max(Math.min(t,e),0);for(var r=e-1,s=0;s<t;s++){var a=Ne(s,r),o=n[s];n[s]=n[a],n[a]=o}return n.slice(0,t)}function wt(e,t){return function(i,n,r){var s=t?[[],[]]:{};return n=De(n,r),ct(i,(function(t,r){r=n(t,r,i),e(s,t,r)})),s}}d=pt(1),M=pt(-1),U=_((function(e,t,i){var n,r;return D(t)?r=t:(n=(t=Ee(t)).slice(0,-1),t=t[t.length-1]),ht(e,(function(e){var s=r;if(!s){if(null==(e=n&&n.length?ke(e,n):e))return;s=e[t]}return null==s?s:s.apply(e,i)}))}));c=wt((function(e,t,i){F(e,i)?e[i].push(t):e[i]=[t]})),u=wt((function(e,t,i){e[i]=t}));var Tt=wt((function(e,t,i){F(e,i)?e[i]++:e[i]=1})),St=wt((function(e,t,i){e[i?0:1].push(t)}),!0),Et=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function kt(e,t,i){return t in i}var Ct=_((function(e,t){var i={},n=t[0];if(null==e)return i;D(n)?(1<t.length&&(n=Pe(n,t[1])),t=re(e)):(n=kt,t=Je(t,!1,!1),e=Object(e));for(var r=0,s=t.length;r<s;r++){var a=t[r],o=e[a];n(o,a,e)&&(i[a]=o)}return i}));oe=_((function(e,t){var i,n=t[0];return D(n)?(n=it(n),1<t.length&&(i=t[1])):(t=ht(Je(t,!1,!1),String),n=function(e,i){return!yt(t,i)}),Ct(e,n,i)}));function xt(e,t,i){return a.call(e,0,Math.max(0,e.length-(null==t||i?1:t)))}function It(e,t,i){return null==e||e.length<1?null==t||i?void 0:[]:null==t||i?e[0]:xt(e,e.length-t)}function At(e,t,i){return a.call(e,null==t||i?1:t)}var Pt=_((function(e,t){return t=Je(t,!0,!0),mt(e,(function(e){return!yt(t,e)}))}));R=_((function(e,t){return Pt(e,t)}));function Ot(e,t,i,n){T(t)||(n=i,i=t,t=!1),null!=i&&(i=De(i,n));for(var r=[],s=[],a=0,o=Y(e);a<o;a++){var l=e[a],u=i?i(l,a,e):l;t&&!i?(a&&s===u||r.push(l),s=u):i?yt(s,u)||(s.push(u),r.push(l)):yt(r,l)||r.push(l)}return r}function Lt(e){for(var t=e&&_t(e,Y).length||0,i=Array(t),n=0;n<t;n++)i[n]=vt(e,n);return i}function Dt(e,t){return e._chain?te(t).chain():t}function Mt(e){return ct(ge(e),(function(t){var i=te[t]=e[t];te.prototype[t]=function(){var e=[this._wrapped];return s.apply(e,arguments),Dt(this,i.apply(te,e))}})),te}return ue=_((function(e){return Ot(Je(e,!0,!0))})),Be=_(Lt),ct(["pop","push","reverse","shift","sort","splice","unshift"],(function(e){var t=i[e];te.prototype[e]=function(){var i=this._wrapped;return null!=i&&(t.apply(i,arguments),"shift"!==e&&"splice"!==e||0!==i.length||delete i[0]),Dt(this,i)}})),ct(["concat","join","slice"],(function(e){var t=i[e];te.prototype[e]=function(){var e=this._wrapped;return Dt(this,e=null!=e?t.apply(e,arguments):e)}})),(Be=Mt({__proto__:null,VERSION:"1.13.1",restArguments:_,isObject:b,isNull:function(e){return null===e},isUndefined:w,isBoolean:T,isElement:function(e){return!(!e||1!==e.nodeType)},isString:E,isNumber:k,isDate:C,isRegExp:x,isError:I,isSymbol:A,isArrayBuffer:P,isDataView:B,isArray:j,isFunction:D,isArguments:H,isFinite:function(e){return!A(e)&&g(e)&&!isNaN(parseFloat(e))},isNaN:V,isTypedArray:Q,isEmpty:function(e){if(null==e)return!0;var t=Y(e);return"number"==typeof t&&(j(e)||E(e)||H(e))?0===t:0===Y(Z(e))},isMatch:ee,isEqual:function(e,t){return function e(t,i,n,s){if(t===i)return 0!==t||1/t==1/i;if(null==t||null==i)return!1;if(t!=t)return i!=i;var a=typeof t;return("function"==a||"object"==a||"object"==typeof i)&&function t(i,n,s,a){if(i instanceof te&&(i=i._wrapped),n instanceof te&&(n=n._wrapped),(u=o.call(i))!==o.call(n))return!1;if(N&&"[object Object]"==u&&B(i)){if(!B(n))return!1;u=ne}switch(u){case"[object RegExp]":case"[object String]":return""+i==""+n;case"[object Number]":return+i!=+i?+n!=+n:0==+i?1/+i==1/n:+i==+n;case"[object Date]":case"[object Boolean]":return+i==+n;case"[object Symbol]":return r.valueOf.call(i)===r.valueOf.call(n);case"[object ArrayBuffer]":case ne:return t(ie(i),ie(n),s,a)}var l="[object Array]"===u;if(!l&&Q(i)){if((d=G(i))!==G(n))return!1;if(i.buffer===n.buffer&&i.byteOffset===n.byteOffset)return!0;l=!0}if(!l){if("object"!=typeof i||"object"!=typeof n)return!1;var u,d;if((u=i.constructor)!==(d=n.constructor)&&!(D(u)&&u instanceof u&&D(d)&&d instanceof d)&&"constructor"in i&&"constructor"in n)return!1}a=a||[];for(var c=(s=s||[]).length;c--;)if(s[c]===i)return a[c]===n;if(s.push(i),a.push(n),l){if((c=i.length)!==n.length)return!1;for(;c--;)if(!e(i[c],n[c],s,a))return!1}else{var h,p=Z(i);if(c=p.length,Z(n).length!==c)return!1;for(;c--;)if(!F(n,h=p[c])||!e(i[h],n[h],s,a))return!1}return s.pop(),a.pop(),!0}(t,i,void 0,void 0)}(e,t)},isMap:de,isWeakMap:ce,isSet:he,isWeakSet:pe,keys:Z,allKeys:re,values:me,pairs:function(e){for(var t=Z(e),i=t.length,n=Array(i),r=0;r<i;r++)n[r]=[t[r],e[t[r]]];return n},invert:fe,functions:ge,methods:ge,extend:ve,extendOwn:_e,assign:_e,defaults:be,create:function(e,t){return e=we(e),t&&_e(e,t),e},clone:Te,tap:function(e,t){return t(e),e},get:Ce,has:function(e,t){for(var i=(t=Ee(t)).length,n=0;n<i;n++){var r=t[n];if(!F(e,r))return!1;e=e[r]}return!!i},mapObject:function(e,t,i){t=De(t,i);for(var n=Z(e),r=n.length,s={},a=0;a<r;a++){var o=n[a];s[o]=t(e[o],o,e)}return s},identity:xe,constant:$,noop:Me,toPath:Se,property:Ae,propertyOf:function(e){return null==e?Me:function(t){return Ce(e,t)}},matcher:Ie,matches:Ie,times:function(e,t,i){var n=Array(Math.max(0,e));t=Pe(t,i,1);for(var r=0;r<e;r++)n[r]=t(r);return n},random:Ne,now:Re,escape:je,unescape:Fe,templateSettings:qe,template:function(e,t,i){t=be({},t=!t&&i?i:t,te.templateSettings);i=RegExp([(t.escape||He).source,(t.interpolate||He).source,(t.evaluate||He).source].join("|")+"|$","g");var n,r=0,s="__p+='";if(e.replace(i,(function(t,i,n,a,o){return s+=e.slice(r,o).replace($e,We),r=o+t.length,i?s+="'+\n((__t=("+i+"))==null?'':_.escape(__t))+\n'":n?s+="'+\n((__t=("+n+"))==null?'':__t)+\n'":a&&(s+="';\n"+a+"\n__p+='"),t})),s+="';\n",i=t.variable){if(!ze.test(i))throw Error("variable is not a bare identifier: "+i)}else s="with(obj||{}){\n"+s+"}\n",i="obj";s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{n=Function(i,"_",s)}catch(e){throw e.source=s,e}return(t=function(e){return n.call(this,e,te)}).source="function("+i+"){\n"+s+"}",t},result:function(e,t,i){var n=(t=Ee(t)).length;if(!n)return D(i)?i.call(e):i;for(var r=0;r<n;r++){var s=null==e?void 0:e[t[r]];void 0===s&&(s=i,r=n),e=D(s)?s.call(e):s}return e},uniqueId:function(e){var t=++Ge+"";return e?e+t:t},chain:function(e){return(e=te(e))._chain=!0,e},iteratee:Le,partial:Ke,bind:Qe,bindAll:Ze,memoize:function(e,t){var i=function(n){var r=i.cache,s=""+(t?t.apply(this,arguments):n);return F(r,s)||(r[s]=e.apply(this,arguments)),r[s]};return i.cache={},i},delay:et,defer:tt,throttle:function(e,t,i){var n,r,s,a,o=0;function l(){o=!1===i.leading?0:Re(),n=null,a=e.apply(r,s),n||(r=s=null)}function u(){var u=Re();o||!1!==i.leading||(o=u);var d=t-(u-o);return r=this,s=arguments,d<=0||t<d?(n&&(clearTimeout(n),n=null),o=u,a=e.apply(r,s),n||(r=s=null)):n||!1===i.trailing||(n=setTimeout(l,d)),a}return i=i||{},u.cancel=function(){clearTimeout(n),o=0,n=r=s=null},u},debounce:function(e,t,i){var n,r,s,a,o,l=function(){var u=Re()-r;u<t?n=setTimeout(l,t-u):(n=null,i||(a=e.apply(o,s)),n||(s=o=null))},u=_((function(u){return o=this,s=u,r=Re(),n||(n=setTimeout(l,t),i&&(a=e.apply(o,s))),a}));return u.cancel=function(){clearTimeout(n),n=s=o=null},u},wrap:function(e,t){return Ke(t,e)},negate:it,compose:function(){var e=arguments,t=e.length-1;return function(){for(var i=t,n=e[t].apply(this,arguments);i--;)n=e[i].call(this,n);return n}},after:function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},before:nt,once:t,findKey:rt,findIndex:at,findLastIndex:L,sortedIndex:ot,indexOf:ut,lastIndexOf:O,find:dt,detect:dt,findWhere:function(e,t){return dt(e,Ie(t))},each:ct,forEach:ct,map:ht,collect:ht,reduce:d,foldl:d,inject:d,reduceRight:M,foldr:M,filter:mt,select:mt,reject:function(e,t,i){return mt(e,it(De(t)),i)},every:ft,all:ft,some:gt,any:gt,contains:yt,includes:yt,include:yt,invoke:U,pluck:vt,where:function(e,t){return mt(e,Ie(t))},max:_t,min:function(e,t,i){var n,r,s=1/0,a=1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var o=0,l=(e=Ye(e)?e:me(e)).length;o<l;o++)null!=(n=e[o])&&n<s&&(s=n);else t=De(t,i),ct(e,(function(e,i,n){((r=t(e,i,n))<a||r===1/0&&s===1/0)&&(s=e,a=r)}));return s},shuffle:function(e){return bt(e,1/0)},sample:bt,sortBy:function(e,t,i){var n=0;return t=De(t,i),vt(ht(e,(function(e,i,r){return{value:e,index:n++,criteria:t(e,i,r)}})).sort((function(e,t){var i=e.criteria,n=t.criteria;if(i!==n){if(n<i||void 0===i)return 1;if(i<n||void 0===n)return-1}return e.index-t.index})),"value")},groupBy:c,indexBy:u,countBy:Tt,partition:St,toArray:function(e){return e?j(e)?a.call(e):E(e)?e.match(Et):Ye(e)?ht(e,xe):me(e):[]},size:function(e){return null==e?0:(Ye(e)?e:Z(e)).length},pick:Ct,omit:oe,first:It,head:It,take:It,initial:xt,last:function(e,t,i){return null==e||e.length<1?null==t||i?void 0:[]:null==t||i?e[e.length-1]:At(e,Math.max(0,e.length-t))},rest:At,tail:At,drop:At,compact:function(e){return mt(e,Boolean)},flatten:function(e,t){return Je(e,t,!1)},without:R,uniq:Ot,unique:Ot,union:ue,intersection:function(e){for(var t=[],i=arguments.length,n=0,r=Y(e);n<r;n++){var s=e[n];if(!yt(t,s)){for(var a=1;a<i&&yt(arguments[a],s);a++);a===i&&t.push(s)}}return t},difference:Pt,unzip:Lt,transpose:Lt,zip:Be,object:function(e,t){for(var i={},n=0,r=Y(e);n<r;n++)t?i[e[n]]=t[n]:i[e[n][0]]=e[n][1];return i},range:function(e,t,i){null==t&&(t=e||0,e=0),i=i||(t<e?-1:1);for(var n=Math.max(Math.ceil((t-e)/i),0),r=Array(n),s=0;s<n;s++,e+=i)r[s]=e;return r},chunk:function(e,t){if(null==t||t<1)return[];for(var i=[],n=0,r=e.length;n<r;)i.push(a.call(e,n,n+=t));return i},mixin:Mt,default:te}))._=Be},"object"==typeof i&&void 0!==t?t.exports=r():"function"==typeof define&&define.amd?define("underscore",r):(s=(n="undefined"!=typeof globalThis?globalThis:n||self)._,(a=n._=r()).noConflict=function(){return n._=s,a})}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],68:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function r(){return(r="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=a(e)););return e}(e,t);if(n)return(t=Object.getOwnPropertyDescriptor(n,t)).get?t.get.call(arguments.length<3?e:i):t.value}).apply(this,arguments)}function s(e,t){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}e("core-js/modules/es.reflect.construct.js"),e("core-js/modules/es.reflect.get.js");var o=e("underscore"),l=e("../events");t.exports=function(e){var t=e.getComponent("MenuItem");return function(){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s(e,t)}(h,t);var e,i,u,d,c=(e=h,i=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var t,n=a(e);return function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0!==e)return e;throw ReferenceError("this hasn't been initialised - super() hasn't been called")}(e)}(this,i?(t=a(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments))});function h(e,t){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,h);var i=t.source;if(!o.isObject(i))throw Error('was not provided a "source" object, but rather: '+typeof i);return t=o.extend({selectable:!0,label:i.label},t),(t=c.call(this,e,t)).source=i,t}return d=[{key:"handleClick",value:function(e){r(a(h.prototype),"handleClick",this).call(this,e),this.player().trigger(l.QUALITY_REQUESTED,this.source)}}],n((u=h).prototype,d),Object.defineProperty(u,"prototype",{writable:!1}),h}()}},{"../events":70,"core-js/modules/es.reflect.construct.js":65,"core-js/modules/es.reflect.get.js":66,underscore:67}],69:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function r(){return(r="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=o(e)););return e}(e,t);if(n)return(t=Object.getOwnPropertyDescriptor(n,t)).get?t.get.call(arguments.length<3?e:i):t.value}).apply(this,arguments)}function s(e,t){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function a(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}e("core-js/modules/es.reflect.construct.js"),e("core-js/modules/es.reflect.get.js"),e("core-js/modules/es.array.map.js");var l=e("underscore"),u=e("../events"),d=e("./QualityOption"),c="vjs-quality-changing";t.exports=function(e){var t=e.getComponent("MenuButton"),i=d(e),h=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s(e,t)}(f,t);var e,d,h,p,m=(e=f,d=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var t,i=o(e);return function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return a(e)}(this,d?(t=o(this).constructor,Reflect.construct(i,arguments,t)):i.apply(this,arguments))});function f(e,t){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,f),t=m.call(this,e,t),e.on(u.QUALITY_REQUESTED,function(t,i){this.setSelectedSource(i),e.addClass(c),e.one("loadeddata",(function(){e.removeClass(c)}))}.bind(a(t))),e.on(u.PLAYER_SOURCES_CHANGED,function(){this.update()}.bind(a(t))),e.on(u.QUALITY_SELECTED,function(e,t){this.setSelectedSource(t)}.bind(a(t))),e.one("ready",function(){this.selectedSrc=e.src(),this.update()}.bind(a(t))),t.controlText("Open quality selector menu"),t}return p=[{key:"setSelectedSource",value:function(e){var t=e?e.src:void 0;this.selectedSrc!==t&&(this.selectedSrc=t,l.each(this.items,(function(e){e.selected(e.source.src===t)})))}},{key:"createItems",value:function(){var e=this.player(),t=e.currentSources();return!t||t.length<2?[]:l.map(t,function(t){return new i(e,{source:t,selected:t.src===this.selectedSrc})}.bind(this))}},{key:"buildWrapperCSSClass",value:function(){return"vjs-quality-selector "+r(o(f.prototype),"buildWrapperCSSClass",this).call(this)}}],n((h=f).prototype,p),Object.defineProperty(h,"prototype",{writable:!1}),f}();return e.registerComponent("QualitySelector",h),h}},{"../events":70,"./QualityOption":68,"core-js/modules/es.array.map.js":64,"core-js/modules/es.reflect.construct.js":65,"core-js/modules/es.reflect.get.js":66,underscore:67}],70:[function(e,t,i){"use strict";t.exports={QUALITY_REQUESTED:"qualityRequested",QUALITY_SELECTED:"qualitySelected",PLAYER_SOURCES_CHANGED:"playerSourcesChanged"}},{}],71:[function(e,t,i){"use strict";var n=e("underscore"),r=e("./events"),s=e("./components/QualitySelector"),a=e("./middleware/SourceInterceptor"),o=e("./util/SafeSeek");t.exports=function(e){s(e=e||window.videojs),a(e),e.hook("setup",(function(e){e.on(r.QUALITY_REQUESTED,(function(t,i){var r=e.currentSources(),s=e.currentTime(),a=e.playbackRate(),l=e.paused();n.each(r,(function(e){e.selected=!1})),n.findWhere(r,{src:i.src}).selected=!0,e._qualitySelectorSafeSeek&&e._qualitySelectorSafeSeek.onQualitySelectionChange(),e.src(r),e.ready((function(){e._qualitySelectorSafeSeek&&!e._qualitySelectorSafeSeek.hasFinished()||(e._qualitySelectorSafeSeek=new o(e,s),e.playbackRate(a)),l||e.play()}))}))}))},t.exports.EVENTS=r},{"./components/QualitySelector":69,"./events":70,"./middleware/SourceInterceptor":72,"./util/SafeSeek":74,underscore:67}],72:[function(e,t,i){"use strict";var n=e("underscore"),r=e("../events");t.exports=function(e){e.use("*",(function(e){return{setSource:function(t,i){var s=e.currentSources();e._qualitySelectorSafeSeek&&e._qualitySelectorSafeSeek.onPlayerSourcesChange(),n.isEqual(s,e._qualitySelectorPreviousSources)||(e.trigger(r.PLAYER_SOURCES_CHANGED,s),e._qualitySelectorPreviousSources=s),s=n.find(s,(function(e){return!0===e.selected||"true"===e.selected||"selected"===e.selected})),e.trigger(r.QUALITY_SELECTED,t=s||t),i(null,t)}}}))}},{"../events":70,underscore:67}],73:[function(e,t,i){"use strict";e("./index")()},{"./index":71}],74:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}t.exports=function(){var e,t;function i(e,t){(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")})(this,i),this._player=e,this._seekToTime=t,this._hasFinished=!1,this._keepThisInstanceWhenPlayerSourcesChange=!1,this._seekWhenSafe()}return t=[{key:"_seekWhenSafe",value:function(){3>this._player.readyState()?(this._seekFn=this._seek.bind(this),this._player.one("canplay",this._seekFn)):this._seek()}},{key:"onPlayerSourcesChange",value:function(){this._keepThisInstanceWhenPlayerSourcesChange?this._keepThisInstanceWhenPlayerSourcesChange=!1:this.cancel()}},{key:"onQualitySelectionChange",value:function(){this.hasFinished()||(this._keepThisInstanceWhenPlayerSourcesChange=!0)}},{key:"_seek",value:function(){this._player.currentTime(this._seekToTime),this._keepThisInstanceWhenPlayerSourcesChange=!1,this._hasFinished=!0}},{key:"hasFinished",value:function(){return this._hasFinished}},{key:"cancel",value:function(){this._player.off("canplay",this._seekFn),this._keepThisInstanceWhenPlayerSourcesChange=!1,this._hasFinished=!0}}],n((e=i).prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),i}()},{}]},{},[73]);