bootstrap-italia 2.13.3 → 2.13.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- !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",t="focus--mouse";class i{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",(i=>{this._usingMouse&&i.target&&(i.target.classList.add(t),i.target.setAttribute(e,!0))})),document.addEventListener("focusout",(i=>{i.target&&(i.target.classList.remove(t),i.target.setAttribute(e,!1))}))}}new i;const n=()=>{"undefined"==typeof window||window.BOOTSTRAP_ITALIA_VERSION||(new i,window.BOOTSTRAP_ITALIA_VERSION="2.13.3")};n();const s={ck3:{}},r={rememberChoice:(e,t)=>{s.ck3[e]=t,localStorage.setItem("bs-ck3",JSON.stringify(s.ck3))},isChoiceRemembered:e=>(s.ck3=JSON.parse(localStorage.getItem("bs-ck3")||"{}"),s.ck3[e]||!1),clearAllRememberedChoices:()=>{localStorage.removeItem("bs-ck3")}},a="splide",o=`data-${a}`,l={CREATED:1,MOUNTED:2,IDLE:3,MOVING:4,DESTROYED:5};function u(e){e.length=0}function c(e){return!f(e)&&"object"==typeof e}function d(e){return Array.isArray(e)}function h(e){return"string"==typeof e}function p(e){return void 0===e}function f(e){return null===e}function m(e){return e instanceof HTMLElement}function g(e){return d(e)?e:[e]}function y(e,t){g(e).forEach(t)}function _(e,t){return e.indexOf(t)>-1}function v(e,t){return e.push(...g(t)),e}const b=Array.prototype;function T(e,t,i){return b.slice.call(e,t,i)}function w(e,t,i){e&&y(t,(t=>{t&&e.classList[i?"add":"remove"](t)}))}function S(e,t){w(e,h(t)?t.split(" "):t,!0)}function E(e,t){y(t,e.appendChild.bind(e))}function C(e,t){y(e,(e=>{const i=t.parentNode;i&&i.insertBefore(e,t)}))}function k(e,t){return m(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function x(e,t){return e?T(e.children).filter((e=>k(e,t))):[]}function I(e,t){return t?x(e,t)[0]:e.firstElementChild}function A(e,t,i){if(e){let n=Object.keys(e);n=i?n.reverse():n;for(let i=0;i<n.length;i++){const s=n[i];if("__proto__"!==s&&!1===t(e[s],s))break}}return e}function O(e){return T(arguments,1).forEach((t=>{A(t,((i,n)=>{e[n]=t[n]}))})),e}function L(e,t){return A(t,((t,i)=>{d(t)?e[i]=t.slice():c(t)?e[i]=L(c(e[i])?e[i]:{},t):e[i]=t})),e}function P(e,t){e&&y(t,(t=>{e.removeAttribute(t)}))}function D(e,t,i){c(t)?A(t,((t,i)=>{D(e,i,t)})):f(i)?P(e,t):e.setAttribute(t,String(i))}function M(e,t,i){const n=document.createElement(e);return t&&(h(t)?S(n,t):D(n,t)),i&&E(i,n),n}function N(e,t,i){if(p(i))return getComputedStyle(e)[t];if(!f(i)){const{style:n}=e;i=`${i}`,n[t]!==i&&(n[t]=i)}}function R(e,t){N(e,"display",t)}function U(e,t){return e.getAttribute(t)}function F(e,t){return e&&e.classList.contains(t)}function B(e){return e.getBoundingClientRect()}function j(e){y(e,(e=>{e&&e.parentNode&&e.parentNode.removeChild(e)}))}function $(e){return I((new DOMParser).parseFromString(e,"text/html").body)}function q(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function V(e,t){return e&&e.querySelector(t)}function H(e,t){return T(e.querySelectorAll(t))}function z(e,t){w(e,t,!1)}function W(e){return h(e)?e:e?`${e}px`:""}function G(e,t=""){if(!e)throw new Error(`[${a}] ${t}`)}function X(e){setTimeout(e)}const K=()=>{};function Y(e){return requestAnimationFrame(e)}const{min:Q,max:J,floor:Z,ceil:ee,abs:te}=Math;function ie(e,t,i,n){const s=Q(t,i),r=J(t,i);return n?s<e&&e<r:s<=e&&e<=r}function ne(e,t,i){const n=Q(t,i),s=J(t,i);return Q(J(n,e),s)}function se(e){return+(e>0)-+(e<0)}function re(e,t){return y(t,(t=>{e=e.replace("%s",`${t}`)})),e}function ae(e){return e<10?`0${e}`:`${e}`}const oe={};const le="mounted",ue="ready",ce="move",de="moved",he="shifted",pe="click",fe="visible",me="hidden",ge="slide:keydown",ye="refresh",_e="updated",ve="resize",be="resized",Te="repositioned",we="scroll",Se="scrolled",Ee="destroy",Ce="navigation:mounted",ke="lazyload:loaded";function xe(e){const{event:t}=e,i={};let n=[];function s(e,t,i){r(e,t,((e,t)=>{n=n.filter((n=>!!(n[0]!==e||n[1]!==t||i&&n[2]!==i)||(e.removeEventListener(t,n[2],n[3]),!1)))}))}function r(e,t,i){y(e,(e=>{e&&t.split(" ").forEach(i.bind(null,e))}))}function a(){n=n.filter((e=>s(e[0],e[1]))),t.offBy(i)}return t.on(Ee,a,i),{on:function(e,n,s){t.on(e,n,i,s)},off:function(e){t.off(e,i)},emit:t.emit,bind:function(e,t,i,s){r(e,t,((e,t)=>{n.push([e,t,i,s]),e.addEventListener(t,i,s)}))},unbind:s,destroy:a}}function Ie(e,t,i,n){const{now:s}=Date;let r,a,o=0,l=!0,u=0;function c(){if(!l){const a=s()-r;if(a>=e?(o=1,r=s()):o=a/e,i&&i(o),1===o&&(t(),n&&++u>=n))return d();Y(c)}}function d(){l=!0}function h(){cancelAnimationFrame(a),o=0,a=0,l=!0}return{start:function(t){!t&&h(),r=s()-(t?o*e:0),l=!1,Y(c)},rewind:function(){r=s(),o=0,i&&i(o)},pause:d,cancel:h,set:function(t){e=t},isPaused:function(){return l}}}function Ae(e,t){let i;return function(){i||(i=Ie(0,(()=>{e.apply(this,arguments),i=null}),null,1),i.start())}}const Oe="ttb",Le={marginRight:["marginBottom","marginLeft"],autoWidth:["autoHeight"],fixedWidth:["fixedHeight"],paddingLeft:["paddingTop","paddingRight"],paddingRight:["paddingBottom","paddingLeft"],width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:["ArrowUp","ArrowRight"],ArrowRight:["ArrowDown","ArrowLeft"]};const Pe=a,De=`${a}__slider`,Me=`${a}__track`,Ne=`${a}__list`,Re=`${a}__slide`,Ue=`${Re}--clone`,Fe=`${Re}__container`,Be=`${a}__arrows`,je=`${a}__arrow`,$e=`${je}--prev`,qe=`${je}--next`,Ve=`${a}__pagination`,He=`${a}__progress`,ze=`${He}__bar`,We=`${a}__autoplay`,Ge=`${a}__play`,Xe=`${a}__pause`,Ke="is-active",Ye="is-prev",Qe="is-next",Je="is-visible",Ze="is-loading",et=[Ke,Je,Ye,Qe,Ze],tt={slide:Re,clone:Ue,arrows:Be,arrow:je,prev:$e,next:qe,pagination:Ve,page:`${Ve}__page`,spinner:`${a}__spinner`};const it="role",nt="aria-controls",st="aria-current",rt="aria-label",at="aria-hidden",ot="tabindex",lt="aria-orientation",ut=[it,nt,st,rt,at,lt,ot,"disabled"],ct="slide",dt="loop",ht="fade";function pt(e,t,i,n){const{on:s,emit:r,bind:a,destroy:o}=xe(e),{Components:l,root:u,options:c}=e,{isNavigation:d,updateOnMove:h}=c,{resolve:p}=l.Direction,f=U(n,"style"),m=i>-1,g=I(n,`.${Fe}`),y=c.focusableNodes&&H(n,c.focusableNodes);let _;function v(){const s=m?i:t,r=re(c.i18n.slideX,s+1),a=e.splides.map((e=>e.splide.root.id)).join(" ");D(n,rt,r),D(n,nt,a),D(n,it,"menuitem"),S(E())}function b(){_||T()}function T(){if(!_){const{index:i}=e;S(E()),function(e){const t=!e&&(!E()||m);D(n,at,t||null),D(n,ot,!t&&c.slideFocus?0:null),y&&y.forEach((e=>{D(e,ot,t?-1:null)}));e!==F(n,Je)&&(w(n,Je,e),r(e?fe:me,C))}(function(){if(e.is(ht))return E();const t=B(l.Elements.track),i=B(n),s=p("left"),r=p("right");return Z(t[s])<=ee(i[s])&&Z(i[r])<=ee(t[r])}()),w(n,Ye,t===i-1),w(n,Qe,t===i+1)}}function S(e){e!==F(n,Ke)&&(w(n,Ke,e),d&&D(n,st,e||null),r(e?"active":"inactive",C))}function E(){const{index:n}=e;return n===t||c.cloneStatus&&n===i}const C={index:t,slideIndex:i,slide:n,container:g,isClone:m,mount:function(){m||(n.id=`${u.id}-slide${ae(t+1)}`),a(n,"click keydown",(e=>{r("click"===e.type?pe:ge,C,e)})),s([ye,Te,he,de,Se],T),s(Ce,v),h&&s(ce,b)},destroy:function(){_=!0,o(),z(n,et),P(n,ut),D(n,"style",f)},update:T,style:function(e,t,i){N(i&&g||n,e,t)},isWithin:function(i,n){let s=te(i-t);return m||!c.rewind&&!e.is(dt)||(s=Q(s,e.length-s)),s<=n}};return C}const ft=`${o}-interval`;const mt={passive:!1,capture:!0},gt="touchmove mousemove",yt="touchend touchcancel mouseup";const _t=["Left","Right","Up","Down"],vt="keydown";const bt=`${o}-lazy`,Tt=`${bt}-srcset`,wt=`[${bt}], [${Tt}]`;const St=[" ","Enter","Spacebar"];var Et=Object.freeze({__proto__:null,Options:function(e,t,i){const n=Ae(u);let s,r,a;function l(e){e&&removeEventListener("resize",n)}function u(){const t=(n=e=>e[1].matches,T(r).filter(n)[0]||[]);var n;t[0]!==a&&function(t){const n=i.breakpoints[t]||s;n.destroy?(e.options=s,e.destroy("completely"===n.destroy)):(e.state.is(5)&&(l(!0),e.mount()),e.options=n)}(a=t[0])}return{setup:function(){try{L(i,JSON.parse(U(e.root,o)))}catch(e){G(!1,e.message)}s=L({},i);const{breakpoints:t}=i;if(t){const e="min"===i.mediaQuery;r=Object.keys(t).sort(((t,i)=>e?+i-+t:+t-+i)).map((t=>[t,matchMedia(`(${e?"min":"max"}-width:${t}px)`)])),u()}},mount:function(){r&&addEventListener("resize",n)},destroy:l}},Direction:function(e,t,i){return{resolve:function(e,t){const{direction:n}=i;return Le[e]["rtl"!==n||t?n===Oe?0:-1:1]||e},orient:function(e){return e*("rtl"===i.direction?1:-1)}}},Elements:function(e,t,i){const{on:n}=xe(e),{root:s}=e,r={},o=[];let l,c,d,h;function p(){!function(){c=I(s,`.${De}`),d=V(s,`.${Me}`),h=I(d,`.${Ne}`),G(d&&h,"A track/list element is missing."),v(o,x(h,`.${Re}:not(.${Ue})`));const e=y(`.${We}`),t=y(`.${Be}`);O(r,{root:s,slider:c,track:d,list:h,slides:o,arrows:t,autoplay:e,prev:V(t,`.${$e}`),next:V(t,`.${qe}`),bar:V(y(`.${He}`),`.${ze}`),play:V(e,`.${Ge}`),pause:V(e,`.${Xe}`)})}(),function(){const e=s.id||(t=a,`${t}${ae(oe[t]=(oe[t]||0)+1)}`);var t;s.id=e,d.id=d.id||`${e}-track`,h.id=h.id||`${e}-list`}(),S(s,l=_())}function f(){[s,d,h].forEach((e=>{P(e,"style")})),u(o),z(s,l)}function m(){f(),p()}function g(){z(s,l),S(s,l=_())}function y(e){return I(s,e)||I(c,e)}function _(){return[`${Pe}--${i.type}`,`${Pe}--${i.direction}`,i.drag&&`${Pe}--draggable`,i.isNavigation&&`${Pe}--nav`,Ke]}return O(r,{setup:p,mount:function(){n(ye,m,8),n(_e,g)},destroy:f})},Slides:function(e,t,i){const{on:n,emit:s,bind:r}=xe(e),{slides:a,list:o}=t.Elements,l=[];function c(){a.forEach(((e,t)=>{f(e,t,-1)}))}function d(){b((e=>{e.destroy()})),u(l)}function p(){d(),c()}function f(t,i,n){const s=pt(e,i,n,t);s.mount(),l.push(s)}function v(e){return e?T((e=>!e.isClone)):l}function b(e,t){v(t).forEach(e)}function T(e){return l.filter("function"==typeof e?e:t=>h(e)?k(t.slide,e):_(g(e),t.index))}return{mount:function(){c(),n(ye,p),n([le,ye],(()=>{l.sort(((e,t)=>e.index-t.index))}))},destroy:d,update:function(){b((e=>{e.update()}))},register:f,get:v,getIn:function(e){const{Controller:n}=t,s=n.toIndex(e),r=n.hasFocus()?1:i.perPage;return T((e=>ie(e.index,s,s+r-1)))},getAt:function(e){return T(e)[0]},add:function(e,t){y(e,(e=>{if(h(e)&&(e=$(e)),m(e)){const n=a[t];n?C(e,n):E(o,e),S(e,i.classes.slide),function(e,t){const i=H(e,"img");let{length:n}=i;n?i.forEach((e=>{r(e,"load error",(()=>{--n||t()}))})):t()}(e,s.bind(null,ve))}})),s(ye)},remove:function(e){j(T(e).map((e=>e.slide))),s(ye)},forEach:b,filter:T,style:function(e,t,i){b((n=>{n.style(e,t,i)}))},getLength:function(e){return e?a.length:l.length},isEnough:function(){return l.length>i.perPage}}},Layout:function(e,t,i){const{on:n,bind:s,emit:r}=xe(e),{Slides:a}=t,{resolve:o}=t.Direction,{root:l,track:u,list:d}=t.Elements,{getAt:h}=a;let p,f;function m(){f=null,p=i.direction===Oe,N(l,"maxWidth",W(i.width)),N(u,o("paddingLeft"),y(!1)),N(u,o("paddingRight"),y(!0)),g()}function g(){const e=B(l);f&&f.width===e.width&&f.height===e.height||(N(u,"height",function(){let e="";p&&(e=_(),G(e,"height or heightRatio is missing."),e=`calc(${e} - ${y(!1)} - ${y(!0)})`);return e}()),a.style(o("marginRight"),W(i.gap)),a.style("width",(i.autoWidth?"":W(i.fixedWidth)||(p?"":v()))||null),a.style("height",W(i.fixedHeight)||(p?i.autoHeight?"":v():_())||null,!0),f=e,r(be))}function y(e){const{padding:t}=i,n=o(e?"right":"left");return t&&W(t[n]||(c(t)?0:t))||"0px"}function _(){return W(i.height||B(d).width*i.heightRatio)}function v(){const e=W(i.gap);return`calc((100%${e&&` + ${e}`})/${i.perPage||1}${e&&` - ${e}`})`}function b(e,t){const i=h(e);if(i){const e=B(i.slide)[o("right")],n=B(d)[o("left")];return te(e-n)+(t?0:T())}return 0}function T(){const e=h(0);return e&&parseFloat(N(e.slide,o("marginRight")))||0}return{mount:function(){m(),s(window,"resize load",Ae(r.bind(this,ve))),n([_e,ye],m),n(ve,g)},listSize:function(){return B(d)[o("width")]},slideSize:function(e,t){const i=h(e||0);return i?B(i.slide)[o("width")]+(t?0:T()):0},sliderSize:function(){return b(e.length-1,!0)-b(-1,!0)},totalSize:b,getPadding:function(e){return parseFloat(N(u,o("padding"+(e?"Right":"Left"))))||0}}},Clones:function(e,t,i){const{on:n,emit:s}=xe(e),{Elements:r,Slides:a}=t,{resolve:o}=t.Direction,l=[];let c;function d(){(c=g())&&(!function(t){const n=a.get().slice(),{length:s}=n;if(s){for(;n.length<t;)v(n,n);v(n.slice(-t),n.slice(0,t)).forEach(((o,u)=>{const c=u<t,d=function(t,n){const s=t.cloneNode(!0);return S(s,i.classes.clone),s.id=`${e.root.id}-clone${ae(n+1)}`,s}(o.slide,u);c?C(d,n[0].slide):E(r.list,d),v(l,d),a.register(d,u-t+(c?0:s),o.index)}))}}(c),s(ve))}function p(){j(l),u(l)}function f(){p(),d()}function m(){c<g()&&s(ye)}function g(){let{clones:t}=i;if(e.is(dt)){if(!t){const n=function(e,t){if(h(t)){const i=M("div",{style:`width: ${t}; position: absolute;`},e);t=B(i).width,j(i)}return t}(r.list,i[o("fixedWidth")]);t=(n&&ee(B(r.track)[o("width")]/n)||i[o("autoWidth")]&&e.length||i.perPage)*(i.drag?(i.flickMaxPages||1)+1:2)}}else t=0;return t}return{mount:function(){d(),n(ye,f),n([_e,ve],m)},destroy:p}},Move:function(e,t,i){const{on:n,emit:s}=xe(e),{slideSize:r,getPadding:a,totalSize:o,listSize:l,sliderSize:u}=t.Layout,{resolve:c,orient:d}=t.Direction,{list:h,track:f}=t.Elements;let m;function g(){S()||(t.Scroll.cancel(),y(e.index),s(Te))}function y(e){_(b(e,!0))}function _(t,i){if(!e.is(ht)){const n=i?t:function(t){if(e.is(dt)){const e=d(t-T()),i=E(!1,t)&&e<0,n=E(!0,t)&&e>0;(i||n)&&(t=v(t,n))}return t}(t);h.style.transform=`translate${c("X")}(${n}px)`,t!==n&&s(he)}}function v(e,t){const i=e-w(t),n=u();return e-=d(n*(ee(te(i)/n)||1))*(t?1:-1)}function b(t,n){const s=d(o(t-1)-function(e){const{focus:t}=i;return"center"===t?(l()-r(e,!0))/2:+t*r(e)||0}(t));return n?function(t){i.trimSpace&&e.is(ct)&&(t=ne(t,0,d(u()-l())));return t}(s):s}function T(){const e=c("left");return B(h)[e]-B(f)[e]+d(a(!1))}function w(e){return b(e?t.Controller.getEnd():0,!!i.trimSpace)}function S(){return e.state.is(4)&&i.waitForTransition}function E(e,t){t=p(t)?T():t;const i=!0!==e&&d(t)<d(w(!1)),n=!1!==e&&d(t)>d(w(!0));return i||n}return{mount:function(){m=t.Transition,n([le,be,_e,ye],g)},destroy:function(){P(h,"style")},move:function(n,r,a,o){if(!S()){const{set:l}=e.state,u=T();n!==r&&(m.cancel(),_(v(u,n>r),!0)),l(4),s(ce,r,a,n),m.start(r,(()=>{l(3),s(de,r,a,n),"move"===i.trimSpace&&n!==a&&u===T()?t.Controller.go(n>a?">":"<",!1,o):o&&o()}))}},jump:y,translate:_,shift:v,cancel:function(){_(T()),m.cancel()},toIndex:function(e){const i=t.Slides.get();let n=0,s=1/0;for(let t=0;t<i.length;t++){const r=i[t].index,a=te(b(r,!0)-e);if(!(a<=s))break;s=a,n=r}return n},toPosition:b,getPosition:T,getLimit:w,isBusy:S,exceededLimit:E}},Controller:function(e,t,i){const{on:n}=xe(e),{Move:s}=t,{getPosition:r,getLimit:a}=s,{isEnough:o,getLength:l}=t.Slides,u=e.is(dt),c=e.is(ct);let d,f,m,g=i.start||0,y=g;function _(){d=l(!0),f=i.perMove,m=i.perPage,g=ne(g,0,d-1)}function v(e,i,n,r,a){const o=i?e:I(e);t.Scroll.scroll(i||n?s.toPosition(o,!0):e,r,(()=>{A(s.toIndex(s.getPosition())),a&&a()}))}function b(e){return w(!1,e)}function T(e){return w(!0,e)}function w(e,t){const i=f||(O()?1:m),n=S(g+i*(e?-1:1),g);return-1!==n||!c||(s=r(),o=a(!e),l=1,te(s-o)<l)?t?n:C(n):e?0:E();var s,o,l}function S(e,t,n){if(o()){const s=E();e<0||e>s?e=ie(0,e,t,!0)||ie(s,t,e,!0)?k(x(e)):u?f||O()?e:e<0?-(d%m||m):d:i.rewind?e<0?s:0:-1:n||e===t||(e=f?e:k(x(t)+(e<t?-1:1)))}else e=-1;return e}function E(){let e=d-m;return(O()||u&&f)&&(e=d-1),J(e,0)}function C(e){return u?o()?e%d+(e<0?d:0):-1:e}function k(e){return ne(O()?e:m*e,0,E())}function x(e){return O()||(e=ie(e,d-m,d-1)?d-1:e,e=Z(e/m)),e}function I(e){const t=s.toIndex(e);return c?ne(t,0,E()):t}function A(e){e!==g&&(y=g,g=e)}function O(){return!p(i.focus)||i.isNavigation}return{mount:function(){_(),n([_e,ye],_,9)},go:function(e,t,n){const r=function(e){let t=g;if(h(e)){const[,i,n]=e.match(/([+\-<>])(\d+)?/)||[];"+"===i||"-"===i?t=S(g+ +`${i}${+n||1}`,g,!0):">"===i?t=n?k(+n):b(!0):"<"===i&&(t=T(!0))}else t=u?e:ne(e,0,E());return t}(e);if(i.useScroll)v(r,!0,!0,i.speed,n);else{const e=C(r);e>-1&&!s.isBusy()&&(t||e!==g)&&(A(e),s.move(r,e,y,n))}},scroll:v,getNext:b,getPrev:T,getAdjacent:w,getEnd:E,setIndex:A,getIndex:function(e){return e?y:g},toIndex:k,toPage:x,toDest:I,hasFocus:O}},Arrows:function(e,t,i){const{on:n,bind:s,emit:r}=xe(e),{classes:a,i18n:o}=i,{Elements:l,Controller:u}=t;let c,d=l.arrows,h=l.prev,p=l.next;const f={};function m(){if(i.arrows&&(h&&p||(d=M("div",a.arrows),h=g(!0),p=g(!1),c=!0,E(d,[h,p]),C(d,I("slider"===i.arrows&&l.slider||e.root)))),h&&p)if(f.prev)R(d,!1===i.arrows?"none":"");else{const{id:e}=l.track;D(h,nt,e),D(p,nt,e),f.prev=h,f.next=p,function(){const{go:e}=u;n([le,de,_e,ye,Se],y),s(p,"click",(()=>{e(">",!0)})),s(h,"click",(()=>{e("<",!0)}))}(),r("arrows:mounted",h,p)}}function g(e){return $(`<button class="${a.arrow} ${e?a.prev:a.next}" type="button"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40"><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 y(){const t=e.index,i=u.getPrev(),n=u.getNext(),s=i>-1&&t<i?o.last:o.prev,a=n>-1&&t>n?o.first:o.next;h.disabled=i<0,p.disabled=n<0,D(h,rt,s),D(p,rt,a),r("arrows:updated",h,p,i,n)}return{arrows:f,mount:function(){m(),n(_e,m)},destroy:function(){c?j(d):(P(h,ut),P(p,ut))}}},Autoplay:function(e,t,i){const{on:n,bind:s,emit:r}=xe(e),a=Ie(i.interval,e.go.bind(e,">"),(function(e){const{bar:t}=l;t&&N(t,"width",100*e+"%"),r("autoplay:playing",e)})),{isPaused:o}=a,{Elements:l}=t;let u,c,d;function h(e){const t=e?"pause":"play",n=l[t];n&&(D(n,nt,l.track.id),D(n,rt,i.i18n[t]),s(n,"click",e?f:p))}function p(){o()&&t.Slides.isEnough()&&(a.start(!i.resetProgress),c=u=d=!1,r("autoplay:play"))}function f(e=!0){o()||(a.pause(),r("autoplay:pause")),d=e}function m(){d||(u||c?f(!1):p())}function g(){const n=t.Slides.getAt(e.index);a.set(n&&+U(n.slide,ft)||i.interval)}return{mount:function(){const{autoplay:e}=i;e&&(h(!0),h(!1),function(){const{root:e}=l;i.pauseOnHover&&s(e,"mouseenter mouseleave",(e=>{u="mouseenter"===e.type,m()}));i.pauseOnFocus&&s(e,"focusin focusout",(e=>{c="focusin"===e.type,m()}));n([ce,we,ye],a.rewind),n(ce,g)}(),"pause"!==e&&p())},destroy:a.cancel,play:p,pause:f,isPaused:o}},Cover:function(e,t,i){const{on:n}=xe(e);function s(e){t.Slides.forEach((t=>{const i=I(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),R(t,e?"none":"")}return{mount:function(){i.cover&&(n(ke,((e,t)=>{r(!0,e,t)})),n([le,_e,ye],s.bind(null,!0)))},destroy:function(){s(!1)}}},Scroll:function(e,t,i){const{on:n,emit:s}=xe(e),{Move:r}=t,{getPosition:a,getLimit:o,exceededLimit:l}=r;let u,c;function d(t,n,f,m){const g=a();let y=1;var _;n=n||(_=te(t-g),J(_/1.5,800)),c=f,p(),u=Ie(n,h,(n=>{const s=a(),u=(g+(t-g)*function(e){const{easingFunc:t}=i;return t?t(e):1-Math.pow(1-e,4)}(n)-a())*y;var c;r.translate(s+u),e.is(ct)&&!m&&l()&&(y*=.6,te(u)<10&&(c=l(!1),d(o(!c),600,null,!0)))}),1),s(we),u.start()}function h(){const t=a(),i=r.toIndex(t);ie(i,0,e.length-1)||r.translate(r.shift(t,i>0),!0),c&&c(),s(Se)}function p(){u&&u.cancel()}function f(){u&&!u.isPaused()&&(p(),h())}return{mount:function(){n(ce,p),n([_e,ye],f)},destroy:p,scroll:d,cancel:f}},Drag:function(e,t,i){const{on:n,emit:s,bind:r,unbind:a}=xe(e),{Move:o,Scroll:l,Controller:u}=t,{track:d}=t.Elements,{resolve:h,orient:p}=t.Direction,{getPosition:f,exceededLimit:m}=o;let g,y,_,v,b,T,w,S,E,C=!1;function x(){const{drag:e}=i;U(!e),b="free"===e}function I(e){if(!S){const{noDrag:t}=i,n=R(e),s=!t||!k(e.target,t);w=!1,!s||!n&&e.button||(o.isBusy()?q(e,!0):(E=n?d:window,_=null,v=null,r(E,gt,A,mt),r(E,yt,O,mt),o.cancel(),l.cancel(),L(e)))}}function A(t){if(v||s("drag"),v=t,t.cancelable){const n=M(t)-M(y);if(T){o.translate(g+function(t){return t/(C&&e.is(ct)?5:1)}(n));const i=N(t)-N(y)>200,r=C!==(C=m());(i||r)&&L(t),s("dragging"),w=!0,q(t)}else{let{dragMinThreshold:e}=i;e=c(e)?e:{mouse:0,touch:+e||10},T=te(n)>(R(t)?e.touch:e.mouse),D()&&q(t)}}}function O(n){a(E,gt,A),a(E,yt,O);const{index:r}=e;if(v){if(T||n.cancelable&&D()){const s=function(t){if(e.is(dt)||!C){const e=y===v&&_||y,i=M(v)-M(e),n=N(t)-N(e),s=N(t)-N(v)<200;if(n&&s)return i/n}return 0}(n),a=function(e){return f()+se(e)*Q(te(e)*(i.flickPower||600),b?1/0:t.Layout.listSize()*(i.flickMaxPages||1))}(s);b?u.scroll(a):e.is(ht)?u.go(r+p(se(s))):u.go(u.toDest(a),!0),q(n)}s("dragged")}else b||f()===o.toPosition(r)||u.go(r,!0);T=!1}function L(e){_=y,y=e,g=f()}function P(e){!S&&w&&q(e,!0)}function D(){return te(M(v)-M(y))>te(M(v,!0)-M(y,!0))}function M(e,t){return(R(e)?e.touches[0]:e)[`page${h(t?"Y":"X")}`]}function N(e){return e.timeStamp}function R(e){return"undefined"!=typeof TouchEvent&&e instanceof TouchEvent}function U(e){S=e}return{mount:function(){r(d,gt,K,mt),r(d,yt,K,mt),r(d,"touchstart mousedown",I,mt),r(d,"click",P,{capture:!0}),r(d,"dragstart",q),n([le,_e],x)},disable:U,isDragging:function(){return T}}},Keyboard:function(e,t,i){const{on:n,bind:s,unbind:r}=xe(e),{root:a}=e,{resolve:o}=t.Direction;let l,u;function c(){const{keyboard:e}=i;e&&("focused"===e?(l=a,D(a,ot,0)):l=window,s(l,vt,f))}function d(){r(l,vt),m(l)&&P(l,ot)}function h(){const e=u;u=!0,X((()=>{u=e}))}function p(){d(),c()}function f(t){if(!u){const{key:i}=t,n=_(_t,i)?`Arrow${i}`:i;n===o("ArrowLeft")?e.go("<"):n===o("ArrowRight")&&e.go(">")}}return{mount:function(){c(),n(_e,p),n(ce,h)},destroy:d,disable:function(e){u=e}}},LazyLoad:function(e,t,i){const{on:n,off:s,bind:r,emit:a}=xe(e),o="sequential"===i.lazyLoad;let l=[],u=0;function c(){h(),d()}function d(){t.Slides.forEach((e=>{H(e.slide,wt).forEach((t=>{const n=U(t,bt),s=U(t,Tt);if(n!==t.src||s!==t.srcset){const r=i.classes.spinner,a=t.parentElement,o=I(a,`.${r}`)||M("span",r,a);D(o,it,"presentation"),l.push({_img:t,_Slide:e,src:n,srcset:s,_spinner:o}),!t.src&&R(t,"none")}}))})),o&&m()}function h(){u=0,l=[]}function p(){l=l.filter((t=>{const n=i.perPage*((i.preloadPages||1)+1)-1;return!t._Slide.isWithin(e.index,n)||f(t)})),l.length||s(de)}function f(e){const{_img:t}=e;S(e._Slide.slide,Ze),r(t,"load error",(t=>{!function(e,t){const{_Slide:i}=e;z(i.slide,Ze),t||(j(e._spinner),R(e._img,""),a(ke,e._img,i),a(ve));o&&m()}(e,"error"===t.type)})),["srcset","src"].forEach((i=>{e[i]&&(D(t,i,e[i]),P(t,"src"===i?bt:Tt))}))}function m(){u<l.length&&f(l[u++])}return{mount:function(){i.lazyLoad&&(d(),n(ye,c),o||n([le,ye,de,Se],p))},destroy:h}},Pagination:function(e,t,i){const{on:n,emit:s,bind:r,unbind:a}=xe(e),{Slides:o,Elements:l,Controller:c}=t,{hasFocus:d,getIndex:h}=c,p=[];let f;function m(){g(),i.pagination&&o.isEnough()&&(!function(){const{length:t}=e,{classes:n,i18n:s,perPage:a}=i,u="slider"===i.pagination&&l.slider||l.root,c=d()?t:ee(t/a);f=M("ul",n.pagination,u);for(let e=0;e<c;e++){const t=M("li",null,f),i=M("button",{class:n.page,type:"button"},t),l=o.getIn(e).map((e=>e.slide.id)),u=!d()&&a>1?s.pageX:s.slideX;r(i,"click",y.bind(null,e)),D(i,nt,l.join(" ")),D(i,rt,re(u,e+1)),p.push({li:t,button:i,page:e})}}(),s("pagination:mounted",{list:f,items:p},_(e.index)),v())}function g(){f&&(j(f),p.forEach((e=>{a(e.button,"click")})),u(p),f=null)}function y(e){c.go(`>${e}`,!0,(()=>{const t=o.getAt(c.toIndex(e));var i;t&&((i=t.slide).setActive&&i.setActive()||i.focus({preventScroll:!0}))}))}function _(e){return p[c.toPage(e)]}function v(){const e=_(h(!0)),t=_(h());e&&(z(e.button,Ke),P(e.button,st)),t&&(S(t.button,Ke),D(t.button,st,!0)),s("pagination:updated",{list:f,items:p},e,t)}return{items:p,mount:function(){m(),n([_e,ye],m),n([ce,Se],v)},destroy:g,getAt:_,update:v}},Sync:function(e,t,i){const{list:n}=t.Elements,s=[];function r(){e.splides.forEach((t=>{var i;!t.isParent&&(i=t.splide,[e,i].forEach((t=>{const n=xe(t),r=t===e?i:e;n.on(ce,((e,t,i)=>{r.go(r.is(dt)?i:e)})),s.push(n)})))})),i.isNavigation&&function(){const t=xe(e),{on:i}=t;i(pe,l),i(ge,c),i([le,_e],o),D(n,it,"menu"),s.push(t),t.emit(Ce,e.splides)}()}function a(){P(n,ut),s.forEach((e=>{e.destroy()})),u(s)}function o(){D(n,lt,i.direction!==Oe?"horizontal":null)}function l(t){e.go(t.index)}function c(e,t){_(St,t.key)&&(l(e),q(t))}return{mount:r,destroy:a,remount:function(){a(),r()}}},Wheel:function(e,t,i){const{bind:n}=xe(e);function s(n){if(n.cancelable){const{deltaY:s}=n;if(s){const r=s<0;e.go(r?"<":">"),function(n){return!i.releaseWheel||e.state.is(4)||-1!==t.Controller.getAdjacent(n)}(r)&&q(n)}}}return{mount:function(){i.wheel&&n(t.Elements.track,"wheel",s,mt)}}}});const Ct={type:"slide",speed:400,waitForTransition:!0,perPage:1,cloneStatus:!0,arrows:!0,pagination:!0,interval:5e3,pauseOnHover:!0,pauseOnFocus:!0,resetProgress:!0,keyboard:!0,easing:"cubic-bezier(0.25, 1, 0.5, 1)",drag:!0,direction:"ltr",slideFocus:!0,trimSpace:!0,focusableNodes:"a, button, textarea, input, select, iframe",classes:tt,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"}};function kt(e,t,i){const{on:n}=xe(e);return{mount:function(){n([le,ye],(()=>{X((()=>{t.Slides.style("transition",`opacity ${i.speed}ms ${i.easing}`)}))}))},start:function(e,i){const{track:n}=t.Elements;N(n,"height",W(B(n).height)),X((()=>{i(),N(n,"height","")}))},cancel:K}}function xt(e,t,i){const{bind:n}=xe(e),{Move:s,Controller:r}=t,{list:a}=t.Elements;let o;function l(){u("")}function u(e){N(a,"transition",e)}return{mount:function(){n(a,"transitionend",(e=>{e.target===a&&o&&(l(),o())}))},start:function(t,n){const a=s.toPosition(t,!0),l=s.getPosition(),c=function(t){const{rewindSpeed:n}=i;if(e.is(ct)&&n){const e=r.getIndex(!0),i=r.getEnd();if(0===e&&t>=i||e>=i&&0===t)return n}return i.speed}(t);te(a-l)>=1&&c>=1?(u(`transform ${c}ms ${i.easing}`),s.translate(a,!0),o=n):(s.jump(t),n())},cancel:l}}const It=class{constructor(e,t){this.event=function(){let e={};function t(t,n){i(t,((t,i)=>{const s=e[t];e[t]=s&&s.filter((e=>e._key?e._key!==n:n||e._namespace!==i))}))}function i(e,t){g(e).join(" ").split(" ").forEach((e=>{const i=e.split(".");t(i[0],i[1])}))}return{on:function(t,n,s,r=10){i(t,((t,i)=>{e[t]=e[t]||[],v(e[t],{_event:t,_callback:n,_namespace:i,_priority:r,_key:s}).sort(((e,t)=>e._priority-t._priority))}))},off:t,offBy:function(i){A(e,((e,n)=>{t(n,i)}))},emit:function(t){(e[t]||[]).forEach((e=>{e._callback.apply(e,T(arguments,1))}))},destroy:function(){e={}}}}(),this.Components={},this.state=function(e){let t=e;return{set:function(e){t=e},is:function(e){return _(g(e),t)}}}(1),this.splides=[],this._options={},this._Extensions={};const i=h(e)?V(document,e):e;G(i,`${i} is invalid.`),this.root=i,L(Ct,It.defaults),L(L(this._options,Ct),t||{})}mount(e,t){const{state:i,Components:n}=this;G(i.is([1,5]),"Already mounted!"),i.set(1),this._Components=n,this._Transition=t||this._Transition||(this.is(ht)?kt:xt),this._Extensions=e||this._Extensions;return A(O({},Et,this._Extensions,{Transition:this._Transition}),((e,t)=>{const i=e(this,n,this._options);n[t]=i,i.setup&&i.setup()})),A(n,(e=>{e.mount&&e.mount()})),this.emit(le),S(this.root,"is-initialized"),i.set(3),this.emit(ue),this}sync(e){return this.splides.push({splide:e}),e.splides.push({splide:this,isParent:!0}),this.state.is(3)&&(this._Components.Sync.remount(),e.Components.Sync.remount()),this}go(e){return this._Components.Controller.go(e),this}on(e,t){return this.event.on(e,t,null,20),this}off(e){return this.event.off(e),this}emit(e){return this.event.emit(e,...T(arguments,1)),this}add(e,t){return this._Components.Slides.add(e,t),this}remove(e){return this._Components.Slides.remove(e),this}is(e){return this._options.type===e}refresh(){return this.emit(ye),this}destroy(e=!0){const{event:t,state:i}=this;return i.is(1)?t.on(ue,this.destroy.bind(this,e),this):(A(this._Components,(t=>{t.destroy&&t.destroy(e)}),!0),t.emit(Ee),t.destroy(),e&&u(this.splides),i.set(5)),this}get options(){return this._options}set options(e){const{_options:t}=this;L(t,e),this.state.is(1)||this.emit(_e,t)}get length(){return this._Components.Slides.getLength(!0)}get index(){return this._Components.Controller.getIndex()}};let At=It;At.defaults={},At.STATES=l;const Ot=new Map,Lt={set(e,t,i){Ot.has(e)||Ot.set(e,new Map);const n=Ot.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)=>Ot.has(e)&&Ot.get(e).get(t)||null,remove(e,t){if(!Ot.has(e))return;const i=Ot.get(e);i.delete(t),0===i.size&&Ot.delete(e)}},Pt="transitionend",Dt=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},Mt=e=>{const t=Dt(e);return t&&document.querySelector(t)?t:null},Nt=e=>{const t=Dt(e);return t?document.querySelector(t):null},Rt=e=>{e.dispatchEvent(new Event(Pt))},Ut=e=>!(!e||"object"!=typeof e)&&void 0!==e.nodeType,Ft=e=>Ut(e)?e:"string"==typeof e&&e.length>0?document.querySelector(e):null,Bt=e=>{if(!Ut(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},jt=e=>!e||e.nodeType!==Node.ELEMENT_NODE||(!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled"))),$t=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?$t(e.parentNode):null},qt=()=>{},Vt=e=>{e.offsetHeight},Ht=()=>"undefined"!=typeof window&&"undefined"!=typeof document&&"rtl"===document.documentElement.dir,zt=e=>{"function"==typeof e&&e()},Wt=(e,t,i=!0)=>{if(!i)return void zt(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(Pt,r),zt(e))};t.addEventListener(Pt,r),setTimeout((()=>{s||Rt(t)}),n)},Gt=(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))])},Xt=/[^.]*(?=\..*)\.|.*/,Kt=/\..*/,Yt=/::\d+$/,Qt={};let Jt=1;const Zt={mouseenter:"mouseover",mouseleave:"mouseout"},ei=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 ti(e,t){return t&&`${t}::${Jt++}`||e.uidEvent||Jt++}function ii(e){const t=ti(e);return e.uidEvent=t,Qt[t]=Qt[t]||{},Qt[t]}function ni(e,t,i=null){return Object.values(e).find((e=>e.callable===t&&e.delegationSelector===i))}function si(e,t,i){const n="string"==typeof t,s=n?i:t||i;let r=function(e){return e=e.replace(Kt,""),Zt[e]||e}(e);return ei.has(r)||(r=e),[n,s,r]}function ri(e,t,i,n,s){if("string"!=typeof t||!e)return;let[r,a,o]=si(t,i,n);if(t in Zt){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=ii(e),u=l[o]||(l[o]={}),c=ni(u,a,r?i:null);if(c)return void(c.oneOff=c.oneOff&&s);const d=ti(a,t.replace(Xt,"")),h=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&&li.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&&li.off(e,n.type,t),t.apply(e,[n])}}(e,a);h.delegationSelector=r?i:null,h.callable=a,h.oneOff=s,h.uidEvent=d,u[d]=h,e.addEventListener(o,h,r)}function ai(e,t,i,n,s){const r=ni(t[i],n,s);r&&(e.removeEventListener(i,r,Boolean(s)),delete t[i][r.uidEvent])}function oi(e,t,i,n){const s=t[i]||{};for(const r of Object.keys(s))if(r.includes(n)){const n=s[r];ai(e,t,i,n.callable,n.delegationSelector)}}const li={on(e,t,i,n){ri(e,t,i,n,!1)},one(e,t,i,n){ri(e,t,i,n,!0)},off(e,t,i,n){if("string"!=typeof t||!e)return;const[s,r,a]=si(t,i,n),o=a!==t,l=ii(e),u=l[a]||{},c=t.startsWith(".");if(void 0===r){if(c)for(const i of Object.keys(l))oi(e,l,i,t.slice(1));for(const i of Object.keys(u)){const n=i.replace(Yt,"");if(!o||t.includes(n)){const t=u[i];ai(e,l,a,t.callable,t.delegationSelector)}}}else{if(!Object.keys(u).length)return;ai(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 ci(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 di(e){return e.replace(/[A-Z]/g,(e=>`-${e.toLowerCase()}`))}const hi={setDataAttribute(e,t,i){e.setAttribute(`data-bs-${di(t)}`,i)},removeDataAttribute(e,t){e.removeAttribute(`data-bs-${di(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]=ci(e.dataset[n])}return t},getDataAttribute:(e,t)=>ci(e.getAttribute(`data-bs-${di(t)}`))};let pi=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=Ut(t)?hi.getDataAttribute(t,"config"):{};return{...this.constructor.Default,..."object"==typeof i?i:{},...Ut(t)?hi.getDataAttributes(t):{},..."object"==typeof e?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const n of Object.keys(t)){const s=t[n],r=e[n],a=Ut(r)?"element":null==(i=r)?`${i}`:Object.prototype.toString.call(i).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(s).test(a))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${n}" provided type "${a}" but expected type "${s}".`)}var i}};class fi extends pi{constructor(e,t){super(),(e=Ft(e))&&(this._element=e,this._config=this._getConfig(t),Lt.set(this._element,this.constructor.DATA_KEY,this))}dispose(){Lt.remove(this._element,this.constructor.DATA_KEY),li.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,i=!0){Wt(e,t,i)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return Lt.get(Ft(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 mi={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=>!jt(e)&&Bt(e)))}},gi={slideFocus:!0,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"}},yi={"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 _i extends fi{constructor(e){super(e),this._config=this._getConfig(),this._splide=new At(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({},gi);return Object.keys(yi).forEach((t=>{this._element.classList.contains(t)&&(e=Object.assign({},e,yi[t]))})),e}}"undefined"!=typeof window&&"undefined"!=typeof document&&li.on(window,"load.bs.carousel.data-api",(()=>{mi.find("[data-bs-carousel-splide]").forEach((e=>{_i.getOrCreateInstance(e)}))}));const vi=".bs.inputlabel",bi=`focus${vi}`,Ti=`blur${vi}`,wi=`change${vi}`,Si="active";class Ei{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(Si)&&(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")?li.on(this._element,Ti,(()=>{this._labelOut()})):(li.on(this._element,bi,(()=>{this._labelOut()})),li.on(this._element,Ti,(()=>{this._labelOver()})),li.on(this._element,wi,(()=>{this._labelToggle()}))))}_getLabel(){return mi.findOne('label[for="'+this._element.getAttribute("id")+'"]')}_isEmpty(){return!this._element.value&&!this._element.getAttribute("placeholder")}_labelOut(){const e=this._getLabel();e&&e.classList.add(Si)}_labelOver(){if(this._isEmpty()){const e=this._getLabel();e&&e.classList.remove(Si)}}_labelToggle(){this._isEmpty()?this._labelOver():this._labelOut()}}const Ci=".bs.inputnumber",ki=`click${Ci}`,xi=`change${Ci}`,Ii=`click${Ci}.data-api`,Ai=".input-number",Oi='input[data-bs-input][type="number"]',Li='button[class^="input-number-"]';class Pi extends fi{constructor(e){super(e),this._wrapperElement=this._element.closest(Ai),this._label=new Ei(e),this._init(),this._bindEvents()}static get NAME(){return"inputnumber"}_init(){this._wrapperElement&&this._inputResize()}_bindEvents(){this._wrapperElement&&(mi.find(Li,this._wrapperElement).forEach((e=>{li.on(e,ki,(t=>{t.preventDefault(),this._incrDecr(e.classList.contains("input-number-sub")),this._label._labelOut()}))})),li.on(this._element,xi,(()=>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){var t=0;if(""!==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),li.trigger(this._element,xi),li.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(Oi+", label").forEach((function(e){const t=Ei.getInputFromLabel(e)||e;var i;(i=t)&&i.matches(Oi)&&i.parentNode.querySelector(Li)&&Pi.getOrCreateInstance(i)}))})),li.on(document,Ii,Li,(function(){const e=this.closest(Ai);if(e){const t=mi.findOne(Oi,e);t&&Pi.getOrCreateInstance(t)}})));const Di="show";class Mi extends fi{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(Di),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&&Vt(this._element),this._element.classList.add(Di);this._queueCallback((()=>{this._isTransitioning=!1}),this._element,e)}_hideElement(){this._element.setAttribute("aria-hidden",!0),this._isTransitioning=!1}}"undefined"!=typeof window&&"undefined"!=typeof document&&li.on(document,"click.bs.dimmer.data-api",'[data-bs-toggle="dimmer"]',(function(){const e=Nt(this),t=Mi.getOrCreateInstance(e);this.checked?t.show():t.hide()}));const Ni=(e,t="hide")=>{const i=`click.dismiss${e.EVENT_KEY}`,n=e.NAME;li.on(document,i,`[data-bs-dismiss="${n}"]`,(function(i){if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),jt(this))return;const s=Nt(this)||this.closest(`.${n}`);e.getOrCreateInstance(s)[t]()}))},Ri=".bs.notification",Ui=`click${Ri}.data-api`,Fi=`hidden${Ri}`,Bi=`show${Ri}`,ji={timeout:0},$i="show";class qi extends fi{constructor(e,t){super(e),this._config=this._getConfig(t),this._isShown=this._element.classList.contains($i),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($i),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&&Vt(this._element),this._element.classList.add($i);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={...ji,...hi.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&&(li.on(document,Ui,'[data-bs-toggle="notification"]',(function(e){const t=Nt(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),li.one(t,Bi,(e=>{e.defaultPrevented||li.one(t,Fi,(()=>{Bt(this)&&this.focus()}))}));qi.getOrCreateInstance(t).toggle(this)})),Ni(qi));const Vi="cookiebar",Hi=".bs.cookiebar",zi=".data-api",Wi="cookies_consent",Gi=`close${Hi}`,Xi=`closed${Hi}`,Ki=`load${Hi}${zi}`,Yi=`click${Hi}${zi}`,Qi="show";class Ji extends fi{constructor(e){super(e),this._isShown=this._element.classList.contains(Qi),this._isTransitioning=!1}static get NAME(){return Vi}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(Qi),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=Wi+"=; 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&&Vt(this._element),this._element.classList.add(Qi);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=Wi+"="+t+"; path=/; SameSite=Strict")}_getRootElement(e){const t=Nt(e);let i=null;return t&&(i=t),i||(i=e.closest(".cookiebar")),i}_triggerCloseEvent(e){return li.trigger(e,Gi)}_removeElement(e){e.classList.remove(Qi),e.setAttribute("aria-hidden","true"),e.setAttribute("aria-live","off"),li.trigger(e,Xi),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,""))==Wi)return unescape(i)}}}"undefined"!=typeof window&&"undefined"!=typeof document&&(li.on(document,Yi,'[data-bs-accept="cookiebar"]',(function(e){if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),jt(this))return;const t=Nt(this)||this.closest(`.${Vi}`);Ji.getOrCreateInstance(t).accept()})),li.on(window,Ki,(function(){if(!Ji._getCookieEU()){if("undefined"==typeof document)return;document.querySelectorAll(".cookiebar").forEach((e=>{Ji.getOrCreateInstance(e).show()}))}})));const Zi=()=>{if("undefined"!=typeof window)return window.matchMedia("(max-width: 991px)").matches},en=(e,t)=>{let i=null;return t.forEach(((t,n)=>{t===e&&(i=n)})),i},tn=(e,t,i)=>{i={isDirectionTop:!1,isLimit:!1,loop:!1,..."object"==typeof i?i:{}};const n=en(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()},nn="pagescroll-scroll-disabled";let sn=!1,rn="undefined"==typeof document?0:document.scrollingElement.scrollTop;const an="undefined"==typeof document?null:document.querySelector("html");"undefined"!=typeof document&&document.addEventListener("scroll",(()=>{sn&&(document.scrollingElement.scrollTop=rn)}));const on=".bs.navbarcollapsible",ln=`click${on}.data-api`,un=`click${on}`,cn=`keyup${on}`,dn=`keydown${on}`,hn=`hide${on}`,pn=`hidden${on}`,fn=`show${on}`,mn=`shown${on}`,gn=`resize${on}`,yn="show",_n="expanded",vn=".close-menu",bn=".nav-link",Tn=".nav-item .list-item",wn=".it-heading-link",Sn=".it-footer-link";class En extends fi{constructor(e){super(e),this._isShown=this._element.classList.contains(_n),this._isTransitioning=!1,this._isMobile=Zi(),this._isKeyShift=!1,this._currItemIdx=0,this._btnClose=mi.findOne(".close-div button",this._element),this._btnBack=mi.findOne(".it-back-button",this._element),this._menuWrapper=mi.findOne(".menu-wrapper",this._element),this._overlay=null,this._setOverlay(),this._menuItems=mi.find([bn,Tn,wn,Sn,vn].join(","),this._element),this._bindEvents()}static get NAME(){return"navbarcollapsible"}show(e){if(this._isShown||this._isTransitioning)return;li.trigger(this._element,fn,{relatedTarget:e}).defaultPrevented||(this._btnBack&&this._btnBack.classList.add(yn),this._isShown=!0,"undefined"!=typeof document&&(sn=!0,rn=document.scrollingElement.scrollTop,an.classList.add(nn)),this._showElement())}hide(){if(!this._isShown||this._isTransitioning)return;if(li.trigger(this._element,hn).defaultPrevented)return;this._isShown=!1;const e=this._isAnimated();e&&(this._isTransitioning=!0),this._btnBack&&this._btnBack.classList.remove(yn),this._overlay&&this._overlay.classList.remove(yn),this._element.classList.remove(_n),"undefined"!=typeof document&&(sn=!1,an.classList.remove(nn)),this._queueCallback((()=>this._hideElement()),this._menuWrapper,e)}toggle(e){this._isShown?this.hide():this.show(e)}dispose(){"undefined"!=typeof window&&"undefined"!=typeof document&&(li.off(window,gn),super.dispose())}_bindEvents(){"undefined"!=typeof window&&"undefined"!=typeof document&&(li.on(window,gn,(()=>this._onResize())),this._overlay&&li.on(this._overlay,un,(()=>this.hide())),li.on(this._btnClose,un,(e=>{e.preventDefault(),this.hide()})),li.on(this._btnBack,un,(e=>{e.preventDefault(),this.hide()})),this._menuItems.forEach((e=>{li.on(e,dn,(e=>this._isMobile&&this._onMenuItemKeyDown(e))),li.on(e,cn,(e=>this._isMobile&&this._onMenuItemKeyUp(e))),li.on(e,un,(e=>this._isMobile&&this._onMenuItemClick(e)))})))}_onResize(){this._isMobile=Zi()}_onMenuItemKeyUp(e){"Shift"===e.key&&(this._isKeyShift=!1)}_onMenuItemKeyDown(e){"Shift"===e.key&&(this._isKeyShift=!0),"Tab"===e.key&&(e.preventDefault(),this._focusNext())}_onMenuItemClick(e){this.currItemIdx=en(e.currentTarget,this._menuItems)}_isAnimated(){return!0}_isElementHidden(e){return null===e.offsetParent}_showElement(){const e=this._isAnimated();this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-expanded",!0),this._overlay&&(this._overlay.style.display="block"),e&&Vt(this._element),this._element.classList.add(_n),this._overlay&&this._overlay.classList.add(yn);this._queueCallback((()=>{this._isTransitioning=!1;const e=this._getNextVisibleItem(0);e.item&&(e.item.focus(),this._currItemIdx=e.index),li.trigger(this._element,mn)}),this._menuWrapper,e)}_hideElement(){this._overlay&&(this._overlay.style.display="none"),this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-expanded"),this._isTransitioning=!1,li.trigger(this._element,pn)}_setOverlay(){this._overlay=mi.findOne(".overlay",this._element),this._isAnimated&&this._overlay.classList.add("fade")}_focusNext(){let e=this._currItemIdx+(this._isKeyShift?-1:1);e<0?e=this._menuItems.length-1:e>=this._menuItems.length&&(e=0);const t=this._getNextVisibleItem(e,this._isKeyShift);t.item&&(t.item.focus(),this._currItemIdx=t.index)}_getNextVisibleItem(e,t){let i=null,n=null,s=e,r=t?-1:1,a=!1;for(;!(i||s==e&&a);)s==e&&(a=!0),this._isElementHidden(this._menuItems[s])||(i=this._menuItems[s],n=s),s+=r,s<0?s=this._menuItems.length-1:s>=this._menuItems.length&&(s=0);return{item:i,index:n}}}"undefined"!=typeof window&&"undefined"!=typeof document&&li.on(document,ln,'[data-bs-toggle="navbarcollapsible"]',(function(e){const t=Nt(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),li.one(t,fn,(e=>{e.defaultPrevented||li.one(t,pn,(()=>{Bt(this)&&this.focus()}))}));En.getOrCreateInstance(t).toggle(this)}));const Cn=".bs.accordion",kn=`keydown${Cn}`,xn=`keydown${Cn}.data-api`,In='.accordion-item > .accordion-header [data-bs-toggle="collapse"]';class An extends fi{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(){mi.find(In,this._element).forEach((e=>{li.on(e,kn,(e=>{this.handleKeyDown(e.key,e.currentTarget,e)}))}))}_getHeadButtons(){return mi.find(":scope > "+In,this._element)}_focusNext(e){tn(e,this._getHeadButtons(),{loop:!0})}_focusPrev(e){tn(e,this._getHeadButtons(),{isDirectionTop:!0,loop:!0})}_focusFirst(e){tn(e,this._getHeadButtons(),{isDirectionTop:!0,isLimit:!0})}_focusLast(e){tn(e,this._getHeadButtons(),{isLimit:!0})}}var On;"undefined"!=typeof window&&"undefined"!=typeof document&&li.on(document,xn,In,(function(e){const t=this.closest(".accordion");if(t){An.getOrCreateInstance(t).handleKeyDown(e.key,this,e)}}));var Ln=new Uint8Array(16);function Pn(){if(!On&&!(On="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return On(Ln)}const Dn=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var Mn=[],Nn=0;Nn<256;++Nn)Mn.push((Nn+256).toString(16).substr(1));function Rn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(Mn[e[t+0]]+Mn[e[t+1]]+Mn[e[t+2]]+Mn[e[t+3]]+"-"+Mn[e[t+4]]+Mn[e[t+5]]+"-"+Mn[e[t+6]]+Mn[e[t+7]]+"-"+Mn[e[t+8]]+Mn[e[t+9]]+"-"+Mn[e[t+10]]+Mn[e[t+11]]+Mn[e[t+12]]+Mn[e[t+13]]+Mn[e[t+14]]+Mn[e[t+15]]).toLowerCase();if(!function(e){return"string"==typeof e&&Dn.test(e)}(i))throw TypeError("Stringified UUID is invalid");return i}function Un(e,t,i){var n=(e=e||{}).random||(e.rng||Pn)();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,Rn(n)}let Fn=!1,Bn=[];class jn{constructor(e,t){this.id=e,this._callback=t}dispose(){$n(this.id)}_execute(e){this._callback(e)}}const $n=e=>{Bn=Bn.filter((t=>t.id!==e))},qn=e=>{if("undefined"!=typeof document){if(Bn.length||"undefined"!=typeof window&&"undefined"!=typeof document&&document.addEventListener("scroll",(e=>{Fn||(window.requestAnimationFrame((()=>{Bn.forEach((t=>t.cb._execute(e))),Fn=!1})),Fn=!0)})),"function"==typeof e){const t=new jn(Un(),e);return Bn.push({id:t.id,cb:t}),t}return console.error("[onDocumentScroll] the provided data has to be of type function"),null}};var Vn={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0},Hn={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},zn=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],Wn={CSS:{},springs:{}};function Gn(e,t,i){return Math.min(Math.max(e,t),i)}function Xn(e,t){return e.indexOf(t)>-1}function Kn(e,t){return e.apply(null,t)}var Yn={arr:function(e){return Array.isArray(e)},obj:function(e){return Xn(Object.prototype.toString.call(e),"Object")},pth:function(e){return Yn.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||Yn.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 Yn.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 Yn.hex(e)||Yn.rgb(e)||Yn.hsl(e)},key:function(e){return!Vn.hasOwnProperty(e)&&!Hn.hasOwnProperty(e)&&"targets"!==e&&"keyframes"!==e}};function Qn(e){var t=/\(([^)]+)\)/.exec(e);return t?t[1].split(",").map((function(e){return parseFloat(e)})):[]}function Jn(e,t){var i=Qn(e),n=Gn(Yn.und(i[0])?1:i[0],.1,100),s=Gn(Yn.und(i[1])?100:i[1],.1,100),r=Gn(Yn.und(i[2])?10:i[2],.1,100),a=Gn(Yn.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 d(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?d:function(){var t=Wn.springs[e];if(t)return t;for(var i=1/6,n=0,s=0;;)if(1===d(n+=i)){if(++s>=16)break}else s=0;var r=n*i*1e3;return Wn.springs[e]=r,r}}function Zn(e){return void 0===e&&(e=10),function(t){return Math.ceil(Gn(t,1e-6,1)*e)*(1/e)}}var es,ts,is=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)}}}(),ns=(es={linear:function(){return function(e){return e}}},ts={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=Gn(e,1,10),n=Gn(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){ts[e]=function(){return function(e){return Math.pow(e,t+2)}}})),Object.keys(ts).forEach((function(e){var t=ts[e];es["easeIn"+e]=t,es["easeOut"+e]=function(e,i){return function(n){return 1-t(e,i)(1-n)}},es["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}},es["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}}})),es);function ss(e,t){if(Yn.fnc(e))return e;var i=e.split("(")[0],n=ns[i],s=Qn(e);switch(i){case"spring":return Jn(e,t);case"cubicBezier":return Kn(is,s);case"steps":return Kn(Zn,s);default:return Kn(n,s)}}function rs(e){try{return document.querySelectorAll(e)}catch(e){return}}function as(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 os(e){return e.reduce((function(e,t){return e.concat(Yn.arr(t)?os(t):t)}),[])}function ls(e){return Yn.arr(e)?e:(Yn.str(e)&&(e=rs(e)||e),e instanceof NodeList||e instanceof HTMLCollection?[].slice.call(e):[e])}function us(e,t){return e.some((function(e){return e===t}))}function cs(e){var t={};for(var i in e)t[i]=e[i];return t}function ds(e,t){var i=cs(e);for(var n in e)i[n]=t.hasOwnProperty(n)?t[n]:e[n];return i}function hs(e,t){var i=cs(e);for(var n in t)i[n]=Yn.und(e[n])?t[n]:e[n];return i}function ps(e){return Yn.rgb(e)?(i=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(t=e))?"rgba("+i[1]+",1)":t:Yn.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):Yn.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,d=2*o-c;t=u(d,c,r+1/3),i=u(d,c,r),n=u(d,c,r-1/3)}return"rgba("+255*t+","+255*i+","+255*n+","+l+")"}(e):void 0;var t,i}function fs(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 ms(e,t){return Yn.fnc(e)?e(t.target,t.id,t.total):e}function gs(e,t){return e.getAttribute(t)}function ys(e,t,i){if(us([i,"deg","rad","turn"],fs(t)))return t;var n=Wn.CSS[t+i];if(!Yn.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 Wn.CSS[t+i]=o,o}function _s(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?ys(e,s,i):s}}function vs(e,t){return Yn.dom(e)&&!Yn.inp(e)&&(!Yn.nil(gs(e,t))||Yn.svg(e)&&e[t])?"attribute":Yn.dom(e)&&us(zn,t)?"transform":Yn.dom(e)&&"transform"!==t&&_s(e,t)?"css":null!=e[t]?"object":void 0}function bs(e){if(Yn.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 Ts(e,t,i,n){var s=Xn(t,"scale")?1:0+function(e){return Xn(e,"translate")||"perspective"===e?"px":Xn(e,"rotate")||Xn(e,"skew")?"deg":void 0}(t),r=bs(e).get(t)||s;return i&&(i.transforms.list.set(t,r),i.transforms.last=t),n?ys(e,r,n):r}function ws(e,t,i,n){switch(vs(e,t)){case"transform":return Ts(e,t,n,i);case"css":return _s(e,t,i);case"attribute":return gs(e,t);default:return e[t]||0}}function Ss(e,t){var i=/^(\*=|\+=|-=)/.exec(e);if(!i)return e;var n=fs(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 Es(e,t){if(Yn.col(e))return ps(e);if(/\s/g.test(e))return e;var i=fs(e),n=i?e.substr(0,e.length-i.length):e;return t?n+t:n}function Cs(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function ks(e){for(var t,i=e.points,n=0,s=0;s<i.numberOfItems;s++){var r=i.getItem(s);s>0&&(n+=Cs(t,r)),t=r}return n}function xs(e){if(e.getTotalLength)return e.getTotalLength();switch(e.tagName.toLowerCase()){case"circle":return function(e){return 2*Math.PI*gs(e,"r")}(e);case"rect":return function(e){return 2*gs(e,"width")+2*gs(e,"height")}(e);case"line":return function(e){return Cs({x:gs(e,"x1"),y:gs(e,"y1")},{x:gs(e,"x2"),y:gs(e,"y2")})}(e);case"polyline":return ks(e);case"polygon":return function(e){var t=e.points;return ks(e)+Cs(t.getItem(t.numberOfItems-1),t.getItem(0))}(e)}}function Is(e,t){var i=t||{},n=i.el||function(e){for(var t=e.parentNode;Yn.svg(t)&&Yn.svg(t.parentNode);)t=t.parentNode;return t}(e),s=n.getBoundingClientRect(),r=gs(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 As(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=Is(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 Os(e,t){var i=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,n=Es(Yn.pth(e)?e.totalLength:e,t)+"";return{original:n,numbers:n.match(i)?n.match(i).map(Number):[0],strings:Yn.str(e)||t?n.split(i):[]}}function Ls(e){return as(e?os(Yn.arr(e)?e.map(ls):ls(e)):[],(function(e,t,i){return i.indexOf(e)===t}))}function Ps(e){var t=Ls(e);return t.map((function(e,i){return{target:e,id:i,total:t.length,transforms:{list:bs(e)}}}))}function Ds(e,t){var i=cs(t);if(/^spring/.test(i.easing)&&(i.duration=Jn(i.easing)),Yn.arr(e)){var n=e.length;2===n&&!Yn.obj(e[0])?e={value:e}:Yn.fnc(t.duration)||(i.duration=t.duration/n)}var s=Yn.arr(e)?e:[e];return s.map((function(e,i){var n=Yn.obj(e)&&!Yn.pth(e)?e:{value:e};return Yn.und(n.delay)&&(n.delay=i?0:t.delay),Yn.und(n.endDelay)&&(n.endDelay=i===s.length-1?t.endDelay:0),n})).map((function(e){return hs(e,i)}))}function Ms(e,t){var i=[],n=t.keyframes;for(var s in n&&(t=hs(function(e){for(var t=as(os(e.map((function(e){return Object.keys(e)}))),(function(e){return Yn.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)Yn.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)Yn.key(s)&&i.push({name:s,tweens:Ds(t[s],e)});return i}function Ns(e,t){var i;return e.tweens.map((function(n){var s=function(e,t){var i={};for(var n in e){var s=ms(e[n],t);Yn.arr(s)&&1===(s=s.map((function(e){return ms(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=Yn.arr(r)?r[1]:r,o=fs(a),l=ws(t.target,e.name,o,t),u=i?i.to.original:l,c=Yn.arr(r)?r[0]:u,d=fs(c)||fs(l),h=o||d;return Yn.und(a)&&(a=u),s.from=Os(c,h),s.to=Os(Ss(a,c),h),s.start=i?i.end:0,s.end=s.start+s.delay+s.duration+s.endDelay,s.easing=ss(s.easing,s.duration),s.isPath=Yn.pth(r),s.isPathTargetInsideSVG=s.isPath&&Yn.svg(t.target),s.isColor=Yn.col(s.from.original),s.isColor&&(s.round=1),i=s,s}))}var Rs={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 Us(e,t){Ps(e).forEach((function(e){for(var i in t){var n=ms(t[i],e),s=e.target,r=fs(n),a=ws(s,i,r,e),o=Ss(Es(n,r||fs(a)),a),l=vs(s,i);Rs[l](s,i,o,e.transforms,!0)}}))}function Fs(e,t){return as(os(e.map((function(e){return t.map((function(t){return function(e,t){var i=vs(e.target,t.name);if(i){var n=Ns(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!Yn.und(e)}))}function Bs(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 js=0;var $s=[],qs=function(){var e;function t(i){for(var n=$s.length,s=0;s<n;){var r=$s[s];r.paused?($s.splice(s,1),n--):(r.tick(i),s++)}e=s>0?requestAnimationFrame(t):void 0}return"undefined"!=typeof document&&document.addEventListener("visibilitychange",(function(){Hs.suspendWhenDocumentHidden&&(Vs()?e=cancelAnimationFrame(e):($s.forEach((function(e){return e._onDocumentVisibility()})),qs()))})),function(){e||Vs()&&Hs.suspendWhenDocumentHidden||!($s.length>0)||(e=requestAnimationFrame(t))}}();function Vs(){return!!document&&document.hidden}function Hs(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=ds(Vn,e),i=ds(Hn,e),n=Ms(i,e),s=Ps(e.targets),r=Fs(s,n),a=Bs(r,i),o=js;return js++,hs(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 d(){i=0,n=c(l.currentTime)*(1/Hs.speed)}function h(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=as(a,(function(t){return e<t.end}))[0]||u);for(var c=Gn(e-u.start-u.delay,0,u.duration)/u.duration,d=isNaN(c)?1:u.easing(c),h=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?As(u.value,d*v,u.isPathTargetInsideSVG):b+d*(v-b),p&&(u.isColor&&y>2||(_=Math.round(_*p)/p)),f.push(_)}var T=h.length;if(T){g=h[0];for(var w=0;w<T;w++){h[w];var S=h[w+1],E=f[w];isNaN(E)||(g+=S?E+S:E+" ")}}else g=f[0];Rs[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 d=l.duration,m=l.delay,g=d-l.endDelay,y=c(e);l.progress=Gn(y/d*100,0,100),l.reversePlayback=y<l.currentTime,t&&function(e){if(l.reversePlayback)for(var i=r;i--;)h(e,t[i]);else for(var n=0;n<r;n++)h(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!==d||!d)&&p(d),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=Gn(y,0,d),l.began&&f("update"),e>=d&&(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=d,l.set=function(e,t){return Us(e,t),l},l.tick=function(e){s=e,i||(i=s),m((s+(n-i))*Hs.speed)},l.seek=function(e){m(c(e))},l.pause=function(){l.paused=!0,d()},l.play=function(){l.paused&&(l.completed&&l.reset(),l.paused=!1,$s.push(l),d(),qs())},l.reverse=function(){u(),l.completed=!l.reversed,d()},l.restart=function(){l.reset(),l.play()},l.remove=function(e){Ws(Ls(e),l)},l.reset(),l.autoplay&&l.play(),l}function zs(e,t){for(var i=t.length;i--;)us(e,t[i].animatable.target)&&t.splice(i,1)}function Ws(e,t){var i=t.animations,n=t.children;zs(e,i);for(var s=n.length;s--;){var r=n[s],a=r.animations;zs(e,a),a.length||r.children.length||n.splice(s,1)}i.length||n.length||t.pause()}Hs.version="3.2.1",Hs.speed=1,Hs.suspendWhenDocumentHidden=!0,Hs.running=$s,Hs.remove=function(e){for(var t=Ls(e),i=$s.length;i--;){Ws(t,$s[i])}},Hs.get=ws,Hs.set=Us,Hs.convertPx=ys,Hs.path=function(e,t){var i=Yn.str(e)?rs(e)[0]:e,n=t||100;return function(e){return{property:e,el:i,svg:Is(i),totalLength:xs(i)*(n/100)}}},Hs.setDashoffset=function(e){var t=xs(e);return e.setAttribute("stroke-dasharray",t),t},Hs.stagger=function(e,t){void 0===t&&(t={});var i=t.direction||"normal",n=t.easing?ss(t.easing):null,s=t.grid,r=t.axis,a=t.from||0,o="first"===a,l="center"===a,u="last"===a,c=Yn.arr(e),d=c?parseFloat(e[0]):parseFloat(e),h=c?parseFloat(e[1]):0,p=fs(c?e[1]:e)||0,f=t.start||0+(c?d: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?(h-d)/g:d)*(Math.round(100*m[t])/100)+p}},Hs.timeline=function(e){void 0===e&&(e={});var t=Hs(e);return t.duration=0,t.add=function(i,n){var s=$s.indexOf(t),r=t.children;function a(e){e.passThrough=!0}s>-1&&$s.splice(s,1);for(var o=0;o<r.length;o++)a(r[o]);var l=hs(i,ds(Hn,e));l.targets=l.targets||e.targets;var u=t.duration;l.autoplay=!1,l.direction=t.direction,l.timelineOffset=Yn.und(n)?u:Ss(n,u),a(t),t.seek(l.timelineOffset);var c=Hs(l);a(c),r.push(c);var d=Bs(r,e);return t.delay=d.delay,t.endDelay=d.endDelay,t.duration=d.duration,t.seek(0),t.reset(),t.autoplay&&t.play(),t},t},Hs.easing=ss,Hs.penner=ns,Hs.random=function(e,t){return Math.floor(Math.random()*(t-e+1))+e};const Gs={duration:800,easing:"easeInOutSine"},Xs=(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,...Gs,..."object"==typeof t?t:{}},n.style.scrollBehavior="auto",t.complete=e=>{n.style.scrollBehavior=s,"function"==typeof i&&i(e)},Hs({targets:n,...t})},Ks="active",Ys="ul.link-list",Qs="a.nav-link",Js=`${Qs}.${Ks}`,Zs=`${Qs}[href^="#"]`,er={scrollPadding:10,duration:800,easing:"easeInOutSine"};class tr extends fi{constructor(e,t){super(e),this._config=this._getConfig(t),this._togglerElement=mi.findOne(".custom-navbar-toggler",this._element),this._sectionContainer=mi.findOne(".it-page-sections-container"),this._collapsible=this._getCollapsible(),this._isCollapseOpened=!1,this._callbackQueue=[],this._scrollCb=null,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={...er,...hi.getDataAttributes(this._element),..."object"==typeof e?e:{}}}_bindEvents(){this._scrollCb=qn((()=>this._onScroll())),this._collapsible&&(li.on(this._collapsible._element,"shown.bs.navbarcollapsible",(()=>this._onCollapseOpened())),li.on(this._collapsible._element,"hidden.bs.navbarcollapsible",(()=>this._onCollapseClosed()))),mi.find(Zs,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&&li.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(Ys),n=null,s=!1;for(;i&&!s;){const e=i.closest("li.nav-link, li.nav-item");if(e){const i=e.querySelector(Qs);i&&t.push(i)}n=i,i=(i.parentElement||i).closest(Ys),i===n&&(s=!0)}return t}_decorateToggler(e){if(this._togglerElement){const t=mi.findOne(".it-list",this._togglerElement);this._togglerElement.innerText="",this._togglerElement.textContent="",this._togglerElement.append(t),this._togglerElement.append(e)}}_scrollToHash(e){const t=mi.findOne(e,this._sectionContainer);t&&(Xs(t.offsetTop-this._getScrollPadding(),{duration:this._config.duration,easing:this._config.easing}),history.pushState?history.pushState(null,null,e):location.hash=e)}_updateProgress(e){if(!e)return;const t=mi.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=mi.find(Qs,this._element),n=this._getScrollPadding();mi.find(".it-page-section").forEach(((s,r)=>{if(s.offsetTop-e<=t+n&&(mi.find(Js,this._element).forEach((e=>{e.classList.remove(Ks)})),r<i.length)){const e=i[r];this._getParentLinks(e).forEach((e=>{e.classList.add(Ks)})),e.classList.add(Ks),this._decorateToggler(e.innerText)}})),this._updateProgress(this._sectionContainer)}_getCollapsible(){const e=mi.findOne(".navbar-collapsable",this._element);return e?En.getOrCreateInstance(e):null}_getScrollPadding(){return"function"==typeof this._config.scrollPadding?this._config.scrollPadding():this._config.scrollPadding}}if("undefined"!=typeof window&&"undefined"!=typeof document){mi.find("[data-bs-navscroll]").map((e=>{tr.getOrCreateInstance(e)}))}const ir=".bs.sticky",nr=`resize${ir}`,sr=`on${ir}`,rr=`off${ir}`,ar="bs-is-sticky",or="bs-is-fixed",lr='[data-bs-toggle="sticky"]',ur={positionType:"sticky",stickyClassName:"",stackable:!1,paddingTop:0};class cr extends fi{constructor(e,t){super(e),this._config=this._getConfig(t),this._isSticky=!1,this._wrapper=null,this._stickyTarget=mi.findOne(Mt(this._element),this._element)||this._element,this._stickyTargetMobile=mi.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=Zi(),this._prevTop=0,this._onScroll(),this._bindEvents()}dispose(){"undefined"!=typeof window&&"undefined"!=typeof document&&(li.off(window,nr),this._scrollCb.dispose(),super.dispose())}static get NAME(){return"sticky"}_getConfig(e){return e={...ur,...hi.getDataAttributes(this._element),..."object"==typeof e?e:{}}}_bindEvents(){"undefined"!=typeof window&&"undefined"!=typeof document&&(li.on(window,nr,(()=>this._onResize())),this._scrollCb=qn((()=>this._onScroll())))}_onResize(){this._isMobile=Zi(),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=ar;this._isTypeSticky()||(e=or,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",li.trigger(this._element,sr)}}_unsetSticky(){if(this._isSticky){let e=ar;this._isTypeSticky()||(e=or,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,li.trigger(this._element,rr)}}_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 mi.find(lr).filter((e=>{const t=cr.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&&qn((()=>{mi.find(lr).map((e=>{cr.getOrCreateInstance(e)}))}));const dr="cloned-element",hr=`.${dr}`,pr=new Map;class fr{constructor(e){if(pr.get(e))return null;this._element=e,this._elementObj=cr.getOrCreateInstance(e),pr.set(e,this._elementObj),this._bindEvents(),this._toggleClonedElement(this._element.classList.contains("is-sticky"))}static getOrCreateInstance(e){return pr.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(!Bt(mi.findOne(".custom-navbar-toggler",this._element))){const t=mi.findOne(".menu-wrapper",this._element);if(e){const e=mi.findOne(".it-brand-wrapper",this._element),i=mi.findOne(".it-search-wrapper",this._element),n=mi.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(dr),r&&t.appendChild(r).classList.add(dr),a&&(t.appendChild(a).classList.add(dr),t.appendChild(a).classList.remove("show"))}else mi.find(hr,this._element).forEach((e=>{e.parentElement.removeChild(e)}))}}}qn((()=>{mi.find(".it-header-sticky").map((e=>{fr.getOrCreateInstance(e)}))}));var mr=Object.defineProperty,gr=(e,t,i)=>(((e,t,i)=>{t in e?mr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i})(e,"symbol"!=typeof t?t+"":t,i),i);const yr=/^(([^<>()[\]\\.,;:\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,}))$/,_r=/^-?[0-9]\d*$/,vr=/^(?=.*[A-Za-z])(?=.*\d).{8,}$/,br=/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/,Tr=e=>"string"!=typeof e||""===e;var wr=(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))(wr||{}),Sr=(e=>(e.Required="required",e))(Sr||{}),Er=(e=>(e.Label="label",e.LabelArrow="labelArrow",e))(Er||{});const Cr=[{key:wr.Required,dict:{en:"The field is required"}},{key:wr.Email,dict:{en:"Email has invalid format"}},{key:wr.MaxLength,dict:{en:"The field must contain a maximum of :value characters"}},{key:wr.MinLength,dict:{en:"The field must contain a minimum of :value characters"}},{key:wr.Password,dict:{en:"Password must contain minimum eight characters, at least one letter and one number"}},{key:wr.StrongPassword,dict:{en:"Password should contain minimum eight characters, at least one uppercase letter, one lowercase letter, one number and one special character"}},{key:wr.Number,dict:{en:"Value should be a number"}},{key:wr.MaxNumber,dict:{en:"Number should be less or equal than :value"}},{key:wr.MinNumber,dict:{en:"Number should be more or equal than :value"}},{key:wr.MinFilesCount,dict:{en:"Files count should be more or equal than :value"}},{key:wr.MaxFilesCount,dict:{en:"Files count should be less or equal than :value"}},{key:wr.Files,dict:{en:"Uploaded files have one or several invalid properties (extension/size/type etc)."}}],kr=e=>"object"==typeof e&&null!==e&&"then"in e&&"function"==typeof e.then,xr=e=>Array.isArray(e)?e.filter((e=>e.length>0)):"string"==typeof e&&e.trim()?[...e.split(" ").filter((e=>e.length>0))]:[],Ir=e=>e instanceof Element||e instanceof HTMLDocument,Ar={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 Or{constructor(e,t,i){gr(this,"form",null),gr(this,"fields",{}),gr(this,"groupFields",{}),gr(this,"errors",{}),gr(this,"isValid",!1),gr(this,"isSubmitted",!1),gr(this,"globalConfig",Ar),gr(this,"errorLabels",{}),gr(this,"successLabels",{}),gr(this,"eventListeners",[]),gr(this,"dictLocale",Cr),gr(this,"currentLocale","en"),gr(this,"customStyleTags",{}),gr(this,"onSuccessCallback"),gr(this,"onFailCallback"),gr(this,"onValidateCallback"),gr(this,"tooltips",[]),gr(this,"lastScrollPosition"),gr(this,"isScrollTick"),gr(this,"fieldIds",new Map),gr(this,"getKeyByFieldSelector",(e=>this.fieldIds.get(e))),gr(this,"getFieldSelectorByKey",(e=>{for(const[t,i]of this.fieldIds)if(e===i)return t})),gr(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})),gr(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})),gr(this,"refreshAllTooltips",(()=>{this.tooltips.forEach((e=>{e.refresh()}))})),gr(this,"handleDocumentScroll",(()=>{this.lastScrollPosition=window.scrollY,this.isScrollTick||(window.requestAnimationFrame((()=>{this.refreshAllTooltips(),this.isScrollTick=!1})),this.isScrollTick=!0)})),gr(this,"formSubmitHandler",(e=>{e.preventDefault(),this.isSubmitted=!0,this.validateHandler(e)})),gr(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))})),gr(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))})),gr(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=Ar,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={...Ar,...t},i&&(this.dictLocale=[...i,...Cr]),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[Er.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 wr.MaxLength:case wr.MinLength:case wr.MaxNumber:case wr.MinNumber:case wr.MinFilesCount:case wr.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===Sr.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){i.plugin(r,this.getCompatibleFields())||this.setFieldInvalid(e,i)}else{switch(i.rule){case wr.Required:(e=>{let t=e;return"string"==typeof e&&(t=e.trim()),!t})(r)&&this.setFieldInvalid(e,i);break;case wr.Email:if(Tr(r))break;a=r,yr.test(a)||this.setFieldInvalid(e,i);break;case wr.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(Tr(r))break;((e,t)=>e.length>t)(r,s)&&this.setFieldInvalid(e,i);break;case wr.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(Tr(r))break;((e,t)=>e.length<t)(r,s)&&this.setFieldInvalid(e,i);break;case wr.Password:if(Tr(r))break;(e=>vr.test(e))(r)||this.setFieldInvalid(e,i);break;case wr.StrongPassword:if(Tr(r))break;(e=>br.test(e))(r)||this.setFieldInvalid(e,i);break;case wr.Number:if(Tr(r))break;(e=>"string"==typeof e&&!isNaN(+e)&&!isNaN(parseFloat(e)))(r)||this.setFieldInvalid(e,i);break;case wr.Integer:if(Tr(r))break;(e=>_r.test(e))(r)||this.setFieldInvalid(e,i);break;case wr.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(Tr(r))break;const t=+r;(Number.isNaN(t)||((e,t)=>e>t)(t,s))&&this.setFieldInvalid(e,i);break}case wr.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(Tr(r))break;const t=+r;(Number.isNaN(t)||((e,t)=>e<t)(t,s))&&this.setFieldInvalid(e,i);break}case wr.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 wr.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 wr.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 wr.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 kr(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);kr(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&&!Ir(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&&!Ir(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);kr(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);kr(t)&&i.push(t)})),Object.keys(this.groupFields).forEach((e=>{const t=this.validateGroup(e);kr(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&&!Ir(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(wr).includes(e.rule)))throw Error(`Rule should be one of these types: ${Object.values(wr).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&&!Ir(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&&!Ir(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:Sr.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(...xr((null==(n=r.config)?void 0:n.errorFieldCssClass)||this.globalConfig.errorFieldCssClass),...xr((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(...xr((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(...xr((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(...xr((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(...xr((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(...xr((null==(s=u.config)?void 0:s.successFieldCssClass)||this.globalConfig.successFieldCssClass))}return}u.elem.classList.add(...xr((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(...xr((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(...xr((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 Lr{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 Pr{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 Dr={errorFieldCssClass:"is-invalid",errorLabelCssClass:"just-validate-error-label"},Mr="justvalidatebi";class Nr extends fi{constructor(e){super(e),this._label=new Ei(e),this._bindEvents()}static get NAME(){return"input"}_bindEvents(){"file"===this._element.getAttribute("type")&&li.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=mi.findOne('label[for="'+this._element.getAttribute("id")+'"] label.form-file-name',this._element);i&&(i.innerText=t+e.join("; "))}}const Rr=["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=!!Rr.find((t=>e.matches(t))),i=!("number"!==e.getAttribute("type")||!e.parentNode.querySelector('button[class^="input-number-"]'));t||i||Nr.getOrCreateInstance(e)})(Ei.getInputFromLabel(e)||e)}))}));var Ur="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Fr(e,t){return e(t={exports:{}},t.exports),t.exports}var Br=Fr((function(e,t){self,e.exports=function(){var e={8952:function(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")}},2096:function(e,t,i){var n=i(2424),s=String,r=TypeError;e.exports=function(e){if(n(e))return e;throw new r("Can't set "+s(e)+" as a prototype")}},4764:function(e,t,i){var n=i(9764).charAt;e.exports=function(e,t,i){return t+(i?n(e,t).length:1)}},6100:function(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:function(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:function(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)}},3364:function(e,t,i){var n=i(8992),s=i(1664),r=i(5712),a=i(4356),o=i(3556),l=i(2568),u=s([].push),c=function(e){var t=1===e,i=2===e,s=3===e,c=4===e,d=6===e,h=7===e,p=5===e||d;return function(f,m,g,y){for(var _,v,b=a(f),T=r(b),w=o(T),S=n(m,g),E=0,C=y||l,k=t?C(f,w):i||h?C(f,0):void 0;w>E;E++)if((p||E in T)&&(v=S(_=T[E],E,b),e))if(t)k[E]=v;else if(v)switch(e){case 3:return!0;case 5:return _;case 6:return E;case 2:u(k,_)}else switch(e){case 4:return!1;case 7:u(k,_)}return d?-1:s||c?c:k}};e.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterReject:c(7)}},953:function(e,t,i){var n=i(9957),s=i(9972),r=i(8504),a=s("species");e.exports=function(e){return r>=51||!n((function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},1496:function(e,t,i){var n=i(9957);e.exports=function(e,t){var i=[][e];return!!i&&n((function(){i.call(null,t||function(){return 1},1)}))}},6728:function(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}},6736:function(e,t,i){var n=i(1432),s=i(6072),r=i(1632),a=i(9972)("species"),o=Array;e.exports=function(e){var t;return n(e)&&(t=e.constructor,(s(t)&&(t===o||n(t.prototype))||r(t)&&null===(t=t[a]))&&(t=void 0)),void 0===t?o:t}},2568:function(e,t,i){var n=i(6736);e.exports=function(e,t){return new(n(e))(0===t?0:t)}},8696:function(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:function(e,t,i){var n=i(1664),s=n({}.toString),r=n("".slice);e.exports=function(e){return r(s(e),8,-1)}},4427:function(e,t,i){var n=i(16),s=i(4328),r=i(1888),a=i(9972)("toStringTag"),o=Object,l="Arguments"===r(function(){return arguments}());e.exports=n?r:function(e){var t,i,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=function(e,t){try{return e[t]}catch(e){}}(t=o(e),a))?i:l?r(t):"Object"===(n=r(t))&&s(t.callee)?"Arguments":n}},9968:function(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 d=o[c];n(e,d)||i&&n(i,d)||l(e,d,u(t,d))}}},2272:function(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:function(e){e.exports=function(e,t){return{value:e,done:t}}},3440:function(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:function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},92:function(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:function(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:function(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:function(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:function(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:function(e,t,i){var n=i(9957);e.exports=!n((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},8168:function(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:function(e){var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},6064:function(e){e.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},8504:function(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:function(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6520:function(e,t,i){var n=i(1664),s=Error,r=n("".replace),a=String(new s("zxcasd").stack),o=/\n\s*at [^:]*:[^\n]*/,l=o.test(a);e.exports=function(e,t){if(l&&"string"==typeof e&&!s.prepareStackTrace)for(;t--;)e=r(e,o,"");return e}},3696:function(e,t,i){var n=i(3440),s=i(6520),r=i(9184),a=Error.captureStackTrace;e.exports=function(e,t,i,o){r&&(a?a(e,t):n(e,"stack",s(i,o)))}},9184:function(e,t,i){var n=i(9957),s=i(9728);e.exports=!n((function(){var e=new Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",s(1,7)),7!==e.stack)}))},9160:function(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,d,h,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(h=t[c],d=e.dontCallGetSet?(p=s(i,c))&&p.value:i[c],!u(m?c:f+(g?".":"#")+c,e.forced)&&void 0!==d){if(typeof h==typeof d)continue;l(h,d)}(e.sham||d&&d.sham)&&r(h,"sham",!0),a(i,c,h,e)}}},9957:function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},7176:function(e,t,i){i(880);var n=i(8448),s=i(6076),r=i(7680),a=i(9957),o=i(9972),l=i(3440),u=o("species"),c=RegExp.prototype;e.exports=function(e,t,i,d){var h=o(e),p=!a((function(){var t={};return t[h]=function(){return 7},7!==""[e](t)})),f=p&&!a((function(){var t=!1,i=/a/;return"split"===e&&((i={}).constructor={},i.constructor[u]=function(){return i},i.flags="",i[h]=/./[h]),i.exec=function(){return t=!0,null},i[h](""),!t}));if(!p||!f||i){var m=/./[h],g=t(h,""[e],(function(e,t,i,s,a){var o=t.exec;return o===r||o===c.exec?p&&!a?{done:!0,value:n(m,t,i,s)}:{done:!0,value:n(e,i,t,s)}:{done:!1}}));s(String.prototype,e,g[0]),s(c,h,g[1])}d&&l(c[h],"sham",!0)}},908:function(e,t,i){var n=i(7332),s=Function.prototype,r=s.apply,a=s.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?a.bind(r):function(){return a.apply(r,arguments)})},8992:function(e,t,i){var n=i(3180),s=i(8952),r=i(7332),a=n(n.bind);e.exports=function(e,t){return s(e),void 0===t?e:r?a(e,t):function(){return e.apply(t,arguments)}}},7332:function(e,t,i){var n=i(9957);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},8448:function(e,t,i){var n=i(7332),s=Function.prototype.call;e.exports=n?s.bind(s):function(){return s.apply(s,arguments)}},6208:function(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}},5288:function(e,t,i){var n=i(1664),s=i(8952);e.exports=function(e,t,i){try{return n(s(Object.getOwnPropertyDescriptor(e,t)[i]))}catch(e){}}},3180:function(e,t,i){var n=i(1888),s=i(1664);e.exports=function(e){if("Function"===n(e))return s(e)}},1664:function(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:function(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:function(e){e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},4504:function(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:function(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:function(e){e.exports={}},4168:function(e,t,i){var n=i(5232);e.exports=n("document","documentElement")},9888:function(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:function(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},7512:function(e,t,i){var n=i(4328),s=i(1632),r=i(4024);e.exports=function(e,t,i){var a,o;return r&&n(a=t.constructor)&&a!==i&&s(o=a.prototype)&&o!==i.prototype&&r(e,o),e}},9112:function(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},3480:function(e,t,i){var n=i(1632),s=i(3440);e.exports=function(e,t){n(t)&&"cause"in t&&s(e,"cause",t.cause)}},9104:function(e,t,i){var n,s,r,a=i(4288),o=i(6420),l=i(1632),u=i(3440),c=i(5152),d=i(3976),h=i(6504),p=i(2560),f="Object already initialized",m=o.TypeError,g=o.WeakMap;if(a||d.state){var y=d.state||(d.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 _=h("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:function(e,t,i){var n=i(1888);e.exports=Array.isArray||function(e){return"Array"===n(e)}},4328:function(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}},6072:function(e,t,i){var n=i(1664),s=i(9957),r=i(4328),a=i(4427),o=i(5232),l=i(9112),u=function(){},c=o("Reflect","construct"),d=/^\s*(?:class|function)\b/,h=n(d.exec),p=!d.test(u),f=function(e){if(!r(e))return!1;try{return c(u,[],e),!0}catch(e){return!1}},m=function(e){if(!r(e))return!1;switch(a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return p||!!h(d,l(e))}catch(e){return!0}};m.sham=!0,e.exports=!c||s((function(){var e;return f(f.call)||!f(Object)||!f((function(){e=!0}))||e}))?m:f},6704:function(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:function(e){e.exports=function(e){return null==e}},1632:function(e,t,i){var n=i(4328);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},2424:function(e,t,i){var n=i(1632);e.exports=function(e){return n(e)||null===e}},7048:function(e){e.exports=!1},7728:function(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:function(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:function(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,d=i(3336),h=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 d(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):d(void 0,!0)}if(i.inner)try{h(i.inner.iterator,"normal")}catch(e){return h(s,"throw",e)}return h(s,"normal"),d(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:function(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:function(e,t,i){var n,s,r,a=i(9957),o=i(4328),l=i(1632),u=i(9368),c=i(7796),d=i(6076),h=i(9972),p=i(7048),f=h("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])||d(n,f,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:m}},3556:function(e,t,i){var n=i(7584);e.exports=function(e){return n(e.length)}},5312:function(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),d=c.enforce,h=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=d(e);return a(n,"source")||(n.source=y(v,"string"==typeof t?t:"")),e};Function.prototype.toString=b((function(){return r(this)&&h(this).source||u(this)}),"toString")},1748:function(e){var t=Math.ceil,i=Math.floor;e.exports=Math.trunc||function(e){var n=+e;return(n>0?i:t)(n)}},8948:function(e,t,i){var n=i(5016);e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:n(e)}},9292:function(e,t,i){var n=i(3476),s=i(1664),r=i(8448),a=i(9957),o=i(1531),l=i(9392),u=i(8912),c=i(4356),d=i(5712),h=Object.assign,p=Object.defineProperty,f=s([].concat);e.exports=!h||a((function(){if(n&&1!==h({b:1},h(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},i=Symbol("assign detection"),s="abcdefghijklmnopqrst";return e[i]=7,s.split("").forEach((function(e){t[e]=e})),7!==h({},e)[i]||o(h({},t)).join("")!==s}))?function(e,t){for(var i=c(e),s=arguments.length,a=1,h=l.f,p=u.f;s>a;)for(var m,g=d(arguments[a++]),y=h?f(o(g),h(g)):o(g),_=y.length,v=0;_>v;)m=y[v++],n&&!r(p,g,m)||(i[m]=g[m]);return i}:h},9368:function(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),d="prototype",h="script",p=c("IE_PROTO"),f=function(){},m=function(e){return"<"+h+">"+e+"</"+h+">"},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"+h+":",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[d][a[s]];return y()};o[p]=!0,e.exports=Object.create||function(e,t){var i;return null!==e?(f[d]=s(e),i=new f,f[d]=null,i[p]=e):i=y(),void 0===t?i:r.f(i,t)}},2056:function(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:function(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,d="enumerable",h="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:h in i?i[h]:n[h],enumerable:d in i?i[d]:n[d],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:function(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),d=Object.getOwnPropertyDescriptor;t.f=n?d:function(e,t){if(e=o(e),t=l(t),c)try{return d(e,t)}catch(e){}if(u(e,t))return a(!s(r.f,e,t),e[t])}},5048:function(e,t,i){var n=i(9008),s=i(8256).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,s)}},9392:function(e,t){t.f=Object.getOwnPropertySymbols},7796:function(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:function(e,t,i){var n=i(1664);e.exports=n({}.isPrototypeOf)},9008:function(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:function(e,t,i){var n=i(9008),s=i(8256);e.exports=Object.keys||function(e){return n(e,s)}},8912:function(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},4024:function(e,t,i){var n=i(5288),s=i(3951),r=i(2096);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,i={};try{(e=n(Object.prototype,"__proto__","set"))(i,[]),t=i instanceof Array}catch(e){}return function(i,n){return s(i),r(n),t?e(i,n):i.__proto__=n,i}}():void 0)},7032:function(e,t,i){var n=i(16),s=i(4427);e.exports=n?{}.toString:function(){return"[object "+s(this)+"]"}},2104:function(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:function(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}},584:function(e,t,i){var n=i(8352).f;e.exports=function(e,t,i){i in e||n(e,i,{configurable:!0,get:function(){return t[i]},set:function(e){t[i]=e}})}},9092:function(e,t,i){var n=i(8448),s=i(3951),r=i(4328),a=i(1888),o=i(7680),l=TypeError;e.exports=function(e,t){var i=e.exec;if(r(i)){var u=n(i,e,t);return null!==u&&s(u),u}if("RegExp"===a(e))return n(o,e,t);throw new l("RegExp#exec called on incompatible receiver")}},7680:function(e,t,i){var n,s,r=i(8448),a=i(1664),o=i(5016),l=i(8872),u=i(3548),c=i(4696),d=i(9368),h=i(9104).get,p=i(8e3),f=i(9124),m=c("native-string-replace",String.prototype.replace),g=RegExp.prototype.exec,y=g,_=a("".charAt),v=a("".indexOf),b=a("".replace),T=a("".slice),w=(s=/b*/g,r(g,n=/a/,"a"),r(g,s,"a"),0!==n.lastIndex||0!==s.lastIndex),S=u.BROKEN_CARET,E=void 0!==/()??/.exec("")[1];(w||E||S||p||f)&&(y=function(e){var t,i,n,s,a,u,c,p=this,f=h(p),C=o(e),k=f.raw;if(k)return k.lastIndex=p.lastIndex,t=r(y,k,C),p.lastIndex=k.lastIndex,t;var x=f.groups,I=S&&p.sticky,A=r(l,p),O=p.source,L=0,P=C;if(I&&(A=b(A,"y",""),-1===v(A,"g")&&(A+="g"),P=T(C,p.lastIndex),p.lastIndex>0&&(!p.multiline||p.multiline&&"\n"!==_(C,p.lastIndex-1))&&(O="(?: "+O+")",P=" "+P,L++),i=new RegExp("^(?:"+O+")",A)),E&&(i=new RegExp("^"+O+"$(?!\\s)",A)),w&&(n=p.lastIndex),s=r(g,I?i:p,P),I?s?(s.input=T(s.input,L),s[0]=T(s[0],L),s.index=p.lastIndex,p.lastIndex+=s[0].length):p.lastIndex=0:w&&s&&(p.lastIndex=p.global?s.index+s[0].length:n),E&&s&&s.length>1&&r(m,s[0],i,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(s[a]=void 0)})),s&&x)for(s.groups=u=d(null),a=0;a<x.length;a++)u[(c=x[a])[0]]=s[c[1]];return s}),e.exports=y},8872:function(e,t,i){var n=i(3951);e.exports=function(){var e=n(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},3548:function(e,t,i){var n=i(9957),s=i(6420).RegExp,r=n((function(){var e=s("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),a=r||n((function(){return!s("a","y").sticky})),o=r||n((function(){var e=s("^r","gy");return e.lastIndex=2,null!==e.exec("str")}));e.exports={BROKEN_CARET:o,MISSED_STICKY:a,UNSUPPORTED_Y:r}},8e3:function(e,t,i){var n=i(9957),s=i(6420).RegExp;e.exports=n((function(){var e=s(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)}))},9124:function(e,t,i){var n=i(9957),s=i(6420).RegExp;e.exports=n((function(){var e=s("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))},5436:function(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:function(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:function(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:function(e,t,i){var n=i(3976);e.exports=function(e,t){return n[e]||(n[e]=t||{})}},9764:function(e,t,i){var n=i(1664),s=i(6180),r=i(5016),a=i(5436),o=n("".charAt),l=n("".charCodeAt),u=n("".slice),c=function(e){return function(t,i){var n,c,d=r(a(t)),h=s(i),p=d.length;return h<0||h>=p?e?"":void 0:(n=l(d,h))<55296||n>56319||h+1===p||(c=l(d,h+1))<56320||c>57343?e?o(d,h):n:e?u(d,h,h+2):c-56320+(n-55296<<10)+65536}};e.exports={codeAt:c(!1),charAt:c(!0)}},772:function(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:function(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:function(e,t,i){var n=i(5712),s=i(5436);e.exports=function(e){return n(s(e))}},6180:function(e,t,i){var n=i(1748);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},7584:function(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:function(e,t,i){var n=i(5436),s=Object;e.exports=function(e){return s(n(e))}},7024:function(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:function(e,t,i){var n=i(7024),s=i(7728);e.exports=function(e){var t=n(e,"string");return s(t)?t:t+""}},16:function(e,t,i){var n={};n[i(9972)("toStringTag")]="z",e.exports="[object z]"===String(n)},5016:function(e,t,i){var n=i(4427),s=String;e.exports=function(e){if("Symbol"===n(e))throw new TypeError("Cannot convert a Symbol value to a string");return s(e)}},36:function(e){var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},7776:function(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:function(e,t,i){var n=i(772);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},1576:function(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:function(e,t,i){var n=i(6420),s=i(4328),r=n.WeakMap;e.exports=s(r)&&/native code/.test(String(r))},9972:function(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"),d=l?u.for||u:u&&u.withoutSetter||a;e.exports=function(e){return r(c,e)||(c[e]=o&&r(u,e)?u[e]:d("Symbol."+e)),c[e]}},6488:function(e,t,i){var n=i(5232),s=i(5152),r=i(3440),a=i(7e3),o=i(4024),l=i(9968),u=i(584),c=i(7512),d=i(8948),h=i(3480),p=i(3696),f=i(3476),m=i(7048);e.exports=function(e,t,i,g){var y="stackTraceLimit",_=g?2:1,v=e.split("."),b=v[v.length-1],T=n.apply(null,v);if(T){var w=T.prototype;if(!m&&s(w,"cause")&&delete w.cause,!i)return T;var S=n("Error"),E=t((function(e,t){var i=d(g?t:e,void 0),n=g?new T(e):new T;return void 0!==i&&r(n,"message",i),p(n,E,n.stack,2),this&&a(w,this)&&c(n,this,E),arguments.length>_&&h(n,arguments[_]),n}));if(E.prototype=w,"Error"!==b?o?o(E,S):l(E,S,{name:!0}):f&&y in T&&(u(E,T,y),u(E,T,"prepareStackTrace")),l(E,T),!m)try{w.name!==b&&r(w,"name",b),w.constructor=E}catch(e){}return E}}},7476:function(e,t,i){var n=i(9160),s=i(9957),r=i(1432),a=i(1632),o=i(4356),l=i(3556),u=i(4316),c=i(92),d=i(2568),h=i(953),p=i(9972),f=i(8504),m=p("isConcatSpreadable"),g=f>=51||!s((function(){var e=[];return e[m]=!1,e.concat()[0]!==e})),y=function(e){if(!a(e))return!1;var t=e[m];return void 0!==t?!!t:r(e)};n({target:"Array",proto:!0,arity:1,forced:!g||!h("concat")},{concat:function(e){var t,i,n,s,r,a=o(this),h=d(a,0),p=0;for(t=-1,n=arguments.length;t<n;t++)if(y(r=-1===t?a:arguments[t]))for(s=l(r),u(p+s),i=0;i<s;i++,p++)i in r&&c(h,p,r[i]);else u(p+1),c(h,p++,r);return h.length=p,h}})},6932:function(e,t,i){var n=i(9160),s=i(3364).filter;n({target:"Array",proto:!0,forced:!i(953)("filter")},{filter:function(e){return s(this,e,arguments.length>1?arguments[1]:void 0)}})},700:function(e,t,i){var n=i(9160),s=i(1664),r=i(5712),a=i(4096),o=i(1496),l=s([].join);n({target:"Array",proto:!0,forced:r!==Object||!o("join",",")},{join:function(e){return l(a(this),void 0===e?",":e)}})},4456:function(e,t,i){var n=i(9160),s=i(3364).map;n({target:"Array",proto:!0,forced:!i(953)("map")},{map:function(e){return s(this,e,arguments.length>1?arguments[1]:void 0)}})},4728:function(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}})},8752:function(e,t,i){var n=i(9160),s=i(6420),r=i(908),a=i(6488),o="WebAssembly",l=s[o],u=7!==new Error("e",{cause:7}).cause,c=function(e,t){var i={};i[e]=a(e,t,u),n({global:!0,constructor:!0,arity:1,forced:u},i)},d=function(e,t){if(l&&l[e]){var i={};i[e]=a(o+"."+e,t,u),n({target:o,stat:!0,constructor:!0,arity:1,forced:u},i)}};c("Error",(function(e){return function(t){return r(e,this,arguments)}})),c("EvalError",(function(e){return function(t){return r(e,this,arguments)}})),c("RangeError",(function(e){return function(t){return r(e,this,arguments)}})),c("ReferenceError",(function(e){return function(t){return r(e,this,arguments)}})),c("SyntaxError",(function(e){return function(t){return r(e,this,arguments)}})),c("TypeError",(function(e){return function(t){return r(e,this,arguments)}})),c("URIError",(function(e){return function(t){return r(e,this,arguments)}})),d("CompileError",(function(e){return function(t){return r(e,this,arguments)}})),d("LinkError",(function(e){return function(t){return r(e,this,arguments)}})),d("RuntimeError",(function(e){return function(t){return r(e,this,arguments)}}))},508:function(e,t,i){var n=i(3476),s=i(6208).EXISTS,r=i(1664),a=i(2544),o=Function.prototype,l=r(o.toString),u=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,c=r(u.exec);n&&!s&&a(o,"name",{configurable:!0,get:function(){try{return c(u,l(this))[1]}catch(e){return""}}})},232:function(e,t,i){var n=i(9160),s=i(9292);n({target:"Object",stat:!0,arity:2,forced:Object.assign!==s},{assign:s})},5443:function(e,t,i){var n=i(16),s=i(6076),r=i(7032);n||s(Object.prototype,"toString",r,{unsafe:!0})},880:function(e,t,i){var n=i(9160),s=i(7680);n({target:"RegExp",proto:!0,forced:/./.exec!==s},{exec:s})},9836:function(e,t,i){var n=i(8448),s=i(7176),r=i(3951),a=i(9760),o=i(7584),l=i(5016),u=i(5436),c=i(4504),d=i(4764),h=i(9092);s("match",(function(e,t,i){return[function(t){var i=u(this),s=a(t)?void 0:c(t,e);return s?n(s,t,i):new RegExp(t)[e](l(i))},function(e){var n=r(this),s=l(e),a=i(t,n,s);if(a.done)return a.value;if(!n.global)return h(n,s);var u=n.unicode;n.lastIndex=0;for(var c,p=[],f=0;null!==(c=h(n,s));){var m=l(c[0]);p[f]=m,""===m&&(n.lastIndex=d(s,o(n.lastIndex),u)),f++}return 0===f?null:p}]}))},3536:function(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),d=i(9957),h=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||!d((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");h(this,e)?this[e]=t:c(this,e,t)}}):f[e]=t};h(f,v)||E(v,_),!w&&h(f,y)&&f[y]!==Object||E(y,S),S.prototype=f,n({global:!0,constructor:!0,forced:w},{Iterator:S})},2144:function(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),d=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 d(o(this),{predicate:e})}})},9080:function(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=function(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=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var n={};return function(){i.d(n,{default:function(){return X}}),i(8752),i(6932),i(4456),i(508),i(232),i(5443),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 d=new e;return d.nodeName=i,d.children=c,d.attributes=null==n?void 0:n,d.key=null==n?void 0:n.key,void 0!==t.vnode&&t.vnode(d),d}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,d=[];function h(e){!e._dirty&&(e._dirty=!0)&&1==d.push(e)&&(t.debounceRendering||u)(p)}function p(){for(var e;e=d.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)?(P(s,u,3,i,n),e=s.base):(r&&!o&&(M(r),e=a=null),s=O(t.nodeName,u,i),e&&!s.nextBase&&(s.nextBase=e,a=null),P(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,d=r.__preactattr_,h=t.children;if(null==d){d=r.__preactattr_={};for(var p=r.attributes,v=p.length;v--;)d[p[v].name]=p[v].value}return!S&&h&&1===h.length&&"string"==typeof h[0]&&null!=c&&void 0!==c.splitText&&null==c.nextSibling?c.nodeValue!=h[0]&&(c.nodeValue=h[0]):(h&&h.length||null!=c)&&function(e,t,i,n,s){var r,a,o,l,u,c=e.childNodes,d=[],h={},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++,h[S]=T):(w||(void 0!==T.splitText?!s||T.nodeValue.trim():s))&&(d[_++]=T)}if(0!==v)for(b=0;b<v;b++){var S;if(u=null,null!=(S=(l=t[b]).key))p&&void 0!==h[S]&&(u=h[S],h[S]=void 0,p--);else if(m<_)for(r=m;r<_;r++)if(void 0!==d[r]&&f(a=d[r],l,s)){u=a,d[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 h)void 0!==h[b]&&x(h[b],!1);for(;m<=_;)void 0!==(u=d[_--])&&x(u,!1)}(r,h,i,n,S||null!=d.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,d),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 O(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=L);s--;)if(A[s].constructor===e)return n.nextBase=A[s].nextBase,A.splice(s,1),n;return n}function L(e,t,i){return this.constructor(e,i)}function P(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?h(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,d=e.context,h=e.prevProps||u,p=e.prevState||c,f=e.prevContext||d,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=h,e.state=p,e.context=f,2!==i&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(u,c,d)?w=!0:e.componentWillUpdate&&e.componentWillUpdate(u,c,d),e.props=u,e.state=c,e.context=d),e.prevProps=e.prevState=e.prevContext=e.nextBase=null,e._dirty=!1,!w){r=e.render(u,c,d),e.getChildContext&&(d=o(o({},d),e.getChildContext())),m&&e.getSnapshotBeforeUpdate&&(S=e.getSnapshotBeforeUpdate(h,p));var k,I,A=r&&r.nodeName;if("function"==typeof A){var L=g(r);(a=v)&&a.constructor===A&&L.key==a.__key?P(a,L,1,d,!1):(k=a,e._component=a=O(A,L,d),a.nextBase=a.nextBase||y,a._parentComponent=e,P(a,L,0,d,!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,d,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,U=e;U=U._parentComponent;)(R=U).base=I;I._component=R,I._componentConstructor=R.constructor}}for(!m||n?b.push(e):w||(e.componentDidUpdate&&e.componentDidUpdate(h,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=[]}function R(e,t,i){return C(i,e,{},!1,t,!1)}function U(e,t){return U=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},U(e,t)}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),h(this)},forceUpdate:function(e){e&&this._renderCallbacks.push(e),D(this,2)},render:function(){}}),i(700),i(4728),i(880),i(9836),i(7476);var F=function(e){var t,i;function n(){for(var t,i=arguments.length,n=new Array(i),s=0;s<i;s++)n[s]=arguments[s];return(t=e.call.apply(e,[this].concat(n))||this).state={bump:!1,debounced:!1},t}i=e,(t=n).prototype=Object.create(i.prototype),t.prototype.constructor=t,U(t,i);var s=n.prototype;return s.componentWillMount=function(){var e,t,i,n=this;this.debounceStatusUpdate=(e=function(){if(!n.state.debounced){var e=!n.props.isInFocus||n.props.validChoiceMade;n.setState((function(t){return{bump:!t.bump,debounced:!0,silenced:e}}))}},t=1400,function(){var n=this,s=arguments;clearTimeout(i),i=setTimeout((function(){i=null,e.apply(n,s)}),t)})},s.componentWillReceiveProps=function(e){e.queryLength,this.setState({debounced:!1})},s.render=function(){var e=this.props,t=e.id,i=e.length,n=e.queryLength,s=e.minQueryLength,r=e.selectedOption,o=e.selectedOptionIndex,l=e.tQueryTooShort,u=e.tNoResults,c=e.tSelectedOption,d=e.tResults,h=e.className,p=this.state,f=p.bump,m=p.debounced,g=p.silenced,y=n<s,_=0===i,v=r?c(r,i,o):"",b=null;return b=y?l(s):_?u():d(i,v),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:t+"__status--A",role:"status","aria-atomic":"true","aria-live":"polite"},!g&&m&&f?b:""),a("div",{id:t+"__status--B",role:"status","aria-atomic":"true","aria-live":"polite"},g||!m||f?"":b))},n}(N);F.defaultProps={tQueryTooShort:function(e){return"Type in "+e+" or more characters for results"},tNoResults:function(){return"No search results"},tSelectedOption:function(e,t,i){return e+" "+(i+1)+" of "+t+" is highlighted"},tResults:function(e,t){return e+" "+(1===e?"result":"results")+" "+(1===e?"is":"are")+" available. "+t}};var B=function(e){return a("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",className:e.className,focusable:"false"},a("g",{stroke:"none",fill:"none","fill-rule":"evenodd"},a("polygon",{fill:"#000000",points:"0 0 22 0 11 17"})))};function j(){return j=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},j.apply(this,arguments)}function $(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function q(e,t){return q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},q(e,t)}var V={13:"enter",27:"escape",32:"space",38:"up",40:"down"};function H(){return"undefined"!=typeof navigator&&!(!navigator.userAgent.match(/(iPod|iPhone|iPad)/g)||!navigator.userAgent.match(/AppleWebKit/g))}var z=function(e){var t,i;function n(t){var i;return(i=e.call(this,t)||this).elementReferences={},i.state={focused:null,hovered:null,menuOpen:!1,options:t.defaultValue?[t.defaultValue]:[],query:t.defaultValue,validChoiceMade:!1,selected:null,ariaHint:!0},i.handleComponentBlur=i.handleComponentBlur.bind($(i)),i.handleKeyDown=i.handleKeyDown.bind($(i)),i.handleUpArrow=i.handleUpArrow.bind($(i)),i.handleDownArrow=i.handleDownArrow.bind($(i)),i.handleEnter=i.handleEnter.bind($(i)),i.handlePrintableKey=i.handlePrintableKey.bind($(i)),i.handleListMouseLeave=i.handleListMouseLeave.bind($(i)),i.handleOptionBlur=i.handleOptionBlur.bind($(i)),i.handleOptionClick=i.handleOptionClick.bind($(i)),i.handleOptionFocus=i.handleOptionFocus.bind($(i)),i.handleOptionMouseDown=i.handleOptionMouseDown.bind($(i)),i.handleOptionMouseEnter=i.handleOptionMouseEnter.bind($(i)),i.handleInputBlur=i.handleInputBlur.bind($(i)),i.handleInputChange=i.handleInputChange.bind($(i)),i.handleInputClick=i.handleInputClick.bind($(i)),i.handleInputFocus=i.handleInputFocus.bind($(i)),i.pollInputElement=i.pollInputElement.bind($(i)),i.getDirectInputChanges=i.getDirectInputChanges.bind($(i)),i}i=e,(t=n).prototype=Object.create(i.prototype),t.prototype.constructor=t,q(t,i);var s=n.prototype;return s.isQueryAnOption=function(e,t){var i=this;return-1!==t.map((function(e){return i.templateInputValue(e).toLowerCase()})).indexOf(e.toLowerCase())},s.componentDidMount=function(){this.pollInputElement()},s.componentWillUnmount=function(){clearTimeout(this.$pollInput)},s.pollInputElement=function(){var e=this;this.getDirectInputChanges(),this.$pollInput=setTimeout((function(){e.pollInputElement()}),100)},s.getDirectInputChanges=function(){var e=this.elementReferences[-1];e&&e.value!==this.state.query&&this.handleInputChange({target:{value:e.value}})},s.componentDidUpdate=function(e,t){var i=this.state.focused,n=null===i,s=t.focused!==i;s&&!n&&this.elementReferences[i].focus();var r=-1===i,a=s&&null===t.focused;if(r&&a){var o=this.elementReferences[i];o.setSelectionRange(0,o.value.length)}},s.hasAutoselect=function(){return!H()&&this.props.autoselect},s.templateInputValue=function(e){var t=this.props.templates&&this.props.templates.inputValue;return t?t(e):e},s.templateSuggestion=function(e){var t=this.props.templates&&this.props.templates.suggestion;return t?t(e):e},s.handleComponentBlur=function(e){var t,i=this.state,n=i.options,s=i.query,r=i.selected;this.props.confirmOnBlur?(t=e.query||s,this.props.onConfirm(n[r])):t=s,this.setState({focused:null,menuOpen:e.menuOpen||!1,query:t,selected:null,validChoiceMade:this.isQueryAnOption(t,n)})},s.handleListMouseLeave=function(e){this.setState({hovered:null})},s.handleOptionBlur=function(e,t){var i=this.state,n=i.focused,s=i.menuOpen,r=i.options,a=i.selected,o=null===e.relatedTarget,l=e.relatedTarget===this.elementReferences[-1],u=n!==t&&-1!==n;if(!u&&o||!u&&!l){var c=s&&H();this.handleComponentBlur({menuOpen:c,query:this.templateInputValue(r[a])})}},s.handleInputBlur=function(e){var t=this.state,i=t.focused,n=t.menuOpen,s=t.options,r=t.query,a=t.selected;if(-1===i){var o=n&&H(),l=H()?r:this.templateInputValue(s[a]);this.handleComponentBlur({menuOpen:o,query:l})}},s.handleInputChange=function(e){var t=this,i=this.props,n=i.minLength,s=i.source,r=i.showAllValues,a=this.hasAutoselect(),o=e.target.value,l=0===o.length,u=this.state.query!==o,c=o.length>=n;this.setState({query:o,ariaHint:l}),r||!l&&u&&c?s(o,(function(e){var i=e.length>0;t.setState({menuOpen:i,options:e,selected:a&&i?0:-1,validChoiceMade:!1})})):!l&&c||this.setState({menuOpen:!1,options:[]})},s.handleInputClick=function(e){this.handleInputChange(e)},s.handleInputFocus=function(e){var t=this.state,i=t.query,n=t.validChoiceMade,s=t.options,r=this.props.minLength,a=!n&&i.length>=r&&s.length>0;a?this.setState((function(e){var t=e.menuOpen;return{focused:-1,menuOpen:a||t,selected:-1}})):this.setState({focused:-1})},s.handleOptionFocus=function(e){this.setState({focused:e,hovered:null,selected:e})},s.handleOptionMouseEnter=function(e,t){H()||this.setState({hovered:t})},s.handleOptionClick=function(e,t){var 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()},s.handleOptionMouseDown=function(e){e.preventDefault()},s.handleUpArrow=function(e){e.preventDefault();var t=this.state,i=t.menuOpen,n=t.selected;-1!==n&&i&&this.handleOptionFocus(n-1)},s.handleDownArrow=function(e){var t=this;if(e.preventDefault(),this.props.showAllValues&&!1===this.state.menuOpen)e.preventDefault(),this.props.source("",(function(e){t.setState({menuOpen:!0,options:e,selected:0,focused:0,hovered:null})}));else if(!0===this.state.menuOpen){var i=this.state,n=i.menuOpen,s=i.options,r=i.selected;r!==s.length-1&&n&&this.handleOptionFocus(r+1)}},s.handleSpace=function(e){var t=this;this.props.showAllValues&&!1===this.state.menuOpen&&""===this.state.query&&(e.preventDefault(),this.props.source("",(function(e){t.setState({menuOpen:!0,options:e})}))),-1!==this.state.focused&&(e.preventDefault(),this.handleOptionClick(e,this.state.focused))},s.handleEnter=function(e){this.state.menuOpen&&(e.preventDefault(),this.state.selected>=0&&this.handleOptionClick(e,this.state.selected))},s.handlePrintableKey=function(e){var t=this.elementReferences[-1];e.target===t||t.focus()},s.handleKeyDown=function(e){switch(V[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},s.render=function(){var e,t=this,i=this.props,n=i.cssNamespace,s=i.displayMenu,r=i.id,o=i.minLength,l=i.name,u=i.placeholder,c=i.required,d=i.showAllValues,h=i.tNoResults,p=i.tStatusQueryTooShort,f=i.tStatusNoResults,m=i.tStatusSelectedOption,g=i.tStatusResults,y=i.tAssistiveHint,_=i.dropdownArrow,v=i.menuAttributes,b=i.inputClasses,T=i.hintClasses,w=i.menuClasses,S=this.state,E=S.focused,C=S.hovered,k=S.menuOpen,x=S.options,I=S.query,A=S.selected,O=S.ariaHint,L=S.validChoiceMade,P=this.hasAutoselect(),D=-1===E,M=0===x.length,N=0!==I.length,R=I.length>=o,U=this.props.showNoOptionsFound&&D&&M&&N&&R,B=n+"__wrapper",$=n+"__status",q=n+"__dropdown-arrow-down",V=-1!==E&&null!==E,z=n+"__option",W=n+"__hint",G=this.templateInputValue(x[A]),X=G&&0===G.toLowerCase().indexOf(I.toLowerCase())&&P?I+G.substr(I.length):"",K=r+"__assistiveHint",Y={"aria-describedby":O?K:null,"aria-expanded":k?"true":"false","aria-activedescendant":V?r+"__option--"+E:null,"aria-controls":r+"__listbox","aria-autocomplete":this.hasAutoselect()?"both":"list"};d&&"string"==typeof(e=_({className:q}))&&(e=a("div",{className:n+"__dropdown-arrow-down-wrapper",dangerouslySetInnerHTML:{__html:e}}));var Q=n+"__input",J=[Q,this.props.showAllValues?Q+"--show-all-values":Q+"--default"];null!==E&&J.push(Q+"--focused"),b&&J.push(b);var Z=n+"__menu",ee=[Z,Z+"--"+s,Z+"--"+(k||U?"visible":"hidden")];w&&ee.push(w),(null!=v&&v.class||null!=v&&v.className)&&ee.push((null==v?void 0:v.class)||(null==v?void 0:v.className));var te=Object.assign({"aria-labelledby":r},v,{id:r+"__listbox",role:"listbox",className:ee.join(" "),onMouseLeave:this.handleListMouseLeave});return delete te.class,a("div",{className:B,onKeyDown:this.handleKeyDown},a(F,{id:r,length:x.length,queryLength:I.length,minQueryLength:o,selectedOption:this.templateInputValue(x[A]),selectedOptionIndex:A,validChoiceMade:L,isInFocus:null!==this.state.focused,tQueryTooShort:p,tNoResults:f,tSelectedOption:m,tResults:g,className:$}),X&&a("span",null,a("input",{className:[W,null===T?b:T].filter(Boolean).join(" "),readonly:!0,tabIndex:"-1",value:X})),a("input",j({},Y,{autoComplete:"off",className:J.join(" "),id:r,onClick:this.handleInputClick,onBlur:this.handleInputBlur},{onInput:this.handleInputChange},{onFocus:this.handleInputFocus,name:l,placeholder:u,ref:function(e){t.elementReferences[-1]=e},type:"text",role:"combobox",required:c,value:I})),e,a("ul",te,x.map((function(e,i){var n=(-1===E?A===i:E===i)&&null===C?" "+z+"--focused":"",s=i%2?" "+z+"--odd":"",o=H()?"<span id="+r+"__option-suffix--"+i+' 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"> '+(i+1)+" of "+x.length+"</span>":"";return a("li",{"aria-selected":E===i?"true":"false",className:""+z+n+s,dangerouslySetInnerHTML:{__html:t.templateSuggestion(e)+o},id:r+"__option--"+i,key:i,onBlur:function(e){return t.handleOptionBlur(e,i)},onClick:function(e){return t.handleOptionClick(e,i)},onMouseDown:t.handleOptionMouseDown,onMouseEnter:function(e){return t.handleOptionMouseEnter(e,i)},ref:function(e){t.elementReferences[i]=e},role:"option",tabIndex:"-1","aria-posinset":i+1,"aria-setsize":x.length})})),U&&a("li",{className:z+" "+z+"--no-results",role:"option","aria-disabled":"true"},h())),a("span",{id:K,style:{display:"none"}},y()))},n}(N);function W(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=G(e.source)),R(a(z,e),e.element)}z.defaultProps={autoselect:!1,cssNamespace:"autocomplete",defaultValue:"",displayMenu:"inline",minLength:0,name:"input-autocomplete",placeholder:"",onConfirm:function(){},confirmOnBlur:!0,showNoOptionsFound:!0,showAllValues:!1,required:!1,tNoResults:function(){return"No results found"},tAssistiveHint:function(){return"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:B,menuAttributes:{},inputClasses:null,hintClasses:null,menuClasses:null};var G=function(e){return function(t,i){i(e.filter((function(e){return-1!==e.toLowerCase().indexOf(t.toLowerCase())})))}};W.enhanceSelectElement=function(e){if(!e.selectElement)throw new Error("selectElement is not defined");if(!e.source){var t=[].filter.call(e.selectElement.options,(function(t){return t.value||e.preserveNullOptions}));e.source=t.map((function(e){return e.textContent||e.innerText}))}if(e.onConfirm=e.onConfirm||function(t){var i=[].filter.call(e.selectElement.options,(function(e){return(e.textContent||e.innerText)===t}))[0];i&&(i.selected=!0)},e.selectElement.value||void 0===e.defaultValue){var i=e.selectElement.options[e.selectElement.options.selectedIndex];e.defaultValue=i.textContent||i.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);var n=document.createElement("div");e.selectElement.parentNode.insertBefore(n,e.selectElement),W(Object.assign({},e,{element:n})),e.selectElement.style.display="none",e.selectElement.id=e.selectElement.id+"-select"};var X=W}(),n.default}()}));Br.accessibleAutocomplete;const jr={autocomplete:[]},$r="autocomplete-list-show",qr="data-bs-autocomplete",Vr="input["+qr+'][type="search"]';class Hr extends fi{constructor(e,t){super(e),this._config=this._getConfig(t),this._items=[],this._autocompleteElement=null,this._label=new Ei(e),this._init(),this._bindEvents()}static get NAME(){return"inputsearchautocomplete"}search(){const e=this._element.value;
1
+ !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",t="focus--mouse";class i{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",(i=>{this._usingMouse&&i.target&&(i.target.classList.add(t),i.target.setAttribute(e,!0))})),document.addEventListener("focusout",(i=>{i.target&&(i.target.classList.remove(t),i.target.setAttribute(e,!1))}))}}new i;const n=()=>{"undefined"==typeof window||window.BOOTSTRAP_ITALIA_VERSION||(new i,window.BOOTSTRAP_ITALIA_VERSION="2.13.4")};n();const s={ck3:{}},r={rememberChoice:(e,t)=>{s.ck3[e]=t,localStorage.setItem("bs-ck3",JSON.stringify(s.ck3))},isChoiceRemembered:e=>(s.ck3=JSON.parse(localStorage.getItem("bs-ck3")||"{}"),s.ck3[e]||!1),clearAllRememberedChoices:()=>{localStorage.removeItem("bs-ck3")}},a="splide",o=`data-${a}`,l={CREATED:1,MOUNTED:2,IDLE:3,MOVING:4,DESTROYED:5};function u(e){e.length=0}function c(e){return!f(e)&&"object"==typeof e}function d(e){return Array.isArray(e)}function h(e){return"string"==typeof e}function p(e){return void 0===e}function f(e){return null===e}function m(e){return e instanceof HTMLElement}function g(e){return d(e)?e:[e]}function y(e,t){g(e).forEach(t)}function _(e,t){return e.indexOf(t)>-1}function v(e,t){return e.push(...g(t)),e}const b=Array.prototype;function T(e,t,i){return b.slice.call(e,t,i)}function w(e,t,i){e&&y(t,(t=>{t&&e.classList[i?"add":"remove"](t)}))}function S(e,t){w(e,h(t)?t.split(" "):t,!0)}function E(e,t){y(t,e.appendChild.bind(e))}function C(e,t){y(e,(e=>{const i=t.parentNode;i&&i.insertBefore(e,t)}))}function k(e,t){return m(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function x(e,t){return e?T(e.children).filter((e=>k(e,t))):[]}function I(e,t){return t?x(e,t)[0]:e.firstElementChild}function A(e,t,i){if(e){let n=Object.keys(e);n=i?n.reverse():n;for(let i=0;i<n.length;i++){const s=n[i];if("__proto__"!==s&&!1===t(e[s],s))break}}return e}function O(e){return T(arguments,1).forEach((t=>{A(t,((i,n)=>{e[n]=t[n]}))})),e}function L(e,t){return A(t,((t,i)=>{d(t)?e[i]=t.slice():c(t)?e[i]=L(c(e[i])?e[i]:{},t):e[i]=t})),e}function P(e,t){e&&y(t,(t=>{e.removeAttribute(t)}))}function D(e,t,i){c(t)?A(t,((t,i)=>{D(e,i,t)})):f(i)?P(e,t):e.setAttribute(t,String(i))}function M(e,t,i){const n=document.createElement(e);return t&&(h(t)?S(n,t):D(n,t)),i&&E(i,n),n}function N(e,t,i){if(p(i))return getComputedStyle(e)[t];if(!f(i)){const{style:n}=e;i=`${i}`,n[t]!==i&&(n[t]=i)}}function R(e,t){N(e,"display",t)}function U(e,t){return e.getAttribute(t)}function F(e,t){return e&&e.classList.contains(t)}function B(e){return e.getBoundingClientRect()}function j(e){y(e,(e=>{e&&e.parentNode&&e.parentNode.removeChild(e)}))}function $(e){return I((new DOMParser).parseFromString(e,"text/html").body)}function q(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function V(e,t){return e&&e.querySelector(t)}function H(e,t){return T(e.querySelectorAll(t))}function z(e,t){w(e,t,!1)}function W(e){return h(e)?e:e?`${e}px`:""}function G(e,t=""){if(!e)throw new Error(`[${a}] ${t}`)}function X(e){setTimeout(e)}const K=()=>{};function Y(e){return requestAnimationFrame(e)}const{min:Q,max:J,floor:Z,ceil:ee,abs:te}=Math;function ie(e,t,i,n){const s=Q(t,i),r=J(t,i);return n?s<e&&e<r:s<=e&&e<=r}function ne(e,t,i){const n=Q(t,i),s=J(t,i);return Q(J(n,e),s)}function se(e){return+(e>0)-+(e<0)}function re(e,t){return y(t,(t=>{e=e.replace("%s",`${t}`)})),e}function ae(e){return e<10?`0${e}`:`${e}`}const oe={};const le="mounted",ue="ready",ce="move",de="moved",he="shifted",pe="click",fe="visible",me="hidden",ge="slide:keydown",ye="refresh",_e="updated",ve="resize",be="resized",Te="repositioned",we="scroll",Se="scrolled",Ee="destroy",Ce="navigation:mounted",ke="lazyload:loaded";function xe(e){const{event:t}=e,i={};let n=[];function s(e,t,i){r(e,t,((e,t)=>{n=n.filter((n=>!!(n[0]!==e||n[1]!==t||i&&n[2]!==i)||(e.removeEventListener(t,n[2],n[3]),!1)))}))}function r(e,t,i){y(e,(e=>{e&&t.split(" ").forEach(i.bind(null,e))}))}function a(){n=n.filter((e=>s(e[0],e[1]))),t.offBy(i)}return t.on(Ee,a,i),{on:function(e,n,s){t.on(e,n,i,s)},off:function(e){t.off(e,i)},emit:t.emit,bind:function(e,t,i,s){r(e,t,((e,t)=>{n.push([e,t,i,s]),e.addEventListener(t,i,s)}))},unbind:s,destroy:a}}function Ie(e,t,i,n){const{now:s}=Date;let r,a,o=0,l=!0,u=0;function c(){if(!l){const a=s()-r;if(a>=e?(o=1,r=s()):o=a/e,i&&i(o),1===o&&(t(),n&&++u>=n))return d();Y(c)}}function d(){l=!0}function h(){cancelAnimationFrame(a),o=0,a=0,l=!0}return{start:function(t){!t&&h(),r=s()-(t?o*e:0),l=!1,Y(c)},rewind:function(){r=s(),o=0,i&&i(o)},pause:d,cancel:h,set:function(t){e=t},isPaused:function(){return l}}}function Ae(e,t){let i;return function(){i||(i=Ie(0,(()=>{e.apply(this,arguments),i=null}),null,1),i.start())}}const Oe="ttb",Le={marginRight:["marginBottom","marginLeft"],autoWidth:["autoHeight"],fixedWidth:["fixedHeight"],paddingLeft:["paddingTop","paddingRight"],paddingRight:["paddingBottom","paddingLeft"],width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:["ArrowUp","ArrowRight"],ArrowRight:["ArrowDown","ArrowLeft"]};const Pe=a,De=`${a}__slider`,Me=`${a}__track`,Ne=`${a}__list`,Re=`${a}__slide`,Ue=`${Re}--clone`,Fe=`${Re}__container`,Be=`${a}__arrows`,je=`${a}__arrow`,$e=`${je}--prev`,qe=`${je}--next`,Ve=`${a}__pagination`,He=`${a}__progress`,ze=`${He}__bar`,We=`${a}__autoplay`,Ge=`${a}__play`,Xe=`${a}__pause`,Ke="is-active",Ye="is-prev",Qe="is-next",Je="is-visible",Ze="is-loading",et=[Ke,Je,Ye,Qe,Ze],tt={slide:Re,clone:Ue,arrows:Be,arrow:je,prev:$e,next:qe,pagination:Ve,page:`${Ve}__page`,spinner:`${a}__spinner`};const it="role",nt="aria-controls",st="aria-current",rt="aria-label",at="aria-hidden",ot="tabindex",lt="aria-orientation",ut=[it,nt,st,rt,at,lt,ot,"disabled"],ct="slide",dt="loop",ht="fade";function pt(e,t,i,n){const{on:s,emit:r,bind:a,destroy:o}=xe(e),{Components:l,root:u,options:c}=e,{isNavigation:d,updateOnMove:h}=c,{resolve:p}=l.Direction,f=U(n,"style"),m=i>-1,g=I(n,`.${Fe}`),y=c.focusableNodes&&H(n,c.focusableNodes);let _;function v(){const s=m?i:t,r=re(c.i18n.slideX,s+1),a=e.splides.map((e=>e.splide.root.id)).join(" ");D(n,rt,r),D(n,nt,a),D(n,it,"menuitem"),S(E())}function b(){_||T()}function T(){if(!_){const{index:i}=e;S(E()),function(e){const t=!e&&(!E()||m);D(n,at,t||null),D(n,ot,!t&&c.slideFocus?0:null),y&&y.forEach((e=>{D(e,ot,t?-1:null)}));e!==F(n,Je)&&(w(n,Je,e),r(e?fe:me,C))}(function(){if(e.is(ht))return E();const t=B(l.Elements.track),i=B(n),s=p("left"),r=p("right");return Z(t[s])<=ee(i[s])&&Z(i[r])<=ee(t[r])}()),w(n,Ye,t===i-1),w(n,Qe,t===i+1)}}function S(e){e!==F(n,Ke)&&(w(n,Ke,e),d&&D(n,st,e||null),r(e?"active":"inactive",C))}function E(){const{index:n}=e;return n===t||c.cloneStatus&&n===i}const C={index:t,slideIndex:i,slide:n,container:g,isClone:m,mount:function(){m||(n.id=`${u.id}-slide${ae(t+1)}`),a(n,"click keydown",(e=>{r("click"===e.type?pe:ge,C,e)})),s([ye,Te,he,de,Se],T),s(Ce,v),h&&s(ce,b)},destroy:function(){_=!0,o(),z(n,et),P(n,ut),D(n,"style",f)},update:T,style:function(e,t,i){N(i&&g||n,e,t)},isWithin:function(i,n){let s=te(i-t);return m||!c.rewind&&!e.is(dt)||(s=Q(s,e.length-s)),s<=n}};return C}const ft=`${o}-interval`;const mt={passive:!1,capture:!0},gt="touchmove mousemove",yt="touchend touchcancel mouseup";const _t=["Left","Right","Up","Down"],vt="keydown";const bt=`${o}-lazy`,Tt=`${bt}-srcset`,wt=`[${bt}], [${Tt}]`;const St=[" ","Enter","Spacebar"];var Et=Object.freeze({__proto__:null,Options:function(e,t,i){const n=Ae(u);let s,r,a;function l(e){e&&removeEventListener("resize",n)}function u(){const t=(n=e=>e[1].matches,T(r).filter(n)[0]||[]);var n;t[0]!==a&&function(t){const n=i.breakpoints[t]||s;n.destroy?(e.options=s,e.destroy("completely"===n.destroy)):(e.state.is(5)&&(l(!0),e.mount()),e.options=n)}(a=t[0])}return{setup:function(){try{L(i,JSON.parse(U(e.root,o)))}catch(e){G(!1,e.message)}s=L({},i);const{breakpoints:t}=i;if(t){const e="min"===i.mediaQuery;r=Object.keys(t).sort(((t,i)=>e?+i-+t:+t-+i)).map((t=>[t,matchMedia(`(${e?"min":"max"}-width:${t}px)`)])),u()}},mount:function(){r&&addEventListener("resize",n)},destroy:l}},Direction:function(e,t,i){return{resolve:function(e,t){const{direction:n}=i;return Le[e]["rtl"!==n||t?n===Oe?0:-1:1]||e},orient:function(e){return e*("rtl"===i.direction?1:-1)}}},Elements:function(e,t,i){const{on:n}=xe(e),{root:s}=e,r={},o=[];let l,c,d,h;function p(){!function(){c=I(s,`.${De}`),d=V(s,`.${Me}`),h=I(d,`.${Ne}`),G(d&&h,"A track/list element is missing."),v(o,x(h,`.${Re}:not(.${Ue})`));const e=y(`.${We}`),t=y(`.${Be}`);O(r,{root:s,slider:c,track:d,list:h,slides:o,arrows:t,autoplay:e,prev:V(t,`.${$e}`),next:V(t,`.${qe}`),bar:V(y(`.${He}`),`.${ze}`),play:V(e,`.${Ge}`),pause:V(e,`.${Xe}`)})}(),function(){const e=s.id||(t=a,`${t}${ae(oe[t]=(oe[t]||0)+1)}`);var t;s.id=e,d.id=d.id||`${e}-track`,h.id=h.id||`${e}-list`}(),S(s,l=_())}function f(){[s,d,h].forEach((e=>{P(e,"style")})),u(o),z(s,l)}function m(){f(),p()}function g(){z(s,l),S(s,l=_())}function y(e){return I(s,e)||I(c,e)}function _(){return[`${Pe}--${i.type}`,`${Pe}--${i.direction}`,i.drag&&`${Pe}--draggable`,i.isNavigation&&`${Pe}--nav`,Ke]}return O(r,{setup:p,mount:function(){n(ye,m,8),n(_e,g)},destroy:f})},Slides:function(e,t,i){const{on:n,emit:s,bind:r}=xe(e),{slides:a,list:o}=t.Elements,l=[];function c(){a.forEach(((e,t)=>{f(e,t,-1)}))}function d(){b((e=>{e.destroy()})),u(l)}function p(){d(),c()}function f(t,i,n){const s=pt(e,i,n,t);s.mount(),l.push(s)}function v(e){return e?T((e=>!e.isClone)):l}function b(e,t){v(t).forEach(e)}function T(e){return l.filter("function"==typeof e?e:t=>h(e)?k(t.slide,e):_(g(e),t.index))}return{mount:function(){c(),n(ye,p),n([le,ye],(()=>{l.sort(((e,t)=>e.index-t.index))}))},destroy:d,update:function(){b((e=>{e.update()}))},register:f,get:v,getIn:function(e){const{Controller:n}=t,s=n.toIndex(e),r=n.hasFocus()?1:i.perPage;return T((e=>ie(e.index,s,s+r-1)))},getAt:function(e){return T(e)[0]},add:function(e,t){y(e,(e=>{if(h(e)&&(e=$(e)),m(e)){const n=a[t];n?C(e,n):E(o,e),S(e,i.classes.slide),function(e,t){const i=H(e,"img");let{length:n}=i;n?i.forEach((e=>{r(e,"load error",(()=>{--n||t()}))})):t()}(e,s.bind(null,ve))}})),s(ye)},remove:function(e){j(T(e).map((e=>e.slide))),s(ye)},forEach:b,filter:T,style:function(e,t,i){b((n=>{n.style(e,t,i)}))},getLength:function(e){return e?a.length:l.length},isEnough:function(){return l.length>i.perPage}}},Layout:function(e,t,i){const{on:n,bind:s,emit:r}=xe(e),{Slides:a}=t,{resolve:o}=t.Direction,{root:l,track:u,list:d}=t.Elements,{getAt:h}=a;let p,f;function m(){f=null,p=i.direction===Oe,N(l,"maxWidth",W(i.width)),N(u,o("paddingLeft"),y(!1)),N(u,o("paddingRight"),y(!0)),g()}function g(){const e=B(l);f&&f.width===e.width&&f.height===e.height||(N(u,"height",function(){let e="";p&&(e=_(),G(e,"height or heightRatio is missing."),e=`calc(${e} - ${y(!1)} - ${y(!0)})`);return e}()),a.style(o("marginRight"),W(i.gap)),a.style("width",(i.autoWidth?"":W(i.fixedWidth)||(p?"":v()))||null),a.style("height",W(i.fixedHeight)||(p?i.autoHeight?"":v():_())||null,!0),f=e,r(be))}function y(e){const{padding:t}=i,n=o(e?"right":"left");return t&&W(t[n]||(c(t)?0:t))||"0px"}function _(){return W(i.height||B(d).width*i.heightRatio)}function v(){const e=W(i.gap);return`calc((100%${e&&` + ${e}`})/${i.perPage||1}${e&&` - ${e}`})`}function b(e,t){const i=h(e);if(i){const e=B(i.slide)[o("right")],n=B(d)[o("left")];return te(e-n)+(t?0:T())}return 0}function T(){const e=h(0);return e&&parseFloat(N(e.slide,o("marginRight")))||0}return{mount:function(){m(),s(window,"resize load",Ae(r.bind(this,ve))),n([_e,ye],m),n(ve,g)},listSize:function(){return B(d)[o("width")]},slideSize:function(e,t){const i=h(e||0);return i?B(i.slide)[o("width")]+(t?0:T()):0},sliderSize:function(){return b(e.length-1,!0)-b(-1,!0)},totalSize:b,getPadding:function(e){return parseFloat(N(u,o("padding"+(e?"Right":"Left"))))||0}}},Clones:function(e,t,i){const{on:n,emit:s}=xe(e),{Elements:r,Slides:a}=t,{resolve:o}=t.Direction,l=[];let c;function d(){(c=g())&&(!function(t){const n=a.get().slice(),{length:s}=n;if(s){for(;n.length<t;)v(n,n);v(n.slice(-t),n.slice(0,t)).forEach(((o,u)=>{const c=u<t,d=function(t,n){const s=t.cloneNode(!0);return S(s,i.classes.clone),s.id=`${e.root.id}-clone${ae(n+1)}`,s}(o.slide,u);c?C(d,n[0].slide):E(r.list,d),v(l,d),a.register(d,u-t+(c?0:s),o.index)}))}}(c),s(ve))}function p(){j(l),u(l)}function f(){p(),d()}function m(){c<g()&&s(ye)}function g(){let{clones:t}=i;if(e.is(dt)){if(!t){const n=function(e,t){if(h(t)){const i=M("div",{style:`width: ${t}; position: absolute;`},e);t=B(i).width,j(i)}return t}(r.list,i[o("fixedWidth")]);t=(n&&ee(B(r.track)[o("width")]/n)||i[o("autoWidth")]&&e.length||i.perPage)*(i.drag?(i.flickMaxPages||1)+1:2)}}else t=0;return t}return{mount:function(){d(),n(ye,f),n([_e,ve],m)},destroy:p}},Move:function(e,t,i){const{on:n,emit:s}=xe(e),{slideSize:r,getPadding:a,totalSize:o,listSize:l,sliderSize:u}=t.Layout,{resolve:c,orient:d}=t.Direction,{list:h,track:f}=t.Elements;let m;function g(){S()||(t.Scroll.cancel(),y(e.index),s(Te))}function y(e){_(b(e,!0))}function _(t,i){if(!e.is(ht)){const n=i?t:function(t){if(e.is(dt)){const e=d(t-T()),i=E(!1,t)&&e<0,n=E(!0,t)&&e>0;(i||n)&&(t=v(t,n))}return t}(t);h.style.transform=`translate${c("X")}(${n}px)`,t!==n&&s(he)}}function v(e,t){const i=e-w(t),n=u();return e-=d(n*(ee(te(i)/n)||1))*(t?1:-1)}function b(t,n){const s=d(o(t-1)-function(e){const{focus:t}=i;return"center"===t?(l()-r(e,!0))/2:+t*r(e)||0}(t));return n?function(t){i.trimSpace&&e.is(ct)&&(t=ne(t,0,d(u()-l())));return t}(s):s}function T(){const e=c("left");return B(h)[e]-B(f)[e]+d(a(!1))}function w(e){return b(e?t.Controller.getEnd():0,!!i.trimSpace)}function S(){return e.state.is(4)&&i.waitForTransition}function E(e,t){t=p(t)?T():t;const i=!0!==e&&d(t)<d(w(!1)),n=!1!==e&&d(t)>d(w(!0));return i||n}return{mount:function(){m=t.Transition,n([le,be,_e,ye],g)},destroy:function(){P(h,"style")},move:function(n,r,a,o){if(!S()){const{set:l}=e.state,u=T();n!==r&&(m.cancel(),_(v(u,n>r),!0)),l(4),s(ce,r,a,n),m.start(r,(()=>{l(3),s(de,r,a,n),"move"===i.trimSpace&&n!==a&&u===T()?t.Controller.go(n>a?">":"<",!1,o):o&&o()}))}},jump:y,translate:_,shift:v,cancel:function(){_(T()),m.cancel()},toIndex:function(e){const i=t.Slides.get();let n=0,s=1/0;for(let t=0;t<i.length;t++){const r=i[t].index,a=te(b(r,!0)-e);if(!(a<=s))break;s=a,n=r}return n},toPosition:b,getPosition:T,getLimit:w,isBusy:S,exceededLimit:E}},Controller:function(e,t,i){const{on:n}=xe(e),{Move:s}=t,{getPosition:r,getLimit:a}=s,{isEnough:o,getLength:l}=t.Slides,u=e.is(dt),c=e.is(ct);let d,f,m,g=i.start||0,y=g;function _(){d=l(!0),f=i.perMove,m=i.perPage,g=ne(g,0,d-1)}function v(e,i,n,r,a){const o=i?e:I(e);t.Scroll.scroll(i||n?s.toPosition(o,!0):e,r,(()=>{A(s.toIndex(s.getPosition())),a&&a()}))}function b(e){return w(!1,e)}function T(e){return w(!0,e)}function w(e,t){const i=f||(O()?1:m),n=S(g+i*(e?-1:1),g);return-1!==n||!c||(s=r(),o=a(!e),l=1,te(s-o)<l)?t?n:C(n):e?0:E();var s,o,l}function S(e,t,n){if(o()){const s=E();e<0||e>s?e=ie(0,e,t,!0)||ie(s,t,e,!0)?k(x(e)):u?f||O()?e:e<0?-(d%m||m):d:i.rewind?e<0?s:0:-1:n||e===t||(e=f?e:k(x(t)+(e<t?-1:1)))}else e=-1;return e}function E(){let e=d-m;return(O()||u&&f)&&(e=d-1),J(e,0)}function C(e){return u?o()?e%d+(e<0?d:0):-1:e}function k(e){return ne(O()?e:m*e,0,E())}function x(e){return O()||(e=ie(e,d-m,d-1)?d-1:e,e=Z(e/m)),e}function I(e){const t=s.toIndex(e);return c?ne(t,0,E()):t}function A(e){e!==g&&(y=g,g=e)}function O(){return!p(i.focus)||i.isNavigation}return{mount:function(){_(),n([_e,ye],_,9)},go:function(e,t,n){const r=function(e){let t=g;if(h(e)){const[,i,n]=e.match(/([+\-<>])(\d+)?/)||[];"+"===i||"-"===i?t=S(g+ +`${i}${+n||1}`,g,!0):">"===i?t=n?k(+n):b(!0):"<"===i&&(t=T(!0))}else t=u?e:ne(e,0,E());return t}(e);if(i.useScroll)v(r,!0,!0,i.speed,n);else{const e=C(r);e>-1&&!s.isBusy()&&(t||e!==g)&&(A(e),s.move(r,e,y,n))}},scroll:v,getNext:b,getPrev:T,getAdjacent:w,getEnd:E,setIndex:A,getIndex:function(e){return e?y:g},toIndex:k,toPage:x,toDest:I,hasFocus:O}},Arrows:function(e,t,i){const{on:n,bind:s,emit:r}=xe(e),{classes:a,i18n:o}=i,{Elements:l,Controller:u}=t;let c,d=l.arrows,h=l.prev,p=l.next;const f={};function m(){if(i.arrows&&(h&&p||(d=M("div",a.arrows),h=g(!0),p=g(!1),c=!0,E(d,[h,p]),C(d,I("slider"===i.arrows&&l.slider||e.root)))),h&&p)if(f.prev)R(d,!1===i.arrows?"none":"");else{const{id:e}=l.track;D(h,nt,e),D(p,nt,e),f.prev=h,f.next=p,function(){const{go:e}=u;n([le,de,_e,ye,Se],y),s(p,"click",(()=>{e(">",!0)})),s(h,"click",(()=>{e("<",!0)}))}(),r("arrows:mounted",h,p)}}function g(e){return $(`<button class="${a.arrow} ${e?a.prev:a.next}" type="button"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40"><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 y(){const t=e.index,i=u.getPrev(),n=u.getNext(),s=i>-1&&t<i?o.last:o.prev,a=n>-1&&t>n?o.first:o.next;h.disabled=i<0,p.disabled=n<0,D(h,rt,s),D(p,rt,a),r("arrows:updated",h,p,i,n)}return{arrows:f,mount:function(){m(),n(_e,m)},destroy:function(){c?j(d):(P(h,ut),P(p,ut))}}},Autoplay:function(e,t,i){const{on:n,bind:s,emit:r}=xe(e),a=Ie(i.interval,e.go.bind(e,">"),(function(e){const{bar:t}=l;t&&N(t,"width",100*e+"%"),r("autoplay:playing",e)})),{isPaused:o}=a,{Elements:l}=t;let u,c,d;function h(e){const t=e?"pause":"play",n=l[t];n&&(D(n,nt,l.track.id),D(n,rt,i.i18n[t]),s(n,"click",e?f:p))}function p(){o()&&t.Slides.isEnough()&&(a.start(!i.resetProgress),c=u=d=!1,r("autoplay:play"))}function f(e=!0){o()||(a.pause(),r("autoplay:pause")),d=e}function m(){d||(u||c?f(!1):p())}function g(){const n=t.Slides.getAt(e.index);a.set(n&&+U(n.slide,ft)||i.interval)}return{mount:function(){const{autoplay:e}=i;e&&(h(!0),h(!1),function(){const{root:e}=l;i.pauseOnHover&&s(e,"mouseenter mouseleave",(e=>{u="mouseenter"===e.type,m()}));i.pauseOnFocus&&s(e,"focusin focusout",(e=>{c="focusin"===e.type,m()}));n([ce,we,ye],a.rewind),n(ce,g)}(),"pause"!==e&&p())},destroy:a.cancel,play:p,pause:f,isPaused:o}},Cover:function(e,t,i){const{on:n}=xe(e);function s(e){t.Slides.forEach((t=>{const i=I(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),R(t,e?"none":"")}return{mount:function(){i.cover&&(n(ke,((e,t)=>{r(!0,e,t)})),n([le,_e,ye],s.bind(null,!0)))},destroy:function(){s(!1)}}},Scroll:function(e,t,i){const{on:n,emit:s}=xe(e),{Move:r}=t,{getPosition:a,getLimit:o,exceededLimit:l}=r;let u,c;function d(t,n,f,m){const g=a();let y=1;var _;n=n||(_=te(t-g),J(_/1.5,800)),c=f,p(),u=Ie(n,h,(n=>{const s=a(),u=(g+(t-g)*function(e){const{easingFunc:t}=i;return t?t(e):1-Math.pow(1-e,4)}(n)-a())*y;var c;r.translate(s+u),e.is(ct)&&!m&&l()&&(y*=.6,te(u)<10&&(c=l(!1),d(o(!c),600,null,!0)))}),1),s(we),u.start()}function h(){const t=a(),i=r.toIndex(t);ie(i,0,e.length-1)||r.translate(r.shift(t,i>0),!0),c&&c(),s(Se)}function p(){u&&u.cancel()}function f(){u&&!u.isPaused()&&(p(),h())}return{mount:function(){n(ce,p),n([_e,ye],f)},destroy:p,scroll:d,cancel:f}},Drag:function(e,t,i){const{on:n,emit:s,bind:r,unbind:a}=xe(e),{Move:o,Scroll:l,Controller:u}=t,{track:d}=t.Elements,{resolve:h,orient:p}=t.Direction,{getPosition:f,exceededLimit:m}=o;let g,y,_,v,b,T,w,S,E,C=!1;function x(){const{drag:e}=i;U(!e),b="free"===e}function I(e){if(!S){const{noDrag:t}=i,n=R(e),s=!t||!k(e.target,t);w=!1,!s||!n&&e.button||(o.isBusy()?q(e,!0):(E=n?d:window,_=null,v=null,r(E,gt,A,mt),r(E,yt,O,mt),o.cancel(),l.cancel(),L(e)))}}function A(t){if(v||s("drag"),v=t,t.cancelable){const n=M(t)-M(y);if(T){o.translate(g+function(t){return t/(C&&e.is(ct)?5:1)}(n));const i=N(t)-N(y)>200,r=C!==(C=m());(i||r)&&L(t),s("dragging"),w=!0,q(t)}else{let{dragMinThreshold:e}=i;e=c(e)?e:{mouse:0,touch:+e||10},T=te(n)>(R(t)?e.touch:e.mouse),D()&&q(t)}}}function O(n){a(E,gt,A),a(E,yt,O);const{index:r}=e;if(v){if(T||n.cancelable&&D()){const s=function(t){if(e.is(dt)||!C){const e=y===v&&_||y,i=M(v)-M(e),n=N(t)-N(e),s=N(t)-N(v)<200;if(n&&s)return i/n}return 0}(n),a=function(e){return f()+se(e)*Q(te(e)*(i.flickPower||600),b?1/0:t.Layout.listSize()*(i.flickMaxPages||1))}(s);b?u.scroll(a):e.is(ht)?u.go(r+p(se(s))):u.go(u.toDest(a),!0),q(n)}s("dragged")}else b||f()===o.toPosition(r)||u.go(r,!0);T=!1}function L(e){_=y,y=e,g=f()}function P(e){!S&&w&&q(e,!0)}function D(){return te(M(v)-M(y))>te(M(v,!0)-M(y,!0))}function M(e,t){return(R(e)?e.touches[0]:e)[`page${h(t?"Y":"X")}`]}function N(e){return e.timeStamp}function R(e){return"undefined"!=typeof TouchEvent&&e instanceof TouchEvent}function U(e){S=e}return{mount:function(){r(d,gt,K,mt),r(d,yt,K,mt),r(d,"touchstart mousedown",I,mt),r(d,"click",P,{capture:!0}),r(d,"dragstart",q),n([le,_e],x)},disable:U,isDragging:function(){return T}}},Keyboard:function(e,t,i){const{on:n,bind:s,unbind:r}=xe(e),{root:a}=e,{resolve:o}=t.Direction;let l,u;function c(){const{keyboard:e}=i;e&&("focused"===e?(l=a,D(a,ot,0)):l=window,s(l,vt,f))}function d(){r(l,vt),m(l)&&P(l,ot)}function h(){const e=u;u=!0,X((()=>{u=e}))}function p(){d(),c()}function f(t){if(!u){const{key:i}=t,n=_(_t,i)?`Arrow${i}`:i;n===o("ArrowLeft")?e.go("<"):n===o("ArrowRight")&&e.go(">")}}return{mount:function(){c(),n(_e,p),n(ce,h)},destroy:d,disable:function(e){u=e}}},LazyLoad:function(e,t,i){const{on:n,off:s,bind:r,emit:a}=xe(e),o="sequential"===i.lazyLoad;let l=[],u=0;function c(){h(),d()}function d(){t.Slides.forEach((e=>{H(e.slide,wt).forEach((t=>{const n=U(t,bt),s=U(t,Tt);if(n!==t.src||s!==t.srcset){const r=i.classes.spinner,a=t.parentElement,o=I(a,`.${r}`)||M("span",r,a);D(o,it,"presentation"),l.push({_img:t,_Slide:e,src:n,srcset:s,_spinner:o}),!t.src&&R(t,"none")}}))})),o&&m()}function h(){u=0,l=[]}function p(){l=l.filter((t=>{const n=i.perPage*((i.preloadPages||1)+1)-1;return!t._Slide.isWithin(e.index,n)||f(t)})),l.length||s(de)}function f(e){const{_img:t}=e;S(e._Slide.slide,Ze),r(t,"load error",(t=>{!function(e,t){const{_Slide:i}=e;z(i.slide,Ze),t||(j(e._spinner),R(e._img,""),a(ke,e._img,i),a(ve));o&&m()}(e,"error"===t.type)})),["srcset","src"].forEach((i=>{e[i]&&(D(t,i,e[i]),P(t,"src"===i?bt:Tt))}))}function m(){u<l.length&&f(l[u++])}return{mount:function(){i.lazyLoad&&(d(),n(ye,c),o||n([le,ye,de,Se],p))},destroy:h}},Pagination:function(e,t,i){const{on:n,emit:s,bind:r,unbind:a}=xe(e),{Slides:o,Elements:l,Controller:c}=t,{hasFocus:d,getIndex:h}=c,p=[];let f;function m(){g(),i.pagination&&o.isEnough()&&(!function(){const{length:t}=e,{classes:n,i18n:s,perPage:a}=i,u="slider"===i.pagination&&l.slider||l.root,c=d()?t:ee(t/a);f=M("ul",n.pagination,u);for(let e=0;e<c;e++){const t=M("li",null,f),i=M("button",{class:n.page,type:"button"},t),l=o.getIn(e).map((e=>e.slide.id)),u=!d()&&a>1?s.pageX:s.slideX;r(i,"click",y.bind(null,e)),D(i,nt,l.join(" ")),D(i,rt,re(u,e+1)),p.push({li:t,button:i,page:e})}}(),s("pagination:mounted",{list:f,items:p},_(e.index)),v())}function g(){f&&(j(f),p.forEach((e=>{a(e.button,"click")})),u(p),f=null)}function y(e){c.go(`>${e}`,!0,(()=>{const t=o.getAt(c.toIndex(e));var i;t&&((i=t.slide).setActive&&i.setActive()||i.focus({preventScroll:!0}))}))}function _(e){return p[c.toPage(e)]}function v(){const e=_(h(!0)),t=_(h());e&&(z(e.button,Ke),P(e.button,st)),t&&(S(t.button,Ke),D(t.button,st,!0)),s("pagination:updated",{list:f,items:p},e,t)}return{items:p,mount:function(){m(),n([_e,ye],m),n([ce,Se],v)},destroy:g,getAt:_,update:v}},Sync:function(e,t,i){const{list:n}=t.Elements,s=[];function r(){e.splides.forEach((t=>{var i;!t.isParent&&(i=t.splide,[e,i].forEach((t=>{const n=xe(t),r=t===e?i:e;n.on(ce,((e,t,i)=>{r.go(r.is(dt)?i:e)})),s.push(n)})))})),i.isNavigation&&function(){const t=xe(e),{on:i}=t;i(pe,l),i(ge,c),i([le,_e],o),D(n,it,"menu"),s.push(t),t.emit(Ce,e.splides)}()}function a(){P(n,ut),s.forEach((e=>{e.destroy()})),u(s)}function o(){D(n,lt,i.direction!==Oe?"horizontal":null)}function l(t){e.go(t.index)}function c(e,t){_(St,t.key)&&(l(e),q(t))}return{mount:r,destroy:a,remount:function(){a(),r()}}},Wheel:function(e,t,i){const{bind:n}=xe(e);function s(n){if(n.cancelable){const{deltaY:s}=n;if(s){const r=s<0;e.go(r?"<":">"),function(n){return!i.releaseWheel||e.state.is(4)||-1!==t.Controller.getAdjacent(n)}(r)&&q(n)}}}return{mount:function(){i.wheel&&n(t.Elements.track,"wheel",s,mt)}}}});const Ct={type:"slide",speed:400,waitForTransition:!0,perPage:1,cloneStatus:!0,arrows:!0,pagination:!0,interval:5e3,pauseOnHover:!0,pauseOnFocus:!0,resetProgress:!0,keyboard:!0,easing:"cubic-bezier(0.25, 1, 0.5, 1)",drag:!0,direction:"ltr",slideFocus:!0,trimSpace:!0,focusableNodes:"a, button, textarea, input, select, iframe",classes:tt,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"}};function kt(e,t,i){const{on:n}=xe(e);return{mount:function(){n([le,ye],(()=>{X((()=>{t.Slides.style("transition",`opacity ${i.speed}ms ${i.easing}`)}))}))},start:function(e,i){const{track:n}=t.Elements;N(n,"height",W(B(n).height)),X((()=>{i(),N(n,"height","")}))},cancel:K}}function xt(e,t,i){const{bind:n}=xe(e),{Move:s,Controller:r}=t,{list:a}=t.Elements;let o;function l(){u("")}function u(e){N(a,"transition",e)}return{mount:function(){n(a,"transitionend",(e=>{e.target===a&&o&&(l(),o())}))},start:function(t,n){const a=s.toPosition(t,!0),l=s.getPosition(),c=function(t){const{rewindSpeed:n}=i;if(e.is(ct)&&n){const e=r.getIndex(!0),i=r.getEnd();if(0===e&&t>=i||e>=i&&0===t)return n}return i.speed}(t);te(a-l)>=1&&c>=1?(u(`transform ${c}ms ${i.easing}`),s.translate(a,!0),o=n):(s.jump(t),n())},cancel:l}}const It=class{constructor(e,t){this.event=function(){let e={};function t(t,n){i(t,((t,i)=>{const s=e[t];e[t]=s&&s.filter((e=>e._key?e._key!==n:n||e._namespace!==i))}))}function i(e,t){g(e).join(" ").split(" ").forEach((e=>{const i=e.split(".");t(i[0],i[1])}))}return{on:function(t,n,s,r=10){i(t,((t,i)=>{e[t]=e[t]||[],v(e[t],{_event:t,_callback:n,_namespace:i,_priority:r,_key:s}).sort(((e,t)=>e._priority-t._priority))}))},off:t,offBy:function(i){A(e,((e,n)=>{t(n,i)}))},emit:function(t){(e[t]||[]).forEach((e=>{e._callback.apply(e,T(arguments,1))}))},destroy:function(){e={}}}}(),this.Components={},this.state=function(e){let t=e;return{set:function(e){t=e},is:function(e){return _(g(e),t)}}}(1),this.splides=[],this._options={},this._Extensions={};const i=h(e)?V(document,e):e;G(i,`${i} is invalid.`),this.root=i,L(Ct,It.defaults),L(L(this._options,Ct),t||{})}mount(e,t){const{state:i,Components:n}=this;G(i.is([1,5]),"Already mounted!"),i.set(1),this._Components=n,this._Transition=t||this._Transition||(this.is(ht)?kt:xt),this._Extensions=e||this._Extensions;return A(O({},Et,this._Extensions,{Transition:this._Transition}),((e,t)=>{const i=e(this,n,this._options);n[t]=i,i.setup&&i.setup()})),A(n,(e=>{e.mount&&e.mount()})),this.emit(le),S(this.root,"is-initialized"),i.set(3),this.emit(ue),this}sync(e){return this.splides.push({splide:e}),e.splides.push({splide:this,isParent:!0}),this.state.is(3)&&(this._Components.Sync.remount(),e.Components.Sync.remount()),this}go(e){return this._Components.Controller.go(e),this}on(e,t){return this.event.on(e,t,null,20),this}off(e){return this.event.off(e),this}emit(e){return this.event.emit(e,...T(arguments,1)),this}add(e,t){return this._Components.Slides.add(e,t),this}remove(e){return this._Components.Slides.remove(e),this}is(e){return this._options.type===e}refresh(){return this.emit(ye),this}destroy(e=!0){const{event:t,state:i}=this;return i.is(1)?t.on(ue,this.destroy.bind(this,e),this):(A(this._Components,(t=>{t.destroy&&t.destroy(e)}),!0),t.emit(Ee),t.destroy(),e&&u(this.splides),i.set(5)),this}get options(){return this._options}set options(e){const{_options:t}=this;L(t,e),this.state.is(1)||this.emit(_e,t)}get length(){return this._Components.Slides.getLength(!0)}get index(){return this._Components.Controller.getIndex()}};let At=It;At.defaults={},At.STATES=l;const Ot=new Map,Lt={set(e,t,i){Ot.has(e)||Ot.set(e,new Map);const n=Ot.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)=>Ot.has(e)&&Ot.get(e).get(t)||null,remove(e,t){if(!Ot.has(e))return;const i=Ot.get(e);i.delete(t),0===i.size&&Ot.delete(e)}},Pt="transitionend",Dt=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},Mt=e=>{const t=Dt(e);return t&&document.querySelector(t)?t:null},Nt=e=>{const t=Dt(e);return t?document.querySelector(t):null},Rt=e=>{e.dispatchEvent(new Event(Pt))},Ut=e=>!(!e||"object"!=typeof e)&&void 0!==e.nodeType,Ft=e=>Ut(e)?e:"string"==typeof e&&e.length>0?document.querySelector(e):null,Bt=e=>{if(!Ut(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},jt=e=>!e||e.nodeType!==Node.ELEMENT_NODE||(!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled"))),$t=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?$t(e.parentNode):null},qt=()=>{},Vt=e=>{e.offsetHeight},Ht=()=>"undefined"!=typeof window&&"undefined"!=typeof document&&"rtl"===document.documentElement.dir,zt=e=>{"function"==typeof e&&e()},Wt=(e,t,i=!0)=>{if(!i)return void zt(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(Pt,r),zt(e))};t.addEventListener(Pt,r),setTimeout((()=>{s||Rt(t)}),n)},Gt=(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))])},Xt=/[^.]*(?=\..*)\.|.*/,Kt=/\..*/,Yt=/::\d+$/,Qt={};let Jt=1;const Zt={mouseenter:"mouseover",mouseleave:"mouseout"},ei=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 ti(e,t){return t&&`${t}::${Jt++}`||e.uidEvent||Jt++}function ii(e){const t=ti(e);return e.uidEvent=t,Qt[t]=Qt[t]||{},Qt[t]}function ni(e,t,i=null){return Object.values(e).find((e=>e.callable===t&&e.delegationSelector===i))}function si(e,t,i){const n="string"==typeof t,s=n?i:t||i;let r=function(e){return e=e.replace(Kt,""),Zt[e]||e}(e);return ei.has(r)||(r=e),[n,s,r]}function ri(e,t,i,n,s){if("string"!=typeof t||!e)return;let[r,a,o]=si(t,i,n);if(t in Zt){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=ii(e),u=l[o]||(l[o]={}),c=ni(u,a,r?i:null);if(c)return void(c.oneOff=c.oneOff&&s);const d=ti(a,t.replace(Xt,"")),h=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&&li.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&&li.off(e,n.type,t),t.apply(e,[n])}}(e,a);h.delegationSelector=r?i:null,h.callable=a,h.oneOff=s,h.uidEvent=d,u[d]=h,e.addEventListener(o,h,r)}function ai(e,t,i,n,s){const r=ni(t[i],n,s);r&&(e.removeEventListener(i,r,Boolean(s)),delete t[i][r.uidEvent])}function oi(e,t,i,n){const s=t[i]||{};for(const r of Object.keys(s))if(r.includes(n)){const n=s[r];ai(e,t,i,n.callable,n.delegationSelector)}}const li={on(e,t,i,n){ri(e,t,i,n,!1)},one(e,t,i,n){ri(e,t,i,n,!0)},off(e,t,i,n){if("string"!=typeof t||!e)return;const[s,r,a]=si(t,i,n),o=a!==t,l=ii(e),u=l[a]||{},c=t.startsWith(".");if(void 0===r){if(c)for(const i of Object.keys(l))oi(e,l,i,t.slice(1));for(const i of Object.keys(u)){const n=i.replace(Yt,"");if(!o||t.includes(n)){const t=u[i];ai(e,l,a,t.callable,t.delegationSelector)}}}else{if(!Object.keys(u).length)return;ai(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 ci(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 di(e){return e.replace(/[A-Z]/g,(e=>`-${e.toLowerCase()}`))}const hi={setDataAttribute(e,t,i){e.setAttribute(`data-bs-${di(t)}`,i)},removeDataAttribute(e,t){e.removeAttribute(`data-bs-${di(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]=ci(e.dataset[n])}return t},getDataAttribute:(e,t)=>ci(e.getAttribute(`data-bs-${di(t)}`))};let pi=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=Ut(t)?hi.getDataAttribute(t,"config"):{};return{...this.constructor.Default,..."object"==typeof i?i:{},...Ut(t)?hi.getDataAttributes(t):{},..."object"==typeof e?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const n of Object.keys(t)){const s=t[n],r=e[n],a=Ut(r)?"element":null==(i=r)?`${i}`:Object.prototype.toString.call(i).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(s).test(a))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${n}" provided type "${a}" but expected type "${s}".`)}var i}};class fi extends pi{constructor(e,t){super(),(e=Ft(e))&&(this._element=e,this._config=this._getConfig(t),Lt.set(this._element,this.constructor.DATA_KEY,this))}dispose(){Lt.remove(this._element,this.constructor.DATA_KEY),li.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,i=!0){Wt(e,t,i)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return Lt.get(Ft(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 mi={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=>!jt(e)&&Bt(e)))}},gi={slideFocus:!0,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"}},yi={"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 _i extends fi{constructor(e){super(e),this._config=this._getConfig(),this._splide=new At(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({},gi);return Object.keys(yi).forEach((t=>{this._element.classList.contains(t)&&(e=Object.assign({},e,yi[t]))})),e}}"undefined"!=typeof window&&"undefined"!=typeof document&&li.on(window,"load.bs.carousel.data-api",(()=>{mi.find("[data-bs-carousel-splide]").forEach((e=>{_i.getOrCreateInstance(e)}))}));const vi=".bs.inputlabel",bi=`focus${vi}`,Ti=`blur${vi}`,wi=`change${vi}`,Si="active";class Ei{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(Si)&&(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")?li.on(this._element,Ti,(()=>{this._labelOut()})):(li.on(this._element,bi,(()=>{this._labelOut()})),li.on(this._element,Ti,(()=>{this._labelOver()})),li.on(this._element,wi,(()=>{this._labelToggle()}))))}_getLabel(){return mi.findOne('label[for="'+this._element.getAttribute("id")+'"]')}_isEmpty(){return!this._element.value&&!this._element.getAttribute("placeholder")}_labelOut(){const e=this._getLabel();e&&e.classList.add(Si)}_labelOver(){if(this._isEmpty()){const e=this._getLabel();e&&e.classList.remove(Si)}}_labelToggle(){this._isEmpty()?this._labelOver():this._labelOut()}}const Ci=".bs.inputnumber",ki=`click${Ci}`,xi=`change${Ci}`,Ii=`click${Ci}.data-api`,Ai=".input-number",Oi='input[data-bs-input][type="number"]',Li='button[class^="input-number-"]';class Pi extends fi{constructor(e){super(e),this._wrapperElement=this._element.closest(Ai),this._label=new Ei(e),this._init(),this._bindEvents()}static get NAME(){return"inputnumber"}_init(){this._wrapperElement&&this._inputResize()}_bindEvents(){this._wrapperElement&&(mi.find(Li,this._wrapperElement).forEach((e=>{li.on(e,ki,(t=>{t.preventDefault(),this._incrDecr(e.classList.contains("input-number-sub")),this._label._labelOut()}))})),li.on(this._element,xi,(()=>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){var t=0;if(""!==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),li.trigger(this._element,xi),li.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(Oi+", label").forEach((function(e){const t=Ei.getInputFromLabel(e)||e;var i;(i=t)&&i.matches(Oi)&&i.parentNode.querySelector(Li)&&Pi.getOrCreateInstance(i)}))})),li.on(document,Ii,Li,(function(){const e=this.closest(Ai);if(e){const t=mi.findOne(Oi,e);t&&Pi.getOrCreateInstance(t)}})));const Di="show";class Mi extends fi{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(Di),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&&Vt(this._element),this._element.classList.add(Di);this._queueCallback((()=>{this._isTransitioning=!1}),this._element,e)}_hideElement(){this._element.setAttribute("aria-hidden",!0),this._isTransitioning=!1}}"undefined"!=typeof window&&"undefined"!=typeof document&&li.on(document,"click.bs.dimmer.data-api",'[data-bs-toggle="dimmer"]',(function(){const e=Nt(this),t=Mi.getOrCreateInstance(e);this.checked?t.show():t.hide()}));const Ni=(e,t="hide")=>{const i=`click.dismiss${e.EVENT_KEY}`,n=e.NAME;li.on(document,i,`[data-bs-dismiss="${n}"]`,(function(i){if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),jt(this))return;const s=Nt(this)||this.closest(`.${n}`);e.getOrCreateInstance(s)[t]()}))},Ri=".bs.notification",Ui=`click${Ri}.data-api`,Fi=`hidden${Ri}`,Bi=`show${Ri}`,ji={timeout:0},$i="show";class qi extends fi{constructor(e,t){super(e),this._config=this._getConfig(t),this._isShown=this._element.classList.contains($i),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($i),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&&Vt(this._element),this._element.classList.add($i);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={...ji,...hi.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&&(li.on(document,Ui,'[data-bs-toggle="notification"]',(function(e){const t=Nt(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),li.one(t,Bi,(e=>{e.defaultPrevented||li.one(t,Fi,(()=>{Bt(this)&&this.focus()}))}));qi.getOrCreateInstance(t).toggle(this)})),Ni(qi));const Vi="cookiebar",Hi=".bs.cookiebar",zi=".data-api",Wi="cookies_consent",Gi=`close${Hi}`,Xi=`closed${Hi}`,Ki=`load${Hi}${zi}`,Yi=`click${Hi}${zi}`,Qi="show";class Ji extends fi{constructor(e){super(e),this._isShown=this._element.classList.contains(Qi),this._isTransitioning=!1}static get NAME(){return Vi}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(Qi),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=Wi+"=; 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&&Vt(this._element),this._element.classList.add(Qi);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=Wi+"="+t+"; path=/; SameSite=Strict")}_getRootElement(e){const t=Nt(e);let i=null;return t&&(i=t),i||(i=e.closest(".cookiebar")),i}_triggerCloseEvent(e){return li.trigger(e,Gi)}_removeElement(e){e.classList.remove(Qi),e.setAttribute("aria-hidden","true"),e.setAttribute("aria-live","off"),li.trigger(e,Xi),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,""))==Wi)return unescape(i)}}}"undefined"!=typeof window&&"undefined"!=typeof document&&(li.on(document,Yi,'[data-bs-accept="cookiebar"]',(function(e){if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),jt(this))return;const t=Nt(this)||this.closest(`.${Vi}`);Ji.getOrCreateInstance(t).accept()})),li.on(window,Ki,(function(){if(!Ji._getCookieEU()){if("undefined"==typeof document)return;document.querySelectorAll(".cookiebar").forEach((e=>{Ji.getOrCreateInstance(e).show()}))}})));const Zi=()=>{if("undefined"!=typeof window)return window.matchMedia("(max-width: 991px)").matches},en=(e,t)=>{let i=null;return t.forEach(((t,n)=>{t===e&&(i=n)})),i},tn=(e,t,i)=>{i={isDirectionTop:!1,isLimit:!1,loop:!1,..."object"==typeof i?i:{}};const n=en(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()},nn="pagescroll-scroll-disabled";let sn=!1,rn="undefined"==typeof document?0:document.scrollingElement.scrollTop;const an="undefined"==typeof document?null:document.querySelector("html");"undefined"!=typeof document&&document.addEventListener("scroll",(()=>{sn&&(document.scrollingElement.scrollTop=rn)}));const on=".bs.navbarcollapsible",ln=`click${on}.data-api`,un=`click${on}`,cn=`keyup${on}`,dn=`keydown${on}`,hn=`hide${on}`,pn=`hidden${on}`,fn=`show${on}`,mn=`shown${on}`,gn=`resize${on}`,yn="show",_n="expanded",vn=".close-menu",bn=".nav-link",Tn=".nav-item .list-item",wn=".it-heading-link",Sn=".it-footer-link";class En extends fi{constructor(e){super(e),this._isShown=this._element.classList.contains(_n),this._isTransitioning=!1,this._isMobile=Zi(),this._isKeyShift=!1,this._currItemIdx=0,this._btnClose=mi.findOne(".close-div button",this._element),this._btnBack=mi.findOne(".it-back-button",this._element),this._menuWrapper=mi.findOne(".menu-wrapper",this._element),this._overlay=null,this._setOverlay(),this._menuItems=mi.find([bn,Tn,wn,Sn,vn].join(","),this._element),this._bindEvents()}static get NAME(){return"navbarcollapsible"}show(e){if(this._isShown||this._isTransitioning)return;li.trigger(this._element,fn,{relatedTarget:e}).defaultPrevented||(this._btnBack&&this._btnBack.classList.add(yn),this._isShown=!0,"undefined"!=typeof document&&(sn=!0,rn=document.scrollingElement.scrollTop,an.classList.add(nn)),this._showElement())}hide(){if(!this._isShown||this._isTransitioning)return;if(li.trigger(this._element,hn).defaultPrevented)return;this._isShown=!1;const e=this._isAnimated();e&&(this._isTransitioning=!0),this._btnBack&&this._btnBack.classList.remove(yn),this._overlay&&this._overlay.classList.remove(yn),this._element.classList.remove(_n),"undefined"!=typeof document&&(sn=!1,an.classList.remove(nn)),this._queueCallback((()=>this._hideElement()),this._menuWrapper,e)}toggle(e){this._isShown?this.hide():this.show(e)}dispose(){"undefined"!=typeof window&&"undefined"!=typeof document&&(li.off(window,gn),super.dispose())}_bindEvents(){"undefined"!=typeof window&&"undefined"!=typeof document&&(li.on(window,gn,(()=>this._onResize())),this._overlay&&li.on(this._overlay,un,(()=>this.hide())),li.on(this._btnClose,un,(e=>{e.preventDefault(),this.hide()})),li.on(this._btnBack,un,(e=>{e.preventDefault(),this.hide()})),this._menuItems.forEach((e=>{li.on(e,dn,(e=>this._isMobile&&this._onMenuItemKeyDown(e))),li.on(e,cn,(e=>this._isMobile&&this._onMenuItemKeyUp(e))),li.on(e,un,(e=>this._isMobile&&this._onMenuItemClick(e)))})))}_onResize(){this._isMobile=Zi()}_onMenuItemKeyUp(e){"Shift"===e.key&&(this._isKeyShift=!1)}_onMenuItemKeyDown(e){"Shift"===e.key&&(this._isKeyShift=!0),"Tab"===e.key&&(e.preventDefault(),this._focusNext())}_onMenuItemClick(e){this.currItemIdx=en(e.currentTarget,this._menuItems)}_isAnimated(){return!0}_isElementHidden(e){return null===e.offsetParent}_showElement(){const e=this._isAnimated();this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-expanded",!0),this._overlay&&(this._overlay.style.display="block"),e&&Vt(this._element),this._element.classList.add(_n),this._overlay&&this._overlay.classList.add(yn);this._queueCallback((()=>{this._isTransitioning=!1;const e=this._getNextVisibleItem(0);e.item&&(e.item.focus(),this._currItemIdx=e.index),li.trigger(this._element,mn)}),this._menuWrapper,e)}_hideElement(){this._overlay&&(this._overlay.style.display="none"),this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-expanded"),this._isTransitioning=!1,li.trigger(this._element,pn)}_setOverlay(){this._overlay=mi.findOne(".overlay",this._element),this._isAnimated&&this._overlay.classList.add("fade")}_focusNext(){let e=this._currItemIdx+(this._isKeyShift?-1:1);e<0?e=this._menuItems.length-1:e>=this._menuItems.length&&(e=0);const t=this._getNextVisibleItem(e,this._isKeyShift);t.item&&(t.item.focus(),this._currItemIdx=t.index)}_getNextVisibleItem(e,t){let i=null,n=null,s=e,r=t?-1:1,a=!1;for(;!(i||s==e&&a);)s==e&&(a=!0),this._isElementHidden(this._menuItems[s])||(i=this._menuItems[s],n=s),s+=r,s<0?s=this._menuItems.length-1:s>=this._menuItems.length&&(s=0);return{item:i,index:n}}}"undefined"!=typeof window&&"undefined"!=typeof document&&li.on(document,ln,'[data-bs-toggle="navbarcollapsible"]',(function(e){const t=Nt(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),li.one(t,fn,(e=>{e.defaultPrevented||li.one(t,pn,(()=>{Bt(this)&&this.focus()}))}));En.getOrCreateInstance(t).toggle(this)}));const Cn=".bs.accordion",kn=`keydown${Cn}`,xn=`keydown${Cn}.data-api`,In='.accordion-item > .accordion-header [data-bs-toggle="collapse"]';class An extends fi{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(){mi.find(In,this._element).forEach((e=>{li.on(e,kn,(e=>{this.handleKeyDown(e.key,e.currentTarget,e)}))}))}_getHeadButtons(){return mi.find(":scope > "+In,this._element)}_focusNext(e){tn(e,this._getHeadButtons(),{loop:!0})}_focusPrev(e){tn(e,this._getHeadButtons(),{isDirectionTop:!0,loop:!0})}_focusFirst(e){tn(e,this._getHeadButtons(),{isDirectionTop:!0,isLimit:!0})}_focusLast(e){tn(e,this._getHeadButtons(),{isLimit:!0})}}var On;"undefined"!=typeof window&&"undefined"!=typeof document&&li.on(document,xn,In,(function(e){const t=this.closest(".accordion");if(t){An.getOrCreateInstance(t).handleKeyDown(e.key,this,e)}}));var Ln=new Uint8Array(16);function Pn(){if(!On&&!(On="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return On(Ln)}const Dn=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var Mn=[],Nn=0;Nn<256;++Nn)Mn.push((Nn+256).toString(16).substr(1));function Rn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(Mn[e[t+0]]+Mn[e[t+1]]+Mn[e[t+2]]+Mn[e[t+3]]+"-"+Mn[e[t+4]]+Mn[e[t+5]]+"-"+Mn[e[t+6]]+Mn[e[t+7]]+"-"+Mn[e[t+8]]+Mn[e[t+9]]+"-"+Mn[e[t+10]]+Mn[e[t+11]]+Mn[e[t+12]]+Mn[e[t+13]]+Mn[e[t+14]]+Mn[e[t+15]]).toLowerCase();if(!function(e){return"string"==typeof e&&Dn.test(e)}(i))throw TypeError("Stringified UUID is invalid");return i}function Un(e,t,i){var n=(e=e||{}).random||(e.rng||Pn)();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,Rn(n)}let Fn=!1,Bn=[];class jn{constructor(e,t){this.id=e,this._callback=t}dispose(){$n(this.id)}_execute(e){this._callback(e)}}const $n=e=>{Bn=Bn.filter((t=>t.id!==e))},qn=e=>{if("undefined"!=typeof document){if(Bn.length||"undefined"!=typeof window&&"undefined"!=typeof document&&document.addEventListener("scroll",(e=>{Fn||(window.requestAnimationFrame((()=>{Bn.forEach((t=>t.cb._execute(e))),Fn=!1})),Fn=!0)})),"function"==typeof e){const t=new jn(Un(),e);return Bn.push({id:t.id,cb:t}),t}return console.error("[onDocumentScroll] the provided data has to be of type function"),null}};var Vn={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0},Hn={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},zn=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],Wn={CSS:{},springs:{}};function Gn(e,t,i){return Math.min(Math.max(e,t),i)}function Xn(e,t){return e.indexOf(t)>-1}function Kn(e,t){return e.apply(null,t)}var Yn={arr:function(e){return Array.isArray(e)},obj:function(e){return Xn(Object.prototype.toString.call(e),"Object")},pth:function(e){return Yn.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||Yn.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 Yn.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 Yn.hex(e)||Yn.rgb(e)||Yn.hsl(e)},key:function(e){return!Vn.hasOwnProperty(e)&&!Hn.hasOwnProperty(e)&&"targets"!==e&&"keyframes"!==e}};function Qn(e){var t=/\(([^)]+)\)/.exec(e);return t?t[1].split(",").map((function(e){return parseFloat(e)})):[]}function Jn(e,t){var i=Qn(e),n=Gn(Yn.und(i[0])?1:i[0],.1,100),s=Gn(Yn.und(i[1])?100:i[1],.1,100),r=Gn(Yn.und(i[2])?10:i[2],.1,100),a=Gn(Yn.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 d(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?d:function(){var t=Wn.springs[e];if(t)return t;for(var i=1/6,n=0,s=0;;)if(1===d(n+=i)){if(++s>=16)break}else s=0;var r=n*i*1e3;return Wn.springs[e]=r,r}}function Zn(e){return void 0===e&&(e=10),function(t){return Math.ceil(Gn(t,1e-6,1)*e)*(1/e)}}var es,ts,is=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)}}}(),ns=(es={linear:function(){return function(e){return e}}},ts={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=Gn(e,1,10),n=Gn(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){ts[e]=function(){return function(e){return Math.pow(e,t+2)}}})),Object.keys(ts).forEach((function(e){var t=ts[e];es["easeIn"+e]=t,es["easeOut"+e]=function(e,i){return function(n){return 1-t(e,i)(1-n)}},es["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}},es["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}}})),es);function ss(e,t){if(Yn.fnc(e))return e;var i=e.split("(")[0],n=ns[i],s=Qn(e);switch(i){case"spring":return Jn(e,t);case"cubicBezier":return Kn(is,s);case"steps":return Kn(Zn,s);default:return Kn(n,s)}}function rs(e){try{return document.querySelectorAll(e)}catch(e){return}}function as(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 os(e){return e.reduce((function(e,t){return e.concat(Yn.arr(t)?os(t):t)}),[])}function ls(e){return Yn.arr(e)?e:(Yn.str(e)&&(e=rs(e)||e),e instanceof NodeList||e instanceof HTMLCollection?[].slice.call(e):[e])}function us(e,t){return e.some((function(e){return e===t}))}function cs(e){var t={};for(var i in e)t[i]=e[i];return t}function ds(e,t){var i=cs(e);for(var n in e)i[n]=t.hasOwnProperty(n)?t[n]:e[n];return i}function hs(e,t){var i=cs(e);for(var n in t)i[n]=Yn.und(e[n])?t[n]:e[n];return i}function ps(e){return Yn.rgb(e)?(i=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(t=e))?"rgba("+i[1]+",1)":t:Yn.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):Yn.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,d=2*o-c;t=u(d,c,r+1/3),i=u(d,c,r),n=u(d,c,r-1/3)}return"rgba("+255*t+","+255*i+","+255*n+","+l+")"}(e):void 0;var t,i}function fs(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 ms(e,t){return Yn.fnc(e)?e(t.target,t.id,t.total):e}function gs(e,t){return e.getAttribute(t)}function ys(e,t,i){if(us([i,"deg","rad","turn"],fs(t)))return t;var n=Wn.CSS[t+i];if(!Yn.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 Wn.CSS[t+i]=o,o}function _s(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?ys(e,s,i):s}}function vs(e,t){return Yn.dom(e)&&!Yn.inp(e)&&(!Yn.nil(gs(e,t))||Yn.svg(e)&&e[t])?"attribute":Yn.dom(e)&&us(zn,t)?"transform":Yn.dom(e)&&"transform"!==t&&_s(e,t)?"css":null!=e[t]?"object":void 0}function bs(e){if(Yn.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 Ts(e,t,i,n){var s=Xn(t,"scale")?1:0+function(e){return Xn(e,"translate")||"perspective"===e?"px":Xn(e,"rotate")||Xn(e,"skew")?"deg":void 0}(t),r=bs(e).get(t)||s;return i&&(i.transforms.list.set(t,r),i.transforms.last=t),n?ys(e,r,n):r}function ws(e,t,i,n){switch(vs(e,t)){case"transform":return Ts(e,t,n,i);case"css":return _s(e,t,i);case"attribute":return gs(e,t);default:return e[t]||0}}function Ss(e,t){var i=/^(\*=|\+=|-=)/.exec(e);if(!i)return e;var n=fs(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 Es(e,t){if(Yn.col(e))return ps(e);if(/\s/g.test(e))return e;var i=fs(e),n=i?e.substr(0,e.length-i.length):e;return t?n+t:n}function Cs(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function ks(e){for(var t,i=e.points,n=0,s=0;s<i.numberOfItems;s++){var r=i.getItem(s);s>0&&(n+=Cs(t,r)),t=r}return n}function xs(e){if(e.getTotalLength)return e.getTotalLength();switch(e.tagName.toLowerCase()){case"circle":return function(e){return 2*Math.PI*gs(e,"r")}(e);case"rect":return function(e){return 2*gs(e,"width")+2*gs(e,"height")}(e);case"line":return function(e){return Cs({x:gs(e,"x1"),y:gs(e,"y1")},{x:gs(e,"x2"),y:gs(e,"y2")})}(e);case"polyline":return ks(e);case"polygon":return function(e){var t=e.points;return ks(e)+Cs(t.getItem(t.numberOfItems-1),t.getItem(0))}(e)}}function Is(e,t){var i=t||{},n=i.el||function(e){for(var t=e.parentNode;Yn.svg(t)&&Yn.svg(t.parentNode);)t=t.parentNode;return t}(e),s=n.getBoundingClientRect(),r=gs(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 As(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=Is(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 Os(e,t){var i=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,n=Es(Yn.pth(e)?e.totalLength:e,t)+"";return{original:n,numbers:n.match(i)?n.match(i).map(Number):[0],strings:Yn.str(e)||t?n.split(i):[]}}function Ls(e){return as(e?os(Yn.arr(e)?e.map(ls):ls(e)):[],(function(e,t,i){return i.indexOf(e)===t}))}function Ps(e){var t=Ls(e);return t.map((function(e,i){return{target:e,id:i,total:t.length,transforms:{list:bs(e)}}}))}function Ds(e,t){var i=cs(t);if(/^spring/.test(i.easing)&&(i.duration=Jn(i.easing)),Yn.arr(e)){var n=e.length;2===n&&!Yn.obj(e[0])?e={value:e}:Yn.fnc(t.duration)||(i.duration=t.duration/n)}var s=Yn.arr(e)?e:[e];return s.map((function(e,i){var n=Yn.obj(e)&&!Yn.pth(e)?e:{value:e};return Yn.und(n.delay)&&(n.delay=i?0:t.delay),Yn.und(n.endDelay)&&(n.endDelay=i===s.length-1?t.endDelay:0),n})).map((function(e){return hs(e,i)}))}function Ms(e,t){var i=[],n=t.keyframes;for(var s in n&&(t=hs(function(e){for(var t=as(os(e.map((function(e){return Object.keys(e)}))),(function(e){return Yn.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)Yn.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)Yn.key(s)&&i.push({name:s,tweens:Ds(t[s],e)});return i}function Ns(e,t){var i;return e.tweens.map((function(n){var s=function(e,t){var i={};for(var n in e){var s=ms(e[n],t);Yn.arr(s)&&1===(s=s.map((function(e){return ms(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=Yn.arr(r)?r[1]:r,o=fs(a),l=ws(t.target,e.name,o,t),u=i?i.to.original:l,c=Yn.arr(r)?r[0]:u,d=fs(c)||fs(l),h=o||d;return Yn.und(a)&&(a=u),s.from=Os(c,h),s.to=Os(Ss(a,c),h),s.start=i?i.end:0,s.end=s.start+s.delay+s.duration+s.endDelay,s.easing=ss(s.easing,s.duration),s.isPath=Yn.pth(r),s.isPathTargetInsideSVG=s.isPath&&Yn.svg(t.target),s.isColor=Yn.col(s.from.original),s.isColor&&(s.round=1),i=s,s}))}var Rs={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 Us(e,t){Ps(e).forEach((function(e){for(var i in t){var n=ms(t[i],e),s=e.target,r=fs(n),a=ws(s,i,r,e),o=Ss(Es(n,r||fs(a)),a),l=vs(s,i);Rs[l](s,i,o,e.transforms,!0)}}))}function Fs(e,t){return as(os(e.map((function(e){return t.map((function(t){return function(e,t){var i=vs(e.target,t.name);if(i){var n=Ns(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!Yn.und(e)}))}function Bs(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 js=0;var $s=[],qs=function(){var e;function t(i){for(var n=$s.length,s=0;s<n;){var r=$s[s];r.paused?($s.splice(s,1),n--):(r.tick(i),s++)}e=s>0?requestAnimationFrame(t):void 0}return"undefined"!=typeof document&&document.addEventListener("visibilitychange",(function(){Hs.suspendWhenDocumentHidden&&(Vs()?e=cancelAnimationFrame(e):($s.forEach((function(e){return e._onDocumentVisibility()})),qs()))})),function(){e||Vs()&&Hs.suspendWhenDocumentHidden||!($s.length>0)||(e=requestAnimationFrame(t))}}();function Vs(){return!!document&&document.hidden}function Hs(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=ds(Vn,e),i=ds(Hn,e),n=Ms(i,e),s=Ps(e.targets),r=Fs(s,n),a=Bs(r,i),o=js;return js++,hs(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 d(){i=0,n=c(l.currentTime)*(1/Hs.speed)}function h(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=as(a,(function(t){return e<t.end}))[0]||u);for(var c=Gn(e-u.start-u.delay,0,u.duration)/u.duration,d=isNaN(c)?1:u.easing(c),h=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?As(u.value,d*v,u.isPathTargetInsideSVG):b+d*(v-b),p&&(u.isColor&&y>2||(_=Math.round(_*p)/p)),f.push(_)}var T=h.length;if(T){g=h[0];for(var w=0;w<T;w++){h[w];var S=h[w+1],E=f[w];isNaN(E)||(g+=S?E+S:E+" ")}}else g=f[0];Rs[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 d=l.duration,m=l.delay,g=d-l.endDelay,y=c(e);l.progress=Gn(y/d*100,0,100),l.reversePlayback=y<l.currentTime,t&&function(e){if(l.reversePlayback)for(var i=r;i--;)h(e,t[i]);else for(var n=0;n<r;n++)h(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!==d||!d)&&p(d),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=Gn(y,0,d),l.began&&f("update"),e>=d&&(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=d,l.set=function(e,t){return Us(e,t),l},l.tick=function(e){s=e,i||(i=s),m((s+(n-i))*Hs.speed)},l.seek=function(e){m(c(e))},l.pause=function(){l.paused=!0,d()},l.play=function(){l.paused&&(l.completed&&l.reset(),l.paused=!1,$s.push(l),d(),qs())},l.reverse=function(){u(),l.completed=!l.reversed,d()},l.restart=function(){l.reset(),l.play()},l.remove=function(e){Ws(Ls(e),l)},l.reset(),l.autoplay&&l.play(),l}function zs(e,t){for(var i=t.length;i--;)us(e,t[i].animatable.target)&&t.splice(i,1)}function Ws(e,t){var i=t.animations,n=t.children;zs(e,i);for(var s=n.length;s--;){var r=n[s],a=r.animations;zs(e,a),a.length||r.children.length||n.splice(s,1)}i.length||n.length||t.pause()}Hs.version="3.2.1",Hs.speed=1,Hs.suspendWhenDocumentHidden=!0,Hs.running=$s,Hs.remove=function(e){for(var t=Ls(e),i=$s.length;i--;){Ws(t,$s[i])}},Hs.get=ws,Hs.set=Us,Hs.convertPx=ys,Hs.path=function(e,t){var i=Yn.str(e)?rs(e)[0]:e,n=t||100;return function(e){return{property:e,el:i,svg:Is(i),totalLength:xs(i)*(n/100)}}},Hs.setDashoffset=function(e){var t=xs(e);return e.setAttribute("stroke-dasharray",t),t},Hs.stagger=function(e,t){void 0===t&&(t={});var i=t.direction||"normal",n=t.easing?ss(t.easing):null,s=t.grid,r=t.axis,a=t.from||0,o="first"===a,l="center"===a,u="last"===a,c=Yn.arr(e),d=c?parseFloat(e[0]):parseFloat(e),h=c?parseFloat(e[1]):0,p=fs(c?e[1]:e)||0,f=t.start||0+(c?d: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?(h-d)/g:d)*(Math.round(100*m[t])/100)+p}},Hs.timeline=function(e){void 0===e&&(e={});var t=Hs(e);return t.duration=0,t.add=function(i,n){var s=$s.indexOf(t),r=t.children;function a(e){e.passThrough=!0}s>-1&&$s.splice(s,1);for(var o=0;o<r.length;o++)a(r[o]);var l=hs(i,ds(Hn,e));l.targets=l.targets||e.targets;var u=t.duration;l.autoplay=!1,l.direction=t.direction,l.timelineOffset=Yn.und(n)?u:Ss(n,u),a(t),t.seek(l.timelineOffset);var c=Hs(l);a(c),r.push(c);var d=Bs(r,e);return t.delay=d.delay,t.endDelay=d.endDelay,t.duration=d.duration,t.seek(0),t.reset(),t.autoplay&&t.play(),t},t},Hs.easing=ss,Hs.penner=ns,Hs.random=function(e,t){return Math.floor(Math.random()*(t-e+1))+e};const Gs={duration:800,easing:"easeInOutSine"},Xs=(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,...Gs,..."object"==typeof t?t:{}},n.style.scrollBehavior="auto",t.complete=e=>{n.style.scrollBehavior=s,"function"==typeof i&&i(e)},Hs({targets:n,...t})},Ks="active",Ys="ul.link-list",Qs="a.nav-link",Js=`${Qs}.${Ks}`,Zs=`${Qs}[href^="#"]`,er={scrollPadding:10,duration:800,easing:"easeInOutSine"};class tr extends fi{constructor(e,t){super(e),this._config=this._getConfig(t),this._togglerElement=mi.findOne(".custom-navbar-toggler",this._element),this._sectionContainer=mi.findOne(".it-page-sections-container"),this._collapsible=this._getCollapsible(),this._isCollapseOpened=!1,this._callbackQueue=[],this._scrollCb=null,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={...er,...hi.getDataAttributes(this._element),..."object"==typeof e?e:{}}}_bindEvents(){this._scrollCb=qn((()=>this._onScroll())),this._collapsible&&(li.on(this._collapsible._element,"shown.bs.navbarcollapsible",(()=>this._onCollapseOpened())),li.on(this._collapsible._element,"hidden.bs.navbarcollapsible",(()=>this._onCollapseClosed()))),mi.find(Zs,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&&li.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(Ys),n=null,s=!1;for(;i&&!s;){const e=i.closest("li.nav-link, li.nav-item");if(e){const i=e.querySelector(Qs);i&&t.push(i)}n=i,i=(i.parentElement||i).closest(Ys),i===n&&(s=!0)}return t}_decorateToggler(e){if(this._togglerElement){const t=mi.findOne(".it-list",this._togglerElement);this._togglerElement.innerText="",this._togglerElement.textContent="",this._togglerElement.append(t),this._togglerElement.append(e)}}_scrollToHash(e){const t=mi.findOne(e,this._sectionContainer);t&&(Xs(t.offsetTop-this._getScrollPadding(),{duration:this._config.duration,easing:this._config.easing}),history.pushState?history.pushState(null,null,e):location.hash=e)}_updateProgress(e){if(!e)return;const t=mi.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=mi.find(Qs,this._element),n=this._getScrollPadding();mi.find(".it-page-section").forEach(((s,r)=>{if(s.offsetTop-e<=t+n&&(mi.find(Js,this._element).forEach((e=>{e.classList.remove(Ks)})),r<i.length)){const e=i[r];this._getParentLinks(e).forEach((e=>{e.classList.add(Ks)})),e.classList.add(Ks),this._decorateToggler(e.innerText)}})),this._updateProgress(this._sectionContainer)}_getCollapsible(){const e=mi.findOne(".navbar-collapsable",this._element);return e?En.getOrCreateInstance(e):null}_getScrollPadding(){return"function"==typeof this._config.scrollPadding?this._config.scrollPadding():this._config.scrollPadding}}if("undefined"!=typeof window&&"undefined"!=typeof document){mi.find("[data-bs-navscroll]").map((e=>{tr.getOrCreateInstance(e)}))}const ir=".bs.sticky",nr=`resize${ir}`,sr=`on${ir}`,rr=`off${ir}`,ar="bs-is-sticky",or="bs-is-fixed",lr='[data-bs-toggle="sticky"]',ur={positionType:"sticky",stickyClassName:"",stackable:!1,paddingTop:0};class cr extends fi{constructor(e,t){super(e),this._config=this._getConfig(t),this._isSticky=!1,this._wrapper=null,this._stickyTarget=mi.findOne(Mt(this._element),this._element)||this._element,this._stickyTargetMobile=mi.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=Zi(),this._prevTop=0,this._onScroll(),this._bindEvents()}dispose(){"undefined"!=typeof window&&"undefined"!=typeof document&&(li.off(window,nr),this._scrollCb.dispose(),super.dispose())}static get NAME(){return"sticky"}_getConfig(e){return e={...ur,...hi.getDataAttributes(this._element),..."object"==typeof e?e:{}}}_bindEvents(){"undefined"!=typeof window&&"undefined"!=typeof document&&(li.on(window,nr,(()=>this._onResize())),this._scrollCb=qn((()=>this._onScroll())))}_onResize(){this._isMobile=Zi(),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=ar;this._isTypeSticky()||(e=or,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",li.trigger(this._element,sr)}}_unsetSticky(){if(this._isSticky){let e=ar;this._isTypeSticky()||(e=or,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,li.trigger(this._element,rr)}}_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 mi.find(lr).filter((e=>{const t=cr.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&&qn((()=>{mi.find(lr).map((e=>{cr.getOrCreateInstance(e)}))}));const dr="cloned-element",hr=`.${dr}`,pr=new Map;class fr{constructor(e){if(pr.get(e))return null;this._element=e,this._elementObj=cr.getOrCreateInstance(e),pr.set(e,this._elementObj),this._bindEvents(),this._toggleClonedElement(this._element.classList.contains("is-sticky"))}static getOrCreateInstance(e){return pr.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(!Bt(mi.findOne(".custom-navbar-toggler",this._element))){const t=mi.findOne(".menu-wrapper",this._element);if(e){const e=mi.findOne(".it-brand-wrapper",this._element),i=mi.findOne(".it-search-wrapper",this._element),n=mi.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(dr),r&&t.appendChild(r).classList.add(dr),a&&(t.appendChild(a).classList.add(dr),t.appendChild(a).classList.remove("show"))}else mi.find(hr,this._element).forEach((e=>{e.parentElement.removeChild(e)}))}}}qn((()=>{mi.find(".it-header-sticky").map((e=>{fr.getOrCreateInstance(e)}))}));var mr=Object.defineProperty,gr=(e,t,i)=>(((e,t,i)=>{t in e?mr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i})(e,"symbol"!=typeof t?t+"":t,i),i);const yr=/^(([^<>()[\]\\.,;:\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,}))$/,_r=/^-?[0-9]\d*$/,vr=/^(?=.*[A-Za-z])(?=.*\d).{8,}$/,br=/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/,Tr=e=>"string"!=typeof e||""===e;var wr=(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))(wr||{}),Sr=(e=>(e.Required="required",e))(Sr||{}),Er=(e=>(e.Label="label",e.LabelArrow="labelArrow",e))(Er||{});const Cr=[{key:wr.Required,dict:{en:"The field is required"}},{key:wr.Email,dict:{en:"Email has invalid format"}},{key:wr.MaxLength,dict:{en:"The field must contain a maximum of :value characters"}},{key:wr.MinLength,dict:{en:"The field must contain a minimum of :value characters"}},{key:wr.Password,dict:{en:"Password must contain minimum eight characters, at least one letter and one number"}},{key:wr.StrongPassword,dict:{en:"Password should contain minimum eight characters, at least one uppercase letter, one lowercase letter, one number and one special character"}},{key:wr.Number,dict:{en:"Value should be a number"}},{key:wr.MaxNumber,dict:{en:"Number should be less or equal than :value"}},{key:wr.MinNumber,dict:{en:"Number should be more or equal than :value"}},{key:wr.MinFilesCount,dict:{en:"Files count should be more or equal than :value"}},{key:wr.MaxFilesCount,dict:{en:"Files count should be less or equal than :value"}},{key:wr.Files,dict:{en:"Uploaded files have one or several invalid properties (extension/size/type etc)."}}],kr=e=>"object"==typeof e&&null!==e&&"then"in e&&"function"==typeof e.then,xr=e=>Array.isArray(e)?e.filter((e=>e.length>0)):"string"==typeof e&&e.trim()?[...e.split(" ").filter((e=>e.length>0))]:[],Ir=e=>e instanceof Element||e instanceof HTMLDocument,Ar={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 Or{constructor(e,t,i){gr(this,"form",null),gr(this,"fields",{}),gr(this,"groupFields",{}),gr(this,"errors",{}),gr(this,"isValid",!1),gr(this,"isSubmitted",!1),gr(this,"globalConfig",Ar),gr(this,"errorLabels",{}),gr(this,"successLabels",{}),gr(this,"eventListeners",[]),gr(this,"dictLocale",Cr),gr(this,"currentLocale","en"),gr(this,"customStyleTags",{}),gr(this,"onSuccessCallback"),gr(this,"onFailCallback"),gr(this,"onValidateCallback"),gr(this,"tooltips",[]),gr(this,"lastScrollPosition"),gr(this,"isScrollTick"),gr(this,"fieldIds",new Map),gr(this,"getKeyByFieldSelector",(e=>this.fieldIds.get(e))),gr(this,"getFieldSelectorByKey",(e=>{for(const[t,i]of this.fieldIds)if(e===i)return t})),gr(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})),gr(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})),gr(this,"refreshAllTooltips",(()=>{this.tooltips.forEach((e=>{e.refresh()}))})),gr(this,"handleDocumentScroll",(()=>{this.lastScrollPosition=window.scrollY,this.isScrollTick||(window.requestAnimationFrame((()=>{this.refreshAllTooltips(),this.isScrollTick=!1})),this.isScrollTick=!0)})),gr(this,"formSubmitHandler",(e=>{e.preventDefault(),this.isSubmitted=!0,this.validateHandler(e)})),gr(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))})),gr(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))})),gr(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=Ar,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={...Ar,...t},i&&(this.dictLocale=[...i,...Cr]),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[Er.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 wr.MaxLength:case wr.MinLength:case wr.MaxNumber:case wr.MinNumber:case wr.MinFilesCount:case wr.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===Sr.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){i.plugin(r,this.getCompatibleFields())||this.setFieldInvalid(e,i)}else{switch(i.rule){case wr.Required:(e=>{let t=e;return"string"==typeof e&&(t=e.trim()),!t})(r)&&this.setFieldInvalid(e,i);break;case wr.Email:if(Tr(r))break;a=r,yr.test(a)||this.setFieldInvalid(e,i);break;case wr.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(Tr(r))break;((e,t)=>e.length>t)(r,s)&&this.setFieldInvalid(e,i);break;case wr.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(Tr(r))break;((e,t)=>e.length<t)(r,s)&&this.setFieldInvalid(e,i);break;case wr.Password:if(Tr(r))break;(e=>vr.test(e))(r)||this.setFieldInvalid(e,i);break;case wr.StrongPassword:if(Tr(r))break;(e=>br.test(e))(r)||this.setFieldInvalid(e,i);break;case wr.Number:if(Tr(r))break;(e=>"string"==typeof e&&!isNaN(+e)&&!isNaN(parseFloat(e)))(r)||this.setFieldInvalid(e,i);break;case wr.Integer:if(Tr(r))break;(e=>_r.test(e))(r)||this.setFieldInvalid(e,i);break;case wr.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(Tr(r))break;const t=+r;(Number.isNaN(t)||((e,t)=>e>t)(t,s))&&this.setFieldInvalid(e,i);break}case wr.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(Tr(r))break;const t=+r;(Number.isNaN(t)||((e,t)=>e<t)(t,s))&&this.setFieldInvalid(e,i);break}case wr.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 wr.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 wr.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 wr.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 kr(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);kr(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&&!Ir(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&&!Ir(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);kr(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);kr(t)&&i.push(t)})),Object.keys(this.groupFields).forEach((e=>{const t=this.validateGroup(e);kr(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&&!Ir(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(wr).includes(e.rule)))throw Error(`Rule should be one of these types: ${Object.values(wr).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&&!Ir(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&&!Ir(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:Sr.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(...xr((null==(n=r.config)?void 0:n.errorFieldCssClass)||this.globalConfig.errorFieldCssClass),...xr((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(...xr((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(...xr((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(...xr((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(...xr((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(...xr((null==(s=u.config)?void 0:s.successFieldCssClass)||this.globalConfig.successFieldCssClass))}return}u.elem.classList.add(...xr((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(...xr((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(...xr((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 Lr{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 Pr{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 Dr={errorFieldCssClass:"is-invalid",errorLabelCssClass:"just-validate-error-label"},Mr="justvalidatebi";class Nr extends fi{constructor(e){super(e),this._label=new Ei(e),this._bindEvents()}static get NAME(){return"input"}_bindEvents(){"file"===this._element.getAttribute("type")&&li.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=mi.findOne('label[for="'+this._element.getAttribute("id")+'"] label.form-file-name',this._element);i&&(i.innerText=t+e.join("; "))}}const Rr=["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=!!Rr.find((t=>e.matches(t))),i=!("number"!==e.getAttribute("type")||!e.parentNode.querySelector('button[class^="input-number-"]'));t||i||Nr.getOrCreateInstance(e)})(Ei.getInputFromLabel(e)||e)}))}));var Ur="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Fr(e,t){return e(t={exports:{}},t.exports),t.exports}var Br=Fr((function(e,t){self,e.exports=function(){var e={8952:function(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")}},2096:function(e,t,i){var n=i(2424),s=String,r=TypeError;e.exports=function(e){if(n(e))return e;throw new r("Can't set "+s(e)+" as a prototype")}},4764:function(e,t,i){var n=i(9764).charAt;e.exports=function(e,t,i){return t+(i?n(e,t).length:1)}},6100:function(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:function(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:function(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)}},3364:function(e,t,i){var n=i(8992),s=i(1664),r=i(5712),a=i(4356),o=i(3556),l=i(2568),u=s([].push),c=function(e){var t=1===e,i=2===e,s=3===e,c=4===e,d=6===e,h=7===e,p=5===e||d;return function(f,m,g,y){for(var _,v,b=a(f),T=r(b),w=o(T),S=n(m,g),E=0,C=y||l,k=t?C(f,w):i||h?C(f,0):void 0;w>E;E++)if((p||E in T)&&(v=S(_=T[E],E,b),e))if(t)k[E]=v;else if(v)switch(e){case 3:return!0;case 5:return _;case 6:return E;case 2:u(k,_)}else switch(e){case 4:return!1;case 7:u(k,_)}return d?-1:s||c?c:k}};e.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterReject:c(7)}},953:function(e,t,i){var n=i(9957),s=i(9972),r=i(8504),a=s("species");e.exports=function(e){return r>=51||!n((function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},1496:function(e,t,i){var n=i(9957);e.exports=function(e,t){var i=[][e];return!!i&&n((function(){i.call(null,t||function(){return 1},1)}))}},6728:function(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}},6736:function(e,t,i){var n=i(1432),s=i(6072),r=i(1632),a=i(9972)("species"),o=Array;e.exports=function(e){var t;return n(e)&&(t=e.constructor,(s(t)&&(t===o||n(t.prototype))||r(t)&&null===(t=t[a]))&&(t=void 0)),void 0===t?o:t}},2568:function(e,t,i){var n=i(6736);e.exports=function(e,t){return new(n(e))(0===t?0:t)}},8696:function(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:function(e,t,i){var n=i(1664),s=n({}.toString),r=n("".slice);e.exports=function(e){return r(s(e),8,-1)}},4427:function(e,t,i){var n=i(16),s=i(4328),r=i(1888),a=i(9972)("toStringTag"),o=Object,l="Arguments"===r(function(){return arguments}());e.exports=n?r:function(e){var t,i,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=function(e,t){try{return e[t]}catch(e){}}(t=o(e),a))?i:l?r(t):"Object"===(n=r(t))&&s(t.callee)?"Arguments":n}},9968:function(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 d=o[c];n(e,d)||i&&n(i,d)||l(e,d,u(t,d))}}},2272:function(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:function(e){e.exports=function(e,t){return{value:e,done:t}}},3440:function(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:function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},92:function(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:function(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:function(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:function(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:function(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:function(e,t,i){var n=i(9957);e.exports=!n((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},8168:function(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:function(e){var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},6064:function(e){e.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},8504:function(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:function(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6520:function(e,t,i){var n=i(1664),s=Error,r=n("".replace),a=String(new s("zxcasd").stack),o=/\n\s*at [^:]*:[^\n]*/,l=o.test(a);e.exports=function(e,t){if(l&&"string"==typeof e&&!s.prepareStackTrace)for(;t--;)e=r(e,o,"");return e}},3696:function(e,t,i){var n=i(3440),s=i(6520),r=i(9184),a=Error.captureStackTrace;e.exports=function(e,t,i,o){r&&(a?a(e,t):n(e,"stack",s(i,o)))}},9184:function(e,t,i){var n=i(9957),s=i(9728);e.exports=!n((function(){var e=new Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",s(1,7)),7!==e.stack)}))},9160:function(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,d,h,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(h=t[c],d=e.dontCallGetSet?(p=s(i,c))&&p.value:i[c],!u(m?c:f+(g?".":"#")+c,e.forced)&&void 0!==d){if(typeof h==typeof d)continue;l(h,d)}(e.sham||d&&d.sham)&&r(h,"sham",!0),a(i,c,h,e)}}},9957:function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},7176:function(e,t,i){i(880);var n=i(8448),s=i(6076),r=i(7680),a=i(9957),o=i(9972),l=i(3440),u=o("species"),c=RegExp.prototype;e.exports=function(e,t,i,d){var h=o(e),p=!a((function(){var t={};return t[h]=function(){return 7},7!==""[e](t)})),f=p&&!a((function(){var t=!1,i=/a/;return"split"===e&&((i={}).constructor={},i.constructor[u]=function(){return i},i.flags="",i[h]=/./[h]),i.exec=function(){return t=!0,null},i[h](""),!t}));if(!p||!f||i){var m=/./[h],g=t(h,""[e],(function(e,t,i,s,a){var o=t.exec;return o===r||o===c.exec?p&&!a?{done:!0,value:n(m,t,i,s)}:{done:!0,value:n(e,i,t,s)}:{done:!1}}));s(String.prototype,e,g[0]),s(c,h,g[1])}d&&l(c[h],"sham",!0)}},908:function(e,t,i){var n=i(7332),s=Function.prototype,r=s.apply,a=s.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?a.bind(r):function(){return a.apply(r,arguments)})},8992:function(e,t,i){var n=i(3180),s=i(8952),r=i(7332),a=n(n.bind);e.exports=function(e,t){return s(e),void 0===t?e:r?a(e,t):function(){return e.apply(t,arguments)}}},7332:function(e,t,i){var n=i(9957);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},8448:function(e,t,i){var n=i(7332),s=Function.prototype.call;e.exports=n?s.bind(s):function(){return s.apply(s,arguments)}},6208:function(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}},5288:function(e,t,i){var n=i(1664),s=i(8952);e.exports=function(e,t,i){try{return n(s(Object.getOwnPropertyDescriptor(e,t)[i]))}catch(e){}}},3180:function(e,t,i){var n=i(1888),s=i(1664);e.exports=function(e){if("Function"===n(e))return s(e)}},1664:function(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:function(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:function(e){e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},4504:function(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:function(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:function(e){e.exports={}},4168:function(e,t,i){var n=i(5232);e.exports=n("document","documentElement")},9888:function(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:function(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},7512:function(e,t,i){var n=i(4328),s=i(1632),r=i(4024);e.exports=function(e,t,i){var a,o;return r&&n(a=t.constructor)&&a!==i&&s(o=a.prototype)&&o!==i.prototype&&r(e,o),e}},9112:function(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},3480:function(e,t,i){var n=i(1632),s=i(3440);e.exports=function(e,t){n(t)&&"cause"in t&&s(e,"cause",t.cause)}},9104:function(e,t,i){var n,s,r,a=i(4288),o=i(6420),l=i(1632),u=i(3440),c=i(5152),d=i(3976),h=i(6504),p=i(2560),f="Object already initialized",m=o.TypeError,g=o.WeakMap;if(a||d.state){var y=d.state||(d.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 _=h("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:function(e,t,i){var n=i(1888);e.exports=Array.isArray||function(e){return"Array"===n(e)}},4328:function(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}},6072:function(e,t,i){var n=i(1664),s=i(9957),r=i(4328),a=i(4427),o=i(5232),l=i(9112),u=function(){},c=o("Reflect","construct"),d=/^\s*(?:class|function)\b/,h=n(d.exec),p=!d.test(u),f=function(e){if(!r(e))return!1;try{return c(u,[],e),!0}catch(e){return!1}},m=function(e){if(!r(e))return!1;switch(a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return p||!!h(d,l(e))}catch(e){return!0}};m.sham=!0,e.exports=!c||s((function(){var e;return f(f.call)||!f(Object)||!f((function(){e=!0}))||e}))?m:f},6704:function(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:function(e){e.exports=function(e){return null==e}},1632:function(e,t,i){var n=i(4328);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},2424:function(e,t,i){var n=i(1632);e.exports=function(e){return n(e)||null===e}},7048:function(e){e.exports=!1},7728:function(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:function(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:function(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,d=i(3336),h=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 d(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):d(void 0,!0)}if(i.inner)try{h(i.inner.iterator,"normal")}catch(e){return h(s,"throw",e)}return h(s,"normal"),d(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:function(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:function(e,t,i){var n,s,r,a=i(9957),o=i(4328),l=i(1632),u=i(9368),c=i(7796),d=i(6076),h=i(9972),p=i(7048),f=h("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])||d(n,f,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:m}},3556:function(e,t,i){var n=i(7584);e.exports=function(e){return n(e.length)}},5312:function(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),d=c.enforce,h=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=d(e);return a(n,"source")||(n.source=y(v,"string"==typeof t?t:"")),e};Function.prototype.toString=b((function(){return r(this)&&h(this).source||u(this)}),"toString")},1748:function(e){var t=Math.ceil,i=Math.floor;e.exports=Math.trunc||function(e){var n=+e;return(n>0?i:t)(n)}},8948:function(e,t,i){var n=i(5016);e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:n(e)}},9292:function(e,t,i){var n=i(3476),s=i(1664),r=i(8448),a=i(9957),o=i(1531),l=i(9392),u=i(8912),c=i(4356),d=i(5712),h=Object.assign,p=Object.defineProperty,f=s([].concat);e.exports=!h||a((function(){if(n&&1!==h({b:1},h(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},i=Symbol("assign detection"),s="abcdefghijklmnopqrst";return e[i]=7,s.split("").forEach((function(e){t[e]=e})),7!==h({},e)[i]||o(h({},t)).join("")!==s}))?function(e,t){for(var i=c(e),s=arguments.length,a=1,h=l.f,p=u.f;s>a;)for(var m,g=d(arguments[a++]),y=h?f(o(g),h(g)):o(g),_=y.length,v=0;_>v;)m=y[v++],n&&!r(p,g,m)||(i[m]=g[m]);return i}:h},9368:function(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),d="prototype",h="script",p=c("IE_PROTO"),f=function(){},m=function(e){return"<"+h+">"+e+"</"+h+">"},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"+h+":",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[d][a[s]];return y()};o[p]=!0,e.exports=Object.create||function(e,t){var i;return null!==e?(f[d]=s(e),i=new f,f[d]=null,i[p]=e):i=y(),void 0===t?i:r.f(i,t)}},2056:function(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:function(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,d="enumerable",h="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:h in i?i[h]:n[h],enumerable:d in i?i[d]:n[d],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:function(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),d=Object.getOwnPropertyDescriptor;t.f=n?d:function(e,t){if(e=o(e),t=l(t),c)try{return d(e,t)}catch(e){}if(u(e,t))return a(!s(r.f,e,t),e[t])}},5048:function(e,t,i){var n=i(9008),s=i(8256).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,s)}},9392:function(e,t){t.f=Object.getOwnPropertySymbols},7796:function(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:function(e,t,i){var n=i(1664);e.exports=n({}.isPrototypeOf)},9008:function(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:function(e,t,i){var n=i(9008),s=i(8256);e.exports=Object.keys||function(e){return n(e,s)}},8912:function(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},4024:function(e,t,i){var n=i(5288),s=i(3951),r=i(2096);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,i={};try{(e=n(Object.prototype,"__proto__","set"))(i,[]),t=i instanceof Array}catch(e){}return function(i,n){return s(i),r(n),t?e(i,n):i.__proto__=n,i}}():void 0)},7032:function(e,t,i){var n=i(16),s=i(4427);e.exports=n?{}.toString:function(){return"[object "+s(this)+"]"}},2104:function(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:function(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}},584:function(e,t,i){var n=i(8352).f;e.exports=function(e,t,i){i in e||n(e,i,{configurable:!0,get:function(){return t[i]},set:function(e){t[i]=e}})}},9092:function(e,t,i){var n=i(8448),s=i(3951),r=i(4328),a=i(1888),o=i(7680),l=TypeError;e.exports=function(e,t){var i=e.exec;if(r(i)){var u=n(i,e,t);return null!==u&&s(u),u}if("RegExp"===a(e))return n(o,e,t);throw new l("RegExp#exec called on incompatible receiver")}},7680:function(e,t,i){var n,s,r=i(8448),a=i(1664),o=i(5016),l=i(8872),u=i(3548),c=i(4696),d=i(9368),h=i(9104).get,p=i(8e3),f=i(9124),m=c("native-string-replace",String.prototype.replace),g=RegExp.prototype.exec,y=g,_=a("".charAt),v=a("".indexOf),b=a("".replace),T=a("".slice),w=(s=/b*/g,r(g,n=/a/,"a"),r(g,s,"a"),0!==n.lastIndex||0!==s.lastIndex),S=u.BROKEN_CARET,E=void 0!==/()??/.exec("")[1];(w||E||S||p||f)&&(y=function(e){var t,i,n,s,a,u,c,p=this,f=h(p),C=o(e),k=f.raw;if(k)return k.lastIndex=p.lastIndex,t=r(y,k,C),p.lastIndex=k.lastIndex,t;var x=f.groups,I=S&&p.sticky,A=r(l,p),O=p.source,L=0,P=C;if(I&&(A=b(A,"y",""),-1===v(A,"g")&&(A+="g"),P=T(C,p.lastIndex),p.lastIndex>0&&(!p.multiline||p.multiline&&"\n"!==_(C,p.lastIndex-1))&&(O="(?: "+O+")",P=" "+P,L++),i=new RegExp("^(?:"+O+")",A)),E&&(i=new RegExp("^"+O+"$(?!\\s)",A)),w&&(n=p.lastIndex),s=r(g,I?i:p,P),I?s?(s.input=T(s.input,L),s[0]=T(s[0],L),s.index=p.lastIndex,p.lastIndex+=s[0].length):p.lastIndex=0:w&&s&&(p.lastIndex=p.global?s.index+s[0].length:n),E&&s&&s.length>1&&r(m,s[0],i,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(s[a]=void 0)})),s&&x)for(s.groups=u=d(null),a=0;a<x.length;a++)u[(c=x[a])[0]]=s[c[1]];return s}),e.exports=y},8872:function(e,t,i){var n=i(3951);e.exports=function(){var e=n(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},3548:function(e,t,i){var n=i(9957),s=i(6420).RegExp,r=n((function(){var e=s("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),a=r||n((function(){return!s("a","y").sticky})),o=r||n((function(){var e=s("^r","gy");return e.lastIndex=2,null!==e.exec("str")}));e.exports={BROKEN_CARET:o,MISSED_STICKY:a,UNSUPPORTED_Y:r}},8e3:function(e,t,i){var n=i(9957),s=i(6420).RegExp;e.exports=n((function(){var e=s(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)}))},9124:function(e,t,i){var n=i(9957),s=i(6420).RegExp;e.exports=n((function(){var e=s("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))},5436:function(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:function(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:function(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:function(e,t,i){var n=i(3976);e.exports=function(e,t){return n[e]||(n[e]=t||{})}},9764:function(e,t,i){var n=i(1664),s=i(6180),r=i(5016),a=i(5436),o=n("".charAt),l=n("".charCodeAt),u=n("".slice),c=function(e){return function(t,i){var n,c,d=r(a(t)),h=s(i),p=d.length;return h<0||h>=p?e?"":void 0:(n=l(d,h))<55296||n>56319||h+1===p||(c=l(d,h+1))<56320||c>57343?e?o(d,h):n:e?u(d,h,h+2):c-56320+(n-55296<<10)+65536}};e.exports={codeAt:c(!1),charAt:c(!0)}},772:function(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:function(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:function(e,t,i){var n=i(5712),s=i(5436);e.exports=function(e){return n(s(e))}},6180:function(e,t,i){var n=i(1748);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},7584:function(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:function(e,t,i){var n=i(5436),s=Object;e.exports=function(e){return s(n(e))}},7024:function(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:function(e,t,i){var n=i(7024),s=i(7728);e.exports=function(e){var t=n(e,"string");return s(t)?t:t+""}},16:function(e,t,i){var n={};n[i(9972)("toStringTag")]="z",e.exports="[object z]"===String(n)},5016:function(e,t,i){var n=i(4427),s=String;e.exports=function(e){if("Symbol"===n(e))throw new TypeError("Cannot convert a Symbol value to a string");return s(e)}},36:function(e){var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},7776:function(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:function(e,t,i){var n=i(772);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},1576:function(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:function(e,t,i){var n=i(6420),s=i(4328),r=n.WeakMap;e.exports=s(r)&&/native code/.test(String(r))},9972:function(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"),d=l?u.for||u:u&&u.withoutSetter||a;e.exports=function(e){return r(c,e)||(c[e]=o&&r(u,e)?u[e]:d("Symbol."+e)),c[e]}},6488:function(e,t,i){var n=i(5232),s=i(5152),r=i(3440),a=i(7e3),o=i(4024),l=i(9968),u=i(584),c=i(7512),d=i(8948),h=i(3480),p=i(3696),f=i(3476),m=i(7048);e.exports=function(e,t,i,g){var y="stackTraceLimit",_=g?2:1,v=e.split("."),b=v[v.length-1],T=n.apply(null,v);if(T){var w=T.prototype;if(!m&&s(w,"cause")&&delete w.cause,!i)return T;var S=n("Error"),E=t((function(e,t){var i=d(g?t:e,void 0),n=g?new T(e):new T;return void 0!==i&&r(n,"message",i),p(n,E,n.stack,2),this&&a(w,this)&&c(n,this,E),arguments.length>_&&h(n,arguments[_]),n}));if(E.prototype=w,"Error"!==b?o?o(E,S):l(E,S,{name:!0}):f&&y in T&&(u(E,T,y),u(E,T,"prepareStackTrace")),l(E,T),!m)try{w.name!==b&&r(w,"name",b),w.constructor=E}catch(e){}return E}}},7476:function(e,t,i){var n=i(9160),s=i(9957),r=i(1432),a=i(1632),o=i(4356),l=i(3556),u=i(4316),c=i(92),d=i(2568),h=i(953),p=i(9972),f=i(8504),m=p("isConcatSpreadable"),g=f>=51||!s((function(){var e=[];return e[m]=!1,e.concat()[0]!==e})),y=function(e){if(!a(e))return!1;var t=e[m];return void 0!==t?!!t:r(e)};n({target:"Array",proto:!0,arity:1,forced:!g||!h("concat")},{concat:function(e){var t,i,n,s,r,a=o(this),h=d(a,0),p=0;for(t=-1,n=arguments.length;t<n;t++)if(y(r=-1===t?a:arguments[t]))for(s=l(r),u(p+s),i=0;i<s;i++,p++)i in r&&c(h,p,r[i]);else u(p+1),c(h,p++,r);return h.length=p,h}})},6932:function(e,t,i){var n=i(9160),s=i(3364).filter;n({target:"Array",proto:!0,forced:!i(953)("filter")},{filter:function(e){return s(this,e,arguments.length>1?arguments[1]:void 0)}})},700:function(e,t,i){var n=i(9160),s=i(1664),r=i(5712),a=i(4096),o=i(1496),l=s([].join);n({target:"Array",proto:!0,forced:r!==Object||!o("join",",")},{join:function(e){return l(a(this),void 0===e?",":e)}})},4456:function(e,t,i){var n=i(9160),s=i(3364).map;n({target:"Array",proto:!0,forced:!i(953)("map")},{map:function(e){return s(this,e,arguments.length>1?arguments[1]:void 0)}})},4728:function(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}})},8752:function(e,t,i){var n=i(9160),s=i(6420),r=i(908),a=i(6488),o="WebAssembly",l=s[o],u=7!==new Error("e",{cause:7}).cause,c=function(e,t){var i={};i[e]=a(e,t,u),n({global:!0,constructor:!0,arity:1,forced:u},i)},d=function(e,t){if(l&&l[e]){var i={};i[e]=a(o+"."+e,t,u),n({target:o,stat:!0,constructor:!0,arity:1,forced:u},i)}};c("Error",(function(e){return function(t){return r(e,this,arguments)}})),c("EvalError",(function(e){return function(t){return r(e,this,arguments)}})),c("RangeError",(function(e){return function(t){return r(e,this,arguments)}})),c("ReferenceError",(function(e){return function(t){return r(e,this,arguments)}})),c("SyntaxError",(function(e){return function(t){return r(e,this,arguments)}})),c("TypeError",(function(e){return function(t){return r(e,this,arguments)}})),c("URIError",(function(e){return function(t){return r(e,this,arguments)}})),d("CompileError",(function(e){return function(t){return r(e,this,arguments)}})),d("LinkError",(function(e){return function(t){return r(e,this,arguments)}})),d("RuntimeError",(function(e){return function(t){return r(e,this,arguments)}}))},508:function(e,t,i){var n=i(3476),s=i(6208).EXISTS,r=i(1664),a=i(2544),o=Function.prototype,l=r(o.toString),u=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,c=r(u.exec);n&&!s&&a(o,"name",{configurable:!0,get:function(){try{return c(u,l(this))[1]}catch(e){return""}}})},232:function(e,t,i){var n=i(9160),s=i(9292);n({target:"Object",stat:!0,arity:2,forced:Object.assign!==s},{assign:s})},5443:function(e,t,i){var n=i(16),s=i(6076),r=i(7032);n||s(Object.prototype,"toString",r,{unsafe:!0})},880:function(e,t,i){var n=i(9160),s=i(7680);n({target:"RegExp",proto:!0,forced:/./.exec!==s},{exec:s})},9836:function(e,t,i){var n=i(8448),s=i(7176),r=i(3951),a=i(9760),o=i(7584),l=i(5016),u=i(5436),c=i(4504),d=i(4764),h=i(9092);s("match",(function(e,t,i){return[function(t){var i=u(this),s=a(t)?void 0:c(t,e);return s?n(s,t,i):new RegExp(t)[e](l(i))},function(e){var n=r(this),s=l(e),a=i(t,n,s);if(a.done)return a.value;if(!n.global)return h(n,s);var u=n.unicode;n.lastIndex=0;for(var c,p=[],f=0;null!==(c=h(n,s));){var m=l(c[0]);p[f]=m,""===m&&(n.lastIndex=d(s,o(n.lastIndex),u)),f++}return 0===f?null:p}]}))},3536:function(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),d=i(9957),h=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||!d((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");h(this,e)?this[e]=t:c(this,e,t)}}):f[e]=t};h(f,v)||E(v,_),!w&&h(f,y)&&f[y]!==Object||E(y,S),S.prototype=f,n({global:!0,constructor:!0,forced:w},{Iterator:S})},2144:function(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),d=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 d(o(this),{predicate:e})}})},9080:function(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=function(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=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var n={};return function(){i.d(n,{default:function(){return X}}),i(8752),i(6932),i(4456),i(508),i(232),i(5443),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 d=new e;return d.nodeName=i,d.children=c,d.attributes=null==n?void 0:n,d.key=null==n?void 0:n.key,void 0!==t.vnode&&t.vnode(d),d}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,d=[];function h(e){!e._dirty&&(e._dirty=!0)&&1==d.push(e)&&(t.debounceRendering||u)(p)}function p(){for(var e;e=d.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)?(P(s,u,3,i,n),e=s.base):(r&&!o&&(M(r),e=a=null),s=O(t.nodeName,u,i),e&&!s.nextBase&&(s.nextBase=e,a=null),P(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,d=r.__preactattr_,h=t.children;if(null==d){d=r.__preactattr_={};for(var p=r.attributes,v=p.length;v--;)d[p[v].name]=p[v].value}return!S&&h&&1===h.length&&"string"==typeof h[0]&&null!=c&&void 0!==c.splitText&&null==c.nextSibling?c.nodeValue!=h[0]&&(c.nodeValue=h[0]):(h&&h.length||null!=c)&&function(e,t,i,n,s){var r,a,o,l,u,c=e.childNodes,d=[],h={},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++,h[S]=T):(w||(void 0!==T.splitText?!s||T.nodeValue.trim():s))&&(d[_++]=T)}if(0!==v)for(b=0;b<v;b++){var S;if(u=null,null!=(S=(l=t[b]).key))p&&void 0!==h[S]&&(u=h[S],h[S]=void 0,p--);else if(m<_)for(r=m;r<_;r++)if(void 0!==d[r]&&f(a=d[r],l,s)){u=a,d[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 h)void 0!==h[b]&&x(h[b],!1);for(;m<=_;)void 0!==(u=d[_--])&&x(u,!1)}(r,h,i,n,S||null!=d.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,d),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 O(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=L);s--;)if(A[s].constructor===e)return n.nextBase=A[s].nextBase,A.splice(s,1),n;return n}function L(e,t,i){return this.constructor(e,i)}function P(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?h(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,d=e.context,h=e.prevProps||u,p=e.prevState||c,f=e.prevContext||d,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=h,e.state=p,e.context=f,2!==i&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(u,c,d)?w=!0:e.componentWillUpdate&&e.componentWillUpdate(u,c,d),e.props=u,e.state=c,e.context=d),e.prevProps=e.prevState=e.prevContext=e.nextBase=null,e._dirty=!1,!w){r=e.render(u,c,d),e.getChildContext&&(d=o(o({},d),e.getChildContext())),m&&e.getSnapshotBeforeUpdate&&(S=e.getSnapshotBeforeUpdate(h,p));var k,I,A=r&&r.nodeName;if("function"==typeof A){var L=g(r);(a=v)&&a.constructor===A&&L.key==a.__key?P(a,L,1,d,!1):(k=a,e._component=a=O(A,L,d),a.nextBase=a.nextBase||y,a._parentComponent=e,P(a,L,0,d,!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,d,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,U=e;U=U._parentComponent;)(R=U).base=I;I._component=R,I._componentConstructor=R.constructor}}for(!m||n?b.push(e):w||(e.componentDidUpdate&&e.componentDidUpdate(h,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=[]}function R(e,t,i){return C(i,e,{},!1,t,!1)}function U(e,t){return U=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},U(e,t)}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),h(this)},forceUpdate:function(e){e&&this._renderCallbacks.push(e),D(this,2)},render:function(){}}),i(700),i(4728),i(880),i(9836),i(7476);var F=function(e){var t,i;function n(){for(var t,i=arguments.length,n=new Array(i),s=0;s<i;s++)n[s]=arguments[s];return(t=e.call.apply(e,[this].concat(n))||this).state={bump:!1,debounced:!1},t}i=e,(t=n).prototype=Object.create(i.prototype),t.prototype.constructor=t,U(t,i);var s=n.prototype;return s.componentWillMount=function(){var e,t,i,n=this;this.debounceStatusUpdate=(e=function(){if(!n.state.debounced){var e=!n.props.isInFocus||n.props.validChoiceMade;n.setState((function(t){return{bump:!t.bump,debounced:!0,silenced:e}}))}},t=1400,function(){var n=this,s=arguments;clearTimeout(i),i=setTimeout((function(){i=null,e.apply(n,s)}),t)})},s.componentWillReceiveProps=function(e){e.queryLength,this.setState({debounced:!1})},s.render=function(){var e=this.props,t=e.id,i=e.length,n=e.queryLength,s=e.minQueryLength,r=e.selectedOption,o=e.selectedOptionIndex,l=e.tQueryTooShort,u=e.tNoResults,c=e.tSelectedOption,d=e.tResults,h=e.className,p=this.state,f=p.bump,m=p.debounced,g=p.silenced,y=n<s,_=0===i,v=r?c(r,i,o):"",b=null;return b=y?l(s):_?u():d(i,v),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:t+"__status--A",role:"status","aria-atomic":"true","aria-live":"polite"},!g&&m&&f?b:""),a("div",{id:t+"__status--B",role:"status","aria-atomic":"true","aria-live":"polite"},g||!m||f?"":b))},n}(N);F.defaultProps={tQueryTooShort:function(e){return"Type in "+e+" or more characters for results"},tNoResults:function(){return"No search results"},tSelectedOption:function(e,t,i){return e+" "+(i+1)+" of "+t+" is highlighted"},tResults:function(e,t){return e+" "+(1===e?"result":"results")+" "+(1===e?"is":"are")+" available. "+t}};var B=function(e){return a("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",className:e.className,focusable:"false"},a("g",{stroke:"none",fill:"none","fill-rule":"evenodd"},a("polygon",{fill:"#000000",points:"0 0 22 0 11 17"})))};function j(){return j=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},j.apply(this,arguments)}function $(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function q(e,t){return q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},q(e,t)}var V={13:"enter",27:"escape",32:"space",38:"up",40:"down"};function H(){return"undefined"!=typeof navigator&&!(!navigator.userAgent.match(/(iPod|iPhone|iPad)/g)||!navigator.userAgent.match(/AppleWebKit/g))}var z=function(e){var t,i;function n(t){var i;return(i=e.call(this,t)||this).elementReferences={},i.state={focused:null,hovered:null,menuOpen:!1,options:t.defaultValue?[t.defaultValue]:[],query:t.defaultValue,validChoiceMade:!1,selected:null,ariaHint:!0},i.handleComponentBlur=i.handleComponentBlur.bind($(i)),i.handleKeyDown=i.handleKeyDown.bind($(i)),i.handleUpArrow=i.handleUpArrow.bind($(i)),i.handleDownArrow=i.handleDownArrow.bind($(i)),i.handleEnter=i.handleEnter.bind($(i)),i.handlePrintableKey=i.handlePrintableKey.bind($(i)),i.handleListMouseLeave=i.handleListMouseLeave.bind($(i)),i.handleOptionBlur=i.handleOptionBlur.bind($(i)),i.handleOptionClick=i.handleOptionClick.bind($(i)),i.handleOptionFocus=i.handleOptionFocus.bind($(i)),i.handleOptionMouseDown=i.handleOptionMouseDown.bind($(i)),i.handleOptionMouseEnter=i.handleOptionMouseEnter.bind($(i)),i.handleInputBlur=i.handleInputBlur.bind($(i)),i.handleInputChange=i.handleInputChange.bind($(i)),i.handleInputClick=i.handleInputClick.bind($(i)),i.handleInputFocus=i.handleInputFocus.bind($(i)),i.pollInputElement=i.pollInputElement.bind($(i)),i.getDirectInputChanges=i.getDirectInputChanges.bind($(i)),i}i=e,(t=n).prototype=Object.create(i.prototype),t.prototype.constructor=t,q(t,i);var s=n.prototype;return s.isQueryAnOption=function(e,t){var i=this;return-1!==t.map((function(e){return i.templateInputValue(e).toLowerCase()})).indexOf(e.toLowerCase())},s.componentDidMount=function(){this.pollInputElement()},s.componentWillUnmount=function(){clearTimeout(this.$pollInput)},s.pollInputElement=function(){var e=this;this.getDirectInputChanges(),this.$pollInput=setTimeout((function(){e.pollInputElement()}),100)},s.getDirectInputChanges=function(){var e=this.elementReferences[-1];e&&e.value!==this.state.query&&this.handleInputChange({target:{value:e.value}})},s.componentDidUpdate=function(e,t){var i=this.state.focused,n=null===i,s=t.focused!==i;s&&!n&&this.elementReferences[i].focus();var r=-1===i,a=s&&null===t.focused;if(r&&a){var o=this.elementReferences[i];o.setSelectionRange(0,o.value.length)}},s.hasAutoselect=function(){return!H()&&this.props.autoselect},s.templateInputValue=function(e){var t=this.props.templates&&this.props.templates.inputValue;return t?t(e):e},s.templateSuggestion=function(e){var t=this.props.templates&&this.props.templates.suggestion;return t?t(e):e},s.handleComponentBlur=function(e){var t,i=this.state,n=i.options,s=i.query,r=i.selected;this.props.confirmOnBlur?(t=e.query||s,this.props.onConfirm(n[r])):t=s,this.setState({focused:null,menuOpen:e.menuOpen||!1,query:t,selected:null,validChoiceMade:this.isQueryAnOption(t,n)})},s.handleListMouseLeave=function(e){this.setState({hovered:null})},s.handleOptionBlur=function(e,t){var i=this.state,n=i.focused,s=i.menuOpen,r=i.options,a=i.selected,o=null===e.relatedTarget,l=e.relatedTarget===this.elementReferences[-1],u=n!==t&&-1!==n;if(!u&&o||!u&&!l){var c=s&&H();this.handleComponentBlur({menuOpen:c,query:this.templateInputValue(r[a])})}},s.handleInputBlur=function(e){var t=this.state,i=t.focused,n=t.menuOpen,s=t.options,r=t.query,a=t.selected;if(-1===i){var o=n&&H(),l=H()?r:this.templateInputValue(s[a]);this.handleComponentBlur({menuOpen:o,query:l})}},s.handleInputChange=function(e){var t=this,i=this.props,n=i.minLength,s=i.source,r=i.showAllValues,a=this.hasAutoselect(),o=e.target.value,l=0===o.length,u=this.state.query!==o,c=o.length>=n;this.setState({query:o,ariaHint:l}),r||!l&&u&&c?s(o,(function(e){var i=e.length>0;t.setState({menuOpen:i,options:e,selected:a&&i?0:-1,validChoiceMade:!1})})):!l&&c||this.setState({menuOpen:!1,options:[]})},s.handleInputClick=function(e){this.handleInputChange(e)},s.handleInputFocus=function(e){var t=this.state,i=t.query,n=t.validChoiceMade,s=t.options,r=this.props.minLength,a=!n&&i.length>=r&&s.length>0;a?this.setState((function(e){var t=e.menuOpen;return{focused:-1,menuOpen:a||t,selected:-1}})):this.setState({focused:-1})},s.handleOptionFocus=function(e){this.setState({focused:e,hovered:null,selected:e})},s.handleOptionMouseEnter=function(e,t){H()||this.setState({hovered:t})},s.handleOptionClick=function(e,t){var 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()},s.handleOptionMouseDown=function(e){e.preventDefault()},s.handleUpArrow=function(e){e.preventDefault();var t=this.state,i=t.menuOpen,n=t.selected;-1!==n&&i&&this.handleOptionFocus(n-1)},s.handleDownArrow=function(e){var t=this;if(e.preventDefault(),this.props.showAllValues&&!1===this.state.menuOpen)e.preventDefault(),this.props.source("",(function(e){t.setState({menuOpen:!0,options:e,selected:0,focused:0,hovered:null})}));else if(!0===this.state.menuOpen){var i=this.state,n=i.menuOpen,s=i.options,r=i.selected;r!==s.length-1&&n&&this.handleOptionFocus(r+1)}},s.handleSpace=function(e){var t=this;this.props.showAllValues&&!1===this.state.menuOpen&&""===this.state.query&&(e.preventDefault(),this.props.source("",(function(e){t.setState({menuOpen:!0,options:e})}))),-1!==this.state.focused&&(e.preventDefault(),this.handleOptionClick(e,this.state.focused))},s.handleEnter=function(e){this.state.menuOpen&&(e.preventDefault(),this.state.selected>=0&&this.handleOptionClick(e,this.state.selected))},s.handlePrintableKey=function(e){var t=this.elementReferences[-1];e.target===t||t.focus()},s.handleKeyDown=function(e){switch(V[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},s.render=function(){var e,t=this,i=this.props,n=i.cssNamespace,s=i.displayMenu,r=i.id,o=i.minLength,l=i.name,u=i.placeholder,c=i.required,d=i.showAllValues,h=i.tNoResults,p=i.tStatusQueryTooShort,f=i.tStatusNoResults,m=i.tStatusSelectedOption,g=i.tStatusResults,y=i.tAssistiveHint,_=i.dropdownArrow,v=i.menuAttributes,b=i.inputClasses,T=i.hintClasses,w=i.menuClasses,S=this.state,E=S.focused,C=S.hovered,k=S.menuOpen,x=S.options,I=S.query,A=S.selected,O=S.ariaHint,L=S.validChoiceMade,P=this.hasAutoselect(),D=-1===E,M=0===x.length,N=0!==I.length,R=I.length>=o,U=this.props.showNoOptionsFound&&D&&M&&N&&R,B=n+"__wrapper",$=n+"__status",q=n+"__dropdown-arrow-down",V=-1!==E&&null!==E,z=n+"__option",W=n+"__hint",G=this.templateInputValue(x[A]),X=G&&0===G.toLowerCase().indexOf(I.toLowerCase())&&P?I+G.substr(I.length):"",K=r+"__assistiveHint",Y={"aria-describedby":O?K:null,"aria-expanded":k?"true":"false","aria-activedescendant":V?r+"__option--"+E:null,"aria-controls":r+"__listbox","aria-autocomplete":this.hasAutoselect()?"both":"list"};d&&"string"==typeof(e=_({className:q}))&&(e=a("div",{className:n+"__dropdown-arrow-down-wrapper",dangerouslySetInnerHTML:{__html:e}}));var Q=n+"__input",J=[Q,this.props.showAllValues?Q+"--show-all-values":Q+"--default"];null!==E&&J.push(Q+"--focused"),b&&J.push(b);var Z=n+"__menu",ee=[Z,Z+"--"+s,Z+"--"+(k||U?"visible":"hidden")];w&&ee.push(w),(null!=v&&v.class||null!=v&&v.className)&&ee.push((null==v?void 0:v.class)||(null==v?void 0:v.className));var te=Object.assign({"aria-labelledby":r},v,{id:r+"__listbox",role:"listbox",className:ee.join(" "),onMouseLeave:this.handleListMouseLeave});return delete te.class,a("div",{className:B,onKeyDown:this.handleKeyDown},a(F,{id:r,length:x.length,queryLength:I.length,minQueryLength:o,selectedOption:this.templateInputValue(x[A]),selectedOptionIndex:A,validChoiceMade:L,isInFocus:null!==this.state.focused,tQueryTooShort:p,tNoResults:f,tSelectedOption:m,tResults:g,className:$}),X&&a("span",null,a("input",{className:[W,null===T?b:T].filter(Boolean).join(" "),readonly:!0,tabIndex:"-1",value:X})),a("input",j({},Y,{autoComplete:"off",className:J.join(" "),id:r,onClick:this.handleInputClick,onBlur:this.handleInputBlur},{onInput:this.handleInputChange},{onFocus:this.handleInputFocus,name:l,placeholder:u,ref:function(e){t.elementReferences[-1]=e},type:"text",role:"combobox",required:c,value:I})),e,a("ul",te,x.map((function(e,i){var n=(-1===E?A===i:E===i)&&null===C?" "+z+"--focused":"",s=i%2?" "+z+"--odd":"",o=H()?"<span id="+r+"__option-suffix--"+i+' 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"> '+(i+1)+" of "+x.length+"</span>":"";return a("li",{"aria-selected":E===i?"true":"false",className:""+z+n+s,dangerouslySetInnerHTML:{__html:t.templateSuggestion(e)+o},id:r+"__option--"+i,key:i,onBlur:function(e){return t.handleOptionBlur(e,i)},onClick:function(e){return t.handleOptionClick(e,i)},onMouseDown:t.handleOptionMouseDown,onMouseEnter:function(e){return t.handleOptionMouseEnter(e,i)},ref:function(e){t.elementReferences[i]=e},role:"option",tabIndex:"-1","aria-posinset":i+1,"aria-setsize":x.length})})),U&&a("li",{className:z+" "+z+"--no-results",role:"option","aria-disabled":"true"},h())),a("span",{id:K,style:{display:"none"}},y()))},n}(N);function W(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=G(e.source)),R(a(z,e),e.element)}z.defaultProps={autoselect:!1,cssNamespace:"autocomplete",defaultValue:"",displayMenu:"inline",minLength:0,name:"input-autocomplete",placeholder:"",onConfirm:function(){},confirmOnBlur:!0,showNoOptionsFound:!0,showAllValues:!1,required:!1,tNoResults:function(){return"No results found"},tAssistiveHint:function(){return"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:B,menuAttributes:{},inputClasses:null,hintClasses:null,menuClasses:null};var G=function(e){return function(t,i){i(e.filter((function(e){return-1!==e.toLowerCase().indexOf(t.toLowerCase())})))}};W.enhanceSelectElement=function(e){if(!e.selectElement)throw new Error("selectElement is not defined");if(!e.source){var t=[].filter.call(e.selectElement.options,(function(t){return t.value||e.preserveNullOptions}));e.source=t.map((function(e){return e.textContent||e.innerText}))}if(e.onConfirm=e.onConfirm||function(t){var i=[].filter.call(e.selectElement.options,(function(e){return(e.textContent||e.innerText)===t}))[0];i&&(i.selected=!0)},e.selectElement.value||void 0===e.defaultValue){var i=e.selectElement.options[e.selectElement.options.selectedIndex];e.defaultValue=i.textContent||i.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);var n=document.createElement("div");e.selectElement.parentNode.insertBefore(n,e.selectElement),W(Object.assign({},e,{element:n})),e.selectElement.style.display="none",e.selectElement.id=e.selectElement.id+"-select"};var X=W}(),n.default}()}));Br.accessibleAutocomplete;const jr={autocomplete:[]},$r="autocomplete-list-show",qr="data-bs-autocomplete",Vr="input["+qr+'][type="search"]';class Hr extends fi{constructor(e,t){super(e),this._config=this._getConfig(t),this._items=[],this._autocompleteElement=null,this._label=new Ei(e),this._init(),this._bindEvents()}static get NAME(){return"inputsearchautocomplete"}search(){const e=this._element.value;
2
2
  //!!! $autocomplete.empty()
3
3
  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($r),this._autocompleteElement.appendChild(this._createOption(a,n,s,r)))})):this._autocompleteElement.classList.remove($r)}_getConfig(e){return e={...jr,..."object"==typeof e?e:{}}}_getItems(){try{return JSON.parse(this._element.getAttribute(qr))}catch(e){return console.error("[InputSearchAutocomplete] invalid data provided for "+qr+" 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(){li.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(Vr+", label").forEach((function(e){const t=Ei.getInputFromLabel(e)||e;var i;(i=t)&&i.matches(Vr)&&Hr.getOrCreateInstance(i)}))}));const zr=".bs.inputpassword",Wr=".data-api",Gr={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."},Xr=`click${zr}`,Kr=`keyup${zr}`,Yr=`score${zr}`,Qr=`text${zr}`,Jr=`suggs${zr}`,Zr=`click${zr}${Wr}`,ea=`mousedown${zr}${Wr}`,ta=`keyup${zr}${Wr}`,ia='input[data-bs-input][type="password"]',na=".password-icon";class sa extends fi{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 Ei(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={...Gr,...hi.getDataAttributes(this._element),..."object"==typeof e?e:{}}}_init(){this._isCustom&&(this._handleAutofill(),this._showPwdElement=mi.findOne(na,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,{...hi.getDataAttributes(this._textElement)})),this._suggsElement&&this._createsuggestionsList()))}_bindEvents(){this._isCustom&&(this._showPwdElement&&li.on(this._showPwdElement,Xr,(()=>this._toggleShowPassword())),this._meter&&(li.on(this._element,Kr,(()=>this._checkPassword())),li.on(this._element,"input",(()=>this._checkPassword()))))}_handleAutofill(){const e=()=>{""!==this._element.value&&(this._label._labelOut(),this._checkPassword())};e(),setTimeout(e,100),li.on(this._element,"animationstart",(t=>{"onAutoFillStart"===t.animationName&&e()}))}_toggleShowPassword(){const e="password"===this._element.getAttribute("type");mi.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)),li.trigger(this._element,Yr)}_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)}`),li.trigger(this._element,Qr))}}_updateSuggestions(e){this._suggsElement&&(this._updateSuggestionsList(e),li.trigger(this._element,Jr))}_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=Gr.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 Nx=e=>e&&e.matches(ia)?sa.getOrCreateInstance(e):null,Rx=()=>{const e=mi.findOne(ia);e&&sa.getOrCreateInstance(e)};"loading"!==document.readyState?Rx():document.addEventListener("DOMContentLoaded",Rx),li.on(document,ea,ia+", label",(function(){const e=Ei.getInputFromLabel(this)||this;Nx(e)})),li.on(document,ta,ia+", label",(function(){const e=Ei.getInputFromLabel(this)||this,t=Nx(e);t&&t._label&&t._label._labelOut()})),li.on(document,Zr,na,(function(){const e=this.parentNode&&this.parentNode.querySelector(ia);e&&sa.getOrCreateInstance(e)}))}var ra,aa=Fr((function(e,t){
4
4
  /*! Shifty 2.20.4 - https://github.com/jeremyckahn/shifty */
@@ -30,4 +30,4 @@ class qS{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width
30
30
  /*! @name @videojs/http-streaming @version 3.16.2 @license Apache-2.0 */
31
31
  const WS=_f,GS=(e,t)=>t&&t.responseURL&&e!==t.responseURL?t.responseURL:e,XS=e=>$S.log.debug?$S.log.debug.bind($S,"VHS:",`${e} >`):function(){};function KS(...e){const t=$S.obj||$S;return(t.merge||t.mergeOptions).apply(t,e)}function YS(...e){const t=$S.time||$S;return(t.createTimeRanges||t.createTimeRanges).apply(t,e)}const QS=1/30,JS=.1,ZS=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 YS(i)},eE=function(e,t){return ZS(e,(function(e,i){return e-JS<=t&&i+JS>=t}))},tE=function(e,t){return ZS(e,(function(e){return e-QS>=t}))},iE=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(", ")},nE=e=>{const t=[];for(let i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t},sE=function(e){if(e&&e.length&&e.end)return e.end(e.length-1)},rE=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},aE=(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},oE=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)),[]),lE=e=>{const t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},uE=({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},cE=(e,t)=>{if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;const i=lE(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},dE=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+=aE(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+=aE(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},hE=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 Xh.Infinity}return dE(e,t,i)},pE=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},fE=function(e,t,i,n){if(!e||!e.segments)return null;if(e.endList)return hE(e);if(null===t)return null;t=t||0;let s=dE(e,e.mediaSequence+e.segments.length,t);return i&&(s-=n="number"==typeof n?n:cE(null,e)),Math.max(0,s)},mE=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},gE=function(e){return e.excludeUntil&&e.excludeUntil===1/0},yE=function(e){const t=mE(e);return!e.disabled&&!t},_E=function(e,t){return t.attributes&&t.attributes[e]},vE=(e,t)=>{if(1===e.playlists.length)return!0;const i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter((e=>!!yE(e)&&(e.attributes.BANDWIDTH||0)<i)).length},bE=(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)))),TE=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},wE=e=>{if(!e||!e.playlists||!e.playlists.length){return TE(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=>Uf(e))))continue;if(!TE(e,(e=>bE(i,e))))return!1}return!0};var SE={liveEdgeDelay:cE,duration:hE,seekable:function(e,t,i){const n=t||0;let s=fE(e,t,!0,i);return null===s?YS():(s<n&&(s=n),YS(n,s))},getMediaInfoForTime:function({playlist:e,currentTime:t,startingSegmentIndex:i,startingPartIndex:n,startTime:s,exactManifestTimings:r}){let a=t-s;const o=oE(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+QS<=0)continue;return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:s-pE({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>QS;if(!(0===a)&&!(n&&a+QS>=0)||t===o.length-1){if(r){if(a>0)continue}else if(a-QS>=0)continue;return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:s+pE({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:yE,isDisabled:function(e){return e.disabled},isExcluded:mE,isIncompatible:gE,playlistEnd:fE,isAes:function(e){for(let t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},hasAttribute:_E,estimateSegmentRequestTime:function(e,t,i,n=0){if(!_E("BANDWIDTH",i))return NaN;return(e*i.attributes.BANDWIDTH-8*n)/t},isLowestEnabledRendition:vE,isAudioOnly:wE,playlistMatch:bE,segmentDurationWithParts:aE};const{log:EE}=$S,CE=(e,t)=>`${e}-${t}`,kE=(e,t,i)=>`placeholder-uri-${e}-${t}-${i}`,xE=(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)}}))},IE=({playlist:e,uri:t,id:i})=>{e.id=i,e.playlistErrors_=0,t&&(e.uri=t),e.attributes=e.attributes||{}},AE=(e,t,i=kE)=>{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=wE(e);xE(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=[Ep({},t)]}t.playlists.forEach((function(t,n){const o=i(s,r,a,t),l=CE(n,o);t.uri?t.resolvedUri=t.resolvedUri||WS(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];IE({playlist:i,id:CE(t,i.uri)}),i.resolvedUri=WS(e.uri,i.uri),e.playlists[i.id]=i,e.playlists[i.uri]=i,i.attributes.BANDWIDTH||EE.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}})(e),(e=>{xE(e,(t=>{t.uri&&(t.resolvedUri=WS(e.uri,t.uri))}))})(e)};class OE{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 LE=({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=Ep({},i),a.errorType=$S.Error.NetworkRequestFailed;else if(t.aborted)a.errorType=$S.Error.NetworkRequestAborted;else if(t.timedout)a.erroType=$S.Error.NetworkRequestTimeout;else if(o){const e=n?$S.Error.NetworkBodyParserFailed:$S.Error.NetworkBadStatus;a.errorType=e,a.status=t.status,a.headers=t.headers}return a},{EventTarget:PE}=$S,DE=(e,t)=>{if(!e)return t;const i=KS(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]=KS(e.parts[n],t.parts[n]));return!e.skipped&&t.skipped&&(i.skipped=!1),e.preload&&!t.preload&&(i.preload=!1),i},ME=(e,t)=>{!e.resolvedUri&&e.uri&&(e.resolvedUri=WS(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=WS(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=WS(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=WS(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach((e=>{e.resolvedUri||(e.resolvedUri=WS(t,e.uri))})),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach((e=>{e.resolvedUri||(e.resolvedUri=WS(t,e.uri))}))},NE=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},RE=(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,UE=(e,t,i=RE)=>{const n=KS(e,{}),s=n.playlists[t.id];if(!s)return null;if(i(s,t))return null;t.segments=NE(t);const r=KS(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(DE(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=>{ME(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,xE(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},FE=(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)},BE=(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 jE extends PE{constructor(e,t,i={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=XS("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 OE,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=WS(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=uE(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 Xh.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:LE({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:t}){try{return(({onwarn:e,oninfo:t,manifestString:i,customTagParsers:n=[],customTagMappers:s=[],llhls:r})=>{const a=new Af;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=lE(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}`}),EE.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),o.partTargetDuration=t}return o})({onwarn:({message:t})=>this.logger_(`m3u8-parser warn for ${e}: ${t}`),oninfo:({message:t})=>this.logger_(`m3u8-parser info for ${e}: ${t}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls})}catch(e){this.error=e,this.error.metadata={errorType:$S.Error.StreamingHlsPlaylistParserError,error:e}}}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(),IE({playlist:r,uri:i,id:n});const a=UE(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_(FE(this.media(),!!a)),s.parsedPlaylist=BE(this.main.playlists,s.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:s}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),Xh.clearTimeout(this.mediaUpdateTimeout),Xh.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new OE,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(Xh.clearTimeout(this.finalRenditionTimeout),t){const t=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;return void(this.finalRenditionTimeout=Xh.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_(FE(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=GS(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&&(Xh.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&&(Xh.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const e=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=Xh.setTimeout((()=>{this.mediaUpdateTimeout=null,this.load()}),e)}else this.started?t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(Xh.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=Xh.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=Xh.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:LE({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=GS(this.src,i),this.trigger({type:"playlistparsestart",metadata:e});const n=this.parseManifest_({manifestString:i.responseText,url:this.src});e.parsedPlaylist=BE(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,AE(this.main,this.srcUri()),e.playlists.forEach((e=>{e.segments=NE(e),e.segments.forEach((t=>{ME(t,e.resolvedUri)}))})),this.trigger("loadedplaylist"),void(this.request||this.media(this.main.playlists[0]));const t=this.srcUri()||Xh.location.href;this.main=((e,t)=>{const i=CE(0,t),n={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:Xh.location.href,resolvedUri:Xh.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=CE(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=CE(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]=Ep({},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=kE(s,t,i),c=CE(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),KS(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){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const n=e.contentProtection[i].attributes.keyId;n&&t.add(n.toLowerCase())}return t}}}const $E=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)},qE=function(){const e=function e(t,i){t=KS({timeout:45e3},t);const n=e.beforeRequest||$S.Vhs.xhr.beforeRequest,s=e._requestCallbackSet||$S.Vhs.xhr._requestCallbackSet||new Set,r=e._responseCallbackSet||$S.Vhs.xhr._responseCallbackSet;n&&"function"==typeof n&&($S.log.warn("beforeRequest is deprecated, use onRequest instead."),s.add(n));const a=!0===$S.Vhs.xhr.original?$S.xhr:$S.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),$E(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},VE=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?Xh.BigInt(e.offset)+Xh.BigInt(e.length)-Xh.BigInt(1):e.offset+e.length-1,"bytes="+i+"-"+t}(e.byterange)),t},HE=function(e,t){return e.start(t)+"-"+e.end(t)},zE=function(e,t){const i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")},WE=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},GE=function(e){const t={};return Object.keys(e).forEach((i=>{const n=e[i];zf(n)?t[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:t[i]=n})),t},XE=function(e){const t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},KE=function(e){return e.resolvedUri},YE=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(zE).join(""),s=t.slice(e*i,e*i+i).map(WE).join(""),r+=n+" "+s+"\n";return r};var QE=Object.freeze({__proto__:null,createTransferableMessage:GE,initSegmentId:XE,segmentKeyId:KE,hexDump:YE,tagDump:({bytes:e})=>YE(e),textRanges:e=>{let t,i="";for(t=0;t<e.length;t++)i+=HE(e,t)+" ";return i}});const JE=({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)},ZE=({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:SE.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",(()=>{ZE({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)},eC=(e,t)=>{if(4===e.readyState)return t()},tC=(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=LE({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 Wf(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=Wf(e),s.set(e,r),r+=e.byteLength})),s}(r,Qf(i,!0)),s=s||t_(r),r.length<10||s&&r.length<s+2)return eC(t,(()=>o(e,t,"",r)));const l=S_(r);return"ts"===l&&r.length<188||!l&&r.length<376?eC(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 $E(e,null,{statusCode:e.status},l)}))}},c=t(u,(function(e,t){return $E(c,e,t,l)}));return c},{EventTarget:iC}=$S,nC=function(e,t){if(!RE(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},sC=(e,t,i,n)=>`placeholder-uri-${e}-${t}-${n.attributes.NAME||i}`,rC=(e,t,i)=>{let n=!0,s=KS(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=vy(r.sidx);i&&i[e]&&i[e].sidx&&hy(r,i[e].sidx,r.sidx.resolvedUri)}const a=UE(s,r,nC);a&&(s=a,n=!1)}return xE(t,((e,t,i,r)=>{if(e.playlists&&e.playlists.length){const a=e.playlists[0].id,o=UE(s,e.playlists[0],nC);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)=>{xE(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},aC=(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,oC=(e,t)=>{const i={};for(const n in e){const s=e[n].sidx;if(s){const e=vy(s);if(!t[e])break;const n=t[e].sidxInfo;aC(n,s)&&(i[e]=t[e])}}return i};class lC extends iC{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_=XS("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&&vy(e.sidx);if(!e.sidx||!n||this.mainPlaylistLoader_.sidxMapping_[n])return Xh.clearTimeout(this.mediaRequest_),void(this.mediaRequest_=Xh.setTimeout((()=>i(!1)),0));const s=GS(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=Zy(Wf(r.response).subarray(8))}catch(e){return e.metadata=LE({requestType:o,request:r,parseFailure:!0}),void this.requestErrored_(e,r,t)}return a[n]={sidxInfo:e.sidx,sidx:l},hy(e,l,e.sidx.resolvedUri),i(!0)};this.request=tC(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:VE({byterange:e.sidx.byterange})},r)}),"dash-sidx")}dispose(){this.isPaused_=!0,this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},Xh.clearTimeout(this.minimumUpdatePeriodTimeout_),Xh.clearTimeout(this.mediaRequest_),Xh.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,Xh.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(),Xh.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(Xh.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)}load(e){this.isPaused_=!1,Xh.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const e=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=Xh.setTimeout((()=>this.load()),e)}else 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 Xh.clearTimeout(this.mediaRequest_),void(this.mediaRequest_=Xh.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=LE({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=GS(this.mainPlaylistLoader_.srcUrl,n),s?(this.handleMain_(),void this.syncClientServerClock_((()=>e(n,s)))):e(n,s)}))}syncClientServerClock_(e){const t=Yy(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:WS(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=LE({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_(){Xh.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=Ky(e,{manifestUri:t,clientOffset:i,sidxMapping:n,previousManifest:s});return AE(r,t,sC),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:$S.Error.StreamingDashManifestParserError,error:e},this.trigger("error")}e&&(i=rC(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_&&(Xh.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_=Xh.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=oC(e.playlists,t);return xE(e,((e,n,s,r)=>{if(e.playlists&&e.playlists.length){const n=e.playlists;i=KS(i,oC(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=Xh.setTimeout((()=>{this.trigger("mediaupdatetimeout"),e()}),FE(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 uC={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 cC=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},dC=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=cC(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}},hC=function(e){return`var browserWorkerPolyFill = ${cC.toString()};\nbrowserWorkerPolyFill(self);\n`+e},pC=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)},fC=hC(pC((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,d,h,p,f,m,g,y,_,v,b,T,w,S,E,C,k,x,I,A,O,L,P,D,M,N,R,U,F,B,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},P=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),L=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,O=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,P))},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,O):i(S.smhd,L),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]=h(e[t]);return i.apply(null,[S.moov,d(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))},d=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?U(e):F(e))},U=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)},F=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))},h=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)},B=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?B(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),d=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],d.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,d=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),d=(c=Math.floor(u/r))*r),!(c<1||d>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(d,e.samplerate)),d}},trimAdtsFramesByEarliestDts:function(e,t,i){return t.minSegmentDts>=i?e:(t.minSegmentDts=1/0,e.filter((function(e){return e.dts>=i&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)})))},generateSampleTable:function(e){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}},de=oe.ONE_SECOND_IN_TS,he={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/de,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,d=u[e],h=u[e+1],p=t.currentWindow;if(l?(s=[d,h],e++):s=[d],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|d]||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,Oe="shared",Le=function(e,t){var i=1;for(e>t&&(i=-1);Math.abs(t-e)>4294967296;)e+=8589934592*i;return e},Pe=function(e){var t,i;Pe.prototype.init.call(this),this.type_=e||Oe,this.push=function(e){"metadata"!==e.type?this.type_!==Oe&&e.type!==this.type_||(void 0===i&&(i=e.dts),e.dts=Le(e.dts,i),e.pts=Le(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")}};Pe.prototype=new Ae;var De,Me={TimestampRolloverStream:Pe,handleRollover:Le},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,Ue=3,Fe=function(e,t,i){var n,s="";for(n=t;n<i;n++)s+="%"+("00"+e[n].toString(16)).slice(-2);return s},Be=function(e,t,i){return decodeURIComponent(Fe(e,t,i))},je=function(e,t,i){return unescape(Fe(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]===Ue&&((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=Be(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]===Ue&&(e.value=Be(e.data,1,e.data.length).replace(/\0*$/,""),e.values=e.value.split("\0"))},TXXX:function(e){var t;e.data[0]===Ue&&-1!==(t=Re(e.data,0,1))&&(e.description=Be(e.data,1,t),e.value=Be(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]===Ue&&-1!==(t=Re(e.data,0,1))&&(e.description=Be(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=q,ze=Ie,We=Ve;De=function(e){var t,i={descriptor:e&&e.descriptor},n=0,s=[],r=0;if(De.prototype.init.call(this),this.dispatchType=ze.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=We.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+=We.parseSyncSafeInteger(t.data.subarray(10,14)),n-=We.parseSyncSafeInteger(t.data.subarray(16,20)));do{if((a=We.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,We.frameParsers[o.id]?We.frameParsers[o.id](o):"T"===o.id[0]?We.frameParsers["T*"](o):"W"===o.id[0]&&We.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)}}},De.prototype=new He;var Ge,Xe,Ke,Ye=De,Qe=q,Je=xe,Ze=Ie,et=Me.TimestampRolloverStream,tt=188;(Ge=function(){var e=new Uint8Array(tt),t=0;Ge.prototype.init.call(this),this.push=function(i){var n,s=0,r=tt;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+=tt,r+=tt);s<n.byteLength&&(e.set(n.subarray(s),0),t=n.byteLength-s)},this.flush=function(){t===tt&&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 Qe,Xe=function(){var e,t,i,n;Xe.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===Ze.H264_STREAM_TYPE&&null===n.programMapTable.video?n.programMapTable.video=a:r===Ze.ADTS_STREAM_TYPE&&null===n.programMapTable.audio?n.programMapTable.audio=a:r===Ze.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=Ze.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=Ze.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}},Xe.prototype=new Qe,Xe.STREAM_TYPES={h264:27,adts:15},Ke=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)}};Ke.prototype.init.call(this),this.push=function(o){({pat:function(){},pes:function(){var e,t;switch(o.streamType){case Ze.H264_STREAM_TYPE:e=n,t="video";break;case Ze.ADTS_STREAM_TYPE:e=s,t="audio";break;case Ze.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")}},Ke.prototype=new Qe;var it={PAT_PID:0,MP2T_PACKET_LENGTH:tt,TransportPacketStream:Ge,TransportParseStream:Xe,ElementaryStream:Ke,TimestampRolloverStream:et,CaptionStream:Je.CaptionStream,Cea608Stream:Je.Cea608Stream,Cea708Stream:Je.Cea708Stream,MetadataStream:Ye};for(var nt in Ze)Ze.hasOwnProperty(nt)&&(it[nt]=Ze[nt]);var st,rt=it,at=q,ot=oe.ONE_SECOND_IN_TS,lt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];st=function(e){var t,i=0;st.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])))*ot/lt[(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:lt[(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")}},st.prototype=new at;var ut,ct=st;ut=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 dt,ht,pt,ft=q,mt=ut;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")}},ht.prototype=new ft,pt={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},dt=function(){var e,t,i,n,s,r,a,o=new ht;dt.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,d,h,p,f=0,m=0,g=0,y=0,_=[1,1];if(i=(t=new mt(e)).readUnsignedByte(),s=t.readUnsignedByte(),n=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),pt[i]&&(3===(r=t.readUnsignedExpGolomb())&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(h=3!==r?8:12,p=0;p<h;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===(d=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-d)*(c+1)*16-2*g-2*y,sarRatio:_}}},dt.prototype=new ft;var gt,yt={H264Stream:dt,NalByteStream:ht},_t=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],vt=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},bt=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+=vt(e,t),bt(e,t))},Tt=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},wt=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))},St={isLikelyAacData:function(e){var t=bt(e,0);return e.length>=t+2&&!(255&~e[t])&&!(240&~e[t+1])&&16==(22&e[t+1])},parseId3TagSize:vt,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 _t[(60&e[t+2])>>>2];t++}return null},parseAacTimestamp:function(e){var t,i,n;t=10,64&e[5]&&(t+=4,t+=Tt(e.subarray(10,14)));do{if((i=Tt(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"===wt(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}},Et=St;(gt=function(){var e=new Uint8Array,t=0;gt.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=Et.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=Et.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 Ct,kt,xt,It,At=q,Ot=ee,Lt=ie,Pt=ce,Dt=he,Mt=rt,Nt=oe,Rt=ct,Ut=yt.H264Stream,Ft=gt,Bt=St.isLikelyAacData,jt=oe.ONE_SECOND_IN_TS,$t=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],qt=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Vt=function(e,t){t.stream=e,this.trigger("log",t)},Ht=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",Vt.bind(e,s))}},zt=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},Wt=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}};kt=function(e,t){var i,n=[],s=0,r=0,a=1/0;i=(t=t||{}).firstSequenceNumber||0,kt.prototype.init.call(this),this.push=function(t){Dt.collectDtsInfo(e,t),e&&$t.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,d,h,p;0!==n.length?(o=Pt.trimAdtsFramesByEarliestDts(n,e,s),e.baseMediaDecodeTime=Dt.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),p=Pt.prefixWithSilence(e,o,r,a),e.samples=Pt.generateSampleTable(o),u=Ot.mdat(Pt.concatenateFrameData(o)),n=[],l=Ot.moof(i,[e]),c=new Uint8Array(l.byteLength+u.byteLength),i++,c.set(l),c.set(u,l.byteLength),Dt.clearDtsInfo(e),d=Math.ceil(1024*jt/e.samplerate),o.length&&(h=o.length*d,this.trigger("segmentTimingInfo",Wt(Nt.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),o[0].dts,o[0].pts,o[0].dts+h,o[0].pts+h,p||0)),this.trigger("timingInfo",{start:o[0].pts,end:o[0].pts+h})),this.trigger("data",{track:e,boxes:c}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")},this.reset=function(){Dt.clearDtsInfo(e),n=[],this.trigger("reset")}},kt.prototype=new At,Ct=function(e,t){var i,n,s,r=[],a=[];i=(t=t||{}).firstSequenceNumber||0,Ct.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){Dt.collectDtsInfo(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||n||(n=t.config,e.sps=[t.data],qt.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,d,h,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");Dt.clearDtsInfo(e),o=f}Dt.collectDtsInfo(e,o),e.samples=Lt.generateSampleTable(o),u=Ot.mdat(Lt.concatenateNalData(o)),e.baseMediaDecodeTime=Dt.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",o.map((function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}}))),d=o[0],h=o[o.length-1],this.trigger("segmentTimingInfo",Wt(e.baseMediaDecodeTime,d.dts,d.pts,h.dts+h.duration,h.pts+h.duration,p)),this.trigger("timingInfo",{start:o[0].pts,end:o[o.length-1].pts+o[o.length-1].duration}),this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),r=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),l=Ot.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(){Dt.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&&zt(e.pps[0],r.pps[0])&&e.sps&&zt(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}},Ct.prototype=new At,It=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,It.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))))}},It.prototype=new At,It.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,qt.forEach((function(e){a.info[e]=this.videoTrack[e]}),this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,$t.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=Ot.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=Nt.metadataTsToSeconds(t.startPts,o,this.keepOriginalTimestamps),t.endTime=Nt.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=Nt.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)},It.prototype.setRemux=function(e){this.remuxTracks=e},xt=function(e){var t,i,n=this,s=!0;xt.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 Mt.MetadataStream,s.aacStream=new Ft,s.audioTimestampRolloverStream=new Mt.TimestampRolloverStream("audio"),s.timedMetadataTimestampRolloverStream=new Mt.TimestampRolloverStream("timed-metadata"),s.adtsStream=new Rt,s.coalesceStream=new It(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 kt(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")),Ht(this,s)},this.setupTsPipeline=function(){var s={};this.transmuxPipeline_=s,s.type="ts",s.metadataStream=new Mt.MetadataStream,s.packetStream=new Mt.TransportPacketStream,s.parseStream=new Mt.TransportParseStream,s.elementaryStream=new Mt.ElementaryStream,s.timestampRolloverStream=new Mt.TimestampRolloverStream,s.adtsStream=new Rt,s.h264Stream=new Ut,s.captionStream=new Mt.CaptionStream(e),s.coalesceStream=new It(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 Ct(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 kt(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")),Ht(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,Dt.clearDtsInfo(i),s.audioTimestampRolloverStream&&s.audioTimestampRolloverStream.discontinuity()),t&&(s.videoSegmentStream&&(s.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,Dt.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()}},xt.prototype=new At;var Gt,Xt,Kt={Transmuxer:xt,VideoSegmentStream:Ct,AudioSegmentStream:kt,AUDIO_PROPERTIES:$t,VIDEO_PROPERTIES:qt,generateSegmentTimingInfo:Wt},Yt=function(e){return e>>>0},Qt=function(e){return("00"+e.toString(16)).slice(-2)},Jt=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])},Zt=Yt,ei=Jt,ti=function(e,t){var i,n,s,r,a,o=[];if(!t.length)return null;for(i=0;i<e.byteLength;)n=Zt(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3]),s=ei(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=ti(e.subarray(i+8,r),t.slice(1))).length&&(o=o.concat(a))),i=r;return o},ii=ti,ni=Yt,si=H.getUint64,ri=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4))};return 1===t.version?t.baseMediaDecodeTime=si(e.subarray(4)):t.baseMediaDecodeTime=ni(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),t},ai=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},oi=H.getUint64,li=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=oi(e.subarray(n)),i.firstOffset=oi(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},ui=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]}},ci=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),d=8;for(s&&(i.dataOffset=n.getInt32(d),d+=4),r&&c&&(t={flags:ui(e.subarray(d,d+4))},d+=4,a&&(t.duration=n.getUint32(d),d+=4),o&&(t.size=n.getUint32(d),d+=4),u&&(1===i.version?t.compositionTimeOffset=n.getInt32(d):t.compositionTimeOffset=n.getUint32(d),d+=4),i.samples.push(t),c--);c--;)t={},a&&(t.duration=n.getUint32(d),d+=4),o&&(t.size=n.getUint32(d),d+=4),l&&(t.flags=ui(e.subarray(d,d+4)),d+=4),u&&(1===i.version?t.compositionTimeOffset=n.getInt32(d):t.compositionTimeOffset=n.getUint32(d),d+=4),i.samples.push(t);return i},di=H.getUint64,hi=function(e){return new Date(1e3*e-20828448e5)},pi=Jt,fi=function(e){var t,i,n=new DataView(e.buffer,e.byteOffset,e.byteLength),s=[];for(t=0;t+4<e.length;t+=i)if(i=n.getUint32(t),t+=4,i<=0)s.push("<span style='color:red;'>MALFORMED DATA</span>");else switch(31&e[t]){case 1:s.push("slice_layer_without_partitioning_rbsp");break;case 5:s.push("slice_layer_without_partitioning_rbsp_idr");break;case 6:s.push("sei_rbsp");break;case 7:s.push("seq_parameter_set_rbsp");break;case 8:s.push("pic_parameter_set_rbsp");break;case 9:s.push("access_unit_delimiter_rbsp");break;default:s.push("UNKNOWN NAL - "+e[t]&31)}return s},mi={avc1:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{dataReferenceIndex:t.getUint16(6),width:t.getUint16(24),height:t.getUint16(26),horizresolution:t.getUint16(28)+t.getUint16(30)/16,vertresolution:t.getUint16(32)+t.getUint16(34)/16,frameCount:t.getUint16(40),depth:t.getUint16(74),config:Gt(e.subarray(78,e.byteLength))}},avcC:function(e){var t,i,n,s,r=new DataView(e.buffer,e.byteOffset,e.byteLength),a={configurationVersion:e[0],avcProfileIndication:e[1],profileCompatibility:e[2],avcLevelIndication:e[3],lengthSizeMinusOne:3&e[4],sps:[],pps:[]},o=31&e[5];for(n=6,s=0;s<o;s++)i=r.getUint16(n),n+=2,a.sps.push(new Uint8Array(e.subarray(n,n+i))),n+=i;for(t=e[n],n++,s=0;s<t;s++)i=r.getUint16(n),n+=2,a.pps.push(new Uint8Array(e.subarray(n,n+i))),n+=i;return a},btrt:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{bufferSizeDB:t.getUint32(0),maxBitrate:t.getUint32(4),avgBitrate:t.getUint32(8)}},edts:function(e){return{boxes:Gt(e)}},elst:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:i.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),edits:[]},s=i.getUint32(4);for(t=8;s;s--)0===n.version?(n.edits.push({segmentDuration:i.getUint32(t),mediaTime:i.getInt32(t+4),mediaRate:i.getUint16(t+8)+i.getUint16(t+10)/65536}),t+=12):(n.edits.push({segmentDuration:di(e.subarray(t)),mediaTime:di(e.subarray(t+8)),mediaRate:i.getUint16(t+16)+i.getUint16(t+18)/65536}),t+=20);return n},esds:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),esId:e[6]<<8|e[7],streamPriority:31&e[8],decoderConfig:{objectProfileIndication:e[11],streamType:e[12]>>>2&63,bufferSize:e[13]<<16|e[14]<<8|e[15],maxBitrate:e[16]<<24|e[17]<<16|e[18]<<8|e[19],avgBitrate:e[20]<<24|e[21]<<16|e[22]<<8|e[23],decoderConfigDescriptor:{tag:e[24],length:e[25],audioObjectType:e[26]>>>3&31,samplingFrequencyIndex:(7&e[26])<<1|e[27]>>>7&1,channelConfiguration:e[27]>>>3&15}}}},ftyp:function(e){for(var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={majorBrand:pi(e.subarray(0,4)),minorVersion:t.getUint32(4),compatibleBrands:[]},n=8;n<e.byteLength;)i.compatibleBrands.push(pi(e.subarray(n,n+4))),n+=4;return i},dinf:function(e){return{boxes:Gt(e)}},dref:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),dataReferences:Gt(e.subarray(8))}},hdlr:function(e){var t={version:new DataView(e.buffer,e.byteOffset,e.byteLength).getUint8(0),flags:new Uint8Array(e.subarray(1,4)),handlerType:pi(e.subarray(8,12)),name:""},i=8;for(i=24;i<e.byteLength;i++){if(0===e[i]){i++;break}t.name+=String.fromCharCode(e[i])}return t.name=decodeURIComponent(escape(t.name)),t},mdat:function(e){return{byteLength:e.byteLength,nals:fi(e)}},mdhd:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n=4,s={version:i.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),language:""};return 1===s.version?(n+=4,s.creationTime=hi(i.getUint32(n)),n+=8,s.modificationTime=hi(i.getUint32(n)),n+=4,s.timescale=i.getUint32(n),n+=8,s.duration=i.getUint32(n)):(s.creationTime=hi(i.getUint32(n)),n+=4,s.modificationTime=hi(i.getUint32(n)),n+=4,s.timescale=i.getUint32(n),n+=4,s.duration=i.getUint32(n)),n+=4,t=i.getUint16(n),s.language+=String.fromCharCode(96+(t>>10)),s.language+=String.fromCharCode(96+((992&t)>>5)),s.language+=String.fromCharCode(96+(31&t)),s},mdia:function(e){return{boxes:Gt(e)}},mfhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sequenceNumber:e[4]<<24|e[5]<<16|e[6]<<8|e[7]}},minf:function(e){return{boxes:Gt(e)}},mp4a:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={dataReferenceIndex:t.getUint16(6),channelcount:t.getUint16(16),samplesize:t.getUint16(18),samplerate:t.getUint16(24)+t.getUint16(26)/65536};return e.byteLength>28&&(i.streamDescriptor=Gt(e.subarray(28))[0]),i},moof:function(e){return{boxes:Gt(e)}},moov:function(e){return{boxes:Gt(e)}},mvex:function(e){return{boxes:Gt(e)}},mvhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=4,n={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};return 1===n.version?(i+=4,n.creationTime=hi(t.getUint32(i)),i+=8,n.modificationTime=hi(t.getUint32(i)),i+=4,n.timescale=t.getUint32(i),i+=8,n.duration=t.getUint32(i)):(n.creationTime=hi(t.getUint32(i)),i+=4,n.modificationTime=hi(t.getUint32(i)),i+=4,n.timescale=t.getUint32(i),i+=4,n.duration=t.getUint32(i)),i+=4,n.rate=t.getUint16(i)+t.getUint16(i+2)/16,i+=4,n.volume=t.getUint8(i)+t.getUint8(i+1)/8,i+=2,i+=2,i+=8,n.matrix=new Uint32Array(e.subarray(i,i+36)),i+=36,i+=24,n.nextTrackId=t.getUint32(i),n},pdin:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),rate:t.getUint32(4),initialDelay:t.getUint32(8)}},sdtp:function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]};for(t=4;t<e.byteLength;t++)i.samples.push({dependsOn:(48&e[t])>>4,isDependedOn:(12&e[t])>>2,hasRedundancy:3&e[t]});return i},sidx:li,smhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),balance:e[4]+e[5]/256}},stbl:function(e){return{boxes:Gt(e)}},ctts:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:i.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),compositionOffsets:[]},s=i.getUint32(4);for(t=8;s;t+=8,s--)n.compositionOffsets.push({sampleCount:i.getUint32(t),sampleOffset:i[0===n.version?"getUint32":"getInt32"](t+4)});return n},stss:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:i.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),syncSamples:[]},s=i.getUint32(4);for(t=8;s;t+=4,s--)n.syncSamples.push(i.getUint32(t));return n},stco:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),chunkOffsets:[]},s=i.getUint32(4);for(t=8;s;t+=4,s--)n.chunkOffsets.push(i.getUint32(t));return n},stsc:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n=i.getUint32(4),s={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleToChunks:[]};for(t=8;n;t+=12,n--)s.sampleToChunks.push({firstChunk:i.getUint32(t),samplesPerChunk:i.getUint32(t+4),sampleDescriptionIndex:i.getUint32(t+8)});return s},stsd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleDescriptions:Gt(e.subarray(8))}},stsz:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleSize:i.getUint32(4),entries:[]};for(t=12;t<e.byteLength;t+=4)n.entries.push(i.getUint32(t));return n},stts:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),timeToSamples:[]},s=i.getUint32(4);for(t=8;s;t+=8,s--)n.timeToSamples.push({sampleCount:i.getUint32(t),sampleDelta:i.getUint32(t+4)});return n},styp:function(e){return mi.ftyp(e)},tfdt:ri,tfhd:ai,tkhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=4,n={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};return 1===n.version?(i+=4,n.creationTime=hi(t.getUint32(i)),i+=8,n.modificationTime=hi(t.getUint32(i)),i+=4,n.trackId=t.getUint32(i),i+=4,i+=8,n.duration=t.getUint32(i)):(n.creationTime=hi(t.getUint32(i)),i+=4,n.modificationTime=hi(t.getUint32(i)),i+=4,n.trackId=t.getUint32(i),i+=4,i+=4,n.duration=t.getUint32(i)),i+=4,i+=8,n.layer=t.getUint16(i),i+=2,n.alternateGroup=t.getUint16(i),i+=2,n.volume=t.getUint8(i)+t.getUint8(i+1)/8,i+=2,i+=2,n.matrix=new Uint32Array(e.subarray(i,i+36)),i+=36,n.width=t.getUint16(i)+t.getUint16(i+2)/65536,i+=4,n.height=t.getUint16(i)+t.getUint16(i+2)/65536,n},traf:function(e){return{boxes:Gt(e)}},trak:function(e){return{boxes:Gt(e)}},trex:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:t.getUint32(4),defaultSampleDescriptionIndex:t.getUint32(8),defaultSampleDuration:t.getUint32(12),defaultSampleSize:t.getUint32(16),sampleDependsOn:3&e[20],sampleIsDependedOn:(192&e[21])>>6,sampleHasRedundancy:(48&e[21])>>4,samplePaddingValue:(14&e[21])>>1,sampleIsDifferenceSample:!!(1&e[21]),sampleDegradationPriority:t.getUint16(22)}},trun:ci,"url ":function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4))}},vmhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),graphicsmode:t.getUint16(4),opcolor:new Uint16Array([t.getUint16(6),t.getUint16(8),t.getUint16(10)])}}};Gt=function(e){for(var t,i,n,s,r,a=0,o=[],l=new ArrayBuffer(e.length),u=new Uint8Array(l),c=0;c<e.length;++c)u[c]=e[c];for(t=new DataView(l);a<e.byteLength;)i=t.getUint32(a),n=pi(e.subarray(a+4,a+8)),s=i>1?a+i:e.byteLength,(r=(mi[n]||function(e){return{data:e}})(e.subarray(a+8,s))).size=i,r.type=n,o.push(r),a=s;return o},Xt=function(e,t){var i;return t=t||0,i=new Array(2*t+1).join(" "),e.map((function(e,n){return i+e.type+"\n"+Object.keys(e).filter((function(e){return"type"!==e&&"boxes"!==e})).map((function(t){var n=i+" "+t+": ",s=e[t];if(s instanceof Uint8Array||s instanceof Uint32Array){var r=Array.prototype.slice.call(new Uint8Array(s.buffer,s.byteOffset,s.byteLength)).map((function(e){return" "+("00"+e.toString(16)).slice(-2)})).join("").match(/.{1,24}/g);return r?1===r.length?n+"<"+r.join("").slice(1)+">":n+"<\n"+r.map((function(e){return i+" "+e})).join("\n")+"\n"+i+" >":n+"<>"}return n+JSON.stringify(s,null,2).split("\n").map((function(e,t){return 0===t?e:i+" "+e})).join("\n")})).join("\n")+(e.boxes?"\n"+Xt(e.boxes,t+1):"")})).join("\n")};var gi,yi,_i,vi,bi,Ti,wi,Si={inspect:Gt,textify:Xt,parseType:pi,findBox:ii,parseTraf:mi.traf,parseTfdt:mi.tfdt,parseHdlr:mi.hdlr,parseTfhd:mi.tfhd,parseTrun:mi.trun,parseSidx:mi.sidx},Ei=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},Ci=H.getUint64,ki=function(e,t){var i="\0"!==t.scheme_id_uri,n=0===e&&xi(t.presentation_time_delta)&&i,s=1===e&&xi(t.presentation_time)&&i;return!(e>1)&&n||s},xi=function(e){return void 0!==e||null!==e},Ii={parseEmsgBox:function(e){var t,i,n,s,r,a,o,l=4,u=e[0];if(0===u)l+=(t=Ei(e.subarray(l))).length,l+=(i=Ei(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=Ci(e.subarray(l)),l+=8,a=c.getUint32(l),l+=4,o=c.getUint32(l),l+=4,l+=(t=Ei(e.subarray(l))).length,l+=(i=Ei(e.subarray(l))).length}var d={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 ki(u,d)?d:void 0},scaleTime:function(e,t,i,n){return e||0===e?e/t:n+i/t}},Ai="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},Oi=Yt,Li=Qt,Pi=ii,Di=Jt,Mi=Ii,Ni=ai,Ri=ci,Ui=ri,Fi=H.getUint64,Bi=Ai,ji=Ve.parseId3Frames;gi=function(e){return Pi(e,["moov","trak"]).reduce((function(e,t){var i,n,s,r,a;return(i=Pi(t,["tkhd"])[0])?(n=i[0],r=Oi(i[s=0===n?12:20]<<24|i[s+1]<<16|i[s+2]<<8|i[s+3]),(a=Pi(t,["mdia","mdhd"])[0])?(s=0===(n=a[0])?12:20,e[r]=Oi(a[s]<<24|a[s+1]<<16|a[s+2]<<8|a[s+3]),e):null):null}),{})},yi=function(e,t){var i=Pi(t,["moof","traf"]).reduce((function(t,i){var n,s=Pi(i,["tfhd"])[0],r=Oi(s[4]<<24|s[5]<<16|s[6]<<8|s[7]),a=e[r]||9e4,o=Pi(i,["tfdt"])[0],l=new DataView(o.buffer,o.byteOffset,o.byteLength);let u;return"bigint"==typeof(n=1===o[0]?Fi(o.subarray(4,12)):l.getUint32(4))?u=n/Bi.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},_i=function(e,t){var i,n=Pi(t,["moof","traf"]),s=0,r=0;if(n&&n.length){var a=Pi(n[0],["tfhd"])[0],o=Pi(n[0],["trun"])[0],l=Pi(n[0],["tfdt"])[0];if(a)i=Ni(a).trackId;if(l)s=Ui(l).baseMediaDecodeTime;if(o){var u=Ri(o);u.samples&&u.samples.length&&(r=u.samples[0].compositionTimeOffset||0)}}var c=e[i]||9e4;"bigint"==typeof s&&(r=Bi.BigInt(r),c=Bi.BigInt(c));var d=(s+r)/c;return"bigint"==typeof d&&d<Number.MAX_SAFE_INTEGER&&(d=Number(d)),d},vi=function(e){var t=Pi(e,["moov","trak"]),i=[];return t.forEach((function(e){var t=Pi(e,["mdia","hdlr"]),n=Pi(e,["tkhd"]);t.forEach((function(e,t){var s,r,a=Di(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},Ti=function(e){var t=0===e[0]?12:20;return Oi(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])},bi=function(e){var t=Pi(e,["moov","trak"]),i=[];return t.forEach((function(e){var t,n,s={},r=Pi(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=Pi(e,["mdia","hdlr"])[0];if(a){var o=Di(a.subarray(8,12));s.type="vide"===o?"video":"soun"===o?"audio":o}var l=Pi(e,["mdia","minf","stbl","stsd"])[0];if(l){var u=l.subarray(8);s.codec=Di(u.subarray(4,8));var c,d=Pi(u,[s.codec])[0];d&&(/^[asm]vc[1-9]$/i.test(s.codec)?(c=d.subarray(78),"avcC"===Di(c.subarray(4,8))&&c.length>11?(s.codec+=".",s.codec+=Li(c[9]),s.codec+=Li(c[10]),s.codec+=Li(c[11])):s.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(s.codec)?(c=d.subarray(28),"esds"===Di(c.subarray(4,8))&&c.length>20&&0!==c[19]?(s.codec+="."+Li(c[19]),s.codec+="."+Li(c[20]>>>2&63).replace(/^0/,"")):s.codec="mp4a.40.2"):s.codec=s.codec.toLowerCase())}var h=Pi(e,["mdia","mdhd"])[0];h&&(s.timescale=Ti(h)),i.push(s)})),i},wi=function(e,t=0){return Pi(e,["emsg"]).map((e=>{var i=Mi.parseEmsgBox(new Uint8Array(e)),n=ji(i.message_data);return{cueTime:Mi.scaleTime(i.presentation_time,i.timescale,i.presentation_time_delta,t),duration:Mi.scaleTime(i.event_duration,i.timescale),frames:n}}))};var $i={findBox:Pi,parseType:Di,timescale:gi,startTime:yi,compositionStartTime:_i,videoTrackIds:vi,tracks:bi,getTimescaleFromMediaHeader:Ti,getEmsgID3:wi};const{parseTrun:qi}=Si,{findBox:Vi}=$i;var Hi=Ai,zi={getMdatTrafPairs:function(e){var t=Vi(e,["moof","traf"]),i=Vi(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=qi(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+Hi.BigInt(e.compositionTimeOffset),n+=Hi.BigInt(e.duration)):(e.pts=n+e.compositionTimeOffset,n+=e.duration)})),o=o.concat(t)})),o}},Wi=pe.discardEmulationPreventionBytes,Gi=xe.CaptionStream,Xi=ii,Ki=ri,Yi=ai,{getMdatTrafPairs:Qi,parseSamples:Ji}=zi,Zi=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},en=function(e,t){var i={};return Qi(e).forEach((function(e){var n,s=e.mdat,r=e.traf,a=Xi(r,["tfhd"]),o=Yi(a[0]),l=o.trackId,u=Xi(r,["tfdt"]),c=u.length>0?Ki(u[0]).baseMediaDecodeTime:0,d=Xi(r,["trun"]);t===l&&d.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=Zi(s,t);if(n={nalUnitType:"sei_rbsp",size:r,data:u,escapedRBSP:Wi(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,Ji(d,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},tn=function(){var e,t,i,n,s,r,a=!1;this.isInitialized=function(){return a},this.init=function(t){e=new Gi,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=en(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:nn}=Si,sn=ii,{getTimescaleFromMediaHeader:rn}=$i,{parseSamples:an,getMdatTrafPairs:on}=zi;var ln=function(){let e=9e4;this.init=function(t){const i=sn(t,["moov","trak","mdia","mdhd"])[0];i&&(e=rn(i))},this.parseSegment=function(t){const i=[],n=on(t);let s=0;return n.forEach((function(t){const n=t.mdat,r=t.traf,a=sn(r,["tfdt"])[0],o=sn(r,["tfhd"])[0],l=sn(r,["trun"]);if(a){const e=nn(a);s=e.baseMediaDecodeTime}if(l.length&&o){const t=an(l,s,o);let r=0;t.forEach((function(t){const s=new TextDecoder("utf-8"),a=n.slice(r,r+t.size);if(sn(a,["vtte"])[0])return void(r+=t.size);sn(a,["vttc"]).forEach((function(n){const r=sn(n,["payl"])[0],a=sn(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}},un=Ie,cn=function(e){var t=31&e[1];return t<<=8,t|=e[2]},dn=function(e){return!!(64&e[1])},hn=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},pn=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}},fn={parseType:function(e,t){var i=cn(e);return 0===i?"pat":i===t?"pmt":t?"pes":null},parsePat:function(e){var t=dn(e),i=4+hn(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},parsePmt:function(e){var t={},i=dn(e),n=4+hn(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:dn,parsePesType:function(e,t){switch(t[cn(e)]){case un.H264_STREAM_TYPE:return"video";case un.ADTS_STREAM_TYPE:return"audio";case un.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(e){if(!dn(e))return null;var t=4+hn(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+hn(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"===pn(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"===pn(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"===pn(31&i[s+3])&&(r=!0),r}},mn=Ie,gn=Me.handleRollover,yn={};yn.ts=fn,yn.aac=St;var _n=oe.ONE_SECOND_IN_TS,vn=188,bn=71,Tn=function(e,t,i){for(var n,s,r,a,o=0,l=vn,u=!1;l<=e.byteLength;)if(e[o]!==bn||e[l]!==bn&&l!==e.byteLength)o++,l++;else{if(n=e.subarray(o,l),"pes"===yn.ts.parseType(n,t.pid))s=yn.ts.parsePesType(n,t.table),r=yn.ts.parsePayloadUnitStartIndicator(n),"audio"===s&&r&&(a=yn.ts.parsePesTime(n))&&(a.type="audio",i.audio.push(a),u=!0);if(u)break;o+=vn,l+=vn}for(o=(l=e.byteLength)-vn,u=!1;o>=0;)if(e[o]!==bn||e[l]!==bn&&l!==e.byteLength)o--,l--;else{if(n=e.subarray(o,l),"pes"===yn.ts.parseType(n,t.pid))s=yn.ts.parsePesType(n,t.table),r=yn.ts.parsePayloadUnitStartIndicator(n),"audio"===s&&r&&(a=yn.ts.parsePesTime(n))&&(a.type="audio",i.audio.push(a),u=!0);if(u)break;o-=vn,l-=vn}},wn=function(e,t,i){for(var n,s,r,a,o,l,u,c=0,d=vn,h=!1,p={data:[],size:0};d<e.byteLength;)if(e[c]!==bn||e[d]!==bn)c++,d++;else{if(n=e.subarray(c,d),"pes"===yn.ts.parseType(n,t.pid))if(s=yn.ts.parsePesType(n,t.table),r=yn.ts.parsePayloadUnitStartIndicator(n),"video"===s&&(r&&!h&&(a=yn.ts.parsePesTime(n))&&(a.type="video",i.video.push(a),h=!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(yn.ts.videoPacketContainsKeyFrame(o)){var f=yn.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(h&&i.firstKeyFrame)break;c+=vn,d+=vn}for(c=(d=e.byteLength)-vn,h=!1;c>=0;)if(e[c]!==bn||e[d]!==bn)c--,d--;else{if(n=e.subarray(c,d),"pes"===yn.ts.parseType(n,t.pid))s=yn.ts.parsePesType(n,t.table),r=yn.ts.parsePayloadUnitStartIndicator(n),"video"===s&&r&&(a=yn.ts.parsePesTime(n))&&(a.type="video",i.video.push(a),h=!0);if(h)break;c-=vn,d-=vn}},Sn=function(e){var t={pid:null,table:null},i={};for(var n in function(e,t){for(var i,n=0,s=vn;s<e.byteLength;)if(e[n]!==bn||e[s]!==bn)n++,s++;else{switch(i=e.subarray(n,s),yn.ts.parseType(i,t.pid)){case"pat":t.pid=yn.ts.parsePat(i);break;case"pmt":var r=yn.ts.parsePmt(i);t.table=t.table||{},Object.keys(r).forEach((function(e){t.table[e]=r[e]}))}n+=vn,s+=vn}}(e,t),t.table){if(t.table.hasOwnProperty(n))switch(t.table[n]){case mn.H264_STREAM_TYPE:i.video=[],wn(e,t,i),0===i.video.length&&delete i.video;break;case mn.ADTS_STREAM_TYPE:i.audio=[],Tn(e,t,i),0===i.audio.length&&delete i.audio}}return i},En=function(e,t){var i;return i=yn.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(yn.aac.parseType(e,o)){case"timed-metadata":if(e.length-o<10){i=!0;break}if((a=yn.aac.parseId3TagSize(e,o))>e.length){i=!0;break}null===r&&(t=e.subarray(o,o+a),r=yn.aac.parseAacTimestamp(t)),o+=a;break;case"audio":if(e.length-o<7){i=!0;break}if((a=yn.aac.parseAdtsSize(e,o))>e.length){i=!0;break}null===s&&(t=e.subarray(o,o+a),s=yn.aac.parseSampleRate(t)),n++,o+=a;break;default:o++}if(i)return null}if(null===s||null===r)return null;var l=_n/s;return{audio:[{type:"audio",dts:r,pts:r},{type:"audio",dts:r+1024*n*l,pts:r+1024*n*l}]}}(e):Sn(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=gn(e.dts,i),e.pts=gn(e.pts,i),e.dtsTime=e.dts/_n,e.ptsTime=e.pts/_n}))}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=gn(e.dts,n),e.pts=gn(e.pts,n),e.dtsTime=e.dts/_n,e.ptsTime=e.pts/_n})),e.firstKeyFrame){var s=e.firstKeyFrame;s.dts=gn(s.dts,n),s.pts=gn(s.pts,n),s.dtsTime=s.dts/_n,s.ptsTime=s.pts/_n}}}(i,t),i):null};class Cn{constructor(e,t){this.options=t||{},this.self=e,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Kt.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 tn,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 ln);const t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.webVttParser.init(t)}getMp4WebVttText(e){this.webVttParser||(this.webVttParser=new ln);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=$i.startTime(e,t);this.self.postMessage({action:"probeMp4StartTime",startTime:i,data:t},[t.buffer])}probeMp4Tracks({data:e}){const t=$i.tracks(e);this.self.postMessage({action:"probeMp4Tracks",tracks:t,data:e},[e.buffer])}probeEmsgID3({data:e,offset:t}){const i=$i.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=En(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 Cn(self,e.data.options):(this.messageHandlers||(this.messageHandlers=new Cn(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}})));var mC=dC(fC);const gC=e=>{const{transmuxer:t,bytes:i,audioAppendStart:n,gopsToAlignWith:s,remux:r,onData:a,onTrackInfo:o,onAudioTimingInfo:l,onVideoTimingInfo:u,onVideoSegmentTimingInfo:c,onAudioSegmentTimingInfo:d,onId3:h,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},d={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&&(d.videoFrameDtsTime=l),void 0!==u&&(d.videoFramePtsTime=u),i(d)})(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&&d(i.data.audioSegmentTimingInfo),"id3Frame"===i.data.action&&h([i.data.id3Frame],i.data.id3Frame.dispatchType),"caption"===i.data.action&&p(i.data.caption),"endedtimeline"===i.data.action&&(T=!1,m()),"log"===i.data.action&&g(i.data.log),"transmuxed"===i.data.type&&(T||(t.onmessage=null,(({transmuxedData:e,callback:t})=>{e.buffer=[],t(e)})({transmuxedData:b,callback:f}),yC(t))))},t.onerror=()=>{const e={message:"Received an error message from the transmuxer worker",metadata:{errorType:$S.Error.StreamingFailedToTransmuxSegment,segmentInfo:dk({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"})},yC=e=>{e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():gC(e.currentTransmux))},_C=(e,t)=>{e.postMessage({action:t}),yC(e)},vC=(e,t)=>{if(!t.currentTransmux)return t.currentTransmux=e,void _C(t,e);t.transmuxQueue.push(_C.bind(null,t,e))},bC=e=>{if(!e.transmuxer.currentTransmux)return e.transmuxer.currentTransmux=e,void gC(e);e.transmuxer.transmuxQueue.push(e)};var TC=e=>{vC("reset",e)},wC=e=>{const t=new mC;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 SC=function(e){const t=e.transmuxer,i=e.endAction||e.action,n=e.callback,s=Ep({},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)},EC=2,CC=-101,kC=-102,xC="wvtt",IC=e=>{e.forEach((e=>{e.abort()}))},AC=(e,t)=>{const{requestType:i}=t,n=LE({requestType:i,request:t,error:e});return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:CC,xhr:t,metadata:n}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:kC,xhr:t,metadata:n}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:EC,xhr:t,metadata:n}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:EC,xhr:t,metadata:n}:null},OC=(e,t,i,n)=>(s,r)=>{const a=r.response,o=AC(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:EC,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)},LC=(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:EC,metadata:{mediaType:s}})}SC({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===xC&&e.transmuxer.postMessage({action:"initMp4WebVttParser",data:e.map.bytes})})(e,t.codec))})),t(null))})},PC=({segment:e,finishProcessingFn:t,responseType:i,triggerSegmentEventFn:n})=>(s,r)=>{const a=AC(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)},DC=({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:d,onTransmuxerLog:h,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");SC({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),bC({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:h,onDone:(t,i)=>{d&&(t.type="combined"===t.type?"video":t.type,p({type:"segmenttransmuxingcomplete",segment:e}),d(i,e,t))},segment:e,triggerSegmentEventFn:p})}})},MC=({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:d,onTransmuxerLog:h,triggerSegmentEventFn:p})=>{let f=new Uint8Array(t);if(function(e){return n_(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===xC&&SC({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,d);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),d(null,e,{})};SC({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),SC({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?SC({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){h(KS(e,{stream:"mp4CaptionParser"}))})),l(i.captions,n)}}):l(void 0,n)}})}})}else 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 d(null,e,{});DC({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:d,onTransmuxerLog:h,triggerSegmentEventFn:p})}else d(null,e,{})},NC=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=dk({segment:s}),i={message:e,metadata:{error:new Error(e),errorType:$S.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(GE({source:e,encrypted:i,key:l,iv:t.iv}),[i.buffer,l.buffer])},RC=({activeXhrs:e,decryptionWorker:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:d,onTransmuxerLog:h,triggerSegmentEventFn:p})=>{let f=0,m=!1;return(g,y)=>{if(!m){if(g)return m=!0,IC(e),d(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:d,onTransmuxerLog:h,triggerSegmentEventFn:p})=>{p({type:"segmentdecryptionstart"}),NC({id:t.requestId,key:t.key,encryptedBytes:t.encryptedBytes,decryptionWorker:e,segment:t,doneFn:d},(e=>{t.bytes=e,p({type:"segmentdecryptioncomplete",segment:t}),MC({segment:t,bytes:t.bytes,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:d,onTransmuxerLog:h,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:d,onTransmuxerLog:h,triggerSegmentEventFn:p});MC({segment:y,bytes:y.bytes,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:d,onTransmuxerLog:h,triggerSegmentEventFn:p})};if(y.endOfAllRequests=Date.now(),y.map&&y.map.encryptedBytes&&!y.map.bytes)return p({type:"segmentdecryptionstart",segment:y}),NC({decryptionWorker:t,id:y.requestId+"-init",encryptedBytes:y.map.encryptedBytes,key:y.map.key,segment:y,doneFn:d},(t=>{y.map.bytes=t,p({type:"segmentdecryptioncomplete",segment:y}),LC(y,(t=>{if(t)return IC(e),d(t,y);f()}))}));f()}}}},UC=({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=KS(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)},FC=({xhr:e,xhrOptions:t,decryptionWorker:i,segment:n,abortFn:s,progressFn:r,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:c,captionsFn:d,isEndOfTimeline:h,endedTimelineFn:p,dataFn:f,doneFn:m,onTransmuxerLog:g,triggerSegmentEventFn:y})=>{const _=[],v=RC({activeXhrs:_,decryptionWorker:i,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:c,captionsFn:d,isEndOfTimeline:h,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=KS(t,{uri:n.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),r=OC(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=KS(t,{uri:n.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),s=OC(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=KS(t,{uri:n.map.resolvedUri,responseType:"arraybuffer",headers:VE(n.map),requestType:"segment-media-initialization"}),s=(({segment:e,finishProcessingFn:t,triggerSegmentEventFn:i})=>(n,s)=>{const r=AC(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,LC(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=KS(t,{uri:n.part&&n.part.resolvedUri||n.resolvedUri,responseType:"arraybuffer",headers:VE(n),requestType:"segment"}),T=PC({segment:n,finishProcessingFn:v,responseType:b.responseType,triggerSegmentEventFn:y});y({type:"segmentloadstart",segment:n});const w=e(b,T);w.addEventListener("progress",UC({segment:n,progressFn:r,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:c,captionsFn:d,isEndOfTimeline:h,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}))})),()=>IC(_)},BC=XS("CodecUtils"),jC=(e,t)=>{const i=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&i.AUDIO&&e.mediaGroups.AUDIO[i.AUDIO]},$C=function(e){const t={};return e.forEach((({mediaType:e,type:i,details:n})=>{t[e]=t[e]||[],t[e].push(Nf(`${i}${n}`))})),Object.keys(t).forEach((function(e){if(t[e].length>1)return BC(`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},qC=function(e){let t=0;return e.audio&&t++,e.video&&t++,t},VC=function(e,t){const i=t.attributes||{},n=$C(function(e){const t=e.attributes||{};if(t.CODECS)return Rf(t.CODECS)}(t)||[]);if(jC(e,t)&&!n.audio&&!((e,t)=>{if(!jC(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=$C(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 Rf(s.playlists[0].attributes.CODECS)}return null}(e,i.AUDIO)||[]);t.audio&&(n.audio=t.audio)}return n},HC=XS("PlaylistSelector"),zC=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||""})},WC=function(e,t){if(!e)return"";const i=Xh.getComputedStyle(e);return i?i[t]:""},GC=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}))},XC=function(e,t){let i,n;return e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||Xh.Number.MAX_VALUE,t.attributes.BANDWIDTH&&(n=t.attributes.BANDWIDTH),n=n||Xh.Number.MAX_VALUE,i-n};let KC=function(e,t,i,n,s,r){if(!e)return;const a={bandwidth:t,width:i,height:n,limitRenditionByPlayerDimensions:s};let o=e.playlists;SE.isAudioOnly(e)&&(o=r.getAudioTrackPlaylists_(),a.audioOnly=!0);let l=o.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||Xh.Number.MAX_VALUE,{bandwidth:t,width:i,height:n,playlist:e}}));GC(l,((e,t)=>e.bandwidth-t.bandwidth)),l=l.filter((e=>!SE.isIncompatible(e.playlist)));let u=l.filter((e=>SE.isEnabled(e.playlist)));u.length||(u=l.filter((e=>!SE.isDisabled(e.playlist))));const c=u.filter((e=>e.bandwidth*uC.BANDWIDTH_VARIANCE<t));let d=c[c.length-1];const h=c.filter((e=>e.bandwidth===d.bandwidth))[0];if(!1===s){const e=h||u[0]||l[0];if(e&&e.playlist){let t="sortedPlaylistReps";return h&&(t="bandwidthBestRep"),u[0]&&(t="enabledPlaylistReps"),HC(`choosing ${zC(e)} using ${t} with options`,a),e.playlist}return HC("could not choose a playlist with options",a),null}const p=c.filter((e=>e.width&&e.height));GC(p,((e,t)=>e.width-t.width));const f=p.filter((e=>e.width===i&&e.height===n));d=f[f.length-1];const m=f.filter((e=>e.bandwidth===d.bandwidth))[0];let g,y,_,v;if(m||(g=p.filter((e=>e.width>i||e.height>n)),y=g.filter((e=>e.width===g[0].width&&e.height===g[0].height)),d=y[y.length-1],_=y.filter((e=>e.bandwidth===d.bandwidth))[0]),r.leastPixelDiffSelector){const e=p.map((e=>(e.pixelDiff=Math.abs(e.width-i)+Math.abs(e.height-n),e)));GC(e,((e,t)=>e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff)),v=e[0]}const b=v||_||m||h||u[0]||l[0];if(b&&b.playlist){let e="sortedPlaylistReps";return v?e="leastPixelDiffRep":_?e="resolutionPlusOneRep":m?e="resolutionBestRep":h?e="bandwidthBestRep":u[0]&&(e="enabledPlaylistReps"),HC(`choosing ${zC(b)} using ${e} with options`,a),b.playlist}return HC("could not choose a playlist with options",a),null};const YC=function(){let e=this.useDevicePixelRatio&&Xh.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(e=this.customPixelRatio),KC(this.playlists.main,this.systemBandwidth,parseInt(WC(this.tech_.el(),"width"),10)*e,parseInt(WC(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.playlistController_)};function QC(e){try{return new URL(e).pathname.split("/").slice(-2).join("/")}catch(e){return""}}const JC=({inbandTextTracks:e,metadataArray:t,timestampOffset:i,videoDuration:n})=>{if(!t)return;const s=Xh.WebKitDataCue||Xh.VTTCue,r=e.metadataTrack_;if(!r)return;if(t.forEach((e=>{const t=e.cueTime+i;!("number"!=typeof t||Xh.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:()=>($S.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key)},value:{get:()=>($S.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data)},privateData:{get:()=>($S.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}))}))},ZC={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"},ek=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),tk=(e,t,i)=>{e.metadataTrack_||(e.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,$S.browser.IS_ANY_SAFARI||(e.metadataTrack_.inBandMetadataTrackDispatchType=t))},ik=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)},nk=e=>"number"==typeof e&&isFinite(e),sk=1/60,rk=e=>{const{startOfSegment:t,duration:i,segment:n,part:s,playlist:{mediaSequence:r,id:a,segments:o=[]},mediaIndex:l,partIndex:u,timeline:c}=e,d=o.length-1;let h="mediaIndex/partIndex increment";e.getMediaInfoForTime?h=`getMediaInfoForTime (${e.getMediaInfoForTime})`:e.isSyncRequest&&(h="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(h+=` with independent ${e.independent}`);const p="number"==typeof u,f=e.segment.uri?"segment":"pre-segment",m=p?uE({preloadSegment:n})-1:0;return`${f} [${r+l}/${r+d}]`+(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 [${h}]`+` playlist [${a}]`},ak=e=>`${e}TimingInfo`,ok=({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},lk=e=>{const t=e.pendingSegment_;if(!t)return;if(ok({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")}},uk=({segmentDuration:e,maxDuration:t})=>!!e&&Math.round(e)>t+QS,ck=(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=Xh.BigInt(r)-Xh.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=uk({segmentDuration:i,maxDuration:2*n}),r=uk({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},dk=({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 hk extends $S.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_=XS(`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_():lk(this)})),this.sourceUpdater_.on("codecschange",(e=>{this.trigger(Ep({type:"codecschange"},e))})),"main"===this.loaderType_&&this.timelineChangeController_.on("pendingtimelinechange",(()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():lk(this)})),"audio"===this.loaderType_&&this.timelineChangeController_.on("timelinechange",(e=>{this.trigger(Ep({type:"timelinechange"},e)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():lk(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():lk(this)}))}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return wC({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_&&Xh.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,Xh.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_&&TC(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return YS();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=XE(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=KE(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: ${sE(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_&&(Xh.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_&&TC(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)*C_),r=Math.ceil((i-n)*C_),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_)ik(e,t,this.inbandTextTracks_[i]);ik(e,t,this.segmentMetadataTrack_),r()}monitorBuffer_(){this.checkBufferTimeout_&&Xh.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=Xh.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&Xh.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=Xh.setTimeout(this.monitorBufferTick_.bind(this),500)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const t={segmentInfo:dk({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=sE(e)||0,i=rE(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:$S.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=SE.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],d={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},h=void 0!==o?o:this.isPendingTimestampOffset_;d.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:u.timeline,currentTimeline:this.currentTimeline_,startOfSegment:s,buffered:this.buffered_(),overrideCheck:h});const p=sE(this.sourceUpdater_.audioBuffered());return"number"==typeof p&&(d.audioAppendStart=p-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(d.gopsToAlignWith=((e,t,i)=>{if(null==t||!e.length)return[];const n=Math.ceil((t-i+3)*C_);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_)),d}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=SE.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=>!SE.isIncompatible(e)));let c=u.filter(SE.isEnabled);c.length||(c=u.filter((e=>!SE.isDisabled(e))));const d=c.filter(SE.hasAttribute.bind(null,"BANDWIDTH")).map((e=>{const t=l.getSyncPoint(e,s,o,i)?1:2;return{playlist:e,rebufferingImpact:SE.estimateSegmentRequestTime(r,n,e)*t-a}})),h=d.filter((e=>e.rebufferingImpact<=0));return GC(h,((e,t)=>XC(t.playlist,e.playlist))),h.length?h[0]:(GC(d,((e,t)=>e.rebufferingImpact-t.rebufferingImpact)),d[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<=QS&&(l=1),!a.playlist||a.playlist.uri===this.playlist_.uri||o<l||(this.bandwidth=a.playlist.attributes.BANDWIDTH*uC.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${rk(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:dk({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_():lk(this)))}handleTimingInfo_(e,t,i,n){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const s=this.pendingSegment_,r=ak(t);s[r]=s[r]||{},s[r][i]=n,this.logger_(`timinginfo: ${t} - ${i} - ${n}`),this.hasEnoughInfoToAppend_()?this.processCallQueue_():lk(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),ik(t,s,a[e]),function({inbandTextTracks:e,captionArray:t,timestampOffset:i}){if(!t)return;const n=Xh.WebKitDataCue||Xh.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_()||!ok({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)&&!ok({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 lk(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[ak(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=XE(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: "+nE(s).join(", ")),r.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+nE(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: ${nE(s).join(", ")}, video buffer: ${nE(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_=Xh.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:$S.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:dk({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 lk(this),void this.loadQueue_.push((()=>{const t=Ep({},e,{forceTimestampOffset:!0});Ep(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${QC(e.uri)}\n${rk(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=FC({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_(`${rk(e)} logged from transmuxer stream ${n} as a ${i}: ${t}`)},triggerSegmentEventFn:({type:e,segment:t,keyInfo:i,trackInfo:n,timingInfo:s})=>{const r={segmentInfo:dk({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-uC.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<sk)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===kC)return;return this.pause(),e.code===CC?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:dk({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=ck(e,this.sourceType_);if(t&&("warn"===t.severity?$S.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 ${rk(e)}`);this.logger_(`Appended ${rk(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"} ${rk(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<sk)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(!nk(i)||!nk(n))return;ik(i,n,this.segmentMetadataTrack_);const s=Xh.WebKitDataCue||Xh.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 pk(){}const fk=function(e){return"string"!=typeof e?e:e.replace(/./,(e=>e.toUpperCase()))},mk=["video","audio"],gk=(e,t)=>{const i=t[`${e}Buffer`];return i&&i.updating||t.queuePending[e]},yk=(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&&!gk(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 yk(e,t))}}else t.updating()||"closed"===t.mediaSource.readyState||(t.queue.shift(),n.action(t),n.doneFn&&n.doneFn(),yk("audio",t),yk("video",t))},_k=(e,t)=>{const i=t[`${e}Buffer`],n=fk(e);i&&(i.removeEventListener("updateend",t[`on${n}UpdateEnd_`]),i.removeEventListener("error",t[`on${n}Error_`]),t.codecs[e]=null,t[`${e}Buffer`]=null)},vk=(e,t)=>e&&t&&-1!==Array.prototype.indexOf.call(e.sourceBuffers,t),bk=(e,t,i)=>(n,s)=>{const r=s[`${n}Buffer`];if(vk(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)}}},Tk=(e,t)=>(i,n)=>{const s=n[`${i}Buffer`];if(vk(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`)}}},wk=e=>(t,i)=>{const n=i[`${t}Buffer`];vk(i.mediaSource,n)&&(i.logger_(`Setting ${t}timestampOffset to ${e}`),n.timestampOffset=e)},Sk=e=>(t,i)=>{e()},Ek=e=>t=>{if("open"===t.mediaSource.readyState){t.logger_(`Calling mediaSource endOfStream(${e||""})`);try{t.mediaSource.endOfStream(e)}catch(e){$S.log.warn("Failed to call media source endOfStream",e)}}},Ck=e=>t=>{t.logger_(`Setting mediaSource duration to ${e}`);try{t.mediaSource.duration=e}catch(e){$S.log.warn("Failed to set media source duration",e)}},kk=()=>(e,t)=>{if("open"!==t.mediaSource.readyState)return;const i=t[`${e}Buffer`];if(vk(t.mediaSource,i)){t.logger_(`calling abort on ${e}Buffer`);try{i.abort()}catch(t){$S.log.warn(`Failed to abort on ${e}Buffer`,t)}}},xk=(e,t)=>i=>{const n=fk(e),s=Ff(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},Ik=e=>t=>{const i=t[`${e}Buffer`];if(_k(e,t),vk(t.mediaSource,i)){t.logger_(`Removing ${e}Buffer with codec ${t.codecs[e]} from mediaSource`);try{t.mediaSource.removeSourceBuffer(i)}catch(t){$S.log.warn(`Failed to removeSourceBuffer ${e}Buffer`,t)}}},Ak=e=>(t,i)=>{const n=i[`${t}Buffer`],s=Ff(e);if(!vk(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=$S.Error.StreamingCodecsChangeError,o.error=e,e.metadata=o,i.error_=e,i.trigger("error"),$S.log.warn(`Failed to changeType on ${t}Buffer`,e)}},Ok=({type:e,sourceUpdater:t,action:i,doneFn:n,name:s})=>{t.queue.push({type:e,action:i,doneFn:n,name:s}),yk(e,t)},Lk=(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_`])}yk(e,t)};class Pk extends $S.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>yk("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=XS("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=Lk("video",this),this.onAudioUpdateEnd_=Lk("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){Ok({type:"mediaSource",sourceUpdater:this,action:xk(e,t),name:"addSourceBuffer"})}abort(e){Ok({type:e,sourceUpdater:this,action:kk(e),name:"abort"})}removeSourceBuffer(e){this.canRemoveSourceBuffer()?Ok({type:"mediaSource",sourceUpdater:this,action:Ik(e),name:"removeSourceBuffer"}):$S.log.error("removeSourceBuffer is not supported!")}canRemoveSourceBuffer(){return!$S.browser.IS_FIREFOX&&Xh.MediaSource&&Xh.MediaSource.prototype&&"function"==typeof Xh.MediaSource.prototype.removeSourceBuffer}static canChangeType(){return Xh.SourceBuffer&&Xh.SourceBuffer.prototype&&"function"==typeof Xh.SourceBuffer.prototype.changeType}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){this.canChangeType()?Ok({type:e,sourceUpdater:this,action:Ak(t),name:"changeType"}):$S.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(Ok({type:n,sourceUpdater:this,action:bk(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 vk(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:YS()}videoBuffered(){return vk(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:YS()}buffered(){const e=vk(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=vk(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 YS();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 YS(a)}(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=pk){Ok({type:"mediaSource",sourceUpdater:this,action:Ck(e),name:"duration",doneFn:t})}endOfStream(e=null,t=pk){"string"!=typeof e&&(e=void 0),Ok({type:"mediaSource",sourceUpdater:this,action:Ek(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,i=pk){this.audioBuffered().length&&0!==this.audioBuffered().end(0)?Ok({type:"audio",sourceUpdater:this,action:Tk(e,t),doneFn:i,name:"remove"}):i()}removeVideo(e,t,i=pk){this.videoBuffered().length&&0!==this.videoBuffered().end(0)?Ok({type:"video",sourceUpdater:this,action:Tk(e,t),doneFn:i,name:"remove"}):i()}updating(){return!(!gk("audio",this)&&!gk("video",this))}audioTimestampOffset(e){return void 0!==e&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(Ok({type:"audio",sourceUpdater:this,action:wk(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return void 0!==e&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(Ok({type:"video",sourceUpdater:this,action:wk(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&Ok({type:"audio",sourceUpdater:this,action:Sk(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&Ok({type:"video",sourceUpdater:this,action:Sk(e),name:"callback"})}dispose(){this.trigger("dispose"),mk.forEach((e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`]((()=>_k(e,this)))})),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const Dk=e=>decodeURIComponent(escape(String.fromCharCode.apply(null,e))),Mk=new Uint8Array("\n\n".split("").map((e=>e.charCodeAt(0))));class Nk extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class Rk extends hk{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 YS();const e=this.subtitlesTrack_.cues;return YS([[e[0].startTime,e[e.length-1].startTime]])}initSegmentForMap(e,t=!1){if(!e)return null;const i=XE(e);let n=this.initSegments_[i];if(t&&!n&&e.bytes){const t=Mk.byteLength+e.bytes.byteLength,s=new Uint8Array(t);s.set(e.bytes),s.set(Mk,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){ik(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===CC&&this.handleTimeout_(),e.code===kC?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 Xh.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:$S.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 Xh.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 Xh.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 Xh.WebVTT)throw new Nk;if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},e.mp4VttCues)return void this.parseMp4VttCues_(e);"function"==typeof Xh.TextDecoder?t=new Xh.TextDecoder("utf8"):(t=Xh.WebVTT.StringDecoder(),i=!0);const n=new Xh.WebVTT.Parser(Xh,Xh.vttjs,t);if(n.oncue=e.cues.push.bind(e.cues),n.ontimestampmap=t=>{e.timestampmap=t},n.onparsingerror=e=>{$S.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){let t=e.segment.map.bytes;i&&(t=Dk(t)),n.parse(t)}let s=e.bytes;i&&(s=Dk(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/C_-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*C_;const n=t*C_;let s;for(s=n<i?-8589934592:8589934592;Math.abs(i-n)>4294967296;)i+=s;return i/C_}}const Uk=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 Fk{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 Bk{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 jk{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 Fk({start:o,end:l,appended:u,segmentIndex:t});e.syncInfo=c;let d=r;const h=(e.parts||[]).map(((e,n)=>{const r=d,o=d+e.duration,l=Boolean(i&&i.partsSyncInfo&&i.partsSyncInfo[n]&&i.partsSyncInfo[n].isAppended),u=new Fk({start:r,end:o,appended:l,segmentIndex:t,partIndex:n});return d=o,s+=`Media Sequence: ${a}.${n} | Range: ${r} --\x3e ${o} | Appended: ${l}\n`,e.syncInfo=u,u}));n.set(a,new Bk(c,h)),s+=`${QC(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 $k extends jk{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 qk=[{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=oE(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 d=Math.abs(s-c);if(null!==a&&(0===d||a<d))break;a=d,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=oE(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 Vk extends $S.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const t=new jk,i=new $k(t),n=new $k(t);this.mediaSequenceStorage_={main:t,audio:i,vtt:n},this.logger_=XS("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,i,n,s){if(t!==1/0){return qk.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+pE({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:n.segmentIndex,endIndex:0}))}runStrategies_(e,t,i,n,s){const r=[];for(let a=0;a<qk.length;a++){const o=qk[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)$S.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-pE({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:s}):i.end+pE({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 Hk extends $S.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 zk=hC(pC((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}();
32
32
  /*! @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,d,h,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,h=l[d=l[c=l[a]]],m=16843009*h^65537*d^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],d=n^a[1],h=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[d>>16&255]^b[h>>8&255]^T[255&p]^a[g],l=_[d>>>24]^v[h>>16&255]^b[p>>8&255]^T[255&c]^a[g+1],u=_[h>>>24]^v[p>>16&255]^b[c>>8&255]^T[255&d]^a[g+2],p=_[p>>>24]^v[c>>16&255]^b[d>>8&255]^T[255&h]^a[g+3],g+=4,c=o,d=l,h=u;for(m=0;m<4;m++)s[(3&-m)+r]=w[c>>>24]<<24^w[d>>16&255]<<16^w[h>>8&255]<<8^w[255&p]^a[g++],o=c,c=d,d=h,h=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;
33
- /*! @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,d,h,p,f,m,g,y;for(u=n[0],c=n[1],d=n[2],h=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]^d),l[y+3]=s(l[y+3]^h),u=p,c=f,d=m,h=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 Wk=dC(zk);const Gk=e=>{let t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},Xk=(e,t)=>{e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},Kk=(e,t)=>{t.activePlaylistLoader=e,e.load()},Yk={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){$S.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;$S.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const n=i.activeTrack();n&&(n.mode="disabled"),i.onTrackChanged()}},Qk={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",Yk[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",Yk[e](e,i))}},Jk={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,d=wE(c.main);a[e]&&0!==Object.keys(a[e]).length||(a[e]={main:{default:{default:!0}}},d&&(a[e].main.default.playlists=c.main.playlists));for(const s in a[e]){o[s]||(o[s]=[]);for(const h in a[e][s]){let p,f=a[e][s][h];if(d?(u(`AUDIO group '${s}' label '${h}' is a main playlist`),f.isMainPlaylist=!0,p=null):p="vhs-json"===n&&f.playlists?new jE(f.playlists[0],i,r):f.resolvedUri?new jE(f.resolvedUri,i,r):f.playlists&&"dash"===n?new lC(f.playlists[0],i,r,c):null,f=KS({id:h,playlistLoader:p},f),Qk[e](e,f.playlistLoader,t),o[s].push(f),void 0===l[h]){const e=new $S.AudioTrack({id:h,kind:Gk(f),enabled:!1,language:f.language,default:f.default,label:h});l[h]=e}}}s.on("error",Yk[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 d in o[e][r]){if(!n.options_.useForcedSubtitles&&o[e][r][d].forced)continue;let h,p=o[e][r][d];if("hls"===s)h=new jE(p.resolvedUri,n,a);else if("dash"===s){if(!p.playlists.filter((e=>e.excludeUntil!==1/0)).length)return;h=new lC(p.playlists[0],n,a,c)}else"vhs-json"===s&&(h=new jE(p.playlists?p.playlists[0]:p.resolvedUri,n,a));if(p=KS({id:d,playlistLoader:h},p),Qk[e](e,p.playlistLoader,t),l[r].push(p),void 0===u[d]){const e=i.addRemoteTextTrack({id:d,kind:"subtitles",default:p.default&&p.autoselect,language:p.language,label:d},!1).track;u[d]=e}}}r.on("error",Yk[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=KS(u,l[u.instreamId])),void 0===u.default&&delete u.default,s[t].push(KS({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}}}}},Zk=(e,t)=>{for(let i=0;i<e.length;i++){if(bE(t,e[i]))return!0;if(e[i].playlists&&Zk(e[i].playlists,t))return!0}return!1},ex={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}},tx=e=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((t=>{Jk[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&&wE(t.main))for(let e=0;e<o.length;e++){const t=s[o[e]];if(Zk(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=ex[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,Xk(i,s),a&&!a.isMainPlaylist&&(a.playlistLoader?(i.resyncLoader(),Kk(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,Xk(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(),Kk(o.playlistLoader,r)):Kk(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 ix{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_=WS(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 nx extends $S.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new ix,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_=XS("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=WS(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:$S.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 Xh.URL(e),i=new Xh.URL(this.proxyServerUrl_);return i.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(i.toString())}decodeDataUriManifest_(e){const t=JSON.parse(Xh.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new Xh.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_=Xh.setTimeout((()=>{this.requestSteeringManifest()}),t)}clearTTLTimeout_(){Xh.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 ix}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&&(WS(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}let sx;const rx=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],ax=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]};class ox extends $S.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:d,leastPixelDiffSelector:h,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),sx=r,this.bufferBasedABR=Boolean(d),this.leastPixelDiffSelector=Boolean(h),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:pk,activeTrack:pk,getActiveGroup:pk,onGroupChanged:pk,onTrackChanged:pk,lastTrack_:null,logger_:XS(`MediaGroups[${t}]`)}})),e})(),f&&Xh.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new Xh.ManagedMediaSource,this.usingManagedMediaSource_=!0,$S.log("Using ManagedMediaSource")):Xh.MediaSource&&(this.mediaSource=new Xh.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_=YS(),this.hasPlayed_=!1,this.syncController_=new Vk(e),this.segmentMetadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new Wk,this.sourceUpdater_=new Pk(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new Hk,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 lC(t,this.vhs_,KS(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new jE(t,this.vhs_,KS(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new hk(KS(g,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new hk(KS(g,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new Rk(KS(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 nx(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_()))),rx.forEach((e=>{this[e+"_"]=ax.bind(this,e)})),this.logger_=XS("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_=Xh.setInterval((()=>this.checkABR_()),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(Xh.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;vE(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()),tx({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;vE(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(Ep({},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"}),sx.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 $S.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(eE(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 d=rE(t,i),h=o?uC.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:uC.MAX_BUFFER_LOW_WATER_LINE;if(a<h)return l(`${u} as duration < max low water line (${a} < ${h})`),!0;const p=n.attributes.BANDWIDTH,f=e.attributes.BANDWIDTH;if(p<f&&(!o||d<r)){let e=`${u} as next bandwidth < current bandwidth (${p} < ${f})`;return o&&(e+=` and forwardBuffer < bufferHighWaterLine (${d} < ${r})`),l(e),!0}if((!o||p>f)&&d>=s){let e=`${u} as forwardBuffer >= bufferLowWaterLine (${d} >= ${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(Ep({},e))})),this.audioSegmentLoader_.on(e,(e=>{this.player_.trigger(Ep({},e))})),this.subtitleSegmentLoader_.on(e,(e=>{this.player_.trigger(Ep({},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;n=s<0?Math.max(i+s,t.start(0)):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=sx.Playlist.playlistEnd(e,t),n=this.tech_.currentTime(),s=this.tech_.buffered();if(!s.length)return i-n<=JS;const r=s.end(s.length-1);return r-n<=JS&&i-r<=JS}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(yE),r=1===s.length&&s[0]===e;if(1===n.length&&i!==1/0)return $S.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&&($S.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_:$S.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,d="number"==typeof o.lastRequest&&Date.now()-o.lastRequest<=c;return this.switchMedia_(o,"exclude",r||d)}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=eE(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:sx.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=sx.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,i),r=Math.max(0,t-s);return r<e?null:YS([[e,r]])}const s=this.syncController_.getExpiredTime(i,this.duration());if(null===s)return null;const r=sx.Playlist.seekable(i,s,sx.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:YS([[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 [${iE(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=sx.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=VC(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||$f}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||s)&&(n.audio=i.audio||e.main.audioCodec||e.audio.audioCodec||$f,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?Bf(t,this.usingManagedMediaSource_):jf(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){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const e=[];if(["video","audio"].forEach((t=>{const i=(Rf(this.sourceUpdater_.codecs[t]||"")[0]||{}).type,s=(Rf(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}{const e=Object.keys(a).reduce(((e,t)=>(e&&(e+=", "),e+=`${t} does not support codec(s): "${a[t].join(",")}"`)),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:e},playlistExclusionDuration:1/0})}}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=VC(this.main,n),r=[];!s.audio||jf(s.audio)||Bf(s.audio,this.usingManagedMediaSource_)||r.push(`audio codec ${s.audio}`),!s.video||jf(s.video)||Bf(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=$C(Rf(e)),s=qC(n),r=n.video&&Rf(n.video)[0]||null,a=n.audio&&Rf(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=VC(this.mainPlaylistLoader_.main,n),u=qC(l);if(l.audio||l.video){if(u!==s&&o.push(`codec count "${u}" !== "${s}"`),!this.sourceUpdater_.canChangeType()){const e=l.video&&Rf(l.video)[0]||null,t=l.audio&&Rf(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=Uk(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 Xh.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 Xh.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=uC.GOAL_BUFFER_LENGTH,i=uC.GOAL_BUFFER_LENGTH_RATE,n=Math.max(t,uC.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,n)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=uC.BUFFER_LOW_WATER_LINE,i=uC.BUFFER_LOW_WATER_LINE_RATE,n=Math.max(t,uC.MAX_BUFFER_LOW_WATER_LINE),s=Math.max(t,uC.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?s:n)}bufferHighWaterLine(){return uC.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){tk(this.inbandTextTracks_,"com.apple.streaming",this.tech_),(({inbandTextTracks:e,dateRanges:t})=>{const i=e.metadataTrack_;if(!i)return;const n=Xh.WebKitDataCue||Xh.VTTCue;t.forEach((e=>{for(const t of Object.keys(e)){if(ek.has(t))continue;const s=new n(e.startTime,e.endTime,"");s.id=e.id,s.type="com.apple.quicktime.HLS",s.value={key:ZC[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();tk(this.inbandTextTracks_,e,this.tech_),JC({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(Ep({},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)this.equalPathwayClones_(i,s)||(this.mainPlaylistLoader_.updateOrDeleteClone(s,!0),this.contentSteeringController_.addAvailablePathway(n));else{e.filter((e=>e.attributes["PATHWAY-ID"]===s["BASE-ID"])).forEach((e=>{this.mainPlaylistLoader_.addClonePathway(s,e)})),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,$S.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 lx{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=VC(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=gE(t),n=yE(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 ux=["seeking","seeked","pause","playing","error"];class cx extends $S.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_=XS("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(ux,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(ux,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_&&Xh.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&Xh.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=Xh.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:nE(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+JS>=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(YS([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:JS)}if(void 0!==i)return this.logger_(`Trying to seek outside of seekable at time ${t} with seekable range ${iE(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-QS),u=[r,a];for(let e=0;e<u.length;e++){if(!u[e])continue;if(rE(u[e],t)<l)return!1}const c=tE(s,t);return 0!==c.length&&(i=c.start(0)+JS,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=eE(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=tE(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)+JS;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=eE(e,i-3),r=eE(e,i),a=eE(t,i);a.length&&!r.length&&s.length&&(n={start:s.end(0),end:a.end(0)})}else{tE(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=tE(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)+QS);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 YS();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 YS(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 dx={errorInterval:30,getSource(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},hx=function(e,t){let i=0,n=0;const s=KS(dx,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);$S.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(),hx(e,t)}},px=function(e){hx(this,e)};var fx="3.16.2";const mx={PlaylistLoader:jE,Playlist:SE,utils:QE,STANDARD_PLAYLIST_SELECTOR:YC,INITIAL_PLAYLIST_SELECTOR:function(){const e=this.playlists.main.playlists.filter(SE.isEnabled);GC(e,((e,t)=>XC(e,t)));return e.filter((e=>!!VC(this.playlists.main,e).video))[0]||null},lastBandwidthSelector:YC,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&&Xh.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),KC(this.playlists.main,t,parseInt(WC(this.tech_.el(),"width"),10)*n,parseInt(WC(this.tech_.el(),"height"),10)*n,this.limitRenditionByPlayerDimensions,this.playlistController_)}},comparePlaylistBandwidth:XC,comparePlaylistResolution:function(e,t){let i,n;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||Xh.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),n=n||Xh.Number.MAX_VALUE,i===n&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-n},xhr:qE()};Object.keys(uC).forEach((e=>{Object.defineProperty(mx,e,{get:()=>($S.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),uC[e]),set(t){$S.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),"number"!=typeof t||t<0?$S.log.warn(`value of Vhs.${e} must be greater than or equal to 0`):uC[e]=t}})}));const gx="videojs-vhs",yx=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"})};mx.canPlaySource=function(){return $S.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const _x=({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)])},vx=({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=$C(Rf(t.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(n.audio=i.attributes.CODECS);const s=Ff(n.video),r=Ff(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 KS(e,a)})(t,i,n);return!!s&&(e.currentSource().keySystems=s,!(s&&!e.eme)||($S.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1))},bx=()=>{if(!Xh.localStorage)return null;const e=Xh.localStorage.getItem(gx);if(!e)return null;try{return JSON.parse(e)}catch(e){return null}},Tx=(e,t)=>{e._requestCallbackSet||(e._requestCallbackSet=new Set),e._requestCallbackSet.add(t)},wx=(e,t)=>{e._responseCallbackSet||(e._responseCallbackSet=new Set),e._responseCallbackSet.add(t)},Sx=(e,t)=>{e._requestCallbackSet&&(e._requestCallbackSet.delete(t),e._requestCallbackSet.size||delete e._requestCallbackSet)},Ex=(e,t)=>{e._responseCallbackSet&&(e._responseCallbackSet.delete(t),e._responseCallbackSet.size||delete e._responseCallbackSet)};mx.supportsNativeHls=function(){if(!Sp||!Sp.createElement)return!1;const e=Sp.createElement("video");if(!$S.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))}))}(),mx.supportsNativeDash=!!(Sp&&Sp.createElement&&$S.getTech("Html5").isSupported())&&/maybe|probably/i.test(Sp.createElement("video").canPlayType("application/dash+xml")),mx.supportsTypeNatively=e=>"hls"===e?mx.supportsNativeHls:"dash"===e&&mx.supportsNativeDash,mx.isSupported=function(){return $S.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},mx.xhr.onRequest=function(e){Tx(mx.xhr,e)},mx.xhr.onResponse=function(e){wx(mx.xhr,e)},mx.xhr.offRequest=function(e){Sx(mx.xhr,e)},mx.xhr.offResponse=function(e){Ex(mx.xhr,e)};const Cx=$S.getComponent("Component");class kx extends Cx{constructor(e,t,i){if(super(t,i.vhs),"number"==typeof i.initialBandwidth&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=XS("VhsHandler"),t.options_&&t.options_.playerId){const e=$S.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(Sp,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],(e=>{const t=Sp.fullscreenElement||Sp.webkitFullscreenElement||Sp.mozFullScreenElement||Sp.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_=KS(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.useBandwidthFromLocalStorage=void 0!==this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=!1!==this.options_.llhls,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,"number"!=typeof this.options_.playlistExclusionDuration&&(this.options_.playlistExclusionDuration=60),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){const e=bx();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=uC.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===uC.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach((e=>{void 0!==this.source_[e]&&(this.options_[e]=this.source_[e])})),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio;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=mx,this.options_.sourceType=Hf(t),this.options_.seekTo=e=>{this.tech_.setCurrentTime(e)},this.options_.player_=this.player_,this.playlistController_=new ox(this.options_);const n=KS({liveRangeSafeTimeDelta:JS},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new cx(n),this.attachStreamingEventListeners_(),this.playlistController_.on("error",(()=>{const e=$S.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?mx.movingAverageBandwidthSelector(.55):mx.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):s.bind(this),this.playlistController_.selectInitialPlaylist=mx.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=Xh.navigator.connection||Xh.navigator.mozConnection||Xh.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(){$S.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:()=>nE(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:()=>nE(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(!Xh.localStorage)return!1;let t=bx();t=t?KS(t,e):e;try{Xh.localStorage.setItem(gx,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=wE(t)?e.playlistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter((e=>!gE(e))).map(((t,i)=>new lx(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_=Xh.URL.createObjectURL(this.playlistController_.mediaSource),($S.browser.IS_ANY_SAFARI||$S.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"),_x({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=vx({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=$S.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)})),yx(e,t.playlists)}(this.qualityLevels_,this)})),this.playlists.on("mediachange",(()=>{yx(this.qualityLevels_,this.playlists)})))}static version(){return{"@videojs/http-streaming":fx,"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 Pk.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_&&Xh.URL.revokeObjectURL&&(Xh.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return JE({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=!0,n=2){return ZE({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=>{Tx(this.xhr,e)},this.xhr.onResponse=e=>{wx(this.xhr,e)},this.xhr.offRequest=e=>{Sx(this.xhr,e)},this.xhr.offResponse=e=>{Ex(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(Ep({},e))}))})),["gapjumped","playedrangeschanged"].forEach((e=>{this.playbackWatcher_.on(e,(e=>{this.player_.trigger(Ep({},e))}))}))}}const xx={name:"videojs-http-streaming",VERSION:fx,canHandleSource(e,t={}){const i=KS($S.options,t);return!(!i.vhs.experimentalUseMMS&&!Bf("avc1.4d400d,mp4a.40.2",!1))&&xx.canPlayType(e.type,i)},handleSource(e,t,i={}){const n=KS($S.options,i);return t.vhs=new kx(e,t,n),t.vhs.xhr=qE(),t.vhs.setupXhrHooks_(),t.vhs.src(e.src,e.type),t.vhs},canPlayType(e,t){const i=Hf(e);if(!i)return"";const n=xx.getOverrideNative(t);return!mx.supportsTypeNatively(i)||n?"maybe":""},getOverrideNative(e={}){const{vhs:t={}}=e,i=!($S.browser.IS_ANY_SAFARI||$S.browser.IS_IOS),{overrideNative:n=i}=t;return n}};Bf("avc1.4d400d,mp4a.40.2",!0)&&$S.getTech("Html5").registerSourceHandler(xx,0),$S.VhsHandler=kx,$S.VhsSourceHandler=xx,$S.Vhs=mx,$S.use||$S.registerComponent("Vhs",mx),$S.options.vhs=$S.options.vhs||{},$S.getPlugin&&$S.getPlugin("reloadSourceOnError")||$S.registerPlugin("reloadSourceOnError",px);const Ix=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; }.vjs-youtube-mobile .vjs-big-play-button { display: none; }",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)},Ax={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"},Ox={};"undefined"!=typeof window&&(window.videojs=$S);class Lx extends fi{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=$S(e,Ax)}setYouTubeVideo(e){Ix($S),this.player.tech("youtube"),this.player.src({type:"video/youtube",src:e})}static get NAME(){return"videoplayer"}_getConfig(e){return e={...Ox,...hi.getDataAttributes(this._element),..."object"==typeof e?e:{}}}}if("undefined"!=typeof window&&"undefined"!=typeof document){const Gx=mi.find("[data-bs-video]");Gx.length>0&&Gx.forEach((e=>{Lx.getOrCreateInstance(e)}))}const Px="show";class Dx extends fi{constructor(e,t){super(e.closest(".acceptoverlay")),this._overlayable=e.closest(".acceptoverlayable");const i=r.isChoiceRemembered(t.service);if(this._isShown=!0,this._toggleElement=e,this._element.classList.contains(Px)&&this._overlayable.classList.add(Px),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,r.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(Px),this._overlayable.classList.remove(Px),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&&Vt(this._element),this._element.classList.add(Px),this._overlayable.add(Px);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 Xx=mi.find("[data-bs-accept-from]");Xx.length>0&&Xx.forEach((e=>{Dx.getOrCreateInstance(e,{service:e.dataset.bsAcceptFrom})}))}n();const Mx={Alert:ko,Button:Io,Carousel:ll,Collapse:wl,Dropdown:Oc,Modal:dd,Offcanvas:Ad,Popover:class extends Yd{static get Default(){return Zd}static get DefaultType(){return eh}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[Qd]:this._getTitle(),[Jd]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}},ScrollSpy:dh,Tab:Ph,Toast:Gh,Tooltip:Yd,VideoPlayer:Lx,AcceptOverlay:Dx,Accordion:An,BackToTop:Fa,CarouselBI:_i,Cookiebar:Ji,Dimmer:Mi,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 Or(e,t,i):new Or(e,t),this.config=Object.assign({},Dr,this.validate.globalConfig),this.formItems=[],this.init(),this.validate}init(){this.target.querySelectorAll("input, select").forEach((e=>{const t=new Lr(e,this.config.errorFieldCssClass,(()=>this.onInputError(e)),(()=>this.onInputErrorRemove(e)),!0);e.id||e.setAttribute("id",Mr+"-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 Pr(e,"."+this.config.errorLabelCssClass,(()=>this.onFieldsetError(e)),(()=>this.onFieldsetErrorRemove(e)));e.id||e.setAttribute("id",Mr+"-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:Ga,HistoryBack:qa,Input:Nr,InputNumber:Pi,InputPassword:sa,InputSearchAutocomplete:Hr,List:so,Masonry:Ja,NavBarCollapsible:En,NavScroll:tr,Notification:qi,ProgressDonut:Ea,SelectAutocomplete:class extends fi{constructor(e,t){super(e),this._hasFormControl=e.classList.contains("form-control"),this.element_original_id=this._element.id,this._config=t,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}`),this._enhance()}static get NAME(){return"selectautocomplete"}_enhance(){Br.enhanceSelectElement(Object.assign({},{selectElement:this._element},this._config)),setTimeout((()=>{if(this._hasFormControl){if("undefined"==typeof document)return;const e=document.getElementById(this.element_original_id);e.classList.add("form-control"),function(e,t){const i=new MutationObserver((e=>{e.forEach((e=>{"attributes"===e.type&&"class"===e.attributeName&&t(e.target)}))}));i.observe(e,{attributes:!0}),i.disconnect}(e,(e=>{e.classList.contains("form-control")||e.classList.add("form-control")}))}}),100)}},Sticky:cr,HeaderSticky:fr,Transfer:wo,UploadDragDrop:Ma,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:r};return Mx}));
33
+ /*! @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,d,h,p,f,m,g,y;for(u=n[0],c=n[1],d=n[2],h=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]^d),l[y+3]=s(l[y+3]^h),u=p,c=f,d=m,h=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 Wk=dC(zk);const Gk=e=>{let t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},Xk=(e,t)=>{e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},Kk=(e,t)=>{t.activePlaylistLoader=e,e.load()},Yk={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){$S.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;$S.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const n=i.activeTrack();n&&(n.mode="disabled"),i.onTrackChanged()}},Qk={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",Yk[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",Yk[e](e,i))}},Jk={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,d=wE(c.main);a[e]&&0!==Object.keys(a[e]).length||(a[e]={main:{default:{default:!0}}},d&&(a[e].main.default.playlists=c.main.playlists));for(const s in a[e]){o[s]||(o[s]=[]);for(const h in a[e][s]){let p,f=a[e][s][h];if(d?(u(`AUDIO group '${s}' label '${h}' is a main playlist`),f.isMainPlaylist=!0,p=null):p="vhs-json"===n&&f.playlists?new jE(f.playlists[0],i,r):f.resolvedUri?new jE(f.resolvedUri,i,r):f.playlists&&"dash"===n?new lC(f.playlists[0],i,r,c):null,f=KS({id:h,playlistLoader:p},f),Qk[e](e,f.playlistLoader,t),o[s].push(f),void 0===l[h]){const e=new $S.AudioTrack({id:h,kind:Gk(f),enabled:!1,language:f.language,default:f.default,label:h});l[h]=e}}}s.on("error",Yk[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 d in o[e][r]){if(!n.options_.useForcedSubtitles&&o[e][r][d].forced)continue;let h,p=o[e][r][d];if("hls"===s)h=new jE(p.resolvedUri,n,a);else if("dash"===s){if(!p.playlists.filter((e=>e.excludeUntil!==1/0)).length)return;h=new lC(p.playlists[0],n,a,c)}else"vhs-json"===s&&(h=new jE(p.playlists?p.playlists[0]:p.resolvedUri,n,a));if(p=KS({id:d,playlistLoader:h},p),Qk[e](e,p.playlistLoader,t),l[r].push(p),void 0===u[d]){const e=i.addRemoteTextTrack({id:d,kind:"subtitles",default:p.default&&p.autoselect,language:p.language,label:d},!1).track;u[d]=e}}}r.on("error",Yk[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=KS(u,l[u.instreamId])),void 0===u.default&&delete u.default,s[t].push(KS({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}}}}},Zk=(e,t)=>{for(let i=0;i<e.length;i++){if(bE(t,e[i]))return!0;if(e[i].playlists&&Zk(e[i].playlists,t))return!0}return!1},ex={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}},tx=e=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((t=>{Jk[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&&wE(t.main))for(let e=0;e<o.length;e++){const t=s[o[e]];if(Zk(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=ex[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,Xk(i,s),a&&!a.isMainPlaylist&&(a.playlistLoader?(i.resyncLoader(),Kk(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,Xk(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(),Kk(o.playlistLoader,r)):Kk(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 ix{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_=WS(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 nx extends $S.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new ix,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_=XS("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=WS(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:$S.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 Xh.URL(e),i=new Xh.URL(this.proxyServerUrl_);return i.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(i.toString())}decodeDataUriManifest_(e){const t=JSON.parse(Xh.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new Xh.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_=Xh.setTimeout((()=>{this.requestSteeringManifest()}),t)}clearTTLTimeout_(){Xh.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 ix}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&&(WS(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}let sx;const rx=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],ax=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]};class ox extends $S.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:d,leastPixelDiffSelector:h,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),sx=r,this.bufferBasedABR=Boolean(d),this.leastPixelDiffSelector=Boolean(h),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:pk,activeTrack:pk,getActiveGroup:pk,onGroupChanged:pk,onTrackChanged:pk,lastTrack_:null,logger_:XS(`MediaGroups[${t}]`)}})),e})(),f&&Xh.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new Xh.ManagedMediaSource,this.usingManagedMediaSource_=!0,$S.log("Using ManagedMediaSource")):Xh.MediaSource&&(this.mediaSource=new Xh.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_=YS(),this.hasPlayed_=!1,this.syncController_=new Vk(e),this.segmentMetadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new Wk,this.sourceUpdater_=new Pk(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new Hk,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 lC(t,this.vhs_,KS(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new jE(t,this.vhs_,KS(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new hk(KS(g,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new hk(KS(g,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new Rk(KS(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 nx(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_()))),rx.forEach((e=>{this[e+"_"]=ax.bind(this,e)})),this.logger_=XS("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_=Xh.setInterval((()=>this.checkABR_()),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(Xh.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;vE(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()),tx({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;vE(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(Ep({},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"}),sx.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 $S.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(eE(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 d=rE(t,i),h=o?uC.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:uC.MAX_BUFFER_LOW_WATER_LINE;if(a<h)return l(`${u} as duration < max low water line (${a} < ${h})`),!0;const p=n.attributes.BANDWIDTH,f=e.attributes.BANDWIDTH;if(p<f&&(!o||d<r)){let e=`${u} as next bandwidth < current bandwidth (${p} < ${f})`;return o&&(e+=` and forwardBuffer < bufferHighWaterLine (${d} < ${r})`),l(e),!0}if((!o||p>f)&&d>=s){let e=`${u} as forwardBuffer >= bufferLowWaterLine (${d} >= ${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(Ep({},e))})),this.audioSegmentLoader_.on(e,(e=>{this.player_.trigger(Ep({},e))})),this.subtitleSegmentLoader_.on(e,(e=>{this.player_.trigger(Ep({},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;n=s<0?Math.max(i+s,t.start(0)):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=sx.Playlist.playlistEnd(e,t),n=this.tech_.currentTime(),s=this.tech_.buffered();if(!s.length)return i-n<=JS;const r=s.end(s.length-1);return r-n<=JS&&i-r<=JS}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(yE),r=1===s.length&&s[0]===e;if(1===n.length&&i!==1/0)return $S.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&&($S.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_:$S.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,d="number"==typeof o.lastRequest&&Date.now()-o.lastRequest<=c;return this.switchMedia_(o,"exclude",r||d)}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=eE(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:sx.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=sx.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,i),r=Math.max(0,t-s);return r<e?null:YS([[e,r]])}const s=this.syncController_.getExpiredTime(i,this.duration());if(null===s)return null;const r=sx.Playlist.seekable(i,s,sx.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:YS([[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 [${iE(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=sx.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=VC(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||$f}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||s)&&(n.audio=i.audio||e.main.audioCodec||e.audio.audioCodec||$f,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?Bf(t,this.usingManagedMediaSource_):jf(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){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const e=[];if(["video","audio"].forEach((t=>{const i=(Rf(this.sourceUpdater_.codecs[t]||"")[0]||{}).type,s=(Rf(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}{const e=Object.keys(a).reduce(((e,t)=>(e&&(e+=", "),e+=`${t} does not support codec(s): "${a[t].join(",")}"`)),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:e},playlistExclusionDuration:1/0})}}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=VC(this.main,n),r=[];!s.audio||jf(s.audio)||Bf(s.audio,this.usingManagedMediaSource_)||r.push(`audio codec ${s.audio}`),!s.video||jf(s.video)||Bf(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=$C(Rf(e)),s=qC(n),r=n.video&&Rf(n.video)[0]||null,a=n.audio&&Rf(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=VC(this.mainPlaylistLoader_.main,n),u=qC(l);if(l.audio||l.video){if(u!==s&&o.push(`codec count "${u}" !== "${s}"`),!this.sourceUpdater_.canChangeType()){const e=l.video&&Rf(l.video)[0]||null,t=l.audio&&Rf(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=Uk(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 Xh.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 Xh.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=uC.GOAL_BUFFER_LENGTH,i=uC.GOAL_BUFFER_LENGTH_RATE,n=Math.max(t,uC.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,n)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=uC.BUFFER_LOW_WATER_LINE,i=uC.BUFFER_LOW_WATER_LINE_RATE,n=Math.max(t,uC.MAX_BUFFER_LOW_WATER_LINE),s=Math.max(t,uC.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?s:n)}bufferHighWaterLine(){return uC.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){tk(this.inbandTextTracks_,"com.apple.streaming",this.tech_),(({inbandTextTracks:e,dateRanges:t})=>{const i=e.metadataTrack_;if(!i)return;const n=Xh.WebKitDataCue||Xh.VTTCue;t.forEach((e=>{for(const t of Object.keys(e)){if(ek.has(t))continue;const s=new n(e.startTime,e.endTime,"");s.id=e.id,s.type="com.apple.quicktime.HLS",s.value={key:ZC[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();tk(this.inbandTextTracks_,e,this.tech_),JC({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(Ep({},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)this.equalPathwayClones_(i,s)||(this.mainPlaylistLoader_.updateOrDeleteClone(s,!0),this.contentSteeringController_.addAvailablePathway(n));else{e.filter((e=>e.attributes["PATHWAY-ID"]===s["BASE-ID"])).forEach((e=>{this.mainPlaylistLoader_.addClonePathway(s,e)})),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,$S.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 lx{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=VC(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=gE(t),n=yE(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 ux=["seeking","seeked","pause","playing","error"];class cx extends $S.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_=XS("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(ux,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(ux,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_&&Xh.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&Xh.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=Xh.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:nE(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+JS>=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(YS([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:JS)}if(void 0!==i)return this.logger_(`Trying to seek outside of seekable at time ${t} with seekable range ${iE(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-QS),u=[r,a];for(let e=0;e<u.length;e++){if(!u[e])continue;if(rE(u[e],t)<l)return!1}const c=tE(s,t);return 0!==c.length&&(i=c.start(0)+JS,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=eE(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=tE(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)+JS;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=eE(e,i-3),r=eE(e,i),a=eE(t,i);a.length&&!r.length&&s.length&&(n={start:s.end(0),end:a.end(0)})}else{tE(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=tE(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)+QS);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 YS();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 YS(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 dx={errorInterval:30,getSource(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},hx=function(e,t){let i=0,n=0;const s=KS(dx,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);$S.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(),hx(e,t)}},px=function(e){hx(this,e)};var fx="3.16.2";const mx={PlaylistLoader:jE,Playlist:SE,utils:QE,STANDARD_PLAYLIST_SELECTOR:YC,INITIAL_PLAYLIST_SELECTOR:function(){const e=this.playlists.main.playlists.filter(SE.isEnabled);GC(e,((e,t)=>XC(e,t)));return e.filter((e=>!!VC(this.playlists.main,e).video))[0]||null},lastBandwidthSelector:YC,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&&Xh.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),KC(this.playlists.main,t,parseInt(WC(this.tech_.el(),"width"),10)*n,parseInt(WC(this.tech_.el(),"height"),10)*n,this.limitRenditionByPlayerDimensions,this.playlistController_)}},comparePlaylistBandwidth:XC,comparePlaylistResolution:function(e,t){let i,n;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||Xh.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),n=n||Xh.Number.MAX_VALUE,i===n&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-n},xhr:qE()};Object.keys(uC).forEach((e=>{Object.defineProperty(mx,e,{get:()=>($S.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),uC[e]),set(t){$S.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),"number"!=typeof t||t<0?$S.log.warn(`value of Vhs.${e} must be greater than or equal to 0`):uC[e]=t}})}));const gx="videojs-vhs",yx=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"})};mx.canPlaySource=function(){return $S.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const _x=({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)])},vx=({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=$C(Rf(t.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(n.audio=i.attributes.CODECS);const s=Ff(n.video),r=Ff(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 KS(e,a)})(t,i,n);return!!s&&(e.currentSource().keySystems=s,!(s&&!e.eme)||($S.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1))},bx=()=>{if(!Xh.localStorage)return null;const e=Xh.localStorage.getItem(gx);if(!e)return null;try{return JSON.parse(e)}catch(e){return null}},Tx=(e,t)=>{e._requestCallbackSet||(e._requestCallbackSet=new Set),e._requestCallbackSet.add(t)},wx=(e,t)=>{e._responseCallbackSet||(e._responseCallbackSet=new Set),e._responseCallbackSet.add(t)},Sx=(e,t)=>{e._requestCallbackSet&&(e._requestCallbackSet.delete(t),e._requestCallbackSet.size||delete e._requestCallbackSet)},Ex=(e,t)=>{e._responseCallbackSet&&(e._responseCallbackSet.delete(t),e._responseCallbackSet.size||delete e._responseCallbackSet)};mx.supportsNativeHls=function(){if(!Sp||!Sp.createElement)return!1;const e=Sp.createElement("video");if(!$S.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))}))}(),mx.supportsNativeDash=!!(Sp&&Sp.createElement&&$S.getTech("Html5").isSupported())&&/maybe|probably/i.test(Sp.createElement("video").canPlayType("application/dash+xml")),mx.supportsTypeNatively=e=>"hls"===e?mx.supportsNativeHls:"dash"===e&&mx.supportsNativeDash,mx.isSupported=function(){return $S.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},mx.xhr.onRequest=function(e){Tx(mx.xhr,e)},mx.xhr.onResponse=function(e){wx(mx.xhr,e)},mx.xhr.offRequest=function(e){Sx(mx.xhr,e)},mx.xhr.offResponse=function(e){Ex(mx.xhr,e)};const Cx=$S.getComponent("Component");class kx extends Cx{constructor(e,t,i){if(super(t,i.vhs),"number"==typeof i.initialBandwidth&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=XS("VhsHandler"),t.options_&&t.options_.playerId){const e=$S.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(Sp,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],(e=>{const t=Sp.fullscreenElement||Sp.webkitFullscreenElement||Sp.mozFullScreenElement||Sp.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_=KS(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.useBandwidthFromLocalStorage=void 0!==this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=!1!==this.options_.llhls,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,"number"!=typeof this.options_.playlistExclusionDuration&&(this.options_.playlistExclusionDuration=60),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){const e=bx();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=uC.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===uC.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach((e=>{void 0!==this.source_[e]&&(this.options_[e]=this.source_[e])})),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio;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=mx,this.options_.sourceType=Hf(t),this.options_.seekTo=e=>{this.tech_.setCurrentTime(e)},this.options_.player_=this.player_,this.playlistController_=new ox(this.options_);const n=KS({liveRangeSafeTimeDelta:JS},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new cx(n),this.attachStreamingEventListeners_(),this.playlistController_.on("error",(()=>{const e=$S.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?mx.movingAverageBandwidthSelector(.55):mx.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):s.bind(this),this.playlistController_.selectInitialPlaylist=mx.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=Xh.navigator.connection||Xh.navigator.mozConnection||Xh.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(){$S.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:()=>nE(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:()=>nE(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(!Xh.localStorage)return!1;let t=bx();t=t?KS(t,e):e;try{Xh.localStorage.setItem(gx,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=wE(t)?e.playlistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter((e=>!gE(e))).map(((t,i)=>new lx(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_=Xh.URL.createObjectURL(this.playlistController_.mediaSource),($S.browser.IS_ANY_SAFARI||$S.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"),_x({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=vx({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=$S.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)})),yx(e,t.playlists)}(this.qualityLevels_,this)})),this.playlists.on("mediachange",(()=>{yx(this.qualityLevels_,this.playlists)})))}static version(){return{"@videojs/http-streaming":fx,"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 Pk.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_&&Xh.URL.revokeObjectURL&&(Xh.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return JE({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=!0,n=2){return ZE({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=>{Tx(this.xhr,e)},this.xhr.onResponse=e=>{wx(this.xhr,e)},this.xhr.offRequest=e=>{Sx(this.xhr,e)},this.xhr.offResponse=e=>{Ex(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(Ep({},e))}))})),["gapjumped","playedrangeschanged"].forEach((e=>{this.playbackWatcher_.on(e,(e=>{this.player_.trigger(Ep({},e))}))}))}}const xx={name:"videojs-http-streaming",VERSION:fx,canHandleSource(e,t={}){const i=KS($S.options,t);return!(!i.vhs.experimentalUseMMS&&!Bf("avc1.4d400d,mp4a.40.2",!1))&&xx.canPlayType(e.type,i)},handleSource(e,t,i={}){const n=KS($S.options,i);return t.vhs=new kx(e,t,n),t.vhs.xhr=qE(),t.vhs.setupXhrHooks_(),t.vhs.src(e.src,e.type),t.vhs},canPlayType(e,t){const i=Hf(e);if(!i)return"";const n=xx.getOverrideNative(t);return!mx.supportsTypeNatively(i)||n?"maybe":""},getOverrideNative(e={}){const{vhs:t={}}=e,i=!($S.browser.IS_ANY_SAFARI||$S.browser.IS_IOS),{overrideNative:n=i}=t;return n}};Bf("avc1.4d400d,mp4a.40.2",!0)&&$S.getTech("Html5").registerSourceHandler(xx,0),$S.VhsHandler=kx,$S.VhsSourceHandler=xx,$S.Vhs=mx,$S.use||$S.registerComponent("Vhs",mx),$S.options.vhs=$S.options.vhs||{},$S.getPlugin&&$S.getPlugin("reloadSourceOnError")||$S.registerPlugin("reloadSourceOnError",px);const Ix=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)},Ax={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"},Ox={};"undefined"!=typeof window&&(window.videojs=$S);class Lx extends fi{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=$S(e,Ax)}setYouTubeVideo(e){Ix($S),this.player.tech("youtube"),this.player.src({type:"video/youtube",src:e})}static get NAME(){return"videoplayer"}_getConfig(e){return e={...Ox,...hi.getDataAttributes(this._element),..."object"==typeof e?e:{}}}}if("undefined"!=typeof window&&"undefined"!=typeof document){const Gx=mi.find("[data-bs-video]");Gx.length>0&&Gx.forEach((e=>{Lx.getOrCreateInstance(e)}))}const Px="show";class Dx extends fi{constructor(e,t){super(e.closest(".acceptoverlay")),this._overlayable=e.closest(".acceptoverlayable");const i=r.isChoiceRemembered(t.service);if(this._isShown=!0,this._toggleElement=e,this._element.classList.contains(Px)&&this._overlayable.classList.add(Px),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,r.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(Px),this._overlayable.classList.remove(Px),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&&Vt(this._element),this._element.classList.add(Px),this._overlayable.add(Px);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 Xx=mi.find("[data-bs-accept-from]");Xx.length>0&&Xx.forEach((e=>{Dx.getOrCreateInstance(e,{service:e.dataset.bsAcceptFrom})}))}n();const Mx={Alert:ko,Button:Io,Carousel:ll,Collapse:wl,Dropdown:Oc,Modal:dd,Offcanvas:Ad,Popover:class extends Yd{static get Default(){return Zd}static get DefaultType(){return eh}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[Qd]:this._getTitle(),[Jd]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}},ScrollSpy:dh,Tab:Ph,Toast:Gh,Tooltip:Yd,VideoPlayer:Lx,AcceptOverlay:Dx,Accordion:An,BackToTop:Fa,CarouselBI:_i,Cookiebar:Ji,Dimmer:Mi,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 Or(e,t,i):new Or(e,t),this.config=Object.assign({},Dr,this.validate.globalConfig),this.formItems=[],this.init(),this.validate}init(){this.target.querySelectorAll("input, select").forEach((e=>{const t=new Lr(e,this.config.errorFieldCssClass,(()=>this.onInputError(e)),(()=>this.onInputErrorRemove(e)),!0);e.id||e.setAttribute("id",Mr+"-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 Pr(e,"."+this.config.errorLabelCssClass,(()=>this.onFieldsetError(e)),(()=>this.onFieldsetErrorRemove(e)));e.id||e.setAttribute("id",Mr+"-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:Ga,HistoryBack:qa,Input:Nr,InputNumber:Pi,InputPassword:sa,InputSearchAutocomplete:Hr,List:so,Masonry:Ja,NavBarCollapsible:En,NavScroll:tr,Notification:qi,ProgressDonut:Ea,SelectAutocomplete:class extends fi{constructor(e,t){super(e),this._hasFormControl=e.classList.contains("form-control"),this.element_original_id=this._element.id,this._config=t,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}`),this._enhance()}static get NAME(){return"selectautocomplete"}_enhance(){Br.enhanceSelectElement(Object.assign({},{selectElement:this._element},this._config)),setTimeout((()=>{if(this._hasFormControl){if("undefined"==typeof document)return;const e=document.getElementById(this.element_original_id);e.classList.add("form-control"),function(e,t){const i=new MutationObserver((e=>{e.forEach((e=>{"attributes"===e.type&&"class"===e.attributeName&&t(e.target)}))}));i.observe(e,{attributes:!0}),i.disconnect}(e,(e=>{e.classList.contains("form-control")||e.classList.add("form-control")}))}}),100)}},Sticky:cr,HeaderSticky:fr,Transfer:wo,UploadDragDrop:Ma,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:r};return Mx}));