Pipeline a trittici (Esecutore->Revisore->Controllore avversariale), 6 trittici T1-T6. Tutto ADDITIVO: nessuna pagina/JS live modificata, produzione intatta. Swap non incluso. - public/vendor/bootstrap-italia/ : BI v2.18.1 self-hostato (CSS+JS bundle+16 woff2+sprite), MAI CDN - 16 pagine *-bi.html (login/register/onboarding/forgot/reset/index + dashboard/assessment/ risks/incidents/policies/supply-chain/training/assets/reports/settings) - public/js/common-bi.js : sidebar/topbar in markup BI (additivo, riusa stessi ID + common.js) - Verifica sul path servito reale: 16/16 -> 200, 0 CDN, 0 FontAwesome residui, parita ID/hook completa, WCAG AA - docs/SISTEMA_TRITTICI_AGENTI.md : design del sistema a trittici Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
40 lines
994 KiB
JavaScript
40 lines
994 KiB
JavaScript
!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).bootstrap=t()}(this,function(){"use strict";!function(){const e={NODE_ENV:"production"};try{if(process)return process.env=Object.assign({},process.env),void Object.assign(process.env,e)}catch(e){}globalThis.process={env:e}}();const e="data-focus-mouse";class t{constructor(){this._usingMouse=!1,this._bindEvents()}_bindEvents(){if("undefined"==typeof document)return;["keydown","mousedown"].forEach(e=>{document.addEventListener(e,e=>{this._usingMouse="mousedown"===e.type})}),document.addEventListener("focusin",t=>{this._usingMouse&&t.target&&t.target.setAttribute(e,!0)}),document.addEventListener("focusout",t=>{t.target&&t.target.setAttribute(e,!1)})}}new t;const i=()=>{"undefined"==typeof window||window.BOOTSTRAP_ITALIA_VERSION||(new t,window.BOOTSTRAP_ITALIA_VERSION="2.18.1")};i();const n={ck3:{}},s={rememberChoice:(e,t)=>{n.ck3[e]=t,localStorage.setItem("bs-ck3",JSON.stringify(n.ck3))},isChoiceRemembered:e=>(n.ck3=JSON.parse(localStorage.getItem("bs-ck3")||"{}"),n.ck3[e]||!1),clearAllRememberedChoices:()=>{localStorage.removeItem("bs-ck3")}};function r(e,t,i){return t&&function(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)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}
|
||
/*!
|
||
* Splide.js
|
||
* Version : 4.1.4
|
||
* License : MIT
|
||
* Copyright: 2022 Naotoshi Fujita
|
||
*/var a="(prefers-reduced-motion: reduce)",o={CREATED:1,MOUNTED:2,IDLE:3,MOVING:4,SCROLLING:5,DRAGGING:6,DESTROYED:7};function l(e){e.length=0}function u(e,t,i){return Array.prototype.slice.call(e,t,i)}function c(e){return e.bind.apply(e,[null].concat(u(arguments,1)))}var h=setTimeout,d=function(){};function p(e){return requestAnimationFrame(e)}function f(e,t){return typeof t===e}function m(e){return!b(e)&&f("object",e)}var g=Array.isArray,y=c(f,"function"),_=c(f,"string"),v=c(f,"undefined");function b(e){return null===e}function T(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch(e){return!1}}function w(e){return g(e)?e:[e]}function S(e,t){w(e).forEach(t)}function E(e,t){return e.indexOf(t)>-1}function C(e,t){return e.push.apply(e,w(t)),e}function k(e,t,i){e&&S(t,function(t){t&&e.classList[i?"add":"remove"](t)})}function x(e,t){k(e,_(t)?t.split(" "):t,!0)}function I(e,t){S(t,e.appendChild.bind(e))}function A(e,t){S(e,function(e){var i=(t||e).parentNode;i&&i.insertBefore(e,t)})}function L(e,t){return T(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function P(e,t){var i=e?u(e.children):[];return t?i.filter(function(e){return L(e,t)}):i}function O(e,t){return t?P(e,t)[0]:e.firstElementChild}var D=Object.keys;function M(e,t,i){return e&&(i?D(e).reverse():D(e)).forEach(function(i){"__proto__"!==i&&t(e[i],i)}),e}function N(e){return u(arguments,1).forEach(function(t){M(t,function(i,n){e[n]=t[n]})}),e}function R(e){return u(arguments,1).forEach(function(t){M(t,function(t,i){g(t)?e[i]=t.slice():m(t)?e[i]=R({},m(e[i])?e[i]:{},t):e[i]=t})}),e}function F(e,t){S(t||D(e),function(t){delete e[t]})}function B(e,t){S(e,function(e){S(t,function(t){e&&e.removeAttribute(t)})})}function U(e,t,i){m(t)?M(t,function(t,i){U(e,i,t)}):S(e,function(e){b(i)||""===i?B(e,t):e.setAttribute(t,String(i))})}function j(e,t,i){var n=document.createElement(e);return t&&(_(t)?x(n,t):U(n,t)),i&&I(i,n),n}function $(e,t,i){if(v(i))return getComputedStyle(e)[t];b(i)||(e.style[t]=""+i)}function q(e,t){$(e,"display",t)}function V(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function H(e,t){return e.getAttribute(t)}function z(e,t){return e&&e.classList.contains(t)}function W(e){return e.getBoundingClientRect()}function G(e){S(e,function(e){e&&e.parentNode&&e.parentNode.removeChild(e)})}function X(e){return O((new DOMParser).parseFromString(e,"text/html").body)}function K(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function Y(e,t){return e&&e.querySelector(t)}function Q(e,t){return t?u(e.querySelectorAll(t)):[]}function J(e,t){k(e,t,!1)}function Z(e){return e.timeStamp}function ee(e){return _(e)?e:e?e+"px":""}var te="splide",ie="data-"+te;function ne(e,t){if(!e)throw new Error("["+te+"] "+(t||""))}var se=Math.min,re=Math.max,ae=Math.floor,oe=Math.ceil,le=Math.abs;function ue(e,t,i){return le(e-t)<i}function ce(e,t,i,n){var s=se(t,i),r=re(t,i);return n?s<e&&e<r:s<=e&&e<=r}function he(e,t,i){var n=se(t,i),s=re(t,i);return se(re(n,e),s)}function de(e){return+(e>0)-+(e<0)}function pe(e,t){return S(t,function(t){e=e.replace("%s",""+t)}),e}function fe(e){return e<10?"0"+e:""+e}var me={};function ge(){var e=[];function t(e,t,i){S(e,function(e){e&&S(t,function(t){t.split(" ").forEach(function(t){var n=t.split(".");i(e,n[0],n[1])})})})}return{bind:function(i,n,s,r){t(i,n,function(t,i,n){var a="addEventListener"in t,o=a?t.removeEventListener.bind(t,i,s,r):t.removeListener.bind(t,s);a?t.addEventListener(i,s,r):t.addListener(s),e.push([t,i,n,s,o])})},unbind:function(i,n,s){t(i,n,function(t,i,n){e=e.filter(function(e){return!!(e[0]!==t||e[1]!==i||e[2]!==n||s&&e[3]!==s)||(e[4](),!1)})})},dispatch:function(e,t,i){var n,s=!0;return"function"==typeof CustomEvent?n=new CustomEvent(t,{bubbles:s,detail:i}):(n=document.createEvent("CustomEvent")).initCustomEvent(t,s,!1,i),e.dispatchEvent(n),n},destroy:function(){e.forEach(function(e){e[4]()}),l(e)}}}var ye="mounted",_e="ready",ve="move",be="moved",Te="click",we="active",Se="inactive",Ee="visible",Ce="hidden",ke="refresh",xe="updated",Ie="resize",Ae="resized",Le="scroll",Pe="scrolled",Oe="destroy",De="arrows:mounted",Me="navigation:mounted",Ne="autoplay:play",Re="autoplay:pause",Fe="lazyload:loaded",Be="sk",Ue="sh",je="ei";function $e(e){var t=e?e.event.bus:document.createDocumentFragment(),i=ge();return e&&e.event.on(Oe,i.destroy),N(i,{bus:t,on:function(e,n){i.bind(t,w(e).join(" "),function(e){n.apply(n,g(e.detail)?e.detail:[])})},off:c(i.unbind,t),emit:function(e){i.dispatch(t,e,u(arguments,1))}})}function qe(e,t,i,n){var s,r,a=Date.now,o=0,l=!0,u=0;function c(){if(!l){if(o=e?se((a()-s)/e,1):1,i&&i(o),o>=1&&(t(),s=a(),n&&++u>=n))return h();r=p(c)}}function h(){l=!0}function d(){r&&cancelAnimationFrame(r),o=0,r=0,l=!0}return{start:function(t){t||d(),s=a()-(t?o*e:0),l=!1,r=p(c)},rewind:function(){s=a(),o=0,i&&i(o)},pause:h,cancel:d,set:function(t){e=t},isPaused:function(){return l}}}var Ve="Arrow",He=Ve+"Left",ze=Ve+"Right",We=Ve+"Up",Ge=Ve+"Down",Xe="ttb",Ke={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[We,ze],ArrowRight:[Ge,He]};var Ye="role",Qe="tabindex",Je="aria-",Ze=Je+"controls",et=Je+"current",tt=Je+"selected",it=Je+"label",nt=Je+"labelledby",st=Je+"hidden",rt=Je+"orientation",at=Je+"roledescription",ot=Je+"live",lt=Je+"busy",ut=Je+"atomic",ct=[Ye,Qe,"disabled",Ze,et,it,nt,st,rt,at],ht=te+"__",dt="is-",pt=te,ft=ht+"track",mt=ht+"list",gt=ht+"slide",yt=gt+"--clone",_t=gt+"__container",vt=ht+"arrows",bt=ht+"arrow",Tt=bt+"--prev",wt=bt+"--next",St=ht+"pagination",Et=St+"__page",Ct=ht+"progress"+"__bar",kt=ht+"toggle",xt=ht+"sr",It=dt+"initialized",At=dt+"active",Lt=dt+"prev",Pt=dt+"next",Ot=dt+"visible",Dt=dt+"loading",Mt=dt+"focus-in",Nt=dt+"overflow",Rt=[At,Ot,Lt,Pt,Dt,Mt,Nt],Ft={slide:gt,clone:yt,arrows:vt,arrow:bt,prev:Tt,next:wt,pagination:St,page:Et,spinner:ht+"spinner"};var Bt="touchstart mousedown",Ut="touchmove mousemove",jt="touchend touchcancel mouseup click";var $t="slide",qt="loop",Vt="fade";function Ht(e,t,i,n){var s,r=$e(e),a=r.on,o=r.emit,l=r.bind,u=e.Components,h=e.root,d=e.options,p=d.isNavigation,f=d.updateOnMove,m=d.i18n,g=d.pagination,y=d.slideFocus,_=u.Direction.resolve,v=H(n,"style"),b=H(n,it),T=i>-1,w=O(n,"."+_t);function S(){var s=e.splides.map(function(e){var i=e.splide.Components.Slides.getAt(t);return i?i.slide.id:""}).join(" ");U(n,it,pe(m.slideX,(T?i:t)+1)),U(n,Ze,s),U(n,Ye,y?"button":""),y&&B(n,at)}function E(){s||C()}function C(){if(!s){var i=e.index;(r=x())!==z(n,At)&&(k(n,At,r),U(n,et,p&&r||""),o(r?we:Se,I)),function(){var t=function(){if(e.is(Vt))return x();var t=W(u.Elements.track),i=W(n),s=_("left",!0),r=_("right",!0);return ae(t[s])<=oe(i[s])&&ae(i[r])<=oe(t[r])}(),i=!t&&(!x()||T);e.state.is([4,5])||U(n,st,i||"");U(Q(n,d.focusableNodes||""),Qe,i?-1:""),y&&U(n,Qe,i?-1:0);t!==z(n,Ot)&&(k(n,Ot,t),o(t?Ee:Ce,I));if(!t&&document.activeElement===n){var s=u.Slides.getAt(e.index);s&&V(s.slide)}}(),k(n,Lt,t===i-1),k(n,Pt,t===i+1)}var r}function x(){var n=e.index;return n===t||d.cloneStatus&&n===i}var I={index:t,slideIndex:i,slide:n,container:w,isClone:T,mount:function(){T||(n.id=h.id+"-slide"+fe(t+1),U(n,Ye,g?"tabpanel":"group"),U(n,at,m.slide),U(n,it,b||pe(m.slideLabel,[t+1,e.length]))),l(n,"click",c(o,Te,I)),l(n,"keydown",c(o,Be,I)),a([be,Ue,Pe],C),a(Me,S),f&&a(ve,E)},destroy:function(){s=!0,r.destroy(),J(n,Rt),B(n,ct),U(n,"style",v),U(n,it,b||"")},update:C,style:function(e,t,i){$(i&&w||n,e,t)},isWithin:function(i,n){var s=le(i-t);return T||!d.rewind&&!e.is(qt)||(s=se(s,e.length-s)),s<=n}};return I}var zt=ie+"-interval";var Wt={passive:!1,capture:!0};var Gt={Spacebar:" ",Right:ze,Left:He,Up:We,Down:Ge};function Xt(e){return e=_(e)?e:e.key,Gt[e]||e}var Kt="keydown";var Yt=ie+"-lazy",Qt=Yt+"-srcset",Jt="["+Yt+"], ["+Qt+"]";var Zt=[" ","Enter"];var ei=Object.freeze({__proto__:null,Media:function(e,t,i){var n=e.state,s=i.breakpoints||{},r=i.reducedMotion||{},o=ge(),l=[];function u(e){e&&o.destroy()}function c(e,t){var i=matchMedia(t);o.bind(i,"change",h),l.push([e,i])}function h(){var t=n.is(7),s=i.direction,r=l.reduce(function(e,t){return R(e,t[1].matches?t[0]:{})},{});F(i),d(r),i.destroy?e.destroy("completely"===i.destroy):t?(u(!0),e.mount()):s!==i.direction&&e.refresh()}function d(t,s,r){R(i,t),s&&R(Object.getPrototypeOf(i),t),!r&&n.is(1)||e.emit(xe,i)}return{setup:function(){var e="min"===i.mediaQuery;D(s).sort(function(t,i){return e?+t-+i:+i-+t}).forEach(function(t){c(s[t],"("+(e?"min":"max")+"-width:"+t+"px)")}),c(r,a),h()},destroy:u,reduce:function(e){matchMedia(a).matches&&(e?R(i,r):F(i,D(r)))},set:d}},Direction:function(e,t,i){return{resolve:function(e,t,n){var s="rtl"!==(n=n||i.direction)||t?n===Xe?0:-1:1;return Ke[e]&&Ke[e][s]||e.replace(/width|left|right/i,function(e,t){var i=Ke[e.toLowerCase()][s]||e;return t>0?i.charAt(0).toUpperCase()+i.slice(1):i})},orient:function(e){return e*("rtl"===i.direction?1:-1)}}},Elements:function(e,t,i){var n,s,r,a=$e(e),o=a.on,u=a.bind,c=e.root,h=i.i18n,d={},p=[],f=[],m=[];function g(){n=b("."+ft),s=O(n,"."+mt),ne(n&&s,"A track/list element is missing."),C(p,P(s,"."+gt+":not(."+yt+")")),M({arrows:vt,pagination:St,prev:Tt,next:wt,bar:Ct,toggle:kt},function(e,t){d[t]=b("."+e)}),N(d,{root:c,track:n,list:s,slides:p}),function(){var e=c.id||(r=te,""+r+fe(me[r]=(me[r]||0)+1)),t=i.role;var r;c.id=e,n.id=n.id||e+"-track",s.id=s.id||e+"-list",!H(c,Ye)&&"SECTION"!==c.tagName&&t&&U(c,Ye,t);U(c,at,h.carousel),U(s,Ye,"presentation")}(),v()}function _(e){var t=ct.concat("style");l(p),J(c,f),J(n,m),B([n,s],t),B(c,e?t:["style",at])}function v(){J(c,f),J(n,m),f=T(pt),m=T(ft),x(c,f),x(n,m),U(c,it,i.label),U(c,nt,i.labelledby)}function b(e){var t=Y(c,e);return t&&function(e,t){if(y(e.closest))return e.closest(t);for(var i=e;i&&1===i.nodeType&&!L(i,t);)i=i.parentElement;return i}(t,"."+pt)===c?t:void 0}function T(e){return[e+"--"+i.type,e+"--"+i.direction,i.drag&&e+"--draggable",i.isNavigation&&e+"--nav",e===pt&&At]}return N(d,{setup:g,mount:function(){o(ke,_),o(ke,g),o(xe,v),u(document,Bt+" keydown",function(e){r="keydown"===e.type},{capture:!0}),u(c,"focusin",function(){k(c,Mt,!!r)})},destroy:_})},Slides:function(e,t,i){var n=$e(e),s=n.on,r=n.emit,a=n.bind,o=t.Elements,u=o.slides,h=o.list,d=[];function p(){u.forEach(function(e,t){m(e,t,-1)})}function f(){v(function(e){e.destroy()}),l(d)}function m(t,i,n){var s=Ht(e,i,n,t);s.mount(),d.push(s),d.sort(function(e,t){return e.index-t.index})}function g(e){return e?b(function(e){return!e.isClone}):d}function v(e,t){g(t).forEach(e)}function b(e){return d.filter(y(e)?e:function(t){return _(e)?L(t.slide,e):E(w(e),t.index)})}return{mount:function(){p(),s(ke,f),s(ke,p)},destroy:f,update:function(){v(function(e){e.update()})},register:m,get:g,getIn:function(e){var n=t.Controller,s=n.toIndex(e),r=n.hasFocus()?1:i.perPage;return b(function(e){return ce(e.index,s,s+r-1)})},getAt:function(e){return b(e)[0]},add:function(e,t){S(e,function(e){if(_(e)&&(e=X(e)),T(e)){var n=u[t];n?A(e,n):I(h,e),x(e,i.classes.slide),s=e,o=c(r,Ie),l=Q(s,"img"),(d=l.length)?l.forEach(function(e){a(e,"load error",function(){--d||o()})}):o()}var s,o,l,d}),r(ke)},remove:function(e){G(b(e).map(function(e){return e.slide})),r(ke)},forEach:v,filter:b,style:function(e,t,i){v(function(n){n.style(e,t,i)})},getLength:function(e){return e?u.length:d.length},isEnough:function(){return d.length>i.perPage}}},Layout:function(e,t,i){var n,s,r,a=$e(e),o=a.on,l=a.bind,u=a.emit,h=t.Slides,d=t.Direction.resolve,p=t.Elements,f=p.root,g=p.track,y=p.list,_=h.getAt,v=h.style;function b(){n=i.direction===Xe,$(f,"maxWidth",ee(i.width)),$(g,d("paddingLeft"),w(!1)),$(g,d("paddingRight"),w(!0)),T(!0)}function T(e){var t=W(f);(e||s.width!==t.width||s.height!==t.height)&&($(g,"height",function(){var e="";n&&(ne(e=S(),"height or heightRatio is missing."),e="calc("+e+" - "+w(!1)+" - "+w(!0)+")");return e}()),v(d("marginRight"),ee(i.gap)),v("width",i.autoWidth?null:ee(i.fixedWidth)||(n?"":E())),v("height",ee(i.fixedHeight)||(n?i.autoHeight?null:E():S()),!0),s=t,u(Ae),r!==(r=P())&&(k(f,Nt,r),u("overflow",r)))}function w(e){var t=i.padding,n=d(e?"right":"left");return t&&ee(t[n]||(m(t)?0:t))||"0px"}function S(){return ee(i.height||W(y).width*i.heightRatio)}function E(){var e=ee(i.gap);return"calc((100%"+(e&&" + "+e)+")/"+(i.perPage||1)+(e&&" - "+e)+")"}function C(){return W(y)[d("width")]}function x(e,t){var i=_(e||0);return i?W(i.slide)[d("width")]+(t?0:L()):0}function I(e,t){var i=_(e);if(i){var n=W(i.slide)[d("right")],s=W(y)[d("left")];return le(n-s)+(t?0:L())}return 0}function A(t){return I(e.length-1)-I(0)+x(0,t)}function L(){var e=_(0);return e&&parseFloat($(e.slide,d("marginRight")))||0}function P(){return e.is(Vt)||A(!0)>C()}return{mount:function(){var e,t;b(),l(window,"resize load",(e=c(u,Ie),t=qe(0,e,null,1),function(){t.isPaused()&&t.start()})),o([xe,ke],b),o(Ie,T)},resize:T,listSize:C,slideSize:x,sliderSize:A,totalSize:I,getPadding:function(e){return parseFloat($(g,d("padding"+(e?"Right":"Left"))))||0},isOverflow:P}},Clones:function(e,t,i){var n,s=$e(e),r=s.on,a=t.Elements,o=t.Slides,u=t.Direction.resolve,c=[];function h(){r(ke,d),r([xe,Ie],f),(n=m())&&(!function(t){var n=o.get().slice(),s=n.length;if(s){for(;n.length<t;)C(n,n);C(n.slice(-t),n.slice(0,t)).forEach(function(r,l){var u=l<t,h=function(t,n){var s=t.cloneNode(!0);return x(s,i.classes.clone),s.id=e.root.id+"-clone"+fe(n+1),s}(r.slide,l);u?A(h,n[0].slide):I(a.list,h),C(c,h),o.register(h,l-t+(u?0:s),r.index)})}}(n),t.Layout.resize(!0))}function d(){p(),h()}function p(){G(c),l(c),s.destroy()}function f(){var e=m();n!==e&&(n<e||!e)&&s.emit(ke)}function m(){var n=i.clones;if(e.is(qt)){if(v(n)){var s=i[u("fixedWidth")]&&t.Layout.slideSize(0);n=s&&oe(W(a.track)[u("width")]/s)||i[u("autoWidth")]&&e.length||2*i.perPage}}else n=0;return n}return{mount:h,destroy:p}},Move:function(e,t,i){var n,s=$e(e),r=s.on,a=s.emit,o=e.state.set,l=t.Layout,u=l.slideSize,c=l.getPadding,h=l.totalSize,d=l.listSize,p=l.sliderSize,f=t.Direction,m=f.resolve,g=f.orient,y=t.Elements,_=y.list,b=y.track;function T(){t.Controller.isBusy()||(t.Scroll.cancel(),w(e.index),t.Slides.update())}function w(e){S(x(e,!0))}function S(i,n){if(!e.is(Vt)){var s=n?i:function(i){if(e.is(qt)){var n=k(i),s=n>t.Controller.getEnd();(n<0||s)&&(i=E(i,s))}return i}(i);$(_,"transform","translate"+m("X")+"("+s+"px)"),i!==s&&a(Ue)}}function E(e,t){var i=e-A(t),n=p();return e-=g(n*(oe(le(i)/n)||1))*(t?1:-1)}function C(){S(I(),!0),n.cancel()}function k(e){for(var i=t.Slides.get(),n=0,s=1/0,r=0;r<i.length;r++){var a=i[r].index,o=le(x(a,!0)-e);if(!(o<=s))break;s=o,n=a}return n}function x(t,n){var s=g(h(t-1)-function(e){var t=i.focus;return"center"===t?(d()-u(e,!0))/2:+t*u(e)||0}(t));return n?function(t){i.trimSpace&&e.is($t)&&(t=he(t,0,g(p(!0)-d())));return t}(s):s}function I(){var e=m("left");return W(_)[e]-W(b)[e]+g(c(!1))}function A(e){return x(e?t.Controller.getEnd():0,!!i.trimSpace)}return{mount:function(){n=t.Transition,r([ye,Ae,xe,ke],T)},move:function(e,t,i,s){var r,l;e!==t&&(r=e>i,l=g(E(I(),r)),r?l>=0:l<=_[m("scrollWidth")]-W(b)[m("width")])&&(C(),S(E(I(),e>i),!0)),o(4),a(ve,t,i,e),n.start(t,function(){o(3),a(be,t,i,e),s&&s()})},jump:w,translate:S,shift:E,cancel:C,toIndex:k,toPosition:x,getPosition:I,getLimit:A,exceededLimit:function(e,t){t=v(t)?I():t;var i=!0!==e&&g(t)<g(A(!1)),n=!1!==e&&g(t)>g(A(!0));return i||n},reposition:T}},Controller:function(e,t,i){var n,s,r,a,o=$e(e),l=o.on,u=o.emit,h=t.Move,d=h.getPosition,p=h.getLimit,f=h.toPosition,m=t.Slides,g=m.isEnough,y=m.getLength,b=i.omitEnd,T=e.is(qt),w=e.is($t),S=c(A,!1),E=c(A,!0),C=i.start||0,k=C;function x(){s=y(!0),r=i.perMove,a=i.perPage,n=O();var e=he(C,0,b?n:s-1);e!==C&&(C=e,h.reposition())}function I(){n!==O()&&u(je)}function A(e,t){var i=r||(R()?1:a),s=L(C+i*(e?-1:1),C,!(r||R()));return-1===s&&w&&!ue(d(),p(!e),1)?e?0:n:t?s:P(s)}function L(t,o,l){if(g()||R()){var u=function(t){if(w&&"move"===i.trimSpace&&t!==C)for(var n=d();n===f(t,!0)&&ce(t,0,e.length-1,!i.rewind);)t<C?--t:++t;return t}(t);u!==t&&(o=t,t=u,l=!1),t<0||t>n?t=r||!ce(0,t,o,!0)&&!ce(n,o,t,!0)?T?l?t<0?-(s%a||a):s:t:i.rewind?t<0?n:0:-1:D(M(t)):l&&t!==o&&(t=D(M(o)+(t<o?-1:1)))}else t=-1;return t}function P(e){return T?(e+s)%s||0:e}function O(){for(var e=s-(R()||T&&r?1:a);b&&e-- >0;)if(f(s-1,!0)!==f(e,!0)){e++;break}return he(e,0,s-1)}function D(e){return he(R()?e:a*e,0,n)}function M(e){return R()?se(e,n):ae((e>=n?s-1:e)/a)}function N(e){e!==C&&(k=C,C=e)}function R(){return!v(i.focus)||i.isNavigation}function F(){return e.state.is([4,5])&&!!i.waitForTransition}return{mount:function(){x(),l([xe,ke,je],x),l(Ae,I)},go:function(e,t,i){if(!F()){var s=function(e){var t=C;if(_(e)){var i=e.match(/([+\-<>])(\d+)?/)||[],s=i[1],r=i[2];"+"===s||"-"===s?t=L(C+ +(""+s+(+r||1)),C):">"===s?t=r?D(+r):S(!0):"<"===s&&(t=E(!0))}else t=T?e:he(e,0,n);return t}(e),r=P(s);r>-1&&(t||r!==C)&&(N(r),h.move(s,r,k,i))}},scroll:function(e,i,s,r){t.Scroll.scroll(e,i,s,function(){var e=P(h.toIndex(d()));N(b?se(e,n):e),r&&r()})},getNext:S,getPrev:E,getAdjacent:A,getEnd:O,setIndex:N,getIndex:function(e){return e?k:C},toIndex:D,toPage:M,toDest:function(e){var t=h.toIndex(e);return w?he(t,0,n):t},hasFocus:R,isBusy:F}},Arrows:function(e,t,i){var n,s,r=$e(e),a=r.on,o=r.bind,l=r.emit,u=i.classes,h=i.i18n,d=t.Elements,p=t.Controller,f=d.arrows,m=d.track,g=f,y=d.prev,_=d.next,v={};function b(){!function(){var e=i.arrows;!e||y&&_||(g=f||j("div",u.arrows),y=E(!0),_=E(!1),n=!0,I(g,[y,_]),!f&&A(g,m));y&&_&&(N(v,{prev:y,next:_}),q(g,e?"":"none"),x(g,s=vt+"--"+i.direction),e&&(a([ye,be,ke,Pe,je],C),o(_,"click",c(S,">")),o(y,"click",c(S,"<")),C(),U([y,_],Ze,m.id),l(De,y,_)))}(),a(xe,T)}function T(){w(),b()}function w(){r.destroy(),J(g,s),n?(G(f?[y,_]:g),y=_=null):B([y,_],ct)}function S(e){p.go(e,!0)}function E(e){return X('<button class="'+u.arrow+" "+(e?u.prev:u.next)+'" type="button"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40" focusable="false"><path d="'+(i.arrowPath||"m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z")+'" />')}function C(){if(y&&_){var t=e.index,i=p.getPrev(),n=p.getNext(),s=i>-1&&t<i?h.last:h.prev,r=n>-1&&t>n?h.first:h.next;y.disabled=i<0,_.disabled=n<0,U(y,it,s),U(_,it,r),l("arrows:updated",y,_,i,n)}}return{arrows:v,mount:b,destroy:w,update:C}},Autoplay:function(e,t,i){var n,s,r=$e(e),a=r.on,o=r.bind,l=r.emit,u=qe(i.interval,e.go.bind(e,">"),function(e){var t=h.bar;t&&$(t,"width",100*e+"%"),l("autoplay:playing",e)}),c=u.isPaused,h=t.Elements,d=t.Elements,p=d.root,f=d.toggle,m=i.autoplay,g="pause"===m;function y(){c()&&t.Slides.isEnough()&&(u.start(!i.resetProgress),s=n=g=!1,b(),l(Ne))}function _(e){void 0===e&&(e=!0),g=!!e,b(),c()||(u.pause(),l(Re))}function v(){g||(n||s?_(!1):y())}function b(){f&&(k(f,At,!g),U(f,it,i.i18n[g?"play":"pause"]))}function T(e){var n=t.Slides.getAt(e);u.set(n&&+H(n.slide,zt)||i.interval)}return{mount:function(){m&&(!function(){i.pauseOnHover&&o(p,"mouseenter mouseleave",function(e){n="mouseenter"===e.type,v()});i.pauseOnFocus&&o(p,"focusin focusout",function(e){s="focusin"===e.type,v()});f&&o(f,"click",function(){g?y():_(!0)});a([ve,Le,ke],u.rewind),a(ve,T)}(),f&&U(f,Ze,h.track.id),g||y(),b())},destroy:u.cancel,play:y,pause:_,isPaused:c}},Cover:function(e,t,i){var n=$e(e).on;function s(e){t.Slides.forEach(function(t){var i=O(t.container||t.slide,"img");i&&i.src&&r(e,i,t)})}function r(e,t,i){i.style("background",e?'center/cover no-repeat url("'+t.src+'")':"",!0),q(t,e?"none":"")}return{mount:function(){i.cover&&(n(Fe,c(r,!0)),n([ye,xe,ke],c(s,!0)))},destroy:c(s,!1)}},Scroll:function(e,t,i){var n,s,r=$e(e),a=r.on,o=r.emit,l=e.state.set,u=t.Move,h=u.getPosition,d=u.getLimit,p=u.exceededLimit,f=u.translate,m=e.is($t),g=1;function y(e,i,r,a,d){var f=h();if(b(),r&&(!m||!p())){var y=t.Layout.sliderSize(),T=de(e)*y*ae(le(e)/y)||0;e=u.toPosition(t.Controller.toDest(e%y))+T}var w=ue(f,e,1);g=1,i=w?0:i||re(le(e-f)/1.5,800),s=a,n=qe(i,_,c(v,f,e,d),1),l(5),o(Le),n.start()}function _(){l(3),s&&s(),o(Pe)}function v(e,t,n,r){var a,o,l=h(),u=(e+(t-e)*(a=r,(o=i.easingFunc)?o(a):1-Math.pow(1-a,4))-l)*g;f(l+u),m&&!n&&p()&&(g*=.6,le(u)<10&&y(d(p(!0)),600,!1,s,!0))}function b(){n&&n.cancel()}function T(){n&&!n.isPaused()&&(b(),_())}return{mount:function(){a(ve,b),a([xe,ke],T)},destroy:b,scroll:y,cancel:T}},Drag:function(e,t,i){var n,s,r,a,o,l,u,c,h=$e(e),p=h.on,f=h.emit,g=h.bind,y=h.unbind,_=e.state,v=t.Move,b=t.Scroll,T=t.Controller,w=t.Elements.track,S=t.Media.reduce,E=t.Direction,C=E.resolve,k=E.orient,x=v.getPosition,I=v.exceededLimit,A=!1;function P(){var e=i.drag;q(!e),a="free"===e}function O(e){if(l=!1,!u){var t=$(e);n=e.target,s=i.noDrag,L(n,"."+Et+", ."+bt)||s&&L(n,s)||!t&&e.button||(T.isBusy()?K(e,!0):(c=t?w:window,o=_.is([4,5]),r=null,g(c,Ut,D,Wt),g(c,jt,M,Wt),v.cancel(),b.cancel(),R(e)))}var n,s}function D(t){if(_.is(6)||(_.set(6),f("drag")),t.cancelable)if(o){v.translate(n+F(t)/(A&&e.is($t)?5:1));var s=B(t)>200,r=A!==(A=I());(s||r)&&R(t),l=!0,f("dragging"),K(t)}else(function(e){return le(F(e))>le(F(e,!0))})(t)&&(o=function(e){var t=i.dragMinThreshold,n=m(t),s=n&&t.mouse||0,r=(n?t.touch:+t)||10;return le(F(e))>($(e)?r:s)}(t),K(t))}function M(n){_.is(6)&&(_.set(3),f("dragged")),o&&(!function(n){var s=function(t){if(e.is(qt)||!A){var i=B(t);if(i&&i<200)return F(t)/i}return 0}(n),r=function(e){return x()+de(e)*se(le(e)*(i.flickPower||600),a?1/0:t.Layout.listSize()*(i.flickMaxPages||1))}(s),o=i.rewind&&i.rewindByDrag;S(!1),a?T.scroll(r,0,i.snap):e.is(Vt)?T.go(k(de(s))<0?o?"<":"-":o?">":"+"):e.is($t)&&A&&o?T.go(I(!0)?">":"<"):T.go(T.toDest(r),!0);S(!0)}(n),K(n)),y(c,Ut,D),y(c,jt,M),o=!1}function N(e){!u&&l&&K(e,!0)}function R(e){r=s,s=e,n=x()}function F(e,t){return j(e,t)-j(U(e),t)}function B(e){return Z(e)-Z(U(e))}function U(e){return s===e&&r||s}function j(e,t){return($(e)?e.changedTouches[0]:e)["page"+C(t?"Y":"X")]}function $(e){return"undefined"!=typeof TouchEvent&&e instanceof TouchEvent}function q(e){u=e}return{mount:function(){g(w,Ut,d,Wt),g(w,jt,d,Wt),g(w,Bt,O,Wt),g(w,"click",N,{capture:!0}),g(w,"dragstart",K),p([ye,xe],P)},disable:q,isDragging:function(){return o}}},Keyboard:function(e,t,i){var n,s,r=$e(e),a=r.on,o=r.bind,l=r.unbind,u=e.root,c=t.Direction.resolve;function d(){var e=i.keyboard;e&&(n="global"===e?window:u,o(n,Kt,m))}function p(){l(n,Kt)}function f(){var e=s;s=!0,h(function(){s=e})}function m(t){if(!s){var i=Xt(t);i===c(He)?e.go("<"):i===c(ze)&&e.go(">")}}return{mount:function(){d(),a(xe,p),a(xe,d),a(ve,f)},destroy:p,disable:function(e){s=e}}},LazyLoad:function(e,t,i){var n=$e(e),s=n.on,r=n.off,a=n.bind,o=n.emit,u="sequential"===i.lazyLoad,h=[be,Pe],d=[];function p(){l(d),t.Slides.forEach(function(e){Q(e.slide,Jt).forEach(function(t){var n=H(t,Yt),s=H(t,Qt);if(n!==t.src||s!==t.srcset){var r=i.classes.spinner,a=t.parentElement,o=O(a,"."+r)||j("span",r,a);d.push([t,e,o]),t.src||q(t,"none")}})}),u?y():(r(h),s(h,f),f())}function f(){(d=d.filter(function(t){var n=i.perPage*((i.preloadPages||1)+1)-1;return!t[1].isWithin(e.index,n)||m(t)})).length||r(h)}function m(e){var t=e[0];x(e[1].slide,Dt),a(t,"load error",c(g,e)),U(t,"src",H(t,Yt)),U(t,"srcset",H(t,Qt)),B(t,Yt),B(t,Qt)}function g(e,t){var i=e[0],n=e[1];J(n.slide,Dt),"error"!==t.type&&(G(e[2]),q(i,""),o(Fe,i,n),o(Ie)),u&&y()}function y(){d.length&&m(d.shift())}return{mount:function(){i.lazyLoad&&(p(),s(ke,p))},destroy:c(l,d),check:f}},Pagination:function(e,t,i){var n,s,r=$e(e),a=r.on,o=r.emit,h=r.bind,d=t.Slides,p=t.Elements,f=t.Controller,m=f.hasFocus,g=f.getIndex,y=f.go,_=t.Direction.resolve,v=p.pagination,b=[];function T(){n&&(G(v?u(n.children):n),J(n,s),l(b),n=null),r.destroy()}function w(e){y(">"+e,!0)}function S(e,t){var i=b.length,n=Xt(t),s=E(),r=-1;n===_(ze,!1,s)?r=++e%i:n===_(He,!1,s)?r=(--e+i)%i:"Home"===n?r=0:"End"===n&&(r=i-1);var a=b[r];a&&(V(a.button),y(">"+r),K(t,!0))}function E(){return i.paginationDirection||i.direction}function C(e){return b[f.toPage(e)]}function k(){var e=C(g(!0)),t=C(g());if(e){var i=e.button;J(i,At),B(i,tt),U(i,Qe,-1)}if(t){var s=t.button;x(s,At),U(s,tt,!0),U(s,Qe,"")}o("pagination:updated",{list:n,items:b},e,t)}return{items:b,mount:function t(){T(),a([xe,ke,je],t);var r=i.pagination;v&&q(v,r?"":"none"),r&&(a([ve,Le,Pe],k),function(){var t=e.length,r=i.classes,a=i.i18n,o=i.perPage,l=m()?f.getEnd()+1:oe(t/o);x(n=v||j("ul",r.pagination,p.track.parentElement),s=St+"--"+E()),U(n,Ye,"tablist"),U(n,it,a.select),U(n,rt,E()===Xe?"vertical":"");for(var u=0;u<l;u++){var g=j("li",null,n),y=j("button",{class:r.page,type:"button"},g),_=d.getIn(u).map(function(e){return e.slide.id}),T=!m()&&o>1?a.pageX:a.slideX;h(y,"click",c(w,u)),i.paginationKeyboard&&h(y,"keydown",c(S,u)),U(g,Ye,"presentation"),U(y,Ye,"tab"),U(y,Ze,_.join(" ")),U(y,it,pe(T,u+1)),U(y,Qe,-1),b.push({li:g,button:y,page:u})}}(),k(),o("pagination:mounted",{list:n,items:b},C(e.index)))},destroy:T,getAt:C,update:k}},Sync:function(e,t,i){var n=i.isNavigation,s=i.slideFocus,r=[];function a(){e.splides.forEach(function(t){t.isParent||(u(e,t.splide),u(t.splide,e))}),n&&function(){var t=$e(e),i=t.on;i(Te,d),i(Be,p),i([ye,xe],h),r.push(t),t.emit(Me,e.splides)}()}function o(){r.forEach(function(e){e.destroy()}),l(r)}function u(e,t){var i=$e(e);i.on(ve,function(e,i,n){t.go(t.is(qt)?n:e)}),r.push(i)}function h(){U(t.Elements.list,rt,i.direction===Xe?"vertical":"")}function d(t){e.go(t.index)}function p(e,t){E(Zt,Xt(t))&&(d(e),K(t))}return{setup:c(t.Media.set,{slideFocus:v(s)?n:s},!0),mount:a,destroy:o,remount:function(){o(),a()}}},Wheel:function(e,t,i){var n=$e(e).bind,s=0;function r(n){if(n.cancelable){var r=n.deltaY,a=r<0,o=Z(n),l=i.wheelMinThreshold||0,u=i.wheelSleep||0;le(r)>l&&o-s>u&&(e.go(a?"<":">"),s=o),function(n){return!i.releaseWheel||e.state.is(4)||-1!==t.Controller.getAdjacent(n)}(a)&&K(n)}}return{mount:function(){i.wheel&&n(t.Elements.track,"wheel",r,Wt)}}},Live:function(e,t,i){var n=$e(e).on,s=t.Elements.track,r=i.live&&!i.isNavigation,a=j("span",xt),o=qe(90,c(l,!1));function l(e){U(s,lt,e),e?(I(s,a),o.start()):(G(a),o.cancel())}function u(e){r&&U(s,ot,e?"off":"polite")}return{mount:function(){r&&(u(!t.Autoplay.isPaused()),U(s,ut,!0),a.textContent="…",n(Ne,c(u,!0)),n(Re,c(u,!1)),n([be,Pe],c(l,!0)))},disable:u,destroy:function(){B(s,[ot,ut,lt]),G(a)}}}}),ti={type:"slide",role:"region",speed:400,perPage:1,cloneStatus:!0,arrows:!0,pagination:!0,paginationKeyboard:!0,interval:5e3,pauseOnHover:!0,pauseOnFocus:!0,resetProgress:!0,easing:"cubic-bezier(0.25, 1, 0.5, 1)",drag:!0,direction:"ltr",trimSpace:!0,focusableNodes:"a, button, textarea, input, select, iframe",live:!0,classes:Ft,i18n:{prev:"Previous slide",next:"Next slide",first:"Go to first slide",last:"Go to last slide",slideX:"Go to slide %s",pageX:"Go to page %s",play:"Start autoplay",pause:"Pause autoplay",carousel:"carousel",slide:"slide",select:"Select a slide to show",slideLabel:"%s of %s"},reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function ii(e,t,i){var n=t.Slides;function s(){n.forEach(function(e){e.style("transform","translateX(-"+100*e.index+"%)")})}return{mount:function(){$e(e).on([ye,ke],s)},start:function(e,t){n.style("transition","opacity "+i.speed+"ms "+i.easing),h(t)},cancel:d}}function ni(e,t,i){var n,s=t.Move,r=t.Controller,a=t.Scroll,o=t.Elements.list,l=c($,o,"transition");function u(){l(""),a.cancel()}return{mount:function(){$e(e).bind(o,"transitionend",function(e){e.target===o&&n&&(u(),n())})},start:function(t,o){var u=s.toPosition(t,!0),c=s.getPosition(),h=function(t){var n=i.rewindSpeed;if(e.is($t)&&n){var s=r.getIndex(!0),a=r.getEnd();if(0===s&&t>=a||s>=a&&0===t)return n}return i.speed}(t);le(u-c)>=1&&h>=1?i.useScroll?a.scroll(u,h,!1,o):(l("transform "+h+"ms "+i.easing),s.translate(u,!0),n=o):(s.jump(t),o())},cancel:u}}var si=function(){function e(t,i){var n;this.event=$e(),this.Components={},this.state=(n=1,{set:function(e){n=e},is:function(e){return E(w(e),n)}}),this.splides=[],this._o={},this._E={};var s=_(t)?Y(document,t):t;ne(s,s+" is invalid."),this.root=s,i=R({label:H(s,it)||"",labelledby:H(s,nt)||""},ti,e.defaults,i||{});try{R(i,JSON.parse(H(s,ie)))}catch(e){ne(!1,"Invalid JSON")}this._o=Object.create(R({},i))}var t=e.prototype;return t.mount=function(e,t){var i=this,n=this.state,s=this.Components;return ne(n.is([1,7]),"Already mounted!"),n.set(1),this._C=s,this._T=t||this._T||(this.is(Vt)?ii:ni),this._E=e||this._E,M(N({},ei,this._E,{Transition:this._T}),function(e,t){var n=e(i,s,i._o);s[t]=n,n.setup&&n.setup()}),M(s,function(e){e.mount&&e.mount()}),this.emit(ye),x(this.root,It),n.set(3),this.emit(_e),this},t.sync=function(e){return this.splides.push({splide:e}),e.splides.push({splide:this,isParent:!0}),this.state.is(3)&&(this._C.Sync.remount(),e.Components.Sync.remount()),this},t.go=function(e){return this._C.Controller.go(e),this},t.on=function(e,t){return this.event.on(e,t),this},t.off=function(e){return this.event.off(e),this},t.emit=function(e){var t;return(t=this.event).emit.apply(t,[e].concat(u(arguments,1))),this},t.add=function(e,t){return this._C.Slides.add(e,t),this},t.remove=function(e){return this._C.Slides.remove(e),this},t.is=function(e){return this._o.type===e},t.refresh=function(){return this.emit(ke),this},t.destroy=function(e){void 0===e&&(e=!0);var t=this.event,i=this.state;return i.is(1)?$e(this).on(_e,this.destroy.bind(this,e)):(M(this._C,function(t){t.destroy&&t.destroy(e)},!0),t.emit(Oe),t.destroy(),e&&l(this.splides),i.set(7)),this},r(e,[{key:"options",get:function(){return this._o},set:function(e){this._C.Media.set(e,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e}(),ri=si;ri.defaults={},ri.STATES=o;const ai=new Map,oi={set(e,t,i){ai.has(e)||ai.set(e,new Map);const n=ai.get(e);n.has(t)||0===n.size?n.set(t,i):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(n.keys())[0]}.`)},get:(e,t)=>ai.has(e)&&ai.get(e).get(t)||null,remove(e,t){if(!ai.has(e))return;const i=ai.get(e);i.delete(t),0===i.size&&ai.delete(e)}},li="transitionend",ui=e=>null==e?`${e}`:Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase(),ci=e=>{let t=e.getAttribute("data-bs-target");if(!t||"#"===t){let i=e.getAttribute("href");if(!i||!i.includes("#")&&!i.startsWith("."))return null;i.includes("#")&&!i.startsWith("#")&&(i=`#${i.split("#")[1]}`),t=i&&"#"!==i?i.trim():null}return t},hi=e=>{const t=ci(e);return t&&document.querySelector(t)?t:null},di=e=>{const t=ci(e);return t?document.querySelector(t):null},pi=e=>!(!e||"object"!=typeof e)&&void 0!==e.nodeType,fi=e=>pi(e)?e:"string"==typeof e&&e.length>0?document.querySelector(e):null,mi=e=>{if(!pi(e)||0===e.getClientRects().length)return!1;const t="visible"===getComputedStyle(e).getPropertyValue("visibility"),i=e.closest("details:not([open])");if(!i)return t;if(i!==e){const t=e.closest("summary");if(t&&t.parentNode!==i)return!1;if(null===t)return!1}return t},gi=e=>!e||e.nodeType!==Node.ELEMENT_NODE||(!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled"))),yi=e=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof e.getRootNode){const t=e.getRootNode();return t instanceof ShadowRoot?t:null}return e instanceof ShadowRoot?e:e.parentNode?yi(e.parentNode):null},_i=()=>{},vi=e=>{e.offsetHeight},bi=()=>"undefined"!=typeof window&&"undefined"!=typeof document&&"rtl"===document.documentElement.dir,Ti=e=>{"function"==typeof e&&e()},wi=(e,t,i=!0)=>{if(!i)return void Ti(e);const n=(e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:i}=window.getComputedStyle(e);const n=Number.parseFloat(t),s=Number.parseFloat(i);return n||s?(t=t.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(t)+Number.parseFloat(i))):0})(t)+5;let s=!1;const r=({target:i})=>{i===t&&(s=!0,t.removeEventListener(li,r),Ti(e))};t.addEventListener(li,r),setTimeout(()=>{s||t.dispatchEvent(new Event(li))},n)},Si=(e,t,i,n)=>{const s=e.length;let r=e.indexOf(t);return-1===r?!i&&n?e[s-1]:e[0]:(r+=i?1:-1,n&&(r=(r+s)%s),e[Math.max(0,Math.min(r,s-1))])},Ei=/[^.]*(?=\..*)\.|.*/,Ci=/\..*/,ki=/::\d+$/,xi={};let Ii=1;const Ai={mouseenter:"mouseover",mouseleave:"mouseout"},Li=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function Pi(e,t){return t&&`${t}::${Ii++}`||e.uidEvent||Ii++}function Oi(e){const t=Pi(e);return e.uidEvent=t,xi[t]=xi[t]||{},xi[t]}function Di(e,t,i=null){return Object.values(e).find(e=>e.callable===t&&e.delegationSelector===i)}function Mi(e,t,i){const n="string"==typeof t,s=n?i:t||i;let r=function(e){return e=e.replace(Ci,""),Ai[e]||e}(e);return Li.has(r)||(r=e),[n,s,r]}function Ni(e,t,i,n,s){if("string"!=typeof t||!e)return;let[r,a,o]=Mi(t,i,n);if(t in Ai){const e=e=>function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)};a=e(a)}const l=Oi(e),u=l[o]||(l[o]={}),c=Di(u,a,r?i:null);if(c)return void(c.oneOff=c.oneOff&&s);const h=Pi(a,t.replace(Ei,"")),d=r?function(e,t,i){return function n(s){const r=e.querySelectorAll(t);for(let{target:a}=s;a&&a!==this;a=a.parentNode)for(const o of r)if(o===a)return Ui(s,{delegateTarget:a}),n.oneOff&&Bi.off(e,s.type,t,i),i.apply(a,[s])}}(e,i,a):function(e,t){return function i(n){return Ui(n,{delegateTarget:e}),i.oneOff&&Bi.off(e,n.type,t),t.apply(e,[n])}}(e,a);d.delegationSelector=r?i:null,d.callable=a,d.oneOff=s,d.uidEvent=h,u[h]=d,e.addEventListener(o,d,r)}function Ri(e,t,i,n,s){const r=Di(t[i],n,s);r&&(e.removeEventListener(i,r,Boolean(s)),delete t[i][r.uidEvent])}function Fi(e,t,i,n){const s=t[i]||{};for(const r of Object.keys(s))if(r.includes(n)){const n=s[r];Ri(e,t,i,n.callable,n.delegationSelector)}}const Bi={on(e,t,i,n){Ni(e,t,i,n,!1)},one(e,t,i,n){Ni(e,t,i,n,!0)},off(e,t,i,n){if("string"!=typeof t||!e)return;const[s,r,a]=Mi(t,i,n),o=a!==t,l=Oi(e),u=l[a]||{},c=t.startsWith(".");if(void 0===r){if(c)for(const i of Object.keys(l))Fi(e,l,i,t.slice(1));for(const i of Object.keys(u)){const n=i.replace(ki,"");if(!o||t.includes(n)){const t=u[i];Ri(e,l,a,t.callable,t.delegationSelector)}}}else{if(!Object.keys(u).length)return;Ri(e,l,a,r,s?i:null)}},trigger(e,t,i){if("string"!=typeof t||!e)return null;let n=new Event(t,{bubbles:!0,cancelable:!0});return n=Ui(n,i),e.dispatchEvent(n),n}};function Ui(e,t){for(const[i,n]of Object.entries(t||{}))try{e[i]=n}catch{Object.defineProperty(e,i,{configurable:!0,get:()=>n})}return e}function ji(e){if("true"===e)return!0;if("false"===e)return!1;if(e===Number(e).toString())return Number(e);if(""===e||"null"===e)return null;if("string"!=typeof e)return e;try{return JSON.parse(decodeURIComponent(e))}catch{return e}}function $i(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}const qi={setDataAttribute(e,t,i){e.setAttribute(`data-bs-${$i(t)}`,i)},removeDataAttribute(e,t){e.removeAttribute(`data-bs-${$i(t)}`)},getDataAttributes(e){if(!e)return{};const t={},i=Object.keys(e.dataset).filter(e=>e.startsWith("bs")&&!e.startsWith("bsConfig"));for(const n of i){let i=n.replace(/^bs/,"");i=i.charAt(0).toLowerCase()+i.slice(1,i.length),t[i]=ji(e.dataset[n])}return t},getDataAttribute:(e,t)=>ji(e.getAttribute(`data-bs-${$i(t)}`))};let Vi=class{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){const i=pi(t)?qi.getDataAttribute(t,"config"):{};return{...this.constructor.Default,..."object"==typeof i?i:{},...pi(t)?qi.getDataAttributes(t):{},..."object"==typeof e?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const i of Object.keys(t)){const n=t[i],s=e[i],r=pi(s)?"element":ui(s);if(!new RegExp(n).test(r))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${i}" provided type "${r}" but expected type "${n}".`)}}};class Hi extends Vi{constructor(e,t){super(),(e=fi(e))&&(this._element=e,this._config=this._getConfig(t),oi.set(this._element,this.constructor.DATA_KEY,this))}dispose(){oi.remove(this._element,this.constructor.DATA_KEY),Bi.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,i=!0){wi(e,t,i)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return oi.get(fi(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,"object"==typeof t?t:null)}static get VERSION(){return"5.2.3"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}}const zi={find:(e,t=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(t,e)),findOne:(e,t=document.documentElement)=>Element.prototype.querySelector.call(t,e),children:(e,t)=>[].concat(...e.children).filter(e=>e.matches(t)),parents(e,t){const i=[];let n=e.parentNode.closest(t);for(;n;)i.push(n),n=n.parentNode.closest(t);return i},prev(e,t){let i=e.previousElementSibling;for(;i;){if(i.matches(t))return[i];i=i.previousElementSibling}return[]},next(e,t){let i=e.nextElementSibling;for(;i;){if(i.matches(t))return[i];i=i.nextElementSibling}return[]},focusableChildren(e){const t=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(e=>`${e}:not([tabindex^="-"])`).join(",");return this.find(t,e).filter(e=>!gi(e)&&mi(e))}},Wi={slideFocus:!1,rewind:!0,perMove:1,i18n:{prev:"Slide precedente",next:"Slide successiva",first:"Vai alla prima slide",last:"Vai all’ultima slide",slideX:"Vai alla slide %s",pageX:"Vai a pagina %s",play:"Attiva autoplay",pause:"Pausa autoplay",carousel:"Carosello",select:"Seleziona una slide da mostrare",slide:"slide",slideLabel:"%s di %s"}},Gi={"it-carousel-landscape-abstract-three-cols":{type:"slide",perPage:3,gap:24,padding:{left:0,right:0},arrows:!1,breakpoints:{768:{perPage:1,gap:24,padding:{left:0,right:0},arrows:!1},992:{perPage:2,gap:24,padding:{left:40,right:40},arrows:!1}}},"it-carousel-landscape-abstract-three-cols-arrow-visible":{type:"slide",perPage:3,gap:24,padding:{left:0,right:0},arrows:!0,breakpoints:{768:{perPage:1,gap:24,padding:{left:40,right:40},arrows:!0},992:{perPage:2,gap:24,padding:{left:40,right:40},arrows:!0}}},"it-big-img":{type:"loop",perPage:1,gap:48,padding:{left:320,right:320},arrows:!1,breakpoints:{768:{perPage:1,gap:0,padding:{left:0,right:0},arrows:!1},992:{perPage:1,gap:24,padding:{left:160,right:160},arrows:!1}}},"it-standard-image":{type:"loop",perPage:3,gap:24,padding:{left:48,right:48},arrows:!1,breakpoints:{768:{perPage:1,gap:24,padding:{left:40,right:40},arrows:!1},992:{perPage:2,gap:24,padding:{left:48,right:48},arrows:!1}}},"it-carousel-landscape-abstract":{type:"slide",perPage:1,gap:24,padding:{left:0,right:0},arrows:!1,breakpoints:{768:{perPage:1,gap:24,padding:{left:0,right:0},arrows:!1},992:{perPage:1,gap:24,padding:{left:24,right:24},arrows:!1}}},"it-calendar-wrapper":{type:"slide",perPage:4,gap:0,padding:{left:0,right:0},arrows:!1,breakpoints:{560:{perPage:1,gap:0,padding:{left:24,right:24},arrows:!1},768:{perPage:2,gap:0,padding:{left:0,right:0},arrows:!1},992:{perPage:3,gap:0,padding:{left:0,right:0},arrows:!1}}}};class Xi extends Hi{constructor(e){super(e),this._config=this._getConfig(),this._splide=new ri(this._element,this._config),this._init()}dispose(){this._splide.destroy(),super.dispose()}static get NAME(){return"carousel"}_init(){this._splide.mount()}_getConfig(){let e=Object.assign({},Wi);return Object.keys(Gi).forEach(t=>{this._element.classList.contains(t)&&(e=Object.assign({},e,Gi[t]))}),e}}"undefined"!=typeof window&&"undefined"!=typeof document&&Bi.on(window,"load.bs.carousel.data-api",()=>{zi.find("[data-bs-carousel-splide]").forEach(e=>{Xi.getOrCreateInstance(e)})});const Ki=".bs.inputlabel",Yi=`focus${Ki}`,Qi=`blur${Ki}`,Ji=`change${Ki}`,Zi="active";class en{constructor(e){this._element=e,this._init()}static get NAME(){return"inputlabel"}static getInputFromLabel=e=>{if("undefined"!=typeof window&&"undefined"!=typeof document)return document.querySelector("#"+CSS.escape(e.getAttribute("for")))};_init(){const e=this._getLabel();e&&!e.classList.contains(Zi)&&(this._labelOut(),this._labelOver()),e&&null===e.getAttribute("it-bs-static")&&this._bindEvents()}_bindEvents(){["date","time"].includes(this._element.getAttribute("type"))||("file"===this._element.getAttribute("type")?Bi.on(this._element,Qi,()=>{this._labelOut()}):(Bi.on(this._element,Yi,()=>{this._labelOut()}),Bi.on(this._element,Qi,()=>{this._labelOver()}),Bi.on(this._element,Ji,()=>{this._labelToggle()})))}_getLabel(){return zi.findOne('label[for="'+this._element.getAttribute("id")+'"]')}_isEmpty(){return"number"===this._element.getAttribute("type")?!this._element.value&&!this._element.getAttribute("placeholder")&&!this._element.validity.badInput:!this._element.value&&!this._element.getAttribute("placeholder")}_labelOut(){const e=this._getLabel();e&&e.classList.add(Zi)}_labelOver(){if(this._isEmpty()){const e=this._getLabel();e&&e.classList.remove(Zi)}}_labelToggle(){this._isEmpty()?this._labelOver():this._labelOut()}}const tn=".bs.inputnumber",nn=`click${tn}`,sn=`change${tn}`,rn=`click${tn}.data-api`,an=".input-number",on='input[data-bs-input][type="number"]',ln='button[class^="input-number-"]';class un extends Hi{constructor(e){super(e),this._wrapperElement=this._element.closest(an),this._label=new en(e),this._init(),this._bindEvents()}static get NAME(){return"inputnumber"}_init(){this._wrapperElement&&this._inputResize()}_bindEvents(){this._wrapperElement&&(zi.find(ln,this._wrapperElement).forEach(e=>{Bi.on(e,nn,t=>{t.preventDefault(),this._incrDecr(e.classList.contains("input-number-sub")),this._label._labelOut()})}),Bi.on(this._element,sn,()=>this._checkLimit()))}_inputResize(){if(this._wrapperElement.classList.contains("input-number-adaptive")){let e=null;e="calc(70px + "+this._element.value.length+"ch)",e&&(this._element.style.width=e)}}_incrDecr(e){let t=0;if(!this._element.disabled&&!this._element.readonly&&(""!==this._element.value&&(t=parseFloat(this._element.value)),!isNaN(t))){let i=parseFloat(this._element.getAttribute("step"));i||(i=1),this._element.value=t+i*(e?-1:1),Bi.trigger(this._element,sn),Bi.trigger(this._element,"input")}}_checkLimit(){const e=parseFloat(this._element.value);if(!isNaN(e)){let t=e;const i=parseFloat(this._element.getAttribute("max")),n=parseFloat(this._element.getAttribute("min"));n&&e<n&&(t=n),i&&e>i&&(t=i),this._element.value=t}this._inputResize()}}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll(on+", label").forEach(function(e){const t=en.getInputFromLabel(e)||e;var i;(i=t)&&i.matches(on)&&i.parentNode.querySelector(ln)&&un.getOrCreateInstance(i)})}),Bi.on(document,rn,ln,function(){const e=this.closest(an);if(e){const t=zi.findOne(on,e);t&&un.getOrCreateInstance(t)}}));const cn="show";class hn extends Hi{constructor(e){super(e),this._isShown=!e.matches("[aria-hidden=true]"),this._isTransitioning=!1}static get NAME(){return"dimmer"}show(){this._isShown||this._isTransitioning||(this._isShown=!0,this._isAnimated()&&(this._isTransitioning=!0),this._showElement())}hide(){if(!this._isShown||this._isTransitioning)return;this._isShown=!1;const e=this._isAnimated();e&&(this._isTransitioning=!0),this._element.classList.remove(cn),this._queueCallback(()=>this._hideElement(),this._element,e)}_isAnimated(){return this._element.classList.contains("fade")}_showElement(){const e=this._isAnimated();this._element.removeAttribute("aria-hidden"),e&&vi(this._element),this._element.classList.add(cn);this._queueCallback(()=>{this._isTransitioning=!1},this._element,e)}_hideElement(){this._element.setAttribute("aria-hidden",!0),this._isTransitioning=!1}}"undefined"!=typeof window&&"undefined"!=typeof document&&Bi.on(document,"click.bs.dimmer.data-api",'[data-bs-toggle="dimmer"]',function(){const e=di(this),t=hn.getOrCreateInstance(e);this.checked?t.show():t.hide()});const dn=(e,t="hide")=>{const i=`click.dismiss${e.EVENT_KEY}`,n=e.NAME;Bi.on(document,i,`[data-bs-dismiss="${n}"]`,function(i){if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),gi(this))return;const s=di(this)||this.closest(`.${n}`);e.getOrCreateInstance(s)[t]()})},pn=".bs.notification",fn=`click${pn}.data-api`,mn=`hidden${pn}`,gn=`show${pn}`,yn={timeout:0},_n="show";class vn extends Hi{constructor(e,t){super(e),this._config=this._getConfig(t),this._isShown=this._element.classList.contains(_n),this._isTransitioning=!1,this._toId=null}static get NAME(){return"notification"}show(e,t){if(this._isShown||this._isTransitioning)return;const i=e||this._getElementTimeout(t);this._isShown=!0,this._isAnimated()&&(this._isTransitioning=!0),this._showElement(i)}hide(){if(!this._isShown||this._isTransitioning)return;this._isShown=!1;const e=this._isAnimated();e&&(this._isTransitioning=!0),this._element.classList.remove(_n),this._queueCallback(()=>this._hideElement(),this._element,e)}toggle(e){this._isShown?this.hide():this.show(null,e)}_isAnimated(){return this._element.classList.contains("fade")}_showElement(e){const t=this._isAnimated();this._element.style.display="block",this._element.removeAttribute("aria-hidden"),t&&vi(this._element),this._element.classList.add(_n);this._queueCallback(()=>{this._isTransitioning=!1,e&&this._setTimeout(e,()=>this.hide())},this._element,t)}_hideElement(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._isTransitioning=!1}_getConfig(e){return e={...yn,...qi.getDataAttributes(this._element),..."object"==typeof e?e:{}}}_getElementTimeout(e){const t=e?parseInt(e.getAttribute("data-bs-timeout")):null;return t>0?t:this._config.timeout}_setTimeout(e,t){this._clearTimeout(),setTimeout(t,e)}_clearTimeout(){this._toId&&(clearTimeout(this._toId),this._toId=null)}}"undefined"!=typeof window&&"undefined"!=typeof document&&(Bi.on(document,fn,'[data-bs-toggle="notification"]',function(e){const t=di(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),Bi.one(t,gn,e=>{e.defaultPrevented||Bi.one(t,mn,()=>{mi(this)&&this.focus()})});vn.getOrCreateInstance(t).toggle(this)}),dn(vn));const bn="cookiebar",Tn=".bs.cookiebar",wn=".data-api",Sn="cookies_consent",En=`close${Tn}`,Cn=`closed${Tn}`,kn=`load${Tn}${wn}`,xn=`click${Tn}${wn}`,In="show";class An extends Hi{constructor(e){super(e),this._isShown=this._element.classList.contains(In),this._isTransitioning=!1}static get NAME(){return bn}static get VERSION(){return"5.0.0"}show(){this._isShown||this._isTransitioning||(this._isShown=!0,this._isAnimated()&&(this._isTransitioning=!0),this._showElement())}hide(){if(!this._isShown||this._isTransitioning)return;this._isShown=!1;const e=this._isAnimated();e&&(this._isTransitioning=!0),this._element.classList.remove(In),this._queueCallback(()=>this._hideElement(),this._element,e)}accept(e){e=e||this._element;const t=this._getRootElement(e);this._triggerCloseEvent(t).defaultPrevented||(this._setCookieEU(),this.hide())}static clearCookie(){"undefined"!=typeof document&&(document.cookie=Sn+"=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;")}_isAnimated(){return this._element.classList.contains("fade")}_showElement(){const e=this._isAnimated();this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-live","polite"),e&&vi(this._element),this._element.classList.add(In);this._queueCallback(()=>{this._isTransitioning=!1},this._element,e)}_hideElement(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-live"),this._isTransitioning=!1}_setCookieEU(){var e=new Date;e.setDate(e.getDate()+30);var t=escape("true")+"; expires="+e.toUTCString();"undefined"!=typeof document&&(document.cookie=Sn+"="+t+"; path=/; SameSite=Strict")}_getRootElement(e){const t=di(e);let i=null;return t&&(i=t),i||(i=e.closest(".cookiebar")),i}_triggerCloseEvent(e){return Bi.trigger(e,En)}_removeElement(e){e.classList.remove(In),e.setAttribute("aria-hidden","true"),e.setAttribute("aria-live","off"),Bi.trigger(e,Cn),this.dispose()}static _handleAccept(e){return function(t){t&&t.preventDefault(),e.close(this)}}static _handleConsent(e){return function(t){t&&t.preventDefault(),e.close(this)}}static _getCookieEU(){if("undefined"!=typeof document){var e,t,i,n=document.cookie.split(";");for(e=0;e<n.length;e++)if(t=n[e].substring(0,n[e].indexOf("=")),i=n[e].substring(n[e].indexOf("=")+1),(t=t.replace(/^\s+|\s+$/g,""))==Sn)return unescape(i)}}}"undefined"!=typeof window&&"undefined"!=typeof document&&(Bi.on(document,xn,'[data-bs-accept="cookiebar"]',function(e){if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),gi(this))return;const t=di(this)||this.closest(`.${bn}`);An.getOrCreateInstance(t).accept()}),Bi.on(window,kn,function(){if(!An._getCookieEU()){if("undefined"==typeof document)return;document.querySelectorAll(".cookiebar").forEach(e=>{An.getOrCreateInstance(e).show()})}}));const Ln=()=>{if("undefined"!=typeof window)return window.matchMedia("(max-width: 991px)").matches},Pn=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",On=".sticky-top",Dn="padding-right",Mn="margin-right";class Nn{constructor(){this._element=document.body}getWidth(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,Dn,t=>t+e),this._setElementAttributes(Pn,Dn,t=>t+e),this._setElementAttributes(On,Mn,t=>t-e)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,Dn),this._resetElementAttributes(Pn,Dn),this._resetElementAttributes(On,Mn)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,i){const n=this.getWidth();this._applyManipulationCallback(e,e=>{if(e!==this._element&&window.innerWidth>e.clientWidth+n)return;this._saveInitialAttribute(e,t);const s=window.getComputedStyle(e).getPropertyValue(t);e.style.setProperty(t,`${i(Number.parseFloat(s))}px`)})}_saveInitialAttribute(e,t){const i=e.style.getPropertyValue(t);i&&qi.setDataAttribute(e,t,i)}_resetElementAttributes(e,t){this._applyManipulationCallback(e,e=>{const i=qi.getDataAttribute(e,t);null!==i?(qi.removeDataAttribute(e,t),e.style.setProperty(t,i)):e.style.removeProperty(t)})}_applyManipulationCallback(e,t){if(pi(e))t(e);else for(const i of zi.find(e,this._element))t(i)}}const Rn=".bs.focustrap",Fn=`focusin${Rn}`,Bn=`keydown.tab${Rn}`,Un="backward",jn={autofocus:!0,trapElement:null,initialFocus:null},$n={autofocus:"boolean",trapElement:"element",initialFocus:"(null|element|string|function)"};class qn extends Vi{constructor(e){super(),this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null,this._affectedElements=[]}static get Default(){return jn}static get DefaultType(){return $n}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._setInitialFocus(),Bi.off(document,Rn),Bi.on(document,Fn,e=>this._handleFocusin(e)),Bi.on(document,Bn,e=>this._handleKeydown(e)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,Bi.off(document,Rn))}_setInitialFocus(){if(this._config.initialFocus){let e;e="function"==typeof this._config.initialFocus?this._config.initialFocus():this._config.initialFocus,e&&"function"==typeof e.focus?e.focus():this._config.trapElement.focus()}else this._config.trapElement.focus()}_handleFocusin(e){const{trapElement:t}=this._config;if(e.target===document||e.target===t||t.contains(e.target))return;const i=zi.focusableChildren(t);0===i.length?t.focus():this._lastTabNavDirection===Un?i[i.length-1].focus():i[0].focus()}_handleKeydown(e){"Tab"===e.key&&(this._lastTabNavDirection=e.shiftKey?Un:"forward")}}const Vn="backdrop",Hn="show",zn=`mousedown.bs.${Vn}`,Wn={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},Gn={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class Xn extends Vi{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return Wn}static get DefaultType(){return Gn}static get NAME(){return Vn}show(e){if(!this._config.isVisible)return void Ti(e);this._append();const t=this._getElement();this._config.isAnimated&&vi(t),t.classList.add(Hn),this._emulateAnimation(()=>{Ti(e)})}hide(e){this._config.isVisible?(this._getElement().classList.remove(Hn),this._emulateAnimation(()=>{this.dispose(),Ti(e)})):Ti(e)}dispose(){this._isAppended&&(Bi.off(this._element,zn),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add("fade"),this._element=e}return this._element}_configAfterMerge(e){return e.rootElement=fi(e.rootElement),e}_append(){if(this._isAppended)return;const e=this._getElement();this._config.rootElement.append(e),Bi.on(e,zn,()=>{Ti(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(e){wi(e,this._getElement(),this._config.isAnimated)}}const Kn=".bs.navbarcollapsible",Yn=`click${Kn}.data-api`,Qn=`click${Kn}`,Jn=`keydown${Kn}`,Zn=`hide${Kn}`,es=`hidden${Kn}`,ts=`show${Kn}`,is=`shown${Kn}`,ns=`resize${Kn}`,ss="navbar-open",rs="show",as="expanded",os='[data-bs-toggle="navbarcollapsible"]',ls=".close-menu",us=".nav-link",cs=".nav-item .list-item",hs=".it-heading-link",ds=".it-footer-link",ps={backdrop:!0,focus:!0},fs={backdrop:"(boolean|string)",focus:"boolean"};class ms extends Hi{constructor(e,t){super(e,t),this._mainElement=zi.findOne("main"),this._isNavbarOutsideMain=this._mainElement&&!this._mainElement.contains(this._element),this._parentElement=this._element.parentNode,this._isShown=this._element.classList.contains(as),this._element.getAttribute("tabindex")||this._element.setAttribute("tabindex","-1"),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._scrollBar=new Nn,this._isTransitioning=!1,this._isMobile=Ln(),this._btnClose=zi.findOne(".close-div button",this._element),this._btnBack=zi.findOne(".it-back-button",this._element),this._menuWrapper=zi.findOne(".menu-wrapper",this._element),this._menuItems=zi.find([us,cs,hs,ds,ls].join(","),this._element),this._toggleButton=zi.findOne(`${os}[data-bs-target="#${this._element.id}"]`)||zi.findOne(`${os}[href="#${this._element.id}"]`),this._toggleButton&&(this._toggleButton.getAttribute("aria-expanded")||this._toggleButton.setAttribute("aria-expanded",this._isShown?"true":"false")),this._bindEvents()}static get Default(){return ps}static get DefaultType(){return fs}static get NAME(){return"navbarcollapsible"}toggle(e){this._isShown?this.hide():this.show(e)}show(e){if(this._isShown||this._isTransitioning)return;Bi.trigger(this._element,ts,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),this._btnBack&&this._btnBack.classList.add(rs),document.body.classList.add(ss),this._backdrop.show(),this._showElement(),this._toggleButton&&this._toggleButton.setAttribute("aria-expanded","true"))}hide(){if(!this._isShown||this._isTransitioning)return;Bi.trigger(this._element,Zn).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._btnBack&&this._btnBack.classList.remove(rs),this._element.classList.remove(as),this._backdrop.hide(),this._queueCallback(()=>this._hideElement(),this._menuWrapper,this._isAnimated()),this._toggleButton&&this._toggleButton.setAttribute("aria-expanded","false"))}dispose(){"undefined"!=typeof window&&"undefined"!=typeof document&&(Bi.off(window,ns),Bi.off(document,Jn)),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){return new Xn({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated(),className:"navbar-backdrop",rootElement:this._parentElement,clickCallback:()=>{this.hide()}})}_initializeFocusTrap(){return new qn({trapElement:this._element,initialFocus:()=>this._btnClose||this._element.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')})}_bindEvents(){"undefined"!=typeof window&&"undefined"!=typeof document&&(Bi.on(window,ns,()=>this._onResize()),Bi.on(document,Jn,e=>{this._isShown&&"Escape"===e.key&&this.hide()}),Bi.on(this._btnClose,Qn,e=>{e.preventDefault(),this.hide()}),Bi.on(this._btnBack,Qn,e=>{e.preventDefault(),this.hide()}),this._menuItems.forEach(e=>{Bi.on(e,Jn,e=>this._isMobile&&this._onMenuItemKeyDown(e))}))}_onResize(){this._isMobile=Ln()}_onMenuItemKeyDown(e){"Escape"===e.key&&this.hide()}_isAnimated(){return!0}_isElementHidden(e){return null===e.offsetParent}_showElement(){this._element.style.display="block",this._element.getAttribute("aria-label")||this._element.getAttribute("aria-labelledby")||this._element.setAttribute("aria-label","Menu"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._mainElement&&this._isNavbarOutsideMain&&this._mainElement.setAttribute("inert",""),vi(this._element),this._element.classList.add(as);this._queueCallback(()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,Bi.trigger(this._element,is)},this._menuWrapper,this._isAnimated())}_hideElement(){this._element.style.display="none",this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),document.body.classList.remove(ss),this._mainElement&&this._isNavbarOutsideMain&&this._mainElement.removeAttribute("inert"),this._scrollBar.reset(),this._isTransitioning=!1,Bi.trigger(this._element,es)}}"undefined"!=typeof window&&"undefined"!=typeof document&&Bi.on(document,Yn,os,function(e){const t=di(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),Bi.one(t,ts,e=>{e.defaultPrevented||Bi.one(t,es,()=>{mi(this)&&this.focus()})});ms.getOrCreateInstance(t).toggle(this)});const gs=(e,t,i)=>{i={isDirectionTop:!1,isLimit:!1,loop:!1,..."object"==typeof i?i:{}};const n=((e,t)=>{let i=null;return t.forEach((t,n)=>{t===e&&(i=n)}),i})(e,t);let s=null;if(i.isLimit&&i.isDirectionTop&&n>0)s=t[0];else if(i.isLimit&&n<t.length-1)s=t[t.length-1];else if(i.isDirectionTop){if(!i.loop&&0===n)return;s=t[0===n?t.length-1:n-1]}else{if(!i.loop&&n===t.length-1)return;s=t[n===t.length-1?0:n+1]}s&&s.focus()},ys=".bs.accordion",_s=`keydown${ys}`,vs=`keydown${ys}.data-api`,bs='.accordion-item > .accordion-header [data-bs-toggle="collapse"]';class Ts extends Hi{constructor(e){super(e),this._bindEvents()}static get NAME(){return"accordion"}handleKeyDown(e,t,i){const n={ArrowDown:e=>this._focusNext(e),ArrowUp:e=>this._focusPrev(e),Home:e=>this._focusFirst(e),End:e=>this._focusLast(e)};"function"==typeof n[e]&&(i&&i.preventDefault(),n[e](t))}_bindEvents(){zi.find(bs,this._element).forEach(e=>{Bi.on(e,_s,e=>{this.handleKeyDown(e.key,e.currentTarget,e)})})}_getHeadButtons(){return zi.find(":scope > "+bs,this._element)}_focusNext(e){gs(e,this._getHeadButtons(),{loop:!0})}_focusPrev(e){gs(e,this._getHeadButtons(),{isDirectionTop:!0,loop:!0})}_focusFirst(e){gs(e,this._getHeadButtons(),{isDirectionTop:!0,isLimit:!0})}_focusLast(e){gs(e,this._getHeadButtons(),{isLimit:!0})}}"undefined"!=typeof window&&"undefined"!=typeof document&&Bi.on(document,vs,bs,function(e){const t=this.closest(".accordion");if(t){Ts.getOrCreateInstance(t).handleKeyDown(e.key,this,e)}});const ws=[];for(let e=0;e<256;++e)ws.push((e+256).toString(16).slice(1));const Ss=new Uint8Array(16);function Es(e,t,i){return crypto.randomUUID?crypto.randomUUID():function(e){e=e||{};const t=e.random??e.rng?.()??crypto.getRandomValues(Ss);if(t.length<16)throw new Error("Random bytes length must be >= 16");return t[6]=15&t[6]|64,t[8]=63&t[8]|128,function(e,t=0){return(ws[e[t+0]]+ws[e[t+1]]+ws[e[t+2]]+ws[e[t+3]]+"-"+ws[e[t+4]]+ws[e[t+5]]+"-"+ws[e[t+6]]+ws[e[t+7]]+"-"+ws[e[t+8]]+ws[e[t+9]]+"-"+ws[e[t+10]]+ws[e[t+11]]+ws[e[t+12]]+ws[e[t+13]]+ws[e[t+14]]+ws[e[t+15]]).toLowerCase()}(t)}(e)}let Cs=!1,ks=[];class xs{constructor(e,t){this.id=e,this._callback=t}dispose(){Is(this.id)}_execute(e){this._callback(e)}}const Is=e=>{ks=ks.filter(t=>t.id!==e)},As=e=>{if("undefined"!=typeof document){if(ks.length||"undefined"!=typeof window&&"undefined"!=typeof document&&document.addEventListener("scroll",e=>{Cs||(window.requestAnimationFrame(()=>{ks.forEach(t=>t.cb._execute(e)),Cs=!1}),Cs=!0)}),"function"==typeof e){const t=new xs(Es(),e);return ks.push({id:t.id,cb:t}),t}return console.error("[onDocumentScroll] the provided data has to be of type function"),null}};var Ls={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0},Ps={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},Os=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],Ds={CSS:{},springs:{}};function Ms(e,t,i){return Math.min(Math.max(e,t),i)}function Ns(e,t){return e.indexOf(t)>-1}function Rs(e,t){return e.apply(null,t)}var Fs={arr:function(e){return Array.isArray(e)},obj:function(e){return Ns(Object.prototype.toString.call(e),"Object")},pth:function(e){return Fs.obj(e)&&e.hasOwnProperty("totalLength")},svg:function(e){return e instanceof SVGElement},inp:function(e){return e instanceof HTMLInputElement},dom:function(e){return e.nodeType||Fs.svg(e)},str:function(e){return"string"==typeof e},fnc:function(e){return"function"==typeof e},und:function(e){return void 0===e},nil:function(e){return Fs.und(e)||null===e},hex:function(e){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(e)},rgb:function(e){return/^rgb/.test(e)},hsl:function(e){return/^hsl/.test(e)},col:function(e){return Fs.hex(e)||Fs.rgb(e)||Fs.hsl(e)},key:function(e){return!Ls.hasOwnProperty(e)&&!Ps.hasOwnProperty(e)&&"targets"!==e&&"keyframes"!==e}};function Bs(e){var t=/\(([^)]+)\)/.exec(e);return t?t[1].split(",").map(function(e){return parseFloat(e)}):[]}function Us(e,t){var i=Bs(e),n=Ms(Fs.und(i[0])?1:i[0],.1,100),s=Ms(Fs.und(i[1])?100:i[1],.1,100),r=Ms(Fs.und(i[2])?10:i[2],.1,100),a=Ms(Fs.und(i[3])?0:i[3],.1,100),o=Math.sqrt(s/n),l=r/(2*Math.sqrt(s*n)),u=l<1?o*Math.sqrt(1-l*l):0,c=l<1?(l*o-a)/u:-a+o;function h(e){var i=t?t*e/1e3:e;return i=l<1?Math.exp(-i*l*o)*(1*Math.cos(u*i)+c*Math.sin(u*i)):(1+c*i)*Math.exp(-i*o),0===e||1===e?e:1-i}return t?h:function(){var t=Ds.springs[e];if(t)return t;for(var i=1/6,n=0,s=0;;)if(1===h(n+=i)){if(++s>=16)break}else s=0;var r=n*i*1e3;return Ds.springs[e]=r,r}}function js(e){return void 0===e&&(e=10),function(t){return Math.ceil(Ms(t,1e-6,1)*e)*(1/e)}}var $s,qs,Vs=function(){var e=.1;function t(e,t){return 1-3*t+3*e}function i(e,t){return 3*t-6*e}function n(e){return 3*e}function s(e,s,r){return((t(s,r)*e+i(s,r))*e+n(s))*e}function r(e,s,r){return 3*t(s,r)*e*e+2*i(s,r)*e+n(s)}return function(t,i,n,a){if(0<=t&&t<=1&&0<=n&&n<=1){var o=new Float32Array(11);if(t!==i||n!==a)for(var l=0;l<11;++l)o[l]=s(l*e,t,n);return function(e){return t===i&&n===a||0===e||1===e?e:s(u(e),i,a)}}function u(i){for(var a=0,l=1;10!==l&&o[l]<=i;++l)a+=e;--l;var u=a+(i-o[l])/(o[l+1]-o[l])*e,c=r(u,t,n);return c>=.001?function(e,t,i,n){for(var a=0;a<4;++a){var o=r(t,i,n);if(0===o)return t;t-=(s(t,i,n)-e)/o}return t}(i,u,t,n):0===c?u:function(e,t,i,n,r){var a,o,l=0;do{(a=s(o=t+(i-t)/2,n,r)-e)>0?i=o:t=o}while(Math.abs(a)>1e-7&&++l<10);return o}(i,a,a+e,t,n)}}}(),Hs=($s={linear:function(){return function(e){return e}}},qs={Sine:function(){return function(e){return 1-Math.cos(e*Math.PI/2)}},Expo:function(){return function(e){return e?Math.pow(2,10*e-10):0}},Circ:function(){return function(e){return 1-Math.sqrt(1-e*e)}},Back:function(){return function(e){return e*e*(3*e-2)}},Bounce:function(){return function(e){for(var t,i=4;e<((t=Math.pow(2,--i))-1)/11;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*t-2)/22-e,2)}},Elastic:function(e,t){void 0===e&&(e=1),void 0===t&&(t=.5);var i=Ms(e,1,10),n=Ms(t,.1,2);return function(e){return 0===e||1===e?e:-i*Math.pow(2,10*(e-1))*Math.sin((e-1-n/(2*Math.PI)*Math.asin(1/i))*(2*Math.PI)/n)}}},["Quad","Cubic","Quart","Quint"].forEach(function(e,t){qs[e]=function(){return function(e){return Math.pow(e,t+2)}}}),Object.keys(qs).forEach(function(e){var t=qs[e];$s["easeIn"+e]=t,$s["easeOut"+e]=function(e,i){return function(n){return 1-t(e,i)(1-n)}},$s["easeInOut"+e]=function(e,i){return function(n){return n<.5?t(e,i)(2*n)/2:1-t(e,i)(-2*n+2)/2}},$s["easeOutIn"+e]=function(e,i){return function(n){return n<.5?(1-t(e,i)(1-2*n))/2:(t(e,i)(2*n-1)+1)/2}}}),$s);function zs(e,t){if(Fs.fnc(e))return e;var i=e.split("(")[0],n=Hs[i],s=Bs(e);switch(i){case"spring":return Us(e,t);case"cubicBezier":return Rs(Vs,s);case"steps":return Rs(js,s);default:return Rs(n,s)}}function Ws(e){try{return document.querySelectorAll(e)}catch(e){return}}function Gs(e,t){for(var i=e.length,n=arguments.length>=2?arguments[1]:void 0,s=[],r=0;r<i;r++)if(r in e){var a=e[r];t.call(n,a,r,e)&&s.push(a)}return s}function Xs(e){return e.reduce(function(e,t){return e.concat(Fs.arr(t)?Xs(t):t)},[])}function Ks(e){return Fs.arr(e)?e:(Fs.str(e)&&(e=Ws(e)||e),e instanceof NodeList||e instanceof HTMLCollection?[].slice.call(e):[e])}function Ys(e,t){return e.some(function(e){return e===t})}function Qs(e){var t={};for(var i in e)t[i]=e[i];return t}function Js(e,t){var i=Qs(e);for(var n in e)i[n]=t.hasOwnProperty(n)?t[n]:e[n];return i}function Zs(e,t){var i=Qs(e);for(var n in t)i[n]=Fs.und(e[n])?t[n]:e[n];return i}function er(e){return Fs.rgb(e)?(i=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(t=e))?"rgba("+i[1]+",1)":t:Fs.hex(e)?function(e){var t=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(e,t,i,n){return t+t+i+i+n+n}),i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return"rgba("+parseInt(i[1],16)+","+parseInt(i[2],16)+","+parseInt(i[3],16)+",1)"}(e):Fs.hsl(e)?function(e){var t,i,n,s=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(e),r=parseInt(s[1],10)/360,a=parseInt(s[2],10)/100,o=parseInt(s[3],10)/100,l=s[4]||1;function u(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e}if(0==a)t=i=n=o;else{var c=o<.5?o*(1+a):o+a-o*a,h=2*o-c;t=u(h,c,r+1/3),i=u(h,c,r),n=u(h,c,r-1/3)}return"rgba("+255*t+","+255*i+","+255*n+","+l+")"}(e):void 0;var t,i}function tr(e){var t=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(e);if(t)return t[1]}function ir(e,t){return Fs.fnc(e)?e(t.target,t.id,t.total):e}function nr(e,t){return e.getAttribute(t)}function sr(e,t,i){if(Ys([i,"deg","rad","turn"],tr(t)))return t;var n=Ds.CSS[t+i];if(!Fs.und(n))return n;var s=document.createElement(e.tagName),r=e.parentNode&&e.parentNode!==document?e.parentNode:document.body;r.appendChild(s),s.style.position="absolute",s.style.width=100+i;var a=100/s.offsetWidth;r.removeChild(s);var o=a*parseFloat(t);return Ds.CSS[t+i]=o,o}function rr(e,t,i){if(t in e.style){var n=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),s=e.style[t]||getComputedStyle(e).getPropertyValue(n)||"0";return i?sr(e,s,i):s}}function ar(e,t){return Fs.dom(e)&&!Fs.inp(e)&&(!Fs.nil(nr(e,t))||Fs.svg(e)&&e[t])?"attribute":Fs.dom(e)&&Ys(Os,t)?"transform":Fs.dom(e)&&"transform"!==t&&rr(e,t)?"css":null!=e[t]?"object":void 0}function or(e){if(Fs.dom(e)){for(var t,i=e.style.transform||"",n=/(\w+)\(([^)]*)\)/g,s=new Map;t=n.exec(i);)s.set(t[1],t[2]);return s}}function lr(e,t,i,n){var s=Ns(t,"scale")?1:0+function(e){return Ns(e,"translate")||"perspective"===e?"px":Ns(e,"rotate")||Ns(e,"skew")?"deg":void 0}(t),r=or(e).get(t)||s;return i&&(i.transforms.list.set(t,r),i.transforms.last=t),n?sr(e,r,n):r}function ur(e,t,i,n){switch(ar(e,t)){case"transform":return lr(e,t,n,i);case"css":return rr(e,t,i);case"attribute":return nr(e,t);default:return e[t]||0}}function cr(e,t){var i=/^(\*=|\+=|-=)/.exec(e);if(!i)return e;var n=tr(e)||0,s=parseFloat(t),r=parseFloat(e.replace(i[0],""));switch(i[0][0]){case"+":return s+r+n;case"-":return s-r+n;case"*":return s*r+n}}function hr(e,t){if(Fs.col(e))return er(e);if(/\s/g.test(e))return e;var i=tr(e),n=i?e.substr(0,e.length-i.length):e;return t?n+t:n}function dr(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function pr(e){for(var t,i=e.points,n=0,s=0;s<i.numberOfItems;s++){var r=i.getItem(s);s>0&&(n+=dr(t,r)),t=r}return n}function fr(e){if(e.getTotalLength)return e.getTotalLength();switch(e.tagName.toLowerCase()){case"circle":return function(e){return 2*Math.PI*nr(e,"r")}(e);case"rect":return function(e){return 2*nr(e,"width")+2*nr(e,"height")}(e);case"line":return function(e){return dr({x:nr(e,"x1"),y:nr(e,"y1")},{x:nr(e,"x2"),y:nr(e,"y2")})}(e);case"polyline":return pr(e);case"polygon":return function(e){var t=e.points;return pr(e)+dr(t.getItem(t.numberOfItems-1),t.getItem(0))}(e)}}function mr(e,t){var i=t||{},n=i.el||function(e){for(var t=e.parentNode;Fs.svg(t)&&Fs.svg(t.parentNode);)t=t.parentNode;return t}(e),s=n.getBoundingClientRect(),r=nr(n,"viewBox"),a=s.width,o=s.height,l=i.viewBox||(r?r.split(" "):[0,0,a,o]);return{el:n,viewBox:l,x:l[0]/1,y:l[1]/1,w:a,h:o,vW:l[2],vH:l[3]}}function gr(e,t,i){function n(i){void 0===i&&(i=0);var n=t+i>=1?t+i:0;return e.el.getPointAtLength(n)}var s=mr(e.el,e.svg),r=n(),a=n(-1),o=n(1),l=i?1:s.w/s.vW,u=i?1:s.h/s.vH;switch(e.property){case"x":return(r.x-s.x)*l;case"y":return(r.y-s.y)*u;case"angle":return 180*Math.atan2(o.y-a.y,o.x-a.x)/Math.PI}}function yr(e,t){var i=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,n=hr(Fs.pth(e)?e.totalLength:e,t)+"";return{original:n,numbers:n.match(i)?n.match(i).map(Number):[0],strings:Fs.str(e)||t?n.split(i):[]}}function _r(e){return Gs(e?Xs(Fs.arr(e)?e.map(Ks):Ks(e)):[],function(e,t,i){return i.indexOf(e)===t})}function vr(e){var t=_r(e);return t.map(function(e,i){return{target:e,id:i,total:t.length,transforms:{list:or(e)}}})}function br(e,t){var i=Qs(t);if(/^spring/.test(i.easing)&&(i.duration=Us(i.easing)),Fs.arr(e)){var n=e.length;2===n&&!Fs.obj(e[0])?e={value:e}:Fs.fnc(t.duration)||(i.duration=t.duration/n)}var s=Fs.arr(e)?e:[e];return s.map(function(e,i){var n=Fs.obj(e)&&!Fs.pth(e)?e:{value:e};return Fs.und(n.delay)&&(n.delay=i?0:t.delay),Fs.und(n.endDelay)&&(n.endDelay=i===s.length-1?t.endDelay:0),n}).map(function(e){return Zs(e,i)})}function Tr(e,t){var i=[],n=t.keyframes;for(var s in n&&(t=Zs(function(e){for(var t=Gs(Xs(e.map(function(e){return Object.keys(e)})),function(e){return Fs.key(e)}).reduce(function(e,t){return e.indexOf(t)<0&&e.push(t),e},[]),i={},n=function(n){var s=t[n];i[s]=e.map(function(e){var t={};for(var i in e)Fs.key(i)?i==s&&(t.value=e[i]):t[i]=e[i];return t})},s=0;s<t.length;s++)n(s);return i}(n),t)),t)Fs.key(s)&&i.push({name:s,tweens:br(t[s],e)});return i}function wr(e,t){var i;return e.tweens.map(function(n){var s=function(e,t){var i={};for(var n in e){var s=ir(e[n],t);Fs.arr(s)&&1===(s=s.map(function(e){return ir(e,t)})).length&&(s=s[0]),i[n]=s}return i.duration=parseFloat(i.duration),i.delay=parseFloat(i.delay),i}(n,t),r=s.value,a=Fs.arr(r)?r[1]:r,o=tr(a),l=ur(t.target,e.name,o,t),u=i?i.to.original:l,c=Fs.arr(r)?r[0]:u,h=tr(c)||tr(l),d=o||h;return Fs.und(a)&&(a=u),s.from=yr(c,d),s.to=yr(cr(a,c),d),s.start=i?i.end:0,s.end=s.start+s.delay+s.duration+s.endDelay,s.easing=zs(s.easing,s.duration),s.isPath=Fs.pth(r),s.isPathTargetInsideSVG=s.isPath&&Fs.svg(t.target),s.isColor=Fs.col(s.from.original),s.isColor&&(s.round=1),i=s,s})}var Sr={css:function(e,t,i){return e.style[t]=i},attribute:function(e,t,i){return e.setAttribute(t,i)},object:function(e,t,i){return e[t]=i},transform:function(e,t,i,n,s){if(n.list.set(t,i),t===n.last||s){var r="";n.list.forEach(function(e,t){r+=t+"("+e+") "}),e.style.transform=r}}};function Er(e,t){vr(e).forEach(function(e){for(var i in t){var n=ir(t[i],e),s=e.target,r=tr(n),a=ur(s,i,r,e),o=cr(hr(n,r||tr(a)),a),l=ar(s,i);Sr[l](s,i,o,e.transforms,!0)}})}function Cr(e,t){return Gs(Xs(e.map(function(e){return t.map(function(t){return function(e,t){var i=ar(e.target,t.name);if(i){var n=wr(t,e),s=n[n.length-1];return{type:i,property:t.name,animatable:e,tweens:n,duration:s.end,delay:n[0].delay,endDelay:s.endDelay}}}(e,t)})})),function(e){return!Fs.und(e)})}function kr(e,t){var i=e.length,n=function(e){return e.timelineOffset?e.timelineOffset:0},s={};return s.duration=i?Math.max.apply(Math,e.map(function(e){return n(e)+e.duration})):t.duration,s.delay=i?Math.min.apply(Math,e.map(function(e){return n(e)+e.delay})):t.delay,s.endDelay=i?s.duration-Math.max.apply(Math,e.map(function(e){return n(e)+e.duration-e.endDelay})):t.endDelay,s}var xr=0;var Ir=[],Ar=function(){var e;function t(i){for(var n=Ir.length,s=0;s<n;){var r=Ir[s];r.paused?(Ir.splice(s,1),n--):(r.tick(i),s++)}e=s>0?requestAnimationFrame(t):void 0}return"undefined"!=typeof document&&document.addEventListener("visibilitychange",function(){Pr.suspendWhenDocumentHidden&&(Lr()?e=cancelAnimationFrame(e):(Ir.forEach(function(e){return e._onDocumentVisibility()}),Ar()))}),function(){e||Lr()&&Pr.suspendWhenDocumentHidden||!(Ir.length>0)||(e=requestAnimationFrame(t))}}();function Lr(){return!!document&&document.hidden}function Pr(e){void 0===e&&(e={});var t,i=0,n=0,s=0,r=0,a=null;function o(e){var t=window.Promise&&new Promise(function(e){return a=e});return e.finished=t,t}var l=function(e){var t=Js(Ls,e),i=Js(Ps,e),n=Tr(i,e),s=vr(e.targets),r=Cr(s,n),a=kr(r,i),o=xr;return xr++,Zs(t,{id:o,children:[],animatables:s,animations:r,duration:a.duration,delay:a.delay,endDelay:a.endDelay})}(e);function u(){var e=l.direction;"alternate"!==e&&(l.direction="normal"!==e?"normal":"reverse"),l.reversed=!l.reversed,t.forEach(function(e){return e.reversed=l.reversed})}function c(e){return l.reversed?l.duration-e:e}function h(){i=0,n=c(l.currentTime)*(1/Pr.speed)}function d(e,t){t&&t.seek(e-t.timelineOffset)}function p(e){for(var t=0,i=l.animations,n=i.length;t<n;){var s=i[t],r=s.animatable,a=s.tweens,o=a.length-1,u=a[o];o&&(u=Gs(a,function(t){return e<t.end})[0]||u);for(var c=Ms(e-u.start-u.delay,0,u.duration)/u.duration,h=isNaN(c)?1:u.easing(c),d=u.to.strings,p=u.round,f=[],m=u.to.numbers.length,g=void 0,y=0;y<m;y++){var _=void 0,v=u.to.numbers[y],b=u.from.numbers[y]||0;_=u.isPath?gr(u.value,h*v,u.isPathTargetInsideSVG):b+h*(v-b),p&&(u.isColor&&y>2||(_=Math.round(_*p)/p)),f.push(_)}var T=d.length;if(T){g=d[0];for(var w=0;w<T;w++){d[w];var S=d[w+1],E=f[w];isNaN(E)||(g+=S?E+S:E+" ")}}else g=f[0];Sr[s.type](r.target,s.property,g,r.transforms),s.currentValue=g,t++}}function f(e){l[e]&&!l.passThrough&&l[e](l)}function m(e){var h=l.duration,m=l.delay,g=h-l.endDelay,y=c(e);l.progress=Ms(y/h*100,0,100),l.reversePlayback=y<l.currentTime,t&&function(e){if(l.reversePlayback)for(var i=r;i--;)d(e,t[i]);else for(var n=0;n<r;n++)d(e,t[n])}(y),!l.began&&l.currentTime>0&&(l.began=!0,f("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,f("loopBegin")),y<=m&&0!==l.currentTime&&p(0),(y>=g&&l.currentTime!==h||!h)&&p(h),y>m&&y<g?(l.changeBegan||(l.changeBegan=!0,l.changeCompleted=!1,f("changeBegin")),f("change"),p(y)):l.changeBegan&&(l.changeCompleted=!0,l.changeBegan=!1,f("changeComplete")),l.currentTime=Ms(y,0,h),l.began&&f("update"),e>=h&&(n=0,l.remaining&&!0!==l.remaining&&l.remaining--,l.remaining?(i=s,f("loopComplete"),l.loopBegan=!1,"alternate"===l.direction&&u()):(l.paused=!0,l.completed||(l.completed=!0,f("loopComplete"),f("complete"),!l.passThrough&&"Promise"in window&&(a(),o(l)))))}return o(l),l.reset=function(){var e=l.direction;l.passThrough=!1,l.currentTime=0,l.progress=0,l.paused=!0,l.began=!1,l.loopBegan=!1,l.changeBegan=!1,l.completed=!1,l.changeCompleted=!1,l.reversePlayback=!1,l.reversed="reverse"===e,l.remaining=l.loop,t=l.children;for(var i=r=t.length;i--;)l.children[i].reset();(l.reversed&&!0!==l.loop||"alternate"===e&&1===l.loop)&&l.remaining++,p(l.reversed?l.duration:0)},l._onDocumentVisibility=h,l.set=function(e,t){return Er(e,t),l},l.tick=function(e){s=e,i||(i=s),m((s+(n-i))*Pr.speed)},l.seek=function(e){m(c(e))},l.pause=function(){l.paused=!0,h()},l.play=function(){l.paused&&(l.completed&&l.reset(),l.paused=!1,Ir.push(l),h(),Ar())},l.reverse=function(){u(),l.completed=!l.reversed,h()},l.restart=function(){l.reset(),l.play()},l.remove=function(e){Dr(_r(e),l)},l.reset(),l.autoplay&&l.play(),l}function Or(e,t){for(var i=t.length;i--;)Ys(e,t[i].animatable.target)&&t.splice(i,1)}function Dr(e,t){var i=t.animations,n=t.children;Or(e,i);for(var s=n.length;s--;){var r=n[s],a=r.animations;Or(e,a),a.length||r.children.length||n.splice(s,1)}i.length||n.length||t.pause()}Pr.version="3.2.1",Pr.speed=1,Pr.suspendWhenDocumentHidden=!0,Pr.running=Ir,Pr.remove=function(e){for(var t=_r(e),i=Ir.length;i--;){Dr(t,Ir[i])}},Pr.get=ur,Pr.set=Er,Pr.convertPx=sr,Pr.path=function(e,t){var i=Fs.str(e)?Ws(e)[0]:e,n=t||100;return function(e){return{property:e,el:i,svg:mr(i),totalLength:fr(i)*(n/100)}}},Pr.setDashoffset=function(e){var t=fr(e);return e.setAttribute("stroke-dasharray",t),t},Pr.stagger=function(e,t){void 0===t&&(t={});var i=t.direction||"normal",n=t.easing?zs(t.easing):null,s=t.grid,r=t.axis,a=t.from||0,o="first"===a,l="center"===a,u="last"===a,c=Fs.arr(e),h=c?parseFloat(e[0]):parseFloat(e),d=c?parseFloat(e[1]):0,p=tr(c?e[1]:e)||0,f=t.start||0+(c?h:0),m=[],g=0;return function(e,t,y){if(o&&(a=0),l&&(a=(y-1)/2),u&&(a=y-1),!m.length){for(var _=0;_<y;_++){if(s){var v=l?(s[0]-1)/2:a%s[0],b=l?(s[1]-1)/2:Math.floor(a/s[0]),T=v-_%s[0],w=b-Math.floor(_/s[0]),S=Math.sqrt(T*T+w*w);"x"===r&&(S=-T),"y"===r&&(S=-w),m.push(S)}else m.push(Math.abs(a-_));g=Math.max.apply(Math,m)}n&&(m=m.map(function(e){return n(e/g)*g})),"reverse"===i&&(m=m.map(function(e){return r?e<0?-1*e:-e:Math.abs(g-e)}))}return f+(c?(d-h)/g:h)*(Math.round(100*m[t])/100)+p}},Pr.timeline=function(e){void 0===e&&(e={});var t=Pr(e);return t.duration=0,t.add=function(i,n){var s=Ir.indexOf(t),r=t.children;function a(e){e.passThrough=!0}s>-1&&Ir.splice(s,1);for(var o=0;o<r.length;o++)a(r[o]);var l=Zs(i,Js(Ps,e));l.targets=l.targets||e.targets;var u=t.duration;l.autoplay=!1,l.direction=t.direction,l.timelineOffset=Fs.und(n)?u:cr(n,u),a(t),t.seek(l.timelineOffset);var c=Pr(l);a(c),r.push(c);var h=kr(r,e);return t.delay=h.delay,t.endDelay=h.endDelay,t.duration=h.duration,t.seek(0),t.reset(),t.autoplay&&t.play(),t},t},Pr.easing=zs,Pr.penner=Hs,Pr.random=function(e,t){return Math.floor(Math.random()*(t-e+1))+e};const Mr={duration:800,easing:"easeInOutSine"},Nr=(e,t)=>{if("undefined"==typeof window||"undefined"==typeof document)return;const i=("object"==typeof t?t:{}).complete,n=window.document.scrollingElement||window.document.body||window.document.documentElement,s=n.style.scrollBehavior;t={scrollTop:e||0,...Mr,..."object"==typeof t?t:{}},n.style.scrollBehavior="auto",t.complete=e=>{n.style.scrollBehavior=s,"function"==typeof i&&i(e)},Pr({targets:n,...t})},Rr="active",Fr="ul.link-list",Br="a.nav-link",Ur=`${Br}.${Rr}`,jr=`${Br}[href^="#"]`,$r={scrollPadding:10,duration:800,easing:"easeInOutSine"};class qr extends Hi{constructor(e,t){super(e),this._config=this._getConfig(t),this._togglerElement=zi.findOne(".custom-navbar-toggler",this._element),this._sectionContainer=zi.findOne(".it-page-sections-container"),this._collapsible=this._getCollapsible(),this._isCollapseOpened=!1,this._callbackQueue=[],this._scrollCb=null;const i=zi.findOne(".menu-wrapper",this._element);i&&!i.hasAttribute("tabindex")&&i.setAttribute("tabindex","-1"),this._bindEvents()}static get NAME(){return"navscroll"}setScrollPadding(e){this._config.scrollPadding=e}dispose(){this._scrollCb&&this._scrollCb.dispose(),super.dispose()}_getConfig(e){return e={...$r,...qi.getDataAttributes(this._element),..."object"==typeof e?e:{}}}_bindEvents(){this._scrollCb=As(()=>this._onScroll()),this._collapsible&&(Bi.on(this._collapsible._element,"shown.bs.navbarcollapsible",()=>this._onCollapseOpened()),Bi.on(this._collapsible._element,"hidden.bs.navbarcollapsible",()=>this._onCollapseClosed())),zi.find(jr,this._element).forEach(e=>{e.addEventListener("click",()=>{const t=()=>this._scrollToHash(e.hash);this._isCollapseOpened?(this._callbackQueue.push(t),this._collapsible.hide()):t()})}),"undefined"!=typeof window&&"undefined"!=typeof document&&Bi.on(window,"load",()=>{setTimeout(()=>this._onScroll(),150)})}_onCollapseOpened(){this._isCollapseOpened=!0}_onCollapseClosed(){for(;this._callbackQueue.length>0;){const e=this._callbackQueue.shift();"function"==typeof e&&e()}this._isCollapseOpened=!1}_getParentLinks(e){const t=[];let i=e.closest(Fr),n=null,s=!1;for(;i&&!s;){const e=i.closest("li.nav-link, li.nav-item");if(e){const i=e.querySelector(Br);i&&t.push(i)}n=i,i=(i.parentElement||i).closest(Fr),i===n&&(s=!0)}return t}_decorateToggler(e){if(this._togglerElement){const t=zi.findOne(".it-list",this._togglerElement);this._togglerElement.innerText="",this._togglerElement.textContent="",this._togglerElement.append(t),this._togglerElement.append(e)}}_scrollToHash(e){if(!e||"#"===e)return;const t=this._sectionContainer?zi.findOne(e,this._sectionContainer):zi.findOne(e);t&&(Nr(t.offsetTop-this._getScrollPadding(),{duration:this._config.duration,easing:this._config.easing,complete:()=>{const e=t.matches("h1, h2, h3, h4, h5, h6"),i=!t.hasAttribute("tabindex");i&&t.setAttribute("tabindex","-1"),t.focus({preventScroll:!0}),i&&e&&setTimeout(()=>{t.removeAttribute("tabindex")},500)}}),history.pushState?history.pushState(null,null,e):location.hash=e)}_updateProgress(e){if(!e)return;const t=zi.find(".it-navscroll-progressbar");if(t){const i=Math.abs(e.getBoundingClientRect().top)/e.getBoundingClientRect().height*100,n=Math.min(100,Math.max(0,i));t.forEach(t=>{e.getBoundingClientRect().top<=0?(t.style.width=n+"%",t.setAttribute("aria-valuenow",n)):(t.style.width="0%",t.setAttribute("aria-valuenow",0))})}}_onScroll(){const e=this._sectionContainer?this._sectionContainer.offsetTop:0;if("undefined"==typeof document)return;const t=document.scrollingElement.scrollTop-e,i=zi.find(Br,this._element),n=this._getScrollPadding();zi.find(".it-page-section").forEach((s,r)=>{if(s.offsetTop-e<=t+n&&(zi.find(Ur,this._element).forEach(e=>{e.classList.remove(Rr)}),r<i.length)){const e=i[r];this._getParentLinks(e).forEach(e=>{e.classList.add(Rr)}),e.classList.add(Rr),this._decorateToggler(e.innerText)}}),this._updateProgress(this._sectionContainer)}_getCollapsible(){const e=zi.findOne(".navbar-collapsable",this._element);return e?ms.getOrCreateInstance(e):null}_getScrollPadding(){return"function"==typeof this._config.scrollPadding?this._config.scrollPadding():this._config.scrollPadding}}if("undefined"!=typeof window&&"undefined"!=typeof document){zi.find("[data-bs-navscroll]").map(e=>{qr.getOrCreateInstance(e)})}const Vr=".bs.sticky",Hr=`resize${Vr}`,zr=`on${Vr}`,Wr=`off${Vr}`,Gr="bs-is-sticky",Xr="bs-is-fixed",Kr='[data-bs-toggle="sticky"]',Yr={positionType:"sticky",stickyClassName:"",stackable:!1,paddingTop:0};class Qr extends Hi{constructor(e,t){super(e),this._config=this._getConfig(t),this._isSticky=!1,this._wrapper=null,this._stickyTarget=zi.findOne(hi(this._element),this._element)||this._element,this._stickyTargetMobile=zi.findOne(this._element.getAttribute("data-bs-target-mobile"),this._element)||this._stickyTarget,this._stickyLimit=0,this._stickyLimitMobile=0,this._setLimit(),this._scrollCb=null,this._isMobile=Ln(),this._prevTop=0,this._onScroll(),this._bindEvents()}dispose(){"undefined"!=typeof window&&"undefined"!=typeof document&&(Bi.off(window,Hr),this._scrollCb.dispose(),super.dispose())}static get NAME(){return"sticky"}_getConfig(e){return e={...Yr,...qi.getDataAttributes(this._element),..."object"==typeof e?e:{}}}_bindEvents(){"undefined"!=typeof window&&"undefined"!=typeof document&&(Bi.on(window,Hr,()=>this._onResize()),this._scrollCb=As(()=>this._onScroll()))}_onResize(){this._isMobile=Ln(),this._setLimit()}_onScroll(){this._checkSticky()}_setLimit(){this._stickyLimit=this._cumulativeOffset(this._stickyTarget).top,this._stickyLimitMobile=this._cumulativeOffset(this._stickyTargetMobile).top}_getLimit(){let e=this._isMobile?this._stickyLimitMobile:this._stickyLimit;return this._config.stackable&&this._getStickySimblings().forEach((t,i)=>{const n=t.getBoundingClientRect();e-=n.height+(0===i?parseFloat(t.style.top):0)}),e>0?e:0}_cumulativeOffset(e){let t=0,i=0;do{t+=e.offsetTop||0,i+=e.offsetLeft||0,e=e.offsetParent}while(e);return{top:t,left:i}}_isTypeSticky(){return"sticky"===this._config.positionType}_checkSticky(){this._isSticky||this._setLimit();const e=this._getLimit();"undefined"!=typeof window&&window.pageYOffset>e?this._setSticky():this._unsetSticky()}_setSticky(){if(!this._isSticky){this._isSticky=!0;let e=Gr;this._isTypeSticky()||(e=Xr,this._wrapper=this._createWrapper()),this._element.classList.add(e),this._config.stickyClassName&&this._element.classList.add(this._config.stickyClassName),this._prevTop=this._element.style.top,this._element.style.top=this._getPositionTop()+"px",Bi.trigger(this._element,zr)}}_unsetSticky(){if(this._isSticky){let e=Gr;this._isTypeSticky()||(e=Xr,this._destroyWrapper()),this._element.classList.remove(e),this._config.stickyClassName&&this._element.classList.remove(this._config.stickyClassName),this._element.style.top=this._prevTop,this._isSticky=!1,Bi.trigger(this._element,Wr)}}_createWrapper(){if("undefined"==typeof document)return;const e=document.createElement("div");return e.classList.add("bs-it-sticky-wrapper"),e.style.width="100%",e.style.height=this._element.getBoundingClientRect().height+"px",e.style.overflow="hidden",this._element.parentNode.insertBefore(e,this._element),e.appendChild(this._element),e}_destroyWrapper(){this._wrapper&&(this._wrapper.parentNode.insertBefore(this._element,this._wrapper),this._wrapper.remove())}_getStickySimblings(){return zi.find(Kr).filter(e=>{const t=Qr.getInstance(e);return!(!t||!t._isSticky||e===this._element)})}_getPositionTop(){let e=0;return this._config.stackable?(this._getStickySimblings().forEach((t,i)=>{const n=t.getBoundingClientRect();e+=n.height+(0===i?parseFloat(t.style.top):0)}),e):e+this._config.paddingTop}}"undefined"!=typeof window&&"undefined"!=typeof document&&As(()=>{zi.find(Kr).map(e=>{Qr.getOrCreateInstance(e)})});const Jr="cloned-element",Zr=`.${Jr}`,ea=new Map;class ta{constructor(e){if(ea.get(e))return null;this._element=e,this._elementObj=Qr.getOrCreateInstance(e),ea.set(e,this._elementObj),this._bindEvents(),this._toggleClonedElement(this._element.classList.contains("is-sticky"))}static getOrCreateInstance(e){return ea.get(e)||new this(e)}_bindEvents(){this._element.addEventListener("on.bs.sticky",()=>this._toggleClonedElement(!0)),this._element.addEventListener("off.bs.sticky",()=>this._toggleClonedElement(!1))}_toggleClonedElement(e=!0){if(!mi(zi.findOne(".custom-navbar-toggler",this._element))){const t=zi.findOne(".menu-wrapper",this._element);if(e){const e=zi.findOne(".it-brand-wrapper",this._element),i=zi.findOne(".it-search-wrapper",this._element),n=zi.findOne(".it-user-wrapper",this._element),s=e?e.cloneNode(!0):null,r=i?i.cloneNode(!0):null,a=n?n.cloneNode(!0):null;s&&t.insertBefore(s,t.childNodes[0]).classList.add(Jr),r&&t.appendChild(r).classList.add(Jr),a&&(t.appendChild(a).classList.add(Jr),t.appendChild(a).classList.remove("show"))}else zi.find(Zr,this._element).forEach(e=>{e.parentElement.removeChild(e)})}}}As(()=>{zi.find('.it-header-sticky [data-bs-toggle="sticky"]').map(e=>{ta.getOrCreateInstance(e)})});var ia=Object.defineProperty,na=(e,t,i)=>(((e,t,i)=>{t in e?ia(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i})(e,"symbol"!=typeof t?t+"":t,i),i);const sa=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,ra=/^-?[0-9]\d*$/,aa=/^(?=.*[A-Za-z])(?=.*\d).{8,}$/,oa=/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/,la=e=>"string"!=typeof e||""===e;var ua=(e=>(e.Required="required",e.Email="email",e.MinLength="minLength",e.MaxLength="maxLength",e.Password="password",e.Number="number",e.Integer="integer",e.MaxNumber="maxNumber",e.MinNumber="minNumber",e.StrongPassword="strongPassword",e.CustomRegexp="customRegexp",e.MinFilesCount="minFilesCount",e.MaxFilesCount="maxFilesCount",e.Files="files",e))(ua||{}),ca=(e=>(e.Required="required",e))(ca||{}),ha=(e=>(e.Label="label",e.LabelArrow="labelArrow",e))(ha||{});const da=[{key:ua.Required,dict:{en:"The field is required"}},{key:ua.Email,dict:{en:"Email has invalid format"}},{key:ua.MaxLength,dict:{en:"The field must contain a maximum of :value characters"}},{key:ua.MinLength,dict:{en:"The field must contain a minimum of :value characters"}},{key:ua.Password,dict:{en:"Password must contain minimum eight characters, at least one letter and one number"}},{key:ua.StrongPassword,dict:{en:"Password should contain minimum eight characters, at least one uppercase letter, one lowercase letter, one number and one special character"}},{key:ua.Number,dict:{en:"Value should be a number"}},{key:ua.MaxNumber,dict:{en:"Number should be less or equal than :value"}},{key:ua.MinNumber,dict:{en:"Number should be more or equal than :value"}},{key:ua.MinFilesCount,dict:{en:"Files count should be more or equal than :value"}},{key:ua.MaxFilesCount,dict:{en:"Files count should be less or equal than :value"}},{key:ua.Files,dict:{en:"Uploaded files have one or several invalid properties (extension/size/type etc)."}}],pa=e=>"object"==typeof e&&null!==e&&"then"in e&&"function"==typeof e.then,fa=e=>Array.isArray(e)?e.filter(e=>e.length>0):"string"==typeof e&&e.trim()?[...e.split(" ").filter(e=>e.length>0)]:[],ma=e=>e instanceof Element||e instanceof HTMLDocument,ga={errorFieldStyle:{color:"#b81111",border:"1px solid #B81111"},errorFieldCssClass:"just-validate-error-field",successFieldCssClass:"just-validate-success-field",errorLabelStyle:{color:"#b81111"},errorLabelCssClass:"just-validate-error-label",successLabelCssClass:"just-validate-success-label",focusInvalidField:!0,lockForm:!0,testingMode:!1,validateBeforeSubmitting:!1,submitFormAutomatically:!1};class ya{constructor(e,t,i){na(this,"form",null),na(this,"fields",{}),na(this,"groupFields",{}),na(this,"errors",{}),na(this,"isValid",!1),na(this,"isSubmitted",!1),na(this,"globalConfig",ga),na(this,"errorLabels",{}),na(this,"successLabels",{}),na(this,"eventListeners",[]),na(this,"dictLocale",da),na(this,"currentLocale","en"),na(this,"customStyleTags",{}),na(this,"onSuccessCallback"),na(this,"onFailCallback"),na(this,"onValidateCallback"),na(this,"tooltips",[]),na(this,"lastScrollPosition"),na(this,"isScrollTick"),na(this,"fieldIds",new Map),na(this,"getKeyByFieldSelector",e=>this.fieldIds.get(e)),na(this,"getFieldSelectorByKey",e=>{for(const[t,i]of this.fieldIds)if(e===i)return t}),na(this,"getCompatibleFields",()=>{const e={};return Object.keys(this.fields).forEach(t=>{let i=t;const n=this.getFieldSelectorByKey(t);"string"==typeof n&&(i=n),e[i]={...this.fields[t]}}),e}),na(this,"setKeyByFieldSelector",e=>{if(this.fieldIds.has(e))return this.fieldIds.get(e);const t=String(this.fieldIds.size+1);return this.fieldIds.set(e,t),t}),na(this,"refreshAllTooltips",()=>{this.tooltips.forEach(e=>{e.refresh()})}),na(this,"handleDocumentScroll",()=>{this.lastScrollPosition=window.scrollY,this.isScrollTick||(window.requestAnimationFrame(()=>{this.refreshAllTooltips(),this.isScrollTick=!1}),this.isScrollTick=!0)}),na(this,"formSubmitHandler",e=>{e.preventDefault(),this.isSubmitted=!0,this.validateHandler(e)}),na(this,"handleFieldChange",e=>{let t;for(const i in this.fields){if(this.fields[i].elem===e){t=i;break}}t&&(this.fields[t].touched=!0,this.validateField(t,!0))}),na(this,"handleGroupChange",e=>{let t;for(const i in this.groupFields){if(this.groupFields[i].elems.find(t=>t===e)){t=i;break}}t&&(this.groupFields[t].touched=!0,this.validateGroup(t,!0))}),na(this,"handlerChange",e=>{e.target&&(this.handleFieldChange(e.target),this.handleGroupChange(e.target),this.renderErrors())}),this.initialize(e,t,i)}initialize(e,t,i){if(this.form=null,this.errors={},this.isValid=!1,this.isSubmitted=!1,this.globalConfig=ga,this.errorLabels={},this.successLabels={},this.eventListeners=[],this.customStyleTags={},this.tooltips=[],this.currentLocale="en","string"==typeof e){const t=document.querySelector(e);if(!t)throw Error(`Form with ${e} selector not found! Please check the form selector`);this.setForm(t)}else{if(!(e instanceof HTMLFormElement))throw Error("Form selector is not valid. Please specify a string selector or a DOM element.");this.setForm(e)}if(this.globalConfig={...ga,...t},i&&(this.dictLocale=[...i,...da]),this.isTooltip()){const e=document.createElement("style");e.textContent=".just-validate-error-label[data-tooltip=true]{position:fixed;padding:4px 8px;background:#423f3f;color:#fff;white-space:nowrap;z-index:10;border-radius:4px;transform:translateY(-5px)}.just-validate-error-label[data-tooltip=true]:before{content:'';width:0;height:0;border-left:solid 5px transparent;border-right:solid 5px transparent;border-bottom:solid 5px #423f3f;position:absolute;z-index:3;display:block;bottom:-5px;transform:rotate(180deg);left:calc(50% - 5px)}.just-validate-error-label[data-tooltip=true][data-direction=left]{transform:translateX(-5px)}.just-validate-error-label[data-tooltip=true][data-direction=left]:before{right:-7px;bottom:auto;left:auto;top:calc(50% - 2px);transform:rotate(90deg)}.just-validate-error-label[data-tooltip=true][data-direction=right]{transform:translateX(5px)}.just-validate-error-label[data-tooltip=true][data-direction=right]:before{right:auto;bottom:auto;left:-7px;top:calc(50% - 2px);transform:rotate(-90deg)}.just-validate-error-label[data-tooltip=true][data-direction=bottom]{transform:translateY(5px)}.just-validate-error-label[data-tooltip=true][data-direction=bottom]:before{right:auto;bottom:auto;left:calc(50% - 5px);top:-5px;transform:rotate(0)}",this.customStyleTags[ha.Label]=document.head.appendChild(e),this.addListener("scroll",document,this.handleDocumentScroll)}}getLocalisedString(e,t,i){var n;const s=null!=i?i:e;let r=null==(n=this.dictLocale.find(e=>e.key===s))?void 0:n.dict[this.currentLocale];if(r||i&&(r=i),r&&void 0!==t)switch(e){case ua.MaxLength:case ua.MinLength:case ua.MaxNumber:case ua.MinNumber:case ua.MinFilesCount:case ua.MaxFilesCount:r=r.replace(":value",String(t))}return r||i||"Value is incorrect"}getFieldErrorMessage(e,t){const i="function"==typeof e.errorMessage?e.errorMessage(this.getElemValue(t),this.fields):e.errorMessage;return this.getLocalisedString(e.rule,e.value,i)}getFieldSuccessMessage(e,t){const i="function"==typeof e?e(this.getElemValue(t),this.fields):e;return this.getLocalisedString(void 0,void 0,i)}getGroupErrorMessage(e){return this.getLocalisedString(e.rule,void 0,e.errorMessage)}getGroupSuccessMessage(e){if(e.successMessage)return this.getLocalisedString(void 0,void 0,e.successMessage)}setFieldInvalid(e,t){this.fields[e].isValid=!1,this.fields[e].errorMessage=this.getFieldErrorMessage(t,this.fields[e].elem)}setFieldValid(e,t){this.fields[e].isValid=!0,void 0!==t&&(this.fields[e].successMessage=this.getFieldSuccessMessage(t,this.fields[e].elem))}setGroupInvalid(e,t){this.groupFields[e].isValid=!1,this.groupFields[e].errorMessage=this.getGroupErrorMessage(t)}setGroupValid(e,t){this.groupFields[e].isValid=!0,this.groupFields[e].successMessage=this.getGroupSuccessMessage(t)}getElemValue(e){switch(e.type){case"checkbox":return e.checked;case"file":return e.files;default:return e.value}}validateGroupRule(e,t,i){if(i.rule===ca.Required)t.every(e=>!e.checked)?this.setGroupInvalid(e,i):this.setGroupValid(e,i)}validateFieldRule(e,t,i,n=!1){const s=i.value,r=this.getElemValue(t);if(i.plugin){return void(i.plugin(r,this.getCompatibleFields())||this.setFieldInvalid(e,i))}switch(i.rule){case ua.Required:(e=>{let t=e;return"string"==typeof e&&(t=e.trim()),!t})(r)&&this.setFieldInvalid(e,i);break;case ua.Email:if(la(r))break;a=r,sa.test(a)||this.setFieldInvalid(e,i);break;case ua.MaxLength:if(void 0===s){console.error(`Value for ${i.rule} rule for [${e}] field is not defined. The field will be always invalid.`),this.setFieldInvalid(e,i);break}if("number"!=typeof s){console.error(`Value for ${i.rule} rule for [${e}] should be a number. The field will be always invalid.`),this.setFieldInvalid(e,i);break}if(la(r))break;((e,t)=>e.length>t)(r,s)&&this.setFieldInvalid(e,i);break;case ua.MinLength:if(void 0===s){console.error(`Value for ${i.rule} rule for [${e}] field is not defined. The field will be always invalid.`),this.setFieldInvalid(e,i);break}if("number"!=typeof s){console.error(`Value for ${i.rule} rule for [${e}] should be a number. The field will be always invalid.`),this.setFieldInvalid(e,i);break}if(la(r))break;((e,t)=>e.length<t)(r,s)&&this.setFieldInvalid(e,i);break;case ua.Password:if(la(r))break;(e=>aa.test(e))(r)||this.setFieldInvalid(e,i);break;case ua.StrongPassword:if(la(r))break;(e=>oa.test(e))(r)||this.setFieldInvalid(e,i);break;case ua.Number:if(la(r))break;(e=>"string"==typeof e&&!isNaN(+e)&&!isNaN(parseFloat(e)))(r)||this.setFieldInvalid(e,i);break;case ua.Integer:if(la(r))break;(e=>ra.test(e))(r)||this.setFieldInvalid(e,i);break;case ua.MaxNumber:{if(void 0===s){console.error(`Value for ${i.rule} rule for [${e}] field is not defined. The field will be always invalid.`),this.setFieldInvalid(e,i);break}if("number"!=typeof s){console.error(`Value for ${i.rule} rule for [${e}] field should be a number. The field will be always invalid.`),this.setFieldInvalid(e,i);break}if(la(r))break;const t=+r;(Number.isNaN(t)||((e,t)=>e>t)(t,s))&&this.setFieldInvalid(e,i);break}case ua.MinNumber:{if(void 0===s){console.error(`Value for ${i.rule} rule for [${e}] field is not defined. The field will be always invalid.`),this.setFieldInvalid(e,i);break}if("number"!=typeof s){console.error(`Value for ${i.rule} rule for [${e}] field should be a number. The field will be always invalid.`),this.setFieldInvalid(e,i);break}if(la(r))break;const t=+r;(Number.isNaN(t)||((e,t)=>e<t)(t,s))&&this.setFieldInvalid(e,i);break}case ua.CustomRegexp:{if(void 0===s)return console.error(`Value for ${i.rule} rule for [${e}] field is not defined. This field will be always invalid.`),void this.setFieldInvalid(e,i);let t;try{t=new RegExp(s)}catch(t){console.error(`Value for ${i.rule} rule for [${e}] should be a valid regexp. This field will be always invalid.`),this.setFieldInvalid(e,i);break}const n=String(r);""===n||t.test(n)||this.setFieldInvalid(e,i);break}case ua.MinFilesCount:if(void 0===s){console.error(`Value for ${i.rule} rule for [${e}] field is not defined. This field will be always invalid.`),this.setFieldInvalid(e,i);break}if("number"!=typeof s){console.error(`Value for ${i.rule} rule for [${e}] field should be a number. The field will be always invalid.`),this.setFieldInvalid(e,i);break}if(Number.isFinite(null==r?void 0:r.length)&&r.length<s){this.setFieldInvalid(e,i);break}break;case ua.MaxFilesCount:if(void 0===s){console.error(`Value for ${i.rule} rule for [${e}] field is not defined. This field will be always invalid.`),this.setFieldInvalid(e,i);break}if("number"!=typeof s){console.error(`Value for ${i.rule} rule for [${e}] field should be a number. The field will be always invalid.`),this.setFieldInvalid(e,i);break}if(Number.isFinite(null==r?void 0:r.length)&&r.length>s){this.setFieldInvalid(e,i);break}break;case ua.Files:{if(void 0===s)return console.error(`Value for ${i.rule} rule for [${e}] field is not defined. This field will be always invalid.`),void this.setFieldInvalid(e,i);if("object"!=typeof s)return console.error(`Value for ${i.rule} rule for [${e}] field should be an object. This field will be always invalid.`),void this.setFieldInvalid(e,i);const t=s.files;if("object"!=typeof t)return console.error(`Value for ${i.rule} rule for [${e}] field should be an object with files array. This field will be always invalid.`),void this.setFieldInvalid(e,i);const n=(e,t)=>{const i=Number.isFinite(t.minSize)&&e.size<t.minSize,n=Number.isFinite(t.maxSize)&&e.size>t.maxSize,s=Array.isArray(t.names)&&!t.names.includes(e.name),r=Array.isArray(t.extensions)&&!t.extensions.includes(e.name.split(".")[e.name.split(".").length-1]),a=Array.isArray(t.types)&&!t.types.includes(e.type);return i||n||s||r||a};if("object"==typeof r&&null!==r)for(let s=0,a=r.length;s<a;++s){const a=r.item(s);if(!a){this.setFieldInvalid(e,i);break}if(n(a,t)){this.setFieldInvalid(e,i);break}}break}default:{if("function"!=typeof i.validator)return console.error(`Validator for custom rule for [${e}] field should be a function. This field will be always invalid.`),void this.setFieldInvalid(e,i);const t=i.validator(r,this.getCompatibleFields());if("boolean"!=typeof t&&"function"!=typeof t&&console.error(`Validator return value for [${e}] field should be boolean or function. It will be cast to boolean.`),"function"==typeof t){if(!n){this.fields[e].asyncCheckPending=!1;const n=t();return pa(n)?n.then(t=>{t||this.setFieldInvalid(e,i)}).catch(()=>{this.setFieldInvalid(e,i)}):(console.error(`Validator function for custom rule for [${e}] field should return a Promise. This field will be always invalid.`),void this.setFieldInvalid(e,i))}this.fields[e].asyncCheckPending=!0}t||this.setFieldInvalid(e,i)}}var a}isFormValid(){let e=!0;for(let t=0,i=Object.values(this.fields).length;t<i;++t){const i=Object.values(this.fields)[t];if(void 0===i.isValid){e=void 0;break}if(!1===i.isValid){e=!1;break}}for(let t=0,i=Object.values(this.groupFields).length;t<i;++t){const i=Object.values(this.groupFields)[t];if(void 0===i.isValid){e=void 0;break}if(!1===i.isValid){e=!1;break}}return e}validateField(e,t=!1){var i;const n=this.fields[e];n.isValid=!0;const s=[];return[...n.rules].reverse().forEach(i=>{const r=this.validateFieldRule(e,n.elem,i,t);pa(r)&&s.push(r)}),n.isValid&&this.setFieldValid(e,null==(i=n.config)?void 0:i.successMessage),Promise.allSettled(s).finally(()=>{var e;t&&(null==(e=this.onValidateCallback)||e.call(this,{isValid:this.isFormValid(),isSubmitted:this.isSubmitted,fields:this.getCompatibleFields(),groups:{...this.groupFields}}))})}revalidateField(e){if("string"!=typeof e&&!ma(e))throw Error("Field selector is not valid. Please specify a string selector or a valid DOM element.");const t=this.getKeyByFieldSelector(e);return t&&this.fields[t]?new Promise(e=>{this.validateField(t,!0).finally(()=>{this.clearFieldStyle(t),this.clearFieldLabel(t),this.renderFieldError(t,!0),e(!!this.fields[t].isValid)})}):(console.error("Field not found. Check the field selector."),Promise.reject())}revalidateGroup(e){if("string"!=typeof e&&!ma(e))throw Error("Group selector is not valid. Please specify a string selector or a valid DOM element.");const t=this.getKeyByFieldSelector(e);return t&&this.groupFields[t]?new Promise(e=>{this.validateGroup(t).finally(()=>{this.clearFieldLabel(t),this.renderGroupError(t,!0),e(!!this.groupFields[t].isValid)})}):(console.error("Group not found. Check the group selector."),Promise.reject())}validateGroup(e,t=!1){const i=this.groupFields[e],n=[];return[...i.rules].reverse().forEach(t=>{const s=this.validateGroupRule(e,i.elems,t);pa(s)&&n.push(s)}),Promise.allSettled(n).finally(()=>{var e;t&&(null==(e=this.onValidateCallback)||e.call(this,{isValid:this.isFormValid(),isSubmitted:this.isSubmitted,fields:this.getCompatibleFields(),groups:{...this.groupFields}}))})}focusInvalidField(){for(const e in this.fields){const t=this.fields[e];if(!t.isValid){setTimeout(()=>t.elem.focus(),0);break}}}afterSubmitValidation(e=!1){this.renderErrors(e),this.globalConfig.focusInvalidField&&this.focusInvalidField()}validate(e=!1){return new Promise(t=>{const i=[];Object.keys(this.fields).forEach(e=>{const t=this.validateField(e);pa(t)&&i.push(t)}),Object.keys(this.groupFields).forEach(e=>{const t=this.validateGroup(e);pa(t)&&i.push(t)}),Promise.allSettled(i).then(()=>{var n;this.afterSubmitValidation(e),null==(n=this.onValidateCallback)||n.call(this,{isValid:this.isFormValid(),isSubmitted:this.isSubmitted,fields:this.getCompatibleFields(),groups:{...this.groupFields}}),t(!!i.length)})})}revalidate(){return new Promise(e=>{this.validateHandler(void 0,!0).finally(()=>{this.globalConfig.focusInvalidField&&this.focusInvalidField(),e(this.isValid)})})}validateHandler(e,t=!1){return this.globalConfig.lockForm&&this.lockForm(),this.validate(t).finally(()=>{var t,i,n;this.globalConfig.lockForm&&this.unlockForm(),this.isValid?(null==(t=this.onSuccessCallback)||t.call(this,e),this.globalConfig.submitFormAutomatically&&(null==(i=null==e?void 0:e.currentTarget)||i.submit())):null==(n=this.onFailCallback)||n.call(this,this.getCompatibleFields(),this.groupFields)})}setForm(e){this.form=e,this.form.setAttribute("novalidate","novalidate"),this.removeListener("submit",this.form,this.formSubmitHandler),this.addListener("submit",this.form,this.formSubmitHandler)}addListener(e,t,i){t.addEventListener(e,i),this.eventListeners.push({type:e,elem:t,func:i})}removeListener(e,t,i){t.removeEventListener(e,i),this.eventListeners=this.eventListeners.filter(i=>i.type!==e||i.elem!==t)}addField(e,t,i){if("string"!=typeof e&&!ma(e))throw Error("Field selector is not valid. Please specify a string selector or a valid DOM element.");let n;if(n="string"==typeof e?this.form.querySelector(e):e,!n)throw Error("Field doesn't exist in the DOM! Please check the field selector.");if(!Array.isArray(t)||!t.length)throw Error("Rules argument should be an array and should contain at least 1 element.");t.forEach(e=>{if(!("rule"in e||"validator"in e||"plugin"in e))throw Error("Rules argument must contain at least one rule or validator property.");if(!(e.validator||e.plugin||e.rule&&Object.values(ua).includes(e.rule)))throw Error(`Rule should be one of these types: ${Object.values(ua).join(", ")}. Provided value: ${e.rule}`)});const s=this.setKeyByFieldSelector(e);return this.fields[s]={elem:n,rules:t,isValid:void 0,touched:!1,config:i},this.setListeners(n),(this.isSubmitted||this.globalConfig.validateBeforeSubmitting)&&this.validateField(s),this}removeField(e){if("string"!=typeof e&&!ma(e))throw Error("Field selector is not valid. Please specify a string selector or a valid DOM element.");const t=this.getKeyByFieldSelector(e);if(!t||!this.fields[t])return console.error("Field not found. Check the field selector."),this;const i=this.getListenerType(this.fields[t].elem.type);return this.removeListener(i,this.fields[t].elem,this.handlerChange),this.clearErrors(),delete this.fields[t],this}removeGroup(e){if("string"!=typeof e)throw Error("Group selector is not valid. Please specify a string selector.");const t=this.getKeyByFieldSelector(e);return t&&this.groupFields[t]?(this.groupFields[t].elems.forEach(e=>{const t=this.getListenerType(e.type);this.removeListener(t,e,this.handlerChange)}),this.clearErrors(),delete this.groupFields[t],this):(console.error("Group not found. Check the group selector."),this)}addRequiredGroup(e,t,i,n){if("string"!=typeof e&&!ma(e))throw Error("Group selector is not valid. Please specify a string selector or a valid DOM element.");let s;if(s="string"==typeof e?this.form.querySelector(e):e,!s)throw Error("Group selector not found! Please check the group selector.");const r=s.querySelectorAll("input"),a=Array.from(r).filter(e=>{const t=((e,t)=>{const i=[...t].reverse();for(let t=0,n=i.length;t<n;++t){const n=i[t];for(const t in e){const i=e[t];if(i.groupElem===n)return[t,i]}}return null})(this.groupFields,(e=>{let t=e;const i=[];for(;t;)i.unshift(t),t=t.parentNode;return i})(e));return!t||t[1].elems.find(t=>t!==e)}),o=this.setKeyByFieldSelector(e);return this.groupFields[o]={rules:[{rule:ca.Required,errorMessage:t,successMessage:n}],groupElem:s,elems:a,touched:!1,isValid:void 0,config:i},r.forEach(e=>{this.setListeners(e)}),this}getListenerType(e){switch(e){case"checkbox":case"select-one":case"file":case"radio":return"change";default:return"input"}}setListeners(e){const t=this.getListenerType(e.type);this.removeListener(t,e,this.handlerChange),this.addListener(t,e,this.handlerChange)}clearFieldLabel(e){var t,i;null==(t=this.errorLabels[e])||t.remove(),null==(i=this.successLabels[e])||i.remove()}clearFieldStyle(e){var t,i,n,s;const r=this.fields[e],a=(null==(t=r.config)?void 0:t.errorFieldStyle)||this.globalConfig.errorFieldStyle;Object.keys(a).forEach(e=>{r.elem.style[e]=""});const o=(null==(i=r.config)?void 0:i.successFieldStyle)||this.globalConfig.successFieldStyle||{};Object.keys(o).forEach(e=>{r.elem.style[e]=""}),r.elem.classList.remove(...fa((null==(n=r.config)?void 0:n.errorFieldCssClass)||this.globalConfig.errorFieldCssClass),...fa((null==(s=r.config)?void 0:s.successFieldCssClass)||this.globalConfig.successFieldCssClass))}clearErrors(){var e,t;Object.keys(this.errorLabels).forEach(e=>this.errorLabels[e].remove()),Object.keys(this.successLabels).forEach(e=>this.successLabels[e].remove());for(const e in this.fields)this.clearFieldStyle(e);for(const i in this.groupFields){const n=this.groupFields[i],s=(null==(e=n.config)?void 0:e.errorFieldStyle)||this.globalConfig.errorFieldStyle;Object.keys(s).forEach(e=>{n.elems.forEach(t=>{var i;t.style[e]="",t.classList.remove(...fa((null==(i=n.config)?void 0:i.errorFieldCssClass)||this.globalConfig.errorFieldCssClass))})});const r=(null==(t=n.config)?void 0:t.successFieldStyle)||this.globalConfig.successFieldStyle||{};Object.keys(r).forEach(e=>{n.elems.forEach(t=>{var i;t.style[e]="",t.classList.remove(...fa((null==(i=n.config)?void 0:i.successFieldCssClass)||this.globalConfig.successFieldCssClass))})})}this.tooltips=[]}isTooltip(){return!!this.globalConfig.tooltip}lockForm(){const e=this.form.querySelectorAll("input, textarea, button, select");for(let t=0,i=e.length;t<i;++t)e[t].setAttribute("data-just-validate-fallback-disabled",e[t].disabled?"true":"false"),e[t].setAttribute("disabled","disabled"),e[t].style.pointerEvents="none",e[t].style.webkitFilter="grayscale(100%)",e[t].style.filter="grayscale(100%)"}unlockForm(){const e=this.form.querySelectorAll("input, textarea, button, select");for(let t=0,i=e.length;t<i;++t)"true"!==e[t].getAttribute("data-just-validate-fallback-disabled")&&e[t].removeAttribute("disabled"),e[t].style.pointerEvents="",e[t].style.webkitFilter="",e[t].style.filter=""}renderTooltip(e,t,i){var n;const{top:s,left:r,width:a,height:o}=e.getBoundingClientRect(),l=t.getBoundingClientRect(),u=i||(null==(n=this.globalConfig.tooltip)?void 0:n.position);switch(u){case"left":t.style.top=s+o/2-l.height/2+"px",t.style.left=r-l.width-5+"px";break;case"top":t.style.top=s-l.height-5+"px",t.style.left=r+a/2-l.width/2+"px";break;case"right":t.style.top=s+o/2-l.height/2+"px",t.style.left=`${r+a+5}px`;break;case"bottom":t.style.top=`${s+o+5}px`,t.style.left=r+a/2-l.width/2+"px"}t.dataset.direction=u;return{refresh:()=>{this.renderTooltip(e,t,i)}}}createErrorLabelElem(e,t,i){const n=document.createElement("div");n.innerHTML=t;const s=this.isTooltip()?null==i?void 0:i.errorLabelStyle:(null==i?void 0:i.errorLabelStyle)||this.globalConfig.errorLabelStyle;return Object.assign(n.style,s),n.classList.add(...fa((null==i?void 0:i.errorLabelCssClass)||this.globalConfig.errorLabelCssClass),"just-validate-error-label"),this.isTooltip()&&(n.dataset.tooltip="true"),this.globalConfig.testingMode&&(n.dataset.testId=`error-label-${e}`),this.errorLabels[e]=n,n}createSuccessLabelElem(e,t,i){if(void 0===t)return null;const n=document.createElement("div");n.innerHTML=t;const s=(null==i?void 0:i.successLabelStyle)||this.globalConfig.successLabelStyle;return Object.assign(n.style,s),n.classList.add(...fa((null==i?void 0:i.successLabelCssClass)||this.globalConfig.successLabelCssClass),"just-validate-success-label"),this.globalConfig.testingMode&&(n.dataset.testId=`success-label-${e}`),this.successLabels[e]=n,n}renderErrorsContainer(e,t){const i=t||this.globalConfig.errorsContainer;if("string"==typeof i){const t=this.form.querySelector(i);if(t)return t.appendChild(e),!0;console.error(`Error container with ${i} selector not found. Errors will be rendered as usual`)}return i instanceof Element?(i.appendChild(e),!0):(void 0!==i&&console.error("Error container not found. It should be a string or existing Element. Errors will be rendered as usual"),!1)}renderGroupLabel(e,t,i,n){if(!n){if(this.renderErrorsContainer(t,i))return}e.appendChild(t)}renderFieldLabel(e,t,i,n){var s,r,a,o,l,u,c;if(!n){if(this.renderErrorsContainer(t,i))return}if("checkbox"===e.type||"radio"===e.type){const i=document.querySelector(`label[for="${e.getAttribute("id")}"]`);"label"===(null==(r=null==(s=e.parentElement)?void 0:s.tagName)?void 0:r.toLowerCase())?null==(o=null==(a=e.parentElement)?void 0:a.parentElement)||o.appendChild(t):i?null==(l=i.parentElement)||l.appendChild(t):null==(u=e.parentElement)||u.appendChild(t)}else null==(c=e.parentElement)||c.appendChild(t)}showLabels(e,t){Object.keys(e).forEach((i,n)=>{const s=e[i],r=this.getKeyByFieldSelector(i);if(!r||!this.fields[r])return void console.error("Field not found. Check the field selector.");const a=this.fields[r];a.isValid=!t,this.clearFieldStyle(r),this.clearFieldLabel(r),this.renderFieldError(r,!1,s),0===n&&this.globalConfig.focusInvalidField&&setTimeout(()=>a.elem.focus(),0)})}showErrors(e){if("object"!=typeof e)throw Error("[showErrors]: Errors should be an object with key: value format");this.showLabels(e,!0)}showSuccessLabels(e){if("object"!=typeof e)throw Error("[showSuccessLabels]: Labels should be an object with key: value format");this.showLabels(e,!1)}renderFieldError(e,t=!1,i){var n,s,r,a,o,l;const u=this.fields[e];if(!1===u.isValid&&(this.isValid=!1),void 0===u.isValid||!t&&!this.isSubmitted&&!u.touched&&void 0===i)return;if(u.isValid){if(!u.asyncCheckPending){const t=this.createSuccessLabelElem(e,void 0!==i?i:u.successMessage,u.config);t&&this.renderFieldLabel(u.elem,t,null==(n=u.config)?void 0:n.errorsContainer,!0),u.elem.classList.add(...fa((null==(s=u.config)?void 0:s.successFieldCssClass)||this.globalConfig.successFieldCssClass))}return}u.elem.classList.add(...fa((null==(r=u.config)?void 0:r.errorFieldCssClass)||this.globalConfig.errorFieldCssClass));const c=this.createErrorLabelElem(e,void 0!==i?i:u.errorMessage,u.config);this.renderFieldLabel(u.elem,c,null==(a=u.config)?void 0:a.errorsContainer),this.isTooltip()&&this.tooltips.push(this.renderTooltip(u.elem,c,null==(l=null==(o=u.config)?void 0:o.tooltip)?void 0:l.position))}renderGroupError(e,t=!0){var i,n,s,r;const a=this.groupFields[e];if(!1===a.isValid&&(this.isValid=!1),void 0===a.isValid||!t&&!this.isSubmitted&&!a.touched)return;if(a.isValid){a.elems.forEach(e=>{var t,i;Object.assign(e.style,(null==(t=a.config)?void 0:t.successFieldStyle)||this.globalConfig.successFieldStyle),e.classList.add(...fa((null==(i=a.config)?void 0:i.successFieldCssClass)||this.globalConfig.successFieldCssClass))});const t=this.createSuccessLabelElem(e,a.successMessage,a.config);return void(t&&this.renderGroupLabel(a.groupElem,t,null==(i=a.config)?void 0:i.errorsContainer,!0))}this.isValid=!1,a.elems.forEach(e=>{var t,i;Object.assign(e.style,(null==(t=a.config)?void 0:t.errorFieldStyle)||this.globalConfig.errorFieldStyle),e.classList.add(...fa((null==(i=a.config)?void 0:i.errorFieldCssClass)||this.globalConfig.errorFieldCssClass))});const o=this.createErrorLabelElem(e,a.errorMessage,a.config);this.renderGroupLabel(a.groupElem,o,null==(n=a.config)?void 0:n.errorsContainer),this.isTooltip()&&this.tooltips.push(this.renderTooltip(a.groupElem,o,null==(r=null==(s=a.config)?void 0:s.tooltip)?void 0:r.position))}renderErrors(e=!1){if(this.isSubmitted||e||this.globalConfig.validateBeforeSubmitting){this.clearErrors(),this.isValid=!0;for(const e in this.groupFields)this.renderGroupError(e);for(const e in this.fields)this.renderFieldError(e)}}destroy(){this.eventListeners.forEach(e=>{this.removeListener(e.type,e.elem,e.func)}),Object.keys(this.customStyleTags).forEach(e=>{this.customStyleTags[e].remove()}),this.clearErrors(),this.globalConfig.lockForm&&this.unlockForm()}refresh(){this.destroy(),this.form?(this.initialize(this.form,this.globalConfig),Object.keys(this.fields).forEach(e=>{const t=this.getFieldSelectorByKey(e);t&&this.addField(t,[...this.fields[e].rules],this.fields[e].config)})):console.error("Cannot initialize the library! Form is not defined")}setCurrentLocale(e){"string"==typeof e||void 0===e?(this.currentLocale=e,this.isSubmitted&&this.validate()):console.error("Current locale should be a string")}onSuccess(e){return this.onSuccessCallback=e,this}onFail(e){return this.onFailCallback=e,this}onValidate(e){return this.onValidateCallback=e,this}}class _a{constructor(e,t,i,n,s){this.targetNode=e,this.classToWatch=t,this.classAddedCallback=i,this.classRemovedCallback=n,this.observer=null,this.lastClassState=e.classList.contains(this.classToWatch),this.ignoreToggle=!!s,this.init()}init(){this.observer=new MutationObserver(e=>this.mutationCallback(e)),this.observe()}observe(){this.observer.observe(this.targetNode,{attributes:!0})}disconnect(){this.observer.disconnect()}mutationCallback(e){for(let t of e)if("attributes"===t.type&&"class"===t.attributeName){let e=t.target.classList.contains(this.classToWatch);(this.ignoreToggle||this.lastClassState!==e)&&(this.lastClassState=e,e?"function"==typeof this.classAddedCallback&&this.classAddedCallback():"function"==typeof this.classRemovedCallback&&this.classRemovedCallback())}}}class va{constructor(e,t,i,n){this.targetNode=e,this.contentSelector=t,this.contentAddedCallback=i,this.contentRemovedCallback=n,this.observer=null,this.init()}init(){this.observer=new MutationObserver(e=>this.mutationCallback(e)),this.observe()}observe(){this.observer.observe(this.targetNode,{childList:!0,subtree:!0})}disconnect(){this.observer.disconnect()}mutationCallback(e){for(let t of e)"childList"===t.type&&(t.addedNodes.forEach(e=>{this._callbackExec(e)}),t.removedNodes.forEach(e=>{this._callbackExec(e,!0)}))}_callbackExec(e,t){const i=e.matches&&e.matches(this.contentSelector)?[e]:e.querySelectorAll?e.querySelectorAll(this.contentSelector):null,n=t&&"function"==typeof this.contentRemovedCallback?this.contentRemovedCallback:"function"==typeof this.contentAddedCallback?this.contentAddedCallback:null;i&&n&&i.forEach(e=>n(e))}}const ba={errorFieldCssClass:"is-invalid",errorLabelCssClass:"just-validate-error-label"},Ta="justvalidatebi";class wa extends Hi{constructor(e){super(e),this._label=new en(e),this._bindEvents()}static get NAME(){return"input"}_bindEvents(){"file"===this._element.getAttribute("type")&&Bi.on(this._element,"change.bs.input",()=>{this._handleFileDescription()})}_handleFileDescription(){const e=[];let t="";Array.from(this._element.files).forEach(t=>{const i=Math.round(parseInt(t.size,10)/1024);e.push(t.name+" ("+i+"kb)")}),this._element.files.length>1&&(t=this._element.files.length+" file da caricare: ");const i=zi.findOne('label[for="'+this._element.getAttribute("id")+'"] label.form-file-name',this._element);i&&(i.innerText=t+e.join("; "))}}const Sa=["select",'input[data-bs-input][type="password"]',"input.input-password[data-bs-input]",'input[data-bs-autocomplete][type="search"]','input[type="time"]','input[type="radio"]','input[type="checkbox"]'];"undefined"!=typeof document&&document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll("input, textarea, label").forEach(function(e){(e=>{const t=!!Sa.find(t=>e.matches(t)),i=!("number"!==e.getAttribute("type")||!e.parentNode.querySelector('button[class^="input-number-"]'));t||i||wa.getOrCreateInstance(e)})(en.getInputFromLabel(e)||e)})});var Ea="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ca(e,t){return e(t={exports:{}},t.exports),t.exports}var ka=Ca(function(e,t){var i;globalThis,i=()=>(()=>{var e={8952:(e,t,i)=>{var n=i(4328),s=i(36),r=TypeError;e.exports=function(e){if(n(e))return e;throw new r(s(e)+" is not a function")}},6100:(e,t,i)=>{var n=i(7e3),s=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw new s("Incorrect invocation")}},3951:(e,t,i)=>{var n=i(1632),s=String,r=TypeError;e.exports=function(e){if(n(e))return e;throw new r(s(e)+" is not an object")}},2504:(e,t,i)=>{var n=i(4096),s=i(2495),r=i(3556),a=function(e){return function(t,i,a){var o=n(t),l=r(o);if(0===l)return!e&&-1;var u,c=s(a,l);if(e&&i!=i){for(;l>c;)if((u=o[c++])!=u)return!0}else for(;l>c;c++)if((e||c in o)&&o[c]===i)return e||c||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},6728:(e,t,i)=>{var n=i(3476),s=i(1432),r=TypeError,a=Object.getOwnPropertyDescriptor,o=n&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=o?function(e,t){if(s(e)&&!a(e,"length").writable)throw new r("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},8696:(e,t,i)=>{var n=i(3951),s=i(3112);e.exports=function(e,t,i,r){try{return r?t(n(i)[0],i[1]):t(i)}catch(t){s(e,"throw",t)}}},1888:(e,t,i)=>{var n=i(1664),s=n({}.toString),r=n("".slice);e.exports=function(e){return r(s(e),8,-1)}},9968:(e,t,i)=>{var n=i(5152),s=i(9252),r=i(9444),a=i(8352);e.exports=function(e,t,i){for(var o=s(t),l=a.f,u=r.f,c=0;c<o.length;c++){var h=o[c];n(e,h)||i&&n(i,h)||l(e,h,u(t,h))}}},2272:(e,t,i)=>{var n=i(9957);e.exports=!n(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})},3336:e=>{e.exports=function(e,t){return{value:e,done:t}}},3440:(e,t,i)=>{var n=i(3476),s=i(8352),r=i(9728);e.exports=n?function(e,t,i){return s.f(e,t,r(1,i))}:function(e,t,i){return e[t]=i,e}},9728:e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},92:(e,t,i)=>{var n=i(3476),s=i(8352),r=i(9728);e.exports=function(e,t,i){n?s.f(e,t,r(0,i)):e[t]=i}},2544:(e,t,i)=>{var n=i(5312),s=i(8352);e.exports=function(e,t,i){return i.get&&n(i.get,t,{getter:!0}),i.set&&n(i.set,t,{setter:!0}),s.f(e,t,i)}},6076:(e,t,i)=>{var n=i(4328),s=i(8352),r=i(5312),a=i(4636);e.exports=function(e,t,i,o){o||(o={});var l=o.enumerable,u=void 0!==o.name?o.name:t;if(n(i)&&r(i,u,o),o.global)l?e[t]=i:a(t,i);else{try{o.unsafe?e[t]&&(l=!0):delete e[t]}catch(e){}l?e[t]=i:s.f(e,t,{value:i,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return e}},4036:(e,t,i)=>{var n=i(6076);e.exports=function(e,t,i){for(var s in t)n(e,s,t[s],i);return e}},4636:(e,t,i)=>{var n=i(6420),s=Object.defineProperty;e.exports=function(e,t){try{s(n,e,{value:t,configurable:!0,writable:!0})}catch(i){n[e]=t}return t}},3476:(e,t,i)=>{var n=i(9957);e.exports=!n(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})},8168:(e,t,i)=>{var n=i(6420),s=i(1632),r=n.document,a=s(r)&&s(r.createElement);e.exports=function(e){return a?r.createElement(e):{}}},4316:e=>{var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},6064:e=>{e.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},8504:(e,t,i)=>{var n,s,r=i(6420),a=i(6064),o=r.process,l=r.Deno,u=o&&o.versions||l&&l.version,c=u&&u.v8;c&&(s=(n=c.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!s&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(s=+n[1]),e.exports=s},8256:e=>{e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},9160:(e,t,i)=>{var n=i(6420),s=i(9444).f,r=i(3440),a=i(6076),o=i(4636),l=i(9968),u=i(6704);e.exports=function(e,t){var i,c,h,d,p,f=e.target,m=e.global,g=e.stat;if(i=m?n:g?n[f]||o(f,{}):n[f]&&n[f].prototype)for(c in t){if(d=t[c],h=e.dontCallGetSet?(p=s(i,c))&&p.value:i[c],!u(m?c:f+(g?".":"#")+c,e.forced)&&void 0!==h){if(typeof d==typeof h)continue;l(d,h)}(e.sham||h&&h.sham)&&r(d,"sham",!0),a(i,c,d,e)}}},9957:e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},7332:(e,t,i)=>{var n=i(9957);e.exports=!n(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})},8448:(e,t,i)=>{var n=i(7332),s=Function.prototype.call;e.exports=n?s.bind(s):function(){return s.apply(s,arguments)}},6208:(e,t,i)=>{var n=i(3476),s=i(5152),r=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,o=s(r,"name"),l=o&&"something"===function(){}.name,u=o&&(!n||n&&a(r,"name").configurable);e.exports={EXISTS:o,PROPER:l,CONFIGURABLE:u}},1664:(e,t,i)=>{var n=i(7332),s=Function.prototype,r=s.call,a=n&&s.bind.bind(r,r);e.exports=n?a:function(e){return function(){return r.apply(e,arguments)}}},5232:(e,t,i)=>{var n=i(6420),s=i(4328);e.exports=function(e,t){return arguments.length<2?(i=n[e],s(i)?i:void 0):n[e]&&n[e][t];var i}},6752:e=>{e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},4504:(e,t,i)=>{var n=i(8952),s=i(9760);e.exports=function(e,t){var i=e[t];return s(i)?void 0:n(i)}},6420:function(e,t,i){var n=function(e){return e&&e.Math===Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof i.g&&i.g)||n("object"==typeof this&&this)||function(){return this}()||Function("return this")()},5152:(e,t,i)=>{var n=i(1664),s=i(4356),r=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return r(s(e),t)}},2560:e=>{e.exports={}},4168:(e,t,i)=>{var n=i(5232);e.exports=n("document","documentElement")},9888:(e,t,i)=>{var n=i(3476),s=i(9957),r=i(8168);e.exports=!n&&!s(function(){return 7!==Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a})},5712:(e,t,i)=>{var n=i(1664),s=i(9957),r=i(1888),a=Object,o=n("".split);e.exports=s(function(){return!a("z").propertyIsEnumerable(0)})?function(e){return"String"===r(e)?o(e,""):a(e)}:a},9112:(e,t,i)=>{var n=i(1664),s=i(4328),r=i(3976),a=n(Function.toString);s(r.inspectSource)||(r.inspectSource=function(e){return a(e)}),e.exports=r.inspectSource},9104:(e,t,i)=>{var n,s,r,a=i(4288),o=i(6420),l=i(1632),u=i(3440),c=i(5152),h=i(3976),d=i(6504),p=i(2560),f="Object already initialized",m=o.TypeError,g=o.WeakMap;if(a||h.state){var y=h.state||(h.state=new g);y.get=y.get,y.has=y.has,y.set=y.set,n=function(e,t){if(y.has(e))throw new m(f);return t.facade=e,y.set(e,t),t},s=function(e){return y.get(e)||{}},r=function(e){return y.has(e)}}else{var _=d("state");p[_]=!0,n=function(e,t){if(c(e,_))throw new m(f);return t.facade=e,u(e,_,t),t},s=function(e){return c(e,_)?e[_]:{}},r=function(e){return c(e,_)}}e.exports={set:n,get:s,has:r,enforce:function(e){return r(e)?s(e):n(e,{})},getterFor:function(e){return function(t){var i;if(!l(t)||(i=s(t)).type!==e)throw new m("Incompatible receiver, "+e+" required");return i}}}},1432:(e,t,i)=>{var n=i(1888);e.exports=Array.isArray||function(e){return"Array"===n(e)}},4328:e=>{var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},6704:(e,t,i)=>{var n=i(9957),s=i(4328),r=/#|\.prototype\./,a=function(e,t){var i=l[o(e)];return i===c||i!==u&&(s(t)?n(t):!!t)},o=a.normalize=function(e){return String(e).replace(r,".").toLowerCase()},l=a.data={},u=a.NATIVE="N",c=a.POLYFILL="P";e.exports=a},9760:e=>{e.exports=function(e){return null==e}},1632:(e,t,i)=>{var n=i(4328);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},7048:e=>{e.exports=!1},7728:(e,t,i)=>{var n=i(5232),s=i(4328),r=i(7e3),a=i(6536),o=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return s(t)&&r(t.prototype,o(e))}},3112:(e,t,i)=>{var n=i(8448),s=i(3951),r=i(4504);e.exports=function(e,t,i){var a,o;s(e);try{if(!(a=r(e,"return"))){if("throw"===t)throw i;return i}a=n(a,e)}catch(e){o=!0,a=e}if("throw"===t)throw i;if(o)throw a;return s(a),i}},9724:(e,t,i)=>{var n=i(8448),s=i(9368),r=i(3440),a=i(4036),o=i(9972),l=i(9104),u=i(4504),c=i(336).IteratorPrototype,h=i(3336),d=i(3112),p=o("toStringTag"),f="IteratorHelper",m="WrapForValidIterator",g=l.set,y=function(e){var t=l.getterFor(e?m:f);return a(s(c),{next:function(){var i=t(this);if(e)return i.nextHandler();try{var n=i.done?void 0:i.nextHandler();return h(n,i.done)}catch(e){throw i.done=!0,e}},return:function(){var i=t(this),s=i.iterator;if(i.done=!0,e){var r=u(s,"return");return r?n(r,s):h(void 0,!0)}if(i.inner)try{d(i.inner.iterator,"normal")}catch(e){return d(s,"throw",e)}return d(s,"normal"),h(void 0,!0)}})},_=y(!0),v=y(!1);r(v,p,"Iterator Helper"),e.exports=function(e,t){var i=function(i,n){n?(n.iterator=i.iterator,n.next=i.next):n=i,n.type=t?m:f,n.nextHandler=e,n.counter=0,n.done=!1,g(this,n)};return i.prototype=t?_:v,i}},5792:(e,t,i)=>{var n=i(8448),s=i(8952),r=i(3951),a=i(6752),o=i(9724),l=i(8696),u=o(function(){var e=this.iterator,t=r(n(this.next,e));if(!(this.done=!!t.done))return l(e,this.mapper,[t.value,this.counter++],!0)});e.exports=function(e){return r(this),s(e),new u(a(this),{mapper:e})}},336:(e,t,i)=>{var n,s,r,a=i(9957),o=i(4328),l=i(1632),u=i(9368),c=i(7796),h=i(6076),d=i(9972),p=i(7048),f=d("iterator"),m=!1;[].keys&&("next"in(r=[].keys())?(s=c(c(r)))!==Object.prototype&&(n=s):m=!0),!l(n)||a(function(){var e={};return n[f].call(e)!==e})?n={}:p&&(n=u(n)),o(n[f])||h(n,f,function(){return this}),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:m}},3556:(e,t,i)=>{var n=i(7584);e.exports=function(e){return n(e.length)}},5312:(e,t,i)=>{var n=i(1664),s=i(9957),r=i(4328),a=i(5152),o=i(3476),l=i(6208).CONFIGURABLE,u=i(9112),c=i(9104),h=c.enforce,d=c.get,p=String,f=Object.defineProperty,m=n("".slice),g=n("".replace),y=n([].join),_=o&&!s(function(){return 8!==f(function(){},"length",{value:8}).length}),v=String(String).split("String"),b=e.exports=function(e,t,i){"Symbol("===m(p(t),0,7)&&(t="["+g(p(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),i&&i.getter&&(t="get "+t),i&&i.setter&&(t="set "+t),(!a(e,"name")||l&&e.name!==t)&&(o?f(e,"name",{value:t,configurable:!0}):e.name=t),_&&i&&a(i,"arity")&&e.length!==i.arity&&f(e,"length",{value:i.arity});try{i&&a(i,"constructor")&&i.constructor?o&&f(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=h(e);return a(n,"source")||(n.source=y(v,"string"==typeof t?t:"")),e};Function.prototype.toString=b(function(){return r(this)&&d(this).source||u(this)},"toString")},1748:e=>{var t=Math.ceil,i=Math.floor;e.exports=Math.trunc||function(e){var n=+e;return(n>0?i:t)(n)}},9368:(e,t,i)=>{var n,s=i(3951),r=i(2056),a=i(8256),o=i(2560),l=i(4168),u=i(8168),c=i(6504),h="prototype",d="script",p=c("IE_PROTO"),f=function(){},m=function(e){return"<"+d+">"+e+"</"+d+">"},g=function(e){e.write(m("")),e.close();var t=e.parentWindow.Object;return e=null,t},y=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t,i;y="undefined"!=typeof document?document.domain&&n?g(n):(t=u("iframe"),i="java"+d+":",t.style.display="none",l.appendChild(t),t.src=String(i),(e=t.contentWindow.document).open(),e.write(m("document.F=Object")),e.close(),e.F):g(n);for(var s=a.length;s--;)delete y[h][a[s]];return y()};o[p]=!0,e.exports=Object.create||function(e,t){var i;return null!==e?(f[h]=s(e),i=new f,f[h]=null,i[p]=e):i=y(),void 0===t?i:r.f(i,t)}},2056:(e,t,i)=>{var n=i(3476),s=i(1576),r=i(8352),a=i(3951),o=i(4096),l=i(1531);t.f=n&&!s?Object.defineProperties:function(e,t){a(e);for(var i,n=o(t),s=l(t),u=s.length,c=0;u>c;)r.f(e,i=s[c++],n[i]);return e}},8352:(e,t,i)=>{var n=i(3476),s=i(9888),r=i(1576),a=i(3951),o=i(88),l=TypeError,u=Object.defineProperty,c=Object.getOwnPropertyDescriptor,h="enumerable",d="configurable",p="writable";t.f=n?r?function(e,t,i){if(a(e),t=o(t),a(i),"function"==typeof e&&"prototype"===t&&"value"in i&&p in i&&!i[p]){var n=c(e,t);n&&n[p]&&(e[t]=i.value,i={configurable:d in i?i[d]:n[d],enumerable:h in i?i[h]:n[h],writable:!1})}return u(e,t,i)}:u:function(e,t,i){if(a(e),t=o(t),a(i),s)try{return u(e,t,i)}catch(e){}if("get"in i||"set"in i)throw new l("Accessors not supported");return"value"in i&&(e[t]=i.value),e}},9444:(e,t,i)=>{var n=i(3476),s=i(8448),r=i(8912),a=i(9728),o=i(4096),l=i(88),u=i(5152),c=i(9888),h=Object.getOwnPropertyDescriptor;t.f=n?h:function(e,t){if(e=o(e),t=l(t),c)try{return h(e,t)}catch(e){}if(u(e,t))return a(!s(r.f,e,t),e[t])}},5048:(e,t,i)=>{var n=i(9008),s=i(8256).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,s)}},9392:(e,t)=>{t.f=Object.getOwnPropertySymbols},7796:(e,t,i)=>{var n=i(5152),s=i(4328),r=i(4356),a=i(6504),o=i(2272),l=a("IE_PROTO"),u=Object,c=u.prototype;e.exports=o?u.getPrototypeOf:function(e){var t=r(e);if(n(t,l))return t[l];var i=t.constructor;return s(i)&&t instanceof i?i.prototype:t instanceof u?c:null}},7e3:(e,t,i)=>{var n=i(1664);e.exports=n({}.isPrototypeOf)},9008:(e,t,i)=>{var n=i(1664),s=i(5152),r=i(4096),a=i(2504).indexOf,o=i(2560),l=n([].push);e.exports=function(e,t){var i,n=r(e),u=0,c=[];for(i in n)!s(o,i)&&s(n,i)&&l(c,i);for(;t.length>u;)s(n,i=t[u++])&&(~a(c,i)||l(c,i));return c}},1531:(e,t,i)=>{var n=i(9008),s=i(8256);e.exports=Object.keys||function(e){return n(e,s)}},8912:(e,t)=>{var i={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,s=n&&!i.call({1:2},1);t.f=s?function(e){var t=n(this,e);return!!t&&t.enumerable}:i},2104:(e,t,i)=>{var n=i(8448),s=i(4328),r=i(1632),a=TypeError;e.exports=function(e,t){var i,o;if("string"===t&&s(i=e.toString)&&!r(o=n(i,e)))return o;if(s(i=e.valueOf)&&!r(o=n(i,e)))return o;if("string"!==t&&s(i=e.toString)&&!r(o=n(i,e)))return o;throw new a("Can't convert object to primitive value")}},9252:(e,t,i)=>{var n=i(5232),s=i(1664),r=i(5048),a=i(9392),o=i(3951),l=s([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=r.f(o(e)),i=a.f;return i?l(t,i(e)):t}},5436:(e,t,i)=>{var n=i(9760),s=TypeError;e.exports=function(e){if(n(e))throw new s("Can't call method on "+e);return e}},6504:(e,t,i)=>{var n=i(4696),s=i(7776),r=n("keys");e.exports=function(e){return r[e]||(r[e]=s(e))}},3976:(e,t,i)=>{var n=i(7048),s=i(6420),r=i(4636),a="__core-js_shared__",o=e.exports=s[a]||r(a,{});(o.versions||(o.versions=[])).push({version:"3.36.0",mode:n?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.36.0/LICENSE",source:"https://github.com/zloirock/core-js"})},4696:(e,t,i)=>{var n=i(3976);e.exports=function(e,t){return n[e]||(n[e]=t||{})}},772:(e,t,i)=>{var n=i(8504),s=i(9957),r=i(6420).String;e.exports=!!Object.getOwnPropertySymbols&&!s(function(){var e=Symbol("symbol detection");return!r(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41})},2495:(e,t,i)=>{var n=i(6180),s=Math.max,r=Math.min;e.exports=function(e,t){var i=n(e);return i<0?s(i+t,0):r(i,t)}},4096:(e,t,i)=>{var n=i(5712),s=i(5436);e.exports=function(e){return n(s(e))}},6180:(e,t,i)=>{var n=i(1748);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},7584:(e,t,i)=>{var n=i(6180),s=Math.min;e.exports=function(e){var t=n(e);return t>0?s(t,9007199254740991):0}},4356:(e,t,i)=>{var n=i(5436),s=Object;e.exports=function(e){return s(n(e))}},7024:(e,t,i)=>{var n=i(8448),s=i(1632),r=i(7728),a=i(4504),o=i(2104),l=i(9972),u=TypeError,c=l("toPrimitive");e.exports=function(e,t){if(!s(e)||r(e))return e;var i,l=a(e,c);if(l){if(void 0===t&&(t="default"),i=n(l,e,t),!s(i)||r(i))return i;throw new u("Can't convert object to primitive value")}return void 0===t&&(t="number"),o(e,t)}},88:(e,t,i)=>{var n=i(7024),s=i(7728);e.exports=function(e){var t=n(e,"string");return s(t)?t:t+""}},36:e=>{var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},7776:(e,t,i)=>{var n=i(1664),s=0,r=Math.random(),a=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++s+r,36)}},6536:(e,t,i)=>{var n=i(772);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},1576:(e,t,i)=>{var n=i(3476),s=i(9957);e.exports=n&&s(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},4288:(e,t,i)=>{var n=i(6420),s=i(4328),r=n.WeakMap;e.exports=s(r)&&/native code/.test(String(r))},9972:(e,t,i)=>{var n=i(6420),s=i(4696),r=i(5152),a=i(7776),o=i(772),l=i(6536),u=n.Symbol,c=s("wks"),h=l?u.for||u:u&&u.withoutSetter||a;e.exports=function(e){return r(c,e)||(c[e]=o&&r(u,e)?u[e]:h("Symbol."+e)),c[e]}},4728:(e,t,i)=>{var n=i(9160),s=i(4356),r=i(3556),a=i(6728),o=i(4316);n({target:"Array",proto:!0,arity:1,forced:i(9957)(function(){return 4294967297!==[].push.call({length:4294967296},1)})||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=s(this),i=r(t),n=arguments.length;o(i+n);for(var l=0;l<n;l++)t[i]=arguments[l],i++;return a(t,i),i}})},3536:(e,t,i)=>{var n=i(9160),s=i(6420),r=i(6100),a=i(3951),o=i(4328),l=i(7796),u=i(2544),c=i(92),h=i(9957),d=i(5152),p=i(9972),f=i(336).IteratorPrototype,m=i(3476),g=i(7048),y="constructor",_="Iterator",v=p("toStringTag"),b=TypeError,T=s[_],w=g||!o(T)||T.prototype!==f||!h(function(){T({})}),S=function(){if(r(this,f),l(this)===f)throw new b("Abstract class Iterator not directly constructable")},E=function(e,t){m?u(f,e,{configurable:!0,get:function(){return t},set:function(t){if(a(this),this===f)throw new b("You can't redefine this property");d(this,e)?this[e]=t:c(this,e,t)}}):f[e]=t};d(f,v)||E(v,_),!w&&d(f,y)&&f[y]!==Object||E(y,S),S.prototype=f,n({global:!0,constructor:!0,forced:w},{Iterator:S})},2144:(e,t,i)=>{var n=i(9160),s=i(8448),r=i(8952),a=i(3951),o=i(6752),l=i(9724),u=i(8696),c=i(7048),h=l(function(){for(var e,t,i=this.iterator,n=this.predicate,r=this.next;;){if(e=a(s(r,i)),this.done=!!e.done)return;if(t=e.value,u(i,n,[t,this.counter++],!0))return t}});n({target:"Iterator",proto:!0,real:!0,forced:c},{filter:function(e){return a(this),r(e),new h(o(this),{predicate:e})}})},9080:(e,t,i)=>{var n=i(9160),s=i(5792);n({target:"Iterator",proto:!0,real:!0,forced:i(7048)},{map:s})}},t={};function i(n){var s=t[n];if(void 0!==s)return s.exports;var r=t[n]={exports:{}};return e[n].call(r.exports,r,r.exports,i),r.exports}i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n={};return(()=>{i.d(n,{default:()=>H}),i(3536),i(2144),i(9080);var e=function(){},t={},s=[],r=[];function a(i,n){var a,o,l,u,c=r;for(u=arguments.length;u-- >2;)s.push(arguments[u]);for(n&&null!=n.children&&(s.length||s.push(n.children),delete n.children);s.length;)if((o=s.pop())&&void 0!==o.pop)for(u=o.length;u--;)s.push(o[u]);else"boolean"==typeof o&&(o=null),(l="function"!=typeof i)&&(null==o?o="":"number"==typeof o?o=String(o):"string"!=typeof o&&(l=!1)),l&&a?c[c.length-1]+=o:c===r?c=[o]:c.push(o),a=l;var h=new e;return h.nodeName=i,h.children=c,h.attributes=null==n?void 0:n,h.key=null==n?void 0:n.key,void 0!==t.vnode&&t.vnode(h),h}function o(e,t){for(var i in t)e[i]=t[i];return e}function l(e,t){e&&("function"==typeof e?e(t):e.current=t)}var u="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,c=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,h=[];function d(e){!e._dirty&&(e._dirty=!0)&&1==h.push(e)&&(t.debounceRendering||u)(p)}function p(){for(var e;e=h.pop();)e._dirty&&D(e)}function f(e,t,i){return"string"==typeof t||"number"==typeof t?void 0!==e.splitText:"string"==typeof t.nodeName?!e._componentConstructor&&m(e,t.nodeName):i||e._componentConstructor===t.nodeName}function m(e,t){return e.normalizedNodeName===t||e.nodeName.toLowerCase()===t.toLowerCase()}function g(e){var t=o({},e.attributes);t.children=e.children;var i=e.nodeName.defaultProps;if(void 0!==i)for(var n in i)void 0===t[n]&&(t[n]=i[n]);return t}function y(e){var t=e.parentNode;t&&t.removeChild(e)}function _(e,t,i,n,s){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)l(i,null),l(n,e);else if("class"!==t||s)if("style"===t){if(n&&"string"!=typeof n&&"string"!=typeof i||(e.style.cssText=n||""),n&&"object"==typeof n){if("string"!=typeof i)for(var r in i)r in n||(e.style[r]="");for(var r in n)e.style[r]="number"==typeof n[r]&&!1===c.test(r)?n[r]+"px":n[r]}}else if("dangerouslySetInnerHTML"===t)n&&(e.innerHTML=n.__html||"");else if("o"==t[0]&&"n"==t[1]){var a=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),n?i||e.addEventListener(t,v,a):e.removeEventListener(t,v,a),(e._listeners||(e._listeners={}))[t]=n}else if("list"!==t&&"type"!==t&&!s&&t in e){try{e[t]=null==n?"":n}catch(e){}null!=n&&!1!==n||"spellcheck"==t||e.removeAttribute(t)}else{var o=s&&t!==(t=t.replace(/^xlink:?/,""));null==n||!1===n?o?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof n&&(o?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),n):e.setAttribute(t,n))}else e.className=n||""}function v(e){return this._listeners[e.type](t.event&&t.event(e)||e)}var b=[],T=0,w=!1,S=!1;function E(){for(var e;e=b.shift();)t.afterMount&&t.afterMount(e),e.componentDidMount&&e.componentDidMount()}function C(e,t,i,n,s,r){T++||(w=null!=s&&void 0!==s.ownerSVGElement,S=null!=e&&!("__preactattr_"in e));var a=k(e,t,i,n,r);return s&&a.parentNode!==s&&s.appendChild(a),--T||(S=!1,r||E()),a}function k(e,t,i,n,s){var r=e,a=w;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||s)?e.nodeValue!=t&&(e.nodeValue=t):(r=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(r,e),x(e,!0))),r.__preactattr_=!0,r;var o,l,u=t.nodeName;if("function"==typeof u)return function(e,t,i,n){for(var s=e&&e._component,r=s,a=e,o=s&&e._componentConstructor===t.nodeName,l=o,u=g(t);s&&!l&&(s=s._parentComponent);)l=s.constructor===t.nodeName;return s&&l&&(!n||s._component)?(O(s,u,3,i,n),e=s.base):(r&&!o&&(M(r),e=a=null),s=L(t.nodeName,u,i),e&&!s.nextBase&&(s.nextBase=e,a=null),O(s,u,1,i,n),e=s.base,a&&e!==a&&(a._component=null,x(a,!1))),e}(e,t,i,n);if(w="svg"===u||"foreignObject"!==u&&w,u=String(u),(!e||!m(e,u))&&(o=u,(l=w?document.createElementNS("http://www.w3.org/2000/svg",o):document.createElement(o)).normalizedNodeName=o,r=l,e)){for(;e.firstChild;)r.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(r,e),x(e,!0)}var c=r.firstChild,h=r.__preactattr_,d=t.children;if(null==h){h=r.__preactattr_={};for(var p=r.attributes,v=p.length;v--;)h[p[v].name]=p[v].value}return!S&&d&&1===d.length&&"string"==typeof d[0]&&null!=c&&void 0!==c.splitText&&null==c.nextSibling?c.nodeValue!=d[0]&&(c.nodeValue=d[0]):(d&&d.length||null!=c)&&function(e,t,i,n,s){var r,a,o,l,u,c=e.childNodes,h=[],d={},p=0,m=0,g=c.length,_=0,v=t?t.length:0;if(0!==g)for(var b=0;b<g;b++){var T=c[b],w=T.__preactattr_;null!=(S=v&&w?T._component?T._component.__key:w.key:null)?(p++,d[S]=T):(w||(void 0!==T.splitText?!s||T.nodeValue.trim():s))&&(h[_++]=T)}if(0!==v)for(b=0;b<v;b++){var S;if(u=null,null!=(S=(l=t[b]).key))p&&void 0!==d[S]&&(u=d[S],d[S]=void 0,p--);else if(m<_)for(r=m;r<_;r++)if(void 0!==h[r]&&f(a=h[r],l,s)){u=a,h[r]=void 0,r===_-1&&_--,r===m&&m++;break}u=k(u,l,i,n),o=c[b],u&&u!==e&&u!==o&&(null==o?e.appendChild(u):u===o.nextSibling?y(o):e.insertBefore(u,o))}if(p)for(var b in d)void 0!==d[b]&&x(d[b],!1);for(;m<=_;)void 0!==(u=h[_--])&&x(u,!1)}(r,d,i,n,S||null!=h.dangerouslySetInnerHTML),function(e,t,i){var n;for(n in i)t&&null!=t[n]||null==i[n]||_(e,n,i[n],i[n]=void 0,w);for(n in t)"children"===n||"innerHTML"===n||n in i&&t[n]===("value"===n||"checked"===n?e[n]:i[n])||_(e,n,i[n],i[n]=t[n],w)}(r,t.attributes,h),w=a,r}function x(e,t){var i=e._component;i?M(i):(null!=e.__preactattr_&&l(e.__preactattr_.ref,null),!1!==t&&null!=e.__preactattr_||y(e),I(e))}function I(e){for(e=e.lastChild;e;){var t=e.previousSibling;x(e,!0),e=t}}var A=[];function L(e,t,i){var n,s=A.length;for(e.prototype&&e.prototype.render?(n=new e(t,i),N.call(n,t,i)):((n=new N(t,i)).constructor=e,n.render=P);s--;)if(A[s].constructor===e)return n.nextBase=A[s].nextBase,A.splice(s,1),n;return n}function P(e,t,i){return this.constructor(e,i)}function O(e,i,n,s,r){e._disable||(e._disable=!0,e.__ref=i.ref,e.__key=i.key,delete i.ref,delete i.key,void 0===e.constructor.getDerivedStateFromProps&&(!e.base||r?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(i,s)),s&&s!==e.context&&(e.prevContext||(e.prevContext=e.context),e.context=s),e.prevProps||(e.prevProps=e.props),e.props=i,e._disable=!1,0!==n&&(1!==n&&!1===t.syncComponentUpdates&&e.base?d(e):D(e,1,r)),l(e.__ref,e))}function D(e,i,n,s){if(!e._disable){var r,a,l,u=e.props,c=e.state,h=e.context,d=e.prevProps||u,p=e.prevState||c,f=e.prevContext||h,m=e.base,y=e.nextBase,_=m||y,v=e._component,w=!1,S=f;if(e.constructor.getDerivedStateFromProps&&(c=o(o({},c),e.constructor.getDerivedStateFromProps(u,c)),e.state=c),m&&(e.props=d,e.state=p,e.context=f,2!==i&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(u,c,h)?w=!0:e.componentWillUpdate&&e.componentWillUpdate(u,c,h),e.props=u,e.state=c,e.context=h),e.prevProps=e.prevState=e.prevContext=e.nextBase=null,e._dirty=!1,!w){r=e.render(u,c,h),e.getChildContext&&(h=o(o({},h),e.getChildContext())),m&&e.getSnapshotBeforeUpdate&&(S=e.getSnapshotBeforeUpdate(d,p));var k,I,A=r&&r.nodeName;if("function"==typeof A){var P=g(r);(a=v)&&a.constructor===A&&P.key==a.__key?O(a,P,1,h,!1):(k=a,e._component=a=L(A,P,h),a.nextBase=a.nextBase||y,a._parentComponent=e,O(a,P,0,h,!1),D(a,1,n,!0)),I=a.base}else l=_,(k=v)&&(l=e._component=null),(_||1===i)&&(l&&(l._component=null),I=C(l,r,h,n||!m,_&&_.parentNode,!0));if(_&&I!==_&&a!==v){var N=_.parentNode;N&&I!==N&&(N.replaceChild(I,_),k||(_._component=null,x(_,!1)))}if(k&&M(k),e.base=I,I&&!s){for(var R=e,F=e;F=F._parentComponent;)(R=F).base=I;I._component=R,I._componentConstructor=R.constructor}}for(!m||n?b.push(e):w||(e.componentDidUpdate&&e.componentDidUpdate(d,p,S),t.afterUpdate&&t.afterUpdate(e));e._renderCallbacks.length;)e._renderCallbacks.pop().call(e);T||s||E()}}function M(e){t.beforeUnmount&&t.beforeUnmount(e);var i=e.base;e._disable=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?M(n):i&&(null!=i.__preactattr_&&l(i.__preactattr_.ref,null),e.nextBase=i,y(i),A.push(e),I(i)),l(e.__ref,null)}function N(e,t){this._dirty=!0,this.context=t,this.props=e,this.state=this.state||{},this._renderCallbacks=[]}o(N.prototype,{setState:function(e,t){this.prevState||(this.prevState=this.state),this.state=o(o({},this.state),"function"==typeof e?e(this.state,this.props):e),t&&this._renderCallbacks.push(t),d(this)},forceUpdate:function(e){e&&this._renderCallbacks.push(e),D(this,2)},render:function(){}}),i(4728);class R extends N{static defaultProps={tQueryTooShort:e=>`Type in ${e} or more characters for results`,tNoResults:()=>"No search results",tSelectedOption:(e,t,i)=>`${e} ${i+1} of ${t} is highlighted`,tResults:(e,t)=>`${e} ${1===e?"result":"results"} ${1===e?"is":"are"} available. ${t}`};state={bump:!1,debounced:!1};componentWillMount(){const e=this;this.debounceStatusUpdate=function(e){let t;return function(){const i=this,n=arguments;clearTimeout(t),t=setTimeout(function(){t=null,e.apply(i,n)},1400)}}(function(){if(!e.state.debounced){const t=!e.props.isInFocus||e.props.validChoiceMade;e.setState(({bump:e})=>({bump:!e,debounced:!0,silenced:t}))}})}componentWillReceiveProps({queryLength:e}){this.setState({debounced:!1})}render(){const{id:e,length:t,queryLength:i,minQueryLength:n,selectedOption:s,selectedOptionIndex:r,tQueryTooShort:o,tNoResults:l,tSelectedOption:u,tResults:c,className:h}=this.props,{bump:d,debounced:p,silenced:f}=this.state,m=i<n,g=0===t,y=s?u(s,t,r):"";let _=null;return _=m?o(n):g?l():c(t,y),this.debounceStatusUpdate(),a("div",{className:h,style:{border:"0",clip:"rect(0 0 0 0)",height:"1px",marginBottom:"-1px",marginRight:"-1px",overflow:"hidden",padding:"0",position:"absolute",whiteSpace:"nowrap",width:"1px"}},a("div",{id:e+"__status--A",role:"status","aria-atomic":"true","aria-live":"polite"},!f&&p&&d?_:""),a("div",{id:e+"__status--B",role:"status","aria-atomic":"true","aria-live":"polite"},f||!p||d?"":_))}}const F=({className:e})=>a("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",className:e,focusable:"false"},a("g",{stroke:"none",fill:"none","fill-rule":"evenodd"},a("polygon",{fill:"#000000",points:"0 0 22 0 11 17"})));function B(){return B=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},B.apply(this,arguments)}const U={13:"enter",27:"escape",32:"space",38:"up",40:"down"};function j(){return"undefined"!=typeof navigator&&!(!navigator.userAgent.match(/(iPod|iPhone|iPad)/g)||!navigator.userAgent.match(/AppleWebKit/g))}class $ extends N{static defaultProps={autoselect:!1,cssNamespace:"autocomplete",defaultValue:"",displayMenu:"inline",minLength:0,name:"input-autocomplete",placeholder:"",onConfirm:()=>{},confirmOnBlur:!0,showNoOptionsFound:!0,showAllValues:!1,required:!1,tNoResults:()=>"No results found",tAssistiveHint:()=>"When autocomplete results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures.",dropdownArrow:F,menuAttributes:{},inputClasses:null,hintClasses:null,menuClasses:null};elementReferences={};constructor(e){super(e),this.state={focused:null,hovered:null,menuOpen:!1,options:e.defaultValue?[e.defaultValue]:[],query:e.defaultValue,validChoiceMade:!1,selected:null,ariaHint:!0},this.handleComponentBlur=this.handleComponentBlur.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleUpArrow=this.handleUpArrow.bind(this),this.handleDownArrow=this.handleDownArrow.bind(this),this.handleEnter=this.handleEnter.bind(this),this.handlePrintableKey=this.handlePrintableKey.bind(this),this.handleListMouseLeave=this.handleListMouseLeave.bind(this),this.handleOptionBlur=this.handleOptionBlur.bind(this),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleOptionFocus=this.handleOptionFocus.bind(this),this.handleOptionMouseDown=this.handleOptionMouseDown.bind(this),this.handleOptionMouseEnter=this.handleOptionMouseEnter.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleInputClick=this.handleInputClick.bind(this),this.handleInputFocus=this.handleInputFocus.bind(this),this.pollInputElement=this.pollInputElement.bind(this),this.getDirectInputChanges=this.getDirectInputChanges.bind(this)}isQueryAnOption(e,t){return-1!==t.map(e=>this.templateInputValue(e).toLowerCase()).indexOf(e.toLowerCase())}componentDidMount(){this.pollInputElement()}componentWillUnmount(){clearTimeout(this.$pollInput)}pollInputElement(){this.getDirectInputChanges(),this.$pollInput=setTimeout(()=>{this.pollInputElement()},100)}getDirectInputChanges(){const e=this.elementReferences[-1];e&&e.value!==this.state.query&&this.handleInputChange({target:{value:e.value}})}componentDidUpdate(e,t){const{focused:i}=this.state,n=null===i,s=t.focused!==i;s&&!n&&this.elementReferences[i].focus();const r=-1===i,a=s&&null===t.focused;if(r&&a){const e=this.elementReferences[i];e.setSelectionRange(0,e.value.length)}}hasAutoselect(){return!j()&&this.props.autoselect}templateInputValue(e){const t=this.props.templates&&this.props.templates.inputValue;return t?t(e):e}templateSuggestion(e){const t=this.props.templates&&this.props.templates.suggestion;return t?t(e):e}handleComponentBlur(e){const{options:t,query:i,selected:n}=this.state;let s;this.props.confirmOnBlur?(s=e.query||i,this.props.onConfirm(t[n])):s=i,this.setState({focused:null,menuOpen:e.menuOpen||!1,query:s,selected:null,validChoiceMade:this.isQueryAnOption(s,t)})}handleListMouseLeave(e){this.setState({hovered:null})}handleOptionBlur(e,t){const{focused:i,menuOpen:n,options:s,selected:r}=this.state,a=null===e.relatedTarget,o=e.relatedTarget===this.elementReferences[-1],l=i!==t&&-1!==i;if(!l&&a||!l&&!o){const e=n&&j();this.handleComponentBlur({menuOpen:e,query:this.templateInputValue(s[r])})}}handleInputBlur(e){const{focused:t,menuOpen:i,options:n,query:s,selected:r}=this.state;if(-1===t){const e=i&&j(),t=j()?s:this.templateInputValue(n[r]);this.handleComponentBlur({menuOpen:e,query:t})}}handleInputChange(e){const{minLength:t,source:i,showAllValues:n}=this.props,s=this.hasAutoselect(),r=e.target.value,a=0===r.length,o=this.state.query!==r,l=r.length>=t;this.setState({query:r,ariaHint:a}),n||!a&&o&&l?i(r,e=>{const t=e.length>0;this.setState({menuOpen:t,options:e,selected:s&&t?0:-1,validChoiceMade:!1})}):!a&&l||this.setState({menuOpen:!1,options:[]})}handleInputClick(e){this.handleInputChange(e)}handleInputFocus(e){const{query:t,validChoiceMade:i,options:n}=this.state,{minLength:s}=this.props,r=!i&&t.length>=s&&n.length>0;r?this.setState(({menuOpen:e})=>({focused:-1,menuOpen:r||e,selected:-1})):this.setState({focused:-1})}handleOptionFocus(e){this.setState({focused:e,hovered:null,selected:e})}handleOptionMouseEnter(e,t){j()||this.setState({hovered:t})}handleOptionClick(e,t){const i=this.state.options[t],n=this.templateInputValue(i);this.props.onConfirm(i),this.setState({focused:-1,hovered:null,menuOpen:!1,query:n,selected:-1,validChoiceMade:!0}),this.forceUpdate()}handleOptionMouseDown(e){e.preventDefault()}handleUpArrow(e){e.preventDefault();const{menuOpen:t,selected:i}=this.state;-1!==i&&t&&this.handleOptionFocus(i-1)}handleDownArrow(e){if(e.preventDefault(),this.props.showAllValues&&!1===this.state.menuOpen)e.preventDefault(),this.props.source("",e=>{this.setState({menuOpen:!0,options:e,selected:0,focused:0,hovered:null})});else if(!0===this.state.menuOpen){const{menuOpen:e,options:t,selected:i}=this.state;i!==t.length-1&&e&&this.handleOptionFocus(i+1)}}handleSpace(e){this.props.showAllValues&&!1===this.state.menuOpen&&""===this.state.query&&(e.preventDefault(),this.props.source("",e=>{this.setState({menuOpen:!0,options:e})})),-1!==this.state.focused&&(e.preventDefault(),this.handleOptionClick(e,this.state.focused))}handleEnter(e){this.state.menuOpen&&(e.preventDefault(),this.state.selected>=0&&this.handleOptionClick(e,this.state.selected))}handlePrintableKey(e){const t=this.elementReferences[-1];e.target===t||t.focus()}handleKeyDown(e){switch(U[e.keyCode]){case"up":this.handleUpArrow(e);break;case"down":this.handleDownArrow(e);break;case"space":this.handleSpace(e);break;case"enter":this.handleEnter(e);break;case"escape":this.handleComponentBlur({query:this.state.query});break;default:((t=e.keyCode)>47&&t<58||32===t||8===t||t>64&&t<91||t>95&&t<112||t>185&&t<193||t>218&&t<223)&&this.handlePrintableKey(e)}var t}render(){const{cssNamespace:e,displayMenu:t,id:i,minLength:n,name:s,placeholder:r,required:o,showAllValues:l,tNoResults:u,tStatusQueryTooShort:c,tStatusNoResults:h,tStatusSelectedOption:d,tStatusResults:p,tAssistiveHint:f,dropdownArrow:m,menuAttributes:g,inputClasses:y,hintClasses:_,menuClasses:v}=this.props,{focused:b,hovered:T,menuOpen:w,options:S,query:E,selected:C,ariaHint:k,validChoiceMade:x}=this.state,I=this.hasAutoselect(),A=-1===b,L=0===S.length,P=0!==E.length,O=E.length>=n,D=this.props.showNoOptionsFound&&A&&L&&P&&O,M=`${e}__wrapper`,N=`${e}__status`,F=`${e}__dropdown-arrow-down`,U=-1!==b&&null!==b,$=`${e}__option`,q=`${e}__hint`,V=this.templateInputValue(S[C]),H=V&&0===V.toLowerCase().indexOf(E.toLowerCase())&&I?E+V.substr(E.length):"",z=i+"__assistiveHint",W={"aria-describedby":k?z:null,"aria-expanded":w?"true":"false","aria-activedescendant":U?`${i}__option--${b}`:null,"aria-controls":`${i}__listbox`,"aria-autocomplete":this.hasAutoselect()?"both":"list"};let G;l&&(G=m({className:F}),"string"==typeof G&&(G=a("div",{className:`${e}__dropdown-arrow-down-wrapper`,dangerouslySetInnerHTML:{__html:G}})));const X=`${e}__input`,K=[X,this.props.showAllValues?`${X}--show-all-values`:`${X}--default`];null!==b&&K.push(`${X}--focused`),y&&K.push(y);const Y=`${e}__menu`,Q=[Y,`${Y}--${t}`,`${Y}--${w||D?"visible":"hidden"}`];v&&Q.push(v),(g?.class||g?.className)&&Q.push(g?.class||g?.className);const J={"aria-labelledby":i,...g,id:`${i}__listbox`,role:"listbox",className:Q.join(" "),onMouseLeave:this.handleListMouseLeave};return delete J.class,a("div",{className:M,onKeyDown:this.handleKeyDown},a(R,{id:i,length:S.length,queryLength:E.length,minQueryLength:n,selectedOption:this.templateInputValue(S[C]),selectedOptionIndex:C,validChoiceMade:x,isInFocus:null!==this.state.focused,tQueryTooShort:c,tNoResults:h,tSelectedOption:d,tResults:p,className:N}),H&&a("span",null,a("input",{className:[q,null===_?y:_].filter(Boolean).join(" "),readonly:!0,tabIndex:"-1",value:H})),a("input",B({},W,{autoComplete:"off",className:K.join(" "),id:i,onClick:this.handleInputClick,onBlur:this.handleInputBlur},{onInput:this.handleInputChange},{onFocus:this.handleInputFocus,name:s,placeholder:r,ref:e=>{this.elementReferences[-1]=e},type:"text",role:"combobox",required:o,value:E})),G,a("ul",J,S.map((e,t)=>{const n=(-1===b?C===t:b===t)&&null===T?` ${$}--focused`:"",s=t%2?` ${$}--odd`:"",r=j()?`<span id=${i}__option-suffix--${t} style="border:0;clip:rect(0 0 0 0);height:1px;marginBottom:-1px;marginRight:-1px;overflow:hidden;padding:0;position:absolute;whiteSpace:nowrap;width:1px"> ${t+1} of ${S.length}</span>`:"";return a("li",{"aria-selected":b===t?"true":"false",className:`${$}${n}${s}`,dangerouslySetInnerHTML:{__html:this.templateSuggestion(e)+r},id:`${i}__option--${t}`,key:t,onBlur:e=>this.handleOptionBlur(e,t),onClick:e=>this.handleOptionClick(e,t),onMouseDown:this.handleOptionMouseDown,onMouseEnter:e=>this.handleOptionMouseEnter(e,t),ref:e=>{this.elementReferences[t]=e},role:"option",tabIndex:"-1","aria-posinset":t+1,"aria-setsize":S.length})}),D&&a("li",{className:`${$} ${$}--no-results`,role:"option","aria-disabled":"true"},u())),a("span",{id:z,style:{display:"none"}},f()))}}function q(e){if(!e.element)throw new Error("element is not defined");if(!e.id)throw new Error("id is not defined");if(!e.source)throw new Error("source is not defined");Array.isArray(e.source)&&(e.source=V(e.source)),function(e,t,i){C(i,e,{},!1,t,!1)}(a($,e),e.element)}const V=e=>(t,i)=>{i(e.filter(e=>-1!==e.toLowerCase().indexOf(t.toLowerCase())))};q.enhanceSelectElement=e=>{if(!e.selectElement)throw new Error("selectElement is not defined");if(!e.source){const t=[].filter.call(e.selectElement.options,t=>t.value||e.preserveNullOptions);e.source=t.map(e=>e.textContent||e.innerText)}if(e.onConfirm=e.onConfirm||(t=>{const i=[].filter.call(e.selectElement.options,e=>(e.textContent||e.innerText)===t)[0];i&&(i.selected=!0)}),e.selectElement.value||void 0===e.defaultValue){const t=e.selectElement.options[e.selectElement.options.selectedIndex];e.defaultValue=t.textContent||t.innerText}void 0===e.name&&(e.name=""),void 0===e.id&&(void 0===e.selectElement.id?e.id="":e.id=e.selectElement.id),void 0===e.autoselect&&(e.autoselect=!0);const t=document.createElement("div");e.selectElement.parentNode.insertBefore(t,e.selectElement),q({...e,element:t}),e.selectElement.style.display="none",e.selectElement.id=e.selectElement.id+"-select"};const H=q})(),n.default})(),e.exports=i()});ka.accessibleAutocomplete;const xa={autocomplete:[]},Ia="autocomplete-list-show",Aa="data-bs-autocomplete",La="input["+Aa+'][type="search"]';class Pa extends Hi{constructor(e,t){super(e),this._config=this._getConfig(t),this._items=[],this._autocompleteElement=null,this._label=new en(e),this._init(),this._bindEvents()}static get NAME(){return"inputsearchautocomplete"}search(){const e=this._element.value;
|
||
//!!! $autocomplete.empty()
|
||
this._autocompleteElement.innerHTML="",e?this._items.forEach(t=>{let i=new RegExp("("+e+")","gi"),n=t.text.replace(i,"<mark>$1</mark>"),s=t.label?"<em>"+t.label+"</em>":"",r=t.icon?t.icon:"",a=t.link?t.link:"#";-1!==n.toLowerCase().indexOf(e.toLowerCase())&&(this._autocompleteElement.classList.add(Ia),this._autocompleteElement.appendChild(this._createOption(a,n,s,r)))}):this._autocompleteElement.classList.remove(Ia)}_getConfig(e){return e={...xa,..."object"==typeof e?e:{}}}_getItems(){try{return JSON.parse(this._element.getAttribute(Aa))}catch(e){return console.error("[InputSearchAutocomplete] invalid data provided for "+Aa+" attribute",e),[]}}_init(){if(this._element.classList.contains("autocomplete")){if("undefined"==typeof document)return;this._items=this._getItems(),this._autocompleteElement=document.createElement("ul"),this._autocompleteElement.classList.add("autocomplete-list"),this._element.parentNode.insertBefore(this._autocompleteElement,this._element.nextSibling)}}_bindEvents(){Bi.on(this._element,"keyup.bs.inputsearchautocomplete",()=>this.search())}_createOption(e,t,i,n){if("undefined"==typeof document)return;const s=document.createElement("li");return s.innerHTML=`<a href="${e}">\n ${n}\n <span class="autocomplete-list-text">\n <span>${t}</span>\n ${i}\n </span>\n </a>`,s}}"undefined"!=typeof document&&document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll(La+", label").forEach(function(e){const t=en.getInputFromLabel(e)||e;var i;(i=t)&&i.matches(La)&&Pa.getOrCreateInstance(i)})});const Oa=".bs.inputpassword",Da=".data-api",Ma={shortPass:"Password troppo breve",badPass:"Password debole.",goodPass:"Password abbastanza sicura.",strongPass:"Password sicura.",minimumLength:8,suggestionsLabel:"Suggerimenti per una buona password:",suggestionFollowed:"suggerimenti seguito",suggestionFollowedPlural:"suggerimenti seguiti",suggestionOf:"di",suggestionMetLabel:"Soddisfatto: ",suggestionMetIconPath:"\n M9.6 16.9 4 11.4l.8-.7 4.8 4.8 8.5-8.4.7.7-9.2 9.1z\n ",suggestionLength:"Almeno {minLength} caratteri.",suggestionUppercase:"Una o più maiuscole.",suggestionLowercase:"Una o più minuscole.",suggestionNumber:"Uno o più numeri.",suggestionSpecial:"Uno o più caratteri speciali."},Na=`click${Oa}`,Ra=`keyup${Oa}`,Fa=`score${Oa}`,Ba=`text${Oa}`,Ua=`suggs${Oa}`,ja=`click${Oa}${Da}`,$a=`mousedown${Oa}${Da}`,qa=`keyup${Oa}${Da}`,Va='input[data-bs-input][type="password"]',Ha=".password-icon";class za extends Hi{constructor(e,t){super(e),this._config=this._getConfig(t),this._isCustom=this._element.classList.contains("input-password"),this._meter=this._element.parentNode.querySelector(".password-strength-meter"),this._grayBarElement=null,this._colorBarElement=null,this._textElement=null,this._suggsElement=null,this._showPwdElement=null,this._text={},this._label=new en(e),this._suggestions=[{key:"length",text:e=>e.suggestionLength.replace("{minLength}",e.minimumLength.toString()),test:(e,t)=>e.length>=t.minimumLength},{key:"uppercase",text:e=>e.suggestionUppercase,test:e=>/[A-Z]/.test(e)},{key:"lowercase",text:e=>e.suggestionLowercase,test:e=>/[a-z]/.test(e)},{key:"number",text:e=>e.suggestionNumber,test:e=>/[0-9]/.test(e)},{key:"special",text:e=>e.suggestionSpecial,test:e=>/[^A-Za-z0-9]/.test(e)}],this._init(),this._bindEvents()}static get NAME(){return"inputpassword"}_getConfig(e){return e={...Ma,...qi.getDataAttributes(this._element),..."object"==typeof e?e:{}}}_init(){this._isCustom&&(this._handleAutofill(),this._showPwdElement=zi.findOne(Ha,this._element.parentNode),this._meter&&(this._grayBarElement=this._meter.querySelector(".password-meter"),this._colorBarElement=this._meter.querySelector(".progress-bar"),this._textElement=this._meter.querySelector(".strength-meter-info"),this._suggsElement=this._meter.querySelector(".strenght-meter-suggestions"),this._textElement&&(this._config=Object.assign({},this._config,{...qi.getDataAttributes(this._textElement)})),this._suggsElement&&this._createsuggestionsList()))}_bindEvents(){this._isCustom&&(this._showPwdElement&&Bi.on(this._showPwdElement,Na,()=>this._toggleShowPassword()),this._meter&&(Bi.on(this._element,Ra,()=>this._checkPassword()),Bi.on(this._element,"input",()=>this._checkPassword())))}_handleAutofill(){const e=()=>{""!==this._element.value&&(this._label._labelOut(),this._checkPassword())};e(),setTimeout(e,100),Bi.on(this._element,"animationstart",t=>{"onAutoFillStart"===t.animationName&&e()})}_toggleShowPassword(){const e="password"===this._element.getAttribute("type");zi.find('[class^="password-icon"]',this._showPwdElement).forEach(e=>e.classList.toggle("d-none")),this._element.setAttribute("type",e?"text":"password"),this._showPwdElement.setAttribute("aria-checked",e.toString())}_checkPassword(){const e=this._element.value,t=this._calculateScore(e);this._updateMeter(t),this._updateText(t,e),this._updateSuggestions(e)}_updateMeter(e){const t=e<0?0:e;this._colorBarElement&&(this._colorBarElement.classList.forEach(e=>{e.match(/(^|\s)bg-\S+/g)&&this._colorBarElement.classList.remove(e)}),this._colorBarElement.classList.add(`bg-${this._scoreColor(e)}`),this._colorBarElement.style.width=`${t}%`,this._colorBarElement.setAttribute("aria-valuenow",t)),Bi.trigger(this._element,Fa)}_updateText(e,t){if(this._textElement){let i=this._scoreText(e);if(this._suggsElement){const{completedCount:e,totalCount:n}=this._getCompletedSuggestions(t),s=1===e?this._config.suggestionFollowed:this._config.suggestionFollowedPlural;i+=` ${e} ${this._config.suggestionOf} ${n} ${s}.`}this._textElement.textContent!==i&&(this._textElement.textContent=i,this._textElement.classList.forEach(e=>{e.match(/(^|\s)text-\S+/g)&&this._textElement.classList.remove(e)}),this._textElement.classList.add(`text-${this._scoreColor(e)}`),Bi.trigger(this._element,Ba))}}_updateSuggestions(e){this._suggsElement&&(this._updateSuggestionsList(e),Bi.trigger(this._element,Ua))}_getCompletedSuggestions(e){let t=0;const i=this._suggestions.length;return this._suggestions.forEach(i=>{i.test(e,this._config)&&t++}),{completedCount:t,totalCount:i}}_createsuggestionsList(){if(this._suggsElement.querySelector(".password-suggestions"))return;const e=document.createElement("label");e.className="visually-hidden",e.htmlFor="suggestions",e.textContent=Ma.suggestionsLabel;const t=document.createElement("div");t.id="suggestions",t.className="password-suggestions",this._suggestions.forEach(e=>{const i=document.createElement("div");i.className="suggestion",i.dataset.suggestion=e.key;const n=this._createIconCheck(),s=document.createElement("span");s.textContent=e.text(this._config),i.appendChild(n),i.appendChild(s),t.appendChild(i)}),this._suggsElement.appendChild(e),this._suggsElement.appendChild(t)}_createIconCheck(){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttribute("class","icon icon-xs me-1 d-none"),e.setAttribute("aria-label",this._config.suggestionMetLabel),e.setAttribute("viewBox","0 0 24 24"),e.style.width="1em",e.style.height="1em";const t=document.createElementNS("http://www.w3.org/2000/svg","path");return t.setAttribute("d",this._config.suggestionMetIconPath.trim()),e.appendChild(t),e}_updateSuggestionsList(e){this._suggsElement&&this._suggestions.forEach(t=>{const i=this._suggsElement.querySelector(`[data-suggestion="${t.key}"]`);if(i){const n=t.test(e,this._config),s=i.querySelector(".icon");s&&s.classList.toggle("d-none",!n)}})}_scoreText(e){return-1===e?this._config.shortPass:-2===e?"":(e=e<0?0:e)<26||e<51?this._config.badPass:e<76?this._config.goodPass:this._config.strongPass}_scoreColor(e){return-1===e||-2===e||e<26?"danger":e<51?"warning":"success"}_calculateScore(e){var t=0;if(0===e.trim().length)return-2;if(e.length<this._config.minimumLength)return-1;t+=4*e.length,t+=this._checkRepetition(1,e).length-e.length,t+=this._checkRepetition(2,e).length-e.length,t+=this._checkRepetition(3,e).length-e.length,t+=this._checkRepetition(4,e).length-e.length,e.match(/(.*[0-9].*[0-9].*[0-9])/)&&(t+=5);var i=".*[!,@,#,$,%,^,&,*,?,_,~]";return i=new RegExp("("+i+i+")"),e.match(i)&&(t+=5),e.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)&&(t+=10),e.match(/([a-zA-Z])/)&&e.match(/([0-9])/)&&(t+=15),e.match(/([!,@,#,$,%,^,&,*,?,_,~])/)&&e.match(/([0-9])/)&&(t+=15),e.match(/([!,@,#,$,%,^,&,*,?,_,~])/)&&e.match(/([a-zA-Z])/)&&(t+=15),(e.match(/^\w+$/)||e.match(/^\d+$/))&&(t-=10),t>100&&(t=100),t<0&&(t=0),t}_checkRepetition(e,t){for(var i="",n=!1,s=0;s<t.length;s++){n=!0;for(var r=0;r<e&&r+s+e<t.length;r++)n=n&&t.charAt(r+s)===t.charAt(r+s+e);r<e&&(n=!1),n?(s+=e-1,n=!1):i+=t.charAt(s)}return i}}if("undefined"!=typeof window&&"undefined"!=typeof document){const e=e=>e&&e.matches(Va)?za.getOrCreateInstance(e):null,t=()=>{const e=zi.findOne(Va);e&&za.getOrCreateInstance(e)};"loading"!==document.readyState?t():document.addEventListener("DOMContentLoaded",t),Bi.on(document,$a,Va+", label",function(){const t=en.getInputFromLabel(this)||this;e(t)}),Bi.on(document,qa,Va+", label",function(){const t=en.getInputFromLabel(this)||this,i=e(t);i&&i._label&&i._label._labelOut()}),Bi.on(document,ja,Ha,function(){const e=this.parentNode&&this.parentNode.querySelector(Va);e&&za.getOrCreateInstance(e)})}var Wa,Ga=Ca(function(e,t){
|
||
/*! Shifty 2.20.4 - https://github.com/jeremyckahn/shifty */
|
||
!function(t,i){e.exports=i()}(0,function(){return(()=>{var e={720:(e,t,i)=>{i.r(t),i.d(t,{Scene:()=>ht,Tweenable:()=>we,interpolate:()=>rt,processTweens:()=>fe,setBezierFunction:()=>V,shouldScheduleUpdate:()=>ye,tween:()=>Se,unsetBezierFunction:()=>H});var n={};i.r(n),i.d(n,{bounce:()=>N,bouncePast:()=>R,easeFrom:()=>B,easeFromTo:()=>F,easeInBack:()=>I,easeInCirc:()=>E,easeInCubic:()=>u,easeInExpo:()=>T,easeInOutBack:()=>L,easeInOutCirc:()=>k,easeInOutCubic:()=>h,easeInOutExpo:()=>S,easeInOutQuad:()=>l,easeInOutQuart:()=>f,easeInOutQuint:()=>y,easeInOutSine:()=>b,easeInQuad:()=>a,easeInQuart:()=>d,easeInQuint:()=>m,easeInSine:()=>_,easeOutBack:()=>A,easeOutBounce:()=>x,easeOutCirc:()=>C,easeOutCubic:()=>c,easeOutExpo:()=>w,easeOutQuad:()=>o,easeOutQuart:()=>p,easeOutQuint:()=>g,easeOutSine:()=>v,easeTo:()=>U,elastic:()=>P,linear:()=>r,swingFrom:()=>D,swingFromTo:()=>O,swingTo:()=>M});var s={};i.r(s),i.d(s,{afterTween:()=>et,beforeTween:()=>Ze,doesApply:()=>Qe,tweenCreated:()=>Je});
|
||
/*!
|
||
* All equations are adapted from Thomas Fuchs'
|
||
* [Scripty2](https://github.com/madrobby/scripty2/blob/master/src/effects/transitions/penner.js).
|
||
*
|
||
* Based on Easing Equations (c) 2003 [Robert
|
||
* Penner](http://www.robertpenner.com/), all rights reserved. This work is
|
||
* [subject to terms](http://www.robertpenner.com/easing_terms_of_use.html).
|
||
*/
|
||
/*!
|
||
* TERMS OF USE - EASING EQUATIONS
|
||
* Open source under the BSD License.
|
||
* Easing Equations (c) 2003 Robert Penner, all rights reserved.
|
||
*/
|
||
var r=function(e){return e},a=function(e){return Math.pow(e,2)},o=function(e){return-(Math.pow(e-1,2)-1)},l=function(e){return(e/=.5)<1?.5*Math.pow(e,2):-.5*((e-=2)*e-2)},u=function(e){return Math.pow(e,3)},c=function(e){return Math.pow(e-1,3)+1},h=function(e){return(e/=.5)<1?.5*Math.pow(e,3):.5*(Math.pow(e-2,3)+2)},d=function(e){return Math.pow(e,4)},p=function(e){return-(Math.pow(e-1,4)-1)},f=function(e){return(e/=.5)<1?.5*Math.pow(e,4):-.5*((e-=2)*Math.pow(e,3)-2)},m=function(e){return Math.pow(e,5)},g=function(e){return Math.pow(e-1,5)+1},y=function(e){return(e/=.5)<1?.5*Math.pow(e,5):.5*(Math.pow(e-2,5)+2)},_=function(e){return 1-Math.cos(e*(Math.PI/2))},v=function(e){return Math.sin(e*(Math.PI/2))},b=function(e){return-.5*(Math.cos(Math.PI*e)-1)},T=function(e){return 0===e?0:Math.pow(2,10*(e-1))},w=function(e){return 1===e?1:1-Math.pow(2,-10*e)},S=function(e){return 0===e?0:1===e?1:(e/=.5)<1?.5*Math.pow(2,10*(e-1)):.5*(2-Math.pow(2,-10*--e))},E=function(e){return-(Math.sqrt(1-e*e)-1)},C=function(e){return Math.sqrt(1-Math.pow(e-1,2))},k=function(e){return(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},x=function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},I=function(e){var t=1.70158;return e*e*((t+1)*e-t)},A=function(e){var t=1.70158;return(e-=1)*e*((t+1)*e+t)+1},L=function(e){var t=1.70158;return(e/=.5)<1?e*e*((1+(t*=1.525))*e-t)*.5:.5*((e-=2)*e*((1+(t*=1.525))*e+t)+2)},P=function(e){return-1*Math.pow(4,-8*e)*Math.sin((6*e-1)*(2*Math.PI)/2)+1},O=function(e){var t=1.70158;return(e/=.5)<1?e*e*((1+(t*=1.525))*e-t)*.5:.5*((e-=2)*e*((1+(t*=1.525))*e+t)+2)},D=function(e){var t=1.70158;return e*e*((t+1)*e-t)},M=function(e){var t=1.70158;return(e-=1)*e*((t+1)*e+t)+1},N=function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},R=function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?2-(7.5625*(e-=1.5/2.75)*e+.75):e<2.5/2.75?2-(7.5625*(e-=2.25/2.75)*e+.9375):2-(7.5625*(e-=2.625/2.75)*e+.984375)},F=function(e){return(e/=.5)<1?.5*Math.pow(e,4):-.5*((e-=2)*Math.pow(e,3)-2)},B=function(e){return Math.pow(e,4)},U=function(e){return Math.pow(e,.25)};function j(e,t,i,n,s,r){var a,o,l=0,u=0,c=0,h=0,d=0,p=0,f=function(e){return((l*e+u)*e+c)*e},m=function(e){return(3*l*e+2*u)*e+c},g=function(e){return e>=0?e:0-e};return l=1-(c=3*t)-(u=3*(n-t)-c),h=1-(p=3*i)-(d=3*(s-i)-p),a=e,o=function(e){return 1/(200*e)}(r),function(e){return((h*e+d)*e+p)*e}(function(e,t){var i,n,s,r,a,o;for(s=e,o=0;o<8;o++){if(r=f(s)-e,g(r)<t)return s;if(a=m(s),g(a)<1e-6)break;s-=r/a}if((s=e)<(i=0))return i;if(s>(n=1))return n;for(;i<n;){if(r=f(s),g(r-e)<t)return s;e>r?i=s:n=s,s=.5*(n-i)+i}return s}(a,o))}var $,q=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.25,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.25,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.75,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.75;return function(s){return j(s,e,t,i,n,1)}},V=function(e,t,i,n,s){var r=q(t,i,n,s);return r.displayName=e,r.x1=t,r.y1=i,r.x2=n,r.y2=s,we.formulas[e]=r},H=function(e){return delete we.formulas[e]};function z(e,t,i){return t&&function(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)}}(e.prototype,t),e}function W(e){return W="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},W(e)}function G(e){return function(e){if(Array.isArray(e))return X(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return X(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return X(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function X(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function K(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function Y(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?K(Object(i),!0).forEach(function(t){Q(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):K(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function Q(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var J,Z,ee,te="linear",ie=1e3/60,ne="undefined"!=typeof window?window:Ea,se="afterTween",re="beforeTween",ae="string",oe=ne.requestAnimationFrame||ne.webkitRequestAnimationFrame||ne.oRequestAnimationFrame||ne.msRequestAnimationFrame||ne.mozCancelRequestAnimationFrame&&ne.mozRequestAnimationFrame||setTimeout,le=function(){},ue=null,ce=null,he=Y({},n),de=function(e,t,i,n,s,r,a){var o,l,u,c=e<r?0:(e-r)/s,h=!1;for(var d in a&&a.call&&(h=!0,o=a(c)),t)h||(o=((l=a[d]).call?l:he[l])(c)),u=i[d],t[d]=u+(n[d]-u)*o;return t},pe=function(e,t){var i=e._timestamp,n=e._currentState,s=e._delay;if(!(t<i+s)){var r=e._duration,a=e._targetState,o=i+s+r,l=t>o?o:t;e._hasEnded=l>=o;var u=r-(o-l),c=e._filters.length>0;if(e._hasEnded)return e._render(a,e._data,u),e.stop(!0);c&&e._applyFilter(re),l<i+s?i=r=l=1:i+=s,de(l,n,e._originalState,a,r,i,e._easing),c&&e._applyFilter(se),e._render(n,e._data,u)}},fe=function(){for(var e,t=we.now(),i=ue;i;)e=i._next,pe(i,t),i=e},me=Date.now||function(){return+new Date},ge=!1,ye=function(e){e&&ge||(ge=e,e&&_e())},_e=function e(){J=me(),ge&&oe.call(ne,e,ie),fe()},ve=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:te,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Array.isArray(t))return q.apply(void 0,G(t));var n=W(t);if(he[t])return he[t];if(n===ae||"function"===n)for(var s in e)i[s]=t;else for(var r in e)i[r]=t[r]||te;return i},be=function(e){e===ue?(ue=e._next)?ue._previous=null:ce=null:e===ce?(ce=e._previous)?ce._next=null:ue=null:(Z=e._previous,ee=e._next,Z._next=ee,ee._previous=Z),e._previous=e._next=null},Te="function"==typeof Promise?Promise:null;$=Symbol.toStringTag;var we=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Q(this,$,"Promise"),this._config={},this._data={},this._delay=0,this._filters=[],this._next=null,this._previous=null,this._timestamp=null,this._hasEnded=!1,this._resolve=null,this._reject=null,this._currentState=t||{},this._originalState={},this._targetState={},this._start=le,this._render=le,this._promiseCtor=Te,i&&this.setConfig(i)}return z(e,[{key:"_applyFilter",value:function(e){for(var t=this._filters.length;t>0;t--){var i=this._filters[t-t][e];i&&i(this)}}},{key:"tween",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return this._isPlaying&&this.stop(),!t&&this._config||this.setConfig(t),this._pausedAtTime=null,this._timestamp=e.now(),this._start(this.get(),this._data),this._delay&&this._render(this._currentState,this._data,0),this._resume(this._timestamp)}},{key:"setConfig",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this._config;for(var n in t)i[n]=t[n];var s=i.promise,r=void 0===s?this._promiseCtor:s,a=i.start,o=void 0===a?le:a,l=i.finish,u=i.render,c=void 0===u?this._config.step||le:u,h=i.step,d=void 0===h?le:h;this._data=i.data||i.attachment||this._data,this._isPlaying=!1,this._pausedAtTime=null,this._scheduleId=null,this._delay=t.delay||0,this._start=o,this._render=c||d,this._duration=i.duration||500,this._promiseCtor=r,l&&(this._resolve=l);var p=t.from,f=t.to,m=void 0===f?{}:f,g=this._currentState,y=this._originalState,_=this._targetState;for(var v in p)g[v]=p[v];var b=!1;for(var T in g){var w=g[T];b||W(w)!==ae||(b=!0),y[T]=w,_[T]=m.hasOwnProperty(T)?m[T]:w}if(this._easing=ve(this._currentState,i.easing,this._easing),this._filters.length=0,b){for(var S in e.filters)e.filters[S].doesApply(this)&&this._filters.push(e.filters[S]);this._applyFilter("tweenCreated")}return this}},{key:"then",value:function(e,t){var i=this;return this._promise=new this._promiseCtor(function(e,t){i._resolve=e,i._reject=t}),this._promise.then(e,t)}},{key:"catch",value:function(e){return this.then().catch(e)}},{key:"finally",value:function(e){return this.then().finally(e)}},{key:"get",value:function(){return Y({},this._currentState)}},{key:"set",value:function(e){this._currentState=e}},{key:"pause",value:function(){if(this._isPlaying)return this._pausedAtTime=e.now(),this._isPlaying=!1,be(this),this}},{key:"resume",value:function(){return this._resume()}},{key:"_resume",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.now();return null===this._timestamp?this.tween():this._isPlaying?this._promise:(this._pausedAtTime&&(this._timestamp+=t-this._pausedAtTime,this._pausedAtTime=null),this._isPlaying=!0,null===ue?(ue=this,ce=this):(this._previous=ce,ce._next=this,ce=this),this)}},{key:"seek",value:function(t){t=Math.max(t,0);var i=e.now();return this._timestamp+t===0||(this._timestamp=i-t,pe(this,i)),this}},{key:"stop",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._isPlaying)return this;this._isPlaying=!1,be(this);var t=this._filters.length>0;return e&&(t&&this._applyFilter(re),de(1,this._currentState,this._originalState,this._targetState,1,0,this._easing),t&&(this._applyFilter(se),this._applyFilter("afterTweenEnd"))),this._resolve&&this._resolve({data:this._data,state:this._currentState,tweenable:this}),this._resolve=null,this._reject=null,this}},{key:"cancel",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this._currentState,i=this._data;return this._isPlaying?(this._reject&&this._reject({data:i,state:t,tweenable:this}),this._resolve=null,this._reject=null,this.stop(e)):this}},{key:"isPlaying",value:function(){return this._isPlaying}},{key:"hasEnded",value:function(){return this._hasEnded}},{key:"setScheduleFunction",value:function(t){e.setScheduleFunction(t)}},{key:"data",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e&&(this._data=Y({},e)),this._data}},{key:"dispose",value:function(){for(var e in this)delete this[e]}}]),e}();function Se(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new we;return t.tween(e),t.tweenable=t,t}Q(we,"now",function(){return J}),Q(we,"setScheduleFunction",function(e){return oe=e}),Q(we,"filters",{}),Q(we,"formulas",he),ye(!0);var Ee,Ce,ke=/(\d|-|\.)/,xe=/([^\-0-9.]+)/g,Ie=/[0-9.-]+/g,Ae=(Ee=Ie.source,Ce=/,\s*/.source,new RegExp("rgba?\\(".concat(Ee).concat(Ce).concat(Ee).concat(Ce).concat(Ee,"(").concat(Ce).concat(Ee,")?\\)"),"g")),Le=/^.*\(/,Pe=/#([0-9]|[a-f]){3,6}/gi,Oe="VAL",De=function(e,t){return e.map(function(e,i){return"_".concat(t,"_").concat(i)})},Me=function(e){var t=e.match(xe);return t?(1===t.length||e.charAt(0).match(ke))&&t.unshift(""):t=["",""],t.join(Oe)};function Ne(e){return parseInt(e,16)}var Re=function(e){return"rgb(".concat((t=e,3===(t=t.replace(/#/,"")).length&&(t=(t=t.split(""))[0]+t[0]+t[1]+t[1]+t[2]+t[2]),[Ne(t.substr(0,2)),Ne(t.substr(2,2)),Ne(t.substr(4,2))]).join(","),")");var t},Fe=function(e,t,i){var n=t.match(e),s=t.replace(e,Oe);return n&&n.forEach(function(e){return s=s.replace(Oe,i(e))}),s},Be=function(e){return Fe(Pe,e,Re)},Ue=function(e){for(var t in e){var i=e[t];"string"==typeof i&&i.match(Pe)&&(e[t]=Be(i))}},je=function(e){var t=e.match(Ie),i=t.slice(0,3).map(Math.floor),n=e.match(Le)[0];if(3===t.length)return"".concat(n).concat(i.join(","),")");if(4===t.length)return"".concat(n).concat(i.join(","),",").concat(t[3],")");throw new Error("Invalid rgbChunk: ".concat(e))},$e=function(e){return Fe(Ae,e,je)},qe=function(e){return e.match(Ie)},Ve=function(e){var t={};for(var i in e){var n=e[i];"string"==typeof n&&(t[i]={formatString:Me(n),chunkNames:De(qe(n),i)})}return t},He=function(e,t){var i=function(i){qe(e[i]).forEach(function(n,s){return e[t[i].chunkNames[s]]=+n}),delete e[i]};for(var n in t)i(n)},ze=function(e,t){var i={};return t.forEach(function(t){i[t]=e[t],delete e[t]}),i},We=function(e,t){return t.map(function(t){return e[t]})},Ge=function(e,t){return t.forEach(function(t){return e=e.replace(Oe,+t.toFixed(4))}),e},Xe=function(e,t){for(var i in t){var n=t[i],s=n.chunkNames,r=n.formatString,a=Ge(r,We(ze(e,s),s));e[i]=$e(a)}},Ke=function(e,t){var i=function(i){var n=t[i].chunkNames,s=e[i];if("string"==typeof s){var r=s.split(" "),a=r[r.length-1];n.forEach(function(t,i){return e[t]=r[i]||a})}else n.forEach(function(t){return e[t]=s});delete e[i]};for(var n in t)i(n)},Ye=function(e,t){for(var i in t){var n=t[i].chunkNames,s=e[n[0]];e[i]="string"==typeof s?n.map(function(t){var i=e[t];return delete e[t],i}).join(" "):s}},Qe=function(e){for(var t in e._currentState)if("string"==typeof e._currentState[t])return!0;return!1};function Je(e){var t=e._currentState;[t,e._originalState,e._targetState].forEach(Ue),e._tokenData=Ve(t)}function Ze(e){var t=e._currentState,i=e._originalState,n=e._targetState,s=e._easing,r=e._tokenData;Ke(s,r),[t,i,n].forEach(function(e){return He(e,r)})}function et(e){var t=e._currentState,i=e._originalState,n=e._targetState,s=e._easing,r=e._tokenData;[t,i,n].forEach(function(e){return Xe(e,r)}),Ye(s,r)}function tt(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function it(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var nt=new we,st=we.filters,rt=function(e,t,i,n){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?tt(Object(i),!0).forEach(function(t){it(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):tt(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}({},e),a=ve(e,n);for(var o in nt._filters.length=0,nt.set({}),nt._currentState=r,nt._originalState=e,nt._targetState=t,nt._easing=a,st)st[o].doesApply(nt)&&nt._filters.push(st[o]);nt._applyFilter("tweenCreated"),nt._applyFilter("beforeTween");var l=de(i,r,e,t,1,s,a);return nt._applyFilter("afterTween"),l};function at(e){return function(e){if(Array.isArray(e))return ot(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return ot(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return ot(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ot(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function lt(e,t,i){return t&&function(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)}}(e.prototype,t),e}function ut(e,t){var i=t.get(e);if(!i)throw new TypeError("attempted to get private field on non-instance");return i.get?i.get.call(e):i.value}var ct=new WeakMap,ht=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ct.set(this,{writable:!0,value:[]});for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];i.forEach(this.add.bind(this))}return lt(e,[{key:"add",value:function(e){return ut(this,ct).push(e),e}},{key:"remove",value:function(e){var t=ut(this,ct).indexOf(e);return~t&&ut(this,ct).splice(t,1),e}},{key:"empty",value:function(){return this.tweenables.map(this.remove.bind(this))}},{key:"isPlaying",value:function(){return ut(this,ct).some(function(e){return e.isPlaying()})}},{key:"play",value:function(){return ut(this,ct).forEach(function(e){return e.tween()}),this}},{key:"pause",value:function(){return ut(this,ct).forEach(function(e){return e.pause()}),this}},{key:"resume",value:function(){return this.playingTweenables.forEach(function(e){return e.resume()}),this}},{key:"stop",value:function(e){return ut(this,ct).forEach(function(t){return t.stop(e)}),this}},{key:"tweenables",get:function(){return at(ut(this,ct))}},{key:"playingTweenables",get:function(){return ut(this,ct).filter(function(e){return!e.hasEnded()})}},{key:"promises",get:function(){return ut(this,ct).map(function(e){return e.then()})}}]),e}();we.filters.token=s}},t={};function i(n){if(t[n])return t[n].exports;var s=t[n]={exports:{}};return e[n](s,s.exports,i),s.exports}return i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i(720)})()})});(Wa=Ga)&&Wa.__esModule&&Object.prototype.hasOwnProperty.call(Wa,"default")&&Wa.default;var Xa=Ca(function(e,t){var i="__lodash_hash_undefined__",n=9007199254740991,s="[object Arguments]",r="[object Function]",a="[object Object]",o=/^\[object .+?Constructor\]$/,l=/^(?:0|[1-9]\d*)$/,u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u[s]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u[r]=u["[object Map]"]=u["[object Number]"]=u[a]=u["[object RegExp]"]=u["[object Set]"]=u["[object String]"]=u["[object WeakMap]"]=!1;var c="object"==typeof Ea&&Ea&&Ea.Object===Object&&Ea,h="object"==typeof self&&self&&self.Object===Object&&self,d=c||h||Function("return this")(),p=t&&!t.nodeType&&t,f=p&&e&&!e.nodeType&&e,m=f&&f.exports===p,g=m&&c.process,y=function(){try{var e=f&&f.require&&f.require("util").types;return e||g&&g.binding&&g.binding("util")}catch(e){}}(),_=y&&y.isTypedArray;var v,b=Array.prototype,T=Function.prototype,w=Object.prototype,S=d["__core-js_shared__"],E=T.toString,C=w.hasOwnProperty,k=(v=/[^.]+$/.exec(S&&S.keys&&S.keys.IE_PROTO||""))?"Symbol(src)_1."+v:"",x=w.toString,I=E.call(Object),A=RegExp("^"+E.call(C).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),L=m?d.Buffer:void 0,P=d.Symbol,O=d.Uint8Array;L&&L.allocUnsafe;var D=function(e,t){return function(i){return e(t(i))}}(Object.getPrototypeOf,Object),M=Object.create,N=w.propertyIsEnumerable,R=b.splice,F=P?P.toStringTag:void 0,B=function(){try{var e=ue(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),U=L?L.isBuffer:void 0,j=Math.max,$=Date.now,q=ue(d,"Map"),V=ue(Object,"create"),H=function(){function e(){}return function(t){if(!Ee(t))return{};if(M)return M(t);e.prototype=t;var i=new e;return e.prototype=void 0,i}}();function z(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function W(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function G(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function X(e){var t=this.__data__=new W(e);this.size=t.size}function K(e,t){var i=ve(e),n=!i&&_e(e),s=!i&&!n&&Te(e),r=!i&&!n&&!s&&ke(e),a=i||n||s||r,o=a?function(e,t){for(var i=-1,n=Array(e);++i<e;)n[i]=t(i);return n}(e.length,String):[],l=o.length;for(var u in e)a&&("length"==u||s&&("offset"==u||"parent"==u)||r&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||ce(u,l))||o.push(u);return o}function Y(e,t,i){(void 0!==i&&!ye(e[t],i)||void 0===i&&!(t in e))&&Z(e,t,i)}function Q(e,t,i){var n=e[t];C.call(e,t)&&ye(n,i)&&(void 0!==i||t in e)||Z(e,t,i)}function J(e,t){for(var i=e.length;i--;)if(ye(e[i][0],t))return i;return-1}function Z(e,t,i){"__proto__"==t&&B?B(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}z.prototype.clear=function(){this.__data__=V?V(null):{},this.size=0},z.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},z.prototype.get=function(e){var t=this.__data__;if(V){var n=t[e];return n===i?void 0:n}return C.call(t,e)?t[e]:void 0},z.prototype.has=function(e){var t=this.__data__;return V?void 0!==t[e]:C.call(t,e)},z.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=V&&void 0===t?i:t,this},W.prototype.clear=function(){this.__data__=[],this.size=0},W.prototype.delete=function(e){var t=this.__data__,i=J(t,e);return!(i<0)&&(i==t.length-1?t.pop():R.call(t,i,1),--this.size,!0)},W.prototype.get=function(e){var t=this.__data__,i=J(t,e);return i<0?void 0:t[i][1]},W.prototype.has=function(e){return J(this.__data__,e)>-1},W.prototype.set=function(e,t){var i=this.__data__,n=J(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this},G.prototype.clear=function(){this.size=0,this.__data__={hash:new z,map:new(q||W),string:new z}},G.prototype.delete=function(e){var t=le(this,e).delete(e);return this.size-=t?1:0,t},G.prototype.get=function(e){return le(this,e).get(e)},G.prototype.has=function(e){return le(this,e).has(e)},G.prototype.set=function(e,t){var i=le(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this},X.prototype.clear=function(){this.__data__=new W,this.size=0},X.prototype.delete=function(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i},X.prototype.get=function(e){return this.__data__.get(e)},X.prototype.has=function(e){return this.__data__.has(e)},X.prototype.set=function(e,t){var i=this.__data__;if(i instanceof W){var n=i.__data__;if(!q||n.length<199)return n.push([e,t]),this.size=++i.size,this;i=this.__data__=new G(n)}return i.set(e,t),this.size=i.size,this};var ee=function(e,t,i){for(var n=-1,s=Object(e),r=i(e),a=r.length;a--;){var o=r[++n];if(!1===t(s[o],o,s))break}return e};function te(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":F&&F in Object(e)?function(e){var t=C.call(e,F),i=e[F];try{e[F]=void 0;var n=!0}catch(e){}var s=x.call(e);n&&(t?e[F]=i:delete e[F]);return s}(e):function(e){return x.call(e)}(e)}function ie(e){return Ce(e)&&te(e)==s}function ne(e){return!(!Ee(e)||(t=e,k&&k in t))&&(we(e)?A:o).test(function(e){if(null!=e){try{return E.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t}function se(e){if(!Ee(e))return function(e){var t=[];if(null!=e)for(var i in Object(e))t.push(i);return t}(e);var t=he(e),i=[];for(var n in e)("constructor"!=n||!t&&C.call(e,n))&&i.push(n);return i}function re(e,t,i,n,s){e!==t&&ee(t,function(r,o){if(s||(s=new X),Ee(r))!function(e,t,i,n,s,r,o){var l=de(e,i),u=de(t,i),c=o.get(u);if(c)return void Y(e,i,c);var h=r?r(l,u,i+"",e,t,o):void 0,d=void 0===h;if(d){var p=ve(u),f=!p&&Te(u),m=!p&&!f&&ke(u);h=u,p||f||m?ve(l)?h=l:Ce(g=l)&&be(g)?h=function(e,t){var i=-1,n=e.length;t||(t=Array(n));for(;++i<n;)t[i]=e[i];return t}(l):f?(d=!1,h=u.slice()):m?(d=!1,h=function(e){var t=(i=e.buffer,n=new i.constructor(i.byteLength),new O(n).set(new O(i)),n);var i,n;return new e.constructor(t,e.byteOffset,e.length)}(u)):h=[]:function(e){if(!Ce(e)||te(e)!=a)return!1;var t=D(e);if(null===t)return!0;var i=C.call(t,"constructor")&&t.constructor;return"function"==typeof i&&i instanceof i&&E.call(i)==I}(u)||_e(u)?(h=l,_e(l)?h=function(e){return function(e,t,i){var n=!i;i||(i={});var s=-1,r=t.length;for(;++s<r;){var a=t[s],o=void 0;void 0===o&&(o=e[a]),n?Z(i,a,o):Q(i,a,o)}return i}(e,xe(e))}(l):Ee(l)&&!we(l)||(h=function(e){return"function"!=typeof e.constructor||he(e)?{}:H(D(e))}(u))):d=!1}var g;d&&(o.set(u,h),s(h,u,n,r,o),o.delete(u));Y(e,i,h)}(e,t,o,i,re,n,s);else{var l=n?n(de(e,o),r,o+"",e,t,s):void 0;void 0===l&&(l=r),Y(e,o,l)}},xe)}function ae(e,t){return ge(function(e,t,i){return t=j(void 0===t?e.length-1:t,0),function(){for(var n=arguments,s=-1,r=j(n.length-t,0),a=Array(r);++s<r;)a[s]=n[t+s];s=-1;for(var o=Array(t+1);++s<t;)o[s]=n[s];return o[t]=i(a),function(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)}(e,this,o)}}(e,t,Le),e+"")}var oe=B?function(e,t){return B(e,"toString",{configurable:!0,enumerable:!1,value:(i=t,function(){return i}),writable:!0});var i}:Le;function le(e,t){var i,n,s=e.__data__;return("string"==(n=typeof(i=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?s["string"==typeof t?"string":"hash"]:s.map}function ue(e,t){var i=function(e,t){return null==e?void 0:e[t]}(e,t);return ne(i)?i:void 0}function ce(e,t){var i=typeof e;return!!(t=null==t?n:t)&&("number"==i||"symbol"!=i&&l.test(e))&&e>-1&&e%1==0&&e<t}function he(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||w)}function de(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var pe,fe,me,ge=(pe=oe,fe=0,me=0,function(){var e=$(),t=16-(e-me);if(me=e,t>0){if(++fe>=800)return arguments[0]}else fe=0;return pe.apply(void 0,arguments)});function ye(e,t){return e===t||e!=e&&t!=t}var _e=ie(function(){return arguments}())?ie:function(e){return Ce(e)&&C.call(e,"callee")&&!N.call(e,"callee")},ve=Array.isArray;function be(e){return null!=e&&Se(e.length)&&!we(e)}var Te=U||function(){return!1};function we(e){if(!Ee(e))return!1;var t=te(e);return t==r||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Se(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}function Ee(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ce(e){return null!=e&&"object"==typeof e}var ke=_?function(e){return function(t){return e(t)}}(_):function(e){return Ce(e)&&Se(e.length)&&!!u[te(e)]};function xe(e){return be(e)?K(e):se(e)}var Ie,Ae=(Ie=function(e,t,i){re(e,t,i)},ae(function(e,t){var i=-1,n=t.length,s=n>1?t[n-1]:void 0,r=n>2?t[2]:void 0;for(s=Ie.length>3&&"function"==typeof s?(n--,s):void 0,r&&function(e,t,i){if(!Ee(i))return!1;var n=typeof t;return!!("number"==n?be(i)&&ce(t,i.length):"string"==n&&t in i)&&ye(i[t],e)}(t[0],t[1],r)&&(s=n<3?void 0:s,n=1),e=Object(e);++i<n;){var a=t[i];a&&Ie(e,a,i,s)}return e}));function Le(e){return e}e.exports=Ae}),Ka="Webkit Moz O ms".split(" ");function Ya(e,t,i){for(var n=e.style,s=0;s<Ka.length;++s){n[Ka[s]+Qa(t)]=i}n[t]=i}function Qa(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Ja(e){return!function(e){return"[object Array]"===Object.prototype.toString.call(e)}(e)&&("object"===typeof e&&!!e)}function Za(e,t){for(var i in e){if(e.hasOwnProperty(i))t(e[i],i)}}var eo={extend:Xa,render:function(e,t){var i=e;for(var n in t)if(t.hasOwnProperty(n)){var s=t[n],r=new RegExp("\\{"+n+"\\}","g");i=i.replace(r,s)}return i},setStyle:Ya,setStyles:function(e,t){Za(t,function(t,i){null!=t&&(Ja(t)&&!0===t.prefix?Ya(e,i,t.value):e.style[i]=t)})},capitalize:Qa,isString:function(e){return"string"==typeof e||e instanceof String},isFunction:function(e){return"function"==typeof e},isObject:Ja,forEachObject:Za,floatEquals:function(e,t){return Math.abs(e-t)<.001},removeChildren:function(e){for(;e.firstChild;)e.removeChild(e.firstChild)}};eo.extend,eo.render,eo.setStyle,eo.setStyles,eo.capitalize,eo.isString,eo.isFunction,eo.isObject,eo.forEachObject,eo.floatEquals,eo.removeChildren;var to=Ga.Tweenable,io={easeIn:"easeInCubic",easeOut:"easeOutCubic",easeInOut:"easeInOutCubic"},no=function e(t,i){if(!(this instanceof e))throw new Error("Constructor was called without new keyword");var n;i=eo.extend({delay:0,duration:800,easing:"linear",from:{},to:{},step:function(){}},i),n=eo.isString(t)?document.querySelector(t):t,this.path=n,this._opts=i,this._tweenable=null;var s=this.path.getTotalLength();this.path.style.strokeDasharray=s+" "+s,this.set(0)};no.prototype.value=function(){var e=this._getComputedDashOffset(),t=this.path.getTotalLength();return parseFloat((1-e/t).toFixed(6),10)},no.prototype.set=function(e){this.stop(),this.path.style.strokeDashoffset=this._progressToOffset(e);var t=this._opts.step;if(eo.isFunction(t)){var i=this._easing(this._opts.easing);t(this._calculateTo(e,i),this._opts.shape||this,this._opts.attachment)}},no.prototype.stop=function(){this._stopTween(),this.path.style.strokeDashoffset=this._getComputedDashOffset()},no.prototype.animate=function(e,t,i){t=t||{},eo.isFunction(t)&&(i=t,t={});var n=eo.extend({},t),s=eo.extend({},this._opts);t=eo.extend(s,t);var r=this._easing(t.easing),a=this._resolveFromAndTo(e,r,n);this.stop(),this.path.getBoundingClientRect();var o=this._getComputedDashOffset(),l=this._progressToOffset(e),u=this;this._tweenable=new to,this._tweenable.tween({from:eo.extend({offset:o},a.from),to:eo.extend({offset:l},a.to),duration:t.duration,delay:t.delay,easing:r,step:function(e){u.path.style.strokeDashoffset=e.offset;var i=t.shape||u;t.step(e,i,t.attachment)}}).then(function(e){eo.isFunction(i)&&i()}).catch(function(e){throw console.error("Error in tweening:",e),e})},no.prototype._getComputedDashOffset=function(){var e=window.getComputedStyle(this.path,null);return parseFloat(e.getPropertyValue("stroke-dashoffset"),10)},no.prototype._progressToOffset=function(e){var t=this.path.getTotalLength();return t-e*t},no.prototype._resolveFromAndTo=function(e,t,i){return i.from&&i.to?{from:i.from,to:i.to}:{from:this._calculateFrom(t),to:this._calculateTo(e,t)}},no.prototype._calculateFrom=function(e){return Ga.interpolate(this._opts.from,this._opts.to,this.value(),e)},no.prototype._calculateTo=function(e,t){return Ga.interpolate(this._opts.from,this._opts.to,e,t)},no.prototype._stopTween=function(){null!==this._tweenable&&(this._tweenable.stop(!0),this._tweenable=null)},no.prototype._easing=function(e){return io.hasOwnProperty(e)?io[e]:e};var so=no,ro="Object is destroyed",ao=function e(t,i){if(!(this instanceof e))throw new Error("Constructor was called without new keyword");if(0!==arguments.length){this._opts=eo.extend({color:"#555",strokeWidth:1,trailColor:null,trailWidth:null,fill:null,text:{style:{color:null,position:"absolute",left:"50%",top:"50%",padding:0,margin:0,transform:{prefix:!0,value:"translate(-50%, -50%)"}},autoStyleContainer:!0,alignToBottom:!0,value:null,className:"progressbar-text"},svgStyle:{display:"block",width:"100%"},warnings:!1},i,!0),eo.isObject(i)&&void 0!==i.svgStyle&&(this._opts.svgStyle=i.svgStyle),eo.isObject(i)&&eo.isObject(i.text)&&void 0!==i.text.style&&(this._opts.text.style=i.text.style);var n,s=this._createSvgView(this._opts);if(!(n=eo.isString(t)?document.querySelector(t):t))throw new Error("Container does not exist: "+t);this._container=n,this._container.appendChild(s.svg),this._opts.warnings&&this._warnContainerAspectRatio(this._container),this._opts.svgStyle&&eo.setStyles(s.svg,this._opts.svgStyle),this.svg=s.svg,this.path=s.path,this.trail=s.trail,this.text=null;var r=eo.extend({attachment:void 0,shape:this},this._opts);this._progressPath=new so(s.path,r),eo.isObject(this._opts.text)&&null!==this._opts.text.value&&this.setText(this._opts.text.value)}};ao.prototype.animate=function(e,t,i){if(null===this._progressPath)throw new Error(ro);this._progressPath.animate(e,t,i)},ao.prototype.stop=function(){if(null===this._progressPath)throw new Error(ro);void 0!==this._progressPath&&this._progressPath.stop()},ao.prototype.pause=function(){if(null===this._progressPath)throw new Error(ro);void 0!==this._progressPath&&this._progressPath._tweenable&&this._progressPath._tweenable.pause()},ao.prototype.resume=function(){if(null===this._progressPath)throw new Error(ro);void 0!==this._progressPath&&this._progressPath._tweenable&&this._progressPath._tweenable.resume()},ao.prototype.destroy=function(){if(null===this._progressPath)throw new Error(ro);this.stop(),this.svg.parentNode.removeChild(this.svg),this.svg=null,this.path=null,this.trail=null,this._progressPath=null,null!==this.text&&(this.text.parentNode.removeChild(this.text),this.text=null)},ao.prototype.set=function(e){if(null===this._progressPath)throw new Error(ro);this._progressPath.set(e)},ao.prototype.value=function(){if(null===this._progressPath)throw new Error(ro);return void 0===this._progressPath?0:this._progressPath.value()},ao.prototype.setText=function(e){if(null===this._progressPath)throw new Error(ro);null===this.text&&(this.text=this._createTextContainer(this._opts,this._container),this._container.appendChild(this.text)),eo.isObject(e)?(eo.removeChildren(this.text),this.text.appendChild(e)):this.text.innerHTML=e},ao.prototype._createSvgView=function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","svg");this._initializeSvg(t,e);var i=null;(e.trailColor||e.trailWidth)&&(i=this._createTrail(e),t.appendChild(i));var n=this._createPath(e);return t.appendChild(n),{svg:t,path:n,trail:i}},ao.prototype._initializeSvg=function(e,t){e.setAttribute("viewBox","0 0 100 100")},ao.prototype._createPath=function(e){var t=this._pathString(e);return this._createPathElement(t,e)},ao.prototype._createTrail=function(e){var t=this._trailString(e),i=eo.extend({},e);return i.trailColor||(i.trailColor="#eee"),i.trailWidth||(i.trailWidth=i.strokeWidth),i.color=i.trailColor,i.strokeWidth=i.trailWidth,i.fill=null,this._createPathElement(t,i)},ao.prototype._createPathElement=function(e,t){var i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d",e),i.setAttribute("stroke",t.color),i.setAttribute("stroke-width",t.strokeWidth),t.fill?i.setAttribute("fill",t.fill):i.setAttribute("fill-opacity","0"),i},ao.prototype._createTextContainer=function(e,t){var i=document.createElement("div");i.className=e.text.className;var n=e.text.style;return n&&(e.text.autoStyleContainer&&(t.style.position="relative"),eo.setStyles(i,n),n.color||(i.style.color=e.color)),this._initializeTextContainer(e,t,i),i},ao.prototype._initializeTextContainer=function(e,t,i){},ao.prototype._pathString=function(e){throw new Error("Override this function for each progress bar")},ao.prototype._trailString=function(e){throw new Error("Override this function for each progress bar")},ao.prototype._warnContainerAspectRatio=function(e){if(this.containerAspectRatio){var t=window.getComputedStyle(e,null),i=parseFloat(t.getPropertyValue("width"),10),n=parseFloat(t.getPropertyValue("height"),10);eo.floatEquals(this.containerAspectRatio,i/n)||(console.warn("Incorrect aspect ratio of container","#"+e.id,"detected:",t.getPropertyValue("width")+"(width)","/",t.getPropertyValue("height")+"(height)","=",i/n),console.warn("Aspect ratio of should be",this.containerAspectRatio))}};var oo=ao,lo=function(e,t){this._pathTemplate="M 50,50 m 0,-{radius} a {radius},{radius} 0 1 1 0,{2radius} a {radius},{radius} 0 1 1 0,-{2radius}",this.containerAspectRatio=1,oo.apply(this,arguments)};(lo.prototype=new oo).constructor=lo,lo.prototype._pathString=function(e){var t=e.strokeWidth;e.trailWidth&&e.trailWidth>e.strokeWidth&&(t=e.trailWidth);var i=50-t/2;return eo.render(this._pathTemplate,{radius:i,"2radius":2*i})},lo.prototype._trailString=function(e){return this._pathString(e)};var uo=lo;const co={color:"#5C6F82",trailColor:"#D9DADB",strokeWidth:24,trailWidth:12,easing:"easeInOut",duration:1400,text:{autoStyleContainer:!1},animate:!0,value:0};class ho extends Hi{constructor(e,t){super(e),this._config=this._getConfig(t),this._bar=null,this._init()}static get NAME(){return"progressdonut"}set(e){this._config.animate?this._bar.animate(e):this._bar.set(e)}dispose(){this._bar.destroy(),super.dispose()}_getConfig(e){return e={...co,step:this._getStepCallback(),...qi.getDataAttributes(this._element),..."object"==typeof e?e:{}}}_getStepCallback(){return(e,t)=>{const i=Math.round(100*t.value());t.setText(i+"%")}}_init(){this._bar=new uo(this._element,this._config),this._config.value>0&&this.set(this._config.value)}}"undefined"!=typeof window&&"undefined"!=typeof document&&zi.find("[data-bs-progress-donut]").forEach(e=>{ho.getOrCreateInstance(e)});const po="dragend",fo="dragover",mo="dragenter",go="dragleave",yo="drop",_o="success",vo="dragover",bo="loading",To="[data-bs-upload-dragdrop]";class wo extends Hi{constructor(e){super(e);const t=zi.findOne("[data-bs-progress-donut]",this._element);t&&(this._donut=ho.getOrCreateInstance(t)),this._bindEvents()}static get NAME(){return"upload"}progress(e){this._donut.set(e)}start(){this.reset(),this._element.classList.add(bo)}success(){this._element.classList.remove(bo),this._element.classList.add(_o)}reset(){this._element.classList.remove(bo),this._element.classList.remove(_o),this._donut.set(0)}dispose(){this._donut.dispose(),super.dispose()}_bindEvents(){Bi.on(this._element,"drag",e=>this._preventEvent(e)),Bi.on(this._element,"dragstart",e=>this._preventEvent(e)),Bi.on(this._element,po,e=>this._preventEvent(e)),Bi.on(this._element,fo,e=>this._preventEvent(e)),Bi.on(this._element,mo,e=>this._preventEvent(e)),Bi.on(this._element,go,e=>this._preventEvent(e)),Bi.on(this._element,yo,e=>this._preventEvent(e)),Bi.on(this._element,fo,()=>this._dropIn()),Bi.on(this._element,mo,()=>this._dropIn()),Bi.on(this._element,go,()=>this._dropOut()),Bi.on(this._element,po,()=>this._dropOut()),Bi.on(this._element,yo,()=>this._dropOut()),Bi.on(this._element,yo,()=>this._drop())}_preventEvent(e){e.preventDefault(),e.stopPropagation()}_dropIn(){this._isSuccess()||this._element.classList.add(vo)}_dropOut(){this._isSuccess()||this._element.classList.remove(vo)}_drop(){this._isSuccess()||this.start()}_isSuccess(){return this._element.classList.contains(_o)}}const So=e=>{let t=e.matches&&e.matches(To)?e:e.closest?e.closest(To):null;return t&&wo.getOrCreateInstance(t),null};"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("dragenter",function(e){So(e.target)}),Bi.on(document,"click.bs.upload.data-api",To+" label",function(){So(this)}));const Eo="back-to-top-show",Co={positionTop:0,scrollLimit:100,duration:800,easing:"easeInOutSine"};class ko extends Hi{constructor(e,t){super(e),this._config=this._getConfig(t),this._scrollCb=null,this._isAnim=!1,this._prevScrollBehavior="",this._bindEvents()}static get NAME(){return"backtotop"}show(){this._element.classList.contains(Eo)||this._element.classList.add(Eo)}hide(){this._element.classList.contains(Eo)&&this._element.classList.remove(Eo)}toggleShow(){"undefined"!=typeof document&&document.scrollingElement.scrollTop>this._config.scrollLimit?this.show():this.hide()}scrollToTop(){this._isAnim||(this._isAnim=!0,Nr(this._config.positionTop,{duration:this._config.duration,easing:this._config.easing,complete:()=>{this._isAnim=!1}}))}dispose(){this._scrollCb&&this._scrollCb.dispose(),super.dispose()}_getConfig(e){return e={...Co,...qi.getDataAttributes(this._element),..."object"==typeof e?e:{}}}_bindEvents(){this._scrollCb=As(()=>this.toggleShow()),Bi.on(this._element,"click.bs.backtotop",e=>{e.preventDefault(),this.scrollToTop()})}}As(()=>{zi.find('[data-bs-toggle="backtotop"]').map(e=>{ko.getOrCreateInstance(e)})});const xo=".bs.historyback",Io=`click${xo}`,Ao=`click${xo}.data-api`;class Lo extends Hi{constructor(e){super(e),this._bindEvents()}static get NAME(){return"historyback"}back(){"undefined"!=typeof window&&window.history.back()}_bindEvents(){Bi.on(this._element,Io,e=>{e.preventDefault(),this.back()})}}"undefined"!=typeof window&&"undefined"!=typeof document&&Bi.on(document,Ao,'[data-bs-toggle="historyback"]',function(e){e.preventDefault();Lo.getOrCreateInstance(this).back()});const Po=".bs.historyback",Oo=`click${Po}`,Do=`click${Po}.data-api`,Mo={duration:800,easing:"easeInOutSine"};class No extends Hi{constructor(e,t){super(e),this._config=this._getConfig(t),this._bindEvents()}static get NAME(){return"historyback"}goToTarget(){const e=di(this._element);e&&Nr(e.offsetTop,{duration:this._config.duration,easing:this._config.easing})}_getConfig(e){return e={...Mo,...qi.getDataAttributes(this._element),..."object"==typeof e?e:{}}}_bindEvents(){Bi.on(this._element,Oo,e=>{e.preventDefault(),this.goToTarget()})}}"undefined"!=typeof window&&"undefined"!=typeof document&&Bi.on(document,Do,'[data-bs-toggle="forward"]',function(e){e.preventDefault();No.getOrCreateInstance(this).goToTarget()});var Ro=function(e){return this._sizes=[],this._columns=[],this._container=null,this._count=null,this._width=0,this._removeListener=null,this._currentGutterX=null,this._currentGutterY=null,this._resizeTimeout=null,this.conf={baseWidth:255,gutterX:null,gutterY:null,gutter:10,container:null,minify:!0,ultimateGutter:5,surroundingGutter:!0,direction:"ltr",wedge:!1},this.init(e),this};Ro.prototype.init=function(e){for(var t in this.conf)null!=e[t]&&(this.conf[t]=e[t]);if(null!=this.conf.gutterX&&null!=this.conf.gutterY||(this.conf.gutterX=this.conf.gutterY=this.conf.gutter),this._currentGutterX=this.conf.gutterX,this._currentGutterY=this.conf.gutterY,this._container="object"==typeof this.conf.container&&this.conf.container.nodeName?this.conf.container:document.querySelector(this.conf.container),!this._container)throw new Error("Container not found or missing");var i=this.resizeThrottler.bind(this);window.addEventListener("resize",i),this._removeListener=function(){window.removeEventListener("resize",i),null!=this._resizeTimeout&&(window.clearTimeout(this._resizeTimeout),this._resizeTimeout=null)},this.layout()},Ro.prototype.reset=function(){this._sizes=[],this._columns=[],this._count=null,this._width=this._container.clientWidth;var e=this.conf.baseWidth;this._width<e&&(this._width=e,this._container.style.minWidth=e+"px"),1==this.getCount()?(this._currentGutterX=this.conf.ultimateGutter,this._count=1):this._width<this.conf.baseWidth+2*this._currentGutterX?this._currentGutterX=0:this._currentGutterX=this.conf.gutterX},Ro.prototype.getCount=function(){return this.conf.surroundingGutter?Math.floor((this._width-this._currentGutterX)/(this.conf.baseWidth+this._currentGutterX)):Math.floor((this._width+this._currentGutterX)/(this.conf.baseWidth+this._currentGutterX))},Ro.prototype.computeWidth=function(){var e;return e=this.conf.surroundingGutter?(this._width-this._currentGutterX)/this._count-this._currentGutterX:(this._width+this._currentGutterX)/this._count-this._currentGutterX,e=Number.parseFloat(e.toFixed(2))},Ro.prototype.layout=function(){if(this._container){this.reset(),null==this._count&&(this._count=this.getCount());for(var e=this.computeWidth(),t=0;t<this._count;t++)this._columns[t]=0;for(var i,n=this._container.children,s=0;s<n.length;s++)n[s].style.width=e+"px",this._sizes[s]=n[s].clientHeight;if(i="ltr"==this.conf.direction?this.conf.surroundingGutter?this._currentGutterX:0:this._width-(this.conf.surroundingGutter?this._currentGutterX:0),this._count>this._sizes.length){var r=this._sizes.length*(e+this._currentGutterX)-this._currentGutterX;!1===this.conf.wedge?i="ltr"==this.conf.direction?(this._width-r)/2:this._width-(this._width-r)/2:"ltr"==this.conf.direction||(i=this._width-this._currentGutterX)}for(var a=0;a<n.length;a++){var o,l=this.conf.minify?this.getShortest():this.getNextColumn(a),u=0;(this.conf.surroundingGutter||l!=this._columns.length)&&(u=this._currentGutterX),o="ltr"==this.conf.direction?i+(e+u)*l:i-(e+u)*l-e;var c=this._columns[l];n[a].style.transform="translate3d("+Math.round(o)+"px,"+Math.round(c)+"px,0)",this._columns[l]+=this._sizes[a]+(this._count>1?this.conf.gutterY:this.conf.ultimateGutter)}this._container.style.height=this._columns[this.getLongest()]-this._currentGutterY+"px"}else console.error("Container not found")},Ro.prototype.getNextColumn=function(e){return e%this._columns.length},Ro.prototype.getShortest=function(){for(var e=0,t=0;t<this._count;t++)this._columns[t]<this._columns[e]&&(e=t);return e},Ro.prototype.getLongest=function(){for(var e=0,t=0;t<this._count;t++)this._columns[t]>this._columns[e]&&(e=t);return e},Ro.prototype.resizeThrottler=function(){this._resizeTimeout||(this._resizeTimeout=setTimeout(function(){this._resizeTimeout=null,this._container.clientWidth!=this._width&&this.layout()}.bind(this),33))},Ro.prototype.destroy=function(){"function"==typeof this._removeListener&&this._removeListener();for(var e=this._container.children,t=0;t<e.length;t++)e[t].style.removeProperty("width"),e[t].style.removeProperty("transform");this._container.style.removeProperty("height"),this._container.style.removeProperty("min-width")};const Fo="masonry-loader",Bo=`.${Fo}`,Uo={percentPosition:!0};class jo extends Hi{constructor(e,t){super(e),"undefined"!=typeof window&&"undefined"!=typeof document&&(this._config=this._getConfig(t),this._masonry=null,this._images=zi.find("img",this._element),this._loadCounter=0,this._init())}static get NAME(){return"masonry"}dispose(){this._masonry&&(this._masonry.destroy(),this._masonry=null),super.dispose()}layout(){this._masonry&&this._masonry.layout()}_getConfig(e){return e={...Uo,...qi.getDataAttributes(this._element),..."object"==typeof e?e:{}}}_init(){this._images.length>0?this._images.forEach(e=>{const t=new Image;t.onload=()=>this._onLoadEnd(),t.src=e.src}):this._initMasonry()}_onLoadEnd(){this._loadCounter++,this._loadCounter>=this._images.length&&this._initMasonry()}_initMasonry(){const e=this._config;e.container=this._element,this._masonry=new Ro(e)}_createLoader(){if("undefined"==typeof document)return;const e=document.createElement("div");return e.classList.add(Fo,"fade","d-flex","justify-content-center","align-items-center"),e.innerHTML='<div class="progress-spinner progress-spinner-active"><span class="visually-hidden">Caricamento...</span></div>',this._element.appendChild(e),e}_getOrCreateLoader(){const e=zi.findOne(Bo,this._element);return e||this._createLoader()}_destroyLoader(){const e=zi.findOne(Bo,this._element);e&&e.remove()}_showLoader(){this._getOrCreateLoader().classList.add("show")}_hideLoader(){this._destroyLoader()}}if("undefined"!=typeof window&&"undefined"!=typeof document){const e=zi.find('[data-bs-toggle="masonry"]');e.length>0&&e.forEach(e=>{jo.getOrCreateInstance(e)})}const $o=".bs.list",qo=`click${$o}`,Vo=`click${$o}.data-api`,Ho="active",zo="input[type=checkbox]";class Wo extends Hi{constructor(e){super(e),this._init()}static get NAME(){return"list"}toggleCheckbox(e){const t=zi.findOne("input",e);t&&(t.checked?(t.checked=!1,e.classList.remove(Ho)):(t.checked=!0,e.classList.add(Ho)))}_init(){this._initCheckbox()}_initCheckbox(){zi.find(zo,this._element).forEach(e=>{Bi.on(e.closest("a"),qo,t=>{t.preventDefault(),this.toggleCheckbox(e.closest("a"))})})}}"undefined"!=typeof window&&"undefined"!=typeof document&&zi.find("[data-bs-list-checkbox]").forEach(e=>{zi.find(zo,e).forEach(t=>{Bi.one(t.closest("a"),Vo,t=>{if(!Wo.getInstance(e)){t.preventDefault();Wo.getOrCreateInstance(e).toggleCheckbox(t.currentTarget)}})})});const Go=".bs.transfer",Xo=".data-api",Ko=`click${Go}${Xo}`,Yo=`keyup${Go}${Xo}`,Qo=`click${Go}`,Jo="active",Zo="source",el="semi-checked",tl="[data-bs-transfer]",il=".transfer-header input",nl=".transfer-group input",sl=".it-transfer-wrapper",rl=".transfer-group",al=`${sl}.source`,ol=`${sl}.target`,ll=".form-check";class ul extends Hi{constructor(e){super(e),this._addBtnElement=zi.findOne("a.transfer",this._element),this._invBtnElement=zi.findOne("a.backtransfer",this._element),this._resetBtnElement=zi.findOne("a.reset",this._element),this._listDefault={source:zi.find(al+" "+rl+" "+ll,this._element),target:zi.find(ol+" "+rl+" "+ll,this._element)},this._bindEvents()}static get NAME(){return"transfer"}_bindEvents(){zi.find(il,this._element).forEach(e=>{Bi.on(e,Qo,()=>{this._checkListHeader(e.closest(sl))})}),zi.find(nl,this._element).forEach(e=>{Bi.on(e,Qo,()=>{this._checkList(e.closest(sl))})}),Bi.on(this._addBtnElement,Qo,e=>{e.preventDefault(),this._disableElement(this._addBtnElement),this._addItems()}),Bi.on(this._invBtnElement,Qo,e=>{e.preventDefault(),this._disableElement(this._invBtnElement),this._addItems(!0)}),Bi.on(this._resetBtnElement,Qo,e=>{e.preventDefault(),this._disableElement(this._addBtnElement),this._disableElement(this._invBtnElement),this._disableElement(this._resetBtnElement),this._resetAll()})}_disableElement(e){e.classList.remove(Jo),e.setAttribute("disabled","disabled"),e.setAttribute("aria-disabled","true")}_enableElement(e){e.classList.add(Jo),e.removeAttribute("disabled"),e.removeAttribute("aria-disabled")}_getScopeData(e){return{scope:e,list:zi.find(nl,e),listChecked:zi.find(nl+":checked",e),head:zi.findOne(".transfer-header",e),inputHead:zi.findOne(il,e),labelNumHead:zi.findOne(".transfer-header span.num",e),group:zi.findOne(rl,e)}}_checkList(e){const t=this._getScopeData(e);0==t.listChecked.length?(t.inputHead.classList.remove(el),t.inputHead.checked=!0,e.classList.contains(Zo)?this._disableElement(this._addBtnElement):this._disableElement(this._invBtnElement)):(t.listChecked.length==t.list.length?(t.inputHead.classList.remove(el),t.inputHead.checked=!0):(t.inputHead.classList.add(el),t.inputHead.checked=!1),e.classList.contains(Zo)?this._enableElement(this._addBtnElement):this._enableElement(this._invBtnElement))}_checkListHeader(e){const t=this._getScopeData(e);t.listChecked.length>0?(t.list.forEach(e=>{e.checked=!1}),t.inputHead.classList.remove(el),t.inputHead.checked=!1,e.classList.contains(Zo)?this._disableElement(this._addBtnElement):this._disableElement(this._invBtnElement)):(t.list.forEach(e=>{e.checked=!0}),e.classList.contains(Zo)?this._enableElement(this._addBtnElement):this._enableElement(this._invBtnElement))}_addItems(e){const t=this._getScopeData(zi.findOne(e?ol:al,this._element)),i=this._getScopeData(zi.findOne(e?al:ol,this._element)),n=t.listChecked,s=t.inputHead,r=t.labelNumHead,a=n.length,o=t.list.length,l=i.group,u=i.list.length+a,c=i.labelNumHead,h=i.inputHead;n.forEach(e=>{const t=e.closest(ll);t.remove(),l.appendChild(t),e.checked=!1});const d=o-a,p=u;r.innerText=d,c.innerText=p,0==d&&s.setAttribute("disabled",!0),p>0&&h.removeAttribute("disabled"),s.classList.remove(el),s.checked=!1,this._enableElement(this._resetBtnElement)}_resetAll(){const e={source:this._getScopeData(zi.findOne(al,this._element)),target:this._getScopeData(zi.findOne(ol,this._element))};Object.keys(e).forEach(t=>{e[t].list.forEach(e=>e.closest(ll).remove())}),Object.keys(e).forEach(t=>{this._listDefault[t].forEach(i=>{i.checked=!1,e[t].group.appendChild(i)}),e[t].labelNumHead.innerText=this._listDefault[t].length,e[t].inputHead.removeAttribute("disabled"),e[t].inputHead.classList.remove(el),e[t].inputHead.checked=!1})}}"undefined"!=typeof window&&"undefined"!=typeof document&&(Bi.on(document,Ko,tl+" .form-check label",function(){ul.getOrCreateInstance(this.closest(tl))}),Bi.on(document,Yo,tl+" .form-check label",function(){ul.getOrCreateInstance(this.closest(tl))}));const cl=".bs.alert",hl=`close${cl}`,dl=`closed${cl}`;class pl extends Hi{static get NAME(){return"alert"}close(){if(Bi.trigger(this._element,hl).defaultPrevented)return;this._element.classList.remove("show");const e=this._element.classList.contains("fade");this._queueCallback(()=>this._destroyElement(),this._element,e)}_destroyElement(){this._element.remove(),Bi.trigger(this._element,dl),this.dispose()}}"undefined"!=typeof window&&"undefined"!=typeof document&&dn(pl,"close");const fl='[data-bs-toggle="button"]';let ml=class extends Hi{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}};"undefined"!=typeof window&&"undefined"!=typeof document&&Bi.on(document,"click.bs.button.data-api",fl,e=>{e.preventDefault();const t=e.target.closest(fl);ml.getOrCreateInstance(t).toggle()});const gl=".bs.collapse",yl=`show${gl}`,_l=`shown${gl}`,vl=`hide${gl}`,bl=`hidden${gl}`,Tl=`click${gl}.data-api`,wl="show",Sl="collapse",El="collapsing",Cl=`:scope .${Sl} .${Sl}`,kl='[data-bs-toggle="collapse"]',xl={parent:null,toggle:!0},Il={parent:"(null|element)",toggle:"boolean"};class Al extends Hi{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];const i=zi.find(kl);for(const e of i){const t=hi(e),i=zi.find(t).filter(e=>e===this._element);null!==t&&i.length&&this._triggerArray.push(e)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return xl}static get DefaultType(){return Il}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e=[];if(this._config.parent&&(e=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter(e=>e!==this._element).map(e=>Al.getOrCreateInstance(e,{toggle:!1}))),e.length&&e[0]._isTransitioning)return;if(Bi.trigger(this._element,yl).defaultPrevented)return;for(const t of e)t.hide();const t=this._getDimension();this._element.classList.remove(Sl),this._element.classList.add(El),this._element.style[t]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const i=`scroll${t[0].toUpperCase()+t.slice(1)}`;this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(El),this._element.classList.add(Sl,wl),this._element.style[t]="",Bi.trigger(this._element,_l)},this._element,!0),this._element.style[t]=`${this._element[i]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(Bi.trigger(this._element,vl).defaultPrevented)return;const e=this._getDimension();this._element.style[e]=`${this._element.getBoundingClientRect()[e]}px`,vi(this._element),this._element.classList.add(El),this._element.classList.remove(Sl,wl);for(const e of this._triggerArray){const t=di(e);t&&!this._isShown(t)&&this._addAriaAndCollapsedClass([e],!1)}this._isTransitioning=!0;this._element.style[e]="",this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(El),this._element.classList.add(Sl),Bi.trigger(this._element,bl)},this._element,!0)}_isShown(e=this._element){return e.classList.contains(wl)}_configAfterMerge(e){return e.toggle=Boolean(e.toggle),e.parent=fi(e.parent),e}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const e=this._getFirstLevelChildren(kl);for(const t of e){const e=di(t);e&&this._addAriaAndCollapsedClass([t],this._isShown(e))}}_getFirstLevelChildren(e){const t=zi.find(Cl,this._config.parent);return zi.find(e,this._config.parent).filter(e=>!t.includes(e))}_addAriaAndCollapsedClass(e,t){if(e.length)for(const i of e)i.classList.toggle("collapsed",!t),i.setAttribute("aria-expanded",t)}}"undefined"!=typeof window&&"undefined"!=typeof document&&Bi.on(document,Tl,kl,function(e){("A"===e.target.tagName||e.delegateTarget&&"A"===e.delegateTarget.tagName)&&e.preventDefault();const t=hi(this),i=zi.find(t);for(const e of i)Al.getOrCreateInstance(e,{toggle:!1}).toggle()});var Ll="top",Pl="bottom",Ol="right",Dl="left",Ml="auto",Nl=[Ll,Pl,Ol,Dl],Rl="start",Fl="end",Bl="clippingParents",Ul="viewport",jl="popper",$l="reference",ql=Nl.reduce(function(e,t){return e.concat([t+"-"+Rl,t+"-"+Fl])},[]),Vl=[].concat(Nl,[Ml]).reduce(function(e,t){return e.concat([t,t+"-"+Rl,t+"-"+Fl])},[]),Hl="beforeRead",zl="read",Wl="afterRead",Gl="beforeMain",Xl="main",Kl="afterMain",Yl="beforeWrite",Ql="write",Jl="afterWrite",Zl=[Hl,zl,Wl,Gl,Xl,Kl,Yl,Ql,Jl];function eu(e){return e?(e.nodeName||"").toLowerCase():null}function tu(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function iu(e){return e instanceof tu(e).Element||e instanceof Element}function nu(e){return e instanceof tu(e).HTMLElement||e instanceof HTMLElement}function su(e){return"undefined"!=typeof ShadowRoot&&(e instanceof tu(e).ShadowRoot||e instanceof ShadowRoot)}const ru={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var i=t.styles[e]||{},n=t.attributes[e]||{},s=t.elements[e];nu(s)&&eu(s)&&(Object.assign(s.style,i),Object.keys(n).forEach(function(e){var t=n[e];!1===t?s.removeAttribute(e):s.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach(function(e){var n=t.elements[e],s=t.attributes[e]||{},r=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:i[e]).reduce(function(e,t){return e[t]="",e},{});nu(n)&&eu(n)&&(Object.assign(n.style,r),Object.keys(s).forEach(function(e){n.removeAttribute(e)}))})}},requires:["computeStyles"]};function au(e){return e.split("-")[0]}var ou=Math.max,lu=Math.min,uu=Math.round;function cu(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function hu(){return!/^((?!chrome|android).)*safari/i.test(cu())}function du(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=!1);var n=e.getBoundingClientRect(),s=1,r=1;t&&nu(e)&&(s=e.offsetWidth>0&&uu(n.width)/e.offsetWidth||1,r=e.offsetHeight>0&&uu(n.height)/e.offsetHeight||1);var a=(iu(e)?tu(e):window).visualViewport,o=!hu()&&i,l=(n.left+(o&&a?a.offsetLeft:0))/s,u=(n.top+(o&&a?a.offsetTop:0))/r,c=n.width/s,h=n.height/r;return{width:c,height:h,top:u,right:l+c,bottom:u+h,left:l,x:l,y:u}}function pu(e){var t=du(e),i=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:n}}function fu(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&su(i)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function mu(e){return tu(e).getComputedStyle(e)}function gu(e){return["table","td","th"].indexOf(eu(e))>=0}function yu(e){return((iu(e)?e.ownerDocument:e.document)||window.document).documentElement}function _u(e){return"html"===eu(e)?e:e.assignedSlot||e.parentNode||(su(e)?e.host:null)||yu(e)}function vu(e){return nu(e)&&"fixed"!==mu(e).position?e.offsetParent:null}function bu(e){for(var t=tu(e),i=vu(e);i&&gu(i)&&"static"===mu(i).position;)i=vu(i);return i&&("html"===eu(i)||"body"===eu(i)&&"static"===mu(i).position)?t:i||function(e){var t=/firefox/i.test(cu());if(/Trident/i.test(cu())&&nu(e)&&"fixed"===mu(e).position)return null;var i=_u(e);for(su(i)&&(i=i.host);nu(i)&&["html","body"].indexOf(eu(i))<0;){var n=mu(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||t&&"filter"===n.willChange||t&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(e)||t}function Tu(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function wu(e,t,i){return ou(e,lu(t,i))}function Su(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Eu(e,t){return t.reduce(function(t,i){return t[i]=e,t},{})}const Cu={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,i=e.state,n=e.name,s=e.options,r=i.elements.arrow,a=i.modifiersData.popperOffsets,o=au(i.placement),l=Tu(o),u=[Dl,Ol].indexOf(o)>=0?"height":"width";if(r&&a){var c=function(e,t){return Su("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Eu(e,Nl))}(s.padding,i),h=pu(r),d="y"===l?Ll:Dl,p="y"===l?Pl:Ol,f=i.rects.reference[u]+i.rects.reference[l]-a[l]-i.rects.popper[u],m=a[l]-i.rects.reference[l],g=bu(r),y=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,_=f/2-m/2,v=c[d],b=y-h[u]-c[p],T=y/2-h[u]/2+_,w=wu(v,T,b),S=l;i.modifiersData[n]=((t={})[S]=w,t.centerOffset=w-T,t)}},effect:function(e){var t=e.state,i=e.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=t.elements.popper.querySelector(n)))&&fu(t.elements.popper,n)&&(t.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ku(e){return e.split("-")[1]}var xu={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Iu(e){var t,i=e.popper,n=e.popperRect,s=e.placement,r=e.variation,a=e.offsets,o=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,h=e.isFixed,d=a.x,p=void 0===d?0:d,f=a.y,m=void 0===f?0:f,g="function"==typeof c?c({x:p,y:m}):{x:p,y:m};p=g.x,m=g.y;var y=a.hasOwnProperty("x"),_=a.hasOwnProperty("y"),v=Dl,b=Ll,T=window;if(u){var w=bu(i),S="clientHeight",E="clientWidth";if(w===tu(i)&&"static"!==mu(w=yu(i)).position&&"absolute"===o&&(S="scrollHeight",E="scrollWidth"),s===Ll||(s===Dl||s===Ol)&&r===Fl)b=Pl,m-=(h&&w===T&&T.visualViewport?T.visualViewport.height:w[S])-n.height,m*=l?1:-1;if(s===Dl||(s===Ll||s===Pl)&&r===Fl)v=Ol,p-=(h&&w===T&&T.visualViewport?T.visualViewport.width:w[E])-n.width,p*=l?1:-1}var C,k=Object.assign({position:o},u&&xu),x=!0===c?function(e,t){var i=e.x,n=e.y,s=t.devicePixelRatio||1;return{x:uu(i*s)/s||0,y:uu(n*s)/s||0}}({x:p,y:m},tu(i)):{x:p,y:m};return p=x.x,m=x.y,l?Object.assign({},k,((C={})[b]=_?"0":"",C[v]=y?"0":"",C.transform=(T.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",C)):Object.assign({},k,((t={})[b]=_?m+"px":"",t[v]=y?p+"px":"",t.transform="",t))}const Au={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,i=e.options,n=i.gpuAcceleration,s=void 0===n||n,r=i.adaptive,a=void 0===r||r,o=i.roundOffsets,l=void 0===o||o,u={placement:au(t.placement),variation:ku(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Iu(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Iu(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var Lu={passive:!0};const Pu={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,i=e.instance,n=e.options,s=n.scroll,r=void 0===s||s,a=n.resize,o=void 0===a||a,l=tu(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&u.forEach(function(e){e.addEventListener("scroll",i.update,Lu)}),o&&l.addEventListener("resize",i.update,Lu),function(){r&&u.forEach(function(e){e.removeEventListener("scroll",i.update,Lu)}),o&&l.removeEventListener("resize",i.update,Lu)}},data:{}};var Ou={left:"right",right:"left",bottom:"top",top:"bottom"};function Du(e){return e.replace(/left|right|bottom|top/g,function(e){return Ou[e]})}var Mu={start:"end",end:"start"};function Nu(e){return e.replace(/start|end/g,function(e){return Mu[e]})}function Ru(e){var t=tu(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Fu(e){return du(yu(e)).left+Ru(e).scrollLeft}function Bu(e){var t=mu(e),i=t.overflow,n=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+s+n)}function Uu(e){return["html","body","#document"].indexOf(eu(e))>=0?e.ownerDocument.body:nu(e)&&Bu(e)?e:Uu(_u(e))}function ju(e,t){var i;void 0===t&&(t=[]);var n=Uu(e),s=n===(null==(i=e.ownerDocument)?void 0:i.body),r=tu(n),a=s?[r].concat(r.visualViewport||[],Bu(n)?n:[]):n,o=t.concat(a);return s?o:o.concat(ju(_u(a)))}function $u(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function qu(e,t,i){return t===Ul?$u(function(e,t){var i=tu(e),n=yu(e),s=i.visualViewport,r=n.clientWidth,a=n.clientHeight,o=0,l=0;if(s){r=s.width,a=s.height;var u=hu();(u||!u&&"fixed"===t)&&(o=s.offsetLeft,l=s.offsetTop)}return{width:r,height:a,x:o+Fu(e),y:l}}(e,i)):iu(t)?function(e,t){var i=du(e,!1,"fixed"===t);return i.top=i.top+e.clientTop,i.left=i.left+e.clientLeft,i.bottom=i.top+e.clientHeight,i.right=i.left+e.clientWidth,i.width=e.clientWidth,i.height=e.clientHeight,i.x=i.left,i.y=i.top,i}(t,i):$u(function(e){var t,i=yu(e),n=Ru(e),s=null==(t=e.ownerDocument)?void 0:t.body,r=ou(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),a=ou(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),o=-n.scrollLeft+Fu(e),l=-n.scrollTop;return"rtl"===mu(s||i).direction&&(o+=ou(i.clientWidth,s?s.clientWidth:0)-r),{width:r,height:a,x:o,y:l}}(yu(e)))}function Vu(e,t,i,n){var s="clippingParents"===t?function(e){var t=ju(_u(e)),i=["absolute","fixed"].indexOf(mu(e).position)>=0&&nu(e)?bu(e):e;return iu(i)?t.filter(function(e){return iu(e)&&fu(e,i)&&"body"!==eu(e)}):[]}(e):[].concat(t),r=[].concat(s,[i]),a=r[0],o=r.reduce(function(t,i){var s=qu(e,i,n);return t.top=ou(s.top,t.top),t.right=lu(s.right,t.right),t.bottom=lu(s.bottom,t.bottom),t.left=ou(s.left,t.left),t},qu(e,a,n));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function Hu(e){var t,i=e.reference,n=e.element,s=e.placement,r=s?au(s):null,a=s?ku(s):null,o=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(r){case Ll:t={x:o,y:i.y-n.height};break;case Pl:t={x:o,y:i.y+i.height};break;case Ol:t={x:i.x+i.width,y:l};break;case Dl:t={x:i.x-n.width,y:l};break;default:t={x:i.x,y:i.y}}var u=r?Tu(r):null;if(null!=u){var c="y"===u?"height":"width";switch(a){case Rl:t[u]=t[u]-(i[c]/2-n[c]/2);break;case Fl:t[u]=t[u]+(i[c]/2-n[c]/2)}}return t}function zu(e,t){void 0===t&&(t={});var i=t,n=i.placement,s=void 0===n?e.placement:n,r=i.strategy,a=void 0===r?e.strategy:r,o=i.boundary,l=void 0===o?Bl:o,u=i.rootBoundary,c=void 0===u?Ul:u,h=i.elementContext,d=void 0===h?jl:h,p=i.altBoundary,f=void 0!==p&&p,m=i.padding,g=void 0===m?0:m,y=Su("number"!=typeof g?g:Eu(g,Nl)),_=d===jl?$l:jl,v=e.rects.popper,b=e.elements[f?_:d],T=Vu(iu(b)?b:b.contextElement||yu(e.elements.popper),l,c,a),w=du(e.elements.reference),S=Hu({reference:w,element:v,placement:s}),E=$u(Object.assign({},v,S)),C=d===jl?E:w,k={top:T.top-C.top+y.top,bottom:C.bottom-T.bottom+y.bottom,left:T.left-C.left+y.left,right:C.right-T.right+y.right},x=e.modifiersData.offset;if(d===jl&&x){var I=x[s];Object.keys(k).forEach(function(e){var t=[Ol,Pl].indexOf(e)>=0?1:-1,i=[Ll,Pl].indexOf(e)>=0?"y":"x";k[e]+=I[i]*t})}return k}function Wu(e,t){void 0===t&&(t={});var i=t,n=i.placement,s=i.boundary,r=i.rootBoundary,a=i.padding,o=i.flipVariations,l=i.allowedAutoPlacements,u=void 0===l?Vl:l,c=ku(n),h=c?o?ql:ql.filter(function(e){return ku(e)===c}):Nl,d=h.filter(function(e){return u.indexOf(e)>=0});0===d.length&&(d=h);var p=d.reduce(function(t,i){return t[i]=zu(e,{placement:i,boundary:s,rootBoundary:r,padding:a})[au(i)],t},{});return Object.keys(p).sort(function(e,t){return p[e]-p[t]})}const Gu={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var s=i.mainAxis,r=void 0===s||s,a=i.altAxis,o=void 0===a||a,l=i.fallbackPlacements,u=i.padding,c=i.boundary,h=i.rootBoundary,d=i.altBoundary,p=i.flipVariations,f=void 0===p||p,m=i.allowedAutoPlacements,g=t.options.placement,y=au(g),_=l||(y===g||!f?[Du(g)]:function(e){if(au(e)===Ml)return[];var t=Du(e);return[Nu(e),t,Nu(t)]}(g)),v=[g].concat(_).reduce(function(e,i){return e.concat(au(i)===Ml?Wu(t,{placement:i,boundary:c,rootBoundary:h,padding:u,flipVariations:f,allowedAutoPlacements:m}):i)},[]),b=t.rects.reference,T=t.rects.popper,w=new Map,S=!0,E=v[0],C=0;C<v.length;C++){var k=v[C],x=au(k),I=ku(k)===Rl,A=[Ll,Pl].indexOf(x)>=0,L=A?"width":"height",P=zu(t,{placement:k,boundary:c,rootBoundary:h,altBoundary:d,padding:u}),O=A?I?Ol:Dl:I?Pl:Ll;b[L]>T[L]&&(O=Du(O));var D=Du(O),M=[];if(r&&M.push(P[x]<=0),o&&M.push(P[O]<=0,P[D]<=0),M.every(function(e){return e})){E=k,S=!1;break}w.set(k,M)}if(S)for(var N=function(e){var t=v.find(function(t){var i=w.get(t);if(i)return i.slice(0,e).every(function(e){return e})});if(t)return E=t,"break"},R=f?3:1;R>0;R--){if("break"===N(R))break}t.placement!==E&&(t.modifiersData[n]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Xu(e,t,i){return void 0===i&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function Ku(e){return[Ll,Ol,Pl,Dl].some(function(t){return e[t]>=0})}const Yu={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,i=e.name,n=t.rects.reference,s=t.rects.popper,r=t.modifiersData.preventOverflow,a=zu(t,{elementContext:"reference"}),o=zu(t,{altBoundary:!0}),l=Xu(a,n),u=Xu(o,s,r),c=Ku(l),h=Ku(u);t.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":h})}};const Qu={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,i=e.options,n=e.name,s=i.offset,r=void 0===s?[0,0]:s,a=Vl.reduce(function(e,i){return e[i]=function(e,t,i){var n=au(e),s=[Dl,Ll].indexOf(n)>=0?-1:1,r="function"==typeof i?i(Object.assign({},t,{placement:e})):i,a=r[0],o=r[1];return a=a||0,o=(o||0)*s,[Dl,Ol].indexOf(n)>=0?{x:o,y:a}:{x:a,y:o}}(i,t.rects,r),e},{}),o=a[t.placement],l=o.x,u=o.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[n]=a}};const Ju={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,i=e.name;t.modifiersData[i]=Hu({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})},data:{}};const Zu={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,n=e.name,s=i.mainAxis,r=void 0===s||s,a=i.altAxis,o=void 0!==a&&a,l=i.boundary,u=i.rootBoundary,c=i.altBoundary,h=i.padding,d=i.tether,p=void 0===d||d,f=i.tetherOffset,m=void 0===f?0:f,g=zu(t,{boundary:l,rootBoundary:u,padding:h,altBoundary:c}),y=au(t.placement),_=ku(t.placement),v=!_,b=Tu(y),T="x"===b?"y":"x",w=t.modifiersData.popperOffsets,S=t.rects.reference,E=t.rects.popper,C="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,k="number"==typeof C?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),x=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,I={x:0,y:0};if(w){if(r){var A,L="y"===b?Ll:Dl,P="y"===b?Pl:Ol,O="y"===b?"height":"width",D=w[b],M=D+g[L],N=D-g[P],R=p?-E[O]/2:0,F=_===Rl?S[O]:E[O],B=_===Rl?-E[O]:-S[O],U=t.elements.arrow,j=p&&U?pu(U):{width:0,height:0},$=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},q=$[L],V=$[P],H=wu(0,S[O],j[O]),z=v?S[O]/2-R-H-q-k.mainAxis:F-H-q-k.mainAxis,W=v?-S[O]/2+R+H+V+k.mainAxis:B+H+V+k.mainAxis,G=t.elements.arrow&&bu(t.elements.arrow),X=G?"y"===b?G.clientTop||0:G.clientLeft||0:0,K=null!=(A=null==x?void 0:x[b])?A:0,Y=D+W-K,Q=wu(p?lu(M,D+z-K-X):M,D,p?ou(N,Y):N);w[b]=Q,I[b]=Q-D}if(o){var J,Z="x"===b?Ll:Dl,ee="x"===b?Pl:Ol,te=w[T],ie="y"===T?"height":"width",ne=te+g[Z],se=te-g[ee],re=-1!==[Ll,Dl].indexOf(y),ae=null!=(J=null==x?void 0:x[T])?J:0,oe=re?ne:te-S[ie]-E[ie]-ae+k.altAxis,le=re?te+S[ie]+E[ie]-ae-k.altAxis:se,ue=p&&re?function(e,t,i){var n=wu(e,t,i);return n>i?i:n}(oe,te,le):wu(p?oe:ne,te,p?le:se);w[T]=ue,I[T]=ue-te}t.modifiersData[n]=I}},requiresIfExists:["offset"]};function ec(e,t,i){void 0===i&&(i=!1);var n,s,r=nu(t),a=nu(t)&&function(e){var t=e.getBoundingClientRect(),i=uu(t.width)/e.offsetWidth||1,n=uu(t.height)/e.offsetHeight||1;return 1!==i||1!==n}(t),o=yu(t),l=du(e,a,i),u={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!i)&&(("body"!==eu(t)||Bu(o))&&(u=(n=t)!==tu(n)&&nu(n)?{scrollLeft:(s=n).scrollLeft,scrollTop:s.scrollTop}:Ru(n)),nu(t)?((c=du(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):o&&(c.x=Fu(o))),{x:l.left+u.scrollLeft-c.x,y:l.top+u.scrollTop-c.y,width:l.width,height:l.height}}function tc(e){var t=new Map,i=new Set,n=[];function s(e){i.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!i.has(e)){var n=t.get(e);n&&s(n)}}),n.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){i.has(e.name)||s(e)}),n}var ic={placement:"bottom",modifiers:[],strategy:"absolute"};function nc(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return!t.some(function(e){return!(e&&"function"==typeof e.getBoundingClientRect)})}function sc(e){void 0===e&&(e={});var t=e,i=t.defaultModifiers,n=void 0===i?[]:i,s=t.defaultOptions,r=void 0===s?ic:s;return function(e,t,i){void 0===i&&(i=r);var s,a,o={placement:"bottom",orderedModifiers:[],options:Object.assign({},ic,r),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],u=!1,c={state:o,setOptions:function(i){var s="function"==typeof i?i(o.options):i;h(),o.options=Object.assign({},r,o.options,s),o.scrollParents={reference:iu(e)?ju(e):e.contextElement?ju(e.contextElement):[],popper:ju(t)};var a,u,d=function(e){var t=tc(e);return Zl.reduce(function(e,i){return e.concat(t.filter(function(e){return e.phase===i}))},[])}((a=[].concat(n,o.options.modifiers),u=a.reduce(function(e,t){var i=e[t.name];return e[t.name]=i?Object.assign({},i,t,{options:Object.assign({},i.options,t.options),data:Object.assign({},i.data,t.data)}):t,e},{}),Object.keys(u).map(function(e){return u[e]})));return o.orderedModifiers=d.filter(function(e){return e.enabled}),o.orderedModifiers.forEach(function(e){var t=e.name,i=e.options,n=void 0===i?{}:i,s=e.effect;if("function"==typeof s){var r=s({state:o,name:t,instance:c,options:n}),a=function(){};l.push(r||a)}}),c.update()},forceUpdate:function(){if(!u){var e=o.elements,t=e.reference,i=e.popper;if(nc(t,i)){o.rects={reference:ec(t,bu(i),"fixed"===o.options.strategy),popper:pu(i)},o.reset=!1,o.placement=o.options.placement,o.orderedModifiers.forEach(function(e){return o.modifiersData[e.name]=Object.assign({},e.data)});for(var n=0;n<o.orderedModifiers.length;n++)if(!0!==o.reset){var s=o.orderedModifiers[n],r=s.fn,a=s.options,l=void 0===a?{}:a,h=s.name;"function"==typeof r&&(o=r({state:o,options:l,name:h,instance:c})||o)}else o.reset=!1,n=-1}}},update:(s=function(){return new Promise(function(e){c.forceUpdate(),e(o)})},function(){return a||(a=new Promise(function(e){Promise.resolve().then(function(){a=void 0,e(s())})})),a}),destroy:function(){h(),u=!0}};if(!nc(e,t))return c;function h(){l.forEach(function(e){return e()}),l=[]}return c.setOptions(i).then(function(e){!u&&i.onFirstUpdate&&i.onFirstUpdate(e)}),c}}var rc=sc({defaultModifiers:[Pu,Ju,Au,ru,Qu,Gu,Zu,Cu,Yu]});const ac=Object.freeze(Object.defineProperty({__proto__:null,afterMain:Kl,afterRead:Wl,afterWrite:Jl,applyStyles:ru,arrow:Cu,auto:Ml,basePlacements:Nl,beforeMain:Gl,beforeRead:Hl,beforeWrite:Yl,bottom:Pl,clippingParents:Bl,computeStyles:Au,createPopper:rc,detectOverflow:zu,end:Fl,eventListeners:Pu,flip:Gu,hide:Yu,left:Dl,main:Xl,modifierPhases:Zl,offset:Qu,placements:Vl,popper:jl,popperGenerator:sc,popperOffsets:Ju,preventOverflow:Zu,read:zl,reference:$l,right:Ol,start:Rl,top:Ll,variationPlacements:ql,viewport:Ul,write:Ql},Symbol.toStringTag,{value:"Module"})),oc="dropdown",lc=".bs.dropdown",uc=".data-api",cc="ArrowUp",hc="ArrowDown",dc=`hide${lc}`,pc=`hidden${lc}`,fc=`show${lc}`,mc=`shown${lc}`,gc=`click${lc}${uc}`,yc=`keydown${lc}${uc}`,_c=`keyup${lc}${uc}`,vc="show",bc='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',Tc=`${bc}.${vc}`,wc=".dropdown-menu",Sc=bi()?"top-end":"top-start",Ec=bi()?"top-start":"top-end",Cc=bi()?"bottom-end":"bottom-start",kc=bi()?"bottom-start":"bottom-end",xc=bi()?"left-start":"right-start",Ic=bi()?"right-start":"left-start",Ac={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},Lc={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class Pc extends Hi{constructor(e,t){super(e,t),this._popper=null,this._parent=this._element.parentNode,this._menu=zi.next(this._element,wc)[0]||zi.prev(this._element,wc)[0]||zi.findOne(wc,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return Ac}static get DefaultType(){return Lc}static get NAME(){return oc}toggle(){return this._isShown()?this.hide():this.show()}show(){if(gi(this._element)||this._isShown())return;const e={relatedTarget:this._element};if(!Bi.trigger(this._element,fc,e).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav"))for(const e of[].concat(...document.body.children))Bi.on(e,"mouseover",_i);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(vc),this._element.classList.add(vc),Bi.trigger(this._element,mc,e)}}hide(){if(gi(this._element)||!this._isShown())return;const e={relatedTarget:this._element};this._completeHide(e)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(e){if(!Bi.trigger(this._element,dc,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))Bi.off(e,"mouseover",_i);this._popper&&this._popper.destroy(),this._menu.classList.remove(vc),this._element.classList.remove(vc),this._element.setAttribute("aria-expanded","false"),qi.removeDataAttribute(this._menu,"popper"),Bi.trigger(this._element,pc,e)}}_getConfig(e){if("object"==typeof(e=super._getConfig(e)).reference&&!pi(e.reference)&&"function"!=typeof e.reference.getBoundingClientRect)throw new TypeError(`${oc.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createPopper(){if(void 0===ac)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let e=this._element;"parent"===this._config.reference?e=this._parent:pi(this._config.reference)?e=fi(this._config.reference):"object"==typeof this._config.reference&&(e=this._config.reference);const t=this._getPopperConfig();this._popper=rc(e,this._menu,t)}_isShown(){return this._menu.classList.contains(vc)}_getPlacement(){const e=this._parent;if(e.classList.contains("dropend"))return xc;if(e.classList.contains("dropstart"))return Ic;if(e.classList.contains("dropup-center"))return"top";if(e.classList.contains("dropdown-center"))return"bottom";const t="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return e.classList.contains("dropup")?t?Ec:Sc:t?kc:Cc}_detectNavbar(){return null!==this._element.closest(".navbar")}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map(e=>Number.parseInt(e,10)):"function"==typeof e?t=>e(t,this._element):e}_getPopperConfig(){const e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(qi.setDataAttribute(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),{...e,..."function"==typeof this._config.popperConfig?this._config.popperConfig(e):this._config.popperConfig}}_selectMenuItem({key:e,target:t}){const i=zi.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter(e=>mi(e));i.length&&Si(i,t,e===hc,!i.includes(t)).focus()}static clearMenus(e){if(2===e.button||"keyup"===e.type&&"Tab"!==e.key)return;const t=zi.find(Tc);for(const i of t){const t=Pc.getInstance(i);if(!t||!1===t._config.autoClose)continue;const n=e.composedPath(),s=n.includes(t._menu);if(n.includes(t._element)||"inside"===t._config.autoClose&&!s||"outside"===t._config.autoClose&&s)continue;if(t._menu.contains(e.target)&&("keyup"===e.type&&"Tab"===e.key||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;const r={relatedTarget:t._element};"click"===e.type&&(r.clickEvent=e),t._completeHide(r)}}static dataApiKeydownHandler(e){const t=/input|textarea/i.test(e.target.tagName),i="Escape"===e.key,n=[cc,hc].includes(e.key);if(!n&&!i)return;if(t&&!i)return;e.preventDefault();const s=this.matches(bc)?this:zi.prev(this,bc)[0]||zi.next(this,bc)[0]||zi.findOne(bc,e.delegateTarget.parentNode),r=Pc.getOrCreateInstance(s);if(n)return e.stopPropagation(),r.show(),void r._selectMenuItem(e);r._isShown()&&(e.stopPropagation(),r.hide(),s.focus())}}"undefined"!=typeof window&&"undefined"!=typeof document&&(Bi.on(document,yc,bc,Pc.dataApiKeydownHandler),Bi.on(document,yc,wc,Pc.dataApiKeydownHandler),Bi.on(document,gc,Pc.clearMenus),Bi.on(document,_c,Pc.clearMenus),Bi.on(document,gc,bc,function(e){e.preventDefault(),Pc.getOrCreateInstance(this).toggle()}));const Oc=".bs.modal",Dc=`hide${Oc}`,Mc=`hidePrevented${Oc}`,Nc=`hidden${Oc}`,Rc=`show${Oc}`,Fc=`shown${Oc}`,Bc=`resize${Oc}`,Uc=`click.dismiss${Oc}`,jc=`mousedown.dismiss${Oc}`,$c=`keydown.dismiss${Oc}`,qc=`click${Oc}.data-api`,Vc="modal-open",Hc="show",zc="modal-static",Wc={backdrop:!0,focus:!0,keyboard:!0},Gc={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class Xc extends Hi{constructor(e,t){super(e,t),this._dialog=zi.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new Nn,this._addEventListeners()}static get Default(){return Wc}static get DefaultType(){return Gc}static get NAME(){return"modal"}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown||this._isTransitioning)return;Bi.trigger(this._element,Rc,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Vc),this._adjustDialog(),this._backdrop.show(()=>this._showElement(e)))}hide(){if(!this._isShown||this._isTransitioning)return;Bi.trigger(this._element,Dc).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(Hc),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){for(const e of[window,this._dialog])Bi.off(e,Oc);this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new Xn({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new qn({trapElement:this._element})}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const t=zi.findOne(".modal-body",this._dialog);t&&(t.scrollTop=0),vi(this._element),this._element.classList.add(Hc);this._queueCallback(()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,Bi.trigger(this._element,Fc,{relatedTarget:e})},this._dialog,this._isAnimated())}_addEventListeners(){Bi.on(this._element,$c,e=>{if("Escape"===e.key)return this._config.keyboard?(e.preventDefault(),void this.hide()):void this._triggerBackdropTransition()}),Bi.on(window,Bc,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),Bi.on(this._element,jc,e=>{Bi.one(this._element,Uc,t=>{this._element===e.target&&this._element===t.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition())})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(Vc),this._resetAdjustments(),this._scrollBar.reset(),Bi.trigger(this._element,Nc)})}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(Bi.trigger(this._element,Mc).defaultPrevented)return;const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._element.style.overflowY;"hidden"===t||this._element.classList.contains(zc)||(e||(this._element.style.overflowY="hidden"),this._element.classList.add(zc),this._queueCallback(()=>{this._element.classList.remove(zc),this._queueCallback(()=>{this._element.style.overflowY=t},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),i=t>0;if(i&&!e){const e=bi()?"paddingLeft":"paddingRight";this._element.style[e]=`${t}px`}if(!i&&e){const e=bi()?"paddingRight":"paddingLeft";this._element.style[e]=`${t}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}}"undefined"!=typeof window&&"undefined"!=typeof document&&(Bi.on(document,qc,'[data-bs-toggle="modal"]',function(e){const t=di(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),Bi.one(t,Rc,e=>{e.defaultPrevented||Bi.one(t,Nc,()=>{mi(this)&&this.focus()})});const i=zi.findOne(".modal.show");i&&Xc.getInstance(i).hide();Xc.getOrCreateInstance(t).toggle(this)}),dn(Xc));const Kc=".bs.offcanvas",Yc=".data-api",Qc=`load${Kc}${Yc}`,Jc="show",Zc="showing",eh="hiding",th=".offcanvas.show",ih=`show${Kc}`,nh=`shown${Kc}`,sh=`hide${Kc}`,rh=`hidePrevented${Kc}`,ah=`hidden${Kc}`,oh=`resize${Kc}`,lh=`click${Kc}${Yc}`,uh=`keydown.dismiss${Kc}`,ch={backdrop:!0,keyboard:!0,scroll:!1},hh={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class dh extends Hi{constructor(e,t){super(e,t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return ch}static get DefaultType(){return hh}static get NAME(){return"offcanvas"}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown)return;if(Bi.trigger(this._element,ih,{relatedTarget:e}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||(new Nn).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(Zc);this._queueCallback(()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(Jc),this._element.classList.remove(Zc),Bi.trigger(this._element,nh,{relatedTarget:e})},this._element,!0)}hide(){if(!this._isShown)return;if(Bi.trigger(this._element,sh).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(eh),this._backdrop.hide();this._queueCallback(()=>{this._element.classList.remove(Jc,eh),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new Nn).reset(),Bi.trigger(this._element,ah)},this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const e=Boolean(this._config.backdrop);return new Xn({className:"offcanvas-backdrop",isVisible:e,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:e?()=>{"static"!==this._config.backdrop?this.hide():Bi.trigger(this._element,rh)}:null})}_initializeFocusTrap(){return new qn({trapElement:this._element})}_addEventListeners(){Bi.on(this._element,uh,e=>{"Escape"===e.key&&(this._config.keyboard?this.hide():Bi.trigger(this._element,rh))})}}"undefined"!=typeof window&&"undefined"!=typeof document&&(Bi.on(document,lh,'[data-bs-toggle="offcanvas"]',function(e){const t=di(this);if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),gi(this))return;Bi.one(t,ah,()=>{mi(this)&&this.focus()});const i=zi.findOne(th);i&&i!==t&&dh.getInstance(i).hide();dh.getOrCreateInstance(t).toggle(this)}),Bi.on(window,Qc,()=>{for(const e of zi.find(th))dh.getOrCreateInstance(e).show()}),Bi.on(window,oh,()=>{for(const e of zi.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(e).position&&dh.getOrCreateInstance(e).hide()}),dn(dh));const ph=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),fh=/^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i,mh=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i,gh=(e,t)=>{const i=e.nodeName.toLowerCase();return t.includes(i)?!ph.has(i)||Boolean(fh.test(e.nodeValue)||mh.test(e.nodeValue)):t.filter(e=>e instanceof RegExp).some(e=>e.test(i))},yh={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]};const _h={allowList:yh,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},vh={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},bh={entry:"(string|element|function|null)",selector:"(string|element)"};class Th extends Vi{constructor(e){super(),this._config=this._getConfig(e)}static get Default(){return _h}static get DefaultType(){return vh}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map(e=>this._resolvePossibleFunction(e)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(e){return this._checkContent(e),this._config.content={...this._config.content,...e},this}toHtml(){const e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(const[t,i]of Object.entries(this._config.content))this._setContent(e,i,t);const t=e.children[0],i=this._resolvePossibleFunction(this._config.extraClass);return i&&t.classList.add(...i.split(" ")),t}_typeCheckConfig(e){super._typeCheckConfig(e),this._checkContent(e.content)}_checkContent(e){for(const[t,i]of Object.entries(e))super._typeCheckConfig({selector:t,entry:i},bh)}_setContent(e,t,i){const n=zi.findOne(i,e);n&&((t=this._resolvePossibleFunction(t))?pi(t)?this._putElementInTemplate(fi(t),n):this._config.html?n.innerHTML=this._maybeSanitize(t):n.textContent=t:n.remove())}_maybeSanitize(e){return this._config.sanitize?function(e,t,i){if(!e.length)return e;if(i&&"function"==typeof i)return i(e);const n=(new window.DOMParser).parseFromString(e,"text/html"),s=[].concat(...n.body.querySelectorAll("*"));for(const e of s){const i=e.nodeName.toLowerCase();if(!Object.keys(t).includes(i)){e.remove();continue}const n=[].concat(...e.attributes),s=[].concat(t["*"]||[],t[i]||[]);for(const t of n)gh(t,s)||e.removeAttribute(t.nodeName)}return n.body.innerHTML}(e,this._config.allowList,this._config.sanitizeFn):e}_resolvePossibleFunction(e){return"function"==typeof e?e(this):e}_putElementInTemplate(e,t){if(this._config.html)return t.innerHTML="",void t.append(e);t.textContent=e.textContent}}const wh=new Set(["sanitize","allowList","sanitizeFn"]),Sh="fade",Eh="show",Ch=".tooltip-inner",kh=".modal",xh="hide.bs.modal",Ih="hover",Ah="focus",Lh="mouseenter",Ph="mouseleave",Oh={AUTO:"auto",TOP:"top",RIGHT:bi()?"left":"right",BOTTOM:"bottom",LEFT:bi()?"right":"left"},Dh={allowList:yh,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,0],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},Mh={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class Nh extends Hi{constructor(e,t){if(void 0===ac)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(e,t),this._isEnabled=!0,this._timers={main:null,tip:null},this._isHovered=null,this._isTipHovered=!1,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return Dh}static get DefaultType(){return Mh}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()?this._leave():this._enter())}dispose(){this._clearTimer("main"),this._clearTimer("tip"),Bi.off(this._element.closest(kh),xh,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const e=Bi.trigger(this._element,this.constructor.eventName("show")),t=(yi(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(e.defaultPrevented||!t)return;this._disposePopper();const i=this._getTipElement();this._element.setAttribute("aria-describedby",i.getAttribute("id"));const{container:n}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(n.append(i),Bi.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(i),i.classList.add(Eh),this._setTipListeners(),"ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))Bi.on(e,"mouseover",_i);document.addEventListener("keyup",e=>{"Escape"===e.key&&this.hide()},{once:!0});this._queueCallback(()=>{Bi.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1},this.tip,this._isAnimated())}hide(){if(!this._isShown())return;if(Bi.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented)return;if(this._getTipElement().classList.remove(Eh),this._removeTipListeners(),"ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))Bi.off(e,"mouseover",_i);this._activeTrigger.click=!1,this._activeTrigger[Ah]=!1,this._activeTrigger[Ih]=!1,this._isHovered=null;this._queueCallback(()=>{this._isWithActiveTrigger()||(this._isHovered&&this._isTipHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),Bi.trigger(this._element,this.constructor.eventName("hidden")))},this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(e){const t=this._getTemplateFactory(e).toHtml();if(!t)return null;t.classList.remove(Sh,Eh),t.classList.add(`bs-${this.constructor.NAME}-auto`);const i=(e=>{do{e+=Math.floor(1e6*Math.random())}while(document.getElementById(e));return e})(this.constructor.NAME).toString();return t.setAttribute("id",i),this._isAnimated()&&t.classList.add(Sh),t}setContent(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new Th({...this._config,content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[Ch]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(Sh)}_isShown(){return this.tip&&this.tip.classList.contains(Eh)}_createPopper(e){const t="function"==typeof this._config.placement?this._config.placement.call(this,e,this._element):this._config.placement,i=Oh[t.toUpperCase()];return rc(this._element,e,this._getPopperConfig(i))}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map(e=>Number.parseInt(e,10)):"function"==typeof e?t=>e(t,this._element):e}_resolvePossibleFunction(e){return"function"==typeof e?e.call(this._element):e}_getPopperConfig(e){const t={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:e=>{this._getTipElement().setAttribute("data-popper-placement",e.state.placement)}}]};return{...t,..."function"==typeof this._config.popperConfig?this._config.popperConfig(t):this._config.popperConfig}}_setListeners(){const e=this._config.trigger.split(" ");for(const t of e)if("click"===t)Bi.on(this._element,this.constructor.eventName("click"),this._config.selector,e=>{this._initializeOnDelegatedTarget(e).toggle()});else if("manual"!==t){const e=t===Ih?this.constructor.eventName(Lh):this.constructor.eventName("focusin"),i=t===Ih?this.constructor.eventName(Ph):this.constructor.eventName("focusout");Bi.on(this._element,e,this._config.selector,e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger["focusin"===e.type?Ah:Ih]=!0,t._enter()}),Bi.on(this._element,i,this._config.selector,e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger["focusout"===e.type?Ah:Ih]=t._element.contains(e.relatedTarget),t._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},Bi.on(this._element.closest(kh),xh,this._hideModalHandler)}_setTipListeners(){this.tip&&(Bi.on(this.tip,Lh,this._handleTipMouseEnter),Bi.on(this.tip,Ph,this._handleTipMouseLeave))}_handleTipMouseEnter=()=>{this._clearTimer("tip"),this._isTipHovered=!0};_handleTipMouseLeave=()=>{this._clearTimer("tip"),this._isTipHovered=!1,this._setTimer("tip",()=>{this._isHovered||this._isTipHovered||this._leave()},100)};_removeTipListeners(){this.tip&&(Bi.off(this.tip,Lh,this._handleTipMouseEnter),Bi.off(this.tip,Ph,this._handleTipMouseLeave),this._clearTimer("tip"))}_fixTitle(){const e=this._element.getAttribute("title");e&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimer("main",()=>{this._isHovered&&this.show()},this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._setTimer("main",()=>{this._isHovered||this._isTipHovered||this.hide()},this._config.delay.hide),this._isHovered=!1,this._isTipHovered=!1)}_setTimer(e,t,i){return this._clearTimer(e),this._timers[e]=setTimeout(()=>{this._timers[e]=null,t()},i),this._timers[e]}_clearTimer(e){this._timers&&this._timers[e]&&(clearTimeout(this._timers[e]),this._timers[e]=null)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(e){const t=qi.getDataAttributes(this._element);for(const e of Object.keys(t))wh.has(e)&&delete t[e];return e={...t,..."object"==typeof e&&e?e:{}},e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e.container=!1===e.container?document.body:fi(e.container),"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),"number"==typeof e.title&&(e.title=e.title.toString()),"number"==typeof e.content&&(e.content=e.content.toString()),e}_getDelegateConfig(){const e={};for(const t in this._config)this.constructor.Default[t]!==this._config[t]&&(e[t]=this._config[t]);return e.selector=!1,e.trigger="manual",e}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this._removeTipListeners(),this._isTipHovered=!1,this.tip.remove(),this.tip=null)}}const Rh=".popover-header",Fh=".popover-body",Bh={...Nh.Default,content:"",offset:[0,8],placement:"right",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',trigger:"click"},Uh={...Nh.DefaultType,content:"(null|string|element|function)"};const jh=".bs.scrollspy",$h=`activate${jh}`,qh=`click${jh}`,Vh=`load${jh}.data-api`,Hh="active",zh="[href]",Wh=".nav-link",Gh=`${Wh}, .nav-item > ${Wh}, .list-group-item`,Xh={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},Kh={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class Yh extends Hi{constructor(e,t){super(e,t),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return Xh}static get DefaultType(){return Kh}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const e of this._observableSections.values())this._observer.observe(e)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(e){return e.target=fi(e.target)||document.body,e.rootMargin=e.offset?`${e.offset}px 0px -30%`:e.rootMargin,"string"==typeof e.threshold&&(e.threshold=e.threshold.split(",").map(e=>Number.parseFloat(e))),e}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(Bi.off(this._config.target,qh),Bi.on(this._config.target,qh,zh,e=>{const t=this._observableSections.get(e.target.hash);if(t){e.preventDefault();const i=this._rootElement||window,n=t.offsetTop-this._element.offsetTop;if(i.scrollTo)return void i.scrollTo({top:n,behavior:"smooth"});i.scrollTop=n}}))}_getNewObserver(){const e={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(e=>this._observerCallback(e),e)}_observerCallback(e){const t=e=>this._targetLinks.get(`#${e.target.id}`),i=e=>{this._previousScrollData.visibleEntryTop=e.target.offsetTop,this._process(t(e))},n=(this._rootElement||document.documentElement).scrollTop,s=n>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=n;for(const r of e){if(!r.isIntersecting){this._activeTarget=null,this._clearActiveClass(t(r));continue}const e=r.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(s&&e){if(i(r),!n)return}else s||e||i(r)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const e=zi.find(zh,this._config.target);for(const t of e){if(!t.hash||gi(t))continue;const e=zi.findOne(t.hash,this._element);mi(e)&&(this._targetLinks.set(t.hash,t),this._observableSections.set(t.hash,e))}}_process(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add(Hh),this._activateParents(e),Bi.trigger(this._element,$h,{relatedTarget:e}))}_activateParents(e){if(e.classList.contains("dropdown-item"))zi.findOne(".dropdown-toggle",e.closest(".dropdown")).classList.add(Hh);else for(const t of zi.parents(e,".nav, .list-group"))for(const e of zi.prev(t,Gh))e.classList.add(Hh)}_clearActiveClass(e){e.classList.remove(Hh);const t=zi.find(`${zh}.${Hh}`,e);for(const e of t)e.classList.remove(Hh)}}"undefined"!=typeof window&&"undefined"!=typeof document&&Bi.on(window,Vh,()=>{for(const e of zi.find('[data-bs-spy="scroll"]'))Yh.getOrCreateInstance(e)});const Qh=".bs.tab",Jh=`hide${Qh}`,Zh=`hidden${Qh}`,ed=`show${Qh}`,td=`shown${Qh}`,id=`click${Qh}`,nd=`keydown${Qh}`,sd=`load${Qh}`,rd="ArrowLeft",ad="ArrowRight",od="ArrowUp",ld="ArrowDown",ud="Enter",cd=" ",hd="active",dd="fade",pd="show",fd=":not(.dropdown-toggle)",md='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',gd=`${`.nav-link${fd}, .list-group-item${fd}, [role="tab"]${fd}`}, ${md}`;class yd extends Hi{constructor(e){super(e),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),Bi.on(this._element,nd,e=>this._keydown(e)))}static get NAME(){return"tab"}show(){const e=this._element;if(this._elemIsActive(e))return;const t=this._getActiveElem(),i=t?Bi.trigger(t,Jh,{relatedTarget:e}):null;Bi.trigger(e,ed,{relatedTarget:t}).defaultPrevented||i&&i.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}_activate(e,t){if(!e)return;e.classList.add(hd),this._activate(di(e));this._queueCallback(()=>{"tab"===e.getAttribute("role")?(e.removeAttribute("tabindex"),e.setAttribute("aria-selected",!0),this._toggleDropDown(e,!0),Bi.trigger(e,td,{relatedTarget:t})):e.classList.add(pd)},e,e.classList.contains(dd))}_deactivate(e,t){if(!e)return;e.classList.remove(hd),e.blur(),this._deactivate(di(e));this._queueCallback(()=>{"tab"===e.getAttribute("role")?(e.setAttribute("aria-selected",!1),e.setAttribute("tabindex","-1"),this._toggleDropDown(e,!1),Bi.trigger(e,Zh,{relatedTarget:t})):e.classList.remove(pd)},e,e.classList.contains(dd))}_keydown(e){if(![rd,ad,od,ld,ud,cd].includes(e.key))return;if(e.stopPropagation(),e.preventDefault(),e.key===ud||e.key===cd)return void yd.getOrCreateInstance(e.target).show();const t=[ad,ld].includes(e.key),i=Si(this._getChildren().filter(e=>!gi(e)),e.target,t,!0);i&&i.focus({preventScroll:!0})}_getChildren(){return zi.find(gd,this._parent)}_getActiveElem(){return this._getChildren().find(e=>this._elemIsActive(e))||null}_setInitialAttributes(e,t){this._setAttributeIfNotExists(e,"role","tablist");for(const e of t)this._setInitialAttributesOnChild(e)}_setInitialAttributesOnChild(e){e=this._getInnerElement(e);const t=this._elemIsActive(e),i=this._getOuterElement(e);e.setAttribute("aria-selected",t),i!==e&&this._setAttributeIfNotExists(i,"role","presentation"),t||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}_setInitialAttributesOnTargetPanel(e){const t=di(e);t&&(this._setAttributeIfNotExists(t,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(t,"aria-labelledby",`#${e.id}`))}_toggleDropDown(e,t){const i=this._getOuterElement(e);if(!i.classList.contains("dropdown"))return;const n=(e,n)=>{const s=zi.findOne(e,i);s&&s.classList.toggle(n,t)};n(".dropdown-toggle",hd),n(".dropdown-menu",pd),i.setAttribute("aria-expanded",t)}_setAttributeIfNotExists(e,t,i){e.hasAttribute(t)||e.setAttribute(t,i)}_elemIsActive(e){return e.classList.contains(hd)}_getInnerElement(e){return e.matches(gd)?e:zi.findOne(gd,e)}_getOuterElement(e){return e.closest(".nav-item, .list-group-item")||e}}"undefined"!=typeof window&&"undefined"!=typeof document&&(Bi.on(document,id,md,function(e){if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),gi(this))return;yd.getOrCreateInstance(this).dispose(),yd.getOrCreateInstance(this).show()}),Bi.on(window,sd,()=>{for(const e of zi.find(md)){yd.getOrCreateInstance(e).dispose(),yd.getOrCreateInstance(e)}}));const _d=".bs.toast",vd=`mouseover${_d}`,bd=`mouseout${_d}`,Td=`focusin${_d}`,wd=`focusout${_d}`,Sd=`hide${_d}`,Ed=`hidden${_d}`,Cd=`show${_d}`,kd=`shown${_d}`,xd="hide",Id="show",Ad="showing",Ld={animation:"boolean",autohide:"boolean",delay:"number"},Pd={animation:!0,autohide:!0,delay:5e3};class Od extends Hi{constructor(e,t){super(e,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return Pd}static get DefaultType(){return Ld}static get NAME(){return"toast"}show(){if(Bi.trigger(this._element,Cd).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");this._element.classList.remove(xd),vi(this._element),this._element.classList.add(Id,Ad),this._queueCallback(()=>{this._element.classList.remove(Ad),Bi.trigger(this._element,kd),this._maybeScheduleHide()},this._element,this._config.animation)}hide(){if(!this.isShown())return;if(Bi.trigger(this._element,Sd).defaultPrevented)return;this._element.classList.add(Ad),this._queueCallback(()=>{this._element.classList.add(xd),this._element.classList.remove(Ad,Id),Bi.trigger(this._element,Ed)},this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(Id),super.dispose()}isShown(){return this._element.classList.contains(Id)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(e,t){switch(e.type){case"mouseover":case"mouseout":this._hasMouseInteraction=t;break;case"focusin":case"focusout":this._hasKeyboardInteraction=t}if(t)return void this._clearTimeout();const i=e.relatedTarget;this._element===i||this._element.contains(i)||this._maybeScheduleHide()}_setListeners(){Bi.on(this._element,vd,e=>this._onInteraction(e,!0)),Bi.on(this._element,bd,e=>this._onInteraction(e,!1)),Bi.on(this._element,Td,e=>this._onInteraction(e,!0)),Bi.on(this._element,wd,e=>this._onInteraction(e,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}}"undefined"!=typeof window&&"undefined"!=typeof document&&dn(Od);var Dd="undefined"!=typeof window?window:void 0!==Ea?Ea:"undefined"!=typeof self?self:{},Md=Array.prototype.slice,Nd=function(e,t){"length"in e||(e=[e]);e=Md.call(e);for(;e.length;){var i=e.shift(),n=t(i);if(n)return n;i.childNodes&&i.childNodes.length&&(e=Md.call(i.childNodes).concat(e))}};var Rd=Fd;function Fd(e,t){if(!(this instanceof Fd))return new Fd(e,t);this.data=e,this.nodeValue=e,this.length=e.length,this.ownerDocument=t||null}Fd.prototype.nodeType=8,Fd.prototype.nodeName="#comment",Fd.prototype.toString=function(){return"[object Comment]"};var Bd=Ud;function Ud(e,t){if(!(this instanceof Ud))return new Ud(e);this.data=e||"",this.length=this.data.length,this.ownerDocument=t||null}Ud.prototype.type="DOMTextNode",Ud.prototype.nodeType=3,Ud.prototype.nodeName="#text",Ud.prototype.toString=function(){return this.data},Ud.prototype.replaceData=function(e,t,i){var n=this.data,s=n.substring(0,e),r=n.substring(e+t,n.length);this.data=s+i+r,this.length=this.data.length};var jd=function(e){var t=this,i=e.type;e.target||(e.target=t);t.listeners||(t.listeners={});var n=t.listeners[i];if(n)return n.forEach(function(i){e.currentTarget=t,"function"==typeof i?i(e):i.handleEvent(e)});t.parentNode&&t.parentNode.dispatchEvent(e)};var $d=function(e,t){var i=this;i.listeners||(i.listeners={});i.listeners[e]||(i.listeners[e]=[]);-1===i.listeners[e].indexOf(t)&&i.listeners[e].push(t)};var qd=function(e,t){var i=this;if(!i.listeners)return;if(!i.listeners[e])return;var n=i.listeners[e],s=n.indexOf(t);-1!==s&&n.splice(s,1)};var Vd=zd,Hd=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"];function zd(e){switch(e.nodeType){case 3:return Xd(e.data);case 8:return"\x3c!--"+e.data+"--\x3e";default:return function(e){var t=[],i=e.tagName;"http://www.w3.org/1999/xhtml"===e.namespaceURI&&(i=i.toLowerCase());t.push("<"+i+function(e){var t=[];for(var i in e)Wd(e,i)&&t.push({name:i,value:e[i]});for(var n in e._attributes)for(var s in e._attributes[n]){var r=e._attributes[n][s],a=(r.prefix?r.prefix+":":"")+s;t.push({name:a,value:r.value})}e.className&&t.push({name:"class",value:e.className});return t.length?Gd(t):""}(e)+function(e){var t=e.dataset,i=[];for(var n in t)i.push({name:"data-"+n,value:t[n]});return i.length?Gd(i):""}(e)),Hd.indexOf(i)>-1?t.push(" />"):(t.push(">"),e.childNodes.length?t.push.apply(t,e.childNodes.map(zd)):e.textContent||e.innerText?t.push(Xd(e.textContent||e.innerText)):e.innerHTML&&t.push(e.innerHTML),t.push("</"+i+">"));return t.join("")}(e)}}function Wd(e,t){var i=typeof e[t];return"style"===t&&Object.keys(e.style).length>0||e.hasOwnProperty(t)&&("string"===i||"boolean"===i||"number"===i)&&"nodeName"!==t&&"className"!==t&&"tagName"!==t&&"textContent"!==t&&"innerText"!==t&&"namespaceURI"!==t&&"innerHTML"!==t}function Gd(e){var t=[];return e.forEach(function(e){var i=e.name,n=e.value;"style"===i&&(n=function(e){if("string"==typeof e)return e;var t="";return Object.keys(e).forEach(function(i){var n=e[i];i=i.replace(/[A-Z]/g,function(e){return"-"+e.toLowerCase()}),t+=i+":"+n+";"}),t}(n)),t.push(i+'="'+(Xd(n).replace(/"/g,""")+'"'))}),t.length?" "+t.join(" "):""}function Xd(e){var t="";return"string"==typeof e?t=e:e&&(t=e.toString()),t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}var Kd="http://www.w3.org/1999/xhtml",Yd=Qd;function Qd(e,t,i){if(!(this instanceof Qd))return new Qd(e);var n=void 0===i?Kd:i||null;this.tagName=n===Kd?String(e).toUpperCase():e,this.nodeName=this.tagName,this.className="",this.dataset={},this.childNodes=[],this.parentNode=null,this.style={},this.ownerDocument=t||null,this.namespaceURI=n,this._attributes={},"INPUT"===this.tagName&&(this.type="text")}Qd.prototype.type="DOMElement",Qd.prototype.nodeType=1,Qd.prototype.appendChild=function(e){return e.parentNode&&e.parentNode.removeChild(e),this.childNodes.push(e),e.parentNode=this,e},Qd.prototype.replaceChild=function(e,t){e.parentNode&&e.parentNode.removeChild(e);var i=this.childNodes.indexOf(t);return t.parentNode=null,this.childNodes[i]=e,e.parentNode=this,t},Qd.prototype.removeChild=function(e){var t=this.childNodes.indexOf(e);return this.childNodes.splice(t,1),e.parentNode=null,e},Qd.prototype.insertBefore=function(e,t){e.parentNode&&e.parentNode.removeChild(e);var i=null==t?-1:this.childNodes.indexOf(t);return i>-1?this.childNodes.splice(i,0,e):this.childNodes.push(e),e.parentNode=this,e},Qd.prototype.setAttributeNS=function(e,t,i){var n=null,s=t,r=t.indexOf(":");(r>-1&&(n=t.substr(0,r),s=t.substr(r+1)),"INPUT"===this.tagName&&"type"===t)?this.type=i:(this._attributes[e]||(this._attributes[e]={}))[s]={value:i,prefix:n}},Qd.prototype.getAttributeNS=function(e,t){var i=this._attributes[e],n=i&&i[t]&&i[t].value;return"INPUT"===this.tagName&&"type"===t?this.type:"string"!=typeof n?null:n},Qd.prototype.removeAttributeNS=function(e,t){if(Object.prototype.hasOwnProperty.call(this._attributes,e)){var i=this._attributes[e];i&&Object.prototype.hasOwnProperty.call(i,t)&&delete i[t]}},Qd.prototype.hasAttributeNS=function(e,t){var i=this._attributes[e];return!!i&&t in i},Qd.prototype.setAttribute=function(e,t){return this.setAttributeNS(null,e,t)},Qd.prototype.getAttribute=function(e){return this.getAttributeNS(null,e)},Qd.prototype.removeAttribute=function(e){return this.removeAttributeNS(null,e)},Qd.prototype.hasAttribute=function(e){return this.hasAttributeNS(null,e)},Qd.prototype.removeEventListener=qd,Qd.prototype.addEventListener=$d,Qd.prototype.dispatchEvent=jd,Qd.prototype.focus=function(){},Qd.prototype.toString=function(){return Vd(this)},Qd.prototype.getElementsByClassName=function(e){var t=e.split(" "),i=[];return Nd(this,function(e){if(1===e.nodeType){var n=(e.className||"").split(" ");t.every(function(e){return-1!==n.indexOf(e)})&&i.push(e)}}),i},Qd.prototype.getElementsByTagName=function(e){e=e.toLowerCase();var t=[];return Nd(this.childNodes,function(i){1!==i.nodeType||"*"!==e&&i.tagName.toLowerCase()!==e||t.push(i)}),t},Qd.prototype.contains=function(e){return Nd(this,function(t){return e===t})||!1};var Jd=Zd;function Zd(e){if(!(this instanceof Zd))return new Zd;this.childNodes=[],this.parentNode=null,this.ownerDocument=e||null}Zd.prototype.type="DocumentFragment",Zd.prototype.nodeType=11,Zd.prototype.nodeName="#document-fragment",Zd.prototype.appendChild=Yd.prototype.appendChild,Zd.prototype.replaceChild=Yd.prototype.replaceChild,Zd.prototype.removeChild=Yd.prototype.removeChild,Zd.prototype.toString=function(){return this.childNodes.map(function(e){return String(e)}).join("")};var ep=tp;function tp(e){}tp.prototype.initEvent=function(e,t,i){this.type=e,this.bubbles=t,this.cancelable=i},tp.prototype.preventDefault=function(){};var ip=np;function np(){if(!(this instanceof np))return new np;this.head=this.createElement("head"),this.body=this.createElement("body"),this.documentElement=this.createElement("html"),this.documentElement.appendChild(this.head),this.documentElement.appendChild(this.body),this.childNodes=[this.documentElement],this.nodeType=9}var sp=np.prototype;sp.createTextNode=function(e){return new Bd(e,this)},sp.createElementNS=function(e,t){var i=null===e?null:String(e);return new Yd(t,this,i)},sp.createElement=function(e){return new Yd(e,this)},sp.createDocumentFragment=function(){return new Jd(this)},sp.createEvent=function(e){return new ep},sp.createComment=function(e){return new Rd(e,this)},sp.getElementById=function(e){return e=String(e),Nd(this.childNodes,function(t){if(String(t.id)===e)return t})||null},sp.getElementsByClassName=Yd.prototype.getElementsByClassName,sp.getElementsByTagName=Yd.prototype.getElementsByTagName,sp.contains=Yd.prototype.contains,sp.removeEventListener=qd,sp.addEventListener=$d,sp.dispatchEvent=jd;var rp,ap=new ip,op=void 0!==Ea?Ea:"undefined"!=typeof window?window:{};"undefined"!=typeof document?rp=document:(rp=op["__GLOBAL_DOCUMENT_CACHE@4"])||(rp=op["__GLOBAL_DOCUMENT_CACHE@4"]=ap);var lp=rp;function up(){return up=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)({}).hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},up.apply(null,arguments)}var cp=function(e){if(!e)return!1;var t=hp.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)},hp=Object.prototype.toString;function dp(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=function(e,t){if(!e)return;if("string"==typeof e)return pp(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return pp(e,t)}(e))||t){i&&(e=i);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function pp(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var fp=function(){function e(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var t=e.prototype;return t.getIsEnabled=function(){return this.enabled_},t.enable=function(){this.enabled_=!0},t.disable=function(){this.enabled_=!1},t.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},t.addInterceptor=function(e,t){this.typeToInterceptorsMap_.has(e)||this.typeToInterceptorsMap_.set(e,new Set);var i=this.typeToInterceptorsMap_.get(e);return!i.has(t)&&(i.add(t),!0)},t.removeInterceptor=function(e,t){var i=this.typeToInterceptorsMap_.get(e);return!(!i||!i.has(t))&&(i.delete(t),!0)},t.clearInterceptorsByType=function(e){return!!this.typeToInterceptorsMap_.get(e)&&(this.typeToInterceptorsMap_.delete(e),this.typeToInterceptorsMap_.set(e,new Set),!0)},t.clear=function(){return!!this.typeToInterceptorsMap_.size&&(this.typeToInterceptorsMap_=new Map,!0)},t.getForType=function(e){return this.typeToInterceptorsMap_.get(e)||new Set},t.execute=function(e,t){for(var i,n=dp(this.getForType(e));!(i=n()).done;){var s=i.value;try{t=s(t)}catch(e){}}return t},e}(),mp=function(){function e(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1}var t=e.prototype;return t.getIsEnabled=function(){return this.enabled_},t.enable=function(){this.enabled_=!0},t.disable=function(){this.enabled_=!1},t.reset=function(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1},t.getMaxAttempts=function(){return this.maxAttempts_},t.setMaxAttempts=function(e){this.maxAttempts_=e},t.getDelayFactor=function(){return this.delayFactor_},t.setDelayFactor=function(e){this.delayFactor_=e},t.getFuzzFactor=function(){return this.fuzzFactor_},t.setFuzzFactor=function(e){this.fuzzFactor_=e},t.getInitialDelay=function(){return this.initialDelay_},t.setInitialDelay=function(e){this.initialDelay_=e},t.createRetry=function(e){var t=void 0===e?{}:e,i=t.maxAttempts,n=t.delayFactor,s=t.fuzzFactor,r=t.initialDelay;return new gp({maxAttempts:i||this.maxAttempts_,delayFactor:n||this.delayFactor_,fuzzFactor:s||this.fuzzFactor_,initialDelay:r||this.initialDelay_})},e}(),gp=function(){function e(e){this.maxAttempts_=e.maxAttempts,this.delayFactor_=e.delayFactor,this.fuzzFactor_=e.fuzzFactor,this.currentDelay_=e.initialDelay,this.currentAttempt_=1}var t=e.prototype;return t.moveToNextAttempt=function(){this.currentAttempt_++;var e=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+e},t.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},t.getCurrentDelay=function(){return this.currentDelay_},t.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},t.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},t.getCurrentFuzzedDelay=function(){var e=this.getCurrentMinPossibleDelay(),t=this.getCurrentMaxPossibleDelay();return e+Math.random()*(t-e)},e}(),yp=mp;var _p=function(e,t){return void 0===t&&(t=!1),function(i,n,s){if(i)e(i);else if(n.statusCode>=400&&n.statusCode<=599){var r=s;if(t)if(Dd.TextDecoder){var a=function(e){void 0===e&&(e="");return e.toLowerCase().split(";").reduce(function(e,t){var i=t.split("="),n=i[0],s=i[1];return"charset"===n.trim()?s.trim():e},"utf-8")}(n.headers&&n.headers["content-type"]);try{r=new TextDecoder(a).decode(s)}catch(e){}}else r=String.fromCharCode.apply(null,new Uint8Array(s));e({cause:r})}else e(null,s)}};Sp.httpHandler=_p,Sp.requestInterceptorsStorage=new fp,Sp.responseInterceptorsStorage=new fp,Sp.retryManager=new yp;
|
||
/**
|
||
* @license
|
||
* slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
|
||
* Copyright (c) 2014 David Björklund
|
||
* Available under the MIT license
|
||
* <https://github.com/kesla/parse-headers/blob/master/LICENCE>
|
||
*/
|
||
var vp=function(e){var t={};return e?(e.trim().split("\n").forEach(function(e){var i=e.indexOf(":"),n=e.slice(0,i).trim().toLowerCase(),s=e.slice(i+1).trim();void 0===t[n]?t[n]=s:Array.isArray(t[n])?t[n].push(s):t[n]=[t[n],s]}),t):t},bp=Sp,Tp=Sp;function wp(e,t,i){var n=e;return cp(t)?(i=t,"string"==typeof e&&(n={uri:e})):n=up({},t,{uri:e}),n.callback=i,n}function Sp(e,t,i){return Ep(t=wp(e,t,i))}function Ep(e){if(void 0===e.callback)throw new Error("callback argument missing");if(e.requestType&&Sp.requestInterceptorsStorage.getIsEnabled()){var t={uri:e.uri||e.url,headers:e.headers||{},body:e.body,metadata:e.metadata||{},retry:e.retry,timeout:e.timeout},i=Sp.requestInterceptorsStorage.execute(e.requestType,t);e.uri=i.uri,e.headers=i.headers,e.body=i.body,e.metadata=i.metadata,e.retry=i.retry,e.timeout=i.timeout}var n=!1,s=function(t,i,s){n||(n=!0,e.callback(t,i,s))};function r(){var e=void 0;if(e=c.response?c.response:c.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}(c),y)try{e=JSON.parse(e)}catch(e){}return e}function a(t){if(clearTimeout(h),clearTimeout(e.retryTimeout),t instanceof Error||(t=new Error(""+(t||"Unknown XMLHttpRequest Error"))),t.statusCode=0,u||!Sp.retryManager.getIsEnabled()||!e.retry||!e.retry.shouldRetry()){if(e.requestType&&Sp.responseInterceptorsStorage.getIsEnabled()){var i={headers:_.headers||{},body:_.body,responseUrl:c.responseURL,responseType:c.responseType},n=Sp.responseInterceptorsStorage.execute(e.requestType,i);_.body=n.body,_.headers=n.headers}return s(t,_)}e.retryTimeout=setTimeout(function(){e.retry.moveToNextAttempt(),e.xhr=c,Ep(e)},e.retry.getCurrentFuzzedDelay())}function o(){if(!u){var t;clearTimeout(h),clearTimeout(e.retryTimeout),t=e.useXDR&&void 0===c.status?200:1223===c.status?204:c.status;var i=_,n=null;if(0!==t?(i={body:r(),statusCode:t,method:p,headers:{},url:d,rawRequest:c},c.getAllResponseHeaders&&(i.headers=vp(c.getAllResponseHeaders()))):n=new Error("Internal XMLHttpRequest Error"),e.requestType&&Sp.responseInterceptorsStorage.getIsEnabled()){var a={headers:i.headers||{},body:i.body,responseUrl:c.responseURL,responseType:c.responseType},o=Sp.responseInterceptorsStorage.execute(e.requestType,a);i.body=o.body,i.headers=o.headers}return s(n,i,i.body)}}var l,u,c=e.xhr||null;c||(c=e.cors||e.useXDR?new Sp.XDomainRequest:new Sp.XMLHttpRequest);var h,d=c.url=e.uri||e.url,p=c.method=e.method||"GET",f=e.body||e.data,m=c.headers=e.headers||{},g=!!e.sync,y=!1,_={body:void 0,headers:{},statusCode:0,method:p,url:d,rawRequest:c};if("json"in e&&!1!==e.json&&(y=!0,m.accept||m.Accept||(m.Accept="application/json"),"GET"!==p&&"HEAD"!==p&&(m["content-type"]||m["Content-Type"]||(m["Content-Type"]="application/json"),f=JSON.stringify(!0===e.json?f:e.json))),c.onreadystatechange=function(){4!==c.readyState||Sp.responseInterceptorsStorage.getIsEnabled()||setTimeout(o,0)},c.onload=o,c.onerror=a,c.onprogress=function(){},c.onabort=function(){u=!0,clearTimeout(e.retryTimeout)},c.ontimeout=a,c.open(p,d,!g,e.username,e.password),g||(c.withCredentials=!!e.withCredentials),!g&&e.timeout>0&&(h=setTimeout(function(){if(!u){u=!0,c.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",a(e)}},e.timeout)),c.setRequestHeader)for(l in m)m.hasOwnProperty(l)&&c.setRequestHeader(l,m[l]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(c.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(c),c.send(f||null),c}Sp.XMLHttpRequest=Dd.XMLHttpRequest||function(){},Sp.XDomainRequest="withCredentials"in new Sp.XMLHttpRequest?Sp.XMLHttpRequest:Dd.XDomainRequest,function(e,t){for(var i=0;i<e.length;i++)t(e[i])}(["get","put","post","patch","head","delete"],function(e){Sp["delete"===e?"del":e]=function(t,i,n){return(i=wp(t,i,n)).method=e.toUpperCase(),Ep(i)}}),bp.default=Tp;var Cp=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();function kp(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function xp(e){function t(e,t,i,n){return 3600*(0|e)+60*(0|t)+(0|i)+(0|n)/1e3}var i=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return i?i[3]?t(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null}function Ip(){this.values=Cp(null)}function Ap(e,t,i,n){var s=n?e.split(n):[e];for(var r in s)if("string"==typeof s[r]){var a=s[r].split(i);if(2===a.length)t(a[0].trim(),a[1].trim())}}function Lp(e,t,i){var n=e;function s(){var t=xp(e);if(null===t)throw new kp(kp.Errors.BadTimeStamp,"Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function r(){e=e.replace(/^\s+/,"")}if(r(),t.startTime=s(),r(),"--\x3e"!==e.substr(0,3))throw new kp(kp.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);e=e.substr(3),r(),t.endTime=s(),r(),function(e,t){var n=new Ip;Ap(e,function(e,t){switch(e){case"region":for(var s=i.length-1;s>=0;s--)if(i[s].id===t){n.set(e,i[s].region);break}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":var r=t.split(","),a=r[0];n.integer(e,a),n.percent(e,a)&&n.set("snapToLines",!1),n.alt(e,a,["auto"]),2===r.length&&n.alt("lineAlign",r[1],["start","center","end"]);break;case"position":r=t.split(","),n.percent(e,r[0]),2===r.length&&n.alt("positionAlign",r[1],["start","center","end"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start","center","end","left","right"])}},/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical","");try{t.line=n.get("line","auto")}catch(e){}t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100);try{t.align=n.get("align","center")}catch(e){t.align=n.get("align","middle")}try{t.position=n.get("position","auto")}catch(e){t.position=n.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=n.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}(e,t)}kp.prototype=Cp(Error.prototype),kp.prototype.constructor=kp,kp.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},Ip.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]*)?%$/)&&(t=parseFloat(t))>=0&&t<=100)&&(this.set(e,t),!0)}};var Pp=lp.createElement&&lp.createElement("textarea"),Op={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},Dp={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)"},Mp={v:"title",lang:"lang"},Np={rt:"ruby"};function Rp(e,t){function i(){if(!t)return null;var e,i=t.match(/^([^<]*)(<[^>]*>?)?/);return e=i[1]?i[1]:i[2],t=t.substr(e.length),e}function n(e){return Pp.innerHTML=e,e=Pp.textContent,Pp.textContent="",e}function s(e,t){return!Np[t.localName]||Np[t.localName]===e.localName}function r(t,i){var n=Op[t];if(!n)return null;var s=e.document.createElement(n),r=Mp[t];return r&&i&&(s[r]=i.trim()),s}for(var a,o=e.document.createElement("div"),l=o,u=[];null!==(a=i());)if("<"!==a[0])l.appendChild(e.document.createTextNode(n(a)));else{if("/"===a[1]){u.length&&u[u.length-1]===a.substr(2).replace(">","")&&(u.pop(),l=l.parentNode);continue}var c,h=xp(a.substr(1,a.length-2));if(h){c=e.document.createProcessingInstruction("timestamp",h),l.appendChild(c);continue}var d=a.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!d)continue;if(!(c=r(d[1],d[3])))continue;if(!s(l,c))continue;if(d[2]){var p=d[2].split(".");p.forEach(function(e){var t=/^bg_/.test(e),i=t?e.slice(3):e;if(Dp.hasOwnProperty(i)){var n=t?"background-color":"color",s=Dp[i];c.style[n]=s}}),c.className=p.join(" ")}u.push(d[1]),l.appendChild(c),l=c}return o}var Fp=[[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 Bp(e){for(var t=0;t<Fp.length;t++){var i=Fp[t];if(e>=i[0]&&e<=i[1])return!0}return!1}function Up(e){var t=[],i="";if(!e||!e.childNodes)return"ltr";function n(e,t){for(var i=t.childNodes.length-1;i>=0;i--)e.push(t.childNodes[i])}function s(e){if(!e||!e.length)return null;var t=e.pop(),i=t.textContent||t.innerText;if(i){var r=i.match(/^.*(\n|\r)/);return r?(e.length=0,r[0]):i}return"ruby"===t.tagName?s(e):t.childNodes?(n(e,t),s(e)):void 0}for(n(t,e);i=s(t);)for(var r=0;r<i.length;r++)if(Bp(i.charCodeAt(r)))return"rtl";return"ltr"}function jp(){}function $p(e,t,i){jp.call(this),this.cue=t,this.cueDiv=Rp(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"};this.applyStyles(n,this.cueDiv),this.div=e.document.createElement("div"),n={direction:Up(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);var s=0;switch(t.positionAlign){case"start":case"line-left":s=t.position;break;case"center":s=t.position-t.size/2;break;case"end":case"line-right":s=t.position-t.size}""===t.vertical?this.applyStyles({left:this.formatStyle(s,"%"),width:this.formatStyle(t.size,"%")}):this.applyStyles({top:this.formatStyle(s,"%"),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 qp(e){var t,i,n,s;if(e.div){i=e.div.offsetHeight,n=e.div.offsetWidth,s=e.div.offsetTop;var r=(r=e.div.childNodes)&&(r=r[0])&&r.getClientRects&&r.getClientRects();e=e.div.getBoundingClientRect(),t=r?Math.max(r[0]&&r[0].height||0,e.height/r.length):0}this.left=e.left,this.right=e.right,this.top=e.top||s,this.height=e.height||i,this.bottom=e.bottom||s+(e.height||i),this.width=e.width||n,this.lineHeight=void 0!==t?t:e.lineHeight}function Vp(e,t,i,n){var s=new qp(t),r=t.cue,a=function(e){if("number"==typeof e.line&&(e.snapToLines||e.line>=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,i=t.textTrackList,n=0,s=0;s<i.length&&i[s]!==t;s++)"showing"===i[s].mode&&n++;return-1*++n}(r),o=[];if(r.snapToLines){var l;switch(r.vertical){case"":o=["+y","-y"],l="height";break;case"rl":o=["+x","-x"],l="width";break;case"lr":o=["-x","+x"],l="width"}var u=s.lineHeight,c=u*Math.round(a),h=i[l]+u,d=o[0];Math.abs(c)>h&&(c=c<0?-1:1,c*=Math.ceil(h/u)*u),a<0&&(c+=""===r.vertical?i.height:i.width,o=o.reverse()),s.move(d,c)}else{var p=s.lineHeight/i.height*100;switch(r.lineAlign){case"center":a-=p/2;break;case"end":a-=p}switch(r.vertical){case"":t.applyStyles({top:t.formatStyle(a,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(a,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(a,"%")})}o=["+y","-x","+x","-y"],s=new qp(t)}var f=function(e,t){for(var s,r=new qp(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);a>l&&(s=new qp(e),a=l),e=new qp(r)}return s||r}(s,o);t.move(f.toCSSCompatValues(i))}function Hp(){}jp.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},jp.prototype.formatStyle=function(e,t){return 0===e?0:e+t},$p.prototype=Cp(jp.prototype),$p.prototype.constructor=$p,qp.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}},qp.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top},qp.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++)if(this.overlaps(e[t]))return!0;return!1},qp.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},qp.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}},qp.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)},qp.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}},qp.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}},Hp.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},Hp.convertCueToDOMTree=function(e,t){return e&&t?Rp(e,t):null};Hp.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!0;return!1}(t)){var s=[],r=qp.getSimpleBoxPosition(n),a={font:Math.round(.05*r.height*100)/100+"px sans-serif"};!function(){for(var i,o,l=0;l<t.length;l++)o=t[l],i=new $p(e,o,a),n.appendChild(i.div),Vp(0,i,r,s),o.displayState=i.div,s.push(qp.getSimpleBoxPosition(i))}()}else for(var o=0;o<t.length;o++)n.appendChild(t[o].displayState)},Hp.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=[]},Hp.Parser.prototype={reportOrThrowError:function(e){if(!(e instanceof kp))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/)?Ap(e,function(e,i){if("X-TIMESTAMP-MAP"===e)!function(e){var i=new Ip;Ap(e,function(e,t){switch(e){case"MPEGT":i.integer(e+"S",t);break;case"LOCA":i.set(e+"L",xp(t))}},/[^\d]:/,/,/),t.ontimestampmap&&t.ontimestampmap({MPEGTS:i.get("MPEGTS"),LOCAL:i.get("LOCAL")})}(i)},/=/):Ap(e,function(e,i){if("Region"===e)!function(e){var i=new Ip;if(Ap(e,function(e,t){switch(e){case"id":i.set(e,t);break;case"width":i.percent(e,t);break;case"lines":i.integer(e,t);break;case"regionanchor":case"viewportanchor":var n=t.split(",");if(2!==n.length)break;var s=new Ip;if(s.percent("x",n[0]),s.percent("y",n[1]),!s.has("x")||!s.has("y"))break;i.set(e+"X",s.get("x")),i.set(e+"Y",s.get("y"));break;case"scroll":i.alt(e,t,["up"])}},/=/,/\s/),i.has("id")){var n=new(t.vttjs.VTTRegion||t.window.VTTRegion);n.width=i.get("width",100),n.lines=i.get("lines",3),n.regionAnchorX=i.get("regionanchorX",0),n.regionAnchorY=i.get("regionanchorY",100),n.viewportAnchorX=i.get("viewportanchorX",0),n.viewportAnchorY=i.get("viewportanchorY",100),n.scroll=i.get("scroll",""),t.onregion&&t.onregion(n),t.regionList.push({id:i.get("id"),region:n})}}(i)},/:/)}e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));try{var s;if("INITIAL"===t.state){if(!/\r\n|\n/.test(t.buffer))return this;var r=(s=i()).match(/^WEBVTT([ \t].*)?$/);if(!r||!r[0])throw new kp(kp.Errors.BadSignature);t.state="HEADER"}for(var a=!1;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(a?a=!1:s=i(),t.state){case"HEADER":/:/.test(s)?n(s):s||(t.state="ID");continue;case"NOTE":s||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(s)){t.state="NOTE";break}if(!s)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===s.indexOf("--\x3e")){t.cue.id=s;continue}case"CUE":try{Lp(s,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!==s.indexOf("--\x3e");if(!s||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+=s.replace(/\u2028/g,"\n").replace(/u2029/g,"\n");continue;case"BADCUE":s||(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 kp(kp.Errors.BadSignature)}catch(t){e.reportOrThrowError(t)}return e.onflush&&e.onflush(),this}};var zp=Hp,Wp={"":1,lr:1,rl:1},Gp={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function Xp(e){return"string"==typeof e&&(!!Gp[e.toLowerCase()]&&e.toLowerCase())}function Kp(e,t,i){this.hasBeenReset=!1;var n="",s=!1,r=e,a=t,o=i,l=null,u="",c=!0,h="auto",d="start",p="auto",f="auto",m=100,g="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return n},set:function(e){n=""+e}},pauseOnExit:{enumerable:!0,get:function(){return s},set:function(e){s=!!e}},startTime:{enumerable:!0,get:function(){return r},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");r=e,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e)throw new 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){var t=function(e){return"string"==typeof e&&!!Wp[e.toLowerCase()]&&e.toLowerCase()}(e);if(!1===t)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");u=t,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return c},set:function(e){c=!!e,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return h},set:function(e){if("number"!=typeof e&&"auto"!==e)throw new SyntaxError("Line: an invalid number or illegal string was specified.");h=e,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return d},set:function(e){var t=Xp(e);t?(d=t,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return p},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");p=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return f},set:function(e){var t=Xp(e);t?(f=t,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return m},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");m=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return g},set:function(e){var t=Xp(e);if(!t)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");g=t,this.hasBeenReset=!0}}}),this.displayState=void 0}Kp.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var Yp=Kp,Qp={"":!0,up:!0};function Jp(e){return"number"==typeof e&&e>=0&&e<=100}var Zp=function(){var e=100,t=3,i=0,n=100,s=0,r=100,a="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!Jp(t))throw new 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 new TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return n},set:function(e){if(!Jp(e))throw new Error("RegionAnchorX must be between 0 and 100.");n=e}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!Jp(e))throw new Error("RegionAnchorY must be between 0 and 100.");i=e}},viewportAnchorY:{enumerable:!0,get:function(){return r},set:function(e){if(!Jp(e))throw new Error("ViewportAnchorY must be between 0 and 100.");r=e}},viewportAnchorX:{enumerable:!0,get:function(){return s},set:function(e){if(!Jp(e))throw new Error("ViewportAnchorX must be between 0 and 100.");s=e}},scroll:{enumerable:!0,get:function(){return a},set:function(e){var t=function(e){return"string"==typeof e&&!!Qp[e.toLowerCase()]&&e.toLowerCase()}(e);!1===t?console.warn("Scroll: an invalid or illegal string was specified."):a=t}}})},ef=Ca(function(e){var t=e.exports={WebVTT:zp,VTTCue:Yp,VTTRegion:Zp};Dd.vttjs=t,Dd.WebVTT=t.WebVTT;var i=t.VTTCue,n=t.VTTRegion,s=Dd.VTTCue,r=Dd.VTTRegion;t.shim=function(){Dd.VTTCue=i,Dd.VTTRegion=n},t.restore=function(){Dd.VTTCue=s,Dd.VTTRegion=r},Dd.VTTCue||t.shim()});ef.WebVTT,ef.VTTCue,ef.VTTRegion;var tf="https://example.com",nf=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=Dd.location&&Dd.location.href||"");var i=/^\/\//.test(e),n=!Dd.location&&!/\/\//i.test(e);e=new Dd.URL(e,Dd.location||tf);var s=new URL(t,e);return n?s.href.slice(19):i?s.href.slice(s.protocol.length):s.href},sf=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(i,1),i>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n<i;++n)t[n].call(this,arguments[1]);else for(var s=Array.prototype.slice.call(arguments,1),r=t.length,a=0;a<r;++a)t[a].apply(this,s)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",function(t){e.push(t)})},e}();function rf(e){for(var t,i=(t=e,Dd.atob?Dd.atob(t):Buffer.from(t,"base64").toString("binary")),n=new Uint8Array(i.length),s=0;s<i.length;s++)n[s]=i.charCodeAt(s);return n}class af extends sf{constructor(){super(),this.buffer=""}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf("\n");t>-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const of=String.fromCharCode(9),lf=function(e){const t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),i={};return t[1]&&(i.length=parseInt(t[1],10)),t[2]&&(i.offset=parseInt(t[2],10)),i},uf=function(e){const t={};if(!e)return t;const i=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))'));let n,s=i.length;for(;s--;)""!==i[s]&&(n=/([^=]*)=(.*)/.exec(i[s]).slice(1),n[0]=n[0].replace(/^\s+|\s+$/g,""),n[1]=n[1].replace(/^\s+|\s+$/g,""),n[1]=n[1].replace(/^['"](.*)['"]$/g,"$1"),t[n[0]]=n[1]);return t},cf=e=>{const t=e.split("x"),i={};return t[0]&&(i.width=parseInt(t[0],10)),t[1]&&(i.height=parseInt(t[1],10)),i};class hf extends sf{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,i;if(0===(e=e.trim()).length)return;if("#"!==e[0])return void this.trigger("data",{type:"uri",uri:e});this.tagMappers.reduce((t,i)=>{const n=i(e);return n===e?t:t.concat([n])},[e]).forEach(e=>{for(let t=0;t<this.customParsers.length;t++)if(this.customParsers[t].call(this,e))return;if(0===e.indexOf("#EXT"))if(e=e.replace("\r",""),t=/^#EXTM3U/.exec(e),t)this.trigger("data",{type:"tag",tagType:"m3u"});else{if(t=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(e),t)return i={type:"tag",tagType:"inf"},t[1]&&(i.duration=parseFloat(t[1])),t[2]&&(i.title=t[2]),void this.trigger("data",i);if(t=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"targetduration"},t[1]&&(i.duration=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-VERSION:([0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"version"},t[1]&&(i.version=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"media-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(e),t)return i={type:"tag",tagType:"playlist-type"},t[1]&&(i.playlistType=t[1]),void this.trigger("data",i);if(t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(e),t)return i=up(lf(t[1]),{type:"tag",tagType:"byterange"}),void this.trigger("data",i);if(t=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(e),t)return i={type:"tag",tagType:"allow-cache"},t[1]&&(i.allowed=!/NO/.test(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-MAP:(.*)$/.exec(e),t){if(i={type:"tag",tagType:"map"},t[1]){const e=uf(t[1]);e.URI&&(i.uri=e.URI),e.BYTERANGE&&(i.byterange=lf(e.BYTERANGE))}this.trigger("data",i)}else{if(t=/^#EXT-X-STREAM-INF:(.*)$/.exec(e),t)return i={type:"tag",tagType:"stream-inf"},t[1]&&(i.attributes=uf(t[1]),i.attributes.RESOLUTION&&(i.attributes.RESOLUTION=cf(i.attributes.RESOLUTION)),i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes["FRAME-RATE"]&&(i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])),i.attributes["PROGRAM-ID"]&&(i.attributes["PROGRAM-ID"]=parseInt(i.attributes["PROGRAM-ID"],10))),void this.trigger("data",i);if(t=/^#EXT-X-MEDIA:(.*)$/.exec(e),t)return i={type:"tag",tagType:"media"},t[1]&&(i.attributes=uf(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-ENDLIST/.exec(e),t)this.trigger("data",{type:"tag",tagType:"endlist"});else if(t=/^#EXT-X-DISCONTINUITY/.exec(e),t)this.trigger("data",{type:"tag",tagType:"discontinuity"});else{if(t=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(e),t)return i={type:"tag",tagType:"program-date-time"},t[1]&&(i.dateTimeString=t[1],i.dateTimeObject=new Date(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-KEY:(.*)$/.exec(e),t)return i={type:"tag",tagType:"key"},t[1]&&(i.attributes=uf(t[1]),i.attributes.IV&&("0x"===i.attributes.IV.substring(0,2).toLowerCase()&&(i.attributes.IV=i.attributes.IV.substring(2)),i.attributes.IV=i.attributes.IV.match(/.{8}/g),i.attributes.IV[0]=parseInt(i.attributes.IV[0],16),i.attributes.IV[1]=parseInt(i.attributes.IV[1],16),i.attributes.IV[2]=parseInt(i.attributes.IV[2],16),i.attributes.IV[3]=parseInt(i.attributes.IV[3],16),i.attributes.IV=new Uint32Array(i.attributes.IV))),void this.trigger("data",i);if(t=/^#EXT-X-START:(.*)$/.exec(e),t)return i={type:"tag",tagType:"start"},t[1]&&(i.attributes=uf(t[1]),i.attributes["TIME-OFFSET"]=parseFloat(i.attributes["TIME-OFFSET"]),i.attributes.PRECISE=/YES/.test(i.attributes.PRECISE)),void this.trigger("data",i);if(t=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(e),t)return i={type:"tag",tagType:"cue-out-cont"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);if(t=/^#EXT-X-CUE-OUT:(.*)?$/.exec(e),t)return i={type:"tag",tagType:"cue-out"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(e),t)return i={type:"tag",tagType:"cue-in"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);if(t=/^#EXT-X-SKIP:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"skip"},i.attributes=uf(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(of)),void this.trigger("data",i);if(t=/^#EXT-X-PART:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"part"},i.attributes=uf(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=lf(i.attributes.BYTERANGE)),void this.trigger("data",i);if(t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"server-control"},i.attributes=uf(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/.test(i.attributes[e]))}),void this.trigger("data",i);if(t=/^#EXT-X-PART-INF:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"part-inf"},i.attributes=uf(t[1]),["PART-TARGET"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))}),void this.trigger("data",i);if(t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"preload-hint"},i.attributes=uf(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(e){if(i.attributes.hasOwnProperty(e)){i.attributes[e]=parseInt(i.attributes[e],10);const t="BYTERANGE-LENGTH"===e?"length":"offset";i.attributes.byterange=i.attributes.byterange||{},i.attributes.byterange[t]=i.attributes[e],delete i.attributes[e]}}),void this.trigger("data",i);if(t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"rendition-report"},i.attributes=uf(t[1]),["LAST-MSN","LAST-PART"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseInt(i.attributes[e],10))}),void this.trigger("data",i);if(t=/^#EXT-X-DATERANGE:(.*)$/.exec(e),t&&t[1]){i={type:"tag",tagType:"daterange"},i.attributes=uf(t[1]),["ID","CLASS"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=String(i.attributes[e]))}),["START-DATE","END-DATE"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=new Date(i.attributes[e]))}),["DURATION","PLANNED-DURATION"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))}),["END-ON-NEXT"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/i.test(i.attributes[e]))}),["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=i.attributes[e].toString(16))});const e=/^X-([A-Z]+-)+[A-Z]+$/;for(const t in i.attributes){if(!e.test(t))continue;const n=/[0-9A-Fa-f]{6}/g.test(i.attributes[t]),s=/^\d+(\.\d+)?$/.test(i.attributes[t]);i.attributes[t]=n?i.attributes[t].toString(16):s?parseFloat(i.attributes[t]):String(i.attributes[t])}return void this.trigger("data",i)}if(t=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(e),t)this.trigger("data",{type:"tag",tagType:"independent-segments"});else if(t=/^#EXT-X-I-FRAMES-ONLY/.exec(e),t)this.trigger("data",{type:"tag",tagType:"i-frames-only"});else{if(t=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(e),t)return i={type:"tag",tagType:"content-steering"},i.attributes=uf(t[1]),void this.trigger("data",i);if(t=/^#EXT-X-I-FRAME-STREAM-INF:(.*)$/.exec(e),t)return i={type:"tag",tagType:"i-frame-playlist"},i.attributes=uf(t[1]),i.attributes.URI&&(i.uri=i.attributes.URI),i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes.RESOLUTION&&(i.attributes.RESOLUTION=cf(i.attributes.RESOLUTION)),i.attributes["AVERAGE-BANDWIDTH"]&&(i.attributes["AVERAGE-BANDWIDTH"]=parseInt(i.attributes["AVERAGE-BANDWIDTH"],10)),i.attributes["FRAME-RATE"]&&(i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])),void this.trigger("data",i);if(t=/^#EXT-X-DEFINE:(.*)$/.exec(e),t)return i={type:"tag",tagType:"define"},i.attributes=uf(t[1]),void this.trigger("data",i);this.trigger("data",{type:"tag",data:e.slice(4)})}}}}else this.trigger("data",{type:"comment",text:e.slice(1)})})}addParser({expression:e,customType:t,dataParser:i,segment:n}){"function"!=typeof i&&(i=e=>e),this.customParsers.push(s=>{if(e.exec(s))return this.trigger("data",{type:"custom",data:i(s),customType:t,segment:n}),!0})}addTagMapper({expression:e,map:t}){this.tagMappers.push(i=>e.test(i)?t(i):i)}}const df=function(e){const t={};return Object.keys(e).forEach(function(i){var n;t[(n=i,n.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()))]=e[i]}),t},pf=function(e){const{serverControl:t,targetDuration:i,partTargetDuration:n}=e;if(!t)return;const s="#EXT-X-SERVER-CONTROL",r="holdBack",a="partHoldBack",o=i&&3*i,l=n&&2*n;i&&!t.hasOwnProperty(r)&&(t[r]=o,this.trigger("info",{message:`${s} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})),o&&t[r]<o&&(this.trigger("warn",{message:`${s} clamping HOLD-BACK (${t[r]}) to targetDuration * 3 (${o})`}),t[r]=o),n&&!t.hasOwnProperty(a)&&(t[a]=3*n,this.trigger("info",{message:`${s} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${t[a]}).`})),n&&t[a]<l&&(this.trigger("warn",{message:`${s} clamping PART-HOLD-BACK (${t[a]}) to partTargetDuration * 2 (${l}).`}),t[a]=l)};class ff extends sf{constructor(e={}){super(),this.lineStream=new af,this.parseStream=new hf,this.lineStream.pipe(this.parseStream),this.mainDefinitions=e.mainDefinitions||{},this.params=new URL(e.uri,"https://a.com").searchParams,this.lastProgramDateTime=null;const t=this,i=[];let n,s,r={},a=!1;const o=function(){},l={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}};let u=0;this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],iFramePlaylists:[],segments:[]};let c=0,h=0;const d={};this.on("end",()=>{r.uri||!r.parts&&!r.preloadHints||(!r.map&&n&&(r.map=n),!r.key&&s&&(r.key=s),r.timeline||"number"!=typeof u||(r.timeline=u),this.manifest.preloadSegment=r)}),this.parseStream.on("data",function(e){let p,f;if(t.manifest.definitions)for(const i in t.manifest.definitions)if(e.uri&&(e.uri=e.uri.replace(`{$${i}}`,t.manifest.definitions[i])),e.attributes)for(const n in e.attributes)"string"==typeof e.attributes[n]&&(e.attributes[n]=e.attributes[n].replace(`{$${i}}`,t.manifest.definitions[i]));({tag(){({version(){e.version&&(this.manifest.version=e.version)},"allow-cache"(){this.manifest.allowCache=e.allowed,"allowed"in e||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const t={};"length"in e&&(r.byterange=t,t.length=e.length,"offset"in e||(e.offset=c)),"offset"in e&&(r.byterange=t,t.offset=e.offset),c=t.offset+t.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),e.title&&(r.title=e.title),e.duration>0&&(r.duration=e.duration),0===e.duration&&(r.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=i},key(){if(e.attributes)if("NONE"!==e.attributes.METHOD)if(e.attributes.URI){if("com.apple.streamingkeydelivery"===e.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:e.attributes});if("com.microsoft.playready"===e.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.microsoft.playready"]={uri:e.attributes.URI});if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===e.attributes.KEYFORMAT){return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(e.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===e.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==e.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):e.attributes.KEYID&&"0x"===e.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:e.attributes.KEYFORMAT,keyId:e.attributes.KEYID.substring(2)},pssh:rf(e.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}))}e.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),s={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI},void 0!==e.attributes.IV&&(s.iv=e.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else s=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence"(){isFinite(e.number)?this.manifest.mediaSequence=e.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+e.number})},"discontinuity-sequence"(){isFinite(e.number)?(this.manifest.discontinuitySequence=e.number,u=e.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+e.number})},"playlist-type"(){/VOD|EVENT/.test(e.playlistType)?this.manifest.playlistType=e.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+e.playlist})},map(){n={},e.uri&&(n.uri=e.uri),e.byterange&&(n.byterange=e.byterange),s&&(n.key=s)},"stream-inf"(){this.manifest.playlists=i,this.manifest.mediaGroups=this.manifest.mediaGroups||l,e.attributes?(r.attributes||(r.attributes={}),up(r.attributes,e.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||l,!(e.attributes&&e.attributes.TYPE&&e.attributes["GROUP-ID"]&&e.attributes.NAME))return void this.trigger("warn",{message:"ignoring incomplete or missing media group"});const t=this.manifest.mediaGroups[e.attributes.TYPE];t[e.attributes["GROUP-ID"]]=t[e.attributes["GROUP-ID"]]||{},p=t[e.attributes["GROUP-ID"]],f={default:/yes/i.test(e.attributes.DEFAULT)},f.default?f.autoselect=!0:f.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(f.language=e.attributes.LANGUAGE),e.attributes.URI&&(f.uri=e.attributes.URI),e.attributes["INSTREAM-ID"]&&(f.instreamId=e.attributes["INSTREAM-ID"]),e.attributes.CHARACTERISTICS&&(f.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(f.forced=/yes/i.test(e.attributes.FORCED)),p[e.attributes.NAME]=f},discontinuity(){u+=1,r.discontinuity=!0,this.manifest.discontinuityStarts.push(i.length)},"program-date-time"(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),r.dateTimeString=e.dateTimeString,r.dateTimeObject=e.dateTimeObject;const{lastProgramDateTime:t}=this;this.lastProgramDateTime=new Date(e.dateTimeString).getTime(),null===t&&this.manifest.segments.reduceRight((e,t)=>(t.programDateTime=e-1e3*t.duration,t.programDateTime),this.lastProgramDateTime)},targetduration(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+e.duration}):(this.manifest.targetDuration=e.duration,pf.call(this,this.manifest))},start(){e.attributes&&!isNaN(e.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:e.attributes["TIME-OFFSET"],precise:e.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out"(){r.cueOut=e.data},"cue-out-cont"(){r.cueOutCont=e.data},"cue-in"(){r.cueIn=e.data},skip(){this.manifest.skip=df(e.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",e.attributes,["SKIPPED-SEGMENTS"])},part(){a=!0;const t=this.manifest.segments.length,i=df(e.attributes);r.parts=r.parts||[],r.parts.push(i),i.byterange&&(i.byterange.hasOwnProperty("offset")||(i.byterange.offset=h),h=i.byterange.offset+i.byterange.length);const n=r.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${n} for segment #${t}`,e.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((e,t)=>{e.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${t} lacks required attribute(s): LAST-PART`})})},"server-control"(){const t=this.manifest.serverControl=df(e.attributes);t.hasOwnProperty("canBlockReload")||(t.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),pf.call(this,this.manifest),t.canSkipDateranges&&!t.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const t=this.manifest.segments.length,i=df(e.attributes),n=i.type&&"PART"===i.type;r.preloadHints=r.preloadHints||[],r.preloadHints.push(i),i.byterange&&(i.byterange.hasOwnProperty("offset")||(i.byterange.offset=n?h:0,n&&(h=i.byterange.offset+i.byterange.length)));const s=r.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${s} for segment #${t}`,e.attributes,["TYPE","URI"]),i.type)for(let e=0;e<r.preloadHints.length-1;e++){const n=r.preloadHints[e];n.type&&(n.type===i.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${s} for segment #${t} has the same TYPE ${i.type} as preload hint #${e}`}))}},"rendition-report"(){const t=df(e.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(t);const i=this.manifest.renditionReports.length-1,n=["LAST-MSN","URI"];a&&n.push("LAST-PART"),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${i}`,e.attributes,n)},"part-inf"(){this.manifest.partInf=df(e.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",e.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),pf.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(df(e.attributes));const t=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${t}`,e.attributes,["ID","START-DATE"]);const i=this.manifest.dateRanges[t];i.endDate&&i.startDate&&new Date(i.endDate)<new Date(i.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"}),i.duration&&i.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),i.plannedDuration&&i.plannedDuration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});const n=!!i.endOnNext;if(n&&!i.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute"}),n&&(i.duration||i.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"}),i.duration&&i.endDate){const e=i.startDate.getTime()+1e3*i.duration;this.manifest.dateRanges[t].endDate=new Date(e)}if(d[i.id]){for(const e in d[i.id])if(i[e]&&JSON.stringify(d[i.id][e])!==JSON.stringify(i[e])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}const e=this.manifest.dateRanges.findIndex(e=>e.id===i.id);this.manifest.dateRanges[e]=up(this.manifest.dateRanges[e],i),d[i.id]=up(d[i.id],i),this.manifest.dateRanges.pop()}else d[i.id]=i},"independent-segments"(){this.manifest.independentSegments=!0},"i-frames-only"(){this.manifest.iFramesOnly=!0,this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering"(){this.manifest.contentSteering=df(e.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",e.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const t=(e,t)=>{e in this.manifest.definitions?this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${e}`}):this.manifest.definitions[e]=t};if("QUERYPARAM"in e.attributes){if("NAME"in e.attributes||"IMPORT"in e.attributes)return void this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});const i=this.params.get(e.attributes.QUERYPARAM);return i?void t(e.attributes.QUERYPARAM,decodeURIComponent(i)):void this.trigger("error",{message:`EXT-X-DEFINE: No query param ${e.attributes.QUERYPARAM}`})}return"NAME"in e.attributes?"IMPORT"in e.attributes?void this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"}):"VALUE"in e.attributes&&"string"==typeof e.attributes.VALUE?void t(e.attributes.NAME,e.attributes.VALUE):void this.trigger("error",{message:`EXT-X-DEFINE: No value for ${e.attributes.NAME}`}):"IMPORT"in e.attributes?this.mainDefinitions[e.attributes.IMPORT]?void t(e.attributes.IMPORT,this.mainDefinitions[e.attributes.IMPORT]):void this.trigger("error",{message:`EXT-X-DEFINE: No value ${e.attributes.IMPORT} to import, or IMPORT used on main playlist`}):void this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:e.attributes,uri:e.uri,timeline:u}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",e.attributes,["BANDWIDTH","URI"])}}[e.tagType]||o).call(t)},uri(){r.uri=e.uri,i.push(r),this.manifest.targetDuration&&!("duration"in r)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),r.duration=this.manifest.targetDuration),s&&(r.key=s),r.timeline=u,n&&(r.map=n),h=0,null!==this.lastProgramDateTime&&(r.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=1e3*r.duration),r={}},comment(){},custom(){e.segment?(r.custom=r.custom||{},r.custom[e.customType]=e.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[e.customType]=e.data)}})[e.type].call(t)})}requiredCompatibilityversion(e,t){(e<t||!e)&&this.trigger("warn",{message:`manifest must be at least version ${t}`})}warnOnMissingAttributes_(e,t,i){const 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.manifest.dateRanges.length&&null===this.lastProgramDateTime&&this.trigger("warn",{message:"A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"}),this.lastProgramDateTime=null,this.trigger("end")}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}}var mf,gf,yf={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^/},_f=["video","audio","text"],vf=["Video","Audio","Text"],bf=function(e){return e?e.replace(/avc1\.(\d+)\.(\d+)/i,function(e,t,i){return"avc1."+("00"+Number(t).toString(16)).slice(-2)+"00"+("00"+Number(i).toString(16)).slice(-2)}):e},Tf=function(e){void 0===e&&(e="");var t=e.split(","),i=[];return t.forEach(function(e){var t;e=e.trim(),_f.forEach(function(n){var s=yf[n].exec(e.toLowerCase());if(s&&!(s.length<=1)){t=n;var r=e.substring(0,s[1].length),a=e.replace(r,"");i.push({type:r,details:a,mediaType:n})}}),t||i.push({type:e,details:"",mediaType:"unknown"})}),i},wf=function(e){return void 0===e&&(e=""),yf.audio.test(e.trim().toLowerCase())},Sf=function(e){if(e&&"string"==typeof e){var t,i=e.toLowerCase().split(",").map(function(e){return bf(e.trim())}),n="video";1===i.length&&wf(i[0])?n="audio":1===i.length&&(void 0===(t=i[0])&&(t=""),yf.text.test(t.trim().toLowerCase()))&&(n="application");var s="mp4";return i.every(function(e){return yf.mp4.test(e)})?s="mp4":i.every(function(e){return yf.webm.test(e)})?s="webm":i.every(function(e){return yf.ogg.test(e)})&&(s="ogg"),n+"/"+s+';codecs="'+e+'"'}},Ef=function(e,t){return void 0===e&&(e=""),void 0===t&&(t=!1),Dd.MediaSource&&Dd.MediaSource.isTypeSupported&&Dd.MediaSource.isTypeSupported(Sf(e))||t&&Dd.ManagedMediaSource&&Dd.ManagedMediaSource.isTypeSupported&&Dd.ManagedMediaSource.isTypeSupported(Sf(e))||!1},Cf=function(e){return void 0===e&&(e=""),e.toLowerCase().split(",").every(function(e){e=e.trim();for(var t=0;t<vf.length;t++){if(yf["muxer"+vf[t]].test(e))return!0}return!1})},kf="mp4a.40.2",xf=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,If=/^application\/dash\+xml/i,Af=function(e){return xf.test(e)?"hls":If.test(e)?"dash":"application/vnd.videojs.vhs+json"===e?"vhs-json":null},Lf=function(e){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},Pf=function(e){return e instanceof Uint8Array?e:(Array.isArray(e)||Lf(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))},Of=Dd.BigInt||Number,Df=[Of("0x1"),Of("0x100"),Of("0x10000"),Of("0x1000000"),Of("0x100000000"),Of("0x10000000000"),Of("0x1000000000000"),Of("0x100000000000000"),Of("0x10000000000000000")];mf=new Uint16Array([65484]),255===(gf=new Uint8Array(mf.buffer,mf.byteOffset,mf.byteLength))[0]||gf[0];var Mf=function(e,t){var i=void 0===t?{}:t,n=i.signed,s=void 0!==n&&n,r=i.le,a=void 0!==r&&r;e=Pf(e);var o=a?"reduce":"reduceRight",l=(e[o]?e[o]:Array.prototype[o]).call(e,function(t,i,n){var s=a?n:Math.abs(n+1-e.length);return t+Of(i)*Df[s]},Of(0));if(s){var u=Df[e.length]/Of(2)-Of(1);(l=Of(l))>u&&(l-=u,l-=u,l-=Of(2))}return Number(l)},Nf=function(e,t){var i={}.le,n=void 0!==i&&i;("bigint"!=typeof e&&"number"!=typeof e||"number"==typeof e&&e!=e)&&(e=0);for(var s=function(e){return Math.ceil(function(e){return e.toString(2).length}(e)/8)}(e=Of(e)),r=new Uint8Array(new ArrayBuffer(s)),a=0;a<s;a++){var o=n?a:Math.abs(a+1-r.length);r[o]=Number(e/Df[a]&Of(255)),e<0&&(r[o]=Math.abs(~r[o]),r[o]-=0===a?1:2)}return r},Rf=function(e,t){if("string"!=typeof e&&e&&"function"==typeof e.toString&&(e=e.toString()),"string"!=typeof e)return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var i=new Uint8Array(e.length),n=0;n<e.length;n++)i[n]=e.charCodeAt(n);return i},Ff=function(e,t,i){var n=void 0===i?{}:i,s=n.offset,r=void 0===s?0:s,a=n.mask,o=void 0===a?[]:a;e=Pf(e);var l=(t=Pf(t)).every?t.every:Array.prototype.every;return t.length&&e.length-r>=t.length&&l.call(t,function(t,i){return t===(o[i]?o[i]&e[r+i]:e[r+i])})};function Bf(e,t){return void 0===t&&(t=Object),t&&"function"==typeof t.freeze?t.freeze(e):e}var Uf=Bf({HTML:"text/html",isHTML:function(e){return e===Uf.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),jf=Bf({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===jf.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"}),$f={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 s=e[n];if(t.call(void 0,s,n,e))return s}},freeze:Bf,NAMESPACE:jf},qf=$f.find,Vf=$f.NAMESPACE;function Hf(e){return""!==e}function zf(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function Wf(e){if(!e)return[];var t=function(e){return e?e.split(/[\t\n\f\r ]+/).filter(Hf):[]}(e);return Object.keys(t.reduce(zf,{}))}function Gf(e,t){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}function Xf(e,t){var i=e.prototype;if(!(i instanceof t)){function n(){}n.prototype=t.prototype,Gf(i,n=new n),e.prototype=i=n}i.constructor!=e&&("function"!=typeof e&&console.error("unknown Class:"+e),i.constructor=e)}var Kf={},Yf=Kf.ELEMENT_NODE=1,Qf=Kf.ATTRIBUTE_NODE=2,Jf=Kf.TEXT_NODE=3,Zf=Kf.CDATA_SECTION_NODE=4,em=Kf.ENTITY_REFERENCE_NODE=5,tm=Kf.ENTITY_NODE=6,im=Kf.PROCESSING_INSTRUCTION_NODE=7,nm=Kf.COMMENT_NODE=8,sm=Kf.DOCUMENT_NODE=9,rm=Kf.DOCUMENT_TYPE_NODE=10,am=Kf.DOCUMENT_FRAGMENT_NODE=11,om=Kf.NOTATION_NODE=12,lm={},um={};lm.INDEX_SIZE_ERR=(um[1]="Index size error",1),lm.DOMSTRING_SIZE_ERR=(um[2]="DOMString size error",2);var cm=lm.HIERARCHY_REQUEST_ERR=(um[3]="Hierarchy request error",3);lm.WRONG_DOCUMENT_ERR=(um[4]="Wrong document",4);var hm=lm.INVALID_CHARACTER_ERR=(um[5]="Invalid character",5);lm.NO_DATA_ALLOWED_ERR=(um[6]="No data allowed",6),lm.NO_MODIFICATION_ALLOWED_ERR=(um[7]="No modification allowed",7);var dm=lm.NOT_FOUND_ERR=(um[8]="Not found",8);lm.NOT_SUPPORTED_ERR=(um[9]="Not supported",9);var pm=lm.INUSE_ATTRIBUTE_ERR=(um[10]="Attribute in use",10),fm=lm.INVALID_STATE_ERR=(um[11]="Invalid state",11);function mm(e,t){if(t instanceof Error)var i=t;else i=this,Error.call(this,um[e]),this.message=um[e],Error.captureStackTrace&&Error.captureStackTrace(this,mm);return i.code=e,t&&(this.message=this.message+": "+t),i}function gm(){}function ym(e,t){this._node=e,this._refresh=t,_m(this)}function _m(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var i=e._refresh(e._node);if(sg(e,"length",i.length),!e.$$length||i.length<e.$$length)for(var n=i.length;n in e;n++)Object.prototype.hasOwnProperty.call(e,n)&&delete e[n];Gf(i,e),e._inc=t}}function vm(){}function bm(e,t){for(var i=e.length;i--;)if(e[i]===t)return i}function Tm(e,t,i,n){if(n?t[bm(t,n)]=i:t[t.length++]=i,e){i.ownerElement=e;var s=e.ownerDocument;s&&(n&&Am(s,e,n),function(e,t,i){e&&e._inc++;var n=i.namespaceURI;n===Vf.XMLNS&&(t._nsMap[i.prefix?i.localName:""]=i.value)}(s,e,i))}}function wm(e,t,i){var n=bm(t,i);if(!(n>=0))throw new mm(dm,new Error(e.tagName+"@"+i));for(var s=t.length-1;n<s;)t[n]=t[++n];if(t.length=s,e){var r=e.ownerDocument;r&&(Am(r,e,i),i.ownerElement=null)}}function Sm(){}function Em(){}function Cm(e){return("<"==e?"<":">"==e&&">")||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function km(e,t){return xm(e,null,{enter:function(e){return!t(e)||xm.STOP}})===xm.STOP}function xm(e,t,i){for(var n=[{node:e,context:t,phase:xm.ENTER}];n.length>0;){var s=n.pop();if(s.phase===xm.ENTER){var r=i.enter(s.node,s.context);if(r===xm.STOP)return xm.STOP;if(n.push({node:s.node,context:r,phase:xm.EXIT}),null==r)continue;for(var a=s.node.lastChild;a;)n.push({node:a,context:r,phase:xm.ENTER}),a=a.previousSibling}else i.exit&&i.exit(s.node,s.context)}}function Im(){this.ownerDocument=this}function Am(e,t,i,n){e&&e._inc++,i.namespaceURI===Vf.XMLNS&&delete t._nsMap[i.prefix?i.localName:""]}function Lm(e,t,i){if(e&&e._inc){e._inc++;var n=t.childNodes;if(i)n[n.length++]=i;else{for(var s=t.firstChild,r=0;s;)n[r++]=s,s=s.nextSibling;n.length=r,delete n[n.length]}}}function Pm(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,Lm(e.ownerDocument,e),t}function Om(e){return e&&e.nodeType===Em.DOCUMENT_TYPE_NODE}function Dm(e){return e&&e.nodeType===Em.ELEMENT_NODE}function Mm(e){return e&&e.nodeType===Em.TEXT_NODE}function Nm(e,t){var i=e.childNodes||[];if(qf(i,Dm)||Om(t))return!1;var n=qf(i,Om);return!(t&&n&&i.indexOf(n)>i.indexOf(t))}function Rm(e,t){var i=e.childNodes||[];if(qf(i,function(e){return Dm(e)&&e!==t}))return!1;var n=qf(i,Om);return!(t&&n&&i.indexOf(n)>i.indexOf(t))}function Fm(e,t,i){if(!function(e){return e&&(e.nodeType===Em.DOCUMENT_NODE||e.nodeType===Em.DOCUMENT_FRAGMENT_NODE||e.nodeType===Em.ELEMENT_NODE)}(e))throw new mm(cm,"Unexpected parent node type "+e.nodeType);if(i&&i.parentNode!==e)throw new mm(dm,"child not in parent");if(!function(e){return e&&(Dm(e)||Mm(e)||Om(e)||e.nodeType===Em.DOCUMENT_FRAGMENT_NODE||e.nodeType===Em.COMMENT_NODE||e.nodeType===Em.PROCESSING_INSTRUCTION_NODE)}(t)||Om(t)&&e.nodeType!==Em.DOCUMENT_NODE)throw new mm(cm,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)}function Bm(e,t,i){var n=e.childNodes||[],s=t.childNodes||[];if(t.nodeType===Em.DOCUMENT_FRAGMENT_NODE){var r=s.filter(Dm);if(r.length>1||qf(s,Mm))throw new mm(cm,"More than one element or text in fragment");if(1===r.length&&!Nm(e,i))throw new mm(cm,"Element in fragment can not be inserted before doctype")}if(Dm(t)&&!Nm(e,i))throw new mm(cm,"Only one element can be added and only after doctype");if(Om(t)){if(qf(n,Om))throw new mm(cm,"Only one doctype is allowed");var a=qf(n,Dm);if(i&&n.indexOf(a)<n.indexOf(i))throw new mm(cm,"Doctype can only be inserted before an element");if(!i&&a)throw new mm(cm,"Doctype can not be appended since element is present")}}function Um(e,t,i){var n=e.childNodes||[],s=t.childNodes||[];if(t.nodeType===Em.DOCUMENT_FRAGMENT_NODE){var r=s.filter(Dm);if(r.length>1||qf(s,Mm))throw new mm(cm,"More than one element or text in fragment");if(1===r.length&&!Rm(e,i))throw new mm(cm,"Element in fragment can not be inserted before doctype")}if(Dm(t)&&!Rm(e,i))throw new mm(cm,"Only one element can be added and only after doctype");if(Om(t)){function o(e){return Om(e)&&e!==i}if(qf(n,o))throw new mm(cm,"Only one doctype is allowed");var a=qf(n,Dm);if(i&&n.indexOf(a)<n.indexOf(i))throw new mm(cm,"Doctype can only be inserted before an element")}}function jm(e,t,i,n){Fm(e,t,i),e.nodeType===Em.DOCUMENT_NODE&&(n||Bm)(e,t,i);var s=t.parentNode;if(s&&s.removeChild(t),t.nodeType===am){var r=t.firstChild;if(null==r)return t;var a=t.lastChild}else r=a=t;var o=i?i.previousSibling:e.lastChild;r.previousSibling=o,a.nextSibling=i,o?o.nextSibling=r:e.firstChild=r,null==i?e.lastChild=a:i.previousSibling=a;do{r.parentNode=e,$m(r,e.ownerDocument||e)}while(r!==a&&(r=r.nextSibling));return Lm(e.ownerDocument||e,e),t.nodeType==am&&(t.firstChild=t.lastChild=null),t}function $m(e,t){if(e.ownerDocument!==t){if(e.ownerDocument=t,e.nodeType===Yf&&e.attributes)for(var i=0;i<e.attributes.length;i++){var n=e.attributes.item(i);n&&(n.ownerDocument=t)}for(var s=e.firstChild;s;)$m(s,t),s=s.nextSibling}}function qm(){this._nsMap={}}function Vm(){}function Hm(){}function zm(){}function Wm(){}function Gm(){}function Xm(){}function Km(){}function Ym(){}function Qm(){}function Jm(){}function Zm(){}function eg(e,t,i){var n=e.prefix||"",s=e.namespaceURI;if(!s)return!1;if("xml"===n&&s===Vf.XML||s===Vf.XMLNS)return!1;for(var r=i.length;r--;){var a=i[r];if(a.prefix===n)return a.namespace!==s}return!0}function tg(e,t,i){e.push(" ",t,'="',i.replace(/[<>&"\t\n\r]/g,Cm),'"')}function ig(e,t,i,n,s,r){s||(s=[]),xm(e,{ns:s,isHTML:i},{enter:function(e,i){var s=i.ns,a=i.isHTML;if(n){if(!(e=n(e)))return null;if("string"==typeof e)return t.push(e),null}switch(e.nodeType){case Yf:var o=e.attributes,l=o.length,u=e.tagName,c=u;if(!(a=Vf.isHTML(e.namespaceURI)||a)&&!e.prefix&&e.namespaceURI){for(var h,d=0;d<o.length;d++)if("xmlns"===o.item(d).name){h=o.item(d).value;break}if(!h)for(var p=s.length-1;p>=0;p--){if(""===(f=s[p]).prefix&&f.namespace===e.namespaceURI){h=f.namespace;break}}if(h!==e.namespaceURI)for(p=s.length-1;p>=0;p--){var f;if((f=s[p]).namespace===e.namespaceURI){f.prefix&&(c=f.prefix+":"+u);break}}}t.push("<",c);for(var m=s.slice(),g=0;g<l;g++){"xmlns"==(y=o.item(g)).prefix?m.push({prefix:y.localName,namespace:y.value}):"xmlns"==y.nodeName&&m.push({prefix:"",namespace:y.value})}for(g=0;g<l;g++){var y;if(eg(y=o.item(g),0,m)){var _=y.prefix||"",v=y.namespaceURI;tg(t,_?"xmlns:"+_:"xmlns",v),m.push({prefix:_,namespace:v})}var b=n?n(y):y;b&&("string"==typeof b?t.push(b):tg(t,b.name,b.value))}if(u===c&&eg(e,0,m)){var T=e.prefix||"";v=e.namespaceURI;tg(t,T?"xmlns:"+T:"xmlns",v),m.push({prefix:T,namespace:v})}var w=e.firstChild;if(w||a&&!/^(?:meta|link|img|br|hr|input)$/i.test(u)){if(t.push(">"),a&&/^script$/i.test(u)){for(;w;)w.data?t.push(w.data):ig(w,t,a,n,m.slice(),r),w=w.nextSibling;return t.push("</",u,">"),null}return{ns:m,isHTML:a,tag:c}}return t.push("/>"),null;case sm:case am:return{ns:s.slice(),isHTML:a,tag:null};case Qf:return tg(t,e.name,e.value),null;case Jf:return t.push(e.data.replace(/[<&>]/g,Cm)),null;case Zf:if(r&&-1!==e.data.indexOf("]]>"))throw new mm(fm,'The CDATASection data contains "]]>"');return t.push("<![CDATA[",e.data.replace(/]]>/g,"]]]]><![CDATA[>"),"]]>"),null;case nm:if(r&&-1!==e.data.indexOf("--\x3e"))throw new mm(fm,'The comment node data contains "--\x3e"');return t.push("\x3c!--",e.data,"--\x3e"),null;case rm:if(r){if(e.publicId&&!/^("[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%']*"|'[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%'"]*')$/.test(e.publicId))throw new mm(fm,"DocumentType publicId is not a valid PubidLiteral");if(e.systemId&&!/^("[^"]*"|'[^']*')$/.test(e.systemId))throw new mm(fm,"DocumentType systemId is not a valid SystemLiteral");if(e.internalSubset&&-1!==e.internalSubset.indexOf("]>"))throw new mm(fm,'DocumentType internalSubset contains "]>"')}var S=e.publicId,E=e.systemId;if(t.push("<!DOCTYPE ",e.name),S)t.push(" PUBLIC ",S),E&&"."!=E&&t.push(" ",E),t.push(">");else if(E&&"."!=E)t.push(" SYSTEM ",E,">");else{var C=e.internalSubset;C&&t.push(" [",C,"]"),t.push(">")}return null;case im:if(r&&-1!==e.data.indexOf("?>"))throw new mm(fm,'The ProcessingInstruction data contains "?>"');return t.push("<?",e.target," ",e.data,"?>"),null;case em:return t.push("&",e.nodeName,";"),null;default:return t.push("??",e.nodeName),null}},exit:function(e,i){i&&i.tag&&t.push("</",i.tag,">")}})}function ng(e,t,i){var n;return xm(t,null,{enter:function(t,s){var r=new t.constructor;for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a)){var o=t[a];"object"!=typeof o&&o!=r[a]&&(r[a]=o)}t.childNodes&&(r.childNodes=new gm),r.ownerDocument=e;var l=i;switch(r.nodeType){case Yf:var u=t.attributes,c=r.attributes=new vm,h=u.length;c._ownerElement=r;for(var d=0;d<h;d++)r.setAttributeNode(ng(e,u.item(d),!0));break;case Qf:l=!0}return null!==s?s.appendChild(r):n=r,l?r:null}}),n}function sg(e,t,i){e[t]=i}lm.SYNTAX_ERR=(um[12]="Syntax error",12),lm.INVALID_MODIFICATION_ERR=(um[13]="Invalid modification",13),lm.NAMESPACE_ERR=(um[14]="Invalid namespace",14),lm.INVALID_ACCESS_ERR=(um[15]="Invalid access",15),mm.prototype=Error.prototype,Gf(lm,mm),gm.prototype={length:0,item:function(e){return e>=0&&e<this.length?this[e]:null},toString:function(e,t,i){for(var n=!!i&&!!i.requireWellFormed,s=[],r=0;r<this.length;r++)ig(this[r],s,e,t,null,n);return s.join("")},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}},ym.prototype.item=function(e){return _m(this),this[e]||null},Xf(ym,gm),vm.prototype={length:0,item:gm.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 mm(pm);var i=this.getNamedItem(e.nodeName);return Tm(this._ownerElement,this,e,i),i},setNamedItemNS:function(e){var t,i=e.ownerElement;if(i&&i!=this._ownerElement)throw new mm(pm);return t=this.getNamedItemNS(e.namespaceURI,e.localName),Tm(this._ownerElement,this,e,t),t},removeNamedItem:function(e){var t=this.getNamedItem(e);return wm(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var i=this.getNamedItemNS(e,t);return wm(this._ownerElement,this,i),i},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}},Sm.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,i){var n=new Im;if(n.implementation=this,n.childNodes=new gm,n.doctype=i||null,i&&n.appendChild(i),t){var s=n.createElementNS(e,t);n.appendChild(s)}return n},createDocumentType:function(e,t,i){var n=new Xm;return n.name=e,n.nodeName=e,n.publicId=t||"",n.systemId=i||"",n}},Em.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 jm(this,e,t)},replaceChild:function(e,t){jm(this,e,t,Um),t&&this.removeChild(t)},removeChild:function(e){return Pm(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return ng(this.ownerDocument||this,this,e)},normalize:function(){xm(this,null,{enter:function(e){for(var t=e.firstChild;t;){var i=t.nextSibling;null!==i&&i.nodeType===Jf&&t.nodeType===Jf?(e.removeChild(i),t.appendData(i.data)):t=i}return!0}})},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){for(var t=this;t;){var i=t._nsMap;if(i)for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&i[n]===e)return n;t=t.nodeType==Qf?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var i=t._nsMap;if(i&&Object.prototype.hasOwnProperty.call(i,e))return i[e];t=t.nodeType==Qf?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},Gf(Kf,Em),Gf(Kf,Em.prototype),xm.STOP=Symbol("walkDOM.STOP"),xm.ENTER=0,xm.EXIT=1,Im.prototype={nodeName:"#document",nodeType:sm,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==am){for(var i=e.firstChild;i;){var n=i.nextSibling;this.insertBefore(i,t),i=n}return e}return jm(this,e,t),$m(e,this),null===this.documentElement&&e.nodeType===Yf&&(this.documentElement=e),e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),Pm(this,e)},replaceChild:function(e,t){jm(this,e,t,Um),$m(e,this),t&&this.removeChild(t),Dm(e)&&(this.documentElement=e)},importNode:function(e,t){return function(e,t,i){var n;return xm(t,null,{enter:function(t,s){var r=t.cloneNode(!1);return r.ownerDocument=e,r.parentNode=null,null===s?n=r:s.appendChild(r),t.nodeType===Qf||i?r:null}}),n}(this,e,t)},getElementById:function(e){var t=null;return km(this.documentElement,function(i){if(i.nodeType==Yf&&i.getAttribute("id")==e)return t=i,!0}),t},getElementsByClassName:function(e){var t=Wf(e);return new ym(this,function(i){var n=[];return t.length>0&&km(i.documentElement,function(s){if(s!==i&&s.nodeType===Yf){var r=s.getAttribute("class");if(r){var a=e===r;if(!a){var o=Wf(r);a=t.every((l=o,function(e){return l&&-1!==l.indexOf(e)}))}a&&n.push(s)}}var l}),n})},createElement:function(e){var t=new qm;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new gm,(t.attributes=new vm)._ownerElement=t,t},createDocumentFragment:function(){var e=new Jm;return e.ownerDocument=this,e.childNodes=new gm,e},createTextNode:function(e){var t=new zm;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new Wm;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){if(-1!==e.indexOf("]]>"))throw new mm(hm,'data contains "]]>"');var t=new Gm;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var i=new Zm;return i.ownerDocument=this,i.tagName=i.nodeName=i.target=e,i.nodeValue=i.data=t,i},createAttribute:function(e){var t=new Vm;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new Qm;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var i=new qm,n=t.split(":"),s=i.attributes=new vm;return i.childNodes=new gm,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,s._ownerElement=i,i},createAttributeNS:function(e,t){var i=new Vm,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}},Xf(Im,Em),qm.prototype={nodeType:Yf,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var i=this.ownerDocument.createAttribute(e);i.value=i.nodeValue=""+t,this.setAttributeNode(i)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===am?this.insertBefore(e,null):function(e,t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=e,t.previousSibling=e.lastChild,t.nextSibling=null,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,e.lastChild=t,Lm(e.ownerDocument,e,t),$m(t,e.ownerDocument||e),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);i&&this.removeAttributeNode(i)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);return i&&i.value||""},setAttributeNS:function(e,t,i){var n=this.ownerDocument.createAttributeNS(e,t);n.value=n.nodeValue=""+i,this.setAttributeNode(n)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new ym(this,function(t){var i=[];return km(t,function(n){n===t||n.nodeType!=Yf||"*"!==e&&n.tagName!=e||i.push(n)}),i})},getElementsByTagNameNS:function(e,t){return new ym(this,function(i){var n=[];return km(i,function(s){s===i||s.nodeType!==Yf||"*"!==e&&s.namespaceURI!==e||"*"!==t&&s.localName!=t||n.push(s)}),n})}},Im.prototype.getElementsByTagName=qm.prototype.getElementsByTagName,Im.prototype.getElementsByTagNameNS=qm.prototype.getElementsByTagNameNS,Xf(qm,Em),Vm.prototype.nodeType=Qf,Xf(Vm,Em),Hm.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(um[cm])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,i){i=this.data.substring(0,e)+i+this.data.substring(e+t),this.nodeValue=this.data=i,this.length=i.length}},Xf(Hm,Em),zm.prototype={nodeName:"#text",nodeType:Jf,splitText:function(e){var t=this.data,i=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var n=this.ownerDocument.createTextNode(i);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}},Xf(zm,Hm),Wm.prototype={nodeName:"#comment",nodeType:nm},Xf(Wm,Hm),Gm.prototype={nodeName:"#cdata-section",nodeType:Zf},Xf(Gm,Hm),Xm.prototype.nodeType=rm,Xf(Xm,Em),Km.prototype.nodeType=om,Xf(Km,Em),Ym.prototype.nodeType=tm,Xf(Ym,Em),Qm.prototype.nodeType=em,Xf(Qm,Em),Jm.prototype.nodeName="#document-fragment",Jm.prototype.nodeType=am,Xf(Jm,Em),Zm.prototype.nodeType=im,Xf(Zm,Em),Em.prototype.toString=function(e,t,i){var n=!!i&&!!i.requireWellFormed,s=[],r=9==this.nodeType&&this.documentElement||this,a=r.prefix,o=r.namespaceURI;if(o&&null==a){if(null==(a=r.lookupPrefix(o)))var l=[{namespace:o,prefix:null}]}return ig(this,s,e,t,l,n),s.join("")};try{Object.defineProperty&&(Object.defineProperty(ym.prototype,"length",{get:function(){return _m(this),this.$$length}}),Object.defineProperty(Em.prototype,"textContent",{get:function(){if(this.nodeType===Yf||this.nodeType===am){var e=[];return xm(this,null,{enter:function(t){return t.nodeType===Yf||t.nodeType===am||(t.nodeType===im||t.nodeType===nm?null:void e.push(t.nodeValue))}}),e.join("")}return this.nodeValue},set:function(e){switch(this.nodeType){case Yf:case am: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}}}),sg=function(e,t,i){e["$$"+t]=i})}catch(e){}var rg={DOMImplementation:Sm},ag=Ca(function(e,t){var i=$f.freeze;t.XML_ENTITIES=i({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),t.HTML_ENTITIES=i({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"",InvisibleTimes:"",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"",NegativeThickSpace:"",NegativeThinSpace:"",NegativeVeryThinSpace:"",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:" ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"",zwnj:""}),t.entityMap=t.HTML_ENTITIES});ag.XML_ENTITIES,ag.HTML_ENTITIES,ag.entityMap;var og=$f.NAMESPACE,lg=/[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]/,ug=new RegExp("[\\-\\.0-9"+lg.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),cg=new RegExp("^"+lg.source+ug.source+"*(?::"+lg.source+ug.source+"*)?$");function hg(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,hg)}function dg(){}function pg(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function fg(e,t,i,n,s,r){function a(e,t,n){i.attributeNames.hasOwnProperty(e)&&r.fatalError("Attribute "+e+" redefined"),i.addValue(e,t.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,s),n)}for(var o,l=++t,u=0;;){var c=e.charAt(l);switch(c){case"=":if(1===u)o=e.slice(t,l),u=3;else{if(2!==u)throw new Error("attribute equal must after attrName");u=3}break;case"'":case'"':if(3===u||1===u){if(1===u&&(r.warning('attribute value must after "="'),o=e.slice(t,l)),t=l+1,!((l=e.indexOf(c,t))>0))throw new Error("attribute value no end '"+c+"' match");a(o,h=e.slice(t,l),t-1),u=5}else{if(4!=u)throw new Error('attribute value must after "="');a(o,h=e.slice(t,l),t),r.warning('attribute "'+o+'" missed start quot('+c+")!!"),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:break;case 2:i.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return r.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:"/"===(h=e.slice(t,l)).slice(-1)&&(i.closed=!0,h=h.slice(0,-1));case 2:2===u&&(h=o),4==u?(r.warning('attribute "'+h+'" missed quot(")!'),a(o,h,t)):(og.isHTML(n[""])&&h.match(/^(?:disabled|checked|selected)$/i)||r.warning('attribute "'+h+'" missed value!! "'+h+'" instead!!'),a(h,h,t));break;case 3:throw new Error("attribute value missed!!")}return l;case"":c=" ";default:if(c<=" ")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 h=e.slice(t,l);r.warning('attribute "'+h+'" missed quot(")!!'),a(o,h,t);case 5:u=6}else switch(u){case 2:i.tagName,og.isHTML(n[""])&&o.match(/^(?:disabled|checked|selected)$/i)||r.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),a(o,o,t),t=l,u=1;break;case 5:r.warning('attribute space is required"'+o+'"!!');case 6:u=1,t=l;break;case 3:u=4,t=l;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}l++}}function mg(e,t,i){for(var n=e.tagName,s=null,r=e.length;r--;){var a=e[r],o=a.qName,l=a.value;if((d=o.indexOf(":"))>0)var u=a.prefix=o.slice(0,d),c=o.slice(d+1),h="xmlns"===u&&c;else c=o,u=null,h="xmlns"===o&&"";a.localName=c,!1!==h&&(null==s&&(s={},_g(i,i={})),i[h]=s[h]=l,a.uri=og.XMLNS,t.startPrefixMapping(h,l))}for(r=e.length;r--;){(u=(a=e[r]).prefix)&&("xml"===u&&(a.uri=og.XML),"xmlns"!==u&&(a.uri=i[u||""]))}var d;(d=n.indexOf(":"))>0?(u=e.prefix=n.slice(0,d),c=e.localName=n.slice(d+1)):(u=null,c=e.localName=n);var p=e.uri=i[u||""];if(t.startElement(p,c,n,e),!e.closed)return e.currentNSMap=i,e.localNSMap=s,!0;if(t.endElement(p,c,n),s)for(u in s)Object.prototype.hasOwnProperty.call(s,u)&&t.endPrefixMapping(u)}function gg(e,t,i,n,s){if(/^(?:script|textarea)$/i.test(i)){var r=e.indexOf("</"+i+">",t),a=e.substring(t+1,r);if(/[&<]/.test(a))return/^script$/i.test(i)?(s.characters(a,0,a.length),r):(a=a.replace(/&#?\w+;/g,n),s.characters(a,0,a.length),r)}return t+1}function yg(e,t,i,n){var s=n[i];return null==s&&((s=e.lastIndexOf("</"+i+">"))<t&&(s=e.lastIndexOf("</"+i)),n[i]=s),s<t}function _g(e,t){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}function vg(e,t,i,n){if("-"===e.charAt(t+2))return"-"===e.charAt(t+3)?(s=e.indexOf("--\x3e",t+4))>t?(i.comment(e,t+4,s-t-4),s+3):(n.error("Unclosed comment"),-1):-1;if("CDATA["==e.substr(t+3,6)){var s=e.indexOf("]]>",t+9);return i.startCDATA(),i.characters(e,t+9,s-t-9),i.endCDATA(),s+3}var r=function(e,t){var i,n=[],s=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;s.lastIndex=t,s.exec(e);for(;i=s.exec(e);)if(n.push(i),i[1])return n}(e,t),a=r.length;if(a>1&&/!doctype/i.test(r[0][0])){var o=r[1][0],l=!1,u=!1;a>3&&(/^public$/i.test(r[2][0])?(l=r[3][0],u=a>4&&r[4][0]):/^system$/i.test(r[2][0])&&(u=r[3][0]));var c=r[a-1];return i.startDTD(o,l,u),i.endDTD(),c.index+c[0].length}return-1}function bg(e,t,i){var n=e.indexOf("?>",t);if(n){var s=e.substring(t,n).match(/^<\?(\S*)\s*([\s\S]*?)$/);return s?(s[0].length,i.processingInstruction(s[1],s[2]),n+2):-1}return-1}function Tg(){this.attributeNames={}}hg.prototype=new Error,hg.prototype.name=hg.name,dg.prototype={parse:function(e,t,i){var n=this.domBuilder;n.startDocument(),_g(t,t={}),function(e,t,i,n,s){function r(e){if(e>65535){var t=55296+((e-=65536)>>10),i=56320+(1023&e);return String.fromCharCode(t,i)}return String.fromCharCode(e)}function a(e){var t=e.slice(1,-1);return Object.hasOwnProperty.call(i,t)?i[t]:"#"===t.charAt(0)?r(parseInt(t.substr(1).replace("x","0x"))):(s.error("entity not found:"+e),e)}function o(t){if(t>m){var i=e.substring(m,t).replace(/&#?\w+;/g,a);d&&l(m),n.characters(i,0,t-m),m=t}}function l(t,i){for(;t>=c&&(i=h.exec(e));)u=i.index,c=u+i[0].length,d.lineNumber++;d.columnNumber=t-u+1}var u=0,c=0,h=/.*(?:\r\n?|\n)|.*$/g,d=n.locator,p=[{currentNSMap:t}],f={},m=0;for(;;){try{var g=e.indexOf("<",m);if(g<0){if(!e.substr(m).match(/^\s*$/)){var y=n.doc,_=y.createTextNode(e.substr(m));y.appendChild(_),n.currentElement=_}return}switch(g>m&&o(g),e.charAt(g+1)){case"/":var v=e.indexOf(">",g+3),b=e.substring(g+2,v).replace(/[ \t\n\r]+$/g,""),T=p.pop();v<0?(b=e.substring(g+2).replace(/[\s<].*/,""),s.error("end tag name: "+b+" is not complete:"+T.tagName),v=g+1+b.length):b.match(/\s</)&&(b=b.replace(/[\s<].*/,""),s.error("end tag name: "+b+" maybe not complete"),v=g+1+b.length);var w=T.localNSMap,S=T.tagName==b;if(S||T.tagName&&T.tagName.toLowerCase()==b.toLowerCase()){if(n.endElement(T.uri,T.localName,b),w)for(var E in w)Object.prototype.hasOwnProperty.call(w,E)&&n.endPrefixMapping(E);S||s.fatalError("end tag name: "+b+" is not match the current start tagName:"+T.tagName)}else p.push(T);v++;break;case"?":d&&l(g),v=bg(e,g,n);break;case"!":d&&l(g),v=vg(e,g,n,s);break;default:d&&l(g);var C=new Tg,k=p[p.length-1].currentNSMap,x=(v=fg(e,g,C,k,a,s),C.length);if(!C.closed&&yg(e,v,C.tagName,f)&&(C.closed=!0,i.nbsp||s.warning("unclosed xml attribute")),d&&x){for(var I=pg(d,{}),A=0;A<x;A++){var L=C[A];l(L.offset),L.locator=pg(d,{})}n.locator=I,mg(C,n,k)&&p.push(C),n.locator=d}else mg(C,n,k)&&p.push(C);og.isHTML(C.uri)&&!C.closed?v=gg(e,v,C.tagName,a,n):v++}}catch(e){if(e instanceof hg)throw e;s.error("element parse error: "+e),v=-1}v>m?m=v:o(Math.max(g,m)+1)}}(e,t,i,n,this.errorHandler),n.endDocument()}},Tg.prototype={setTagName:function(e){if(!cg.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,i){if(!cg.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:i}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}};var wg={XMLReader:dg,ParseError:hg},Sg=rg.DOMImplementation,Eg=$f.NAMESPACE,Cg=wg.ParseError,kg=wg.XMLReader;function xg(e){return e.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function Ig(e){this.options=e||{locator:{}}}function Ag(){this.cdata=!1}function Lg(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function Pg(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function Og(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 Dg(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}Ig.prototype.parseFromString=function(e,t){var i=this.options,n=new kg,s=i.domBuilder||new Ag,r=i.errorHandler,a=i.locator,o=i.xmlns||{},l=/\/x?html?$/.test(t),u=l?ag.HTML_ENTITIES:ag.XML_ENTITIES;a&&s.setDocumentLocator(a),n.errorHandler=function(e,t,i){if(!e){if(t instanceof Ag)return t;e=t}var n={},s=e instanceof Function;function r(t){var r=e[t];!r&&s&&(r=2==e.length?function(i){e(t,i)}:e),n[t]=r&&function(e){r("[xmldom "+t+"]\t"+e+Pg(i))}||function(){}}return i=i||{},r("warning"),r("error"),r("fatalError"),n}(r,s,a),n.domBuilder=i.domBuilder||s,l&&(o[""]=Eg.HTML),o.xml=o.xml||Eg.XML;var c=i.normalizeLineEndings||xg;return e&&"string"==typeof e?n.parse(c(e),o,u):n.errorHandler.error("invalid doc source"),s.doc},Ag.prototype={startDocument:function(){this.doc=(new Sg).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,i,n){var s=this.doc,r=s.createElementNS(e,i||t),a=n.length;Dg(this,r),this.currentElement=r,this.locator&&Lg(this.locator,r);for(var o=0;o<a;o++){e=n.getURI(o);var l=n.getValue(o),u=(i=n.getQName(o),s.createAttributeNS(e,i));this.locator&&Lg(n.getLocator(o),u),u.value=u.nodeValue=l,r.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){var i=this.doc.createProcessingInstruction(e,t);this.locator&&Lg(this.locator,i),Dg(this,i)},ignorableWhitespace:function(e,t,i){},characters:function(e,t,i){if(e=Og.apply(this,arguments)){if(this.cdata)var n=this.doc.createCDATASection(e);else n=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(e)&&this.doc.appendChild(n),this.locator&&Lg(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=Og.apply(this,arguments);var n=this.doc.createComment(e);this.locator&&Lg(this.locator,n),Dg(this,n)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,i){var n=this.doc.implementation;if(n&&n.createDocumentType){var s=n.createDocumentType(e,t,i);this.locator&&Lg(this.locator,s),Dg(this,s),this.doc.doctype=s}},warning:function(e){console.warn("[xmldom warning]\t"+e,Pg(this.locator))},error:function(e){console.error("[xmldom error]\t"+e,Pg(this.locator))},fatalError:function(e){throw new Cg(e,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(e){Ag.prototype[e]=function(){return null}});var Mg={DOMParser:Ig}.DOMParser;const Ng=e=>!!e&&"object"==typeof e,Rg=(...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]):Ng(e[i])&&Ng(t[i])?e[i]=Rg(e[i],t[i]):e[i]=t[i]}),e),{}),Fg=e=>Object.keys(e).map(t=>e[t]),Bg=e=>e.reduce((e,t)=>e.concat(t),[]),Ug=e=>{if(!e.length)return[];const t=[];for(let i=0;i<e.length;i++)t.push(e[i]);return t};var jg="INVALID_NUMBER_OF_PERIOD",$g="DASH_EMPTY_MANIFEST",qg="DASH_INVALID_XML",Vg="NO_BASE_URL",Hg="SEGMENT_TIME_UNSPECIFIED",zg="UNSUPPORTED_UTC_TIMING_SCHEME";const Wg=({baseUrl:e="",source:t="",range:i="",indexRange:n=""})=>{const s={uri:t,resolvedUri:nf(e||"",t)};if(i||n){const e=(i||n).split("-");let t,r=Dd.BigInt?Dd.BigInt(e[0]):parseInt(e[0],10),a=Dd.BigInt?Dd.BigInt(e[1]):parseInt(e[1],10);r<Number.MAX_SAFE_INTEGER&&"bigint"==typeof r&&(r=Number(r)),a<Number.MAX_SAFE_INTEGER&&"bigint"==typeof a&&(a=Number(a)),t="bigint"==typeof a||"bigint"==typeof r?Dd.BigInt(a)-Dd.BigInt(r)+Dd.BigInt(1):a-r+1,"bigint"==typeof t&&t<Number.MAX_SAFE_INTEGER&&(t=Number(t)),s.byterange={length:t,offset:r}}return s},Gg=e=>(e&&"number"!=typeof e&&(e=parseInt(e,10)),isNaN(e)?null:e),Xg={static(e){const{duration:t,timescale:i=1,sourceDuration:n,periodDuration:s}=e,r=Gg(e.endNumber),a=t/i;return"number"==typeof r?{start:0,end:r}:"number"==typeof s?{start:0,end:s/a}:{start:0,end:n/a}},dynamic(e){const{NOW:t,clientOffset:i,availabilityStartTime:n,timescale:s=1,duration:r,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:l=1/0}=e,u=Gg(e.endNumber),c=(t+i)/1e3,h=n+a,d=c+o-h,p=Math.ceil(d*s/r),f=Math.floor((c-h-l)*s/r),m=Math.floor((c-h)*s/r);return{start:Math.max(0,f),end:"number"==typeof u?u:Math.min(p,m)}}},Kg=e=>{const{type:t,duration:i,timescale:n=1,periodDuration:s,sourceDuration:r}=e,{start:a,end:o}=Xg[t](e),l=((e,t)=>{const i=[];for(let n=e;n<t;n++)i.push(n);return i})(a,o).map((e=>t=>{const{duration:i,timescale:n=1,periodStart:s,startNumber:r=1}=e;return{number:r+t,duration:i/n,timeline:s,time:t*i}})(e));if("static"===t){const e=l.length-1,t="number"==typeof s?s:r;l[e].duration=t-i/n*e}return l},Yg=e=>{const{baseUrl:t,initialization:i={},sourceDuration:n,indexRange:s="",periodStart:r,presentationTime:a,number:o=0,duration:l}=e;if(!t)throw new Error(Vg);const u=Wg({baseUrl:t,source:i.sourceURL,range:i.range}),c=Wg({baseUrl:t,source:t,indexRange:s});if(c.map=u,l){const t=Kg(e);t.length&&(c.duration=t[0].duration,c.timeline=t[0].timeline)}else n&&(c.duration=n,c.timeline=r);return c.presentationTime=a||r,c.number=o,[c]},Qg=(e,t,i)=>{const n=e.sidx.map?e.sidx.map:null,s=e.sidx.duration,r=e.timeline||0,a=e.sidx.byterange,o=a.offset+a.length,l=t.timescale,u=t.references.filter(e=>1!==e.referenceType),c=[],h=e.endList?"static":"dynamic",d=e.sidx.timeline;let p,f=d,m=e.mediaSequence||0;p="bigint"==typeof t.firstOffset?Dd.BigInt(o)+t.firstOffset:o+t.firstOffset;for(let e=0;e<u.length;e++){const a=t.references[e],o=a.referencedSize,u=a.subsegmentDuration;let g;g="bigint"==typeof p?p+Dd.BigInt(o)-Dd.BigInt(1):p+o-1;const y=Yg({baseUrl:i,timescale:l,timeline:r,periodStart:d,presentationTime:f,number:m,duration:u,sourceDuration:s,indexRange:`${p}-${g}`,type:h})[0];n&&(y.map=n),c.push(y),p+="bigint"==typeof p?Dd.BigInt(o):o,f+=u/l,m++}return e.segments=c,e},Jg=["AUDIO","SUBTITLES"],Zg=1/60,ey=e=>{return(t=e,i=({timeline:e})=>e,Fg(t.reduce((e,t)=>(t.forEach(t=>{e[i(t)]=t}),e),{}))).sort((e,t)=>e.timeline>t.timeline?1:-1);var t,i},ty=e=>{let t=[];var i,n;return i=e,n=(e,i,n,s)=>{t=t.concat(e.playlists||[])},Jg.forEach(function(e){for(var t in i.mediaGroups[e])for(var s in i.mediaGroups[e][t]){var r=i.mediaGroups[e][t][s];n(r,e,t,s)}}),t},iy=({playlist:e,mediaSequence:t})=>{e.mediaSequence=t,e.segments.forEach((t,i)=>{t.number=e.mediaSequence+i})},ny=({oldManifest:e,newManifest:t})=>{const i=e.playlists.concat(ty(e)),n=t.playlists.concat(ty(t));return t.timelineStarts=ey([e.timelineStarts,t.timelineStarts]),(({oldPlaylists:e,newPlaylists:t,timelineStarts:i})=>{t.forEach(t=>{t.discontinuitySequence=i.findIndex(function({timeline:e}){return e===t.timeline});const n=((e,t)=>{for(let i=0;i<e.length;i++)if(e[i].attributes.NAME===t)return e[i];return null})(e,t.attributes.NAME);if(!n)return;if(t.sidx)return;const s=t.segments[0],r=n.segments.findIndex(function(e){return Math.abs(e.presentationTime-s.presentationTime)<Zg});if(-1===r)return iy({playlist:t,mediaSequence:n.mediaSequence+n.segments.length}),t.segments[0].discontinuity=!0,t.discontinuityStarts.unshift(0),void((!n.segments.length&&t.timeline>n.timeline||n.segments.length&&t.timeline>n.segments[n.segments.length-1].timeline)&&t.discontinuitySequence--);n.segments[r].discontinuity&&!s.discontinuity&&(s.discontinuity=!0,t.discontinuityStarts.unshift(0),t.discontinuitySequence--),iy({playlist:t,mediaSequence:n.segments[r].number})})})({oldPlaylists:i,newPlaylists:n,timelineStarts:t.timelineStarts}),t},sy=e=>e&&e.uri+"-"+(e=>{let t;return t="bigint"==typeof e.offset||"bigint"==typeof e.length?Dd.BigInt(e.offset)+Dd.BigInt(e.length)-Dd.BigInt(1):e.offset+e.length-1,`${e.offset}-${t}`})(e.byterange),ry=e=>{const t=e.reduce(function(e,t){return e[t.attributes.baseUrl]||(e[t.attributes.baseUrl]=[]),e[t.attributes.baseUrl].push(t),e},{});let i=[];return Object.values(t).forEach(e=>{const t=Fg(e.reduce((e,t)=>{const i=t.attributes.id+(t.attributes.lang||"");return e[i]?(t.segments&&(t.segments[0]&&(t.segments[0].discontinuity=!0),e[i].segments.push(...t.segments)),t.attributes.contentProtection&&(e[i].attributes.contentProtection=t.attributes.contentProtection)):(e[i]=t,e[i].attributes.timelineStarts=[]),e[i].attributes.timelineStarts.push({start:t.attributes.periodStart,timeline:t.attributes.periodStart}),e},{}));i=i.concat(t)}),i.map(e=>{var t,i;return e.discontinuityStarts=(t=e.segments||[],i="discontinuity",t.reduce((e,t,n)=>(t[i]&&e.push(n),e),[])),e})},ay=(e,t)=>{const i=sy(e.sidx),n=i&&t[i]&&t[i].sidx;return n&&Qg(e,n,e.sidx.resolvedUri),e},oy=(e,t={})=>{if(!Object.keys(t).length)return e;for(const i in e)e[i]=ay(e[i],t);return e},ly=({attributes:e,segments:t,sidx:i,discontinuityStarts:n})=>{const s={attributes:{NAME:e.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:e.width,height:e.height},CODECS:e.codecs,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1},uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuityStarts:n,timelineStarts:e.timelineStarts,segments:t};return e.frameRate&&(s.attributes["FRAME-RATE"]=e.frameRate),e.contentProtection&&(s.contentProtection=e.contentProtection),e.serviceLocation&&(s.attributes.serviceLocation=e.serviceLocation),i&&(s.sidx=i),s},uy=({attributes:e})=>"video/mp4"===e.mimeType||"video/webm"===e.mimeType||"video"===e.contentType,cy=({attributes:e})=>"audio/mp4"===e.mimeType||"audio/webm"===e.mimeType||"audio"===e.contentType,hy=({attributes:e})=>"text/vtt"===e.mimeType||"text"===e.contentType,dy=e=>e?Object.keys(e).reduce((t,i)=>{const n=e[i];return t.concat(n.playlists)},[]):[],py=({dashPlaylists:e,locations:t,contentSteering:i,sidxMapping:n={},previousManifest:s,eventStream:r})=>{if(!e.length)return{};const{sourceDuration:a,type:o,suggestedPresentationDelay:l,minimumUpdatePeriod:u}=e[0].attributes,c=ry(e.filter(uy)).map(ly),h=ry(e.filter(cy)),d=ry(e.filter(hy)),p=e.map(e=>e.attributes.captionServices).filter(Boolean),f={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:oy(c,n)};u>=0&&(f.minimumUpdatePeriod=1e3*u),t&&(f.locations=t),i&&(f.contentSteering=i),"dynamic"===o&&(f.suggestedPresentationDelay=l),r&&r.length>0&&(f.eventStream=r);const m=0===f.playlists.length,g=h.length?((e,t={},i=!1)=>{let n;const s=e.reduce((e,s)=>{const r=s.attributes.role&&s.attributes.role.value||"",a=s.attributes.lang||"";let o=s.attributes.label||"main";if(a&&!s.attributes.label){const e=r?` (${r})`:"";o=`${s.attributes.lang}${e}`}e[o]||(e[o]={language:a,autoselect:!0,default:"main"===r,playlists:[],uri:""});const l=ay((({attributes:e,segments:t,sidx:i,mediaSequence:n,discontinuitySequence:s,discontinuityStarts:r},a)=>{const o={attributes:{NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs,"PROGRAM-ID":1},uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuitySequence:s,discontinuityStarts:r,timelineStarts:e.timelineStarts,mediaSequence:n,segments:t};return e.contentProtection&&(o.contentProtection=e.contentProtection),e.serviceLocation&&(o.attributes.serviceLocation=e.serviceLocation),i&&(o.sidx=i),a&&(o.attributes.AUDIO="audio",o.attributes.SUBTITLES="subs"),o})(s,i),t);return e[o].playlists.push(l),void 0===n&&"main"===r&&(n=s,n.default=!0),e},{});n||(s[Object.keys(s)[0]].default=!0);return s})(h,n,m):null,y=d.length?((e,t={})=>e.reduce((e,i)=>{const n=i.attributes.label||i.attributes.lang||"text",s=i.attributes.lang||"und";return e[n]||(e[n]={language:s,default:!1,autoselect:!1,playlists:[],uri:""}),e[n].playlists.push(ay((({attributes:e,segments:t,mediaSequence:i,discontinuityStarts:n,discontinuitySequence:s})=>{void 0===t&&(t=[{uri:e.baseUrl,timeline:e.periodStart,resolvedUri:e.baseUrl||"",duration:e.sourceDuration,number:0}],e.duration=e.sourceDuration);const r={NAME:e.id,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1};e.codecs&&(r.CODECS=e.codecs);const a={attributes:r,uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,timelineStarts:e.timelineStarts,discontinuityStarts:n,discontinuitySequence:s,mediaSequence:i,segments:t};return e.serviceLocation&&(a.attributes.serviceLocation=e.serviceLocation),a})(i),t)),e},{}))(d,n):null,_=c.concat(dy(g),dy(y)),v=_.map(({timelineStarts:e})=>e);var b,T;return f.timelineStarts=ey(v),b=_,T=f.timelineStarts,b.forEach(e=>{e.mediaSequence=0,e.discontinuitySequence=T.findIndex(function({timeline:t}){return t===e.timeline}),e.segments&&e.segments.forEach((e,t)=>{e.number=t})}),g&&(f.mediaGroups.AUDIO.audio=g),y&&(f.mediaGroups.SUBTITLES.subs=y),p.length&&(f.mediaGroups["CLOSED-CAPTIONS"].cc=p.reduce((e,t)=>t?(t.forEach(t=>{const{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):e,{})),s?ny({oldManifest:s,newManifest:f}):f},fy=(e,t,i)=>{const{NOW:n,clientOffset:s,availabilityStartTime:r,timescale:a=1,periodStart:o=0,minimumUpdatePeriod:l=0}=e,u=(n+s)/1e3+l-(r+o);return Math.ceil((u*a-t)/i)},my=(e,t)=>{const{type:i,minimumUpdatePeriod:n=0,media:s="",sourceDuration:r,timescale:a=1,startNumber:o=1,periodStart:l}=e,u=[];let c=-1;for(let h=0;h<t.length;h++){const d=t[h],p=d.d,f=d.r||0,m=d.t||0;let g;if(c<0&&(c=m),m&&m>c&&(c=m),f<0){const o=h+1;g=o===t.length?"dynamic"===i&&n>0&&s.indexOf("$Number$")>0?fy(e,c,p):(r*a-c)/p:(t[o].t-c)/p}else g=f+1;const y=o+u.length+g;let _=o+u.length;for(;_<y;)u.push({number:_,duration:p/a,time:c,timeline:l}),c+=p,_++}return u},gy=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,yy=(e,t)=>e.replace(gy,(e=>(t,i,n,s)=>{if("$$"===t)return"$";if(void 0===e[i])return t;const r=""+e[i];return"RepresentationID"===i?r:(s=n?parseInt(s,10):1,r.length>=s?r:`${new Array(s-r.length+1).join("0")}${r}`)})(t)),_y=(e,t)=>{const i={RepresentationID:e.id,Bandwidth:e.bandwidth||0},{initialization:n={sourceURL:"",range:""}}=e,s=Wg({baseUrl:e.baseUrl,source:yy(n.sourceURL,i),range:n.range}),r=((e,t)=>e.duration||t?e.duration?Kg(e):my(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}])(e,t);return r.map(t=>{i.Number=t.number,i.Time=t.time;const n=yy(e.media||"",i),r=e.timescale||1,a=e.presentationTimeOffset||0,o=e.periodStart+(t.time-a)/r;return{uri:n,timeline:t.timeline,duration:t.duration,resolvedUri:nf(e.baseUrl||"",n),map:s,number:t.number,presentationTime:o}})},vy=(e,t)=>{const{duration:i,segmentUrls:n=[],periodStart:s}=e;if(!i&&!t||i&&t)throw new Error(Hg);const r=n.map(t=>((e,t)=>{const{baseUrl:i,initialization:n={}}=e,s=Wg({baseUrl:i,source:n.sourceURL,range:n.range}),r=Wg({baseUrl:i,source:t.media,range:t.mediaRange});return r.map=s,r})(e,t));let a;i&&(a=Kg(e)),t&&(a=my(e,t));return a.map((t,i)=>{if(r[i]){const n=r[i],a=e.timescale||1,o=e.presentationTimeOffset||0;return n.timeline=t.timeline,n.duration=t.duration,n.number=t.number,n.presentationTime=s+(t.time-o)/a,n}}).filter(e=>e)},by=({attributes:e,segmentInfo:t})=>{let i,n;t.template?(n=_y,i=Rg(e,t.template)):t.base?(n=Yg,i=Rg(e,t.base)):t.list&&(n=vy,i=Rg(e,t.list));const s={attributes:e};if(!n)return s;const r=n(i,t.segmentTimeline);if(i.duration){const{duration:e,timescale:t=1}=i;i.duration=e/t}else r.length?i.duration=r.reduce((e,t)=>Math.max(e,Math.ceil(t.duration)),0):i.duration=0;return s.attributes=i,s.segments=r,t.base&&i.indexRange&&(s.sidx=r[0],s.segments=[]),s},Ty=(e,t)=>Ug(e.childNodes).filter(({tagName:e})=>e===t),wy=e=>e.textContent.trim(),Sy=e=>{const t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!t)return 0;const[i,n,s,r,a,o]=t.slice(1);return 31536e3*parseFloat(i||0)+2592e3*parseFloat(n||0)+86400*parseFloat(s||0)+3600*parseFloat(r||0)+60*parseFloat(a||0)+parseFloat(o||0)},Ey={mediaPresentationDuration:e=>Sy(e),availabilityStartTime(e){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t=e)&&(t+="Z"),Date.parse(t)/1e3;var t},minimumUpdatePeriod:e=>Sy(e),suggestedPresentationDelay:e=>Sy(e),type:e=>e,timeShiftBufferDepth:e=>Sy(e),start:e=>Sy(e),width:e=>parseInt(e,10),height:e=>parseInt(e,10),bandwidth:e=>parseInt(e,10),frameRate:e=>(e=>parseFloat(e.split("/").reduce((e,t)=>e/t)))(e),startNumber:e=>parseInt(e,10),timescale:e=>parseInt(e,10),presentationTimeOffset:e=>parseInt(e,10),duration(e){const t=parseInt(e,10);return isNaN(t)?Sy(e):t},d:e=>parseInt(e,10),t:e=>parseInt(e,10),r:e=>parseInt(e,10),presentationTime:e=>parseInt(e,10),DEFAULT:e=>e},Cy=e=>e&&e.attributes?Ug(e.attributes).reduce((e,t)=>{const i=Ey[t.name]||Ey.DEFAULT;return e[t.name]=i(t.value),e},{}):{},ky={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},xy=(e,t)=>t.length?Bg(e.map(function(e){return t.map(function(t){const i=wy(t),n=nf(e.baseUrl,i),s=Rg(Cy(t),{baseUrl:n});return n!==i&&!s.serviceLocation&&e.serviceLocation&&(s.serviceLocation=e.serviceLocation),s})})):e,Iy=e=>{const t=Ty(e,"SegmentTemplate")[0],i=Ty(e,"SegmentList")[0],n=i&&Ty(i,"SegmentURL").map(e=>Rg({tag:"SegmentURL"},Cy(e))),s=Ty(e,"SegmentBase")[0],r=i||t,a=r&&Ty(r,"SegmentTimeline")[0],o=i||s||t,l=o&&Ty(o,"Initialization")[0],u=t&&Cy(t);u&&l?u.initialization=l&&Cy(l):u&&u.initialization&&(u.initialization={sourceURL:u.initialization});const c={template:u,segmentTimeline:a&&Ty(a,"S").map(e=>Cy(e)),list:i&&Rg(Cy(i),{segmentUrls:n,initialization:Cy(l)}),base:s&&Rg(Cy(s),{initialization:Cy(l)})};return Object.keys(c).forEach(e=>{c[e]||delete c[e]}),c},Ay=e=>Bg(Ty(e.node,"EventStream").map(t=>{const i=Cy(t),n=i.schemeIdUri;return Ty(t,"Event").map(t=>{const s=Cy(t),r=s.presentationTime||0,a=i.timescale||1,o=s.duration||0,l=r/a+e.attributes.start;return{schemeIdUri:n,value:i.value,id:s.id,start:l,end:l+o/a,messageData:wy(t)||s.messageData,contentEncoding:i.contentEncoding,presentationTimeOffset:i.presentationTimeOffset||0}})})),Ly=(e,t,i)=>n=>{const s=Cy(n),r=xy(t,Ty(n,"BaseURL")),a=Ty(n,"Role")[0],o={role:Cy(a)};let l=Rg(e,s,o);const u=Ty(n,"Accessibility")[0],c=(e=>{if("urn:scte:dash:cc:cea-608:2015"===e.schemeIdUri)return("string"!=typeof e.value?[]:e.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}});if("urn:scte:dash:cc:cea-708:2015"===e.schemeIdUri)return("string"!=typeof e.value?[]:e.value.split(";")).map(e=>{const t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){const[i,n=""]=e.split("=");t.channel=i,t.language=e,n.split(",").forEach(e=>{const[i,n]=e.split(":");"lang"===i?t.language=n:"er"===i?t.easyReader=Number(n):"war"===i?t.aspectRatio=Number(n):"3D"===i&&(t["3D"]=Number(n))})}else t.language=e;return t.channel&&(t.channel="SERVICE"+t.channel),t})})(Cy(u));c&&(l=Rg(l,{captionServices:c}));const h=Ty(n,"Label")[0];if(h&&h.childNodes.length){const e=h.childNodes[0].nodeValue.trim();l=Rg(l,{label:e})}const d=Ty(n,"ContentProtection").reduce((e,t)=>{const i=Cy(t);i.schemeIdUri&&(i.schemeIdUri=i.schemeIdUri.toLowerCase());const n=ky[i.schemeIdUri];if(n){e[n]={attributes:i};const s=Ty(t,"cenc:pssh")[0];if(s){const t=wy(s);e[n].pssh=t&&rf(t)}}return e},{});Object.keys(d).length&&(l=Rg(l,{contentProtection:d}));const p=Iy(n),f=Ty(n,"Representation"),m=Rg(i,p);return Bg(f.map(((e,t,i)=>n=>{const s=Ty(n,"BaseURL"),r=xy(t,s),a=Rg(e,Cy(n)),o=Iy(n);return r.map(e=>({segmentInfo:Rg(i,o),attributes:Rg(a,e)}))})(l,r,m)))},Py=(e,t)=>(i,n)=>{const s=xy(t,Ty(i.node,"BaseURL")),r=Rg(e,{periodStart:i.attributes.start});"number"==typeof i.attributes.duration&&(r.periodDuration=i.attributes.duration);const a=Ty(i.node,"AdaptationSet"),o=Iy(i.node);return Bg(a.map(Ly(r,s,o)))},Oy=(e,t)=>{if(e.length>1&&t({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!e.length)return null;const i=Rg({serverURL:wy(e[0])},Cy(e[0]));return i.queryBeforeStart="true"===i.queryBeforeStart,i},Dy=e=>{if(""===e)throw new Error($g);const t=new Mg;let i,n;try{i=t.parseFromString(e,"application/xml"),n=i&&"MPD"===i.documentElement.tagName?i.documentElement:null}catch(e){}if(!n||n&&n.getElementsByTagName("parsererror").length>0)throw new Error(qg);return n},My=(e,t={})=>{const i=((e,t={})=>{const{manifestUri:i="",NOW:n=Date.now(),clientOffset:s=0,eventHandler:r=function(){}}=t,a=Ty(e,"Period");if(!a.length)throw new Error(jg);const o=Ty(e,"Location"),l=Cy(e),u=xy([{baseUrl:i}],Ty(e,"BaseURL")),c=Ty(e,"ContentSteering");l.type=l.type||"static",l.sourceDuration=l.mediaPresentationDuration||0,l.NOW=n,l.clientOffset=s,o.length&&(l.locations=o.map(wy));const h=[];return a.forEach((e,t)=>{const i=Cy(e),n=h[t-1];i.start=(({attributes:e,priorPeriodAttributes:t,mpdType:i})=>"number"==typeof e.start?e.start:t&&"number"==typeof t.start&&"number"==typeof t.duration?t.start+t.duration:t||"static"!==i?null:0)({attributes:i,priorPeriodAttributes:n?n.attributes:null,mpdType:l.type}),h.push({node:e,attributes:i})}),{locations:l.locations,contentSteeringInfo:Oy(c,r),representationInfo:Bg(h.map(Py(l,u))),eventStream:Bg(h.map(Ay))}})(Dy(e),t),n=i.representationInfo.map(by);return py({dashPlaylists:n,locations:i.locations,contentSteering:i.contentSteeringInfo,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest,eventStream:i.eventStream})},Ny=e=>(e=>{const t=Ty(e,"UTCTiming")[0];if(!t)return null;const i=Cy(t);switch(i.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":i.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":i.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":i.method="DIRECT",i.value=Date.parse(i.value);break;default:throw new Error(zg)}return i})(Dy(e));var Ry=Math.pow(2,32),Fy=function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.getBigUint64?(t=i.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(t):t:i.getUint32(0)*Ry+i.getUint32(4)},By=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8)},n=12;0===i.version?(i.earliestPresentationTime=t.getUint32(n),i.firstOffset=t.getUint32(n+4),n+=8):(i.earliestPresentationTime=Fy(e.subarray(n)),i.firstOffset=Fy(e.subarray(n+8)),n+=16),n+=2;var s=t.getUint16(n);for(n+=2;s>0;n+=12,s--)i.references.push({referenceType:(128&e[n])>>>7,referencedSize: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},Uy=Pf([73,68,51]),jy=function e(t,i){return void 0===i&&(i=0),(t=Pf(t)).length-i<10||!Ff(t,Uy,{offset:i})?i:(i+=function(e,t){void 0===t&&(t=0);var i=(e=Pf(e))[t+5],n=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&i)>>4?n+20:n+10}(t,i),e(t,i))},$y=function(e){return"string"==typeof e?Rf(e):e},qy=function e(t,i,n){void 0===n&&(n=!1),i=function(e){return Array.isArray(e)?e.map(function(e){return $y(e)}):[$y(e)]}(i),t=Pf(t);var s=[];if(!i.length)return s;for(var r=0;r<t.length;){var a=(t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3])>>>0,o=t.subarray(r+4,r+8);if(0===a)break;var l=r+a;if(l>t.length){if(n)break;l=t.length}var u=t.subarray(r+8,l);Ff(o,i[0])&&(1===i.length?s.push(u):s.push.apply(s,e(u,i.slice(1),n))),r=l}return s},Vy={EBML:Pf([26,69,223,163]),DocType:Pf([66,130]),Segment:Pf([24,83,128,103]),SegmentInfo:Pf([21,73,169,102]),Tracks:Pf([22,84,174,107]),Track:Pf([174]),TrackNumber:Pf([215]),DefaultDuration:Pf([35,227,131]),TrackEntry:Pf([174]),TrackType:Pf([131]),FlagDefault:Pf([136]),CodecID:Pf([134]),CodecPrivate:Pf([99,162]),VideoTrack:Pf([224]),AudioTrack:Pf([225]),Cluster:Pf([31,67,182,117]),Timestamp:Pf([231]),TimestampScale:Pf([42,215,177]),BlockGroup:Pf([160]),BlockDuration:Pf([155]),Block:Pf([161]),SimpleBlock:Pf([163])},Hy=[128,64,32,16,8,4,2,1],zy=function(e,t,i,n){void 0===i&&(i=!0),void 0===n&&(n=!1);var s=function(e){for(var t=1,i=0;i<Hy.length&&!(e&Hy[i]);i++)t++;return t}(e[t]),r=e.subarray(t,t+s);return i&&((r=Array.prototype.slice.call(e,t,t+s))[0]^=Hy[s-1]),{length:s,value:Mf(r,{signed:n}),bytes:r}},Wy=function e(t){return"string"==typeof t?t.match(/.{1,2}/g).map(function(t){return e(t)}):"number"==typeof t?Nf(t):t},Gy=function e(t,i,n){if(n>=i.length)return i.length;var s=zy(i,n,!1);if(Ff(t.bytes,s.bytes))return n;var r=zy(i,n+s.length);return e(t,i,n+r.length+r.value+s.length)},Xy=function e(t,i){i=function(e){return Array.isArray(e)?e.map(function(e){return Wy(e)}):[Wy(e)]}(i),t=Pf(t);var n=[];if(!i.length)return n;for(var s=0;s<t.length;){var r=zy(t,s,!1),a=zy(t,s+r.length),o=s+r.length+a.length;127===a.value&&(a.value=Gy(r,t,o),a.value!==t.length&&(a.value-=o));var l=o+a.value>t.length?t.length:o+a.value,u=t.subarray(o,l);Ff(i[0],r.bytes)&&(1===i.length?n.push(u):n=n.concat(e(u,i.slice(1)))),s+=r.length+a.length+u.length}return n},Ky=Pf([0,0,0,1]),Yy=Pf([0,0,1]),Qy=Pf([0,0,3]),Jy=function(e){for(var t=[],i=1;i<e.length-2;)Ff(e.subarray(i,i+3),Qy)&&(t.push(i+2),i++),i++;if(0===t.length)return e;var n=e.length-t.length,s=new Uint8Array(n),r=0;for(i=0;i<n;r++,i++)r===t[0]&&(r++,t.shift()),s[i]=e[r];return s},Zy=function(e,t,i,n){e=Pf(e),i=[].concat(i);for(var s,r=0,a=0;r<e.length&&(a<n||s);){var o=void 0;if(Ff(e.subarray(r),Ky)?o=4:Ff(e.subarray(r),Yy)&&(o=3),o){if(a++,s)return Jy(e.subarray(s,r));var l=void 0;"h264"===t?l=31&e[r+o]:"h265"===t&&(l=e[r+o]>>1&63),-1!==i.indexOf(l)&&(s=r+o),r+=o+("h264"===t?1:2)}else r++}return e.subarray(0,0)},e_={webm:Pf([119,101,98,109]),matroska:Pf([109,97,116,114,111,115,107,97]),flac:Pf([102,76,97,67]),ogg:Pf([79,103,103,83]),ac3:Pf([11,119]),riff:Pf([82,73,70,70]),avi:Pf([65,86,73]),wav:Pf([87,65,86,69]),"3gp":Pf([102,116,121,112,51,103]),mp4:Pf([102,116,121,112]),fmp4:Pf([115,116,121,112]),mov:Pf([102,116,121,112,113,116]),moov:Pf([109,111,111,118]),moof:Pf([109,111,111,102])},t_={aac:function(e){var t=jy(e);return Ff(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=jy(e);return Ff(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=Xy(e,[Vy.EBML,Vy.DocType])[0];return Ff(t,e_.webm)},mkv:function(e){var t=Xy(e,[Vy.EBML,Vy.DocType])[0];return Ff(t,e_.matroska)},mp4:function(e){return!t_["3gp"](e)&&!t_.mov(e)&&(!(!Ff(e,e_.mp4,{offset:4})&&!Ff(e,e_.fmp4,{offset:4}))||(!(!Ff(e,e_.moof,{offset:4})&&!Ff(e,e_.moov,{offset:4}))||void 0))},mov:function(e){return Ff(e,e_.mov,{offset:4})},"3gp":function(e){return Ff(e,e_["3gp"],{offset:4})},ac3:function(e){var t=jy(e);return Ff(e,e_.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return 71===e[0];for(var t=0;t+188<e.length&&t<188;){if(71===e[t]&&71===e[t+188])return!0;t+=1}return!1},flac:function(e){var t=jy(e);return Ff(e,e_.flac,{offset:t})},ogg:function(e){return Ff(e,e_.ogg)},avi:function(e){return Ff(e,e_.riff)&&Ff(e,e_.avi,{offset:8})},wav:function(e){return Ff(e,e_.riff)&&Ff(e,e_.wav,{offset:8})},h264:function(e){return function(e,t,i){return Zy(e,"h264",t,i)}(e,7,3).length},h265:function(e){return function(e,t,i){return Zy(e,"h265",t,i)}(e,[32,33],3).length}},i_=Object.keys(t_).filter(function(e){return"ts"!==e&&"h264"!==e&&"h265"!==e}).concat(["ts","h264","h265"]);i_.forEach(function(e){var t=t_[e];t_[e]=function(e){return t(Pf(e))}});var n_=t_,s_=function(e){e=Pf(e);for(var t=0;t<i_.length;t++){var i=i_[t];if(n_[i](e))return i}return""},r_=9e4,a_="8.23.7";const o_={},l_=function(e,t){return o_[e]=o_[e]||[],t&&(o_[e]=o_[e].concat(t)),o_[e]},u_=function(e,t){const i=l_(e).indexOf(t);return!(i<=-1)&&(o_[e]=o_[e].slice(),o_[e].splice(i,1),!0)},c_={prefixed:!0},h_=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],d_=h_[0];let p_;for(let e=0;e<h_.length;e++)if(h_[e][1]in lp){p_=h_[e];break}if(p_){for(let e=0;e<p_.length;e++)c_[d_[e]]=p_[e];c_.prefixed=p_[0]!==d_[0]}let f_=[];const m_=function e(t,i=":",n=""){let s,r="info";function a(...e){s("log",r,e)}return s=((e,t,i)=>(n,s,r)=>{const a=t.levels[s],o=new RegExp(`^(${a})$`);let l=e;if("log"!==n&&r.unshift(n.toUpperCase()+":"),i&&(l=`%c${e}`,r.unshift(i)),r.unshift(l+":"),f_){f_.push([].concat(r));const e=f_.length-1e3;f_.splice(0,e>0?e:0)}if(!Dd.console)return;let u=Dd.console[n];u||"debug"!==n||(u=Dd.console.info||Dd.console.log),u&&a&&o.test(n)&&u[Array.isArray(r)?"apply":"call"](Dd.console,r)})(t,a,n),a.createLogger=(s,r,a)=>{const o=void 0!==r?r:i;return e(`${t} ${o} ${s}`,o,void 0!==a?a:n)},a.createNewLogger=(t,i,n)=>e(t,i,n),a.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:r},a.level=e=>{if("string"==typeof e){if(!a.levels.hasOwnProperty(e))throw new Error(`"${e}" in not a valid log level`);r=e}return r},a.history=()=>f_?[].concat(f_):[],a.history.filter=e=>(f_||[]).filter(t=>new RegExp(`.*${e}.*`).test(t[0])),a.history.clear=()=>{f_&&(f_.length=0)},a.history.disable=()=>{null!==f_&&(f_.length=0,f_=null)},a.history.enable=()=>{null===f_&&(f_=[])},a.error=(...e)=>s("error",r,e),a.warn=(...e)=>s("warn",r,e),a.debug=(...e)=>s("debug",r,e),a}("VIDEOJS"),g_=m_.createLogger,y_=Object.prototype.toString,__=function(e){return T_(e)?Object.keys(e):[]};function v_(e,t){__(e).forEach(i=>t(e[i],i))}function b_(e,t,i=0){return __(e).reduce((i,n)=>t(i,e[n],n),i)}function T_(e){return!!e&&"object"==typeof e}function w_(e){return T_(e)&&"[object Object]"===y_.call(e)&&e.constructor===Object}function S_(...e){const t={};return e.forEach(e=>{e&&v_(e,(e,i)=>{w_(e)?(w_(t[i])||(t[i]={}),t[i]=S_(t[i],e)):t[i]=e})}),t}function E_(e={}){const t=[];for(const i in e)if(e.hasOwnProperty(i)){const n=e[i];t.push(n)}return t}function C_(e,t,i,n=!0){const s=i=>Object.defineProperty(e,t,{value:i,enumerable:!0,writable:!0}),r={configurable:!0,enumerable:!0,get(){const e=i();return s(e),e}};return n&&(r.set=s),Object.defineProperty(e,t,r)}var k_=Object.freeze({__proto__:null,each:v_,reduce:b_,isObject:T_,isPlain:w_,merge:S_,values:E_,defineLazyProperty:C_});let x_,I_=!1,A_=null,L_=!1,P_=!1,O_=!1,D_=!1,M_=!1,N_=null,R_=null;const F_=Boolean(Dd.cast&&Dd.cast.framework&&Dd.cast.framework.CastReceiverContext);let B_=null,U_=!1,j_=!1,$_=!1,q_=!1,V_=!1,H_=!1,z_=!1;const W_=Boolean(J_()&&("ontouchstart"in Dd||Dd.navigator.maxTouchPoints||Dd.DocumentTouch&&Dd.document instanceof Dd.DocumentTouch)),G_=Dd.navigator&&Dd.navigator.userAgentData;if(G_&&G_.platform&&G_.brands&&(L_="Android"===G_.platform,O_=Boolean(G_.brands.find(e=>"Microsoft Edge"===e.brand)),D_=Boolean(G_.brands.find(e=>"Chromium"===e.brand)),M_=!O_&&D_,N_=R_=(G_.brands.find(e=>"Chromium"===e.brand)||{}).version||null,j_="Windows"===G_.platform),!D_){const e=Dd.navigator&&Dd.navigator.userAgent||"";I_=/iPod/i.test(e),A_=function(){const t=e.match(/OS (\d+)_/i);return t&&t[1]?t[1]:null}(),L_=/Android/i.test(e),x_=function(){const t=e.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!t)return null;const i=t[1]&&parseFloat(t[1]),n=t[2]&&parseFloat(t[2]);return i&&n?parseFloat(t[1]+"."+t[2]):i||null}(),P_=/Firefox/i.test(e),O_=/Edg/i.test(e),D_=/Chrome/i.test(e)||/CriOS/i.test(e),M_=!O_&&D_,N_=R_=function(){const t=e.match(/(Chrome|CriOS)\/(\d+)/);return t&&t[2]?parseFloat(t[2]):null}(),B_=function(){const t=/MSIE\s(\d+)\.\d/.exec(e);let i=t&&parseFloat(t[1]);return!i&&/Trident\/7.0/i.test(e)&&/rv:11.0/.test(e)&&(i=11),i}(),V_=/Tizen/i.test(e),H_=/Web0S/i.test(e),z_=V_||H_,U_=/Safari/i.test(e)&&!M_&&!L_&&!O_&&!z_,j_=/Windows/i.test(e),$_=/iPad/i.test(e)||U_&&W_&&!/iPhone/i.test(e),q_=/iPhone/i.test(e)&&!$_}const X_=q_||$_||I_,K_=(U_||X_)&&!M_;var Y_=Object.freeze({__proto__:null,get IS_IPOD(){return I_},get IOS_VERSION(){return A_},get IS_ANDROID(){return L_},get ANDROID_VERSION(){return x_},get IS_FIREFOX(){return P_},get IS_EDGE(){return O_},get IS_CHROMIUM(){return D_},get IS_CHROME(){return M_},get CHROMIUM_VERSION(){return N_},get CHROME_VERSION(){return R_},IS_CHROMECAST_RECEIVER:F_,get IE_VERSION(){return B_},get IS_SAFARI(){return U_},get IS_WINDOWS(){return j_},get IS_IPAD(){return $_},get IS_IPHONE(){return q_},get IS_TIZEN(){return V_},get IS_WEBOS(){return H_},get IS_SMART_TV(){return z_},TOUCH_ENABLED:W_,IS_IOS:X_,IS_ANY_SAFARI:K_});function Q_(e){return"string"==typeof e&&Boolean(e.trim())}function J_(){return lp===Dd.document}function Z_(e){return T_(e)&&1===e.nodeType}function ev(){try{return Dd.parent!==Dd.self}catch(e){return!0}}function tv(e){return function(t,i){if(!Q_(t))return lp[e](null);Q_(i)&&(i=lp.querySelector(i));const n=Z_(i)?i:lp;return n[e]&&n[e](t)}}function iv(e="div",t={},i={},n){const s=lp.createElement(e);return Object.getOwnPropertyNames(t).forEach(function(e){const i=t[e];"textContent"===e?nv(s,i):s[e]===i&&"tabIndex"!==e||(s[e]=i)}),Object.getOwnPropertyNames(i).forEach(function(e){s.setAttribute(e,i[e])}),n&&wv(s,n),s}function nv(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function sv(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function rv(e,t){return function(e){if(e.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}(t),e.classList.contains(t)}function av(e,...t){return e.classList.add(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[])),e}function ov(e,...t){return e?(e.classList.remove(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[])),e):(m_.warn("removeClass was called with an element that doesn't exist"),null)}function lv(e,t,i){return"function"==typeof i&&(i=i(e,t)),"boolean"!=typeof i&&(i=void 0),t.split(/\s+/).forEach(t=>e.classList.toggle(t,i)),e}function uv(e,t){Object.getOwnPropertyNames(t).forEach(function(i){const n=t[i];null==n||!1===n?e.removeAttribute(i):e.setAttribute(i,!0===n?"":n)})}function cv(e){const t={},i=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(e&&e.attributes&&e.attributes.length>0){const n=e.attributes;for(let e=n.length-1;e>=0;e--){const s=n[e].name;let r=n[e].value;i.includes(s)&&(r=null!==r),t[s]=r}}return t}function hv(e,t){return e.getAttribute(t)}function dv(e,t,i){e.setAttribute(t,i)}function pv(e,t){e.removeAttribute(t)}function fv(){lp.body.focus(),lp.onselectstart=function(){return!1}}function mv(){lp.onselectstart=function(){return!0}}function gv(e){if(e&&e.getBoundingClientRect&&e.parentNode){const t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach(e=>{void 0!==t[e]&&(i[e]=t[e])}),i.height||(i.height=parseFloat(xv(e,"height"))),i.width||(i.width=parseFloat(xv(e,"width"))),i}}function yv(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};const t=e.offsetWidth,i=e.offsetHeight;let n=0,s=0;for(;e.offsetParent&&e!==lp[c_.fullscreenElement];)n+=e.offsetLeft,s+=e.offsetTop,e=e.offsetParent;return{left:n,top:s,width:t,height:i}}function _v(e,t){const i={x:0,y:0};if(X_){let t=e;for(;t&&"html"!==t.nodeName.toLowerCase();){const e=xv(t,"transform");if(/^matrix/.test(e)){const t=e.slice(7,-1).split(/,\s/).map(Number);i.x+=t[4],i.y+=t[5]}else if(/^matrix3d/.test(e)){const t=e.slice(9,-1).split(/,\s/).map(Number);i.x+=t[12],i.y+=t[13]}if(t.assignedSlot&&t.assignedSlot.parentElement&&Dd.WebKitCSSMatrix){const e=Dd.getComputedStyle(t.assignedSlot.parentElement).transform,n=new Dd.WebKitCSSMatrix(e);i.x+=n.m41,i.y+=n.m42}t=t.parentNode||t.host}}const n={},s=yv(t.target),r=yv(e),a=r.width,o=r.height;let l=t.offsetY-(r.top-s.top),u=t.offsetX-(r.left-s.left);return t.changedTouches&&(u=t.changedTouches[0].pageX-r.left,l=t.changedTouches[0].pageY+r.top,X_&&(u-=i.x,l-=i.y)),n.y=1-Math.max(0,Math.min(1,l/o)),n.x=Math.max(0,Math.min(1,u/a)),n}function vv(e){return T_(e)&&3===e.nodeType}function bv(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function Tv(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map(e=>("function"==typeof e&&(e=e()),Z_(e)||vv(e)?e:"string"==typeof e&&/\S/.test(e)?lp.createTextNode(e):void 0)).filter(e=>e)}function wv(e,t){return Tv(t).forEach(t=>e.appendChild(t)),e}function Sv(e,t){return wv(bv(e),t)}function Ev(e){return void 0===e.button&&void 0===e.buttons||(0===e.button&&void 0===e.buttons||("mouseup"===e.type&&0===e.button&&0===e.buttons||("mousedown"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons)))}const Cv=tv("querySelector"),kv=tv("querySelectorAll");function xv(e,t){if(!e||!t)return"";if("function"==typeof Dd.getComputedStyle){let i;try{i=Dd.getComputedStyle(e)}catch(e){return""}return i?i.getPropertyValue(t)||i[t]:""}return""}function Iv(e){[...lp.styleSheets].forEach(t=>{try{const i=[...t.cssRules].map(e=>e.cssText).join(""),n=lp.createElement("style");n.textContent=i,e.document.head.appendChild(n)}catch(i){const n=lp.createElement("link");n.rel="stylesheet",n.type=t.type,n.media=t.media.mediaText,n.href=t.href,e.document.head.appendChild(n)}})}var Av=Object.freeze({__proto__:null,isReal:J_,isEl:Z_,isInFrame:ev,createEl:iv,textContent:nv,prependTo:sv,hasClass:rv,addClass:av,removeClass:ov,toggleClass:lv,setAttributes:uv,getAttributes:cv,getAttribute:hv,setAttribute:dv,removeAttribute:pv,blockTextSelection:fv,unblockTextSelection:mv,getBoundingClientRect:gv,findPosition:yv,getPointerPosition:_v,isTextNode:vv,emptyEl:bv,normalizeContent:Tv,appendContent:wv,insertContent:Sv,isSingleLeftClick:Ev,$:Cv,$$:kv,computedStyle:xv,copyStyleSheetsToWindow:Iv});let Lv,Pv=!1;const Ov=function(){if(!1===Lv.options.autoSetup)return;const e=Array.prototype.slice.call(lp.getElementsByTagName("video")),t=Array.prototype.slice.call(lp.getElementsByTagName("audio")),i=Array.prototype.slice.call(lp.getElementsByTagName("video-js")),n=e.concat(t,i);if(n&&n.length>0)for(let e=0,t=n.length;e<t;e++){const t=n[e];if(!t||!t.getAttribute){Dv(1);break}if(void 0===t.player){null!==t.getAttribute("data-setup")&&Lv(t)}}else Pv||Dv(1)};function Dv(e,t){J_()&&(t&&(Lv=t),Dd.setTimeout(Ov,e))}function Mv(){Pv=!0,Dd.removeEventListener("load",Mv)}J_()&&("complete"===lp.readyState?Mv():Dd.addEventListener("load",Mv));const Nv=function(e){const t=lp.createElement("style");return t.className=e,t},Rv=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t};var Fv=new WeakMap;let Bv,Uv=3;function jv(){return Uv++}function $v(e,t){if(!Fv.has(e))return;const i=Fv.get(e);0===i.handlers[t].length&&(delete i.handlers[t],e.removeEventListener?e.removeEventListener(t,i.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,i.dispatcher)),Object.getOwnPropertyNames(i.handlers).length<=0&&(delete i.handlers,delete i.dispatcher,delete i.disabled),0===Object.getOwnPropertyNames(i).length&&Fv.delete(e)}function qv(e,t,i,n){i.forEach(function(i){e(t,i,n)})}function Vv(e){if(e.fixed_)return e;function t(){return!0}function i(){return!1}if(!e||!e.isPropagationStopped||!e.isImmediatePropagationStopped){const n=e||Dd.event;e={};const s=["layerX","layerY","keyLocation","path","webkitMovementX","webkitMovementY","mozPressure","mozInputSource"];for(const t in n)s.includes(t)||"returnValue"===t&&n.preventDefault||(e[t]=n[t]);if(e.target||(e.target=e.srcElement||lp),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){n.preventDefault&&n.preventDefault(),e.returnValue=!1,n.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){n.stopPropagation&&n.stopPropagation(),e.cancelBubble=!0,n.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=i,e.stopImmediatePropagation=function(){n.stopImmediatePropagation&&n.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=i,null!==e.clientX&&void 0!==e.clientX){const t=lp.documentElement,i=lp.body;e.pageX=e.clientX+(t&&t.scrollLeft||i&&i.scrollLeft||0)-(t&&t.clientLeft||i&&i.clientLeft||0),e.pageY=e.clientY+(t&&t.scrollTop||i&&i.scrollTop||0)-(t&&t.clientTop||i&&i.clientTop||0)}e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e.fixed_=!0,e}const Hv=["touchstart","touchmove"];function zv(e,t,i){if(Array.isArray(t))return qv(zv,e,t,i);Fv.has(e)||Fv.set(e,{});const n=Fv.get(e);if(n.handlers||(n.handlers={}),n.handlers[t]||(n.handlers[t]=[]),i.guid||(i.guid=jv()),n.handlers[t].push(i),n.dispatcher||(n.disabled=!1,n.dispatcher=function(t,i){if(n.disabled)return;t=Vv(t);const s=n.handlers[t.type];if(s){const n=s.slice(0);for(let s=0,r=n.length;s<r&&!t.isImmediatePropagationStopped();s++)try{n[s].call(e,t,i)}catch(e){m_.error(e)}}}),1===n.handlers[t].length)if(e.addEventListener){let i=!1;(function(){if("boolean"!=typeof Bv){Bv=!1;try{const e=Object.defineProperty({},"passive",{get(){Bv=!0}});Dd.addEventListener("test",null,e),Dd.removeEventListener("test",null,e)}catch(e){}}return Bv})()&&Hv.indexOf(t)>-1&&(i={passive:!0}),e.addEventListener(t,n.dispatcher,i)}else e.attachEvent&&e.attachEvent("on"+t,n.dispatcher)}function Wv(e,t,i){if(!Fv.has(e))return;const n=Fv.get(e);if(!n.handlers)return;if(Array.isArray(t))return qv(Wv,e,t,i);const s=function(e,t){n.handlers[t]=[],$v(e,t)};if(void 0===t){for(const t in n.handlers)Object.prototype.hasOwnProperty.call(n.handlers||{},t)&&s(e,t);return}const r=n.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);$v(e,t)}else s(e,t)}function Gv(e,t,i){const n=Fv.has(e)?Fv.get(e):{},s=e.parentNode||e.ownerDocument;if("string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=Vv(t),n.dispatcher&&n.dispatcher.call(e,t,i),s&&!t.isPropagationStopped()&&!0===t.bubbles)Gv.call(null,s,t,i);else if(!s&&!t.defaultPrevented&&t.target&&t.target[t.type]){Fv.has(t.target)||Fv.set(t.target,{});const e=Fv.get(t.target);t.target[t.type]&&(e.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),e.disabled=!1)}return!t.defaultPrevented}function Xv(e,t,i){if(Array.isArray(t))return qv(Xv,e,t,i);const n=function(){Wv(e,t,n),i.apply(this,arguments)};n.guid=i.guid=i.guid||jv(),zv(e,t,n)}function Kv(e,t,i){const n=function(){Wv(e,t,n),i.apply(this,arguments)};n.guid=i.guid=i.guid||jv(),zv(e,t,n)}var Yv=Object.freeze({__proto__:null,fixEvent:Vv,on:zv,off:Wv,trigger:Gv,one:Xv,any:Kv});const Qv=30,Jv=function(e,t,i){t.guid||(t.guid=jv());const n=t.bind(e);return n.guid=i?i+"_"+t.guid:t.guid,n},Zv=function(e,t){let i=Dd.performance.now();return function(...n){const s=Dd.performance.now();s-i>=t&&(e(...n),i=s)}},eb=function(e,t,i,n=Dd){let s;const r=function(){const r=this,a=arguments;let o=function(){s=null,o=null,i||e.apply(r,a)};!s&&i&&e.apply(r,a),n.clearTimeout(s),s=n.setTimeout(o,t)};return r.cancel=()=>{n.clearTimeout(s),s=null},r};var tb=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:Qv,bind_:Jv,throttle:Zv,debounce:eb});let ib;class nb{on(e,t){const i=this.addEventListener;this.addEventListener=()=>{},zv(this,e,t),this.addEventListener=i}off(e,t){Wv(this,e,t)}one(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Xv(this,e,t),this.addEventListener=i}any(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Kv(this,e,t),this.addEventListener=i}trigger(e){const t=e.type||e;"string"==typeof e&&(e={type:t}),e=Vv(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Gv(this,e)}queueTrigger(e){ib||(ib=new Map);const t=e.type||e;let i=ib.get(this);i||(i=new Map,ib.set(this,i));const n=i.get(t);i.delete(t),Dd.clearTimeout(n);const s=Dd.setTimeout(()=>{i.delete(t),0===i.size&&(i=null,ib.delete(this)),this.trigger(e)},0);i.set(t,s)}}nb.prototype.allowedEvents_={},nb.prototype.addEventListener=nb.prototype.on,nb.prototype.removeEventListener=nb.prototype.off,nb.prototype.dispatchEvent=nb.prototype.trigger;const sb=e=>"function"==typeof e.name?e.name():"string"==typeof e.name?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e,rb=e=>e instanceof nb||!!e.eventBusEl_&&["on","one","off","trigger"].every(t=>"function"==typeof e[t]),ab=e=>"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length,ob=(e,t,i)=>{if(!e||!e.nodeName&&!rb(e))throw new Error(`Invalid target for ${sb(t)}#${i}; must be a DOM node or evented object.`)},lb=(e,t,i)=>{if(!ab(e))throw new Error(`Invalid event type for ${sb(t)}#${i}; must be a non-empty string or array.`)},ub=(e,t,i)=>{if("function"!=typeof e)throw new Error(`Invalid listener for ${sb(t)}#${i}; must be a function.`)},cb=(e,t,i)=>{const n=t.length<3||t[0]===e||t[0]===e.eventBusEl_;let s,r,a;return n?(s=e.eventBusEl_,t.length>=3&&t.shift(),[r,a]=t):(s=t[0],r=t[1],a=t[2]),ob(s,e,i),lb(r,e,i),ub(a,e,i),a=Jv(e,a),{isTargetingSelf:n,target:s,type:r,listener:a}},hb=(e,t,i,n)=>{ob(e,e,t),e.nodeName?Yv[t](e,i,n):e[t](i,n)},db={on(...e){const{isTargetingSelf:t,target:i,type:n,listener:s}=cb(this,e,"on");if(hb(i,"on",n,s),!t){const e=()=>this.off(i,n,s);e.guid=s.guid;const t=()=>this.off("dispose",e);t.guid=s.guid,hb(this,"on","dispose",e),hb(i,"on","dispose",t)}},one(...e){const{isTargetingSelf:t,target:i,type:n,listener:s}=cb(this,e,"one");if(t)hb(i,"one",n,s);else{const e=(...t)=>{this.off(i,n,e),s.apply(null,t)};e.guid=s.guid,hb(i,"one",n,e)}},any(...e){const{isTargetingSelf:t,target:i,type:n,listener:s}=cb(this,e,"any");if(t)hb(i,"any",n,s);else{const e=(...t)=>{this.off(i,n,e),s.apply(null,t)};e.guid=s.guid,hb(i,"any",n,e)}},off(e,t,i){if(!e||ab(e))Wv(this.eventBusEl_,e,t);else{const n=e,s=t;ob(n,this,"off"),lb(s,this,"off"),ub(i,this,"off"),i=Jv(this,i),this.off("dispose",i),n.nodeName?(Wv(n,s,i),Wv(n,"dispose",i)):rb(n)&&(n.off(s,i),n.off("dispose",i))}},trigger(e,t){ob(this.eventBusEl_,this,"trigger");const i=e&&"string"!=typeof e?e.type:e;if(!ab(i))throw new Error(`Invalid event type for ${sb(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return Gv(this.eventBusEl_,e,t)}};function pb(e,t={}){const{eventBusKey:i}=t;if(i){if(!e[i].nodeName)throw new Error(`The eventBusKey "${i}" does not refer to an element.`);e.eventBusEl_=e[i]}else e.eventBusEl_=iv("span",{className:"vjs-event-bus"});return Object.assign(e,db),e.eventedCallbacks&&e.eventedCallbacks.forEach(e=>{e()}),e.on("dispose",()=>{e.off(),[e,e.el_,e.eventBusEl_].forEach(function(e){e&&Fv.has(e)&&Fv.delete(e)}),Dd.setTimeout(()=>{e.eventBusEl_=null},0)}),e}const fb={state:{},setState(e){let t;return"function"==typeof e&&(e=e()),v_(e,(e,i)=>{this.state[i]!==e&&(t=t||{},t[i]={from:this.state[i],to:e}),this.state[i]=e}),t&&rb(this)&&this.trigger({changes:t,type:"statechanged"}),t}};function mb(e,t){return Object.assign(e,fb),e.state=Object.assign({},e.state,t),"function"==typeof e.handleStateChanged&&rb(e)&&e.on("statechanged",e.handleStateChanged),e}const gb=function(e){return"string"!=typeof e?e:e.replace(/./,e=>e.toLowerCase())},yb=function(e){return"string"!=typeof e?e:e.replace(/./,e=>e.toUpperCase())},_b=function(e,t){return yb(e)===yb(t)};var vb=Object.freeze({__proto__:null,toLowerCase:gb,toTitleCase:yb,titleCaseEquals:_b});class bb{constructor(e,t,i){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=S_({},this.options_),t=this.options_=S_(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const t=e&&e.id&&e.id()||"no_player";this.id_=`${t}_component_${jv()}`}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&&(pb(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),mb(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,!1!==t.initChildren&&this.initChildren(),this.ready(i),!1!==t.reportTouchActivity&&this.enableTouchActivity()}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let e=this.children_.length-1;e>=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return Boolean(this.isDisposed_)}player(){return this.player_}options(e){return e?(this.options_=S_(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,i){return iv(e,t,i)}localize(e,t,i=e){const n=this.player_.language&&this.player_.language(),s=this.player_.languages&&this.player_.languages(),r=s&&s[n],a=n&&n.split("-")[0],o=s&&s[a];let l=i;return r&&r[e]?l=r[e]:o&&o[e]&&(l=o[e]),t&&(l=l.replace(/\{(\d+)\}/g,function(e,i){const n=t[i-1];let s=n;return void 0===n&&(s=e),s})),l}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce((e,t)=>e.concat(t),[]);let t=this;for(let i=0;i<e.length;i++)if(t=t.getChild(e[i]),!t||!t.getChild)return;return t}setIcon(e,t=this.el()){if(!this.player_.options_.experimentalSvgIcons)return;const i="http://www.w3.org/2000/svg",n=iv("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),s=lp.createElementNS(i,"svg");s.setAttributeNS(null,"viewBox","0 0 512 512");const r=lp.createElementNS(i,"use");return s.appendChild(r),r.setAttributeNS(null,"href",`#vjs-icon-${e}`),n.appendChild(s),this.iconIsSet_?t.replaceChild(n,t.querySelector(".vjs-icon-placeholder")):t.appendChild(n),this.iconIsSet_=!0,n}addChild(e,t={},i=this.children_.length){let n,s;if("string"==typeof e){s=yb(e);const i=t.componentClass||s;t.name=s;const r=bb.getComponent(i);if(!r)throw new Error(`Component ${i} does not exist`);if("function"!=typeof r)return null;n=new r(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),s=s||n.name&&yb(n.name()),s&&(this.childNameIndex_[s]=n,this.childNameIndex_[gb(s)]=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_:Z_(this.children_[i+1])&&(e=this.children_[i+1])),this.contentEl().insertBefore(n.el(),e)}return n}removeChild(e){if("string"==typeof e&&(e=this.getChild(e)),!e||!this.children_)return;let t=!1;for(let i=this.children_.length-1;i>=0;i--)if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[yb(e.name())]=null,this.childNameIndex_[gb(e.name())]=null;const i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,i=e=>{const i=e.name;let n=e.opts;if(void 0!==t[i]&&(n=t[i]),!1===n)return;!0===n&&(n={}),n.playerOptions=this.options_.playerOptions;const s=this.addChild(i,n);s&&(this[i]=s)};let n;const s=bb.getComponent("Tech");n=Array.isArray(e)?e:Object.keys(e),n.concat(Object.keys(this.options_).filter(function(e){return!n.some(function(t){return"string"==typeof t?e===t:e===t.name})})).map(t=>{let i,n;return"string"==typeof t?(i=t,n=e[i]||this.options_[i]||{}):(i=t.name,n=t),{name:i,opts:n}}).filter(e=>{const t=bb.getComponent(e.opts.componentClass||yb(e.name));return t&&!s.isTech(t)}).forEach(i)}}buildCSSClass(){return""}ready(e,t=!1){if(e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))}triggerReady(){this.isReady_=!0,this.setTimeout(function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)}$(e,t){return Cv(e,t||this.contentEl())}$$(e,t){return kv(e,t||this.contentEl())}hasClass(e){return rv(this.el_,e)}addClass(...e){av(this.el_,...e)}removeClass(...e){ov(this.el_,...e)}toggleClass(e,t){lv(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 hv(this.el_,e)}setAttribute(e,t){dv(this.el_,e,t)}removeAttribute(e){pv(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,i){if(void 0!==t)return null!==t&&t==t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;const n=this.el_.style[e],s=n.indexOf("px");return-1!==s?parseInt(n.slice(0,s),10):parseInt(this.el_["offset"+yb(e)],10)}currentDimension(e){let t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if(t=xv(this.el_,e),t=parseFloat(t),0===t||isNaN(t)){const i=`offset${yb(e)}`;t=this.el_[i]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){const e=this.el_.getBoundingClientRect();return{boundingClientRect:{x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},center:{x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2}}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&("Tab"===e.key||this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled||e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,t=null;let i;this.on("touchstart",function(n){1===n.touches.length&&(t={pageX:n.touches[0].pageX,pageY:n.touches[0].pageY},e=Dd.performance.now(),i=!0)}),this.on("touchmove",function(e){if(e.touches.length>1)i=!1;else if(t){const n=e.touches[0].pageX-t.pageX,s=e.touches[0].pageY-t.pageY;Math.sqrt(n*n+s*s)>10&&(i=!1)}});const n=function(){i=!1};this.on("touchleave",n),this.on("touchcancel",n),this.on("touchend",function(n){if(t=null,!0===i){Dd.performance.now()-e<200&&(n.preventDefault(),this.trigger("tap"))}})}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;const e=Jv(this.player(),this.player().reportUserActivity);let t;this.on("touchstart",function(){e(),this.clearInterval(t),t=this.setInterval(e,250)});const i=function(i){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",i),this.on("touchcancel",i)}setTimeout(e,t){var i;return e=Jv(this,e),this.clearTimersOnDispose_(),i=Dd.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),Dd.clearTimeout(e)),e}setInterval(e,t){e=Jv(this,e),this.clearTimersOnDispose_();const i=Dd.setInterval(e,t);return this.setIntervalIds_.add(i),i}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),Dd.clearInterval(e)),e}requestAnimationFrame(e){var t;return this.clearTimersOnDispose_(),e=Jv(this,e),t=Dd.requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),t=Jv(this,t);const i=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,i),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),Dd.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,t])=>{this[e].forEach((e,i)=>this[t](i))}),this.clearingTimersOnDispose_=!1}))}getIsDisabled(){return Boolean(this.el_.disabled)}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){return(e||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){function t(e){const t=Dd.getComputedStyle(e,null),i=t.getPropertyValue("visibility");return"none"!==t.getPropertyValue("display")&&!["hidden","collapse"].includes(i)}return e||(e=this.el()),!!(function(e){if(e.offsetWidth+e.offsetHeight+e.getBoundingClientRect().height+e.getBoundingClientRect().width===0)return!1;const t={x:e.getBoundingClientRect().left+e.offsetWidth/2,y:e.getBoundingClientRect().top+e.offsetHeight/2};if(t.x<0)return!1;if(t.x>(lp.documentElement.clientWidth||Dd.innerWidth))return!1;if(t.y<0)return!1;if(t.y>(lp.documentElement.clientHeight||Dd.innerHeight))return!1;let i=lp.elementFromPoint(t.x,t.y);for(;i;){if(i===e)return!0;if(!i.parentNode)return!1;i=i.parentNode}}(e)&&(i=e,t(i.parentElement)&&t(i)&&"0"!==i.style.opacity&&"0px"!==Dd.getComputedStyle(i).height&&"0px"!==Dd.getComputedStyle(i).width)&&(!e.parentElement||e.tabIndex>=0));var i}static registerComponent(e,t){if("string"!=typeof e||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const i=bb.getComponent("Tech"),n=i&&i.isTech(t),s=bb===t||bb.prototype.isPrototypeOf(t.prototype);if(n||!s){let t;throw t=n?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error(`Illegal component, "${e}"; ${t}.`)}e=yb(e),bb.components_||(bb.components_={});const r=bb.getComponent("Player");if("Player"===e&&r&&r.players){const e=r.players,t=Object.keys(e);if(e&&t.length>0)for(let i=0;i<t.length;i++)if(null!==e[t[i]])throw new Error("Can not register Player component after player has been created.")}return bb.components_[e]=t,bb.components_[gb(e)]=t,t}static getComponent(e){if(e&&bb.components_)return bb.components_[e]}}function Tb(e,t,i,n){return function(e,t,i){if("number"!=typeof t||t<0||t>i)throw new Error(`Failed to execute '${e}' on 'TimeRanges': The index provided (${t}) is non-numeric or out of bounds (0-${i}).`)}(e,n,i.length-1),i[n][t]}function wb(e){let t;return t=void 0===e||0===e.length?{length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:Tb.bind(null,"start",0,e),end:Tb.bind(null,"end",1,e)},Dd.Symbol&&Dd.Symbol.iterator&&(t[Dd.Symbol.iterator]=()=>(e||[]).values()),t}function Sb(e,t){return Array.isArray(e)?wb(e):void 0===e||void 0===t?wb():wb([[e,t]])}bb.registerComponent("Component",bb);const Eb=function(e,t){e=e<0?0:e;let i=Math.floor(e%60),n=Math.floor(e/60%60),s=Math.floor(e/3600);const r=Math.floor(t/60%60),a=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(s=n=i="-"),s=s>0||a>0?s+":":"",n=((s||r>=10)&&n<10?"0"+n:n)+":",i=i<10?"0"+i:i,s+n+i};let Cb=Eb;function kb(e){Cb=e}function xb(){Cb=Eb}function Ib(e,t=e){return Cb(e,t)}var Ab=Object.freeze({__proto__:null,createTimeRanges:Sb,createTimeRange:Sb,setFormatTime:kb,resetFormatTime:xb,formatTime:Ib});function Lb(e,t){let i,n,s=0;if(!t)return 0;e&&e.length||(e=Sb(0,0));for(let r=0;r<e.length;r++)i=e.start(r),n=e.end(r),n>t&&(n=t),s+=n-i;return s/t}function Pb(e){if(e instanceof Pb)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:T_(e)&&("number"==typeof e.code&&(this.code=e.code),Object.assign(this,e)),this.message||(this.message=Pb.defaultMessages[this.code]||"")}function Ob(e){return null!=e&&"function"==typeof e.then}function Db(e){Ob(e)&&e.then(null,e=>{})}Pb.prototype.code=0,Pb.prototype.message="",Pb.prototype.status=null,Pb.prototype.metadata=null,Pb.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Pb.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."},Pb.MEDIA_ERR_CUSTOM=0,Pb.prototype.MEDIA_ERR_CUSTOM=0,Pb.MEDIA_ERR_ABORTED=1,Pb.prototype.MEDIA_ERR_ABORTED=1,Pb.MEDIA_ERR_NETWORK=2,Pb.prototype.MEDIA_ERR_NETWORK=2,Pb.MEDIA_ERR_DECODE=3,Pb.prototype.MEDIA_ERR_DECODE=3,Pb.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Pb.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Pb.MEDIA_ERR_ENCRYPTED=5,Pb.prototype.MEDIA_ERR_ENCRYPTED=5;const Mb=function(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}})})};var Nb=function(e){const t=e.$$("track"),i=Array.prototype.map.call(t,e=>e.track);return Array.prototype.map.call(t,function(e){const t=Mb(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(Mb))},Rb=function(e,t){return e.forEach(function(e){const i=t.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach(e=>i.addCue(e))}),t.textTracks()},Fb=Mb;const Bb="vjs-modal-dialog";class Ub extends bb{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_=iv("div",{className:`${Bb}-content`},{role:"document"}),this.descEl_=iv("p",{className:`${Bb}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),nv(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${Bb} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(this.opened_)return void(this.options_.fillAlways&&this.fill());const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return"boolean"==typeof e&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if("boolean"==typeof e){const t=this.closeable_=!!e;let i=this.getChild("closeButton");if(t&&!i){const e=this.contentEl_;this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=e,this.on(i,"close",this.close_)}!t&&i&&(this.off(i,"close",this.close_),this.removeChild(i),i.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),i=t.parentNode,n=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),Sv(t,e),this.trigger("modalfill"),n?i.insertBefore(t,n):i.appendChild(t);const s=this.getChild("closeButton");s&&i.appendChild(s.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),bv(this.contentEl()),this.trigger("modalempty")}content(e){return void 0!==e&&(this.content_=e),this.content_}conditionalFocus_(){const e=lp.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(this.trigger({type:"modalKeydown",originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),"Escape"===e.key&&this.closeable())return e.preventDefault(),void this.close();if("Tab"!==e.key)return;const t=this.focusableEls_(),i=this.el_.querySelector(":focus");let n;for(let e=0;e<t.length;e++)if(i===t[e]){n=e;break}lp.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_(){const e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,e=>(e instanceof Dd.HTMLAnchorElement||e instanceof Dd.HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof Dd.HTMLInputElement||e instanceof Dd.HTMLSelectElement||e instanceof Dd.HTMLTextAreaElement||e instanceof Dd.HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof Dd.HTMLIFrameElement||e instanceof Dd.HTMLObjectElement||e instanceof Dd.HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable"))}}Ub.prototype.options_={pauseOnOpen:!0,temporary:!0},bb.registerComponent("ModalDialog",Ub);class jb extends nb{constructor(e=[]){super(),this.tracks_=[];for(let t=0;t<e.length;t++)this.addTrack(e[t])}get length(){return this.tracks_.length}addTrack(e){const t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.tracks_[t]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=()=>{this.trigger({track:e,type:"labelchange",target:this})},rb(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],t.off&&t.off(),this.tracks_.splice(i,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})}getTrackById(e){let t=null;for(let i=0,n=this.length;i<n;i++){const n=this[i];if(n.id===e){t=n;break}}return t}}jb.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const e in jb.prototype.allowedEvents_)jb.prototype["on"+e]=null;const $b=function(e,t){for(let i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].enabled=!1)};class qb extends jb{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){$b(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&$b(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,$b(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}}const Vb=function(e,t){for(let i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].selected=!1)};class Hb extends jb{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){Vb(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&&Vb(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,Vb(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}}class zb extends jb{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_);-1===["metadata","chapters"].indexOf(e.kind)&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}toJSON(){return this.tracks_.map(e=>e.toJSON())}}class Wb{constructor(e){Wb.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){const t=this.length||0;let i=0;const n=e.length;this.cues_=e,this.length_=e.length;const s=function(e){""+e in this||Object.defineProperty(this,""+e,{get(){return this.cues_[e]}})};if(t<n)for(i=t;i<n;i++)s.call(this,i)}getCueById(e){let t=null;for(let i=0,n=this.length;i<n;i++){const n=this[i];if(n.id===e){t=n;break}}return t}}const Gb={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},Xb={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},Kb={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Yb={disabled:"disabled",hidden:"hidden",showing:"showing"};class Qb extends nb{constructor(e={}){super();const t={id:e.id||"vjs_track_"+jv(),kind:e.kind||"",language:e.language||""};let i=e.label||"";for(const e in t)Object.defineProperty(this,e,{get:()=>t[e],set(){}});Object.defineProperty(this,"label",{get:()=>i,set(e){e!==i&&(i=e,this.trigger("labelchange"))}})}}const Jb=function(e){return new URL(e,lp.baseURI)},Zb=function(e){return new URL(e,lp.baseURI).href},eT=function(e){if("string"==typeof e){const t=e.split("?")[0].replace(/\/+$/,"").match(/\.([^.\/]+)$/);return t?t[1].toLowerCase():""}return""},tT=function(e,t=Dd.location){return Jb(e).origin!==t.origin};var iT=Object.freeze({__proto__:null,parseUrl:Jb,getAbsoluteURL:Zb,getFileExtension:eT,isCrossOrigin:tT});const nT=function(e,t){const i=new Dd.WebVTT.Parser(Dd,Dd.vttjs,Dd.WebVTT.StringDecoder()),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),n.length>0&&(Dd.console&&Dd.console.groupCollapsed&&Dd.console.groupCollapsed(`Text Track parsing errors for ${t.src}`),n.forEach(e=>m_.error(e)),Dd.console&&Dd.console.groupEnd&&Dd.console.groupEnd()),i.flush()},sT=function(e,t){const i={uri:e},n=tT(e);n&&(i.cors=n);const s="use-credentials"===t.tech_.crossOrigin();s&&(i.withCredentials=s),bp(i,Jv(this,function(e,i,n){if(e)return m_.error(e,i);t.loaded_=!0,"function"!=typeof Dd.WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],e=>{if("vttjserror"!==e.type)return nT(n,t);m_.error(`vttjs failed to load, stopping trying to process ${t.src}`)}):nT(n,t)}))};class rT extends Qb{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=S_(e,{kind:Kb[e.kind]||"subtitles",language:e.language||e.srclang||""});let i=Yb[t.mode]||"disabled";const n=t.default;"metadata"!==t.kind&&"chapters"!==t.kind||(i="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=!1!==this.tech_.preloadTextTracks;const s=new Wb(this.cues_),r=new Wb(this.activeCues_);let a=!1;this.timeupdateHandler=Jv(this,function(e={}){this.tech_.isDisposed()||(this.tech_.isReady_?(this.activeCues=this.activeCues,a&&(this.trigger("cuechange"),a=!1),"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))):"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)))});this.tech_.one("dispose",()=>{this.stopTracking()}),"disabled"!==i&&this.startTracking(),Object.defineProperties(this,{default:{get:()=>n,set(){}},mode:{get:()=>i,set(e){Yb[e]&&i!==e&&(i=e,this.preload_||"disabled"===i||0!==this.cues.length||sT(this.src,this),this.stopTracking(),"disabled"!==i&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?s:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(0===this.cues.length)return r;const e=this.tech_.currentTime(),t=[];for(let i=0,n=this.cues.length;i<n;i++){const n=this.cues[i];n.startTime<=e&&n.endTime>=e&&t.push(n)}if(a=!1,t.length!==this.activeCues_.length)a=!0;else for(let e=0;e<t.length;e++)-1===this.activeCues_.indexOf(t[e])&&(a=!0);return this.activeCues_=t,r.setCues_(this.activeCues_),r},set(){}}}),t.src?(this.src=t.src,this.preload_||(this.loaded_=!0),(this.preload_||"subtitles"!==t.kind&&"captions"!==t.kind)&&sT(this.src,this)):this.loaded_=!0}startTracking(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)}stopTracking(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)}addCue(e){let t=e;if(!("getCueAsHTML"in t)){t=new Dd.vttjs.VTTCue(e.startTime,e.endTime,e.text);for(const i in e)i in t||(t[i]=e[i]);t.id=e.id,t.originalCue_=e}const i=this.tech_.textTracks();for(let e=0;e<i.length;e++)i[e]!==this&&i[e].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}toJSON(){return Fb(this)}removeCue(e){let t=this.cues_.length;for(;t--;){const i=this.cues_[t];if(i===e||i.originalCue_&&i.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}}rT.prototype.allowedEvents_={cuechange:"cuechange"};class aT extends Qb{constructor(e={}){const t=S_(e,{kind:Xb[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"enabled",{get:()=>i,set(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}}class oT extends Qb{constructor(e={}){const t=S_(e,{kind:Gb[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"selected",{get:()=>i,set(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}}class lT extends nb{constructor(e={}){let t;super();const i=new rT(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=lT.NONE,i.addEventListener("loadeddata",()=>{t=lT.LOADED,this.trigger({type:"load",target:this})})}}lT.prototype.allowedEvents_={load:"load"},lT.NONE=0,lT.LOADING=1,lT.LOADED=2,lT.ERROR=3;const uT={audio:{ListClass:qb,TrackClass:aT,capitalName:"Audio"},video:{ListClass:Hb,TrackClass:oT,capitalName:"Video"},text:{ListClass:zb,TrackClass:rT,capitalName:"Text"}};Object.keys(uT).forEach(function(e){uT[e].getterName=`${e}Tracks`,uT[e].privateName=`${e}Tracks_`});const cT={remoteText:{ListClass:zb,TrackClass:rT,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:class{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,i=e.length;t<i;t++)this.addTrackElement_(e[t])}addTrackElement_(e){const t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.trackElements_[t]}}),-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:lT,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},hT=Object.assign({},uT,cT);cT.names=Object.keys(cT),uT.names=Object.keys(uT),hT.names=[].concat(cT.names).concat(uT.names);class dT extends bb{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}),hT.names.forEach(t=>{const i=hT[t];e&&e[i.getterName]&&(this[i.privateName]=e[i.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(t=>{!1===e[`native${t}Tracks`]&&(this[`featuresNative${t}Tracks`]=!1)}),!1===e.nativeCaptions||!1===e.nativeTextTracks?this.featuresNativeTextTracks=!1:!0!==e.nativeCaptions&&!0!==e.nativeTextTracks||(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=!1!==e.preloadTextTracks,this.autoRemoteTextTracks_=new hT.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(Jv(this,function(){const e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return Sb(0,0)}bufferedPercent(){return Lb(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(uT.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){(e=[].concat(e)).forEach(e=>{const t=this[`${e}Tracks`]()||[];let i=t.length;for(;i--;){const n=t[i];"text"===e&&this.removeRemoteTextTrack(n),t.removeTrack(n)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const i=e[t];this.removeRemoteTextTrack(i)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return void 0!==e&&(this.error_=new Pb(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?Sb(0,0):Sb()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){uT.names.forEach(e=>{const t=uT[e],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(!Dd.WebVTT)if(lp.body.contains(this.el())){if(!this.options_["vtt.js"]&&w_(ef)&&Object.keys(ef).length>0)return void this.trigger("vttjsloaded");const e=lp.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}),Dd.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),i=t=>e.addTrack(t.track),n=t=>e.removeTrack(t.track);t.on("addtrack",i),t.on("removetrack",n),this.addWebVttScript_();const s=()=>this.trigger("texttrackchange"),r=()=>{s();for(let t=0;t<e.length;t++){const i=e[t];i.removeEventListener("cuechange",s),"showing"===i.mode&&i.addEventListener("cuechange",s)}};r(),e.addEventListener("change",r),e.addEventListener("addtrack",r),e.addEventListener("removetrack",r),this.on("dispose",function(){t.off("addtrack",i),t.off("removetrack",n),e.removeEventListener("change",r),e.removeEventListener("addtrack",r),e.removeEventListener("removetrack",r);for(let t=0;t<e.length;t++){e[t].removeEventListener("cuechange",s)}})}addTextTrack(e,t,i){if(!e)throw new Error("TextTrack kind is required but was not provided");return function(e,t,i,n,s={}){const r=e.textTracks();s.kind=t,i&&(s.label=i),n&&(s.language=n),s.tech=e;const a=new hT.text.TrackClass(s);return r.addTrack(a),a}(this,e,t,i)}createRemoteTextTrack(e){const t=S_(e,{tech:this});return new cT.remoteTextEl.TrackClass(t)}addRemoteTextTrack(e={},t){const i=this.createRemoteTextTrack(e);return"boolean"!=typeof t&&(t=!1),this.remoteTextTrackEls().addTrackElement_(i),this.remoteTextTracks().addTrack(i.track),!1===t&&this.ready(()=>this.autoRemoteTextTracks_.addTrack(i.track)),i}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=jv();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 dT.canPlayType(e.type)}static isTech(e){return e.prototype instanceof dT||e instanceof dT||e===dT}static registerTech(e,t){if(dT.techs_||(dT.techs_={}),!dT.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!dT.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!dT.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=yb(e),dT.techs_[e]=t,dT.techs_[gb(e)]=t,"Tech"!==e&&dT.defaultTechOrder_.push(e),t}static getTech(e){if(e)return dT.techs_&&dT.techs_[e]?dT.techs_[e]:(e=yb(e),Dd&&Dd.videojs&&Dd.videojs[e]?(m_.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),Dd.videojs[e]):void 0)}}hT.names.forEach(function(e){const t=hT[e];dT.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}}),dT.prototype.featuresVolumeControl=!0,dT.prototype.featuresMuteControl=!0,dT.prototype.featuresFullscreenResize=!1,dT.prototype.featuresPlaybackRate=!1,dT.prototype.featuresProgressEvents=!1,dT.prototype.featuresSourceset=!1,dT.prototype.featuresTimeupdateEvents=!1,dT.prototype.featuresNativeTextTracks=!1,dT.prototype.featuresVideoFrameCallback=!1,dT.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){const i=e.sourceHandlers||[];let n;for(let e=0;e<i.length;e++)if(n=i[e].canPlayType(t),n)return n;return""},e.selectSourceHandler=function(t,i){const n=e.sourceHandlers||[];let s;for(let e=0;e<n.length;e++)if(s=n[e].canHandleSource(t,i),s)return n[e];return null},e.canPlaySource=function(t,i){const n=e.selectSourceHandler(t,i);return n?n.canHandleSource(t,i):""};["seekable","seeking","duration"].forEach(function(e){const t=this[e];"function"==typeof t&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)})},e.prototype),e.prototype.setSource=function(t){let i=e.selectSourceHandler(t,this.options_);i||(e.nativeSourceHandler?i=e.nativeSourceHandler:m_.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)}},bb.registerComponent("Tech",dT),dT.registerTech("Tech",dT),dT.defaultTechOrder_=[];const pT={},fT={},mT={};function gT(e,t,i){e.setTimeout(()=>wT(t,pT[t.type],i,e),1)}function yT(e,t,i,n=null){const s="call"+yb(i),r=e.reduce(TT(s),n),a=r===mT,o=a?null:t[i](r);return function(e,t,i,n){for(let s=e.length-1;s>=0;s--){const r=e[s];r[t]&&r[t](n,i)}}(e,i,o,a),o}const _T={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},vT={setCurrentTime:1,setMuted:1,setVolume:1},bT={play:1,pause:1};function TT(e){return(t,i)=>t===mT?mT:i[e]?i[e](t):t}function wT(e={},t=[],i,n,s=[],r=!1){const[a,...o]=t;if("string"==typeof a)wT(e,pT[a],i,n,s,r);else if(a){const t=function(e,t){const i=fT[e.id()];let n=null;if(null==i)return n=t(e),fT[e.id()]=[[t,n]],n;for(let e=0;e<i.length;e++){const[s,r]=i[e];s===t&&(n=r)}return null===n&&(n=t(e),i.push([t,n])),n}(n,a);if(!t.setSource)return s.push(t),wT(e,o,i,n,s,r);t.setSource(Object.assign({},e),function(a,l){if(a)return wT(e,o,i,n,s,r);s.push(t),wT(l,e.type===l.type?o:pT[l.type],i,n,s,r)})}else o.length?wT(e,o,i,n,s,r):r?i(e,s):wT(e,pT["*"],i,n,s,!0)}const ST={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"},ET=function(e=""){const t=eT(e);return ST[t.toLowerCase()]||""},CT=function(e){if(Array.isArray(e)){let t=[];e.forEach(function(e){e=CT(e),Array.isArray(e)?t=t.concat(e):T_(e)&&t.push(e)}),e=t}else e="string"==typeof e&&e.trim()?[kT({src:e})]:T_(e)&&"string"==typeof e.src&&e.src&&e.src.trim()?[kT(e)]:[];return e};function kT(e){if(!e.type){const t=ET(e.src);t&&(e.type=t)}return e}const xT=V_?10009:H_?461:8,IT={codes:{play:415,pause:19,ff:417,rw:412,back:xT},names:{415:"play",19:"pause",417:"ff",412:"rw",[xT]:"back"},isEventKey(e,t){return t=t.toLowerCase(),!(!this.names[e.keyCode]||this.names[e.keyCode]!==t)},getEventName(e){if(this.names[e.keyCode])return this.names[e.keyCode];if(this.codes[e.code]){const t=this.codes[e.code];return this.names[t]}return null}};class AT extends nb{constructor(e){super(),this.player_=e,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}start(){this.isListening_||(this.player_.on("keydown",this.onKeyDown_),this.player_.on("modalKeydown",this.onKeyDown_),this.player_.on("loadedmetadata",()=>{this.focus(this.updateFocusableComponents()[0])}),this.player_.on("modalclose",()=>{this.refocusComponent()}),this.player_.on("focusin",this.handlePlayerFocus_.bind(this)),this.player_.on("focusout",this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on("aftermodalfill",()=>{this.updateFocusableComponents(),this.focusableComponents.length&&(this.focusableComponents.length>1?this.focusableComponents[1].focus():this.focusableComponents[0].focus())}))}stop(){this.player_.off("keydown",this.onKeyDown_),this.isListening_=!1}onKeyDown_(e){const t=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)){if(this.isPaused_)return;t.preventDefault();const e=t.key.substring(5).toLowerCase();this.move(e)}else if(IT.isEventKey(t,"play")||IT.isEventKey(t,"pause")||IT.isEventKey(t,"ff")||IT.isEventKey(t,"rw")){t.preventDefault();const e=IT.getEventName(t);this.performMediaAction_(e)}else IT.isEventKey(t,"Back")&&e.target&&"function"==typeof e.target.closeable&&e.target.closeable()&&(t.preventDefault(),e.target.close())}performMediaAction_(e){if(this.player_)switch(e){case"play":this.player_.paused()&&this.player_.play();break;case"pause":this.player_.paused()||this.player_.pause();break;case"ff":this.userSeek_(this.player_.currentTime()+5);break;case"rw":this.userSeek_(this.player_.currentTime()-5)}}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(e){const t=e.relatedTarget;let i=null;const n=this.getCurrentComponent(e.target);t&&(i=Boolean(t.closest(".video-js")),t.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(e.currentTarget.contains(e.relatedTarget)||i)&&t||(n&&"CloseButton"===n.name()?this.refocusComponent():(this.pause(),n&&n.el()&&(this.lastFocusedComponent_=n)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){const e=this.player_,t=[];function i(e){for(const n of e)n.hasOwnProperty("el_")&&n.getIsFocusable()&&n.getIsAvailableToBeFocused(n.el())&&t.push(n),n.hasOwnProperty("children_")&&n.children_.length>0&&i(n.children_)}return e.children_.forEach(e=>{if(e.hasOwnProperty("el_")){if(e.getIsFocusable&&e.getIsAvailableToBeFocused&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el()))return void t.push(e);e.hasOwnProperty("children_")&&e.children_.length>0?i(e.children_):e.hasOwnProperty("items")&&e.items.length>0?i(e.items):this.findSuitableDOMChild(e)&&t.push(e)}if("ErrorDisplay"===e.name_&&e.opened_){const i=e.el_.querySelector(".vjs-errors-ok-button-container");if(i){i.querySelectorAll("button").forEach((e,i)=>{t.push({name:()=>"ModalButton"+(i+1),el:()=>e,getPositions:()=>{const t=e.getBoundingClientRect();return{boundingClientRect:{x:t.x,y:t.y,width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left},center:{x:t.left+t.width/2,y:t.top+t.height/2,width:0,height:0,top:t.top+t.height/2,right:t.left+t.width/2,bottom:t.top+t.height/2,left:t.left+t.width/2}}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:e=>!0,focus:()=>e.focus()})})}}}),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(e){return e.el()?function t(i){if(e.getIsFocusable(i)&&e.getIsAvailableToBeFocused(i))return i;for(let e=0;e<i.children.length;e++){const n=t(i.children[e]);if(n)return n}return null}(e.el()):null}getCurrentComponent(e){this.updateFocusableComponents();const t=e||document.activeElement;if(this.focusableComponents.length)for(const e of this.focusableComponents)if(e.el()===t)return e}add(e){const t=[...this.focusableComponents];e.hasOwnProperty("el_")&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el())&&t.push(e),this.focusableComponents=t,this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}remove(e){for(let t=0;t<this.focusableComponents.length;t++)if(this.focusableComponents[t].name()===e.name())return this.focusableComponents.splice(t,1),void this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}clear(){this.focusableComponents.length>0&&(this.focusableComponents=[],this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents}))}move(e){const t=this.getCurrentComponent();if(!t)return;const i=t.getPositions(),n=this.focusableComponents.filter(n=>n!==t&&this.isInDirection_(i.boundingClientRect,n.getPositions().boundingClientRect,e)),s=this.findBestCandidate_(i.center,n,e);s?this.focus(s):this.trigger({type:"endOfFocusableComponents",direction:e,focusedComponent:t})}findBestCandidate_(e,t,i){let n=1/0,s=null;for(const r of t){const t=r.getPositions().center,a=this.calculateDistance_(e,t,i);a<n&&(n=a,s=r)}return s}isInDirection_(e,t,i){switch(i){case"right":return t.left>=e.right;case"left":return t.right<=e.left;case"down":return t.top>=e.bottom;case"up":return t.bottom<=e.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let e=0;e<this.focusableComponents.length;e++)if(this.focusableComponents[e].name()===this.lastFocusedComponent_.name())return void this.focus(this.focusableComponents[e])}else this.focus(this.updateFocusableComponents()[0])}focus(e){"object"==typeof e&&(e.getIsAvailableToBeFocused(e.el())?e.focus():this.findSuitableDOMChild(e)&&this.findSuitableDOMChild(e).focus())}calculateDistance_(e,t,i){const n=Math.abs(e.x-t.x),s=Math.abs(e.y-t.y);let r;switch(i){case"right":case"left":r=n+100*s;break;case"up":r=2*s+.5*n;break;case"down":r=5*s+n;break;default:r=n+s}return r}searchForTrackSelect_(){const e=this;for(const t of e.updateFocusableComponents())if("TextTrackSelect"===t.constructor.name){e.focus(t);break}}}bb.registerComponent("MediaLoader",class extends bb{constructor(e,t,i){if(super(e,S_({createEl:!1},t),i),t.playerOptions.sources&&0!==t.playerOptions.sources.length)e.src(t.playerOptions.sources);else for(let i=0,n=t.playerOptions.techOrder;i<n.length;i++){const t=yb(n[i]);let s=dT.getTech(t);if(t||(s=bb.getComponent(t)),s&&s.isSupported()){e.loadTech_(t);break}}}});class LT extends bb{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=e=>this.handleMouseOver(e),this.handleMouseOut_=e=>this.handleMouseOut(e),this.handleClick_=e=>this.handleClick(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.emitTapEvents(),this.enable()}createEl(e="div",t={},i={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),"button"===e&&m_.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),i=Object.assign({role:"button"},i),this.tabIndex_=t.tabIndex;const n=iv(e,t,i);return this.player_.options_.experimentalSvgIcons||n.appendChild(iv("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(n),n}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=iv("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(void 0===e)return this.controlText_||"Need Text";const i=this.localize(e);this.controlText_=e,nv(this.controlTextEl_,i),this.nonIconControl||this.player_.options_.noUITitleAttributes||t.setAttribute("title",i)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){" "===e.key||"Enter"===e.key?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}bb.registerComponent("ClickableComponent",LT);class PT extends LT{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 iv("div",{className:"vjs-poster"})}crossOrigin(e){if(void 0===e)return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;null===e||"anonymous"===e||"use-credentials"===e?this.$("img")&&(this.$("img").crossOrigin=e):this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`)}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){e?(this.$("img")||this.el_.appendChild(iv("picture",{className:"vjs-poster",tabIndex:-1},{},iv("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()?Db(this.player_.play()):this.player_.pause())}}PT.prototype.crossorigin=PT.prototype.crossOrigin,bb.registerComponent("PosterImage",PT);const OT="#222",DT="#ccc",MT={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 NT(e,t){let i;if(4===e.length)i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");i=e.slice(1)}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function RT(e,t,i){try{e.style[t]=i}catch(e){return}}function FT(e){return e?`${e}px`:""}bb.registerComponent("TextTrackDisplay",class extends bb{constructor(e,t,i){super(e,t,i);const n=e=>this.updateDisplay(e),s=e=>{this.updateDisplayOverlay(),this.updateDisplay(e)};e.on("loadstart",e=>this.toggleDisplay(e)),e.on("useractive",n),e.on("userinactive",n),e.on("texttrackchange",n),e.on("loadedmetadata",e=>{this.updateDisplayOverlay(),this.preselectTrack(e)}),e.ready(Jv(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks)return void this.hide();e.on("fullscreenchange",s),e.on("playerresize",s);const t=Dd.screen.orientation||Dd,i=Dd.screen.orientation?"change":"orientationchange";t.addEventListener(i,s),e.on("dispose",()=>t.removeEventListener(i,s));const n=this.options_.playerOptions.tracks||[];for(let e=0;e<n.length;e++)this.player_.addRemoteTextTrack(n[e],!0);this.preselectTrack()}))}preselectTrack(){const e={captions:1,subtitles:1},t=this.player_.textTracks(),i=this.player_.cache_.selectedLanguage;let n,s,r;for(let a=0;a<t.length;a++){const o=t[a];i&&i.enabled&&i.language&&i.language===o.language&&o.kind in e?o.kind===i.kind?r=o:r||(r=o):i&&!i.enabled?(r=null,n=null,s=null):o.default&&("descriptions"!==o.kind||n?o.kind in e&&!s&&(s=o):n=o)}r?r.mode="showing":s?s.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 Dd.WebVTT&&Dd.WebVTT.processCues(Dd,[],this.el_)}updateDisplay(){const e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){const t=[];for(let i=0;i<e.length;++i){const n=e[i];"showing"===n.mode&&t.push(n)}return void this.updateForTrack(t)}let i=null,n=null,s=e.length;for(;s--;){const t=e[s];"showing"===t.mode&&("descriptions"===t.kind?i=t:n=t)}if(n?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(n)):i&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(i)),void 0===Dd.CSS||!Dd.CSS.supports("inset","10px")){const e=this.el_,t=e.querySelectorAll(".vjs-text-track-cue"),i=this.player_.controlBar.el_.getBoundingClientRect().height,n=this.player_.el_.getBoundingClientRect().height;e.style="",RT(e,"position","relative"),RT(e,"height",n-i+"px"),RT(e,"top","unset"),RT(e,"bottom",z_?n+"px":"0px"),t.length>0&&t.forEach(e=>{if(e.style.inset){const t=e.style.inset.split(" ");3===t.length&&Object.assign(e.style,{top:t[0],right:t[1],bottom:t[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||void 0===Dd.CSS||!Dd.CSS.supports("inset-inline: 10px"))return;const e=this.player_.currentWidth(),t=this.player_.currentHeight(),i=e/t,n=this.player_.videoWidth()/this.player_.videoHeight();let s=0,r=0;Math.abs(i-n)>.1&&(i>n?s=Math.round((e-t*n)/2):r=Math.round((t-e/n)/2)),RT(this.el_,"insetInline",FT(s)),RT(this.el_,"insetBlock",FT(r))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),i=e.activeCues;let n=i.length;for(;n--;){const e=i[n];if(!e)continue;const s=e.displayState;if(t.color&&(s.firstChild.style.color=t.color),t.textOpacity&&RT(s.firstChild,"color",NT(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(s.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&RT(s.firstChild,"backgroundColor",NT(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?RT(s,"backgroundColor",NT(t.windowColor,t.windowOpacity)):s.style.backgroundColor=t.windowColor),t.edgeStyle&&("dropshadow"===t.edgeStyle?s.firstChild.style.textShadow=`2px 2px 3px ${OT}, 2px 2px 4px ${OT}, 2px 2px 5px ${OT}`:"raised"===t.edgeStyle?s.firstChild.style.textShadow=`1px 1px ${OT}, 2px 2px ${OT}, 3px 3px ${OT}`:"depressed"===t.edgeStyle?s.firstChild.style.textShadow=`1px 1px ${DT}, 0 1px ${DT}, -1px -1px ${OT}, 0 -1px ${OT}`:"uniform"===t.edgeStyle&&(s.firstChild.style.textShadow=`0 0 4px ${OT}, 0 0 4px ${OT}, 0 0 4px ${OT}, 0 0 4px ${OT}`)),t.fontPercent&&1!==t.fontPercent){const e=Dd.parseFloat(s.style.fontSize);s.style.fontSize=e*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=MT[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),"function"!=typeof Dd.WebVTT||e.every(e=>!e.activeCues))return;const t=[];for(let i=0;i<e.length;++i){const n=e[i];for(let e=0;e<n.activeCues.length;++e)t.push(n.activeCues[e])}Dd.WebVTT.processCues(Dd,t,this.el_);for(let t=0;t<e.length;++t){const i=e[t];for(let e=0;e<i.activeCues.length;++e){const n=i.activeCues[e].displayState;av(n,"vjs-text-track-cue","vjs-text-track-cue-"+(i.language?i.language:t)),i.language&&dv(n,"lang",i.language)}this.player_.textTrackSettings&&this.updateDisplayState(i)}}});bb.registerComponent("LoadingSpinner",class extends bb{createEl(){const e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"Video Player"),i=iv("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[t])}),n=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});return n.appendChild(i),n}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}});class BT extends LT{createEl(e,t={},i={}){const n=iv("button",t=Object.assign({className:this.buildCSSClass()},t),i=Object.assign({type:"button"},i));return this.player_.options_.experimentalSvgIcons||n.appendChild(iv("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(n),n}addChild(e,t={}){const i=this.constructor.name;return m_.warn(`Adding an actionable (user controllable) child to a Button (${i}) is not supported; use a ClickableComponent instead.`),bb.prototype.addChild.call(this,e,t)}enable(){super.enable(),this.el_.removeAttribute("disabled")}disable(){super.disable(),this.el_.setAttribute("disabled","disabled")}handleKeyDown(e){" "!==e.key&&"Enter"!==e.key?super.handleKeyDown(e):e.stopPropagation()}}bb.registerComponent("Button",BT);class UT extends BT{constructor(e,t){super(e,t),this.mouseused_=!1,this.setIcon("play"),this.on("mousedown",e=>this.handleMouseDown(e))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if("tap"===e.type||this.mouseused_&&"clientX"in e&&"clientY"in e)return Db(t),void(this.player_.tech(!0)&&this.player_.tech(!0).focus());const i=this.player_.getChild("controlBar"),n=i&&i.getChild("playToggle");if(!n)return void this.player_.tech(!0).focus();const s=()=>n.focus();Ob(t)?t.then(s,()=>{}):this.setTimeout(s,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}UT.prototype.controlText_="Play Video",bb.registerComponent("BigPlayButton",UT);bb.registerComponent("CloseButton",class extends BT{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){"Escape"===e.key?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}});class jT extends BT{constructor(e,t={}){super(e,t),t.replay=void 0===t.replay||t.replay,this.setIcon("play"),this.on(e,"play",e=>this.handlePlay(e)),this.on(e,"pause",e=>this.handlePause(e)),t.replay&&this.on(e,"ended",e=>this.handleEnded(e))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?Db(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",e=>this.handleSeeked(e))}}jT.prototype.controlText_="Play",bb.registerComponent("PlayToggle",jT);class $T extends bb{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],e=>this.update(e)),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),i=iv("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return t.appendChild(i),this.contentEl_=iv("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){(this.player_.options_.enableSmoothSeeking||"seeking"!==e.type)&&this.updateContent(e)}updateTextNode_(e=0){e=Ib(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let e=this.textNode_;e&&this.contentEl_.firstChild!==e&&(e=null,m_.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_=lp.createTextNode(this.formattedTime_),this.textNode_&&(e?this.contentEl_.replaceChild(this.textNode_,e):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}$T.prototype.labelText_="Time",$T.prototype.controlText_="Time",bb.registerComponent("TimeDisplay",$T);class qT extends $T{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;t=this.player_.ended()?this.player_.duration():e&&e.target&&"function"==typeof e.target.pendingSeekTime&&null!==e.target.pendingSeekTime()?e.target.pendingSeekTime():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}qT.prototype.labelText_="Current Time",qT.prototype.controlText_="Current Time",bb.registerComponent("CurrentTimeDisplay",qT);class VT extends $T{constructor(e,t){super(e,t);const i=e=>this.updateContent(e);this.on(e,"durationchange",i),this.on(e,"loadstart",i),this.on(e,"loadedmetadata",i)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}VT.prototype.labelText_="Duration",VT.prototype.controlText_="Duration",bb.registerComponent("DurationDisplay",VT);bb.registerComponent("TimeDivider",class extends bb{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),i=super.createEl("span",{textContent:"/"});return t.appendChild(i),e.appendChild(t),e}});class HT extends $T{constructor(e,t){super(e,t),this.on(e,"durationchange",e=>this.updateContent(e))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return!1!==this.options_.displayNegative&&e.insertBefore(iv("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if("number"!=typeof this.player_.duration())return;let t;t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t)}}HT.prototype.labelText_="Remaining Time",HT.prototype.controlText_="Remaining Time",bb.registerComponent("RemainingTimeDisplay",HT);bb.registerComponent("LiveDisplay",class extends bb{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",e=>this.updateShowing(e))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=iv("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(iv("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(lp.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 zT extends BT{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=e=>this.updateLiveEdgeStatus(e),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=iv("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 WT(e,t,i){return e=Number(e),Math.min(i,Math.max(t,isNaN(e)?t:e))}zT.prototype.controlText_="Seek to live, currently playing live",bb.registerComponent("SeekToLive",zT);var GT=Object.freeze({__proto__:null,clamp:WT});class XT extends bb{constructor(e,t){super(e,t),this.handleMouseDown_=e=>this.handleMouseDown(e),this.handleMouseUp_=e=>this.handleMouseUp(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.handleClick_=e=>this.handleClick(e),this.handleMouseMove_=e=>this.handleMouseMove(e),this.update_=e=>this.update(e),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},i={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),i=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},i),super.createEl(e,t,i)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||M_||e.preventDefault(),fv(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;mv(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{const t=this.vertical()?"height":"width";this.bar.el().style[t]=(100*e).toFixed(2)+"%"})),e}getProgress(){return Number(WT(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=_v(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){const t=this.options_.playerOptions.spatialNavigation,i=t&&t.enabled,n=t&&t.horizontalSeek;i?n&&"ArrowLeft"===e.key||!n&&"ArrowDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepBack()):n&&"ArrowRight"===e.key||!n&&"ArrowUp"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(this.pendingSeekTime()&&(this.pendingSeekTime(null),this.userSeek_(this.player_.currentTime())),super.handleKeyDown(e)):"ArrowLeft"===e.key||"ArrowDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepBack()):"ArrowUp"===e.key||"ArrowRight"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}bb.registerComponent("Slider",XT);const KT=(e,t)=>WT(e/t*100,0,100).toFixed(2)+"%";bb.registerComponent("LoadProgressBar",class extends bb{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",e=>this.update(e))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=iv("span",{className:"vjs-control-text"}),i=iv("span",{textContent:this.localize("Loaded")}),n=lp.createTextNode(": ");return this.percentageEl_=iv("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",()=>{const e=this.player_.liveTracker,t=this.player_.buffered(),i=e&&e.isLive()?e.seekableEnd():this.player_.duration(),n=this.player_.bufferedEnd(),s=this.partEls_,r=KT(n,i);this.percent_!==r&&(this.el_.style.width=r,nv(this.percentageEl_,r),this.percent_=r);for(let e=0;e<t.length;e++){const i=t.start(e),r=t.end(e);let a=s[e];a||(a=this.el_.appendChild(iv()),s[e]=a),a.dataset.start===i&&a.dataset.end===r||(a.dataset.start=i,a.dataset.end=r,a.style.left=KT(i,n),a.style.width=KT(r-i,n))}for(let e=s.length;e>t.length;e--)this.el_.removeChild(s[e-1]);s.length=t.length})}});bb.registerComponent("TimeTooltip",class extends bb{constructor(e,t){super(e,t),this.update=Zv(Jv(this,this.update),Qv)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,i){const n=yv(this.el_),s=gv(this.player_.el()),r=e.width*t;if(!s||!n)return;let a=e.left-s.left+r,o=e.width-r+(s.right-e.right);o||(o=e.width-r,a=r);let l=n.width/2;a<l?l+=l-a:o<l&&(l=o),l<0?l=0:l>n.width&&(l=n.width),l=Math.round(l),this.el_.style.right=`-${l}px`,this.write(i)}write(e){nv(this.el_,e)}updateTime(e,t,i,n){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let s;const r=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const e=this.player_.liveTracker.liveWindow(),i=e-t*e;s=(i<1?"":"-")+Ib(i,e)}else s=Ib(i,r);this.update(e,t,s),n&&n()})}});class QT extends bb{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=Zv(Jv(this,this.update),Qv)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t,i){const n=this.getChild("timeTooltip");if(!n)return;const s=i&&i.target&&"function"==typeof i.target.pendingSeekTime?i.target.pendingSeekTime():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();n.updateTime(e,t,s)}}QT.prototype.options_={children:[]},X_||L_||QT.prototype.options_.children.push("timeTooltip"),bb.registerComponent("PlayProgressBar",QT);class JT extends bb{constructor(e,t){super(e,t),this.update=Zv(Jv(this,this.update),Qv)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const i=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,i,()=>{this.el_.style.left=e.width*t+"px"})}}JT.prototype.options_={children:["timeTooltip"]},bb.registerComponent("MouseTimeDisplay",JT);class ZT extends XT{constructor(e,t){(t=S_(ZT.prototype.options_,t)).children=[...t.children];const i=e.options_.disableSeekWhileScrubbingOnMobile&&(X_||L_)||e.options_.disableSeekWhileScrubbingOnSTV;(!X_&&!L_||i)&&t.children.splice(1,0,"mouseTimeDisplay"),super(e,t),this.shouldDisableSeekWhileScrubbing_=i,this.pendingSeekTime_=null,this.setEventHandlers_()}setEventHandlers_(){this.update_=Jv(this,this.update),this.update=Zv(this.update_,Qv),this.on(this.player_,["durationchange","timeupdate"],this.update),this.on(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in lp&&"visibilityState"in lp&&this.on(lp,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){"hidden"===lp.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,Qv))}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"===lp.visibilityState)return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{const i=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),n=this.player_.liveTracker;let s=this.player_.duration();n&&n.isLive()&&(s=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.percent_=t),this.currentTime_===i&&this.duration_===s||(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[Ib(i,s),Ib(s,s)],"{1} of {2}")),this.currentTime_=i,this.duration_=s),this.bar&&this.bar.update(gv(this.el()),this.getProgress(),e)}),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}pendingSeekTime(e){if(void 0!==e)if(null!==e){const t=this.player_.duration();this.pendingSeekTime_=Math.max(0,Math.min(e,t))}else this.pendingSeekTime_=null;return this.pendingSeekTime_}getPercent(){if(null!==this.pendingSeekTime())return this.pendingSeekTime()/this.player_.duration();const e=this.getCurrentTime_();let t;const i=this.player_.liveTracker;return i&&i.isLive()?(t=(e-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){Ev(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.shouldDisableSeekWhileScrubbing_||this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!Ev(e)||isNaN(this.player_.duration()))return;let i;t||this.player_.scrubbing()||this.player_.scrubbing(!0);const n=this.calculateDistance(e),s=this.player_.liveTracker;if(s&&s.isLive()){if(n>=.99)return void s.seekToLiveEdge();const e=s.seekableStart(),t=s.liveCurrentTime();if(i=e+n*s.liveWindow(),i>=t&&(i=t),i<=e&&(i=e+.1),i===1/0)return}else i=n*this.player_.duration(),i===this.player_.duration()&&(i-=.1);this.shouldDisableSeekWhileScrubbing_?this.pendingSeekTime(i):this.userSeek_(i),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),null!==this.pendingSeekTime()&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?Db(this.player_.play()):this.update_()}handlePendingSeek_(e){this.player_.paused()||this.player_.pause();const t=null!==this.pendingSeekTime()?this.pendingSeekTime():this.player_.currentTime();this.pendingSeekTime(t+e),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}stepForward(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(this.options().stepSeconds):this.userSeek_(this.player_.currentTime()+this.options().stepSeconds)}stepBack(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(-this.options().stepSeconds):this.userSeek_(this.player_.currentTime()-this.options().stepSeconds)}handleAction(e){null!==this.pendingSeekTime()&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const t=this.player_.liveTracker;if(" "===e.key||"Enter"===e.key)e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if("Home"===e.key)e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if("End"===e.key)e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();const i=.1*parseInt(e.key,10);t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*i):this.userSeek_(this.player_.duration()*i)}else"PageDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-this.options().stepSeconds*this.options().pageMultiplier)):"PageUp"===e.key?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+this.options().stepSeconds*this.options().pageMultiplier)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["durationchange","timeupdate"],this.update),this.off(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in lp&&"visibilityState"in lp&&this.off(lp,"visibilitychange",this.toggleVisibility_),super.dispose()}}ZT.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar",stepSeconds:5,pageMultiplier:12},bb.registerComponent("SeekBar",ZT);class ew extends bb{constructor(e,t){super(e,t),this.handleMouseMove=Zv(Jv(this,this.handleMouseMove),Qv),this.throttledHandleMouseSeek=Zv(Jv(this,this.handleMouseSeek),Qv),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.handleMouseDownHandler_=e=>this.handleMouseDown(e),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const i=t.getChild("playProgressBar"),n=t.getChild("mouseTimeDisplay");if(!i&&!n)return;const s=t.el(),r=yv(s);let a=_v(s,e).x;a=WT(a,0,1),n&&n.update(r,a),i&&i.update(r,t.getProgress())}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach(e=>e.disable&&e.disable()),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&Db(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}ew.prototype.options_={children:["seekBar"]},bb.registerComponent("ProgressControl",ew);class tw extends BT{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],e=>this.handlePictureInPictureChange(e)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],e=>this.handlePictureInPictureEnabledChange(e)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){"audio"===this.player_.currentType().substring(0,5)||this.player_.audioPosterMode()||this.player_.audioOnlyMode()?(this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()):this.show()}handlePictureInPictureEnabledChange(){lp.pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in Dd?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){"function"==typeof lp.exitPictureInPicture&&super.show()}}tw.prototype.controlText_="Picture-in-Picture",bb.registerComponent("PictureInPictureToggle",tw);class iw extends BT{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",e=>this.handleFullscreenChange(e)),!1===lp[e.fsApi_.fullscreenEnabled]&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}iw.prototype.controlText_="Fullscreen",bb.registerComponent("FullscreenToggle",iw);bb.registerComponent("VolumeLevel",class extends bb{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}});bb.registerComponent("VolumeLevelTooltip",class extends bb{constructor(e,t){super(e,t),this.update=Zv(Jv(this,this.update),Qv)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,i,n){if(!i){const i=gv(this.el_),n=gv(this.player_.el()),s=e.width*t;if(!n||!i)return;const r=e.left-n.left+s,a=e.width-s+(n.right-e.right);let o=i.width/2;r<o?o+=o-r:a<o&&(o=a),o<0?o=0:o>i.width&&(o=i.width),this.el_.style.right=`-${o}px`}this.write(`${n}%`)}write(e){nv(this.el_,e)}updateVolume(e,t,i,n,s){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,i,n.toFixed(0)),s&&s()})}});class nw extends bb{constructor(e,t){super(e,t),this.update=Zv(Jv(this,this.update),Qv)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,i){const n=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,n,()=>{i?this.el_.style.bottom=e.height*t+"px":this.el_.style.left=e.width*t+"px"})}}nw.prototype.options_={children:["volumeLevelTooltip"]},bb.registerComponent("MouseVolumeLevelDisplay",nw);class sw extends XT{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){Ev(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const i=this.el(),n=gv(i),s=this.vertical();let r=_v(i,e);r=s?r.y:r.x,r=WT(r,0,1),t.update(n,r,s)}Ev(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(100*this.player_.volume())}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",()=>{0===this.player_.volume()&&this.player_.lastVolume_(e)})}}sw.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},X_||L_||sw.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),sw.prototype.playerEvent="volumechange",bb.registerComponent("VolumeBar",sw);class rw extends bb{constructor(e,t={}){t.vertical=t.vertical||!1,(void 0===t.volumeBar||w_(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})}(this,e),this.throttledHandleMouseMove=Zv(Jv(this,this.handleMouseMove),Qv),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.on("mousedown",e=>this.handleMouseDown(e)),this.on("touchstart",e=>this.handleMouseDown(e)),this.on("mousemove",e=>this.handleMouseMove(e)),this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")}),this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}rw.prototype.options_={children:["volumeBar"]},bb.registerComponent("VolumeControl",rw);class aw extends BT{constructor(e,t){super(e,t),function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})}(this,e),this.on(e,["loadstart","volumechange"],e=>this.update(e))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),i=this.player_.lastVolume_();if(0===t){const e=i<.1?.1:i;this.player_.volume(e),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high"),X_&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?(this.setIcon("volume-mute"),t=0):e<.33?(this.setIcon("volume-low"),t=1):e<.67&&(this.setIcon("volume-medium"),t=2),ov(this.el_,[0,1,2,3].reduce((e,t)=>e+`${t?" ":""}vjs-vol-${t}`,"")),av(this.el_,`vjs-vol-${t}`)}updateControlText_(){const e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)}}aw.prototype.controlText_="Mute",bb.registerComponent("MuteToggle",aw);class ow extends bb{constructor(e,t={}){void 0!==t.inline?t.inline=t.inline:t.inline=!0,(void 0===t.volumeControl||w_(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=e=>this.handleKeyPress(e),this.on(e,["loadstart"],e=>this.volumePanelState_(e)),this.on(this.muteToggle,"keyup",e=>this.handleKeyPress(e)),this.on(this.volumeControl,"keyup",e=>this.handleVolumeControlKeyUp(e)),this.on("keydown",e=>this.handleKeyPress(e)),this.on("mouseover",e=>this.handleMouseOver(e)),this.on("mouseout",e=>this.handleMouseOut(e)),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){"Escape"===e.key&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),zv(lp,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),Wv(lp,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){"Escape"===e.key&&this.handleMouseOut()}}ow.prototype.options_={children:["muteToggle","volumeControl"]},bb.registerComponent("VolumePanel",ow);class lw extends BT{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;const t=this.player_.currentTime(),i=this.player_.liveTracker,n=i&&i.isLive()?i.seekableEnd():this.player_.duration();let s;s=t+this.skipTime<=n?t+this.skipTime:n,this.player_.currentTime(s)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}lw.prototype.controlText_="Skip Forward",bb.registerComponent("SkipForward",lw);class uw extends BT{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime(),i=this.player_.liveTracker,n=i&&i.isLive()&&i.seekableStart();let s;s=n&&t-this.skipTime<=n?n:t>=this.skipTime?t-this.skipTime:0,this.player_.currentTime(s)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}uw.prototype.controlText_="Skip Backward",bb.registerComponent("SkipBackward",uw);class cw extends bb{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 bb&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof bb&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){"string"==typeof e&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){const t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=iv(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),zv(t,"click",function(e){e.preventDefault(),e.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||lp.activeElement;if(!this.children().some(e=>e.el()===t)){const e=this.menuButton_;e&&e.buttonPressed_&&t!==e.el().firstChild&&e.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const i=t.filter(t=>t.el()===e.target)[0];if(!i)return;"CaptionSettingsMenuItem"!==i.name()&&this.menuButton_.focus()}}handleKeyDown(e){"ArrowLeft"===e.key||"ArrowDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepForward()):"ArrowRight"!==e.key&&"ArrowUp"!==e.key||(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}bb.registerComponent("Menu",cw);class hw extends bb{constructor(e,t={}){super(e,t),this.menuButton_=new BT(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const i=BT.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+i,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const n=e=>this.handleClick(e);this.handleMenuKeyUp_=e=>this.handleMenuKeyUp(e),this.on(this.menuButton_,"tap",n),this.on(this.menuButton_,"click",n),this.on(this.menuButton_,"keydown",e=>this.handleKeyDown(e)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),zv(lp,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",e=>this.handleMouseLeave(e)),this.on("keydown",e=>this.handleSubmenuKeyDown(e))}update(){const e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const e=new cw(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=iv("li",{className:"vjs-menu-title",textContent:yb(this.options_.title),tabIndex:-1}),i=new bb(this.player_,{el:t});e.addItem(i)}if(this.items=this.createItems(),this.items)for(let t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e}createItems(){}createEl(){return super.createEl("div",{className:this.buildWrapperCSSClass()},{})}setIcon(e){return super.setIcon(e,this.menuButton_.el_)}buildWrapperCSSClass(){let e="vjs-menu-button";!0===this.options_.inline?e+="-inline":e+="-popup";return`vjs-menu-button ${e} ${BT.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"),Wv(lp,"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(e){"Escape"===e.key||"Tab"===e.key?(this.buttonPressed_&&this.unpressButton(),"Tab"===!e.key&&(e.preventDefault(),this.menuButton_.focus())):"Up"!==e.key&&("Down"!==e.key||this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)||this.buttonPressed_||(e.preventDefault(),this.pressButton())}handleMenuKeyUp(e){"Escape"!==e.key&&"Tab"!==e.key||this.removeClass("vjs-hover")}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e)}handleSubmenuKeyDown(e){"Escape"!==e.key&&"Tab"!==e.key||(this.buttonPressed_&&this.unpressButton(),"Tab"===!e.key&&(e.preventDefault(),this.menuButton_.focus()))}pressButton(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),X_&&ev())return;this.menu.focus()}}unpressButton(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))}disable(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()}enable(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()}}bb.registerComponent("MenuButton",hw);class dw extends hw{constructor(e,t){const i=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),!i)return;const n=Jv(this,this.update);i.addEventListener("removetrack",n),i.addEventListener("addtrack",n),i.addEventListener("labelchange",n),this.player_.on("ready",n),this.player_.on("dispose",function(){i.removeEventListener("removetrack",n),i.removeEventListener("addtrack",n),i.removeEventListener("labelchange",n)})}}bb.registerComponent("TrackButton",dw);class pw extends LT{constructor(e,t){super(e,t),this.selectable=t.selectable,this.isSelected_=t.selected||!1,this.multiSelectable=t.multiSelectable,this.selected(this.isSelected_),this.selectable?this.multiSelectable?this.el_.setAttribute("role","menuitemcheckbox"):this.el_.setAttribute("role","menuitemradio"):this.el_.setAttribute("role","menuitem")}createEl(e,t,i){this.nonIconControl=!0;const n=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),i),s=iv("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});return this.player_.options_.experimentalSvgIcons?n.appendChild(s):n.replaceChild(s,n.querySelector(".vjs-icon-placeholder")),n}handleKeyDown(e){["Tab","Escape","ArrowUp","ArrowLeft","ArrowRight","ArrowDown"].includes(e.key)||super.handleKeyDown(e)}handleClick(e){this.selected(!0)}selected(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))}}bb.registerComponent("MenuItem",pw);class fw extends pw{constructor(e,t){const i=t.track,n=e.textTracks();t.label=i.label||i.language||"Unknown",t.selected="showing"===i.mode,super(e,t),this.track=i,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);const s=(...e)=>{this.handleTracksChange.apply(this,e)},r=(...e)=>{this.handleSelectedLanguageChange.apply(this,e)};if(e.on(["loadstart","texttrackchange"],s),n.addEventListener("change",s),n.addEventListener("selectedlanguagechange",r),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],s),n.removeEventListener("change",s),n.removeEventListener("selectedlanguagechange",r)}),void 0===n.onchange){let e;this.on(["tap","click"],function(){if("object"!=typeof Dd.Event)try{e=new Dd.Event("change")}catch(e){}e||(e=lp.createEvent("Event"),e.initEvent("change",!0,!0)),n.dispatchEvent(e)})}this.handleTracksChange()}handleClick(e){const t=this.track,i=this.player_.textTracks();if(super.handleClick(e),i)for(let e=0;e<i.length;e++){const 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){const t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)}handleSelectedLanguageChange(e){if("showing"===this.track.mode){const e=this.player_.cache_.selectedLanguage;if(e&&e.enabled&&e.language===this.track.language&&e.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}}dispose(){this.track=null,super.dispose()}}bb.registerComponent("TextTrackMenuItem",fw);class mw extends fw{constructor(e,t){t.track={player:e,kind:t.kind,kinds:t.kinds,default:!1,mode:"disabled"},t.kinds||(t.kinds=[t.kind]),t.label?t.track.label=t.label:t.track.label=t.kinds.join(" and ")+" off",t.selectable=!0,t.multiSelectable=!1,super(e,t)}handleTracksChange(e){const t=this.player().textTracks();let i=!0;for(let e=0,n=t.length;e<n;e++){const n=t[e];if(this.options_.kinds.indexOf(n.kind)>-1&&"showing"===n.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let i=!0;for(let e=0,n=t.length;e<n;e++){const n=t[e];if(["captions","descriptions","subtitles"].indexOf(n.kind)>-1&&"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()}}bb.registerComponent("OffTextTrackMenuItem",mw);class gw extends dw{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=fw){let i;this.label_&&(i=`${this.label_} off`),e.push(new mw(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;const n=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let i=0;i<n.length;i++){const s=n[i];if(this.kinds_.indexOf(s.kind)>-1){const i=new t(this.player_,{track:s,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});i.addClass(`vjs-${s.kind}-menu-item`),e.push(i)}}return e}}bb.registerComponent("TextTrackButton",gw);class yw extends pw{constructor(e,t){const i=t.track,n=t.cue,s=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=n.text,t.selected=n.startTime<=s&&s<n.endTime,super(e,t),this.track=i,this.cue=n}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}}bb.registerComponent("ChaptersTrackMenuItem",yw);class _w extends gw{constructor(e,t,i){super(e,t,i),this.setIcon("chapters"),this.selectCurrentItem_=()=>{this.items.forEach(e=>{e.selected(this.track_.activeCues[0]===e.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&"chapters"!==e.track.kind)return;const t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){const i=e[t];if(i.kind===this.kind_)return i}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(yb(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let i=0,n=t.length;i<n;i++){const n=t[i],s=new yw(this.player_,{track:this.track_,cue:n});e.push(s)}return e}}_w.prototype.kind_="chapters",_w.prototype.controlText_="Chapters",bb.registerComponent("ChaptersButton",_w);class vw extends gw{constructor(e,t,i){super(e,t,i),this.setIcon("audio-description");const n=e.textTracks(),s=Jv(this,this.handleTracksChange);n.addEventListener("change",s),this.on("dispose",function(){n.removeEventListener("change",s)})}handleTracksChange(e){const t=this.player().textTracks();let i=!1;for(let e=0,n=t.length;e<n;e++){const 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()}`}}vw.prototype.kind_="descriptions",vw.prototype.controlText_="Descriptions",bb.registerComponent("DescriptionsButton",vw);class bw extends gw{constructor(e,t,i){super(e,t,i),this.setIcon("subtitles")}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}}bw.prototype.kind_="subtitles",bw.prototype.controlText_="Subtitles",bb.registerComponent("SubtitlesButton",bw);class Tw extends fw{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()}}bb.registerComponent("CaptionSettingsMenuItem",Tw);class ww extends gw{constructor(e,t,i){super(e,t,i),this.setIcon("captions")}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){const e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new Tw(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}}ww.prototype.kind_="captions",ww.prototype.controlText_="Captions",bb.registerComponent("CaptionsButton",ww);class Sw extends fw{createEl(e,t,i){const n=super.createEl(e,t,i),s=n.querySelector(".vjs-menu-item-text");return"captions"===this.options_.track.kind&&(this.player_.options_.experimentalSvgIcons?this.setIcon("captions",n):s.appendChild(iv("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),s.appendChild(iv("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))),n}}bb.registerComponent("SubsCapsMenuItem",Sw);class Ew extends gw{constructor(e,t={}){super(e,t),this.label_="subtitles",this.setIcon("subtitles"),["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)>-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(yb(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 Tw(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,Sw),e}}Ew.prototype.kinds_=["captions","subtitles"],Ew.prototype.controlText_="Subtitles",bb.registerComponent("SubsCapsButton",Ew);class Cw extends pw{constructor(e,t){const i=t.track,n=e.audioTracks();t.label=i.label||i.language||"Unknown",t.selected=i.enabled,super(e,t),this.track=i,this.addClass(`vjs-${i.kind}-menu-item`);const s=(...e)=>{this.handleTracksChange.apply(this,e)};n.addEventListener("change",s),this.on("dispose",()=>{n.removeEventListener("change",s)})}createEl(e,t,i){const n=super.createEl(e,t,i),s=n.querySelector(".vjs-menu-item-text");return["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0&&(s.appendChild(iv("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),s.appendChild(iv("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),n}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const e=this.player_.audioTracks();for(let t=0;t<e.length;t++){const i=e[t];i!==this.track&&(i.enabled=i===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}}bb.registerComponent("AudioTrackMenuItem",Cw);class kw extends dw{constructor(e,t={}){t.tracks=e.audioTracks(),super(e,t),this.setIcon("audio")}buildCSSClass(){return`vjs-audio-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-audio-button ${super.buildWrapperCSSClass()}`}createItems(e=[]){this.hideThreshold_=1;const t=this.player_.audioTracks();for(let i=0;i<t.length;i++){const n=t[i];e.push(new Cw(this.player_,{track:n,selectable:!0,multiSelectable:!1}))}return e}}kw.prototype.controlText_="Audio Track",bb.registerComponent("AudioTrackButton",kw);class xw extends pw{constructor(e,t){const 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)}}xw.prototype.contentElType="button",bb.registerComponent("PlaybackRateMenuItem",xw);class Iw extends hw{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",e=>this.updateVisibility(e)),this.on(e,"ratechange",e=>this.updateLabel(e)),this.on(e,"playbackrateschange",e=>this.handlePlaybackRateschange(e))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=iv("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),t=[];for(let i=e.length-1;i>=0;i--)t.push(new xw(this.player(),{rate:e[i]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}Iw.prototype.controlText_="Playback Rate",bb.registerComponent("PlaybackRateMenuButton",Iw);class Aw extends bb{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},i={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,i)}}bb.registerComponent("Spacer",Aw);bb.registerComponent("CustomControlSpacer",class extends Aw{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}});class Lw extends bb{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}Lw.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]},bb.registerComponent("ControlBar",Lw);class Pw extends Ub{constructor(e,t){super(e,t),this.on(e,"error",e=>{this.open(e)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}Pw.prototype.options_=Object.assign({},Ub.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),bb.registerComponent("ErrorDisplay",Pw);class Ow extends bb{constructor(e,t={}){super(e,t),this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim();return iv("select",{id:this.options_.id},{},this.options_.SelectOptions.map(e=>{const t=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${jv()}`)+"-"+e[1].replace(/\W+/g,""),i=iv("option",{id:t,value:this.localize(e[0]),textContent:this.localize(e[1])});return i.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${t}`),i}))}}bb.registerComponent("TextTrackSelect",Ow);class Dw extends bb{constructor(e,t={}){super(e,t);const i=iv("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(i);const n=this.options_.selects;for(const t of n){const i=this.options_.selectConfigs[t],n=i.className,s=i.id.replace("%s",this.options_.id_);let r=null;const a=`vjs_select_${jv()}`;if("colors"===this.options_.type){r=iv("span",{className:n});const e=iv("label",{id:s,className:"vjs-label",textContent:this.localize(i.label)});e.setAttribute("for",a),r.appendChild(e)}const o=new Ow(e,{SelectOptions:i.options,legendId:this.options_.legendId,id:a,labelId:s});this.addChild(o),"colors"===this.options_.type&&(r.appendChild(o.el()),this.el().appendChild(r))}}createEl(){return iv("fieldset",{className:this.options_.className})}}bb.registerComponent("TextTrackFieldset",Dw);class Mw extends bb{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,n=new Dw(e,{id_:i,legendId:`captions-text-legend-${i}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(n);const s=new Dw(e,{id_:i,legendId:`captions-background-${i}`,legendText:this.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(s);const r=new Dw(e,{id_:i,legendId:`captions-window-${i}`,legendText:this.localize("Caption Area Background"),className:"vjs-window vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(r)}createEl(){return iv("div",{className:"vjs-track-settings-colors"})}}bb.registerComponent("TextTrackSettingsColors",Mw);class Nw extends bb{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,n=new Dw(e,{id_:i,legendId:`captions-font-size-${i}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(n);const s=new Dw(e,{id_:i,legendId:`captions-edge-style-${i}`,legendText:this.localize("Text Edge Style"),className:"vjs-edge-style vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(s);const r=new Dw(e,{id_:i,legendId:`captions-font-family-${i}`,legendText:this.localize("Font Family"),className:"vjs-font-family vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(r)}createEl(){return iv("div",{className:"vjs-track-settings-font"})}}bb.registerComponent("TextTrackSettingsFont",Nw);class Rw extends bb{constructor(e,t={}){super(e,t);const i=new BT(e,{controlText:this.localize("restore all settings to the default values"),className:"vjs-default-button"});i.el().classList.remove("vjs-control","vjs-button"),i.el().textContent=this.localize("Reset"),this.addChild(i);const n=this.localize("Done"),s=new BT(e,{controlText:n,className:"vjs-done-button"});s.el().classList.remove("vjs-control","vjs-button"),s.el().textContent=n,this.addChild(s)}createEl(){return iv("div",{className:"vjs-track-settings-controls"})}}bb.registerComponent("TrackSettingsControls",Rw);const Fw="vjs-text-track-settings",Bw=["#000","Black"],Uw=["#00F","Blue"],jw=["#0FF","Cyan"],$w=["#0F0","Green"],qw=["#F0F","Magenta"],Vw=["#F00","Red"],Hw=["#FFF","White"],zw=["#FF0","Yellow"],Ww=["1","Opaque"],Gw=["0.5","Semi-Transparent"],Xw=["0","Transparent"],Kw={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Bw,Hw,Vw,$w,Uw,zw,qw,jw],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[Ww,Gw,Xw],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Hw,Bw,Vw,$w,Uw,zw,qw,jw],className:"vjs-text-color"},edgeStyle:{selector:".vjs-edge-style > select",id:"",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:e=>"1.00"===e?null:Number(e)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[Ww,Gw],className:"vjs-text-opacity vjs-opacity"},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color",className:"vjs-window-color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[Xw,Gw,Ww],className:"vjs-window-opacity vjs-opacity"}};function Yw(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}Kw.windowColor.options=Kw.backgroundColor.options;bb.registerComponent("TextTrackSettings",class extends Ub{constructor(e,t){t.temporary=!1,super(e,t),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.renderModalComponents(e),this.endDialog=iv("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")}),this.el().appendChild(this.endDialog),this.setDefaults(),void 0===t.persistTextTrackSettings&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings),this.bindFunctionsToSelectsAndButtons(),this.options_.persistTextTrackSettings&&this.restoreSettings()}renderModalComponents(e){const t=new Mw(e,{textTrackComponentid:this.id_,selectConfigs:Kw,fieldSets:[["color","textOpacity"],["backgroundColor","backgroundOpacity"],["windowColor","windowOpacity"]]});this.addChild(t);const i=new Nw(e,{textTrackComponentid:this.id_,selectConfigs:Kw,fieldSets:[["fontPercent"],["edgeStyle"],["fontFamily"]]});this.addChild(i);const n=new Rw(e);this.addChild(n)}bindFunctionsToSelectsAndButtons(){this.on(this.$(".vjs-done-button"),["click","tap"],()=>{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),["click","tap"],()=>{this.setDefaults(),this.updateDisplay()}),v_(Kw,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})}dispose(){this.endDialog=null,super.dispose()}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return b_(Kw,(e,t,i)=>{const n=(s=this.$(t.selector),r=t.parser,Yw(s.options[s.options.selectedIndex].value,r));var s,r;return void 0!==n&&(e[i]=n),e},{})}setValues(e){v_(Kw,(t,i)=>{!function(e,t,i){if(t)for(let n=0;n<e.options.length;n++)if(Yw(e.options[n].value,i)===t){e.selectedIndex=n;break}}(this.$(t.selector),e[i],t.parser)})}setDefaults(){v_(Kw,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(Dd.localStorage.getItem(Fw))}catch(e){m_.warn(e)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?Dd.localStorage.setItem(Fw,JSON.stringify(e)):Dd.localStorage.removeItem(Fw)}catch(e){m_.warn(e)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}});bb.registerComponent("ResizeManager",class extends bb{constructor(e,t){let i=t.ResizeObserver||Dd.ResizeObserver;null===t.ResizeObserver&&(i=!1);super(e,S_({createEl:!i,reportTouchActivity:!1},t)),this.ResizeObserver=t.ResizeObserver||Dd.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=eb(()=>{this.resizeHandler()},100,!1,this),i?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const e=this.debouncedHandler_;let t=this.unloadListener_=function(){Wv(this,"resize",e),Wv(this,"unload",t),t=null};zv(this.el_.contentWindow,"unload",t),zv(this.el_.contentWindow,"resize",e)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}});const Qw={trackingThreshold:20,liveTolerance:15};bb.registerComponent("LiveTracker",class extends bb{constructor(e,t){super(e,S_(Qw,t,{createEl:!1})),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=e=>this.handlePlay(e),this.handleFirstTimeupdate_=e=>this.handleFirstTimeupdate(e),this.handleSeeked_=e=>this.handleSeeked(e),this.seekToLiveEdge_=e=>this.seekToLiveEdge(e),this.reset_(),this.on(this.player_,"durationchange",e=>this.handleDurationchange(e)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(Dd.performance.now().toFixed(4)),i=-1===this.lastTime_?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+i;const n=this.liveCurrentTime(),s=this.player_.currentTime();let r=this.player_.paused()||this.seekedBehindLive_||Math.abs(n-s)>this.options_.liveTolerance;this.timeupdateSeen_&&n!==1/0||(r=!1),r!==this.behindLiveEdge_&&(this.behindLiveEdge_=r,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_,Qv),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return-1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return"number"==typeof this.trackingInterval_}seekToLiveEdge(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}});bb.registerComponent("TitleBar",class extends bb{constructor(e,t){super(e,t),this.on("statechanged",e=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:iv("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${jv()}`}),description:iv("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${jv()}`})},iv("div",{className:"vjs-title-bar"},{},E_(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,i={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(e=>{const n=this.state[e],s=this.els[e],r=i[e];bv(s),n&&nv(s,n),t&&(t.removeAttribute(r),n&&t.setAttribute(r,s.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}});const Jw={initialDisplay:4e3,position:[],takeFocus:!1};bb.registerComponent("TransientButton",class extends BT{constructor(e,t){super(e,t=S_(Jw,t)),this.controlText(t.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],e=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(" ")}`}createEl(){const e=iv("button",{},{type:"button",class:this.buildCSSClass()},iv("span"));return this.controlTextEl_=e.querySelector("span"),e}show(){super.show(),this.addClass("force-display"),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout(()=>{this.removeClass("force-display")},this.options_.initialDisplay)}hide(){this.removeClass("force-display"),super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout),super.dispose()}});const Zw=e=>{const t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;const i=e.$$("source"),n=[];let s="";if(!i.length)return!1;for(let e=0;e<i.length;e++){const t=i[e].src;t&&-1===n.indexOf(t)&&n.push(t)}return!!n.length&&(1===n.length&&(s=n[0]),e.triggerSourceset(s),!0)},eS=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(e){const t=lp.createElement(this.nodeName.toLowerCase());t.innerHTML=e;const i=lp.createDocumentFragment();for(;t.childNodes.length;)i.appendChild(t.childNodes[0]);return this.innerText="",Dd.Element.prototype.appendChild.call(this,i),this.innerHTML}}),tS=(e,t)=>{let i={};for(let n=0;n<e.length&&(i=Object.getOwnPropertyDescriptor(e[n],t),!(i&&i.set&&i.get));n++);return i.enumerable=!0,i.configurable=!0,i},iS=function(e){const t=e.el();if(t.resetSourceWatch_)return;const i={},n=(e=>tS([e.el(),Dd.HTMLMediaElement.prototype,Dd.Element.prototype,eS],"innerHTML"))(e),s=i=>(...n)=>{const s=i.apply(t,n);return Zw(e),s};["append","appendChild","insertAdjacentHTML"].forEach(e=>{t[e]&&(i[e]=t[e],t[e]=s(i[e]))}),Object.defineProperty(t,"innerHTML",S_(n,{set:s(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_)},nS=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?Zb(Dd.Element.prototype.getAttribute.call(this,"src")):""},set(e){return Dd.Element.prototype.setAttribute.call(this,"src",e),e}}),sS=function(e){if(!e.featuresSourceset)return;const t=e.el();if(t.resetSourceset_)return;const i=(e=>tS([e.el(),Dd.HTMLMediaElement.prototype,nS],"src"))(e),n=t.setAttribute,s=t.load;Object.defineProperty(t,"src",S_(i,{set:n=>{const s=i.set.call(t,n);return e.triggerSourceset(t.src),s}})),t.setAttribute=(i,s)=>{const r=n.call(t,i,s);return/src/i.test(i)&&e.triggerSourceset(t.src),r},t.load=()=>{const i=s.call(t);return Zw(e)||(e.triggerSourceset(""),iS(e)),i},t.currentSrc?e.triggerSourceset(t.currentSrc):Zw(e)||iS(e),t.resetSourceset_=()=>{t.resetSourceset_=null,t.load=s,t.setAttribute=n,Object.defineProperty(t,"src",i),t.resetSourceWatch_&&t.resetSourceWatch_()}};class rS extends dT{constructor(e,t){super(e,t);const i=e.source;let n=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&"VIDEO"===this.el_.tagName,i&&(this.el_.currentSrc!==i.src||e.tag&&3===e.tag.initNetworkState_)?this.setSource(i):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const e=this.el_.childNodes;let t=e.length;const i=[];for(;t--;){const s=e[t];"track"===s.nodeName.toLowerCase()&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(s),this.remoteTextTracks().addTrack(s.track),this.textTracks().addTrack(s.track),n||this.el_.hasAttribute("crossorigin")||!tT(s.src)||(n=!0)):i.push(s))}for(let e=0;e<i.length;e++)this.el_.removeChild(i[e])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&n&&m_.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_(),(W_||q_)&&!0===e.nativeControlsForTouch&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),rS.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){sS(this)}restoreMetadataTracksInIOSNativePlayer_(){const e=this.textTracks();let t;const i=()=>{t=[];for(let i=0;i<e.length;i++){const n=e[i];"metadata"===n.kind&&t.push({track:n,storedMode:n.mode})}};i(),e.addEventListener("change",i),this.on("dispose",()=>e.removeEventListener("change",i));const n=()=>{for(let e=0;e<t.length;e++){const i=t[e];"disabled"===i.track.mode&&i.track.mode!==i.storedMode&&(i.track.mode=i.storedMode)}e.removeEventListener("change",n)};this.on("webkitbeginfullscreen",()=>{e.removeEventListener("change",i),e.removeEventListener("change",n),e.addEventListener("change",n)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",i),e.addEventListener("change",i),e.removeEventListener("change",n)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const i=e.toLowerCase();this[`${i}TracksListeners_`]&&Object.keys(this[`${i}TracksListeners_`]).forEach(e=>{this.el()[`${i}Tracks`].removeEventListener(e,this[`${i}TracksListeners_`][e])}),this[`featuresNative${e}Tracks`]=!t,this[`${i}TracksListeners_`]=null,this.proxyNativeTracksForType_(i)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=uT[e],i=this.el()[t.getterName],n=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!i||!i.addEventListener)return;const s={change:t=>{const i={type:"change",target:n,currentTarget:n,srcElement:n};n.trigger(i),"text"===e&&this[cT.remoteText.getterName]().trigger(i)},addtrack(e){n.addTrack(e.track)},removetrack(e){n.removeTrack(e.track)}},r=function(){const e=[];for(let t=0;t<n.length;t++){let s=!1;for(let e=0;e<i.length;e++)if(i[e]===n[t]){s=!0;break}s||e.push(n[t])}for(;e.length;)n.removeTrack(e.shift())};this[t.getterName+"Listeners_"]=s,Object.keys(s).forEach(e=>{const t=s[e];i.addEventListener(e,t),this.on("dispose",n=>i.removeEventListener(e,t))}),this.on("loadstart",r),this.on("dispose",e=>this.off("loadstart",r))}proxyNativeTracks_(){uT.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){const t=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(t,e),rS.disposeMediaElement(e),e=t}else{e=lp.createElement("video");const t=S_({},this.options_.tag&&cv(this.options_.tag));W_&&!0===this.options_.nativeControlsForTouch||delete t.controls,uv(e,Object.assign(t,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}void 0!==this.options_.preload&&dv(e,"preload",this.options_.preload),void 0!==this.options_.disablePictureInPicture&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let i=0;i<t.length;i++){const n=t[i],s=this.options_[n];void 0!==s&&(s?dv(e,n,n):pv(e,n),e[n]=s)}return e}handleLateInit_(e){if(0===e.networkState||3===e.networkState)return;if(0===e.readyState){let e=!1;const t=function(){e=!0};this.on("loadstart",t);const i=function(){e||this.trigger("loadstart")};return this.on("loadedmetadata",i),void this.ready(function(){this.off("loadstart",t),this.off("loadedmetadata",i),e||this.trigger("loadstart")})}const t=["loadstart"];t.push("loadedmetadata"),e.readyState>=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready(function(){t.forEach(function(e){this.trigger(e)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&K_?this.el_.fastSeek(e):this.el_.currentTime=e}catch(e){m_(e,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&L_&&M_&&0===this.el_.currentTime){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)})}supportsFullScreen(){return"function"==typeof this.el_.webkitEnterFullScreen}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)Db(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}},0);else try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}}exitFullScreen(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(void 0===e)return this.el_.src;this.setSrc(e)}addSourceElement(e,t){if(!e)return m_.error("Invalid source URL."),!1;const i={src:e};t&&(i.type=t);const n=iv("source",{},i);return this.el_.appendChild(n),!0}removeSourceElement(e){if(!e)return m_.error("Source URL is required to remove the source element."),!1;const t=this.el_.querySelectorAll("source");for(const i of t)if(i.src===e)return this.el_.removeChild(i),!0;return m_.warn(`No matching source element found with src: ${e}`),!1}reset(){rS.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,i):super.addTextTrack(e,t,i)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=lp.createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){const i=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(i),i}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let i=t.length;for(;i--;)e!==t[i]&&e!==t[i].track||this.el().removeChild(t[i])}}getVideoPlaybackQuality(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();const e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),Dd.performance&&(e.creationTime=Dd.performance.now()),e}}C_(rS,"TEST_VID",function(){if(!J_())return;const e=lp.createElement("video"),t=lp.createElement("track");return t.kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e}),rS.isSupported=function(){try{rS.TEST_VID.volume=.5}catch(e){return!1}return!(!rS.TEST_VID||!rS.TEST_VID.canPlayType)},rS.canPlayType=function(e){return rS.TEST_VID.canPlayType(e)},rS.canPlaySource=function(e,t){return rS.canPlayType(e.type)},rS.canControlVolume=function(){try{const e=rS.TEST_VID.volume;rS.TEST_VID.volume=e/2+.1;const t=e!==rS.TEST_VID.volume;return t&&X_?(Dd.setTimeout(()=>{rS&&rS.prototype&&(rS.prototype.featuresVolumeControl=e!==rS.TEST_VID.volume)}),!1):t}catch(e){return!1}},rS.canMuteVolume=function(){try{const e=rS.TEST_VID.muted;return rS.TEST_VID.muted=!e,rS.TEST_VID.muted?dv(rS.TEST_VID,"muted","muted"):pv(rS.TEST_VID,"muted"),e!==rS.TEST_VID.muted}catch(e){return!1}},rS.canControlPlaybackRate=function(){if(L_&&M_&&R_<58)return!1;try{const e=rS.TEST_VID.playbackRate;return rS.TEST_VID.playbackRate=e/2+.1,e!==rS.TEST_VID.playbackRate}catch(e){return!1}},rS.canOverrideAttributes=function(){try{const e=()=>{};Object.defineProperty(lp.createElement("video"),"src",{get:e,set:e}),Object.defineProperty(lp.createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(lp.createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(lp.createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return!1}return!0},rS.supportsNativeTextTracks=function(){return K_||X_&&M_},rS.supportsNativeVideoTracks=function(){return!(!rS.TEST_VID||!rS.TEST_VID.videoTracks)},rS.supportsNativeAudioTracks=function(){return!(!rS.TEST_VID||!rS.TEST_VID.audioTracks)},rS.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]){C_(rS.prototype,e,()=>rS[t](),!0)}),rS.prototype.featuresVolumeControl=rS.canControlVolume(),rS.prototype.movingMediaElementInDOM=!X_,rS.prototype.featuresFullscreenResize=!0,rS.prototype.featuresProgressEvents=!0,rS.prototype.featuresTimeupdateEvents=!0,rS.prototype.featuresVideoFrameCallback=!(!rS.TEST_VID||!rS.TEST_VID.requestVideoFrameCallback),rS.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},rS.resetMediaElement=function(e){if(!e)return;const t=e.querySelectorAll("source");let i=t.length;for(;i--;)e.removeChild(t[i]);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(e){rS.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(e){rS.prototype["set"+yb(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(e){rS.prototype[e]=function(){return this.el_[e]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(e){rS.prototype["set"+yb(e)]=function(t){this.el_[e]=t}}),["pause","load","play"].forEach(function(e){rS.prototype[e]=function(){return this.el_[e]()}}),dT.withSourceHandlers(rS),rS.nativeSourceHandler={},rS.nativeSourceHandler.canPlayType=function(e){try{return rS.TEST_VID.canPlayType(e)}catch(e){return""}},rS.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return rS.nativeSourceHandler.canPlayType(e.type);if(e.src){const t=eT(e.src);return rS.nativeSourceHandler.canPlayType(`video/${t}`)}return""},rS.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)},rS.nativeSourceHandler.dispose=function(){},rS.registerSourceHandler(rS.nativeSourceHandler),dT.registerTech("Html5",rS);const aS=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],oS={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},lS=["tiny","xsmall","small","medium","large","xlarge","huge"],uS={};lS.forEach(e=>{const t="x"===e.charAt(0)?`x-${e.substring(1)}`:e;uS[e]=`vjs-layout-${t}`});const cS={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class hS extends bb{constructor(e,t,i){if(e.id=e.id||t.id||`vjs_video_${jv()}`,(t=Object.assign(hS.getTagSettings(e),t)).initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const i=e.closest("[lang]");i&&(t.language=i.getAttribute("lang"))}if(super(null,t,i),this.boundDocumentFullscreenChange_=e=>this.documentFullscreenChange_(e),this.boundFullWindowOnEscKey_=e=>this.fullWindowOnEscKey(e),this.boundUpdateStyleEl_=e=>this.updateStyleEl_(e),this.boundApplyInitTime_=e=>this.applyInitTime_(e),this.boundUpdateCurrentBreakpoint_=e=>this.updateCurrentBreakpoint_(e),this.boundHandleTechClick_=e=>this.handleTechClick_(e),this.boundHandleTechDoubleClick_=e=>this.handleTechDoubleClick_(e),this.boundHandleTechTouchStart_=e=>this.handleTechTouchStart_(e),this.boundHandleTechTouchMove_=e=>this.handleTechTouchMove_(e),this.boundHandleTechTouchEnd_=e=>this.handleTechTouchEnd_(e),this.boundHandleTechTap_=e=>this.handleTechTap_(e),this.boundUpdatePlayerHeightOnAudioOnlyMode_=e=>this.updatePlayerHeightOnAudioOnlyMode_(e),this.isFullscreen_=!1,this.log=g_(this.id_),this.fsApi_=c_,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={controlBarHeight:null,playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&cv(e),this.language(this.options_.language),t.languages){const e={};Object.getOwnPropertyNames(t.languages).forEach(function(i){e[i.toLowerCase()]=t.languages[i]}),this.languages_=e}else this.languages_=hS.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach(e=>{if("function"!=typeof this[e])throw new Error(`plugin "${e}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),pb(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(zv(lp,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const n=S_(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(e=>{this[e](t.plugins[e])}),t.debug&&this.debug(!0),this.options_.playerOptions=n,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const e=(new Dd.DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg">\n <defs>\n <symbol viewBox="0 0 48 48" id="vjs-icon-play">\n <path d="M16 10v28l22-14z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-pause">\n <path d="M12 38h8V10h-8v28zm16-28v28h8V10h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-audio">\n <path d="M24 2C14.06 2 6 10.06 6 20v14c0 3.31 2.69 6 6 6h6V24h-8v-4c0-7.73 6.27-14 14-14s14 6.27 14 14v4h-8v16h6c3.31 0 6-2.69 6-6V20c0-9.94-8.06-18-18-18z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-captions">\n <path d="M38 8H10c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM22 22h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2zm14 0h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-subtitles">\n <path d="M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-enter">\n <path d="M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-exit">\n <path d="M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-play-circle">\n <path d="M20 33l12-9-12-9v18zm4-29C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-mute">\n <path d="M33 24c0-3.53-2.04-6.58-5-8.05v4.42l4.91 4.91c.06-.42.09-.85.09-1.28zm5 0c0 1.88-.41 3.65-1.08 5.28l3.03 3.03C41.25 29.82 42 27 42 24c0-8.56-5.99-15.72-14-17.54v4.13c5.78 1.72 10 7.07 10 13.41zM8.55 6L6 8.55 15.45 18H6v12h8l10 10V26.55l8.51 8.51c-1.34 1.03-2.85 1.86-4.51 2.36v4.13a17.94 17.94 0 0 0 7.37-3.62L39.45 42 42 39.45l-18-18L8.55 6zM24 8l-4.18 4.18L24 16.36V8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-low">\n <path d="M14 18v12h8l10 10V8L22 18h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-medium">\n <path d="M37 24c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zm-27-6v12h8l10 10V8L18 18h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-high">\n <path d="M6 18v12h8l10 10V8L14 18H6zm27 6c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zM28 6.46v4.13c5.78 1.72 10 7.07 10 13.41s-4.22 11.69-10 13.41v4.13c8.01-1.82 14-8.97 14-17.54S36.01 8.28 28 6.46z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-spinner">\n <path d="M18.8 21l9.53-16.51C26.94 4.18 25.49 4 24 4c-4.8 0-9.19 1.69-12.64 4.51l7.33 12.69.11-.2zm24.28-3c-1.84-5.85-6.3-10.52-11.99-12.68L23.77 18h19.31zm.52 2H28.62l.58 1 9.53 16.5C41.99 33.94 44 29.21 44 24c0-1.37-.14-2.71-.4-4zm-26.53 4l-7.8-13.5C6.01 14.06 4 18.79 4 24c0 1.37.14 2.71.4 4h14.98l-2.31-4zM4.92 30c1.84 5.85 6.3 10.52 11.99 12.68L24.23 30H4.92zm22.54 0l-7.8 13.51c1.4.31 2.85.49 4.34.49 4.8 0 9.19-1.69 12.64-4.51L29.31 26.8 27.46 30z"></path>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-hd">\n <path d="M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 12H9.5v-2h-2v2H6V9h1.5v2.5h2V9H11v6zm2-6h4c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1h-4V9zm1.5 4.5h2v-3h-2v3z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-chapters">\n <path d="M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z"></path>\n </symbol>\n <symbol viewBox="0 0 40 40" id="vjs-icon-downloading">\n <path d="M18.208 36.875q-3.208-.292-5.979-1.729-2.771-1.438-4.812-3.729-2.042-2.292-3.188-5.229-1.146-2.938-1.146-6.23 0-6.583 4.334-11.416 4.333-4.834 10.833-5.5v3.166q-5.167.75-8.583 4.646Q6.25 14.75 6.25 19.958q0 5.209 3.396 9.104 3.396 3.896 8.562 4.646zM20 28.417L11.542 20l2.083-2.083 4.917 4.916v-11.25h2.916v11.25l4.875-4.916L28.417 20zm1.792 8.458v-3.167q1.833-.25 3.541-.958 1.709-.708 3.167-1.875l2.333 2.292q-1.958 1.583-4.25 2.541-2.291.959-4.791 1.167zm6.791-27.792q-1.541-1.125-3.25-1.854-1.708-.729-3.541-1.021V3.042q2.5.25 4.77 1.208 2.271.958 4.271 2.5zm4.584 21.584l-2.25-2.25q1.166-1.5 1.854-3.209.687-1.708.937-3.541h3.209q-.292 2.5-1.229 4.791-.938 2.292-2.521 4.209zm.541-12.417q-.291-1.833-.958-3.562-.667-1.73-1.833-3.188l2.375-2.208q1.541 1.916 2.458 4.208.917 2.292 1.167 4.75z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download">\n <path d="M10.8 40.55q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h26.35v-7.7h3.4v7.7q0 1.4-1 2.4t-2.4 1zM24 32.1L13.9 22.05l2.45-2.45 5.95 5.95V7.15h3.4v18.4l5.95-5.95 2.45 2.45z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-done">\n <path d="M9.8 40.5v-3.45h28.4v3.45zm9.2-9.05L7.4 19.85l2.45-2.35L19 26.65l19.2-19.2 2.4 2.4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-off">\n <path d="M4.9 4.75L43.25 43.1 41 45.3l-4.75-4.75q-.05.05-.075.025-.025-.025-.075-.025H10.8q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h22.05l-7-7-1.85 1.8L13.9 21.9l1.85-1.85L2.7 7zm26.75 14.7l2.45 2.45-3.75 3.8-2.45-2.5zM25.7 7.15V21.1l-3.4-3.45V7.15z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-share">\n <path d="M36 32.17c-1.52 0-2.89.59-3.93 1.54L17.82 25.4c.11-.45.18-.92.18-1.4s-.07-.95-.18-1.4l14.1-8.23c1.07 1 2.5 1.62 4.08 1.62 3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6c0 .48.07.95.18 1.4l-14.1 8.23c-1.07-1-2.5-1.62-4.08-1.62-3.31 0-6 2.69-6 6s2.69 6 6 6c1.58 0 3.01-.62 4.08-1.62l14.25 8.31c-.1.42-.16.86-.16 1.31A5.83 5.83 0 1 0 36 32.17z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cog">\n <path d="M38.86 25.95c.08-.64.14-1.29.14-1.95s-.06-1.31-.14-1.95l4.23-3.31c.38-.3.49-.84.24-1.28l-4-6.93c-.25-.43-.77-.61-1.22-.43l-4.98 2.01c-1.03-.79-2.16-1.46-3.38-1.97L29 4.84c-.09-.47-.5-.84-1-.84h-8c-.5 0-.91.37-.99.84l-.75 5.3a14.8 14.8 0 0 0-3.38 1.97L9.9 10.1a1 1 0 0 0-1.22.43l-4 6.93c-.25.43-.14.97.24 1.28l4.22 3.31C9.06 22.69 9 23.34 9 24s.06 1.31.14 1.95l-4.22 3.31c-.38.3-.49.84-.24 1.28l4 6.93c.25.43.77.61 1.22.43l4.98-2.01c1.03.79 2.16 1.46 3.38 1.97l.75 5.3c.08.47.49.84.99.84h8c.5 0 .91-.37.99-.84l.75-5.3a14.8 14.8 0 0 0 3.38-1.97l4.98 2.01a1 1 0 0 0 1.22-.43l4-6.93c.25-.43.14-.97-.24-1.28l-4.22-3.31zM24 31c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-square">\n <path d="M36 8H12c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h24c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zm0 28H12V12h24v24z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle">\n <circle cx="24" cy="24" r="20"></circle>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle-outline">\n <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle-inner-circle">\n <path d="M24 4C12.97 4 4 12.97 4 24s8.97 20 20 20 20-8.97 20-20S35.03 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16zm6-16c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6 6 2.69 6 6z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cancel">\n <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm10 27.17L31.17 34 24 26.83 16.83 34 14 31.17 21.17 24 14 16.83 16.83 14 24 21.17 31.17 14 34 16.83 26.83 24 34 31.17z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-replay">\n <path d="M24 10V2L14 12l10 10v-8c6.63 0 12 5.37 12 12s-5.37 12-12 12-12-5.37-12-12H8c0 8.84 7.16 16 16 16s16-7.16 16-16-7.16-16-16-16z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-repeat">\n <path d="M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-5">\n <path d="M17.689 98l-8.697 8.696 8.697 8.697 2.486-2.485-4.32-4.319h1.302c4.93 0 9.071 1.722 12.424 5.165 3.352 3.443 5.029 7.638 5.029 12.584h3.55c0-2.958-.553-5.73-1.658-8.313-1.104-2.583-2.622-4.841-4.555-6.774-1.932-1.932-4.19-3.45-6.773-4.555-2.584-1.104-5.355-1.657-8.313-1.657H15.5l4.615-4.615zm-8.08 21.659v13.861h11.357v5.008H9.609V143h12.7c.834 0 1.55-.298 2.146-.894.596-.597.895-1.31.895-2.145v-7.781c0-.835-.299-1.55-.895-2.147a2.929 2.929 0 0 0-2.147-.894h-8.227v-5.096H25.35v-4.384z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-10">\n <path d="M42.315 125.63c0-4.997-1.694-9.235-5.08-12.713-3.388-3.479-7.571-5.218-12.552-5.218h-1.315l4.363 4.363-2.51 2.51-8.787-8.786L25.221 97l2.45 2.45-4.662 4.663h1.375c2.988 0 5.788.557 8.397 1.673 2.61 1.116 4.892 2.65 6.844 4.602 1.953 1.953 3.487 4.234 4.602 6.844 1.116 2.61 1.674 5.41 1.674 8.398zM8.183 142v-19.657H3.176V117.8h9.643V142zm13.63 0c-1.156 0-2.127-.393-2.912-1.178-.778-.778-1.168-1.746-1.168-2.902v-16.04c0-1.156.393-2.127 1.178-2.912.779-.779 1.746-1.168 2.902-1.168h7.696c1.156 0 2.126.392 2.911 1.177.779.78 1.168 1.747 1.168 2.903v16.04c0 1.156-.392 2.127-1.177 2.912-.779.779-1.746 1.168-2.902 1.168zm.556-4.636h6.583v-15.02H22.37z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-30">\n <path d="M26.047 97l-8.733 8.732 8.733 8.733 2.496-2.494-4.336-4.338h1.307c4.95 0 9.108 1.73 12.474 5.187 3.367 3.458 5.051 7.668 5.051 12.635h3.565c0-2.97-.556-5.751-1.665-8.346-1.109-2.594-2.633-4.862-4.574-6.802-1.94-1.941-4.208-3.466-6.803-4.575-2.594-1.109-5.375-1.664-8.345-1.664H23.85l4.634-4.634zM2.555 117.531v4.688h10.297v5.25H5.873v4.687h6.979v5.156H2.555V142H13.36c1.061 0 1.95-.395 2.668-1.186.718-.79 1.076-1.772 1.076-2.94v-16.218c0-1.168-.358-2.149-1.076-2.94-.717-.79-1.607-1.185-2.668-1.185zm22.482.14c-1.149 0-2.11.39-2.885 1.165-.78.78-1.172 1.744-1.172 2.893v15.943c0 1.149.388 2.11 1.163 2.885.78.78 1.745 1.172 2.894 1.172h7.649c1.148 0 2.11-.388 2.884-1.163.78-.78 1.17-1.745 1.17-2.894v-15.943c0-1.15-.386-2.111-1.16-2.885-.78-.78-1.746-1.172-2.894-1.172zm.553 4.518h6.545v14.93H25.59z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-5">\n <path d="M29.508 97l-2.431 2.43 4.625 4.625h-1.364c-2.965 0-5.742.554-8.332 1.66-2.589 1.107-4.851 2.629-6.788 4.566-1.937 1.937-3.458 4.2-4.565 6.788-1.107 2.59-1.66 5.367-1.66 8.331h3.557c0-4.957 1.68-9.16 5.04-12.611 3.36-3.45 7.51-5.177 12.451-5.177h1.304l-4.326 4.33 2.49 2.49 8.715-8.716zm-9.783 21.61v13.89h11.382v5.018H19.725V142h12.727a2.93 2.93 0 0 0 2.15-.896 2.93 2.93 0 0 0 .896-2.15v-7.798c0-.837-.299-1.554-.896-2.152a2.93 2.93 0 0 0-2.15-.896h-8.245V123h11.29v-4.392z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-10">\n <path d="M23.119 97l-2.386 2.383 4.538 4.538h-1.339c-2.908 0-5.633.543-8.173 1.63-2.54 1.085-4.76 2.577-6.66 4.478-1.9 1.9-3.392 4.12-4.478 6.66-1.085 2.54-1.629 5.264-1.629 8.172h3.49c0-4.863 1.648-8.986 4.944-12.372 3.297-3.385 7.368-5.078 12.216-5.078h1.279l-4.245 4.247 2.443 2.442 8.55-8.55zm-9.52 21.45v4.42h4.871V142h4.513v-23.55zm18.136 0c-1.125 0-2.066.377-2.824 1.135-.764.764-1.148 1.709-1.148 2.834v15.612c0 1.124.38 2.066 1.139 2.824.764.764 1.708 1.145 2.833 1.145h7.489c1.125 0 2.066-.378 2.824-1.136.764-.764 1.145-1.709 1.145-2.833v-15.612c0-1.125-.378-2.067-1.136-2.825-.764-.764-1.708-1.145-2.833-1.145zm.54 4.42h6.408v14.617h-6.407z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-30">\n <path d="M25.549 97l-2.437 2.434 4.634 4.635H26.38c-2.97 0-5.753.555-8.347 1.664-2.594 1.109-4.861 2.633-6.802 4.574-1.94 1.94-3.465 4.207-4.574 6.802-1.109 2.594-1.664 5.377-1.664 8.347h3.565c0-4.967 1.683-9.178 5.05-12.636 3.366-3.458 7.525-5.187 12.475-5.187h1.307l-4.335 4.338 2.495 2.494 8.732-8.732zm-11.553 20.53v4.689h10.297v5.249h-6.978v4.688h6.978v5.156H13.996V142h10.808c1.06 0 1.948-.395 2.666-1.186.718-.79 1.077-1.771 1.077-2.94v-16.217c0-1.169-.36-2.15-1.077-2.94-.718-.79-1.605-1.186-2.666-1.186zm21.174.168c-1.149 0-2.11.389-2.884 1.163-.78.78-1.172 1.745-1.172 2.894v15.942c0 1.15.388 2.11 1.162 2.885.78.78 1.745 1.17 2.894 1.17h7.649c1.149 0 2.11-.386 2.885-1.16.78-.78 1.17-1.746 1.17-2.895v-15.942c0-1.15-.387-2.11-1.161-2.885-.78-.78-1.745-1.172-2.894-1.172zm.552 4.516h6.542v14.931h-6.542z"></path>\n </symbol>\n <symbol viewBox="0 0 512 512" id="vjs-icon-audio-description">\n <g fill-rule="evenodd"><path d="M227.29 381.351V162.993c50.38-1.017 89.108-3.028 117.631 17.126 27.374 19.342 48.734 56.965 44.89 105.325-4.067 51.155-41.335 94.139-89.776 98.475-24.085 2.155-71.972 0-71.972 0s-.84-1.352-.773-2.568m48.755-54.804c31.43 1.26 53.208-16.633 56.495-45.386 4.403-38.51-21.188-63.552-58.041-60.796v103.612c-.036 1.466.575 2.22 1.546 2.57"></path><path d="M383.78 381.328c13.336 3.71 17.387-11.06 23.215-21.408 12.722-22.571 22.294-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.226 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M425.154 381.328c13.336 3.71 17.384-11.061 23.215-21.408 12.721-22.571 22.291-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.511c-.586 3.874 2.226 7.315 3.866 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M466.26 381.328c13.337 3.71 17.385-11.061 23.216-21.408 12.722-22.571 22.292-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.225 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894M4.477 383.005H72.58l18.573-28.484 64.169-.135s.065 19.413.065 28.62h48.756V160.307h-58.816c-5.653 9.537-140.85 222.697-140.85 222.697zm152.667-145.282v71.158l-40.453-.27 40.453-70.888z"></path></g>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-next-item">\n <path d="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-previous-item">\n <path d="M12 12h4v24h-4zm7 12l17 12V12z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-shuffle">\n <path d="M21.17 18.34L10.83 8 8 10.83l10.34 10.34 2.83-2.83zM29 8l4.09 4.09L8 37.17 10.83 40l25.09-25.09L40 19V8H29zm.66 18.83l-2.83 2.83 6.26 6.26L29 40h11V29l-4.09 4.09-6.25-6.26z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cast">\n <path d="M42 6H6c-2.21 0-4 1.79-4 4v6h4v-6h36v28H28v4h14c2.21 0 4-1.79 4-4V10c0-2.21-1.79-4-4-4zM2 36v6h6c0-3.31-2.69-6-6-6zm0-8v4c5.52 0 10 4.48 10 10h4c0-7.73-6.27-14-14-14zm0-8v4c9.94 0 18 8.06 18 18h4c0-12.15-9.85-22-22-22z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-picture-in-picture-enter">\n <path d="M38 22H22v11.99h16V22zm8 16V9.96C46 7.76 44.2 6 42 6H6C3.8 6 2 7.76 2 9.96V38c0 2.2 1.8 4 4 4h36c2.2 0 4-1.8 4-4zm-4 .04H6V9.94h36v28.1z"></path>\n </symbol>\n <symbol viewBox="0 0 22 18" id="vjs-icon-picture-in-picture-exit">\n <path d="M18 4H4v10h14V4zm4 12V1.98C22 .88 21.1 0 20 0H2C.9 0 0 .88 0 1.98V16c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H2V1.97h18v14.05z"></path>\n <path fill="none" d="M-1-3h24v24H-1z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-facebook">\n <path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-linkedin">\n <path d="M477 625v991H147V625h330zm21-306q1 73-50.5 122T312 490h-2q-82 0-132-49t-50-122q0-74 51.5-122.5T314 148t133 48.5T498 319zm1166 729v568h-329v-530q0-105-40.5-164.5T1168 862q-63 0-105.5 34.5T999 982q-11 30-11 81v553H659q2-399 2-647t-1-296l-1-48h329v144h-2q20-32 41-56t56.5-52 87-43.5T1285 602q171 0 275 113.5t104 332.5z"></path>\n </symbol>\n <symbol viewBox="0 0 1200 1227" id="vjs-icon-twitter">\n <path d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z"/>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-tumblr">\n <path d="M1328 1329l80 237q-23 35-111 66t-177 32q-104 2-190.5-26T787 1564t-95-106-55.5-120-16.5-118V676H452V461q72-26 129-69.5t91-90 58-102 34-99T779 12q1-5 4.5-8.5T791 0h244v424h333v252h-334v518q0 30 6.5 56t22.5 52.5 49.5 41.5 81.5 14q78-2 134-29z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-pinterest">\n <path d="M1664 896q0 209-103 385.5T1281.5 1561 896 1664q-111 0-218-32 59-93 78-164 9-34 54-211 20 39 73 67.5t114 28.5q121 0 216-68.5t147-188.5 52-270q0-114-59.5-214T1180 449t-255-63q-105 0-196 29t-154.5 77-109 110.5-67 129.5T377 866q0 104 40 183t117 111q30 12 38-20 2-7 8-31t8-30q6-23-11-43-51-61-51-151 0-151 104.5-259.5T904 517q151 0 235.5 82t84.5 213q0 170-68.5 289T980 1220q-61 0-98-43.5T859 1072q8-35 26.5-93.5t30-103T927 800q0-50-27-83t-77-33q-62 0-105 57t-43 142q0 73 25 122l-99 418q-17 70-13 177-206-91-333-281T128 896q0-209 103-385.5T510.5 231 896 128t385.5 103T1561 510.5 1664 896z"></path>\n </symbol>\n </defs>\n</svg>',"image/svg+xml");if(e.querySelector("parsererror"))m_.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const t=e.documentElement;t.style.display="none",this.el_.appendChild(t),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio("audio"===e.nodeName.toLowerCase()),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),t.spatialNavigation&&t.spatialNavigation.enabled&&(this.spatialNavigation=new AT(this),this.addClass("vjs-spatial-navigation-enabled")),W_&&this.addClass("vjs-touch-enabled"),X_||this.addClass("vjs-workinghover"),hS.players[this.id_]=this;const s=a_.split(".")[0];this.addClass(`vjs-v${s}`),this.userActive(!0),this.reportUserActivity(),this.one("play",e=>this.listenForUserActivity_(e)),this.on("keydown",e=>this.handleKeyDown(e)),this.on("languagechange",e=>this.handleLanguagechange(e)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){var e;this.trigger("dispose"),this.off("dispose"),Wv(lp,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Wv(lp,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),hS.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),e=this,fT.hasOwnProperty(e.id())&&delete fT[e.id()],hT.names.forEach(e=>{const t=this[hT[e].getterName]();t&&t.off&&t.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e,t=this.tag,i=this.playerElIngest_=t.parentNode&&t.parentNode.hasAttribute&&t.parentNode.hasAttribute("data-vjs-player");const n="video-js"===this.tag.tagName.toLowerCase();i?e=this.el_=t.parentNode:n||(e=this.el_=super.createEl("div"));const s=cv(t);if(n){for(e=this.el_=t,t=this.tag=lp.createElement("video");e.children.length;)t.appendChild(e.firstChild);rv(e,"video-js")||av(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"),s.tabindex="-1",M_&&j_&&(t.setAttribute("role","application"),s.role="application"),t.removeAttribute("width"),t.removeAttribute("height"),"width"in s&&delete s.width,"height"in s&&delete s.height,Object.getOwnPropertyNames(s).forEach(function(i){n&&"class"===i||e.setAttribute(i,s[i]),n&&t.setAttribute(i,s[i])}),t.playerId=t.id,t.id+="_html5_api",t.className="vjs-tech",t.player=e.player=this,this.addClass("vjs-paused");const r=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter(e=>Y_[e]).map(e=>"vjs-device-"+e.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...r),!0!==Dd.VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=Nv("vjs-styles-dimensions");const e=Cv(".vjs-styles-defaults"),t=Cv("head");t.insertBefore(this.styleEl_,e?e.nextSibling:t.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const a=t.getElementsByTagName("a");for(let e=0;e<a.length;e++){const t=a.item(e);av(t,"vjs-hidden"),t.setAttribute("hidden","hidden")}return t.initNetworkState_=t.networkState,t.parentNode&&!i&&t.parentNode.insertBefore(e,t),sv(t,e),this.children_.unshift(t),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=e,e}crossOrigin(e){if(void 0===e)return this.techGet_("crossOrigin");null===e||"anonymous"===e||"use-credentials"===e?(this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e)):m_.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`)}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,t){const i=e+"_";if(void 0===t)return this[i]||0;if(""===t||"auto"===t)return this[i]=void 0,void this.updateStyleEl_();const n=parseFloat(t);isNaN(n)?m_.error(`Improper value "${t}" supplied for for ${e}`):(this[i]=n,this.updateStyleEl_())}fluid(e){if(void 0===e)return!!this.fluid_;var t,i;this.fluid_=!!e,rb(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),i=()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)},rb(t=this)?i():(t.eventedCallbacks||(t.eventedCallbacks=[]),t.eventedCallbacks.push(i))):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(void 0===e)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(!0===Dd.VIDEOJS_NO_DYNAMIC_STYLE){const e="number"==typeof this.width_?this.width_:this.options_.width,t="number"==typeof this.height_?this.height_:this.options_.height,i=this.tech_&&this.tech_.el();return void(i&&(e>=0&&(i.width=e),t>=0&&(i.height=t)))}let e,t,i,n;i=void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9";const s=i.split(":"),r=s[1]/s[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/r:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*r,n=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(n),Rv(this.styleEl_,`\n .${n} {\n width: ${e}px;\n height: ${t}px;\n }\n\n .${n}.vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: ${100*r}%;\n }\n `)}loadTech_(e,t){this.tech_&&this.unloadTech_();const i=yb(e),n=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==i&&this.tag&&(dT.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=i,this.isReady_=!1;let s=this.autoplay();("string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(s=!1);const r={source:t,autoplay:s,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${n}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};hT.names.forEach(e=>{const t=hT[e];r[t.getterName]=this[t.privateName]}),Object.assign(r,this.options_[i]),Object.assign(r,this.options_[n]),Object.assign(r,this.options_[e.toLowerCase()]),this.tag&&(r.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(r.startTime=this.cache_.currentTime);const a=dT.getTech(e);if(!a)throw new Error(`No Tech named '${i}' exists! '${i}' should be registered using videojs.registerTech()'`);this.tech_=new a(r),this.tech_.ready(Jv(this,this.handleTechReady_),!0),Rb(this.textTracksJson_||[],this.tech_),aS.forEach(e=>{this.on(this.tech_,e,t=>this[`handleTech${yb(e)}_`](t))}),Object.keys(oS).forEach(e=>{this.on(this.tech_,e,t=>{0===this.tech_.playbackRate()&&this.tech_.seeking()?this.queuedCallbacks_.push({callback:this[`handleTech${oS[e]}_`].bind(this),event:t}):this[`handleTech${oS[e]}_`](t)})}),this.on(this.tech_,"loadstart",e=>this.handleTechLoadStart_(e)),this.on(this.tech_,"sourceset",e=>this.handleTechSourceset_(e)),this.on(this.tech_,"waiting",e=>this.handleTechWaiting_(e)),this.on(this.tech_,"ended",e=>this.handleTechEnded_(e)),this.on(this.tech_,"seeking",e=>this.handleTechSeeking_(e)),this.on(this.tech_,"play",e=>this.handleTechPlay_(e)),this.on(this.tech_,"pause",e=>this.handleTechPause_(e)),this.on(this.tech_,"durationchange",e=>this.handleTechDurationChange_(e)),this.on(this.tech_,"fullscreenchange",(e,t)=>this.handleTechFullscreenChange_(e,t)),this.on(this.tech_,"fullscreenerror",(e,t)=>this.handleTechFullscreenError_(e,t)),this.on(this.tech_,"enterpictureinpicture",e=>this.handleTechEnterPictureInPicture_(e)),this.on(this.tech_,"leavepictureinpicture",e=>this.handleTechLeavePictureInPicture_(e)),this.on(this.tech_,"error",e=>this.handleTechError_(e)),this.on(this.tech_,"posterchange",e=>this.handleTechPosterChange_(e)),this.on(this.tech_,"textdata",e=>this.handleTechTextData_(e)),this.on(this.tech_,"ratechange",e=>this.handleTechRateChange_(e)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===i&&this.tag||sv(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){hT.names.forEach(e=>{const t=hT[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=Nb(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&&m_.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_}version(){return{"video.js":a_}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||"string"!=typeof e)return;const t=()=>{const e=this.muted();this.muted(!0);const t=()=>{this.muted(e)};this.playTerminatedQueue_.push(t);const i=this.play();if(Ob(i))return i.catch(e=>{throw t(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${e||""}`)})};let i;return"any"!==e||this.muted()?i="muted"!==e||this.muted()?this.play():t():(i=this.play(),Ob(i)&&(i=i.catch(t))),Ob(i)?i.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})}):void 0}updateSourceCaches_(e=""){let t=e,i="";"string"!=typeof t&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=((e,t)=>{if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;const i=e.cache_.sources.filter(e=>e.src===t);if(i.length)return i[0].type;const n=e.$$("source");for(let e=0;e<n.length;e++){const i=n[e];if(i.type&&i.src&&i.src===t)return i.type}return ET(t)})(this,t)),this.cache_.source=S_({},e,{src:t,type:i});const n=this.cache_.sources.filter(e=>e.src&&e.src===t),s=[],r=this.$$("source"),a=[];for(let e=0;e<r.length;e++){const i=cv(r[e]);s.push(i),i.src&&i.src===t&&a.push(i.src)}a.length&&!n.length?this.cache_.sources=s:n.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let t=e=>this.updateSourceCaches_(e);const i=this.currentSource().src,n=e.src;i&&!/^blob:/.test(i)&&/^blob:/.test(n)&&(!this.lastSource_||this.lastSource_.tech!==n&&this.lastSource_.player!==i)&&(t=()=>{}),t(n),e.src||this.tech_.any(["sourceset","loadstart"],e=>{if("sourceset"===e.type)return;const t=this.techGet_("currentSrc");this.lastSource_.tech=t,this.updateSourceCaches_(t)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(void 0===e)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}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()?Db(this.play()):this.pause()))}handleTechDoubleClick_(e){if(!this.controls_)return;Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),t=>t.contains(e.target))||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isInPictureInPicture()&&!lp.pictureInPictureElement?this.exitPictureInPicture():this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this)return;const i=this.el();let n=lp[this.fsApi_.fullscreenElement]===i;!n&&i.matches&&(n=i.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(n)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in vT)return function(e,t,i,n){return t[i](e.reduce(TT(i),n))}(this.middleware_,this.tech_,e,t);if(e in bT)return yT(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(e){throw m_(e),e}},!0)}techGet_(e){if(this.tech_&&this.tech_.isReady_){if(e in _T)return function(e,t,i){return e.reduceRight(TT(i),t[i]())}(this.middleware_,this.tech_,e);if(e in bT)return yT(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw m_(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t;if("TypeError"===t.name)throw m_(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t;throw m_(t),t}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=Db){this.playCallbacks_.push(e);const t=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc())),i=Boolean(K_||X_);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t)return this.waitToPlay_=e=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(!t&&i&&this.load());const n=this.techGet_("play");i&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),null===n?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(n)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(e){e()})}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(t){t(e)})}pause(){this.techCall_("pause")}paused(){return!1!==this.techGet_("paused")}played(){return this.techGet_("played")||Sb(0,0)}scrubbing(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){return void 0===e?(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime):(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),this.cache_.initTime=0,void(isFinite(e)&&(this.cache_.currentTime=Number(e)))):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_)))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return e&&e.length||(e=Sb(0,0)),e}seekable(){let e=this.techGet_("seekable");return e&&e.length||(e=Sb(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return Lb(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let i=e.end(e.length-1);return i>t&&(i=t),i}volume(e){let t;return void 0!==e?(t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)}muted(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)}defaultMuted(e){return void 0!==e&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(void 0!==e){const t=this.isFullscreen_;return this.isFullscreen_=Boolean(e),this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise((i,n)=>{function s(){t.off("fullscreenerror",a),t.off("fullscreenchange",r)}function r(){s(),i()}function a(e,t){s(),n(t)}t.one("fullscreenchange",r),t.one("fullscreenerror",a);const o=t.requestFullscreenHelper_(e);o&&(o.then(s,s),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){const e=this.el_[this.fsApi_.requestFullscreen](t);return e&&e.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),e}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise((t,i)=>{function n(){e.off("fullscreenerror",r),e.off("fullscreenchange",s)}function s(){n(),t()}function r(e,t){n(),i(t)}e.one("fullscreenchange",s),e.one("fullscreenerror",r);const a=e.exitFullscreenHelper_();a&&(a.then(n,n),a.then(t,i))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=lp[this.fsApi_.exitFullscreen]();return e&&Db(e.then(()=>this.isFullscreen(!1))),e}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=lp.documentElement.style.overflow,zv(lp,"keydown",this.boundFullWindowOnEscKey_),lp.documentElement.style.overflow="hidden",av(lp.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){"Escape"===e.key&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,Wv(lp,"keydown",this.boundFullWindowOnEscKey_),lp.documentElement.style.overflow=this.docOrigOverflow,ov(lp.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){return void 0!==e?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&Dd.documentPictureInPicture){const e=lp.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(iv("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),Dd.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(Iv(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:t}),t.addEventListener("pagehide",t=>{const i=t.target.querySelector(".video-js");e.parentNode.replaceChild(i,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in lp&&!1===this.disablePictureInPicture()?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){return Dd.documentPictureInPicture&&Dd.documentPictureInPicture.window?(Dd.documentPictureInPicture.window.close(),Promise.resolve()):"pictureInPictureEnabled"in lp?lp.exitPictureInPicture():void 0}handleKeyDown(e){const{userActions:t}=this.options_;if(!t||!t.hotkeys)return;(e=>{const t=e.tagName.toLowerCase();if(e.isContentEditable)return!0;if("input"===t)return-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(e.type);return-1!==["textarea"].indexOf(t)})(this.el_.ownerDocument.activeElement)||("function"==typeof t.hotkeys?t.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:i=t=>"f"===e.key.toLowerCase(),muteKey:n=t=>"m"===e.key.toLowerCase(),playPauseKey:s=t=>"k"===e.key.toLowerCase()||" "===e.key.toLowerCase()}=t;if(i.call(this,e)){e.preventDefault(),e.stopPropagation();const t=bb.getComponent("FullscreenToggle");!1!==lp[this.fsApi_.fullscreenEnabled]&&t.prototype.handleClick.call(this,e)}else if(n.call(this,e)){e.preventDefault(),e.stopPropagation();bb.getComponent("MuteToggle").prototype.handleClick.call(this,e)}else if(s.call(this,e)){e.preventDefault(),e.stopPropagation();bb.getComponent("PlayToggle").prototype.handleClick.call(this,e)}}canPlayType(e){let t;for(let i=0,n=this.options_.techOrder;i<n.length;i++){const s=n[i];let r=dT.getTech(s);if(r||(r=bb.getComponent(s)),r){if(r.isSupported()&&(t=r.canPlayType(e),t))return t}else m_.error(`The "${s}" tech is undefined. Skipped browser support check for that tech.`)}return""}selectSource(e){const t=this.options_.techOrder.map(e=>[e,dT.getTech(e)]).filter(([e,t])=>t?t.isSupported():(m_.error(`The "${e}" tech is undefined. Skipped browser support check for that tech.`),!1)),i=function(e,t,i){let n;return e.some(e=>t.some(t=>{if(n=i(e,t),n)return!0})),n};let n;const s=([e,t],i)=>{if(t.canPlaySource(i,this.options_[e.toLowerCase()]))return{source:i,tech:e}};var r;return n=this.options_.sourceOrder?i(e,t,(r=s,(e,t)=>r(t,e))):i(t,e,s),n||!1}handleSrc_(e,t){if(void 0===e)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const i=CT(e);if(i.length){if(this.changingSrc_=!0,t||(this.cache_.sources=i),this.updateSourceCaches_(i[0]),gT(this,i[0],(e,n)=>{this.middleware_=n,t||(this.cache_.sources=i),this.updateSourceCaches_(e);if(this.src_(e))return i.length>1?this.handleSrc_(i.slice(1)):(this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),void this.triggerReady());var s,r;s=n,r=this.tech_,s.forEach(e=>e.setTech&&e.setTech(r))}),i.length>1){const e=()=>{this.error(null),this.handleSrc_(i.slice(1),!0)},t=()=>{this.off("error",e)};this.one("error",e),this.one("playing",t),this.resetRetryOnError_=()=>{this.off("error",e),this.off("playing",t)}}}else this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0)}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return!t||(_b(t.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1))}addSourceElement(e,t){return!!this.tech_&&this.tech_.addSourceElement(e,t)}removeSourceElement(e){return!!this.tech_&&this.tech_.removeSourceElement(e)}load(){this.tech_&&this.tech_.vhs?this.src(this.currentSource()):this.techCall_("load")}reset(){if(this.paused())this.doReset_();else{Db(this.play().then(()=>this.doReset_()))}}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),rb(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:i,remainingTimeDisplay:n}=this.controlBar||{},{seekBar:s}=i||{};e&&e.updateContent(),t&&t.updateContent(),n&&n.updateContent(),s&&(s.update(),s.loadProgressBar&&s.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")}autoplay(e){if(void 0===e)return this.options_.autoplay||!1;let t;"string"==typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"==typeof e?e:"play"),t=!1):this.options_.autoplay=!!e,t=void 0===t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return void 0!==e&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")}poster(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(void 0===e)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(void 0===e)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(void 0===e)return this.error_||null;if(l_("beforeerror").forEach(t=>{const i=t(this,e);T_(i)&&!Array.isArray(i)||"string"==typeof i||"number"==typeof i||null===i?e=i:this.log.error("please return a value that MediaError expects in beforeerror hooks")}),this.options_.suppressNotSupportedError&&e&&4===e.code){const t=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),void this.one("loadstart",function(){this.off(["click","touchstart"],t)})}if(null===e)return this.error_=null,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new Pb(e),this.addClass("vjs-error"),m_.error(`(CODE:${this.error_.code} ${Pb.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),l_("error").forEach(e=>e(this,this.error_))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",function(e){e.stopPropagation(),e.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,i;const n=Jv(this,this.reportUserActivity),s=function(t){n(),this.clearInterval(e)};this.on("mousedown",function(){n(),this.clearInterval(e),e=this.setInterval(n,250)}),this.on("mousemove",function(e){e.screenX===t&&e.screenY===i||(t=e.screenX,i=e.screenY,n())}),this.on("mouseup",s),this.on("mouseleave",s);const r=this.getChild("controlBar");let a;!r||X_||L_||(r.on("mouseenter",function(e){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),r.on("mouseleave",function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",n),this.on("keyup",n);this.setInterval(function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(a);const e=this.options_.inactivityTimeout;e<=0||(a=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},e))},250)}playbackRate(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)}defaultPlaybackRate(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e}updatePlayerHeightOnAudioOnlyMode_(){const e=this.getChild("ControlBar");e&&this.audioOnlyCache_.controlBarHeight!==e.currentHeight()&&(this.audioOnlyCache_.controlBarHeight=e.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),i=t&&t.currentHeight();e.forEach(e=>{e!==t&&e.el_&&!e.hasClass("vjs-hidden")&&(e.hide(),this.audioOnlyCache_.hiddenChildren.push(e))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=i,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(i),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.off("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if("boolean"!=typeof e||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const e=[];return this.isInPictureInPicture()&&e.push(this.exitPictureInPicture()),this.isFullscreen()&&e.push(this.exitFullscreen()),this.audioPosterMode()&&e.push(this.audioPosterMode(!1)),Promise.all(e).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){if("boolean"!=typeof e||e===this.audioPosterMode_)return this.audioPosterMode_;if(this.audioPosterMode_=e,e){if(this.audioOnlyMode()){return this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()})}return Promise.resolve().then(()=>{this.enablePosterModeUI_()})}return Promise.resolve().then(()=>{this.disablePosterModeUI_()})}addTextTrack(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),rb(this)&&this.trigger("languagechange"))}languages(){return S_(hS.prototype.options_.languages,this.languages_)}toJSON(){const e=S_(this.options_),t=e.tracks;e.tracks=[];for(let i=0;i<t.length;i++){let n=t[i];n=S_(n),n.player=void 0,e.tracks[i]=n}return e}createModal(e,t){(t=t||{}).content=e||"";const i=new Ub(this,t);return this.addChild(i),i.on("dispose",()=>{this.removeChild(i)}),i.open(),i}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let i=0;i<lS.length;i++){const n=lS[i];if(t<=this.breakpoints_[n]){if(e===n)return;e&&this.removeClass(uS[e]),this.addClass(uS[n]),this.breakpoint_=n;break}}}removeCurrentBreakpoint_(){const e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)}breakpoints(e){return void 0===e||(this.breakpoint_="",this.breakpoints_=Object.assign({},cS,e),this.updateCurrentBreakpoint_()),Object.assign(this.breakpoints_)}responsive(e){if(void 0===e)return this.responsive_;return(e=Boolean(e))!==this.responsive_?(this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e):void 0}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return uS[this.breakpoint_]||""}loadMedia(e,t){if(!e||"object"!=typeof e)return;const i=this.crossOrigin();this.reset(),this.cache_.media=S_(e);const{artist:n,artwork:s,description:r,poster:a,src:o,textTracks:l,title:u}=this.cache_.media;!s&&a&&(this.cache_.media.artwork=[{src:a,type:ET(a)}]),i&&this.crossOrigin(i),o&&this.src(o),a&&this.poster(a),Array.isArray(l)&&l.forEach(e=>this.addRemoteTextTrack(e,!1)),this.titleBar&&this.titleBar.update({title:u,description:r||n||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),e=>({kind:e.kind,label:e.label,language:e.language,src:e.src}))};return e&&(t.poster=e,t.artwork=[{src:t.poster,type:ET(t.poster)}]),t}return S_(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},i=cv(e),n=i["data-setup"];if(rv(e,"vjs-fill")&&(i.fill=!0),rv(e,"vjs-fluid")&&(i.fluid=!0),null!==n)try{Object.assign(i,JSON.parse(n||"{}"))}catch(e){m_.error("data-setup",e)}if(Object.assign(t,i),e.hasChildNodes()){const i=e.childNodes;for(let e=0,n=i.length;e<n;e++){const n=i[e],s=n.nodeName.toLowerCase();"source"===s?t.sources.push(cv(n)):"track"===s&&t.tracks.push(cv(n))}}return t}debug(e){if(void 0===e)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)}playbackRates(e){if(void 0===e)return this.cache_.playbackRates;Array.isArray(e)&&e.every(e=>"number"==typeof e)&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}}hS.prototype.videoTracks=()=>{},hS.prototype.audioTracks=()=>{},hS.prototype.textTracks=()=>{},hS.prototype.remoteTextTracks=()=>{},hS.prototype.remoteTextTrackEls=()=>{},hT.names.forEach(function(e){const t=hT[e];hS.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}}),hS.prototype.crossorigin=hS.prototype.crossOrigin,hS.players={};const dS=Dd.navigator;hS.prototype.options_={techOrder:dT.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:dS&&(dS.languages&&dS.languages[0]||dS.userLanguage||dS.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1,disableSeekWhileScrubbingOnMobile:!1,disableSeekWhileScrubbingOnSTV:!1},aS.forEach(function(e){hS.prototype[`handleTech${yb(e)}_`]=function(){return this.trigger(e)}}),bb.registerComponent("Player",hS);const pS="plugin",fS="activePlugins_",mS={},gS=e=>mS.hasOwnProperty(e),yS=e=>gS(e)?mS[e]:void 0,_S=(e,t)=>{e[fS]=e[fS]||{},e[fS][t]=!0},vS=(e,t,i)=>{const n=(i?"before":"")+"pluginsetup";e.trigger(n,t),e.trigger(n+":"+t.name,t)},bS=(e,t)=>(t.prototype.name=e,function(...i){vS(this,{name:e,plugin:t,instance:null},!0);const n=new t(...[this,...i]);return this[e]=()=>n,vS(this,n.getEventHash()),n});class TS{constructor(e){if(this.constructor===TS)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),pb(this),delete this.trigger,mb(this,this.constructor.defaultState),_S(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 Gv(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[fS][e]=!1,this.player=this.state=null,t[e]=bS(e,mS[e])}static isBasic(e){const t="string"==typeof e?yS(e):e;return"function"==typeof t&&!TS.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if("string"!=typeof e)throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(gS(e))m_.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(hS.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if("function"!=typeof t)throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return mS[e]=t,e!==pS&&(TS.isBasic(t)?hS.prototype[e]=function(e,t){const i=function(){vS(this,{name:e,plugin:t,instance:null},!0);const i=t.apply(this,arguments);return _S(this,e),vS(this,{name:e,plugin:t,instance:i}),i};return Object.keys(t).forEach(function(e){i[e]=t[e]}),i}(e,t):hS.prototype[e]=bS(e,t)),t}static deregisterPlugin(e){if(e===pS)throw new Error("Cannot de-register base plugin.");gS(e)&&(delete mS[e],delete hS.prototype[e])}static getPlugins(e=Object.keys(mS)){let t;return e.forEach(e=>{const i=yS(e);i&&(t=t||{},t[e]=i)}),t}static getPluginVersion(e){const t=yS(e);return t&&t.VERSION||""}}function wS(e,t,i,n){return function(e,t){let i=!1;return function(...n){return i||m_.warn(e),i=!0,t.apply(this,n)}}(`${t} is deprecated and will be removed in ${e}.0; please use ${i} instead.`,n)}TS.getPlugin=yS,TS.BASE_PLUGIN_NAME=pS,TS.registerPlugin(pS,TS),hS.prototype.usingPlugin=function(e){return!!this[fS]&&!0===this[fS][e]},hS.prototype.hasPlugin=function(e){return!!gS(e)};const SS=e=>0===e.indexOf("#")?e.slice(1):e;function ES(e,t,i){let n=ES.getPlayer(e);if(n)return t&&m_.warn(`Player "${e}" is already initialised. Options will not be applied.`),i&&n.ready(i),n;const s="string"==typeof e?Cv("#"+SS(e)):e;if(!Z_(s))throw new TypeError("The element or ID supplied is not valid. (videojs)");const r="getRootNode"in s&&s.getRootNode()instanceof Dd.ShadowRoot?s.getRootNode():s.ownerDocument.body;s.ownerDocument.defaultView&&r.contains(s)||m_.warn("The element supplied is not included in the DOM"),!0===(t=t||{}).restoreEl&&(t.restoreEl=(s.parentNode&&s.parentNode.hasAttribute&&s.parentNode.hasAttribute("data-vjs-player")?s.parentNode:s).cloneNode(!0)),l_("beforesetup").forEach(e=>{const i=e(s,S_(t));T_(i)&&!Array.isArray(i)?t=S_(t,i):m_.error("please return an object in beforesetup hooks")});const a=bb.getComponent("Player");return n=new a(s,t,i),l_("setup").forEach(e=>e(n)),n}if(ES.hooks_=o_,ES.hooks=l_,ES.hook=function(e,t){l_(e,t)},ES.hookOnce=function(e,t){l_(e,[].concat(t).map(t=>{const i=(...n)=>(u_(e,i),t(...n));return i}))},ES.removeHook=u_,!0!==Dd.VIDEOJS_NO_DYNAMIC_STYLE&&J_()){let e=Cv(".vjs-styles-defaults");if(!e){e=Nv("vjs-styles-defaults");const t=Cv("head");t&&t.insertBefore(e,t.firstChild),Rv(e,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: 56.25%\n }\n ")}}Dv(1,ES),ES.VERSION=a_,ES.options=hS.prototype.options_,ES.getPlayers=()=>hS.players,ES.getPlayer=e=>{const t=hS.players;let i;if("string"==typeof e){const n=SS(e),s=t[n];if(s)return s;i=Cv("#"+n)}else i=e;if(Z_(i)){const{player:e,playerId:n}=i;if(e||t[n])return e||t[n]}},ES.getAllPlayers=()=>Object.keys(hS.players).map(e=>hS.players[e]).filter(Boolean),ES.players=hS.players,ES.getComponent=bb.getComponent,ES.registerComponent=(e,t)=>(dT.isTech(t)&&m_.warn(`The ${e} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),bb.registerComponent.call(bb,e,t)),ES.getTech=dT.getTech,ES.registerTech=dT.registerTech,ES.use=function(e,t){pT[e]=pT[e]||[],pT[e].push(t)},Object.defineProperty(ES,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(ES.middleware,"TERMINATOR",{value:mT,writeable:!1,enumerable:!0}),ES.browser=Y_,ES.obj=k_,ES.mergeOptions=wS(9,"videojs.mergeOptions","videojs.obj.merge",S_),ES.defineLazyProperty=wS(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",C_),ES.bind=wS(9,"videojs.bind","native Function.prototype.bind",Jv),ES.registerPlugin=TS.registerPlugin,ES.deregisterPlugin=TS.deregisterPlugin,ES.plugin=(e,t)=>(m_.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),TS.registerPlugin(e,t)),ES.getPlugins=TS.getPlugins,ES.getPlugin=TS.getPlugin,ES.getPluginVersion=TS.getPluginVersion,ES.addLanguage=function(e,t){return e=(""+e).toLowerCase(),ES.options.languages=S_(ES.options.languages,{[e]:t}),ES.options.languages[e]},ES.log=m_,ES.createLogger=g_,ES.time=Ab,ES.createTimeRange=wS(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Sb),ES.createTimeRanges=wS(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Sb),ES.formatTime=wS(9,"videojs.formatTime","videojs.time.formatTime",Ib),ES.setFormatTime=wS(9,"videojs.setFormatTime","videojs.time.setFormatTime",kb),ES.resetFormatTime=wS(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",xb),ES.parseUrl=wS(9,"videojs.parseUrl","videojs.url.parseUrl",Jb),ES.isCrossOrigin=wS(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",tT),ES.EventTarget=nb,ES.any=Kv,ES.on=zv,ES.one=Xv,ES.off=Wv,ES.trigger=Gv,ES.xhr=bp,ES.TrackList=jb,ES.TextTrack=rT,ES.TextTrackList=zb,ES.AudioTrack=aT,ES.AudioTrackList=qb,ES.VideoTrack=oT,ES.VideoTrackList=Hb,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(e=>{ES[e]=function(){return m_.warn(`videojs.${e}() is deprecated; use videojs.dom.${e}() instead`),Av[e].apply(null,arguments)}}),ES.computedStyle=wS(9,"videojs.computedStyle","videojs.dom.computedStyle",xv),ES.dom=Av,ES.fn=tb,ES.num=GT,ES.str=vb,ES.url=iT,ES.Error={NetworkBadStatus:"networkbadstatus",NetworkRequestFailed:"networkrequestfailed",NetworkRequestAborted:"networkrequestaborted",NetworkRequestTimeout:"networkrequesttimeout",NetworkBodyParserFailed:"networkbodyparserfailed",StreamingHlsPlaylistParserError:"streaminghlsplaylistparsererror",StreamingDashManifestParserError:"streamingdashmanifestparsererror",StreamingContentSteeringParserError:"streamingcontentsteeringparsererror",StreamingVttParserError:"streamingvttparsererror",StreamingFailedToSelectNextSegment:"streamingfailedtoselectnextsegment",StreamingFailedToDecryptSegment:"streamingfailedtodecryptsegment",StreamingFailedToTransmuxSegment:"streamingfailedtotransmuxsegment",StreamingFailedToAppendSegment:"streamingfailedtoappendsegment",StreamingCodecsChangeError:"streamingcodecschangeerror"};
|
||
/*! @name videojs-contrib-quality-levels @version 4.1.0 @license Apache-2.0 */
|
||
class CS{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 kS extends ES.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get:()=>e.selectedIndex_}),Object.defineProperty(e,"length",{get:()=>e.levels_.length}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const i=this.levels_.length;return t=new CS(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++){const i=this[t];if(i.id===e)return i}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}}kS.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const e in kS.prototype.allowedEvents_)kS.prototype["on"+e]=null;var xS="4.1.0";const IS=function(e){return function(e){const t=e.qualityLevels,i=new kS,n=function(){i.dispose(),e.qualityLevels=t,e.off("dispose",n)};return e.on("dispose",n),e.qualityLevels=()=>i,e.qualityLevels.VERSION=xS,i}(this,ES.obj.merge({},e))};ES.registerPlugin("qualityLevels",IS),IS.VERSION=xS;
|
||
/*! @name @videojs/http-streaming @version 3.17.3 @license Apache-2.0 */
|
||
const AS=nf,LS=(e,t)=>t&&t.responseURL&&e!==t.responseURL?t.responseURL:e,PS=e=>ES.log.debug?ES.log.debug.bind(ES,"VHS:",`${e} >`):function(){};function OS(...e){const t=ES.obj||ES;return(t.merge||t.mergeOptions).apply(t,e)}function DS(...e){const t=ES.time||ES;return(t.createTimeRanges||t.createTimeRanges).apply(t,e)}const MS=1/30,NS=.1,RS=function(e,t){const 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 DS(i)},FS=function(e,t){return RS(e,function(e,i){return e-NS<=t&&i+NS>=t})},BS=function(e,t){return RS(e,function(e){return e-MS>=t})},US=e=>{const t=[];if(!e||!e.length)return"";for(let i=0;i<e.length;i++)t.push(e.start(i)+" => "+e.end(i));return t.join(", ")},jS=e=>{const t=[];for(let i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t},$S=function(e){if(e&&e.length&&e.end)return e.end(e.length-1)},qS=function(e,t){let i=0;if(!e||!e.length)return i;for(let n=0;n<e.length;n++){const s=e.start(n),r=e.end(n);t>r||(i+=t>s&&t<=r?r-t:r-s)}return i},VS=(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},HS=e=>(e.segments||[]).reduce((e,t,i)=>(t.parts?t.parts.forEach(function(n,s){e.push({duration:n.duration,segmentIndex:i,partIndex:s,part:n,segment:t})}):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e),[]),zS=e=>{const t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},WS=({preloadSegment:e})=>{if(!e)return;const{parts:t,preloadHints:i}=e;let n=(i||[]).reduce((e,t)=>e+("PART"===t.type?1:0),0);return n+=t&&t.length?t.length:0,n},GS=(e,t)=>{if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;const i=zS(t).length>0;return i&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:i&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},XS=function(e,t,i){if(void 0===t&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence)return 0;const n=function(e,t){let i=0,n=t-e.mediaSequence,s=e.segments[n];if(s){if(void 0!==s.start)return{result:s.start,precise:!0};if(void 0!==s.end)return{result:s.end-s.duration,precise:!0}}for(;n--;){if(s=e.segments[n],void 0!==s.end)return{result:i+s.end,precise:!0};if(i+=VS(e,s),void 0!==s.start)return{result:i+s.start,precise:!0}}return{result:i,precise:!1}}(e,t);if(n.precise)return n.result;const s=function(e,t){let i,n=0,s=t-e.mediaSequence;for(;s<e.segments.length;s++){if(i=e.segments[s],void 0!==i.start)return{result:i.start-n,precise:!0};if(n+=VS(e,i),void 0!==i.end)return{result:i.end-n,precise:!0}}return{result:-1,precise:!1}}(e,t);return s.precise?s.result:n.result+i},KS=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 Dd.Infinity}return XS(e,t,i)},YS=function({defaultDuration:e,durationList:t,startIndex:i,endIndex:n}){let s=0;if(i>n&&([i,n]=[n,i]),i<0){for(let t=i;t<Math.min(0,n);t++)s+=e;i=0}for(let e=i;e<n;e++)s+=t[e].duration;return s},QS=function(e,t,i,n){if(!e||!e.segments)return null;if(e.endList)return KS(e);if(null===t)return null;t=t||0;let s=XS(e,e.mediaSequence+e.segments.length,t);return i&&(s-=n="number"==typeof n?n:GS(null,e)),Math.max(0,s)},JS=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},ZS=function(e){return e.excludeUntil&&e.excludeUntil===1/0},eE=function(e){const t=JS(e);return!e.disabled&&!t},tE=function(e,t){return t.attributes&&t.attributes[e]},iE=(e,t)=>{if(1===e.playlists.length)return!0;const i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter(e=>!!eE(e)&&(e.attributes.BANDWIDTH||0)<i).length},nE=(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)))),sE=function(e,t){const i=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{};let n=!1;for(const e in i){for(const s in i[e])if(n=t(i[e][s]),n)break;if(n)break}return!!n},rE=e=>{if(!e||!e.playlists||!e.playlists.length){return sE(e,e=>e.playlists&&e.playlists.length||e.uri)}for(let t=0;t<e.playlists.length;t++){const i=e.playlists[t],n=i.attributes&&i.attributes.CODECS;if(n&&n.split(",").every(e=>wf(e)))continue;if(!sE(e,e=>nE(i,e)))return!1}return!0};var aE={liveEdgeDelay:GS,duration:KS,seekable:function(e,t,i){const n=t||0;let s=QS(e,t,!0,i);return null===s?DS():(s<n&&(s=n),DS(n,s))},getMediaInfoForTime:function({playlist:e,currentTime:t,startingSegmentIndex:i,startingPartIndex:n,startTime:s,exactManifestTimings:r}){let a=t-s;const o=HS(e);let l=0;for(let e=0;e<o.length;e++){const t=o[e];if(i===t.segmentIndex&&("number"!=typeof n||"number"!=typeof t.partIndex||n===t.partIndex)){l=e;break}}if(a<0){if(l>0)for(let t=l-1;t>=0;t--){const i=o[t];if(a+=i.duration,r){if(a<0)continue}else if(a+MS<=0)continue;return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:s-YS({defaultDuration:e.targetDuration,durationList:o,startIndex:l,endIndex:t})}}return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:t}}if(l<0){for(let i=l;i<0;i++)if(a-=e.targetDuration,a<0)return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:t};l=0}for(let t=l;t<o.length;t++){const i=o[t];a-=i.duration;const n=i.duration>MS;if(!(0===a)&&!(n&&a+MS>=0)||t===o.length-1){if(r){if(a>0)continue}else if(a-MS>=0)continue;return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:s+YS({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:eE,isDisabled:function(e){return e.disabled},isExcluded:JS,isIncompatible:ZS,playlistEnd:QS,isAes:function(e){for(let t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},hasAttribute:tE,estimateSegmentRequestTime:function(e,t,i,n=0){if(!tE("BANDWIDTH",i))return NaN;return(e*i.attributes.BANDWIDTH-8*n)/t},isLowestEnabledRendition:iE,isAudioOnly:rE,playlistMatch:nE,segmentDurationWithParts:VS};const{log:oE}=ES,lE=(e,t)=>`${e}-${t}`,uE=(e,t,i)=>`placeholder-uri-${e}-${t}-${i}`,cE=(e,t)=>{e.mediaGroups&&["AUDIO","SUBTITLES"].forEach(i=>{if(e.mediaGroups[i])for(const n in e.mediaGroups[i])for(const s in e.mediaGroups[i][n]){const r=e.mediaGroups[i][n][s];t(r,i,n,s)}})},hE=({playlist:e,uri:t,id:i})=>{e.id=i,e.playlistErrors_=0,t&&(e.uri=t),e.attributes=e.attributes||{}},dE=(e,t,i=uE)=>{e.uri=t;for(let t=0;t<e.playlists.length;t++)if(!e.playlists[t].uri){const i=`placeholder-uri-${t}`;e.playlists[t].uri=i}const n=rE(e);cE(e,(t,s,r,a)=>{if(!t.playlists||!t.playlists.length){if(n&&"AUDIO"===s&&!t.uri)for(let t=0;t<e.playlists.length;t++){const i=e.playlists[t];if(i.attributes&&i.attributes.AUDIO&&i.attributes.AUDIO===r)return}t.playlists=[up({},t)]}t.playlists.forEach(function(t,n){const o=i(s,r,a,t),l=lE(n,o);t.uri?t.resolvedUri=t.resolvedUri||AS(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})}),(e=>{let t=e.playlists.length;for(;t--;){const i=e.playlists[t];hE({playlist:i,id:lE(t,i.uri)}),i.resolvedUri=AS(e.uri,i.uri),e.playlists[i.id]=i,e.playlists[i.uri]=i,i.attributes.BANDWIDTH||oE.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}})(e),(e=>{cE(e,t=>{t.uri&&(t.resolvedUri=AS(e.uri,t.uri))})})(e)};class pE{constructor(){this.offset_=null,this.pendingDateRanges_=new Map,this.processedDateRanges_=new Map}setOffset(e=[]){if(null!==this.offset_)return;if(!e.length)return;const[t]=e;void 0!==t.programDateTime&&(this.offset_=t.programDateTime/1e3)}setPendingDateRanges(e=[]){if(!e.length)return;const[t]=e,i=t.startDate.getTime();this.trimProcessedDateRanges_(i),this.pendingDateRanges_=e.reduce((e,t)=>(e.set(t.id,t),e),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(null===this.offset_)return[];const e={},t=[];this.pendingDateRanges_.forEach((i,n)=>{if(!this.processedDateRanges_.has(n)&&(i.startTime=i.startDate.getTime()/1e3-this.offset_,i.processDateRange=()=>this.processDateRange(i),t.push(i),i.class))if(e[i.class]){const t=e[i.class].push(i);i.classListIndex=t-1}else e[i.class]=[i],i.classListIndex=0});for(const i of t){const t=e[i.class]||[];i.endDate?i.endTime=i.endDate.getTime()/1e3-this.offset_:i.endOnNext&&t[i.classListIndex+1]?i.endTime=t[i.classListIndex+1].startTime:i.duration?i.endTime=i.startTime+i.duration:i.plannedDuration?i.endTime=i.startTime+i.plannedDuration:i.endTime=i.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((t,i)=>{t.startDate.getTime()<e&&this.processedDateRanges_.delete(i)})}}const fE=({requestType:e,request:t,error:i,parseFailure:n})=>{const s=t.status<200||t.status>299,r=t.status>=400&&t.status<=499,a={uri:t.uri,requestType:e},o=s&&!r||n;if(i&&r)a.error=up({},i),a.errorType=ES.Error.NetworkRequestFailed;else if(t.aborted)a.errorType=ES.Error.NetworkRequestAborted;else if(t.timedout)a.errorType=ES.Error.NetworkRequestTimeout;else if(o){const e=n?ES.Error.NetworkBodyParserFailed:ES.Error.NetworkBadStatus;a.errorType=e,a.status=t.status,a.headers=t.headers}return a},mE=PS("CodecUtils"),gE=function(e){const t=e.attributes||{};if(t.CODECS)return Tf(t.CODECS)},yE=(e,t)=>{const i=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&i.AUDIO&&e.mediaGroups.AUDIO[i.AUDIO]},_E=function(e){const t={};return e.forEach(({mediaType:e,type:i,details:n})=>{t[e]=t[e]||[],t[e].push(bf(`${i}${n}`))}),Object.keys(t).forEach(function(e){if(t[e].length>1)return mE(`multiple ${e} codecs found as attributes: ${t[e].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),void(t[e]=null);t[e]=t[e][0]}),t},vE=function(e){let t=0;return e.audio&&t++,e.video&&t++,t},bE=function(e,t){const i=t.attributes||{},n=_E(gE(t)||[]);if(yE(e,t)&&!n.audio&&!((e,t)=>{if(!yE(e,t))return!0;const i=t.attributes||{},n=e.mediaGroups.AUDIO[i.AUDIO];for(const e in n)if(!n[e].uri&&!n[e].playlists)return!0;return!1})(e,t)){const t=_E(function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var i=e.mediaGroups.AUDIO[t];if(!i)return null;for(var n in i){var s=i[n];if(s.default&&s.playlists)return Tf(s.playlists[0].attributes.CODECS)}return null}(e,i.AUDIO)||[]);t.audio&&(n.audio=t.audio)}return n},{EventTarget:TE}=ES,wE=(e,t)=>{if(!e)return t;const i=OS(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]=OS(e.parts[n],t.parts[n]));return!e.skipped&&t.skipped&&(i.skipped=!1),e.preload&&!t.preload&&(i.preload=!1),i},SE=(e,t)=>{!e.resolvedUri&&e.uri&&(e.resolvedUri=AS(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=AS(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=AS(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=AS(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach(e=>{e.resolvedUri||(e.resolvedUri=AS(t,e.uri))}),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach(e=>{e.resolvedUri||(e.resolvedUri=AS(t,e.uri))})},EE=function(e){const t=e.segments||[],i=e.preloadSegment;if(i&&i.parts&&i.parts.length){if(i.preloadHints)for(let e=0;e<i.preloadHints.length;e++)if("MAP"===i.preloadHints[e].type)return t;i.duration=e.targetDuration,i.preload=!0,t.push(i)}return t},CE=(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,kE=(e,t,i=CE)=>{const n=OS(e,{}),s=n.playlists[t.id];if(!s)return null;if(i(s,t))return null;t.segments=EE(t);const r=OS(s,t);if(r.preloadSegment&&!t.preloadSegment&&delete r.preloadSegment,s.segments){if(t.skip){t.segments=t.segments||[];for(let e=0;e<t.skip.skippedSegments;e++)t.segments.unshift({skipped:!0})}r.segments=((e,t,i)=>{const n=e.slice(),s=t.slice();i=i||0;const r=[];let a;for(let e=0;e<s.length;e++){const t=n[e+i],o=s[e];t?(a=t.map||a,r.push(wE(t,o))):(a&&!o.map&&(o.map=a),r.push(o))}return r})(s.segments,t.segments,t.mediaSequence-s.mediaSequence)}r.segments.forEach(e=>{SE(e,r.resolvedUri)});for(let e=0;e<n.playlists.length;e++)n.playlists[e].id===t.id&&(n.playlists[e]=r);return n.playlists[t.id]=r,n.playlists[t.uri]=r,cE(e,(e,i,n,s)=>{if(e.playlists)for(let i=0;i<e.playlists.length;i++)t.id===e.playlists[i].id&&(e.playlists[i]=r)}),n},xE=(e,t)=>{const i=e.segments||[],n=i[i.length-1],s=n&&n.parts&&n.parts[n.parts.length-1],r=s&&s.duration||n&&n.duration;return t&&r?1e3*r:500*(e.partTargetDuration||e.targetDuration||10)},IE=(e,t,i)=>{if(!e)return;const n=[];return e.forEach(e=>{if(!e.attributes)return;const{BANDWIDTH:t,RESOLUTION:i,CODECS:s}=e.attributes;n.push({id:e.id,bandwidth:t,resolution:i,codecs:s})}),{type:t,isLive:i,renditions:n}};class AE extends TE{constructor(e,t,i={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=PS("PlaylistLoader");const{withCredentials:n=!1}=i;this.src=e,this.vhs_=t,this.withCredentials=n,this.addDateRangesToTextTrack_=i.addDateRangesToTextTrack;const s=t.options_;this.customTagParsers=s&&s.customTagParsers||[],this.customTagMappers=s&&s.customTagMappers||[],this.llhls=s&&s.llhls,this.dateRangesStorage_=new pE,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();t.length&&this.addDateRangesToTextTrack_&&this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if("HAVE_METADATA"!==this.state)return;const e=this.media();let t=AS(this.main.uri,e.uri);this.llhls&&(t=((e,t)=>{if(t.endList||!t.serverControl)return e;const i={};if(t.serverControl.canBlockReload){const{preloadSegment:e}=t;let n=t.mediaSequence+t.segments.length;if(e){const s=e.parts||[],r=WS(t)-1;r>-1&&r!==s.length-1&&(i._HLS_part=r),(r>-1||s.length)&&n--}i._HLS_msn=n}if(t.serverControl&&t.serverControl.canSkipUntil&&(i._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(i).length){const t=new Dd.URL(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(e){i.hasOwnProperty(e)&&t.searchParams.set(e,i[e])}),e=t.toString()}return e})(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},(e,t)=>{if(this.request)return e?this.playlistRequestError(this.request,this.media(),"HAVE_METADATA"):void this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})})}playlistRequestError(e,t,i){const{uri:n,id:s}=t;this.request=null,i&&(this.state=i),this.error={playlist:this.main.playlists[s],status:e.status,message:`HLS playlist request error at URL: ${n}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:fE({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:t}){try{const i=(({onwarn:e,oninfo:t,manifestString:i,customTagParsers:n=[],customTagMappers:s=[],llhls:r})=>{const a=new ff;e&&a.on("warn",e),t&&a.on("info",t),n.forEach(e=>a.addParser(e)),s.forEach(e=>a.addTagMapper(e)),a.push(i),a.end();const o=a.manifest;if(r||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(e){o.hasOwnProperty(e)&&delete o[e]}),o.segments&&o.segments.forEach(function(e){["parts","preloadHints"].forEach(function(t){e.hasOwnProperty(t)&&delete e[t]})})),!o.targetDuration){let t=10;o.segments&&o.segments.length&&(t=o.segments.reduce((e,t)=>Math.max(e,t.duration),0)),e&&e({message:`manifest has no targetDuration defaulting to ${t}`}),o.targetDuration=t}const l=zS(o);if(l.length&&!o.partTargetDuration){const t=l.reduce((e,t)=>Math.max(e,t.duration),0);e&&(e({message:`manifest has no partTargetDuration defaulting to ${t}`}),oE.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),o.partTargetDuration=t}return o})({onwarn:({message:t})=>this.logger_(`m3u8-parser warn for ${e}: ${t}`),oninfo:({message:t})=>this.logger_(`m3u8-parser info for ${e}: ${t}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls});return i.playlists&&i.playlists.length?(this.excludeAudioOnlyVariants(i.playlists),i):i}catch(e){this.error=e,this.error.metadata={errorType:ES.Error.StreamingHlsPlaylistParserError,error:e}}}excludeAudioOnlyVariants(e){const t=e=>{const t=e.attributes||{},{width:i,height:n}=t.RESOLUTION||{};if(i&&n)return!0;const s=gE(e)||[],r=_E(s);return Boolean(r.video)};e.some(t)&&e.forEach(e=>{t(e)||(e.excludeUntil=1/0)})}haveMetadata({playlistString:e,playlistObject:t,url:i,id:n}){this.request=null,this.state="HAVE_METADATA";const s={playlistInfo:{type:"media",uri:i}};this.trigger({type:"playlistparsestart",metadata:s});const r=t||this.parseManifest_({url:i,manifestString:e});r.lastRequest=Date.now(),hE({playlist:r,uri:i,id:n});const a=kE(this.main,r);this.targetDuration=r.partTargetDuration||r.targetDuration,this.pendingMedia_=null,a?(this.main=a,this.media_=this.main.playlists[n]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(xE(this.media(),!!a)),s.parsedPlaylist=IE(this.main.playlists,s.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:s}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),Dd.clearTimeout(this.mediaUpdateTimeout),Dd.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new pE,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"==typeof e){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(Dd.clearTimeout(this.finalRenditionTimeout),t){const t=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;return void(this.finalRenditionTimeout=Dd.setTimeout(this.media.bind(this,e,!1),t))}const i=this.state,n=!this.media_||e.id!==this.media_.id,s=this.main.playlists[e.id];if(s&&s.endList||e.endList&&e.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(n&&(this.trigger("mediachanging"),"HAVE_MAIN_MANIFEST"===i?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(xE(e,!0)),!n)return;if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e;const r={playlistInfo:{type:"media",uri:e.uri}};this.trigger({type:"playlistrequeststart",metadata:r}),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(t,n)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=LS(e.resolvedUri,n),t)return this.playlistRequestError(this.request,e,i);this.trigger({type:"playlistrequestcomplete",metadata:r}),this.haveMetadata({playlistString:n.responseText,url:e.uri,id:e.id}),"HAVE_MAIN_MANIFEST"===i?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&(Dd.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&&(Dd.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const e=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;return void(this.mediaUpdateTimeout=Dd.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},e))}this.started?t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(Dd.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=Dd.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,"object"==typeof this.src)return this.src.uri||(this.src.uri=Dd.location.href),this.src.resolvedUri=this.src.uri,void setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);const e={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:e}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},(t,i)=>{if(!this.request)return;if(this.request=null,t)return this.error={status:i.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:i.responseText,code:2,metadata:fE({requestType:i.requestType,request:i,error:t})},"HAVE_NOTHING"===this.state&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=LS(this.src,i),this.trigger({type:"playlistparsestart",metadata:e});const n=this.parseManifest_({manifestString:i.responseText,url:this.src});e.parsedPlaylist=IE(n.playlists,e.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:e}),this.setupInitialPlaylist(n)})}srcUri(){return"string"==typeof this.src?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists)return this.main=e,dE(this.main,this.srcUri()),e.playlists.forEach(e=>{e.segments=EE(e),e.segments.forEach(t=>{SE(t,e.resolvedUri)})}),this.trigger("loadedplaylist"),void(this.request||this.media(this.main.playlists[0]));const t=this.srcUri()||Dd.location.href;this.main=((e,t)=>{const i=lE(0,t),n={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:Dd.location.href,resolvedUri:Dd.location.href,playlists:[{uri:t,id:i,resolvedUri:t,attributes:{}}]};return n.playlists[i]=n.playlists[0],n.playlists[t]=n.playlists[0],n})(0,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const i=this.main,n=e.ID;let s=i.playlists.length;for(;s--;){const r=i.playlists[s];if(r.attributes["PATHWAY-ID"]===n){const a=r.resolvedUri,o=r.id;if(t){const t=this.createCloneURI_(r.resolvedUri,e),a=lE(n,t),o=this.createCloneAttributes_(n,r.attributes),l=this.createClonePlaylist_(r,a,e,o);i.playlists[s]=l,i.playlists[a]=l,i.playlists[t]=l}else i.playlists.splice(s,1);delete i.playlists[o],delete i.playlists[a]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const i=this.main,n=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{if(i.mediaGroups[e]&&i.mediaGroups[e][n])for(const t in i.mediaGroups[e])if(t===n){for(const n in i.mediaGroups[e][t]){i.mediaGroups[e][t][n].playlists.forEach((e,t)=>{const n=i.playlists[e.id],s=n.id,r=n.resolvedUri;delete i.playlists[s],delete i.playlists[r]})}delete i.mediaGroups[e][t]}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const i=this.main,n=i.playlists.length,s=this.createCloneURI_(t.resolvedUri,e),r=lE(e.ID,s),a=this.createCloneAttributes_(e.ID,t.attributes),o=this.createClonePlaylist_(t,r,e,a);i.playlists[n]=o,i.playlists[r]=o,i.playlists[s]=o,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,i=e["BASE-ID"],n=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(s=>{if(n.mediaGroups[s]&&!n.mediaGroups[s][t])for(const r in n.mediaGroups[s])if(r===i){n.mediaGroups[s][t]={};for(const i in n.mediaGroups[s][r]){const a=n.mediaGroups[s][r][i];n.mediaGroups[s][t][i]=up({},a);const o=n.mediaGroups[s][t][i],l=this.createCloneURI_(a.resolvedUri,e);o.resolvedUri=l,o.uri=l,o.playlists=[],a.playlists.forEach((r,a)=>{const l=n.playlists[r.id],u=uE(s,t,i),c=lE(t,u);if(l&&!n.playlists[c]){const t=this.createClonePlaylist_(l,c,e),i=t.resolvedUri;n.playlists[c]=t,n.playlists[i]=t}o.playlists[a]=this.createClonePlaylist_(r,c,e)})}}})}createClonePlaylist_(e,t,i,n){const s=this.createCloneURI_(e.resolvedUri,i),r={resolvedUri:s,uri:s,id:t};return e.segments&&(r.segments=[]),n&&(r.attributes=n),OS(e,r)}createCloneURI_(e,t){const i=new URL(e);i.hostname=t["URI-REPLACEMENT"].HOST;const n=t["URI-REPLACEMENT"].PARAMS;for(const e of Object.keys(n))i.searchParams.set(e,n[e]);return i.href}createCloneAttributes_(e,t){const i={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{t[n]&&(i[n]=e)}),i}getKeyIdSet(e){const t=new Set;if(!e||!e.contentProtection)return t;for(const i in e.contentProtection)if(e.contentProtection[i]&&e.contentProtection[i].attributes&&e.contentProtection[i].attributes.keyId){const n=e.contentProtection[i].attributes.keyId;t.add(n.toLowerCase())}return t}}const LE=function(e,t,i,n){const s="arraybuffer"===e.responseType?e.response:e.responseText;!t&&s&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=s.byteLength||s.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),i.headers&&(e.responseHeaders=i.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),t||e.aborted||200===i.statusCode||206===i.statusCode||0===i.statusCode||(t=new Error("XHR Failed with a response of: "+(e&&(s||e.responseText)))),n(t,e)},PE=function(){const e=function e(t,i){t=OS({timeout:45e3},t);const n=e.beforeRequest||ES.Vhs.xhr.beforeRequest,s=e._requestCallbackSet||ES.Vhs.xhr._requestCallbackSet||new Set,r=e._responseCallbackSet||ES.Vhs.xhr._responseCallbackSet;n&&"function"==typeof n&&(ES.log.warn("beforeRequest is deprecated, use onRequest instead."),s.add(n));const a=!0===ES.Vhs.xhr.original?ES.xhr:ES.Vhs.xhr,o=((e,t)=>{if(!e||!e.size)return;let i=t;return e.forEach(e=>{i=e(i)}),i})(s,t);s.delete(n);const l=a(o||t,function(e,t){return((e,t,i,n)=>{e&&e.size&&e.forEach(e=>{e(t,i,n)})})(r,l,e,t),LE(l,e,t,i)}),u=l.abort;return l.abort=function(){return l.aborted=!0,u.apply(l,arguments)},l.uri=t.uri,l.requestType=t.requestType,l.requestTime=Date.now(),l};return e.original=!0,e},OE=function(e){const t={};return e.byterange&&(t.Range=function(e){let t;const i=e.offset;return t="bigint"==typeof e.offset||"bigint"==typeof e.length?Dd.BigInt(e.offset)+Dd.BigInt(e.length)-Dd.BigInt(1):e.offset+e.length-1,"bytes="+i+"-"+t}(e.byterange)),t},DE=function(e,t){return e.start(t)+"-"+e.end(t)},ME=function(e,t){const i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")},NE=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},RE=function(e){const t={};return Object.keys(e).forEach(i=>{const n=e[i];Lf(n)?t[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:t[i]=n}),t},FE=function(e){const t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},BE=function(e){return e.resolvedUri},UE=e=>{const t=Array.prototype.slice.call(e),i=16;let n,s,r="";for(let e=0;e<t.length/i;e++)n=t.slice(e*i,e*i+i).map(ME).join(""),s=t.slice(e*i,e*i+i).map(NE).join(""),r+=n+" "+s+"\n";return r};var jE=Object.freeze({__proto__:null,createTransferableMessage:RE,initSegmentId:FE,segmentKeyId:BE,hexDump:UE,tagDump:({bytes:e})=>UE(e),textRanges:e=>{let t,i="";for(t=0;t<e.length;t++)i+=DE(e,t)+" ";return i}});const $E=({playlist:e,time:t,callback:i})=>{if(!i)throw new Error("getProgramTime: callback must be provided");if(!e||void 0===t)return i({message:"getProgramTime: playlist and time must be provided"});const n=((e,t)=>{if(!t||!t.segments||0===t.segments.length)return null;let i,n=0;for(let s=0;s<t.segments.length&&(i=t.segments[s],n=i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationEnd:n+i.duration,!(e<=n));s++);const s=t.segments[t.segments.length-1];if(s.videoTimingInfo&&s.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>n){if(e>n+.25*s.duration)return null;i=s}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:n-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}})(t,e);if(!n)return i({message:"valid programTime was not found"});if("estimate"===n.type)return i({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:n.estimatedStart});const s={mediaSeconds:t},r=((e,t)=>{if(!t.dateTimeObject)return null;const i=t.videoTimingInfo.transmuxerPrependedSeconds,n=e-(t.videoTimingInfo.transmuxedPresentationStart+i);return new Date(t.dateTimeObject.getTime()+1e3*n)})(t,n.segment);return r&&(s.programDateTime=r.toISOString()),i(null,s)},qE=({programTime:e,playlist:t,retryCount:i=2,seekTo:n,pauseAfterSeek:s=!0,tech:r,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if(void 0===e||!t||!n)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!t.endList&&!r.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!(e=>{if(!e.segments||0===e.segments.length)return!1;for(let t=0;t<e.segments.length;t++)if(!e.segments[t].dateTimeObject)return!1;return!0})(t))return a({message:"programDateTime tags must be provided in the manifest "+t.resolvedUri});const o=((e,t)=>{let i;try{i=new Date(e)}catch(e){return null}if(!t||!t.segments||0===t.segments.length)return null;let n=t.segments[0];if(i<new Date(n.dateTimeObject))return null;for(let e=0;e<t.segments.length-1&&(n=t.segments[e],!(i<new Date(t.segments[e+1].dateTimeObject)));e++);const s=t.segments[t.segments.length-1],r=s.dateTimeObject,a=s.videoTimingInfo?(o=s.videoTimingInfo).transmuxedPresentationEnd-o.transmuxedPresentationStart-o.transmuxerPrependedSeconds:s.duration+.25*s.duration;var o;return i>new Date(r.getTime()+1e3*a)?null:(i>new Date(r)&&(n=s),{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:aE.duration(t,t.mediaSequence+t.segments.indexOf(n)),type:n.videoTimingInfo?"accurate":"estimate"})})(e,t);if(!o)return a({message:`${e} was not found in the stream`});const l=o.segment,u=((e,t)=>{let i,n;try{i=new Date(e),n=new Date(t)}catch(e){}const s=i.getTime();return(n.getTime()-s)/1e3})(l.dateTimeObject,e);if("estimate"===o.type)return 0===i?a({message:`${e} is not buffered yet. Try again`}):(n(o.estimatedStart+u),void r.one("seeked",()=>{qE({programTime:e,playlist:t,retryCount:i-1,seekTo:n,pauseAfterSeek:s,tech:r,callback:a})}));const c=l.start+u;r.one("seeked",()=>a(null,r.currentTime())),s&&r.pause(),n(c)},VE=(e,t)=>{if(4===e.readyState)return t()},HE=(e,t,i,n)=>{let s,r=[],a=!1;const o=function(e,t,n,s){return t.abort(),a=!0,i(e,t,n,s)},l=function(e,t){if(a)return;if(e)return e.metadata=fE({requestType:n,request:t,error:e}),o(e,t,"",r);const i=t.responseText.substring(r&&r.byteLength||0,t.responseText.length);if(r=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];if(t=t.filter(function(e){return e&&(e.byteLength||e.length)&&"string"!=typeof e}),t.length<=1)return Pf(t[0]);var n=t.reduce(function(e,t,i){return e+(t.byteLength||t.length)},0),s=new Uint8Array(n),r=0;return t.forEach(function(e){e=Pf(e),s.set(e,r),r+=e.byteLength}),s}(r,Rf(i,!0)),s=s||jy(r),r.length<10||s&&r.length<s+2)return VE(t,()=>o(e,t,"",r));const l=s_(r);return"ts"===l&&r.length<188||!l&&r.length<376?VE(t,()=>o(e,t,"",r)):o(null,t,l,r)},u={uri:e,beforeSend(e){e.overrideMimeType("text/plain; charset=x-user-defined"),e.addEventListener("progress",function({total:t,loaded:i}){return LE(e,null,{statusCode:e.status},l)})}},c=t(u,function(e,t){return LE(c,e,t,l)});return c},{EventTarget:zE}=ES,WE=function(e,t){if(!CE(e,t))return!1;if(e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length))return!1;if(!e.sidx&&t.sidx||e.sidx&&!t.sidx)return!1;if(e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(!e.segments&&!t.segments)return!0;for(let i=0;i<e.segments.length;i++){const n=e.segments[i],s=t.segments[i];if(n.uri!==s.uri)return!1;if(!n.byterange&&!s.byterange)continue;const r=n.byterange,a=s.byterange;if(r&&!a||!r&&a)return!1;if(r.offset!==a.offset||r.length!==a.length)return!1}return!0},GE=(e,t,i,n)=>`placeholder-uri-${e}-${t}-${n.attributes.NAME||i}`,XE=(e,t,i)=>{let n=!0,s=OS(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts});for(let e=0;e<t.playlists.length;e++){const r=t.playlists[e];if(r.sidx){const e=sy(r.sidx);i&&i[e]&&i[e].sidx&&Qg(r,i[e].sidx,r.sidx.resolvedUri)}const a=kE(s,r,WE);a&&(s=a,n=!1)}return cE(t,(e,t,i,r)=>{if(e.playlists&&e.playlists.length){const a=e.playlists[0].id,o=kE(s,e.playlists[0],WE);o&&(s=o,r in s.mediaGroups[t][i]||(s.mediaGroups[t][i][r]=e),s.mediaGroups[t][i][r].playlists[0]=s.playlists[a],n=!1)}}),((e,t)=>{cE(e,(i,n,s,r)=>{t.mediaGroups[n][s]&&r in t.mediaGroups[n][s]||delete e.mediaGroups[n][s][r]})})(s,t),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(n=!1),n?null:s},KE=(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,YE=(e,t)=>{const i={};for(const n in e){const s=e[n].sidx;if(s){const e=sy(s);if(!t[e])break;const n=t[e].sidxInfo;KE(n,s)&&(i[e]=t[e])}}return i};class QE extends zE{constructor(e,t,i={},n){super(),this.isPaused_=!0,this.mainPlaylistLoader_=n||this,n||(this.isMain_=!0);const{withCredentials:s=!1}=i;if(this.vhs_=t,this.withCredentials=s,this.addMetadataToTextTrack=i.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=PS("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}get isPaused(){return this.isPaused_}requestErrored_(e,t,i){return!this.request||(this.request=null,e?(this.error="object"!=typeof e||e instanceof Error?{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata}:e,i&&(this.state=i),this.trigger("error"),!0):void 0)}addSidxSegments_(e,t,i){const n=e.sidx&&sy(e.sidx);if(!e.sidx||!n||this.mainPlaylistLoader_.sidxMapping_[n])return Dd.clearTimeout(this.mediaRequest_),void(this.mediaRequest_=Dd.setTimeout(()=>i(!1),0));const s=LS(e.sidx.resolvedUri),r=(s,r)=>{if(this.requestErrored_(s,r,t))return;const a=this.mainPlaylistLoader_.sidxMapping_,{requestType:o}=r;let l;try{l=By(Pf(r.response).subarray(8))}catch(e){return e.metadata=fE({requestType:o,request:r,parseFailure:!0}),void this.requestErrored_(e,r,t)}return a[n]={sidxInfo:e.sidx,sidx:l},Qg(e,l,e.sidx.resolvedUri),i(!0)};this.request=HE(s,this.vhs_.xhr,(t,i,n,a)=>{if(t)return r(t,i);if(!n||"mp4"!==n){const t=n||"unknown";return r({status:i.status,message:`Unsupported ${t} container type for sidx segment at URL: ${s}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},i)}const{offset:o,length:l}=e.sidx.byterange;if(a.length>=l+o)return r(t,{response:a.subarray(o,o+l),status:i.status,uri:i.uri});this.request=this.vhs_.xhr({uri:s,responseType:"arraybuffer",requestType:"dash-sidx",headers:OE({byterange:e.sidx.byterange})},r)},"dash-sidx")}dispose(){this.isPaused_=!0,this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},Dd.clearTimeout(this.minimumUpdatePeriodTimeout_),Dd.clearTimeout(this.mediaRequest_),Dd.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if("string"==typeof e){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const i=!this.media_||e.id!==this.media_.id;if(i&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(i&&(this.trigger("mediachanging"),this.trigger("mediachange")));i&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,i=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,Dd.clearTimeout(this.mediaRequest_),this.mediaRequest_=null,this.refreshMedia_(t.id),"HAVE_MAIN_MANIFEST"===e?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.isPaused_=!0,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),Dd.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(Dd.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)}load(e){this.isPaused_=!1,Dd.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const e=t?t.targetDuration/2*1e3:5e3;return void(this.mediaUpdateTimeout=Dd.setTimeout(()=>this.load(),e))}this.started?t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()}start(){if(this.started=!0,!this.isMain_)return Dd.clearTimeout(this.mediaRequest_),void(this.mediaRequest_=Dd.setTimeout(()=>this.haveMain_(),0));this.requestMain_((e,t)=>{this.haveMain_(),this.hasPendingRequest()||this.media_||this.media(this.mainPlaylistLoader_.main.playlists[0])})}requestMain_(e){const t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:t}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(i,n)=>{if(i){const{requestType:e}=n;i.metadata=fE({requestType:e,request:n,error:i})}if(this.requestErrored_(i,n))return void("HAVE_NOTHING"===this.state&&(this.started=!1));this.trigger({type:"manifestrequestcomplete",metadata:t});const s=n.responseText!==this.mainPlaylistLoader_.mainXml_;return this.mainPlaylistLoader_.mainXml_=n.responseText,n.responseHeaders&&n.responseHeaders.date?this.mainLoaded_=Date.parse(n.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=LS(this.mainPlaylistLoader_.srcUrl,n),s?(this.handleMain_(),void this.syncClientServerClock_(()=>e(n,s))):e(n,s)})}syncClientServerClock_(e){const t=Ny(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:AS(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(i,n)=>{if(!this.request)return;if(i){const{requestType:t}=n;return this.error.metadata=fE({requestType:t,request:n,error:i}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let s;s="HEAD"===t.method?n.responseHeaders&&n.responseHeaders.date?Date.parse(n.responseHeaders.date):this.mainLoaded_:Date.parse(n.responseText),this.mainPlaylistLoader_.clientOffset_=s-Date.now(),e()}))}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){Dd.clearTimeout(this.mediaRequest_),this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main,t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};let i;this.trigger({type:"manifestparsestart",metadata:t});try{i=(({mainXml:e,srcUrl:t,clientOffset:i,sidxMapping:n,previousManifest:s})=>{const r=My(e,{manifestUri:t,clientOffset:i,sidxMapping:n,previousManifest:s});return dE(r,t,GE),r})({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(e){this.error=e,this.error.metadata={errorType:ES.Error.StreamingDashManifestParserError,error:e},this.trigger("error")}e&&(i=XE(e,i,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=i||e;const n=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(n&&n!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=n),(!e||i&&i.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(i),i){const{duration:e,endList:n}=i,s=[];i.playlists.forEach(e=>{s.push({id:e.id,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS})});const r={duration:e,isLive:!n,renditions:s};t.parsedManifest=r,this.trigger({type:"manifestparsecomplete",metadata:t})}return Boolean(i)}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(Dd.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;0===t&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),"number"!=typeof t||t<=0?t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`):this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=Dd.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=((e,t)=>{let i=YE(e.playlists,t);return cE(e,(e,n,s,r)=>{if(e.playlists&&e.playlists.length){const n=e.playlists;i=OS(i,YE(n,t))}}),i})(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,e=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const t=this.mainPlaylistLoader_.main.playlists,i=!this.media_||this.media_!==t[e];if(i?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const e=()=>{this.media().endList||(this.mediaUpdateTimeout=Dd.setTimeout(()=>{this.trigger("mediaupdatetimeout"),e()},xE(this.media(),Boolean(i))))};e()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const e=this.mainPlaylistLoader_.main.eventStream.map(e=>({cueTime:e.start,frames:[{data:e.messageData}]}));this.addMetadataToTextTrack("EventStream",e,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const n=e.contentProtection[i].attributes["cenc:default_KID"];n&&t.add(n.replace(/-/g,"").toLowerCase())}return t}}}var JE={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const ZE=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},eC=function(e){return function(){const t=function(e){try{return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch(t){const i=new BlobBuilder;return i.append(e),URL.createObjectURL(i.getBlob())}}(e),i=ZE(new Worker(t));i.objURL=t;const n=i.terminate;return i.on=i.addEventListener,i.off=i.removeEventListener,i.terminate=function(){return URL.revokeObjectURL(t),n.call(this)},i}},tC=function(e){return`var browserWorkerPolyFill = ${ZE.toString()};\nbrowserWorkerPolyFill(self);\n`+e},iC=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)},nC=tC(iC(function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=function(){this.init=function(){var e={};this.on=function(t,i){e[t]||(e[t]=[]),e[t]=e[t].concat(i)},this.off=function(t,i){var n;return!!e[t]&&(n=e[t].indexOf(i),e[t]=e[t].slice(),e[t].splice(n,1),n>-1)},this.trigger=function(t){var i,n,s,r;if(i=e[t])if(2===arguments.length)for(s=i.length,n=0;n<s;++n)i[n].call(this,arguments[1]);else{for(r=[],n=arguments.length,n=1;n<arguments.length;++n)r.push(arguments[n]);for(s=i.length,n=0;n<s;++n)i[n].apply(this,r)}},this.dispose=function(){e={}}}};t.prototype.pipe=function(e){return this.on("data",function(t){e.push(t)}),this.on("done",function(t){e.flush(t)}),this.on("partialdone",function(t){e.partialFlush(t)}),this.on("endedtimeline",function(t){e.endTimeline(t)}),this.on("reset",function(t){e.reset(t)}),e},t.prototype.push=function(e){this.trigger("data",e)},t.prototype.flush=function(e){this.trigger("done",e)},t.prototype.partialFlush=function(e){this.trigger("partialdone",e)},t.prototype.endTimeline=function(e){this.trigger("endedtimeline",e)},t.prototype.reset=function(e){this.trigger("reset",e)};var i,n,s,r,a,o,l,u,c,h,d,p,f,m,g,y,_,v,b,T,w,S,E,C,k,x,I,A,L,P,O,D,M,N,R,F,B,U,j,$,q=t,V=Math.pow(2,32),H={getUint64:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.getBigUint64?(t=i.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(t):t:i.getUint32(0)*V+i.getUint32(4)},MAX_UINT32:V},z=H.MAX_UINT32;!function(){var e;if(S={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!=typeof Uint8Array){for(e in S)S.hasOwnProperty(e)&&(S[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);E=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),k=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),C=new Uint8Array([0,0,0,1]),x=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),I=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),A={video:x,audio:I},O=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),P=new Uint8Array([0,0,0,0,0,0,0,0]),D=new Uint8Array([0,0,0,0,0,0,0,0]),M=D,N=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),R=D,L=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),i=function(e){var t,i,n=[],s=0;for(t=1;t<arguments.length;t++)n.push(arguments[t]);for(t=n.length;t--;)s+=n[t].byteLength;for(i=new Uint8Array(s+8),new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,i.byteLength),i.set(e,4),t=0,s=8;t<n.length;t++)i.set(n[t],s),s+=n[t].byteLength;return i},n=function(){return i(S.dinf,i(S.dref,O))},s=function(e){return i(S.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]))},g=function(e){return i(S.hdlr,A[e])},m=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(t[12]=e.samplerate>>>24&255,t[13]=e.samplerate>>>16&255,t[14]=e.samplerate>>>8&255,t[15]=255&e.samplerate),i(S.mdhd,t)},f=function(e){return i(S.mdia,m(e),g(e.type),o(e))},a=function(e){return i(S.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},o=function(e){return i(S.minf,"video"===e.type?i(S.vmhd,L):i(S.smhd,P),n(),_(e))},l=function(e,t){for(var n=[],s=t.length;s--;)n[s]=b(t[s]);return i.apply(null,[S.moof,a(e)].concat(n))},u=function(e){for(var t=e.length,n=[];t--;)n[t]=d(e[t]);return i.apply(null,[S.moov,h(4294967295)].concat(n).concat(c(e)))},c=function(e){for(var t=e.length,n=[];t--;)n[t]=T(e[t]);return i.apply(null,[S.mvex].concat(n))},h=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return i(S.mvhd,t)},y=function(e){var t,n,s=e.samples||[],r=new Uint8Array(4+s.length);for(n=0;n<s.length;n++)t=s[n].flags,r[n+4]=t.dependsOn<<4|t.isDependedOn<<2|t.hasRedundancy;return i(S.sdtp,r)},_=function(e){return i(S.stbl,v(e),i(S.stts,R),i(S.stsc,M),i(S.stsz,N),i(S.stco,D))},v=function(e){return i(S.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===e.type?F(e):B(e))},F=function(e){var t,n,s=e.sps||[],r=e.pps||[],a=[],o=[];for(t=0;t<s.length;t++)a.push((65280&s[t].byteLength)>>>8),a.push(255&s[t].byteLength),a=a.concat(Array.prototype.slice.call(s[t]));for(t=0;t<r.length;t++)o.push((65280&r[t].byteLength)>>>8),o.push(255&r[t].byteLength),o=o.concat(Array.prototype.slice.call(r[t]));if(n=[S.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),i(S.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([s.length],a,[r.length],o))),i(S.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio){var l=e.sarRatio[0],u=e.sarRatio[1];n.push(i(S.pasp,new Uint8Array([(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l,(4278190080&u)>>24,(16711680&u)>>16,(65280&u)>>8,255&u])))}return i.apply(null,n)},B=function(e){return i(S.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),s(e))},p=function(e){var t=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return i(S.tkhd,t)},b=function(e){var t,n,s,r,a,o;return t=i(S.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),a=Math.floor(e.baseMediaDecodeTime/z),o=Math.floor(e.baseMediaDecodeTime%z),n=i(S.tfdt,new Uint8Array([1,0,0,0,a>>>24&255,a>>>16&255,a>>>8&255,255&a,o>>>24&255,o>>>16&255,o>>>8&255,255&o])),"audio"===e.type?(s=w(e,92),i(S.traf,t,n,s)):(r=y(e),s=w(e,r.length+92),i(S.traf,t,n,s,r))},d=function(e){return e.duration=e.duration||4294967295,i(S.trak,p(e),f(e))},T=function(e){var t=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(t[t.length-1]=0),i(S.trex,t)},$=function(e,t){var i=0,n=0,s=0,r=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(n=2),void 0!==e[0].flags&&(s=4),void 0!==e[0].compositionTimeOffset&&(r=8)),[0,0,i|n|s|r,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},j=function(e,t){var n,s,r,a,o,l;for(t+=20+16*(a=e.samples||[]).length,r=$(a,t),(s=new Uint8Array(r.length+16*a.length)).set(r),n=r.length,l=0;l<a.length;l++)o=a[l],s[n++]=(4278190080&o.duration)>>>24,s[n++]=(16711680&o.duration)>>>16,s[n++]=(65280&o.duration)>>>8,s[n++]=255&o.duration,s[n++]=(4278190080&o.size)>>>24,s[n++]=(16711680&o.size)>>>16,s[n++]=(65280&o.size)>>>8,s[n++]=255&o.size,s[n++]=o.flags.isLeading<<2|o.flags.dependsOn,s[n++]=o.flags.isDependedOn<<6|o.flags.hasRedundancy<<4|o.flags.paddingValue<<1|o.flags.isNonSyncSample,s[n++]=61440&o.flags.degradationPriority,s[n++]=15&o.flags.degradationPriority,s[n++]=(4278190080&o.compositionTimeOffset)>>>24,s[n++]=(16711680&o.compositionTimeOffset)>>>16,s[n++]=(65280&o.compositionTimeOffset)>>>8,s[n++]=255&o.compositionTimeOffset;return i(S.trun,s)},U=function(e,t){var n,s,r,a,o,l;for(t+=20+8*(a=e.samples||[]).length,r=$(a,t),(n=new Uint8Array(r.length+8*a.length)).set(r),s=r.length,l=0;l<a.length;l++)o=a[l],n[s++]=(4278190080&o.duration)>>>24,n[s++]=(16711680&o.duration)>>>16,n[s++]=(65280&o.duration)>>>8,n[s++]=255&o.duration,n[s++]=(4278190080&o.size)>>>24,n[s++]=(16711680&o.size)>>>16,n[s++]=(65280&o.size)>>>8,n[s++]=255&o.size;return i(S.trun,n)},w=function(e,t){return"audio"===e.type?U(e,t):j(e,t)};var W,G,X,K,Y,Q,J,Z,ee={ftyp:r=function(){return i(S.ftyp,E,C,E,k)},mdat:function(e){return i(S.mdat,e)},moof:l,moov:u,initSegment:function(e){var t,i=r(),n=u(e);return(t=new Uint8Array(i.byteLength+n.byteLength)).set(i),t.set(n,i.byteLength),t}},te=function(e,t){var i={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return i.dataOffset=t,i.compositionTimeOffset=e.pts-e.dts,i.duration=e.duration,i.size=4*e.length,i.size+=e.byteLength,e.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i},ie={groupNalsIntoFrames:function(e){var t,i,n=[],s=[];for(s.byteLength=0,s.nalCount=0,s.duration=0,n.byteLength=0,t=0;t<e.length;t++)"access_unit_delimiter_rbsp"===(i=e[t]).nalUnitType?(n.length&&(n.duration=i.dts-n.dts,s.byteLength+=n.byteLength,s.nalCount+=n.length,s.duration+=n.duration,s.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 s.length&&(!n.duration||n.duration<=0)&&(n.duration=s[s.length-1].duration),s.byteLength+=n.byteLength,s.nalCount+=n.length,s.duration+=n.duration,s.push(n),s},groupFramesIntoGops:function(e){var t,i,n=[],s=[];for(n.byteLength=0,n.nalCount=0,n.duration=0,n.pts=e[0].pts,n.dts=e[0].dts,s.byteLength=0,s.nalCount=0,s.duration=0,s.pts=e[0].pts,s.dts=e[0].dts,t=0;t<e.length;t++)(i=e[t]).keyFrame?(n.length&&(s.push(n),s.byteLength+=n.byteLength,s.nalCount+=n.nalCount,s.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 s.length&&n.duration<=0&&(n.duration=s[s.length-1].duration),s.byteLength+=n.byteLength,s.nalCount+=n.nalCount,s.duration+=n.duration,s.push(n),s},extendFirstKeyFrame:function(e){var t;return!e[0][0].keyFrame&&e.length>1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},generateSampleTable:function(e,t){var i,n,s,r,a,o=t||0,l=[];for(i=0;i<e.length;i++)for(r=e[i],n=0;n<r.length;n++)a=r[n],o+=(s=te(a,o)).size,l.push(s);return l},concatenateNalData:function(e){var t,i,n,s,r,a,o=0,l=e.byteLength,u=e.nalCount,c=new Uint8Array(l+4*u),h=new DataView(c.buffer);for(t=0;t<e.length;t++)for(s=e[t],i=0;i<s.length;i++)for(r=s[i],n=0;n<r.length;n++)a=r[n],h.setUint32(o,a.data.byteLength),o+=4,c.set(a.data,o),o+=a.data.byteLength;return c},generateSampleTableForFrame:function(e,t){var i,n=[];return i=te(e,t||0),n.push(i),n},concatenateNalDataForFrame:function(e){var t,i,n=0,s=e.byteLength,r=e.length,a=new Uint8Array(s+4*r),o=new DataView(a.buffer);for(t=0;t<e.length;t++)i=e[t],o.setUint32(n,i.data.byteLength),n+=4,a.set(i.data,n),n+=i.data.byteLength;return a}},ne=[33,16,5,32,164,27],se=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],re=function(e){for(var t=[];e--;)t.push(0);return t},ae=9e4;Q=function(e,t){return G(Y(e,t))},J=function(e,t){return X(K(e),t)},Z=function(e,t,i){return K(i?e:e-t)};var oe={ONE_SECOND_IN_TS:ae,secondsToVideoTs:G=function(e){return e*ae},secondsToAudioTs:X=function(e,t){return e*t},videoTsToSeconds:K=function(e){return e/ae},audioTsToSeconds:Y=function(e,t){return e/t},audioTsToVideoTs:Q,videoTsToAudioTs:J,metadataTsToSeconds:Z},le=function(){if(!W){var e={96e3:[ne,[227,64],re(154),[56]],88200:[ne,[231],re(170),[56]],64e3:[ne,[248,192],re(240),[56]],48e3:[ne,[255,192],re(268),[55,148,128],re(54),[112]],44100:[ne,[255,192],re(268),[55,163,128],re(84),[112]],32e3:[ne,[255,192],re(268),[55,234],re(226),[112]],24e3:[ne,[255,192],re(268),[55,255,128],re(268),[111,112],re(126),[224]],16e3:[ne,[255,192],re(268),[55,255,128],re(268),[111,255],re(269),[223,108],re(195),[1,192]],12e3:[se,re(268),[3,127,248],re(268),[6,255,240],re(268),[13,255,224],re(268),[27,253,128],re(259),[56]],11025:[se,re(268),[3,127,248],re(268),[6,255,240],re(268),[13,255,224],re(268),[27,255,192],re(268),[55,175,128],re(108),[112]],8e3:[se,re(268),[3,121,16],re(47),[7]]};t=e,W=Object.keys(t).reduce(function(e,i){return e[i]=new Uint8Array(t[i].reduce(function(e,t){return e.concat(t)},[])),e},{})}var t;return W},ue=oe,ce={prefixWithSilence:function(e,t,i,n){var s,r,a,o,l,u=0,c=0,h=0;if(t.length&&(s=ue.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),r=Math.ceil(ue.ONE_SECOND_IN_TS/(e.samplerate/1024)),i&&n&&(u=s-Math.max(i,n),h=(c=Math.floor(u/r))*r),!(c<1||h>ue.ONE_SECOND_IN_TS/2))){for((a=le()[e.samplerate])||(a=t[0].data),o=0;o<c;o++)l=t[0],t.splice(0,0,{data:a,dts:l.dts-r,pts:l.pts-r});return e.baseMediaDecodeTime-=Math.floor(ue.videoTsToAudioTs(h,e.samplerate)),h}},trimAdtsFramesByEarliestDts:function(e,t,i){return t.minSegmentDts>=i?e:(t.minSegmentDts=1/0,e.filter(function(e){return e.dts>=i&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)}))},generateSampleTable:function(e){var t,i,n=[];for(t=0;t<e.length;t++)i=e[t],n.push({size:i.data.byteLength,duration:1024});return n},concatenateFrameData:function(e){var t,i,n=0,s=new Uint8Array(function(e){var t,i=0;for(t=0;t<e.length;t++)i+=e[t].data.byteLength;return i}(e));for(t=0;t<e.length;t++)i=e[t],s.set(i.data,n),n+=i.data.byteLength;return s}},he=oe.ONE_SECOND_IN_TS,de={clearDtsInfo:function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},calculateTrackBaseMediaDecodeTime:function(e,t){var i,n=e.minSegmentDts;return t||(n-=e.timelineStartInfo.dts),i=e.timelineStartInfo.baseMediaDecodeTime,i+=n,i=Math.max(0,i),"audio"===e.type&&(i*=e.samplerate/he,i=Math.floor(i)),i},collectDtsInfo:function(e,t){"number"==typeof t.pts&&(void 0===e.timelineStartInfo.pts&&(e.timelineStartInfo.pts=t.pts),void 0===e.minSegmentPts?e.minSegmentPts=t.pts:e.minSegmentPts=Math.min(e.minSegmentPts,t.pts),void 0===e.maxSegmentPts?e.maxSegmentPts=t.pts:e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)),"number"==typeof t.dts&&(void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),void 0===e.minSegmentDts?e.minSegmentDts=t.dts:e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),void 0===e.maxSegmentDts?e.maxSegmentDts=t.dts:e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts))}},pe={parseSei:function(e){for(var t=0,i={payloadType:-1,payloadSize:0},n=0,s=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)n+=255,t++;for(n+=e[t++];255===e[t];)s+=255,t++;if(s+=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=s,i.payload=e.subarray(t,t+s);break}i.payload=void 0}t+=s,n=0,s=0}return i},parseUserData:function(e){return 181!==e.payload[0]||49!=(e.payload[1]<<8|e.payload[2])||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},parseCaptionPackets:function(e,t){var i,n,s,r,a=[];if(!(64&t[0]))return a;for(n=31&t[0],i=0;i<n;i++)r={type:3&t[(s=3*i)+2],pts:e},4&t[s+2]&&(r.ccData=t[s+3]<<8|t[s+4],a.push(r));return a},discardEmulationPreventionBytes:function(e){for(var t,i,n=e.byteLength,s=[],r=1;r<n-2;)0===e[r]&&0===e[r+1]&&3===e[r+2]?(s.push(r+2),r+=2):r++;if(0===s.length)return e;t=n-s.length,i=new Uint8Array(t);var a=0;for(r=0;r<t;a++,r++)a===s[0]&&(a++,s.shift()),i[r]=e[a];return i},USER_DATA_REGISTERED_ITU_T_T35:4},fe=q,me=pe,ge=function(e){e=e||{},ge.prototype.init.call(this),this.parse708captions_="boolean"!=typeof e.parse708captions||e.parse708captions,this.captionPackets_=[],this.ccStreams_=[new ke(0,0),new ke(0,1),new ke(1,0),new ke(1,1)],this.parse708captions_&&(this.cc708Stream_=new Te({captionServices:e.captionServices})),this.reset(),this.ccStreams_.forEach(function(e){e.on("data",this.trigger.bind(this,"data")),e.on("partialdone",this.trigger.bind(this,"partialdone")),e.on("done",this.trigger.bind(this,"done"))},this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};ge.prototype=new fe,ge.prototype.push=function(e){var t,i,n;if("sei_rbsp"===e.nalUnitType&&(t=me.parseSei(e.escapedRBSP)).payload&&t.payloadType===me.USER_DATA_REGISTERED_ITU_T_T35&&(i=me.parseUserData(t)))if(e.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));n=me.parseCaptionPackets(e.pts,i),this.captionPackets_=this.captionPackets_.concat(n),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},ge.prototype.flushCCStreams=function(e){this.ccStreams_.forEach(function(t){return"flush"===e?t.flush():t.partialFlush()},this)},ge.prototype.flushStream=function(e){this.captionPackets_.length?(this.captionPackets_.forEach(function(e,t){e.presortIndex=t}),this.captionPackets_.sort(function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts}),this.captionPackets_.forEach(function(e){e.type<2?this.dispatchCea608Packet(e):this.dispatchCea708Packet(e)},this),this.captionPackets_.length=0,this.flushCCStreams(e)):this.flushCCStreams(e)},ge.prototype.flush=function(){return this.flushStream("flush")},ge.prototype.partialFlush=function(){return this.flushStream("partialFlush")},ge.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(e){e.reset()})},ge.prototype.dispatchCea608Packet=function(e){this.setsTextOrXDSActive(e)?this.activeCea608Channel_[e.type]=null:this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},ge.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},ge.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)},ge.prototype.setsTextOrXDSActive=function(e){return 256==(28928&e.ccData)||4138==(30974&e.ccData)||6186==(30974&e.ccData)},ge.prototype.dispatchCea708Packet=function(e){this.parse708captions_&&this.cc708Stream_.push(e)};var ye={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},_e=function(e){return 32<=e&&e<=127||160<=e&&e<=255},ve=function(e){this.windowNum=e,this.reset()};ve.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},ve.prototype.getText=function(){return this.rows.join("\n")},ve.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},ve.prototype.newLine=function(e){for(this.rows.length>=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},ve.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},ve.prototype.addText=function(e){this.rows[this.rowIdx]+=e},ve.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var be=function(e,t,i){this.serviceNum=e,this.text="",this.currentWindow=new ve(-1),this.windows=[],this.stream=i,"string"==typeof t&&this.createTextDecoder(t)};be.prototype.init=function(e,t){this.startPts=e;for(var i=0;i<8;i++)this.windows[i]=new ve(i),"function"==typeof t&&(this.windows[i].beforeRowOverflow=t)},be.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]},be.prototype.createTextDecoder=function(e){if("undefined"==typeof TextDecoder)this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(e)}catch(t){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+e+" encoding. "+t})}};var Te=function(e){e=e||{},Te.prototype.init.call(this);var t,i=this,n=e.captionServices||{},s={};Object.keys(n).forEach(e=>{t=n[e],/^SERVICE/.test(e)&&(s[e]=t.encoding)}),this.serviceEncodings=s,this.current708Packet=null,this.services={},this.push=function(e){3===e.type?(i.new708Packet(),i.add708Bytes(e)):(null===i.current708Packet&&i.new708Packet(),i.add708Bytes(e))}};Te.prototype=new fe,Te.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},Te.prototype.add708Bytes=function(e){var t=e.ccData,i=t>>>8,n=255&t;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(i),this.current708Packet.data.push(n)},Te.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,i=null,n=null,s=0,r=t[s++];for(e.seq=r>>6,e.sizeCode=63&r;s<t.length;s++)n=31&(r=t[s++]),7===(i=r>>5)&&n>0&&(i=r=t[s++]),this.pushServiceBlock(i,s,n),n>0&&(s+=n-1)},Te.prototype.pushServiceBlock=function(e,t,i){var n,s=t,r=this.current708Packet.data,a=this.services[e];for(a||(a=this.initService(e,s));s<t+i&&s<r.length;s++)n=r[s],_e(n)?s=this.handleText(s,a):24===n?s=this.multiByteCharacter(s,a):16===n?s=this.extendedCommands(s,a):128<=n&&n<=135?s=this.setCurrentWindow(s,a):152<=n&&n<=159?s=this.defineWindow(s,a):136===n?s=this.clearWindows(s,a):140===n?s=this.deleteWindows(s,a):137===n?s=this.displayWindows(s,a):138===n?s=this.hideWindows(s,a):139===n?s=this.toggleWindows(s,a):151===n?s=this.setWindowAttributes(s,a):144===n?s=this.setPenAttributes(s,a):145===n?s=this.setPenColor(s,a):146===n?s=this.setPenLocation(s,a):143===n?a=this.reset(s,a):8===n?a.currentWindow.backspace():12===n?a.currentWindow.clearText():13===n?a.currentWindow.pendingNewLine=!0:14===n?a.currentWindow.clearText():141===n&&s++},Te.prototype.extendedCommands=function(e,t){var i=this.current708Packet.data[++e];return _e(i)&&(e=this.handleText(e,t,{isExtended:!0})),e},Te.prototype.getPts=function(e){return this.current708Packet.ptsVals[Math.floor(e/2)]},Te.prototype.initService=function(e,t){var i,n,s=this;return(i="SERVICE"+e)in this.serviceEncodings&&(n=this.serviceEncodings[i]),this.services[e]=new be(e,n,s),this.services[e].init(this.getPts(t),function(t){s.flushDisplayed(t,s.services[e])}),this.services[e]},Te.prototype.handleText=function(e,t,i){var n,s,r,a,o=i&&i.isExtended,l=i&&i.isMultiByte,u=this.current708Packet.data,c=o?4096:0,h=u[e],d=u[e+1],p=t.currentWindow;if(l?(s=[h,d],e++):s=[h],t.textDecoder_&&!o)n=t.textDecoder_.decode(new Uint8Array(s));else if(l){const e=s.map(e=>("0"+(255&e).toString(16)).slice(-2)).join("");n=String.fromCharCode(parseInt(e,16))}else a=ye[r=c|h]||r,n=4096&r&&r===a?"":String.fromCharCode(a);return p.pendingNewLine&&!p.isEmpty()&&p.newLine(this.getPts(e)),p.pendingNewLine=!1,p.addText(n),e},Te.prototype.multiByteCharacter=function(e,t){var i=this.current708Packet.data,n=i[e+1],s=i[e+2];return _e(n)&&_e(s)&&(e=this.handleText(++e,t,{isMultiByte:!0})),e},Te.prototype.setCurrentWindow=function(e,t){var i=7&this.current708Packet.data[e];return t.setCurrentWindow(i),e},Te.prototype.defineWindow=function(e,t){var i=this.current708Packet.data,n=i[e],s=7&n;t.setCurrentWindow(s);var r=t.currentWindow;return n=i[++e],r.visible=(32&n)>>5,r.rowLock=(16&n)>>4,r.columnLock=(8&n)>>3,r.priority=7&n,n=i[++e],r.relativePositioning=(128&n)>>7,r.anchorVertical=127&n,n=i[++e],r.anchorHorizontal=n,n=i[++e],r.anchorPoint=(240&n)>>4,r.rowCount=15&n,n=i[++e],r.columnCount=63&n,n=i[++e],r.windowStyle=(56&n)>>3,r.penStyle=7&n,r.virtualRowCount=r.rowCount+1,e},Te.prototype.setWindowAttributes=function(e,t){var i=this.current708Packet.data,n=i[e],s=t.currentWindow.winAttr;return n=i[++e],s.fillOpacity=(192&n)>>6,s.fillRed=(48&n)>>4,s.fillGreen=(12&n)>>2,s.fillBlue=3&n,n=i[++e],s.borderType=(192&n)>>6,s.borderRed=(48&n)>>4,s.borderGreen=(12&n)>>2,s.borderBlue=3&n,n=i[++e],s.borderType+=(128&n)>>5,s.wordWrap=(64&n)>>6,s.printDirection=(48&n)>>4,s.scrollDirection=(12&n)>>2,s.justify=3&n,n=i[++e],s.effectSpeed=(240&n)>>4,s.effectDirection=(12&n)>>2,s.displayEffect=3&n,e},Te.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},Te.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)},Te.prototype.displayWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var s=0;s<8;s++)i&1<<s&&(t.windows[s].visible=1);return e},Te.prototype.hideWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var s=0;s<8;s++)i&1<<s&&(t.windows[s].visible=0);return e},Te.prototype.toggleWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var s=0;s<8;s++)i&1<<s&&(t.windows[s].visible^=1);return e},Te.prototype.clearWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var s=0;s<8;s++)i&1<<s&&t.windows[s].clearText();return e},Te.prototype.deleteWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var s=0;s<8;s++)i&1<<s&&t.windows[s].reset();return e},Te.prototype.setPenAttributes=function(e,t){var i=this.current708Packet.data,n=i[e],s=t.currentWindow.penAttr;return n=i[++e],s.textTag=(240&n)>>4,s.offset=(12&n)>>2,s.penSize=3&n,n=i[++e],s.italics=(128&n)>>7,s.underline=(64&n)>>6,s.edgeType=(56&n)>>3,s.fontStyle=7&n,e},Te.prototype.setPenColor=function(e,t){var i=this.current708Packet.data,n=i[e],s=t.currentWindow.penColor;return n=i[++e],s.fgOpacity=(192&n)>>6,s.fgRed=(48&n)>>4,s.fgGreen=(12&n)>>2,s.fgBlue=3&n,n=i[++e],s.bgOpacity=(192&n)>>6,s.bgRed=(48&n)>>4,s.bgGreen=(12&n)>>2,s.bgBlue=3&n,n=i[++e],s.edgeRed=(48&n)>>4,s.edgeGreen=(12&n)>>2,s.edgeBlue=3&n,e},Te.prototype.setPenLocation=function(e,t){var i=this.current708Packet.data,n=i[e],s=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,n=i[++e],s.row=15&n,n=i[++e],s.column=63&n,e},Te.prototype.reset=function(e,t){var i=this.getPts(e);return this.flushDisplayed(i,t),this.initService(t.serviceNum,e)};var we={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Se=function(e){return null===e?"":(e=we[e]||e,String.fromCharCode(e))},Ee=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Ce=function(){for(var e=[],t=15;t--;)e.push({text:"",indent:0,offset:0});return e},ke=function(e,t){ke.prototype.init.call(this),this.field_=e||0,this.dataChannel_=t||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,i,n,s,r;if((t=32639&e.ccData)!==this.lastControlCode_){if(4096==(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),n=t>>>8,s=255&t,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(t===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(t===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=Ce();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Ce();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=Ce()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(n,s))r=Se((n=(3&n)<<8)|s),this[this.mode_](e.pts,r),this.column_++;else if(this.isExtCharacter(n,s))"popOn"===this.mode_?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),r=Se((n=(3&n)<<8)|s),this[this.mode_](e.pts,r),this.column_++;else if(this.isMidRowCode(n,s))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14&~s||this.addFormatting(e.pts,["i"]),1&~s||this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(n,s)){const e=3&s;this.nonDisplayed_[this.row_].offset=e,this.column_+=e}else if(this.isPAC(n,s)){var a=Ee.indexOf(7968&t);if("rollUp"===this.mode_&&(a-this.rollUpRows_+1<0&&(a=this.rollUpRows_-1),this.setRollUp(e.pts,a)),a!==this.row_&&a>=0&&a<=14&&(this.clearFormatting(e.pts),this.row_=a),1&s&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),!(16&~t)){const e=(14&t)>>1;this.column_=4*e,this.nonDisplayed_[this.row_].indent+=e}this.isColorPAC(s)&&(14&~s||this.addFormatting(e.pts,["i"]))}else this.isNormalChar(n)&&(0===s&&(s=null),r=Se(n),r+=Se(s),this[this.mode_](e.pts,r),this.column_+=r.length)}else this.lastControlCode_=null}};ke.prototype=new fe,ke.prototype.flushDisplayed=function(e){const t=e=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+e+"."})},i=[];this.displayed_.forEach((e,n)=>{if(e&&e.text&&e.text.length){try{e.text=e.text.trim()}catch(e){t(n)}e.text.length&&i.push({text:e.text,line:n+1,position:10+Math.min(70,10*e.indent)+2.5*e.offset})}else null==e&&t(n)}),i.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,content:i,stream:this.name_})},ke.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Ce(),this.nonDisplayed_=Ce(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},ke.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},ke.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},ke.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},ke.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},ke.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},ke.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},ke.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},ke.prototype.isNormalChar=function(e){return e>=32&&e<=127},ke.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=Ce(),this.displayed_=Ce()),void 0!==t&&t!==this.row_)for(var i=0;i<this.rollUpRows_;i++)this.displayed_[t-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]={text:"",indent:0,offset:0};void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},ke.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var i=t.reduce(function(e,t){return e+"<"+t+">"},"");this[this.mode_](e,i)},ke.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce(function(e,t){return e+"</"+t+">"},"");this.formatting_=[],this[this.mode_](e,t)}},ke.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_].text;i+=t,this.nonDisplayed_[this.row_].text=i},ke.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_].text;i+=t,this.displayed_[this.row_].text=i},ke.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++)this.displayed_[e]={text:"",indent:0,offset:0};for(e=this.row_+1;e<15;e++)this.displayed_[e]={text:"",indent:0,offset:0};for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]={text:"",indent:0,offset:0}},ke.prototype.paintOn=function(e,t){var i=this.displayed_[this.row_].text;i+=t,this.displayed_[this.row_].text=i};var xe={CaptionStream:ge,Cea608Stream:ke,Cea708Stream:Te},Ie={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Ae=q,Le="shared",Pe=function(e,t){var i=1;for(e>t&&(i=-1);Math.abs(t-e)>4294967296;)e+=8589934592*i;return e},Oe=function(e){var t,i;Oe.prototype.init.call(this),this.type_=e||Le,this.push=function(e){"metadata"!==e.type?this.type_!==Le&&e.type!==this.type_||(void 0===i&&(i=e.dts),e.dts=Pe(e.dts,i),e.pts=Pe(e.pts,i),t=e.dts,this.trigger("data",e)):this.trigger("data",e)},this.flush=function(){i=t,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){i=void 0,t=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Oe.prototype=new Ae;var De,Me={TimestampRolloverStream:Oe,handleRollover:Pe},Ne=(e,t,i)=>{if(!e)return-1;for(var n=i;n<e.length;n++)if(e[n]===t)return n;return-1},Re=Ne,Fe=3,Be=function(e,t,i){var n,s="";for(n=t;n<i;n++)s+="%"+("00"+e[n].toString(16)).slice(-2);return s},Ue=function(e,t,i){return decodeURIComponent(Be(e,t,i))},je=function(e,t,i){return unescape(Be(e,t,i))},$e=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},qe={APIC:function(e){var t,i,n=1;e.data[0]===Fe&&((t=Re(e.data,0,n))<0||(e.mimeType=je(e.data,n,t),n=t+1,e.pictureType=e.data[n],n++,(i=Re(e.data,0,n))<0||(e.description=Ue(e.data,n,i),n=i+1,"--\x3e"===e.mimeType?e.url=je(e.data,n,e.data.length):e.pictureData=e.data.subarray(n,e.data.length))))},"T*":function(e){e.data[0]===Fe&&(e.value=Ue(e.data,1,e.data.length).replace(/\0*$/,""),e.values=e.value.split("\0"))},TXXX:function(e){var t;e.data[0]===Fe&&-1!==(t=Re(e.data,0,1))&&(e.description=Ue(e.data,1,t),e.value=Ue(e.data,t+1,e.data.length).replace(/\0*$/,""),e.data=e.value)},"W*":function(e){e.url=je(e.data,0,e.data.length).replace(/\0.*$/,"")},WXXX:function(e){var t;e.data[0]===Fe&&-1!==(t=Re(e.data,0,1))&&(e.description=Ue(e.data,1,t),e.url=je(e.data,t+1,e.data.length).replace(/\0.*$/,""))},PRIV:function(e){var t;for(t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=je(e.data,0,t);break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}},Ve={parseId3Frames:function(e){var t,i=10,n=0,s=[];if(!(e.length<10||e[0]!=="I".charCodeAt(0)||e[1]!=="D".charCodeAt(0)||e[2]!=="3".charCodeAt(0))){n=$e(e.subarray(6,10)),n+=10,64&e[5]&&(i+=4,i+=$e(e.subarray(10,14)),n-=$e(e.subarray(16,20)));do{if((t=$e(e.subarray(i+4,i+8)))<1)break;var r={id:String.fromCharCode(e[i],e[i+1],e[i+2],e[i+3]),data:e.subarray(i+10,i+t+10)};r.key=r.id,qe[r.id]?qe[r.id](r):"T"===r.id[0]?qe["T*"](r):"W"===r.id[0]&&qe["W*"](r),s.push(r),i+=10,i+=t}while(i<n);return s}},parseSyncSafeInteger:$e,frameParsers:qe},He=Ie,ze=Ve;(De=function(e){var t,i={descriptor:e&&e.descriptor},n=0,s=[],r=0;if(De.prototype.init.call(this),this.dispatchType=He.METADATA_STREAM_TYPE.toString(16),i.descriptor)for(t=0;t<i.descriptor.length;t++)this.dispatchType+=("00"+i.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,i,a,o,l;if("timed-metadata"===e.type)if(e.dataAlignmentIndicator&&(r=0,s.length=0),0===s.length&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0)))this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});else if(s.push(e),r+=e.data.byteLength,1===s.length&&(n=ze.parseSyncSafeInteger(e.data.subarray(6,10)),n+=10),!(r<n)){for(t={data:new Uint8Array(n),frames:[],pts:s[0].pts,dts:s[0].dts},l=0;l<n;)t.data.set(s[0].data.subarray(0,n-l),l),l+=s[0].data.byteLength,r-=s[0].data.byteLength,s.shift();i=10,64&t.data[5]&&(i+=4,i+=ze.parseSyncSafeInteger(t.data.subarray(10,14)),n-=ze.parseSyncSafeInteger(t.data.subarray(16,20)));do{if((a=ze.parseSyncSafeInteger(t.data.subarray(i+4,i+8)))<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if((o={id:String.fromCharCode(t.data[i],t.data[i+1],t.data[i+2],t.data[i+3]),data:t.data.subarray(i+10,i+a+10)}).key=o.id,ze.frameParsers[o.id]?ze.frameParsers[o.id](o):"T"===o.id[0]?ze.frameParsers["T*"](o):"W"===o.id[0]&&ze.frameParsers["W*"](o),"com.apple.streaming.transportStreamTimestamp"===o.owner){var u=o.data,c=(1&u[3])<<30|u[4]<<22|u[5]<<14|u[6]<<6|u[7]>>>2;c*=4,c+=3&u[7],o.timeStamp=c,void 0===t.pts&&void 0===t.dts&&(t.pts=o.timeStamp,t.dts=o.timeStamp),this.trigger("timestamp",o)}t.frames.push(o),i+=10,i+=a}while(i<n);this.trigger("data",t)}}}).prototype=new q;var We,Ge,Xe,Ke=De,Ye=q,Qe=xe,Je=Ie,Ze=Me.TimestampRolloverStream,et=188;(We=function(){var e=new Uint8Array(et),t=0;We.prototype.init.call(this),this.push=function(i){var n,s=0,r=et;for(t?((n=new Uint8Array(i.byteLength+t)).set(e.subarray(0,t)),n.set(i,t),t=0):n=i;r<n.byteLength;)71!==n[s]||71!==n[r]?(s++,r++):(this.trigger("data",n.subarray(s,r)),s+=et,r+=et);s<n.byteLength&&(e.set(n.subarray(s),0),t=n.byteLength-s)},this.flush=function(){t===et&&71===e[0]&&(this.trigger("data",e),t=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){t=0,this.trigger("reset")}}).prototype=new Ye,Ge=function(){var e,t,i,n;Ge.prototype.init.call(this),n=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,n){var s=0;n.payloadUnitStartIndicator&&(s+=e[s]+1),"pat"===n.type?t(e.subarray(s),n):i(e.subarray(s),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,s;if(1&e[5]){for(n.programMapTable={video:null,audio:null,"timed-metadata":{}},i=3+((15&e[1])<<8|e[2])-4,s=12+((15&e[10])<<8|e[11]);s<i;){var r=e[s],a=(31&e[s+1])<<8|e[s+2];r===Je.H264_STREAM_TYPE&&null===n.programMapTable.video?n.programMapTable.video=a:r===Je.ADTS_STREAM_TYPE&&null===n.programMapTable.audio?n.programMapTable.audio=a:r===Je.METADATA_STREAM_TYPE&&(n.programMapTable["timed-metadata"][a]=r),s+=5+((15&e[s+3])<<8|e[s+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],(48&t[3])>>>4>1&&(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)}},Ge.prototype=new Ye,Ge.STREAM_TYPES={h264:27,adts:15},Xe=function(){var e,t=this,i=!1,n={data:[],size:0},s={data:[],size:0},r={data:[],size:0},a=function(e,i,n){var s,r,a=new Uint8Array(e.size),o={type:i},l=0,u=0;if(e.data.length&&!(e.size<9)){for(o.trackId=e.data[0].pid,l=0;l<e.data.length;l++)r=e.data[l],a.set(r.data,u),u+=r.data.byteLength;!function(e,t){var i;const n=e[0]<<16|e[1]<<8|e[2];t.data=new Uint8Array,1===n&&(t.packetLength=6+(e[4]<<8|e[5]),t.dataAlignmentIndicator=!!(4&e[6]),192&(i=e[7])&&(t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&i&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1)),t.data=e.subarray(9+e[8]))}(a,o),s="video"===i||o.packetLength<=e.size,(n||s)&&(e.size=0,e.data.length=0),s&&t.trigger("data",o)}};Xe.prototype.init.call(this),this.push=function(o){({pat:function(){},pes:function(){var e,t;switch(o.streamType){case Je.H264_STREAM_TYPE:e=n,t="video";break;case Je.ADTS_STREAM_TYPE:e=s,t="audio";break;case Je.METADATA_STREAM_TYPE:e=r,t="timed-metadata";break;default:return}o.payloadUnitStartIndicator&&a(e,t,!0),e.data.push(o),e.size+=o.data.byteLength},pmt:function(){var n={type:"metadata",tracks:[]};null!==(e=o.programMapTable).video&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),i=!0,t.trigger("data",n)}})[o.type]()},this.reset=function(){n.size=0,n.data.length=0,s.size=0,s.data.length=0,this.trigger("reset")},this.flushStreams_=function(){a(n,"video"),a(s,"audio"),a(r,"timed-metadata")},this.flush=function(){if(!i&&e){var n={type:"metadata",tracks:[]};null!==e.video&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),t.trigger("data",n)}i=!1,this.flushStreams_(),this.trigger("done")}},Xe.prototype=new Ye;var tt={PAT_PID:0,MP2T_PACKET_LENGTH:et,TransportPacketStream:We,TransportParseStream:Ge,ElementaryStream:Xe,TimestampRolloverStream:Ze,CaptionStream:Qe.CaptionStream,Cea608Stream:Qe.Cea608Stream,Cea708Stream:Qe.Cea708Stream,MetadataStream:Ke};for(var it in Je)Je.hasOwnProperty(it)&&(tt[it]=Je[it]);var nt,st=tt,rt=q,at=oe.ONE_SECOND_IN_TS,ot=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];nt=function(e){var t,i=0;nt.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 s,r,a,o,l,u=0;if(e||(i=0),"audio"===n.type){var c;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;u+7<t.length;)if(255===t[u]&&240==(246&t[u+1])){if("number"==typeof c&&(this.skipWarn_(c,u),c=null),r=2*(1&~t[u+1]),s=(3&t[u+3])<<11|t[u+4]<<3|(224&t[u+5])>>5,l=(o=1024*(1+(3&t[u+6])))*at/ot[(60&t[u+2])>>>2],t.byteLength-u<s)break;this.trigger("data",{pts:n.pts+i*l,dts:n.dts+i*l,sampleCount:o,audioobjecttype:1+(t[u+2]>>>6&3),channelcount:(1&t[u+2])<<2|(192&t[u+3])>>>6,samplerate:ot[(60&t[u+2])>>>2],samplingfrequencyindex:(60&t[u+2])>>>2,samplesize:16,data:t.subarray(u+7+r,u+s)}),i++,u+=s}else"number"!=typeof c&&(c=u),u++;"number"==typeof c&&(this.skipWarn_(c,u),c=null),t=t.subarray(u)}},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")}},nt.prototype=new rt;var lt,ut=nt;lt=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 s=e.byteLength-t,r=new Uint8Array(4),a=Math.min(4,t);if(0===a)throw new Error("no bytes available");r.set(e.subarray(s,s+a)),i=new DataView(r.buffer).getUint32(0),n=8*a,t-=a},this.skipBits=function(e){var s;n>e?(i<<=e,n-=e):(e-=n,e-=8*(s=Math.floor(e/8)),t-=s,this.loadWord(),i<<=e,n-=e)},this.readBits=function(e){var s=Math.min(n,e),r=i>>>32-s;return(n-=s)>0?i<<=s:t>0&&this.loadWord(),(s=e-s)>0?r<<s|this.readBits(s):r},this.skipLeadingZeros=function(){var e;for(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()};var ct,ht,dt,pt=q,ft=lt;(ht=function(){var e,t,i=0;ht.prototype.init.call(this),this.push=function(n){var s;t?((s=new Uint8Array(t.byteLength+n.data.byteLength)).set(t),s.set(n.data,t.byteLength),t=s):t=n.data;for(var r=t.byteLength;i<r-3;i++)if(1===t[i+2]){e=i+5;break}for(;e<r;)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}i+3!==e-2&&this.trigger("data",t.subarray(i+3,e-2));do{e++}while(1!==t[e]&&e<r);i=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(i+3,e-2)),i=e-2,e+=3;break;default:e+=3}t=t.subarray(i),e-=i,i=0},this.reset=function(){t=null,i=0,this.trigger("reset")},this.flush=function(){t&&t.byteLength>3&&this.trigger("data",t.subarray(i+3)),t=null,i=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}}).prototype=new pt,dt={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},ct=function(){var e,t,i,n,s,r,a,o=new ht;ct.prototype.init.call(this),e=this,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=s(a.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=s(a.subarray(1)),o.config=r(o.escapedRBSP);break;case 8:o.nalUnitType="pic_parameter_set_rbsp";break;case 9:o.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",o)}),o.on("done",function(){e.trigger("done")}),o.on("partialdone",function(){e.trigger("partialdone")}),o.on("reset",function(){e.trigger("reset")}),o.on("endedtimeline",function(){e.trigger("endedtimeline")}),this.flush=function(){o.flush()},this.partialFlush=function(){o.partialFlush()},this.reset=function(){o.reset()},this.endTimeline=function(){o.endTimeline()},a=function(e,t){var i,n=8,s=8;for(i=0;i<e;i++)0!==s&&(s=(n+t.readExpGolomb()+256)%256),n=0===s?n:s},s=function(e){for(var t,i,n=e.byteLength,s=[],r=1;r<n-2;)0===e[r]&&0===e[r+1]&&3===e[r+2]?(s.push(r+2),r+=2):r++;if(0===s.length)return e;t=n-s.length,i=new Uint8Array(t);var a=0;for(r=0;r<t;a++,r++)a===s[0]&&(a++,s.shift()),i[r]=e[a];return i},r=function(e){var t,i,n,s,r,o,l,u,c,h,d,p,f=0,m=0,g=0,y=0,_=[1,1];if(i=(t=new ft(e)).readUnsignedByte(),s=t.readUnsignedByte(),n=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),dt[i]&&(3===(r=t.readUnsignedExpGolomb())&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(d=3!==r?8:12,p=0;p<d;p++)t.readBoolean()&&a(p<6?16:64,t);if(t.skipUnsignedExpGolomb(),0===(o=t.readUnsignedExpGolomb()))t.readUnsignedExpGolomb();else if(1===o)for(t.skipBits(1),t.skipExpGolomb(),t.skipExpGolomb(),l=t.readUnsignedExpGolomb(),p=0;p<l;p++)t.skipExpGolomb();if(t.skipUnsignedExpGolomb(),t.skipBits(1),u=t.readUnsignedExpGolomb(),c=t.readUnsignedExpGolomb(),0===(h=t.readBits(1))&&t.skipBits(1),t.skipBits(1),t.readBoolean()&&(f=t.readUnsignedExpGolomb(),m=t.readUnsignedExpGolomb(),g=t.readUnsignedExpGolomb(),y=t.readUnsignedExpGolomb()),t.readBoolean()&&t.readBoolean()){switch(t.readUnsignedByte()){case 1:_=[1,1];break;case 2:_=[12,11];break;case 3:_=[10,11];break;case 4:_=[16,11];break;case 5:_=[40,33];break;case 6:_=[24,11];break;case 7:_=[20,11];break;case 8:_=[32,11];break;case 9:_=[80,33];break;case 10:_=[18,11];break;case 11:_=[15,11];break;case 12:_=[64,33];break;case 13:_=[160,99];break;case 14:_=[4,3];break;case 15:_=[3,2];break;case 16:_=[2,1];break;case 255:_=[t.readUnsignedByte()<<8|t.readUnsignedByte(),t.readUnsignedByte()<<8|t.readUnsignedByte()]}_&&(_[0],_[1])}return{profileIdc:i,levelIdc:n,profileCompatibility:s,width:16*(u+1)-2*f-2*m,height:(2-h)*(c+1)*16-2*g-2*y,sarRatio:_}}},ct.prototype=new pt;var mt,gt={H264Stream:ct},yt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],_t=function(e,t){var i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return i=i>=0?i:0,(16&e[t+5])>>4?i+20:i+10},vt=function(e,t){return e.length-t<10||e[t]!=="I".charCodeAt(0)||e[t+1]!=="D".charCodeAt(0)||e[t+2]!=="3".charCodeAt(0)?t:(t+=_t(e,t),vt(e,t))},bt=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},Tt=function(e,t,i){return unescape(function(e,t,i){var n,s="";for(n=t;n<i;n++)s+="%"+("00"+e[n].toString(16)).slice(-2);return s}(e,t,i))},wt={isLikelyAacData:function(e){var t=vt(e,0);return e.length>=t+2&&!(255&~e[t])&&!(240&~e[t+1])&&16==(22&e[t+1])},parseId3TagSize:_t,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 e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)?"timed-metadata":!0&e[t]&&!(240&~e[t+1])?"audio":null},parseSampleRate:function(e){for(var t=0;t+5<e.length;){if(255===e[t]&&240==(246&e[t+1]))return yt[(60&e[t+2])>>>2];t++}return null},parseAacTimestamp:function(e){var t,i,n;t=10,64&e[5]&&(t+=4,t+=bt(e.subarray(10,14)));do{if((i=bt(e.subarray(t+4,t+8)))<1)return null;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){n=e.subarray(t+10,t+i+10);for(var s=0;s<n.byteLength;s++)if(0===n[s]){if("com.apple.streaming.transportStreamTimestamp"===Tt(n,0,s)){var r=n.subarray(s+1),a=(1&r[3])<<30|r[4]<<22|r[5]<<14|r[6]<<6|r[7]>>>2;return a*=4,a+=3&r[7]}break}}t+=10,t+=i}while(t<e.byteLength);return null}},St=wt;(mt=function(){var e=new Uint8Array,t=0;mt.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(i){var n,s,r,a,o=0,l=0;for(e.length?(a=e.length,(e=new Uint8Array(i.byteLength+a)).set(e.subarray(0,a)),e.set(i,a)):e=i;e.length-l>=3;)if(e[l]!=="I".charCodeAt(0)||e[l+1]!=="D".charCodeAt(0)||e[l+2]!=="3".charCodeAt(0))if(255&~e[l]||240&~e[l+1])l++;else{if(e.length-l<7)break;if(l+(o=St.parseAdtsSize(e,l))>e.length)break;r={type:"audio",data:e.subarray(l,l+o),pts:t,dts:t},this.trigger("data",r),l+=o}else{if(e.length-l<10)break;if(l+(o=St.parseId3TagSize(e,l))>e.length)break;s={type:"timed-metadata",data:e.subarray(l,l+o)},this.trigger("data",s),l+=o}n=e.length-l,e=n>0?e.subarray(l):new Uint8Array},this.reset=function(){e=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){e=new Uint8Array,this.trigger("endedtimeline")}}).prototype=new q;var Et,Ct,kt,xt,It=q,At=ee,Lt=ie,Pt=ce,Ot=de,Dt=st,Mt=oe,Nt=ut,Rt=gt.H264Stream,Ft=mt,Bt=wt.isLikelyAacData,Ut=oe.ONE_SECOND_IN_TS,jt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],$t=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],qt=function(e,t){t.stream=e,this.trigger("log",t)},Vt=function(e,t){for(var i=Object.keys(t),n=0;n<i.length;n++){var s=i[n];"headOfPipeline"!==s&&t[s].on&&t[s].on("log",qt.bind(e,s))}},Ht=function(e,t){var i;if(e.length!==t.length)return!1;for(i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0},zt=function(e,t,i,n,s,r){return{start:{dts:e,pts:e+(i-t)},end:{dts:e+(n-t),pts:e+(s-i)},prependedContentDuration:r,baseMediaDecodeTime:e}};Ct=function(e,t){var i,n=[],s=0,r=0,a=1/0;i=(t=t||{}).firstSequenceNumber||0,Ct.prototype.init.call(this),this.push=function(t){Ot.collectDtsInfo(e,t),e&&jt.forEach(function(i){e[i]=t[i]}),n.push(t)},this.setEarliestDts=function(e){s=e},this.setVideoBaseMediaDecodeTime=function(e){a=e},this.setAudioAppendStart=function(e){r=e},this.flush=function(){var o,l,u,c,h,d,p;0!==n.length?(o=Pt.trimAdtsFramesByEarliestDts(n,e,s),e.baseMediaDecodeTime=Ot.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),p=Pt.prefixWithSilence(e,o,r,a),e.samples=Pt.generateSampleTable(o),u=At.mdat(Pt.concatenateFrameData(o)),n=[],l=At.moof(i,[e]),c=new Uint8Array(l.byteLength+u.byteLength),i++,c.set(l),c.set(u,l.byteLength),Ot.clearDtsInfo(e),h=Math.ceil(1024*Ut/e.samplerate),o.length&&(d=o.length*h,this.trigger("segmentTimingInfo",zt(Mt.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),o[0].dts,o[0].pts,o[0].dts+d,o[0].pts+d,p||0)),this.trigger("timingInfo",{start:o[0].pts,end:o[0].pts+d})),this.trigger("data",{track:e,boxes:c}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")},this.reset=function(){Ot.clearDtsInfo(e),n=[],this.trigger("reset")}},Ct.prototype=new It,Et=function(e,t){var i,n,s,r=[],a=[];i=(t=t||{}).firstSequenceNumber||0,Et.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){Ot.collectDtsInfo(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||n||(n=t.config,e.sps=[t.data],$t.forEach(function(t){e[t]=n[t]},this)),"pic_parameter_set_rbsp"!==t.nalUnitType||s||(s=t.data,e.pps=[t.data]),r.push(t)},this.flush=function(){for(var n,s,o,l,u,c,h,d,p=0;r.length&&"access_unit_delimiter_rbsp"!==r[0].nalUnitType;)r.shift();if(0===r.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(n=Lt.groupNalsIntoFrames(r),(o=Lt.groupFramesIntoGops(n))[0][0].keyFrame||((s=this.getGopForFusion_(r[0],e))?(p=s.duration,o.unshift(s),o.byteLength+=s.byteLength,o.nalCount+=s.nalCount,o.pts=s.pts,o.dts=s.dts,o.duration+=s.duration):o=Lt.extendFirstKeyFrame(o)),a.length){var f;if(!(f=t.alignGopsAtEnd?this.alignGopsAtEnd_(o):this.alignGopsAtStart_(o)))return this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),r=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");Ot.clearDtsInfo(e),o=f}Ot.collectDtsInfo(e,o),e.samples=Lt.generateSampleTable(o),u=At.mdat(Lt.concatenateNalData(o)),e.baseMediaDecodeTime=Ot.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",o.map(function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}})),h=o[0],d=o[o.length-1],this.trigger("segmentTimingInfo",zt(e.baseMediaDecodeTime,h.dts,h.pts,d.dts+d.duration,d.pts+d.duration,p)),this.trigger("timingInfo",{start:o[0].pts,end:o[o.length-1].pts+o[o.length-1].duration}),this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),r=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),l=At.moof(i,[e]),c=new Uint8Array(l.byteLength+u.byteLength),i++,c.set(l),c.set(u,l.byteLength),this.trigger("data",{track:e,boxes:c}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),r=[],this.gopCache_.length=0,a.length=0,this.trigger("reset")},this.resetStream_=function(){Ot.clearDtsInfo(e),n=void 0,s=void 0},this.getGopForFusion_=function(t){var i,n,s,r,a,o=1/0;for(a=0;a<this.gopCache_.length;a++)s=(r=this.gopCache_[a]).gop,e.pps&&Ht(e.pps[0],r.pps[0])&&e.sps&&Ht(e.sps[0],r.sps[0])&&(s.dts<e.timelineStartInfo.dts||(i=t.dts-s.dts-s.duration)>=-1e4&&i<=45e3&&(!n||o>i)&&(n=r,o=i));return n?n.gop:null},this.alignGopsAtStart_=function(e){var t,i,n,s,r,o,l,u;for(r=e.byteLength,o=e.nalCount,l=e.duration,t=i=0;t<a.length&&i<e.length&&(n=a[t],s=e[i],n.pts!==s.pts);)s.pts>n.pts?t++:(i++,r-=s.byteLength,o-=s.nalCount,l-=s.duration);return 0===i?e:i===e.length?null:((u=e.slice(i)).byteLength=r,u.duration=l,u.nalCount=o,u.pts=u[0].pts,u.dts=u[0].dts,u)},this.alignGopsAtEnd_=function(e){var t,i,n,s,r,o,l;for(t=a.length-1,i=e.length-1,r=null,o=!1;t>=0&&i>=0;){if(n=a[t],s=e[i],n.pts===s.pts){o=!0;break}n.pts>s.pts?t--:(t===a.length-1&&(r=i),i--)}if(!o&&null===r)return null;if(0===(l=o?i:r))return e;var u=e.slice(l),c=u.reduce(function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e},{byteLength:0,duration:0,nalCount:0});return u.byteLength=c.byteLength,u.duration=c.duration,u.nalCount=c.nalCount,u.pts=u[0].pts,u.dts=u[0].dts,u},this.alignGopsWith=function(e){a=e}},Et.prototype=new It,xt=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,xt.prototype.init.call(this),this.push=function(e){return e.content||e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),void("audio"===e.track.type&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes))))}},xt.prototype=new It,xt.prototype.flush=function(e){var t,i,n,s,r=0,a={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return this.emittedTracks++,void(this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,$t.forEach(function(e){a.info[e]=this.videoTrack[e]},this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,jt.forEach(function(e){a.info[e]=this.audioTrack[e]},this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?a.type=this.pendingTracks[0].type:a.type="combined",this.emittedTracks+=this.pendingTracks.length,n=At.initSegment(this.pendingTracks),a.initSegment=new Uint8Array(n.byteLength),a.initSegment.set(n),a.data=new Uint8Array(this.pendingBytes),s=0;s<this.pendingBoxes.length;s++)a.data.set(this.pendingBoxes[s],r),r+=this.pendingBoxes[s].byteLength;for(s=0;s<this.pendingCaptions.length;s++)(t=this.pendingCaptions[s]).startTime=Mt.metadataTsToSeconds(t.startPts,o,this.keepOriginalTimestamps),t.endTime=Mt.metadataTsToSeconds(t.endPts,o,this.keepOriginalTimestamps),a.captionStreams[t.stream]=!0,a.captions.push(t);for(s=0;s<this.pendingMetadata.length;s++)(i=this.pendingMetadata[s]).cueTime=Mt.metadataTsToSeconds(i.pts,o,this.keepOriginalTimestamps),a.metadata.push(i);for(a.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",a),s=0;s<a.captions.length;s++)t=a.captions[s],this.trigger("caption",t);for(s=0;s<a.metadata.length;s++)i=a.metadata[s],this.trigger("id3Frame",i)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},xt.prototype.setRemux=function(e){this.remuxTracks=e},kt=function(e){var t,i,n=this,s=!0;kt.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var s={};this.transmuxPipeline_=s,s.type="aac",s.metadataStream=new Dt.MetadataStream,s.aacStream=new Ft,s.audioTimestampRolloverStream=new Dt.TimestampRolloverStream("audio"),s.timedMetadataTimestampRolloverStream=new Dt.TimestampRolloverStream("timed-metadata"),s.adtsStream=new Nt,s.coalesceStream=new xt(e,s.metadataStream),s.headOfPipeline=s.aacStream,s.aacStream.pipe(s.audioTimestampRolloverStream).pipe(s.adtsStream),s.aacStream.pipe(s.timedMetadataTimestampRolloverStream).pipe(s.metadataStream).pipe(s.coalesceStream),s.metadataStream.on("timestamp",function(e){s.aacStream.setTimestamp(e.timeStamp)}),s.aacStream.on("data",function(r){"timed-metadata"!==r.type&&"audio"!==r.type||s.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:n.baseMediaDecodeTime},codec:"adts",type:"audio"},s.coalesceStream.numberOfTracks++,s.audioSegmentStream=new Ct(i,e),s.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream")),s.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),s.adtsStream.pipe(s.audioSegmentStream).pipe(s.coalesceStream),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t}))}),s.coalesceStream.on("data",this.trigger.bind(this,"data")),s.coalesceStream.on("done",this.trigger.bind(this,"done")),Vt(this,s)},this.setupTsPipeline=function(){var s={};this.transmuxPipeline_=s,s.type="ts",s.metadataStream=new Dt.MetadataStream,s.packetStream=new Dt.TransportPacketStream,s.parseStream=new Dt.TransportParseStream,s.elementaryStream=new Dt.ElementaryStream,s.timestampRolloverStream=new Dt.TimestampRolloverStream,s.adtsStream=new Nt,s.h264Stream=new Rt,s.captionStream=new Dt.CaptionStream(e),s.coalesceStream=new xt(e,s.metadataStream),s.headOfPipeline=s.packetStream,s.packetStream.pipe(s.parseStream).pipe(s.elementaryStream).pipe(s.timestampRolloverStream),s.timestampRolloverStream.pipe(s.h264Stream),s.timestampRolloverStream.pipe(s.adtsStream),s.timestampRolloverStream.pipe(s.metadataStream).pipe(s.coalesceStream),s.h264Stream.pipe(s.captionStream).pipe(s.coalesceStream),s.elementaryStream.on("data",function(r){var a;if("metadata"===r.type){for(a=r.tracks.length;a--;)t||"video"!==r.tracks[a].type?i||"audio"!==r.tracks[a].type||((i=r.tracks[a]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime):(t=r.tracks[a]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime;t&&!s.videoSegmentStream&&(s.coalesceStream.numberOfTracks++,s.videoSegmentStream=new Et(t,e),s.videoSegmentStream.on("log",n.getLogTrigger_("videoSegmentStream")),s.videoSegmentStream.on("timelineStartInfo",function(t){i&&!e.keepOriginalTimestamps&&(i.timelineStartInfo=t,s.audioSegmentStream.setEarliestDts(t.dts-n.baseMediaDecodeTime))}),s.videoSegmentStream.on("processedGopsInfo",n.trigger.bind(n,"gopInfo")),s.videoSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"videoSegmentTimingInfo")),s.videoSegmentStream.on("baseMediaDecodeTime",function(e){i&&s.audioSegmentStream.setVideoBaseMediaDecodeTime(e)}),s.videoSegmentStream.on("timingInfo",n.trigger.bind(n,"videoTimingInfo")),s.h264Stream.pipe(s.videoSegmentStream).pipe(s.coalesceStream)),i&&!s.audioSegmentStream&&(s.coalesceStream.numberOfTracks++,s.audioSegmentStream=new Ct(i,e),s.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream")),s.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),s.audioSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"audioSegmentTimingInfo")),s.adtsStream.pipe(s.audioSegmentStream).pipe(s.coalesceStream)),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t})}}),s.coalesceStream.on("data",this.trigger.bind(this,"data")),s.coalesceStream.on("id3Frame",function(e){e.dispatchType=s.metadataStream.dispatchType,n.trigger("id3Frame",e)}),s.coalesceStream.on("caption",this.trigger.bind(this,"caption")),s.coalesceStream.on("done",this.trigger.bind(this,"done")),Vt(this,s)},this.setBaseMediaDecodeTime=function(n){var s=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=n),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,Ot.clearDtsInfo(i),s.audioTimestampRolloverStream&&s.audioTimestampRolloverStream.discontinuity()),t&&(s.videoSegmentStream&&(s.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,Ot.clearDtsInfo(t),s.captionStream.reset()),s.timestampRolloverStream&&s.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.setRemux=function(t){var i=this.transmuxPipeline_;e.remux=t,i&&i.coalesceStream&&i.coalesceStream.setRemux(t)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.getLogTrigger_=function(e){var t=this;return function(i){i.stream=e,t.trigger("log",i)}},this.push=function(e){if(s){var t=Bt(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),s=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){s=!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()}},kt.prototype=new It;var Wt,Gt,Xt,Kt,Yt,Qt,Jt,Zt={Transmuxer:kt},ei=function(e){return e>>>0},ti=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),t+=String.fromCharCode(e[2]),t+=String.fromCharCode(e[3])},ii=ei,ni=ti,si=function(e,t){var i,n,s,r,a,o=[];if(!t.length)return null;for(i=0;i<e.byteLength;)n=ii(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3]),s=ni(e.subarray(i+4,i+8)),r=n>1?i+n:e.byteLength,s===t[0]&&(1===t.length?o.push(e.subarray(i+8,r)):(a=si(e.subarray(i+8,r),t.slice(1))).length&&(o=o.concat(a))),i=r;return o},ri=si,ai=ei,oi=H.getUint64,li=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4))};return 1===t.version?t.baseMediaDecodeTime=oi(e.subarray(4)):t.baseMediaDecodeTime=ai(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),t},ui=function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:i.getUint32(4)},s=1&n.flags[2],r=2&n.flags[2],a=8&n.flags[2],o=16&n.flags[2],l=32&n.flags[2],u=65536&n.flags[0],c=131072&n.flags[0];return t=8,s&&(t+=4,n.baseDataOffset=i.getUint32(12),t+=4),r&&(n.sampleDescriptionIndex=i.getUint32(t),t+=4),a&&(n.defaultSampleDuration=i.getUint32(t),t+=4),o&&(n.defaultSampleSize=i.getUint32(t),t+=4),l&&(n.defaultSampleFlags=i.getUint32(t)),u&&(n.durationIsEmpty=!0),!s&&c&&(n.baseDataOffsetIsMoof=!0),n},ci=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]}},hi=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),s=1&i.flags[2],r=4&i.flags[2],a=1&i.flags[1],o=2&i.flags[1],l=4&i.flags[1],u=8&i.flags[1],c=n.getUint32(4),h=8;for(s&&(i.dataOffset=n.getInt32(h),h+=4),r&&c&&(t={flags:ci(e.subarray(h,h+4))},h+=4,a&&(t.duration=n.getUint32(h),h+=4),o&&(t.size=n.getUint32(h),h+=4),u&&(1===i.version?t.compositionTimeOffset=n.getInt32(h):t.compositionTimeOffset=n.getUint32(h),h+=4),i.samples.push(t),c--);c--;)t={},a&&(t.duration=n.getUint32(h),h+=4),o&&(t.size=n.getUint32(h),h+=4),l&&(t.flags=ci(e.subarray(h,h+4)),h+=4),u&&(1===i.version?t.compositionTimeOffset=n.getInt32(h):t.compositionTimeOffset=n.getUint32(h),h+=4),i.samples.push(t);return i},di={tfdt:li,trun:hi},pi={parseTfdt:di.tfdt,parseTrun:di.trun},fi=function(e){for(var t=0,i=String.fromCharCode(e[t]),n="";"\0"!==i;)n+=i,t++,i=String.fromCharCode(e[t]);return n+=i},mi=H.getUint64,gi=function(e,t){var i="\0"!==t.scheme_id_uri,n=0===e&&yi(t.presentation_time_delta)&&i,s=1===e&&yi(t.presentation_time)&&i;return!(e>1)&&n||s},yi=function(e){return void 0!==e||null!==e},_i={parseEmsgBox:function(e){var t,i,n,s,r,a,o,l=4,u=e[0];if(0===u)l+=(t=fi(e.subarray(l))).length,l+=(i=fi(e.subarray(l))).length,n=(c=new DataView(e.buffer)).getUint32(l),l+=4,r=c.getUint32(l),l+=4,a=c.getUint32(l),l+=4,o=c.getUint32(l),l+=4;else if(1===u){var c;n=(c=new DataView(e.buffer)).getUint32(l),l+=4,s=mi(e.subarray(l)),l+=8,a=c.getUint32(l),l+=4,o=c.getUint32(l),l+=4,l+=(t=fi(e.subarray(l))).length,l+=(i=fi(e.subarray(l))).length}var h={scheme_id_uri:t,value:i,timescale:n||1,presentation_time:s,presentation_time_delta:r,event_duration:a,id:o,message_data:new Uint8Array(e.subarray(l,e.byteLength))};return gi(u,h)?h:void 0},scaleTime:function(e,t,i,n){return e||0===e?e/t:n+i/t}},vi="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},bi=ei,Ti=function(e){return("00"+e.toString(16)).slice(-2)},wi=ri,Si=ti,Ei=_i,Ci=ui,ki=hi,xi=li,Ii=H.getUint64,Ai=vi,Li=Ve.parseId3Frames;Wt=function(e){return wi(e,["moov","trak"]).reduce(function(e,t){var i,n,s,r,a;return(i=wi(t,["tkhd"])[0])?(n=i[0],r=bi(i[s=0===n?12:20]<<24|i[s+1]<<16|i[s+2]<<8|i[s+3]),(a=wi(t,["mdia","mdhd"])[0])?(s=0===(n=a[0])?12:20,e[r]=bi(a[s]<<24|a[s+1]<<16|a[s+2]<<8|a[s+3]),e):null):null},{})},Gt=function(e,t){var i=wi(t,["moof","traf"]).reduce(function(t,i){var n,s=wi(i,["tfhd"])[0],r=bi(s[4]<<24|s[5]<<16|s[6]<<8|s[7]),a=e[r]||9e4,o=wi(i,["tfdt"])[0],l=new DataView(o.buffer,o.byteOffset,o.byteLength);let u;return"bigint"==typeof(n=1===o[0]?Ii(o.subarray(4,12)):l.getUint32(4))?u=n/Ai.BigInt(a):"number"!=typeof n||isNaN(n)||(u=n/a),u<Number.MAX_SAFE_INTEGER&&(u=Number(u)),u<t&&(t=u),t},1/0);return"bigint"==typeof i||isFinite(i)?i:0},Xt=function(e,t){var i,n=wi(t,["moof","traf"]),s=0,r=0;if(n&&n.length){var a=wi(n[0],["tfhd"])[0],o=wi(n[0],["trun"])[0],l=wi(n[0],["tfdt"])[0];if(a)i=Ci(a).trackId;if(l)s=xi(l).baseMediaDecodeTime;if(o){var u=ki(o);u.samples&&u.samples.length&&(r=u.samples[0].compositionTimeOffset||0)}}var c=e[i]||9e4;"bigint"==typeof s&&(r=Ai.BigInt(r),c=Ai.BigInt(c));var h=(s+r)/c;return"bigint"==typeof h&&h<Number.MAX_SAFE_INTEGER&&(h=Number(h)),h},Kt=function(e){var t=wi(e,["moov","trak"]),i=[];return t.forEach(function(e){var t=wi(e,["mdia","hdlr"]),n=wi(e,["tkhd"]);t.forEach(function(e,t){var s,r,a=Si(e.subarray(8,12)),o=n[t];"vide"===a&&(r=0===(s=new DataView(o.buffer,o.byteOffset,o.byteLength)).getUint8(0)?s.getUint32(12):s.getUint32(20),i.push(r))})}),i},Qt=function(e){var t=0===e[0]?12:20;return bi(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])},Yt=function(e){var t=wi(e,["moov","trak"]),i=[];return t.forEach(function(e){var t,n,s={},r=wi(e,["tkhd"])[0];r&&(n=(t=new DataView(r.buffer,r.byteOffset,r.byteLength)).getUint8(0),s.id=0===n?t.getUint32(12):t.getUint32(20));var a=wi(e,["mdia","hdlr"])[0];if(a){var o=Si(a.subarray(8,12));s.type="vide"===o?"video":"soun"===o?"audio":o}var l=wi(e,["mdia","minf","stbl","stsd"])[0];if(l){var u=l.subarray(8);s.codec=Si(u.subarray(4,8));var c,h=wi(u,[s.codec])[0];h&&(/^[asm]vc[1-9]$/i.test(s.codec)?(c=h.subarray(78),"avcC"===Si(c.subarray(4,8))&&c.length>11?(s.codec+=".",s.codec+=Ti(c[9]),s.codec+=Ti(c[10]),s.codec+=Ti(c[11])):s.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(s.codec)?(c=h.subarray(28),"esds"===Si(c.subarray(4,8))&&c.length>20&&0!==c[19]?(s.codec+="."+Ti(c[19]),s.codec+="."+Ti(c[20]>>>2&63).replace(/^0/,"")):s.codec="mp4a.40.2"):s.codec=s.codec.toLowerCase())}var d=wi(e,["mdia","mdhd"])[0];d&&(s.timescale=Qt(d)),i.push(s)}),i},Jt=function(e,t=0){return wi(e,["emsg"]).map(e=>{var i=Ei.parseEmsgBox(new Uint8Array(e)),n=Li(i.message_data);return{cueTime:Ei.scaleTime(i.presentation_time,i.timescale,i.presentation_time_delta,t),duration:Ei.scaleTime(i.event_duration,i.timescale),frames:n}})};var Pi={findBox:wi,parseType:Si,timescale:Wt,startTime:Gt,compositionStartTime:Xt,videoTrackIds:Kt,tracks:Yt,getTimescaleFromMediaHeader:Qt,getEmsgID3:Jt};const{parseTrun:Oi}=pi,{findBox:Di}=Pi;var Mi=vi,Ni={getMdatTrafPairs:function(e){var t=Di(e,["moof","traf"]),i=Di(e,["mdat"]),n=[];return i.forEach(function(e,i){var s=t[i];n.push({mdat:e,traf:s})}),n},parseSamples:function(e,t,i){var n=t,s=i.defaultSampleDuration||0,r=i.defaultSampleSize||0,a=i.trackId,o=[];return e.forEach(function(e){var t=Oi(e).samples;t.forEach(function(e){void 0===e.duration&&(e.duration=s),void 0===e.size&&(e.size=r),e.trackId=a,e.dts=n,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),"bigint"==typeof n?(e.pts=n+Mi.BigInt(e.compositionTimeOffset),n+=Mi.BigInt(e.duration)):(e.pts=n+e.compositionTimeOffset,n+=e.duration)}),o=o.concat(t)}),o}},Ri=pe.discardEmulationPreventionBytes,Fi=xe.CaptionStream,Bi=ri,Ui=li,ji=ui,{getMdatTrafPairs:$i,parseSamples:qi}=Ni,Vi=function(e,t){for(var i=e,n=0;n<t.length;n++){var s=t[n];if(i<s.size)return s;i-=s.size}return null},Hi=function(e,t){var i={};return $i(e).forEach(function(e){var n,s=e.mdat,r=e.traf,a=Bi(r,["tfhd"]),o=ji(a[0]),l=o.trackId,u=Bi(r,["tfdt"]),c=u.length>0?Ui(u[0]).baseMediaDecodeTime:0,h=Bi(r,["trun"]);t===l&&h.length>0&&(n=function(e,t,i){var n,s,r,a,o=new DataView(e.buffer,e.byteOffset,e.byteLength),l={logs:[],seiNals:[]};for(s=0;s+4<e.length;s+=r)if(r=o.getUint32(s),s+=4,!(r<=0))switch(31&e[s]){case 6:var u=e.subarray(s+1,s+1+r),c=Vi(s,t);if(n={nalUnitType:"sei_rbsp",size:r,data:u,escapedRBSP:Ri(u),trackId:i},c)n.pts=c.pts,n.dts=c.dts,a=c;else{if(!a){l.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+s+" for trackId "+i+". See mux.js#223."});break}n.pts=a.pts,n.dts=a.dts}l.seiNals.push(n)}return l}(s,qi(h,c,o),l),i[l]||(i[l]={seiNals:[],logs:[]}),i[l].seiNals=i[l].seiNals.concat(n.seiNals),i[l].logs=i[l].logs.concat(n.logs))}),i},zi=function(){var e,t,i,n,s,r,a=!1;this.isInitialized=function(){return a},this.init=function(t){e=new Fi,a=!0,r=!!t&&t.isPartial,e.on("data",function(e){e.startTime=e.startPts/n,e.endTime=e.endPts/n,s.captions.push(e),s.captionStreams[e.stream]=!0}),e.on("log",function(e){s.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,r,a){var o;if(!this.isInitialized())return null;if(!r||!a)return null;if(this.isNewInit(r,a))i=r[0],n=a[i];else if(null===i||!n)return t.push(e),null;for(;t.length>0;){var l=t.shift();this.parse(l,r,a)}return o=function(e,t,i){if(null===t)return null;var n=Hi(e,t)[t]||{};return{seiNals:n.seiNals,logs:n.logs,timescale:i}}(e,i,n),o&&o.logs&&(s.logs=s.logs.concat(o.logs)),null!==o&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),s):s.logs.length?{logs:s.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach(function(t){e.push(t)})},this.flushStream=function(){if(!this.isInitialized())return null;r?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){s.captions=[],s.captionStreams={},s.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],i=null,n=null,s?this.clearParsedCaptions():s={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()};const{parseTfdt:Wi}=pi,Gi=ri,{getTimescaleFromMediaHeader:Xi}=Pi,{parseSamples:Ki,getMdatTrafPairs:Yi}=Ni;var Qi=function(){let e=9e4;this.init=function(t){const i=Gi(t,["moov","trak","mdia","mdhd"])[0];i&&(e=Xi(i))},this.parseSegment=function(t){const i=[],n=Yi(t);let s=0;return n.forEach(function(t){const n=t.mdat,r=t.traf,a=Gi(r,["tfdt"])[0],o=Gi(r,["tfhd"])[0],l=Gi(r,["trun"]);if(a){const e=Wi(a);s=e.baseMediaDecodeTime}if(l.length&&o){const t=Ki(l,s,o);let r=0;t.forEach(function(t){const s=new TextDecoder("utf-8"),a=n.slice(r,r+t.size);if(Gi(a,["vtte"])[0])return void(r+=t.size);Gi(a,["vttc"]).forEach(function(n){const r=Gi(n,["payl"])[0],a=Gi(n,["sttg"])[0],o=t.pts/e,l=(t.pts+t.duration)/e;let u,c;if(r)try{u=s.decode(r)}catch(e){console.error(e)}if(a)try{c=s.decode(a)}catch(e){console.error(e)}t.duration&&u&&i.push({cueText:u,start:o,end:l,settings:c})}),r+=t.size})}}),i}},Ji=Ie,Zi=function(e){var t=31&e[1];return t<<=8,t|=e[2]},en=function(e){return!!(64&e[1])},tn=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},nn=function(e){switch(e){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},sn={parseType:function(e,t){var i=Zi(e);return 0===i?"pat":i===t?"pmt":t?"pes":null},parsePat:function(e){var t=en(e),i=4+tn(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},parsePmt:function(e){var t={},i=en(e),n=4+tn(e);if(i&&(n+=e[n]+1),1&e[n+5]){var s;s=3+((15&e[n+1])<<8|e[n+2])-4;for(var r=12+((15&e[n+10])<<8|e[n+11]);r<s;){var a=n+r;t[(31&e[a+1])<<8|e[a+2]]=e[a],r+=5+((15&e[a+3])<<8|e[a+4])}return t}},parsePayloadUnitStartIndicator:en,parsePesType:function(e,t){switch(t[Zi(e)]){case Ji.H264_STREAM_TYPE:return"video";case Ji.ADTS_STREAM_TYPE:return"audio";case Ji.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(e){if(!en(e))return null;var t=4+tn(e);if(t>=e.byteLength)return null;var i,n=null;return 192&(i=e[t+7])&&((n={}).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,n.pts*=4,n.pts+=(6&e[t+13])>>>1,n.dts=n.pts,64&i&&(n.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,n.dts*=4,n.dts+=(6&e[t+18])>>>1)),n},videoPacketContainsKeyFrame:function(e){for(var t=4+tn(e),i=e.subarray(t),n=0,s=0,r=!1;s<i.byteLength-3;s++)if(1===i[s+2]){n=s+5;break}for(;n<i.byteLength;)switch(i[n]){case 0:if(0!==i[n-1]){n+=2;break}if(0!==i[n-2]){n++;break}s+3!==n-2&&"slice_layer_without_partitioning_rbsp_idr"===nn(31&i[s+3])&&(r=!0);do{n++}while(1!==i[n]&&n<i.length);s=n-2,n+=3;break;case 1:if(0!==i[n-1]||0!==i[n-2]){n+=3;break}"slice_layer_without_partitioning_rbsp_idr"===nn(31&i[s+3])&&(r=!0),s=n-2,n+=3;break;default:n+=3}return i=i.subarray(s),n-=s,s=0,i&&i.byteLength>3&&"slice_layer_without_partitioning_rbsp_idr"===nn(31&i[s+3])&&(r=!0),r}},rn=Ie,an=Me.handleRollover,on={};on.ts=sn,on.aac=wt;var ln=oe.ONE_SECOND_IN_TS,un=188,cn=71,hn=function(e,t,i){for(var n,s,r,a,o=0,l=un,u=!1;l<=e.byteLength;)if(e[o]!==cn||e[l]!==cn&&l!==e.byteLength)o++,l++;else{if(n=e.subarray(o,l),"pes"===on.ts.parseType(n,t.pid))s=on.ts.parsePesType(n,t.table),r=on.ts.parsePayloadUnitStartIndicator(n),"audio"===s&&r&&(a=on.ts.parsePesTime(n))&&(a.type="audio",i.audio.push(a),u=!0);if(u)break;o+=un,l+=un}for(o=(l=e.byteLength)-un,u=!1;o>=0;)if(e[o]!==cn||e[l]!==cn&&l!==e.byteLength)o--,l--;else{if(n=e.subarray(o,l),"pes"===on.ts.parseType(n,t.pid))s=on.ts.parsePesType(n,t.table),r=on.ts.parsePayloadUnitStartIndicator(n),"audio"===s&&r&&(a=on.ts.parsePesTime(n))&&(a.type="audio",i.audio.push(a),u=!0);if(u)break;o-=un,l-=un}},dn=function(e,t,i){for(var n,s,r,a,o,l,u,c=0,h=un,d=!1,p={data:[],size:0};h<e.byteLength;)if(e[c]!==cn||e[h]!==cn)c++,h++;else{if(n=e.subarray(c,h),"pes"===on.ts.parseType(n,t.pid))if(s=on.ts.parsePesType(n,t.table),r=on.ts.parsePayloadUnitStartIndicator(n),"video"===s&&(r&&!d&&(a=on.ts.parsePesTime(n))&&(a.type="video",i.video.push(a),d=!0),!i.firstKeyFrame)){if(r&&0!==p.size){for(o=new Uint8Array(p.size),l=0;p.data.length;)u=p.data.shift(),o.set(u,l),l+=u.byteLength;if(on.ts.videoPacketContainsKeyFrame(o)){var f=on.ts.parsePesTime(o);f?(i.firstKeyFrame=f,i.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}p.size=0}p.data.push(n),p.size+=n.byteLength}if(d&&i.firstKeyFrame)break;c+=un,h+=un}for(c=(h=e.byteLength)-un,d=!1;c>=0;)if(e[c]!==cn||e[h]!==cn)c--,h--;else{if(n=e.subarray(c,h),"pes"===on.ts.parseType(n,t.pid))s=on.ts.parsePesType(n,t.table),r=on.ts.parsePayloadUnitStartIndicator(n),"video"===s&&r&&(a=on.ts.parsePesTime(n))&&(a.type="video",i.video.push(a),d=!0);if(d)break;c-=un,h-=un}},pn=function(e){var t={pid:null,table:null},i={};for(var n in function(e,t){for(var i,n=0,s=un;s<e.byteLength;)if(e[n]!==cn||e[s]!==cn)n++,s++;else{switch(i=e.subarray(n,s),on.ts.parseType(i,t.pid)){case"pat":t.pid=on.ts.parsePat(i);break;case"pmt":var r=on.ts.parsePmt(i);t.table=t.table||{},Object.keys(r).forEach(function(e){t.table[e]=r[e]})}n+=un,s+=un}}(e,t),t.table){if(t.table.hasOwnProperty(n))switch(t.table[n]){case rn.H264_STREAM_TYPE:i.video=[],dn(e,t,i),0===i.video.length&&delete i.video;break;case rn.ADTS_STREAM_TYPE:i.audio=[],hn(e,t,i),0===i.audio.length&&delete i.audio}}return i},fn=function(e,t){var i;return i=on.aac.isLikelyAacData(e)?function(e){for(var t,i=!1,n=0,s=null,r=null,a=0,o=0;e.length-o>=3;){switch(on.aac.parseType(e,o)){case"timed-metadata":if(e.length-o<10){i=!0;break}if((a=on.aac.parseId3TagSize(e,o))>e.length){i=!0;break}null===r&&(t=e.subarray(o,o+a),r=on.aac.parseAacTimestamp(t)),o+=a;break;case"audio":if(e.length-o<7){i=!0;break}if((a=on.aac.parseAdtsSize(e,o))>e.length){i=!0;break}null===s&&(t=e.subarray(o,o+a),s=on.aac.parseSampleRate(t)),n++,o+=a;break;default:o++}if(i)return null}if(null===s||null===r)return null;var l=ln/s;return{audio:[{type:"audio",dts:r,pts:r},{type:"audio",dts:r+1024*n*l,pts:r+1024*n*l}]}}(e):pn(e),i&&(i.audio||i.video)?(function(e,t){if(e.audio&&e.audio.length){var i=t;(void 0===i||isNaN(i))&&(i=e.audio[0].dts),e.audio.forEach(function(e){e.dts=an(e.dts,i),e.pts=an(e.pts,i),e.dtsTime=e.dts/ln,e.ptsTime=e.pts/ln})}if(e.video&&e.video.length){var n=t;if((void 0===n||isNaN(n))&&(n=e.video[0].dts),e.video.forEach(function(e){e.dts=an(e.dts,n),e.pts=an(e.pts,n),e.dtsTime=e.dts/ln,e.ptsTime=e.pts/ln}),e.firstKeyFrame){var s=e.firstKeyFrame;s.dts=an(s.dts,n),s.pts=an(s.pts,n),s.dtsTime=s.dts/ln,s.ptsTime=s.pts/ln}}}(i,t),i):null};class mn{constructor(e,t){this.options=t||{},this.self=e,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Zt.Transmuxer(this.options),function(e,t){t.on("data",function(t){const i=t.initSegment;t.initSegment={data:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength};const n=t.data;t.data=n.buffer,e.postMessage({action:"data",segment:t,byteOffset:n.byteOffset,byteLength:n.byteLength},[t.data])}),t.on("done",function(t){e.postMessage({action:"done"})}),t.on("gopInfo",function(t){e.postMessage({action:"gopInfo",gopInfo:t})}),t.on("videoSegmentTimingInfo",function(t){const i={start:{decode:oe.videoTsToSeconds(t.start.dts),presentation:oe.videoTsToSeconds(t.start.pts)},end:{decode:oe.videoTsToSeconds(t.end.dts),presentation:oe.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:oe.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=oe.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:i})}),t.on("audioSegmentTimingInfo",function(t){const i={start:{decode:oe.videoTsToSeconds(t.start.dts),presentation:oe.videoTsToSeconds(t.start.pts)},end:{decode:oe.videoTsToSeconds(t.end.dts),presentation:oe.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:oe.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=oe.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:i})}),t.on("id3Frame",function(t){e.postMessage({action:"id3Frame",id3Frame:t})}),t.on("caption",function(t){e.postMessage({action:"caption",caption:t})}),t.on("trackinfo",function(t){e.postMessage({action:"trackinfo",trackInfo:t})}),t.on("audioTimingInfo",function(t){e.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:oe.videoTsToSeconds(t.start),end:oe.videoTsToSeconds(t.end)}})}),t.on("videoTimingInfo",function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:oe.videoTsToSeconds(t.start),end:oe.videoTsToSeconds(t.end)}})}),t.on("log",function(t){e.postMessage({action:"log",log:t})})}(this.self,this.transmuxer)}pushMp4Captions(e){this.captionParser||(this.captionParser=new zi,this.captionParser.init());const t=new Uint8Array(e.data,e.byteOffset,e.byteLength),i=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:"mp4Captions",captions:i&&i.captions||[],logs:i&&i.logs||[],data:t.buffer},[t.buffer])}initMp4WebVttParser(e){this.webVttParser||(this.webVttParser=new Qi);const t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.webVttParser.init(t)}getMp4WebVttText(e){this.webVttParser||(this.webVttParser=new Qi);const t=new Uint8Array(e.data,e.byteOffset,e.byteLength),i=this.webVttParser.parseSegment(t);this.self.postMessage({action:"getMp4WebVttText",mp4VttCues:i||[],data:t.buffer},[t.buffer])}probeMp4StartTime({timescales:e,data:t}){const i=Pi.startTime(e,t);this.self.postMessage({action:"probeMp4StartTime",startTime:i,data:t},[t.buffer])}probeMp4Tracks({data:e}){const t=Pi.tracks(e);this.self.postMessage({action:"probeMp4Tracks",tracks:t,data:e},[e.buffer])}probeEmsgID3({data:e,offset:t}){const i=Pi.getEmsgID3(e,t);this.self.postMessage({action:"probeEmsgID3",id3Frames:i,emsgData:e},[e.buffer])}probeTs({data:e,baseStartTime:t}){const i="number"!=typeof t||isNaN(t)?void 0:t*oe.ONE_SECOND_IN_TS,n=fn(e,i);let s=null;n&&(s={hasVideo:n.video&&2===n.video.length||!1,hasAudio:n.audio&&2===n.audio.length||!1},s.hasVideo&&(s.videoStart=n.video[0].ptsTime),s.hasAudio&&(s.audioStart=n.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:s,data:e},[e.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(e){const t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)}reset(){this.transmuxer.reset()}setTimestampOffset(e){const t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(oe.secondsToVideoTs(t)))}setAudioAppendStart(e){this.transmuxer.setAudioAppendStart(Math.ceil(oe.secondsToVideoTs(e.appendStart)))}setRemux(e){this.transmuxer.setRemux(e.remux)}flush(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())}}self.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new mn(self,e.data.options):(this.messageHandlers||(this.messageHandlers=new mn(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}}));var sC=eC(nC);const rC=e=>{const{transmuxer:t,bytes:i,audioAppendStart:n,gopsToAlignWith:s,remux:r,onData:a,onTrackInfo:o,onAudioTimingInfo:l,onVideoTimingInfo:u,onVideoSegmentTimingInfo:c,onAudioSegmentTimingInfo:h,onId3:d,onCaptions:p,onDone:f,onEndedTimeline:m,onTransmuxerLog:g,isEndOfTimeline:y,segment:_,triggerSegmentEventFn:v}=e,b={buffer:[]};let T=y;if(t.onmessage=i=>{t.currentTransmux===e&&("data"===i.data.action&&((e,t,i)=>{const{type:n,initSegment:s,captions:r,captionStreams:a,metadata:o,videoFrameDtsTime:l,videoFramePtsTime:u}=e.data.segment;t.buffer.push({captions:r,captionStreams:a,metadata:o});const c=e.data.segment.boxes||{data:e.data.segment.data},h={type:n,data:new Uint8Array(c.data,c.data.byteOffset,c.data.byteLength),initSegment:new Uint8Array(s.data,s.byteOffset,s.byteLength)};void 0!==l&&(h.videoFrameDtsTime=l),void 0!==u&&(h.videoFramePtsTime=u),i(h)})(i,b,a),"trackinfo"===i.data.action&&o(i.data.trackInfo),"gopInfo"===i.data.action&&((e,t)=>{t.gopInfo=e.data.gopInfo})(i,b),"audioTimingInfo"===i.data.action&&l(i.data.audioTimingInfo),"videoTimingInfo"===i.data.action&&u(i.data.videoTimingInfo),"videoSegmentTimingInfo"===i.data.action&&c(i.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===i.data.action&&h(i.data.audioSegmentTimingInfo),"id3Frame"===i.data.action&&d([i.data.id3Frame],i.data.id3Frame.dispatchType),"caption"===i.data.action&&p(i.data.caption),"endedtimeline"===i.data.action&&(T=!1,m()),"log"===i.data.action&&g(i.data.log),"transmuxed"===i.data.type&&(T||(t.onmessage=null,(({transmuxedData:e,callback:t})=>{e.buffer=[],t(e)})({transmuxedData:b,callback:f}),aC(t))))},t.onerror=()=>{const e={message:"Received an error message from the transmuxer worker",metadata:{errorType:ES.Error.StreamingFailedToTransmuxSegment,segmentInfo:KC({segment:_})}};f(null,e)},n&&t.postMessage({action:"setAudioAppendStart",appendStart:n}),Array.isArray(s)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:s}),void 0!==r&&t.postMessage({action:"setRemux",remux:r}),i.byteLength){const e=i instanceof ArrayBuffer?i:i.buffer,n=i instanceof ArrayBuffer?0:i.byteOffset;v({type:"segmenttransmuxingstart",segment:_}),t.postMessage({action:"push",data:e,byteOffset:n,byteLength:i.byteLength},[e])}y&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},aC=e=>{e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():rC(e.currentTransmux))},oC=(e,t)=>{e.postMessage({action:t}),aC(e)},lC=(e,t)=>{if(!t.currentTransmux)return t.currentTransmux=e,void oC(t,e);t.transmuxQueue.push(oC.bind(null,t,e))},uC=e=>{if(!e.transmuxer.currentTransmux)return e.transmuxer.currentTransmux=e,void rC(e);e.transmuxer.transmuxQueue.push(e)};var cC=e=>{lC("reset",e)},hC=e=>{const t=new sC;t.currentTransmux=null,t.transmuxQueue=[];const i=t.terminate;return t.terminate=()=>(t.currentTransmux=null,t.transmuxQueue.length=0,i.call(t)),t.postMessage({action:"init",options:e}),t};const dC=function(e){const t=e.transmuxer,i=e.endAction||e.action,n=e.callback,s=up({},e,{endAction:null,transmuxer:null,callback:null}),r=s=>{s.data.action===i&&(t.removeEventListener("message",r),s.data.data&&(s.data.data=new Uint8Array(s.data.data,e.byteOffset||0,e.byteLength||s.data.data.byteLength),e.data&&(e.data=s.data.data)),n(s.data))};if(t.addEventListener("message",r),e.data){const i=e.data instanceof ArrayBuffer;s.byteOffset=i?0:e.data.byteOffset,s.byteLength=e.data.byteLength;const n=[i?e.data:e.data.buffer];t.postMessage(s,n)}else t.postMessage(s)},pC=2,fC=-101,mC=-102,gC="wvtt",yC=e=>{e.forEach(e=>{e.abort()})},_C=(e,t)=>{const{requestType:i}=t,n=fE({requestType:i,request:t,error:e});return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:fC,xhr:t,metadata:n}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:mC,xhr:t,metadata:n}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:pC,xhr:t,metadata:n}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:pC,xhr:t,metadata:n}:null},vC=(e,t,i,n)=>(s,r)=>{const a=r.response,o=_C(s,r);if(o)return i(o,e);if(16!==a.byteLength)return i({status:r.status,message:"Invalid HLS key at URL: "+r.uri,code:pC,xhr:r},e);const l=new DataView(a),u=new Uint32Array([l.getUint32(0),l.getUint32(4),l.getUint32(8),l.getUint32(12)]);for(let e=0;e<t.length;e++)t[e].bytes=u;const c={uri:r.uri};return n({type:"segmentkeyloadcomplete",segment:e,keyInfo:c}),i(null,e)},bC=(e,t)=>{const i=s_(e.map.bytes);if("mp4"!==i){const n=e.map.resolvedUri||e.map.uri,s=i||"unknown";return t({internal:!0,message:`Found unsupported ${s} container for initialization segment at URL: ${n}`,code:pC,metadata:{mediaType:s}})}dC({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]||(e.map.tracks[t.type]=t,"number"==typeof t.id&&t.timescale&&(e.map.timescales=e.map.timescales||{},e.map.timescales[t.id]=t.timescale),"text"===t.type&&((e,t)=>{t===gC&&e.transmuxer.postMessage({action:"initMp4WebVttParser",data:e.map.bytes})})(e,t.codec))}),t(null))})},TC=({segment:e,finishProcessingFn:t,responseType:i,triggerSegmentEventFn:n})=>(s,r)=>{const a=_C(s,r);if(a)return t(a,e);n({type:"segmentloaded",segment:e});const o="arraybuffer"!==i&&r.responseText?(e=>{const t=new Uint8Array(new ArrayBuffer(e.length));for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t.buffer})(r.responseText.substring(e.lastReachedChar||0)):r.response;return e.stats=(e=>({bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}))(r),e.key?e.encryptedBytes=new Uint8Array(o):e.bytes=new Uint8Array(o),t(null,e)},wC=({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:d,triggerSegmentEventFn:p})=>{const f=e.map&&e.map.tracks||{},m=Boolean(f.audio&&f.video);let g=n.bind(null,e,"audio","start");const y=n.bind(null,e,"audio","end");let _=n.bind(null,e,"video","start");const v=n.bind(null,e,"video","end");dC({action:"probeTs",transmuxer:e.transmuxer,data:t,baseStartTime:e.baseStartTime,callback:n=>{e.bytes=t=n.data;const f=n.result;f&&(i(e,{hasAudio:f.hasAudio,hasVideo:f.hasVideo,isMuxed:m}),i=null),uC({bytes:t,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,remux:m,onData:t=>{t.type="combined"===t.type?"video":t.type,c(e,t)},onTrackInfo:t=>{i&&(m&&(t.isMuxed=!0),i(e,t))},onAudioTimingInfo:e=>{g&&void 0!==e.start&&(g(e.start),g=null),y&&void 0!==e.end&&y(e.end)},onVideoTimingInfo:e=>{_&&void 0!==e.start&&(_(e.start),_=null),v&&void 0!==e.end&&v(e.end)},onVideoSegmentTimingInfo:t=>{const i={pts:{start:t.start.presentation,end:t.end.presentation},dts:{start:t.start.decode,end:t.end.decode}};p({type:"segmenttransmuxingtiminginfoavailable",segment:e,timingInfo:i}),s(t)},onAudioSegmentTimingInfo:t=>{const i={pts:{start:t.start.pts,end:t.end.pts},dts:{start:t.start.dts,end:t.end.dts}};p({type:"segmenttransmuxingtiminginfoavailable",segment:e,timingInfo:i}),r(t)},onId3:(t,i)=>{a(e,t,i)},onCaptions:t=>{o(e,[t])},isEndOfTimeline:l,onEndedTimeline:()=>{u()},onTransmuxerLog:d,onDone:(t,i)=>{h&&(t.type="combined"===t.type?"video":t.type,p({type:"segmenttransmuxingcomplete",segment:e}),h(i,e,t))},segment:e,triggerSegmentEventFn:p})}})},SC=({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:d,triggerSegmentEventFn:p})=>{let f=new Uint8Array(t);if(function(e){return qy(e,["moof"]).length>0}(f)){e.isFmp4=!0;const{tracks:s}=e.map;if(s.text&&(!s.audio||!s.video))return c(e,{data:f,type:"text"}),void((e,t,i)=>{t===gC&&dC({action:"getMp4WebVttText",data:e.bytes,transmuxer:e.transmuxer,callback:({data:t,mp4VttCues:n})=>{e.bytes=t,i(null,e,{mp4VttCues:n})}})})(e,s.text.codec,h);const r={isFmp4:!0,hasVideo:!!s.video,hasAudio:!!s.audio};s.audio&&s.audio.codec&&"enca"!==s.audio.codec&&(r.audioCodec=s.audio.codec),s.video&&s.video.codec&&"encv"!==s.video.codec&&(r.videoCodec=s.video.codec),s.video&&s.audio&&(r.isMuxed=!0),i(e,r);const l=(t,i)=>{c(e,{data:f,type:r.hasAudio&&!r.isMuxed?"audio":"video"}),i&&i.length&&a(e,i),t&&t.length&&o(e,t),h(null,e,{})};return void dC({action:"probeMp4StartTime",timescales:e.map.timescales,data:f,transmuxer:e.transmuxer,callback:({data:i,startTime:a})=>{t=i.buffer,e.bytes=f=i,r.hasAudio&&!r.isMuxed&&n(e,"audio","start",a),r.hasVideo&&n(e,"video","start",a),dC({action:"probeEmsgID3",data:f,transmuxer:e.transmuxer,offset:a,callback:({emsgData:i,id3Frames:n})=>{t=i.buffer,e.bytes=f=i,s.video&&i.byteLength&&e.transmuxer?dC({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:e.transmuxer,data:f,timescales:e.map.timescales,trackIds:[s.video.id],callback:i=>{t=i.data.buffer,e.bytes=f=i.data,i.logs.forEach(function(e){d(OS(e,{stream:"mp4CaptionParser"}))}),l(i.captions,n)}}):l(void 0,n)}})}})}if(e.transmuxer){if(void 0===e.container&&(e.container=s_(f)),"ts"!==e.container&&"aac"!==e.container)return i(e,{hasAudio:!1,hasVideo:!1}),void h(null,e,{});wC({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:d,triggerSegmentEventFn:p})}else h(null,e,{})},EC=function({id:e,key:t,encryptedBytes:i,decryptionWorker:n,segment:s,doneFn:r},a){const o=t=>{if(t.data.source===e){n.removeEventListener("message",o);const e=t.data.decrypted;a(new Uint8Array(e.bytes,e.byteOffset,e.byteLength))}};let l;n.onerror=()=>{const e="An error occurred in the decryption worker",t=KC({segment:s}),i={message:e,metadata:{error:new Error(e),errorType:ES.Error.StreamingFailedToDecryptSegment,segmentInfo:t,keyInfo:{uri:s.key.resolvedUri||s.map.key.resolvedUri}}};r(i,s)},n.addEventListener("message",o),l=t.bytes.slice?t.bytes.slice():new Uint32Array(Array.prototype.slice.call(t.bytes)),n.postMessage(RE({source:e,encrypted:i,key:l,iv:t.iv}),[i.buffer,l.buffer])},CC=({activeXhrs:e,decryptionWorker:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:d,triggerSegmentEventFn:p})=>{let f=0,m=!1;return(g,y)=>{if(!m){if(g)return m=!0,yC(e),h(g,y);if(f+=1,f===e.length){const f=function(){if(y.encryptedBytes)return(({decryptionWorker:e,segment:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:d,triggerSegmentEventFn:p})=>{p({type:"segmentdecryptionstart"}),EC({id:t.requestId,key:t.key,encryptedBytes:t.encryptedBytes,decryptionWorker:e,segment:t,doneFn:h},e=>{t.bytes=e,p({type:"segmentdecryptioncomplete",segment:t}),SC({segment:t,bytes:t.bytes,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:d,triggerSegmentEventFn:p})})})({decryptionWorker:t,segment:y,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:d,triggerSegmentEventFn:p});SC({segment:y,bytes:y.bytes,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:d,triggerSegmentEventFn:p})};if(y.endOfAllRequests=Date.now(),y.map&&y.map.encryptedBytes&&!y.map.bytes)return p({type:"segmentdecryptionstart",segment:y}),EC({decryptionWorker:t,id:y.requestId+"-init",encryptedBytes:y.map.encryptedBytes,key:y.map.key,segment:y,doneFn:h},t=>{y.map.bytes=t,p({type:"segmentdecryptioncomplete",segment:y}),bC(y,t=>{if(t)return yC(e),h(t,y);f()})});f()}}}},kC=({segment:e,progressFn:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c})=>i=>{if(!i.target.aborted)return e.stats=OS(e.stats,(e=>{const t=e.target,i={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-t.requestTime||0};return i.bytesReceived=e.loaded,i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3),i})(i)),!e.stats.firstBytesReceivedAt&&e.stats.bytesReceived&&(e.stats.firstBytesReceivedAt=Date.now()),t(i,e)},xC=({xhr:e,xhrOptions:t,decryptionWorker:i,segment:n,abortFn:s,progressFn:r,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:c,captionsFn:h,isEndOfTimeline:d,endedTimelineFn:p,dataFn:f,doneFn:m,onTransmuxerLog:g,triggerSegmentEventFn:y})=>{const _=[],v=CC({activeXhrs:_,decryptionWorker:i,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:c,captionsFn:h,isEndOfTimeline:d,endedTimelineFn:p,dataFn:f,doneFn:m,onTransmuxerLog:g,triggerSegmentEventFn:y});if(n.key&&!n.key.bytes){const i=[n.key];n.map&&!n.map.bytes&&n.map.key&&n.map.key.resolvedUri===n.key.resolvedUri&&i.push(n.map.key);const s=OS(t,{uri:n.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),r=vC(n,i,v,y);y({type:"segmentkeyloadstart",segment:n,keyInfo:{uri:n.key.resolvedUri}});const a=e(s,r);_.push(a)}if(n.map&&!n.map.bytes){if(n.map.key&&(!n.key||n.key.resolvedUri!==n.map.key.resolvedUri)){const i=OS(t,{uri:n.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),s=vC(n,[n.map.key],v,y);y({type:"segmentkeyloadstart",segment:n,keyInfo:{uri:n.map.key.resolvedUri}});const r=e(i,s);_.push(r)}const i=OS(t,{uri:n.map.resolvedUri,responseType:"arraybuffer",headers:OE(n.map),requestType:"segment-media-initialization"}),s=(({segment:e,finishProcessingFn:t,triggerSegmentEventFn:i})=>(n,s)=>{const r=_C(n,s);if(r)return t(r,e);const a=new Uint8Array(s.response);if(i({type:"segmentloaded",segment:e}),e.map.key)return e.map.encryptedBytes=a,t(null,e);e.map.bytes=a,bC(e,function(i){if(i)return i.xhr=s,i.status=s.status,t(i,e);t(null,e)})})({segment:n,finishProcessingFn:v,triggerSegmentEventFn:y});y({type:"segmentloadstart",segment:n});const r=e(i,s);_.push(r)}const b=OS(t,{uri:n.part&&n.part.resolvedUri||n.resolvedUri,responseType:"arraybuffer",headers:OE(n),requestType:"segment"}),T=TC({segment:n,finishProcessingFn:v,responseType:b.responseType,triggerSegmentEventFn:y});y({type:"segmentloadstart",segment:n});const w=e(b,T);w.addEventListener("progress",kC({segment:n,progressFn:r,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:c,captionsFn:h,isEndOfTimeline:d,endedTimelineFn:p,dataFn:f})),_.push(w);const S={};return _.forEach(e=>{e.addEventListener("loadend",(({loadendState:e,abortFn:t})=>i=>{i.target.aborted&&t&&!e.calledAbortFn&&(t(),e.calledAbortFn=!0)})({loadendState:S,abortFn:s}))}),()=>yC(_)},IC=PS("PlaylistSelector"),AC=function(e){if(!e||!e.playlist)return;const t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})},LC=function(e,t){if(!e)return"";const i=Dd.getComputedStyle(e);return i?i[t]:""},PC=function(e,t){const i=e.slice();e.sort(function(e,n){const s=t(e,n);return 0===s?i.indexOf(e)-i.indexOf(n):s})},OC=function(e,t){let i,n;return e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||Dd.Number.MAX_VALUE,t.attributes.BANDWIDTH&&(n=t.attributes.BANDWIDTH),n=n||Dd.Number.MAX_VALUE,i-n};let DC=function(e){const{main:t,bandwidth:i,playerWidth:n,playerHeight:s,playerObjectFit:r,limitRenditionByPlayerDimensions:a,playlistController:o}=e;if(!t)return;const l={bandwidth:i,width:n,height:s,limitRenditionByPlayerDimensions:a};let u=t.playlists;aE.isAudioOnly(t)&&(u=o.getAudioTrackPlaylists_(),l.audioOnly=!0);let c=u.map(e=>{let t;const i=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,n=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return t=e.attributes&&e.attributes.BANDWIDTH,t=t||Dd.Number.MAX_VALUE,{bandwidth:t,width:i,height:n,playlist:e}});PC(c,(e,t)=>e.bandwidth-t.bandwidth),c=c.filter(e=>!aE.isIncompatible(e.playlist));let h=c.filter(e=>aE.isEnabled(e.playlist));h.length||(h=c.filter(e=>!aE.isDisabled(e.playlist)));const d=h.filter(e=>e.bandwidth*JE.BANDWIDTH_VARIANCE<i);let p=d[d.length-1];const f=d.filter(e=>e.bandwidth===p.bandwidth)[0];if(!1===a){const e=f||h[0]||c[0];if(e&&e.playlist){let t="sortedPlaylistReps";return f&&(t="bandwidthBestRep"),h[0]&&(t="enabledPlaylistReps"),IC(`choosing ${AC(e)} using ${t} with options`,l),e.playlist}return IC("could not choose a playlist with options",l),null}const m=d.filter(e=>e.width&&e.height);PC(m,(e,t)=>e.width-t.width);const g=m.filter(e=>e.width===n&&e.height===s);p=g[g.length-1];const y=g.filter(e=>e.bandwidth===p.bandwidth)[0];let _,v,b,T;if(y||(_=m.filter(e=>"cover"===r?e.width>n&&e.height>s:e.width>n||e.height>s),v=_.filter(e=>e.width===_[0].width&&e.height===_[0].height),p=v[v.length-1],b=v.filter(e=>e.bandwidth===p.bandwidth)[0]),o.leastPixelDiffSelector){const e=m.map(e=>(e.pixelDiff=Math.abs(e.width-n)+Math.abs(e.height-s),e));PC(e,(e,t)=>e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff),T=e[0]}const w=T||b||y||f||h[0]||c[0];if(w&&w.playlist){let e="sortedPlaylistReps";return T?e="leastPixelDiffRep":b?e="resolutionPlusOneRep":y?e="resolutionBestRep":f?e="bandwidthBestRep":h[0]&&(e="enabledPlaylistReps"),IC(`choosing ${AC(w)} using ${e} with options`,l),w.playlist}return IC("could not choose a playlist with options",l),null};const MC=function(){let e=this.useDevicePixelRatio&&Dd.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(e=this.customPixelRatio),DC({main:this.playlists.main,bandwidth:this.systemBandwidth,playerWidth:parseInt(LC(this.tech_.el(),"width"),10)*e,playerHeight:parseInt(LC(this.tech_.el(),"height"),10)*e,playerObjectFit:this.usePlayerObjectFit?LC(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})};function NC(e){try{return new URL(e).pathname.split("/").slice(-2).join("/")}catch(e){return""}}const RC=({inbandTextTracks:e,metadataArray:t,timestampOffset:i,videoDuration:n})=>{if(!t)return;const s=Dd.WebKitDataCue||Dd.VTTCue,r=e.metadataTrack_;if(!r)return;if(t.forEach(e=>{const t=e.cueTime+i;!("number"!=typeof t||Dd.isNaN(t)||t<0)&&t<1/0&&e.frames&&e.frames.length&&e.frames.forEach(e=>{const i=new s(t,t,e.value||e.url||e.data||"");i.frame=e,i.value=e,function(e){Object.defineProperties(e.frame,{id:{get:()=>(ES.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key)},value:{get:()=>(ES.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data)},privateData:{get:()=>(ES.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data)}})}(i),r.addCue(i)})}),!r.cues||!r.cues.length)return;const a=r.cues,o=[];for(let e=0;e<a.length;e++)a[e]&&o.push(a[e]);const l=o.reduce((e,t)=>{const i=e[t.startTime]||[];return i.push(t),e[t.startTime]=i,e},{}),u=Object.keys(l).sort((e,t)=>Number(e)-Number(t));u.forEach((e,t)=>{const i=l[e],s=isFinite(n)?n:e,r=Number(u[t+1])||s;i.forEach(e=>{e.endTime=r})})},FC={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},BC=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),UC=(e,t,i)=>{e.metadataTrack_||(e.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,ES.browser.IS_ANY_SAFARI||(e.metadataTrack_.inBandMetadataTrackDispatchType=t))},jC=function(e,t,i){let n,s;if(i&&i.cues)for(n=i.cues.length;n--;)s=i.cues[n],s.startTime>=e&&s.endTime<=t&&i.removeCue(s)},$C=e=>"number"==typeof e&&isFinite(e),qC=1/60,VC=e=>{const{startOfSegment:t,duration:i,segment:n,part:s,playlist:{mediaSequence:r,id:a,segments:o=[]},mediaIndex:l,partIndex:u,timeline:c}=e,h=o.length-1;let d="mediaIndex/partIndex increment";e.getMediaInfoForTime?d=`getMediaInfoForTime (${e.getMediaInfoForTime})`:e.isSyncRequest&&(d="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(d+=` with independent ${e.independent}`);const p="number"==typeof u,f=e.segment.uri?"segment":"pre-segment",m=p?WS({preloadSegment:n})-1:0;return`${f} [${r+l}/${r+h}]`+(p?` part [${u}/${m}]`:"")+` segment start/end [${n.start} => ${n.end}]`+(p?` part start/end [${s.start} => ${s.end}]`:"")+` startOfSegment [${t}]`+` duration [${i}]`+` timeline [${c}]`+` selected by [${d}]`+` playlist [${a}]`},HC=e=>`${e}TimingInfo`,zC=({timelineChangeController:e,currentTimeline:t,segmentTimeline:i,loaderType:n,audioDisabled:s})=>{if(t===i)return!1;if("audio"===n){const t=e.lastTimelineChange({type:"main"});return!t||t.to!==i}if("main"===n&&s){const t=e.pendingTimelineChange({type:"audio"});return!t||t.to!==i}return!1},WC=e=>{const t=e.pendingSegment_;if(!t)return;if(zC({timelineChangeController:e.timelineChangeController_,currentTimeline:e.currentTimeline_,segmentTimeline:t.timeline,loaderType:e.loaderType_,audioDisabled:e.audioDisabled_})&&(e=>{if(!e)return!1;const t=e.pendingTimelineChange({type:"audio"}),i=e.pendingTimelineChange({type:"main"}),n=t&&i,s=n&&t.to!==i.to;return!(!n||-1===t.from||-1===i.from||!s)})(e.timelineChangeController_)){if((e=>{const t=e.timelineChangeController_.pendingTimelineChange({type:"audio"}),i=e.timelineChangeController_.pendingTimelineChange({type:"main"});return t&&i&&t.to<i.to})(e))return void e.timelineChangeController_.trigger("audioTimelineBehind");e.timelineChangeController_.trigger("fixBadTimelineChange")}},GC=({segmentDuration:e,maxDuration:t})=>!!e&&Math.round(e)>t+MS,XC=(e,t)=>{if("hls"!==t)return null;const i=(e=>{let t=0;return["video","audio"].forEach(function(i){const n=e[`${i}TimingInfo`];if(!n)return;const{start:s,end:r}=n;let a;"bigint"==typeof s||"bigint"==typeof r?a=Dd.BigInt(r)-Dd.BigInt(s):"number"==typeof s&&"number"==typeof r&&(a=r-s),void 0!==a&&a>t&&(t=a)}),"bigint"==typeof t&&t<Number.MAX_SAFE_INTEGER&&(t=Number(t)),t})({audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo});if(!i)return null;const n=e.playlist.targetDuration,s=GC({segmentDuration:i,maxDuration:2*n}),r=GC({segmentDuration:i,maxDuration:n}),a=`Segment with index ${e.mediaIndex} from playlist ${e.playlist.id} has a duration of ${i} when the reported duration is ${e.duration} and the target duration is ${n}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return s||r?{severity:s?"warn":"info",message:a}:null},KC=({type:e,segment:t})=>{if(!t)return;const i=Boolean(t.key||t.map&&t.map.ke),n=Boolean(t.map&&!t.map.bytes),s=void 0===t.startOfSegment?t.start:t.startOfSegment;return{type:e||t.type,uri:t.resolvedUri||t.uri,start:s,duration:t.duration,isEncrypted:i,isMediaInitialization:n}};class YC extends ES.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if("function"!=typeof e.currentTime)throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=PS(`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_():WC(this)}),this.sourceUpdater_.on("codecschange",e=>{this.trigger(up({type:"codecschange"},e))}),"main"===this.loaderType_&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():WC(this)}),"audio"===this.loaderType_&&this.timelineChangeController_.on("timelinechange",e=>{this.trigger(up({type:"timelinechange"},e)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():WC(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():WC(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return hC({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_&&Dd.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if("WAITING"!==this.state)return this.pendingSegment_&&(this.pendingSegment_=null),void this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,Dd.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_&&cC(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return DS();if("main"===this.loaderType_){const{hasAudio:t,hasVideo:i,isMuxed:n}=e;if(i&&t&&!this.audioDisabled_&&!n)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const i=FE(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;const i=BE(e);let n=this.keyCache_[i];this.cacheEncryptionKeys_&&t&&!n&&e.bytes&&(this.keyCache_[i]=n={resolvedUri:e.resolvedUri,bytes:e.bytes});const s={resolvedUri:(n||e).resolvedUri};return n&&(s.bytes=n.bytes),s}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),this.playlist_)return"INIT"===this.state&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY"))}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e)return;if(this.playlist_&&this.playlist_.endList&&e.endList&&this.playlist_.uri===e.uri)return;const i=this.playlist_,n=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(i&&(i.id?s=i.id:i.uri&&(s=i.uri)),this.logger_(`playlist update [${s} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update:\ncurrentTime: ${this.currentTime_()}\nbufferedEnd: ${$S(this.buffered_())}\n`,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri){if(null!==this.mediaIndex){!e.endList&&"number"==typeof e.partTargetDuration?this.resetLoader():this.resyncLoader()}return this.currentMediaInfo_=void 0,void this.trigger("playlistupdate")}const r=e.mediaSequence-i.mediaSequence;if(this.logger_(`live window shift [${r}]`),null!==this.mediaIndex)if(this.mediaIndex-=r,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const e=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!e.parts||!e.parts.length||!e.parts[this.partIndex])){const e=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=e}}n&&(n.mediaIndex-=r,n.mediaIndex<0?(n.mediaIndex=null,n.partIndex=null):(n.mediaIndex>=0&&(n.segment=e.segments[n.mediaIndex]),n.partIndex>=0&&n.segment.parts&&(n.part=n.segment.parts[n.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e)}pause(){this.checkBufferTimeout_&&(Dd.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return null===this.checkBufferTimeout_}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&cC(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;"hls"===this.sourceType_&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,i=()=>{},n=!1){if(t===1/0&&(t=this.duration_()),t<=e)return void this.logger_("skipping remove because end ${end} is <= start ${start}");if(!this.sourceUpdater_||!this.getMediaInfo_())return void this.logger_("skipping remove because no source updater or starting media info");let s=1;const r=()=>{s--,0===s&&i()};!n&&this.audioDisabled_||(s++,this.sourceUpdater_.removeAudio(e,t,r)),(n||"main"===this.loaderType_)&&(this.gopBuffer_=((e,t,i,n)=>{const s=Math.ceil((t-n)*r_),r=Math.ceil((i-n)*r_),a=e.slice();let o=e.length;for(;o--&&!(e[o].pts<=r););if(-1===o)return a;let l=o+1;for(;l--&&!(e[l].pts<=s););return l=Math.max(l,0),a.splice(l,o-l+1),a})(this.gopBuffer_,e,t,this.timeMapping_),s++,this.sourceUpdater_.removeVideo(e,t,r));for(const i in this.inbandTextTracks_)jC(e,t,this.inbandTextTracks_[i]);jC(e,t,this.segmentMetadataTrack_),r()}monitorBuffer_(){this.checkBufferTimeout_&&Dd.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=Dd.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&Dd.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=Dd.setTimeout(this.monitorBufferTick_.bind(this),500)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const t={segmentInfo:KC({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:t}),"number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,i=this.partIndex){if(!t||!this.mediaSource_)return!1;const n="number"==typeof e&&t.segments[e],s=e+1===t.segments.length,r=!n||!n.parts||i+1===n.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&s&&r}chooseNextRequest_(){const e=this.buffered_(),t=$S(e)||0,i=qS(e,this.currentTime_()),n=!this.hasPlayed_()&&i>=1,s=i>=this.goalBufferLength_(),r=this.playlist_.segments;if(!r.length||n||s)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const a={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(a.isSyncRequest)a.mediaIndex=function(e,t,i){t=t||[];const n=[];let s=0;for(let r=0;r<t.length;r++){const a=t[r];if(e===a.timeline&&(n.push(r),s+=a.duration,s>i))return r}return 0===n.length?0:n[n.length-1]}(this.currentTimeline_,r,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${a.mediaIndex}`);else if(null!==this.mediaIndex){const e=r[this.mediaIndex],i="number"==typeof this.partIndex?this.partIndex:-1;a.startOfSegment=e.end?e.end:t,e.parts&&e.parts[i+1]?(a.mediaIndex=this.mediaIndex,a.partIndex=i+1):a.mediaIndex=this.mediaIndex+1}else{let e,i,n;const s=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch:\nFor TargetTime: ${s}.\nCurrentTime: ${this.currentTime_()}\nBufferedEnd: ${t}\nFetch At Buffer: ${this.fetchAtBuffer_}\n`,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const t=this.getSyncInfoFromMediaSequenceSync_(s);if(!t){const e="No sync info found while using media sequence sync";return this.error({message:e,metadata:{errorType:ES.Error.StreamingFailedToSelectNextSegment,error:new Error(e)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${t.start} --\x3e ${t.end})`),e=t.segmentIndex,i=t.partIndex,n=t.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const t=aE.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:s,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});e=t.segmentIndex,i=t.partIndex,n=t.startTime}a.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${s}`:`currentTime ${s}`,a.mediaIndex=e,a.startOfSegment=n,a.partIndex=i,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${a.mediaIndex} `)}const o=r[a.mediaIndex];let l=o&&"number"==typeof a.partIndex&&o.parts&&o.parts[a.partIndex];if(!o||"number"==typeof a.partIndex&&!l)return null;"number"!=typeof a.partIndex&&o.parts&&(a.partIndex=0,l=o.parts[0]);const u=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!i&&l&&!u&&!l.independent)if(0===a.partIndex){const e=r[a.mediaIndex-1],t=e.parts&&e.parts.length&&e.parts[e.parts.length-1];t&&t.independent&&(a.mediaIndex-=1,a.partIndex=e.parts.length-1,a.independent="previous segment")}else o.parts[a.partIndex-1].independent&&(a.partIndex-=1,a.independent="previous part");const c=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return a.mediaIndex>=r.length-1&&c&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,a.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(a))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);const i=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!i)return null;if(!i.isAppended)return i;const n=this.mediaSequenceSync_.getSyncInfoForTime(i.end);return n?(n.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),n):null}generateSegmentInfo_(e){const{independent:t,playlist:i,mediaIndex:n,startOfSegment:s,isSyncRequest:r,partIndex:a,forceTimestampOffset:o,getMediaInfoForTime:l}=e,u=i.segments[n],c="number"==typeof a&&u.parts[a],h={requestId:"segment-loader-"+Math.random(),uri:c&&c.resolvedUri||u.resolvedUri,mediaIndex:n,partIndex:c?a:null,isSyncRequest:r,startOfSegment:s,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:u.timeline,duration:c&&c.duration||u.duration,segment:u,part:c,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:l,independent:t},d=void 0!==o?o:this.isPendingTimestampOffset_;h.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:u.timeline,currentTimeline:this.currentTimeline_,startOfSegment:s,buffered:this.buffered_(),overrideCheck:d});const p=$S(this.sourceUpdater_.audioBuffered());return"number"==typeof p&&(h.audioAppendStart=p-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(h.gopsToAlignWith=((e,t,i)=>{if(null==t||!e.length)return[];const n=Math.ceil((t-i+3)*r_);let s;for(s=0;s<e.length&&!(e[s].pts>n);s++);return e.slice(s)})(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),h}timestampOffsetForSegment_(e){return(({segmentTimeline:e,currentTimeline:t,startOfSegment:i,buffered:n,overrideCheck:s})=>s||e!==t?e<t?i:n.length?n.end(n.length-1):i:null)(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH)return;if(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),i=e.bandwidth,n=this.pendingSegment_.duration,s=aE.estimateSegmentRequestTime(n,i,this.playlist_,e.bytesReceived),r=function(e,t,i=1){return((e.length?e.end(e.length-1):0)-t)/i}(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(s<=r)return;const a=function(e){const{main:t,currentTime:i,bandwidth:n,duration:s,segmentDuration:r,timeUntilRebuffer:a,currentTimeline:o,syncController:l}=e,u=t.playlists.filter(e=>!aE.isIncompatible(e));let c=u.filter(aE.isEnabled);c.length||(c=u.filter(e=>!aE.isDisabled(e)));const h=c.filter(aE.hasAttribute.bind(null,"BANDWIDTH")).map(e=>{const t=l.getSyncPoint(e,s,o,i)?1:2;return{playlist:e,rebufferingImpact:aE.estimateSegmentRequestTime(r,n,e)*t-a}}),d=h.filter(e=>e.rebufferingImpact<=0);return PC(d,(e,t)=>OC(t.playlist,e.playlist)),d.length?d[0]:(PC(h,(e,t)=>e.rebufferingImpact-t.rebufferingImpact),h[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(!a)return;const o=s-r-a.rebufferingImpact;let l=.5;r<=MS&&(l=1),!a.playlist||a.playlist.uri===this.playlist_.uri||o<l||(this.bandwidth=a.playlist.attributes.BANDWIDTH*JE.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${VC(e)}`),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),this.checkForAbort_(t.requestId)||this.trigger("progress")}handleTrackInfo_(e,t){const{hasAudio:i,hasVideo:n}=t,s={segmentInfo:KC({type:this.loaderType_,segment:e}),trackInfo:{hasAudio:i,hasVideo:n}};this.trigger({type:"segmenttransmuxingtrackinfoavailable",metadata:s}),this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||this.checkForIllegalMediaSwitch(t)||(t=t||{},function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;const i=Object.keys(e).sort(),n=Object.keys(t).sort();if(i.length!==n.length)return!1;for(let s=0;s<i.length;s++){const r=i[s];if(r!==n[s])return!1;if(e[r]!==t[r])return!1}return!0}(this.currentMediaInfo_,t)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_("trackinfo update",t),this.trigger("trackinfo")),this.checkForAbort_(e.requestId)||(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()?this.processCallQueue_():WC(this)))}handleTimingInfo_(e,t,i,n){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const s=this.pendingSegment_,r=HC(t);s[r]=s[r]||{},s[r][i]=n,this.logger_(`timinginfo: ${t} - ${i} - ${n}`),this.hasEnoughInfoToAppend_()?this.processCallQueue_():WC(this)}handleCaptions_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(0===t.length)return void this.logger_("SegmentLoader received no captions from a caption event");if(!this.pendingSegment_.hasAppendedData_)return void this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));const i=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),n={};t.forEach(e=>{n[e.stream]=n[e.stream]||{startTime:1/0,captions:[],endTime:0};const t=n[e.stream];t.startTime=Math.min(t.startTime,e.startTime+i),t.endTime=Math.max(t.endTime,e.endTime+i),t.captions.push(e)}),Object.keys(n).forEach(e=>{const{startTime:t,endTime:s,captions:r}=n[e],a=this.inbandTextTracks_;this.logger_(`adding cues from ${t} -> ${s} for ${e}`),function(e,t,i){if(!e[i]){t.trigger({type:"usage",name:"vhs-608"});let n=i;/^cc708_/.test(i)&&(n="SERVICE"+i.split("_")[1]);const s=t.textTracks().getTrackById(n);if(s)e[i]=s;else{let s=i,r=i,a=!1;const o=(t.options_.vhs&&t.options_.vhs.captionServices||{})[n];o&&(s=o.label,r=o.language,a=o.default),e[i]=t.addRemoteTextTrack({kind:"captions",id:n,default:a,label:s,language:r},!1).track}}}(a,this.vhs_.tech_,e),jC(t,s,a[e]),function({inbandTextTracks:e,captionArray:t,timestampOffset:i}){if(!t)return;const n=Dd.WebKitDataCue||Dd.VTTCue;t.forEach(t=>{const s=t.stream;t.content?t.content.forEach(r=>{const a=new n(t.startTime+i,t.endTime+i,r.text);a.line=r.line,a.align="left",a.position=r.position,a.positionAlign="line-left",e[s].addCue(a)}):e[s].addCue(new n(t.startTime+i,t.endTime+i,t.text))})}({captionArray:r,inbandTextTracks:a,timestampOffset:i})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,i){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;this.pendingSegment_.hasAppendedData_?this.addMetadataToTextTrack(i,t,this.duration_()):this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i))}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(e=>e())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(e=>e())}hasEnoughInfoToLoad_(){if("audio"!==this.loaderType_)return!0;const e=this.pendingSegment_;return!!e&&(!this.getCurrentMediaInfo_()||!zC({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready())return!1;if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:i,hasVideo:n,isMuxed:s}=t;return!(n&&!e.videoTimingInfo)&&(!(i&&!this.audioDisabled_&&!s&&!e.audioTimingInfo)&&!zC({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_())return WC(this),void this.callQueue_.push(this.handleData_.bind(this,e,t));const i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.part||i.segment),"closed"!==this.mediaSource_.readyState){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),i.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[HC(t.type)].start;else{const e=this.getCurrentMediaInfo_(),t="main"===this.loaderType_&&e&&e.hasVideo;let n;t&&(n=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:t,firstVideoFrameTimeForData:n,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(i,t.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:"main"===this.loaderType_});const e=this.chooseNextRequest_();if(e.mediaIndex!==i.mediaIndex||e.partIndex!==i.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,t)}}updateAppendInitSegmentStatus(e,t){"main"!==this.loaderType_||"number"!=typeof e.timestampOffset||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:i,playlist:n}){if(i){const e=FE(i);if(this.activeInitSegmentId_===e)return null;t=this.initSegmentForMap(i,!0).bytes,this.activeInitSegmentId_=e}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){const s=this.sourceUpdater_.audioBuffered(),r=this.sourceUpdater_.videoBuffered();s.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+jS(s).join(", ")),r.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+jS(r).join(", "));const a=s.length?s.start(0):0,o=s.length?s.end(s.length-1):0,l=r.length?r.start(0):0,u=r.length?r.end(r.length-1):0;if(o-a<=1&&u-l<=1)return this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${i.byteLength}, audio buffer: ${jS(s).join(", ")}, video buffer: ${jS(r).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:i}));const c=this.currentTime_()-1;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${c}`),this.remove(0,c,()=>{this.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=Dd.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.logger_("Received non QUOTA_EXCEEDED_ERR on append",n),this.error({message:`${t} append of ${i.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:ES.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i}))}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:i,data:n,bytes:s}){if(!s){const e=[n];let t=n.byteLength;i&&(e.unshift(i),t+=i.byteLength),s=(e=>{let t,i=0;return e.bytes&&(t=new Uint8Array(e.bytes),e.segments.forEach(e=>{t.set(e,i),i+=e.byteLength})),t})({bytes:t,segments:e})}const r={segmentInfo:KC({type:this.loaderType_,segment:e})};this.trigger({type:"segmentappendstart",metadata:r}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:s},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:s}))}handleSegmentTimingInfo_(e,t,i){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const n=this.pendingSegment_.segment,s=`${e}TimingInfo`;n[s]||(n[s]={}),n[s].transmuxerPrependedSeconds=i.prependedContentDuration||0,n[s].transmuxedPresentationStart=i.start.presentation,n[s].transmuxedDecodeStart=i.start.decode,n[s].transmuxedPresentationEnd=i.end.presentation,n[s].transmuxedDecodeEnd=i.end.decode,n[s].baseMediaDecodeTime=i.baseMediaDecodeTime}appendData_(e,t){const{type:i,data:n}=t;if(!n||!n.byteLength)return;if("audio"===i&&this.audioDisabled_)return;const s=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:s,data:n})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_())return WC(this),void this.loadQueue_.push(()=>{const t=up({},e,{forceTimestampOffset:!0});up(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),i=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),n=null!==this.mediaIndex,s=e.timeline!==this.currentTimeline_&&e.timeline>0,r=i||n&&s;this.logger_(`Requesting\n${NC(e.uri)}\n${VC(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=xC({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:r,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:t,level:i,stream:n})=>{this.logger_(`${VC(e)} logged from transmuxer stream ${n} as a ${i}: ${t}`)},triggerSegmentEventFn:({type:e,segment:t,keyInfo:i,trackInfo:n,timingInfo:s})=>{const r={segmentInfo:KC({segment:t})};i&&(r.keyInfo=i),n&&(r.trackInfo=n),s&&(r.timingInfo=s),this.trigger({type:e,metadata:r})}})}trimBackBuffer_(e){const t=((e,t,i)=>{let n=t-JE.BACK_BUFFER_LENGTH;e.length&&(n=Math.max(n,e.start(0)));const s=t-i;return Math.min(s,n)})(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,i=e.part,n=e.segment.key||e.segment.map&&e.segment.map.key,s=e.segment.map&&!e.segment.map.bytes,r={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:n,isMediaInitialization:s},a=e.playlist.segments[e.mediaIndex-1];if(a&&a.timeline===t.timeline&&(a.videoTimingInfo?r.baseStartTime=a.videoTimingInfo.transmuxedDecodeEnd:a.audioTimingInfo&&(r.baseStartTime=a.audioTimingInfo.transmuxedDecodeEnd)),t.key){const i=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);r.key=this.segmentKey(t.key),r.key.iv=i}return t.map&&(r.map=this.initSegmentForMap(t.map)),r}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e<qC)return void this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record 0.016666666666666666`);const i={bandwidthInfo:{from:this.bandwidth,to:t.bandwidth}};this.trigger({type:"bandwidthupdated",metadata:i}),this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime}handleTimeout_(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")}segmentRequestFinished_(e,t,i){if(this.callQueue_.length)return void this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,i));if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return;if(t.requestId!==this.pendingSegment_.requestId)return;if(e){if(this.pendingSegment_=null,this.state="READY",e.code===mC)return;return this.pause(),e.code===fC?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error"))}const n=this.pendingSegment_;this.saveBandwidthRelatedStats_(n.duration,t.stats),n.endOfAllRequests=t.endOfAllRequests,i.gopInfo&&(this.gopBuffer_=((e,t,i)=>{if(!t.length)return e;if(i)return t.slice();const n=t[0].pts;let s=0;for(;s<e.length&&!(e[s].pts>=n);s++);return e.slice(0,s).concat(t)})(this.gopBuffer_,i.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(n)}setTimeMapping_(e){const t=this.syncController_.mappingForTimeline(e);null!==t&&(this.timeMapping_=t)}updateMediaSecondsLoaded_(e){"number"==typeof e.start&&"number"==typeof e.end?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration}shouldUpdateTransmuxerTimestampOffset_(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())}trueSegmentStart_({currentStart:e,playlist:t,mediaIndex:i,firstVideoFrameTimeForData:n,currentVideoTimestampOffset:s,useVideoTimingInfo:r,videoTimingInfo:a,audioTimingInfo:o}){if(void 0!==e)return e;if(!r)return o.start;const l=t.segments[i-1];return 0!==i&&l&&void 0!==l.start&&l.end===n+s?a.start:n}waitForAppendsToComplete_(e){const t=this.getCurrentMediaInfo_(e);if(!t)return this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),void this.trigger("error");const{hasAudio:i,hasVideo:n,isMuxed:s}=t,r="main"===this.loaderType_&&n,a=!this.audioDisabled_&&i&&!s;if(e.waitingOnAppends=0,!e.hasAppendedData_)return e.timingInfo||"number"!=typeof e.timestampOffset||(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),void this.checkAppendsDone_(e);r&&e.waitingOnAppends++,a&&e.waitingOnAppends++,r&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),a&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,0===e.waitingOnAppends&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=((e,t,i)=>"main"===e&&t&&i?i.hasAudio||i.hasVideo?t.hasVideo&&!i.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!t.hasVideo&&i.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null)(this.loaderType_,this.getCurrentMediaInfo_(),e);return!!t&&(this.error({message:t,playlistExclusionDuration:1/0}),this.trigger("error"),!0)}updateSourceBufferTimestampOffset_(e){if(null===e.timestampOffset||"number"!=typeof e.timingInfo.start||e.changedTimestampOffset||"main"!==this.loaderType_)return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:i}){return this.useDtsForTimestampOffset_?e&&"number"==typeof e.transmuxedDecodeStart?e.transmuxedDecodeStart:t&&"number"==typeof t.transmuxedDecodeStart?t.transmuxedDecodeStart:i.start:i.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),i="main"===this.loaderType_&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;i&&(e.timingInfo.end="number"==typeof i.end?i.end:i.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_){const e={segmentInfo:KC({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:e})}if(!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());const e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_});const t=XC(e,this.sourceType_);if(t&&("warn"===t.severity?ES.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_))return void this.logger_(`Throwing away un-appended sync request ${VC(e)}`);this.logger_(`Appended ${VC(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),"main"!==this.loaderType_||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const i=e.segment,n=e.part,s=i.end&&this.currentTime_()-i.end>3*e.playlist.targetDuration,r=n&&n.end&&this.currentTime_()-n.end>3*e.playlist.partTargetDuration;if(s||r)return this.logger_(`bad ${s?"segment":"part"} ${VC(e)}`),void this.resetEverything();null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duration<qC)return void this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record 0.016666666666666666`);const t=this.throughput.rate,i=Date.now()-e.endOfAllRequests+1,n=Math.floor(e.byteLength/i*8*1e3);this.throughput.rate+=(n-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;const t=e.segment,i=t.start,n=t.end;if(!$C(i)||!$C(n))return;jC(i,n,this.segmentMetadataTrack_);const s=Dd.WebKitDataCue||Dd.VTTCue,r={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,programDateTime:t.programDateTime,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:i,end:n},a=new s(i,n,JSON.stringify(r));a.value=r,this.segmentMetadataTrack_.addCue(a)}}function QC(){}const JC=function(e){return"string"!=typeof e?e:e.replace(/./,e=>e.toUpperCase())},ZC=["video","audio"],ek=(e,t)=>{const i=t[`${e}Buffer`];return i&&i.updating||t.queuePending[e]},tk=(e,t)=>{if(0===t.queue.length)return;let i=0,n=t.queue[i];if("mediaSource"!==n.type){if("mediaSource"!==e&&t.ready()&&"closed"!==t.mediaSource.readyState&&!ek(e,t)){if(n.type!==e){if(i=((e,t)=>{for(let i=0;i<t.length;i++){const n=t[i];if("mediaSource"===n.type)return null;if(n.type===e)return i}return null})(e,t.queue),null===i)return;n=t.queue[i]}return t.queue.splice(i,1),t.queuePending[e]=n,n.action(e,t),n.doneFn?void 0:(t.queuePending[e]=null,void tk(e,t))}}else t.updating()||"closed"===t.mediaSource.readyState||(t.queue.shift(),n.action(t),n.doneFn&&n.doneFn(),tk("audio",t),tk("video",t))},ik=(e,t)=>{const i=t[`${e}Buffer`],n=JC(e);i&&(i.removeEventListener("updateend",t[`on${n}UpdateEnd_`]),i.removeEventListener("error",t[`on${n}Error_`]),t.codecs[e]=null,t[`${e}Buffer`]=null)},nk=(e,t)=>e&&t&&-1!==Array.prototype.indexOf.call(e.sourceBuffers,t),sk=(e,t,i)=>(n,s)=>{const r=s[`${n}Buffer`];if(nk(s.mediaSource,r)){s.logger_(`Appending segment ${t.mediaIndex}'s ${e.length} bytes to ${n}Buffer`);try{r.appendBuffer(e)}catch(e){s.logger_(`Error with code ${e.code} `+(22===e.code?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${t.mediaIndex} to ${n}Buffer`),s.queuePending[n]=null,i(e)}}},rk=(e,t)=>(i,n)=>{const s=n[`${i}Buffer`];if(nk(n.mediaSource,s)){n.logger_(`Removing ${e} to ${t} from ${i}Buffer`);try{s.remove(e,t)}catch(s){n.logger_(`Remove ${e} to ${t} from ${i}Buffer failed`)}}},ak=e=>(t,i)=>{const n=i[`${t}Buffer`];nk(i.mediaSource,n)&&(i.logger_(`Setting ${t}timestampOffset to ${e}`),n.timestampOffset=e)},ok=e=>(t,i)=>{e()},lk=e=>t=>{if("open"===t.mediaSource.readyState){t.logger_(`Calling mediaSource endOfStream(${e||""})`);try{t.mediaSource.endOfStream(e)}catch(e){ES.log.warn("Failed to call media source endOfStream",e)}}},uk=e=>t=>{t.logger_(`Setting mediaSource duration to ${e}`);try{t.mediaSource.duration=e}catch(e){ES.log.warn("Failed to set media source duration",e)}},ck=()=>(e,t)=>{if("open"!==t.mediaSource.readyState)return;const i=t[`${e}Buffer`];if(nk(t.mediaSource,i)){t.logger_(`calling abort on ${e}Buffer`);try{i.abort()}catch(t){ES.log.warn(`Failed to abort on ${e}Buffer`,t)}}},hk=(e,t)=>i=>{const n=JC(e),s=Sf(t);i.logger_(`Adding ${e}Buffer with codec ${t} to mediaSource`);const r=i.mediaSource.addSourceBuffer(s);r.addEventListener("updateend",i[`on${n}UpdateEnd_`]),r.addEventListener("error",i[`on${n}Error_`]),i.codecs[e]=t,i[`${e}Buffer`]=r},dk=e=>t=>{const i=t[`${e}Buffer`];if(ik(e,t),nk(t.mediaSource,i)){t.logger_(`Removing ${e}Buffer with codec ${t.codecs[e]} from mediaSource`);try{t.mediaSource.removeSourceBuffer(i)}catch(t){ES.log.warn(`Failed to removeSourceBuffer ${e}Buffer`,t)}}},pk=e=>(t,i)=>{const n=i[`${t}Buffer`],s=Sf(e);if(!nk(i.mediaSource,n))return;const r=e.substring(0,e.indexOf(".")),a=i.codecs[t];if(a.substring(0,a.indexOf("."))===r)return;const o={codecsChangeInfo:{from:a,to:e}};i.trigger({type:"codecschange",metadata:o}),i.logger_(`changing ${t}Buffer codec from ${a} to ${e}`);try{n.changeType(s),i.codecs[t]=e}catch(e){o.errorType=ES.Error.StreamingCodecsChangeError,o.error=e,e.metadata=o,i.error_=e,i.trigger("error"),ES.log.warn(`Failed to changeType on ${t}Buffer`,e)}},fk=({type:e,sourceUpdater:t,action:i,doneFn:n,name:s})=>{t.queue.push({type:e,action:i,doneFn:n,name:s}),tk(e,t)},mk=(e,t)=>i=>{const n=function(e){if(0===e.length)return"Buffered Ranges are empty";let t="Buffered Ranges: \n";for(let i=0;i<e.length;i++){const n=e.start(i),s=e.end(i);t+=`${n} --\x3e ${s}. Duration (${s-n})\n`}return t}(t[`${e}Buffered`]());if(t.logger_(`received "updateend" event for ${e} Source Buffer: `,n),t.queuePending[e]){const i=t.queuePending[e].doneFn;t.queuePending[e]=null,i&&i(t[`${e}Error_`])}tk(e,t)};class gk extends ES.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>tk("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=PS("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=mk("video",this),this.onAudioUpdateEnd_=mk("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){fk({type:"mediaSource",sourceUpdater:this,action:hk(e,t),name:"addSourceBuffer"})}abort(e){fk({type:e,sourceUpdater:this,action:ck(e),name:"abort"})}removeSourceBuffer(e){this.canRemoveSourceBuffer()?fk({type:"mediaSource",sourceUpdater:this,action:dk(e),name:"removeSourceBuffer"}):ES.log.error("removeSourceBuffer is not supported!")}canRemoveSourceBuffer(){return!ES.browser.IS_FIREFOX&&Dd.MediaSource&&Dd.MediaSource.prototype&&"function"==typeof Dd.MediaSource.prototype.removeSourceBuffer}static canChangeType(){return Dd.SourceBuffer&&Dd.SourceBuffer.prototype&&"function"==typeof Dd.SourceBuffer.prototype.changeType}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){this.canChangeType()?fk({type:e,sourceUpdater:this,action:pk(t),name:"changeType"}):ES.log.error("changeType is not supported!")}addOrChangeSourceBuffers(e){if(!e||"object"!=typeof e||0===Object.keys(e).length)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{const i=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,i);this.canChangeType()&&this.changeType(t,i)})}appendBuffer(e,t){const{segmentInfo:i,type:n,bytes:s}=e;if(this.processedAppend_=!0,"audio"===n&&this.videoBuffer&&!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([e,t]),void this.logger_(`delayed audio append of ${s.length} until video append`);if(fk({type:n,sourceUpdater:this,action:sk(s,i||{mediaIndex:-1},t),doneFn:t,name:"appendBuffer"}),"video"===n){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const e=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${e.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,e.forEach(e=>{this.appendBuffer.apply(this,e)})}}audioBuffered(){return nk(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:DS()}videoBuffered(){return nk(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:DS()}buffered(){const e=nk(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=nk(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():function(e,t){let i=null,n=null,s=0;const r=[],a=[];if(!(e&&e.length&&t&&t.length))return DS();let o=e.length;for(;o--;)r.push({time:e.start(o),type:"start"}),r.push({time:e.end(o),type:"end"});for(o=t.length;o--;)r.push({time:t.start(o),type:"start"}),r.push({time:t.end(o),type:"end"});for(r.sort(function(e,t){return e.time-t.time}),o=0;o<r.length;o++)"start"===r[o].type?(s++,2===s&&(i=r[o].time)):"end"===r[o].type&&(s--,1===s&&(n=r[o].time)),null!==i&&null!==n&&(a.push([i,n]),i=null,n=null);return DS(a)}(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=QC){fk({type:"mediaSource",sourceUpdater:this,action:uk(e),name:"duration",doneFn:t})}endOfStream(e=null,t=QC){"string"!=typeof e&&(e=void 0),fk({type:"mediaSource",sourceUpdater:this,action:lk(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,i=QC){this.audioBuffered().length&&0!==this.audioBuffered().end(0)?fk({type:"audio",sourceUpdater:this,action:rk(e,t),doneFn:i,name:"remove"}):i()}removeVideo(e,t,i=QC){this.videoBuffered().length&&0!==this.videoBuffered().end(0)?fk({type:"video",sourceUpdater:this,action:rk(e,t),doneFn:i,name:"remove"}):i()}updating(){return!(!ek("audio",this)&&!ek("video",this))}audioTimestampOffset(e){return void 0!==e&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(fk({type:"audio",sourceUpdater:this,action:ak(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return void 0!==e&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(fk({type:"video",sourceUpdater:this,action:ak(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&fk({type:"audio",sourceUpdater:this,action:ok(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&fk({type:"video",sourceUpdater:this,action:ok(e),name:"callback"})}dispose(){this.trigger("dispose"),ZC.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>ik(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const yk=e=>decodeURIComponent(escape(String.fromCharCode.apply(null,e))),_k=new Uint8Array("\n\n".split("").map(e=>e.charCodeAt(0)));class vk extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class bk extends YC{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return DS();const e=this.subtitlesTrack_.cues;return DS([[e[0].startTime,e[e.length-1].startTime]])}initSegmentForMap(e,t=!1){if(!e)return null;const i=FE(e);let n=this.initSegments_[i];if(t&&!n&&e.bytes){const t=_k.byteLength+e.bytes.byteLength,s=new Uint8Array(t);s.set(e.bytes),s.set(_k,e.bytes.byteLength),this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:s}}return 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){jC(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(null===this.syncController_.timestampOffsetForTimeline(e.timeline)){const e=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};return this.syncController_.one("timestampoffset",e),void(this.state="WAITING_ON_TIMELINE")}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,i){if(!this.subtitlesTrack_)return void(this.state="READY");if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===fC&&this.handleTimeout_(),e.code===mC?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);const n=this.pendingSegment_,s=i.mp4VttCues&&i.mp4VttCues.length;s&&(n.mp4VttCues=i.mp4VttCues),this.saveBandwidthRelatedStats_(n.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const r=n.segment;if(r.map&&(r.map.bytes=t.map.bytes),n.bytes=t.bytes,"function"!=typeof Dd.WebVTT&&"function"==typeof this.loadVttJs)return this.state="WAITING_ON_VTTJS",void this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,i),()=>this.stopForError({message:"Error loading vtt.js"}));r.requested=!0;try{this.parseVTTCues_(n)}catch(e){return void this.stopForError({message:e.message,metadata:{errorType:ES.Error.StreamingVttParserError,error:e}})}if(s||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)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");n.byteLength=n.bytes.byteLength,this.mediaSecondsLoaded+=r.duration,n.cues.forEach(e=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new Dd.VTTCue(e.startTime,e.endTime,e.text):e)}),function(e){const t=e.cues;if(!t)return;const i={};for(let n=t.length-1;n>=0;n--){const s=t[n],r=`${s.startTime}-${s.endTime}-${s.text}`;i[r]?e.removeCue(s):i[r]=s}}(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(e,t){const i=e&&"vtt"===e.type,n=t&&"text"===t.type;i&&n&&super.handleData_(e,t)}updateTimingInfoEnd_(){}parseMp4VttCues_(e){const t=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();e.mp4VttCues.forEach(i=>{const n=i.start+t,s=i.end+t,r=new Dd.VTTCue(n,s,i.cueText);i.settings&&i.settings.split(" ").forEach(e=>{const t=e.split(":"),i=t[0],n=t[1];r[i]=isNaN(n)?n:Number(n)}),e.cues.push(r)})}parseVTTCues_(e){let t,i=!1;if("function"!=typeof Dd.WebVTT)throw new vk;if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},e.mp4VttCues)return void this.parseMp4VttCues_(e);"function"==typeof Dd.TextDecoder?t=new Dd.TextDecoder("utf8"):(t=Dd.WebVTT.StringDecoder(),i=!0);const n=new Dd.WebVTT.Parser(Dd,Dd.vttjs,t);if(n.oncue=e.cues.push.bind(e.cues),n.ontimestampmap=t=>{e.timestampmap=t},n.onparsingerror=e=>{ES.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){let t=e.segment.map.bytes;i&&(t=yk(t)),n.parse(t)}let s=e.bytes;i&&(s=yk(s)),n.parse(s),n.flush()}updateTimeMapping_(e,t,i){const n=e.segment;if(!t)return;if(!e.cues.length)return void(n.empty=!0);const{MPEGTS:s,LOCAL:r}=e.timestampmap,a=s/r_-r+t.mapping;if(e.cues.forEach(e=>{const i=e.endTime-e.startTime,n=this.handleRollover_(e.startTime+a,t.time);e.startTime=Math.max(n,0),e.endTime=Math.max(n+i,0)}),!i.syncInfo){const t=e.cues[0].startTime,s=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(t,s-n.duration)}}}handleRollover_(e,t){if(null===t)return e;let i=e*r_;const n=t*r_;let s;for(s=n<i?-8589934592:8589934592;Math.abs(i-n)>4294967296;)i+=s;return i/r_}}const Tk=function(e,t){const i=e.cues;for(let e=0;e<i.length;e++){const n=i[e];if(t>=n.adStartTime&&t<=n.adEndTime)return n}return null};class wk{constructor({start:e,end:t,segmentIndex:i,partIndex:n=null,appended:s=!1}){this.start_=e,this.end_=t,this.segmentIndex_=i,this.partIndex_=n,this.appended_=s}isInRange(e){return e>=this.start&&e<this.end}markAppended(){this.appended_=!0}resetAppendedStatus(){this.appended_=!1}get isAppended(){return this.appended_}get start(){return this.start_}get end(){return this.end_}get segmentIndex(){return this.segmentIndex_}get partIndex(){return this.partIndex_}}class Sk{constructor(e,t=[]){this.segmentSyncInfo_=e,this.partsSyncInfo_=t}get segmentSyncInfo(){return this.segmentSyncInfo_}get partsSyncInfo(){return this.partsSyncInfo_}get hasPartsSyncInfo(){return this.partsSyncInfo_.length>0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class Ek{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,t){const{mediaSequence:i,segments:n}=e;if(this.isReliable_=this.isReliablePlaylist_(i,n),this.isReliable_)return this.updateStorage_(n,i,this.calculateBaseTime_(i,n,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:i}of this.storage_.values())if(i.length){for(const t of i)if(t.isInRange(e))return t}else if(t.isInRange(e))return t;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,t,i){const n=new Map;let s="\n",r=i,a=t;this.start_=r,e.forEach((e,t)=>{const i=this.storage_.get(a),o=r,l=o+e.duration,u=Boolean(i&&i.segmentSyncInfo&&i.segmentSyncInfo.isAppended),c=new wk({start:o,end:l,appended:u,segmentIndex:t});e.syncInfo=c;let h=r;const d=(e.parts||[]).map((e,n)=>{const r=h,o=h+e.duration,l=Boolean(i&&i.partsSyncInfo&&i.partsSyncInfo[n]&&i.partsSyncInfo[n].isAppended),u=new wk({start:r,end:o,appended:l,segmentIndex:t,partIndex:n});return h=o,s+=`Media Sequence: ${a}.${n} | Range: ${r} --\x3e ${o} | Appended: ${l}\n`,e.syncInfo=u,u});n.set(a,new Sk(c,d)),s+=`${NC(e.resolvedUri)} | Media Sequence: ${a} | Range: ${o} --\x3e ${l} | Appended: ${u}\n`,a++,r=l}),this.end_=r,this.storage_=n,this.diagnostics_=s}calculateBaseTime_(e,t,i){if(!this.storage_.size)return 0;if(this.storage_.has(e))return this.storage_.get(e).segmentSyncInfo.start;const n=Math.min(...this.storage_.keys());if(e<n){const i=n-e;let s=this.storage_.get(n).segmentSyncInfo.start;for(let e=0;e<i;e++){s-=t[e].duration}return s}return i}isReliablePlaylist_(e,t){return null!=e&&Array.isArray(t)&&t.length}}class Ck extends Ek{constructor(e){super(),this.parent_=e}calculateBaseTime_(e,t,i){if(!this.storage_.size){const t=this.parent_.getSyncInfoForMediaSequence(e);return t?t.segmentSyncInfo.start:0}return super.calculateBaseTime_(e,t,i)}}const kk=[{name:"VOD",run:(e,t,i,n,s)=>{if(i!==1/0){return{time:0,segmentIndex:0,partIndex:null}}return null}},{name:"MediaSequence",run:(e,t,i,n,s,r)=>{const a=e.getMediaSequenceSync(r);if(!a)return null;if(!a.isReliable)return null;const o=a.getSyncInfoForTime(s);return o?{time:o.start,partIndex:o.partIndex,segmentIndex:o.segmentIndex}:null}},{name:"ProgramDateTime",run:(e,t,i,n,s)=>{if(!Object.keys(e.timelineToDatetimeMappings).length)return null;let r=null,a=null;const o=HS(t);s=s||0;for(let i=0;i<o.length;i++){const n=o[t.endList||0===s?i:o.length-(i+1)],l=n.segment,u=e.timelineToDatetimeMappings[l.timeline];if(!u||!l.dateTimeObject)continue;let c=l.dateTimeObject.getTime()/1e3+u;if(l.parts&&"number"==typeof n.partIndex)for(let e=0;e<n.partIndex;e++)c+=l.parts[e].duration;const h=Math.abs(s-c);if(null!==a&&(0===h||a<h))break;a=h,r={time:c,segmentIndex:n.segmentIndex,partIndex:n.partIndex}}return r}},{name:"Segment",run:(e,t,i,n,s)=>{let r=null,a=null;s=s||0;const o=HS(t);for(let e=0;e<o.length;e++){const i=o[t.endList||0===s?e:o.length-(e+1)],l=i.segment,u=i.part&&i.part.start||l&&l.start;if(l.timeline===n&&void 0!==u){const e=Math.abs(s-u);if(null!==a&&a<e)break;(!r||null===a||a>=e)&&(a=e,r={time:u,segmentIndex:i.segmentIndex,partIndex:i.partIndex})}}return r}},{name:"Discontinuity",run:(e,t,i,n,s)=>{let r=null;if(s=s||0,t.discontinuityStarts&&t.discontinuityStarts.length){let i=null;for(let n=0;n<t.discontinuityStarts.length;n++){const a=t.discontinuityStarts[n],o=t.discontinuitySequence+n+1,l=e.discontinuities[o];if(l){const e=Math.abs(s-l.time);if(null!==i&&i<e)break;(!r||null===i||i>=e)&&(i=e,r={time:l.time,segmentIndex:a,partIndex:null})}}}return r}},{name:"Playlist",run:(e,t,i,n,s)=>{if(t.syncInfo){return{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}}return null}}];class xk extends ES.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const t=new Ek,i=new Ck(t),n=new Ck(t);this.mediaSequenceStorage_={main:t,audio:i,vtt:n},this.logger_=PS("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,i,n,s){if(t!==1/0){return kk.find(({name:e})=>"VOD"===e).run(this,e,t)}const r=this.runStrategies_(e,t,i,n,s);if(!r.length)return null;for(const t of r){const{syncPoint:i,strategy:s}=t,{segmentIndex:r,time:a}=i;if(r<0)continue;const o=a,l=o+e.segments[r].duration;if(this.logger_(`Strategy: ${s}. Current time: ${n}. selected segment: ${r}. Time: [${o} -> ${l}]}`),n>=o&&n<l)return this.logger_("Found sync point with exact match: ",i),i}return this.selectSyncPoint_(r,{key:"time",value:n})}getExpiredTime(e,t){if(!e||!e.segments)return null;const i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length)return null;const n=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});return n.segmentIndex>0&&(n.time*=-1),Math.abs(n.time+YS({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:n.segmentIndex,endIndex:0}))}runStrategies_(e,t,i,n,s){const r=[];for(let a=0;a<kk.length;a++){const o=kk[a],l=o.run(this,e,t,i,n,s);l&&(l.strategy=o.name,r.push({strategy:o.name,syncPoint:l}))}return r}selectSyncPoint_(e,t){let i=e[0].syncPoint,n=Math.abs(e[0].syncPoint[t.key]-t.value),s=e[0].strategy;for(let r=1;r<e.length;r++){const a=Math.abs(e[r].syncPoint[t.key]-t.value);a<n&&(n=a,i=e[r].syncPoint,s=e[r].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${s}]: [time:${i.time}, segmentIndex:${i.segmentIndex}`+("number"==typeof i.partIndex?`,partIndex:${i.partIndex}`:"")+"]"),i}saveExpiredSegmentInfo(e,t){const i=t.mediaSequence-e.mediaSequence;if(i>86400)ES.log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);else for(let n=i-1;n>=0;n--){const i=e.segments[n];if(i&&void 0!==i.start){t.syncInfo={mediaSequence:e.mediaSequence+n,time:i.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const i=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),n=e.segment;i&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:n.start}));const s=n.dateTimeObject;n.discontinuity&&t&&s&&(this.timelineToDatetimeMappings[n.timeline]=-s.getTime()/1e3)}timestampOffsetForTimeline(e){return void 0===this.timelines[e]?null:this.timelines[e].time}mappingForTimeline(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,i){const n=e.segment,s=e.part;let r,a,o=this.timelines[e.timeline];if("number"==typeof e.timestampOffset)o={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=o,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${o.time}] [mapping: ${o.mapping}]`)),r=e.startOfSegment,a=t.end+o.mapping;else{if(!o)return!1;r=t.start+o.mapping,a=t.end+o.mapping}return s&&(s.start=r,s.end=a),(!n.start||r<n.start)&&(n.start=r),n.end=a,!0}saveDiscontinuitySyncInfo_(e){const t=e.playlist,i=e.segment;if(i.discontinuity)this.discontinuities[i.timeline]={time:i.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(let n=0;n<t.discontinuityStarts.length;n++){const s=t.discontinuityStarts[n],r=t.discontinuitySequence+n+1,a=s-e.mediaIndex,o=Math.abs(a);if(!this.discontinuities[r]||this.discontinuities[r].accuracy>o){let n;n=a<0?i.start-YS({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:s}):i.end+YS({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:s}),this.discontinuities[r]={time:n,accuracy:o}}}}dispose(){this.trigger("dispose"),this.off()}}class Ik extends ES.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:i}){return"number"==typeof t&&"number"==typeof i&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:i},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:i}){if("number"==typeof t&&"number"==typeof i){this.lastTimelineChanges_[e]={type:e,from:t,to:i},delete this.pendingTimelineChanges_[e];const n={timelineChangeInfo:{from:t,to:i}};this.trigger({type:"timelinechange",metadata:n})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const Ak=tC(iC(function(){var e=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(i,1),i>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n<i;++n)t[n].call(this,arguments[1]);else for(var s=Array.prototype.slice.call(arguments,1),r=t.length,a=0;a<r;++a)t[a].apply(this,s)},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,s;t||(t=function(){const e=[[[],[],[],[],[]],[[],[],[],[],[]]],t=e[0],i=e[1],n=t[4],s=i[4];let r,a,o;const l=[],u=[];let c,h,d,p,f,m;for(r=0;r<256;r++)u[(l[r]=r<<1^283*(r>>7))^r]=r;for(a=o=0;!n[a];a^=c||1,o=u[o]||1)for(p=o^o<<1^o<<2^o<<3^o<<4,p=p>>8^255&p^99,n[a]=p,s[p]=a,d=l[h=l[c=l[a]]],m=16843009*d^65537*h^257*c^16843008*a,f=257*l[p]^16843008*p,r=0;r<4;r++)t[r][a]=f=f<<24^f>>>8,i[r][p]=m=m<<24^m>>>8;for(r=0;r<5;r++)t[r]=t[r].slice(0),i[r]=i[r].slice(0);return e}()),this._tables=[[t[0][0].slice(),t[0][1].slice(),t[0][2].slice(),t[0][3].slice(),t[0][4].slice()],[t[1][0].slice(),t[1][1].slice(),t[1][2].slice(),t[1][3].slice(),t[1][4].slice()]];const r=this._tables[0][4],a=this._tables[1],o=e.length;let l=1;if(4!==o&&6!==o&&8!==o)throw new Error("Invalid aes key size");const u=e.slice(0),c=[];for(this._key=[u,c],i=o;i<4*o+28;i++)s=u[i-1],(i%o===0||8===o&&i%o===4)&&(s=r[s>>>24]<<24^r[s>>16&255]<<16^r[s>>8&255]<<8^r[255&s],i%o===0&&(s=s<<8^s>>>24^l<<24,l=l<<1^283*(l>>7))),u[i]=u[i-o]^s;for(n=0;i;n++,i--)s=u[3&n?i:i-4],c[n]=i<=4||n<4?s:a[0][r[s>>>24]]^a[1][r[s>>16&255]]^a[2][r[s>>8&255]]^a[3][r[255&s]]}decrypt(e,t,i,n,s,r){const a=this._key[1];let o,l,u,c=e^a[0],h=n^a[1],d=i^a[2],p=t^a[3];const f=a.length/4-2;let m,g=4;const y=this._tables[1],_=y[0],v=y[1],b=y[2],T=y[3],w=y[4];for(m=0;m<f;m++)o=_[c>>>24]^v[h>>16&255]^b[d>>8&255]^T[255&p]^a[g],l=_[h>>>24]^v[d>>16&255]^b[p>>8&255]^T[255&c]^a[g+1],u=_[d>>>24]^v[p>>16&255]^b[c>>8&255]^T[255&h]^a[g+2],p=_[p>>>24]^v[c>>16&255]^b[h>>8&255]^T[255&d]^a[g+3],g+=4,c=o,h=l,d=u;for(m=0;m<4;m++)s[(3&-m)+r]=w[c>>>24]<<24^w[h>>16&255]<<16^w[d>>8&255]<<8^w[255&p]^a[g++],o=c,c=h,h=d,d=p,p=o}}class n extends e{constructor(){super(e),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const s=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24};class r{constructor(e,t,i,a){const o=r.STEP,l=new Int32Array(e.buffer),u=new Uint8Array(e.byteLength);let c=0;for(this.asyncStream_=new n,this.asyncStream_.push(this.decryptChunk_(l.subarray(c,c+o),t,i,u)),c=o;c<l.length;c+=o)i=new Uint32Array([s(l[c-4]),s(l[c-3]),s(l[c-2]),s(l[c-1])]),this.asyncStream_.push(this.decryptChunk_(l.subarray(c,c+o),t,i,u));this.asyncStream_.push(function(){var e;
|
||
/*! @name aes-decrypter @version 4.0.2 @license Apache-2.0 */a(null,(e=u).subarray(0,e.byteLength-e[e.byteLength-1]))})}static get STEP(){return 32e3}decryptChunk_(e,t,n,r){return function(){const a=function(e,t,n){const r=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),a=new i(Array.prototype.slice.call(t)),o=new Uint8Array(e.byteLength),l=new Int32Array(o.buffer);let u,c,h,d,p,f,m,g,y;for(u=n[0],c=n[1],h=n[2],d=n[3],y=0;y<r.length;y+=4)p=s(r[y]),f=s(r[y+1]),m=s(r[y+2]),g=s(r[y+3]),a.decrypt(p,f,m,g,l,y),l[y]=s(l[y]^u),l[y+1]=s(l[y+1]^c),l[y+2]=s(l[y+2]^h),l[y+3]=s(l[y+3]^d),u=p,c=f,h=m,d=g;return o}(e,t,n);r.set(a,e.byteOffset)}}}var a,o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};a="undefined"!=typeof window?window:void 0!==o?o:"undefined"!=typeof self?self:{};var l=a.BigInt||Number;l("0x1"),l("0x100"),l("0x10000"),l("0x1000000"),l("0x100000000"),l("0x10000000000"),l("0x1000000000000"),l("0x100000000000000"),l("0x10000000000000000"),function(){var e=new Uint16Array([65484]),t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);255===t[0]||t[0]}();const u=function(e){const t={};return Object.keys(e).forEach(i=>{const n=e[i];var s;s=n,("function"===ArrayBuffer.isView?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer)?t[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:t[i]=n}),t};self.onmessage=function(e){const t=e.data,i=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),n=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),s=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new r(i,n,s,function(e,i){self.postMessage(u({source:t.source,decrypted:i}),[i.buffer])})}}));var Lk=eC(Ak);const Pk=e=>{let t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},Ok=(e,t)=>{e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},Dk=(e,t)=>{t.activePlaylistLoader=e,e.load()},Mk={AUDIO:(e,t)=>()=>{const{mediaTypes:{[e]:i},excludePlaylist:n}=t,s=i.activeTrack(),r=i.activeGroup(),a=(r.filter(e=>e.default)[0]||r[0]).id,o=i.tracks[a];if(s!==o){ES.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const e in i.tracks)i.tracks[e].enabled=i.tracks[e]===o;i.onTrackChanged()}else n({error:{message:"Problem encountered loading the default audio track."}})},SUBTITLES:(e,t)=>()=>{const{mediaTypes:{[e]:i}}=t;ES.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const n=i.activeTrack();n&&(n.mode="disabled"),i.onTrackChanged()}},Nk={AUDIO:(e,t,i)=>{if(!t)return;const{tech:n,requestOptions:s,segmentLoaders:{[e]:r}}=i;t.on("loadedmetadata",()=>{const e=t.media();r.playlist(e,s),(!n.paused()||e.endList&&"none"!==n.preload())&&r.load()}),t.on("loadedplaylist",()=>{r.playlist(t.media(),s),n.paused()||r.load()}),t.on("error",Mk[e](e,i))},SUBTITLES:(e,t,i)=>{const{tech:n,requestOptions:s,segmentLoaders:{[e]:r},mediaTypes:{[e]:a}}=i;t.on("loadedmetadata",()=>{const e=t.media();r.playlist(e,s),r.track(a.activeTrack()),(!n.paused()||e.endList&&"none"!==n.preload())&&r.load()}),t.on("loadedplaylist",()=>{r.playlist(t.media(),s),n.paused()||r.load()}),t.on("error",Mk[e](e,i))}},Rk={AUDIO:(e,t)=>{const{vhs:i,sourceType:n,segmentLoaders:{[e]:s},requestOptions:r,main:{mediaGroups:a},mediaTypes:{[e]:{groups:o,tracks:l,logger_:u}},mainPlaylistLoader:c}=t,h=rE(c.main);a[e]&&0!==Object.keys(a[e]).length||(a[e]={main:{default:{default:!0}}},h&&(a[e].main.default.playlists=c.main.playlists));for(const s in a[e]){o[s]||(o[s]=[]);for(const d in a[e][s]){let p,f=a[e][s][d];if(h?(u(`AUDIO group '${s}' label '${d}' is a main playlist`),f.isMainPlaylist=!0,p=null):p="vhs-json"===n&&f.playlists?new AE(f.playlists[0],i,r):f.resolvedUri?new AE(f.resolvedUri,i,r):f.playlists&&"dash"===n?new QE(f.playlists[0],i,r,c):null,f=OS({id:d,playlistLoader:p},f),Nk[e](e,f.playlistLoader,t),o[s].push(f),void 0===l[d]){const e=new ES.AudioTrack({id:d,kind:Pk(f),enabled:!1,language:f.language,default:f.default,label:d});l[d]=e}}}s.on("error",Mk[e](e,t))},SUBTITLES:(e,t)=>{const{tech:i,vhs:n,sourceType:s,segmentLoaders:{[e]:r},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[e]:{groups:l,tracks:u}},mainPlaylistLoader:c}=t;for(const r in o[e]){l[r]||(l[r]=[]);for(const h in o[e][r]){if(!n.options_.useForcedSubtitles&&o[e][r][h].forced)continue;let d,p=o[e][r][h];if("hls"===s)d=new AE(p.resolvedUri,n,a);else if("dash"===s){if(!p.playlists.filter(e=>e.excludeUntil!==1/0).length)return;d=new QE(p.playlists[0],n,a,c)}else"vhs-json"===s&&(d=new AE(p.playlists?p.playlists[0]:p.resolvedUri,n,a));if(p=OS({id:h,playlistLoader:d},p),Nk[e](e,p.playlistLoader,t),l[r].push(p),void 0===u[h]){const e=i.addRemoteTextTrack({id:h,kind:"subtitles",default:p.default&&p.autoselect,language:p.language,label:h},!1).track;u[h]=e}}}r.on("error",Mk[e](e,t))},"CLOSED-CAPTIONS":(e,t)=>{const{tech:i,main:{mediaGroups:n},mediaTypes:{[e]:{groups:s,tracks:r}}}=t;for(const t in n[e]){s[t]||(s[t]=[]);for(const a in n[e][t]){const o=n[e][t][a];if(!/^(?:CC|SERVICE)/.test(o.instreamId))continue;const l=i.options_.vhs&&i.options_.vhs.captionServices||{};let u={label:a,language:o.language,instreamId:o.instreamId,default:o.default&&o.autoselect};if(l[u.instreamId]&&(u=OS(u,l[u.instreamId])),void 0===u.default&&delete u.default,s[t].push(OS({id:a},o)),void 0===r[a]){const e=i.addRemoteTextTrack({id:u.instreamId,kind:"captions",default:u.default,language:u.language,label:u.label},!1).track;r[a]=e}}}}},Fk=(e,t)=>{for(let i=0;i<e.length;i++){if(nE(t,e[i]))return!0;if(e[i].playlists&&Fk(e[i].playlists,t))return!0}return!1},Bk={AUDIO:(e,t)=>()=>{const{mediaTypes:{[e]:{tracks:i}}}=t;for(const e in i)if(i[e].enabled)return i[e];return null},SUBTITLES:(e,t)=>()=>{const{mediaTypes:{[e]:{tracks:i}}}=t;for(const e in i)if("showing"===i[e].mode||"hidden"===i[e].mode)return i[e];return null}},Uk=e=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{Rk[t](t,e)});const{mediaTypes:t,mainPlaylistLoader:i,tech:n,vhs:s,segmentLoaders:{AUDIO:r,main:a}}=e;["AUDIO","SUBTITLES"].forEach(i=>{t[i].activeGroup=((e,t)=>i=>{const{mainPlaylistLoader:n,mediaTypes:{[e]:{groups:s}}}=t,r=n.media();if(!r)return null;let a=null;r.attributes[e]&&(a=s[r.attributes[e]]);const o=Object.keys(s);if(!a)if("AUDIO"===e&&o.length>1&&rE(t.main))for(let e=0;e<o.length;e++){const t=s[o[e]];if(Fk(t,r)){a=t;break}}else s.main?a=s.main:1===o.length&&(a=s[o[0]]);return void 0===i?a:null!==i&&a&&a.filter(e=>e.id===i.id)[0]||null})(i,e),t[i].activeTrack=Bk[i](i,e),t[i].onGroupChanged=((e,t)=>()=>{const{segmentLoaders:{[e]:i,main:n},mediaTypes:{[e]:s}}=t,r=s.activeTrack(),a=s.getActiveGroup(),o=s.activePlaylistLoader,l=s.lastGroup_;a&&l&&a.id===l.id||(s.lastGroup_=a,s.lastTrack_=r,Ok(i,s),a&&!a.isMainPlaylist&&(a.playlistLoader?(i.resyncLoader(),Dk(a.playlistLoader,s)):o&&n.resetEverything()))})(i,e),t[i].onGroupChanging=((e,t)=>()=>{const{segmentLoaders:{[e]:i},mediaTypes:{[e]:n}}=t;n.lastGroup_=null,i.abort(),i.pause()})(i,e),t[i].onTrackChanged=((e,t)=>()=>{const{mainPlaylistLoader:i,segmentLoaders:{[e]:n,main:s},mediaTypes:{[e]:r}}=t,a=r.activeTrack(),o=r.getActiveGroup(),l=r.activePlaylistLoader,u=r.lastTrack_;if((!u||!a||u.id!==a.id)&&(r.lastGroup_=o,r.lastTrack_=a,Ok(n,r),o)){if(o.isMainPlaylist){if(!a||!u||a.id===u.id)return;const e=t.vhs.playlistController_,n=e.selectPlaylist();if(e.media()===n)return;return r.logger_(`track change. Switching main audio from ${u.id} to ${a.id}`),i.pause(),s.resetEverything(),void e.fastQualityChange_(n)}if("AUDIO"===e){if(!o.playlistLoader)return s.setAudio(!0),void s.resetEverything();n.setAudio(!0),s.setAudio(!1)}l!==o.playlistLoader?(n.track&&n.track(a),n.resetEverything(),Dk(o.playlistLoader,r)):Dk(o.playlistLoader,r)}})(i,e),t[i].getActiveGroup=((e,{mediaTypes:t})=>()=>{const i=t[e].activeTrack();return i?t[e].activeGroup(i):null})(i,e)});const o=t.AUDIO.activeGroup();if(o){const e=(o.filter(e=>e.default)[0]||o[0]).id;t.AUDIO.tracks[e].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged();t.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),r.setAudio(!0)):a.setAudio(!0)}i.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(e=>t[e].onGroupChanged())}),i.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(e=>t[e].onGroupChanging())});const l=()=>{t.AUDIO.onTrackChanged(),n.trigger({type:"usage",name:"vhs-audio-change"})};n.audioTracks().addEventListener("change",l),n.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),s.on("dispose",()=>{n.audioTracks().removeEventListener("change",l),n.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)}),n.clearTracks("audio");for(const e in t.AUDIO.tracks)n.audioTracks().addTrack(t.AUDIO.tracks[e])};class jk{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){1===e&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=AS(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(e=>[e.ID,e])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class $k extends ES.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new jk,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=PS("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const i=t.serverUri||t.serverURL;if(!i)return this.logger_(`steering manifest URL is ${i}, cannot request steering manifest.`),void this.trigger("error");i.startsWith("data:")?this.decodeDataUriManifest_(i.substring(i.indexOf(",")+1)):(this.steeringManifest.reloadUri=AS(e,i),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering"))}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t)return;const i=e?t:this.getRequestURI(t);if(!i)return this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),void this.dispose();const n={contentSteeringInfo:{uri:i}};this.trigger({type:"contentsteeringloadstart",metadata:n}),this.request_=this.xhr_({uri:i,requestType:"content-steering-manifest"},(e,t)=>{if(e){if(410===t.status)return this.logger_(`manifest request 410 ${e}.`),this.logger_(`There will be no more content steering requests to ${i} this session.`),void this.excludedSteeringManifestURLs.add(i);if(429===t.status){const i=t.responseHeaders["retry-after"];return this.logger_(`manifest request 429 ${e}.`),this.logger_(`content steering will retry in ${i} seconds.`),void this.startTTLTimeout_(parseInt(i,10))}return this.logger_(`manifest failed to load ${e}.`),void this.startTTLTimeout_()}let s;this.trigger({type:"contentsteeringloadcomplete",metadata:n});try{s=JSON.parse(this.request_.responseText)}catch(e){const t={errorType:ES.Error.StreamingContentSteeringParserError,error:e};this.trigger({type:"error",metadata:t})}this.assignSteeringProperties_(s);const r={contentSteeringInfo:n.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:r}),this.startTTLTimeout_()})}setProxyServerUrl_(e){const t=new Dd.URL(e),i=new Dd.URL(this.proxyServerUrl_);return i.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(i.toString())}decodeDataUriManifest_(e){const t=JSON.parse(Dd.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new Dd.URL(e),i=this.getPathway(),n=this.getBandwidth_();if(i){const e=`_${this.manifestType_}_pathway`;t.searchParams.set(e,i)}if(n){const e=`_${this.manifestType_}_throughput`;t.searchParams.set(e,n)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version)return this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),void this.trigger("error");this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const t=(e=>{for(const t of e)if(this.availablePathways_.has(t))return t;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==t&&(this.currentPathway=t,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=e=>this.excludedSteeringManifestURLs.has(e);if(this.proxyServerUrl_){const i=this.setProxyServerUrl_(e);if(!t(i))return i}const i=this.setSteeringParams_(e);return t(i)?null:i}startTTLTimeout_(e=this.steeringManifest.ttl){const t=1e3*e;this.ttlTimeout_=Dd.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){Dd.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new jk}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(AS(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}let qk;const Vk=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],Hk=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]};class zk extends ES.EventTarget{constructor(e){super(),this.fastQualityChange_=((e,t)=>{let i=null;return(...n)=>{clearTimeout(i),i=setTimeout(()=>{e.apply(null,n)},t)}})(this.fastQualityChange_.bind(this),100);const{src:t,withCredentials:i,tech:n,bandwidth:s,externVhs:r,useCueTags:a,playlistExclusionDuration:o,enableLowInitialPlaylist:l,sourceType:u,cacheEncryptionKeys:c,bufferBasedABR:h,leastPixelDiffSelector:d,captionServices:p,experimentalUseMMS:f}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:m}=e;null==m&&(m=1/0),qk=r,this.bufferBasedABR=Boolean(h),this.leastPixelDiffSelector=Boolean(d),this.withCredentials=i,this.tech_=n,this.vhs_=n.vhs,this.player_=e.player_,this.sourceType_=u,this.useCueTags_=a,this.playlistExclusionDuration=o,this.maxPlaylistRetries=m,this.enableLowInitialPlaylist=l,this.usingManagedMediaSource_=!1,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_=(()=>{const e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:QC,activeTrack:QC,getActiveGroup:QC,onGroupChanged:QC,onTrackChanged:QC,lastTrack_:null,logger_:PS(`MediaGroups[${t}]`)}}),e})(),f&&Dd.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new Dd.ManagedMediaSource,this.usingManagedMediaSource_=!0,ES.log("Using ManagedMediaSource")):Dd.MediaSource&&(this.mediaSource=new Dd.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.load=this.load.bind(this),this.pause=this.pause.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.mediaSource.addEventListener("startstreaming",this.load),this.mediaSource.addEventListener("endstreaming",this.pause),this.seekable_=DS(),this.hasPlayed_=!1,this.syncController_=new xk(e),this.segmentMetadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.segmentMetadataTrack_.mode="hidden",this.decrypter_=new Lk,this.sourceUpdater_=new gk(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new Ik,this.keyStatusMap_=new Map;const g={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:s,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:c,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_="dash"===this.sourceType_?new QE(t,this.vhs_,OS(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new AE(t,this.vhs_,OS(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new YC(OS(g,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new YC(OS(g,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new bk(OS(g,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((e,t)=>{function i(){n.off("vttjserror",s),e()}function s(){n.off("vttjsloaded",i),t()}n.one("vttjsloaded",i),n.one("vttjserror",s),n.addWebVttScript_()})}),e);this.contentSteeringController_=new $k(this.vhs_.xhr,()=>this.mainSegmentLoader_.bandwidth),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),Vk.forEach(e=>{this[e+"_"]=Hk.bind(this,e)}),this.logger_=PS("pc"),this.triggeredFmp4Usage=!1,"none"===this.tech_.preload()?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const y="none"===this.tech_.preload()?"play":"loadstart";this.tech_.one(y,()=>{const e=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-e,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return-1===e||-1===t?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,i){const n=this.media(),s=n&&(n.id||n.uri),r=e&&(e.id||e.uri);if(s&&s!==r){this.logger_(`switch media ${s} -> ${r} from ${t}`);const i={renditionInfo:{id:r,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:"renditionselected",metadata:i}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,i)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const t=this.mediaTypes_[e],i=t?t.activeGroup():null,n=this.contentSteeringController_.getPathway();if(i&&n){const t=(i.length?i[0].playlists:i.playlists).filter(e=>e.attributes.serviceLocation===n);t.length&&this.mediaTypes_[e].activePlaylistLoader.media(t[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=Dd.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(Dd.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const i=e.mediaGroups.AUDIO,n=Object.keys(i);let s;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)s=this.mediaTypes_.AUDIO.activeTrack();else{const e=i.main||n.length&&i[n[0]];for(const t in e)if(e[t].default){s={label:t};break}}if(!s)return t;const r=[];for(const t in i)if(i[t][s.label]){const n=i[t][s.label];if(n.playlists&&n.playlists.length)r.push.apply(r,n.playlists);else if(n.uri)r.push(n);else if(e.playlists.length)for(let i=0;i<e.playlists.length;i++){const n=e.playlists[i];n.attributes&&n.attributes.AUDIO&&n.attributes.AUDIO===t&&r.push(n)}}return r.length?r:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;iE(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()),Uk({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),e),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let e=this.mainPlaylistLoader_.media();if(!e){let t;if(this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_(),this.enableLowInitialPlaylist&&(t=this.selectInitialPlaylist()),t||(t=this.selectPlaylist()),!t||!this.shouldSwitchToMedia_(t))return;this.initialMedia_=t,this.switchMedia_(this.initialMedia_,"initial");if(!("vhs-json"===this.sourceType_&&this.initialMedia_.segments))return;e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)}),this.mainPlaylistLoader_.on("error",()=>{const e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;iE(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,"dash"===this.sourceType_&&this.mainPlaylistLoader_.isPaused&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const e=this.mainPlaylistLoader_.media();if("playlist-unchanged"===e.lastExcludeReason_)return;this.stuckAtPlaylistEnd_(e)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})});["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(e=>{this.mainPlaylistLoader_.on(e,e=>{this.player_.trigger(up({},e))})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const i=e.mediaGroups||{};let n=!0;const s=Object.keys(i.AUDIO);for(const e in i.AUDIO)for(const t in i.AUDIO[e]){i.AUDIO[e][t].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"}),qk.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),s.length&&Object.keys(i.AUDIO[s[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,i=this.tech_.currentTime(),n=this.bufferLowWaterLine(),s=this.bufferHighWaterLine();return function({currentPlaylist:e,buffered:t,currentTime:i,nextPlaylist:n,bufferLowWaterLine:s,bufferHighWaterLine:r,duration:a,bufferBasedABR:o,log:l}){if(!n)return ES.log.warn("We received no playlist to switch to. Please check your stream."),!1;const u=`allowing switch ${e&&e.id||"null"} -> ${n.id}`;if(!e)return l(`${u} as current playlist is not set`),!0;if(n.id===e.id)return!1;const c=Boolean(FS(t,i).length);if(!e.endList)return c||"number"!=typeof e.partTargetDuration?(l(`${u} as current playlist is live`),!0):(l(`not ${u} as current playlist is live llhls, but currentTime isn't in buffered.`),!1);const h=qS(t,i),d=o?JE.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:JE.MAX_BUFFER_LOW_WATER_LINE;if(a<d)return l(`${u} as duration < max low water line (${a} < ${d})`),!0;const p=n.attributes.BANDWIDTH,f=e.attributes.BANDWIDTH;if(p<f&&(!o||h<r)){let e=`${u} as next bandwidth < current bandwidth (${p} < ${f})`;return o&&(e+=` and forwardBuffer < bufferHighWaterLine (${h} < ${r})`),l(e),!0}if((!o||p>f)&&h>=s){let e=`${u} as forwardBuffer >= bufferLowWaterLine (${h} >= ${s})`;return o&&(e+=` and next bandwidth > current bandwidth (${p} > ${f})`),l(e),!0}return l(`not ${u} as no switching criteria met`),!1}({buffered:this.tech_.buffered(),currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:n,bufferHighWaterLine:s,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const e=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{const e=this.audioSegmentLoader_.pendingSegment_;if(!e||!e.segment||!e.segment.syncInfo)return;const t=e.segment.syncInfo.end+.01;this.tech_.setCurrentTime(t)}),this.timelineChangeController_.on("fixBadTimelineChange",()=>{this.logger_("Fix bad timeline change. Restarting al segment loaders..."),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}),this.mainSegmentLoader_.on("earlyabort",e=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:10}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const e=this.getCodecsOrExclude_();e&&this.sourceUpdater_.addOrChangeSourceBuffers(e)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()});["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(e=>{this.mainSegmentLoader_.on(e,e=>{this.player_.trigger(up({},e))}),this.audioSegmentLoader_.on(e,e=>{this.player_.trigger(up({},e))}),this.subtitleSegmentLoader_.on(e,e=>{this.player_.trigger(up({},e))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}pause(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}fastQualityChange_(e=this.selectPlaylist()){e&&e===this.mainPlaylistLoader_.media()?this.logger_("skipping fastQualityChange because new media is same as old"):(this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0)}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0)?this.tech_.setCurrentTime(e.end(e.length-1)):void 0}setupFirstPlay(){const e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList||e.start){const t=this.seekable();if(!t.length)return!1;const i=t.end(0);let n=i;if(e.start){const s=e.start.timeOffset;if(s<0){const r=this.mainPlaylistLoader_.main,a=i+qk.Playlist.liveEdgeDelay(r,e);n=Math.max(Math.min(a+s,i),t.start(0))}else n=Math.min(i,s)}this.trigger("firstplay"),this.tech_.setCurrentTime(n)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){const e=this.tech_.play();void 0!==e&&"function"==typeof e.then&&e.then(null,e=>{})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();e=!t||t.hasVideo?e&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const t=this.syncController_.getExpiredTime(e,this.duration());if(null===t)return!1;const i=qk.Playlist.playlistEnd(e,t),n=this.tech_.currentTime(),s=this.tech_.buffered();if(!s.length)return i-n<=NS;const r=s.end(s.length-1);return r-n<=NS&&i-r<=NS}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:i}){if(e=e||this.mainPlaylistLoader_.media(),i=i||t.playlistExclusionDuration||this.playlistExclusionDuration,!e)return this.error=t,void("open"!==this.mediaSource.readyState?this.trigger("error"):this.sourceUpdater_.endOfStream("network"));e.playlistErrors_++;const n=this.mainPlaylistLoader_.main.playlists,s=n.filter(eE),r=1===s.length&&s[0]===e;if(1===n.length&&i!==1/0)return ES.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(r);if(r){if(this.main().contentSteering){const t=this.pathwayAttribute_(e),i=1e3*this.contentSteeringController_.steeringManifest.ttl;return this.contentSteeringController_.excludePathway(t),this.excludeThenChangePathway_(),void setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(t)},i)}let t=!1;n.forEach(i=>{if(i===e)return;const n=i.excludeUntil;void 0!==n&&n!==1/0&&(t=!0,delete i.excludeUntil)}),t&&(ES.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let a;a=e.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*i,e.excludeUntil=a,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const o=this.selectPlaylist();if(!o)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");const l=t.internal?this.logger_:ES.log.warn,u=t.message?" "+t.message:"";l(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${u} Switching to playlist ${o.id}.`),o.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),o.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const c=o.targetDuration/2*1e3||5e3,h="number"==typeof o.lastRequest&&Date.now()-o.lastRequest<=c;return this.switchMedia_(o,"exclude",r||h)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const i=[],n="all"===e;(n||"main"===e)&&i.push(this.mainPlaylistLoader_);const s=[];(n||"audio"===e)&&s.push("AUDIO"),(n||"subtitle"===e)&&(s.push("CLOSED-CAPTIONS"),s.push("SUBTITLES")),s.forEach(e=>{const t=this.mediaTypes_[e]&&this.mediaTypes_[e].activePlaylistLoader;t&&i.push(t)}),["main","audio","subtitle"].forEach(t=>{const 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){const t=FS(this.tech_.buffered(),e);return this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media()&&this.mainPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),void this.load()):0}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:qk.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}getSeekableRange_(e,t){const i=e.media();if(!i)return null;const n=this.syncController_.getMediaSequenceSync(t);if(n&&n.isReliable){const e=n.start,t=n.end;if(!isFinite(e)||!isFinite(t))return null;const s=qk.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,i);return DS([[e,Math.max(e,t-s)]])}const s=this.syncController_.getExpiredTime(i,this.duration());if(null===s)return null;const r=qk.Playlist.seekable(i,s,qk.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,i));return r.length?r:null}computeFinalSeekable_(e,t){if(!t)return e;const i=e.start(0),n=e.end(0),s=t.start(0),r=t.end(0);return s>n||i>r?e:DS([[Math.max(i,s),Math.min(n,r)]])}onSyncInfoUpdate_(){if(!this.mainPlaylistLoader_)return;const e=this.getSeekableRange_(this.mainPlaylistLoader_,"main");if(!e)return;let t;if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=this.getSeekableRange_(this.mediaTypes_.AUDIO.activePlaylistLoader,"audio"),!t))return;const i=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(e,t),!this.seekable_)return;if(i&&i.length&&this.seekable_.length&&i.start(0)===this.seekable_.start(0)&&i.end(0)===this.seekable_.end(0))return;this.logger_(`seekable updated [${US(this.seekable_)}]`);const n={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:n}),this.tech_.trigger("seekablechanged")}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),"open"!==this.mediaSource.readyState)return this.updateDuration_=this.updateDuration.bind(this,e),void this.mediaSource.addEventListener("sourceopen",this.updateDuration_);if(e){const e=this.seekable();if(!e.length)return;return void((isNaN(this.mediaSource.duration)||this.mediaSource.duration<e.end(e.length-1))&&this.sourceUpdater_.setDuration(e.end(e.length-1)))}const t=this.tech_.buffered();let i=qk.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(i=Math.max(i,t.end(t.length-1))),this.mediaSource.duration!==i&&this.sourceUpdater_.setDuration(i)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const t=this.mediaTypes_[e].groups;for(const e in t)t[e].forEach(e=>{e.playlistLoader&&e.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!i)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const i=bE(this.main(),t),n={},s=!!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||kf}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||s)&&(n.audio=i.audio||e.main.audioCodec||e.audio.audioCodec||kf,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!n.audio&&!n.video)return void this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});const r=(e,t)=>e?Ef(t,this.usingManagedMediaSource_):Cf(t),a={};let o;if(["video","audio"].forEach(function(t){if(n.hasOwnProperty(t)&&!r(e[t].isFmp4,n[t])){const i=e[t].isFmp4?"browser":"muxer";a[i]=a[i]||[],a[i].push(n[t]),"audio"===t&&(o=i)}}),s&&o&&t.attributes.AUDIO){const 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 ${o} does not support codec(s): "${n.audio}"`)}if(Object.keys(a).length){const e=Object.keys(a).reduce((e,t)=>(e&&(e+=", "),e+=`${t} does not support codec(s): "${a[t].join(",")}"`),"")+".";return void this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:e},playlistExclusionDuration:1/0})}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const e=[];if(["video","audio"].forEach(t=>{const i=(Tf(this.sourceUpdater_.codecs[t]||"")[0]||{}).type,s=(Tf(n[t]||"")[0]||{}).type;i&&s&&i.toLowerCase()!==s.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}tryToCreateSourceBuffers_(){if("open"!==this.mediaSource.readyState||this.sourceUpdater_.hasCreatedSourceBuffers())return;if(!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach(i=>{const n=e[i];if(-1!==t.indexOf(n.id))return;t.push(n.id);const s=bE(this.main,n),r=[];!s.audio||Cf(s.audio)||Ef(s.audio,this.usingManagedMediaSource_)||r.push(`audio codec ${s.audio}`),!s.video||Cf(s.video)||Ef(s.video,this.usingManagedMediaSource_)||r.push(`video codec ${s.video}`),s.text&&"stpp.ttml.im1t"===s.text&&r.push(`text codec ${s.text}`),r.length&&(n.excludeUntil=1/0,this.logger_(`excluding ${n.id} for unsupported: ${r.join(", ")}`))})}excludeIncompatibleVariants_(e){const t=[],i=this.main().playlists,n=_E(Tf(e)),s=vE(n),r=n.video&&Tf(n.video)[0]||null,a=n.audio&&Tf(n.audio)[0]||null;Object.keys(i).forEach(e=>{const n=i[e];if(-1!==t.indexOf(n.id)||n.excludeUntil===1/0)return;t.push(n.id);const o=[],l=bE(this.mainPlaylistLoader_.main,n),u=vE(l);if(l.audio||l.video){if(u!==s&&o.push(`codec count "${u}" !== "${s}"`),!this.sourceUpdater_.canChangeType()){const e=l.video&&Tf(l.video)[0]||null,t=l.audio&&Tf(l.audio)[0]||null;e&&r&&e.type.toLowerCase()!==r.type.toLowerCase()&&o.push(`video codec "${e.type}" !== "${r.type}"`),t&&a&&t.type.toLowerCase()!==a.type.toLowerCase()&&o.push(`audio codec "${t.type}" !== "${a.type}"`)}o.length&&(n.excludeUntil=1/0,this.logger_(`excluding ${n.id}: ${o.join(" && ")}`))}})}updateAdCues_(e){let t=0;const i=this.seekable();i.length&&(t=i.start(0)),function(e,t,i=0){if(!e.segments)return;let n,s=i;for(let i=0;i<e.segments.length;i++){const r=e.segments[i];if(n||(n=Tk(t,s+r.duration/2)),n){if("cueIn"in r){n.endTime=s,n.adEndTime=s,s+=r.duration,n=null;continue}if(s<n.endTime){s+=r.duration;continue}n.endTime+=r.duration}else if("cueOut"in r&&(n=new Dd.VTTCue(s,s+r.duration,r.cueOut),n.adStartTime=s,n.adEndTime=s+parseFloat(r.cueOut),t.addCue(n)),"cueOutCont"in r){const[e,i]=r.cueOutCont.split("/").map(parseFloat);n=new Dd.VTTCue(s,s+r.duration,""),n.adStartTime=s-e,n.adEndTime=n.adStartTime+i,t.addCue(n)}s+=r.duration}}(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=JE.GOAL_BUFFER_LENGTH,i=JE.GOAL_BUFFER_LENGTH_RATE,n=Math.max(t,JE.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,n)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=JE.BUFFER_LOW_WATER_LINE,i=JE.BUFFER_LOW_WATER_LINE_RATE,n=Math.max(t,JE.MAX_BUFFER_LOW_WATER_LINE),s=Math.max(t,JE.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?s:n)}bufferHighWaterLine(){return JE.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){UC(this.inbandTextTracks_,"com.apple.streaming",this.tech_),(({inbandTextTracks:e,dateRanges:t})=>{const i=e.metadataTrack_;if(!i)return;const n=Dd.WebKitDataCue||Dd.VTTCue;t.forEach(e=>{for(const t of Object.keys(e)){if(BC.has(t))continue;const s=new n(e.startTime,e.endTime,"");s.id=e.id,s.type="com.apple.quicktime.HLS",s.value={key:FC[t],data:e[t]},"scte35Out"!==t&&"scte35In"!==t||(s.value.data=new Uint8Array(s.value.data.match(/[\da-f]{2}/gi)).buffer),i.addCue(s)}e.processDateRange()})})({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,i){const n=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();UC(this.inbandTextTracks_,e,this.tech_),RC({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:n,videoDuration:i})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart?this.contentSteeringController_.requestSteeringManifest(!0):this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this));["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(e=>{this.contentSteeringController_.on(e,e=>{this.trigger(up({},e))})}),"dash"===this.sourceType_&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const e=this.main();(this.contentSteeringController_.didDASHTagChange(e.uri,e.contentSteering)||(()=>{const t=this.contentSteeringController_.getAvailablePathways(),i=[];for(const n of e.playlists){const e=n.attributes.serviceLocation;if(e&&(i.push(e),!t.has(e)))return!0}return!(i.length||!t.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const t=this.main().playlists,i=new Set;let n=!1;Object.keys(t).forEach(s=>{const r=t[s],a=this.pathwayAttribute_(r),o=a&&e!==a;r.excludeUntil===1/0&&"content-steering"===r.lastExcludeReason_&&!o&&(delete r.excludeUntil,delete r.lastExcludeReason_,n=!0);const l=!r.excludeUntil&&r.excludeUntil!==1/0;!i.has(r.id)&&o&&l&&(i.add(r.id),r.excludeUntil=1/0,r.lastExcludeReason_="content-steering",this.logger_(`excluding ${r.id} for ${r.lastExcludeReason_}`))}),"DASH"===this.contentSteeringController_.manifestType_&&Object.keys(this.mediaTypes_).forEach(t=>{const i=this.mediaTypes_[t];if(i.activePlaylistLoader){const t=i.activePlaylistLoader.media_;t&&t.attributes.serviceLocation!==e&&(n=!0)}}),n&&this.changeSegmentPathway_()}handlePathwayClones_(){const e=this.main().playlists,t=this.contentSteeringController_.currentPathwayClones,i=this.contentSteeringController_.nextPathwayClones;if(t&&t.size||i&&i.size){for(const[e,n]of t.entries()){i.get(e)||(this.mainPlaylistLoader_.updateOrDeleteClone(n),this.contentSteeringController_.excludePathway(e))}for(const[n,s]of i.entries()){const i=t.get(n);if(!i){e.filter(e=>e.attributes["PATHWAY-ID"]===s["BASE-ID"]).forEach(e=>{this.mainPlaylistLoader_.addClonePathway(s,e)}),this.contentSteeringController_.addAvailablePathway(n);continue}this.equalPathwayClones_(i,s)||(this.mainPlaylistLoader_.updateOrDeleteClone(s,!0),this.contentSteeringController_.addAvailablePathway(n))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...i])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;const i=e["URI-REPLACEMENT"].PARAMS,n=t["URI-REPLACEMENT"].PARAMS;for(const e in i)if(i[e]!==n[e])return!1;for(const e in n)if(i[e]!==n[e])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),"DASH"===this.contentSteeringController_.manifestType_&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const t="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(i=>{const n=this.mainPlaylistLoader_.getKeyIdSet(i);n&&n.size&&n.forEach(n=>{const s="usable",r=this.keyStatusMap_.has(n)&&this.keyStatusMap_.get(n)===s,a=i.lastExcludeReason_===t&&i.excludeUntil===1/0;r?r&&a&&(delete i.excludeUntil,delete i.lastExcludeReason_,this.logger_(`enabling playlist ${i.id} because key ID ${n} is ${s}`)):(i.excludeUntil!==1/0&&i.lastExcludeReason_!==t&&(i.excludeUntil=1/0,i.lastExcludeReason_=t,this.logger_(`excluding playlist ${i.id} because the key ID ${n} doesn't exist in the keyStatusMap or is not ${s}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(e=>{const i=e&&e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height<720,n=e.excludeUntil===1/0&&e.lastExcludeReason_===t;i&&n&&(delete e.excludeUntil,ES.log.warn(`enabling non-HD playlist ${e.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){const i=("string"==typeof e?e:(e=>{const t=new Uint8Array(e);return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")})(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${i} added to the keyStatusMap`),this.keyStatusMap_.set(i,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}class Wk{constructor(e,t,i){const{playlistController_:n}=e,s=n.fastQualityChange_.bind(n);if(t.attributes){const e=t.attributes.RESOLUTION;this.width=e&&e.width,this.height=e&&e.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}var r,a,o;this.codecs=bE(n.main(),t),this.playlist=t,this.id=i,this.enabled=(r=e.playlists,a=t.id,o=s,e=>{const t=r.main.playlists[a],i=ZS(t),n=eE(t);if(void 0===e)return n;e?delete t.disabled:t.disabled=!0;const s={renditionInfo:{id:a,bandwidth:t.attributes.BANDWIDTH,resolution:t.attributes.RESOLUTION,codecs:t.attributes.CODECS},cause:"fast-quality"};return e===n||i||(e?(o(t),r.trigger({type:"renditionenabled",metadata:s})):r.trigger({type:"renditiondisabled",metadata:s})),e})}}const Gk=["seeking","seeked","pause","playing","error"];class Xk extends ES.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=PS("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),i=()=>this.monitorCurrentTime_(),n=()=>this.techWaiting_(),s=()=>this.resetTimeUpdate_(),r=this.playlistController_,a=["main","subtitle","audio"],o={};a.forEach(e=>{o[e]={reset:()=>this.resetSegmentDownloads_(e),updateend:()=>this.checkSegmentDownloads_(e)},r[`${e}SegmentLoader_`].on("appendsdone",o[e].updateend),r[`${e}SegmentLoader_`].on("playlistupdate",o[e].reset),this.tech_.on(["seeked","seeking"],o[e].reset)});const l=e=>{["main","audio"].forEach(t=>{r[`${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(Gk,s),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(Gk,s),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=>{r[`${e}SegmentLoader_`].off("appendsdone",o[e].updateend),r[`${e}SegmentLoader_`].off("playlistupdate",o[e].reset),this.tech_.off(["seeked","seeking"],o[e].reset)}),this.checkCurrentTimeTimeout_&&Dd.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&Dd.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=Dd.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,i=t[`${e}SegmentLoader_`],n=i.buffered_(),s=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e)return!0;if(e.length!==t.length)return!0;for(let i=0;i<e.length;i++)if(e.start(i)!==t.start(i)||e.end(i)!==t.end(i))return!0;return!1}(this[`${e}Buffered_`],n);if(this[`${e}Buffered_`]=n,s){const i={bufferedRanges:n};return t.trigger({type:"bufferedrangeschanged",metadata:i}),void this.resetSegmentDownloads_(e)}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:i.playlist_&&i.playlist_.id,buffered:jS(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_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+NS>=t.end(t.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(DS([this.lastRecordedTime,e]));const t={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:t}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const e=this.seekable(),t=this.tech_.currentTime();let i;if(this.afterSeekableWindow_(e,t,this.media(),this.allowSeeksWithinUnsafeLiveWindow)){i=e.end(e.length-1)}if(this.beforeSeekableWindow_(e,t)){const t=e.start(0);i=t+(t===e.end(0)?0:NS)}if(void 0!==i)return this.logger_(`Trying to seek outside of seekable at time ${t} with seekable range ${US(e)}. Seeking to ${i}.`),this.tech_.setCurrentTime(i),!0;const n=this.playlistController_.sourceUpdater_,s=this.tech_.buffered(),r=n.audioBuffer?n.audioBuffered():null,a=n.videoBuffer?n.videoBuffered():null,o=this.media(),l=o.partTargetDuration?o.partTargetDuration:2*(o.targetDuration-MS),u=[r,a];for(let e=0;e<u.length;e++){if(!u[e])continue;if(qS(u[e],t)<l)return!1}const c=BS(s,t);return 0!==c.length&&(i=c.start(0)+NS,this.logger_(`Buffered region starts (${c.start(0)}) just beyond seek point (${t}). Seeking to ${i}.`),this.tech_.setCurrentTime(i),!0)}waiting_(){if(this.techWaiting_())return;const e=this.tech_.currentTime(),t=this.tech_.buffered(),i=FS(t,e);return i.length&&e+3<=i.end(0)?(this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${i.start(0)} -> ${i.end(0)}]. Attempting to resume playback by seeking to the current time.`),void this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"})):void 0}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const i=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${i}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const i=this.tech_.vhs.playlistController_.sourceUpdater_,n=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const s=BS(n,t);return s.length>0&&(this.logger_(`Stopped at ${t} and seeking to ${s.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0)}afterSeekableWindow_(e,t,i,n=!1){if(!e.length)return!1;let s=e.end(e.length-1)+NS;const r=!i.endList,a="number"==typeof i.partTargetDuration;return r&&(a||n)&&(s=e.end(e.length-1)+3*i.targetDuration),t>s}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:i}){if(!e)return;let n;if(e.length&&t.length){const s=FS(e,i-3),r=FS(e,i),a=FS(t,i);a.length&&!r.length&&s.length&&(n={start:s.end(0),end:a.end(0)})}else{BS(e,i).length||(n=this.gapFromVideoUnderflow_(e,i))}return!!n&&(this.logger_(`Encountered a gap in video from ${n.start} to ${n.end}. Seeking to current time ${i}`),!0)}skipTheGap_(e){const t=this.tech_.buffered(),i=this.tech_.currentTime(),n=BS(t,i);if(this.resetTimeUpdate_(),0===n.length||i!==e)return;this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",n.start(0)),this.tech_.setCurrentTime(n.start(0)+MS);const s={gapInfo:{from:i,to:n.start(0)}};this.playlistController_.trigger({type:"gapjumped",metadata:s}),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(e,t){const i=function(e){if(e.length<2)return DS();const t=[];for(let i=1;i<e.length;i++){const n=e.end(i-1),s=e.start(i);t.push([n,s])}return DS(t)}(e);for(let e=0;e<i.length;e++){const n=i.start(e),s=i.end(e);if(t-n<4&&t-n>2)return{start:n,end:s}}return null}}const Kk={errorInterval:30,getSource(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},Yk=function(e,t){let i=0,n=0;const s=OS(Kk,t);e.ready(()=>{e.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const r=function(){n&&e.currentTime(n)},a=function(t){null!=t&&(n=e.duration()!==1/0&&e.currentTime()||0,e.one("loadedmetadata",r),e.src(t),e.trigger({type:"usage",name:"vhs-error-reload"}),e.play())},o=function(){if(Date.now()-i<1e3*s.errorInterval)e.trigger({type:"usage",name:"vhs-error-reload-canceled"});else{if(s.getSource&&"function"==typeof s.getSource)return i=Date.now(),s.getSource.call(e,a);ES.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}},l=function(){e.off("loadedmetadata",r),e.off("error",o),e.off("dispose",l)};e.on("error",o),e.on("dispose",l),e.reloadSourceOnError=function(t){l(),Yk(e,t)}},Qk=function(e){Yk(this,e)};var Jk="3.17.3";const Zk={PlaylistLoader:AE,Playlist:aE,utils:jE,STANDARD_PLAYLIST_SELECTOR:MC,INITIAL_PLAYLIST_SELECTOR:function(){const e=this.playlists.main.playlists.filter(aE.isEnabled);PC(e,(e,t)=>OC(e,t));return e.filter(e=>!!bE(this.playlists.main,e).video)[0]||null},lastBandwidthSelector:MC,movingAverageBandwidthSelector:function(e){let t=-1,i=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let n=this.useDevicePixelRatio&&Dd.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(n=this.customPixelRatio),t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(t=e*this.systemBandwidth+(1-e)*t,i=this.systemBandwidth),DC({main:this.playlists.main,bandwidth:t,playerWidth:parseInt(LC(this.tech_.el(),"width"),10)*n,playerHeight:parseInt(LC(this.tech_.el(),"height"),10)*n,playerObjectFit:this.usePlayerObjectFit?LC(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})}},comparePlaylistBandwidth:OC,comparePlaylistResolution:function(e,t){let i,n;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||Dd.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),n=n||Dd.Number.MAX_VALUE,i===n&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-n},xhr:PE()};Object.keys(JE).forEach(e=>{Object.defineProperty(Zk,e,{get:()=>(ES.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),JE[e]),set(t){ES.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),"number"!=typeof t||t<0?ES.log.warn(`value of Vhs.${e} must be greater than or equal to 0`):JE[e]=t}})});const ex="videojs-vhs",tx=function(e,t){const 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"})};Zk.canPlaySource=function(){return ES.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const ix=({player:e,sourceKeySystems:t,audioMedia:i,mainPlaylists:n})=>{if(!e.eme.initializeMediaKeys)return Promise.resolve();const s=((e,t)=>e.reduce((e,i)=>{if(!i.contentProtection)return e;const n=t.reduce((e,t)=>{const n=i.contentProtection[t];return n&&n.pssh&&(e[t]={pssh:n.pssh}),e},{});return Object.keys(n).length&&e.push(n),e},[]))(i?n.concat([i]):n,Object.keys(t)),r=[],a=[];return s.forEach(t=>{a.push(new Promise((t,i)=>{e.tech_.one("keysessioncreated",t)})),r.push(new Promise((i,n)=>{e.eme.initializeMediaKeys({keySystems:t},e=>{e?n(e):i()})}))}),Promise.race([Promise.all(r),Promise.race(a)])},nx=({player:e,sourceKeySystems:t,media:i,audioMedia:n})=>{const s=((e,t,i)=>{if(!e)return e;let n={};t&&t.attributes&&t.attributes.CODECS&&(n=_E(Tf(t.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(n.audio=i.attributes.CODECS);const s=Sf(n.video),r=Sf(n.audio),a={};for(const i in e)a[i]={},r&&(a[i].audioContentType=r),s&&(a[i].videoContentType=s),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 OS(e,a)})(t,i,n);return!!s&&(e.currentSource().keySystems=s,!(s&&!e.eme)||(ES.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1))},sx=()=>{if(!Dd.localStorage)return null;const e=Dd.localStorage.getItem(ex);if(!e)return null;try{return JSON.parse(e)}catch(e){return null}},rx=(e,t)=>{e._requestCallbackSet||(e._requestCallbackSet=new Set),e._requestCallbackSet.add(t)},ax=(e,t)=>{e._responseCallbackSet||(e._responseCallbackSet=new Set),e._responseCallbackSet.add(t)},ox=(e,t)=>{e._requestCallbackSet&&(e._requestCallbackSet.delete(t),e._requestCallbackSet.size||delete e._requestCallbackSet)},lx=(e,t)=>{e._responseCallbackSet&&(e._responseCallbackSet.delete(t),e._responseCallbackSet.size||delete e._responseCallbackSet)};Zk.supportsNativeHls=function(){if(!lp||!lp.createElement)return!1;const e=lp.createElement("video");if(!ES.getTech("Html5").isSupported())return!1;return["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))})}(),Zk.supportsNativeDash=!!(lp&&lp.createElement&&ES.getTech("Html5").isSupported())&&/maybe|probably/i.test(lp.createElement("video").canPlayType("application/dash+xml")),Zk.supportsTypeNatively=e=>"hls"===e?Zk.supportsNativeHls:"dash"===e&&Zk.supportsNativeDash,Zk.isSupported=function(){return ES.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},Zk.xhr.onRequest=function(e){rx(Zk.xhr,e)},Zk.xhr.onResponse=function(e){ax(Zk.xhr,e)},Zk.xhr.offRequest=function(e){ox(Zk.xhr,e)},Zk.xhr.offResponse=function(e){lx(Zk.xhr,e)};const ux=ES.getComponent("Component");class cx extends ux{constructor(e,t,i){if(super(t,i.vhs),"number"==typeof i.initialBandwidth&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=PS("VhsHandler"),t.options_&&t.options_.playerId){const e=ES.getPlayer(t.options_.playerId);this.player_=e}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(lp,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],e=>{const t=lp.fullscreenElement||lp.webkitFullscreenElement||lp.mozFullScreenElement||lp.msFullscreenElement;t&&t.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=OS(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.usePlayerObjectFit=this.options_.usePlayerObjectFit||!1,this.options_.useBandwidthFromLocalStorage=void 0!==this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=void 0===this.options_.useNetworkInformationApi||this.options_.useNetworkInformationApi,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=!1!==this.options_.llhls,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,"number"!=typeof this.options_.playlistExclusionDuration&&(this.options_.playlistExclusionDuration=60),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){const e=sx();e&&e.bandwidth&&(this.options_.bandwidth=e.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),e&&e.throughput&&(this.options_.throughput=e.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}"number"!=typeof this.options_.bandwidth&&(this.options_.bandwidth=JE.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===JE.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","usePlayerObjectFit","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(e=>{void 0!==this.source_[e]&&(this.options_[e]=this.source_[e])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio,this.usePlayerObjectFit=this.options_.usePlayerObjectFit;const t=this.options_.customPixelRatio;"number"==typeof t&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;var i;this.setOptions_(),this.options_.src=0===(i=this.source_.src).toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")?JSON.parse(i.substring(i.indexOf(",")+1)):i,this.options_.tech=this.tech_,this.options_.externVhs=Zk,this.options_.sourceType=Af(t),this.options_.seekTo=e=>{this.tech_.setCurrentTime(e)},this.options_.player_=this.player_,this.playlistController_=new zk(this.options_);const n=OS({liveRangeSafeTimeDelta:NS},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new Xk(n),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const e=ES.players[this.tech_.options_.playerId];let t=this.playlistController_.error;"object"!=typeof t||t.code?"string"==typeof t&&(t={message:t,code:3}):t.code=3,e.error(t)});const s=this.options_.bufferBasedABR?Zk.movingAverageBandwidthSelector(.55):Zk.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):s.bind(this),this.playlistController_.selectInitialPlaylist=Zk.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(e){this.playlistController_.selectPlaylist=e.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(e){this.playlistController_.mainSegmentLoader_.throughput.rate=e,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let e=this.playlistController_.mainSegmentLoader_.bandwidth;const t=Dd.navigator.connection||Dd.navigator.mozConnection||Dd.navigator.webkitConnection,i=1e7;if(this.options_.useNetworkInformationApi&&t){const n=1e3*t.downlink*1e3;e=n>=i&&e>=i?Math.max(e,n):n}return e},set(e){this.playlistController_.mainSegmentLoader_.bandwidth=e,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const e=1/(this.bandwidth||1);let t;t=this.throughput>0?1/this.throughput:0;return Math.floor(1/(e+t))},set(){ES.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:()=>jS(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:()=>jS(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&(e=>{if(!Dd.localStorage)return!1;let t=sx();t=t?OS(t,e):e;try{Dd.localStorage.setItem(ex,JSON.stringify(t))}catch(e){return!1}})({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{var e;(e=this).representations=()=>{const t=e.playlistController_.main(),i=rE(t)?e.playlistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter(e=>!ZS(e)).map((t,i)=>new Wk(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_=Dd.URL.createObjectURL(this.playlistController_.mediaSource),(ES.browser.IS_ANY_SAFARI||ES.browser.IS_IOS)&&this.options_.overrideNative&&"hls"===this.options_.sourceType&&"function"==typeof this.tech_.addSourceElement?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),ix({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(e=>{this.logger_("error while creating EME key session",e),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=nx({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});this.player_.tech_.on("keystatuschange",e=>{this.playlistController_.updatePlaylistByKeyStatus(e.keyId,e.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),t?this.createKeySessions_():this.playlistController_.sourceUpdater_.initializedEme()}setupQualityLevels_(){const e=ES.players[this.tech_.options_.playerId];e&&e.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{!function(e,t){t.representations().forEach(t=>{e.addQualityLevel(t)}),tx(e,t.playlists)}(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{tx(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":Jk,"mux.js":"7.1.0","mpd-parser":"1.3.1","m3u8-parser":"7.2.0","aes-decrypter":"4.0.2"}}version(){return this.constructor.version()}canChangeType(){return gk.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_&&Dd.URL.revokeObjectURL&&(Dd.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return $E({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=!0,n=2){return qE({programTime:e,playlist:this.playlistController_.media(),retryCount:n,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{rx(this.xhr,e)},this.xhr.onResponse=e=>{ax(this.xhr,e)},this.xhr.offRequest=e=>{ox(this.xhr,e)},this.xhr.offResponse=e=>{lx(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(e=>{this.playlistController_.on(e,e=>{this.player_.trigger(up({},e))})}),["gapjumped","playedrangeschanged"].forEach(e=>{this.playbackWatcher_.on(e,e=>{this.player_.trigger(up({},e))})})}}const hx={name:"videojs-http-streaming",VERSION:Jk,canHandleSource(e,t={}){const i=OS(ES.options,t);return!(!i.vhs.experimentalUseMMS&&!Ef("avc1.4d400d,mp4a.40.2",!1))&&hx.canPlayType(e.type,i)},handleSource(e,t,i={}){const n=OS(ES.options,i);return t.vhs=new cx(e,t,n),t.vhs.xhr=PE(),t.vhs.setupXhrHooks_(),t.vhs.src(e.src,e.type),t.vhs},canPlayType(e,t){const i=Af(e);if(!i)return"";const n=hx.getOverrideNative(t);return!Zk.supportsTypeNatively(i)||n?"maybe":""},getOverrideNative(e={}){const{vhs:t={}}=e,i=!(ES.browser.IS_ANY_SAFARI||ES.browser.IS_IOS),{overrideNative:n=i}=t;return n}};Ef("avc1.4d400d,mp4a.40.2",!0)&&ES.getTech("Html5").registerSourceHandler(hx,0),ES.VhsHandler=cx,ES.VhsSourceHandler=hx,ES.Vhs=Zk,ES.use||ES.registerComponent("Vhs",Zk),ES.options.vhs=ES.options.vhs||{},ES.getPlugin&&ES.getPlugin("reloadSourceOnError")||ES.registerPlugin("reloadSourceOnError",Qk);const dx=e=>{const t=e.browser.IS_IOS||e.browser.IS_NATIVE_ANDROID,i=e.getTech("Tech");class n extends i{constructor(e,i){super(e,i),this.setPoster(e.poster),this.setSrc(this.options_.source,!0),this.setTimeout(function(){this.el_&&(this.el_.parentNode.className+=" vjs-youtube",t&&(this.el_.parentNode.className+=" vjs-youtube-mobile"),n.isApiReady?this.initYTPlayer():n.apiReadyQueue.push(this))}.bind(this))}dispose(){if(this.ytPlayer)this.ytPlayer.stopVideo&&this.ytPlayer.stopVideo(),this.ytPlayer.destroy&&this.ytPlayer.destroy();else{var e=n.apiReadyQueue.indexOf(this);-1!==e&&n.apiReadyQueue.splice(e,1)}this.ytPlayer=null,this.el_.parentNode.className=this.el_.parentNode.className.replace(" vjs-youtube","").replace(" vjs-youtube-mobile",""),this.el_.parentNode.removeChild(this.el_),i.prototype.dispose.call(this)}createEl(){if("undefined"!=typeof document){var e=document.createElement("div");e.setAttribute("id",this.options_.techId),e.setAttribute("style","width:100%;height:100%;top:0;left:0;position:absolute"),e.setAttribute("class","vjs-tech");var i=document.createElement("div");if(i.appendChild(e),!t&&!this.options_.ytControls){var n=document.createElement("div");n.setAttribute("class","vjs-iframe-blocker"),n.setAttribute("style","position:absolute;top:0;left:0;width:100%;height:100%"),n.onclick=function(){this.pause()}.bind(this),i.appendChild(n)}return i}}initYTPlayer(){var e={controls:0,modestbranding:1,rel:0,showinfo:0,loop:this.options_.loop?1:0};if(void 0!==this.options_.autohide&&(e.autohide=this.options_.autohide),void 0!==this.options_.cc_load_policy&&(e.cc_load_policy=this.options_.cc_load_policy),void 0!==this.options_.ytControls&&(e.controls=this.options_.ytControls),void 0!==this.options_.disablekb&&(e.disablekb=this.options_.disablekb),void 0!==this.options_.color&&(e.color=this.options_.color),e.controls?void 0!==this.options_.fs&&(e.fs=this.options_.fs):e.fs=0,-1!==this.options_.source.src.indexOf("end=")){var t=this.options_.source.src.match(/end=([0-9]*)/);this.options_.end=parseInt(t[1])}if(void 0!==this.options_.end&&(e.end=this.options_.end),void 0!==this.options_.hl?e.hl=this.options_.hl:void 0!==this.options_.language&&(e.hl=this.options_.language.substr(0,2)),void 0!==this.options_.iv_load_policy&&(e.iv_load_policy=this.options_.iv_load_policy),void 0!==this.options_.list?e.list=this.options_.list:this.url&&void 0!==this.url.listId&&(e.list=this.url.listId),void 0!==this.options_.listType&&(e.listType=this.options_.listType),void 0!==this.options_.modestbranding&&(e.modestbranding=this.options_.modestbranding),void 0!==this.options_.playlist&&(e.playlist=this.options_.playlist),void 0!==this.options_.playsinline&&(e.playsinline=this.options_.playsinline),void 0!==this.options_.rel&&(e.rel=this.options_.rel),void 0!==this.options_.showinfo&&(e.showinfo=this.options_.showinfo),-1!==this.options_.source.src.indexOf("start=")){var i=this.options_.source.src.match(/start=([0-9]*)/);this.options_.start=parseInt(i[1])}if(void 0!==this.options_.start&&(e.start=this.options_.start),void 0!==this.options_.theme&&(e.theme=this.options_.theme),void 0!==this.options_.customVars){var n=this.options_.customVars;Object.keys(n).forEach(function(t){e[t]=n[t]})}this.activeVideoId=this.url?this.url.videoId:null,this.activeList=e.list;var s={videoId:this.activeVideoId,playerVars:e,events:{onReady:this.onPlayerReady.bind(this),onPlaybackQualityChange:this.onPlayerPlaybackQualityChange.bind(this),onPlaybackRateChange:this.onPlayerPlaybackRateChange.bind(this),onStateChange:this.onPlayerStateChange.bind(this),onVolumeChange:this.onPlayerVolumeChange.bind(this),onError:this.onPlayerError.bind(this)}};void 0!==this.options_.enablePrivacyEnhancedMode&&this.options_.enablePrivacyEnhancedMode&&(s.host="https://www.youtube-nocookie.com"),this.ytPlayer=new YT.Player(this.options_.techId,s)}onPlayerReady(){this.options_.muted&&this.ytPlayer.mute(),this.ytPlayer.getAvailablePlaybackRates().length>1&&(this.featuresPlaybackRate=!0),this.playerReady_=!0,this.triggerReady(),this.playOnReady?this.play():this.cueOnReady&&(this.cueVideoById_(this.url.videoId),this.activeVideoId=this.url.videoId)}onPlayerPlaybackQualityChange(){}onPlayerPlaybackRateChange(){this.trigger("ratechange")}onPlayerStateChange(e){var t=e.data;if(t!==this.lastState&&!this.errorNumber)switch(this.lastState=t,t){case-1:this.trigger("loadstart"),this.trigger("loadedmetadata"),this.trigger("durationchange"),this.trigger("ratechange");break;case YT.PlayerState.ENDED:this.trigger("ended");break;case YT.PlayerState.PLAYING:this.trigger("timeupdate"),this.trigger("durationchange"),this.trigger("playing"),this.trigger("play"),this.isSeeking&&this.onSeeked();break;case YT.PlayerState.PAUSED:this.trigger("canplay"),this.isSeeking?this.onSeeked():this.trigger("pause");break;case YT.PlayerState.BUFFERING:this.player_.trigger("timeupdate"),this.player_.trigger("waiting")}}onPlayerVolumeChange(){this.trigger("volumechange")}onPlayerError(e){this.errorNumber=e.data,this.trigger("pause"),this.trigger("error")}error(){var e=1e3+this.errorNumber;switch(this.errorNumber){case 5:return{code:e,message:"Error while trying to play the video"};case 2:case 100:return{code:e,message:"Unable to find the video"};case 101:case 150:return{code:e,message:"Playback on other Websites has been disabled by the video owner."}}return{code:e,message:"YouTube unknown error ("+this.errorNumber+")"}}loadVideoById_(e){var t={videoId:e};this.options_.start&&(t.startSeconds=this.options_.start),this.options_.end&&(t.endSeconds=this.options_.end),this.ytPlayer.loadVideoById(t)}cueVideoById_(e){var t={videoId:e};this.options_.start&&(t.startSeconds=this.options_.start),this.options_.end&&(t.endSeconds=this.options_.end),this.ytPlayer.cueVideoById(t)}src(e){return e&&this.setSrc({src:e}),this.source}poster(){return t?null:this.poster_}setPoster(e){this.poster_=e}setSrc(e){e&&e.src&&(delete this.errorNumber,this.source=e,this.url=n.parseUrl(e.src),this.options_.poster||this.url.videoId&&(this.poster_="https://img.youtube.com/vi/"+this.url.videoId+"/0.jpg",this.trigger("posterchange"),this.checkHighResPoster()),this.options_.autoplay&&!t?this.isReady_?this.play():this.playOnReady=!0:this.activeVideoId!==this.url.videoId&&(this.isReady_?(this.cueVideoById_(this.url.videoId),this.activeVideoId=this.url.videoId):this.cueOnReady=!0))}autoplay(){return this.options_.autoplay}setAutoplay(e){this.options_.autoplay=e}loop(){return this.options_.loop}setLoop(e){this.options_.loop=e}play(){this.url&&this.url.videoId&&(this.wasPausedBeforeSeek=!1,this.isReady_?(this.url.listId&&(this.activeList===this.url.listId?this.ytPlayer.playVideo():(this.ytPlayer.loadPlaylist(this.url.listId),this.activeList=this.url.listId)),this.activeVideoId===this.url.videoId?this.ytPlayer.playVideo():(this.loadVideoById_(this.url.videoId),this.activeVideoId=this.url.videoId)):(this.trigger("waiting"),this.playOnReady=!0))}pause(){this.ytPlayer&&this.ytPlayer.pauseVideo()}paused(){return!this.ytPlayer||this.lastState!==YT.PlayerState.PLAYING&&this.lastState!==YT.PlayerState.BUFFERING}currentTime(){return this.ytPlayer?this.ytPlayer.getCurrentTime():0}setCurrentTime(e){this.lastState===YT.PlayerState.PAUSED&&(this.timeBeforeSeek=this.currentTime()),this.isSeeking||(this.wasPausedBeforeSeek=this.paused()),this.ytPlayer.seekTo(e,!0),this.trigger("timeupdate"),this.trigger("seeking"),this.isSeeking=!0,this.lastState===YT.PlayerState.PAUSED&&this.timeBeforeSeek!==e&&(clearInterval(this.checkSeekedInPauseInterval),this.checkSeekedInPauseInterval=setInterval(function(){this.lastState===YT.PlayerState.PAUSED&&this.isSeeking?this.currentTime()!==this.timeBeforeSeek&&(this.trigger("timeupdate"),this.onSeeked()):clearInterval(this.checkSeekedInPauseInterval)}.bind(this),250))}seeking(){return this.isSeeking}seekable(){return this.ytPlayer?e.createTimeRange(0,this.ytPlayer.getDuration()):e.createTimeRange()}onSeeked(){clearInterval(this.checkSeekedInPauseInterval),this.isSeeking=!1,this.wasPausedBeforeSeek&&this.pause(),this.trigger("seeked")}playbackRate(){return this.ytPlayer?this.ytPlayer.getPlaybackRate():1}setPlaybackRate(e){this.ytPlayer&&this.ytPlayer.setPlaybackRate(e)}duration(){return this.ytPlayer?this.ytPlayer.getDuration():0}currentSrc(){return this.source&&this.source.src}ended(){return!!this.ytPlayer&&this.lastState===YT.PlayerState.ENDED}volume(){return this.ytPlayer?this.ytPlayer.getVolume()/100:1}setVolume(e){this.ytPlayer&&this.ytPlayer.setVolume(100*e)}muted(){return!!this.ytPlayer&&this.ytPlayer.isMuted()}setMuted(e){this.ytPlayer&&(this.muted(!0),e?this.ytPlayer.mute():this.ytPlayer.unMute(),this.setTimeout(function(){this.trigger("volumechange")},50))}buffered(){if(!this.ytPlayer||!this.ytPlayer.getVideoLoadedFraction)return e.createTimeRange();var t=this.ytPlayer.getVideoLoadedFraction()*this.ytPlayer.getDuration();return e.createTimeRange(0,t)}preload(){}load(){}reset(){}networkState(){if(!this.ytPlayer)return 0;switch(this.ytPlayer.getPlayerState()){case-1:return 0;case 3:return 2;default:return 1}}readyState(){if(!this.ytPlayer)return 0;switch(this.ytPlayer.getPlayerState()){case-1:return 0;case 5:return 1;case 3:return 2;default:return 4}}supportsFullScreen(){if("undefined"!=typeof document)return document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled}checkHighResPoster(){var e="https://img.youtube.com/vi/"+this.url.videoId+"/maxresdefault.jpg";try{var t=new Image;t.onload=function(){if("naturalHeight"in t){if(t.naturalHeight<=90||t.naturalWidth<=120)return}else if(t.height<=90||t.width<=120)return;this.poster_=e,this.trigger("posterchange")}.bind(this),t.onerror=function(){},t.src=e}catch(e){}}}n.isSupported=function(){return!0},n.canPlaySource=function(e){return n.canPlayType(e.type)},n.canPlayType=function(e){return"video/youtube"===e},n.parseUrl=function(e){var t={videoId:null},i=e.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/);i&&11===i[2].length&&(t.videoId=i[2]);return(i=e.match(/[?&]list=([^#\&\?]+)/))&&i[1]&&(t.listId=i[1]),t},n.apiReadyQueue=[],"undefined"!=typeof document&&(function(e,t){if("undefined"!=typeof document){var i=!1,n=document.createElement("script"),s=document.getElementsByTagName("script")[0];s&&(s.parentNode.insertBefore(n,s),n.onload=function(){i||(i=!0,t())},n.onreadystatechange=function(){i||"complete"!==this.readyState&&"loaded"!==this.readyState||(i=!0,t())},n.src=e)}}("https://www.youtube.com/iframe_api",function(){YT.ready(function(){n.isApiReady=!0;for(var e=0;e<n.apiReadyQueue.length;++e)n.apiReadyQueue[e].initYTPlayer()})}),function(){if("undefined"!=typeof document){var e=".vjs-youtube .vjs-iframe-blocker { display: none; }.vjs-youtube.vjs-user-inactive .vjs-iframe-blocker { display: block; }.vjs-youtube .vjs-poster { background-size: cover; }",t=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e)),t.appendChild(i)}}()),void 0!==e.registerTech?e.registerTech("Youtube",n):e.registerComponent("Youtube",n)},px={languages:{it:{"Audio Player":"Lettore audio","Video Player":"Lettore video",Play:"Play",Pause:"Pausa",Replay:"Replay","Current Time":"Orario attuale",Duration:"Durata","Remaining Time":"Tempo rimanente","Stream Type":"Tipo di streaming",LIVE:"LIVE",Loaded:"Caricato",Progress:"Stato","Progress Bar":"Barra di avanzamento","progress bar timing: currentTime={1} duration={2}":"{1} di {2}",Fullscreen:"Schermo intero","Exit Fullscreen":"Chiudi Schermo intero",Mute:"Disattiva l’audio",Unmute:"Attiva l’audio","Playback Rate":"Velocità di riproduzione",Subtitles:"Sottotitoli","subtitles off":"Senza sottotitoli",Captions:"Sottotitoli non udenti","captions off":"Senza sottotitoli non udenti",Chapters:"Capitolo",Descriptions:"Descrizioni","descriptions off":"Descrizioni disattivate","Audio Track":"Traccia audio","Volume Level":"Livello del volume","You aborted the media playback":"La riproduzione del filmato è stata interrotta.","A network error caused the media download to fail part-way.":"Il download del filmato è stato interrotto a causa di un problema rete.","The media could not be loaded, either because the server or network failed or because the format is not supported.":"Il filmato non può essere caricato a causa di un errore nel server o nella rete o perché il formato non viene supportato.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"La riproduzione del filmato è stata interrotta a causa di un file danneggiato o per l’utilizzo di impostazioni non supportate dal browser.","No compatible source was found for this media.":"Non ci sono fonti compatibili per questo filmato.","The media is encrypted and we do not have the keys to decrypt it.":"Il contenuto multimediale è criptato e non disponiamo delle chiavi per decifrarlo.","Play Video":"Riproduci il video",Close:"Chiudi","Close Modal Dialog":"Chiudi la finestra di dialogo","Modal Window":"Finestra di dialogo","This is a modal window":"Questa è una finestra di dialogo","This modal can be closed by pressing the Escape key or activating the close button.":"Questa finestra di dialogo può essere chiusa premendo sul tasto Esc o attivando il pulsante di chiusura.",", opens captions settings dialog":", aprire i parametri della trascrizione dei sottotitoli",", opens subtitles settings dialog":", aprire i parametri dei sottotitoli",", opens descriptions settings dialog":", aprire i parametri delle descrizioni",", selected":", selezionato","captions settings":"Parametri sottotitoli non udenti","subtitles settings":"Parametri sottotitoli","descriptions settings":"Parametri descrizioni",Text:"Testo",White:"Bianco",Black:"Nero",Red:"Rosso",Green:"Verde",Blue:"Blu",Yellow:"Giallo",Magenta:"Magenta",Cyan:"Ciano",Background:"Sfondo",Window:"Finestra",Transparent:"Trasparente","Semi-Transparent":"Semi-Trasparente",Opaque:"Opaco","Font Size":"Dimensione dei caratteri","Text Edge Style":"Stile dei bordi del testo",None:"Nessuno",Uniform:"Uniforme","Drop shadow":"Ombra","Font Family":"Carattere","Proportional Sans-Serif":"Sans-Serif proporzionale","Monospace Sans-Serif":"Sans-Serif monospaziato","Proportional Serif":"Serif proporzionale","Monospace Serif":"Serif monospaziato","Small Caps":"Maiuscoletto",Reset:"Reinizializza","restore all settings to the default values":"Ripristina i valori predefiniti per tutti i parametri",Done:"Fatto","Caption Settings Dialog":"Finestra di dialogo dei parametri della trascrizione dei sottotitoli","Beginning of dialog window. Escape will cancel and close the window.":"Inizio della finestra di dialogo. Il tasto Esc annullerà l’operazione e chiuderà la finestra.","End of dialog window.":"Fine della finestra di dialogo.","{1} is loading.":"{1} in fase di caricamento.","Exit Picture-in-Picture":"Esci dalla modalità Picture-in-Picture","Picture-in-Picture":"Picture-in-Picture",Color:"Colore",Opacity:"Opacità","Text Background":"Sfondo testo","Caption Area Background":"Sfondo area sottotitoli","Skip forward {1} seconds":"Avanti {1} secondi","Skip backward {1} seconds":"Indietro {1} secondi"}},language:"it"},fx={};"undefined"!=typeof window&&(window.videojs=ES);class mx extends Hi{constructor(e,t){super(e),e.classList.add("video-js","vjs-theme-bootstrap-italia","vjs-fluid","vjs-big-play-centered"),this._config=this._getConfig(t),this.player=ES(e,px)}setYouTubeVideo(e){dx(ES),this.player.tech("youtube"),this.player.src({type:"video/youtube",src:e})}static get NAME(){return"videoplayer"}_getConfig(e){return e={...fx,...qi.getDataAttributes(this._element),..."object"==typeof e?e:{}}}}if("undefined"!=typeof window&&"undefined"!=typeof document){const e=zi.find("[data-bs-video]");e.length>0&&e.forEach(e=>{mx.getOrCreateInstance(e)})}const gx="show";class yx extends Hi{constructor(e,t){super(e.closest(".acceptoverlay")),this._overlayable=e.closest(".acceptoverlayable");const i=s.isChoiceRemembered(t.service);if(this._isShown=!0,this._toggleElement=e,this._element.classList.contains(gx)&&this._overlayable.classList.add(gx),i)return this.hide(),void setTimeout(()=>{this._toggleElement.dispatchEvent(new Event("click"))},100);this._toggleElement.addEventListener("click",()=>{this.hide(),this._remember=this._toggleElement.parentElement.querySelector("[data-bs-accept-remember]").checked,s.rememberChoice(t.service,this._remember)})}static get NAME(){return"acceptoverlay"}show(){this._isShown||this._isTransitioning||(this._isShown=!0,this._isAnimated()&&(this._isTransitioning=!0),this._showElement())}hide(){if(!this._isShown||this._isTransitioning)return;this._isShown=!1;const e=this._isAnimated();e&&(this._isTransitioning=!0),this._element.classList.remove(gx),this._overlayable.classList.remove(gx),this._queueCallback(()=>this._hideElement(),this._element,e)}_isAnimated(){return this._element.classList.contains("fade")}_showElement(){const e=this._isAnimated();this._element.removeAttribute("aria-hidden"),e&&vi(this._element),this._element.classList.add(gx),this._overlayable.add(gx);this._queueCallback(()=>{this._isTransitioning=!1},this._element,e)}_hideElement(){this._element.setAttribute("aria-hidden",!0),this._isTransitioning=!1}}if("undefined"!=typeof window&&"undefined"!=typeof document){const e=zi.find("[data-bs-accept-from]");e.length>0&&e.forEach(e=>{yx.getOrCreateInstance(e,{service:e.dataset.bsAcceptFrom})})}i();const _x={Alert:pl,Button:ml,Carousel:Xi,Collapse:Al,Dropdown:Pc,Modal:Xc,Offcanvas:dh,Popover:class extends Nh{static get Default(){return Bh}static get DefaultType(){return Uh}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[Rh]:this._getTitle(),[Fh]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}},ScrollSpy:Yh,Tab:yd,Toast:Od,Tooltip:Nh,VideoPlayer:mx,AcceptOverlay:yx,Accordion:Ts,BackToTop:ko,Cookiebar:An,Dimmer:hn,FormValidate:class{constructor(e,t,i){if(this.formSelector=e,"undefined"!=typeof window&&"undefined"!=typeof document)return this.target=document.querySelector(e),this.validate=null!=i?new ya(e,t,i):new ya(e,t),this.config=Object.assign({},ba,this.validate.globalConfig),this.formItems=[],this.init(),this.validate}init(){this.target.querySelectorAll("input, select").forEach(e=>{const t=new _a(e,this.config.errorFieldCssClass,()=>this.onInputError(e),()=>this.onInputErrorRemove(e),!0);e.id||e.setAttribute("id",Ta+"-input-"+Math.random()),this.formItems.push({item:e,watcher:t})});this.target.querySelectorAll("fieldset").forEach(e=>{if(e.querySelectorAll("input[type=radio],input[type=checkbox]").length>0){const t=new va(e,"."+this.config.errorLabelCssClass,()=>this.onFieldsetError(e),()=>this.onFieldsetErrorRemove(e));e.id||e.setAttribute("id",Ta+"-fieldset-"+Math.random()),this.formItems.push({item:e,watcher:t})}})}onInputError(e){const t=this.getErrorMessages(e),i=[];t.forEach((t,n)=>{const s=e.id+"-error-"+n;t.setAttribute("id",s),i.push(s)}),i.length>0&&(e.setAttribute("aria-describedby",i.join(" ")),e.setAttribute("aria-invalid","true"))}onInputErrorRemove(e){e.removeAttribute("aria-describedby"),e.setAttribute("aria-invalid","false")}onFieldsetError(e){const t=this.getErrorMessages(e),i=[],n=[];if(t.forEach((t,s)=>{const r=e.id+"-error-"+s;t.setAttribute("id",r),i.push(r),n.push(t.textContent)}),i.length>0){const t=e.querySelector("legend");t&&(t.setAttribute("aria-describedby",i.join(" ")),t.setAttribute("aria-invalid","true"))}}onFieldsetErrorRemove(e){const t=e.querySelector("legend");if(t){t.removeAttribute("aria-describedby"),t.setAttribute("aria-invalid","false");const e=t.querySelector(".sr-only-justvalidate-bi");e&&e.remove()}}getErrorMessages(e){let t=e,i=t.querySelectorAll("."+this.config.errorLabelCssClass);for(;null!=t&&0===i.length;)t=t.parentNode,i=t.querySelectorAll("."+this.config.errorLabelCssClass);return i}},Forward:No,HistoryBack:Lo,Input:wa,InputNumber:un,InputPassword:za,InputSearchAutocomplete:Pa,List:Wo,Masonry:jo,NavBarCollapsible:ms,NavScroll:qr,Notification:vn,ProgressDonut:ho,SelectAutocomplete:class extends Hi{constructor(e,t){super(e),this._config=t||{},this._config.inputClasses="form-control",this._config.showNoOptionsFound=!0,this._config.hintClasses="app-hint",this._config.autoselect=!1,this._config.showAllValues=!1,this._config.templates=void 0,this._config.confirmOnBlur=!1,this._config.menuAttributes={},this._config.menuClasses=null,this._extraClasses=[],this._config.tAssistiveHint||(this._config.tAssistiveHint=()=>"Quando i risultati del completamento automatico sono disponibili, usa le frecce su e giù per rivedere e Invio per selezionare. Utenti di dispositivi touch, esplora tramite tocco o con gesti di scorrimento"),this._config.tNoResults||(this._config.tNoResults=()=>"Nessun risultato trovato"),this._config.tStatusQueryTooShort||(this._config.tStatusQueryTooShort=e=>`Digita ${e} o più caratteri per mostrare le opzioni di ricerca`),this._config.tStatusNoResults||(this._config.tStatusNoResults=()=>"Nessun risultato di ricerca"),this._config.tStatusSelectedOption||(this._config.tStatusSelectedOption=(e,t,i)=>`${e} ${i+1} di ${t} è sottolineato`),this._config.tStatusResults||(this._config.tStatusResults=(e,t)=>`${e} ${1===e?"risultato":"risultati"} ${1===e?"è":"sono"} ${1===e?"disponibile":"disponibili"}. ${t}`),"undefined"!=typeof document&&this._enhance()}static get NAME(){return"selectautocomplete"}_enhance(){const e=this._config.id,t=this._config.onConfirm;this._config.onConfirm=i=>{document.getElementById(e).value=i,document.getElementById(e).dispatchEvent(new Event("input")),t&&t(i)},ka(Object.assign({},{element:this._element,id:e},this._config)),setTimeout(()=>{this._inputField=document.getElementById(e),this._label=new en(this._inputField),this._inputField.addEventListener("focus",()=>{this._extraClasses.forEach(e=>{this._inputField.classList.add(e)}),this._extraClasses=[]}),this._inputField.addEventListener("blur",()=>{this._extraClasses.forEach(e=>{this._inputField.classList.add(e)}),this._extraClasses=[]}),function(e,t){const i=new MutationObserver(e=>{e.forEach(e=>{"attributes"===e.type&&"class"===e.attributeName&&t(e.oldValue,e.target)})});i.observe(e,{attributes:!0,attributeOldValue:!0}),i.disconnect}(this._inputField,e=>{this._extraClasses=[],e!==this._inputField.classList.value&&e.split(" ").forEach(e=>{e.startsWith("autocomplete")||this._extraClasses.push(e)})})},100)}},Sticky:Qr,HeaderSticky:ta,Transfer:ul,UploadDragDrop:wo,ValidatorSelectAutocomplete:(e,t={})=>(i,n)=>{let s=!1;const r=n[e];if(!r)throw new Error("ValidatorSelectAutocomplete: "+e+" not found as form field");return t.required||i?"undefined"!=typeof window&&"undefined"!=typeof document&&document.querySelector("#"+r.elem.id+"-select").querySelectorAll("option").forEach(e=>{e.text===i&&(s=!0)}):s=!0,s},loadFonts:(e="/node_modules/bootstrap-italia/dist/fonts")=>{if("undefined"==typeof window||"undefined"==typeof document)return;const t=document.createElement("style"),i=window.__PUBLIC_PATH__?window.__PUBLIC_PATH__:e;t.innerHTML=`\n /* Titillium+Web:300,400,600,700 */\n\n /* titillium-web-300 - latin-ext_latin */\n @font-face {\n font-family: 'Titillium Web';\n font-style: normal;\n font-weight: 300;\n font-display: swap;\n src: url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-300.eot'); /* IE9 Compat Modes */\n src: local(''),\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-300.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-300.woff2') format('woff2'), /* Super Modern Browsers */\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-300.woff') format('woff'), /* Modern Browsers */\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-300.ttf') format('truetype'), /* Safari, Android, iOS */\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-300.svg#TitilliumWeb') format('svg'); /* Legacy iOS */\n }\n\n /* titillium-web-300italic - latin-ext_latin */\n @font-face {\n font-family: 'Titillium Web';\n font-style: italic;\n font-weight: 300;\n font-display: swap;\n src: url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-300italic.eot'); /* IE9 Compat Modes */\n src: local(''),\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-300italic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-300italic.woff2') format('woff2'), /* Super Modern Browsers */\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-300italic.woff') format('woff'), /* Modern Browsers */\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-300italic.ttf') format('truetype'), /* Safari, Android, iOS */\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-300italic.svg#TitilliumWeb') format('svg'); /* Legacy iOS */\n }\n\n /* titillium-web-regular - latin-ext_latin */\n @font-face {\n font-family: 'Titillium Web';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-regular.eot'); /* IE9 Compat Modes */\n src: local(''),\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-regular.woff2') format('woff2'), /* Super Modern Browsers */\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-regular.woff') format('woff'), /* Modern Browsers */\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-regular.svg#TitilliumWeb') format('svg'); /* Legacy iOS */\n }\n\n /* titillium-web-italic - latin-ext_latin */\n @font-face {\n font-family: 'Titillium Web';\n font-style: italic;\n font-weight: 400;\n font-display: swap;\n src: url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-italic.eot'); /* IE9 Compat Modes */\n src: local(''),\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-italic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-italic.woff2') format('woff2'), /* Super Modern Browsers */\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-italic.woff') format('woff'), /* Modern Browsers */\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-italic.ttf') format('truetype'), /* Safari, Android, iOS */\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-italic.svg#TitilliumWeb') format('svg'); /* Legacy iOS */\n }\n\n /* titillium-web-700 - latin-ext_latin */\n @font-face {\n font-family: 'Titillium Web';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-700.eot'); /* IE9 Compat Modes */\n src: local(''),\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-700.woff2') format('woff2'), /* Super Modern Browsers */\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-700.woff') format('woff'), /* Modern Browsers */\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-700.ttf') format('truetype'), /* Safari, Android, iOS */\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-700.svg#TitilliumWeb') format('svg'); /* Legacy iOS */\n }\n\n /* titillium-web-700italic - latin-ext_latin */\n @font-face {\n font-family: 'Titillium Web';\n font-style: italic;\n font-weight: 700;\n font-display: swap;\n src: url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-700italic.eot'); /* IE9 Compat Modes */\n src: local(''),\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-700italic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-700italic.woff2') format('woff2'), /* Super Modern Browsers */\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-700italic.woff') format('woff'), /* Modern Browsers */\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-700italic.ttf') format('truetype'), /* Safari, Android, iOS */\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-700italic.svg#TitilliumWeb') format('svg'); /* Legacy iOS */\n }\n /* titillium-web-600 - latin-ext_latin */\n @font-face {\n font-family: 'Titillium Web';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-600.eot'); /* IE9 Compat Modes */\n src: local(''),\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-600.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-600.woff2') format('woff2'), /* Super Modern Browsers */\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-600.woff') format('woff'), /* Modern Browsers */\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-600.ttf') format('truetype'), /* Safari, Android, iOS */\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-600.svg#TitilliumWeb') format('svg'); /* Legacy iOS */\n }\n\n /* titillium-web-600italic - latin-ext_latin */\n @font-face {\n font-family: 'Titillium Web';\n font-style: italic;\n font-weight: 600;\n font-display: swap;\n src: url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-600italic.eot'); /* IE9 Compat Modes */\n src: local(''),\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-600italic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-600italic.woff2') format('woff2'), /* Super Modern Browsers */\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-600italic.woff') format('woff'), /* Modern Browsers */\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-600italic.ttf') format('truetype'), /* Safari, Android, iOS */\n url('${i}/Titillium_Web/titillium-web-v10-latin-ext_latin-600italic.svg#TitilliumWeb') format('svg'); /* Legacy iOS */\n }\n\n /* Lora:400,700 */\n\n /* lora-regular - latin-ext_latin */\n @font-face {\n font-family: 'Lora';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url('${i}/Lora/lora-v20-latin-ext_latin-regular.eot'); /* IE9 Compat Modes */\n src: local(''),\n url('${i}/Lora/lora-v20-latin-ext_latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */\n url('${i}/Lora/lora-v20-latin-ext_latin-regular.woff2') format('woff2'), /* Super Modern Browsers */\n url('${i}/Lora/lora-v20-latin-ext_latin-regular.woff') format('woff'), /* Modern Browsers */\n url('${i}/Lora/lora-v20-latin-ext_latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */\n url('${i}/Lora/lora-v20-latin-ext_latin-regular.svg#Lora') format('svg'); /* Legacy iOS */\n }\n\n /* lora-700 - latin-ext_latin */\n @font-face {\n font-family: 'Lora';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url('${i}/Lora/lora-v20-latin-ext_latin-700.eot'); /* IE9 Compat Modes */\n src: local(''),\n url('${i}/Lora/lora-v20-latin-ext_latin-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */\n url('${i}/Lora/lora-v20-latin-ext_latin-700.woff2') format('woff2'), /* Super Modern Browsers */\n url('${i}/Lora/lora-v20-latin-ext_latin-700.woff') format('woff'), /* Modern Browsers */\n url('${i}/Lora/lora-v20-latin-ext_latin-700.ttf') format('truetype'), /* Safari, Android, iOS */\n url('${i}/Lora/lora-v20-latin-ext_latin-700.svg#Lora') format('svg'); /* Legacy iOS */\n }\n\n /* lora-italic - latin-ext_latin */\n @font-face {\n font-family: 'Lora';\n font-style: italic;\n font-weight: 400;\n font-display: swap;\n src: url('${i}/Lora/lora-v20-latin-ext_latin-italic.eot'); /* IE9 Compat Modes */\n src: local(''),\n url('${i}/Lora/lora-v20-latin-ext_latin-italic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */\n url('${i}/Lora/lora-v20-latin-ext_latin-italic.woff2') format('woff2'), /* Super Modern Browsers */\n url('${i}/Lora/lora-v20-latin-ext_latin-italic.woff') format('woff'), /* Modern Browsers */\n url('${i}/Lora/lora-v20-latin-ext_latin-italic.ttf') format('truetype'), /* Safari, Android, iOS */\n url('${i}/Lora/lora-v20-latin-ext_latin-italic.svg#Lora') format('svg'); /* Legacy iOS */\n }\n\n /* lora-700italic - latin-ext_latin */\n @font-face {\n font-family: 'Lora';\n font-style: italic;\n font-weight: 700;\n font-display: swap;\n src: url('${i}/Lora/lora-v20-latin-ext_latin-700italic.eot'); /* IE9 Compat Modes */\n src: local(''),\n url('${i}/Lora/lora-v20-latin-ext_latin-700italic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */\n url('${i}/Lora/lora-v20-latin-ext_latin-700italic.woff2') format('woff2'), /* Super Modern Browsers */\n url('${i}/Lora/lora-v20-latin-ext_latin-700italic.woff') format('woff'), /* Modern Browsers */\n url('${i}/Lora/lora-v20-latin-ext_latin-700italic.ttf') format('truetype'), /* Safari, Android, iOS */\n url('${i}/Lora/lora-v20-latin-ext_latin-700italic.svg#Lora') format('svg'); /* Legacy iOS */\n }\n\n /* Roboto+Mono:400,700 */\n\n /* roboto-mono-regular - latin-ext_latin */\n @font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url('${i}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-regular.eot'); /* IE9 Compat Modes */\n src: local(''),\n url('${i}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */\n url('${i}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-regular.woff2') format('woff2'), /* Super Modern Browsers */\n url('${i}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-regular.woff') format('woff'), /* Modern Browsers */\n url('${i}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */\n url('${i}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-regular.svg#RobotoMono') format('svg'); /* Legacy iOS */\n }\n\n /* roboto-mono-700 - latin-ext_latin */\n @font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url('${i}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-700.eot'); /* IE9 Compat Modes */\n src: local(''),\n url('${i}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */\n url('${i}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-700.woff2') format('woff2'), /* Super Modern Browsers */\n url('${i}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-700.woff') format('woff'), /* Modern Browsers */\n url('${i}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-700.ttf') format('truetype'), /* Safari, Android, iOS */\n url('${i}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-700.svg#RobotoMono') format('svg'); /* Legacy iOS */\n }\n\n /* roboto-mono-italic - latin-ext_latin */\n @font-face {\n font-family: 'Roboto Mono';\n font-style: italic;\n font-weight: 400;\n font-display: swap;\n src: url('${i}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-italic.eot'); /* IE9 Compat Modes */\n src: local(''),\n url('${i}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-italic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */\n url('${i}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-italic.woff2') format('woff2'), /* Super Modern Browsers */\n url('${i}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-italic.woff') format('woff'), /* Modern Browsers */\n url('${i}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-italic.ttf') format('truetype'), /* Safari, Android, iOS */\n url('${i}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-italic.svg#RobotoMono') format('svg'); /* Legacy iOS */\n }\n\n /* roboto-mono-700italic - latin-ext_latin */\n @font-face {\n font-family: 'Roboto Mono';\n font-style: italic;\n font-weight: 700;\n font-display: swap;\n src: url('${i}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-700italic.eot'); /* IE9 Compat Modes */\n src: local(''),\n url('${i}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-700italic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */\n url('${i}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-700italic.woff2') format('woff2'), /* Super Modern Browsers */\n url('${i}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-700italic.woff') format('woff'), /* Modern Browsers */\n url('${i}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-700italic.ttf') format('truetype'), /* Safari, Android, iOS */\n url('${i}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-700italic.svg#RobotoMono') format('svg'); /* Legacy iOS */\n }\n `,document.getElementsByTagName("head")[0].appendChild(t)},cookies:s};return _x});
|