bootstrap-italia 2.3.7 → 2.4.0

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.
Files changed (41) hide show
  1. package/dist/bootstrap-italia.esm.js +2 -0
  2. package/dist/bootstrap-italia.esm.js.map +1 -1
  3. package/dist/css/bootstrap-italia-comuni.min.css +1 -1
  4. package/dist/css/bootstrap-italia.min.css +1 -1
  5. package/dist/css/bootstrap-italia.min.css.map +1 -1
  6. package/dist/js/bootstrap-italia.bundle.min.js +198 -72
  7. package/dist/js/bootstrap-italia.min.js +54 -47
  8. package/dist/plugins/accept-overlay.js +118 -0
  9. package/dist/plugins/accept-overlay.js.map +1 -0
  10. package/dist/plugins/carousel-bi.js +1 -1
  11. package/dist/plugins/carousel-bi.js.map +1 -1
  12. package/dist/plugins/dimmer.js +0 -16
  13. package/dist/plugins/dimmer.js.map +1 -1
  14. package/dist/plugins/util/cookies.js +29 -0
  15. package/dist/plugins/util/cookies.js.map +1 -0
  16. package/dist/plugins/videoplayer.js +151 -0
  17. package/dist/plugins/videoplayer.js.map +1 -0
  18. package/dist/version.js +1 -1
  19. package/dist/version.js.map +1 -1
  20. package/package.json +6 -5
  21. package/src/js/bootstrap-italia.entry.js +6 -0
  22. package/src/js/bootstrap-italia.esm.js +2 -0
  23. package/src/js/plugins/accept-overlay.js +118 -0
  24. package/src/js/plugins/carousel-bi.js +1 -1
  25. package/src/js/plugins/dimmer.js +0 -15
  26. package/src/js/plugins/util/cookies.js +28 -0
  27. package/src/js/plugins/videoplayer.js +151 -0
  28. package/src/js/version.js +1 -1
  29. package/src/scss/_variables.scss +1 -1
  30. package/src/scss/bootstrap-italia.scss +2 -0
  31. package/src/scss/custom/_accept-overlay.scss +128 -0
  32. package/src/scss/custom/_alert.scss +1 -1
  33. package/src/scss/custom/_buttons.scss +10 -3
  34. package/src/scss/custom/_callout.scss +53 -10
  35. package/src/scss/custom/_carousel.scss +1 -1
  36. package/src/scss/custom/_timeline.scss +3 -0
  37. package/src/scss/custom/_type.scss +1 -0
  38. package/src/scss/custom/_version.scss +1 -1
  39. package/src/scss/custom/_videoplayer.scss +40 -0
  40. package/types/index.d.ts +2 -0
  41. package/types/plugins/fonts-loader.d.ts +5 -0
@@ -20,12 +20,14 @@
20
20
 
21
21
  const DATA_MOUSE_FOCUS="data-focus-mouse";class TrackFocus{constructor(){this._usingMouse=!1,this._bindEvents();}_bindEvents(){["keydown","mousedown"].forEach((t=>{document.addEventListener(t,(t=>{this._usingMouse="mousedown"===t.type;}));})),document.addEventListener("focusin",(t=>{this._usingMouse&&t.target&&(t.target.classList.add("focus--mouse"),t.target.setAttribute(DATA_MOUSE_FOCUS,!0));})),document.addEventListener("focusout",(t=>{t.target&&(t.target.classList.remove("focus--mouse"),t.target.setAttribute(DATA_MOUSE_FOCUS,!1));}));}}new TrackFocus;const TrackFocus$1 = TrackFocus;
22
22
 
23
- const BOOTSTRAP_ITALIA_VERSION = "2.3.7";
23
+ const BOOTSTRAP_ITALIA_VERSION = "2.4.0";
24
24
 
25
25
  const init=()=>{window.BOOTSTRAP_ITALIA_VERSION||(new TrackFocus$1,window.BOOTSTRAP_ITALIA_VERSION=BOOTSTRAP_ITALIA_VERSION);};const init$1 = init;init();
26
26
 
27
27
  const loadFonts = (t="/node_modules/bootstrap-italia/dist/fonts")=>{const i=document.createElement("style"),o=window.__PUBLIC_PATH__?window.__PUBLIC_PATH__:t;i.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('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-300.eot'); /* IE9 Compat Modes */\n src: local(''),\n url('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-300.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */\n url('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-300.woff2') format('woff2'), /* Super Modern Browsers */\n url('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-300.woff') format('woff'), /* Modern Browsers */\n url('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-300.ttf') format('truetype'), /* Safari, Android, iOS */\n url('${o}/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('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-300italic.eot'); /* IE9 Compat Modes */\n src: local(''),\n url('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-300italic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */\n url('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-300italic.woff2') format('woff2'), /* Super Modern Browsers */\n url('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-300italic.woff') format('woff'), /* Modern Browsers */\n url('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-300italic.ttf') format('truetype'), /* Safari, Android, iOS */\n url('${o}/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('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-regular.eot'); /* IE9 Compat Modes */\n src: local(''),\n url('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */\n url('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-regular.woff2') format('woff2'), /* Super Modern Browsers */\n url('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-regular.woff') format('woff'), /* Modern Browsers */\n url('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */\n url('${o}/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('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-italic.eot'); /* IE9 Compat Modes */\n src: local(''),\n url('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-italic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */\n url('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-italic.woff2') format('woff2'), /* Super Modern Browsers */\n url('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-italic.woff') format('woff'), /* Modern Browsers */\n url('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-italic.ttf') format('truetype'), /* Safari, Android, iOS */\n url('${o}/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('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-700.eot'); /* IE9 Compat Modes */\n src: local(''),\n url('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */\n url('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-700.woff2') format('woff2'), /* Super Modern Browsers */\n url('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-700.woff') format('woff'), /* Modern Browsers */\n url('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-700.ttf') format('truetype'), /* Safari, Android, iOS */\n url('${o}/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('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-700italic.eot'); /* IE9 Compat Modes */\n src: local(''),\n url('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-700italic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */\n url('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-700italic.woff2') format('woff2'), /* Super Modern Browsers */\n url('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-700italic.woff') format('woff'), /* Modern Browsers */\n url('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-700italic.ttf') format('truetype'), /* Safari, Android, iOS */\n url('${o}/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('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-600.eot'); /* IE9 Compat Modes */\n src: local(''),\n url('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-600.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */\n url('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-600.woff2') format('woff2'), /* Super Modern Browsers */\n url('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-600.woff') format('woff'), /* Modern Browsers */\n url('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-600.ttf') format('truetype'), /* Safari, Android, iOS */\n url('${o}/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('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-600italic.eot'); /* IE9 Compat Modes */\n src: local(''),\n url('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-600italic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */\n url('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-600italic.woff2') format('woff2'), /* Super Modern Browsers */\n url('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-600italic.woff') format('woff'), /* Modern Browsers */\n url('${o}/Titillium_Web/titillium-web-v10-latin-ext_latin-600italic.ttf') format('truetype'), /* Safari, Android, iOS */\n url('${o}/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('${o}/Lora/lora-v20-latin-ext_latin-regular.eot'); /* IE9 Compat Modes */\n src: local(''),\n url('${o}/Lora/lora-v20-latin-ext_latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */\n url('${o}/Lora/lora-v20-latin-ext_latin-regular.woff2') format('woff2'), /* Super Modern Browsers */\n url('${o}/Lora/lora-v20-latin-ext_latin-regular.woff') format('woff'), /* Modern Browsers */\n url('${o}/Lora/lora-v20-latin-ext_latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */\n url('${o}/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('${o}/Lora/lora-v20-latin-ext_latin-700.eot'); /* IE9 Compat Modes */\n src: local(''),\n url('${o}/Lora/lora-v20-latin-ext_latin-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */\n url('${o}/Lora/lora-v20-latin-ext_latin-700.woff2') format('woff2'), /* Super Modern Browsers */\n url('${o}/Lora/lora-v20-latin-ext_latin-700.woff') format('woff'), /* Modern Browsers */\n url('${o}/Lora/lora-v20-latin-ext_latin-700.ttf') format('truetype'), /* Safari, Android, iOS */\n url('${o}/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('${o}/Lora/lora-v20-latin-ext_latin-italic.eot'); /* IE9 Compat Modes */\n src: local(''),\n url('${o}/Lora/lora-v20-latin-ext_latin-italic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */\n url('${o}/Lora/lora-v20-latin-ext_latin-italic.woff2') format('woff2'), /* Super Modern Browsers */\n url('${o}/Lora/lora-v20-latin-ext_latin-italic.woff') format('woff'), /* Modern Browsers */\n url('${o}/Lora/lora-v20-latin-ext_latin-italic.ttf') format('truetype'), /* Safari, Android, iOS */\n url('${o}/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('${o}/Lora/lora-v20-latin-ext_latin-700italic.eot'); /* IE9 Compat Modes */\n src: local(''),\n url('${o}/Lora/lora-v20-latin-ext_latin-700italic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */\n url('${o}/Lora/lora-v20-latin-ext_latin-700italic.woff2') format('woff2'), /* Super Modern Browsers */\n url('${o}/Lora/lora-v20-latin-ext_latin-700italic.woff') format('woff'), /* Modern Browsers */\n url('${o}/Lora/lora-v20-latin-ext_latin-700italic.ttf') format('truetype'), /* Safari, Android, iOS */\n url('${o}/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('${o}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-regular.eot'); /* IE9 Compat Modes */\n src: local(''),\n url('${o}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */\n url('${o}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-regular.woff2') format('woff2'), /* Super Modern Browsers */\n url('${o}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-regular.woff') format('woff'), /* Modern Browsers */\n url('${o}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */\n url('${o}/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('${o}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-700.eot'); /* IE9 Compat Modes */\n src: local(''),\n url('${o}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */\n url('${o}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-700.woff2') format('woff2'), /* Super Modern Browsers */\n url('${o}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-700.woff') format('woff'), /* Modern Browsers */\n url('${o}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-700.ttf') format('truetype'), /* Safari, Android, iOS */\n url('${o}/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('${o}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-italic.eot'); /* IE9 Compat Modes */\n src: local(''),\n url('${o}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-italic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */\n url('${o}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-italic.woff2') format('woff2'), /* Super Modern Browsers */\n url('${o}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-italic.woff') format('woff'), /* Modern Browsers */\n url('${o}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-italic.ttf') format('truetype'), /* Safari, Android, iOS */\n url('${o}/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('${o}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-700italic.eot'); /* IE9 Compat Modes */\n src: local(''),\n url('${o}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-700italic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */\n url('${o}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-700italic.woff2') format('woff2'), /* Super Modern Browsers */\n url('${o}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-700italic.woff') format('woff'), /* Modern Browsers */\n url('${o}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-700italic.ttf') format('truetype'), /* Safari, Android, iOS */\n url('${o}/Roboto_Mono/roboto-mono-v13-latin-ext_latin-700italic.svg#RobotoMono') format('svg'); /* Legacy iOS */\n }\n `,document.getElementsByTagName("head")[0].appendChild(i);};
28
28
 
29
+ const preferencesMap={ck3:{}},rememberChoice=(e,r)=>{preferencesMap.ck3[e]=r,localStorage.setItem("bs-ck3",JSON.stringify(preferencesMap.ck3));},isChoiceRemembered=e=>(preferencesMap.ck3=JSON.parse(localStorage.getItem("bs-ck3")||"{}"),preferencesMap.ck3[e]||!1),clearAllRememberedChoices=()=>{localStorage.removeItem("bs-ck3");},cookies={rememberChoice:rememberChoice,isChoiceRemembered:isChoiceRemembered,clearAllRememberedChoices:clearAllRememberedChoices};
30
+
29
31
  const icons = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
30
32
  __proto__: null
31
33
  }, Symbol.toStringTag, { value: 'Module' }));
@@ -35,35 +37,35 @@
35
37
  * Version : 3.6.12
36
38
  * License : MIT
37
39
  * Copyright: 2022 Naotoshi Fujita
38
- */const STATES={CREATED:1,MOUNTED:2,IDLE:3,MOVING:4,DESTROYED:5};function empty(t){t.length=0;}function isObject$1(t){return !isNull(t)&&"object"==typeof t}function isArray$1(t){return Array.isArray(t)}function isFunction$1(t){return "function"==typeof t}function isString$1(t){return "string"==typeof t}function isUndefined(t){return void 0===t}function isNull(t){return null===t}function isHTMLElement$1(t){return t instanceof HTMLElement}function toArray$1(t){return isArray$1(t)?t:[t]}function forEach(t,e){toArray$1(t).forEach(e);}function includes(t,e){return t.indexOf(e)>-1}function push(t,e){return t.push(...toArray$1(e)),t}const arrayProto=Array.prototype;function slice(t,e,n){return arrayProto.slice.call(t,e,n)}function find(t,e){return slice(t).filter(e)[0]}function toggleClass(t,e,n){t&&forEach(e,(e=>{e&&t.classList[n?"add":"remove"](e);}));}function addClass(t,e){toggleClass(t,isString$1(e)?e.split(" "):e,!0);}function append(t,e){forEach(e,t.appendChild.bind(t));}function before(t,e){forEach(t,(t=>{const n=e.parentNode;n&&n.insertBefore(t,e);}));}function matches(t,e){return isHTMLElement$1(t)&&(t.msMatchesSelector||t.matches).call(t,e)}function children(t,e){return t?slice(t.children).filter((t=>matches(t,e))):[]}function child(t,e){return e?children(t,e)[0]:t.firstElementChild}function forOwn(t,e,n){if(t){let i=Object.keys(t);i=n?i.reverse():i;for(let n=0;n<i.length;n++){const s=i[n];if("__proto__"!==s&&!1===e(t[s],s))break}}return t}function assign(t){return slice(arguments,1).forEach((e=>{forOwn(e,((n,i)=>{t[i]=e[i];}));})),t}function merge(t,e){return forOwn(e,((e,n)=>{isArray$1(e)?t[n]=e.slice():isObject$1(e)?t[n]=merge(isObject$1(t[n])?t[n]:{},e):t[n]=e;})),t}function removeAttribute(t,e){t&&forEach(e,(e=>{t.removeAttribute(e);}));}function setAttribute(t,e,n){isObject$1(e)?forOwn(e,((e,n)=>{setAttribute(t,n,e);})):isNull(n)?removeAttribute(t,e):t.setAttribute(e,String(n));}function create(t,e,n){const i=document.createElement(t);return e&&(isString$1(e)?addClass(i,e):setAttribute(i,e)),n&&append(n,i),i}function style(t,e,n){if(isUndefined(n))return getComputedStyle(t)[e];if(!isNull(n)){const{style:i}=t;n=`${n}`,i[e]!==n&&(i[e]=n);}}function display(t,e){style(t,"display",e);}function focus(t){t.setActive&&t.setActive()||t.focus({preventScroll:!0});}function getAttribute$1(t,e){return t.getAttribute(e)}function hasClass(t,e){return t&&t.classList.contains(e)}function rect(t){return t.getBoundingClientRect()}function remove(t){forEach(t,(t=>{t&&t.parentNode&&t.parentNode.removeChild(t);}));}function measure(t,e){if(isString$1(e)){const n=create("div",{style:`width: ${e}; position: absolute;`},t);e=rect(n).width,remove(n);}return e}function parseHtml(t){return child((new DOMParser).parseFromString(t,"text/html").body)}function prevent(t,e){t.preventDefault(),e&&(t.stopPropagation(),t.stopImmediatePropagation());}function query(t,e){return t&&t.querySelector(e)}function queryAll(t,e){return slice(t.querySelectorAll(e))}function removeClass(t,e){toggleClass(t,e,!1);}function unit(t){return isString$1(t)?t:t?`${t}px`:""}function assert(t,e=""){if(!t)throw new Error(`[splide] ${e}`)}function nextTick(t){setTimeout(t);}const noop$1=()=>{};function raf(t){return requestAnimationFrame(t)}const{min:min$1,max:max$1,floor:floor,ceil:ceil,abs:abs}=Math;function approximatelyEqual(t,e,n){return abs(t-e)<n}function between(t,e,n,i){const s=min$1(e,n),o=max$1(e,n);return i?s<t&&t<o:s<=t&&t<=o}function clamp(t,e,n){const i=min$1(e,n),s=max$1(e,n);return min$1(max$1(i,t),s)}function sign(t){return +(t>0)-+(t<0)}function format$1(t,e){return forEach(e,(e=>{t=t.replace("%s",`${e}`);})),t}function pad(t){return t<10?`0${t}`:`${t}`}const ids={};function uniqueId(t){return `${t}${pad(ids[t]=(ids[t]||0)+1)}`}function EventBus(){let t={};function e(e,i){n(e,((e,n)=>{const s=t[e];t[e]=s&&s.filter((t=>t._key?t._key!==i:i||t._namespace!==n));}));}function n(t,e){toArray$1(t).join(" ").split(" ").forEach((t=>{const n=t.split(".");e(n[0],n[1]);}));}return {on:function(e,i,s,o=10){n(e,((e,n)=>{t[e]=t[e]||[],push(t[e],{_event:e,_callback:i,_namespace:n,_priority:o,_key:s}).sort(((t,e)=>t._priority-e._priority));}));},off:e,offBy:function(n){forOwn(t,((t,i)=>{e(i,n);}));},emit:function(e){(t[e]||[]).forEach((t=>{t._callback.apply(t,slice(arguments,1));}));},destroy:function(){t={};}}}function EventInterface(t){const{event:e}=t,n={};let i=[];function s(t,e,n){o(t,e,((t,e)=>{i=i.filter((i=>!!(i[0]!==t||i[1]!==e||n&&i[2]!==n)||(t.removeEventListener(e,i[2],i[3]),!1)));}));}function o(t,e,n){forEach(t,(t=>{t&&e.split(" ").forEach(n.bind(null,t));}));}function r(){i=i.filter((t=>s(t[0],t[1]))),e.offBy(n);}return e.on("destroy",r,n),{on:function(t,i,s){e.on(t,i,n,s);},off:function(t){e.off(t,n);},emit:e.emit,bind:function(t,e,n,s){o(t,e,((t,e)=>{i.push([t,e,n,s]),t.addEventListener(e,n,s);}));},unbind:s,destroy:r}}function RequestInterval(t,e,n,i){const{now:s}=Date;let o,r,c=0,l=!0,a=0;function u(){if(!l){const r=s()-o;if(r>=t?(c=1,o=s()):c=r/t,n&&n(c),1===c&&(e(),i&&++a>=i))return d();raf(u);}}function d(){l=!0;}function f(){cancelAnimationFrame(r),c=0,r=0,l=!0;}return {start:function(e){!e&&f(),o=s()-(e?c*t:0),l=!1,raf(u);},rewind:function(){o=s(),c=0,n&&n(c);},pause:d,cancel:f,set:function(e){t=e;},isPaused:function(){return l}}}function State(t){let e=t;return {set:function(t){e=t;},is:function(t){return includes(toArray$1(t),e)}}}function Throttle(t,e){let n;return function(){n||(n=RequestInterval(e||0,(()=>{t.apply(this,arguments),n=null;}),null,1),n.start());}}function Options(t,e,n){const i=Throttle(l);let s,o,r;function c(t){t&&removeEventListener("resize",i);}function l(){const e=find(o,(t=>t[1].matches))||[];e[0]!==r&&function(e){const i=n.breakpoints[e]||s;i.destroy?(t.options=s,t.destroy("completely"===i.destroy)):(t.state.is(5)&&(c(!0),t.mount()),t.options=i);}(r=e[0]);}return {setup:function(){try{merge(n,JSON.parse(getAttribute$1(t.root,"data-splide")));}catch(t){assert(!1,t.message);}s=merge({},n);const{breakpoints:e}=n;if(e){const t="min"===n.mediaQuery;o=Object.keys(e).sort(((e,n)=>t?+n-+e:+e-+n)).map((e=>[e,matchMedia(`(${t?"min":"max"}-width:${e}px)`)])),l();}},mount:function(){o&&addEventListener("resize",i);},destroy:c}}const RTL="rtl",TTB="ttb",ORIENTATION_MAP={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"]};function Direction(t,e,n){return {resolve:function(t,e){const{direction:i}=n;return ORIENTATION_MAP[t][i!==RTL||e?i===TTB?0:-1:1]||t},orient:function(t){return t*(n.direction===RTL?1:-1)}}}const CLASS_ROOT="splide",CLASS_SLIDE="splide__slide",CLASS_CLONE="splide__slide--clone",CLASS_CONTAINER="splide__slide__container",CLASS_ARROWS="splide__arrows",CLASS_ARROW="splide__arrow",CLASS_ARROW_PREV="splide__arrow--prev",CLASS_ARROW_NEXT="splide__arrow--next",CLASS_PAGINATION="splide__pagination",CLASS_PAGINATION_PAGE="splide__pagination__page",CLASS_SPINNER="splide__spinner",CLASS_ACTIVE="is-active",STATUS_CLASSES=[CLASS_ACTIVE,"is-visible","is-prev","is-next","is-loading"],CLASSES={slide:CLASS_SLIDE,clone:CLASS_CLONE,arrows:CLASS_ARROWS,arrow:CLASS_ARROW,prev:CLASS_ARROW_PREV,next:CLASS_ARROW_NEXT,pagination:CLASS_PAGINATION,page:CLASS_PAGINATION_PAGE,spinner:CLASS_SPINNER};function Elements(t,e,n){const{on:i}=EventInterface(t),{root:s}=t,o={},r=[];let c,l,a,u;function d(){!function(){l=child(s,".splide__slider"),a=query(s,".splide__track"),u=child(a,".splide__list"),assert(a&&u,"A track/list element is missing."),push(r,children(u,`.splide__slide:not(.${CLASS_CLONE})`));const t=h(".splide__autoplay"),e=h(".splide__arrows");assign(o,{root:s,slider:l,track:a,list:u,slides:r,arrows:e,autoplay:t,prev:query(e,".splide__arrow--prev"),next:query(e,".splide__arrow--next"),bar:query(h(".splide__progress"),".splide__progress__bar"),play:query(t,".splide__play"),pause:query(t,".splide__pause")});}(),function(){const t=s.id||uniqueId("splide");s.id=t,a.id=a.id||`${t}-track`,u.id=u.id||`${t}-list`;}(),addClass(s,c=S());}function f(){[s,a,u].forEach((t=>{removeAttribute(t,"style");})),empty(r),removeClass(s,c);}function E(){f(),d();}function p(){removeClass(s,c),addClass(s,c=S());}function h(t){return child(s,t)||child(l,t)}function S(){return [`${CLASS_ROOT}--${n.type}`,`${CLASS_ROOT}--${n.direction}`,n.drag&&`${CLASS_ROOT}--draggable`,n.isNavigation&&`${CLASS_ROOT}--nav`,CLASS_ACTIVE]}return assign(o,{setup:d,mount:function(){i("refresh",E,8),i("updated",p);},destroy:f})}const ROLE="role",ARIA_CONTROLS="aria-controls",ARIA_CURRENT="aria-current",ARIA_LABEL="aria-label",ARIA_HIDDEN="aria-hidden",TAB_INDEX="tabindex",DISABLED="disabled",ARIA_ORIENTATION="aria-orientation",ALL_ATTRIBUTES=[ROLE,ARIA_CONTROLS,ARIA_CURRENT,ARIA_LABEL,ARIA_HIDDEN,ARIA_ORIENTATION,TAB_INDEX,DISABLED],SLIDE="slide",LOOP="loop",FADE="fade";function Slide$1(t,e,n,i){const{on:s,emit:o,bind:r,destroy:c}=EventInterface(t),{Components:l,root:a,options:u}=t,{isNavigation:d,updateOnMove:f}=u,{resolve:E}=l.Direction,p=getAttribute$1(i,"style"),h=n>-1,S=child(i,`.${CLASS_CONTAINER}`),A=u.focusableNodes&&queryAll(i,u.focusableNodes);let _;function g(){const s=h?n:e,o=format$1(u.i18n.slideX,s+1),r=t.splides.map((t=>t.splide.root.id)).join(" ");setAttribute(i,ARIA_LABEL,o),setAttribute(i,ARIA_CONTROLS,r),setAttribute(i,ROLE,"menuitem"),L(C());}function T(){_||m();}function m(){if(!_){const{index:n}=t;L(C()),function(t){const e=!t&&(!C()||h);setAttribute(i,ARIA_HIDDEN,e||null),setAttribute(i,TAB_INDEX,!e&&u.slideFocus?0:null),A&&A.forEach((t=>{setAttribute(t,TAB_INDEX,e?-1:null);}));t!==hasClass(i,"is-visible")&&(toggleClass(i,"is-visible",t),o(t?"visible":"hidden",I));}(function(){if(t.is(FADE))return C();const e=rect(l.Elements.track),n=rect(i),s=E("left"),o=E("right");return floor(e[s])<=ceil(n[s])&&floor(n[o])<=ceil(e[o])}()),toggleClass(i,"is-prev",e===n-1),toggleClass(i,"is-next",e===n+1);}}function L(t){t!==hasClass(i,CLASS_ACTIVE)&&(toggleClass(i,CLASS_ACTIVE,t),d&&setAttribute(i,ARIA_CURRENT,t||null),o(t?"active":"inactive",I));}function C(){const{index:i}=t;return i===e||u.cloneStatus&&i===n}const I={index:e,slideIndex:n,slide:i,container:S,isClone:h,mount:function(){h||(i.id=`${a.id}-slide${pad(e+1)}`),r(i,"click keydown",(t=>{o("click"===t.type?"click":"slide:keydown",I,t);})),s(["refresh","repositioned","shifted","moved","scrolled"],m),s("navigation:mounted",g),f&&s("move",T);},destroy:function(){_=!0,c(),removeClass(i,STATUS_CLASSES),removeAttribute(i,ALL_ATTRIBUTES),setAttribute(i,"style",p);},update:m,style:function(t,e,n){style(n&&S||i,t,e);},isWithin:function(n,i){let s=abs(n-e);return h||!u.rewind&&!t.is(LOOP)||(s=min$1(s,t.length-s)),s<=i}};return I}function Slides(t,e,n){const{on:i,emit:s,bind:o}=EventInterface(t),{slides:r,list:c}=e.Elements,l=[];function a(){r.forEach(((t,e)=>{f(t,e,-1);}));}function u(){p((t=>{t.destroy();})),empty(l);}function d(){u(),a();}function f(e,n,i){const s=Slide$1(t,n,i,e);s.mount(),l.push(s);}function E(t){return t?h((t=>!t.isClone)):l}function p(t,e){E(e).forEach(t);}function h(t){return l.filter(isFunction$1(t)?t:e=>isString$1(t)?matches(e.slide,t):includes(toArray$1(t),e.index))}return {mount:function(){a(),i("refresh",d),i(["mounted","refresh"],(()=>{l.sort(((t,e)=>t.index-e.index));}));},destroy:u,update:function(){p((t=>{t.update();}));},register:f,get:E,getIn:function(t){const{Controller:i}=e,s=i.toIndex(t),o=i.hasFocus()?1:n.perPage;return h((t=>between(t.index,s,s+o-1)))},getAt:function(t){return h(t)[0]},add:function(t,e){forEach(t,(t=>{if(isString$1(t)&&(t=parseHtml(t)),isHTMLElement$1(t)){const i=r[e];i?before(t,i):append(c,t),addClass(t,n.classes.slide),function(t,e){const n=queryAll(t,"img");let{length:i}=n;i?n.forEach((t=>{o(t,"load error",(()=>{--i||e();}));})):e();}(t,s.bind(null,"resize"));}})),s("refresh");},remove:function(t){remove(h(t).map((t=>t.slide))),s("refresh");},forEach:p,filter:h,style:function(t,e,n){p((i=>{i.style(t,e,n);}));},getLength:function(t){return t?r.length:l.length},isEnough:function(){return l.length>n.perPage}}}function Layout(t,e,n){const{on:i,bind:s,emit:o}=EventInterface(t),{Slides:r}=e,{resolve:c}=e.Direction,{root:l,track:a,list:u}=e.Elements,{getAt:d}=r;let f,E;function p(){E=null,f=n.direction===TTB,style(l,"maxWidth",unit(n.width)),style(a,c("paddingLeft"),S(!1)),style(a,c("paddingRight"),S(!0)),h();}function h(){const t=rect(l);E&&E.width===t.width&&E.height===t.height||(style(a,"height",function(){let t="";f&&(t=A(),assert(t,"height or heightRatio is missing."),t=`calc(${t} - ${S(!1)} - ${S(!0)})`);return t}()),r.style(c("marginRight"),unit(n.gap)),r.style("width",(n.autoWidth?"":unit(n.fixedWidth)||(f?"":_()))||null),r.style("height",unit(n.fixedHeight)||(f?n.autoHeight?"":_():A())||null,!0),E=t,o("resized"));}function S(t){const{padding:e}=n,i=c(t?"right":"left");return e&&unit(e[i]||(isObject$1(e)?0:e))||"0px"}function A(){return unit(n.height||rect(u).width*n.heightRatio)}function _(){const t=unit(n.gap);return `calc((100%${t&&` + ${t}`})/${n.perPage||1}${t&&` - ${t}`})`}function g(t,e){const n=d(t);if(n){const t=rect(n.slide)[c("right")],i=rect(u)[c("left")];return abs(t-i)+(e?0:T())}return 0}function T(){const t=d(0);return t&&parseFloat(style(t.slide,c("marginRight")))||0}return {mount:function(){p(),s(window,"resize load",Throttle(o.bind(this,"resize"))),i(["updated","refresh"],p),i("resize",h);},listSize:function(){return rect(u)[c("width")]},slideSize:function(t,e){const n=d(t||0);return n?rect(n.slide)[c("width")]+(e?0:T()):0},sliderSize:function(){return g(t.length-1,!0)-g(-1,!0)},totalSize:g,getPadding:function(t){return parseFloat(style(a,c("padding"+(t?"Right":"Left"))))||0}}}function Clones(t,e,n){const{on:i,emit:s}=EventInterface(t),{Elements:o,Slides:r}=e,{resolve:c}=e.Direction,l=[];let a;function u(){(a=p())&&(!function(e){const i=r.get().slice(),{length:s}=i;if(s){for(;i.length<e;)push(i,i);push(i.slice(-e),i.slice(0,e)).forEach(((c,a)=>{const u=a<e,d=function(e,i){const s=e.cloneNode(!0);return addClass(s,n.classes.clone),s.id=`${t.root.id}-clone${pad(i+1)}`,s}(c.slide,a);u?before(d,i[0].slide):append(o.list,d),push(l,d),r.register(d,a-e+(u?0:s),c.index);}));}}(a),s("resize"));}function d(){remove(l),empty(l);}function f(){d(),u();}function E(){a<p()&&s("refresh");}function p(){let{clones:e}=n;if(t.is(LOOP)){if(!e){const i=measure(o.list,n[c("fixedWidth")]);e=(i&&ceil(rect(o.track)[c("width")]/i)||n[c("autoWidth")]&&t.length||n.perPage)*(n.drag?(n.flickMaxPages||1)+1:2);}}else e=0;return e}return {mount:function(){u(),i("refresh",f),i(["updated","resize"],E);},destroy:d}}function Move(t,e,n){const{on:i,emit:s}=EventInterface(t),{slideSize:o,getPadding:r,totalSize:c,listSize:l,sliderSize:a}=e.Layout,{resolve:u,orient:d}=e.Direction,{list:f,track:E}=e.Elements;let p;function h(){L()||(e.Scroll.cancel(),S(t.index),s("repositioned"));}function S(t){A(g(t,!0));}function A(e,n){if(!t.is(FADE)){const i=n?e:function(e){if(t.is(LOOP)){const t=d(e-T()),n=C(!1,e)&&t<0,i=C(!0,e)&&t>0;(n||i)&&(e=_(e,i));}return e}(e);f.style.transform=`translate${u("X")}(${i}px)`,e!==i&&s("shifted");}}function _(t,e){const n=t-m(e),i=a();return t-=d(i*(ceil(abs(n)/i)||1))*(e?1:-1)}function g(e,i){const s=d(c(e-1)-function(t){const{focus:e}=n;return "center"===e?(l()-o(t,!0))/2:+e*o(t)||0}(e));return i?function(e){n.trimSpace&&t.is(SLIDE)&&(e=clamp(e,0,d(a()-l())));return e}(s):s}function T(){const t=u("left");return rect(f)[t]-rect(E)[t]+d(r(!1))}function m(t){return g(t?e.Controller.getEnd():0,!!n.trimSpace)}function L(){return t.state.is(4)&&n.waitForTransition}function C(t,e){e=isUndefined(e)?T():e;const n=!0!==t&&d(e)<d(m(!1)),i=!1!==t&&d(e)>d(m(!0));return n||i}return {mount:function(){p=e.Transition,i(["mounted","resized","updated","refresh"],h);},destroy:function(){removeAttribute(f,"style");},move:function(i,o,r,c){if(!L()){const{set:l}=t.state,a=T();i!==o&&(p.cancel(),A(_(a,i>o),!0)),l(4),s("move",o,r,i),p.start(o,(()=>{l(3),s("moved",o,r,i),"move"===n.trimSpace&&i!==r&&a===T()?e.Controller.go(i>r?">":"<",!1,c):c&&c();}));}},jump:S,translate:A,shift:_,cancel:function(){A(T()),p.cancel();},toIndex:function(t){const n=e.Slides.get();let i=0,s=1/0;for(let e=0;e<n.length;e++){const o=n[e].index,r=abs(g(o,!0)-t);if(!(r<=s))break;s=r,i=o;}return i},toPosition:g,getPosition:T,getLimit:m,isBusy:L,exceededLimit:C}}function Controller(t,e,n){const{on:i}=EventInterface(t),{Move:s}=e,{getPosition:o,getLimit:r}=s,{isEnough:c,getLength:l}=e.Slides,a=t.is(LOOP),u=t.is(SLIDE);let d,f,E,p=n.start||0,h=p;function S(){d=l(!0),f=n.perMove,E=n.perPage,p=clamp(p,0,d-1);}function A(t,n,i,o,r){const c=n?t:O(t);e.Scroll.scroll(n||i?s.toPosition(c,!0):t,o,(()=>{y(s.toIndex(s.getPosition())),r&&r();}));}function _(t){return T(!1,t)}function g(t){return T(!0,t)}function T(t,e){const n=f||(N()?1:E),i=m(p+n*(t?-1:1),p);return -1===i&&u&&!approximatelyEqual(o(),r(!t),1)?t?0:L():e?i:C(i)}function m(t,e,i){if(c()){const s=L();t<0||t>s?t=between(0,t,e,!0)||between(s,e,t,!0)?I(R(t)):a?f||N()?t:t<0?-(d%E||E):d:n.rewind?t<0?s:0:-1:i||t===e||(t=f?t:I(R(e)+(t<e?-1:1)));}else t=-1;return t}function L(){let t=d-E;return (N()||a&&f)&&(t=d-1),max$1(t,0)}function C(t){return a?c()?t%d+(t<0?d:0):-1:t}function I(t){return clamp(N()?t:E*t,0,L())}function R(t){return N()||(t=between(t,d-E,d-1)?d-1:t,t=floor(t/E)),t}function O(t){const e=s.toIndex(t);return u?clamp(e,0,L()):e}function y(t){t!==p&&(h=p,p=t);}function N(){return !isUndefined(n.focus)||n.isNavigation}return {mount:function(){S(),i(["updated","refresh"],S,9);},go:function(t,e,i){const o=function(t){let e=p;if(isString$1(t)){const[,n,i]=t.match(/([+\-<>])(\d+)?/)||[];"+"===n||"-"===n?e=m(p+ +`${n}${+i||1}`,p,!0):">"===n?e=i?I(+i):_(!0):"<"===n&&(e=g(!0));}else e=a?t:clamp(t,0,L());return e}(t);if(n.useScroll)A(o,!0,!0,n.speed,i);else {const t=C(o);t>-1&&!s.isBusy()&&(e||t!==p)&&(y(t),s.move(o,t,h,i));}},scroll:A,getNext:_,getPrev:g,getAdjacent:T,getEnd:L,setIndex:y,getIndex:function(t){return t?h:p},toIndex:I,toPage:R,toDest:O,hasFocus:N}}const XML_NAME_SPACE="http://www.w3.org/2000/svg",PATH="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 Arrows(t,e,n){const{on:i,bind:s,emit:o}=EventInterface(t),{classes:r,i18n:c}=n,{Elements:l,Controller:a}=e;let u,d=l.arrows,f=l.prev,E=l.next;const p={};function h(){if(n.arrows&&(f&&E||(d=create("div",r.arrows),f=S(!0),E=S(!1),u=!0,append(d,[f,E]),before(d,child("slider"===n.arrows&&l.slider||t.root)))),f&&E)if(p.prev)display(d,!1===n.arrows?"none":"");else {const{id:t}=l.track;setAttribute(f,ARIA_CONTROLS,t),setAttribute(E,ARIA_CONTROLS,t),p.prev=f,p.next=E,function(){const{go:t}=a;i(["mounted","moved","updated","refresh","scrolled"],A),s(E,"click",(()=>{t(">",!0);})),s(f,"click",(()=>{t("<",!0);}));}(),o("arrows:mounted",f,E);}}function S(t){return parseHtml(`<button class="${r.arrow} ${t?r.prev:r.next}" type="button"><svg xmlns="${XML_NAME_SPACE}" viewBox="0 0 40 40" width="40" height="40"><path d="${n.arrowPath||PATH}" />`)}function A(){const e=t.index,n=a.getPrev(),i=a.getNext(),s=n>-1&&e<n?c.last:c.prev,r=i>-1&&e>i?c.first:c.next;f.disabled=n<0,E.disabled=i<0,setAttribute(f,ARIA_LABEL,s),setAttribute(E,ARIA_LABEL,r),o("arrows:updated",f,E,n,i);}return {arrows:p,mount:function(){h(),i("updated",h);},destroy:function(){u?remove(d):(removeAttribute(f,ALL_ATTRIBUTES),removeAttribute(E,ALL_ATTRIBUTES));}}}function Autoplay(t,e,n){const{on:i,bind:s,emit:o}=EventInterface(t),r=RequestInterval(n.interval,t.go.bind(t,">"),(function(t){const{bar:e}=l;e&&style(e,"width",100*t+"%"),o("autoplay:playing",t);})),{isPaused:c}=r,{Elements:l}=e;let a,u,d;function f(t){const e=t?"pause":"play",i=l[e];i&&(setAttribute(i,ARIA_CONTROLS,l.track.id),setAttribute(i,ARIA_LABEL,n.i18n[e]),s(i,"click",t?p:E));}function E(){c()&&e.Slides.isEnough()&&(r.start(!n.resetProgress),u=a=d=!1,o("autoplay:play"));}function p(t=!0){c()||(r.pause(),o("autoplay:pause")),d=t;}function h(){d||(a||u?p(!1):E());}function S(){const i=e.Slides.getAt(t.index);r.set(i&&+getAttribute$1(i.slide,"data-splide-interval")||n.interval);}return {mount:function(){const{autoplay:t}=n;t&&(f(!0),f(!1),function(){const{root:t}=l;n.pauseOnHover&&s(t,"mouseenter mouseleave",(t=>{a="mouseenter"===t.type,h();}));n.pauseOnFocus&&s(t,"focusin focusout",(t=>{u="focusin"===t.type,h();}));i(["move","scroll","refresh"],r.rewind),i("move",S);}(),"pause"!==t&&E());},destroy:r.cancel,play:E,pause:p,isPaused:c}}function Cover(t,e,n){const{on:i}=EventInterface(t);function s(t){e.Slides.forEach((e=>{const n=child(e.container||e.slide,"img");n&&n.src&&o(t,n,e);}));}function o(t,e,n){n.style("background",t?`center/cover no-repeat url("${e.src}")`:"",!0),display(e,t?"none":"");}return {mount:function(){n.cover&&(i("lazyload:loaded",((t,e)=>{o(!0,t,e);})),i(["mounted","updated","refresh"],s.bind(null,!0)));},destroy:function(){s(!1);}}}function Scroll(t,e,n){const{on:i,emit:s}=EventInterface(t),{Move:o}=e,{getPosition:r,getLimit:c,exceededLimit:l}=o;let a,u;function d(e,i,p,h){const S=r();let A=1;var _;i=i||(_=abs(e-S),max$1(_/1.5,800)),u=p,E(),a=RequestInterval(i,f,(i=>{const s=r(),a=(S+(e-S)*function(t){const{easingFunc:e}=n;return e?e(t):1-Math.pow(1-t,4)}(i)-r())*A;var u;o.translate(s+a),t.is(SLIDE)&&!h&&l()&&(A*=.6,abs(a)<10&&(u=l(!1),d(c(!u),600,null,!0)));}),1),s("scroll"),a.start();}function f(){const e=r(),n=o.toIndex(e);between(n,0,t.length-1)||o.translate(o.shift(e,n>0),!0),u&&u(),s("scrolled");}function E(){a&&a.cancel();}function p(){a&&!a.isPaused()&&(E(),f());}return {mount:function(){i("move",E),i(["updated","refresh"],p);},destroy:E,scroll:d,cancel:p}}const SCROLL_LISTENER_OPTIONS={passive:!1,capture:!0},POINTER_DOWN_EVENTS="touchstart mousedown",POINTER_MOVE_EVENTS="touchmove mousemove",POINTER_UP_EVENTS="touchend touchcancel mouseup";function Drag(t,e,n){const{on:i,emit:s,bind:o,unbind:r}=EventInterface(t),{Move:c,Scroll:l,Controller:a}=e,{track:u}=e.Elements,{resolve:d,orient:f}=e.Direction,{getPosition:E,exceededLimit:p}=c;let h,S,A,_,g,T,m,L,C,I=!1;function R(){const{drag:t}=n;$(!t),g="free"===t;}function O(t){if(!L){const{noDrag:e}=n,i=w(t),s=!e||!matches(t.target,e);m=!1,!s||!i&&t.button||(c.isBusy()?prevent(t,!0):(C=i?u:window,A=null,_=null,o(C,POINTER_MOVE_EVENTS,y,SCROLL_LISTENER_OPTIONS),o(C,POINTER_UP_EVENTS,N,SCROLL_LISTENER_OPTIONS),c.cancel(),l.cancel(),v(t)));}}function y(e){if(_||s("drag"),_=e,e.cancelable){const i=P(e)-P(S);if(T){c.translate(h+function(e){return e/(I&&t.is(SLIDE)?5:1)}(i));const n=V(e)-V(S)>200,o=I!==(I=p());(n||o)&&v(e),s("dragging"),m=!0,prevent(e);}else {let{dragMinThreshold:t}=n;t=isObject$1(t)?t:{mouse:0,touch:+t||10},T=abs(i)>(w(e)?t.touch:t.mouse),D()&&prevent(e);}}}function N(i){r(C,POINTER_MOVE_EVENTS,y),r(C,POINTER_UP_EVENTS,N);const{index:o}=t;if(_){if(T||i.cancelable&&D()){const s=function(e){if(t.is(LOOP)||!I){const t=S===_&&A||S,n=P(_)-P(t),i=V(e)-V(t),s=V(e)-V(_)<200;if(i&&s)return n/i}return 0}(i),r=function(t){return E()+sign(t)*min$1(abs(t)*(n.flickPower||600),g?1/0:e.Layout.listSize()*(n.flickMaxPages||1))}(s);g?a.scroll(r):t.is(FADE)?a.go(o+f(sign(s))):a.go(a.toDest(r),!0),prevent(i);}s("dragged");}else g||E()===c.toPosition(o)||a.go(o,!0);T=!1;}function v(t){A=S,S=t,h=E();}function b(t){!L&&m&&prevent(t,!0);}function D(){return abs(P(_)-P(S))>abs(P(_,!0)-P(S,!0))}function P(t,e){return (w(t)?t.touches[0]:t)[`page${d(e?"Y":"X")}`]}function V(t){return t.timeStamp}function w(t){return "undefined"!=typeof TouchEvent&&t instanceof TouchEvent}function $(t){L=t;}return {mount:function(){o(u,POINTER_MOVE_EVENTS,noop$1,SCROLL_LISTENER_OPTIONS),o(u,POINTER_UP_EVENTS,noop$1,SCROLL_LISTENER_OPTIONS),o(u,POINTER_DOWN_EVENTS,O,SCROLL_LISTENER_OPTIONS),o(u,"click",b,{capture:!0}),o(u,"dragstart",prevent),i(["mounted","updated"],R);},disable:$,isDragging:function(){return T}}}const IE_ARROW_KEYS=["Left","Right","Up","Down"];function Keyboard(t,e,n){const{on:i,bind:s,unbind:o}=EventInterface(t),{root:r}=t,{resolve:c}=e.Direction;let l,a;function u(){const{keyboard:t}=n;t&&("focused"===t?(l=r,setAttribute(r,TAB_INDEX,0)):l=window,s(l,"keydown",p));}function d(){o(l,"keydown"),isHTMLElement$1(l)&&removeAttribute(l,TAB_INDEX);}function f(){const t=a;a=!0,nextTick((()=>{a=t;}));}function E(){d(),u();}function p(e){if(!a){const{key:n}=e,i=includes(IE_ARROW_KEYS,n)?`Arrow${n}`:n;i===c("ArrowLeft")?t.go("<"):i===c("ArrowRight")&&t.go(">");}}return {mount:function(){u(),i("updated",E),i("move",f);},destroy:d,disable:function(t){a=t;}}}const SRCSET_DATA_ATTRIBUTE="data-splide-lazy-srcset",IMAGE_SELECTOR="[data-splide-lazy], [data-splide-lazy-srcset]";function LazyLoad(t,e,n){const{on:i,off:s,bind:o,emit:r}=EventInterface(t),c="sequential"===n.lazyLoad;let l=[],a=0;function u(){f(),d();}function d(){e.Slides.forEach((t=>{queryAll(t.slide,IMAGE_SELECTOR).forEach((e=>{const i=getAttribute$1(e,"data-splide-lazy"),s=getAttribute$1(e,SRCSET_DATA_ATTRIBUTE);if(i!==e.src||s!==e.srcset){const o=n.classes.spinner,r=e.parentElement,c=child(r,`.${o}`)||create("span",o,r);setAttribute(c,ROLE,"presentation"),l.push({_img:e,_Slide:t,src:i,srcset:s,_spinner:c}),!e.src&&display(e,"none");}}));})),c&&h();}function f(){a=0,l=[];}function E(){l=l.filter((e=>{const i=n.perPage*((n.preloadPages||1)+1)-1;return !e._Slide.isWithin(t.index,i)||p(e)})),l.length||s("moved");}function p(t){const{_img:e}=t;addClass(t._Slide.slide,"is-loading"),o(e,"load error",(e=>{!function(t,e){const{_Slide:n}=t;removeClass(n.slide,"is-loading"),e||(remove(t._spinner),display(t._img,""),r("lazyload:loaded",t._img,n),r("resize"));c&&h();}(t,"error"===e.type);})),["srcset","src"].forEach((n=>{t[n]&&(setAttribute(e,n,t[n]),removeAttribute(e,"src"===n?"data-splide-lazy":SRCSET_DATA_ATTRIBUTE));}));}function h(){a<l.length&&p(l[a++]);}return {mount:function(){n.lazyLoad&&(d(),i("refresh",u),c||i(["mounted","refresh","moved","scrolled"],E));},destroy:f}}function Pagination(t,e,n){const{on:i,emit:s,bind:o,unbind:r}=EventInterface(t),{Slides:c,Elements:l,Controller:a}=e,{hasFocus:u,getIndex:d}=a,f=[];let E;function p(){h(),n.pagination&&c.isEnough()&&(!function(){const{length:e}=t,{classes:i,i18n:s,perPage:r}=n,a="slider"===n.pagination&&l.slider||l.root,d=u()?e:ceil(e/r);E=create("ul",i.pagination,a);for(let t=0;t<d;t++){const e=create("li",null,E),n=create("button",{class:i.page,type:"button"},e),l=c.getIn(t).map((t=>t.slide.id)),a=!u()&&r>1?s.pageX:s.slideX;o(n,"click",S.bind(null,t)),setAttribute(n,ARIA_CONTROLS,l.join(" ")),setAttribute(n,ARIA_LABEL,format$1(a,t+1)),f.push({li:e,button:n,page:t});}}(),s("pagination:mounted",{list:E,items:f},A(t.index)),_());}function h(){E&&(remove(E),f.forEach((t=>{r(t.button,"click");})),empty(f),E=null);}function S(t){a.go(`>${t}`,!0,(()=>{const e=c.getAt(a.toIndex(t));e&&focus(e.slide);}));}function A(t){return f[a.toPage(t)]}function _(){const t=A(d(!0)),e=A(d());t&&(removeClass(t.button,CLASS_ACTIVE),removeAttribute(t.button,ARIA_CURRENT)),e&&(addClass(e.button,CLASS_ACTIVE),setAttribute(e.button,ARIA_CURRENT,!0)),s("pagination:updated",{list:E,items:f},t,e);}return {items:f,mount:function(){p(),i(["updated","refresh"],p),i(["move","scrolled"],_);},destroy:h,getAt:A,update:_}}const TRIGGER_KEYS=[" ","Enter","Spacebar"];function Sync(t,e,n){const{list:i}=e.Elements,s=[];function o(){t.splides.forEach((e=>{var n;!e.isParent&&(n=e.splide,[t,n].forEach((e=>{const i=EventInterface(e),o=e===t?n:t;i.on("move",((t,e,n)=>{o.go(o.is(LOOP)?n:t);})),s.push(i);})));})),n.isNavigation&&function(){const e=EventInterface(t),{on:n}=e;n("click",l),n("slide:keydown",a),n(["mounted","updated"],c),setAttribute(i,ROLE,"menu"),s.push(e),e.emit("navigation:mounted",t.splides);}();}function r(){removeAttribute(i,ALL_ATTRIBUTES),s.forEach((t=>{t.destroy();})),empty(s);}function c(){setAttribute(i,ARIA_ORIENTATION,n.direction!==TTB?"horizontal":null);}function l(e){t.go(e.index);}function a(t,e){includes(TRIGGER_KEYS,e.key)&&(l(t),prevent(e));}return {mount:o,destroy:r,remount:function(){r(),o();}}}function Wheel(t,e,n){const{bind:i}=EventInterface(t);function s(i){if(i.cancelable){const{deltaY:s}=i;if(s){const o=s<0;t.go(o?"<":">"),function(i){return !n.releaseWheel||t.state.is(4)||-1!==e.Controller.getAdjacent(i)}(o)&&prevent(i);}}}return {mount:function(){n.wheel&&i(e.Elements.track,"wheel",s,SCROLL_LISTENER_OPTIONS);}}}var ComponentConstructors=Object.freeze({__proto__:null,Options:Options,Direction:Direction,Elements:Elements,Slides:Slides,Layout:Layout,Clones:Clones,Move:Move,Controller:Controller,Arrows:Arrows,Autoplay:Autoplay,Cover:Cover,Scroll:Scroll,Drag:Drag,Keyboard:Keyboard,LazyLoad:LazyLoad,Pagination:Pagination,Sync:Sync,Wheel:Wheel});const 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"},DEFAULTS={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:CLASSES,i18n:I18N};function Fade(t,e,n){const{on:i}=EventInterface(t);return {mount:function(){i(["mounted","refresh"],(()=>{nextTick((()=>{e.Slides.style("transition",`opacity ${n.speed}ms ${n.easing}`);}));}));},start:function(t,n){const{track:i}=e.Elements;style(i,"height",unit(rect(i).height)),nextTick((()=>{n(),style(i,"height","");}));},cancel:noop$1}}function Slide(t,e,n){const{bind:i}=EventInterface(t),{Move:s,Controller:o}=e,{list:r}=e.Elements;let c;function l(){a("");}function a(t){style(r,"transition",t);}return {mount:function(){i(r,"transitionend",(t=>{t.target===r&&c&&(l(),c());}));},start:function(e,i){const r=s.toPosition(e,!0),l=s.getPosition(),u=function(e){const{rewindSpeed:i}=n;if(t.is(SLIDE)&&i){const t=o.getIndex(!0),n=o.getEnd();if(0===t&&e>=n||t>=n&&0===e)return i}return n.speed}(e);abs(r-l)>=1&&u>=1?(a(`transform ${u}ms ${n.easing}`),s.translate(r,!0),c=i):(s.jump(e),i());},cancel:l}}const _Splide=class{constructor(t,e){this.event=EventBus(),this.Components={},this.state=State(1),this.splides=[],this._options={},this._Extensions={};const n=isString$1(t)?query(document,t):t;assert(n,`${n} is invalid.`),this.root=n,merge(DEFAULTS,_Splide.defaults),merge(merge(this._options,DEFAULTS),e||{});}mount(t,e){const{state:n,Components:i}=this;assert(n.is([1,5]),"Already mounted!"),n.set(1),this._Components=i,this._Transition=e||this._Transition||(this.is(FADE)?Fade:Slide),this._Extensions=t||this._Extensions;return forOwn(assign({},ComponentConstructors,this._Extensions,{Transition:this._Transition}),((t,e)=>{const n=t(this,i,this._options);i[e]=n,n.setup&&n.setup();})),forOwn(i,(t=>{t.mount&&t.mount();})),this.emit("mounted"),addClass(this.root,"is-initialized"),n.set(3),this.emit("ready"),this}sync(t){return this.splides.push({splide:t}),t.splides.push({splide:this,isParent:!0}),this.state.is(3)&&(this._Components.Sync.remount(),t.Components.Sync.remount()),this}go(t){return this._Components.Controller.go(t),this}on(t,e){return this.event.on(t,e,null,20),this}off(t){return this.event.off(t),this}emit(t){return this.event.emit(t,...slice(arguments,1)),this}add(t,e){return this._Components.Slides.add(t,e),this}remove(t){return this._Components.Slides.remove(t),this}is(t){return this._options.type===t}refresh(){return this.emit("refresh"),this}destroy(t=!0){const{event:e,state:n}=this;return n.is(1)?e.on("ready",this.destroy.bind(this,t),this):(forOwn(this._Components,(e=>{e.destroy&&e.destroy(t);}),!0),e.emit("destroy"),e.destroy(),t&&empty(this.splides),n.set(5)),this}get options(){return this._options}set options(t){const{_options:e}=this;merge(e,t),this.state.is(1)||this.emit("updated",e);}get length(){return this._Components.Slides.getLength(!0)}get index(){return this._Components.Controller.getIndex()}};let Splide=_Splide;Splide.defaults={},Splide.STATES=STATES;
40
+ */const STATES={CREATED:1,MOUNTED:2,IDLE:3,MOVING:4,DESTROYED:5};function empty(t){t.length=0;}function isObject$3(t){return !isNull(t)&&"object"==typeof t}function isArray$1(t){return Array.isArray(t)}function isFunction$2(t){return "function"==typeof t}function isString$1(t){return "string"==typeof t}function isUndefined(t){return void 0===t}function isNull(t){return null===t}function isHTMLElement$1(t){return t instanceof HTMLElement}function toArray$1(t){return isArray$1(t)?t:[t]}function forEach(t,e){toArray$1(t).forEach(e);}function includes(t,e){return t.indexOf(e)>-1}function push(t,e){return t.push(...toArray$1(e)),t}const arrayProto=Array.prototype;function slice$1(t,e,n){return arrayProto.slice.call(t,e,n)}function find$2(t,e){return slice$1(t).filter(e)[0]}function toggleClass$1(t,e,n){t&&forEach(e,(e=>{e&&t.classList[n?"add":"remove"](e);}));}function addClass$1(t,e){toggleClass$1(t,isString$1(e)?e.split(" "):e,!0);}function append(t,e){forEach(e,t.appendChild.bind(t));}function before(t,e){forEach(t,(t=>{const n=e.parentNode;n&&n.insertBefore(t,e);}));}function matches(t,e){return isHTMLElement$1(t)&&(t.msMatchesSelector||t.matches).call(t,e)}function children(t,e){return t?slice$1(t.children).filter((t=>matches(t,e))):[]}function child(t,e){return e?children(t,e)[0]:t.firstElementChild}function forOwn(t,e,n){if(t){let i=Object.keys(t);i=n?i.reverse():i;for(let n=0;n<i.length;n++){const s=i[n];if("__proto__"!==s&&!1===e(t[s],s))break}}return t}function assign$1(t){return slice$1(arguments,1).forEach((e=>{forOwn(e,((n,i)=>{t[i]=e[i];}));})),t}function merge$3(t,e){return forOwn(e,((e,n)=>{isArray$1(e)?t[n]=e.slice():isObject$3(e)?t[n]=merge$3(isObject$3(t[n])?t[n]:{},e):t[n]=e;})),t}function removeAttribute$1(t,e){t&&forEach(e,(e=>{t.removeAttribute(e);}));}function setAttribute$1(t,e,n){isObject$3(e)?forOwn(e,((e,n)=>{setAttribute$1(t,n,e);})):isNull(n)?removeAttribute$1(t,e):t.setAttribute(e,String(n));}function create(t,e,n){const i=document.createElement(t);return e&&(isString$1(e)?addClass$1(i,e):setAttribute$1(i,e)),n&&append(n,i),i}function style(t,e,n){if(isUndefined(n))return getComputedStyle(t)[e];if(!isNull(n)){const{style:i}=t;n=`${n}`,i[e]!==n&&(i[e]=n);}}function display(t,e){style(t,"display",e);}function focus(t){t.setActive&&t.setActive()||t.focus({preventScroll:!0});}function getAttribute$2(t,e){return t.getAttribute(e)}function hasClass$1(t,e){return t&&t.classList.contains(e)}function rect(t){return t.getBoundingClientRect()}function remove(t){forEach(t,(t=>{t&&t.parentNode&&t.parentNode.removeChild(t);}));}function measure(t,e){if(isString$1(e)){const n=create("div",{style:`width: ${e}; position: absolute;`},t);e=rect(n).width,remove(n);}return e}function parseHtml(t){return child((new DOMParser).parseFromString(t,"text/html").body)}function prevent(t,e){t.preventDefault(),e&&(t.stopPropagation(),t.stopImmediatePropagation());}function query(t,e){return t&&t.querySelector(e)}function queryAll(t,e){return slice$1(t.querySelectorAll(e))}function removeClass$1(t,e){toggleClass$1(t,e,!1);}function unit(t){return isString$1(t)?t:t?`${t}px`:""}function assert(t,e=""){if(!t)throw new Error(`[splide] ${e}`)}function nextTick(t){setTimeout(t);}const noop$3=()=>{};function raf(t){return requestAnimationFrame(t)}const{min:min$1,max:max$1,floor:floor,ceil:ceil,abs:abs}=Math;function approximatelyEqual(t,e,n){return abs(t-e)<n}function between(t,e,n,i){const s=min$1(e,n),o=max$1(e,n);return i?s<t&&t<o:s<=t&&t<=o}function clamp$1(t,e,n){const i=min$1(e,n),s=max$1(e,n);return min$1(max$1(i,t),s)}function sign(t){return +(t>0)-+(t<0)}function format$1(t,e){return forEach(e,(e=>{t=t.replace("%s",`${e}`);})),t}function pad(t){return t<10?`0${t}`:`${t}`}const ids={};function uniqueId(t){return `${t}${pad(ids[t]=(ids[t]||0)+1)}`}function EventBus(){let t={};function e(e,i){n(e,((e,n)=>{const s=t[e];t[e]=s&&s.filter((t=>t._key?t._key!==i:i||t._namespace!==n));}));}function n(t,e){toArray$1(t).join(" ").split(" ").forEach((t=>{const n=t.split(".");e(n[0],n[1]);}));}return {on:function(e,i,s,o=10){n(e,((e,n)=>{t[e]=t[e]||[],push(t[e],{_event:e,_callback:i,_namespace:n,_priority:o,_key:s}).sort(((t,e)=>t._priority-e._priority));}));},off:e,offBy:function(n){forOwn(t,((t,i)=>{e(i,n);}));},emit:function(e){(t[e]||[]).forEach((t=>{t._callback.apply(t,slice$1(arguments,1));}));},destroy:function(){t={};}}}function EventInterface(t){const{event:e}=t,n={};let i=[];function s(t,e,n){o(t,e,((t,e)=>{i=i.filter((i=>!!(i[0]!==t||i[1]!==e||n&&i[2]!==n)||(t.removeEventListener(e,i[2],i[3]),!1)));}));}function o(t,e,n){forEach(t,(t=>{t&&e.split(" ").forEach(n.bind(null,t));}));}function r(){i=i.filter((t=>s(t[0],t[1]))),e.offBy(n);}return e.on("destroy",r,n),{on:function(t,i,s){e.on(t,i,n,s);},off:function(t){e.off(t,n);},emit:e.emit,bind:function(t,e,n,s){o(t,e,((t,e)=>{i.push([t,e,n,s]),t.addEventListener(e,n,s);}));},unbind:s,destroy:r}}function RequestInterval(t,e,n,i){const{now:s}=Date;let o,r,c=0,l=!0,a=0;function u(){if(!l){const r=s()-o;if(r>=t?(c=1,o=s()):c=r/t,n&&n(c),1===c&&(e(),i&&++a>=i))return d();raf(u);}}function d(){l=!0;}function f(){cancelAnimationFrame(r),c=0,r=0,l=!0;}return {start:function(e){!e&&f(),o=s()-(e?c*t:0),l=!1,raf(u);},rewind:function(){o=s(),c=0,n&&n(c);},pause:d,cancel:f,set:function(e){t=e;},isPaused:function(){return l}}}function State(t){let e=t;return {set:function(t){e=t;},is:function(t){return includes(toArray$1(t),e)}}}function Throttle(t,e){let n;return function(){n||(n=RequestInterval(e||0,(()=>{t.apply(this,arguments),n=null;}),null,1),n.start());}}function Options(t,e,n){const i=Throttle(l);let s,o,r;function c(t){t&&removeEventListener("resize",i);}function l(){const e=find$2(o,(t=>t[1].matches))||[];e[0]!==r&&function(e){const i=n.breakpoints[e]||s;i.destroy?(t.options=s,t.destroy("completely"===i.destroy)):(t.state.is(5)&&(c(!0),t.mount()),t.options=i);}(r=e[0]);}return {setup:function(){try{merge$3(n,JSON.parse(getAttribute$2(t.root,"data-splide")));}catch(t){assert(!1,t.message);}s=merge$3({},n);const{breakpoints:e}=n;if(e){const t="min"===n.mediaQuery;o=Object.keys(e).sort(((e,n)=>t?+n-+e:+e-+n)).map((e=>[e,matchMedia(`(${t?"min":"max"}-width:${e}px)`)])),l();}},mount:function(){o&&addEventListener("resize",i);},destroy:c}}const RTL="rtl",TTB="ttb",ORIENTATION_MAP={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"]};function Direction(t,e,n){return {resolve:function(t,e){const{direction:i}=n;return ORIENTATION_MAP[t][i!==RTL||e?i===TTB?0:-1:1]||t},orient:function(t){return t*(n.direction===RTL?1:-1)}}}const CLASS_ROOT="splide",CLASS_SLIDE="splide__slide",CLASS_CLONE="splide__slide--clone",CLASS_CONTAINER="splide__slide__container",CLASS_ARROWS="splide__arrows",CLASS_ARROW="splide__arrow",CLASS_ARROW_PREV="splide__arrow--prev",CLASS_ARROW_NEXT="splide__arrow--next",CLASS_PAGINATION="splide__pagination",CLASS_PAGINATION_PAGE="splide__pagination__page",CLASS_SPINNER="splide__spinner",CLASS_ACTIVE="is-active",STATUS_CLASSES=[CLASS_ACTIVE,"is-visible","is-prev","is-next","is-loading"],CLASSES={slide:CLASS_SLIDE,clone:CLASS_CLONE,arrows:CLASS_ARROWS,arrow:CLASS_ARROW,prev:CLASS_ARROW_PREV,next:CLASS_ARROW_NEXT,pagination:CLASS_PAGINATION,page:CLASS_PAGINATION_PAGE,spinner:CLASS_SPINNER};function Elements(t,e,n){const{on:i}=EventInterface(t),{root:s}=t,o={},r=[];let c,l,a,u;function d(){!function(){l=child(s,".splide__slider"),a=query(s,".splide__track"),u=child(a,".splide__list"),assert(a&&u,"A track/list element is missing."),push(r,children(u,`.splide__slide:not(.${CLASS_CLONE})`));const t=h(".splide__autoplay"),e=h(".splide__arrows");assign$1(o,{root:s,slider:l,track:a,list:u,slides:r,arrows:e,autoplay:t,prev:query(e,".splide__arrow--prev"),next:query(e,".splide__arrow--next"),bar:query(h(".splide__progress"),".splide__progress__bar"),play:query(t,".splide__play"),pause:query(t,".splide__pause")});}(),function(){const t=s.id||uniqueId("splide");s.id=t,a.id=a.id||`${t}-track`,u.id=u.id||`${t}-list`;}(),addClass$1(s,c=S());}function f(){[s,a,u].forEach((t=>{removeAttribute$1(t,"style");})),empty(r),removeClass$1(s,c);}function E(){f(),d();}function p(){removeClass$1(s,c),addClass$1(s,c=S());}function h(t){return child(s,t)||child(l,t)}function S(){return [`${CLASS_ROOT}--${n.type}`,`${CLASS_ROOT}--${n.direction}`,n.drag&&`${CLASS_ROOT}--draggable`,n.isNavigation&&`${CLASS_ROOT}--nav`,CLASS_ACTIVE]}return assign$1(o,{setup:d,mount:function(){i("refresh",E,8),i("updated",p);},destroy:f})}const ROLE="role",ARIA_CONTROLS="aria-controls",ARIA_CURRENT="aria-current",ARIA_LABEL="aria-label",ARIA_HIDDEN="aria-hidden",TAB_INDEX="tabindex",DISABLED="disabled",ARIA_ORIENTATION="aria-orientation",ALL_ATTRIBUTES=[ROLE,ARIA_CONTROLS,ARIA_CURRENT,ARIA_LABEL,ARIA_HIDDEN,ARIA_ORIENTATION,TAB_INDEX,DISABLED],SLIDE="slide",LOOP="loop",FADE="fade";function Slide$1(t,e,n,i){const{on:s,emit:o,bind:r,destroy:c}=EventInterface(t),{Components:l,root:a,options:u}=t,{isNavigation:d,updateOnMove:f}=u,{resolve:E}=l.Direction,p=getAttribute$2(i,"style"),h=n>-1,S=child(i,`.${CLASS_CONTAINER}`),A=u.focusableNodes&&queryAll(i,u.focusableNodes);let _;function g(){const s=h?n:e,o=format$1(u.i18n.slideX,s+1),r=t.splides.map((t=>t.splide.root.id)).join(" ");setAttribute$1(i,ARIA_LABEL,o),setAttribute$1(i,ARIA_CONTROLS,r),setAttribute$1(i,ROLE,"menuitem"),L(C());}function T(){_||m();}function m(){if(!_){const{index:n}=t;L(C()),function(t){const e=!t&&(!C()||h);setAttribute$1(i,ARIA_HIDDEN,e||null),setAttribute$1(i,TAB_INDEX,!e&&u.slideFocus?0:null),A&&A.forEach((t=>{setAttribute$1(t,TAB_INDEX,e?-1:null);}));t!==hasClass$1(i,"is-visible")&&(toggleClass$1(i,"is-visible",t),o(t?"visible":"hidden",I));}(function(){if(t.is(FADE))return C();const e=rect(l.Elements.track),n=rect(i),s=E("left"),o=E("right");return floor(e[s])<=ceil(n[s])&&floor(n[o])<=ceil(e[o])}()),toggleClass$1(i,"is-prev",e===n-1),toggleClass$1(i,"is-next",e===n+1);}}function L(t){t!==hasClass$1(i,CLASS_ACTIVE)&&(toggleClass$1(i,CLASS_ACTIVE,t),d&&setAttribute$1(i,ARIA_CURRENT,t||null),o(t?"active":"inactive",I));}function C(){const{index:i}=t;return i===e||u.cloneStatus&&i===n}const I={index:e,slideIndex:n,slide:i,container:S,isClone:h,mount:function(){h||(i.id=`${a.id}-slide${pad(e+1)}`),r(i,"click keydown",(t=>{o("click"===t.type?"click":"slide:keydown",I,t);})),s(["refresh","repositioned","shifted","moved","scrolled"],m),s("navigation:mounted",g),f&&s("move",T);},destroy:function(){_=!0,c(),removeClass$1(i,STATUS_CLASSES),removeAttribute$1(i,ALL_ATTRIBUTES),setAttribute$1(i,"style",p);},update:m,style:function(t,e,n){style(n&&S||i,t,e);},isWithin:function(n,i){let s=abs(n-e);return h||!u.rewind&&!t.is(LOOP)||(s=min$1(s,t.length-s)),s<=i}};return I}function Slides(t,e,n){const{on:i,emit:s,bind:o}=EventInterface(t),{slides:r,list:c}=e.Elements,l=[];function a(){r.forEach(((t,e)=>{f(t,e,-1);}));}function u(){p((t=>{t.destroy();})),empty(l);}function d(){u(),a();}function f(e,n,i){const s=Slide$1(t,n,i,e);s.mount(),l.push(s);}function E(t){return t?h((t=>!t.isClone)):l}function p(t,e){E(e).forEach(t);}function h(t){return l.filter(isFunction$2(t)?t:e=>isString$1(t)?matches(e.slide,t):includes(toArray$1(t),e.index))}return {mount:function(){a(),i("refresh",d),i(["mounted","refresh"],(()=>{l.sort(((t,e)=>t.index-e.index));}));},destroy:u,update:function(){p((t=>{t.update();}));},register:f,get:E,getIn:function(t){const{Controller:i}=e,s=i.toIndex(t),o=i.hasFocus()?1:n.perPage;return h((t=>between(t.index,s,s+o-1)))},getAt:function(t){return h(t)[0]},add:function(t,e){forEach(t,(t=>{if(isString$1(t)&&(t=parseHtml(t)),isHTMLElement$1(t)){const i=r[e];i?before(t,i):append(c,t),addClass$1(t,n.classes.slide),function(t,e){const n=queryAll(t,"img");let{length:i}=n;i?n.forEach((t=>{o(t,"load error",(()=>{--i||e();}));})):e();}(t,s.bind(null,"resize"));}})),s("refresh");},remove:function(t){remove(h(t).map((t=>t.slide))),s("refresh");},forEach:p,filter:h,style:function(t,e,n){p((i=>{i.style(t,e,n);}));},getLength:function(t){return t?r.length:l.length},isEnough:function(){return l.length>n.perPage}}}function Layout(t,e,n){const{on:i,bind:s,emit:o}=EventInterface(t),{Slides:r}=e,{resolve:c}=e.Direction,{root:l,track:a,list:u}=e.Elements,{getAt:d}=r;let f,E;function p(){E=null,f=n.direction===TTB,style(l,"maxWidth",unit(n.width)),style(a,c("paddingLeft"),S(!1)),style(a,c("paddingRight"),S(!0)),h();}function h(){const t=rect(l);E&&E.width===t.width&&E.height===t.height||(style(a,"height",function(){let t="";f&&(t=A(),assert(t,"height or heightRatio is missing."),t=`calc(${t} - ${S(!1)} - ${S(!0)})`);return t}()),r.style(c("marginRight"),unit(n.gap)),r.style("width",(n.autoWidth?"":unit(n.fixedWidth)||(f?"":_()))||null),r.style("height",unit(n.fixedHeight)||(f?n.autoHeight?"":_():A())||null,!0),E=t,o("resized"));}function S(t){const{padding:e}=n,i=c(t?"right":"left");return e&&unit(e[i]||(isObject$3(e)?0:e))||"0px"}function A(){return unit(n.height||rect(u).width*n.heightRatio)}function _(){const t=unit(n.gap);return `calc((100%${t&&` + ${t}`})/${n.perPage||1}${t&&` - ${t}`})`}function g(t,e){const n=d(t);if(n){const t=rect(n.slide)[c("right")],i=rect(u)[c("left")];return abs(t-i)+(e?0:T())}return 0}function T(){const t=d(0);return t&&parseFloat(style(t.slide,c("marginRight")))||0}return {mount:function(){p(),s(window,"resize load",Throttle(o.bind(this,"resize"))),i(["updated","refresh"],p),i("resize",h);},listSize:function(){return rect(u)[c("width")]},slideSize:function(t,e){const n=d(t||0);return n?rect(n.slide)[c("width")]+(e?0:T()):0},sliderSize:function(){return g(t.length-1,!0)-g(-1,!0)},totalSize:g,getPadding:function(t){return parseFloat(style(a,c("padding"+(t?"Right":"Left"))))||0}}}function Clones(t,e,n){const{on:i,emit:s}=EventInterface(t),{Elements:o,Slides:r}=e,{resolve:c}=e.Direction,l=[];let a;function u(){(a=p())&&(!function(e){const i=r.get().slice(),{length:s}=i;if(s){for(;i.length<e;)push(i,i);push(i.slice(-e),i.slice(0,e)).forEach(((c,a)=>{const u=a<e,d=function(e,i){const s=e.cloneNode(!0);return addClass$1(s,n.classes.clone),s.id=`${t.root.id}-clone${pad(i+1)}`,s}(c.slide,a);u?before(d,i[0].slide):append(o.list,d),push(l,d),r.register(d,a-e+(u?0:s),c.index);}));}}(a),s("resize"));}function d(){remove(l),empty(l);}function f(){d(),u();}function E(){a<p()&&s("refresh");}function p(){let{clones:e}=n;if(t.is(LOOP)){if(!e){const i=measure(o.list,n[c("fixedWidth")]);e=(i&&ceil(rect(o.track)[c("width")]/i)||n[c("autoWidth")]&&t.length||n.perPage)*(n.drag?(n.flickMaxPages||1)+1:2);}}else e=0;return e}return {mount:function(){u(),i("refresh",f),i(["updated","resize"],E);},destroy:d}}function Move(t,e,n){const{on:i,emit:s}=EventInterface(t),{slideSize:o,getPadding:r,totalSize:c,listSize:l,sliderSize:a}=e.Layout,{resolve:u,orient:d}=e.Direction,{list:f,track:E}=e.Elements;let p;function h(){L()||(e.Scroll.cancel(),S(t.index),s("repositioned"));}function S(t){A(g(t,!0));}function A(e,n){if(!t.is(FADE)){const i=n?e:function(e){if(t.is(LOOP)){const t=d(e-T()),n=C(!1,e)&&t<0,i=C(!0,e)&&t>0;(n||i)&&(e=_(e,i));}return e}(e);f.style.transform=`translate${u("X")}(${i}px)`,e!==i&&s("shifted");}}function _(t,e){const n=t-m(e),i=a();return t-=d(i*(ceil(abs(n)/i)||1))*(e?1:-1)}function g(e,i){const s=d(c(e-1)-function(t){const{focus:e}=n;return "center"===e?(l()-o(t,!0))/2:+e*o(t)||0}(e));return i?function(e){n.trimSpace&&t.is(SLIDE)&&(e=clamp$1(e,0,d(a()-l())));return e}(s):s}function T(){const t=u("left");return rect(f)[t]-rect(E)[t]+d(r(!1))}function m(t){return g(t?e.Controller.getEnd():0,!!n.trimSpace)}function L(){return t.state.is(4)&&n.waitForTransition}function C(t,e){e=isUndefined(e)?T():e;const n=!0!==t&&d(e)<d(m(!1)),i=!1!==t&&d(e)>d(m(!0));return n||i}return {mount:function(){p=e.Transition,i(["mounted","resized","updated","refresh"],h);},destroy:function(){removeAttribute$1(f,"style");},move:function(i,o,r,c){if(!L()){const{set:l}=t.state,a=T();i!==o&&(p.cancel(),A(_(a,i>o),!0)),l(4),s("move",o,r,i),p.start(o,(()=>{l(3),s("moved",o,r,i),"move"===n.trimSpace&&i!==r&&a===T()?e.Controller.go(i>r?">":"<",!1,c):c&&c();}));}},jump:S,translate:A,shift:_,cancel:function(){A(T()),p.cancel();},toIndex:function(t){const n=e.Slides.get();let i=0,s=1/0;for(let e=0;e<n.length;e++){const o=n[e].index,r=abs(g(o,!0)-t);if(!(r<=s))break;s=r,i=o;}return i},toPosition:g,getPosition:T,getLimit:m,isBusy:L,exceededLimit:C}}function Controller(t,e,n){const{on:i}=EventInterface(t),{Move:s}=e,{getPosition:o,getLimit:r}=s,{isEnough:c,getLength:l}=e.Slides,a=t.is(LOOP),u=t.is(SLIDE);let d,f,E,p=n.start||0,h=p;function S(){d=l(!0),f=n.perMove,E=n.perPage,p=clamp$1(p,0,d-1);}function A(t,n,i,o,r){const c=n?t:O(t);e.Scroll.scroll(n||i?s.toPosition(c,!0):t,o,(()=>{y(s.toIndex(s.getPosition())),r&&r();}));}function _(t){return T(!1,t)}function g(t){return T(!0,t)}function T(t,e){const n=f||(N()?1:E),i=m(p+n*(t?-1:1),p);return -1===i&&u&&!approximatelyEqual(o(),r(!t),1)?t?0:L():e?i:C(i)}function m(t,e,i){if(c()){const s=L();t<0||t>s?t=between(0,t,e,!0)||between(s,e,t,!0)?I(R(t)):a?f||N()?t:t<0?-(d%E||E):d:n.rewind?t<0?s:0:-1:i||t===e||(t=f?t:I(R(e)+(t<e?-1:1)));}else t=-1;return t}function L(){let t=d-E;return (N()||a&&f)&&(t=d-1),max$1(t,0)}function C(t){return a?c()?t%d+(t<0?d:0):-1:t}function I(t){return clamp$1(N()?t:E*t,0,L())}function R(t){return N()||(t=between(t,d-E,d-1)?d-1:t,t=floor(t/E)),t}function O(t){const e=s.toIndex(t);return u?clamp$1(e,0,L()):e}function y(t){t!==p&&(h=p,p=t);}function N(){return !isUndefined(n.focus)||n.isNavigation}return {mount:function(){S(),i(["updated","refresh"],S,9);},go:function(t,e,i){const o=function(t){let e=p;if(isString$1(t)){const[,n,i]=t.match(/([+\-<>])(\d+)?/)||[];"+"===n||"-"===n?e=m(p+ +`${n}${+i||1}`,p,!0):">"===n?e=i?I(+i):_(!0):"<"===n&&(e=g(!0));}else e=a?t:clamp$1(t,0,L());return e}(t);if(n.useScroll)A(o,!0,!0,n.speed,i);else {const t=C(o);t>-1&&!s.isBusy()&&(e||t!==p)&&(y(t),s.move(o,t,h,i));}},scroll:A,getNext:_,getPrev:g,getAdjacent:T,getEnd:L,setIndex:y,getIndex:function(t){return t?h:p},toIndex:I,toPage:R,toDest:O,hasFocus:N}}const XML_NAME_SPACE="http://www.w3.org/2000/svg",PATH="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 Arrows(t,e,n){const{on:i,bind:s,emit:o}=EventInterface(t),{classes:r,i18n:c}=n,{Elements:l,Controller:a}=e;let u,d=l.arrows,f=l.prev,E=l.next;const p={};function h(){if(n.arrows&&(f&&E||(d=create("div",r.arrows),f=S(!0),E=S(!1),u=!0,append(d,[f,E]),before(d,child("slider"===n.arrows&&l.slider||t.root)))),f&&E)if(p.prev)display(d,!1===n.arrows?"none":"");else {const{id:t}=l.track;setAttribute$1(f,ARIA_CONTROLS,t),setAttribute$1(E,ARIA_CONTROLS,t),p.prev=f,p.next=E,function(){const{go:t}=a;i(["mounted","moved","updated","refresh","scrolled"],A),s(E,"click",(()=>{t(">",!0);})),s(f,"click",(()=>{t("<",!0);}));}(),o("arrows:mounted",f,E);}}function S(t){return parseHtml(`<button class="${r.arrow} ${t?r.prev:r.next}" type="button"><svg xmlns="${XML_NAME_SPACE}" viewBox="0 0 40 40" width="40" height="40"><path d="${n.arrowPath||PATH}" />`)}function A(){const e=t.index,n=a.getPrev(),i=a.getNext(),s=n>-1&&e<n?c.last:c.prev,r=i>-1&&e>i?c.first:c.next;f.disabled=n<0,E.disabled=i<0,setAttribute$1(f,ARIA_LABEL,s),setAttribute$1(E,ARIA_LABEL,r),o("arrows:updated",f,E,n,i);}return {arrows:p,mount:function(){h(),i("updated",h);},destroy:function(){u?remove(d):(removeAttribute$1(f,ALL_ATTRIBUTES),removeAttribute$1(E,ALL_ATTRIBUTES));}}}function Autoplay(t,e,n){const{on:i,bind:s,emit:o}=EventInterface(t),r=RequestInterval(n.interval,t.go.bind(t,">"),(function(t){const{bar:e}=l;e&&style(e,"width",100*t+"%"),o("autoplay:playing",t);})),{isPaused:c}=r,{Elements:l}=e;let a,u,d;function f(t){const e=t?"pause":"play",i=l[e];i&&(setAttribute$1(i,ARIA_CONTROLS,l.track.id),setAttribute$1(i,ARIA_LABEL,n.i18n[e]),s(i,"click",t?p:E));}function E(){c()&&e.Slides.isEnough()&&(r.start(!n.resetProgress),u=a=d=!1,o("autoplay:play"));}function p(t=!0){c()||(r.pause(),o("autoplay:pause")),d=t;}function h(){d||(a||u?p(!1):E());}function S(){const i=e.Slides.getAt(t.index);r.set(i&&+getAttribute$2(i.slide,"data-splide-interval")||n.interval);}return {mount:function(){const{autoplay:t}=n;t&&(f(!0),f(!1),function(){const{root:t}=l;n.pauseOnHover&&s(t,"mouseenter mouseleave",(t=>{a="mouseenter"===t.type,h();}));n.pauseOnFocus&&s(t,"focusin focusout",(t=>{u="focusin"===t.type,h();}));i(["move","scroll","refresh"],r.rewind),i("move",S);}(),"pause"!==t&&E());},destroy:r.cancel,play:E,pause:p,isPaused:c}}function Cover(t,e,n){const{on:i}=EventInterface(t);function s(t){e.Slides.forEach((e=>{const n=child(e.container||e.slide,"img");n&&n.src&&o(t,n,e);}));}function o(t,e,n){n.style("background",t?`center/cover no-repeat url("${e.src}")`:"",!0),display(e,t?"none":"");}return {mount:function(){n.cover&&(i("lazyload:loaded",((t,e)=>{o(!0,t,e);})),i(["mounted","updated","refresh"],s.bind(null,!0)));},destroy:function(){s(!1);}}}function Scroll(t,e,n){const{on:i,emit:s}=EventInterface(t),{Move:o}=e,{getPosition:r,getLimit:c,exceededLimit:l}=o;let a,u;function d(e,i,p,h){const S=r();let A=1;var _;i=i||(_=abs(e-S),max$1(_/1.5,800)),u=p,E(),a=RequestInterval(i,f,(i=>{const s=r(),a=(S+(e-S)*function(t){const{easingFunc:e}=n;return e?e(t):1-Math.pow(1-t,4)}(i)-r())*A;var u;o.translate(s+a),t.is(SLIDE)&&!h&&l()&&(A*=.6,abs(a)<10&&(u=l(!1),d(c(!u),600,null,!0)));}),1),s("scroll"),a.start();}function f(){const e=r(),n=o.toIndex(e);between(n,0,t.length-1)||o.translate(o.shift(e,n>0),!0),u&&u(),s("scrolled");}function E(){a&&a.cancel();}function p(){a&&!a.isPaused()&&(E(),f());}return {mount:function(){i("move",E),i(["updated","refresh"],p);},destroy:E,scroll:d,cancel:p}}const SCROLL_LISTENER_OPTIONS={passive:!1,capture:!0},POINTER_DOWN_EVENTS="touchstart mousedown",POINTER_MOVE_EVENTS="touchmove mousemove",POINTER_UP_EVENTS="touchend touchcancel mouseup";function Drag(t,e,n){const{on:i,emit:s,bind:o,unbind:r}=EventInterface(t),{Move:c,Scroll:l,Controller:a}=e,{track:u}=e.Elements,{resolve:d,orient:f}=e.Direction,{getPosition:E,exceededLimit:p}=c;let h,S,A,_,g,T,m,L,C,I=!1;function R(){const{drag:t}=n;$(!t),g="free"===t;}function O(t){if(!L){const{noDrag:e}=n,i=w(t),s=!e||!matches(t.target,e);m=!1,!s||!i&&t.button||(c.isBusy()?prevent(t,!0):(C=i?u:window,A=null,_=null,o(C,POINTER_MOVE_EVENTS,y,SCROLL_LISTENER_OPTIONS),o(C,POINTER_UP_EVENTS,N,SCROLL_LISTENER_OPTIONS),c.cancel(),l.cancel(),v(t)));}}function y(e){if(_||s("drag"),_=e,e.cancelable){const i=P(e)-P(S);if(T){c.translate(h+function(e){return e/(I&&t.is(SLIDE)?5:1)}(i));const n=V(e)-V(S)>200,o=I!==(I=p());(n||o)&&v(e),s("dragging"),m=!0,prevent(e);}else {let{dragMinThreshold:t}=n;t=isObject$3(t)?t:{mouse:0,touch:+t||10},T=abs(i)>(w(e)?t.touch:t.mouse),D()&&prevent(e);}}}function N(i){r(C,POINTER_MOVE_EVENTS,y),r(C,POINTER_UP_EVENTS,N);const{index:o}=t;if(_){if(T||i.cancelable&&D()){const s=function(e){if(t.is(LOOP)||!I){const t=S===_&&A||S,n=P(_)-P(t),i=V(e)-V(t),s=V(e)-V(_)<200;if(i&&s)return n/i}return 0}(i),r=function(t){return E()+sign(t)*min$1(abs(t)*(n.flickPower||600),g?1/0:e.Layout.listSize()*(n.flickMaxPages||1))}(s);g?a.scroll(r):t.is(FADE)?a.go(o+f(sign(s))):a.go(a.toDest(r),!0),prevent(i);}s("dragged");}else g||E()===c.toPosition(o)||a.go(o,!0);T=!1;}function v(t){A=S,S=t,h=E();}function b(t){!L&&m&&prevent(t,!0);}function D(){return abs(P(_)-P(S))>abs(P(_,!0)-P(S,!0))}function P(t,e){return (w(t)?t.touches[0]:t)[`page${d(e?"Y":"X")}`]}function V(t){return t.timeStamp}function w(t){return "undefined"!=typeof TouchEvent&&t instanceof TouchEvent}function $(t){L=t;}return {mount:function(){o(u,POINTER_MOVE_EVENTS,noop$3,SCROLL_LISTENER_OPTIONS),o(u,POINTER_UP_EVENTS,noop$3,SCROLL_LISTENER_OPTIONS),o(u,POINTER_DOWN_EVENTS,O,SCROLL_LISTENER_OPTIONS),o(u,"click",b,{capture:!0}),o(u,"dragstart",prevent),i(["mounted","updated"],R);},disable:$,isDragging:function(){return T}}}const IE_ARROW_KEYS=["Left","Right","Up","Down"];function Keyboard(t,e,n){const{on:i,bind:s,unbind:o}=EventInterface(t),{root:r}=t,{resolve:c}=e.Direction;let l,a;function u(){const{keyboard:t}=n;t&&("focused"===t?(l=r,setAttribute$1(r,TAB_INDEX,0)):l=window,s(l,"keydown",p));}function d(){o(l,"keydown"),isHTMLElement$1(l)&&removeAttribute$1(l,TAB_INDEX);}function f(){const t=a;a=!0,nextTick((()=>{a=t;}));}function E(){d(),u();}function p(e){if(!a){const{key:n}=e,i=includes(IE_ARROW_KEYS,n)?`Arrow${n}`:n;i===c("ArrowLeft")?t.go("<"):i===c("ArrowRight")&&t.go(">");}}return {mount:function(){u(),i("updated",E),i("move",f);},destroy:d,disable:function(t){a=t;}}}const SRCSET_DATA_ATTRIBUTE="data-splide-lazy-srcset",IMAGE_SELECTOR="[data-splide-lazy], [data-splide-lazy-srcset]";function LazyLoad(t,e,n){const{on:i,off:s,bind:o,emit:r}=EventInterface(t),c="sequential"===n.lazyLoad;let l=[],a=0;function u(){f(),d();}function d(){e.Slides.forEach((t=>{queryAll(t.slide,IMAGE_SELECTOR).forEach((e=>{const i=getAttribute$2(e,"data-splide-lazy"),s=getAttribute$2(e,SRCSET_DATA_ATTRIBUTE);if(i!==e.src||s!==e.srcset){const o=n.classes.spinner,r=e.parentElement,c=child(r,`.${o}`)||create("span",o,r);setAttribute$1(c,ROLE,"presentation"),l.push({_img:e,_Slide:t,src:i,srcset:s,_spinner:c}),!e.src&&display(e,"none");}}));})),c&&h();}function f(){a=0,l=[];}function E(){l=l.filter((e=>{const i=n.perPage*((n.preloadPages||1)+1)-1;return !e._Slide.isWithin(t.index,i)||p(e)})),l.length||s("moved");}function p(t){const{_img:e}=t;addClass$1(t._Slide.slide,"is-loading"),o(e,"load error",(e=>{!function(t,e){const{_Slide:n}=t;removeClass$1(n.slide,"is-loading"),e||(remove(t._spinner),display(t._img,""),r("lazyload:loaded",t._img,n),r("resize"));c&&h();}(t,"error"===e.type);})),["srcset","src"].forEach((n=>{t[n]&&(setAttribute$1(e,n,t[n]),removeAttribute$1(e,"src"===n?"data-splide-lazy":SRCSET_DATA_ATTRIBUTE));}));}function h(){a<l.length&&p(l[a++]);}return {mount:function(){n.lazyLoad&&(d(),i("refresh",u),c||i(["mounted","refresh","moved","scrolled"],E));},destroy:f}}function Pagination(t,e,n){const{on:i,emit:s,bind:o,unbind:r}=EventInterface(t),{Slides:c,Elements:l,Controller:a}=e,{hasFocus:u,getIndex:d}=a,f=[];let E;function p(){h(),n.pagination&&c.isEnough()&&(!function(){const{length:e}=t,{classes:i,i18n:s,perPage:r}=n,a="slider"===n.pagination&&l.slider||l.root,d=u()?e:ceil(e/r);E=create("ul",i.pagination,a);for(let t=0;t<d;t++){const e=create("li",null,E),n=create("button",{class:i.page,type:"button"},e),l=c.getIn(t).map((t=>t.slide.id)),a=!u()&&r>1?s.pageX:s.slideX;o(n,"click",S.bind(null,t)),setAttribute$1(n,ARIA_CONTROLS,l.join(" ")),setAttribute$1(n,ARIA_LABEL,format$1(a,t+1)),f.push({li:e,button:n,page:t});}}(),s("pagination:mounted",{list:E,items:f},A(t.index)),_());}function h(){E&&(remove(E),f.forEach((t=>{r(t.button,"click");})),empty(f),E=null);}function S(t){a.go(`>${t}`,!0,(()=>{const e=c.getAt(a.toIndex(t));e&&focus(e.slide);}));}function A(t){return f[a.toPage(t)]}function _(){const t=A(d(!0)),e=A(d());t&&(removeClass$1(t.button,CLASS_ACTIVE),removeAttribute$1(t.button,ARIA_CURRENT)),e&&(addClass$1(e.button,CLASS_ACTIVE),setAttribute$1(e.button,ARIA_CURRENT,!0)),s("pagination:updated",{list:E,items:f},t,e);}return {items:f,mount:function(){p(),i(["updated","refresh"],p),i(["move","scrolled"],_);},destroy:h,getAt:A,update:_}}const TRIGGER_KEYS=[" ","Enter","Spacebar"];function Sync(t,e,n){const{list:i}=e.Elements,s=[];function o(){t.splides.forEach((e=>{var n;!e.isParent&&(n=e.splide,[t,n].forEach((e=>{const i=EventInterface(e),o=e===t?n:t;i.on("move",((t,e,n)=>{o.go(o.is(LOOP)?n:t);})),s.push(i);})));})),n.isNavigation&&function(){const e=EventInterface(t),{on:n}=e;n("click",l),n("slide:keydown",a),n(["mounted","updated"],c),setAttribute$1(i,ROLE,"menu"),s.push(e),e.emit("navigation:mounted",t.splides);}();}function r(){removeAttribute$1(i,ALL_ATTRIBUTES),s.forEach((t=>{t.destroy();})),empty(s);}function c(){setAttribute$1(i,ARIA_ORIENTATION,n.direction!==TTB?"horizontal":null);}function l(e){t.go(e.index);}function a(t,e){includes(TRIGGER_KEYS,e.key)&&(l(t),prevent(e));}return {mount:o,destroy:r,remount:function(){r(),o();}}}function Wheel(t,e,n){const{bind:i}=EventInterface(t);function s(i){if(i.cancelable){const{deltaY:s}=i;if(s){const o=s<0;t.go(o?"<":">"),function(i){return !n.releaseWheel||t.state.is(4)||-1!==e.Controller.getAdjacent(i)}(o)&&prevent(i);}}}return {mount:function(){n.wheel&&i(e.Elements.track,"wheel",s,SCROLL_LISTENER_OPTIONS);}}}var ComponentConstructors=Object.freeze({__proto__:null,Options:Options,Direction:Direction,Elements:Elements,Slides:Slides,Layout:Layout,Clones:Clones,Move:Move,Controller:Controller,Arrows:Arrows,Autoplay:Autoplay,Cover:Cover,Scroll:Scroll,Drag:Drag,Keyboard:Keyboard,LazyLoad:LazyLoad,Pagination:Pagination,Sync:Sync,Wheel:Wheel});const 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"},DEFAULTS={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:CLASSES,i18n:I18N};function Fade(t,e,n){const{on:i}=EventInterface(t);return {mount:function(){i(["mounted","refresh"],(()=>{nextTick((()=>{e.Slides.style("transition",`opacity ${n.speed}ms ${n.easing}`);}));}));},start:function(t,n){const{track:i}=e.Elements;style(i,"height",unit(rect(i).height)),nextTick((()=>{n(),style(i,"height","");}));},cancel:noop$3}}function Slide(t,e,n){const{bind:i}=EventInterface(t),{Move:s,Controller:o}=e,{list:r}=e.Elements;let c;function l(){a("");}function a(t){style(r,"transition",t);}return {mount:function(){i(r,"transitionend",(t=>{t.target===r&&c&&(l(),c());}));},start:function(e,i){const r=s.toPosition(e,!0),l=s.getPosition(),u=function(e){const{rewindSpeed:i}=n;if(t.is(SLIDE)&&i){const t=o.getIndex(!0),n=o.getEnd();if(0===t&&e>=n||t>=n&&0===e)return i}return n.speed}(e);abs(r-l)>=1&&u>=1?(a(`transform ${u}ms ${n.easing}`),s.translate(r,!0),c=i):(s.jump(e),i());},cancel:l}}const _Splide=class{constructor(t,e){this.event=EventBus(),this.Components={},this.state=State(1),this.splides=[],this._options={},this._Extensions={};const n=isString$1(t)?query(document,t):t;assert(n,`${n} is invalid.`),this.root=n,merge$3(DEFAULTS,_Splide.defaults),merge$3(merge$3(this._options,DEFAULTS),e||{});}mount(t,e){const{state:n,Components:i}=this;assert(n.is([1,5]),"Already mounted!"),n.set(1),this._Components=i,this._Transition=e||this._Transition||(this.is(FADE)?Fade:Slide),this._Extensions=t||this._Extensions;return forOwn(assign$1({},ComponentConstructors,this._Extensions,{Transition:this._Transition}),((t,e)=>{const n=t(this,i,this._options);i[e]=n,n.setup&&n.setup();})),forOwn(i,(t=>{t.mount&&t.mount();})),this.emit("mounted"),addClass$1(this.root,"is-initialized"),n.set(3),this.emit("ready"),this}sync(t){return this.splides.push({splide:t}),t.splides.push({splide:this,isParent:!0}),this.state.is(3)&&(this._Components.Sync.remount(),t.Components.Sync.remount()),this}go(t){return this._Components.Controller.go(t),this}on(t,e){return this.event.on(t,e,null,20),this}off(t){return this.event.off(t),this}emit(t){return this.event.emit(t,...slice$1(arguments,1)),this}add(t,e){return this._Components.Slides.add(t,e),this}remove(t){return this._Components.Slides.remove(t),this}is(t){return this._options.type===t}refresh(){return this.emit("refresh"),this}destroy(t=!0){const{event:e,state:n}=this;return n.is(1)?e.on("ready",this.destroy.bind(this,t),this):(forOwn(this._Components,(e=>{e.destroy&&e.destroy(t);}),!0),e.emit("destroy"),e.destroy(),t&&empty(this.splides),n.set(5)),this}get options(){return this._options}set options(t){const{_options:e}=this;merge$3(e,t),this.state.is(1)||this.emit("updated",e);}get length(){return this._Components.Slides.getLength(!0)}get index(){return this._Components.Controller.getIndex()}};let Splide=_Splide;Splide.defaults={},Splide.STATES=STATES;
39
41
 
40
42
  const elementMap=new Map;const Data = {set(e,t,n){elementMap.has(e)||elementMap.set(e,new Map);const a=elementMap.get(e);a.has(t)||0===a.size?a.set(t,n):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(a.keys())[0]}.`);},get:(e,t)=>elementMap.has(e)&&elementMap.get(e).get(t)||null,remove(e,t){if(!elementMap.has(e))return;const n=elementMap.get(e);n.delete(t),0===n.size&&elementMap.delete(e);}};
41
43
 
42
- const TRANSITION_END="transitionend",toType=e=>null==e?`${e}`:Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase(),getUID=e=>{do{e+=Math.floor(1e6*Math.random());}while(document.getElementById(e));return e},getSelector=e=>{let t=e.getAttribute("data-bs-target");if(!t||"#"===t){let n=e.getAttribute("href");if(!n||!n.includes("#")&&!n.startsWith("."))return null;n.includes("#")&&!n.startsWith("#")&&(n=`#${n.split("#")[1]}`),t=n&&"#"!==n?n.trim():null;}return t},getSelectorFromElement=e=>{const t=getSelector(e);return t&&document.querySelector(t)?t:null},getElementFromSelector=e=>{const t=getSelector(e);return t?document.querySelector(t):null},getTransitionDurationFromElement=e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:n}=window.getComputedStyle(e);const o=Number.parseFloat(t),r=Number.parseFloat(n);return o||r?(t=t.split(",")[0],n=n.split(",")[0],1e3*(Number.parseFloat(t)+Number.parseFloat(n))):0},triggerTransitionEnd=e=>{e.dispatchEvent(new Event(TRANSITION_END));},isElement$1=e=>!(!e||"object"!=typeof e)&&(void 0!==e.jquery&&(e=e[0]),void 0!==e.nodeType),getElement=e=>isElement$1(e)?e.jquery?e[0]:e:"string"==typeof e&&e.length>0?document.querySelector(e):null,isVisible=e=>{if(!isElement$1(e)||0===e.getClientRects().length)return !1;const t="visible"===getComputedStyle(e).getPropertyValue("visibility"),n=e.closest("details:not([open])");if(!n)return t;if(n!==e){const t=e.closest("summary");if(t&&t.parentNode!==n)return !1;if(null===t)return !1}return t},isDisabled=e=>!e||e.nodeType!==Node.ELEMENT_NODE||(!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled"))),findShadowRoot=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?findShadowRoot(e.parentNode):null},noop=()=>{},reflow=e=>{e.offsetHeight;},getjQuery=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,DOMContentLoadedCallbacks=[],onDOMContentLoaded=e=>{"loading"===document.readyState?(DOMContentLoadedCallbacks.length||document.addEventListener("DOMContentLoaded",(()=>{for(const e of DOMContentLoadedCallbacks)e();})),DOMContentLoadedCallbacks.push(e)):e();},isRTL=()=>"rtl"===document.documentElement.dir,defineJQueryPlugin=e=>{onDOMContentLoaded((()=>{const t=getjQuery();if(t){const n=e.NAME,o=t.fn[n];t.fn[n]=e.jQueryInterface,t.fn[n].Constructor=e,t.fn[n].noConflict=()=>(t.fn[n]=o,e.jQueryInterface);}}));},execute=e=>{"function"==typeof e&&e();},executeAfterTransition=(e,t,n=!0)=>{if(!n)return void execute(e);const o=getTransitionDurationFromElement(t)+5;let r=!1;const i=({target:n})=>{n===t&&(r=!0,t.removeEventListener(TRANSITION_END,i),execute(e));};t.addEventListener(TRANSITION_END,i),setTimeout((()=>{r||triggerTransitionEnd(t);}),o);},getNextActiveElement=(e,t,n,o)=>{const r=e.length;let i=e.indexOf(t);return -1===i?!n&&o?e[r-1]:e[0]:(i+=n?1:-1,o&&(i=(i+r)%r),e[Math.max(0,Math.min(i,r-1))])};
44
+ const TRANSITION_END="transitionend",toType=e=>null==e?`${e}`:Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase(),getUID=e=>{do{e+=Math.floor(1e6*Math.random());}while(document.getElementById(e));return e},getSelector=e=>{let t=e.getAttribute("data-bs-target");if(!t||"#"===t){let n=e.getAttribute("href");if(!n||!n.includes("#")&&!n.startsWith("."))return null;n.includes("#")&&!n.startsWith("#")&&(n=`#${n.split("#")[1]}`),t=n&&"#"!==n?n.trim():null;}return t},getSelectorFromElement=e=>{const t=getSelector(e);return t&&document.querySelector(t)?t:null},getElementFromSelector=e=>{const t=getSelector(e);return t?document.querySelector(t):null},getTransitionDurationFromElement=e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:n}=window.getComputedStyle(e);const o=Number.parseFloat(t),r=Number.parseFloat(n);return o||r?(t=t.split(",")[0],n=n.split(",")[0],1e3*(Number.parseFloat(t)+Number.parseFloat(n))):0},triggerTransitionEnd=e=>{e.dispatchEvent(new Event(TRANSITION_END));},isElement$1=e=>!(!e||"object"!=typeof e)&&(void 0!==e.jquery&&(e=e[0]),void 0!==e.nodeType),getElement=e=>isElement$1(e)?e.jquery?e[0]:e:"string"==typeof e&&e.length>0?document.querySelector(e):null,isVisible=e=>{if(!isElement$1(e)||0===e.getClientRects().length)return !1;const t="visible"===getComputedStyle(e).getPropertyValue("visibility"),n=e.closest("details:not([open])");if(!n)return t;if(n!==e){const t=e.closest("summary");if(t&&t.parentNode!==n)return !1;if(null===t)return !1}return t},isDisabled$1=e=>!e||e.nodeType!==Node.ELEMENT_NODE||(!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled"))),findShadowRoot=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?findShadowRoot(e.parentNode):null},noop$2=()=>{},reflow=e=>{e.offsetHeight;},getjQuery=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,DOMContentLoadedCallbacks=[],onDOMContentLoaded=e=>{"loading"===document.readyState?(DOMContentLoadedCallbacks.length||document.addEventListener("DOMContentLoaded",(()=>{for(const e of DOMContentLoadedCallbacks)e();})),DOMContentLoadedCallbacks.push(e)):e();},isRTL=()=>"rtl"===document.documentElement.dir,defineJQueryPlugin=e=>{onDOMContentLoaded((()=>{const t=getjQuery();if(t){const n=e.NAME,o=t.fn[n];t.fn[n]=e.jQueryInterface,t.fn[n].Constructor=e,t.fn[n].noConflict=()=>(t.fn[n]=o,e.jQueryInterface);}}));},execute=e=>{"function"==typeof e&&e();},executeAfterTransition=(e,t,n=!0)=>{if(!n)return void execute(e);const o=getTransitionDurationFromElement(t)+5;let r=!1;const i=({target:n})=>{n===t&&(r=!0,t.removeEventListener(TRANSITION_END,i),execute(e));};t.addEventListener(TRANSITION_END,i),setTimeout((()=>{r||triggerTransitionEnd(t);}),o);},getNextActiveElement=(e,t,n,o)=>{const r=e.length;let i=e.indexOf(t);return -1===i?!n&&o?e[r-1]:e[0]:(i+=n?1:-1,o&&(i=(i+r)%r),e[Math.max(0,Math.min(i,r-1))])};
43
45
 
44
46
  const namespaceRegex=/[^.]*(?=\..*)\.|.*/,stripNameRegex=/\..*/,stripUidRegex=/::\d+$/,eventRegistry={};let uidEvent=1;const customEvents={mouseenter:"mouseover",mouseleave:"mouseout"},nativeEvents=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 makeEventUid(e,t){return t&&`${t}::${uidEvent++}`||e.uidEvent||uidEvent++}function getElementEvents(e){const t=makeEventUid(e);return e.uidEvent=t,eventRegistry[t]=eventRegistry[t]||{},eventRegistry[t]}function bootstrapHandler(e,t){return function n(r){return hydrateObj(r,{delegateTarget:e}),n.oneOff&&EventHandler.off(e,r.type,t),t.apply(e,[r])}}function bootstrapDelegationHandler(e,t,n){return function r(o){const a=e.querySelectorAll(t);for(let{target:l}=o;l&&l!==this;l=l.parentNode)for(const s of a)if(s===l)return hydrateObj(o,{delegateTarget:l}),r.oneOff&&EventHandler.off(e,o.type,t,n),n.apply(l,[o])}}function findHandler(e,t,n=null){return Object.values(e).find((e=>e.callable===t&&e.delegationSelector===n))}function normalizeParameters(e,t,n){const r="string"==typeof t,o=r?n:t||n;let a=getTypeEvent(e);return nativeEvents.has(a)||(a=e),[r,o,a]}function addHandler(e,t,n,r,o){if("string"!=typeof t||!e)return;let[a,l,s]=normalizeParameters(t,n,r);if(t in customEvents){const e=e=>function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)};l=e(l);}const i=getElementEvents(e),c=i[s]||(i[s]={}),u=findHandler(c,l,a?n:null);if(u)return void(u.oneOff=u.oneOff&&o);const d=makeEventUid(l,t.replace(namespaceRegex,"")),f=a?bootstrapDelegationHandler(e,n,l):bootstrapHandler(e,l);f.delegationSelector=a?n:null,f.callable=l,f.oneOff=o,f.uidEvent=d,c[d]=f,e.addEventListener(s,f,a);}function removeHandler(e,t,n,r,o){const a=findHandler(t[n],r,o);a&&(e.removeEventListener(n,a,Boolean(o)),delete t[n][a.uidEvent]);}function removeNamespacedHandlers(e,t,n,r){const o=t[n]||{};for(const a of Object.keys(o))if(a.includes(r)){const r=o[a];removeHandler(e,t,n,r.callable,r.delegationSelector);}}function getTypeEvent(e){return e=e.replace(stripNameRegex,""),customEvents[e]||e}const EventHandler={on(e,t,n,r){addHandler(e,t,n,r,!1);},one(e,t,n,r){addHandler(e,t,n,r,!0);},off(e,t,n,r){if("string"!=typeof t||!e)return;const[o,a,l]=normalizeParameters(t,n,r),s=l!==t,i=getElementEvents(e),c=i[l]||{},u=t.startsWith(".");if(void 0===a){if(u)for(const n of Object.keys(i))removeNamespacedHandlers(e,i,n,t.slice(1));for(const n of Object.keys(c)){const r=n.replace(stripUidRegex,"");if(!s||t.includes(r)){const t=c[n];removeHandler(e,i,l,t.callable,t.delegationSelector);}}}else {if(!Object.keys(c).length)return;removeHandler(e,i,l,a,o?n:null);}},trigger(e,t,n){if("string"!=typeof t||!e)return null;const r=getjQuery();let o=null,a=!0,l=!0,s=!1;t!==getTypeEvent(t)&&r&&(o=r.Event(t,n),r(e).trigger(o),a=!o.isPropagationStopped(),l=!o.isImmediatePropagationStopped(),s=o.isDefaultPrevented());let i=new Event(t,{bubbles:a,cancelable:!0});return i=hydrateObj(i,n),s&&i.preventDefault(),l&&e.dispatchEvent(i),i.defaultPrevented&&o&&o.preventDefault(),i}};function hydrateObj(e,t){for(const[n,r]of Object.entries(t||{}))try{e[n]=r;}catch{Object.defineProperty(e,n,{configurable:!0,get:()=>r});}return e}const EventHandler$1 = EventHandler;
45
47
 
46
48
  function normalizeData(t){if("true"===t)return !0;if("false"===t)return !1;if(t===Number(t).toString())return Number(t);if(""===t||"null"===t)return null;if("string"!=typeof t)return t;try{return JSON.parse(decodeURIComponent(t))}catch{return t}}function normalizeDataKey(t){return t.replace(/[A-Z]/g,(t=>`-${t.toLowerCase()}`))}const Manipulator={setDataAttribute(t,e,r){t.setAttribute(`data-bs-${normalizeDataKey(e)}`,r);},removeDataAttribute(t,e){t.removeAttribute(`data-bs-${normalizeDataKey(e)}`);},getDataAttributes(t){if(!t)return {};const e={},r=Object.keys(t.dataset).filter((t=>t.startsWith("bs")&&!t.startsWith("bsConfig")));for(const a of r){let r=a.replace(/^bs/,"");r=r.charAt(0).toLowerCase()+r.slice(1,r.length),e[r]=normalizeData(t.dataset[a]);}return e},getDataAttribute:(t,e)=>normalizeData(t.getAttribute(`data-bs-${normalizeDataKey(e)}`))};
47
49
 
48
- class Config{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(t){return t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t}_mergeConfigObj(t,e){const o=isElement$1(e)?Manipulator.getDataAttribute(e,"config"):{};return {...this.constructor.Default,..."object"==typeof o?o:{},...isElement$1(e)?Manipulator.getDataAttributes(e):{},..."object"==typeof t?t:{}}}_typeCheckConfig(t,e=this.constructor.DefaultType){for(const o of Object.keys(e)){const r=e[o],n=t[o],i=isElement$1(n)?"element":toType(n);if(!new RegExp(r).test(i))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${o}" provided type "${i}" but expected type "${r}".`)}}}
50
+ class Config$1{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(t){return t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t}_mergeConfigObj(t,e){const o=isElement$1(e)?Manipulator.getDataAttribute(e,"config"):{};return {...this.constructor.Default,..."object"==typeof o?o:{},...isElement$1(e)?Manipulator.getDataAttributes(e):{},..."object"==typeof t?t:{}}}_typeCheckConfig(t,e=this.constructor.DefaultType){for(const o of Object.keys(e)){const r=e[o],n=t[o],i=isElement$1(n)?"element":toType(n);if(!new RegExp(r).test(i))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${o}" provided type "${i}" but expected type "${r}".`)}}}
49
51
 
50
- class BaseComponent extends Config{constructor(t,e){super(),(t=getElement(t))&&(this._element=t,this._config=this._getConfig(e),Data.set(this._element,this.constructor.DATA_KEY,this));}dispose(){Data.remove(this._element,this.constructor.DATA_KEY),EventHandler$1.off(this._element,this.constructor.EVENT_KEY);for(const t of Object.getOwnPropertyNames(this))this[t]=null;}_queueCallback(t,e,n=!0){executeAfterTransition(t,e,n);}_getConfig(t){return t=this._mergeConfigObj(t,this._element),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}static getInstance(t){return Data.get(getElement(t),this.DATA_KEY)}static getOrCreateInstance(t,e={}){return this.getInstance(t)||new this(t,"object"==typeof e?e: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(t){return `${t}${this.EVENT_KEY}`}}
52
+ class BaseComponent extends Config$1{constructor(t,e){super(),(t=getElement(t))&&(this._element=t,this._config=this._getConfig(e),Data.set(this._element,this.constructor.DATA_KEY,this));}dispose(){Data.remove(this._element,this.constructor.DATA_KEY),EventHandler$1.off(this._element,this.constructor.EVENT_KEY);for(const t of Object.getOwnPropertyNames(this))this[t]=null;}_queueCallback(t,e,n=!0){executeAfterTransition(t,e,n);}_getConfig(t){return t=this._mergeConfigObj(t,this._element),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}static getInstance(t){return Data.get(getElement(t),this.DATA_KEY)}static getOrCreateInstance(t,e={}){return this.getInstance(t)||new this(t,"object"==typeof e?e: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(t){return `${t}${this.EVENT_KEY}`}}
51
53
 
52
- const SelectorEngine={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 n=[];let i=e.parentNode.closest(t);for(;i;)n.push(i),i=i.parentNode.closest(t);return n},prev(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return [n];n=n.previousElementSibling;}return []},next(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return [n];n=n.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=>!isDisabled(e)&&isVisible(e)))}};const SelectorEngine$1 = SelectorEngine;
54
+ const SelectorEngine={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 n=[];let i=e.parentNode.closest(t);for(;i;)n.push(i),i=i.parentNode.closest(t);return n},prev(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return [n];n=n.previousElementSibling;}return []},next(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return [n];n=n.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=>!isDisabled$1(e)&&isVisible(e)))}};const SelectorEngine$1 = SelectorEngine;
53
55
 
54
- const NAME$C="carousel",EVENT_LOAD_DATA_API$4="load.bs.carousel.data-api",SELECTOR_CAROUSEL="[data-bs-carousel-splide]",CONFIG_DEFAULT$1={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"}},CONFIGS={"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:40,right:40},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 CarouselBI extends BaseComponent{constructor(e){super(e),this._config=this._getConfig(),this._splide=new Splide(this._element,this._config),this._init();}dispose(){this._splide.destroy(),super.dispose();}static get NAME(){return NAME$C}_init(){this._splide.mount();}_getConfig(){let e=Object.assign({},CONFIG_DEFAULT$1);return Object.keys(CONFIGS).forEach((a=>{this._element.classList.contains(a)&&(e=Object.assign({},e,CONFIGS[a]));})),e}}EventHandler$1.on(window,EVENT_LOAD_DATA_API$4,(()=>{SelectorEngine$1.find(SELECTOR_CAROUSEL).forEach((e=>{CarouselBI.getOrCreateInstance(e);}));}));const CarouselBI$1 = CarouselBI;
56
+ const NAME$E="carousel",EVENT_LOAD_DATA_API$4="load.bs.carousel.data-api",SELECTOR_CAROUSEL="[data-bs-carousel-splide]",CONFIG_DEFAULT$1={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"}},CONFIGS={"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 CarouselBI extends BaseComponent{constructor(e){super(e),this._config=this._getConfig(),this._splide=new Splide(this._element,this._config),this._init();}dispose(){this._splide.destroy(),super.dispose();}static get NAME(){return NAME$E}_init(){this._splide.mount();}_getConfig(){let e=Object.assign({},CONFIG_DEFAULT$1);return Object.keys(CONFIGS).forEach((a=>{this._element.classList.contains(a)&&(e=Object.assign({},e,CONFIGS[a]));})),e}}EventHandler$1.on(window,EVENT_LOAD_DATA_API$4,(()=>{SelectorEngine$1.find(SELECTOR_CAROUSEL).forEach((e=>{CarouselBI.getOrCreateInstance(e);}));}));const CarouselBI$1 = CarouselBI;
55
57
 
56
- const NAME$B="inputlabel",DATA_KEY$d="bs.inputlabel",EVENT_KEY$f=`.${DATA_KEY$d}`,EVENT_FOCUS=`focus${EVENT_KEY$f}`,EVENT_BLUR=`blur${EVENT_KEY$f}`,EVENT_CHANGE$2=`change${EVENT_KEY$f}`;class InputLabel{constructor(e){this._element=e,this._init();}static get NAME(){return NAME$B}static getInputFromLabel=e=>document.querySelector("#"+e.getAttribute("for"));_init(){const e=this._getLabel();e&&!e.classList.contains("active")&&(this._labelOut(),this._labelOver()),this._bindEvents();}_bindEvents(){["date","time"].includes(this._element.getAttribute("type"))||("file"===this._element.getAttribute("type")?EventHandler$1.on(this._element,EVENT_BLUR,(()=>{this._labelOut();})):(EventHandler$1.on(this._element,EVENT_FOCUS,(()=>{this._labelOut();})),EventHandler$1.on(this._element,EVENT_BLUR,(()=>{this._labelOver();})),EventHandler$1.on(this._element,EVENT_CHANGE$2,(()=>{this._labelToggle();}))));}_getLabel(){return SelectorEngine$1.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("active");}_labelOver(){if(this._isEmpty()){const e=this._getLabel();e&&e.classList.remove("active");}}_labelToggle(){this._isEmpty()?this._labelOver():this._labelOut();}}const InputLabel$1 = InputLabel;
58
+ const NAME$D="inputlabel",DATA_KEY$d="bs.inputlabel",EVENT_KEY$f=`.${DATA_KEY$d}`,EVENT_FOCUS=`focus${EVENT_KEY$f}`,EVENT_BLUR=`blur${EVENT_KEY$f}`,EVENT_CHANGE$2=`change${EVENT_KEY$f}`;class InputLabel{constructor(e){this._element=e,this._init();}static get NAME(){return NAME$D}static getInputFromLabel=e=>document.querySelector("#"+e.getAttribute("for"));_init(){const e=this._getLabel();e&&!e.classList.contains("active")&&(this._labelOut(),this._labelOver()),this._bindEvents();}_bindEvents(){["date","time"].includes(this._element.getAttribute("type"))||("file"===this._element.getAttribute("type")?EventHandler$1.on(this._element,EVENT_BLUR,(()=>{this._labelOut();})):(EventHandler$1.on(this._element,EVENT_FOCUS,(()=>{this._labelOut();})),EventHandler$1.on(this._element,EVENT_BLUR,(()=>{this._labelOver();})),EventHandler$1.on(this._element,EVENT_CHANGE$2,(()=>{this._labelToggle();}))));}_getLabel(){return SelectorEngine$1.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("active");}_labelOver(){if(this._isEmpty()){const e=this._getLabel();e&&e.classList.remove("active");}}_labelToggle(){this._isEmpty()?this._labelOver():this._labelOut();}}const InputLabel$1 = InputLabel;
57
59
 
58
- const NAME$A="inputnumber",DATA_KEY$c="bs.inputnumber",EVENT_KEY$e=`.${DATA_KEY$c}`,EVENT_CLICK$8=`click${EVENT_KEY$e}`,EVENT_CHANGE$1=`change${EVENT_KEY$e}`,EVENT_CLICK_DATA_API$g=`click${EVENT_KEY$e}.data-api`,EVENT_MOUSEDOWN_DATA_API$3=`mousedown${EVENT_KEY$e}.data-api`,EVENT_KEYUP_DATA_API$5=`keyup${EVENT_KEY$e}.data-api`,CLASS_NAME_ADAPTIVE="input-number-adaptive",CLASS_NAME_PERCENTAGE="input-number-percentage",CLASS_NAME_CURRENCY="input-number-currency",SELECTOR_INPUT='input[data-bs-input][type="number"]',SELECTOR_BTN='button[class^="input-number-"]';class InputNumber extends BaseComponent{constructor(e){super(e),this._wrapperElement=this._element.closest(".input-number"),this._label=new InputLabel$1(e),this._init(),this._bindEvents();}static get NAME(){return NAME$A}_init(){this._wrapperElement&&this._inputResize();}_bindEvents(){this._wrapperElement&&(SelectorEngine$1.find(SELECTOR_BTN,this._wrapperElement).forEach((e=>{EventHandler$1.on(e,EVENT_CLICK$8,(t=>{t.preventDefault(),this._incrDecr(e.classList.contains("input-number-sub"));}));})),EventHandler$1.on(this._element,EVENT_CHANGE$1,(()=>this._checkLimit())));}_inputResize(){if(this._wrapperElement.classList.contains(CLASS_NAME_ADAPTIVE)){let e=null;this._wrapperElement.classList.contains(CLASS_NAME_PERCENTAGE)||(e="calc(44px + "+this._element.value.length+"ch)"),this._wrapperElement.classList.contains(CLASS_NAME_CURRENCY)&&(e="calc(40px + 44px + "+this._element.value.length+"ch)"),e&&(this._element.style.width=e);}}_incrDecr(e){const t=parseFloat(this._element.value);if(!isNaN(t)){let n=parseFloat(this._element.getAttribute("step"));n||(n=1),this._element.value=t+n*(e?-1:1),EventHandler$1.trigger(this._element,EVENT_CHANGE$1);}}_checkLimit(){const e=parseFloat(this._element.value);if(!isNaN(e)){let t=e;const n=parseFloat(this._element.getAttribute("max")),E=parseFloat(this._element.getAttribute("min"));E&&e<E&&(t=E),n&&e>n&&(t=n),this._element.value=t;}this._inputResize();}}const createInput$4=e=>e&&e.matches(SELECTOR_INPUT)&&e.parentNode.querySelector(SELECTOR_BTN)?InputNumber.getOrCreateInstance(e):null;EventHandler$1.on(document,EVENT_MOUSEDOWN_DATA_API$3,SELECTOR_INPUT+", label",(function(){const e=InputLabel$1.getInputFromLabel(this)||this;createInput$4(e);})),EventHandler$1.on(document,EVENT_KEYUP_DATA_API$5,SELECTOR_INPUT+", label",(function(){const e=InputLabel$1.getInputFromLabel(this)||this,t=createInput$4(e);t&&t._label&&t._label._labelOut();})),EventHandler$1.on(document,EVENT_CLICK_DATA_API$g,SELECTOR_BTN,(function(){const e=this.closest(".input-number");if(e){const t=SelectorEngine$1.findOne(SELECTOR_INPUT,e);t&&InputNumber.getOrCreateInstance(t);}}));const InputNumber$1 = InputNumber;
60
+ const NAME$C="inputnumber",DATA_KEY$c="bs.inputnumber",EVENT_KEY$e=`.${DATA_KEY$c}`,EVENT_CLICK$8=`click${EVENT_KEY$e}`,EVENT_CHANGE$1=`change${EVENT_KEY$e}`,EVENT_CLICK_DATA_API$g=`click${EVENT_KEY$e}.data-api`,EVENT_MOUSEDOWN_DATA_API$3=`mousedown${EVENT_KEY$e}.data-api`,EVENT_KEYUP_DATA_API$5=`keyup${EVENT_KEY$e}.data-api`,CLASS_NAME_ADAPTIVE="input-number-adaptive",CLASS_NAME_PERCENTAGE="input-number-percentage",CLASS_NAME_CURRENCY="input-number-currency",SELECTOR_INPUT='input[data-bs-input][type="number"]',SELECTOR_BTN='button[class^="input-number-"]';class InputNumber extends BaseComponent{constructor(e){super(e),this._wrapperElement=this._element.closest(".input-number"),this._label=new InputLabel$1(e),this._init(),this._bindEvents();}static get NAME(){return NAME$C}_init(){this._wrapperElement&&this._inputResize();}_bindEvents(){this._wrapperElement&&(SelectorEngine$1.find(SELECTOR_BTN,this._wrapperElement).forEach((e=>{EventHandler$1.on(e,EVENT_CLICK$8,(t=>{t.preventDefault(),this._incrDecr(e.classList.contains("input-number-sub"));}));})),EventHandler$1.on(this._element,EVENT_CHANGE$1,(()=>this._checkLimit())));}_inputResize(){if(this._wrapperElement.classList.contains(CLASS_NAME_ADAPTIVE)){let e=null;this._wrapperElement.classList.contains(CLASS_NAME_PERCENTAGE)||(e="calc(44px + "+this._element.value.length+"ch)"),this._wrapperElement.classList.contains(CLASS_NAME_CURRENCY)&&(e="calc(40px + 44px + "+this._element.value.length+"ch)"),e&&(this._element.style.width=e);}}_incrDecr(e){const t=parseFloat(this._element.value);if(!isNaN(t)){let n=parseFloat(this._element.getAttribute("step"));n||(n=1),this._element.value=t+n*(e?-1:1),EventHandler$1.trigger(this._element,EVENT_CHANGE$1);}}_checkLimit(){const e=parseFloat(this._element.value);if(!isNaN(e)){let t=e;const n=parseFloat(this._element.getAttribute("max")),E=parseFloat(this._element.getAttribute("min"));E&&e<E&&(t=E),n&&e>n&&(t=n),this._element.value=t;}this._inputResize();}}const createInput$4=e=>e&&e.matches(SELECTOR_INPUT)&&e.parentNode.querySelector(SELECTOR_BTN)?InputNumber.getOrCreateInstance(e):null;EventHandler$1.on(document,EVENT_MOUSEDOWN_DATA_API$3,SELECTOR_INPUT+", label",(function(){const e=InputLabel$1.getInputFromLabel(this)||this;createInput$4(e);})),EventHandler$1.on(document,EVENT_KEYUP_DATA_API$5,SELECTOR_INPUT+", label",(function(){const e=InputLabel$1.getInputFromLabel(this)||this,t=createInput$4(e);t&&t._label&&t._label._labelOut();})),EventHandler$1.on(document,EVENT_CLICK_DATA_API$g,SELECTOR_BTN,(function(){const e=this.closest(".input-number");if(e){const t=SelectorEngine$1.findOne(SELECTOR_INPUT,e);t&&InputNumber.getOrCreateInstance(t);}}));const InputNumber$1 = InputNumber;
59
61
 
60
- const NAME$z="dimmer",EVENT_CLICK_DATA_API$f="click.bs.dimmer.data-api",SELECTOR_DATA_TOGGLE$b='[data-bs-toggle="dimmer"]';class Dimmer extends BaseComponent{constructor(t){super(t),this._isShown=!t.matches("[aria-hidden=true]"),this._isTransitioning=!1;}static get NAME(){return NAME$z}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 t=this._isAnimated();t&&(this._isTransitioning=!0),this._element.classList.remove("show"),this._queueCallback((()=>this._hideElement()),this._element,t);}_isAnimated(){return this._element.classList.contains("fade")}_showElement(){const t=this._isAnimated();this._element.removeAttribute("aria-hidden"),t&&reflow(this._element),this._element.classList.add("show");this._queueCallback((()=>{this._isTransitioning=!1;}),this._element,t);}_hideElement(){this._element.setAttribute("aria-hidden",!0),this._isTransitioning=!1;}}EventHandler$1.on(document,EVENT_CLICK_DATA_API$f,SELECTOR_DATA_TOGGLE$b,(function(){const t=getElementFromSelector(this),e=Dimmer.getOrCreateInstance(t);this.checked?e.show():e.hide();}));const Dimmer$1 = Dimmer;
62
+ const NAME$B="dimmer",EVENT_CLICK_DATA_API$f="click.bs.dimmer.data-api",SELECTOR_DATA_TOGGLE$c='[data-bs-toggle="dimmer"]';class Dimmer extends BaseComponent{constructor(t){super(t),this._isShown=!t.matches("[aria-hidden=true]"),this._isTransitioning=!1;}static get NAME(){return NAME$B}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 t=this._isAnimated();t&&(this._isTransitioning=!0),this._element.classList.remove("show"),this._queueCallback((()=>this._hideElement()),this._element,t);}_isAnimated(){return this._element.classList.contains("fade")}_showElement(){const t=this._isAnimated();this._element.removeAttribute("aria-hidden"),t&&reflow(this._element),this._element.classList.add("show");this._queueCallback((()=>{this._isTransitioning=!1;}),this._element,t);}_hideElement(){this._element.setAttribute("aria-hidden",!0),this._isTransitioning=!1;}}EventHandler$1.on(document,EVENT_CLICK_DATA_API$f,SELECTOR_DATA_TOGGLE$c,(function(){const t=getElementFromSelector(this),e=Dimmer.getOrCreateInstance(t);this.checked?e.show():e.hide();}));const Dimmer$1 = Dimmer;
61
63
 
62
- const enableDismissTrigger=(e,t="hide")=>{const s=`click.dismiss${e.EVENT_KEY}`,i=e.NAME;EventHandler$1.on(document,s,`[data-bs-dismiss="${i}"]`,(function(s){if(["A","AREA"].includes(this.tagName)&&s.preventDefault(),isDisabled(this))return;const n=getElementFromSelector(this)||this.closest(`.${i}`);e.getOrCreateInstance(n)[t]();}));};
64
+ const enableDismissTrigger=(e,t="hide")=>{const s=`click.dismiss${e.EVENT_KEY}`,i=e.NAME;EventHandler$1.on(document,s,`[data-bs-dismiss="${i}"]`,(function(s){if(["A","AREA"].includes(this.tagName)&&s.preventDefault(),isDisabled$1(this))return;const n=getElementFromSelector(this)||this.closest(`.${i}`);e.getOrCreateInstance(n)[t]();}));};
63
65
 
64
- const NAME$y="notification",DATA_KEY$b="bs.notification",EVENT_KEY$d=`.${DATA_KEY$b}`,EVENT_CLICK_DATA_API$e=`click${EVENT_KEY$d}.data-api`,EVENT_HIDDEN$7=`hidden${EVENT_KEY$d}`,EVENT_SHOW$7=`show${EVENT_KEY$d}`,Default$l={timeout:0},SELECTOR_DATA_TOGGLE$a='[data-bs-toggle="notification"]';class Notification extends BaseComponent{constructor(t,i){super(t),this._config=this._getConfig(i),this._isShown=this._element.classList.contains("show"),this._isTransitioning=!1,this._toId=null;}static get NAME(){return NAME$y}show(t,i){if(this._isShown||this._isTransitioning)return;const e=t||this._getElementTimeout(i);this._isShown=!0,this._isAnimated()&&(this._isTransitioning=!0),this._showElement(e);}hide(){if(!this._isShown||this._isTransitioning)return;this._isShown=!1;const t=this._isAnimated();t&&(this._isTransitioning=!0),this._element.classList.remove("show"),this._queueCallback((()=>this._hideElement()),this._element,t);}toggle(t){this._isShown?this.hide():this.show(null,t);}_isAnimated(){return this._element.classList.contains("fade")}_showElement(t){const i=this._isAnimated();this._element.style.display="block",this._element.removeAttribute("aria-hidden"),i&&reflow(this._element),this._element.classList.add("show");this._queueCallback((()=>{this._isTransitioning=!1,t&&this._setTimeout(t,(()=>this.hide()));}),this._element,i);}_hideElement(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._isTransitioning=!1;}_getConfig(t){return t={...Default$l,...Manipulator.getDataAttributes(this._element),..."object"==typeof t?t:{}}}_getElementTimeout(t){const i=t?parseInt(t.getAttribute("data-bs-timeout")):null;return i>0?i:this._config.timeout}_setTimeout(t,i){this._clearTimeout(),setTimeout(i,t);}_clearTimeout(){this._toId&&(clearTimeout(this._toId),this._toId=null);}}EventHandler$1.on(document,EVENT_CLICK_DATA_API$e,SELECTOR_DATA_TOGGLE$a,(function(t){const i=getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&t.preventDefault(),EventHandler$1.one(i,EVENT_SHOW$7,(t=>{t.defaultPrevented||EventHandler$1.one(i,EVENT_HIDDEN$7,(()=>{isVisible(this)&&this.focus();}));}));Notification.getOrCreateInstance(i).toggle(this);})),enableDismissTrigger(Notification);const Notification$1 = Notification;
66
+ const NAME$A="notification",DATA_KEY$b="bs.notification",EVENT_KEY$d=`.${DATA_KEY$b}`,EVENT_CLICK_DATA_API$e=`click${EVENT_KEY$d}.data-api`,EVENT_HIDDEN$7=`hidden${EVENT_KEY$d}`,EVENT_SHOW$7=`show${EVENT_KEY$d}`,Default$m={timeout:0},SELECTOR_DATA_TOGGLE$b='[data-bs-toggle="notification"]';class Notification extends BaseComponent{constructor(t,i){super(t),this._config=this._getConfig(i),this._isShown=this._element.classList.contains("show"),this._isTransitioning=!1,this._toId=null;}static get NAME(){return NAME$A}show(t,i){if(this._isShown||this._isTransitioning)return;const e=t||this._getElementTimeout(i);this._isShown=!0,this._isAnimated()&&(this._isTransitioning=!0),this._showElement(e);}hide(){if(!this._isShown||this._isTransitioning)return;this._isShown=!1;const t=this._isAnimated();t&&(this._isTransitioning=!0),this._element.classList.remove("show"),this._queueCallback((()=>this._hideElement()),this._element,t);}toggle(t){this._isShown?this.hide():this.show(null,t);}_isAnimated(){return this._element.classList.contains("fade")}_showElement(t){const i=this._isAnimated();this._element.style.display="block",this._element.removeAttribute("aria-hidden"),i&&reflow(this._element),this._element.classList.add("show");this._queueCallback((()=>{this._isTransitioning=!1,t&&this._setTimeout(t,(()=>this.hide()));}),this._element,i);}_hideElement(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._isTransitioning=!1;}_getConfig(t){return t={...Default$m,...Manipulator.getDataAttributes(this._element),..."object"==typeof t?t:{}}}_getElementTimeout(t){const i=t?parseInt(t.getAttribute("data-bs-timeout")):null;return i>0?i:this._config.timeout}_setTimeout(t,i){this._clearTimeout(),setTimeout(i,t);}_clearTimeout(){this._toId&&(clearTimeout(this._toId),this._toId=null);}}EventHandler$1.on(document,EVENT_CLICK_DATA_API$e,SELECTOR_DATA_TOGGLE$b,(function(t){const i=getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&t.preventDefault(),EventHandler$1.one(i,EVENT_SHOW$7,(t=>{t.defaultPrevented||EventHandler$1.one(i,EVENT_HIDDEN$7,(()=>{isVisible(this)&&this.focus();}));}));Notification.getOrCreateInstance(i).toggle(this);})),enableDismissTrigger(Notification);const Notification$1 = Notification;
65
67
 
66
- const NAME$x="cookiebar",DATA_KEY$a="bs.cookiebar",EVENT_KEY$c=`.${DATA_KEY$a}`,COOKIE_NAME="cookies_consent",SELECTOR_ACCEPT='[data-bs-accept="cookiebar"]',EVENT_CLOSE$1=`close${EVENT_KEY$c}`,EVENT_CLOSED$1=`closed${EVENT_KEY$c}`,EVENT_LOAD_DATA_API$3=`load${EVENT_KEY$c}.data-api`,EVENT_CLICK_DATA_API$d=`click${EVENT_KEY$c}.data-api`;class Cookiebar extends BaseComponent{constructor(e){super(e),this._isShown=this._element.classList.contains("show"),this._isTransitioning=!1;}static get NAME(){return NAME$x}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("show"),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(){document.cookie=COOKIE_NAME+"=; 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&&reflow(this._element),this._element.classList.add("show");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();document.cookie=COOKIE_NAME+"="+t+"; path=/; SameSite=Strict";}_getRootElement(e){const t=getElementFromSelector(e);let i=null;return t&&(i=t),i||(i=e.closest(".cookiebar")),i}_triggerCloseEvent(e){return EventHandler$1.trigger(e,EVENT_CLOSE$1)}_removeElement(e){e.classList.remove("show"),e.setAttribute("aria-hidden","true"),e.setAttribute("aria-live","off"),EventHandler$1.trigger(e,EVENT_CLOSED$1),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(){var e,t,i,s=document.cookie.split(";");for(e=0;e<s.length;e++)if(t=s[e].substring(0,s[e].indexOf("=")),i=s[e].substring(s[e].indexOf("=")+1),(t=t.replace(/^\s+|\s+$/g,""))==COOKIE_NAME)return unescape(i)}}EventHandler$1.on(document,EVENT_CLICK_DATA_API$d,SELECTOR_ACCEPT,(function(e){if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),isDisabled(this))return;const t=getElementFromSelector(this)||this.closest(`.${NAME$x}`);Cookiebar.getOrCreateInstance(t).accept();})),EventHandler$1.on(window,EVENT_LOAD_DATA_API$3,(function(){if(!Cookiebar._getCookieEU()){document.querySelectorAll(".cookiebar").forEach((e=>{Cookiebar.getOrCreateInstance(e).show();}));}}));const Cookiebar$1 = Cookiebar;
68
+ const NAME$z="cookiebar",DATA_KEY$a="bs.cookiebar",EVENT_KEY$c=`.${DATA_KEY$a}`,COOKIE_NAME="cookies_consent",SELECTOR_ACCEPT='[data-bs-accept="cookiebar"]',EVENT_CLOSE$1=`close${EVENT_KEY$c}`,EVENT_CLOSED$1=`closed${EVENT_KEY$c}`,EVENT_LOAD_DATA_API$3=`load${EVENT_KEY$c}.data-api`,EVENT_CLICK_DATA_API$d=`click${EVENT_KEY$c}.data-api`;class Cookiebar extends BaseComponent{constructor(e){super(e),this._isShown=this._element.classList.contains("show"),this._isTransitioning=!1;}static get NAME(){return NAME$z}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("show"),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(){document.cookie=COOKIE_NAME+"=; 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&&reflow(this._element),this._element.classList.add("show");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();document.cookie=COOKIE_NAME+"="+t+"; path=/; SameSite=Strict";}_getRootElement(e){const t=getElementFromSelector(e);let i=null;return t&&(i=t),i||(i=e.closest(".cookiebar")),i}_triggerCloseEvent(e){return EventHandler$1.trigger(e,EVENT_CLOSE$1)}_removeElement(e){e.classList.remove("show"),e.setAttribute("aria-hidden","true"),e.setAttribute("aria-live","off"),EventHandler$1.trigger(e,EVENT_CLOSED$1),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(){var e,t,i,s=document.cookie.split(";");for(e=0;e<s.length;e++)if(t=s[e].substring(0,s[e].indexOf("=")),i=s[e].substring(s[e].indexOf("=")+1),(t=t.replace(/^\s+|\s+$/g,""))==COOKIE_NAME)return unescape(i)}}EventHandler$1.on(document,EVENT_CLICK_DATA_API$d,SELECTOR_ACCEPT,(function(e){if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),isDisabled$1(this))return;const t=getElementFromSelector(this)||this.closest(`.${NAME$z}`);Cookiebar.getOrCreateInstance(t).accept();})),EventHandler$1.on(window,EVENT_LOAD_DATA_API$3,(function(){if(!Cookiebar._getCookieEU()){document.querySelectorAll(".cookiebar").forEach((e=>{Cookiebar.getOrCreateInstance(e).show();}));}}));const Cookiebar$1 = Cookiebar;
67
69
 
68
70
  const MEDIA_MOBILE="(max-width: 991px)",isScreenMobile=()=>window.matchMedia(MEDIA_MOBILE).matches;
69
71
 
@@ -71,9 +73,9 @@
71
73
 
72
74
  const CLASS_SCROLL_DISABLED="pagescroll-scroll-disabled";let disabled=!1,currentScrollPos=document.scrollingElement.scrollTop;const htmlContainer=document.querySelector("html");function disablePageScroll(){disabled=!0,currentScrollPos=document.scrollingElement.scrollTop,htmlContainer.classList.add(CLASS_SCROLL_DISABLED);}function enablePageScroll(){disabled=!1,htmlContainer.classList.remove(CLASS_SCROLL_DISABLED);}document.addEventListener("scroll",(()=>{disabled&&(document.scrollingElement.scrollTop=currentScrollPos);}));
73
75
 
74
- const NAME$w="navbarcollapsible",DATA_KEY$9="bs.navbarcollapsible",EVENT_KEY$b=`.${DATA_KEY$9}`,EVENT_CLICK_DATA_API$c=`click${EVENT_KEY$b}.data-api`,EVENT_CLICK$7=`click${EVENT_KEY$b}`,EVENT_KEYUP$2=`keyup${EVENT_KEY$b}`,EVENT_KEYDOWN$4=`keydown${EVENT_KEY$b}`,EVENT_HIDE$6=`hide${EVENT_KEY$b}`,EVENT_HIDDEN$6=`hidden${EVENT_KEY$b}`,EVENT_SHOW$6=`show${EVENT_KEY$b}`,EVENT_SHOWN$6=`shown${EVENT_KEY$b}`,EVENT_RESIZE$3=`resize${EVENT_KEY$b}`,SELECTOR_DATA_TOGGLE$9='[data-bs-toggle="navbarcollapsible"]',SELECTOR_BTN_CLOSE=".close-div button",SELECTOR_BTN_MENU_CLOSE=".close-menu",SELECTOR_NAVLINK="a.nav-link",SELECTOR_MEGAMENUNAVLINK=".nav-item .list-item";class NavBarCollapsible extends BaseComponent{constructor(e){super(e),this._isShown=this._element.classList.contains("expanded"),this._isTransitioning=!1,this._isMobile=isScreenMobile(),this._isKeyShift=!1,this._currItemIdx=0,this._btnClose=SelectorEngine$1.findOne(SELECTOR_BTN_CLOSE,this._element),this._btnBack=SelectorEngine$1.findOne(".it-back-button",this._element),this._menuWrapper=SelectorEngine$1.findOne(".menu-wrapper",this._element),this._overlay=null,this._setOverlay(),this._menuItems=SelectorEngine$1.find([SELECTOR_NAVLINK,SELECTOR_MEGAMENUNAVLINK,SELECTOR_BTN_MENU_CLOSE].join(","),this._element),this._bindEvents();}static get NAME(){return NAME$w}show(e){if(this._isShown||this._isTransitioning)return;EventHandler$1.trigger(this._element,EVENT_SHOW$6,{relatedTarget:e}).defaultPrevented||(this._btnBack&&this._btnBack.classList.add("show"),this._isShown=!0,disablePageScroll(),this._showElement());}hide(){if(!this._isShown||this._isTransitioning)return;if(EventHandler$1.trigger(this._element,EVENT_HIDE$6).defaultPrevented)return;this._isShown=!1;const e=this._isAnimated();e&&(this._isTransitioning=!0),this._btnBack&&this._btnBack.classList.remove("show"),this._overlay&&this._overlay.classList.remove("show"),this._element.classList.remove("expanded"),enablePageScroll(),this._queueCallback((()=>this._hideElement()),this._menuWrapper,e);}toggle(e){this._isShown?this.hide():this.show(e);}dispose(){EventHandler$1.off(window,EVENT_RESIZE$3),super.dispose();}_bindEvents(){EventHandler$1.on(window,EVENT_RESIZE$3,(()=>this._onResize())),this._overlay&&EventHandler$1.on(this._overlay,EVENT_CLICK$7,(()=>this.hide())),EventHandler$1.on(this._btnClose,EVENT_CLICK$7,(e=>{e.preventDefault(),this.hide();})),EventHandler$1.on(this._btnBack,EVENT_CLICK$7,(e=>{e.preventDefault(),this.hide();})),this._menuItems.forEach((e=>{EventHandler$1.on(e,EVENT_KEYDOWN$4,(e=>this._isMobile&&this._onMenuItemKeyDown(e))),EventHandler$1.on(e,EVENT_KEYUP$2,(e=>this._isMobile&&this._onMenuItemKeyUp(e))),EventHandler$1.on(e,EVENT_CLICK$7,(e=>this._isMobile&&this._onMenuItemClick(e)));}));}_onResize(){this._isMobile=isScreenMobile();}_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=getElementIndex(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&&reflow(this._element),this._element.classList.add("expanded"),this._overlay&&this._overlay.classList.add("show");this._queueCallback((()=>{this._isTransitioning=!1;const e=this._getNextVisibleItem(0);e.item&&(e.item.focus(),this._currItemIdx=e.index),EventHandler$1.trigger(this._element,EVENT_SHOWN$6);}),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,EventHandler$1.trigger(this._element,EVENT_HIDDEN$6);}_setOverlay(){this._overlay=SelectorEngine$1.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,s=null,n=e,l=t?-1:1,E=!1;for(;!(i||n==e&&E);)n==e&&(E=!0),this._isElementHidden(this._menuItems[n])||(i=this._menuItems[n],s=n),n+=l,n<0?n=this._menuItems.length-1:n>=this._menuItems.length&&(n=0);return {item:i,index:s}}}EventHandler$1.on(document,EVENT_CLICK_DATA_API$c,SELECTOR_DATA_TOGGLE$9,(function(e){const t=getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),EventHandler$1.one(t,EVENT_SHOW$6,(e=>{e.defaultPrevented||EventHandler$1.one(t,EVENT_HIDDEN$6,(()=>{isVisible(this)&&this.focus();}));}));NavBarCollapsible.getOrCreateInstance(t).toggle(this);}));const NavBarCollapsible$1 = NavBarCollapsible;
76
+ const NAME$y="navbarcollapsible",DATA_KEY$9="bs.navbarcollapsible",EVENT_KEY$b=`.${DATA_KEY$9}`,EVENT_CLICK_DATA_API$c=`click${EVENT_KEY$b}.data-api`,EVENT_CLICK$7=`click${EVENT_KEY$b}`,EVENT_KEYUP$2=`keyup${EVENT_KEY$b}`,EVENT_KEYDOWN$4=`keydown${EVENT_KEY$b}`,EVENT_HIDE$6=`hide${EVENT_KEY$b}`,EVENT_HIDDEN$6=`hidden${EVENT_KEY$b}`,EVENT_SHOW$6=`show${EVENT_KEY$b}`,EVENT_SHOWN$6=`shown${EVENT_KEY$b}`,EVENT_RESIZE$3=`resize${EVENT_KEY$b}`,SELECTOR_DATA_TOGGLE$a='[data-bs-toggle="navbarcollapsible"]',SELECTOR_BTN_CLOSE=".close-div button",SELECTOR_BTN_MENU_CLOSE=".close-menu",SELECTOR_NAVLINK="a.nav-link",SELECTOR_MEGAMENUNAVLINK=".nav-item .list-item";class NavBarCollapsible extends BaseComponent{constructor(e){super(e),this._isShown=this._element.classList.contains("expanded"),this._isTransitioning=!1,this._isMobile=isScreenMobile(),this._isKeyShift=!1,this._currItemIdx=0,this._btnClose=SelectorEngine$1.findOne(SELECTOR_BTN_CLOSE,this._element),this._btnBack=SelectorEngine$1.findOne(".it-back-button",this._element),this._menuWrapper=SelectorEngine$1.findOne(".menu-wrapper",this._element),this._overlay=null,this._setOverlay(),this._menuItems=SelectorEngine$1.find([SELECTOR_NAVLINK,SELECTOR_MEGAMENUNAVLINK,SELECTOR_BTN_MENU_CLOSE].join(","),this._element),this._bindEvents();}static get NAME(){return NAME$y}show(e){if(this._isShown||this._isTransitioning)return;EventHandler$1.trigger(this._element,EVENT_SHOW$6,{relatedTarget:e}).defaultPrevented||(this._btnBack&&this._btnBack.classList.add("show"),this._isShown=!0,disablePageScroll(),this._showElement());}hide(){if(!this._isShown||this._isTransitioning)return;if(EventHandler$1.trigger(this._element,EVENT_HIDE$6).defaultPrevented)return;this._isShown=!1;const e=this._isAnimated();e&&(this._isTransitioning=!0),this._btnBack&&this._btnBack.classList.remove("show"),this._overlay&&this._overlay.classList.remove("show"),this._element.classList.remove("expanded"),enablePageScroll(),this._queueCallback((()=>this._hideElement()),this._menuWrapper,e);}toggle(e){this._isShown?this.hide():this.show(e);}dispose(){EventHandler$1.off(window,EVENT_RESIZE$3),super.dispose();}_bindEvents(){EventHandler$1.on(window,EVENT_RESIZE$3,(()=>this._onResize())),this._overlay&&EventHandler$1.on(this._overlay,EVENT_CLICK$7,(()=>this.hide())),EventHandler$1.on(this._btnClose,EVENT_CLICK$7,(e=>{e.preventDefault(),this.hide();})),EventHandler$1.on(this._btnBack,EVENT_CLICK$7,(e=>{e.preventDefault(),this.hide();})),this._menuItems.forEach((e=>{EventHandler$1.on(e,EVENT_KEYDOWN$4,(e=>this._isMobile&&this._onMenuItemKeyDown(e))),EventHandler$1.on(e,EVENT_KEYUP$2,(e=>this._isMobile&&this._onMenuItemKeyUp(e))),EventHandler$1.on(e,EVENT_CLICK$7,(e=>this._isMobile&&this._onMenuItemClick(e)));}));}_onResize(){this._isMobile=isScreenMobile();}_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=getElementIndex(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&&reflow(this._element),this._element.classList.add("expanded"),this._overlay&&this._overlay.classList.add("show");this._queueCallback((()=>{this._isTransitioning=!1;const e=this._getNextVisibleItem(0);e.item&&(e.item.focus(),this._currItemIdx=e.index),EventHandler$1.trigger(this._element,EVENT_SHOWN$6);}),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,EventHandler$1.trigger(this._element,EVENT_HIDDEN$6);}_setOverlay(){this._overlay=SelectorEngine$1.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,s=null,n=e,l=t?-1:1,E=!1;for(;!(i||n==e&&E);)n==e&&(E=!0),this._isElementHidden(this._menuItems[n])||(i=this._menuItems[n],s=n),n+=l,n<0?n=this._menuItems.length-1:n>=this._menuItems.length&&(n=0);return {item:i,index:s}}}EventHandler$1.on(document,EVENT_CLICK_DATA_API$c,SELECTOR_DATA_TOGGLE$a,(function(e){const t=getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),EventHandler$1.one(t,EVENT_SHOW$6,(e=>{e.defaultPrevented||EventHandler$1.one(t,EVENT_HIDDEN$6,(()=>{isVisible(this)&&this.focus();}));}));NavBarCollapsible.getOrCreateInstance(t).toggle(this);}));const NavBarCollapsible$1 = NavBarCollapsible;
75
77
 
76
- const NAME$v="accordion",DATA_KEY$8="bs.accordion",EVENT_KEY$a=`.${DATA_KEY$8}`,EVENT_KEYDOWN$3=`keydown${EVENT_KEY$a}`,EVENT_KEYDOWN_DATA_API$1=`keydown${EVENT_KEY$a}.data-api`,SELECTOR_HEADBTN='.accordion-item > .accordion-header [data-bs-toggle="collapse"]';class Accordion extends BaseComponent{constructor(o){super(o),this._bindEvents();}static get NAME(){return NAME$v}handleKeyDown(o,t,e){const n={ArrowDown:o=>this._focusNext(o),ArrowUp:o=>this._focusPrev(o),Home:o=>this._focusFirst(o),End:o=>this._focusLast(o)};"function"==typeof n[o]&&(e&&e.preventDefault(),n[o](t));}_bindEvents(){SelectorEngine$1.find(SELECTOR_HEADBTN,this._element).forEach((o=>{EventHandler$1.on(o,EVENT_KEYDOWN$3,(o=>{this.handleKeyDown(o.key,o.currentTarget,o);}));}));}_getHeadButtons(){return SelectorEngine$1.find(":scope > "+SELECTOR_HEADBTN,this._element)}_focusNext(o){focusSimbling(o,this._getHeadButtons(),{loop:!0});}_focusPrev(o){focusSimbling(o,this._getHeadButtons(),{isDirectionTop:!0,loop:!0});}_focusFirst(o){focusSimbling(o,this._getHeadButtons(),{isDirectionTop:!0,isLimit:!0});}_focusLast(o){focusSimbling(o,this._getHeadButtons(),{isLimit:!0});}}EventHandler$1.on(document,EVENT_KEYDOWN_DATA_API$1,SELECTOR_HEADBTN,(function(o){const t=this.closest(".accordion");if(t){Accordion.getOrCreateInstance(t).handleKeyDown(o.key,this,o);}}));const Accordion$1 = Accordion;
78
+ const NAME$x="accordion",DATA_KEY$8="bs.accordion",EVENT_KEY$a=`.${DATA_KEY$8}`,EVENT_KEYDOWN$3=`keydown${EVENT_KEY$a}`,EVENT_KEYDOWN_DATA_API$1=`keydown${EVENT_KEY$a}.data-api`,SELECTOR_HEADBTN='.accordion-item > .accordion-header [data-bs-toggle="collapse"]';class Accordion extends BaseComponent{constructor(o){super(o),this._bindEvents();}static get NAME(){return NAME$x}handleKeyDown(o,t,e){const n={ArrowDown:o=>this._focusNext(o),ArrowUp:o=>this._focusPrev(o),Home:o=>this._focusFirst(o),End:o=>this._focusLast(o)};"function"==typeof n[o]&&(e&&e.preventDefault(),n[o](t));}_bindEvents(){SelectorEngine$1.find(SELECTOR_HEADBTN,this._element).forEach((o=>{EventHandler$1.on(o,EVENT_KEYDOWN$3,(o=>{this.handleKeyDown(o.key,o.currentTarget,o);}));}));}_getHeadButtons(){return SelectorEngine$1.find(":scope > "+SELECTOR_HEADBTN,this._element)}_focusNext(o){focusSimbling(o,this._getHeadButtons(),{loop:!0});}_focusPrev(o){focusSimbling(o,this._getHeadButtons(),{isDirectionTop:!0,loop:!0});}_focusFirst(o){focusSimbling(o,this._getHeadButtons(),{isDirectionTop:!0,isLimit:!0});}_focusLast(o){focusSimbling(o,this._getHeadButtons(),{isLimit:!0});}}EventHandler$1.on(document,EVENT_KEYDOWN_DATA_API$1,SELECTOR_HEADBTN,(function(o){const t=this.closest(".accordion");if(t){Accordion.getOrCreateInstance(t).handleKeyDown(o.key,this,o);}}));const Accordion$1 = Accordion;
77
79
 
78
80
  var getRandomValues,rnds8=new Uint8Array(16);function rng(){if(!getRandomValues&&!(getRandomValues="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 getRandomValues(rnds8)}
79
81
 
@@ -81,29 +83,29 @@
81
83
 
82
84
  function validate(t){return "string"==typeof t&&REGEX.test(t)}
83
85
 
84
- for(var byteToHex=[],i=0;i<256;++i)byteToHex.push((i+256).toString(16).substr(1));function stringify(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=(byteToHex[e[t+0]]+byteToHex[e[t+1]]+byteToHex[e[t+2]]+byteToHex[e[t+3]]+"-"+byteToHex[e[t+4]]+byteToHex[e[t+5]]+"-"+byteToHex[e[t+6]]+byteToHex[e[t+7]]+"-"+byteToHex[e[t+8]]+byteToHex[e[t+9]]+"-"+byteToHex[e[t+10]]+byteToHex[e[t+11]]+byteToHex[e[t+12]]+byteToHex[e[t+13]]+byteToHex[e[t+14]]+byteToHex[e[t+15]]).toLowerCase();if(!validate(o))throw TypeError("Stringified UUID is invalid");return o}
86
+ for(var byteToHex=[],i=0;i<256;++i)byteToHex.push((i+256).toString(16).substr(1));function stringify$1(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=(byteToHex[e[t+0]]+byteToHex[e[t+1]]+byteToHex[e[t+2]]+byteToHex[e[t+3]]+"-"+byteToHex[e[t+4]]+byteToHex[e[t+5]]+"-"+byteToHex[e[t+6]]+byteToHex[e[t+7]]+"-"+byteToHex[e[t+8]]+byteToHex[e[t+9]]+"-"+byteToHex[e[t+10]]+byteToHex[e[t+11]]+byteToHex[e[t+12]]+byteToHex[e[t+13]]+byteToHex[e[t+14]]+byteToHex[e[t+15]]).toLowerCase();if(!validate(o))throw TypeError("Stringified UUID is invalid");return o}
85
87
 
86
- function v4(r,n,i){var t=(r=r||{}).random||(r.rng||rng)();if(t[6]=15&t[6]|64,t[8]=63&t[8]|128,n){i=i||0;for(var o=0;o<16;++o)n[i+o]=t[o];return n}return stringify(t)}
88
+ function v4(r,n,i){var t=(r=r||{}).random||(r.rng||rng)();if(t[6]=15&t[6]|64,t[8]=63&t[8]|128,n){i=i||0;for(var o=0;o<16;++o)n[i+o]=t[o];return n}return stringify$1(t)}
87
89
 
88
90
  let ticking=!1,callbacks=[];class ScrollCallback{constructor(c,l){this.id=c,this._callback=l;}dispose(){removeCallBack(this.id);}_execute(c){this._callback(c);}}const removeCallBack=c=>{callbacks=callbacks.filter((l=>l.id!==c));},onDocumentScroll=c=>{if(callbacks.length||document.addEventListener("scroll",(c=>{ticking||(window.requestAnimationFrame((()=>{callbacks.forEach((l=>l.cb._execute(c))),ticking=!1;})),ticking=!0);})),"function"==typeof c){const l=new ScrollCallback(v4(),c);return callbacks.push({id:l.id,cb:l}),l}return console.error("[onDocumentScroll] the provided data has to be of type function"),null};const onDocumentScroll$1 = onDocumentScroll;
89
91
 
90
- var defaultInstanceSettings={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0},defaultTweenSettings={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},validTransforms=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],cache={CSS:{},springs:{}};function minMax(e,t,n){return Math.min(Math.max(e,t),n)}function stringContains(e,t){return e.indexOf(t)>-1}function applyArguments(e,t){return e.apply(null,t)}var is={arr:function(e){return Array.isArray(e)},obj:function(e){return stringContains(Object.prototype.toString.call(e),"Object")},pth:function(e){return is.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||is.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 is.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 is.hex(e)||is.rgb(e)||is.hsl(e)},key:function(e){return !defaultInstanceSettings.hasOwnProperty(e)&&!defaultTweenSettings.hasOwnProperty(e)&&"targets"!==e&&"keyframes"!==e}};function parseEasingParameters(e){var t=/\(([^)]+)\)/.exec(e);return t?t[1].split(",").map((function(e){return parseFloat(e)})):[]}function spring(e,t){var n=parseEasingParameters(e),r=minMax(is.und(n[0])?1:n[0],.1,100),a=minMax(is.und(n[1])?100:n[1],.1,100),i=minMax(is.und(n[2])?10:n[2],.1,100),o=minMax(is.und(n[3])?0:n[3],.1,100),s=Math.sqrt(a/r),u=i/(2*Math.sqrt(a*r)),c=u<1?s*Math.sqrt(1-u*u):0,l=u<1?(u*s-o)/c:-o+s;function g(e){var n=t?t*e/1e3:e;return n=u<1?Math.exp(-n*u*s)*(1*Math.cos(c*n)+l*Math.sin(c*n)):(1+l*n)*Math.exp(-n*s),0===e||1===e?e:1-n}return t?g:function(){var t=cache.springs[e];if(t)return t;for(var n=1/6,r=0,a=0;;)if(1===g(r+=n)){if(++a>=16)break}else a=0;var i=r*n*1e3;return cache.springs[e]=i,i}}function steps(e){return void 0===e&&(e=10),function(t){return Math.ceil(minMax(t,1e-6,1)*e)*(1/e)}}var bezier=function(){var e=.1;function t(e,t){return 1-3*t+3*e}function n(e,t){return 3*t-6*e}function r(e){return 3*e}function a(e,a,i){return ((t(a,i)*e+n(a,i))*e+r(a))*e}function i(e,a,i){return 3*t(a,i)*e*e+2*n(a,i)*e+r(a)}return function(t,n,r,o){if(0<=t&&t<=1&&0<=r&&r<=1){var s=new Float32Array(11);if(t!==n||r!==o)for(var u=0;u<11;++u)s[u]=a(u*e,t,r);return function(e){return t===n&&r===o||0===e||1===e?e:a(c(e),n,o)}}function c(n){for(var o=0,u=1;10!==u&&s[u]<=n;++u)o+=e;--u;var c=o+(n-s[u])/(s[u+1]-s[u])*e,l=i(c,t,r);return l>=.001?function(e,t,n,r){for(var o=0;o<4;++o){var s=i(t,n,r);if(0===s)return t;t-=(a(t,n,r)-e)/s;}return t}(n,c,t,r):0===l?c:function(e,t,n,r,i){var o,s,u=0;do{(o=a(s=t+(n-t)/2,r,i)-e)>0?n=s:t=s;}while(Math.abs(o)>1e-7&&++u<10);return s}(n,o,o+e,t,r)}}}(),penner=function(){var e={linear:function(){return function(e){return e}}},t={Sine:function(){return function(e){return 1-Math.cos(e*Math.PI/2)}},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,n=4;e<((t=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-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 n=minMax(e,1,10),r=minMax(t,.1,2);return function(e){return 0===e||1===e?e:-n*Math.pow(2,10*(e-1))*Math.sin((e-1-r/(2*Math.PI)*Math.asin(1/n))*(2*Math.PI)/r)}}};return ["Quad","Cubic","Quart","Quint","Expo"].forEach((function(e,n){t[e]=function(){return function(e){return Math.pow(e,n+2)}};})),Object.keys(t).forEach((function(n){var r=t[n];e["easeIn"+n]=r,e["easeOut"+n]=function(e,t){return function(n){return 1-r(e,t)(1-n)}},e["easeInOut"+n]=function(e,t){return function(n){return n<.5?r(e,t)(2*n)/2:1-r(e,t)(-2*n+2)/2}},e["easeOutIn"+n]=function(e,t){return function(n){return n<.5?(1-r(e,t)(1-2*n))/2:(r(e,t)(2*n-1)+1)/2}};})),e}();function parseEasings(e,t){if(is.fnc(e))return e;var n=e.split("(")[0],r=penner[n],a=parseEasingParameters(e);switch(n){case"spring":return spring(e,t);case"cubicBezier":return applyArguments(bezier,a);case"steps":return applyArguments(steps,a);default:return applyArguments(r,a)}}function selectString(e){try{return document.querySelectorAll(e)}catch(e){return}}function filterArray(e,t){for(var n=e.length,r=arguments.length>=2?arguments[1]:void 0,a=[],i=0;i<n;i++)if(i in e){var o=e[i];t.call(r,o,i,e)&&a.push(o);}return a}function flattenArray(e){return e.reduce((function(e,t){return e.concat(is.arr(t)?flattenArray(t):t)}),[])}function toArray(e){return is.arr(e)?e:(is.str(e)&&(e=selectString(e)||e),e instanceof NodeList||e instanceof HTMLCollection?[].slice.call(e):[e])}function arrayContains(e,t){return e.some((function(e){return e===t}))}function cloneObject(e){var t={};for(var n in e)t[n]=e[n];return t}function replaceObjectProps(e,t){var n=cloneObject(e);for(var r in e)n[r]=t.hasOwnProperty(r)?t[r]:e[r];return n}function mergeObjects(e,t){var n=cloneObject(e);for(var r in t)n[r]=is.und(e[r])?t[r]:e[r];return n}function rgbToRgba(e){var t=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(e);return t?"rgba("+t[1]+",1)":e}function hexToRgba(e){var t=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(e,t,n,r){return t+t+n+n+r+r})),n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return "rgba("+parseInt(n[1],16)+","+parseInt(n[2],16)+","+parseInt(n[3],16)+",1)"}function hslToRgba(e){var t,n,r,a=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(e),i=parseInt(a[1],10)/360,o=parseInt(a[2],10)/100,s=parseInt(a[3],10)/100,u=a[4]||1;function c(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(0==o)t=n=r=s;else {var l=s<.5?s*(1+o):s+o-s*o,g=2*s-l;t=c(g,l,i+1/3),n=c(g,l,i),r=c(g,l,i-1/3);}return "rgba("+255*t+","+255*n+","+255*r+","+u+")"}function colorToRgb(e){return is.rgb(e)?rgbToRgba(e):is.hex(e)?hexToRgba(e):is.hsl(e)?hslToRgba(e):void 0}function getUnit(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 getTransformUnit(e){return stringContains(e,"translate")||"perspective"===e?"px":stringContains(e,"rotate")||stringContains(e,"skew")?"deg":void 0}function getFunctionValue(e,t){return is.fnc(e)?e(t.target,t.id,t.total):e}function getAttribute(e,t){return e.getAttribute(t)}function convertPxToUnit(e,t,n){if(arrayContains([n,"deg","rad","turn"],getUnit(t)))return t;var r=cache.CSS[t+n];if(!is.und(r))return r;var a=document.createElement(e.tagName),i=e.parentNode&&e.parentNode!==document?e.parentNode:document.body;i.appendChild(a),a.style.position="absolute",a.style.width=100+n;var o=100/a.offsetWidth;i.removeChild(a);var s=o*parseFloat(t);return cache.CSS[t+n]=s,s}function getCSSValue(e,t,n){if(t in e.style){var r=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),a=e.style[t]||getComputedStyle(e).getPropertyValue(r)||"0";return n?convertPxToUnit(e,a,n):a}}function getAnimationType(e,t){return is.dom(e)&&!is.inp(e)&&(!is.nil(getAttribute(e,t))||is.svg(e)&&e[t])?"attribute":is.dom(e)&&arrayContains(validTransforms,t)?"transform":is.dom(e)&&"transform"!==t&&getCSSValue(e,t)?"css":null!=e[t]?"object":void 0}function getElementTransforms(e){if(is.dom(e)){for(var t,n=e.style.transform||"",r=/(\w+)\(([^)]*)\)/g,a=new Map;t=r.exec(n);)a.set(t[1],t[2]);return a}}function getTransformValue(e,t,n,r){var a=stringContains(t,"scale")?1:0+getTransformUnit(t),i=getElementTransforms(e).get(t)||a;return n&&(n.transforms.list.set(t,i),n.transforms.last=t),r?convertPxToUnit(e,i,r):i}function getOriginalTargetValue(e,t,n,r){switch(getAnimationType(e,t)){case"transform":return getTransformValue(e,t,r,n);case"css":return getCSSValue(e,t,n);case"attribute":return getAttribute(e,t);default:return e[t]||0}}function getRelativeValue(e,t){var n=/^(\*=|\+=|-=)/.exec(e);if(!n)return e;var r=getUnit(e)||0,a=parseFloat(t),i=parseFloat(e.replace(n[0],""));switch(n[0][0]){case"+":return a+i+r;case"-":return a-i+r;case"*":return a*i+r}}function validateValue(e,t){if(is.col(e))return colorToRgb(e);if(/\s/g.test(e))return e;var n=getUnit(e),r=n?e.substr(0,e.length-n.length):e;return t?r+t:r}function getDistance(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function getCircleLength(e){return 2*Math.PI*getAttribute(e,"r")}function getRectLength(e){return 2*getAttribute(e,"width")+2*getAttribute(e,"height")}function getLineLength(e){return getDistance({x:getAttribute(e,"x1"),y:getAttribute(e,"y1")},{x:getAttribute(e,"x2"),y:getAttribute(e,"y2")})}function getPolylineLength(e){for(var t,n=e.points,r=0,a=0;a<n.numberOfItems;a++){var i=n.getItem(a);a>0&&(r+=getDistance(t,i)),t=i;}return r}function getPolygonLength(e){var t=e.points;return getPolylineLength(e)+getDistance(t.getItem(t.numberOfItems-1),t.getItem(0))}function getTotalLength(e){if(e.getTotalLength)return e.getTotalLength();switch(e.tagName.toLowerCase()){case"circle":return getCircleLength(e);case"rect":return getRectLength(e);case"line":return getLineLength(e);case"polyline":return getPolylineLength(e);case"polygon":return getPolygonLength(e)}}function setDashoffset(e){var t=getTotalLength(e);return e.setAttribute("stroke-dasharray",t),t}function getParentSvgEl(e){for(var t=e.parentNode;is.svg(t)&&is.svg(t.parentNode);)t=t.parentNode;return t}function getParentSvg(e,t){var n=t||{},r=n.el||getParentSvgEl(e),a=r.getBoundingClientRect(),i=getAttribute(r,"viewBox"),o=a.width,s=a.height,u=n.viewBox||(i?i.split(" "):[0,0,o,s]);return {el:r,viewBox:u,x:u[0]/1,y:u[1]/1,w:o,h:s,vW:u[2],vH:u[3]}}function getPath(e,t){var n=is.str(e)?selectString(e)[0]:e,r=t||100;return function(e){return {property:e,el:n,svg:getParentSvg(n),totalLength:getTotalLength(n)*(r/100)}}}function getPathProgress(e,t,n){function r(n){void 0===n&&(n=0);var r=t+n>=1?t+n:0;return e.el.getPointAtLength(r)}var a=getParentSvg(e.el,e.svg),i=r(),o=r(-1),s=r(1),u=n?1:a.w/a.vW,c=n?1:a.h/a.vH;switch(e.property){case"x":return (i.x-a.x)*u;case"y":return (i.y-a.y)*c;case"angle":return 180*Math.atan2(s.y-o.y,s.x-o.x)/Math.PI}}function decomposeValue(e,t){var n=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,r=validateValue(is.pth(e)?e.totalLength:e,t)+"";return {original:r,numbers:r.match(n)?r.match(n).map(Number):[0],strings:is.str(e)||t?r.split(n):[]}}function parseTargets(e){return filterArray(e?flattenArray(is.arr(e)?e.map(toArray):toArray(e)):[],(function(e,t,n){return n.indexOf(e)===t}))}function getAnimatables(e){var t=parseTargets(e);return t.map((function(e,n){return {target:e,id:n,total:t.length,transforms:{list:getElementTransforms(e)}}}))}function normalizePropertyTweens(e,t){var n=cloneObject(t);if(/^spring/.test(n.easing)&&(n.duration=spring(n.easing)),is.arr(e)){var r=e.length;2===r&&!is.obj(e[0])?e={value:e}:is.fnc(t.duration)||(n.duration=t.duration/r);}var a=is.arr(e)?e:[e];return a.map((function(e,n){var r=is.obj(e)&&!is.pth(e)?e:{value:e};return is.und(r.delay)&&(r.delay=n?0:t.delay),is.und(r.endDelay)&&(r.endDelay=n===a.length-1?t.endDelay:0),r})).map((function(e){return mergeObjects(e,n)}))}function flattenKeyframes(e){for(var t=filterArray(flattenArray(e.map((function(e){return Object.keys(e)}))),(function(e){return is.key(e)})).reduce((function(e,t){return e.indexOf(t)<0&&e.push(t),e}),[]),n={},r=function(r){var a=t[r];n[a]=e.map((function(e){var t={};for(var n in e)is.key(n)?n==a&&(t.value=e[n]):t[n]=e[n];return t}));},a=0;a<t.length;a++)r(a);return n}function getProperties(e,t){var n=[],r=t.keyframes;for(var a in r&&(t=mergeObjects(flattenKeyframes(r),t)),t)is.key(a)&&n.push({name:a,tweens:normalizePropertyTweens(t[a],e)});return n}function normalizeTweenValues(e,t){var n={};for(var r in e){var a=getFunctionValue(e[r],t);is.arr(a)&&1===(a=a.map((function(e){return getFunctionValue(e,t)}))).length&&(a=a[0]),n[r]=a;}return n.duration=parseFloat(n.duration),n.delay=parseFloat(n.delay),n}function normalizeTweens(e,t){var n;return e.tweens.map((function(r){var a=normalizeTweenValues(r,t),i=a.value,o=is.arr(i)?i[1]:i,s=getUnit(o),u=getOriginalTargetValue(t.target,e.name,s,t),c=n?n.to.original:u,l=is.arr(i)?i[0]:c,g=getUnit(l)||getUnit(u),f=s||g;return is.und(o)&&(o=c),a.from=decomposeValue(l,f),a.to=decomposeValue(getRelativeValue(o,l),f),a.start=n?n.end:0,a.end=a.start+a.delay+a.duration+a.endDelay,a.easing=parseEasings(a.easing,a.duration),a.isPath=is.pth(i),a.isPathTargetInsideSVG=a.isPath&&is.svg(t.target),a.isColor=is.col(a.from.original),a.isColor&&(a.round=1),n=a,a}))}var setProgressValue={css:function(e,t,n){return e.style[t]=n},attribute:function(e,t,n){return e.setAttribute(t,n)},object:function(e,t,n){return e[t]=n},transform:function(e,t,n,r,a){if(r.list.set(t,n),t===r.last||a){var i="";r.list.forEach((function(e,t){i+=t+"("+e+") ";})),e.style.transform=i;}}};function setTargetsValue(e,t){getAnimatables(e).forEach((function(e){for(var n in t){var r=getFunctionValue(t[n],e),a=e.target,i=getUnit(r),o=getOriginalTargetValue(a,n,i,e),s=getRelativeValue(validateValue(r,i||getUnit(o)),o),u=getAnimationType(a,n);setProgressValue[u](a,n,s,e.transforms,!0);}}));}function createAnimation(e,t){var n=getAnimationType(e.target,t.name);if(n){var r=normalizeTweens(t,e),a=r[r.length-1];return {type:n,property:t.name,animatable:e,tweens:r,duration:a.end,delay:r[0].delay,endDelay:a.endDelay}}}function getAnimations(e,t){return filterArray(flattenArray(e.map((function(e){return t.map((function(t){return createAnimation(e,t)}))}))),(function(e){return !is.und(e)}))}function getInstanceTimings(e,t){var n=e.length,r=function(e){return e.timelineOffset?e.timelineOffset:0},a={};return a.duration=n?Math.max.apply(Math,e.map((function(e){return r(e)+e.duration}))):t.duration,a.delay=n?Math.min.apply(Math,e.map((function(e){return r(e)+e.delay}))):t.delay,a.endDelay=n?a.duration-Math.max.apply(Math,e.map((function(e){return r(e)+e.duration-e.endDelay}))):t.endDelay,a}var instanceID=0;function createNewInstance(e){var t=replaceObjectProps(defaultInstanceSettings,e),n=replaceObjectProps(defaultTweenSettings,e),r=getProperties(n,e),a=getAnimatables(e.targets),i=getAnimations(a,r),o=getInstanceTimings(i,n),s=instanceID;return instanceID++,mergeObjects(t,{id:s,children:[],animatables:a,animations:i,duration:o.duration,delay:o.delay,endDelay:o.endDelay})}var activeInstances=[],engine=function(){var e;function t(n){for(var r=activeInstances.length,a=0;a<r;){var i=activeInstances[a];i.paused?(activeInstances.splice(a,1),r--):(i.tick(n),a++);}e=a>0?requestAnimationFrame(t):void 0;}return "undefined"!=typeof document&&document.addEventListener("visibilitychange",(function(){anime.suspendWhenDocumentHidden&&(isDocumentHidden()?e=cancelAnimationFrame(e):(activeInstances.forEach((function(e){return e._onDocumentVisibility()})),engine()));})),function(){e||isDocumentHidden()&&anime.suspendWhenDocumentHidden||!(activeInstances.length>0)||(e=requestAnimationFrame(t));}}();function isDocumentHidden(){return !!document&&document.hidden}function anime(e){void 0===e&&(e={});var t,n=0,r=0,a=0,i=0,o=null;function s(e){var t=window.Promise&&new Promise((function(e){return o=e}));return e.finished=t,t}var u=createNewInstance(e);s(u);function c(){var e=u.direction;"alternate"!==e&&(u.direction="normal"!==e?"normal":"reverse"),u.reversed=!u.reversed,t.forEach((function(e){return e.reversed=u.reversed}));}function l(e){return u.reversed?u.duration-e:e}function g(){n=0,r=l(u.currentTime)*(1/anime.speed);}function f(e,t){t&&t.seek(e-t.timelineOffset);}function m(e){for(var t=0,n=u.animations,r=n.length;t<r;){var a=n[t],i=a.animatable,o=a.tweens,s=o.length-1,c=o[s];s&&(c=filterArray(o,(function(t){return e<t.end}))[0]||c);for(var l=minMax(e-c.start-c.delay,0,c.duration)/c.duration,g=isNaN(l)?1:c.easing(l),f=c.to.strings,m=c.round,d=[],p=c.to.numbers.length,v=void 0,h=0;h<p;h++){var y=void 0,b=c.to.numbers[h],T=c.from.numbers[h]||0;y=c.isPath?getPathProgress(c.value,g*b,c.isPathTargetInsideSVG):T+g*(b-T),m&&(c.isColor&&h>2||(y=Math.round(y*m)/m)),d.push(y);}var x=f.length;if(x){v=f[0];for(var M=0;M<x;M++){f[M];var A=f[M+1],P=d[M];isNaN(P)||(v+=A?P+A:P+" ");}}else v=d[0];setProgressValue[a.type](i.target,a.property,v,i.transforms),a.currentValue=v,t++;}}function d(e){u[e]&&!u.passThrough&&u[e](u);}function p(e){var g=u.duration,p=u.delay,v=g-u.endDelay,h=l(e);u.progress=minMax(h/g*100,0,100),u.reversePlayback=h<u.currentTime,t&&function(e){if(u.reversePlayback)for(var n=i;n--;)f(e,t[n]);else for(var r=0;r<i;r++)f(e,t[r]);}(h),!u.began&&u.currentTime>0&&(u.began=!0,d("begin")),!u.loopBegan&&u.currentTime>0&&(u.loopBegan=!0,d("loopBegin")),h<=p&&0!==u.currentTime&&m(0),(h>=v&&u.currentTime!==g||!g)&&m(g),h>p&&h<v?(u.changeBegan||(u.changeBegan=!0,u.changeCompleted=!1,d("changeBegin")),d("change"),m(h)):u.changeBegan&&(u.changeCompleted=!0,u.changeBegan=!1,d("changeComplete")),u.currentTime=minMax(h,0,g),u.began&&d("update"),e>=g&&(r=0,u.remaining&&!0!==u.remaining&&u.remaining--,u.remaining?(n=a,d("loopComplete"),u.loopBegan=!1,"alternate"===u.direction&&c()):(u.paused=!0,u.completed||(u.completed=!0,d("loopComplete"),d("complete"),!u.passThrough&&"Promise"in window&&(o(),s(u)))));}return u.reset=function(){var e=u.direction;u.passThrough=!1,u.currentTime=0,u.progress=0,u.paused=!0,u.began=!1,u.loopBegan=!1,u.changeBegan=!1,u.completed=!1,u.changeCompleted=!1,u.reversePlayback=!1,u.reversed="reverse"===e,u.remaining=u.loop,t=u.children;for(var n=i=t.length;n--;)u.children[n].reset();(u.reversed&&!0!==u.loop||"alternate"===e&&1===u.loop)&&u.remaining++,m(u.reversed?u.duration:0);},u._onDocumentVisibility=g,u.set=function(e,t){return setTargetsValue(e,t),u},u.tick=function(e){a=e,n||(n=a),p((a+(r-n))*anime.speed);},u.seek=function(e){p(l(e));},u.pause=function(){u.paused=!0,g();},u.play=function(){u.paused&&(u.completed&&u.reset(),u.paused=!1,activeInstances.push(u),g(),engine());},u.reverse=function(){c(),u.completed=!u.reversed,g();},u.restart=function(){u.reset(),u.play();},u.remove=function(e){removeTargetsFromInstance(parseTargets(e),u);},u.reset(),u.autoplay&&u.play(),u}function removeTargetsFromAnimations(e,t){for(var n=t.length;n--;)arrayContains(e,t[n].animatable.target)&&t.splice(n,1);}function removeTargetsFromInstance(e,t){var n=t.animations,r=t.children;removeTargetsFromAnimations(e,n);for(var a=r.length;a--;){var i=r[a],o=i.animations;removeTargetsFromAnimations(e,o),o.length||i.children.length||r.splice(a,1);}n.length||r.length||t.pause();}function removeTargetsFromActiveInstances(e){for(var t=parseTargets(e),n=activeInstances.length;n--;){removeTargetsFromInstance(t,activeInstances[n]);}}function stagger(e,t){void 0===t&&(t={});var n=t.direction||"normal",r=t.easing?parseEasings(t.easing):null,a=t.grid,i=t.axis,o=t.from||0,s="first"===o,u="center"===o,c="last"===o,l=is.arr(e),g=l?parseFloat(e[0]):parseFloat(e),f=l?parseFloat(e[1]):0,m=getUnit(l?e[1]:e)||0,d=t.start||0+(l?g:0),p=[],v=0;return function(e,t,h){if(s&&(o=0),u&&(o=(h-1)/2),c&&(o=h-1),!p.length){for(var y=0;y<h;y++){if(a){var b=u?(a[0]-1)/2:o%a[0],T=u?(a[1]-1)/2:Math.floor(o/a[0]),x=b-y%a[0],M=T-Math.floor(y/a[0]),A=Math.sqrt(x*x+M*M);"x"===i&&(A=-x),"y"===i&&(A=-M),p.push(A);}else p.push(Math.abs(o-y));v=Math.max.apply(Math,p);}r&&(p=p.map((function(e){return r(e/v)*v}))),"reverse"===n&&(p=p.map((function(e){return i?e<0?-1*e:-e:Math.abs(v-e)})));}return d+(l?(f-g)/v:g)*(Math.round(100*p[t])/100)+m}}function timeline(e){void 0===e&&(e={});var t=anime(e);return t.duration=0,t.add=function(n,r){var a=activeInstances.indexOf(t),i=t.children;function o(e){e.passThrough=!0;}a>-1&&activeInstances.splice(a,1);for(var s=0;s<i.length;s++)o(i[s]);var u=mergeObjects(n,replaceObjectProps(defaultTweenSettings,e));u.targets=u.targets||e.targets;var c=t.duration;u.autoplay=!1,u.direction=t.direction,u.timelineOffset=is.und(r)?c:getRelativeValue(r,c),o(t),t.seek(u.timelineOffset);var l=anime(u);o(l),i.push(l);var g=getInstanceTimings(i,e);return t.delay=g.delay,t.endDelay=g.endDelay,t.duration=g.duration,t.seek(0),t.reset(),t.autoplay&&t.play(),t},t}anime.version="3.2.1",anime.speed=1,anime.suspendWhenDocumentHidden=!0,anime.running=activeInstances,anime.remove=removeTargetsFromActiveInstances,anime.get=getOriginalTargetValue,anime.set=setTargetsValue,anime.convertPx=convertPxToUnit,anime.path=getPath,anime.setDashoffset=setDashoffset,anime.stagger=stagger,anime.timeline=timeline,anime.easing=parseEasings,anime.penner=penner,anime.random=function(e,t){return Math.floor(Math.random()*(t-e+1))+e};
92
+ var defaultInstanceSettings={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0},defaultTweenSettings={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},validTransforms=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],cache={CSS:{},springs:{}};function minMax(e,t,n){return Math.min(Math.max(e,t),n)}function stringContains(e,t){return e.indexOf(t)>-1}function applyArguments(e,t){return e.apply(null,t)}var is={arr:function(e){return Array.isArray(e)},obj:function(e){return stringContains(Object.prototype.toString.call(e),"Object")},pth:function(e){return is.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||is.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 is.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 is.hex(e)||is.rgb(e)||is.hsl(e)},key:function(e){return !defaultInstanceSettings.hasOwnProperty(e)&&!defaultTweenSettings.hasOwnProperty(e)&&"targets"!==e&&"keyframes"!==e}};function parseEasingParameters(e){var t=/\(([^)]+)\)/.exec(e);return t?t[1].split(",").map((function(e){return parseFloat(e)})):[]}function spring(e,t){var n=parseEasingParameters(e),r=minMax(is.und(n[0])?1:n[0],.1,100),a=minMax(is.und(n[1])?100:n[1],.1,100),i=minMax(is.und(n[2])?10:n[2],.1,100),o=minMax(is.und(n[3])?0:n[3],.1,100),s=Math.sqrt(a/r),u=i/(2*Math.sqrt(a*r)),c=u<1?s*Math.sqrt(1-u*u):0,l=u<1?(u*s-o)/c:-o+s;function g(e){var n=t?t*e/1e3:e;return n=u<1?Math.exp(-n*u*s)*(1*Math.cos(c*n)+l*Math.sin(c*n)):(1+l*n)*Math.exp(-n*s),0===e||1===e?e:1-n}return t?g:function(){var t=cache.springs[e];if(t)return t;for(var n=1/6,r=0,a=0;;)if(1===g(r+=n)){if(++a>=16)break}else a=0;var i=r*n*1e3;return cache.springs[e]=i,i}}function steps(e){return void 0===e&&(e=10),function(t){return Math.ceil(minMax(t,1e-6,1)*e)*(1/e)}}var bezier=function(){var e=.1;function t(e,t){return 1-3*t+3*e}function n(e,t){return 3*t-6*e}function r(e){return 3*e}function a(e,a,i){return ((t(a,i)*e+n(a,i))*e+r(a))*e}function i(e,a,i){return 3*t(a,i)*e*e+2*n(a,i)*e+r(a)}return function(t,n,r,o){if(0<=t&&t<=1&&0<=r&&r<=1){var s=new Float32Array(11);if(t!==n||r!==o)for(var u=0;u<11;++u)s[u]=a(u*e,t,r);return function(e){return t===n&&r===o||0===e||1===e?e:a(c(e),n,o)}}function c(n){for(var o=0,u=1;10!==u&&s[u]<=n;++u)o+=e;--u;var c=o+(n-s[u])/(s[u+1]-s[u])*e,l=i(c,t,r);return l>=.001?function(e,t,n,r){for(var o=0;o<4;++o){var s=i(t,n,r);if(0===s)return t;t-=(a(t,n,r)-e)/s;}return t}(n,c,t,r):0===l?c:function(e,t,n,r,i){var o,s,u=0;do{(o=a(s=t+(n-t)/2,r,i)-e)>0?n=s:t=s;}while(Math.abs(o)>1e-7&&++u<10);return s}(n,o,o+e,t,r)}}}(),penner=function(){var e={linear:function(){return function(e){return e}}},t={Sine:function(){return function(e){return 1-Math.cos(e*Math.PI/2)}},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,n=4;e<((t=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-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 n=minMax(e,1,10),r=minMax(t,.1,2);return function(e){return 0===e||1===e?e:-n*Math.pow(2,10*(e-1))*Math.sin((e-1-r/(2*Math.PI)*Math.asin(1/n))*(2*Math.PI)/r)}}};return ["Quad","Cubic","Quart","Quint","Expo"].forEach((function(e,n){t[e]=function(){return function(e){return Math.pow(e,n+2)}};})),Object.keys(t).forEach((function(n){var r=t[n];e["easeIn"+n]=r,e["easeOut"+n]=function(e,t){return function(n){return 1-r(e,t)(1-n)}},e["easeInOut"+n]=function(e,t){return function(n){return n<.5?r(e,t)(2*n)/2:1-r(e,t)(-2*n+2)/2}},e["easeOutIn"+n]=function(e,t){return function(n){return n<.5?(1-r(e,t)(1-2*n))/2:(r(e,t)(2*n-1)+1)/2}};})),e}();function parseEasings(e,t){if(is.fnc(e))return e;var n=e.split("(")[0],r=penner[n],a=parseEasingParameters(e);switch(n){case"spring":return spring(e,t);case"cubicBezier":return applyArguments(bezier,a);case"steps":return applyArguments(steps,a);default:return applyArguments(r,a)}}function selectString(e){try{return document.querySelectorAll(e)}catch(e){return}}function filterArray(e,t){for(var n=e.length,r=arguments.length>=2?arguments[1]:void 0,a=[],i=0;i<n;i++)if(i in e){var o=e[i];t.call(r,o,i,e)&&a.push(o);}return a}function flattenArray(e){return e.reduce((function(e,t){return e.concat(is.arr(t)?flattenArray(t):t)}),[])}function toArray(e){return is.arr(e)?e:(is.str(e)&&(e=selectString(e)||e),e instanceof NodeList||e instanceof HTMLCollection?[].slice.call(e):[e])}function arrayContains(e,t){return e.some((function(e){return e===t}))}function cloneObject(e){var t={};for(var n in e)t[n]=e[n];return t}function replaceObjectProps(e,t){var n=cloneObject(e);for(var r in e)n[r]=t.hasOwnProperty(r)?t[r]:e[r];return n}function mergeObjects(e,t){var n=cloneObject(e);for(var r in t)n[r]=is.und(e[r])?t[r]:e[r];return n}function rgbToRgba(e){var t=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(e);return t?"rgba("+t[1]+",1)":e}function hexToRgba(e){var t=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(e,t,n,r){return t+t+n+n+r+r})),n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return "rgba("+parseInt(n[1],16)+","+parseInt(n[2],16)+","+parseInt(n[3],16)+",1)"}function hslToRgba(e){var t,n,r,a=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(e),i=parseInt(a[1],10)/360,o=parseInt(a[2],10)/100,s=parseInt(a[3],10)/100,u=a[4]||1;function c(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(0==o)t=n=r=s;else {var l=s<.5?s*(1+o):s+o-s*o,g=2*s-l;t=c(g,l,i+1/3),n=c(g,l,i),r=c(g,l,i-1/3);}return "rgba("+255*t+","+255*n+","+255*r+","+u+")"}function colorToRgb(e){return is.rgb(e)?rgbToRgba(e):is.hex(e)?hexToRgba(e):is.hsl(e)?hslToRgba(e):void 0}function getUnit(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 getTransformUnit(e){return stringContains(e,"translate")||"perspective"===e?"px":stringContains(e,"rotate")||stringContains(e,"skew")?"deg":void 0}function getFunctionValue(e,t){return is.fnc(e)?e(t.target,t.id,t.total):e}function getAttribute$1(e,t){return e.getAttribute(t)}function convertPxToUnit(e,t,n){if(arrayContains([n,"deg","rad","turn"],getUnit(t)))return t;var r=cache.CSS[t+n];if(!is.und(r))return r;var a=document.createElement(e.tagName),i=e.parentNode&&e.parentNode!==document?e.parentNode:document.body;i.appendChild(a),a.style.position="absolute",a.style.width=100+n;var o=100/a.offsetWidth;i.removeChild(a);var s=o*parseFloat(t);return cache.CSS[t+n]=s,s}function getCSSValue(e,t,n){if(t in e.style){var r=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),a=e.style[t]||getComputedStyle(e).getPropertyValue(r)||"0";return n?convertPxToUnit(e,a,n):a}}function getAnimationType(e,t){return is.dom(e)&&!is.inp(e)&&(!is.nil(getAttribute$1(e,t))||is.svg(e)&&e[t])?"attribute":is.dom(e)&&arrayContains(validTransforms,t)?"transform":is.dom(e)&&"transform"!==t&&getCSSValue(e,t)?"css":null!=e[t]?"object":void 0}function getElementTransforms(e){if(is.dom(e)){for(var t,n=e.style.transform||"",r=/(\w+)\(([^)]*)\)/g,a=new Map;t=r.exec(n);)a.set(t[1],t[2]);return a}}function getTransformValue(e,t,n,r){var a=stringContains(t,"scale")?1:0+getTransformUnit(t),i=getElementTransforms(e).get(t)||a;return n&&(n.transforms.list.set(t,i),n.transforms.last=t),r?convertPxToUnit(e,i,r):i}function getOriginalTargetValue(e,t,n,r){switch(getAnimationType(e,t)){case"transform":return getTransformValue(e,t,r,n);case"css":return getCSSValue(e,t,n);case"attribute":return getAttribute$1(e,t);default:return e[t]||0}}function getRelativeValue(e,t){var n=/^(\*=|\+=|-=)/.exec(e);if(!n)return e;var r=getUnit(e)||0,a=parseFloat(t),i=parseFloat(e.replace(n[0],""));switch(n[0][0]){case"+":return a+i+r;case"-":return a-i+r;case"*":return a*i+r}}function validateValue(e,t){if(is.col(e))return colorToRgb(e);if(/\s/g.test(e))return e;var n=getUnit(e),r=n?e.substr(0,e.length-n.length):e;return t?r+t:r}function getDistance(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function getCircleLength(e){return 2*Math.PI*getAttribute$1(e,"r")}function getRectLength(e){return 2*getAttribute$1(e,"width")+2*getAttribute$1(e,"height")}function getLineLength(e){return getDistance({x:getAttribute$1(e,"x1"),y:getAttribute$1(e,"y1")},{x:getAttribute$1(e,"x2"),y:getAttribute$1(e,"y2")})}function getPolylineLength(e){for(var t,n=e.points,r=0,a=0;a<n.numberOfItems;a++){var i=n.getItem(a);a>0&&(r+=getDistance(t,i)),t=i;}return r}function getPolygonLength(e){var t=e.points;return getPolylineLength(e)+getDistance(t.getItem(t.numberOfItems-1),t.getItem(0))}function getTotalLength(e){if(e.getTotalLength)return e.getTotalLength();switch(e.tagName.toLowerCase()){case"circle":return getCircleLength(e);case"rect":return getRectLength(e);case"line":return getLineLength(e);case"polyline":return getPolylineLength(e);case"polygon":return getPolygonLength(e)}}function setDashoffset(e){var t=getTotalLength(e);return e.setAttribute("stroke-dasharray",t),t}function getParentSvgEl(e){for(var t=e.parentNode;is.svg(t)&&is.svg(t.parentNode);)t=t.parentNode;return t}function getParentSvg(e,t){var n=t||{},r=n.el||getParentSvgEl(e),a=r.getBoundingClientRect(),i=getAttribute$1(r,"viewBox"),o=a.width,s=a.height,u=n.viewBox||(i?i.split(" "):[0,0,o,s]);return {el:r,viewBox:u,x:u[0]/1,y:u[1]/1,w:o,h:s,vW:u[2],vH:u[3]}}function getPath(e,t){var n=is.str(e)?selectString(e)[0]:e,r=t||100;return function(e){return {property:e,el:n,svg:getParentSvg(n),totalLength:getTotalLength(n)*(r/100)}}}function getPathProgress(e,t,n){function r(n){void 0===n&&(n=0);var r=t+n>=1?t+n:0;return e.el.getPointAtLength(r)}var a=getParentSvg(e.el,e.svg),i=r(),o=r(-1),s=r(1),u=n?1:a.w/a.vW,c=n?1:a.h/a.vH;switch(e.property){case"x":return (i.x-a.x)*u;case"y":return (i.y-a.y)*c;case"angle":return 180*Math.atan2(s.y-o.y,s.x-o.x)/Math.PI}}function decomposeValue(e,t){var n=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,r=validateValue(is.pth(e)?e.totalLength:e,t)+"";return {original:r,numbers:r.match(n)?r.match(n).map(Number):[0],strings:is.str(e)||t?r.split(n):[]}}function parseTargets(e){return filterArray(e?flattenArray(is.arr(e)?e.map(toArray):toArray(e)):[],(function(e,t,n){return n.indexOf(e)===t}))}function getAnimatables(e){var t=parseTargets(e);return t.map((function(e,n){return {target:e,id:n,total:t.length,transforms:{list:getElementTransforms(e)}}}))}function normalizePropertyTweens(e,t){var n=cloneObject(t);if(/^spring/.test(n.easing)&&(n.duration=spring(n.easing)),is.arr(e)){var r=e.length;2===r&&!is.obj(e[0])?e={value:e}:is.fnc(t.duration)||(n.duration=t.duration/r);}var a=is.arr(e)?e:[e];return a.map((function(e,n){var r=is.obj(e)&&!is.pth(e)?e:{value:e};return is.und(r.delay)&&(r.delay=n?0:t.delay),is.und(r.endDelay)&&(r.endDelay=n===a.length-1?t.endDelay:0),r})).map((function(e){return mergeObjects(e,n)}))}function flattenKeyframes(e){for(var t=filterArray(flattenArray(e.map((function(e){return Object.keys(e)}))),(function(e){return is.key(e)})).reduce((function(e,t){return e.indexOf(t)<0&&e.push(t),e}),[]),n={},r=function(r){var a=t[r];n[a]=e.map((function(e){var t={};for(var n in e)is.key(n)?n==a&&(t.value=e[n]):t[n]=e[n];return t}));},a=0;a<t.length;a++)r(a);return n}function getProperties(e,t){var n=[],r=t.keyframes;for(var a in r&&(t=mergeObjects(flattenKeyframes(r),t)),t)is.key(a)&&n.push({name:a,tweens:normalizePropertyTweens(t[a],e)});return n}function normalizeTweenValues(e,t){var n={};for(var r in e){var a=getFunctionValue(e[r],t);is.arr(a)&&1===(a=a.map((function(e){return getFunctionValue(e,t)}))).length&&(a=a[0]),n[r]=a;}return n.duration=parseFloat(n.duration),n.delay=parseFloat(n.delay),n}function normalizeTweens(e,t){var n;return e.tweens.map((function(r){var a=normalizeTweenValues(r,t),i=a.value,o=is.arr(i)?i[1]:i,s=getUnit(o),u=getOriginalTargetValue(t.target,e.name,s,t),c=n?n.to.original:u,l=is.arr(i)?i[0]:c,g=getUnit(l)||getUnit(u),f=s||g;return is.und(o)&&(o=c),a.from=decomposeValue(l,f),a.to=decomposeValue(getRelativeValue(o,l),f),a.start=n?n.end:0,a.end=a.start+a.delay+a.duration+a.endDelay,a.easing=parseEasings(a.easing,a.duration),a.isPath=is.pth(i),a.isPathTargetInsideSVG=a.isPath&&is.svg(t.target),a.isColor=is.col(a.from.original),a.isColor&&(a.round=1),n=a,a}))}var setProgressValue={css:function(e,t,n){return e.style[t]=n},attribute:function(e,t,n){return e.setAttribute(t,n)},object:function(e,t,n){return e[t]=n},transform:function(e,t,n,r,a){if(r.list.set(t,n),t===r.last||a){var i="";r.list.forEach((function(e,t){i+=t+"("+e+") ";})),e.style.transform=i;}}};function setTargetsValue(e,t){getAnimatables(e).forEach((function(e){for(var n in t){var r=getFunctionValue(t[n],e),a=e.target,i=getUnit(r),o=getOriginalTargetValue(a,n,i,e),s=getRelativeValue(validateValue(r,i||getUnit(o)),o),u=getAnimationType(a,n);setProgressValue[u](a,n,s,e.transforms,!0);}}));}function createAnimation(e,t){var n=getAnimationType(e.target,t.name);if(n){var r=normalizeTweens(t,e),a=r[r.length-1];return {type:n,property:t.name,animatable:e,tweens:r,duration:a.end,delay:r[0].delay,endDelay:a.endDelay}}}function getAnimations(e,t){return filterArray(flattenArray(e.map((function(e){return t.map((function(t){return createAnimation(e,t)}))}))),(function(e){return !is.und(e)}))}function getInstanceTimings(e,t){var n=e.length,r=function(e){return e.timelineOffset?e.timelineOffset:0},a={};return a.duration=n?Math.max.apply(Math,e.map((function(e){return r(e)+e.duration}))):t.duration,a.delay=n?Math.min.apply(Math,e.map((function(e){return r(e)+e.delay}))):t.delay,a.endDelay=n?a.duration-Math.max.apply(Math,e.map((function(e){return r(e)+e.duration-e.endDelay}))):t.endDelay,a}var instanceID=0;function createNewInstance(e){var t=replaceObjectProps(defaultInstanceSettings,e),n=replaceObjectProps(defaultTweenSettings,e),r=getProperties(n,e),a=getAnimatables(e.targets),i=getAnimations(a,r),o=getInstanceTimings(i,n),s=instanceID;return instanceID++,mergeObjects(t,{id:s,children:[],animatables:a,animations:i,duration:o.duration,delay:o.delay,endDelay:o.endDelay})}var activeInstances=[],engine=function(){var e;function t(n){for(var r=activeInstances.length,a=0;a<r;){var i=activeInstances[a];i.paused?(activeInstances.splice(a,1),r--):(i.tick(n),a++);}e=a>0?requestAnimationFrame(t):void 0;}return "undefined"!=typeof document&&document.addEventListener("visibilitychange",(function(){anime.suspendWhenDocumentHidden&&(isDocumentHidden()?e=cancelAnimationFrame(e):(activeInstances.forEach((function(e){return e._onDocumentVisibility()})),engine()));})),function(){e||isDocumentHidden()&&anime.suspendWhenDocumentHidden||!(activeInstances.length>0)||(e=requestAnimationFrame(t));}}();function isDocumentHidden(){return !!document&&document.hidden}function anime(e){void 0===e&&(e={});var t,n=0,r=0,a=0,i=0,o=null;function s(e){var t=window.Promise&&new Promise((function(e){return o=e}));return e.finished=t,t}var u=createNewInstance(e);s(u);function c(){var e=u.direction;"alternate"!==e&&(u.direction="normal"!==e?"normal":"reverse"),u.reversed=!u.reversed,t.forEach((function(e){return e.reversed=u.reversed}));}function l(e){return u.reversed?u.duration-e:e}function g(){n=0,r=l(u.currentTime)*(1/anime.speed);}function f(e,t){t&&t.seek(e-t.timelineOffset);}function m(e){for(var t=0,n=u.animations,r=n.length;t<r;){var a=n[t],i=a.animatable,o=a.tweens,s=o.length-1,c=o[s];s&&(c=filterArray(o,(function(t){return e<t.end}))[0]||c);for(var l=minMax(e-c.start-c.delay,0,c.duration)/c.duration,g=isNaN(l)?1:c.easing(l),f=c.to.strings,m=c.round,d=[],p=c.to.numbers.length,v=void 0,h=0;h<p;h++){var y=void 0,b=c.to.numbers[h],T=c.from.numbers[h]||0;y=c.isPath?getPathProgress(c.value,g*b,c.isPathTargetInsideSVG):T+g*(b-T),m&&(c.isColor&&h>2||(y=Math.round(y*m)/m)),d.push(y);}var x=f.length;if(x){v=f[0];for(var M=0;M<x;M++){f[M];var A=f[M+1],P=d[M];isNaN(P)||(v+=A?P+A:P+" ");}}else v=d[0];setProgressValue[a.type](i.target,a.property,v,i.transforms),a.currentValue=v,t++;}}function d(e){u[e]&&!u.passThrough&&u[e](u);}function p(e){var g=u.duration,p=u.delay,v=g-u.endDelay,h=l(e);u.progress=minMax(h/g*100,0,100),u.reversePlayback=h<u.currentTime,t&&function(e){if(u.reversePlayback)for(var n=i;n--;)f(e,t[n]);else for(var r=0;r<i;r++)f(e,t[r]);}(h),!u.began&&u.currentTime>0&&(u.began=!0,d("begin")),!u.loopBegan&&u.currentTime>0&&(u.loopBegan=!0,d("loopBegin")),h<=p&&0!==u.currentTime&&m(0),(h>=v&&u.currentTime!==g||!g)&&m(g),h>p&&h<v?(u.changeBegan||(u.changeBegan=!0,u.changeCompleted=!1,d("changeBegin")),d("change"),m(h)):u.changeBegan&&(u.changeCompleted=!0,u.changeBegan=!1,d("changeComplete")),u.currentTime=minMax(h,0,g),u.began&&d("update"),e>=g&&(r=0,u.remaining&&!0!==u.remaining&&u.remaining--,u.remaining?(n=a,d("loopComplete"),u.loopBegan=!1,"alternate"===u.direction&&c()):(u.paused=!0,u.completed||(u.completed=!0,d("loopComplete"),d("complete"),!u.passThrough&&"Promise"in window&&(o(),s(u)))));}return u.reset=function(){var e=u.direction;u.passThrough=!1,u.currentTime=0,u.progress=0,u.paused=!0,u.began=!1,u.loopBegan=!1,u.changeBegan=!1,u.completed=!1,u.changeCompleted=!1,u.reversePlayback=!1,u.reversed="reverse"===e,u.remaining=u.loop,t=u.children;for(var n=i=t.length;n--;)u.children[n].reset();(u.reversed&&!0!==u.loop||"alternate"===e&&1===u.loop)&&u.remaining++,m(u.reversed?u.duration:0);},u._onDocumentVisibility=g,u.set=function(e,t){return setTargetsValue(e,t),u},u.tick=function(e){a=e,n||(n=a),p((a+(r-n))*anime.speed);},u.seek=function(e){p(l(e));},u.pause=function(){u.paused=!0,g();},u.play=function(){u.paused&&(u.completed&&u.reset(),u.paused=!1,activeInstances.push(u),g(),engine());},u.reverse=function(){c(),u.completed=!u.reversed,g();},u.restart=function(){u.reset(),u.play();},u.remove=function(e){removeTargetsFromInstance(parseTargets(e),u);},u.reset(),u.autoplay&&u.play(),u}function removeTargetsFromAnimations(e,t){for(var n=t.length;n--;)arrayContains(e,t[n].animatable.target)&&t.splice(n,1);}function removeTargetsFromInstance(e,t){var n=t.animations,r=t.children;removeTargetsFromAnimations(e,n);for(var a=r.length;a--;){var i=r[a],o=i.animations;removeTargetsFromAnimations(e,o),o.length||i.children.length||r.splice(a,1);}n.length||r.length||t.pause();}function removeTargetsFromActiveInstances(e){for(var t=parseTargets(e),n=activeInstances.length;n--;){removeTargetsFromInstance(t,activeInstances[n]);}}function stagger(e,t){void 0===t&&(t={});var n=t.direction||"normal",r=t.easing?parseEasings(t.easing):null,a=t.grid,i=t.axis,o=t.from||0,s="first"===o,u="center"===o,c="last"===o,l=is.arr(e),g=l?parseFloat(e[0]):parseFloat(e),f=l?parseFloat(e[1]):0,m=getUnit(l?e[1]:e)||0,d=t.start||0+(l?g:0),p=[],v=0;return function(e,t,h){if(s&&(o=0),u&&(o=(h-1)/2),c&&(o=h-1),!p.length){for(var y=0;y<h;y++){if(a){var b=u?(a[0]-1)/2:o%a[0],T=u?(a[1]-1)/2:Math.floor(o/a[0]),x=b-y%a[0],M=T-Math.floor(y/a[0]),A=Math.sqrt(x*x+M*M);"x"===i&&(A=-x),"y"===i&&(A=-M),p.push(A);}else p.push(Math.abs(o-y));v=Math.max.apply(Math,p);}r&&(p=p.map((function(e){return r(e/v)*v}))),"reverse"===n&&(p=p.map((function(e){return i?e<0?-1*e:-e:Math.abs(v-e)})));}return d+(l?(f-g)/v:g)*(Math.round(100*p[t])/100)+m}}function timeline(e){void 0===e&&(e={});var t=anime(e);return t.duration=0,t.add=function(n,r){var a=activeInstances.indexOf(t),i=t.children;function o(e){e.passThrough=!0;}a>-1&&activeInstances.splice(a,1);for(var s=0;s<i.length;s++)o(i[s]);var u=mergeObjects(n,replaceObjectProps(defaultTweenSettings,e));u.targets=u.targets||e.targets;var c=t.duration;u.autoplay=!1,u.direction=t.direction,u.timelineOffset=is.und(r)?c:getRelativeValue(r,c),o(t),t.seek(u.timelineOffset);var l=anime(u);o(l),i.push(l);var g=getInstanceTimings(i,e);return t.delay=g.delay,t.endDelay=g.endDelay,t.duration=g.duration,t.seek(0),t.reset(),t.autoplay&&t.play(),t},t}anime.version="3.2.1",anime.speed=1,anime.suspendWhenDocumentHidden=!0,anime.running=activeInstances,anime.remove=removeTargetsFromActiveInstances,anime.get=getOriginalTargetValue,anime.set=setTargetsValue,anime.convertPx=convertPxToUnit,anime.path=getPath,anime.setDashoffset=setDashoffset,anime.stagger=stagger,anime.timeline=timeline,anime.easing=parseEasings,anime.penner=penner,anime.random=function(e,t){return Math.floor(Math.random()*(t-e+1))+e};
91
93
 
92
94
  const AnimeDefault={duration:800,easing:"easeInOutSine"};const documentScrollTo=(e,o)=>{const t=("object"==typeof o?o:{}).complete,n=window.document.scrollingElement||window.document.body||window.document.documentElement,l=n.style.scrollBehavior;o={scrollTop:e||0,...AnimeDefault,..."object"==typeof o?o:{}},n.style.scrollBehavior="auto",o.complete=e=>{n.style.scrollBehavior=l,"function"==typeof t&&t(e);},anime({targets:n,...o});};
93
95
 
94
- const NAME$u="navscroll",SELECTOR_NAVSCROLL="[data-bs-navscroll]",SELECTOR_LIST$1="ul.link-list",SELECTOR_LINK_CONTAINER="li.nav-link, li.nav-item",SELECTOR_CONTAINER=".it-page-sections-container",SELECTOR_TOGGLER$1=".custom-navbar-toggler",SELECTOR_COLLAPSIBLE=".navbar-collapsable",SELECTOR_PROGRESS_BAR=".it-navscroll-progressbar",Default$k={scrollPadding:10,duration:800,easing:"easeInOutSine"};class NavScroll extends BaseComponent{constructor(e,t){super(e),this._config=this._getConfig(t),this._togglerElement=SelectorEngine$1.findOne(SELECTOR_TOGGLER$1,this._element),this._sectionContainer=SelectorEngine$1.findOne(SELECTOR_CONTAINER),this._collapsible=this._getCollapsible(),this._isCollapseOpened=!1,this._callbackQueue=[],this._scrollCb=null,this._bindEvents();}static get NAME(){return NAME$u}setScrollPadding(e){this._config.scrollPadding=e;}dispose(){this._scrollCb&&this._scrollCb.dispose(),super.dispose();}_getConfig(e){return e={...Default$k,...Manipulator.getDataAttributes(this._element),..."object"==typeof e?e:{}}}_bindEvents(){this._scrollCb=onDocumentScroll$1((()=>this._onScroll())),this._collapsible&&(EventHandler$1.on(this._collapsible._element,"shown.bs.navbarcollapsible",(()=>this._onCollapseOpened())),EventHandler$1.on(this._collapsible._element,"hidden.bs.navbarcollapsible",(()=>this._onCollapseClosed()))),SelectorEngine$1.find('a.nav-link[href^="#"]',this._element).forEach((e=>{e.addEventListener("click",(t=>{t.preventDefault();const n=()=>this._scrollToHash(e.hash);this._isCollapseOpened?(this._callbackQueue.push(n),this._collapsible.hide()):n();}));})),EventHandler$1.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 n=e.closest(SELECTOR_LIST$1),l=null,o=!1;for(;n&&!o;){const e=n.closest(SELECTOR_LINK_CONTAINER);if(e){const n=e.querySelector("a.nav-link");n&&t.push(n);}l=n,n=(n.parentElement||n).closest(SELECTOR_LIST$1),n===l&&(o=!0);}return t}_decorateToggler(e){if(this._togglerElement){const t=SelectorEngine$1.findOne(".it-list",this._togglerElement);this._togglerElement.innerText="",this._togglerElement.textContent="",this._togglerElement.append(t),this._togglerElement.append(e);}}_scrollToHash(e){const t=SelectorEngine$1.findOne(e,this._sectionContainer);t&&(documentScrollTo(t.offsetTop-this._getScrollPadding(),{duration:this._config.duration,easing:this._config.easing}),history.pushState?history.pushState(null,null,e):location.hash=e);}_updateProgress(e){const t=SelectorEngine$1.find(SELECTOR_PROGRESS_BAR);if(t){const n=Math.abs(e.getBoundingClientRect().top)/e.getBoundingClientRect().height*100,l=Math.min(100,Math.max(0,n));t.forEach((t=>{e.getBoundingClientRect().top<=0?(t.style.width=l+"%",t.setAttribute("aria-valuenow",l)):(t.style.width="0%",t.setAttribute("aria-valuenow",0));}));}}_onScroll(){const e=this._sectionContainer?this._sectionContainer.offsetTop:0,t=document.scrollingElement.scrollTop-e,n=SelectorEngine$1.find("a.nav-link",this._element),l=this._getScrollPadding();SelectorEngine$1.find(".it-page-section").forEach(((o,i)=>{if(o.offsetTop-e<=t+l&&(SelectorEngine$1.find("a.nav-link.active",this._element).forEach((e=>{e.classList.remove("active");})),i<n.length)){const e=n[i];this._getParentLinks(e).forEach((e=>{e.classList.add("active");})),e.classList.add("active"),this._decorateToggler(e.innerText);}})),this._updateProgress(this._sectionContainer);}_getCollapsible(){const e=SelectorEngine$1.findOne(SELECTOR_COLLAPSIBLE,this._element);return e?NavBarCollapsible$1.getOrCreateInstance(e):null}_getScrollPadding(){return "function"==typeof this._config.scrollPadding?this._config.scrollPadding():this._config.scrollPadding}}onDocumentScroll$1((()=>{SelectorEngine$1.find(SELECTOR_NAVSCROLL).map((e=>{NavScroll.getOrCreateInstance(e);}));}));const NavScroll$1 = NavScroll;
96
+ const NAME$w="navscroll",SELECTOR_NAVSCROLL="[data-bs-navscroll]",SELECTOR_LIST$1="ul.link-list",SELECTOR_LINK_CONTAINER="li.nav-link, li.nav-item",SELECTOR_CONTAINER=".it-page-sections-container",SELECTOR_TOGGLER$1=".custom-navbar-toggler",SELECTOR_COLLAPSIBLE=".navbar-collapsable",SELECTOR_PROGRESS_BAR=".it-navscroll-progressbar",Default$l={scrollPadding:10,duration:800,easing:"easeInOutSine"};class NavScroll extends BaseComponent{constructor(e,t){super(e),this._config=this._getConfig(t),this._togglerElement=SelectorEngine$1.findOne(SELECTOR_TOGGLER$1,this._element),this._sectionContainer=SelectorEngine$1.findOne(SELECTOR_CONTAINER),this._collapsible=this._getCollapsible(),this._isCollapseOpened=!1,this._callbackQueue=[],this._scrollCb=null,this._bindEvents();}static get NAME(){return NAME$w}setScrollPadding(e){this._config.scrollPadding=e;}dispose(){this._scrollCb&&this._scrollCb.dispose(),super.dispose();}_getConfig(e){return e={...Default$l,...Manipulator.getDataAttributes(this._element),..."object"==typeof e?e:{}}}_bindEvents(){this._scrollCb=onDocumentScroll$1((()=>this._onScroll())),this._collapsible&&(EventHandler$1.on(this._collapsible._element,"shown.bs.navbarcollapsible",(()=>this._onCollapseOpened())),EventHandler$1.on(this._collapsible._element,"hidden.bs.navbarcollapsible",(()=>this._onCollapseClosed()))),SelectorEngine$1.find('a.nav-link[href^="#"]',this._element).forEach((e=>{e.addEventListener("click",(t=>{t.preventDefault();const n=()=>this._scrollToHash(e.hash);this._isCollapseOpened?(this._callbackQueue.push(n),this._collapsible.hide()):n();}));})),EventHandler$1.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 n=e.closest(SELECTOR_LIST$1),l=null,o=!1;for(;n&&!o;){const e=n.closest(SELECTOR_LINK_CONTAINER);if(e){const n=e.querySelector("a.nav-link");n&&t.push(n);}l=n,n=(n.parentElement||n).closest(SELECTOR_LIST$1),n===l&&(o=!0);}return t}_decorateToggler(e){if(this._togglerElement){const t=SelectorEngine$1.findOne(".it-list",this._togglerElement);this._togglerElement.innerText="",this._togglerElement.textContent="",this._togglerElement.append(t),this._togglerElement.append(e);}}_scrollToHash(e){const t=SelectorEngine$1.findOne(e,this._sectionContainer);t&&(documentScrollTo(t.offsetTop-this._getScrollPadding(),{duration:this._config.duration,easing:this._config.easing}),history.pushState?history.pushState(null,null,e):location.hash=e);}_updateProgress(e){const t=SelectorEngine$1.find(SELECTOR_PROGRESS_BAR);if(t){const n=Math.abs(e.getBoundingClientRect().top)/e.getBoundingClientRect().height*100,l=Math.min(100,Math.max(0,n));t.forEach((t=>{e.getBoundingClientRect().top<=0?(t.style.width=l+"%",t.setAttribute("aria-valuenow",l)):(t.style.width="0%",t.setAttribute("aria-valuenow",0));}));}}_onScroll(){const e=this._sectionContainer?this._sectionContainer.offsetTop:0,t=document.scrollingElement.scrollTop-e,n=SelectorEngine$1.find("a.nav-link",this._element),l=this._getScrollPadding();SelectorEngine$1.find(".it-page-section").forEach(((o,i)=>{if(o.offsetTop-e<=t+l&&(SelectorEngine$1.find("a.nav-link.active",this._element).forEach((e=>{e.classList.remove("active");})),i<n.length)){const e=n[i];this._getParentLinks(e).forEach((e=>{e.classList.add("active");})),e.classList.add("active"),this._decorateToggler(e.innerText);}})),this._updateProgress(this._sectionContainer);}_getCollapsible(){const e=SelectorEngine$1.findOne(SELECTOR_COLLAPSIBLE,this._element);return e?NavBarCollapsible$1.getOrCreateInstance(e):null}_getScrollPadding(){return "function"==typeof this._config.scrollPadding?this._config.scrollPadding():this._config.scrollPadding}}onDocumentScroll$1((()=>{SelectorEngine$1.find(SELECTOR_NAVSCROLL).map((e=>{NavScroll.getOrCreateInstance(e);}));}));const NavScroll$1 = NavScroll;
95
97
 
96
- const NAME$t="sticky",EVENT_RESIZE$2="resize.bs.sticky",CLASS_NAME_WRAPPER="bs-it-sticky-wrapper",DATA_TARGET_MOBILE="data-bs-target-mobile",SELECTOR_DATA_TOGGLE$8='[data-bs-toggle="sticky"]',Default$j={positionType:"sticky",stickyClassName:"",stackable:!1,paddingTop:0};class Sticky extends BaseComponent{constructor(t,e){super(t),this._config=this._getConfig(e),this._isSticky=!1,this._wrapper=null,this._stickyTarget=SelectorEngine$1.findOne(getSelectorFromElement(this._element),this._element)||this._element,this._stickyTargetMobile=SelectorEngine$1.findOne(this._element.getAttribute(DATA_TARGET_MOBILE),this._element)||this._stickyTarget,this._stickyLimit=0,this._stickyLimitMobile=0,this._setLimit(),this._scrollCb=null,this._isMobile=isScreenMobile(),this._prevTop=0,this._onScroll(),this._bindEvents();}dispose(){EventHandler$1.off(window,EVENT_RESIZE$2),this._scrollCb.dispose(),super.dispose();}static get NAME(){return NAME$t}_getConfig(t){return t={...Default$j,...Manipulator.getDataAttributes(this._element),..."object"==typeof t?t:{}}}_bindEvents(){EventHandler$1.on(window,EVENT_RESIZE$2,(()=>this._onResize())),this._scrollCb=onDocumentScroll$1((()=>this._onScroll()));}_onResize(){this._isMobile=isScreenMobile(),this._setLimit();}_onScroll(){this._checkSticky();}_setLimit(){this._stickyLimit=this._cumulativeOffset(this._stickyTarget).top,this._stickyLimitMobile=this._cumulativeOffset(this._stickyTargetMobile).top;}_getLimit(){let t=this._isMobile?this._stickyLimitMobile:this._stickyLimit;return this._config.stackable&&this._getStickySimblings().forEach(((e,i)=>{const s=e.getBoundingClientRect();t-=s.height+(0===i?parseFloat(e.style.top):0);})),t>0?t:0}_cumulativeOffset(t){let e=0,i=0;do{e+=t.offsetTop||0,i+=t.offsetLeft||0,t=t.offsetParent;}while(t);return {top:e,left:i}}_isTypeSticky(){return "sticky"===this._config.positionType}_checkSticky(){this._isSticky||this._setLimit();const t=this._getLimit();window.pageYOffset>t?this._setSticky():this._unsetSticky();}_setSticky(){if(!this._isSticky){this._isSticky=!0;let t="bs-is-sticky";this._isTypeSticky()||(t="bs-is-fixed",this._wrapper=this._createWrapper()),this._element.classList.add(t),this._config.stickyClassName&&this._element.classList.add(this._config.stickyClassName),this._prevTop=this._element.style.top,this._element.style.top=this._getPositionTop()+"px",EventHandler$1.trigger(this._element,"on.bs.sticky");}}_unsetSticky(){if(this._isSticky){let t="bs-is-sticky";this._isTypeSticky()||(t="bs-is-fixed",this._destroyWrapper()),this._element.classList.remove(t),this._config.stickyClassName&&this._element.classList.remove(this._config.stickyClassName),this._element.style.top=this._prevTop,this._isSticky=!1,EventHandler$1.trigger(this._element,"off.bs.sticky");}}_createWrapper(){const t=document.createElement("div");return t.classList.add(CLASS_NAME_WRAPPER),t.style.width="100%",t.style.height=this._element.getBoundingClientRect().height+"px",t.style.overflow="hidden",this._element.parentNode.insertBefore(t,this._element),t.appendChild(this._element),t}_destroyWrapper(){this._wrapper&&(this._wrapper.parentNode.insertBefore(this._element,this._wrapper),this._wrapper.remove());}_getStickySimblings(){return SelectorEngine$1.find(SELECTOR_DATA_TOGGLE$8).filter((t=>{const e=Sticky.getInstance(t);return !(!e||!e._isSticky||t===this._element)}))}_getPositionTop(){let t=0;return this._config.stackable?(this._getStickySimblings().forEach(((e,i)=>{const s=e.getBoundingClientRect();t+=s.height+(0===i?parseFloat(e.style.top):0);})),t):t+this._config.paddingTop}}onDocumentScroll$1((()=>{SelectorEngine$1.find(SELECTOR_DATA_TOGGLE$8).map((t=>{Sticky.getOrCreateInstance(t);}));}));const Sticky$1 = Sticky;
98
+ const NAME$v="sticky",EVENT_RESIZE$2="resize.bs.sticky",CLASS_NAME_WRAPPER="bs-it-sticky-wrapper",DATA_TARGET_MOBILE="data-bs-target-mobile",SELECTOR_DATA_TOGGLE$9='[data-bs-toggle="sticky"]',Default$k={positionType:"sticky",stickyClassName:"",stackable:!1,paddingTop:0};class Sticky extends BaseComponent{constructor(t,e){super(t),this._config=this._getConfig(e),this._isSticky=!1,this._wrapper=null,this._stickyTarget=SelectorEngine$1.findOne(getSelectorFromElement(this._element),this._element)||this._element,this._stickyTargetMobile=SelectorEngine$1.findOne(this._element.getAttribute(DATA_TARGET_MOBILE),this._element)||this._stickyTarget,this._stickyLimit=0,this._stickyLimitMobile=0,this._setLimit(),this._scrollCb=null,this._isMobile=isScreenMobile(),this._prevTop=0,this._onScroll(),this._bindEvents();}dispose(){EventHandler$1.off(window,EVENT_RESIZE$2),this._scrollCb.dispose(),super.dispose();}static get NAME(){return NAME$v}_getConfig(t){return t={...Default$k,...Manipulator.getDataAttributes(this._element),..."object"==typeof t?t:{}}}_bindEvents(){EventHandler$1.on(window,EVENT_RESIZE$2,(()=>this._onResize())),this._scrollCb=onDocumentScroll$1((()=>this._onScroll()));}_onResize(){this._isMobile=isScreenMobile(),this._setLimit();}_onScroll(){this._checkSticky();}_setLimit(){this._stickyLimit=this._cumulativeOffset(this._stickyTarget).top,this._stickyLimitMobile=this._cumulativeOffset(this._stickyTargetMobile).top;}_getLimit(){let t=this._isMobile?this._stickyLimitMobile:this._stickyLimit;return this._config.stackable&&this._getStickySimblings().forEach(((e,i)=>{const s=e.getBoundingClientRect();t-=s.height+(0===i?parseFloat(e.style.top):0);})),t>0?t:0}_cumulativeOffset(t){let e=0,i=0;do{e+=t.offsetTop||0,i+=t.offsetLeft||0,t=t.offsetParent;}while(t);return {top:e,left:i}}_isTypeSticky(){return "sticky"===this._config.positionType}_checkSticky(){this._isSticky||this._setLimit();const t=this._getLimit();window.pageYOffset>t?this._setSticky():this._unsetSticky();}_setSticky(){if(!this._isSticky){this._isSticky=!0;let t="bs-is-sticky";this._isTypeSticky()||(t="bs-is-fixed",this._wrapper=this._createWrapper()),this._element.classList.add(t),this._config.stickyClassName&&this._element.classList.add(this._config.stickyClassName),this._prevTop=this._element.style.top,this._element.style.top=this._getPositionTop()+"px",EventHandler$1.trigger(this._element,"on.bs.sticky");}}_unsetSticky(){if(this._isSticky){let t="bs-is-sticky";this._isTypeSticky()||(t="bs-is-fixed",this._destroyWrapper()),this._element.classList.remove(t),this._config.stickyClassName&&this._element.classList.remove(this._config.stickyClassName),this._element.style.top=this._prevTop,this._isSticky=!1,EventHandler$1.trigger(this._element,"off.bs.sticky");}}_createWrapper(){const t=document.createElement("div");return t.classList.add(CLASS_NAME_WRAPPER),t.style.width="100%",t.style.height=this._element.getBoundingClientRect().height+"px",t.style.overflow="hidden",this._element.parentNode.insertBefore(t,this._element),t.appendChild(this._element),t}_destroyWrapper(){this._wrapper&&(this._wrapper.parentNode.insertBefore(this._element,this._wrapper),this._wrapper.remove());}_getStickySimblings(){return SelectorEngine$1.find(SELECTOR_DATA_TOGGLE$9).filter((t=>{const e=Sticky.getInstance(t);return !(!e||!e._isSticky||t===this._element)}))}_getPositionTop(){let t=0;return this._config.stackable?(this._getStickySimblings().forEach(((e,i)=>{const s=e.getBoundingClientRect();t+=s.height+(0===i?parseFloat(e.style.top):0);})),t):t+this._config.paddingTop}}onDocumentScroll$1((()=>{SelectorEngine$1.find(SELECTOR_DATA_TOGGLE$9).map((t=>{Sticky.getOrCreateInstance(t);}));}));const Sticky$1 = Sticky;
97
99
 
98
100
  const SELECTOR_HEADER=".it-header-sticky",SELECTOR_TOGGLER=".custom-navbar-toggler",SELECTOR_CLONED=".cloned-element",dataSet=new Map;class HeaderSticky{constructor(e){if(dataSet.get(e))return null;this._element=e,this._elementObj=Sticky$1.getOrCreateInstance(e),dataSet.set(e,this._elementObj),this._bindEvents(),this._toggleClonedElement(this._element.classList.contains("is-sticky"));}static getOrCreateInstance(e){return dataSet.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(!isVisible(SelectorEngine$1.findOne(SELECTOR_TOGGLER,this._element))){const t=SelectorEngine$1.findOne(".menu-wrapper",this._element);if(e){const e=SelectorEngine$1.findOne(".it-brand-wrapper",this._element),n=SelectorEngine$1.findOne(".it-search-wrapper",this._element),i=SelectorEngine$1.findOne(".it-user-wrapper",this._element),l=e?e.cloneNode(!0):null,s=n?n.cloneNode(!0):null,r=i?i.cloneNode(!0):null;l&&t.insertBefore(l,t.childNodes[0]).classList.add("cloned-element"),s&&t.appendChild(s).classList.add("cloned-element"),r&&(t.appendChild(r).classList.add("cloned-element"),t.appendChild(r).classList.remove("show"));}else SelectorEngine$1.find(SELECTOR_CLONED,this._element).forEach((e=>{e.parentElement.removeChild(e);}));}}}onDocumentScroll$1((()=>{SelectorEngine$1.find(SELECTOR_HEADER).map((e=>{HeaderSticky.getOrCreateInstance(e);}));}));const HeaderSticky$1 = HeaderSticky;
99
101
 
100
- var __defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,i,s)=>i in e?__defProp(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s,__spreadValues=(e,i)=>{for(var s in i||(i={}))__hasOwnProp.call(i,s)&&__defNormalProp(e,s,i[s]);if(__getOwnPropSymbols)for(var s of __getOwnPropSymbols(i))__propIsEnum.call(i,s)&&__defNormalProp(e,s,i[s]);return e},__publicField=(e,i,s)=>(__defNormalProp(e,"symbol"!=typeof i?i+"":i,s),s);const EMAIL_REGEXP=/^(([^<>()[\]\\.,;:\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,}))$/,NUMBER_REGEXP=/^[0-9]+$/,PASSWORD_REGEXP=/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$/,STRONG_PASSWORD_REGEXP=/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/,isEmpty=e=>{let i=e;return "string"==typeof e&&(i=e.trim()),!i},isLengthMoreThanMax=(e,i)=>e.length>i,isLengthLessThanMin=(e,i)=>e.length<i,isNumber=e=>NUMBER_REGEXP.test(e),isPassword=e=>PASSWORD_REGEXP.test(e),isStrongPassword=e=>STRONG_PASSWORD_REGEXP.test(e),isNumberMoreThanMax=(e,i)=>e>i,isNumberLessThanMin=(e,i)=>e<i;var Rules,GroupRules,CustomStyleTagIds;!function(e){e.Required="required",e.Email="email",e.MinLength="minLength",e.MaxLength="maxLength",e.Password="password",e.Number="number",e.MaxNumber="maxNumber",e.MinNumber="minNumber",e.StrongPassword="strongPassword",e.CustomRegexp="customRegexp",e.MinFilesCount="minFilesCount",e.MaxFilesCount="maxFilesCount",e.Files="files";}(Rules||(Rules={})),(GroupRules||(GroupRules={})).Required="required",function(e){e.Label="label",e.LabelArrow="labelArrow";}(CustomStyleTagIds||(CustomStyleTagIds={}));const getDefaultFieldMessage=(e,i)=>{switch(e){case Rules.Required:return "The field is required";case Rules.Email:return "Email has invalid format";case Rules.MaxLength:return "The field must contain a maximum of :value characters".replace(":value",String(i));case Rules.MinLength:return "The field must contain a minimum of :value characters".replace(":value",String(i));case Rules.Password:return "Password must contain minimum eight characters, at least one letter and one number";case Rules.Number:return "Value should be a number";case Rules.StrongPassword:return "Password should contain minimum eight characters, at least one uppercase letter, one lowercase letter, one number and one special character";case Rules.MaxNumber:return "Number should be less or equal than :value".replace(":value",String(i));case Rules.MinNumber:return "Number should be more or equal than :value".replace(":value",String(i));case Rules.MinFilesCount:return "Files count should be more or equal than :value".replace(":value",String(i));case Rules.MaxFilesCount:return "Files count should be less or equal than :value".replace(":value",String(i));case Rules.Files:return "Uploaded files have one or several invalid properties (extension/size/type etc)";default:return "Value is incorrect"}},isPromise=e=>!!e&&"function"==typeof e.then,errorLabelCss=".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)}",defaultGlobalConfig={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};class JustValidate{constructor(e,i,s){__publicField(this,"form",null),__publicField(this,"fields",{}),__publicField(this,"groupFields",{}),__publicField(this,"errors",{}),__publicField(this,"isValid",!1),__publicField(this,"isSubmitted",!1),__publicField(this,"globalConfig",defaultGlobalConfig),__publicField(this,"errorLabels",{}),__publicField(this,"successLabels",{}),__publicField(this,"eventListeners",[]),__publicField(this,"dictLocale",[]),__publicField(this,"currentLocale"),__publicField(this,"customStyleTags",{}),__publicField(this,"onSuccessCallback"),__publicField(this,"onFailCallback"),__publicField(this,"tooltips",[]),__publicField(this,"lastScrollPosition"),__publicField(this,"isScrollTick"),__publicField(this,"refreshAllTooltips",(()=>{this.tooltips.forEach((e=>{e.refresh();}));})),__publicField(this,"handleDocumentScroll",(()=>{this.lastScrollPosition=window.scrollY,this.isScrollTick||(window.requestAnimationFrame((()=>{this.refreshAllTooltips(),this.isScrollTick=!1;})),this.isScrollTick=!0);})),__publicField(this,"formSubmitHandler",(e=>{e.preventDefault(),this.isSubmitted=!0,this.validateHandler(e);})),__publicField(this,"handleFieldChange",(e=>{let i;for(const s in this.fields){if(this.fields[s].elem===e){i=s;break}}i&&this.validateField(i,!0);})),__publicField(this,"handleGroupChange",(e=>{let i,s;for(const l in this.groupFields){const t=this.groupFields[l];if(t.elems.find((i=>i===e))){i=t,s=l;break}}i&&s&&this.validateGroup(s,i);})),__publicField(this,"handlerChange",(e=>{e.target&&(this.handleFieldChange(e.target),this.handleGroupChange(e.target),this.renderErrors());})),this.initialize(e,i,s);}initialize(e,i,s){if(this.form=null,this.errors={},this.isValid=!1,this.isSubmitted=!1,this.globalConfig=defaultGlobalConfig,this.errorLabels={},this.successLabels={},this.eventListeners=[],this.customStyleTags={},this.tooltips=[],"string"==typeof e){const i=document.querySelector(e);if(!i)throw Error(`Form with ${e} selector not found! Please check the form selector`);this.setForm(i);}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=__spreadValues(__spreadValues({},defaultGlobalConfig),i),s&&(this.dictLocale=s),this.isTooltip()){const e=document.createElement("style");e.textContent=errorLabelCss,this.customStyleTags[CustomStyleTagIds.Label]=document.head.appendChild(e),this.addListener("scroll",document,this.handleDocumentScroll);}}getLocalisedString(e){var i;if(!this.currentLocale||!this.dictLocale.length)return e;return (null==(i=this.dictLocale.find((i=>i.key===e)))?void 0:i.dict[this.currentLocale])||e}getFieldErrorMessage(e,i){const s="function"==typeof e.errorMessage?e.errorMessage(this.getElemValue(i),this.fields):e.errorMessage;return this.getLocalisedString(s)||getDefaultFieldMessage(e.rule,e.value)}getFieldSuccessMessage(e,i){const s="function"==typeof e?e(this.getElemValue(i),this.fields):e;return this.getLocalisedString(s)}getGroupErrorMessage(e){return this.getLocalisedString(e.errorMessage)||(e.rule===GroupRules.Required?"The field is required":"Group is incorrect")}getGroupSuccessMessage(e){return this.getLocalisedString(e.successMessage)}setFieldInvalid(e,i){this.fields[e].isValid=!1,this.fields[e].errorMessage=this.getFieldErrorMessage(i,this.fields[e].elem);}setFieldValid(e,i){this.fields[e].isValid=!0,void 0!==i&&(this.fields[e].successMessage=this.getFieldSuccessMessage(i,this.fields[e].elem));}setGroupInvalid(e,i){this.groupFields[e].isValid=!1,this.groupFields[e].errorMessage=this.getGroupErrorMessage(i);}setGroupValid(e,i){this.groupFields[e].isValid=!0,this.groupFields[e].successMessage=this.getGroupSuccessMessage(i);}getElemValue(e){switch(e.type){case"checkbox":return e.checked;case"file":return e.files;default:return e.value}}validateGroupRule(e,i,s,l){if(l.rule===GroupRules.Required)"radio"!==i&&"checkbox"!==i||(s.every((e=>!e.checked))?this.setGroupInvalid(e,l):this.setGroupValid(e,l));}validateFieldRule(e,i,s,l=!1){const t=s.value,r=this.getElemValue(i);if(s.plugin){s.plugin(r,this.fields)||this.setFieldInvalid(e,s);}else {switch(s.rule){case Rules.Required:isEmpty(r)&&this.setFieldInvalid(e,s);break;case Rules.Email:if("string"!=typeof r){this.setFieldInvalid(e,s);break}o=r,EMAIL_REGEXP.test(o)||this.setFieldInvalid(e,s);break;case Rules.MaxLength:if(void 0===t){console.error(`Value for ${s.rule} rule for [${e}] field is not defined. The field will be always invalid.`),this.setFieldInvalid(e,s);break}if("number"!=typeof t){console.error(`Value for ${s.rule} rule for [${e}] should be a number. The field will be always invalid.`),this.setFieldInvalid(e,s);break}if("string"!=typeof r){this.setFieldInvalid(e,s);break}if(""===r)break;isLengthMoreThanMax(r,t)&&this.setFieldInvalid(e,s);break;case Rules.MinLength:if(void 0===t){console.error(`Value for ${s.rule} rule for [${e}] field is not defined. The field will be always invalid.`),this.setFieldInvalid(e,s);break}if("number"!=typeof t){console.error(`Value for ${s.rule} rule for [${e}] should be a number. The field will be always invalid.`),this.setFieldInvalid(e,s);break}if("string"!=typeof r){this.setFieldInvalid(e,s);break}if(""===r)break;isLengthLessThanMin(r,t)&&this.setFieldInvalid(e,s);break;case Rules.Password:if("string"!=typeof r){this.setFieldInvalid(e,s);break}if(""===r)break;isPassword(r)||this.setFieldInvalid(e,s);break;case Rules.StrongPassword:if("string"!=typeof r){this.setFieldInvalid(e,s);break}if(""===r)break;isStrongPassword(r)||this.setFieldInvalid(e,s);break;case Rules.Number:if("string"!=typeof r){this.setFieldInvalid(e,s);break}if(""===r)break;isNumber(r)||this.setFieldInvalid(e,s);break;case Rules.MaxNumber:{if(void 0===t){console.error(`Value for ${s.rule} rule for [${e}] field is not defined. The field will be always invalid.`),this.setFieldInvalid(e,s);break}if("number"!=typeof t){console.error(`Value for ${s.rule} rule for [${e}] field should be a number. The field will be always invalid.`),this.setFieldInvalid(e,s);break}if("string"!=typeof r){this.setFieldInvalid(e,s);break}if(""===r)break;const i=+r;(Number.isNaN(i)||isNumberMoreThanMax(i,t))&&this.setFieldInvalid(e,s);break}case Rules.MinNumber:{if(void 0===t){console.error(`Value for ${s.rule} rule for [${e}] field is not defined. The field will be always invalid.`),this.setFieldInvalid(e,s);break}if("number"!=typeof t){console.error(`Value for ${s.rule} rule for [${e}] field should be a number. The field will be always invalid.`),this.setFieldInvalid(e,s);break}if("string"!=typeof r){this.setFieldInvalid(e,s);break}if(""===r)break;const i=+r;(Number.isNaN(i)||isNumberLessThanMin(i,t))&&this.setFieldInvalid(e,s);break}case Rules.CustomRegexp:{if(void 0===t)return console.error(`Value for ${s.rule} rule for [${e}] field is not defined. This field will be always invalid.`),void this.setFieldInvalid(e,s);let i;try{i=new RegExp(t);}catch(i){console.error(`Value for ${s.rule} rule for [${e}] should be a valid regexp. This field will be always invalid.`),this.setFieldInvalid(e,s);break}const l=String(r);""===l||i.test(l)||this.setFieldInvalid(e,s);break}case Rules.MinFilesCount:if(void 0===t){console.error(`Value for ${s.rule} rule for [${e}] field is not defined. This field will be always invalid.`),this.setFieldInvalid(e,s);break}if("number"!=typeof t){console.error(`Value for ${s.rule} rule for [${e}] field should be a number. The field will be always invalid.`),this.setFieldInvalid(e,s);break}if(Number.isFinite(null==r?void 0:r.length)&&r.length<t){this.setFieldInvalid(e,s);break}break;case Rules.MaxFilesCount:if(void 0===t){console.error(`Value for ${s.rule} rule for [${e}] field is not defined. This field will be always invalid.`),this.setFieldInvalid(e,s);break}if("number"!=typeof t){console.error(`Value for ${s.rule} rule for [${e}] field should be a number. The field will be always invalid.`),this.setFieldInvalid(e,s);break}if(Number.isFinite(null==r?void 0:r.length)&&r.length>t){this.setFieldInvalid(e,s);break}break;case Rules.Files:{if(void 0===t)return console.error(`Value for ${s.rule} rule for [${e}] field is not defined. This field will be always invalid.`),void this.setFieldInvalid(e,s);if("object"!=typeof t)return console.error(`Value for ${s.rule} rule for [${e}] field should be an object. This field will be always invalid.`),void this.setFieldInvalid(e,s);const i=t.files;if("object"!=typeof i)return console.error(`Value for ${s.rule} rule for [${e}] field should be an object with files array. This field will be always invalid.`),void this.setFieldInvalid(e,s);const l=(e,i)=>{const s=Number.isFinite(i.minSize)&&e.size<i.minSize,l=Number.isFinite(i.maxSize)&&e.size>i.maxSize,t=Array.isArray(i.names)&&!i.names.includes(e.name),r=Array.isArray(i.extensions)&&!i.extensions.includes(e.name.split(".")[e.name.split(".").length-1]),o=Array.isArray(i.types)&&!i.types.includes(e.type);return s||l||t||r||o};if("object"==typeof r&&null!==r)for(let t=0,o=r.length;t<o;++t){const o=r.item(t);if(!o){this.setFieldInvalid(e,s);break}if(l(o,i)){this.setFieldInvalid(e,s);break}}break}default:{if("function"!=typeof s.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,s);const i=s.validator(r,this.fields);if("boolean"!=typeof i&&"function"!=typeof i&&console.error(`Validator return value for [${e}] field should be boolean or function. It will be cast to boolean.`),"function"==typeof i){if(!l){this.fields[e].asyncCheckPending=!1;const l=i();return isPromise(l)?l.then((i=>{i||this.setFieldInvalid(e,s);})).catch((()=>{this.setFieldInvalid(e,s);})):(console.error(`Validator function for custom rule for [${e}] field should return a Promise. This field will be always invalid.`),void this.setFieldInvalid(e,s))}this.fields[e].asyncCheckPending=!0;}i||this.setFieldInvalid(e,s);}}var o;}}validateField(e,i=!1){var s;const l=this.fields[e];l.isValid=!0;const t=[];return [...l.rules].reverse().forEach((s=>{const r=this.validateFieldRule(e,l.elem,s,i);isPromise(r)&&t.push(r);})),l.isValid&&this.setFieldValid(e,null==(s=l.config)?void 0:s.successMessage),Promise.allSettled(t)}revalidateField(e){if("string"!=typeof e)throw Error("Field selector is not valid. Please specify a string selector.");return this.fields[e]?new Promise((i=>{this.validateField(e,!0).finally((()=>{this.clearFieldError(e),this.clearFieldLabel(e),this.renderFieldError(e),i(!!this.fields[e].isValid);}));})):(console.error("Field not found. Check the field selector."),Promise.reject())}validateGroup(e,i){const s=[];return [...i.rules].reverse().forEach((l=>{const t=this.validateGroupRule(e,i.type,i.elems,l);isPromise(t)&&s.push(t);})),Promise.allSettled(s)}focusInvalidField(){for(const e in this.fields){const i=this.fields[e];if(!i.isValid){setTimeout((()=>i.elem.focus()),0);break}}}afterSubmitValidation(e=!1){this.renderErrors(e),this.globalConfig.focusInvalidField&&this.focusInvalidField();}validate(e=!1){return new Promise((i=>{const s=[];Object.keys(this.fields).forEach((e=>{const i=this.validateField(e);isPromise(i)&&s.push(i);})),Object.keys(this.groupFields).forEach((e=>{const i=this.groupFields[e],l=this.validateGroup(e,i);isPromise(l)&&s.push(l);})),s.length?Promise.allSettled(s).then((()=>{this.afterSubmitValidation(e),i(!0);})):(this.afterSubmitValidation(e),i(!1));}))}revalidate(){return new Promise((e=>{this.validateHandler(void 0,!0).finally((()=>{this.globalConfig.focusInvalidField&&this.focusInvalidField(),e(this.isValid);}));}))}validateHandler(e,i=!1){return this.globalConfig.lockForm&&this.lockForm(),this.validate(i).finally((()=>{var i,s;this.globalConfig.lockForm&&this.unlockForm(),this.isValid?null==(i=this.onSuccessCallback)||i.call(this,e):null==(s=this.onFailCallback)||s.call(this,this.fields,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,i,s){i.addEventListener(e,s),this.eventListeners.push({type:e,elem:i,func:s});}removeListener(e,i,s){i.removeEventListener(e,s),this.eventListeners=this.eventListeners.filter((s=>s.type!==e||s.elem!==i));}addField(e,i,s){if("string"!=typeof e)throw Error("Field selector is not valid. Please specify a string selector.");const l=this.form.querySelector(e);if(!l)throw Error(`Field with ${e} selector not found! Please check the field selector.`);if(!Array.isArray(i)||!i.length)throw Error(`Rules argument for the field [${e}] should be an array and should contain at least 1 element.`);return i.forEach((i=>{if(!("rule"in i||"validator"in i||"plugin"in i))throw Error(`Rules argument for the field [${e}] must contain at least one rule or validator property.`);if(!(i.validator||i.plugin||i.rule&&Object.values(Rules).includes(i.rule)))throw Error(`Rule should be one of these types: ${Object.values(Rules).join(", ")}. Provided value: ${i.rule}`)})),this.fields[e]={elem:l,rules:i,isValid:void 0,config:s},this.setListeners(l),this.isSubmitted&&this.validate(),this}removeField(e){if("string"!=typeof e)throw Error("Field selector is not valid. Please specify a string selector.");if(!this.fields[e])return console.error("Field not found. Check the field selector."),this;const i=this.getListenerType(this.fields[e].elem.type);return this.removeListener(i,this.fields[e].elem,this.handlerChange),this.clearErrors(),delete this.fields[e],this}removeGroup(e){if("string"!=typeof e)throw Error("Group selector is not valid. Please specify a string selector.");return this.groupFields[e]?(this.groupFields[e].elems.forEach((e=>{const i=this.getListenerType(e.type);this.removeListener(i,e,this.handlerChange);})),this.clearErrors(),delete this.groupFields[e],this):(console.error("Group not found. Check the group selector."),this)}addRequiredGroup(e,i,s,l){if("string"!=typeof e)throw Error("Group selector is not valid. Please specify a string selector.");const t=this.form.querySelector(e);if(!t)throw Error(`Group with ${e} selector not found! Please check the group selector.`);const r=t.querySelectorAll("input"),o=Array.from(r).every((e=>"radio"===e.type)),a=Array.from(r).every((e=>"checkbox"===e.type));if(!o&&!a)throw Error("Group should contain either or checkboxes or radio buttons");return this.groupFields[e]={rules:[{rule:GroupRules.Required,errorMessage:i,successMessage:l}],groupElem:t,elems:Array.from(r),type:o?"radio":"checkbox",isDirty:!1,isValid:void 0,config:s},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 i=this.getListenerType(e.type);this.removeListener(i,e,this.handlerChange),this.addListener(i,e,this.handlerChange);}clearFieldLabel(e){var i,s;null==(i=this.errorLabels[e])||i.remove(),null==(s=this.successLabels[e])||s.remove();}clearFieldError(e){var i,s,l,t;const r=this.fields[e],o=(null==(i=r.config)?void 0:i.errorFieldStyle)||this.globalConfig.errorFieldStyle;Object.keys(o).forEach((e=>{r.elem.style[e]="";}));const a=(null==(s=r.config)?void 0:s.successFieldStyle)||this.globalConfig.successFieldStyle||{};Object.keys(a).forEach((e=>{r.elem.style[e]="";})),r.elem.classList.remove((null==(l=r.config)?void 0:l.errorFieldCssClass)||this.globalConfig.errorFieldCssClass,(null==(t=r.config)?void 0:t.successFieldCssClass)||this.globalConfig.successFieldCssClass);}clearErrors(){var e,i;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.clearFieldError(e);for(const s in this.groupFields){const l=this.groupFields[s],t=(null==(e=l.config)?void 0:e.errorFieldStyle)||this.globalConfig.errorFieldStyle;Object.keys(t).forEach((e=>{l.elems.forEach((i=>{var s;i.style[e]="",i.classList.remove((null==(s=l.config)?void 0:s.errorFieldCssClass)||this.globalConfig.errorFieldCssClass);}));}));const r=(null==(i=l.config)?void 0:i.successFieldStyle)||this.globalConfig.successFieldStyle||{};Object.keys(r).forEach((e=>{l.elems.forEach((i=>{var s;i.style[e]="",i.classList.remove((null==(s=l.config)?void 0:s.successFieldCssClass)||this.globalConfig.successFieldCssClass);}));}));}this.tooltips=[];}isTooltip(){return !!this.globalConfig.tooltip}lockForm(){const e=this.form.querySelectorAll("input, textarea, button, select");for(let i=0,s=e.length;i<s;++i)e[i].setAttribute("disabled","disabled"),e[i].style.pointerEvents="none",e[i].style.webkitFilter="grayscale(100%)",e[i].style.filter="grayscale(100%)";}unlockForm(){const e=this.form.querySelectorAll("input, textarea, button, select");for(let i=0,s=e.length;i<s;++i)e[i].removeAttribute("disabled"),e[i].style.pointerEvents="",e[i].style.webkitFilter="",e[i].style.filter="";}renderTooltip(e,i,s){var l;const{top:t,left:r,width:o,height:a}=e.getBoundingClientRect(),n=i.getBoundingClientRect(),d=s||(null==(l=this.globalConfig.tooltip)?void 0:l.position);switch(d){case"left":i.style.top=t+a/2-n.height/2+"px",i.style.left=r-n.width-5+"px";break;case"top":i.style.top=t-n.height-5+"px",i.style.left=r+o/2-n.width/2+"px";break;case"right":i.style.top=t+a/2-n.height/2+"px",i.style.left=`${r+o+5}px`;break;case"bottom":i.style.top=`${t+a+5}px`,i.style.left=r+o/2-n.width/2+"px";}i.dataset.direction=d;return {refresh:()=>{this.renderTooltip(e,i,s);}}}createErrorLabelElem(e,i,s){const l=document.createElement("div");l.innerHTML=i;const t=this.isTooltip()?null==s?void 0:s.errorLabelStyle:(null==s?void 0:s.errorLabelStyle)||this.globalConfig.errorLabelStyle;return Object.assign(l.style,t),l.classList.add((null==s?void 0:s.errorLabelCssClass)||this.globalConfig.errorLabelCssClass,"just-validate-error-label"),this.isTooltip()&&(l.dataset.tooltip="true"),this.globalConfig.testingMode&&(l.dataset.testId=`error-label-${e}`),this.errorLabels[e]=l,l}createSuccessLabelElem(e,i,s){if(void 0===i)return null;const l=document.createElement("div");l.innerHTML=i;const t=(null==s?void 0:s.successLabelStyle)||this.globalConfig.successLabelStyle;return Object.assign(l.style,t),l.classList.add((null==s?void 0:s.successLabelCssClass)||this.globalConfig.successLabelCssClass,"just-validate-success-label"),this.globalConfig.testingMode&&(l.dataset.testId=`success-label-${e}`),this.successLabels[e]=l,l}renderErrorsContainer(e,i){const s=i||this.globalConfig.errorsContainer;if("string"==typeof s){const i=this.form.querySelector(s);if(i)return i.appendChild(e),!0;console.error(`Error container with ${s} selector not found. Errors will be rendered as usual`);}return s instanceof Element?(s.appendChild(e),!0):(void 0!==s&&console.error("Error container not found. It should be a string or existing Element. Errors will be rendered as usual"),!1)}renderGroupLabel(e,i,s,l){if(!l){if(this.renderErrorsContainer(i,s))return}e.appendChild(i);}renderFieldLabel(e,i,s,l){var t,r,o,a,n,d,u;if(!l){if(this.renderErrorsContainer(i,s))return}if("checkbox"===e.type||"radio"===e.type){const s=document.querySelector(`label[for="${e.getAttribute("id")}"]`);"label"===(null==(r=null==(t=e.parentElement)?void 0:t.tagName)?void 0:r.toLowerCase())?null==(a=null==(o=e.parentElement)?void 0:o.parentElement)||a.appendChild(i):s?null==(n=s.parentElement)||n.appendChild(i):null==(d=e.parentElement)||d.appendChild(i);}else null==(u=e.parentElement)||u.appendChild(i);}renderFieldError(e){var i,s,l,t,r,o;const a=this.fields[e];if(a.isValid){if(!a.asyncCheckPending){const l=this.createSuccessLabelElem(e,a.successMessage,a.config);l&&this.renderFieldLabel(a.elem,l,null==(i=a.config)?void 0:i.errorsContainer,!0),a.elem.classList.add((null==(s=a.config)?void 0:s.successFieldCssClass)||this.globalConfig.successFieldCssClass);}return}this.isValid=!1,a.elem.classList.add((null==(l=a.config)?void 0:l.errorFieldCssClass)||this.globalConfig.errorFieldCssClass);const n=this.createErrorLabelElem(e,a.errorMessage,a.config);this.renderFieldLabel(a.elem,n,null==(t=a.config)?void 0:t.errorsContainer),this.isTooltip()&&this.tooltips.push(this.renderTooltip(a.elem,n,null==(o=null==(r=a.config)?void 0:r.tooltip)?void 0:o.position));}renderErrors(e=!1){var i,s,l,t;if(this.isSubmitted||e){this.clearErrors(),this.isValid=!0;for(const e in this.groupFields){const r=this.groupFields[e];if(r.isValid){r.elems.forEach((e=>{var i,s;Object.assign(e.style,(null==(i=r.config)?void 0:i.successFieldStyle)||this.globalConfig.successFieldStyle),e.classList.add((null==(s=r.config)?void 0:s.successFieldCssClass)||this.globalConfig.successFieldCssClass);}));const s=this.createSuccessLabelElem(e,r.successMessage,r.config);s&&this.renderGroupLabel(r.groupElem,s,null==(i=r.config)?void 0:i.errorsContainer,!0);continue}this.isValid=!1,r.elems.forEach((e=>{var i,s;Object.assign(e.style,(null==(i=r.config)?void 0:i.errorFieldStyle)||this.globalConfig.errorFieldStyle),e.classList.add((null==(s=r.config)?void 0:s.errorFieldCssClass)||this.globalConfig.errorFieldCssClass);}));const o=this.createErrorLabelElem(e,r.errorMessage,r.config);this.renderGroupLabel(r.groupElem,o,null==(s=r.config)?void 0:s.errorsContainer),this.isTooltip()&&this.tooltips.push(this.renderTooltip(r.groupElem,o,null==(t=null==(l=r.config)?void 0:l.tooltip)?void 0:t.position));}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=>{this.addField(e,[...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}}
102
+ var __defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,i,s)=>i in e?__defProp(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s,__spreadValues=(e,i)=>{for(var s in i||(i={}))__hasOwnProp.call(i,s)&&__defNormalProp(e,s,i[s]);if(__getOwnPropSymbols)for(var s of __getOwnPropSymbols(i))__propIsEnum.call(i,s)&&__defNormalProp(e,s,i[s]);return e},__publicField=(e,i,s)=>(__defNormalProp(e,"symbol"!=typeof i?i+"":i,s),s);const EMAIL_REGEXP=/^(([^<>()[\]\\.,;:\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,}))$/,NUMBER_REGEXP=/^[0-9]+$/,PASSWORD_REGEXP=/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$/,STRONG_PASSWORD_REGEXP=/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/,isEmpty$1=e=>{let i=e;return "string"==typeof e&&(i=e.trim()),!i},isLengthMoreThanMax=(e,i)=>e.length>i,isLengthLessThanMin=(e,i)=>e.length<i,isNumber=e=>NUMBER_REGEXP.test(e),isPassword=e=>PASSWORD_REGEXP.test(e),isStrongPassword=e=>STRONG_PASSWORD_REGEXP.test(e),isNumberMoreThanMax=(e,i)=>e>i,isNumberLessThanMin=(e,i)=>e<i;var Rules,GroupRules,CustomStyleTagIds;!function(e){e.Required="required",e.Email="email",e.MinLength="minLength",e.MaxLength="maxLength",e.Password="password",e.Number="number",e.MaxNumber="maxNumber",e.MinNumber="minNumber",e.StrongPassword="strongPassword",e.CustomRegexp="customRegexp",e.MinFilesCount="minFilesCount",e.MaxFilesCount="maxFilesCount",e.Files="files";}(Rules||(Rules={})),(GroupRules||(GroupRules={})).Required="required",function(e){e.Label="label",e.LabelArrow="labelArrow";}(CustomStyleTagIds||(CustomStyleTagIds={}));const getDefaultFieldMessage=(e,i)=>{switch(e){case Rules.Required:return "The field is required";case Rules.Email:return "Email has invalid format";case Rules.MaxLength:return "The field must contain a maximum of :value characters".replace(":value",String(i));case Rules.MinLength:return "The field must contain a minimum of :value characters".replace(":value",String(i));case Rules.Password:return "Password must contain minimum eight characters, at least one letter and one number";case Rules.Number:return "Value should be a number";case Rules.StrongPassword:return "Password should contain minimum eight characters, at least one uppercase letter, one lowercase letter, one number and one special character";case Rules.MaxNumber:return "Number should be less or equal than :value".replace(":value",String(i));case Rules.MinNumber:return "Number should be more or equal than :value".replace(":value",String(i));case Rules.MinFilesCount:return "Files count should be more or equal than :value".replace(":value",String(i));case Rules.MaxFilesCount:return "Files count should be less or equal than :value".replace(":value",String(i));case Rules.Files:return "Uploaded files have one or several invalid properties (extension/size/type etc)";default:return "Value is incorrect"}},isPromise$1=e=>!!e&&"function"==typeof e.then,errorLabelCss=".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)}",defaultGlobalConfig={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};class JustValidate{constructor(e,i,s){__publicField(this,"form",null),__publicField(this,"fields",{}),__publicField(this,"groupFields",{}),__publicField(this,"errors",{}),__publicField(this,"isValid",!1),__publicField(this,"isSubmitted",!1),__publicField(this,"globalConfig",defaultGlobalConfig),__publicField(this,"errorLabels",{}),__publicField(this,"successLabels",{}),__publicField(this,"eventListeners",[]),__publicField(this,"dictLocale",[]),__publicField(this,"currentLocale"),__publicField(this,"customStyleTags",{}),__publicField(this,"onSuccessCallback"),__publicField(this,"onFailCallback"),__publicField(this,"tooltips",[]),__publicField(this,"lastScrollPosition"),__publicField(this,"isScrollTick"),__publicField(this,"refreshAllTooltips",(()=>{this.tooltips.forEach((e=>{e.refresh();}));})),__publicField(this,"handleDocumentScroll",(()=>{this.lastScrollPosition=window.scrollY,this.isScrollTick||(window.requestAnimationFrame((()=>{this.refreshAllTooltips(),this.isScrollTick=!1;})),this.isScrollTick=!0);})),__publicField(this,"formSubmitHandler",(e=>{e.preventDefault(),this.isSubmitted=!0,this.validateHandler(e);})),__publicField(this,"handleFieldChange",(e=>{let i;for(const s in this.fields){if(this.fields[s].elem===e){i=s;break}}i&&this.validateField(i,!0);})),__publicField(this,"handleGroupChange",(e=>{let i,s;for(const l in this.groupFields){const t=this.groupFields[l];if(t.elems.find((i=>i===e))){i=t,s=l;break}}i&&s&&this.validateGroup(s,i);})),__publicField(this,"handlerChange",(e=>{e.target&&(this.handleFieldChange(e.target),this.handleGroupChange(e.target),this.renderErrors());})),this.initialize(e,i,s);}initialize(e,i,s){if(this.form=null,this.errors={},this.isValid=!1,this.isSubmitted=!1,this.globalConfig=defaultGlobalConfig,this.errorLabels={},this.successLabels={},this.eventListeners=[],this.customStyleTags={},this.tooltips=[],"string"==typeof e){const i=document.querySelector(e);if(!i)throw Error(`Form with ${e} selector not found! Please check the form selector`);this.setForm(i);}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=__spreadValues(__spreadValues({},defaultGlobalConfig),i),s&&(this.dictLocale=s),this.isTooltip()){const e=document.createElement("style");e.textContent=errorLabelCss,this.customStyleTags[CustomStyleTagIds.Label]=document.head.appendChild(e),this.addListener("scroll",document,this.handleDocumentScroll);}}getLocalisedString(e){var i;if(!this.currentLocale||!this.dictLocale.length)return e;return (null==(i=this.dictLocale.find((i=>i.key===e)))?void 0:i.dict[this.currentLocale])||e}getFieldErrorMessage(e,i){const s="function"==typeof e.errorMessage?e.errorMessage(this.getElemValue(i),this.fields):e.errorMessage;return this.getLocalisedString(s)||getDefaultFieldMessage(e.rule,e.value)}getFieldSuccessMessage(e,i){const s="function"==typeof e?e(this.getElemValue(i),this.fields):e;return this.getLocalisedString(s)}getGroupErrorMessage(e){return this.getLocalisedString(e.errorMessage)||(e.rule===GroupRules.Required?"The field is required":"Group is incorrect")}getGroupSuccessMessage(e){return this.getLocalisedString(e.successMessage)}setFieldInvalid(e,i){this.fields[e].isValid=!1,this.fields[e].errorMessage=this.getFieldErrorMessage(i,this.fields[e].elem);}setFieldValid(e,i){this.fields[e].isValid=!0,void 0!==i&&(this.fields[e].successMessage=this.getFieldSuccessMessage(i,this.fields[e].elem));}setGroupInvalid(e,i){this.groupFields[e].isValid=!1,this.groupFields[e].errorMessage=this.getGroupErrorMessage(i);}setGroupValid(e,i){this.groupFields[e].isValid=!0,this.groupFields[e].successMessage=this.getGroupSuccessMessage(i);}getElemValue(e){switch(e.type){case"checkbox":return e.checked;case"file":return e.files;default:return e.value}}validateGroupRule(e,i,s,l){if(l.rule===GroupRules.Required)"radio"!==i&&"checkbox"!==i||(s.every((e=>!e.checked))?this.setGroupInvalid(e,l):this.setGroupValid(e,l));}validateFieldRule(e,i,s,l=!1){const t=s.value,r=this.getElemValue(i);if(s.plugin){s.plugin(r,this.fields)||this.setFieldInvalid(e,s);}else {switch(s.rule){case Rules.Required:isEmpty$1(r)&&this.setFieldInvalid(e,s);break;case Rules.Email:if("string"!=typeof r){this.setFieldInvalid(e,s);break}o=r,EMAIL_REGEXP.test(o)||this.setFieldInvalid(e,s);break;case Rules.MaxLength:if(void 0===t){console.error(`Value for ${s.rule} rule for [${e}] field is not defined. The field will be always invalid.`),this.setFieldInvalid(e,s);break}if("number"!=typeof t){console.error(`Value for ${s.rule} rule for [${e}] should be a number. The field will be always invalid.`),this.setFieldInvalid(e,s);break}if("string"!=typeof r){this.setFieldInvalid(e,s);break}if(""===r)break;isLengthMoreThanMax(r,t)&&this.setFieldInvalid(e,s);break;case Rules.MinLength:if(void 0===t){console.error(`Value for ${s.rule} rule for [${e}] field is not defined. The field will be always invalid.`),this.setFieldInvalid(e,s);break}if("number"!=typeof t){console.error(`Value for ${s.rule} rule for [${e}] should be a number. The field will be always invalid.`),this.setFieldInvalid(e,s);break}if("string"!=typeof r){this.setFieldInvalid(e,s);break}if(""===r)break;isLengthLessThanMin(r,t)&&this.setFieldInvalid(e,s);break;case Rules.Password:if("string"!=typeof r){this.setFieldInvalid(e,s);break}if(""===r)break;isPassword(r)||this.setFieldInvalid(e,s);break;case Rules.StrongPassword:if("string"!=typeof r){this.setFieldInvalid(e,s);break}if(""===r)break;isStrongPassword(r)||this.setFieldInvalid(e,s);break;case Rules.Number:if("string"!=typeof r){this.setFieldInvalid(e,s);break}if(""===r)break;isNumber(r)||this.setFieldInvalid(e,s);break;case Rules.MaxNumber:{if(void 0===t){console.error(`Value for ${s.rule} rule for [${e}] field is not defined. The field will be always invalid.`),this.setFieldInvalid(e,s);break}if("number"!=typeof t){console.error(`Value for ${s.rule} rule for [${e}] field should be a number. The field will be always invalid.`),this.setFieldInvalid(e,s);break}if("string"!=typeof r){this.setFieldInvalid(e,s);break}if(""===r)break;const i=+r;(Number.isNaN(i)||isNumberMoreThanMax(i,t))&&this.setFieldInvalid(e,s);break}case Rules.MinNumber:{if(void 0===t){console.error(`Value for ${s.rule} rule for [${e}] field is not defined. The field will be always invalid.`),this.setFieldInvalid(e,s);break}if("number"!=typeof t){console.error(`Value for ${s.rule} rule for [${e}] field should be a number. The field will be always invalid.`),this.setFieldInvalid(e,s);break}if("string"!=typeof r){this.setFieldInvalid(e,s);break}if(""===r)break;const i=+r;(Number.isNaN(i)||isNumberLessThanMin(i,t))&&this.setFieldInvalid(e,s);break}case Rules.CustomRegexp:{if(void 0===t)return console.error(`Value for ${s.rule} rule for [${e}] field is not defined. This field will be always invalid.`),void this.setFieldInvalid(e,s);let i;try{i=new RegExp(t);}catch(i){console.error(`Value for ${s.rule} rule for [${e}] should be a valid regexp. This field will be always invalid.`),this.setFieldInvalid(e,s);break}const l=String(r);""===l||i.test(l)||this.setFieldInvalid(e,s);break}case Rules.MinFilesCount:if(void 0===t){console.error(`Value for ${s.rule} rule for [${e}] field is not defined. This field will be always invalid.`),this.setFieldInvalid(e,s);break}if("number"!=typeof t){console.error(`Value for ${s.rule} rule for [${e}] field should be a number. The field will be always invalid.`),this.setFieldInvalid(e,s);break}if(Number.isFinite(null==r?void 0:r.length)&&r.length<t){this.setFieldInvalid(e,s);break}break;case Rules.MaxFilesCount:if(void 0===t){console.error(`Value for ${s.rule} rule for [${e}] field is not defined. This field will be always invalid.`),this.setFieldInvalid(e,s);break}if("number"!=typeof t){console.error(`Value for ${s.rule} rule for [${e}] field should be a number. The field will be always invalid.`),this.setFieldInvalid(e,s);break}if(Number.isFinite(null==r?void 0:r.length)&&r.length>t){this.setFieldInvalid(e,s);break}break;case Rules.Files:{if(void 0===t)return console.error(`Value for ${s.rule} rule for [${e}] field is not defined. This field will be always invalid.`),void this.setFieldInvalid(e,s);if("object"!=typeof t)return console.error(`Value for ${s.rule} rule for [${e}] field should be an object. This field will be always invalid.`),void this.setFieldInvalid(e,s);const i=t.files;if("object"!=typeof i)return console.error(`Value for ${s.rule} rule for [${e}] field should be an object with files array. This field will be always invalid.`),void this.setFieldInvalid(e,s);const l=(e,i)=>{const s=Number.isFinite(i.minSize)&&e.size<i.minSize,l=Number.isFinite(i.maxSize)&&e.size>i.maxSize,t=Array.isArray(i.names)&&!i.names.includes(e.name),r=Array.isArray(i.extensions)&&!i.extensions.includes(e.name.split(".")[e.name.split(".").length-1]),o=Array.isArray(i.types)&&!i.types.includes(e.type);return s||l||t||r||o};if("object"==typeof r&&null!==r)for(let t=0,o=r.length;t<o;++t){const o=r.item(t);if(!o){this.setFieldInvalid(e,s);break}if(l(o,i)){this.setFieldInvalid(e,s);break}}break}default:{if("function"!=typeof s.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,s);const i=s.validator(r,this.fields);if("boolean"!=typeof i&&"function"!=typeof i&&console.error(`Validator return value for [${e}] field should be boolean or function. It will be cast to boolean.`),"function"==typeof i){if(!l){this.fields[e].asyncCheckPending=!1;const l=i();return isPromise$1(l)?l.then((i=>{i||this.setFieldInvalid(e,s);})).catch((()=>{this.setFieldInvalid(e,s);})):(console.error(`Validator function for custom rule for [${e}] field should return a Promise. This field will be always invalid.`),void this.setFieldInvalid(e,s))}this.fields[e].asyncCheckPending=!0;}i||this.setFieldInvalid(e,s);}}var o;}}validateField(e,i=!1){var s;const l=this.fields[e];l.isValid=!0;const t=[];return [...l.rules].reverse().forEach((s=>{const r=this.validateFieldRule(e,l.elem,s,i);isPromise$1(r)&&t.push(r);})),l.isValid&&this.setFieldValid(e,null==(s=l.config)?void 0:s.successMessage),Promise.allSettled(t)}revalidateField(e){if("string"!=typeof e)throw Error("Field selector is not valid. Please specify a string selector.");return this.fields[e]?new Promise((i=>{this.validateField(e,!0).finally((()=>{this.clearFieldError(e),this.clearFieldLabel(e),this.renderFieldError(e),i(!!this.fields[e].isValid);}));})):(console.error("Field not found. Check the field selector."),Promise.reject())}validateGroup(e,i){const s=[];return [...i.rules].reverse().forEach((l=>{const t=this.validateGroupRule(e,i.type,i.elems,l);isPromise$1(t)&&s.push(t);})),Promise.allSettled(s)}focusInvalidField(){for(const e in this.fields){const i=this.fields[e];if(!i.isValid){setTimeout((()=>i.elem.focus()),0);break}}}afterSubmitValidation(e=!1){this.renderErrors(e),this.globalConfig.focusInvalidField&&this.focusInvalidField();}validate(e=!1){return new Promise((i=>{const s=[];Object.keys(this.fields).forEach((e=>{const i=this.validateField(e);isPromise$1(i)&&s.push(i);})),Object.keys(this.groupFields).forEach((e=>{const i=this.groupFields[e],l=this.validateGroup(e,i);isPromise$1(l)&&s.push(l);})),s.length?Promise.allSettled(s).then((()=>{this.afterSubmitValidation(e),i(!0);})):(this.afterSubmitValidation(e),i(!1));}))}revalidate(){return new Promise((e=>{this.validateHandler(void 0,!0).finally((()=>{this.globalConfig.focusInvalidField&&this.focusInvalidField(),e(this.isValid);}));}))}validateHandler(e,i=!1){return this.globalConfig.lockForm&&this.lockForm(),this.validate(i).finally((()=>{var i,s;this.globalConfig.lockForm&&this.unlockForm(),this.isValid?null==(i=this.onSuccessCallback)||i.call(this,e):null==(s=this.onFailCallback)||s.call(this,this.fields,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,i,s){i.addEventListener(e,s),this.eventListeners.push({type:e,elem:i,func:s});}removeListener(e,i,s){i.removeEventListener(e,s),this.eventListeners=this.eventListeners.filter((s=>s.type!==e||s.elem!==i));}addField(e,i,s){if("string"!=typeof e)throw Error("Field selector is not valid. Please specify a string selector.");const l=this.form.querySelector(e);if(!l)throw Error(`Field with ${e} selector not found! Please check the field selector.`);if(!Array.isArray(i)||!i.length)throw Error(`Rules argument for the field [${e}] should be an array and should contain at least 1 element.`);return i.forEach((i=>{if(!("rule"in i||"validator"in i||"plugin"in i))throw Error(`Rules argument for the field [${e}] must contain at least one rule or validator property.`);if(!(i.validator||i.plugin||i.rule&&Object.values(Rules).includes(i.rule)))throw Error(`Rule should be one of these types: ${Object.values(Rules).join(", ")}. Provided value: ${i.rule}`)})),this.fields[e]={elem:l,rules:i,isValid:void 0,config:s},this.setListeners(l),this.isSubmitted&&this.validate(),this}removeField(e){if("string"!=typeof e)throw Error("Field selector is not valid. Please specify a string selector.");if(!this.fields[e])return console.error("Field not found. Check the field selector."),this;const i=this.getListenerType(this.fields[e].elem.type);return this.removeListener(i,this.fields[e].elem,this.handlerChange),this.clearErrors(),delete this.fields[e],this}removeGroup(e){if("string"!=typeof e)throw Error("Group selector is not valid. Please specify a string selector.");return this.groupFields[e]?(this.groupFields[e].elems.forEach((e=>{const i=this.getListenerType(e.type);this.removeListener(i,e,this.handlerChange);})),this.clearErrors(),delete this.groupFields[e],this):(console.error("Group not found. Check the group selector."),this)}addRequiredGroup(e,i,s,l){if("string"!=typeof e)throw Error("Group selector is not valid. Please specify a string selector.");const t=this.form.querySelector(e);if(!t)throw Error(`Group with ${e} selector not found! Please check the group selector.`);const r=t.querySelectorAll("input"),o=Array.from(r).every((e=>"radio"===e.type)),a=Array.from(r).every((e=>"checkbox"===e.type));if(!o&&!a)throw Error("Group should contain either or checkboxes or radio buttons");return this.groupFields[e]={rules:[{rule:GroupRules.Required,errorMessage:i,successMessage:l}],groupElem:t,elems:Array.from(r),type:o?"radio":"checkbox",isDirty:!1,isValid:void 0,config:s},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 i=this.getListenerType(e.type);this.removeListener(i,e,this.handlerChange),this.addListener(i,e,this.handlerChange);}clearFieldLabel(e){var i,s;null==(i=this.errorLabels[e])||i.remove(),null==(s=this.successLabels[e])||s.remove();}clearFieldError(e){var i,s,l,t;const r=this.fields[e],o=(null==(i=r.config)?void 0:i.errorFieldStyle)||this.globalConfig.errorFieldStyle;Object.keys(o).forEach((e=>{r.elem.style[e]="";}));const a=(null==(s=r.config)?void 0:s.successFieldStyle)||this.globalConfig.successFieldStyle||{};Object.keys(a).forEach((e=>{r.elem.style[e]="";})),r.elem.classList.remove((null==(l=r.config)?void 0:l.errorFieldCssClass)||this.globalConfig.errorFieldCssClass,(null==(t=r.config)?void 0:t.successFieldCssClass)||this.globalConfig.successFieldCssClass);}clearErrors(){var e,i;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.clearFieldError(e);for(const s in this.groupFields){const l=this.groupFields[s],t=(null==(e=l.config)?void 0:e.errorFieldStyle)||this.globalConfig.errorFieldStyle;Object.keys(t).forEach((e=>{l.elems.forEach((i=>{var s;i.style[e]="",i.classList.remove((null==(s=l.config)?void 0:s.errorFieldCssClass)||this.globalConfig.errorFieldCssClass);}));}));const r=(null==(i=l.config)?void 0:i.successFieldStyle)||this.globalConfig.successFieldStyle||{};Object.keys(r).forEach((e=>{l.elems.forEach((i=>{var s;i.style[e]="",i.classList.remove((null==(s=l.config)?void 0:s.successFieldCssClass)||this.globalConfig.successFieldCssClass);}));}));}this.tooltips=[];}isTooltip(){return !!this.globalConfig.tooltip}lockForm(){const e=this.form.querySelectorAll("input, textarea, button, select");for(let i=0,s=e.length;i<s;++i)e[i].setAttribute("disabled","disabled"),e[i].style.pointerEvents="none",e[i].style.webkitFilter="grayscale(100%)",e[i].style.filter="grayscale(100%)";}unlockForm(){const e=this.form.querySelectorAll("input, textarea, button, select");for(let i=0,s=e.length;i<s;++i)e[i].removeAttribute("disabled"),e[i].style.pointerEvents="",e[i].style.webkitFilter="",e[i].style.filter="";}renderTooltip(e,i,s){var l;const{top:t,left:r,width:o,height:a}=e.getBoundingClientRect(),n=i.getBoundingClientRect(),d=s||(null==(l=this.globalConfig.tooltip)?void 0:l.position);switch(d){case"left":i.style.top=t+a/2-n.height/2+"px",i.style.left=r-n.width-5+"px";break;case"top":i.style.top=t-n.height-5+"px",i.style.left=r+o/2-n.width/2+"px";break;case"right":i.style.top=t+a/2-n.height/2+"px",i.style.left=`${r+o+5}px`;break;case"bottom":i.style.top=`${t+a+5}px`,i.style.left=r+o/2-n.width/2+"px";}i.dataset.direction=d;return {refresh:()=>{this.renderTooltip(e,i,s);}}}createErrorLabelElem(e,i,s){const l=document.createElement("div");l.innerHTML=i;const t=this.isTooltip()?null==s?void 0:s.errorLabelStyle:(null==s?void 0:s.errorLabelStyle)||this.globalConfig.errorLabelStyle;return Object.assign(l.style,t),l.classList.add((null==s?void 0:s.errorLabelCssClass)||this.globalConfig.errorLabelCssClass,"just-validate-error-label"),this.isTooltip()&&(l.dataset.tooltip="true"),this.globalConfig.testingMode&&(l.dataset.testId=`error-label-${e}`),this.errorLabels[e]=l,l}createSuccessLabelElem(e,i,s){if(void 0===i)return null;const l=document.createElement("div");l.innerHTML=i;const t=(null==s?void 0:s.successLabelStyle)||this.globalConfig.successLabelStyle;return Object.assign(l.style,t),l.classList.add((null==s?void 0:s.successLabelCssClass)||this.globalConfig.successLabelCssClass,"just-validate-success-label"),this.globalConfig.testingMode&&(l.dataset.testId=`success-label-${e}`),this.successLabels[e]=l,l}renderErrorsContainer(e,i){const s=i||this.globalConfig.errorsContainer;if("string"==typeof s){const i=this.form.querySelector(s);if(i)return i.appendChild(e),!0;console.error(`Error container with ${s} selector not found. Errors will be rendered as usual`);}return s instanceof Element?(s.appendChild(e),!0):(void 0!==s&&console.error("Error container not found. It should be a string or existing Element. Errors will be rendered as usual"),!1)}renderGroupLabel(e,i,s,l){if(!l){if(this.renderErrorsContainer(i,s))return}e.appendChild(i);}renderFieldLabel(e,i,s,l){var t,r,o,a,n,d,u;if(!l){if(this.renderErrorsContainer(i,s))return}if("checkbox"===e.type||"radio"===e.type){const s=document.querySelector(`label[for="${e.getAttribute("id")}"]`);"label"===(null==(r=null==(t=e.parentElement)?void 0:t.tagName)?void 0:r.toLowerCase())?null==(a=null==(o=e.parentElement)?void 0:o.parentElement)||a.appendChild(i):s?null==(n=s.parentElement)||n.appendChild(i):null==(d=e.parentElement)||d.appendChild(i);}else null==(u=e.parentElement)||u.appendChild(i);}renderFieldError(e){var i,s,l,t,r,o;const a=this.fields[e];if(a.isValid){if(!a.asyncCheckPending){const l=this.createSuccessLabelElem(e,a.successMessage,a.config);l&&this.renderFieldLabel(a.elem,l,null==(i=a.config)?void 0:i.errorsContainer,!0),a.elem.classList.add((null==(s=a.config)?void 0:s.successFieldCssClass)||this.globalConfig.successFieldCssClass);}return}this.isValid=!1,a.elem.classList.add((null==(l=a.config)?void 0:l.errorFieldCssClass)||this.globalConfig.errorFieldCssClass);const n=this.createErrorLabelElem(e,a.errorMessage,a.config);this.renderFieldLabel(a.elem,n,null==(t=a.config)?void 0:t.errorsContainer),this.isTooltip()&&this.tooltips.push(this.renderTooltip(a.elem,n,null==(o=null==(r=a.config)?void 0:r.tooltip)?void 0:o.position));}renderErrors(e=!1){var i,s,l,t;if(this.isSubmitted||e){this.clearErrors(),this.isValid=!0;for(const e in this.groupFields){const r=this.groupFields[e];if(r.isValid){r.elems.forEach((e=>{var i,s;Object.assign(e.style,(null==(i=r.config)?void 0:i.successFieldStyle)||this.globalConfig.successFieldStyle),e.classList.add((null==(s=r.config)?void 0:s.successFieldCssClass)||this.globalConfig.successFieldCssClass);}));const s=this.createSuccessLabelElem(e,r.successMessage,r.config);s&&this.renderGroupLabel(r.groupElem,s,null==(i=r.config)?void 0:i.errorsContainer,!0);continue}this.isValid=!1,r.elems.forEach((e=>{var i,s;Object.assign(e.style,(null==(i=r.config)?void 0:i.errorFieldStyle)||this.globalConfig.errorFieldStyle),e.classList.add((null==(s=r.config)?void 0:s.errorFieldCssClass)||this.globalConfig.errorFieldCssClass);}));const o=this.createErrorLabelElem(e,r.errorMessage,r.config);this.renderGroupLabel(r.groupElem,o,null==(s=r.config)?void 0:s.errorsContainer),this.isTooltip()&&this.tooltips.push(this.renderTooltip(r.groupElem,o,null==(t=null==(l=r.config)?void 0:l.tooltip)?void 0:t.position));}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=>{this.addField(e,[...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}}
101
103
 
102
104
  class CssClassObserver{constructor(t,e,s,a,l){this.targetNode=t,this.classToWatch=e,this.classAddedCallback=s,this.classRemovedCallback=a,this.observer=null,this.lastClassState=t.classList.contains(this.classToWatch),this.ignoreToggle=!!l,this.init();}init(){this.observer=new MutationObserver((t=>this.mutationCallback(t))),this.observe();}observe(){this.observer.observe(this.targetNode,{attributes:!0});}disconnect(){this.observer.disconnect();}mutationCallback(t){for(let e of t)if("attributes"===e.type&&"class"===e.attributeName){let t=e.target.classList.contains(this.classToWatch);(this.ignoreToggle||this.lastClassState!==t)&&(this.lastClassState=t,t?"function"==typeof this.classAddedCallback&&this.classAddedCallback():"function"==typeof this.classRemovedCallback&&this.classRemovedCallback());}}}class ContentObserver{constructor(t,e,s,a){this.targetNode=t,this.contentSelector=e,this.contentAddedCallback=s,this.contentRemovedCallback=a,this.observer=null,this.init();}init(){this.observer=new MutationObserver((t=>this.mutationCallback(t))),this.observe();}observe(){this.observer.observe(this.targetNode,{childList:!0,subtree:!0});}disconnect(){this.observer.disconnect();}mutationCallback(t){for(let e of t)"childList"===e.type&&(e.addedNodes.forEach((t=>{this._callbackExec(t);})),e.removedNodes.forEach((t=>{this._callbackExec(t,!0);})));}_callbackExec(t,e){const s=t.matches&&t.matches(this.contentSelector)?[t]:t.querySelectorAll?t.querySelectorAll(this.contentSelector):null,a=e&&"function"==typeof this.contentRemovedCallback?this.contentRemovedCallback:"function"==typeof this.contentAddedCallback?this.contentAddedCallback:null;s&&a&&s.forEach((t=>a(t)));}}
103
105
 
104
- const CONFIG_DEFAULT={errorFieldCssClass:"is-invalid",errorLabelCssClass:"just-validate-error-label"},NAME$s="justvalidatebi",CLASS_NAME_SRONLY="sr-only-justvalidate-bi",SELECTOR_SPAN_SRONLY=`.${CLASS_NAME_SRONLY}`;class FormValidate{constructor(e,t){return this.formSelector=e,this.target=document.querySelector(e),this.validate=new JustValidate(e,t),this.config=Object.assign({},CONFIG_DEFAULT,this.validate.globalConfig),this.formItems=[],this.init(),this.validate}init(){this.target.querySelectorAll("input, select").forEach((e=>{const t=new CssClassObserver(e,this.config.errorFieldCssClass,(()=>this.onInputError(e)),(()=>this.onInputErrorRemove(e)),!0);e.id||e.setAttribute("id",NAME$s+"-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 ContentObserver(e,"."+this.config.errorLabelCssClass,(()=>this.onFieldsetError(e)),(()=>this.onFieldsetErrorRemove(e)));e.id||e.setAttribute("id",NAME$s+"-fieldset-"+Math.random()),this.formItems.push({item:e,watcher:t});}}));}onInputError(e){const t=this.getErrorMessages(e),r=[];t.forEach(((t,s)=>{const i=e.id+"-error-"+s;t.setAttribute("id",i),r.push(i);})),r.length>0&&(e.setAttribute("aria-describedby",r.join(" ")),e.setAttribute("aria-invalid","true"));}onInputErrorRemove(e){e.removeAttribute("aria-describedby"),e.setAttribute("aria-invalid","false");}onFieldsetError(e){const t=this.getErrorMessages(e),r=[],s=[];if(t.forEach(((t,i)=>{const o=e.id+"-error-"+i;t.setAttribute("id",o),r.push(o),s.push(t.textContent);})),r.length>0){const t=e.querySelector("legend");t&&(t.setAttribute("aria-describedby",r.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(SELECTOR_SPAN_SRONLY);e&&e.remove();}}getErrorMessages(e){let t=e,r=t.querySelectorAll("."+this.config.errorLabelCssClass);for(;null!=t&&0===r.length;)t=t.parentNode,r=t.querySelectorAll("."+this.config.errorLabelCssClass);return r}}const ValidatorSelectAutocomplete=(e,t={})=>(r,s)=>{let i=!1;const o=s[e];if(!o)throw new Error("ValidatorSelectAutocomplete: "+e+" not found as form field");return t.required||r?document.querySelector("#"+o.elem.id+"-select").querySelectorAll("option").forEach((e=>{e.text===r&&(i=!0);})):i=!0,i};
106
+ const CONFIG_DEFAULT={errorFieldCssClass:"is-invalid",errorLabelCssClass:"just-validate-error-label"},NAME$u="justvalidatebi",CLASS_NAME_SRONLY="sr-only-justvalidate-bi",SELECTOR_SPAN_SRONLY=`.${CLASS_NAME_SRONLY}`;class FormValidate{constructor(e,t){return this.formSelector=e,this.target=document.querySelector(e),this.validate=new JustValidate(e,t),this.config=Object.assign({},CONFIG_DEFAULT,this.validate.globalConfig),this.formItems=[],this.init(),this.validate}init(){this.target.querySelectorAll("input, select").forEach((e=>{const t=new CssClassObserver(e,this.config.errorFieldCssClass,(()=>this.onInputError(e)),(()=>this.onInputErrorRemove(e)),!0);e.id||e.setAttribute("id",NAME$u+"-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 ContentObserver(e,"."+this.config.errorLabelCssClass,(()=>this.onFieldsetError(e)),(()=>this.onFieldsetErrorRemove(e)));e.id||e.setAttribute("id",NAME$u+"-fieldset-"+Math.random()),this.formItems.push({item:e,watcher:t});}}));}onInputError(e){const t=this.getErrorMessages(e),r=[];t.forEach(((t,s)=>{const i=e.id+"-error-"+s;t.setAttribute("id",i),r.push(i);})),r.length>0&&(e.setAttribute("aria-describedby",r.join(" ")),e.setAttribute("aria-invalid","true"));}onInputErrorRemove(e){e.removeAttribute("aria-describedby"),e.setAttribute("aria-invalid","false");}onFieldsetError(e){const t=this.getErrorMessages(e),r=[],s=[];if(t.forEach(((t,i)=>{const o=e.id+"-error-"+i;t.setAttribute("id",o),r.push(o),s.push(t.textContent);})),r.length>0){const t=e.querySelector("legend");t&&(t.setAttribute("aria-describedby",r.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(SELECTOR_SPAN_SRONLY);e&&e.remove();}}getErrorMessages(e){let t=e,r=t.querySelectorAll("."+this.config.errorLabelCssClass);for(;null!=t&&0===r.length;)t=t.parentNode,r=t.querySelectorAll("."+this.config.errorLabelCssClass);return r}}const ValidatorSelectAutocomplete=(e,t={})=>(r,s)=>{let i=!1;const o=s[e];if(!o)throw new Error("ValidatorSelectAutocomplete: "+e+" not found as form field");return t.required||r?document.querySelector("#"+o.elem.id+"-select").querySelectorAll("option").forEach((e=>{e.text===r&&(i=!0);})):i=!0,i};
105
107
 
106
- const NAME$r="input",EVENT_MOUSEDOWN_DATA_API$2="mousedown.bs.input.data-api",EVENT_KEYUP_DATA_API$4="keyup.bs.input.data-api",EVENT_CHANGE="change.bs.input";class Input extends BaseComponent{constructor(e){super(e),this._label=new InputLabel$1(e),this._bindEvents();}static get NAME(){return NAME$r}_bindEvents(){"file"===this._element.getAttribute("type")&&EventHandler$1.on(this._element,EVENT_CHANGE,(()=>{this._handleFileDescription();}));}_handleFileDescription(){const e=[];let t="";Array.from(this._element.files).forEach((t=>{const n=Math.round(parseInt(t.size,10)/1024);e.push(t.name+" ("+n+"kb)");})),this._element.files.length>1&&(t=this._element.files.length+" file da caricare: ");const n=SelectorEngine$1.findOne('label[for="'+this._element.getAttribute("id")+'"] label.form-file-name',this._element);n&&(n.innerText=t+e.join("; "));}}const excludes=["select",'input[data-bs-input][type="password"]',"input.input-password[data-bs-input]",'input[data-bs-autocomplete][type="search"]','input[type="time"]'],createInput$3=e=>{const t=!!excludes.find((t=>e.matches(t))),n=!("number"!==e.getAttribute("type")||!e.parentNode.querySelector('button[class^="input-number-"]'));return t||n?null:Input.getOrCreateInstance(e)};EventHandler$1.on(document,EVENT_MOUSEDOWN_DATA_API$2,"input, textarea, label",(function(){const e=InputLabel$1.getInputFromLabel(this)||this;createInput$3(e);})),EventHandler$1.on(document,EVENT_KEYUP_DATA_API$4,"input, textarea, label",(function(){const e=InputLabel$1.getInputFromLabel(this)||this,t=createInput$3(e);t&&t._label&&t._label._labelOut();}));const Input$1 = Input;
108
+ const NAME$t="input",EVENT_MOUSEDOWN_DATA_API$2="mousedown.bs.input.data-api",EVENT_KEYUP_DATA_API$4="keyup.bs.input.data-api",EVENT_CHANGE="change.bs.input";class Input extends BaseComponent{constructor(e){super(e),this._label=new InputLabel$1(e),this._bindEvents();}static get NAME(){return NAME$t}_bindEvents(){"file"===this._element.getAttribute("type")&&EventHandler$1.on(this._element,EVENT_CHANGE,(()=>{this._handleFileDescription();}));}_handleFileDescription(){const e=[];let t="";Array.from(this._element.files).forEach((t=>{const n=Math.round(parseInt(t.size,10)/1024);e.push(t.name+" ("+n+"kb)");})),this._element.files.length>1&&(t=this._element.files.length+" file da caricare: ");const n=SelectorEngine$1.findOne('label[for="'+this._element.getAttribute("id")+'"] label.form-file-name',this._element);n&&(n.innerText=t+e.join("; "));}}const excludes=["select",'input[data-bs-input][type="password"]',"input.input-password[data-bs-input]",'input[data-bs-autocomplete][type="search"]','input[type="time"]'],createInput$3=e=>{const t=!!excludes.find((t=>e.matches(t))),n=!("number"!==e.getAttribute("type")||!e.parentNode.querySelector('button[class^="input-number-"]'));return t||n?null:Input.getOrCreateInstance(e)};EventHandler$1.on(document,EVENT_MOUSEDOWN_DATA_API$2,"input, textarea, label",(function(){const e=InputLabel$1.getInputFromLabel(this)||this;createInput$3(e);})),EventHandler$1.on(document,EVENT_KEYUP_DATA_API$4,"input, textarea, label",(function(){const e=InputLabel$1.getInputFromLabel(this)||this,t=createInput$3(e);t&&t._label&&t._label._labelOut();}));const Input$1 = Input;
107
109
 
108
110
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
109
111
 
@@ -117,12 +119,12 @@
117
119
 
118
120
  var accessibleAutocomplete_min=createCommonjsModule((function(e,t){var n;n=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r});},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0});},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=37)}([function(e,t,n){var r=n(1),o=n(6),i=n(7),u=n(16),a=n(18),s="prototype",l=function(e,t,n){var c,p,f,d,h=e&l.F,v=e&l.G,m=e&l.S,y=e&l.P,_=e&l.B,g=v?r:m?r[t]||(r[t]={}):(r[t]||{})[s],b=v?o:o[t]||(o[t]={}),w=b[s]||(b[s]={});for(c in v&&(n=t),n)f=((p=!h&&g&&void 0!==g[c])?g:n)[c],d=_&&p?a(f,r):y&&"function"==typeof f?a(Function.call,f):f,g&&u(g,c,f,e&l.U),b[c]!=f&&i(b,c,d),y&&w[c]!=f&&(w[c]=f);};r.core=o,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l;},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n);},function(e,t){e.exports=function(e){return "object"==typeof e?null!==e:"function"==typeof e};},function(e,t,n){e.exports=!n(4)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}));},function(e,t){e.exports=function(e){try{return !!e()}catch(e){return !0}};},function(e,t,n){n.r(t),n.d(t,"h",(function(){return a})),n.d(t,"createElement",(function(){return a})),n.d(t,"cloneElement",(function(){return c})),n.d(t,"Component",(function(){return L})),n.d(t,"render",(function(){return T})),n.d(t,"rerender",(function(){return h})),n.d(t,"options",(function(){return o}));var r=function(){},o={},i=[],u=[];function a(e,t){var n,a,s,l,c=u;for(l=arguments.length;2<l--;)i.push(arguments[l]);for(t&&null!=t.children&&(i.length||i.push(t.children),delete t.children);i.length;)if((a=i.pop())&&void 0!==a.pop)for(l=a.length;l--;)i.push(a[l]);else "boolean"==typeof a&&(a=null),(s="function"!=typeof e)&&(null==a?a="":"number"==typeof a?a=String(a):"string"!=typeof a&&(s=!1)),s&&n?c[c.length-1]+=a:c===u?c=[a]:c.push(a),n=s;var p=new r;return p.nodeName=e,p.children=c,p.attributes=null==t?void 0:t,p.key=null==t?void 0:t.key,void 0!==o.vnode&&o.vnode(p),p}function s(e,t){for(var n in t)e[n]=t[n];return e}var l="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;function c(e,t){return a(e.nodeName,s(s({},e.attributes),t),2<arguments.length?[].slice.call(arguments,2):e.children)}var p=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,f=[];function d(e){!e._dirty&&(e._dirty=!0)&&1==f.push(e)&&(o.debounceRendering||l)(h);}function h(){var e,t=f;for(f=[];e=t.pop();)e._dirty&&j(e);}function v(e,t){return e.normalizedNodeName===t||e.nodeName.toLowerCase()===t.toLowerCase()}function m(e){var t=s({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var r in n)void 0===t[r]&&(t[r]=n[r]);return t}function y(e){var t=e.parentNode;t&&t.removeChild(e);}function _(e,t,n,r,o){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),r&&r(e);else if("class"!==t||o)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var i in n)i in r||(e.style[i]="");for(var i in r)e.style[i]="number"==typeof r[i]&&!1===p.test(i)?r[i]+"px":r[i];}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var u=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,g,u):e.removeEventListener(t,g,u),(e._listeners||(e._listeners={}))[t]=r;}else if("list"!==t&&"type"!==t&&!o&&t in e){try{e[t]=null==r?"":r;}catch(e){}null!=r&&!1!==r||"spellcheck"==t||e.removeAttribute(t);}else {var a=o&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?a?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(a?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r));}else e.className=r||"";}function g(e){return this._listeners[e.type](o.event&&o.event(e)||e)}var b=[],w=0,x=!1,O=!1;function C(){for(var e;e=b.pop();)o.afterMount&&o.afterMount(e),e.componentDidMount&&e.componentDidMount();}function S(e,t,n,r,o){var i=e,u=x;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||o)?e.nodeValue!=t&&(e.nodeValue=t):(i=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(i,e),E(e,!0))),i.__preactattr_=!0,i;var a=t.nodeName;if("function"==typeof a)return function(e,t,n,r){for(var o=e&&e._component,i=o,u=e,a=o&&e._componentConstructor===t.nodeName,s=a,l=m(t);o&&!s&&(o=o._parentComponent);)s=o.constructor===t.nodeName;return o&&s&&(!r||o._component)?(k(o,l,3,n,r),e=o.base):(i&&!a&&(P(i),e=u=null),o=I(t.nodeName,l,n),e&&!o.nextBase&&(o.nextBase=e,u=null),k(o,l,1,n,r),e=o.base,u&&e!==u&&(u._component=null,E(u,!1))),e}(e,t,n,r);if(x="svg"===a||"foreignObject"!==a&&x,a=String(a),(!e||!v(e,a))&&(i=function(e,t){var n=t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return n.normalizedNodeName=e,n}(a,x),e)){for(;e.firstChild;)i.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(i,e),E(e,!0);}var s=i.firstChild,l=i.__preactattr_,c=t.children;if(null==l){l=i.__preactattr_={};for(var p=i.attributes,f=p.length;f--;)l[p[f].name]=p[f].value;}return !O&&c&&1===c.length&&"string"==typeof c[0]&&null!=s&&void 0!==s.splitText&&null==s.nextSibling?s.nodeValue!=c[0]&&(s.nodeValue=c[0]):(c&&c.length||null!=s)&&function(e,t,n,r,o){var i,u,a,s,l,c,p,f,d=e.childNodes,h=[],m={},_=0,g=0,b=d.length,w=0,x=t?t.length:0;if(0!==b)for(var O=0;O<b;O++){var C=d[O],M=C.__preactattr_;null!=(N=x&&M?C._component?C._component.__key:M.key:null)?(_++,m[N]=C):(M||(void 0!==C.splitText?!o||C.nodeValue.trim():o))&&(h[w++]=C);}if(0!==x)for(O=0;O<x;O++){var N;if(l=null,null!=(N=(s=t[O]).key))_&&void 0!==m[N]&&(l=m[N],m[N]=void 0,_--);else if(g<w)for(i=g;i<w;i++)if(void 0!==h[i]&&(c=u=h[i],f=o,"string"==typeof(p=s)||"number"==typeof p?void 0!==c.splitText:"string"==typeof p.nodeName?!c._componentConstructor&&v(c,p.nodeName):f||c._componentConstructor===p.nodeName)){l=u,h[i]=void 0,i===w-1&&w--,i===g&&g++;break}l=S(l,s,n,r),a=d[O],l&&l!==e&&l!==a&&(null==a?e.appendChild(l):l===a.nextSibling?y(a):e.insertBefore(l,a));}if(_)for(var O in m)void 0!==m[O]&&E(m[O],!1);for(;g<=w;)void 0!==(l=h[w--])&&E(l,!1);}(i,c,n,r,O||null!=l.dangerouslySetInnerHTML),function(e,t,n){var r;for(r in n)t&&null!=t[r]||null==n[r]||_(e,r,n[r],n[r]=void 0,x);for(r in t)"children"===r||"innerHTML"===r||r in n&&t[r]===("value"===r||"checked"===r?e[r]:n[r])||_(e,r,n[r],n[r]=t[r],x);}(i,t.attributes,l),x=u,i}function E(e,t){var n=e._component;n?P(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||y(e),M(e));}function M(e){for(e=e.lastChild;e;){var t=e.previousSibling;E(e,!0),e=t;}}var N=[];function I(e,t,n){var r,o=N.length;for(e.prototype&&e.prototype.render?(r=new e(t,n),L.call(r,t,n)):((r=new L(t,n)).constructor=e,r.render=A);o--;)if(N[o].constructor===e)return r.nextBase=N[o].nextBase,N.splice(o,1),r;return r}function A(e,t,n){return this.constructor(e,n)}function k(e,t,n,r,i){e._disable||(e._disable=!0,e.__ref=t.ref,e.__key=t.key,delete t.ref,delete t.key,void 0===e.constructor.getDerivedStateFromProps&&(!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,r)),r&&r!==e.context&&(e.prevContext||(e.prevContext=e.context),e.context=r),e.prevProps||(e.prevProps=e.props),e.props=t,e._disable=!1,0!==n&&(1!==n&&!1===o.syncComponentUpdates&&e.base?d(e):j(e,1,i)),e.__ref&&e.__ref(e));}function j(e,t,n,r){if(!e._disable){var i,u,a,l=e.props,c=e.state,p=e.context,f=e.prevProps||l,d=e.prevState||c,h=e.prevContext||p,v=e.base,y=e.nextBase,_=v||y,g=e._component,M=!1,N=h;if(e.constructor.getDerivedStateFromProps&&(c=s(s({},c),e.constructor.getDerivedStateFromProps(l,c)),e.state=c),v&&(e.props=f,e.state=d,e.context=h,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(l,c,p)?M=!0:e.componentWillUpdate&&e.componentWillUpdate(l,c,p),e.props=l,e.state=c,e.context=p),e.prevProps=e.prevState=e.prevContext=e.nextBase=null,e._dirty=!1,!M){i=e.render(l,c,p),e.getChildContext&&(p=s(s({},p),e.getChildContext())),v&&e.getSnapshotBeforeUpdate&&(N=e.getSnapshotBeforeUpdate(f,d));var A,L,T=i&&i.nodeName;if("function"==typeof T){var B=m(i);(u=g)&&u.constructor===T&&B.key==u.__key?k(u,B,1,p,!1):(A=u,e._component=u=I(T,B,p),u.nextBase=u.nextBase||y,u._parentComponent=e,k(u,B,0,p,!1),j(u,1,n,!0)),L=u.base;}else a=_,(A=g)&&(a=e._component=null),(_||1===t)&&(a&&(a._component=null),L=function(e,t,n,r,o,i){w++||(x=null!=o&&void 0!==o.ownerSVGElement,O=null!=e&&!("__preactattr_"in e));var u=S(e,t,n,r,i);return o&&u.parentNode!==o&&o.appendChild(u),--w||(O=!1,i||C()),u}(a,i,p,n||!v,_&&_.parentNode,!0));if(_&&L!==_&&u!==g){var D=_.parentNode;D&&L!==D&&(D.replaceChild(L,_),A||(_._component=null,E(_,!1)));}if(A&&P(A),(e.base=L)&&!r){for(var F=e,R=e;R=R._parentComponent;)(F=R).base=L;L._component=F,L._componentConstructor=F.constructor;}}for(!v||n?b.unshift(e):M||(e.componentDidUpdate&&e.componentDidUpdate(f,d,N),o.afterUpdate&&o.afterUpdate(e));e._renderCallbacks.length;)e._renderCallbacks.pop().call(e);w||r||C();}}function P(e){o.beforeUnmount&&o.beforeUnmount(e);var t=e.base;e._disable=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?P(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),y(e.nextBase=t),N.push(e),M(t)),e.__ref&&e.__ref(null);}function L(e,t){this._dirty=!0,this.context=t,this.props=e,this.state=this.state||{},this._renderCallbacks=[];}function T(e,t,n){return function(e,t,n,r,o,i){w++||(x=null!=o&&void 0!==o.ownerSVGElement,O=null!=e&&!("__preactattr_"in e));var u=S(e,t,n,r,i);return o&&u.parentNode!==o&&o.appendChild(u),--w||(O=!1,i||C()),u}(n,e,{},!1,t,!1)}s(L.prototype,{setState:function(e,t){this.prevState||(this.prevState=this.state),this.state=s(s({},this.state),"function"==typeof e?e(this.state,this.props):e),t&&this._renderCallbacks.push(t),d(this);},forceUpdate:function(e){e&&this._renderCallbacks.push(e),j(this,2);},render:function(){}});var B={h:a,createElement:a,cloneElement:c,Component:L,render:T,rerender:h,options:o};t.default=B;},function(e,t){var n=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n);},function(e,t,n){var r=n(8),o=n(40);e.exports=n(3)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e};},function(e,t,n){var r=n(9),o=n(38),i=n(39),u=Object.defineProperty;t.f=n(3)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return u(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return "value"in n&&(e[t]=n.value),e};},function(e,t,n){var r=n(2);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e};},function(e,t){var n=0,r=Math.random();e.exports=function(e){return "Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))};},function(e,t,n){var r=n(22);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return "String"==r(e)?e.split(""):Object(e)};},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e};},function(e,t,n){var r=n(4);e.exports=function(e,t){return !!e&&r((function(){t?e.call(null,(function(){}),1):e.call(null);}))};},function(e,t,n){var r=n(0);r(r.S+r.F,"Object",{assign:n(41)});},function(e,t,n){var r=n(2),o=n(1).document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}};},function(e,t,n){var r=n(1),o=n(7),i=n(17),u=n(10)("src"),a="toString",s=Function[a],l=(""+s).split(a);n(6).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,a){var s="function"==typeof n;s&&(i(n,"name")||o(n,"name",t)),e[t]!==n&&(s&&(i(n,u)||o(n,u,e[t]?""+e[t]:l.join(String(t)))),e===r?e[t]=n:a?e[t]?e[t]=n:o(e,t,n):(delete e[t],o(e,t,n)));})(Function.prototype,a,(function(){return "function"==typeof this&&this[u]||s.call(this)}));},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)};},function(e,t,n){var r=n(19);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}};},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e};},function(e,t,n){var r=n(42),o=n(28);e.exports=Object.keys||function(e){return r(e,o)};},function(e,t,n){var r=n(11),o=n(12);e.exports=function(e){return r(o(e))};},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)};},function(e,t,n){var r=n(21),o=n(24),i=n(43);e.exports=function(e){return function(t,n,u){var a,s=r(t),l=o(s.length),c=i(u,l);if(e&&n!=n){for(;c<l;)if((a=s[c++])!=a)return !0}else for(;c<l;c++)if((e||c in s)&&s[c]===n)return e||c||0;return !e&&-1}};},function(e,t,n){var r=n(25),o=Math.min;e.exports=function(e){return 0<e?o(r(e),9007199254740991):0};},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(0<e?r:n)(e)};},function(e,t,n){var r=n(27)("keys"),o=n(10);e.exports=function(e){return r[e]||(r[e]=o(e))};},function(e,t,n){var r=n(6),o=n(1),i="__core-js_shared__",u=o[i]||(o[i]={});(e.exports=function(e,t){return u[e]||(u[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(44)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"});},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",");},function(e,t,n){var r=n(12);e.exports=function(e){return Object(r(e))};},function(e,t,n){var r=n(8).f,o=Function.prototype,i=/^\s*function ([^ (]*)/;"name"in o||n(3)&&r(o,"name",{configurable:!0,get:function(){try{return (""+this).match(i)[1]}catch(e){return ""}}});},function(e,t,n){var r=n(0),o=n(32)(1);r(r.P+r.F*!n(13)([].map,!0),"Array",{map:function(e){return o(this,e,arguments[1])}});},function(e,t,n){var r=n(18),o=n(11),i=n(29),u=n(24),a=n(47);e.exports=function(e,t){var n=1==e,s=2==e,l=3==e,c=4==e,p=6==e,f=5==e||p,d=t||a;return function(t,a,h){for(var v,m,y=i(t),_=o(y),g=r(a,h,3),b=u(_.length),w=0,x=n?d(t,b):s?d(t,0):void 0;w<b;w++)if((f||w in _)&&(m=g(v=_[w],w,y),e))if(n)x[w]=m;else if(m)switch(e){case 3:return !0;case 5:return v;case 6:return w;case 2:x.push(v);}else if(c)return !1;return p?-1:l||c?c:x}};},function(e,t,n){var r=n(22);e.exports=Array.isArray||function(e){return "Array"==r(e)};},function(e,t,n){var r=n(27)("wks"),o=n(10),i=n(1).Symbol,u="function"==typeof i;(e.exports=function(e){return r[e]||(r[e]=u&&i[e]||(u?i:o)("Symbol."+e))}).store=r;},function(e,t,n){var r=n(0),o=n(23)(!1),i=[].indexOf,u=!!i&&1/[1].indexOf(1,-0)<0;r(r.P+r.F*(u||!n(13)(i)),"Array",{indexOf:function(e){return u?i.apply(this,arguments)||0:o(this,e,arguments[1])}});},function(e,t,n){var r=n(0);r(r.S,"Object",{create:n(52)});},function(e,t,n){t.__esModule=!0,t.default=void 0,n(14),n(30),n(31),n(35),n(49),n(50);var r=n(5),o=function(e){return e&&e.__esModule?e:{default:e}}(n(51));function i(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=u(e.source)),(0, r.render)((0, r.createElement)(o.default,e),e.element);}var u=function(e){return function(t,n){n(e.filter((function(e){return -1!==e.toLowerCase().indexOf(t.toLowerCase())})));}};i.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 n=[].filter.call(e.selectElement.options,(function(e){return (e.textContent||e.innerText)===t}))[0];n&&(n.selected=!0);},e.selectElement.value||void 0===e.defaultValue){var n=e.selectElement.options[e.selectElement.options.selectedIndex];e.defaultValue=n.textContent||n.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 r=document.createElement("div");e.selectElement.parentNode.insertBefore(r,e.selectElement),i(Object.assign({},e,{element:r})),e.selectElement.style.display="none",e.selectElement.id=e.selectElement.id+"-select";};var a=i;t.default=a;},function(e,t,n){e.exports=!n(3)&&!n(4)((function(){return 7!=Object.defineProperty(n(15)("div"),"a",{get:function(){return 7}}).a}));},function(e,t,n){var r=n(2);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")};},function(e,t){e.exports=function(e,t){return {enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}};},function(e,t,n){var r=n(20),o=n(45),i=n(46),u=n(29),a=n(11),s=Object.assign;e.exports=!s||n(4)((function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e;})),7!=s({},e)[n]||Object.keys(s({},t)).join("")!=r}))?function(e,t){for(var n=u(e),s=arguments.length,l=1,c=o.f,p=i.f;l<s;)for(var f,d=a(arguments[l++]),h=c?r(d).concat(c(d)):r(d),v=h.length,m=0;m<v;)p.call(d,f=h[m++])&&(n[f]=d[f]);return n}:s;},function(e,t,n){var r=n(17),o=n(21),i=n(23)(!1),u=n(26)("IE_PROTO");e.exports=function(e,t){var n,a=o(e),s=0,l=[];for(n in a)n!=u&&r(a,n)&&l.push(n);for(;t.length>s;)r(a,n=t[s++])&&(~i(l,n)||l.push(n));return l};},function(e,t,n){var r=n(25),o=Math.max,i=Math.min;e.exports=function(e,t){return (e=r(e))<0?o(e+t,0):i(e,t)};},function(e,t){e.exports=!1;},function(e,t){t.f=Object.getOwnPropertySymbols;},function(e,t){t.f={}.propertyIsEnumerable;},function(e,t,n){var r=n(48);e.exports=function(e,t){return new(r(e))(t)};},function(e,t,n){var r=n(2),o=n(33),i=n(34)("species");e.exports=function(e){var t;return o(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!o(t.prototype)||(t=void 0),r(t)&&null===(t=t[i])&&(t=void 0)),void 0===t?Array:t};},function(e,t,n){var r=n(0),o=n(32)(2);r(r.P+r.F*!n(13)([].filter,!0),"Array",{filter:function(e){return o(this,e,arguments[1])}});},function(e,t,n){var r=n(0);r(r.S,"Array",{isArray:n(33)});},function(e,t,n){t.__esModule=!0,t.default=void 0,n(14),n(36),n(30),n(31),n(35),n(55),n(58);var r=n(5),o=u(n(60)),i=u(n(61));function u(e){return e&&e.__esModule?e:{default:e}}function a(){return (a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);}return e}).apply(this,arguments)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var l={13:"enter",27:"escape",32:"space",38:"up",40:"down"};function c(){return "undefined"!=typeof navigator&&!(!navigator.userAgent.match(/(iPod|iPhone|iPad)/g)||!navigator.userAgent.match(/AppleWebKit/g))}var p=function(e){function t(t){var n;return (n=e.call(this,t)||this).elementReferences={},n.state={focused:null,hovered:null,menuOpen:!1,options:t.defaultValue?[t.defaultValue]:[],query:t.defaultValue,validChoiceMade:!1,selected:null,ariaHint:!0},n.handleComponentBlur=n.handleComponentBlur.bind(s(s(n))),n.handleKeyDown=n.handleKeyDown.bind(s(s(n))),n.handleUpArrow=n.handleUpArrow.bind(s(s(n))),n.handleDownArrow=n.handleDownArrow.bind(s(s(n))),n.handleEnter=n.handleEnter.bind(s(s(n))),n.handlePrintableKey=n.handlePrintableKey.bind(s(s(n))),n.handleListMouseLeave=n.handleListMouseLeave.bind(s(s(n))),n.handleOptionBlur=n.handleOptionBlur.bind(s(s(n))),n.handleOptionClick=n.handleOptionClick.bind(s(s(n))),n.handleOptionFocus=n.handleOptionFocus.bind(s(s(n))),n.handleOptionMouseDown=n.handleOptionMouseDown.bind(s(s(n))),n.handleOptionMouseEnter=n.handleOptionMouseEnter.bind(s(s(n))),n.handleInputBlur=n.handleInputBlur.bind(s(s(n))),n.handleInputChange=n.handleInputChange.bind(s(s(n))),n.handleInputFocus=n.handleInputFocus.bind(s(s(n))),n.pollInputElement=n.pollInputElement.bind(s(s(n))),n.getDirectInputChanges=n.getDirectInputChanges.bind(s(s(n))),n}!function(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;}(t,e);var n=t.prototype;return n.isQueryAnOption=function(e,t){var n=this;return -1!==t.map((function(e){return n.templateInputValue(e).toLowerCase()})).indexOf(e.toLowerCase())},n.componentDidMount=function(){this.pollInputElement();},n.componentWillUnmount=function(){clearTimeout(this.$pollInput);},n.pollInputElement=function(){var e=this;this.getDirectInputChanges(),this.$pollInput=setTimeout((function(){e.pollInputElement();}),100);},n.getDirectInputChanges=function(){var e=this.elementReferences[-1];e&&e.value!==this.state.query&&this.handleInputChange({target:{value:e.value}});},n.componentDidUpdate=function(e,t){var n=this.state.focused,r=null===n,o=t.focused!==n;o&&!r&&this.elementReferences[n].focus();var i=-1===n,u=o&&null===t.focused;if(i&&u){var a=this.elementReferences[n];a.setSelectionRange(0,a.value.length);}},n.hasAutoselect=function(){return !c()&&this.props.autoselect},n.templateInputValue=function(e){var t=this.props.templates&&this.props.templates.inputValue;return t?t(e):e},n.templateSuggestion=function(e){var t=this.props.templates&&this.props.templates.suggestion;return t?t(e):e},n.handleComponentBlur=function(e){var t,n=this.state,r=n.options,o=n.query,i=n.selected;this.props.confirmOnBlur?(t=e.query||o,this.props.onConfirm(r[i])):t=o,this.setState({focused:null,menuOpen:e.menuOpen||!1,query:t,selected:null,validChoiceMade:this.isQueryAnOption(t,r)});},n.handleListMouseLeave=function(e){this.setState({hovered:null});},n.handleOptionBlur=function(e,t){var n=this.state,r=n.focused,o=n.menuOpen,i=n.options,u=n.selected,a=null===e.relatedTarget,s=e.relatedTarget===this.elementReferences[-1],l=r!==t&&-1!==r;if(!l&&a||!l&&!s){var p=o&&c();this.handleComponentBlur({menuOpen:p,query:this.templateInputValue(i[u])});}},n.handleInputBlur=function(e){var t=this.state,n=t.focused,r=t.menuOpen,o=t.options,i=t.query,u=t.selected;if(-1===n){var a=r&&c(),s=c()?i:this.templateInputValue(o[u]);this.handleComponentBlur({menuOpen:a,query:s});}},n.handleInputChange=function(e){var t=this,n=this.props,r=n.minLength,o=n.source,i=n.showAllValues,u=this.hasAutoselect(),a=e.target.value,s=0===a.length,l=this.state.query.length!==a.length,c=a.length>=r;this.setState({query:a,ariaHint:s}),i||!s&&l&&c?o(a,(function(e){var n=0<e.length;t.setState({menuOpen:n,options:e,selected:u&&n?0:-1,validChoiceMade:!1});})):!s&&c||this.setState({menuOpen:!1,options:[]});},n.handleInputClick=function(e){this.handleInputChange(e);},n.handleInputFocus=function(e){var t=this.state,n=t.query,r=t.validChoiceMade,o=t.options,i=this.props.minLength,u=!r&&n.length>=i&&0<o.length;u?this.setState((function(e){var t=e.menuOpen;return {focused:-1,menuOpen:u||t,selected:-1}})):this.setState({focused:-1});},n.handleOptionFocus=function(e){this.setState({focused:e,hovered:null,selected:e});},n.handleOptionMouseEnter=function(e,t){c()||this.setState({hovered:t});},n.handleOptionClick=function(e,t){var n=this.state.options[t],r=this.templateInputValue(n);this.props.onConfirm(n),this.setState({focused:-1,hovered:null,menuOpen:!1,query:r,selected:-1,validChoiceMade:!0}),this.forceUpdate();},n.handleOptionMouseDown=function(e){e.preventDefault();},n.handleUpArrow=function(e){e.preventDefault();var t=this.state,n=t.menuOpen,r=t.selected;-1!==r&&n&&this.handleOptionFocus(r-1);},n.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 n=this.state,r=n.menuOpen,o=n.options,i=n.selected;i!==o.length-1&&r&&this.handleOptionFocus(i+1);}},n.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));},n.handleEnter=function(e){this.state.menuOpen&&(e.preventDefault(),0<=this.state.selected&&this.handleOptionClick(e,this.state.selected));},n.handlePrintableKey=function(e){var t=this.elementReferences[-1];e.target===t||t.focus();},n.handleKeyDown=function(e){switch(l[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:(function(e){return 47<e&&e<58||32===e||8===e||64<e&&e<91||95<e&&e<112||185<e&&e<193||218<e&&e<223})(e.keyCode)&&this.handlePrintableKey(e);}},n.render=function(){var e,t=this,n=this.props,i=n.cssNamespace,u=n.displayMenu,s=n.id,l=n.minLength,p=n.name,f=n.placeholder,d=n.required,h=n.showAllValues,v=n.tNoResults,m=n.tStatusQueryTooShort,y=n.tStatusNoResults,_=n.tStatusSelectedOption,g=n.tStatusResults,b=n.tAssistiveHint,w=n.dropdownArrow,x=this.state,O=x.focused,C=x.hovered,S=x.menuOpen,E=x.options,M=x.query,N=x.selected,I=x.ariaHint,A=x.validChoiceMade,k=this.hasAutoselect(),j=-1===O,P=0===E.length,L=0!==M.length,T=M.length>=l,B=this.props.showNoOptionsFound&&j&&P&&L&&T,D=i+"__wrapper",F=i+"__input",R=null!==O?" "+F+"--focused":"",U=this.props.showAllValues?" "+F+"--show-all-values":" "+F+"--default",V=i+"__dropdown-arrow-down",q=-1!==O&&null!==O,H=i+"__menu",W=H+"--"+u,K=H+"--"+(S||B?"visible":"hidden"),Q=i+"__option",z=i+"__hint",G=this.templateInputValue(E[N]),$=G&&0===G.toLowerCase().indexOf(M.toLowerCase())&&k?M+G.substr(M.length):"",J=s+"__assistiveHint",X=I?{"aria-describedby":J}:null;return h&&"string"==typeof(e=w({className:V}))&&(e=(0, r.createElement)("div",{className:i+"__dropdown-arrow-down-wrapper",dangerouslySetInnerHTML:{__html:e}})),(0, r.createElement)("div",{className:D,onKeyDown:this.handleKeyDown},(0, r.createElement)(o.default,{id:s,length:E.length,queryLength:M.length,minQueryLength:l,selectedOption:this.templateInputValue(E[N]),selectedOptionIndex:N,validChoiceMade:A,isInFocus:null!==this.state.focused,tQueryTooShort:m,tNoResults:y,tSelectedOption:_,tResults:g}),$&&(0, r.createElement)("span",null,(0, r.createElement)("input",{className:z,readonly:!0,tabIndex:"-1",value:$})),(0, r.createElement)("input",a({"aria-expanded":S?"true":"false","aria-activedescendant":!!q&&s+"__option--"+O,"aria-owns":s+"__listbox","aria-autocomplete":this.hasAutoselect()?"both":"list"},X,{autoComplete:"off",className:""+F+R+U,id:s,onClick:function(e){return t.handleInputClick(e)},onBlur:this.handleInputBlur},function(e){return {onInput:e}}(this.handleInputChange),{onFocus:this.handleInputFocus,name:p,placeholder:f,ref:function(e){t.elementReferences[-1]=e;},type:"text",role:"combobox",required:d,value:M})),e,(0, r.createElement)("ul",{className:H+" "+W+" "+K,onMouseLeave:function(e){return t.handleListMouseLeave(e)},id:s+"__listbox",role:"listbox"},E.map((function(e,n){var o=(-1===O?N===n:O===n)&&null===C?" "+Q+"--focused":"",i=n%2?" "+Q+"--odd":"",u=c()?"<span id="+s+"__option-suffix--"+n+' 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"> '+(n+1)+" of "+E.length+"</span>":"";return (0, r.createElement)("li",{"aria-selected":O===n?"true":"false",className:""+Q+o+i,dangerouslySetInnerHTML:{__html:t.templateSuggestion(e)+u},id:s+"__option--"+n,key:n,onBlur:function(e){return t.handleOptionBlur(e,n)},onClick:function(e){return t.handleOptionClick(e,n)},onMouseDown:t.handleOptionMouseDown,onMouseEnter:function(e){return t.handleOptionMouseEnter(e,n)},ref:function(e){t.elementReferences[n]=e;},role:"option",tabIndex:"-1","aria-posinset":n+1,"aria-setsize":E.length})})),B&&(0, r.createElement)("li",{className:Q+" "+Q+"--no-results"},v())),(0, r.createElement)("span",{id:J,style:{display:"none"}},b()))},t}(r.Component);(t.default=p).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:i.default};},function(e,t,n){var r=n(9),o=n(53),i=n(28),u=n(26)("IE_PROTO"),a=function(){},s="prototype",l=function(){var e,t=n(15)("iframe"),r=i.length;for(t.style.display="none",n(54).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),l=e.F;r--;)delete l[s][i[r]];return l()};e.exports=Object.create||function(e,t){var n;return null!==e?(a[s]=r(e),n=new a,a[s]=null,n[u]=e):n=l(),void 0===t?n:o(n,t)};},function(e,t,n){var r=n(8),o=n(9),i=n(20);e.exports=n(3)?Object.defineProperties:function(e,t){o(e);for(var n,u=i(t),a=u.length,s=0;s<a;)r.f(e,n=u[s++],t[n]);return e};},function(e,t,n){var r=n(1).document;e.exports=r&&r.documentElement;},function(e,t,n){var r=n(0);r(r.P,"Function",{bind:n(56)});},function(e,t,n){var r=n(19),o=n(2),i=n(57),u=[].slice,a={};e.exports=Function.bind||function(e){var t=r(this),n=u.call(arguments,1),s=function(){var r=n.concat(u.call(arguments));return this instanceof s?function(e,t,n){if(!(t in a)){for(var r=[],o=0;o<t;o++)r[o]="a["+o+"]";a[t]=Function("F,a","return new F("+r.join(",")+")");}return a[t](e,n)}(t,r.length,r):i(t,r,e)};return o(t.prototype)&&(s.prototype=t.prototype),s};},function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)};},function(e,t,n){n(59)("match",1,(function(e,t,n){return [function(n){var r=e(this),o=null==n?void 0:n[t];return void 0!==o?o.call(n,r):new RegExp(n)[t](String(r))},n]}));},function(e,t,n){var r=n(7),o=n(16),i=n(4),u=n(12),a=n(34);e.exports=function(e,t,n){var s=a(e),l=n(u,s,""[e]),c=l[0],p=l[1];i((function(){var t={};return t[s]=function(){return 7},7!=""[e](t)}))&&(o(String.prototype,e,c),r(RegExp.prototype,s,2==t?function(e,t){return p.call(e,this,t)}:function(e){return p.call(e,this)}));};},function(e,t,n){t.__esModule=!0,t.default=void 0,n(36);var r=n(5),o=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return (t=e.call.apply(e,[this].concat(r))||this).state={bump:!1,debounced:!1},t}!function(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t;}(t,e);var n=t.prototype;return n.componentWillMount=function(){var e=this;this.debounceStatusUpdate=function(e,t,n){var r;return function(){var o=this,i=arguments,u=function(){r=null,n||e.apply(o,i);},a=n&&!r;clearTimeout(r),r=setTimeout(u,t),a&&e.apply(o,i);}}((function(){if(!e.state.debounced){var t=!e.props.isInFocus||e.props.validChoiceMade;e.setState((function(e){return {bump:!e.bump,debounced:!0,silenced:t}}));}}),1400);},n.componentWillReceiveProps=function(e){e.queryLength,this.setState({debounced:!1});},n.render=function(){var e,t=this.props,n=t.id,o=t.length,i=t.queryLength,u=t.minQueryLength,a=t.selectedOption,s=t.selectedOptionIndex,l=t.tQueryTooShort,c=t.tNoResults,p=t.tSelectedOption,f=t.tResults,d=this.state,h=d.bump,v=d.debounced,m=d.silenced,y=i<u,_=0===o,g=a?p(a,o,s):"";return e=y?l(u):_?c():f(o,g),this.debounceStatusUpdate(),(0, r.createElement)("div",{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"}},(0, r.createElement)("div",{id:n+"__status--A",role:"status","aria-atomic":"true","aria-live":"polite"},!m&&v&&h?e:""),(0, r.createElement)("div",{id:n+"__status--B",role:"status","aria-atomic":"true","aria-live":"polite"},m||!v||h?"":e))},t}(r.Component);(t.default=o).defaultProps={tQueryTooShort:function(e){return "Type in "+e+" or more characters for results"},tNoResults:function(){return "No search results"},tSelectedOption:function(e,t,n){return e+" "+(n+1)+" of "+t+" is highlighted"},tResults:function(e,t){return e+" "+(1===e?"result":"results")+" "+(1===e?"is":"are")+" available. "+t}};},function(e,t,n){t.__esModule=!0,t.default=void 0;var r=n(5);t.default=function(e){var t=e.className;return (0, r.createElement)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",className:t,focusable:"false"},(0, r.createElement)("g",{stroke:"none",fill:"none","fill-rule":"evenodd"},(0, r.createElement)("polygon",{fill:"#000000",points:"0 0 22 0 11 17"})))};}]).default},e.exports=n();}));const accessibleAutocomplete = unwrapExports(accessibleAutocomplete_min);
119
121
 
120
- const NAME$q="selectautocomplete";class SelectAutocomplete extends BaseComponent{constructor(e,t){super(e),this._config=t,this._enhance();}static get NAME(){return NAME$q}_enhance(){accessibleAutocomplete.enhanceSelectElement(Object.assign({},{selectElement:this._element},this._config));}}const SelectAutocomplete$1 = SelectAutocomplete;
122
+ const NAME$s="selectautocomplete";class SelectAutocomplete extends BaseComponent{constructor(e,t){super(e),this._config=t,this._enhance();}static get NAME(){return NAME$s}_enhance(){accessibleAutocomplete.enhanceSelectElement(Object.assign({},{selectElement:this._element},this._config));}}const SelectAutocomplete$1 = SelectAutocomplete;
121
123
 
122
- const NAME$p="inputsearchautocomplete",DATA_KEY$7="bs.inputsearchautocomplete",EVENT_KEY$9=`.${DATA_KEY$7}`,Default$i={autocomplete:[]},EVENT_KEYUP$1=`keyup${EVENT_KEY$9}`,EVENT_KEYUP_DATA_API$3=`keyup${EVENT_KEY$9}.data-api`,EVENT_MOUSEDOWN_DATA_API$1=`mousedown${EVENT_KEY$9}.data-api`,CLASS_NAME_SHOW$1="autocomplete-list-show",DATA_AUTOCOMPLETE="data-bs-autocomplete",SELECTOR_SEARCH='input[data-bs-autocomplete][type="search"]';class InputSearch extends BaseComponent{constructor(e,t){super(e),this._config=this._getConfig(t),this._items=[],this._autocompleteElement=null,this._label=new InputLabel$1(e),this._init(),this._bindEvents();}static get NAME(){return NAME$p}search(){const e=this._element.value;//!!! $autocomplete.empty()
123
- this._autocompleteElement.innerHTML="",e?this._items.forEach((t=>{let n=new RegExp("("+e+")","gi"),a=t.text.replace(n,"<mark>$1</mark>"),o=t.label?"<em>"+t.label+"</em>":"",s=t.icon?t.icon:"",l=t.link?t.link:"#";-1!==a.toLowerCase().indexOf(e.toLowerCase())&&(this._autocompleteElement.classList.add(CLASS_NAME_SHOW$1),this._autocompleteElement.appendChild(this._createOption(l,a,o,s)));})):this._autocompleteElement.classList.remove(CLASS_NAME_SHOW$1);}_getConfig(e){return e={...Default$i,..."object"==typeof e?e:{}}}_getItems(){try{return JSON.parse(this._element.getAttribute(DATA_AUTOCOMPLETE))}catch(e){return console.error("[InputSearchAutocomplete] invalid data provided for data-bs-autocomplete attribute",e),[]}}_init(){this._element.classList.contains("autocomplete")&&(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(){EventHandler$1.on(this._element,EVENT_KEYUP$1,(()=>this.search()));}_createOption(e,t,n,a){const o=document.createElement("li");return o.innerHTML=`<a href="${e}">\n ${a}\n <span class="autocomplete-list-text">\n <span>${t}</span>\n ${n}\n </span>\n </a>`,o}}const createInput$2=e=>e&&e.matches(SELECTOR_SEARCH)?InputSearch.getOrCreateInstance(e):null;EventHandler$1.on(document,EVENT_MOUSEDOWN_DATA_API$1,SELECTOR_SEARCH+", label",(function(){const e=InputLabel$1.getInputFromLabel(this)||this;createInput$2(e);})),EventHandler$1.on(document,EVENT_KEYUP_DATA_API$3,SELECTOR_SEARCH+", label",(function(){const e=InputLabel$1.getInputFromLabel(this)||this,t=createInput$2(e);t&&t._label&&t._label._labelOut();}));const InputSearchAutocomplete = InputSearch;
124
+ const NAME$r="inputsearchautocomplete",DATA_KEY$7="bs.inputsearchautocomplete",EVENT_KEY$9=`.${DATA_KEY$7}`,Default$j={autocomplete:[]},EVENT_KEYUP$1=`keyup${EVENT_KEY$9}`,EVENT_KEYUP_DATA_API$3=`keyup${EVENT_KEY$9}.data-api`,EVENT_MOUSEDOWN_DATA_API$1=`mousedown${EVENT_KEY$9}.data-api`,CLASS_NAME_SHOW$1="autocomplete-list-show",DATA_AUTOCOMPLETE="data-bs-autocomplete",SELECTOR_SEARCH='input[data-bs-autocomplete][type="search"]';class InputSearch extends BaseComponent{constructor(e,t){super(e),this._config=this._getConfig(t),this._items=[],this._autocompleteElement=null,this._label=new InputLabel$1(e),this._init(),this._bindEvents();}static get NAME(){return NAME$r}search(){const e=this._element.value;//!!! $autocomplete.empty()
125
+ this._autocompleteElement.innerHTML="",e?this._items.forEach((t=>{let n=new RegExp("("+e+")","gi"),a=t.text.replace(n,"<mark>$1</mark>"),o=t.label?"<em>"+t.label+"</em>":"",s=t.icon?t.icon:"",l=t.link?t.link:"#";-1!==a.toLowerCase().indexOf(e.toLowerCase())&&(this._autocompleteElement.classList.add(CLASS_NAME_SHOW$1),this._autocompleteElement.appendChild(this._createOption(l,a,o,s)));})):this._autocompleteElement.classList.remove(CLASS_NAME_SHOW$1);}_getConfig(e){return e={...Default$j,..."object"==typeof e?e:{}}}_getItems(){try{return JSON.parse(this._element.getAttribute(DATA_AUTOCOMPLETE))}catch(e){return console.error("[InputSearchAutocomplete] invalid data provided for data-bs-autocomplete attribute",e),[]}}_init(){this._element.classList.contains("autocomplete")&&(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(){EventHandler$1.on(this._element,EVENT_KEYUP$1,(()=>this.search()));}_createOption(e,t,n,a){const o=document.createElement("li");return o.innerHTML=`<a href="${e}">\n ${a}\n <span class="autocomplete-list-text">\n <span>${t}</span>\n ${n}\n </span>\n </a>`,o}}const createInput$2=e=>e&&e.matches(SELECTOR_SEARCH)?InputSearch.getOrCreateInstance(e):null;EventHandler$1.on(document,EVENT_MOUSEDOWN_DATA_API$1,SELECTOR_SEARCH+", label",(function(){const e=InputLabel$1.getInputFromLabel(this)||this;createInput$2(e);})),EventHandler$1.on(document,EVENT_KEYUP_DATA_API$3,SELECTOR_SEARCH+", label",(function(){const e=InputLabel$1.getInputFromLabel(this)||this,t=createInput$2(e);t&&t._label&&t._label._labelOut();}));const InputSearchAutocomplete = InputSearch;
124
126
 
125
- const NAME$o="inputpassword",DATA_KEY$6="bs.inputpassword",EVENT_KEY$8=`.${DATA_KEY$6}`,Default$h={shortPass:"Password molto debole",badPass:"Password debole",goodPass:"Password sicura",strongPass:"Password molto sicura",enterPass:"Inserisci almeno 8 caratteri e una lettera maiuscola",alertCaps:"CAPS LOCK inserito",showText:!0,minimumLength:4},EVENT_CLICK$6=`click${EVENT_KEY$8}`,EVENT_KEYUP=`keyup${EVENT_KEY$8}`,EVENT_KEYDOWN$2=`keydown${EVENT_KEY$8}`,EVENT_KEYPRESS=`keypress${EVENT_KEY$8}`,EVENT_SCORE=`score${EVENT_KEY$8}`,EVENT_TEXT=`text${EVENT_KEY$8}`,EVENT_CLICK_DATA_API$b=`click${EVENT_KEY$8}.data-api`,EVENT_MOUSEDOWN_DATA_API=`mousedown${EVENT_KEY$8}.data-api`,EVENT_KEYUP_DATA_API$2=`keyup${EVENT_KEY$8}.data-api`,SELECTOR_PASSWORD='input[data-bs-input][type="password"]',SELECTOR_METER=".password-strength-meter",SELECTOR_CAPS=".password-caps";class InputPassword extends BaseComponent{constructor(t,e){super(t),this._config=this._getConfig(e),this._isCustom=this._element.classList.contains("input-password"),this._meter=this._element.parentNode.querySelector(SELECTOR_METER),this._isShiftPressed=!1,this._isCapsOn=!1,this._grayBarElement=null,this._colorBarElement=null,this._textElement=null,this._capsElement=null,this._showPwdElement=null,this._text={},this._label=new InputLabel$1(t),this._init(),this._bindEvents();}static get NAME(){return NAME$o}_getConfig(t){return t={...Default$h,...Manipulator.getDataAttributes(this._element),..."object"==typeof t?t:{}}}_init(){this._meter&&(this._grayBarElement=this._meter.querySelector(".password-meter"),this._colorBarElement=this._meter.querySelector(".progress-bar"),this._textElement=this._meter.querySelector(".form-text"),this._textElement&&(this._config=Object.assign({},this._config,{...Manipulator.getDataAttributes(this._textElement)},{enterPass:this._textElement.innerText}))),this._isCustom&&(this._capsElement=this._element.parentNode.querySelector(SELECTOR_CAPS)),this._showPwdElement=SelectorEngine$1.findOne(".password-icon",this._element.parentNode);}_bindEvents(){this._meter&&EventHandler$1.on(this._element,EVENT_KEYUP,(()=>this._checkPassword())),this._isCustom&&(EventHandler$1.on(this._element,EVENT_KEYDOWN$2,(t=>{"Shift"===t.key&&(this._isShiftPressed=!0);})),EventHandler$1.on(this._element,EVENT_KEYUP,(t=>{"Shift"===t.key&&(this._isShiftPressed=!1),"CapsLock"===t.key&&(this._isCapsOn=!this._isCapsOn,this._isCapsOn?this._showCapsMsg():this._hideCapsMsg());})),EventHandler$1.on(this._element,EVENT_KEYPRESS,(t=>{(t.key.match(/[A-Z]$/)||[]).length>0&&!this._isShiftPressed?(this._isCapsOn=!0,this._showCapsMsg()):this._isCapsOn&&(this._isCapsOn=!1,this._hideCapsMsg());}))),this._showPwdElement&&EventHandler$1.on(this._showPwdElement,EVENT_CLICK$6,(()=>this._toggleShowPassword()));}_showCapsMsg(){this._capsElement&&this._capsElement.classList.add("show");}_hideCapsMsg(){this._capsElement&&this._capsElement.classList.remove("show");}_toggleShowPassword(){const t="password"===this._element.getAttribute("type");SelectorEngine$1.find('[class^="password-icon"]',this._showPwdElement).forEach((t=>t.classList.toggle("d-none"))),t?this._element.setAttribute("type","text"):this._element.setAttribute("type","password");}_checkPassword(){const t=this._calculateScore(this._element.value),e=t<0?0:t;if(this._colorBarElement.classList.forEach((t=>{t.match(/(^|\s)bg-\S+/g)&&this._colorBarElement.classList.remove(t);})),this._colorBarElement.classList.add("bg-"+this._scoreColor(t)),this._colorBarElement.style.width=e+"%",this._colorBarElement.setAttribute("aria-valuenow",e),EventHandler$1.trigger(this._element,EVENT_SCORE),this._textElement){let e=this._scoreText(t);0===this._element.value.length&&t<=0&&(e=this._config.enterPass),-1===this._textElement.innerHTML.search(e)&&(this._textElement.innerHTML=e,this._textElement.classList.forEach((t=>{t.match(/(^|\s)text-\S+/g)&&this._textElement.classList.remove(t);})),this._textElement.classList.add("text-"+this._scoreColor(t)),EventHandler$1.trigger(this._element,EVENT_TEXT));}}_scoreText(t){return -1===t||(t=t<0?0:t)<26?this._config.shortPass:t<51?this._config.badPass:t<76?this._config.goodPass:this._config.strongPass}_scoreColor(t){return -1===t?"danger":-2===t?"muted":(t=t<0?0:t)<26?"danger":t<51?"warning":"success"}_calculateScore(t){var e=0;if(0===t.trim().length)return -2;if(t.length<this._config.minimumLength)return -1;e+=4*t.length,e+=this._checkRepetition(1,t).length-t.length,e+=this._checkRepetition(2,t).length-t.length,e+=this._checkRepetition(3,t).length-t.length,e+=this._checkRepetition(4,t).length-t.length,t.match(/(.*[0-9].*[0-9].*[0-9])/)&&(e+=5);var s=".*[!,@,#,$,%,^,&,*,?,_,~]";return s=new RegExp("("+s+s+")"),t.match(s)&&(e+=5),t.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)&&(e+=10),t.match(/([a-zA-Z])/)&&t.match(/([0-9])/)&&(e+=15),t.match(/([!,@,#,$,%,^,&,*,?,_,~])/)&&t.match(/([0-9])/)&&(e+=15),t.match(/([!,@,#,$,%,^,&,*,?,_,~])/)&&t.match(/([a-zA-Z])/)&&(e+=15),(t.match(/^\w+$/)||t.match(/^\d+$/))&&(e-=10),e>100&&(e=100),e<0&&(e=0),e}_checkRepetition(t,e){for(var s="",n=!1,i=0;i<e.length;i++){n=!0;for(var a=0;a<t&&a+i+t<e.length;a++)n=n&&e.charAt(a+i)===e.charAt(a+i+t);a<t&&(n=!1),n?(i+=t-1,n=!1):s+=e.charAt(i);}return s}}const createInput$1=t=>t&&t.matches(SELECTOR_PASSWORD)?InputPassword.getOrCreateInstance(t):null;EventHandler$1.on(document,EVENT_MOUSEDOWN_DATA_API,SELECTOR_PASSWORD+", label",(function(){const t=InputLabel$1.getInputFromLabel(this)||this;createInput$1(t);})),EventHandler$1.on(document,EVENT_KEYUP_DATA_API$2,SELECTOR_PASSWORD+", label",(function(){const t=InputLabel$1.getInputFromLabel(this)||this,e=createInput$1(t);e&&e._label&&e._label._labelOut();})),EventHandler$1.on(document,EVENT_CLICK_DATA_API$b,".password-icon",(function(){const t=this.parentNode&&this.parentNode.querySelector(SELECTOR_PASSWORD);t&&InputPassword.getOrCreateInstance(t);}));const InputPassword$1 = InputPassword;
127
+ const NAME$q="inputpassword",DATA_KEY$6="bs.inputpassword",EVENT_KEY$8=`.${DATA_KEY$6}`,Default$i={shortPass:"Password molto debole",badPass:"Password debole",goodPass:"Password sicura",strongPass:"Password molto sicura",enterPass:"Inserisci almeno 8 caratteri e una lettera maiuscola",alertCaps:"CAPS LOCK inserito",showText:!0,minimumLength:4},EVENT_CLICK$6=`click${EVENT_KEY$8}`,EVENT_KEYUP=`keyup${EVENT_KEY$8}`,EVENT_KEYDOWN$2=`keydown${EVENT_KEY$8}`,EVENT_KEYPRESS=`keypress${EVENT_KEY$8}`,EVENT_SCORE=`score${EVENT_KEY$8}`,EVENT_TEXT=`text${EVENT_KEY$8}`,EVENT_CLICK_DATA_API$b=`click${EVENT_KEY$8}.data-api`,EVENT_MOUSEDOWN_DATA_API=`mousedown${EVENT_KEY$8}.data-api`,EVENT_KEYUP_DATA_API$2=`keyup${EVENT_KEY$8}.data-api`,SELECTOR_PASSWORD='input[data-bs-input][type="password"]',SELECTOR_METER=".password-strength-meter",SELECTOR_CAPS=".password-caps";class InputPassword extends BaseComponent{constructor(t,e){super(t),this._config=this._getConfig(e),this._isCustom=this._element.classList.contains("input-password"),this._meter=this._element.parentNode.querySelector(SELECTOR_METER),this._isShiftPressed=!1,this._isCapsOn=!1,this._grayBarElement=null,this._colorBarElement=null,this._textElement=null,this._capsElement=null,this._showPwdElement=null,this._text={},this._label=new InputLabel$1(t),this._init(),this._bindEvents();}static get NAME(){return NAME$q}_getConfig(t){return t={...Default$i,...Manipulator.getDataAttributes(this._element),..."object"==typeof t?t:{}}}_init(){this._meter&&(this._grayBarElement=this._meter.querySelector(".password-meter"),this._colorBarElement=this._meter.querySelector(".progress-bar"),this._textElement=this._meter.querySelector(".form-text"),this._textElement&&(this._config=Object.assign({},this._config,{...Manipulator.getDataAttributes(this._textElement)},{enterPass:this._textElement.innerText}))),this._isCustom&&(this._capsElement=this._element.parentNode.querySelector(SELECTOR_CAPS)),this._showPwdElement=SelectorEngine$1.findOne(".password-icon",this._element.parentNode);}_bindEvents(){this._meter&&EventHandler$1.on(this._element,EVENT_KEYUP,(()=>this._checkPassword())),this._isCustom&&(EventHandler$1.on(this._element,EVENT_KEYDOWN$2,(t=>{"Shift"===t.key&&(this._isShiftPressed=!0);})),EventHandler$1.on(this._element,EVENT_KEYUP,(t=>{"Shift"===t.key&&(this._isShiftPressed=!1),"CapsLock"===t.key&&(this._isCapsOn=!this._isCapsOn,this._isCapsOn?this._showCapsMsg():this._hideCapsMsg());})),EventHandler$1.on(this._element,EVENT_KEYPRESS,(t=>{(t.key.match(/[A-Z]$/)||[]).length>0&&!this._isShiftPressed?(this._isCapsOn=!0,this._showCapsMsg()):this._isCapsOn&&(this._isCapsOn=!1,this._hideCapsMsg());}))),this._showPwdElement&&EventHandler$1.on(this._showPwdElement,EVENT_CLICK$6,(()=>this._toggleShowPassword()));}_showCapsMsg(){this._capsElement&&this._capsElement.classList.add("show");}_hideCapsMsg(){this._capsElement&&this._capsElement.classList.remove("show");}_toggleShowPassword(){const t="password"===this._element.getAttribute("type");SelectorEngine$1.find('[class^="password-icon"]',this._showPwdElement).forEach((t=>t.classList.toggle("d-none"))),t?this._element.setAttribute("type","text"):this._element.setAttribute("type","password");}_checkPassword(){const t=this._calculateScore(this._element.value),e=t<0?0:t;if(this._colorBarElement.classList.forEach((t=>{t.match(/(^|\s)bg-\S+/g)&&this._colorBarElement.classList.remove(t);})),this._colorBarElement.classList.add("bg-"+this._scoreColor(t)),this._colorBarElement.style.width=e+"%",this._colorBarElement.setAttribute("aria-valuenow",e),EventHandler$1.trigger(this._element,EVENT_SCORE),this._textElement){let e=this._scoreText(t);0===this._element.value.length&&t<=0&&(e=this._config.enterPass),-1===this._textElement.innerHTML.search(e)&&(this._textElement.innerHTML=e,this._textElement.classList.forEach((t=>{t.match(/(^|\s)text-\S+/g)&&this._textElement.classList.remove(t);})),this._textElement.classList.add("text-"+this._scoreColor(t)),EventHandler$1.trigger(this._element,EVENT_TEXT));}}_scoreText(t){return -1===t||(t=t<0?0:t)<26?this._config.shortPass:t<51?this._config.badPass:t<76?this._config.goodPass:this._config.strongPass}_scoreColor(t){return -1===t?"danger":-2===t?"muted":(t=t<0?0:t)<26?"danger":t<51?"warning":"success"}_calculateScore(t){var e=0;if(0===t.trim().length)return -2;if(t.length<this._config.minimumLength)return -1;e+=4*t.length,e+=this._checkRepetition(1,t).length-t.length,e+=this._checkRepetition(2,t).length-t.length,e+=this._checkRepetition(3,t).length-t.length,e+=this._checkRepetition(4,t).length-t.length,t.match(/(.*[0-9].*[0-9].*[0-9])/)&&(e+=5);var s=".*[!,@,#,$,%,^,&,*,?,_,~]";return s=new RegExp("("+s+s+")"),t.match(s)&&(e+=5),t.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)&&(e+=10),t.match(/([a-zA-Z])/)&&t.match(/([0-9])/)&&(e+=15),t.match(/([!,@,#,$,%,^,&,*,?,_,~])/)&&t.match(/([0-9])/)&&(e+=15),t.match(/([!,@,#,$,%,^,&,*,?,_,~])/)&&t.match(/([a-zA-Z])/)&&(e+=15),(t.match(/^\w+$/)||t.match(/^\d+$/))&&(e-=10),e>100&&(e=100),e<0&&(e=0),e}_checkRepetition(t,e){for(var s="",n=!1,i=0;i<e.length;i++){n=!0;for(var a=0;a<t&&a+i+t<e.length;a++)n=n&&e.charAt(a+i)===e.charAt(a+i+t);a<t&&(n=!1),n?(i+=t-1,n=!1):s+=e.charAt(i);}return s}}const createInput$1=t=>t&&t.matches(SELECTOR_PASSWORD)?InputPassword.getOrCreateInstance(t):null;EventHandler$1.on(document,EVENT_MOUSEDOWN_DATA_API,SELECTOR_PASSWORD+", label",(function(){const t=InputLabel$1.getInputFromLabel(this)||this;createInput$1(t);})),EventHandler$1.on(document,EVENT_KEYUP_DATA_API$2,SELECTOR_PASSWORD+", label",(function(){const t=InputLabel$1.getInputFromLabel(this)||this,e=createInput$1(t);e&&e._label&&e._label._labelOut();})),EventHandler$1.on(document,EVENT_CLICK_DATA_API$b,".password-icon",(function(){const t=this.parentNode&&this.parentNode.querySelector(SELECTOR_PASSWORD);t&&InputPassword.getOrCreateInstance(t);}));const InputPassword$1 = InputPassword;
126
128
 
127
129
  var shifty_node=createCommonjsModule((function(t,e){
128
130
  /*! Shifty 2.17.1 - https://github.com/jeremyckahn/shifty */
@@ -142,31 +144,31 @@
142
144
  */
143
145
  var o=function(t){return t},a=function(t){return Math.pow(t,2)},u=function(t){return -(Math.pow(t-1,2)-1)},s=function(t){return (t/=.5)<1?.5*Math.pow(t,2):-.5*((t-=2)*t-2)},c=function(t){return Math.pow(t,3)},f=function(t){return Math.pow(t-1,3)+1},l=function(t){return (t/=.5)<1?.5*Math.pow(t,3):.5*(Math.pow(t-2,3)+2)},h=function(t){return Math.pow(t,4)},p=function(t){return -(Math.pow(t-1,4)-1)},v=function(t){return (t/=.5)<1?.5*Math.pow(t,4):-.5*((t-=2)*Math.pow(t,3)-2)},_=function(t){return Math.pow(t,5)},m=function(t){return Math.pow(t-1,5)+1},y=function(t){return (t/=.5)<1?.5*Math.pow(t,5):.5*(Math.pow(t-2,5)+2)},d=function(t){return 1-Math.cos(t*(Math.PI/2))},g=function(t){return Math.sin(t*(Math.PI/2))},w=function(t){return -.5*(Math.cos(Math.PI*t)-1)},b=function(t){return 0===t?0:Math.pow(2,10*(t-1))},O=function(t){return 1===t?1:1-Math.pow(2,-10*t)},S=function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))},j=function(t){return -(Math.sqrt(1-t*t)-1)},k=function(t){return Math.sqrt(1-Math.pow(t-1,2))},P=function(t){return (t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},M=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},E=function(t){var e=1.70158;return t*t*((e+1)*t-e)},x=function(t){var e=1.70158;return (t-=1)*t*((e+1)*t+e)+1},F=function(t){var e=1.70158;return (t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},I=function(t){return -1*Math.pow(4,-8*t)*Math.sin((6*t-1)*(2*Math.PI)/2)+1},T=function(t){var e=1.70158;return (t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},A=function(t){var e=1.70158;return t*t*((e+1)*t-e)},C=function(t){var e=1.70158;return (t-=1)*t*((e+1)*t+e)+1},D=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},q=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?2-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?2-(7.5625*(t-=2.25/2.75)*t+.9375):2-(7.5625*(t-=2.625/2.75)*t+.984375)},Q=function(t){return (t/=.5)<1?.5*Math.pow(t,4):-.5*((t-=2)*Math.pow(t,3)-2)},B=function(t){return Math.pow(t,4)},H=function(t){return Math.pow(t,.25)};function N(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function R(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}function z(t){return z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},z(t)}function G(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r);}return n}function L(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?G(Object(n),!0).forEach((function(e){U(t,e,n[e]);})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):G(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e));}));}return t}function U(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var V,W,$,J="linear",K="undefined"!=typeof window?window:commonjsGlobal,X="afterTween",Y="afterTweenEnd",Z="beforeTween",tt="tweenCreated",et="function",nt="string",rt=K.requestAnimationFrame||K.webkitRequestAnimationFrame||K.oRequestAnimationFrame||K.msRequestAnimationFrame||K.mozCancelRequestAnimationFrame&&K.mozRequestAnimationFrame||setTimeout,it=function(){},ot=null,at=null,ut=L({},r),st=function(t,e,n,r,i,o,a){var u,s,c,f=t<o?0:(t-o)/i,l=!1;for(var h in a&&a.call&&(l=!0,u=a(f)),e)l||(u=((s=a[h]).call?s:ut[s])(f)),c=n[h],e[h]=c+(r[h]-c)*u;return e},ct=function(t,e){var n=t._timestamp,r=t._currentState,i=t._delay;if(!(e<n+i)){var o=t._duration,a=t._targetState,u=n+i+o,s=e>u?u:e,c=s>=u,f=o-(u-s),l=t._filters.length>0;if(c)return t._render(a,t._data,f),t.stop(!0);l&&t._applyFilter(Z),s<n+i?n=o=s=1:n+=i,st(s,r,t._originalState,a,o,n,t._easing),l&&t._applyFilter(X),t._render(r,t._data,f);}},ft=function(){for(var t,e=_t.now(),n=ot;n;)t=n._next,ct(n,e),n=t;},lt=Date.now||function(){return +new Date},ht=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:J,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=z(e);if(ut[e])return ut[e];if(r===nt||r===et)for(var i in t)n[i]=e;else for(var o in t)n[o]=e[o]||J;return n},pt=function(t){t===ot?(ot=t._next)?ot._previous=null:at=null:t===at?(at=t._previous)?at._next=null:ot=null:(W=t._previous,$=t._next,W._next=$,$._previous=W),t._previous=t._next=null;},vt="function"==typeof Promise?Promise:null,_t=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;N(this,t),this._config={},this._data={},this._delay=0,this._filters=[],this._next=null,this._previous=null,this._timestamp=null,this._resolve=null,this._reject=null,this._currentState=e||{},this._originalState={},this._targetState={},this._start=it,this._render=it,this._promiseCtor=vt,n&&this.setConfig(n);}var e,n;return e=t,n=[{key:"_applyFilter",value:function(t){for(var e=this._filters.length;e>0;e--){var n=this._filters[e-e][t];n&&n(this);}}},{key:"tween",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return this._isPlaying&&this.stop(),!e&&this._config||this.setConfig(e),this._pausedAtTime=null,this._timestamp=t.now(),this._start(this.get(),this._data),this._delay&&this._render(this._currentState,this._data,0),this._resume(this._timestamp)}},{key:"setConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this._config;for(var r in e)n[r]=e[r];var i=n.promise,o=void 0===i?this._promiseCtor:i,a=n.start,u=void 0===a?it:a,s=n.finish,c=n.render,f=void 0===c?this._config.step||it:c,l=n.step,h=void 0===l?it:l;this._data=n.data||n.attachment||this._data,this._isPlaying=!1,this._pausedAtTime=null,this._scheduleId=null,this._delay=e.delay||0,this._start=u,this._render=f||h,this._duration=n.duration||500,this._promiseCtor=o,s&&(this._resolve=s);var p=e.from,v=e.to,_=void 0===v?{}:v,m=this._currentState,y=this._originalState,d=this._targetState;for(var g in p)m[g]=p[g];var w=!1;for(var b in m){var O=m[b];w||z(O)!==nt||(w=!0),y[b]=O,d[b]=_.hasOwnProperty(b)?_[b]:O;}if(this._easing=ht(this._currentState,n.easing,this._easing),this._filters.length=0,w){for(var S in t.filters)t.filters[S].doesApply(this)&&this._filters.push(t.filters[S]);this._applyFilter(tt);}return this}},{key:"then",value:function(t,e){var n=this;return this._promise=new this._promiseCtor((function(t,e){n._resolve=t,n._reject=e;})),this._promise.then(t,e)}},{key:"catch",value:function(t){return this.then().catch(t)}},{key:"get",value:function(){return L({},this._currentState)}},{key:"set",value:function(t){this._currentState=t;}},{key:"pause",value:function(){if(this._isPlaying)return this._pausedAtTime=t.now(),this._isPlaying=!1,pt(this),this}},{key:"resume",value:function(){return this._resume()}},{key:"_resume",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.now();return null===this._timestamp?this.tween():this._isPlaying?this._promise:(this._pausedAtTime&&(this._timestamp+=e-this._pausedAtTime,this._pausedAtTime=null),this._isPlaying=!0,null===ot?(ot=this,at=this):(this._previous=at,at._next=this,at=this),this)}},{key:"seek",value:function(e){e=Math.max(e,0);var n=t.now();return this._timestamp+e===0||(this._timestamp=n-e,ct(this,n)),this}},{key:"stop",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._isPlaying)return this;this._isPlaying=!1,pt(this);var e=this._filters.length>0;return t&&(e&&this._applyFilter(Z),st(1,this._currentState,this._originalState,this._targetState,1,0,this._easing),e&&(this._applyFilter(X),this._applyFilter(Y))),this._resolve&&this._resolve({data:this._data,state:this._currentState,tweenable:this}),this._resolve=null,this._reject=null,this}},{key:"cancel",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this._currentState,n=this._data,r=this._isPlaying;return r?(this._reject&&this._reject({data:n,state:e,tweenable:this}),this._resolve=null,this._reject=null,this.stop(t)):this}},{key:"isPlaying",value:function(){return this._isPlaying}},{key:"setScheduleFunction",value:function(e){t.setScheduleFunction(e);}},{key:"data",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t&&(this._data=L({},t)),this._data}},{key:"dispose",value:function(){for(var t in this)delete this[t];}}],n&&R(e.prototype,n),t}();function mt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=new _t;return e.tween(t),e.tweenable=e,e}U(_t,"now",(function(){return V})),_t.setScheduleFunction=function(t){return rt=t},_t.formulas=ut,_t.filters={},function t(){V=lt(),rt.call(K,t,16.666666666666668),ft();}();var yt,dt,gt=/(\d|-|\.)/,wt=/([^\-0-9.]+)/g,bt=/[0-9.-]+/g,Ot=(yt=bt.source,dt=/,\s*/.source,new RegExp("rgba?\\(".concat(yt).concat(dt).concat(yt).concat(dt).concat(yt,"(").concat(dt).concat(yt,")?\\)"),"g")),St=/^.*\(/,jt=/#([0-9]|[a-f]){3,6}/gi,kt="VAL",Pt=function(t,e){return t.map((function(t,n){return "_".concat(e,"_").concat(n)}))};function Mt(t){return parseInt(t,16)}var Et=function(t){return "rgb(".concat((e=t,3===(e=e.replace(/#/,"")).length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]),[Mt(e.substr(0,2)),Mt(e.substr(2,2)),Mt(e.substr(4,2))]).join(","),")");var e;},xt=function(t,e,n){var r=e.match(t),i=e.replace(t,kt);return r&&r.forEach((function(t){return i=i.replace(kt,n(t))})),i},Ft=function(t){for(var e in t){var n=t[e];"string"==typeof n&&n.match(jt)&&(t[e]=xt(jt,n,Et));}},It=function(t){var e=t.match(bt),n=e.slice(0,3).map(Math.floor),r=t.match(St)[0];if(3===e.length)return "".concat(r).concat(n.join(","),")");if(4===e.length)return "".concat(r).concat(n.join(","),",").concat(e[3],")");throw new Error("Invalid rgbChunk: ".concat(t))},Tt=function(t){return t.match(bt)},At=function(t,e){var n={};return e.forEach((function(e){n[e]=t[e],delete t[e];})),n},Ct=function(t,e){return e.map((function(e){return t[e]}))},Dt=function(t,e){return e.forEach((function(e){return t=t.replace(kt,+e.toFixed(4))})),t},qt=function(t){for(var e in t._currentState)if("string"==typeof t._currentState[e])return !0;return !1};function Qt(t){var e=t._currentState;[e,t._originalState,t._targetState].forEach(Ft),t._tokenData=function(t){var e,n,r={};for(var i in t){var o=t[i];"string"==typeof o&&(r[i]={formatString:(e=o,n=void 0,n=e.match(wt),n?(1===n.length||e.charAt(0).match(gt))&&n.unshift(""):n=["",""],n.join(kt)),chunkNames:Pt(Tt(o),i)});}return r}(e);}function Bt(t){var e=t._currentState,n=t._originalState,r=t._targetState,i=t._easing,o=t._tokenData;!function(t,e){var n=function(n){var r=e[n].chunkNames,i=t[n];if("string"==typeof i){var o=i.split(" "),a=o[o.length-1];r.forEach((function(e,n){return t[e]=o[n]||a}));}else r.forEach((function(e){return t[e]=i}));delete t[n];};for(var r in e)n(r);}(i,o),[e,n,r].forEach((function(t){return function(t,e){var n=function(n){Tt(t[n]).forEach((function(r,i){return t[e[n].chunkNames[i]]=+r})),delete t[n];};for(var r in e)n(r);}(t,o)}));}function Ht(t){var e=t._currentState,n=t._originalState,r=t._targetState,i=t._easing,o=t._tokenData;[e,n,r].forEach((function(t){return function(t,e){for(var n in e){var r=e[n],i=r.chunkNames,o=r.formatString,a=Dt(o,Ct(At(t,i),i));t[n]=xt(Ot,a,It);}}(t,o)})),function(t,e){for(var n in e){var r=e[n].chunkNames,i=t[r[0]];t[n]="string"==typeof i?r.map((function(e){var n=t[e];return delete t[e],n})).join(" "):i;}}(i,o);}function Nt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r);}return n}function Rt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Nt(Object(n),!0).forEach((function(e){zt(t,e,n[e]);})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Nt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e));}));}return t}function zt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Gt=new _t,Lt=_t.filters,Ut=function(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=Rt({},t),a=ht(t,r);for(var u in Gt._filters.length=0,Gt.set({}),Gt._currentState=o,Gt._originalState=t,Gt._targetState=e,Gt._easing=a,Lt)Lt[u].doesApply(Gt)&&Gt._filters.push(Lt[u]);Gt._applyFilter("tweenCreated"),Gt._applyFilter("beforeTween");var s=st(n,o,t,e,1,i,a);return Gt._applyFilter("afterTween"),s};function Vt(t){return function(t){if(Array.isArray(t))return Wt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return Wt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return "Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wt(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function $t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Jt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}function Kt(t,e){var n=e.get(t);if(!n)throw new TypeError("attempted to get private field on non-instance");return n.get?n.get.call(t):n.value}var Xt=new WeakMap,Yt=function(){function t(){$t(this,t),Xt.set(this,{writable:!0,value:[]});for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];n.forEach(this.add.bind(this));}var e,n;return e=t,(n=[{key:"add",value:function(t){return Kt(this,Xt).push(t),t}},{key:"remove",value:function(t){var e=Kt(this,Xt).indexOf(t);return ~e&&Kt(this,Xt).splice(e,1),t}},{key:"empty",value:function(){return this.tweenables.map(this.remove.bind(this))}},{key:"isPlaying",value:function(){return Kt(this,Xt).some((function(t){return t.isPlaying()}))}},{key:"play",value:function(){return Kt(this,Xt).forEach((function(t){return t.tween()})),this}},{key:"pause",value:function(){return Kt(this,Xt).forEach((function(t){return t.pause()})),this}},{key:"resume",value:function(){return Kt(this,Xt).forEach((function(t){return t.resume()})),this}},{key:"stop",value:function(t){return Kt(this,Xt).forEach((function(e){return e.stop(t)})),this}},{key:"tweenables",get:function(){return Vt(Kt(this,Xt))}},{key:"promises",get:function(){return Kt(this,Xt).map((function(t){return t.then()}))}}])&&Jt(e.prototype,n),t}();function Zt(t,e,n,r,i,o){var a,u,s=0,c=0,f=0,l=0,h=0,p=0,v=function(t){return ((s*t+c)*t+f)*t},_=function(t){return (3*s*t+2*c)*t+f},m=function(t){return t>=0?t:0-t};return s=1-(f=3*e)-(c=3*(r-e)-f),l=1-(p=3*n)-(h=3*(i-n)-p),a=t,u=function(t){return 1/(200*t)}(o),function(t){return ((l*t+h)*t+p)*t}(function(t,e){var n,r,i,o,a,u;for(i=t,u=0;u<8;u++){if(o=v(i)-t,m(o)<e)return i;if(a=_(i),m(a)<1e-6)break;i-=o/a;}if((i=t)<(n=0))return n;if(i>(r=1))return r;for(;n<r;){if(o=v(i),m(o-t)<e)return i;t>o?n=i:r=i,i=.5*(r-n)+n;}return i}(a,u))}var te=function(t,e,n,r,i){var o=function(t,e,n,r){return function(i){return Zt(i,t,e,n,r,1)}}(e,n,r,i);return o.displayName=t,o.x1=e,o.y1=n,o.x2=r,o.y2=i,_t.formulas[t]=o},ee=function(t){return delete _t.formulas[t]};_t.filters.token=i;}},e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={exports:{}};return t[r](i,i.exports,n),i.exports}return n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]});},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0});},n(720)})()},t.exports=n();}));unwrapExports(shifty_node);
144
146
 
145
- var PREFIXES="Webkit Moz O ms".split(" "),FLOAT_COMPARISON_EPSILON=.001;function extend(t,e,i){for(var r in t=t||{},i=i||!1,e=e||{})if(e.hasOwnProperty(r)){var s=t[r],l=e[r];i&&isObject(s)&&isObject(l)?t[r]=extend(s,l,i):t[r]=l;}return t}function render(t,e){var i=t;for(var r in e)if(e.hasOwnProperty(r)){var s=e[r],l=new RegExp("\\{"+r+"\\}","g");i=i.replace(l,s);}return i}function setStyle(t,e,i){for(var r=t.style,s=0;s<PREFIXES.length;++s){r[PREFIXES[s]+capitalize(e)]=i;}r[e]=i;}function setStyles(t,e){forEachObject(e,(function(e,i){null!=e&&(isObject(e)&&!0===e.prefix?setStyle(t,i,e.value):t.style[i]=e);}));}function capitalize(t){return t.charAt(0).toUpperCase()+t.slice(1)}function isString(t){return "string"==typeof t||t instanceof String}function isFunction(t){return "function"==typeof t}function isArray(t){return "[object Array]"===Object.prototype.toString.call(t)}function isObject(t){return !isArray(t)&&("object"===typeof t&&!!t)}function forEachObject(t,e){for(var i in t){if(t.hasOwnProperty(i))e(t[i],i);}}function floatEquals(t,e){return Math.abs(t-e)<FLOAT_COMPARISON_EPSILON}function removeChildren(t){for(;t.firstChild;)t.removeChild(t.firstChild);}var utils$1={extend:extend,render:render,setStyle:setStyle,setStyles:setStyles,capitalize:capitalize,isString:isString,isFunction:isFunction,isObject:isObject,forEachObject:forEachObject,floatEquals:floatEquals,removeChildren:removeChildren};
147
+ var PREFIXES="Webkit Moz O ms".split(" "),FLOAT_COMPARISON_EPSILON=.001;function extend(t,e,i){for(var r in t=t||{},i=i||!1,e=e||{})if(e.hasOwnProperty(r)){var s=t[r],l=e[r];i&&isObject$2(s)&&isObject$2(l)?t[r]=extend(s,l,i):t[r]=l;}return t}function render(t,e){var i=t;for(var r in e)if(e.hasOwnProperty(r)){var s=e[r],l=new RegExp("\\{"+r+"\\}","g");i=i.replace(l,s);}return i}function setStyle(t,e,i){for(var r=t.style,s=0;s<PREFIXES.length;++s){r[PREFIXES[s]+capitalize(e)]=i;}r[e]=i;}function setStyles(t,e){forEachObject(e,(function(e,i){null!=e&&(isObject$2(e)&&!0===e.prefix?setStyle(t,i,e.value):t.style[i]=e);}));}function capitalize(t){return t.charAt(0).toUpperCase()+t.slice(1)}function isString(t){return "string"==typeof t||t instanceof String}function isFunction$1(t){return "function"==typeof t}function isArray(t){return "[object Array]"===Object.prototype.toString.call(t)}function isObject$2(t){return !isArray(t)&&("object"===typeof t&&!!t)}function forEachObject(t,e){for(var i in t){if(t.hasOwnProperty(i))e(t[i],i);}}function floatEquals(t,e){return Math.abs(t-e)<FLOAT_COMPARISON_EPSILON}function removeChildren(t){for(;t.firstChild;)t.removeChild(t.firstChild);}var utils$2={extend:extend,render:render,setStyle:setStyle,setStyles:setStyles,capitalize:capitalize,isString:isString,isFunction:isFunction$1,isObject:isObject$2,forEachObject:forEachObject,floatEquals:floatEquals,removeChildren:removeChildren};
146
148
 
147
- var Tweenable=shifty_node.Tweenable,EASING_ALIASES={easeIn:"easeInCubic",easeOut:"easeOutCubic",easeInOut:"easeInOutCubic"},Path=function t(e,s){if(!(this instanceof t))throw new Error("Constructor was called without new keyword");var o;s=utils$1.extend({delay:0,duration:800,easing:"linear",from:{},to:{},step:function(){}},s),o=utils$1.isString(e)?document.querySelector(e):e,this.path=o,this._opts=s,this._tweenable=null;var i=this.path.getTotalLength();this.path.style.strokeDasharray=i+" "+i,this.set(0);};Path.prototype.value=function(){var t=this._getComputedDashOffset(),e=this.path.getTotalLength();return parseFloat((1-t/e).toFixed(6),10)},Path.prototype.set=function(t){this.stop(),this.path.style.strokeDashoffset=this._progressToOffset(t);var e=this._opts.step;if(utils$1.isFunction(e)){var s=this._easing(this._opts.easing);e(this._calculateTo(t,s),this._opts.shape||this,this._opts.attachment);}},Path.prototype.stop=function(){this._stopTween(),this.path.style.strokeDashoffset=this._getComputedDashOffset();},Path.prototype.animate=function(t,e,s){e=e||{},utils$1.isFunction(e)&&(s=e,e={});var o=utils$1.extend({},e),i=utils$1.extend({},this._opts);e=utils$1.extend(i,e);var a=this._easing(e.easing),n=this._resolveFromAndTo(t,a,o);this.stop(),this.path.getBoundingClientRect();var r=this._getComputedDashOffset(),h=this._progressToOffset(t),p=this;this._tweenable=new Tweenable,this._tweenable.tween({from:utils$1.extend({offset:r},n.from),to:utils$1.extend({offset:h},n.to),duration:e.duration,delay:e.delay,easing:a,step:function(t){p.path.style.strokeDashoffset=t.offset;var s=e.shape||p;e.step(t,s,e.attachment);}}).then((function(t){utils$1.isFunction(s)&&s();}));},Path.prototype._getComputedDashOffset=function(){var t=window.getComputedStyle(this.path,null);return parseFloat(t.getPropertyValue("stroke-dashoffset"),10)},Path.prototype._progressToOffset=function(t){var e=this.path.getTotalLength();return e-t*e},Path.prototype._resolveFromAndTo=function(t,e,s){return s.from&&s.to?{from:s.from,to:s.to}:{from:this._calculateFrom(e),to:this._calculateTo(t,e)}},Path.prototype._calculateFrom=function(t){return shifty_node.interpolate(this._opts.from,this._opts.to,this.value(),t)},Path.prototype._calculateTo=function(t,e){return shifty_node.interpolate(this._opts.from,this._opts.to,t,e)},Path.prototype._stopTween=function(){null!==this._tweenable&&(this._tweenable.stop(),this._tweenable=null);},Path.prototype._easing=function(t){return EASING_ALIASES.hasOwnProperty(t)?EASING_ALIASES[t]:t};var path=Path;
149
+ var Tweenable=shifty_node.Tweenable,EASING_ALIASES={easeIn:"easeInCubic",easeOut:"easeOutCubic",easeInOut:"easeInOutCubic"},Path=function t(e,s){if(!(this instanceof t))throw new Error("Constructor was called without new keyword");var o;s=utils$2.extend({delay:0,duration:800,easing:"linear",from:{},to:{},step:function(){}},s),o=utils$2.isString(e)?document.querySelector(e):e,this.path=o,this._opts=s,this._tweenable=null;var i=this.path.getTotalLength();this.path.style.strokeDasharray=i+" "+i,this.set(0);};Path.prototype.value=function(){var t=this._getComputedDashOffset(),e=this.path.getTotalLength();return parseFloat((1-t/e).toFixed(6),10)},Path.prototype.set=function(t){this.stop(),this.path.style.strokeDashoffset=this._progressToOffset(t);var e=this._opts.step;if(utils$2.isFunction(e)){var s=this._easing(this._opts.easing);e(this._calculateTo(t,s),this._opts.shape||this,this._opts.attachment);}},Path.prototype.stop=function(){this._stopTween(),this.path.style.strokeDashoffset=this._getComputedDashOffset();},Path.prototype.animate=function(t,e,s){e=e||{},utils$2.isFunction(e)&&(s=e,e={});var o=utils$2.extend({},e),i=utils$2.extend({},this._opts);e=utils$2.extend(i,e);var a=this._easing(e.easing),n=this._resolveFromAndTo(t,a,o);this.stop(),this.path.getBoundingClientRect();var r=this._getComputedDashOffset(),h=this._progressToOffset(t),p=this;this._tweenable=new Tweenable,this._tweenable.tween({from:utils$2.extend({offset:r},n.from),to:utils$2.extend({offset:h},n.to),duration:e.duration,delay:e.delay,easing:a,step:function(t){p.path.style.strokeDashoffset=t.offset;var s=e.shape||p;e.step(t,s,e.attachment);}}).then((function(t){utils$2.isFunction(s)&&s();}));},Path.prototype._getComputedDashOffset=function(){var t=window.getComputedStyle(this.path,null);return parseFloat(t.getPropertyValue("stroke-dashoffset"),10)},Path.prototype._progressToOffset=function(t){var e=this.path.getTotalLength();return e-t*e},Path.prototype._resolveFromAndTo=function(t,e,s){return s.from&&s.to?{from:s.from,to:s.to}:{from:this._calculateFrom(e),to:this._calculateTo(t,e)}},Path.prototype._calculateFrom=function(t){return shifty_node.interpolate(this._opts.from,this._opts.to,this.value(),t)},Path.prototype._calculateTo=function(t,e){return shifty_node.interpolate(this._opts.from,this._opts.to,t,e)},Path.prototype._stopTween=function(){null!==this._tweenable&&(this._tweenable.stop(),this._tweenable=null);},Path.prototype._easing=function(t){return EASING_ALIASES.hasOwnProperty(t)?EASING_ALIASES[t]:t};var path=Path;
148
150
 
149
- var DESTROYED_ERROR="Object is destroyed",Shape=function t(e,r){if(!(this instanceof t))throw new Error("Constructor was called without new keyword");if(0!==arguments.length){this._opts=utils$1.extend({color:"#555",strokeWidth:1,trailColor:null,trailWidth:null,fill:null,text:{style:{color:null,position:"absolute",left:"50%",top:"50%",padding:0,margin:0,transform:{prefix:!0,value:"translate(-50%, -50%)"}},autoStyleContainer:!0,alignToBottom:!0,value:null,className:"progressbar-text"},svgStyle:{display:"block",width:"100%"},warnings:!1},r,!0),utils$1.isObject(r)&&void 0!==r.svgStyle&&(this._opts.svgStyle=r.svgStyle),utils$1.isObject(r)&&utils$1.isObject(r.text)&&void 0!==r.text.style&&(this._opts.text.style=r.text.style);var i,s=this._createSvgView(this._opts);if(!(i=utils$1.isString(e)?document.querySelector(e):e))throw new Error("Container does not exist: "+e);this._container=i,this._container.appendChild(s.svg),this._opts.warnings&&this._warnContainerAspectRatio(this._container),this._opts.svgStyle&&utils$1.setStyles(s.svg,this._opts.svgStyle),this.svg=s.svg,this.path=s.path,this.trail=s.trail,this.text=null;var o=utils$1.extend({attachment:void 0,shape:this},this._opts);this._progressPath=new path(s.path,o),utils$1.isObject(this._opts.text)&&null!==this._opts.text.value&&this.setText(this._opts.text.value);}};Shape.prototype.animate=function(t,e,r){if(null===this._progressPath)throw new Error(DESTROYED_ERROR);this._progressPath.animate(t,e,r);},Shape.prototype.stop=function(){if(null===this._progressPath)throw new Error(DESTROYED_ERROR);void 0!==this._progressPath&&this._progressPath.stop();},Shape.prototype.pause=function(){if(null===this._progressPath)throw new Error(DESTROYED_ERROR);void 0!==this._progressPath&&this._progressPath._tweenable&&this._progressPath._tweenable.pause();},Shape.prototype.resume=function(){if(null===this._progressPath)throw new Error(DESTROYED_ERROR);void 0!==this._progressPath&&this._progressPath._tweenable&&this._progressPath._tweenable.resume();},Shape.prototype.destroy=function(){if(null===this._progressPath)throw new Error(DESTROYED_ERROR);this.stop(),this.svg.parentNode.removeChild(this.svg),this.svg=null,this.path=null,this.trail=null,this._progressPath=null,null!==this.text&&(this.text.parentNode.removeChild(this.text),this.text=null);},Shape.prototype.set=function(t){if(null===this._progressPath)throw new Error(DESTROYED_ERROR);this._progressPath.set(t);},Shape.prototype.value=function(){if(null===this._progressPath)throw new Error(DESTROYED_ERROR);return void 0===this._progressPath?0:this._progressPath.value()},Shape.prototype.setText=function(t){if(null===this._progressPath)throw new Error(DESTROYED_ERROR);null===this.text&&(this.text=this._createTextContainer(this._opts,this._container),this._container.appendChild(this.text)),utils$1.isObject(t)?(utils$1.removeChildren(this.text),this.text.appendChild(t)):this.text.innerHTML=t;},Shape.prototype._createSvgView=function(t){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");this._initializeSvg(e,t);var r=null;(t.trailColor||t.trailWidth)&&(r=this._createTrail(t),e.appendChild(r));var i=this._createPath(t);return e.appendChild(i),{svg:e,path:i,trail:r}},Shape.prototype._initializeSvg=function(t,e){t.setAttribute("viewBox","0 0 100 100");},Shape.prototype._createPath=function(t){var e=this._pathString(t);return this._createPathElement(e,t)},Shape.prototype._createTrail=function(t){var e=this._trailString(t),r=utils$1.extend({},t);return r.trailColor||(r.trailColor="#eee"),r.trailWidth||(r.trailWidth=r.strokeWidth),r.color=r.trailColor,r.strokeWidth=r.trailWidth,r.fill=null,this._createPathElement(e,r)},Shape.prototype._createPathElement=function(t,e){var r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttribute("d",t),r.setAttribute("stroke",e.color),r.setAttribute("stroke-width",e.strokeWidth),e.fill?r.setAttribute("fill",e.fill):r.setAttribute("fill-opacity","0"),r},Shape.prototype._createTextContainer=function(t,e){var r=document.createElement("div");r.className=t.text.className;var i=t.text.style;return i&&(t.text.autoStyleContainer&&(e.style.position="relative"),utils$1.setStyles(r,i),i.color||(r.style.color=t.color)),this._initializeTextContainer(t,e,r),r},Shape.prototype._initializeTextContainer=function(t,e,r){},Shape.prototype._pathString=function(t){throw new Error("Override this function for each progress bar")},Shape.prototype._trailString=function(t){throw new Error("Override this function for each progress bar")},Shape.prototype._warnContainerAspectRatio=function(t){if(this.containerAspectRatio){var e=window.getComputedStyle(t,null),r=parseFloat(e.getPropertyValue("width"),10),i=parseFloat(e.getPropertyValue("height"),10);utils$1.floatEquals(this.containerAspectRatio,r/i)||(console.warn("Incorrect aspect ratio of container","#"+t.id,"detected:",e.getPropertyValue("width")+"(width)","/",e.getPropertyValue("height")+"(height)","=",r/i),console.warn("Aspect ratio of should be",this.containerAspectRatio));}};var shape=Shape;
151
+ var DESTROYED_ERROR="Object is destroyed",Shape=function t(e,r){if(!(this instanceof t))throw new Error("Constructor was called without new keyword");if(0!==arguments.length){this._opts=utils$2.extend({color:"#555",strokeWidth:1,trailColor:null,trailWidth:null,fill:null,text:{style:{color:null,position:"absolute",left:"50%",top:"50%",padding:0,margin:0,transform:{prefix:!0,value:"translate(-50%, -50%)"}},autoStyleContainer:!0,alignToBottom:!0,value:null,className:"progressbar-text"},svgStyle:{display:"block",width:"100%"},warnings:!1},r,!0),utils$2.isObject(r)&&void 0!==r.svgStyle&&(this._opts.svgStyle=r.svgStyle),utils$2.isObject(r)&&utils$2.isObject(r.text)&&void 0!==r.text.style&&(this._opts.text.style=r.text.style);var i,s=this._createSvgView(this._opts);if(!(i=utils$2.isString(e)?document.querySelector(e):e))throw new Error("Container does not exist: "+e);this._container=i,this._container.appendChild(s.svg),this._opts.warnings&&this._warnContainerAspectRatio(this._container),this._opts.svgStyle&&utils$2.setStyles(s.svg,this._opts.svgStyle),this.svg=s.svg,this.path=s.path,this.trail=s.trail,this.text=null;var o=utils$2.extend({attachment:void 0,shape:this},this._opts);this._progressPath=new path(s.path,o),utils$2.isObject(this._opts.text)&&null!==this._opts.text.value&&this.setText(this._opts.text.value);}};Shape.prototype.animate=function(t,e,r){if(null===this._progressPath)throw new Error(DESTROYED_ERROR);this._progressPath.animate(t,e,r);},Shape.prototype.stop=function(){if(null===this._progressPath)throw new Error(DESTROYED_ERROR);void 0!==this._progressPath&&this._progressPath.stop();},Shape.prototype.pause=function(){if(null===this._progressPath)throw new Error(DESTROYED_ERROR);void 0!==this._progressPath&&this._progressPath._tweenable&&this._progressPath._tweenable.pause();},Shape.prototype.resume=function(){if(null===this._progressPath)throw new Error(DESTROYED_ERROR);void 0!==this._progressPath&&this._progressPath._tweenable&&this._progressPath._tweenable.resume();},Shape.prototype.destroy=function(){if(null===this._progressPath)throw new Error(DESTROYED_ERROR);this.stop(),this.svg.parentNode.removeChild(this.svg),this.svg=null,this.path=null,this.trail=null,this._progressPath=null,null!==this.text&&(this.text.parentNode.removeChild(this.text),this.text=null);},Shape.prototype.set=function(t){if(null===this._progressPath)throw new Error(DESTROYED_ERROR);this._progressPath.set(t);},Shape.prototype.value=function(){if(null===this._progressPath)throw new Error(DESTROYED_ERROR);return void 0===this._progressPath?0:this._progressPath.value()},Shape.prototype.setText=function(t){if(null===this._progressPath)throw new Error(DESTROYED_ERROR);null===this.text&&(this.text=this._createTextContainer(this._opts,this._container),this._container.appendChild(this.text)),utils$2.isObject(t)?(utils$2.removeChildren(this.text),this.text.appendChild(t)):this.text.innerHTML=t;},Shape.prototype._createSvgView=function(t){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");this._initializeSvg(e,t);var r=null;(t.trailColor||t.trailWidth)&&(r=this._createTrail(t),e.appendChild(r));var i=this._createPath(t);return e.appendChild(i),{svg:e,path:i,trail:r}},Shape.prototype._initializeSvg=function(t,e){t.setAttribute("viewBox","0 0 100 100");},Shape.prototype._createPath=function(t){var e=this._pathString(t);return this._createPathElement(e,t)},Shape.prototype._createTrail=function(t){var e=this._trailString(t),r=utils$2.extend({},t);return r.trailColor||(r.trailColor="#eee"),r.trailWidth||(r.trailWidth=r.strokeWidth),r.color=r.trailColor,r.strokeWidth=r.trailWidth,r.fill=null,this._createPathElement(e,r)},Shape.prototype._createPathElement=function(t,e){var r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttribute("d",t),r.setAttribute("stroke",e.color),r.setAttribute("stroke-width",e.strokeWidth),e.fill?r.setAttribute("fill",e.fill):r.setAttribute("fill-opacity","0"),r},Shape.prototype._createTextContainer=function(t,e){var r=document.createElement("div");r.className=t.text.className;var i=t.text.style;return i&&(t.text.autoStyleContainer&&(e.style.position="relative"),utils$2.setStyles(r,i),i.color||(r.style.color=t.color)),this._initializeTextContainer(t,e,r),r},Shape.prototype._initializeTextContainer=function(t,e,r){},Shape.prototype._pathString=function(t){throw new Error("Override this function for each progress bar")},Shape.prototype._trailString=function(t){throw new Error("Override this function for each progress bar")},Shape.prototype._warnContainerAspectRatio=function(t){if(this.containerAspectRatio){var e=window.getComputedStyle(t,null),r=parseFloat(e.getPropertyValue("width"),10),i=parseFloat(e.getPropertyValue("height"),10);utils$2.floatEquals(this.containerAspectRatio,r/i)||(console.warn("Incorrect aspect ratio of container","#"+t.id,"detected:",e.getPropertyValue("width")+"(width)","/",e.getPropertyValue("height")+"(height)","=",r/i),console.warn("Aspect ratio of should be",this.containerAspectRatio));}};var shape=Shape;
150
152
 
151
- var Line=function(t,e){this._pathTemplate="M 0,{center} L 100,{center}",shape.apply(this,arguments);};Line.prototype=new shape,Line.prototype.constructor=Line,Line.prototype._initializeSvg=function(t,e){t.setAttribute("viewBox","0 0 100 "+e.strokeWidth),t.setAttribute("preserveAspectRatio","none");},Line.prototype._pathString=function(t){return utils$1.render(this._pathTemplate,{center:t.strokeWidth/2})},Line.prototype._trailString=function(t){return this._pathString(t)};var line=Line;
153
+ var Line=function(t,e){this._pathTemplate="M 0,{center} L 100,{center}",shape.apply(this,arguments);};Line.prototype=new shape,Line.prototype.constructor=Line,Line.prototype._initializeSvg=function(t,e){t.setAttribute("viewBox","0 0 100 "+e.strokeWidth),t.setAttribute("preserveAspectRatio","none");},Line.prototype._pathString=function(t){return utils$2.render(this._pathTemplate,{center:t.strokeWidth/2})},Line.prototype._trailString=function(t){return this._pathString(t)};var line=Line;
152
154
 
153
- var Circle=function(r,t){this._pathTemplate="M 50,50 m 0,-{radius} a {radius},{radius} 0 1 1 0,{2radius} a {radius},{radius} 0 1 1 0,-{2radius}",this.containerAspectRatio=1,shape.apply(this,arguments);};Circle.prototype=new shape,Circle.prototype.constructor=Circle,Circle.prototype._pathString=function(r){var t=r.strokeWidth;r.trailWidth&&r.trailWidth>r.strokeWidth&&(t=r.trailWidth);var i=50-t/2;return utils$1.render(this._pathTemplate,{radius:i,"2radius":2*i})},Circle.prototype._trailString=function(r){return this._pathString(r)};var circle=Circle;
155
+ var Circle=function(r,t){this._pathTemplate="M 50,50 m 0,-{radius} a {radius},{radius} 0 1 1 0,{2radius} a {radius},{radius} 0 1 1 0,-{2radius}",this.containerAspectRatio=1,shape.apply(this,arguments);};Circle.prototype=new shape,Circle.prototype.constructor=Circle,Circle.prototype._pathString=function(r){var t=r.strokeWidth;r.trailWidth&&r.trailWidth>r.strokeWidth&&(t=r.trailWidth);var i=50-t/2;return utils$2.render(this._pathTemplate,{radius:i,"2radius":2*i})},Circle.prototype._trailString=function(r){return this._pathString(r)};var circle=Circle;
154
156
 
155
- var SemiCircle=function(t,i){this._pathTemplate="M 50,50 m -{radius},0 a {radius},{radius} 0 1 1 {2radius},0",this.containerAspectRatio=2,shape.apply(this,arguments);};SemiCircle.prototype=new shape,SemiCircle.prototype.constructor=SemiCircle,SemiCircle.prototype._initializeSvg=function(t,i){t.setAttribute("viewBox","0 0 100 50");},SemiCircle.prototype._initializeTextContainer=function(t,i,e){t.text.style&&(e.style.top="auto",e.style.bottom="0",t.text.alignToBottom?utils$1.setStyle(e,"transform","translate(-50%, 0)"):utils$1.setStyle(e,"transform","translate(-50%, 50%)"));},SemiCircle.prototype._pathString=circle.prototype._pathString,SemiCircle.prototype._trailString=circle.prototype._trailString;var semicircle=SemiCircle;
157
+ var SemiCircle=function(t,i){this._pathTemplate="M 50,50 m -{radius},0 a {radius},{radius} 0 1 1 {2radius},0",this.containerAspectRatio=2,shape.apply(this,arguments);};SemiCircle.prototype=new shape,SemiCircle.prototype.constructor=SemiCircle,SemiCircle.prototype._initializeSvg=function(t,i){t.setAttribute("viewBox","0 0 100 50");},SemiCircle.prototype._initializeTextContainer=function(t,i,e){t.text.style&&(e.style.top="auto",e.style.bottom="0",t.text.alignToBottom?utils$2.setStyle(e,"transform","translate(-50%, 0)"):utils$2.setStyle(e,"transform","translate(-50%, 50%)"));},SemiCircle.prototype._pathString=circle.prototype._pathString,SemiCircle.prototype._trailString=circle.prototype._trailString;var semicircle=SemiCircle;
156
158
 
157
- var Square=function(t,r){this._pathTemplate="M 0,{halfOfStrokeWidth} L {width},{halfOfStrokeWidth} L {width},{width} L {halfOfStrokeWidth},{width} L {halfOfStrokeWidth},{strokeWidth}",this._trailTemplate="M {startMargin},{halfOfStrokeWidth} L {width},{halfOfStrokeWidth} L {width},{width} L {halfOfStrokeWidth},{width} L {halfOfStrokeWidth},{halfOfStrokeWidth}",shape.apply(this,arguments);};Square.prototype=new shape,Square.prototype.constructor=Square,Square.prototype._pathString=function(t){var r=100-t.strokeWidth/2;return utils$1.render(this._pathTemplate,{width:r,strokeWidth:t.strokeWidth,halfOfStrokeWidth:t.strokeWidth/2})},Square.prototype._trailString=function(t){var r=100-t.strokeWidth/2;return utils$1.render(this._trailTemplate,{width:r,strokeWidth:t.strokeWidth,halfOfStrokeWidth:t.strokeWidth/2,startMargin:t.strokeWidth/2-t.trailWidth/2})};var square=Square;
159
+ var Square=function(t,r){this._pathTemplate="M 0,{halfOfStrokeWidth} L {width},{halfOfStrokeWidth} L {width},{width} L {halfOfStrokeWidth},{width} L {halfOfStrokeWidth},{strokeWidth}",this._trailTemplate="M {startMargin},{halfOfStrokeWidth} L {width},{halfOfStrokeWidth} L {width},{width} L {halfOfStrokeWidth},{width} L {halfOfStrokeWidth},{halfOfStrokeWidth}",shape.apply(this,arguments);};Square.prototype=new shape,Square.prototype.constructor=Square,Square.prototype._pathString=function(t){var r=100-t.strokeWidth/2;return utils$2.render(this._pathTemplate,{width:r,strokeWidth:t.strokeWidth,halfOfStrokeWidth:t.strokeWidth/2})},Square.prototype._trailString=function(t){var r=100-t.strokeWidth/2;return utils$2.render(this._trailTemplate,{width:r,strokeWidth:t.strokeWidth,halfOfStrokeWidth:t.strokeWidth/2,startMargin:t.strokeWidth/2-t.trailWidth/2})};var square=Square;
158
160
 
159
- var main$1={Line:line,Circle:circle,SemiCircle:semicircle,Square:square,Path:path,Shape:shape,utils:utils$1};
161
+ var main$1={Line:line,Circle:circle,SemiCircle:semicircle,Square:square,Path:path,Shape:shape,utils:utils$2};
160
162
 
161
- const NAME$n="progressdonut",SELECTOR_DONUT$1="[data-bs-progress-donut]",Default$g={color:"#5C6F82",trailColor:"#D9DADB",strokeWidth:24,trailWidth:12,easing:"easeInOut",duration:1400,text:{autoStyleContainer:!1},animate:!0,value:0};class ProgressDonut extends BaseComponent{constructor(t,e){super(t),this._config=this._getConfig(e),this._bar=null,this._init();}static get NAME(){return NAME$n}set(t){this._config.animate?this._bar.animate(t):this._bar.set(t);}dispose(){this._bar.destroy(),super.dispose();}_getConfig(t){return t={...Default$g,step:this._getStepCallback(),...Manipulator.getDataAttributes(this._element),..."object"==typeof t?t:{}}}_getStepCallback(){return (t,e)=>{const s=Math.round(100*e.value());e.setText(s+"%");}}_init(){this._bar=new main$1.Circle(this._element,this._config),this._config.value>0&&this.set(this._config.value);}}SelectorEngine$1.find(SELECTOR_DONUT$1).forEach((t=>{ProgressDonut.getOrCreateInstance(t);}));const ProgressDonut$1 = ProgressDonut;
163
+ const NAME$p="progressdonut",SELECTOR_DONUT$1="[data-bs-progress-donut]",Default$h={color:"#5C6F82",trailColor:"#D9DADB",strokeWidth:24,trailWidth:12,easing:"easeInOut",duration:1400,text:{autoStyleContainer:!1},animate:!0,value:0};class ProgressDonut extends BaseComponent{constructor(t,e){super(t),this._config=this._getConfig(e),this._bar=null,this._init();}static get NAME(){return NAME$p}set(t){this._config.animate?this._bar.animate(t):this._bar.set(t);}dispose(){this._bar.destroy(),super.dispose();}_getConfig(t){return t={...Default$h,step:this._getStepCallback(),...Manipulator.getDataAttributes(this._element),..."object"==typeof t?t:{}}}_getStepCallback(){return (t,e)=>{const s=Math.round(100*e.value());e.setText(s+"%");}}_init(){this._bar=new main$1.Circle(this._element,this._config),this._config.value>0&&this.set(this._config.value);}}SelectorEngine$1.find(SELECTOR_DONUT$1).forEach((t=>{ProgressDonut.getOrCreateInstance(t);}));const ProgressDonut$1 = ProgressDonut;
162
164
 
163
- const NAME$m="upload",EVENT_CLICK_DATA_API$a="click.bs.upload.data-api",SELECTOR_FORM="[data-bs-upload-dragdrop]",SELECTOR_DONUT="[data-bs-progress-donut]";class UploadDragDrop extends BaseComponent{constructor(e){super(e);const t=SelectorEngine$1.findOne(SELECTOR_DONUT,this._element);t&&(this._donut=ProgressDonut$1.getOrCreateInstance(t)),this._bindEvents();}static get NAME(){return NAME$m}progress(e){this._donut.set(e);}start(){this.reset(),this._element.classList.add("loading");}success(){this._element.classList.remove("loading"),this._element.classList.add("success");}reset(){this._element.classList.remove("loading"),this._element.classList.remove("success"),this._donut.set(0);}dispose(){this._donut.dispose(),super.dispose();}_bindEvents(){EventHandler$1.on(this._element,"drag",(e=>this._preventEvent(e))),EventHandler$1.on(this._element,"dragstart",(e=>this._preventEvent(e))),EventHandler$1.on(this._element,"dragend",(e=>this._preventEvent(e))),EventHandler$1.on(this._element,"dragover",(e=>this._preventEvent(e))),EventHandler$1.on(this._element,"dragenter",(e=>this._preventEvent(e))),EventHandler$1.on(this._element,"dragleave",(e=>this._preventEvent(e))),EventHandler$1.on(this._element,"drop",(e=>this._preventEvent(e))),EventHandler$1.on(this._element,"dragover",(()=>this._dropIn())),EventHandler$1.on(this._element,"dragenter",(()=>this._dropIn())),EventHandler$1.on(this._element,"dragleave",(()=>this._dropOut())),EventHandler$1.on(this._element,"dragend",(()=>this._dropOut())),EventHandler$1.on(this._element,"drop",(()=>this._dropOut())),EventHandler$1.on(this._element,"drop",(()=>this._drop()));}_preventEvent(e){e.preventDefault(),e.stopPropagation();}_dropIn(){this._isSuccess()||this._element.classList.add("dragover");}_dropOut(){this._isSuccess()||this._element.classList.remove("dragover");}_drop(){this._isSuccess()||this.start();}_isSuccess(){return this._element.classList.contains("success")}}const createInput=e=>{let t=e.matches&&e.matches(SELECTOR_FORM)?e:e.closest?e.closest(SELECTOR_FORM):null;return t&&UploadDragDrop.getOrCreateInstance(t),null};document.addEventListener("dragenter",(function(e){createInput(e.target);})),EventHandler$1.on(document,EVENT_CLICK_DATA_API$a,SELECTOR_FORM+" label",(function(){createInput(this);}));const UploadDragDrop$1 = UploadDragDrop;
165
+ const NAME$o="upload",EVENT_CLICK_DATA_API$a="click.bs.upload.data-api",SELECTOR_FORM="[data-bs-upload-dragdrop]",SELECTOR_DONUT="[data-bs-progress-donut]";class UploadDragDrop extends BaseComponent{constructor(e){super(e);const t=SelectorEngine$1.findOne(SELECTOR_DONUT,this._element);t&&(this._donut=ProgressDonut$1.getOrCreateInstance(t)),this._bindEvents();}static get NAME(){return NAME$o}progress(e){this._donut.set(e);}start(){this.reset(),this._element.classList.add("loading");}success(){this._element.classList.remove("loading"),this._element.classList.add("success");}reset(){this._element.classList.remove("loading"),this._element.classList.remove("success"),this._donut.set(0);}dispose(){this._donut.dispose(),super.dispose();}_bindEvents(){EventHandler$1.on(this._element,"drag",(e=>this._preventEvent(e))),EventHandler$1.on(this._element,"dragstart",(e=>this._preventEvent(e))),EventHandler$1.on(this._element,"dragend",(e=>this._preventEvent(e))),EventHandler$1.on(this._element,"dragover",(e=>this._preventEvent(e))),EventHandler$1.on(this._element,"dragenter",(e=>this._preventEvent(e))),EventHandler$1.on(this._element,"dragleave",(e=>this._preventEvent(e))),EventHandler$1.on(this._element,"drop",(e=>this._preventEvent(e))),EventHandler$1.on(this._element,"dragover",(()=>this._dropIn())),EventHandler$1.on(this._element,"dragenter",(()=>this._dropIn())),EventHandler$1.on(this._element,"dragleave",(()=>this._dropOut())),EventHandler$1.on(this._element,"dragend",(()=>this._dropOut())),EventHandler$1.on(this._element,"drop",(()=>this._dropOut())),EventHandler$1.on(this._element,"drop",(()=>this._drop()));}_preventEvent(e){e.preventDefault(),e.stopPropagation();}_dropIn(){this._isSuccess()||this._element.classList.add("dragover");}_dropOut(){this._isSuccess()||this._element.classList.remove("dragover");}_drop(){this._isSuccess()||this.start();}_isSuccess(){return this._element.classList.contains("success")}}const createInput=e=>{let t=e.matches&&e.matches(SELECTOR_FORM)?e:e.closest?e.closest(SELECTOR_FORM):null;return t&&UploadDragDrop.getOrCreateInstance(t),null};document.addEventListener("dragenter",(function(e){createInput(e.target);})),EventHandler$1.on(document,EVENT_CLICK_DATA_API$a,SELECTOR_FORM+" label",(function(){createInput(this);}));const UploadDragDrop$1 = UploadDragDrop;
164
166
 
165
- const NAME$l="backtotop",DATA_KEY$5="bs.backtotop",EVENT_KEY$7=`.${DATA_KEY$5}`,EVENT_CLICK$5=`click${EVENT_KEY$7}`,CLASS_NAME_SHOW="back-to-top-show",SELECTOR_TOGGLE$2='[data-bs-toggle="backtotop"]',Default$f={positionTop:0,scrollLimit:100,duration:800,easing:"easeInOutSine"};class BackToTop extends BaseComponent{constructor(t,o){super(t),this._config=this._getConfig(o),this._scrollCb=null,this._isAnim=!1,this._prevScrollBehavior="",this._bindEvents();}static get NAME(){return NAME$l}show(){this._element.classList.contains(CLASS_NAME_SHOW)||this._element.classList.add(CLASS_NAME_SHOW);}hide(){this._element.classList.contains(CLASS_NAME_SHOW)&&this._element.classList.remove(CLASS_NAME_SHOW);}toggleShow(){document.scrollingElement.scrollTop>this._config.scrollLimit?this.show():this.hide();}scrollToTop(){this._isAnim||(this._isAnim=!0,documentScrollTo(this._config.positionTop,{duration:this._config.duration,easing:this._config.easing,complete:()=>{this._isAnim=!1;}}));}dispose(){this._scrollCb&&this._scrollCb.dispose(),super.dispose();}_getConfig(t){return t={...Default$f,...Manipulator.getDataAttributes(this._element),..."object"==typeof t?t:{}}}_bindEvents(){this._scrollCb=onDocumentScroll$1((()=>this.toggleShow())),EventHandler$1.on(this._element,EVENT_CLICK$5,(t=>{t.preventDefault(),this.scrollToTop();}));}}onDocumentScroll$1((()=>{SelectorEngine$1.find(SELECTOR_TOGGLE$2).map((t=>{BackToTop.getOrCreateInstance(t);}));}));const BackToTop$1 = BackToTop;
167
+ const NAME$n="backtotop",DATA_KEY$5="bs.backtotop",EVENT_KEY$7=`.${DATA_KEY$5}`,EVENT_CLICK$5=`click${EVENT_KEY$7}`,CLASS_NAME_SHOW="back-to-top-show",SELECTOR_TOGGLE$3='[data-bs-toggle="backtotop"]',Default$g={positionTop:0,scrollLimit:100,duration:800,easing:"easeInOutSine"};class BackToTop extends BaseComponent{constructor(t,o){super(t),this._config=this._getConfig(o),this._scrollCb=null,this._isAnim=!1,this._prevScrollBehavior="",this._bindEvents();}static get NAME(){return NAME$n}show(){this._element.classList.contains(CLASS_NAME_SHOW)||this._element.classList.add(CLASS_NAME_SHOW);}hide(){this._element.classList.contains(CLASS_NAME_SHOW)&&this._element.classList.remove(CLASS_NAME_SHOW);}toggleShow(){document.scrollingElement.scrollTop>this._config.scrollLimit?this.show():this.hide();}scrollToTop(){this._isAnim||(this._isAnim=!0,documentScrollTo(this._config.positionTop,{duration:this._config.duration,easing:this._config.easing,complete:()=>{this._isAnim=!1;}}));}dispose(){this._scrollCb&&this._scrollCb.dispose(),super.dispose();}_getConfig(t){return t={...Default$g,...Manipulator.getDataAttributes(this._element),..."object"==typeof t?t:{}}}_bindEvents(){this._scrollCb=onDocumentScroll$1((()=>this.toggleShow())),EventHandler$1.on(this._element,EVENT_CLICK$5,(t=>{t.preventDefault(),this.scrollToTop();}));}}onDocumentScroll$1((()=>{SelectorEngine$1.find(SELECTOR_TOGGLE$3).map((t=>{BackToTop.getOrCreateInstance(t);}));}));const BackToTop$1 = BackToTop;
166
168
 
167
- const NAME$k="historyback",DATA_KEY$4="bs.historyback",EVENT_KEY$6=`.${DATA_KEY$4}`,EVENT_CLICK$4=`click${EVENT_KEY$6}`,EVENT_CLICK_DATA_API$9=`click${EVENT_KEY$6}.data-api`,SELECTOR_TOGGLE$1='[data-bs-toggle="historyback"]';class HistoryBack extends BaseComponent{constructor(t){super(t),this._bindEvents();}static get NAME(){return NAME$k}back(){window.history.back();}_bindEvents(){EventHandler$1.on(this._element,EVENT_CLICK$4,(t=>{t.preventDefault(),this.back();}));}}EventHandler$1.on(document,EVENT_CLICK_DATA_API$9,SELECTOR_TOGGLE$1,(function(t){t.preventDefault();HistoryBack.getOrCreateInstance(this).back();}));const HistoryBack$1 = HistoryBack;
169
+ const NAME$m="historyback",DATA_KEY$4="bs.historyback",EVENT_KEY$6=`.${DATA_KEY$4}`,EVENT_CLICK$4=`click${EVENT_KEY$6}`,EVENT_CLICK_DATA_API$9=`click${EVENT_KEY$6}.data-api`,SELECTOR_TOGGLE$2='[data-bs-toggle="historyback"]';class HistoryBack extends BaseComponent{constructor(t){super(t),this._bindEvents();}static get NAME(){return NAME$m}back(){window.history.back();}_bindEvents(){EventHandler$1.on(this._element,EVENT_CLICK$4,(t=>{t.preventDefault(),this.back();}));}}EventHandler$1.on(document,EVENT_CLICK_DATA_API$9,SELECTOR_TOGGLE$2,(function(t){t.preventDefault();HistoryBack.getOrCreateInstance(this).back();}));const HistoryBack$1 = HistoryBack;
168
170
 
169
- const NAME$j="historyback",DATA_KEY$3="bs.historyback",EVENT_KEY$5=`.${DATA_KEY$3}`,EVENT_CLICK$3=`click${EVENT_KEY$5}`,EVENT_CLICK_DATA_API$8=`click${EVENT_KEY$5}.data-api`,SELECTOR_TOGGLE='[data-bs-toggle="forward"]',Default$e={duration:800,easing:"easeInOutSine"};class Forward extends BaseComponent{constructor(t,e){super(t),this._config=this._getConfig(e),this._bindEvents();}static get NAME(){return NAME$j}goToTarget(){const t=getElementFromSelector(this._element);t&&documentScrollTo(t.offsetTop,{duration:this._config.duration,easing:this._config.easing});}_getConfig(t){return t={...Default$e,...Manipulator.getDataAttributes(this._element),..."object"==typeof t?t:{}}}_bindEvents(){EventHandler$1.on(this._element,EVENT_CLICK$3,(t=>{t.preventDefault(),this.goToTarget();}));}}EventHandler$1.on(document,EVENT_CLICK_DATA_API$8,SELECTOR_TOGGLE,(function(t){t.preventDefault();Forward.getOrCreateInstance(this).goToTarget();}));const Forward$1 = Forward;
171
+ const NAME$l="historyback",DATA_KEY$3="bs.historyback",EVENT_KEY$5=`.${DATA_KEY$3}`,EVENT_CLICK$3=`click${EVENT_KEY$5}`,EVENT_CLICK_DATA_API$8=`click${EVENT_KEY$5}.data-api`,SELECTOR_TOGGLE$1='[data-bs-toggle="forward"]',Default$f={duration:800,easing:"easeInOutSine"};class Forward extends BaseComponent{constructor(t,e){super(t),this._config=this._getConfig(e),this._bindEvents();}static get NAME(){return NAME$l}goToTarget(){const t=getElementFromSelector(this._element);t&&documentScrollTo(t.offsetTop,{duration:this._config.duration,easing:this._config.easing});}_getConfig(t){return t={...Default$f,...Manipulator.getDataAttributes(this._element),..."object"==typeof t?t:{}}}_bindEvents(){EventHandler$1.on(this._element,EVENT_CLICK$3,(t=>{t.preventDefault(),this.goToTarget();}));}}EventHandler$1.on(document,EVENT_CLICK_DATA_API$8,SELECTOR_TOGGLE$1,(function(t){t.preventDefault();Forward.getOrCreateInstance(this).goToTarget();}));const Forward$1 = Forward;
170
172
 
171
173
  var evEmitter=createCommonjsModule((function(e){var t,n;t="undefined"!=typeof window?window:commonjsGlobal,n=function(){function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var n=this._events=this._events||{},s=n[e]=n[e]||[];return -1==s.indexOf(t)&&s.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var n=this._onceEvents=this._onceEvents||{};return (n[e]=n[e]||{})[t]=!0,this}},t.off=function(e,t){var n=this._events&&this._events[e];if(n&&n.length){var s=n.indexOf(t);return -1!=s&&n.splice(s,1),this}},t.emitEvent=function(e,t){var n=this._events&&this._events[e];if(n&&n.length){n=n.slice(0),t=t||[];for(var s=this._onceEvents&&this._onceEvents[e],o=0;o<n.length;o++){var i=n[o];s&&s[i]&&(this.off(e,i),delete s[i]),i.apply(this,t);}return this}},t.allOff=function(){delete this._events,delete this._onceEvents;},e},e.exports?e.exports=n():t.EvEmitter=n();}));
172
174
 
@@ -180,7 +182,7 @@
180
182
 
181
183
  var matchesSelector=createCommonjsModule((function(e){!function(t,r){e.exports?e.exports=r():t.matchesSelector=r();}(window,(function(){var e=function(){var e=window.Element.prototype;if(e.matches)return "matches";if(e.matchesSelector)return "matchesSelector";for(var t=["webkit","moz","ms","o"],r=0;r<t.length;r++){var o=t[r]+"MatchesSelector";if(e[o])return o}}();return function(t,r){return t[e](r)}}));}));
182
184
 
183
- var utils=createCommonjsModule((function(e){!function(t,r){e.exports?e.exports=r(t,matchesSelector):t.fizzyUIUtils=r(t,t.matchesSelector);}(window,(function(e,t){var r={extend:function(e,t){for(var r in t)e[r]=t[r];return e},modulo:function(e,t){return (e%t+t)%t}},o=Array.prototype.slice;r.makeArray=function(e){return Array.isArray(e)?e:null==e?[]:"object"==typeof e&&"number"==typeof e.length?o.call(e):[e]},r.removeFrom=function(e,t){var r=e.indexOf(t);-1!=r&&e.splice(r,1);},r.getParent=function(e,r){for(;e.parentNode&&e!=document.body;)if(e=e.parentNode,t(e,r))return e},r.getQueryElement=function(e){return "string"==typeof e?document.querySelector(e):e},r.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e);},r.filterFindElements=function(e,o){e=r.makeArray(e);var n=[];return e.forEach((function(e){if(e instanceof HTMLElement)if(o){t(e,o)&&n.push(e);for(var r=e.querySelectorAll(o),u=0;u<r.length;u++)n.push(r[u]);}else n.push(e);})),n},r.debounceMethod=function(e,t,r){r=r||100;var o=e.prototype[t],n=t+"Timeout";e.prototype[t]=function(){var e=this[n];clearTimeout(e);var t=arguments,u=this;this[n]=setTimeout((function(){o.apply(u,t),delete u[n];}),r);};},r.docReady=function(e){var t=document.readyState;"complete"==t||"interactive"==t?setTimeout(e):document.addEventListener("DOMContentLoaded",e);},r.toDashed=function(e){return e.replace(/(.)([A-Z])/g,(function(e,t,r){return t+"-"+r})).toLowerCase()};var n=e.console;return r.htmlInit=function(t,o){r.docReady((function(){var u=r.toDashed(o),a="data-"+u,i=document.querySelectorAll("["+a+"]"),c=document.querySelectorAll(".js-"+u),s=r.makeArray(i).concat(r.makeArray(c)),l=a+"-options",m=e.jQuery;s.forEach((function(e){var r,u=e.getAttribute(a)||e.getAttribute(l);try{r=u&&JSON.parse(u);}catch(t){return void(n&&n.error("Error parsing "+a+" on "+e.className+": "+t))}var i=new t(e,r);m&&m.data(e,o,i);}));}));},r}));}));
185
+ var utils$1=createCommonjsModule((function(e){!function(t,r){e.exports?e.exports=r(t,matchesSelector):t.fizzyUIUtils=r(t,t.matchesSelector);}(window,(function(e,t){var r={extend:function(e,t){for(var r in t)e[r]=t[r];return e},modulo:function(e,t){return (e%t+t)%t}},o=Array.prototype.slice;r.makeArray=function(e){return Array.isArray(e)?e:null==e?[]:"object"==typeof e&&"number"==typeof e.length?o.call(e):[e]},r.removeFrom=function(e,t){var r=e.indexOf(t);-1!=r&&e.splice(r,1);},r.getParent=function(e,r){for(;e.parentNode&&e!=document.body;)if(e=e.parentNode,t(e,r))return e},r.getQueryElement=function(e){return "string"==typeof e?document.querySelector(e):e},r.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e);},r.filterFindElements=function(e,o){e=r.makeArray(e);var n=[];return e.forEach((function(e){if(e instanceof HTMLElement)if(o){t(e,o)&&n.push(e);for(var r=e.querySelectorAll(o),u=0;u<r.length;u++)n.push(r[u]);}else n.push(e);})),n},r.debounceMethod=function(e,t,r){r=r||100;var o=e.prototype[t],n=t+"Timeout";e.prototype[t]=function(){var e=this[n];clearTimeout(e);var t=arguments,u=this;this[n]=setTimeout((function(){o.apply(u,t),delete u[n];}),r);};},r.docReady=function(e){var t=document.readyState;"complete"==t||"interactive"==t?setTimeout(e):document.addEventListener("DOMContentLoaded",e);},r.toDashed=function(e){return e.replace(/(.)([A-Z])/g,(function(e,t,r){return t+"-"+r})).toLowerCase()};var n=e.console;return r.htmlInit=function(t,o){r.docReady((function(){var u=r.toDashed(o),a="data-"+u,i=document.querySelectorAll("["+a+"]"),c=document.querySelectorAll(".js-"+u),s=r.makeArray(i).concat(r.makeArray(c)),l=a+"-options",m=e.jQuery;s.forEach((function(e){var r,u=e.getAttribute(a)||e.getAttribute(l);try{r=u&&JSON.parse(u);}catch(t){return void(n&&n.error("Error parsing "+a+" on "+e.className+": "+t))}var i=new t(e,r);m&&m.data(e,o,i);}));}));},r}));}));
184
186
 
185
187
  var item=createCommonjsModule((function(t){!function(i,n){t.exports?t.exports=n(evEmitter,getSize):(i.Outlayer={},i.Outlayer.Item=n(i.EvEmitter,i.getSize));}(window,(function(t,i){var n=document.documentElement.style,o="string"==typeof n.transition?"transition":"WebkitTransition",e="string"==typeof n.transform?"transform":"WebkitTransform",s={WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[o],r={transform:e,transition:o,transitionDuration:o+"Duration",transitionProperty:o+"Property",transitionDelay:o+"Delay"};function a(t,i){t&&(this.element=t,this.layout=i,this.position={x:0,y:0},this._create());}var h=a.prototype=Object.create(t.prototype);h.constructor=a,h._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"});},h.handleEvent=function(t){var i="on"+t.type;this[i]&&this[i](t);},h.getSize=function(){this.size=i(this.element);},h.css=function(t){var i=this.element.style;for(var n in t){i[r[n]||n]=t[n];}},h.getPosition=function(){var t=getComputedStyle(this.element),i=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop"),o=t[i?"left":"right"],e=t[n?"top":"bottom"],s=parseFloat(o),r=parseFloat(e),a=this.layout.size;-1!=o.indexOf("%")&&(s=s/100*a.width),-1!=e.indexOf("%")&&(r=r/100*a.height),s=isNaN(s)?0:s,r=isNaN(r)?0:r,s-=i?a.paddingLeft:a.paddingRight,r-=n?a.paddingTop:a.paddingBottom,this.position.x=s,this.position.y=r;},h.layoutPosition=function(){var t=this.layout.size,i={},n=this.layout._getOption("originLeft"),o=this.layout._getOption("originTop"),e=n?"paddingLeft":"paddingRight",s=n?"left":"right",r=n?"right":"left",a=this.position.x+t[e];i[s]=this.getXValue(a),i[r]="";var h=o?"paddingTop":"paddingBottom",l=o?"top":"bottom",p=o?"bottom":"top",u=this.position.y+t[h];i[l]=this.getYValue(u),i[p]="",this.css(i),this.emitEvent("layout",[this]);},h.getXValue=function(t){var i=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&!i?t/this.layout.size.width*100+"%":t+"px"},h.getYValue=function(t){var i=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&i?t/this.layout.size.height*100+"%":t+"px"},h._transitionTo=function(t,i){this.getPosition();var n=this.position.x,o=this.position.y,e=t==this.position.x&&i==this.position.y;if(this.setPosition(t,i),!e||this.isTransitioning){var s=t-n,r=i-o,a={};a.transform=this.getTranslate(s,r),this.transition({to:a,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0});}else this.layoutPosition();},h.getTranslate=function(t,i){return "translate3d("+(t=this.layout._getOption("originLeft")?t:-t)+"px, "+(i=this.layout._getOption("originTop")?i:-i)+"px, 0)"},h.goTo=function(t,i){this.setPosition(t,i),this.layoutPosition();},h.moveTo=h._transitionTo,h.setPosition=function(t,i){this.position.x=parseFloat(t),this.position.y=parseFloat(i);},h._nonTransition=function(t){for(var i in this.css(t.to),t.isCleaning&&this._removeStyles(t.to),t.onTransitionEnd)t.onTransitionEnd[i].call(this);},h.transition=function(t){if(parseFloat(this.layout.options.transitionDuration)){var i=this._transn;for(var n in t.onTransitionEnd)i.onEnd[n]=t.onTransitionEnd[n];for(n in t.to)i.ingProperties[n]=!0,t.isCleaning&&(i.clean[n]=!0);if(t.from){this.css(t.from);this.element.offsetHeight;}this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0;}else this._nonTransition(t);};var l="opacity,"+e.replace(/([A-Z])/g,(function(t){return "-"+t.toLowerCase()}));h.enableTransition=function(){if(!this.isTransitioning){var t=this.layout.options.transitionDuration;t="number"==typeof t?t+"ms":t,this.css({transitionProperty:l,transitionDuration:t,transitionDelay:this.staggerDelay||0}),this.element.addEventListener(s,this,!1);}},h.onwebkitTransitionEnd=function(t){this.ontransitionend(t);},h.onotransitionend=function(t){this.ontransitionend(t);};var p={"-webkit-transform":"transform"};h.ontransitionend=function(t){if(t.target===this.element){var i=this._transn,n=p[t.propertyName]||t.propertyName;if(delete i.ingProperties[n],function(t){for(var i in t)return !1;return !0}(i.ingProperties)&&this.disableTransition(),n in i.clean&&(this.element.style[t.propertyName]="",delete i.clean[n]),n in i.onEnd)i.onEnd[n].call(this),delete i.onEnd[n];this.emitEvent("transitionEnd",[this]);}},h.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(s,this,!1),this.isTransitioning=!1;},h._removeStyles=function(t){var i={};for(var n in t)i[n]="";this.css(i);};var u={transitionProperty:"",transitionDuration:"",transitionDelay:""};return h.removeTransitionStyles=function(){this.css(u);},h.stagger=function(t){t=isNaN(t)?0:t,this.staggerDelay=t+"ms";},h.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this]);},h.remove=function(){o&&parseFloat(this.layout.options.transitionDuration)?(this.once("transitionEnd",(function(){this.removeElem();})),this.hide()):this.removeElem();},h.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options,i={};i[this.getHideRevealTransitionEndProperty("visibleStyle")]=this.onRevealTransitionEnd,this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0,onTransitionEnd:i});},h.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal");},h.getHideRevealTransitionEndProperty=function(t){var i=this.layout.options[t];if(i.opacity)return "opacity";for(var n in i)return n},h.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options,i={};i[this.getHideRevealTransitionEndProperty("hiddenStyle")]=this.onHideTransitionEnd,this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:i});},h.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"));},h.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""});},a}));}));
186
188
 
@@ -190,7 +192,7 @@
190
192
  * the brains and guts of a layout library
191
193
  * MIT license
192
194
  */
193
- !function(e,i){t.exports?t.exports=i(e,evEmitter,getSize,utils,item):e.Outlayer=i(e,e.EvEmitter,e.getSize,e.fizzyUIUtils,e.Outlayer.Item);}(window,(function(t,e,i,n,o){var s=t.console,r=t.jQuery,a=function(){},h=0,u={};function m(t,e){var i=n.getQueryElement(t);if(i){this.element=i,r&&(this.$element=r(this.element)),this.options=n.extend({},this.constructor.defaults),this.option(e);var o=++h;this.element.outlayerGUID=o,u[o]=this,this._create(),this._getOption("initLayout")&&this.layout();}else s&&s.error("Bad element for "+this.constructor.namespace+": "+(i||t));}m.namespace="outlayer",m.Item=o,m.defaults={containerStyle:{position:"relative"},initLayout:!0,originLeft:!0,originTop:!0,resize:!0,resizeContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}};var c=m.prototype;function l(t){function e(){t.apply(this,arguments);}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e}n.extend(c,e.prototype),c.option=function(t){n.extend(this.options,t);},c._getOption=function(t){var e=this.constructor.compatOptions[t];return e&&void 0!==this.options[e]?this.options[e]:this.options[t]},m.compatOptions={initLayout:"isInitLayout",horizontal:"isHorizontal",layoutInstant:"isLayoutInstant",originLeft:"isOriginLeft",originTop:"isOriginTop",resize:"isResizeBound",resizeContainer:"isResizingContainer"},c._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),n.extend(this.element.style,this.options.containerStyle),this._getOption("resize")&&this.bindResize();},c.reloadItems=function(){this.items=this._itemize(this.element.children);},c._itemize=function(t){for(var e=this._filterFindItemElements(t),i=this.constructor.Item,n=[],o=0;o<e.length;o++){var s=new i(e[o],this);n.push(s);}return n},c._filterFindItemElements=function(t){return n.filterFindElements(t,this.options.itemSelector)},c.getItemElements=function(){return this.items.map((function(t){return t.element}))},c.layout=function(){this._resetLayout(),this._manageStamps();var t=this._getOption("layoutInstant"),e=void 0!==t?t:!this._isLayoutInited;this.layoutItems(this.items,e),this._isLayoutInited=!0;},c._init=c.layout,c._resetLayout=function(){this.getSize();},c.getSize=function(){this.size=i(this.element);},c._getMeasurement=function(t,e){var n,o=this.options[t];o?("string"==typeof o?n=this.element.querySelector(o):o instanceof HTMLElement&&(n=o),this[t]=n?i(n)[e]:o):this[t]=0;},c.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout();},c._getItemsForLayout=function(t){return t.filter((function(t){return !t.isIgnored}))},c._layoutItems=function(t,e){if(this._emitCompleteOnItems("layout",t),t&&t.length){var i=[];t.forEach((function(t){var n=this._getItemLayoutPosition(t);n.item=t,n.isInstant=e||t.isLayoutInstant,i.push(n);}),this),this._processLayoutQueue(i);}},c._getItemLayoutPosition=function(){return {x:0,y:0}},c._processLayoutQueue=function(t){this.updateStagger(),t.forEach((function(t,e){this._positionItem(t.item,t.x,t.y,t.isInstant,e);}),this);},c.updateStagger=function(){var t=this.options.stagger;if(null!=t)return this.stagger=function(t){if("number"==typeof t)return t;var e=t.match(/(^\d*\.?\d*)(\w*)/),i=e&&e[1],n=e&&e[2];if(!i.length)return 0;return (i=parseFloat(i))*(f[n]||1)}(t),this.stagger;this.stagger=0;},c._positionItem=function(t,e,i,n,o){n?t.goTo(e,i):(t.stagger(o*this.stagger),t.moveTo(e,i));},c._postLayout=function(){this.resizeContainer();},c.resizeContainer=function(){if(this._getOption("resizeContainer")){var t=this._getContainerSize();t&&(this._setContainerMeasure(t.width,!0),this._setContainerMeasure(t.height,!1));}},c._getContainerSize=a,c._setContainerMeasure=function(t,e){if(void 0!==t){var i=this.size;i.isBorderBox&&(t+=e?i.paddingLeft+i.paddingRight+i.borderLeftWidth+i.borderRightWidth:i.paddingBottom+i.paddingTop+i.borderTopWidth+i.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px";}},c._emitCompleteOnItems=function(t,e){var i=this;function n(){i.dispatchEvent(t+"Complete",null,[e]);}var o=e.length;if(e&&o){var s=0;e.forEach((function(e){e.once(t,r);}));}else n();function r(){++s==o&&n();}},c.dispatchEvent=function(t,e,i){var n=e?[e].concat(i):i;if(this.emitEvent(t,n),r)if(this.$element=this.$element||r(this.element),e){var o=r.Event(e);o.type=t,this.$element.trigger(o,i);}else this.$element.trigger(t,i);},c.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0);},c.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored;},c.stamp=function(t){(t=this._find(t))&&(this.stamps=this.stamps.concat(t),t.forEach(this.ignore,this));},c.unstamp=function(t){(t=this._find(t))&&t.forEach((function(t){n.removeFrom(this.stamps,t),this.unignore(t);}),this);},c._find=function(t){if(t)return "string"==typeof t&&(t=this.element.querySelectorAll(t)),t=n.makeArray(t)},c._manageStamps=function(){this.stamps&&this.stamps.length&&(this._getBoundingRect(),this.stamps.forEach(this._manageStamp,this));},c._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)};},c._manageStamp=a,c._getElementOffset=function(t){var e=t.getBoundingClientRect(),n=this._boundingRect,o=i(t);return {left:e.left-n.left-o.marginLeft,top:e.top-n.top-o.marginTop,right:n.right-e.right-o.marginRight,bottom:n.bottom-e.bottom-o.marginBottom}},c.handleEvent=n.handleEvent,c.bindResize=function(){t.addEventListener("resize",this),this.isResizeBound=!0;},c.unbindResize=function(){t.removeEventListener("resize",this),this.isResizeBound=!1;},c.onresize=function(){this.resize();},n.debounceMethod(m,"onresize",100),c.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout();},c.needsResizeLayout=function(){var t=i(this.element);return this.size&&t&&t.innerWidth!==this.size.innerWidth},c.addItems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},c.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e));},c.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(i);}},c.reveal=function(t){if(this._emitCompleteOnItems("reveal",t),t&&t.length){var e=this.updateStagger();t.forEach((function(t,i){t.stagger(i*e),t.reveal();}));}},c.hide=function(t){if(this._emitCompleteOnItems("hide",t),t&&t.length){var e=this.updateStagger();t.forEach((function(t,i){t.stagger(i*e),t.hide();}));}},c.revealItemElements=function(t){var e=this.getItems(t);this.reveal(e);},c.hideItemElements=function(t){var e=this.getItems(t);this.hide(e);},c.getItem=function(t){for(var e=0;e<this.items.length;e++){var i=this.items[e];if(i.element==t)return i}},c.getItems=function(t){t=n.makeArray(t);var e=[];return t.forEach((function(t){var i=this.getItem(t);i&&e.push(i);}),this),e},c.remove=function(t){var e=this.getItems(t);this._emitCompleteOnItems("remove",e),e&&e.length&&e.forEach((function(t){t.remove(),n.removeFrom(this.items,t);}),this);},c.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="",this.items.forEach((function(t){t.destroy();})),this.unbindResize();var e=this.element.outlayerGUID;delete u[e],delete this.element.outlayerGUID,r&&r.removeData(this.element,this.constructor.namespace);},m.data=function(t){var e=(t=n.getQueryElement(t))&&t.outlayerGUID;return e&&u[e]},m.create=function(t,e){var i=l(m);return i.defaults=n.extend({},m.defaults),n.extend(i.defaults,e),i.compatOptions=n.extend({},m.compatOptions),i.namespace=t,i.data=m.data,i.Item=l(o),n.htmlInit(i,t),r&&r.bridget&&r.bridget(t,i),i};var f={ms:1,s:1e3};return m.Item=o,m}));}));
195
+ !function(e,i){t.exports?t.exports=i(e,evEmitter,getSize,utils$1,item):e.Outlayer=i(e,e.EvEmitter,e.getSize,e.fizzyUIUtils,e.Outlayer.Item);}(window,(function(t,e,i,n,o){var s=t.console,r=t.jQuery,a=function(){},h=0,u={};function m(t,e){var i=n.getQueryElement(t);if(i){this.element=i,r&&(this.$element=r(this.element)),this.options=n.extend({},this.constructor.defaults),this.option(e);var o=++h;this.element.outlayerGUID=o,u[o]=this,this._create(),this._getOption("initLayout")&&this.layout();}else s&&s.error("Bad element for "+this.constructor.namespace+": "+(i||t));}m.namespace="outlayer",m.Item=o,m.defaults={containerStyle:{position:"relative"},initLayout:!0,originLeft:!0,originTop:!0,resize:!0,resizeContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}};var c=m.prototype;function l(t){function e(){t.apply(this,arguments);}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e}n.extend(c,e.prototype),c.option=function(t){n.extend(this.options,t);},c._getOption=function(t){var e=this.constructor.compatOptions[t];return e&&void 0!==this.options[e]?this.options[e]:this.options[t]},m.compatOptions={initLayout:"isInitLayout",horizontal:"isHorizontal",layoutInstant:"isLayoutInstant",originLeft:"isOriginLeft",originTop:"isOriginTop",resize:"isResizeBound",resizeContainer:"isResizingContainer"},c._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),n.extend(this.element.style,this.options.containerStyle),this._getOption("resize")&&this.bindResize();},c.reloadItems=function(){this.items=this._itemize(this.element.children);},c._itemize=function(t){for(var e=this._filterFindItemElements(t),i=this.constructor.Item,n=[],o=0;o<e.length;o++){var s=new i(e[o],this);n.push(s);}return n},c._filterFindItemElements=function(t){return n.filterFindElements(t,this.options.itemSelector)},c.getItemElements=function(){return this.items.map((function(t){return t.element}))},c.layout=function(){this._resetLayout(),this._manageStamps();var t=this._getOption("layoutInstant"),e=void 0!==t?t:!this._isLayoutInited;this.layoutItems(this.items,e),this._isLayoutInited=!0;},c._init=c.layout,c._resetLayout=function(){this.getSize();},c.getSize=function(){this.size=i(this.element);},c._getMeasurement=function(t,e){var n,o=this.options[t];o?("string"==typeof o?n=this.element.querySelector(o):o instanceof HTMLElement&&(n=o),this[t]=n?i(n)[e]:o):this[t]=0;},c.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout();},c._getItemsForLayout=function(t){return t.filter((function(t){return !t.isIgnored}))},c._layoutItems=function(t,e){if(this._emitCompleteOnItems("layout",t),t&&t.length){var i=[];t.forEach((function(t){var n=this._getItemLayoutPosition(t);n.item=t,n.isInstant=e||t.isLayoutInstant,i.push(n);}),this),this._processLayoutQueue(i);}},c._getItemLayoutPosition=function(){return {x:0,y:0}},c._processLayoutQueue=function(t){this.updateStagger(),t.forEach((function(t,e){this._positionItem(t.item,t.x,t.y,t.isInstant,e);}),this);},c.updateStagger=function(){var t=this.options.stagger;if(null!=t)return this.stagger=function(t){if("number"==typeof t)return t;var e=t.match(/(^\d*\.?\d*)(\w*)/),i=e&&e[1],n=e&&e[2];if(!i.length)return 0;return (i=parseFloat(i))*(f[n]||1)}(t),this.stagger;this.stagger=0;},c._positionItem=function(t,e,i,n,o){n?t.goTo(e,i):(t.stagger(o*this.stagger),t.moveTo(e,i));},c._postLayout=function(){this.resizeContainer();},c.resizeContainer=function(){if(this._getOption("resizeContainer")){var t=this._getContainerSize();t&&(this._setContainerMeasure(t.width,!0),this._setContainerMeasure(t.height,!1));}},c._getContainerSize=a,c._setContainerMeasure=function(t,e){if(void 0!==t){var i=this.size;i.isBorderBox&&(t+=e?i.paddingLeft+i.paddingRight+i.borderLeftWidth+i.borderRightWidth:i.paddingBottom+i.paddingTop+i.borderTopWidth+i.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px";}},c._emitCompleteOnItems=function(t,e){var i=this;function n(){i.dispatchEvent(t+"Complete",null,[e]);}var o=e.length;if(e&&o){var s=0;e.forEach((function(e){e.once(t,r);}));}else n();function r(){++s==o&&n();}},c.dispatchEvent=function(t,e,i){var n=e?[e].concat(i):i;if(this.emitEvent(t,n),r)if(this.$element=this.$element||r(this.element),e){var o=r.Event(e);o.type=t,this.$element.trigger(o,i);}else this.$element.trigger(t,i);},c.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0);},c.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored;},c.stamp=function(t){(t=this._find(t))&&(this.stamps=this.stamps.concat(t),t.forEach(this.ignore,this));},c.unstamp=function(t){(t=this._find(t))&&t.forEach((function(t){n.removeFrom(this.stamps,t),this.unignore(t);}),this);},c._find=function(t){if(t)return "string"==typeof t&&(t=this.element.querySelectorAll(t)),t=n.makeArray(t)},c._manageStamps=function(){this.stamps&&this.stamps.length&&(this._getBoundingRect(),this.stamps.forEach(this._manageStamp,this));},c._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)};},c._manageStamp=a,c._getElementOffset=function(t){var e=t.getBoundingClientRect(),n=this._boundingRect,o=i(t);return {left:e.left-n.left-o.marginLeft,top:e.top-n.top-o.marginTop,right:n.right-e.right-o.marginRight,bottom:n.bottom-e.bottom-o.marginBottom}},c.handleEvent=n.handleEvent,c.bindResize=function(){t.addEventListener("resize",this),this.isResizeBound=!0;},c.unbindResize=function(){t.removeEventListener("resize",this),this.isResizeBound=!1;},c.onresize=function(){this.resize();},n.debounceMethod(m,"onresize",100),c.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout();},c.needsResizeLayout=function(){var t=i(this.element);return this.size&&t&&t.innerWidth!==this.size.innerWidth},c.addItems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},c.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e));},c.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(i);}},c.reveal=function(t){if(this._emitCompleteOnItems("reveal",t),t&&t.length){var e=this.updateStagger();t.forEach((function(t,i){t.stagger(i*e),t.reveal();}));}},c.hide=function(t){if(this._emitCompleteOnItems("hide",t),t&&t.length){var e=this.updateStagger();t.forEach((function(t,i){t.stagger(i*e),t.hide();}));}},c.revealItemElements=function(t){var e=this.getItems(t);this.reveal(e);},c.hideItemElements=function(t){var e=this.getItems(t);this.hide(e);},c.getItem=function(t){for(var e=0;e<this.items.length;e++){var i=this.items[e];if(i.element==t)return i}},c.getItems=function(t){t=n.makeArray(t);var e=[];return t.forEach((function(t){var i=this.getItem(t);i&&e.push(i);}),this),e},c.remove=function(t){var e=this.getItems(t);this._emitCompleteOnItems("remove",e),e&&e.length&&e.forEach((function(t){t.remove(),n.removeFrom(this.items,t);}),this);},c.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="",this.items.forEach((function(t){t.destroy();})),this.unbindResize();var e=this.element.outlayerGUID;delete u[e],delete this.element.outlayerGUID,r&&r.removeData(this.element,this.constructor.namespace);},m.data=function(t){var e=(t=n.getQueryElement(t))&&t.outlayerGUID;return e&&u[e]},m.create=function(t,e){var i=l(m);return i.defaults=n.extend({},m.defaults),n.extend(i.defaults,e),i.compatOptions=n.extend({},m.compatOptions),i.namespace=t,i.data=m.data,i.Item=l(o),n.htmlInit(i,t),r&&r.bridget&&r.bridget(t,i),i};var f={ms:1,s:1e3};return m.Item=o,m}));}));
194
196
 
195
197
  var masonry=createCommonjsModule((function(t){
196
198
  /*!
@@ -202,27 +204,27 @@
202
204
  */
203
205
  !function(i,o){t.exports?t.exports=o(outlayer,getSize):i.Masonry=o(i.Outlayer,i.getSize);}(window,(function(t,i){var o=t.create("masonry");o.compatOptions.fitWidth="isFitWidth";var e=o.prototype;return e._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns(),this.colYs=[];for(var t=0;t<this.cols;t++)this.colYs.push(0);this.maxY=0,this.horizontalColIndex=0;},e.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var t=this.items[0],o=t&&t.element;this.columnWidth=o&&i(o).outerWidth||this.containerWidth;}var e=this.columnWidth+=this.gutter,r=this.containerWidth+this.gutter,s=r/e,n=e-r%e;s=Math[n&&n<1?"round":"floor"](s),this.cols=Math.max(s,1);},e.getContainerWidth=function(){var t=this._getOption("fitWidth")?this.element.parentNode:this.element,o=i(t);this.containerWidth=o&&o.innerWidth;},e._getItemLayoutPosition=function(t){t.getSize();var i=t.size.outerWidth%this.columnWidth,o=Math[i&&i<1?"round":"ceil"](t.size.outerWidth/this.columnWidth);o=Math.min(o,this.cols);for(var e=this[this.options.horizontalOrder?"_getHorizontalColPosition":"_getTopColPosition"](o,t),r={x:this.columnWidth*e.col,y:e.y},s=e.y+t.size.outerHeight,n=o+e.col,h=e.col;h<n;h++)this.colYs[h]=s;return r},e._getTopColPosition=function(t){var i=this._getTopColGroup(t),o=Math.min.apply(Math,i);return {col:i.indexOf(o),y:o}},e._getTopColGroup=function(t){if(t<2)return this.colYs;for(var i=[],o=this.cols+1-t,e=0;e<o;e++)i[e]=this._getColGroupY(e,t);return i},e._getColGroupY=function(t,i){if(i<2)return this.colYs[t];var o=this.colYs.slice(t,t+i);return Math.max.apply(Math,o)},e._getHorizontalColPosition=function(t,i){var o=this.horizontalColIndex%this.cols;o=t>1&&o+t>this.cols?0:o;var e=i.size.outerWidth&&i.size.outerHeight;return this.horizontalColIndex=e?o+t:this.horizontalColIndex,{col:o,y:this._getColGroupY(o,t)}},e._manageStamp=function(t){var o=i(t),e=this._getElementOffset(t),r=this._getOption("originLeft")?e.left:e.right,s=r+o.outerWidth,n=Math.floor(r/this.columnWidth);n=Math.max(0,n);var h=Math.floor(s/this.columnWidth);h-=s%this.columnWidth?0:1,h=Math.min(this.cols-1,h);for(var a=(this._getOption("originTop")?e.top:e.bottom)+o.outerHeight,l=n;l<=h;l++)this.colYs[l]=Math.max(a,this.colYs[l]);},e._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this._getOption("fitWidth")&&(t.width=this._getContainerFitWidth()),t},e._getContainerFitWidth=function(){for(var t=0,i=this.cols;--i&&0===this.colYs[i];)t++;return (this.cols-t)*this.columnWidth-this.gutter},e.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!=this.containerWidth},o}));}));
204
206
 
205
- const NAME$i="masonry",SELECTOR_DATA_TOGGLE$7='[data-bs-toggle="masonry"]',SELECTOR_LOADER=".masonry-loader",Default$d={percentPosition:!0};class Masonry extends BaseComponent{constructor(e,t){super(e),this._config=this._getConfig(t),this._masonry=null,this._images=SelectorEngine$1.find("img",this._element),this._loadCounter=0,this._init();}static get NAME(){return NAME$i}dispose(){this._masonry&&(this._masonry.destroy(),this._masonry=null),super.dispose();}_getConfig(e){return e={...Default$d,...Manipulator.getDataAttributes(this._element),..."object"==typeof e?e:{}}}_init(){this._images.length>0?this._images.forEach((e=>{const t=new Image;t.onload=()=>this._onLoadEnd(),t.src=e.src;})):this._initMasonry();}_onLoadEnd(){this._loadCounter++,this._loadCounter>=this._images.length&&this._initMasonry();}_initMasonry(){this._masonry=new masonry(this._element,this._config);}_createLoader(){const e=document.createElement("div");return e.classList.add("masonry-loader","fade","d-flex","justify-content-center","align-items-center"),e.innerHTML='<div class="progress-spinner progress-spinner-active"><span class="visually-hidden">Caricamento...</span></div>',this._element.appendChild(e),e}_getOrCreateLoader(){const e=SelectorEngine$1.findOne(SELECTOR_LOADER,this._element);return e||this._createLoader()}_destroyLoader(){const e=SelectorEngine$1.findOne(SELECTOR_LOADER,this._element);e&&e.remove();}_showLoader(){this._getOrCreateLoader().classList.add("show");}_hideLoader(){this._destroyLoader();}}const masonries=SelectorEngine$1.find(SELECTOR_DATA_TOGGLE$7);masonries.length>0&&masonries.forEach((e=>{Masonry.getOrCreateInstance(e);}));const Masonry$1 = Masonry;
207
+ const NAME$k="masonry",SELECTOR_DATA_TOGGLE$8='[data-bs-toggle="masonry"]',SELECTOR_LOADER=".masonry-loader",Default$e={percentPosition:!0};class Masonry extends BaseComponent{constructor(e,t){super(e),this._config=this._getConfig(t),this._masonry=null,this._images=SelectorEngine$1.find("img",this._element),this._loadCounter=0,this._init();}static get NAME(){return NAME$k}dispose(){this._masonry&&(this._masonry.destroy(),this._masonry=null),super.dispose();}_getConfig(e){return e={...Default$e,...Manipulator.getDataAttributes(this._element),..."object"==typeof e?e:{}}}_init(){this._images.length>0?this._images.forEach((e=>{const t=new Image;t.onload=()=>this._onLoadEnd(),t.src=e.src;})):this._initMasonry();}_onLoadEnd(){this._loadCounter++,this._loadCounter>=this._images.length&&this._initMasonry();}_initMasonry(){this._masonry=new masonry(this._element,this._config);}_createLoader(){const e=document.createElement("div");return e.classList.add("masonry-loader","fade","d-flex","justify-content-center","align-items-center"),e.innerHTML='<div class="progress-spinner progress-spinner-active"><span class="visually-hidden">Caricamento...</span></div>',this._element.appendChild(e),e}_getOrCreateLoader(){const e=SelectorEngine$1.findOne(SELECTOR_LOADER,this._element);return e||this._createLoader()}_destroyLoader(){const e=SelectorEngine$1.findOne(SELECTOR_LOADER,this._element);e&&e.remove();}_showLoader(){this._getOrCreateLoader().classList.add("show");}_hideLoader(){this._destroyLoader();}}const masonries=SelectorEngine$1.find(SELECTOR_DATA_TOGGLE$8);masonries.length>0&&masonries.forEach((e=>{Masonry.getOrCreateInstance(e);}));const Masonry$1 = Masonry;
206
208
 
207
- const NAME$h="list",EVENT_CLICK$2="click.bs.list",EVENT_CLICK_DATA_API$7="click.bs.list.data-api",SELECTOR_LIST="[data-bs-list-checkbox]";class List extends BaseComponent{constructor(e){super(e),this._init();}static get NAME(){return NAME$h}toggleCheckbox(e){const t=SelectorEngine$1.findOne("input",e);t&&(t.checked?(t.checked=!1,e.classList.remove("active")):(t.checked=!0,e.classList.add("active")));}_init(){this._initCheckbox();}_initCheckbox(){SelectorEngine$1.find("input[type=checkbox]",this._element).forEach((e=>{EventHandler$1.on(e.closest("a"),EVENT_CLICK$2,(t=>{t.preventDefault(),this.toggleCheckbox(e.closest("a"));}));}));}}SelectorEngine$1.find(SELECTOR_LIST).forEach((e=>{SelectorEngine$1.find("input[type=checkbox]",e).forEach((t=>{EventHandler$1.one(t.closest("a"),EVENT_CLICK_DATA_API$7,(t=>{if(!List.getInstance(e)){t.preventDefault();List.getOrCreateInstance(e).toggleCheckbox(t.currentTarget);}}));}));}));const List$1 = List;
209
+ const NAME$j="list",EVENT_CLICK$2="click.bs.list",EVENT_CLICK_DATA_API$7="click.bs.list.data-api",SELECTOR_LIST="[data-bs-list-checkbox]";class List extends BaseComponent{constructor(e){super(e),this._init();}static get NAME(){return NAME$j}toggleCheckbox(e){const t=SelectorEngine$1.findOne("input",e);t&&(t.checked?(t.checked=!1,e.classList.remove("active")):(t.checked=!0,e.classList.add("active")));}_init(){this._initCheckbox();}_initCheckbox(){SelectorEngine$1.find("input[type=checkbox]",this._element).forEach((e=>{EventHandler$1.on(e.closest("a"),EVENT_CLICK$2,(t=>{t.preventDefault(),this.toggleCheckbox(e.closest("a"));}));}));}}SelectorEngine$1.find(SELECTOR_LIST).forEach((e=>{SelectorEngine$1.find("input[type=checkbox]",e).forEach((t=>{EventHandler$1.one(t.closest("a"),EVENT_CLICK_DATA_API$7,(t=>{if(!List.getInstance(e)){t.preventDefault();List.getOrCreateInstance(e).toggleCheckbox(t.currentTarget);}}));}));}));const List$1 = List;
208
210
 
209
- const NAME$g="transfer",EVENT_CLICK_DATA_API$6="click.bs.transfer.data-api",EVENT_KEYUP_DATA_API$1="keyup.bs.transfer.data-api",EVENT_CLICK$1="click.bs.transfer",SELECTOR_BLOCK="[data-bs-transfer]",SELECTOR_HEAD=".transfer-header",SELECTOR_HEAD_INPUT=".transfer-header input",SELECTOR_HEAD_LABEL=".transfer-header span.num",SELECTOR_LIST_INPUT=".transfer-group input",SELECTOR_SOURCE=".it-transfer-wrapper.source",SELECTOR_TARGET=".it-transfer-wrapper.target";class Transfer extends BaseComponent{constructor(e){super(e),this._addBtnElement=SelectorEngine$1.findOne("a.transfer",this._element),this._invBtnElement=SelectorEngine$1.findOne("a.backtransfer",this._element),this._resetBtnElement=SelectorEngine$1.findOne("a.reset",this._element),this._listDefault={source:SelectorEngine$1.find(SELECTOR_SOURCE+" .transfer-group .form-check",this._element),target:SelectorEngine$1.find(SELECTOR_TARGET+" .transfer-group .form-check",this._element)},this._bindEvents();}static get NAME(){return NAME$g}_bindEvents(){SelectorEngine$1.find(SELECTOR_HEAD_INPUT,this._element).forEach((e=>{EventHandler$1.on(e,EVENT_CLICK$1,(()=>{this._checkListHeader(e.closest(".it-transfer-wrapper"));}));})),SelectorEngine$1.find(SELECTOR_LIST_INPUT,this._element).forEach((e=>{EventHandler$1.on(e,EVENT_CLICK$1,(()=>{this._checkList(e.closest(".it-transfer-wrapper"));}));})),EventHandler$1.on(this._addBtnElement,EVENT_CLICK$1,(e=>{e.preventDefault(),this._disableElement(this._addBtnElement),this._addItems();})),EventHandler$1.on(this._invBtnElement,EVENT_CLICK$1,(e=>{e.preventDefault(),this._disableElement(this._invBtnElement),this._addItems(!0);})),EventHandler$1.on(this._resetBtnElement,EVENT_CLICK$1,(e=>{e.preventDefault(),this._disableElement(this._addBtnElement),this._disableElement(this._invBtnElement),this._disableElement(this._resetBtnElement),this._resetAll();}));}_disableElement(e){e.classList.remove("active"),e.setAttribute("disabled","disabled"),e.setAttribute("aria-disabled","true");}_enableElement(e){e.classList.add("active"),e.removeAttribute("disabled"),e.removeAttribute("aria-disabled");}_getScopeData(e){return {scope:e,list:SelectorEngine$1.find(SELECTOR_LIST_INPUT,e),listChecked:SelectorEngine$1.find(SELECTOR_LIST_INPUT+":checked",e),head:SelectorEngine$1.findOne(SELECTOR_HEAD,e),inputHead:SelectorEngine$1.findOne(SELECTOR_HEAD_INPUT,e),labelNumHead:SelectorEngine$1.findOne(SELECTOR_HEAD_LABEL,e),group:SelectorEngine$1.findOne(".transfer-group",e)}}_checkList(e){const t=this._getScopeData(e);0==t.listChecked.length?(t.inputHead.classList.remove("semi-checked"),t.inputHead.checked=!0,e.classList.contains("source")?this._disableElement(this._addBtnElement):this._disableElement(this._invBtnElement)):(t.listChecked.length==t.list.length?(t.inputHead.classList.remove("semi-checked"),t.inputHead.checked=!0):(t.inputHead.classList.add("semi-checked"),t.inputHead.checked=!1),e.classList.contains("source")?this._enableElement(this._addBtnElement):this._enableElement(this._invBtnElement));}_checkListHeader(e){const t=this._getScopeData(e);t.listChecked.length>0?(t.list.forEach((e=>{e.checked=!1;})),t.inputHead.classList.remove("semi-checked"),t.inputHead.checked=!1,e.classList.contains("source")?this._disableElement(this._addBtnElement):this._disableElement(this._invBtnElement)):(t.list.forEach((e=>{e.checked=!0;})),e.classList.contains("source")?this._enableElement(this._addBtnElement):this._enableElement(this._invBtnElement));}_addItems(e){const t=this._getScopeData(SelectorEngine$1.findOne(e?SELECTOR_TARGET:SELECTOR_SOURCE,this._element)),n=this._getScopeData(SelectorEngine$1.findOne(e?SELECTOR_SOURCE:SELECTOR_TARGET,this._element)),s=t.listChecked,i=t.inputHead,a=t.labelNumHead,E=s.length,r=t.list.length,l=n.group,c=n.list.length+E,_=n.labelNumHead,d=n.inputHead;s.forEach((e=>{const t=e.closest(".form-check");t.remove(),l.appendChild(t),e.checked=!1;}));const o=r-E,h=c;a.innerText=o,_.innerText=h,0==o&&i.setAttribute("disabled",!0),h>0&&d.removeAttribute("disabled"),i.classList.remove("semi-checked"),i.checked=!1,this._enableElement(this._resetBtnElement);}_resetAll(){const e={source:this._getScopeData(SelectorEngine$1.findOne(SELECTOR_SOURCE,this._element)),target:this._getScopeData(SelectorEngine$1.findOne(SELECTOR_TARGET,this._element))};Object.keys(e).forEach((t=>{e[t].list.forEach((e=>e.closest(".form-check").remove()));})),Object.keys(e).forEach((t=>{this._listDefault[t].forEach((n=>{n.checked=!1,e[t].group.appendChild(n);})),e[t].labelNumHead.innerText=this._listDefault[t].length,e[t].inputHead.removeAttribute("disabled"),e[t].inputHead.classList.remove("semi-checked"),e[t].inputHead.checked=!1;}));}}EventHandler$1.on(document,EVENT_CLICK_DATA_API$6,SELECTOR_BLOCK+" .form-check label",(function(){Transfer.getOrCreateInstance(this.closest(SELECTOR_BLOCK));})),EventHandler$1.on(document,EVENT_KEYUP_DATA_API$1,SELECTOR_BLOCK+" .form-check label",(function(){Transfer.getOrCreateInstance(this.closest(SELECTOR_BLOCK));}));const Transfer$1 = Transfer;
211
+ const NAME$i="transfer",EVENT_CLICK_DATA_API$6="click.bs.transfer.data-api",EVENT_KEYUP_DATA_API$1="keyup.bs.transfer.data-api",EVENT_CLICK$1="click.bs.transfer",SELECTOR_BLOCK="[data-bs-transfer]",SELECTOR_HEAD=".transfer-header",SELECTOR_HEAD_INPUT=".transfer-header input",SELECTOR_HEAD_LABEL=".transfer-header span.num",SELECTOR_LIST_INPUT=".transfer-group input",SELECTOR_SOURCE=".it-transfer-wrapper.source",SELECTOR_TARGET=".it-transfer-wrapper.target";class Transfer extends BaseComponent{constructor(e){super(e),this._addBtnElement=SelectorEngine$1.findOne("a.transfer",this._element),this._invBtnElement=SelectorEngine$1.findOne("a.backtransfer",this._element),this._resetBtnElement=SelectorEngine$1.findOne("a.reset",this._element),this._listDefault={source:SelectorEngine$1.find(SELECTOR_SOURCE+" .transfer-group .form-check",this._element),target:SelectorEngine$1.find(SELECTOR_TARGET+" .transfer-group .form-check",this._element)},this._bindEvents();}static get NAME(){return NAME$i}_bindEvents(){SelectorEngine$1.find(SELECTOR_HEAD_INPUT,this._element).forEach((e=>{EventHandler$1.on(e,EVENT_CLICK$1,(()=>{this._checkListHeader(e.closest(".it-transfer-wrapper"));}));})),SelectorEngine$1.find(SELECTOR_LIST_INPUT,this._element).forEach((e=>{EventHandler$1.on(e,EVENT_CLICK$1,(()=>{this._checkList(e.closest(".it-transfer-wrapper"));}));})),EventHandler$1.on(this._addBtnElement,EVENT_CLICK$1,(e=>{e.preventDefault(),this._disableElement(this._addBtnElement),this._addItems();})),EventHandler$1.on(this._invBtnElement,EVENT_CLICK$1,(e=>{e.preventDefault(),this._disableElement(this._invBtnElement),this._addItems(!0);})),EventHandler$1.on(this._resetBtnElement,EVENT_CLICK$1,(e=>{e.preventDefault(),this._disableElement(this._addBtnElement),this._disableElement(this._invBtnElement),this._disableElement(this._resetBtnElement),this._resetAll();}));}_disableElement(e){e.classList.remove("active"),e.setAttribute("disabled","disabled"),e.setAttribute("aria-disabled","true");}_enableElement(e){e.classList.add("active"),e.removeAttribute("disabled"),e.removeAttribute("aria-disabled");}_getScopeData(e){return {scope:e,list:SelectorEngine$1.find(SELECTOR_LIST_INPUT,e),listChecked:SelectorEngine$1.find(SELECTOR_LIST_INPUT+":checked",e),head:SelectorEngine$1.findOne(SELECTOR_HEAD,e),inputHead:SelectorEngine$1.findOne(SELECTOR_HEAD_INPUT,e),labelNumHead:SelectorEngine$1.findOne(SELECTOR_HEAD_LABEL,e),group:SelectorEngine$1.findOne(".transfer-group",e)}}_checkList(e){const t=this._getScopeData(e);0==t.listChecked.length?(t.inputHead.classList.remove("semi-checked"),t.inputHead.checked=!0,e.classList.contains("source")?this._disableElement(this._addBtnElement):this._disableElement(this._invBtnElement)):(t.listChecked.length==t.list.length?(t.inputHead.classList.remove("semi-checked"),t.inputHead.checked=!0):(t.inputHead.classList.add("semi-checked"),t.inputHead.checked=!1),e.classList.contains("source")?this._enableElement(this._addBtnElement):this._enableElement(this._invBtnElement));}_checkListHeader(e){const t=this._getScopeData(e);t.listChecked.length>0?(t.list.forEach((e=>{e.checked=!1;})),t.inputHead.classList.remove("semi-checked"),t.inputHead.checked=!1,e.classList.contains("source")?this._disableElement(this._addBtnElement):this._disableElement(this._invBtnElement)):(t.list.forEach((e=>{e.checked=!0;})),e.classList.contains("source")?this._enableElement(this._addBtnElement):this._enableElement(this._invBtnElement));}_addItems(e){const t=this._getScopeData(SelectorEngine$1.findOne(e?SELECTOR_TARGET:SELECTOR_SOURCE,this._element)),n=this._getScopeData(SelectorEngine$1.findOne(e?SELECTOR_SOURCE:SELECTOR_TARGET,this._element)),s=t.listChecked,i=t.inputHead,a=t.labelNumHead,E=s.length,r=t.list.length,l=n.group,c=n.list.length+E,_=n.labelNumHead,d=n.inputHead;s.forEach((e=>{const t=e.closest(".form-check");t.remove(),l.appendChild(t),e.checked=!1;}));const o=r-E,h=c;a.innerText=o,_.innerText=h,0==o&&i.setAttribute("disabled",!0),h>0&&d.removeAttribute("disabled"),i.classList.remove("semi-checked"),i.checked=!1,this._enableElement(this._resetBtnElement);}_resetAll(){const e={source:this._getScopeData(SelectorEngine$1.findOne(SELECTOR_SOURCE,this._element)),target:this._getScopeData(SelectorEngine$1.findOne(SELECTOR_TARGET,this._element))};Object.keys(e).forEach((t=>{e[t].list.forEach((e=>e.closest(".form-check").remove()));})),Object.keys(e).forEach((t=>{this._listDefault[t].forEach((n=>{n.checked=!1,e[t].group.appendChild(n);})),e[t].labelNumHead.innerText=this._listDefault[t].length,e[t].inputHead.removeAttribute("disabled"),e[t].inputHead.classList.remove("semi-checked"),e[t].inputHead.checked=!1;}));}}EventHandler$1.on(document,EVENT_CLICK_DATA_API$6,SELECTOR_BLOCK+" .form-check label",(function(){Transfer.getOrCreateInstance(this.closest(SELECTOR_BLOCK));})),EventHandler$1.on(document,EVENT_KEYUP_DATA_API$1,SELECTOR_BLOCK+" .form-check label",(function(){Transfer.getOrCreateInstance(this.closest(SELECTOR_BLOCK));}));const Transfer$1 = Transfer;
210
212
 
211
- const NAME$f="alert",EVENT_CLOSE="close.bs.alert",EVENT_CLOSED="closed.bs.alert";class Alert$2 extends BaseComponent{static get NAME(){return NAME$f}close(){if(EventHandler$1.trigger(this._element,EVENT_CLOSE).defaultPrevented)return;this._element.classList.remove("show");const e=this._element.classList.contains("fade");this._queueCallback((()=>this._destroyElement()),this._element,e);}_destroyElement(){this._element.remove(),EventHandler$1.trigger(this._element,EVENT_CLOSED),this.dispose();}static jQueryInterface(e){return this.each((function(){const t=Alert$2.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this);}}))}}enableDismissTrigger(Alert$2,"close"),defineJQueryPlugin(Alert$2);
213
+ const NAME$h="alert",EVENT_CLOSE="close.bs.alert",EVENT_CLOSED="closed.bs.alert";class Alert$2 extends BaseComponent{static get NAME(){return NAME$h}close(){if(EventHandler$1.trigger(this._element,EVENT_CLOSE).defaultPrevented)return;this._element.classList.remove("show");const e=this._element.classList.contains("fade");this._queueCallback((()=>this._destroyElement()),this._element,e);}_destroyElement(){this._element.remove(),EventHandler$1.trigger(this._element,EVENT_CLOSED),this.dispose();}static jQueryInterface(e){return this.each((function(){const t=Alert$2.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this);}}))}}enableDismissTrigger(Alert$2,"close"),defineJQueryPlugin(Alert$2);
212
214
 
213
215
  class Alert extends Alert$2{}const Alert$1 = Alert;
214
216
 
215
- const NAME$e="button",SELECTOR_DATA_TOGGLE$6='[data-bs-toggle="button"]',EVENT_CLICK_DATA_API$5="click.bs.button.data-api";class Button$2 extends BaseComponent{static get NAME(){return NAME$e}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"));}static jQueryInterface(t){return this.each((function(){const e=Button$2.getOrCreateInstance(this);"toggle"===t&&e[t]();}))}}EventHandler$1.on(document,EVENT_CLICK_DATA_API$5,SELECTOR_DATA_TOGGLE$6,(t=>{t.preventDefault();const e=t.target.closest(SELECTOR_DATA_TOGGLE$6);Button$2.getOrCreateInstance(e).toggle();})),defineJQueryPlugin(Button$2);
217
+ const NAME$g="button",SELECTOR_DATA_TOGGLE$7='[data-bs-toggle="button"]',EVENT_CLICK_DATA_API$5="click.bs.button.data-api";class Button$3 extends BaseComponent{static get NAME(){return NAME$g}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"));}static jQueryInterface(t){return this.each((function(){const e=Button$3.getOrCreateInstance(this);"toggle"===t&&e[t]();}))}}EventHandler$1.on(document,EVENT_CLICK_DATA_API$5,SELECTOR_DATA_TOGGLE$7,(t=>{t.preventDefault();const e=t.target.closest(SELECTOR_DATA_TOGGLE$7);Button$3.getOrCreateInstance(e).toggle();})),defineJQueryPlugin(Button$3);
216
218
 
217
- class Button extends Button$2{}const Button$1 = Button;
219
+ class Button$1 extends Button$3{}const Button$2 = Button$1;
218
220
 
219
- const NAME$d="swipe",EVENT_KEY$4=".bs.swipe",EVENT_TOUCHSTART="touchstart.bs.swipe",EVENT_TOUCHMOVE="touchmove.bs.swipe",EVENT_TOUCHEND="touchend.bs.swipe",EVENT_POINTERDOWN="pointerdown.bs.swipe",EVENT_POINTERUP="pointerup.bs.swipe",Default$c={endCallback:null,leftCallback:null,rightCallback:null},DefaultType$c={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class Swipe extends Config{constructor(t,e){super(),this._element=t,t&&Swipe.isSupported()&&(this._config=this._getConfig(e),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents());}static get Default(){return Default$c}static get DefaultType(){return DefaultType$c}static get NAME(){return NAME$d}dispose(){EventHandler$1.off(this._element,EVENT_KEY$4);}_start(t){this._supportPointerEvents?this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX):this._deltaX=t.touches[0].clientX;}_end(t){this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX-this._deltaX),this._handleSwipe(),execute(this._config.endCallback);}_move(t){this._deltaX=t.touches&&t.touches.length>1?0:t.touches[0].clientX-this._deltaX;}_handleSwipe(){const t=Math.abs(this._deltaX);if(t<=40)return;const e=t/this._deltaX;this._deltaX=0,e&&execute(e>0?this._config.rightCallback:this._config.leftCallback);}_initEvents(){this._supportPointerEvents?(EventHandler$1.on(this._element,EVENT_POINTERDOWN,(t=>this._start(t))),EventHandler$1.on(this._element,EVENT_POINTERUP,(t=>this._end(t))),this._element.classList.add("pointer-event")):(EventHandler$1.on(this._element,EVENT_TOUCHSTART,(t=>this._start(t))),EventHandler$1.on(this._element,EVENT_TOUCHMOVE,(t=>this._move(t))),EventHandler$1.on(this._element,EVENT_TOUCHEND,(t=>this._end(t))));}_eventIsPointerPenTouch(t){return this._supportPointerEvents&&("pen"===t.pointerType||"touch"===t.pointerType)}static isSupported(){return "ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}
221
+ const NAME$f="swipe",EVENT_KEY$4=".bs.swipe",EVENT_TOUCHSTART="touchstart.bs.swipe",EVENT_TOUCHMOVE="touchmove.bs.swipe",EVENT_TOUCHEND="touchend.bs.swipe",EVENT_POINTERDOWN="pointerdown.bs.swipe",EVENT_POINTERUP="pointerup.bs.swipe",Default$d={endCallback:null,leftCallback:null,rightCallback:null},DefaultType$c={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class Swipe extends Config$1{constructor(t,e){super(),this._element=t,t&&Swipe.isSupported()&&(this._config=this._getConfig(e),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents());}static get Default(){return Default$d}static get DefaultType(){return DefaultType$c}static get NAME(){return NAME$f}dispose(){EventHandler$1.off(this._element,EVENT_KEY$4);}_start(t){this._supportPointerEvents?this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX):this._deltaX=t.touches[0].clientX;}_end(t){this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX-this._deltaX),this._handleSwipe(),execute(this._config.endCallback);}_move(t){this._deltaX=t.touches&&t.touches.length>1?0:t.touches[0].clientX-this._deltaX;}_handleSwipe(){const t=Math.abs(this._deltaX);if(t<=40)return;const e=t/this._deltaX;this._deltaX=0,e&&execute(e>0?this._config.rightCallback:this._config.leftCallback);}_initEvents(){this._supportPointerEvents?(EventHandler$1.on(this._element,EVENT_POINTERDOWN,(t=>this._start(t))),EventHandler$1.on(this._element,EVENT_POINTERUP,(t=>this._end(t))),this._element.classList.add("pointer-event")):(EventHandler$1.on(this._element,EVENT_TOUCHSTART,(t=>this._start(t))),EventHandler$1.on(this._element,EVENT_TOUCHMOVE,(t=>this._move(t))),EventHandler$1.on(this._element,EVENT_TOUCHEND,(t=>this._end(t))));}_eventIsPointerPenTouch(t){return this._supportPointerEvents&&("pen"===t.pointerType||"touch"===t.pointerType)}static isSupported(){return "ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}
220
222
 
221
- const NAME$c="carousel",EVENT_SLIDE="slide.bs.carousel",EVENT_SLID="slid.bs.carousel",EVENT_KEYDOWN$1="keydown.bs.carousel",EVENT_MOUSEENTER="mouseenter.bs.carousel",EVENT_MOUSELEAVE="mouseleave.bs.carousel",EVENT_DRAG_START="dragstart.bs.carousel",EVENT_LOAD_DATA_API$2="load.bs.carousel.data-api",EVENT_CLICK_DATA_API$4="click.bs.carousel.data-api",CLASS_NAME_END="carousel-item-end",CLASS_NAME_START="carousel-item-start",CLASS_NAME_NEXT="carousel-item-next",CLASS_NAME_PREV="carousel-item-prev",SELECTOR_ITEM=".carousel-item",SELECTOR_ACTIVE_ITEM=".active.carousel-item",SELECTOR_ITEM_IMG=".carousel-item img",SELECTOR_INDICATORS=".carousel-indicators",SELECTOR_DATA_SLIDE="[data-bs-slide], [data-bs-slide-to]",SELECTOR_DATA_RIDE='[data-bs-ride="carousel"]',KEY_TO_DIRECTION={ArrowLeft:"right",ArrowRight:"left"},Default$b={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},DefaultType$b={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class Carousel$2 extends BaseComponent{constructor(e,t){super(e,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=SelectorEngine$1.findOne(SELECTOR_INDICATORS,this._element),this._addEventListeners(),"carousel"===this._config.ride&&this.cycle();}static get Default(){return Default$b}static get DefaultType(){return DefaultType$b}static get NAME(){return NAME$c}next(){this._slide("next");}nextWhenVisible(){!document.hidden&&isVisible(this._element)&&this.next();}prev(){this._slide("prev");}pause(){this._isSliding&&triggerTransitionEnd(this._element),this._clearInterval();}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval((()=>this.nextWhenVisible()),this._config.interval);}_maybeEnableCycle(){this._config.ride&&(this._isSliding?EventHandler$1.one(this._element,EVENT_SLID,(()=>this.cycle())):this.cycle());}to(e){const t=this._getItems();if(e>t.length-1||e<0)return;if(this._isSliding)return void EventHandler$1.one(this._element,EVENT_SLID,(()=>this.to(e)));const i=this._getItemIndex(this._getActive());if(i===e)return;const s=e>i?"next":"prev";this._slide(s,t[e]);}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose();}_configAfterMerge(e){return e.defaultInterval=e.interval,e}_addEventListeners(){this._config.keyboard&&EventHandler$1.on(this._element,EVENT_KEYDOWN$1,(e=>this._keydown(e))),"hover"===this._config.pause&&(EventHandler$1.on(this._element,EVENT_MOUSEENTER,(()=>this.pause())),EventHandler$1.on(this._element,EVENT_MOUSELEAVE,(()=>this._maybeEnableCycle()))),this._config.touch&&Swipe.isSupported()&&this._addTouchEventListeners();}_addTouchEventListeners(){for(const e of SelectorEngine$1.find(SELECTOR_ITEM_IMG,this._element))EventHandler$1.on(e,EVENT_DRAG_START,(e=>e.preventDefault()));const e={leftCallback:()=>this._slide(this._directionToOrder("left")),rightCallback:()=>this._slide(this._directionToOrder("right")),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout((()=>this._maybeEnableCycle()),500+this._config.interval));}};this._swipeHelper=new Swipe(this._element,e);}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;const t=KEY_TO_DIRECTION[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)));}_getItemIndex(e){return this._getItems().indexOf(e)}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;const t=SelectorEngine$1.findOne(".active",this._indicatorsElement);t.classList.remove("active"),t.removeAttribute("aria-current");const i=SelectorEngine$1.findOne(`[data-bs-slide-to="${e}"]`,this._indicatorsElement);i&&(i.classList.add("active"),i.setAttribute("aria-current","true"));}_updateInterval(){const e=this._activeElement||this._getActive();if(!e)return;const t=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval;}_slide(e,t=null){if(this._isSliding)return;const i=this._getActive(),s="next"===e,n=t||getNextActiveElement(this._getItems(),i,s,this._config.wrap);if(n===i)return;const r=this._getItemIndex(n),a=t=>EventHandler$1.trigger(this._element,t,{relatedTarget:n,direction:this._orderToDirection(e),from:this._getItemIndex(i),to:r});if(a(EVENT_SLIDE).defaultPrevented)return;if(!i||!n)return;const l=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(r),this._activeElement=n;const o=s?CLASS_NAME_START:CLASS_NAME_END,_=s?CLASS_NAME_NEXT:CLASS_NAME_PREV;n.classList.add(_),reflow(n),i.classList.add(o),n.classList.add(o);this._queueCallback((()=>{n.classList.remove(o,_),n.classList.add("active"),i.classList.remove("active",_,o),this._isSliding=!1,a(EVENT_SLID);}),i,this._isAnimated()),l&&this.cycle();}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return SelectorEngine$1.findOne(SELECTOR_ACTIVE_ITEM,this._element)}_getItems(){return SelectorEngine$1.find(SELECTOR_ITEM,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null);}_directionToOrder(e){return isRTL()?"left"===e?"prev":"next":"left"===e?"next":"prev"}_orderToDirection(e){return isRTL()?"prev"===e?"left":"right":"prev"===e?"right":"left"}static jQueryInterface(e){return this.each((function(){const t=Carousel$2.getOrCreateInstance(this,e);if("number"!=typeof e){if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]();}}else t.to(e);}))}}EventHandler$1.on(document,EVENT_CLICK_DATA_API$4,SELECTOR_DATA_SLIDE,(function(e){const t=getElementFromSelector(this);if(!t||!t.classList.contains("carousel"))return;e.preventDefault();const i=Carousel$2.getOrCreateInstance(t),s=this.getAttribute("data-bs-slide-to");return s?(i.to(s),void i._maybeEnableCycle()):"next"===Manipulator.getDataAttribute(this,"slide")?(i.next(),void i._maybeEnableCycle()):(i.prev(),void i._maybeEnableCycle())})),EventHandler$1.on(window,EVENT_LOAD_DATA_API$2,(()=>{const e=SelectorEngine$1.find(SELECTOR_DATA_RIDE);for(const t of e)Carousel$2.getOrCreateInstance(t);})),defineJQueryPlugin(Carousel$2);
223
+ const NAME$e="carousel",EVENT_SLIDE="slide.bs.carousel",EVENT_SLID="slid.bs.carousel",EVENT_KEYDOWN$1="keydown.bs.carousel",EVENT_MOUSEENTER="mouseenter.bs.carousel",EVENT_MOUSELEAVE="mouseleave.bs.carousel",EVENT_DRAG_START="dragstart.bs.carousel",EVENT_LOAD_DATA_API$2="load.bs.carousel.data-api",EVENT_CLICK_DATA_API$4="click.bs.carousel.data-api",CLASS_NAME_END="carousel-item-end",CLASS_NAME_START="carousel-item-start",CLASS_NAME_NEXT="carousel-item-next",CLASS_NAME_PREV="carousel-item-prev",SELECTOR_ITEM=".carousel-item",SELECTOR_ACTIVE_ITEM=".active.carousel-item",SELECTOR_ITEM_IMG=".carousel-item img",SELECTOR_INDICATORS=".carousel-indicators",SELECTOR_DATA_SLIDE="[data-bs-slide], [data-bs-slide-to]",SELECTOR_DATA_RIDE='[data-bs-ride="carousel"]',KEY_TO_DIRECTION={ArrowLeft:"right",ArrowRight:"left"},Default$c={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},DefaultType$b={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class Carousel$2 extends BaseComponent{constructor(e,t){super(e,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=SelectorEngine$1.findOne(SELECTOR_INDICATORS,this._element),this._addEventListeners(),"carousel"===this._config.ride&&this.cycle();}static get Default(){return Default$c}static get DefaultType(){return DefaultType$b}static get NAME(){return NAME$e}next(){this._slide("next");}nextWhenVisible(){!document.hidden&&isVisible(this._element)&&this.next();}prev(){this._slide("prev");}pause(){this._isSliding&&triggerTransitionEnd(this._element),this._clearInterval();}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval((()=>this.nextWhenVisible()),this._config.interval);}_maybeEnableCycle(){this._config.ride&&(this._isSliding?EventHandler$1.one(this._element,EVENT_SLID,(()=>this.cycle())):this.cycle());}to(e){const t=this._getItems();if(e>t.length-1||e<0)return;if(this._isSliding)return void EventHandler$1.one(this._element,EVENT_SLID,(()=>this.to(e)));const i=this._getItemIndex(this._getActive());if(i===e)return;const s=e>i?"next":"prev";this._slide(s,t[e]);}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose();}_configAfterMerge(e){return e.defaultInterval=e.interval,e}_addEventListeners(){this._config.keyboard&&EventHandler$1.on(this._element,EVENT_KEYDOWN$1,(e=>this._keydown(e))),"hover"===this._config.pause&&(EventHandler$1.on(this._element,EVENT_MOUSEENTER,(()=>this.pause())),EventHandler$1.on(this._element,EVENT_MOUSELEAVE,(()=>this._maybeEnableCycle()))),this._config.touch&&Swipe.isSupported()&&this._addTouchEventListeners();}_addTouchEventListeners(){for(const e of SelectorEngine$1.find(SELECTOR_ITEM_IMG,this._element))EventHandler$1.on(e,EVENT_DRAG_START,(e=>e.preventDefault()));const e={leftCallback:()=>this._slide(this._directionToOrder("left")),rightCallback:()=>this._slide(this._directionToOrder("right")),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout((()=>this._maybeEnableCycle()),500+this._config.interval));}};this._swipeHelper=new Swipe(this._element,e);}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;const t=KEY_TO_DIRECTION[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)));}_getItemIndex(e){return this._getItems().indexOf(e)}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;const t=SelectorEngine$1.findOne(".active",this._indicatorsElement);t.classList.remove("active"),t.removeAttribute("aria-current");const i=SelectorEngine$1.findOne(`[data-bs-slide-to="${e}"]`,this._indicatorsElement);i&&(i.classList.add("active"),i.setAttribute("aria-current","true"));}_updateInterval(){const e=this._activeElement||this._getActive();if(!e)return;const t=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval;}_slide(e,t=null){if(this._isSliding)return;const i=this._getActive(),s="next"===e,n=t||getNextActiveElement(this._getItems(),i,s,this._config.wrap);if(n===i)return;const r=this._getItemIndex(n),a=t=>EventHandler$1.trigger(this._element,t,{relatedTarget:n,direction:this._orderToDirection(e),from:this._getItemIndex(i),to:r});if(a(EVENT_SLIDE).defaultPrevented)return;if(!i||!n)return;const l=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(r),this._activeElement=n;const o=s?CLASS_NAME_START:CLASS_NAME_END,_=s?CLASS_NAME_NEXT:CLASS_NAME_PREV;n.classList.add(_),reflow(n),i.classList.add(o),n.classList.add(o);this._queueCallback((()=>{n.classList.remove(o,_),n.classList.add("active"),i.classList.remove("active",_,o),this._isSliding=!1,a(EVENT_SLID);}),i,this._isAnimated()),l&&this.cycle();}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return SelectorEngine$1.findOne(SELECTOR_ACTIVE_ITEM,this._element)}_getItems(){return SelectorEngine$1.find(SELECTOR_ITEM,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null);}_directionToOrder(e){return isRTL()?"left"===e?"prev":"next":"left"===e?"next":"prev"}_orderToDirection(e){return isRTL()?"prev"===e?"left":"right":"prev"===e?"right":"left"}static jQueryInterface(e){return this.each((function(){const t=Carousel$2.getOrCreateInstance(this,e);if("number"!=typeof e){if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]();}}else t.to(e);}))}}EventHandler$1.on(document,EVENT_CLICK_DATA_API$4,SELECTOR_DATA_SLIDE,(function(e){const t=getElementFromSelector(this);if(!t||!t.classList.contains("carousel"))return;e.preventDefault();const i=Carousel$2.getOrCreateInstance(t),s=this.getAttribute("data-bs-slide-to");return s?(i.to(s),void i._maybeEnableCycle()):"next"===Manipulator.getDataAttribute(this,"slide")?(i.next(),void i._maybeEnableCycle()):(i.prev(),void i._maybeEnableCycle())})),EventHandler$1.on(window,EVENT_LOAD_DATA_API$2,(()=>{const e=SelectorEngine$1.find(SELECTOR_DATA_RIDE);for(const t of e)Carousel$2.getOrCreateInstance(t);})),defineJQueryPlugin(Carousel$2);
222
224
 
223
225
  class Carousel extends Carousel$2{}const Carousel$1 = Carousel;
224
226
 
225
- const NAME$b="collapse",EVENT_SHOW$5="show.bs.collapse",EVENT_SHOWN$5="shown.bs.collapse",EVENT_HIDE$5="hide.bs.collapse",EVENT_HIDDEN$5="hidden.bs.collapse",EVENT_CLICK_DATA_API$3="click.bs.collapse.data-api",CLASS_NAME_DEEPER_CHILDREN=":scope .collapse .collapse",WIDTH="width",HEIGHT="height",SELECTOR_ACTIVES=".collapse.show, .collapse.collapsing",SELECTOR_DATA_TOGGLE$5='[data-bs-toggle="collapse"]',Default$a={parent:null,toggle:!0},DefaultType$a={parent:"(null|element)",toggle:"boolean"};class Collapse$2 extends BaseComponent{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];const s=SelectorEngine$1.find(SELECTOR_DATA_TOGGLE$5);for(const e of s){const t=getSelectorFromElement(e),s=SelectorEngine$1.find(t).filter((e=>e===this._element));null!==t&&s.length&&this._triggerArray.push(e);}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle();}static get Default(){return Default$a}static get DefaultType(){return DefaultType$a}static get NAME(){return NAME$b}toggle(){this._isShown()?this.hide():this.show();}show(){if(this._isTransitioning||this._isShown())return;let e=[];if(this._config.parent&&(e=this._getFirstLevelChildren(SELECTOR_ACTIVES).filter((e=>e!==this._element)).map((e=>Collapse$2.getOrCreateInstance(e,{toggle:!1})))),e.length&&e[0]._isTransitioning)return;if(EventHandler$1.trigger(this._element,EVENT_SHOW$5).defaultPrevented)return;for(const t of e)t.hide();const t=this._getDimension();this._element.classList.remove("collapse"),this._element.classList.add("collapsing"),this._element.style[t]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const s=`scroll${t[0].toUpperCase()+t.slice(1)}`;this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove("collapsing"),this._element.classList.add("collapse","show"),this._element.style[t]="",EventHandler$1.trigger(this._element,EVENT_SHOWN$5);}),this._element,!0),this._element.style[t]=`${this._element[s]}px`;}hide(){if(this._isTransitioning||!this._isShown())return;if(EventHandler$1.trigger(this._element,EVENT_HIDE$5).defaultPrevented)return;const e=this._getDimension();this._element.style[e]=`${this._element.getBoundingClientRect()[e]}px`,reflow(this._element),this._element.classList.add("collapsing"),this._element.classList.remove("collapse","show");for(const e of this._triggerArray){const t=getElementFromSelector(e);t&&!this._isShown(t)&&this._addAriaAndCollapsedClass([e],!1);}this._isTransitioning=!0;this._element.style[e]="",this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove("collapsing"),this._element.classList.add("collapse"),EventHandler$1.trigger(this._element,EVENT_HIDDEN$5);}),this._element,!0);}_isShown(e=this._element){return e.classList.contains("show")}_configAfterMerge(e){return e.toggle=Boolean(e.toggle),e.parent=getElement(e.parent),e}_getDimension(){return this._element.classList.contains("collapse-horizontal")?WIDTH:HEIGHT}_initializeChildren(){if(!this._config.parent)return;const e=this._getFirstLevelChildren(SELECTOR_DATA_TOGGLE$5);for(const t of e){const e=getElementFromSelector(t);e&&this._addAriaAndCollapsedClass([t],this._isShown(e));}}_getFirstLevelChildren(e){const t=SelectorEngine$1.find(CLASS_NAME_DEEPER_CHILDREN,this._config.parent);return SelectorEngine$1.find(e,this._config.parent).filter((e=>!t.includes(e)))}_addAriaAndCollapsedClass(e,t){if(e.length)for(const s of e)s.classList.toggle("collapsed",!t),s.setAttribute("aria-expanded",t);}static jQueryInterface(e){const t={};return "string"==typeof e&&/show|hide/.test(e)&&(t.toggle=!1),this.each((function(){const s=Collapse$2.getOrCreateInstance(this,t);if("string"==typeof e){if(void 0===s[e])throw new TypeError(`No method named "${e}"`);s[e]();}}))}}EventHandler$1.on(document,EVENT_CLICK_DATA_API$3,SELECTOR_DATA_TOGGLE$5,(function(e){("A"===e.target.tagName||e.delegateTarget&&"A"===e.delegateTarget.tagName)&&e.preventDefault();const t=getSelectorFromElement(this),s=SelectorEngine$1.find(t);for(const e of s)Collapse$2.getOrCreateInstance(e,{toggle:!1}).toggle();})),defineJQueryPlugin(Collapse$2);
227
+ const NAME$d="collapse",EVENT_SHOW$5="show.bs.collapse",EVENT_SHOWN$5="shown.bs.collapse",EVENT_HIDE$5="hide.bs.collapse",EVENT_HIDDEN$5="hidden.bs.collapse",EVENT_CLICK_DATA_API$3="click.bs.collapse.data-api",CLASS_NAME_DEEPER_CHILDREN=":scope .collapse .collapse",WIDTH="width",HEIGHT="height",SELECTOR_ACTIVES=".collapse.show, .collapse.collapsing",SELECTOR_DATA_TOGGLE$6='[data-bs-toggle="collapse"]',Default$b={parent:null,toggle:!0},DefaultType$a={parent:"(null|element)",toggle:"boolean"};class Collapse$2 extends BaseComponent{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];const s=SelectorEngine$1.find(SELECTOR_DATA_TOGGLE$6);for(const e of s){const t=getSelectorFromElement(e),s=SelectorEngine$1.find(t).filter((e=>e===this._element));null!==t&&s.length&&this._triggerArray.push(e);}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle();}static get Default(){return Default$b}static get DefaultType(){return DefaultType$a}static get NAME(){return NAME$d}toggle(){this._isShown()?this.hide():this.show();}show(){if(this._isTransitioning||this._isShown())return;let e=[];if(this._config.parent&&(e=this._getFirstLevelChildren(SELECTOR_ACTIVES).filter((e=>e!==this._element)).map((e=>Collapse$2.getOrCreateInstance(e,{toggle:!1})))),e.length&&e[0]._isTransitioning)return;if(EventHandler$1.trigger(this._element,EVENT_SHOW$5).defaultPrevented)return;for(const t of e)t.hide();const t=this._getDimension();this._element.classList.remove("collapse"),this._element.classList.add("collapsing"),this._element.style[t]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const s=`scroll${t[0].toUpperCase()+t.slice(1)}`;this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove("collapsing"),this._element.classList.add("collapse","show"),this._element.style[t]="",EventHandler$1.trigger(this._element,EVENT_SHOWN$5);}),this._element,!0),this._element.style[t]=`${this._element[s]}px`;}hide(){if(this._isTransitioning||!this._isShown())return;if(EventHandler$1.trigger(this._element,EVENT_HIDE$5).defaultPrevented)return;const e=this._getDimension();this._element.style[e]=`${this._element.getBoundingClientRect()[e]}px`,reflow(this._element),this._element.classList.add("collapsing"),this._element.classList.remove("collapse","show");for(const e of this._triggerArray){const t=getElementFromSelector(e);t&&!this._isShown(t)&&this._addAriaAndCollapsedClass([e],!1);}this._isTransitioning=!0;this._element.style[e]="",this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove("collapsing"),this._element.classList.add("collapse"),EventHandler$1.trigger(this._element,EVENT_HIDDEN$5);}),this._element,!0);}_isShown(e=this._element){return e.classList.contains("show")}_configAfterMerge(e){return e.toggle=Boolean(e.toggle),e.parent=getElement(e.parent),e}_getDimension(){return this._element.classList.contains("collapse-horizontal")?WIDTH:HEIGHT}_initializeChildren(){if(!this._config.parent)return;const e=this._getFirstLevelChildren(SELECTOR_DATA_TOGGLE$6);for(const t of e){const e=getElementFromSelector(t);e&&this._addAriaAndCollapsedClass([t],this._isShown(e));}}_getFirstLevelChildren(e){const t=SelectorEngine$1.find(CLASS_NAME_DEEPER_CHILDREN,this._config.parent);return SelectorEngine$1.find(e,this._config.parent).filter((e=>!t.includes(e)))}_addAriaAndCollapsedClass(e,t){if(e.length)for(const s of e)s.classList.toggle("collapsed",!t),s.setAttribute("aria-expanded",t);}static jQueryInterface(e){const t={};return "string"==typeof e&&/show|hide/.test(e)&&(t.toggle=!1),this.each((function(){const s=Collapse$2.getOrCreateInstance(this,t);if("string"==typeof e){if(void 0===s[e])throw new TypeError(`No method named "${e}"`);s[e]();}}))}}EventHandler$1.on(document,EVENT_CLICK_DATA_API$3,SELECTOR_DATA_TOGGLE$6,(function(e){("A"===e.target.tagName||e.delegateTarget&&"A"===e.delegateTarget.tagName)&&e.preventDefault();const t=getSelectorFromElement(this),s=SelectorEngine$1.find(t);for(const e of s)Collapse$2.getOrCreateInstance(e,{toggle:!1}).toggle();})),defineJQueryPlugin(Collapse$2);
226
228
 
227
229
  class Collapse extends Collapse$2{}const Collapse$1 = Collapse;
228
230
 
@@ -244,9 +246,9 @@
244
246
 
245
247
  function isLayoutViewport(){return !/^((?!chrome|android).)*safari/i.test(getUAString())}
246
248
 
247
- function getBoundingClientRect(t,i,e){void 0===i&&(i=!1),void 0===e&&(e=!1);var o=t.getBoundingClientRect(),n=1,r=1;i&&isHTMLElement(t)&&(n=t.offsetWidth>0&&round(o.width)/t.offsetWidth||1,r=t.offsetHeight>0&&round(o.height)/t.offsetHeight||1);var f=(isElement(t)?getWindow(t):window).visualViewport,s=!isLayoutViewport()&&e,d=(o.left+(s&&f?f.offsetLeft:0))/n,p=(o.top+(s&&f?f.offsetTop:0))/r,h=o.width/n,m=o.height/r;return {width:h,height:m,top:p,right:d+h,bottom:p+m,left:d,x:d,y:p}}
249
+ function getBoundingClientRect$1(t,i,e){void 0===i&&(i=!1),void 0===e&&(e=!1);var o=t.getBoundingClientRect(),n=1,r=1;i&&isHTMLElement(t)&&(n=t.offsetWidth>0&&round(o.width)/t.offsetWidth||1,r=t.offsetHeight>0&&round(o.height)/t.offsetHeight||1);var f=(isElement(t)?getWindow(t):window).visualViewport,s=!isLayoutViewport()&&e,d=(o.left+(s&&f?f.offsetLeft:0))/n,p=(o.top+(s&&f?f.offsetTop:0))/r,h=o.width/n,m=o.height/r;return {width:h,height:m,top:p,right:d+h,bottom:p+m,left:d,x:d,y:p}}
248
250
 
249
- function getLayoutRect(t){var e=getBoundingClientRect(t),i=t.offsetWidth,o=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-o)<=1&&(o=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:o}}
251
+ function getLayoutRect(t){var e=getBoundingClientRect$1(t),i=t.offsetWidth,o=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-o)<=1&&(o=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:o}}
250
252
 
251
253
  function contains(o,t){var e=t.getRootNode&&t.getRootNode();if(o.contains(t))return !0;if(e&&isShadowRoot(e)){var i=t;do{if(i&&o.isSameNode(i))return !0;i=i.parentNode||i.host;}while(i)}return !1}
252
254
 
@@ -284,7 +286,7 @@
284
286
 
285
287
  function getWindowScroll(e){var o=getWindow(e);return {scrollLeft:o.pageXOffset,scrollTop:o.pageYOffset}}
286
288
 
287
- function getWindowScrollBarX(e){return getBoundingClientRect(getDocumentElement(e)).left+getWindowScroll(e).scrollLeft}
289
+ function getWindowScrollBarX(e){return getBoundingClientRect$1(getDocumentElement(e)).left+getWindowScroll(e).scrollLeft}
288
290
 
289
291
  function getViewportRect(t,e){var o=getWindow(t),i=getDocumentElement(t),r=o.visualViewport,n=i.clientWidth,l=i.clientHeight,m=0,p=0;if(r){n=r.width,l=r.height;var g=isLayoutViewport();(g||!g&&"fixed"===e)&&(m=r.offsetLeft,p=r.offsetTop);}return {width:n,height:l,x:m+getWindowScrollBarX(t),y:p}}
290
292
 
@@ -298,11 +300,11 @@
298
300
 
299
301
  function rectToClientRect(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}
300
302
 
301
- function getInnerBoundingClientRect(t,e){var o=getBoundingClientRect(t,!1,"fixed"===e);return o.top=o.top+t.clientTop,o.left=o.left+t.clientLeft,o.bottom=o.top+t.clientHeight,o.right=o.left+t.clientWidth,o.width=t.clientWidth,o.height=t.clientHeight,o.x=o.left,o.y=o.top,o}function getClientRectFromMixedType(t,e,o){return e===viewport?rectToClientRect(getViewportRect(t,o)):isElement(e)?getInnerBoundingClientRect(e,o):rectToClientRect(getDocumentRect(getDocumentElement(t)))}function getClippingParents(t){var e=listScrollParents(getParentNode(t)),o=["absolute","fixed"].indexOf(getComputedStyle$1(t).position)>=0&&isHTMLElement(t)?getOffsetParent(t):t;return isElement(o)?e.filter((function(t){return isElement(t)&&contains(t,o)&&"body"!==getNodeName(t)})):[]}function getClippingRect(t,e,o,n){var i="clippingParents"===e?getClippingParents(t):[].concat(e),r=[].concat(i,[o]),m=r[0],l=r.reduce((function(e,o){var i=getClientRectFromMixedType(t,o,n);return e.top=max(i.top,e.top),e.right=min(i.right,e.right),e.bottom=min(i.bottom,e.bottom),e.left=max(i.left,e.left),e}),getClientRectFromMixedType(t,m,n));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}
303
+ function getInnerBoundingClientRect(t,e){var o=getBoundingClientRect$1(t,!1,"fixed"===e);return o.top=o.top+t.clientTop,o.left=o.left+t.clientLeft,o.bottom=o.top+t.clientHeight,o.right=o.left+t.clientWidth,o.width=t.clientWidth,o.height=t.clientHeight,o.x=o.left,o.y=o.top,o}function getClientRectFromMixedType(t,e,o){return e===viewport?rectToClientRect(getViewportRect(t,o)):isElement(e)?getInnerBoundingClientRect(e,o):rectToClientRect(getDocumentRect(getDocumentElement(t)))}function getClippingParents(t){var e=listScrollParents(getParentNode(t)),o=["absolute","fixed"].indexOf(getComputedStyle$1(t).position)>=0&&isHTMLElement(t)?getOffsetParent(t):t;return isElement(o)?e.filter((function(t){return isElement(t)&&contains(t,o)&&"body"!==getNodeName(t)})):[]}function getClippingRect(t,e,o,n){var i="clippingParents"===e?getClippingParents(t):[].concat(e),r=[].concat(i,[o]),m=r[0],l=r.reduce((function(e,o){var i=getClientRectFromMixedType(t,o,n);return e.top=max(i.top,e.top),e.right=min(i.right,e.right),e.bottom=min(i.bottom,e.bottom),e.left=max(i.left,e.left),e}),getClientRectFromMixedType(t,m,n));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}
302
304
 
303
305
  function computeOffsets(e){var t,a=e.reference,i=e.element,r=e.placement,n=r?getBasePlacement(r):null,o=r?getVariation(r):null,s=a.x+a.width/2-i.width/2,m=a.y+a.height/2-i.height/2;switch(n){case top:t={x:s,y:a.y-i.height};break;case bottom:t={x:s,y:a.y+a.height};break;case right:t={x:a.x+a.width,y:m};break;case left:t={x:a.x-i.width,y:m};break;default:t={x:a.x,y:a.y};}var l=n?getMainAxisFromPlacement(n):null;if(null!=l){var c="y"===l?"height":"width";switch(o){case start:t[l]=t[l]-(a[c]/2-i[c]/2);break;case end:t[l]=t[l]+(a[c]/2-i[c]/2);}}return t}
304
306
 
305
- function detectOverflow(e,t){void 0===t&&(t={});var o=t,r=o.placement,p=void 0===r?e.placement:r,n=o.strategy,i=void 0===n?e.strategy:n,m=o.boundary,s=void 0===m?clippingParents:m,c=o.rootBoundary,l=void 0===c?viewport:c,a=o.elementContext,f=void 0===a?popper:a,g=o.altBoundary,d=void 0!==g&&g,u=o.padding,b=void 0===u?0:u,j=mergePaddingObject("number"!=typeof b?b:expandToHashMap(b,basePlacements)),v=f===popper?reference:popper,O=e.rects.popper,h=e.elements[d?v:f],C=getClippingRect(isElement(h)?h:h.contextElement||getDocumentElement(e.elements.popper),s,l,i),x=getBoundingClientRect(e.elements.reference),y=computeOffsets({reference:x,element:O,strategy:"absolute",placement:p}),R=rectToClientRect(Object.assign({},O,y)),E=f===popper?R:x,P={top:C.top-E.top+j.top,bottom:E.bottom-C.bottom+j.bottom,left:C.left-E.left+j.left,right:E.right-C.right+j.right},T=e.modifiersData.offset;if(f===popper&&T){var B=T[p];Object.keys(P).forEach((function(e){var t=[right,bottom].indexOf(e)>=0?1:-1,o=[top,bottom].indexOf(e)>=0?"y":"x";P[e]+=B[o]*t;}));}return P}
307
+ function detectOverflow(e,t){void 0===t&&(t={});var o=t,r=o.placement,p=void 0===r?e.placement:r,n=o.strategy,i=void 0===n?e.strategy:n,m=o.boundary,s=void 0===m?clippingParents:m,c=o.rootBoundary,l=void 0===c?viewport:c,a=o.elementContext,f=void 0===a?popper:a,g=o.altBoundary,d=void 0!==g&&g,u=o.padding,b=void 0===u?0:u,j=mergePaddingObject("number"!=typeof b?b:expandToHashMap(b,basePlacements)),v=f===popper?reference:popper,O=e.rects.popper,h=e.elements[d?v:f],C=getClippingRect(isElement(h)?h:h.contextElement||getDocumentElement(e.elements.popper),s,l,i),x=getBoundingClientRect$1(e.elements.reference),y=computeOffsets({reference:x,element:O,strategy:"absolute",placement:p}),R=rectToClientRect(Object.assign({},O,y)),E=f===popper?R:x,P={top:C.top-E.top+j.top,bottom:E.bottom-C.bottom+j.bottom,left:C.left-E.left+j.left,right:E.right-C.right+j.right},T=e.modifiersData.offset;if(f===popper&&T){var B=T[p];Object.keys(P).forEach((function(e){var t=[right,bottom].indexOf(e)>=0?1:-1,o=[top,bottom].indexOf(e)>=0?"y":"x";P[e]+=B[o]*t;}));}return P}
306
308
 
307
309
  function computeAutoPlacement(e,t){void 0===t&&(t={});var o=t,a=o.placement,n=o.boundary,r=o.rootBoundary,l=o.padding,i=o.flipVariations,s=o.allowedAutoPlacements,c=void 0===s?placements:s,m=getVariation(a),u=m?i?variationPlacements:variationPlacements.filter((function(e){return getVariation(e)===m})):basePlacements,p=u.filter((function(e){return c.indexOf(e)>=0}));0===p.length&&(p=u,"production"!==process.env.NODE_ENV&&console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")));var d=p.reduce((function(t,o){return t[o]=detectOverflow(e,{placement:o,boundary:n,rootBoundary:r,padding:l})[getBasePlacement(o)],t}),{});return Object.keys(d).sort((function(e,t){return d[e]-d[t]}))}
308
310
 
@@ -322,11 +324,11 @@
322
324
 
323
325
  function getNodeScroll(e){return e!==getWindow(e)&&isHTMLElement(e)?getHTMLElementScroll(e):getWindowScroll(e)}
324
326
 
325
- function isElementScaled(e){var t=e.getBoundingClientRect(),o=round(t.width)/e.offsetWidth||1,l=round(t.height)/e.offsetHeight||1;return 1!==o||1!==l}function getCompositeRect(e,t,o){void 0===o&&(o=!1);var l=isHTMLElement(t),i=isHTMLElement(t)&&isElementScaled(t),n=getDocumentElement(t),r=getBoundingClientRect(e,i,o),m={scrollLeft:0,scrollTop:0},c={x:0,y:0};return (l||!l&&!o)&&(("body"!==getNodeName(t)||isScrollParent(n))&&(m=getNodeScroll(t)),isHTMLElement(t)?((c=getBoundingClientRect(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):n&&(c.x=getWindowScrollBarX(n))),{x:r.left+m.scrollLeft-c.x,y:r.top+m.scrollTop-c.y,width:r.width,height:r.height}}
327
+ function isElementScaled(e){var t=e.getBoundingClientRect(),o=round(t.width)/e.offsetWidth||1,l=round(t.height)/e.offsetHeight||1;return 1!==o||1!==l}function getCompositeRect(e,t,o){void 0===o&&(o=!1);var l=isHTMLElement(t),i=isHTMLElement(t)&&isElementScaled(t),n=getDocumentElement(t),r=getBoundingClientRect$1(e,i,o),m={scrollLeft:0,scrollTop:0},c={x:0,y:0};return (l||!l&&!o)&&(("body"!==getNodeName(t)||isScrollParent(n))&&(m=getNodeScroll(t)),isHTMLElement(t)?((c=getBoundingClientRect$1(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):n&&(c.x=getWindowScrollBarX(n))),{x:r.left+m.scrollLeft-c.x,y:r.top+m.scrollTop-c.y,width:r.width,height:r.height}}
326
328
 
327
329
  function order(r){var e=new Map,n=new Set,o=[];function t(r){n.add(r.name),[].concat(r.requires||[],r.requiresIfExists||[]).forEach((function(r){if(!n.has(r)){var o=e.get(r);o&&t(o);}})),o.push(r);}return r.forEach((function(r){e.set(r.name,r);})),r.forEach((function(r){n.has(r.name)||t(r);})),o}function orderModifiers(r){var e=order(r);return modifierPhases.reduce((function(r,n){return r.concat(e.filter((function(r){return r.phase===n})))}),[])}
328
330
 
329
- function debounce(n){var e;return function(){return e||(e=new Promise((function(o){Promise.resolve().then((function(){e=void 0,o(n());}));}))),e}}
331
+ function debounce$1(n){var e;return function(){return e||(e=new Promise((function(o){Promise.resolve().then((function(){e=void 0,o(n());}));}))),e}}
330
332
 
331
333
  function format(r){for(var e=arguments.length,n=new Array(e>1?e-1:0),t=1;t<e;t++)n[t-1]=arguments[t];return [].concat(n).reduce((function(r,e){return r.replace(/%s/,e)}),r)}
332
334
 
@@ -336,7 +338,7 @@
336
338
 
337
339
  function mergeByName(e){var n=e.reduce((function(e,n){var t=e[n.name];return e[n.name]=t?Object.assign({},t,n,{options:Object.assign({},t.options,n.options),data:Object.assign({},t.data,n.data)}):n,e}),{});return Object.keys(n).map((function(e){return n[e]}))}
338
340
 
339
- var INVALID_ELEMENT_ERROR="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",INFINITE_LOOP_ERROR="Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.",DEFAULT_OPTIONS={placement:"bottom",modifiers:[],strategy:"absolute"};function areValidElements(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return !t.some((function(e){return !(e&&"function"==typeof e.getBoundingClientRect)}))}function popperGenerator(e){void 0===e&&(e={});var t=e,o=t.defaultModifiers,r=void 0===o?[]:o,n=t.defaultOptions,i=void 0===n?DEFAULT_OPTIONS:n;return function(e,t,o){void 0===o&&(o=i);var n={placement:"bottom",orderedModifiers:[],options:Object.assign({},DEFAULT_OPTIONS,i),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},s=[],a=!1,p={state:n,setOptions:function(o){var a="function"==typeof o?o(n.options):o;f(),n.options=Object.assign({},i,n.options,a),n.scrollParents={reference:isElement(e)?listScrollParents(e):e.contextElement?listScrollParents(e.contextElement):[],popper:listScrollParents(t)};var d=orderModifiers(mergeByName([].concat(r,n.options.modifiers)));if(n.orderedModifiers=d.filter((function(e){return e.enabled})),"production"!==process.env.NODE_ENV){var c=uniqueBy([].concat(d,n.options.modifiers),(function(e){return e.name}));if(validateModifiers(c),getBasePlacement(n.options.placement)===auto)n.orderedModifiers.find((function(e){return "flip"===e.name}))||console.error(['Popper: "auto" placements require the "flip" modifier be',"present and enabled to work."].join(" "));var m=getComputedStyle$1(t);[m.marginTop,m.marginRight,m.marginBottom,m.marginLeft].some((function(e){return parseFloat(e)}))&&console.warn(['Popper: CSS "margin" styles cannot be used to apply padding',"between the popper and its reference element or boundary.","To replicate margin, use the `offset` modifier, as well as","the `padding` option in the `preventOverflow` and `flip`","modifiers."].join(" "));}return n.orderedModifiers.forEach((function(e){var t=e.name,o=e.options,r=void 0===o?{}:o,i=e.effect;if("function"==typeof i){var a=i({state:n,name:t,instance:p,options:r}),f=function(){};s.push(a||f);}})),p.update()},forceUpdate:function(){if(!a){var e=n.elements,t=e.reference,o=e.popper;if(areValidElements(t,o)){n.rects={reference:getCompositeRect(t,getOffsetParent(o),"fixed"===n.options.strategy),popper:getLayoutRect(o)},n.reset=!1,n.placement=n.options.placement,n.orderedModifiers.forEach((function(e){return n.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0,i=0;i<n.orderedModifiers.length;i++){if("production"!==process.env.NODE_ENV&&(r+=1)>100){console.error(INFINITE_LOOP_ERROR);break}if(!0!==n.reset){var s=n.orderedModifiers[i],f=s.fn,d=s.options,c=void 0===d?{}:d,m=s.name;"function"==typeof f&&(n=f({state:n,options:c,name:m,instance:p})||n);}else n.reset=!1,i=-1;}}else "production"!==process.env.NODE_ENV&&console.error(INVALID_ELEMENT_ERROR);}},update:debounce((function(){return new Promise((function(e){p.forceUpdate(),e(n);}))})),destroy:function(){f(),a=!0;}};if(!areValidElements(e,t))return "production"!==process.env.NODE_ENV&&console.error(INVALID_ELEMENT_ERROR),p;function f(){s.forEach((function(e){return e()})),s=[];}return p.setOptions(o).then((function(e){!a&&o.onFirstUpdate&&o.onFirstUpdate(e);})),p}}var createPopper$2=popperGenerator();
341
+ var INVALID_ELEMENT_ERROR="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",INFINITE_LOOP_ERROR="Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.",DEFAULT_OPTIONS={placement:"bottom",modifiers:[],strategy:"absolute"};function areValidElements(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return !t.some((function(e){return !(e&&"function"==typeof e.getBoundingClientRect)}))}function popperGenerator(e){void 0===e&&(e={});var t=e,o=t.defaultModifiers,r=void 0===o?[]:o,n=t.defaultOptions,i=void 0===n?DEFAULT_OPTIONS:n;return function(e,t,o){void 0===o&&(o=i);var n={placement:"bottom",orderedModifiers:[],options:Object.assign({},DEFAULT_OPTIONS,i),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},s=[],a=!1,p={state:n,setOptions:function(o){var a="function"==typeof o?o(n.options):o;f(),n.options=Object.assign({},i,n.options,a),n.scrollParents={reference:isElement(e)?listScrollParents(e):e.contextElement?listScrollParents(e.contextElement):[],popper:listScrollParents(t)};var d=orderModifiers(mergeByName([].concat(r,n.options.modifiers)));if(n.orderedModifiers=d.filter((function(e){return e.enabled})),"production"!==process.env.NODE_ENV){var c=uniqueBy([].concat(d,n.options.modifiers),(function(e){return e.name}));if(validateModifiers(c),getBasePlacement(n.options.placement)===auto)n.orderedModifiers.find((function(e){return "flip"===e.name}))||console.error(['Popper: "auto" placements require the "flip" modifier be',"present and enabled to work."].join(" "));var m=getComputedStyle$1(t);[m.marginTop,m.marginRight,m.marginBottom,m.marginLeft].some((function(e){return parseFloat(e)}))&&console.warn(['Popper: CSS "margin" styles cannot be used to apply padding',"between the popper and its reference element or boundary.","To replicate margin, use the `offset` modifier, as well as","the `padding` option in the `preventOverflow` and `flip`","modifiers."].join(" "));}return n.orderedModifiers.forEach((function(e){var t=e.name,o=e.options,r=void 0===o?{}:o,i=e.effect;if("function"==typeof i){var a=i({state:n,name:t,instance:p,options:r}),f=function(){};s.push(a||f);}})),p.update()},forceUpdate:function(){if(!a){var e=n.elements,t=e.reference,o=e.popper;if(areValidElements(t,o)){n.rects={reference:getCompositeRect(t,getOffsetParent(o),"fixed"===n.options.strategy),popper:getLayoutRect(o)},n.reset=!1,n.placement=n.options.placement,n.orderedModifiers.forEach((function(e){return n.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0,i=0;i<n.orderedModifiers.length;i++){if("production"!==process.env.NODE_ENV&&(r+=1)>100){console.error(INFINITE_LOOP_ERROR);break}if(!0!==n.reset){var s=n.orderedModifiers[i],f=s.fn,d=s.options,c=void 0===d?{}:d,m=s.name;"function"==typeof f&&(n=f({state:n,options:c,name:m,instance:p})||n);}else n.reset=!1,i=-1;}}else "production"!==process.env.NODE_ENV&&console.error(INVALID_ELEMENT_ERROR);}},update:debounce$1((function(){return new Promise((function(e){p.forceUpdate(),e(n);}))})),destroy:function(){f(),a=!0;}};if(!areValidElements(e,t))return "production"!==process.env.NODE_ENV&&console.error(INVALID_ELEMENT_ERROR),p;function f(){s.forEach((function(e){return e()})),s=[];}return p.setOptions(o).then((function(e){!a&&o.onFirstUpdate&&o.onFirstUpdate(e);})),p}}var createPopper$2=popperGenerator();
340
342
 
341
343
  var defaultModifiers$1=[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1],createPopper$1=popperGenerator({defaultModifiers:defaultModifiers$1});
342
344
 
@@ -384,49 +386,173 @@
384
386
  preventOverflow: preventOverflow$1
385
387
  }, Symbol.toStringTag, { value: 'Module' }));
386
388
 
387
- const NAME$a="dropdown",ARROW_UP_KEY$2="ArrowUp",ARROW_DOWN_KEY$2="ArrowDown",EVENT_HIDE$4="hide.bs.dropdown",EVENT_HIDDEN$4="hidden.bs.dropdown",EVENT_SHOW$4="show.bs.dropdown",EVENT_SHOWN$4="shown.bs.dropdown",EVENT_CLICK_DATA_API$2="click.bs.dropdown.data-api",EVENT_KEYDOWN_DATA_API="keydown.bs.dropdown.data-api",EVENT_KEYUP_DATA_API="keyup.bs.dropdown.data-api",SELECTOR_DATA_TOGGLE$4='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',SELECTOR_DATA_TOGGLE_SHOWN=`${SELECTOR_DATA_TOGGLE$4}.show`,SELECTOR_MENU=".dropdown-menu",SELECTOR_VISIBLE_ITEMS=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",PLACEMENT_TOP=isRTL()?"top-end":"top-start",PLACEMENT_TOPEND=isRTL()?"top-start":"top-end",PLACEMENT_BOTTOM=isRTL()?"bottom-end":"bottom-start",PLACEMENT_BOTTOMEND=isRTL()?"bottom-start":"bottom-end",PLACEMENT_RIGHT=isRTL()?"left-start":"right-start",PLACEMENT_LEFT=isRTL()?"right-start":"left-start",Default$9={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},DefaultType$9={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class Dropdown$2 extends BaseComponent{constructor(e,t){super(e,t),this._popper=null,this._parent=this._element.parentNode,this._menu=SelectorEngine$1.next(this._element,SELECTOR_MENU)[0]||SelectorEngine$1.prev(this._element,SELECTOR_MENU)[0]||SelectorEngine$1.findOne(SELECTOR_MENU,this._parent),this._inNavbar=this._detectNavbar();}static get Default(){return Default$9}static get DefaultType(){return DefaultType$9}static get NAME(){return NAME$a}toggle(){return this._isShown()?this.hide():this.show()}show(){if(isDisabled(this._element)||this._isShown())return;const e={relatedTarget:this._element};if(!EventHandler$1.trigger(this._element,EVENT_SHOW$4,e).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav"))for(const e of [].concat(...document.body.children))EventHandler$1.on(e,"mouseover",noop);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add("show"),this._element.classList.add("show"),EventHandler$1.trigger(this._element,EVENT_SHOWN$4,e);}}hide(){if(isDisabled(this._element)||!this._isShown())return;const e={relatedTarget:this._element};this._completeHide(e);}dispose(){this._popper&&this._popper.destroy(),super.dispose();}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update();}_completeHide(e){if(!EventHandler$1.trigger(this._element,EVENT_HIDE$4,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const e of [].concat(...document.body.children))EventHandler$1.off(e,"mouseover",noop);this._popper&&this._popper.destroy(),this._menu.classList.remove("show"),this._element.classList.remove("show"),this._element.setAttribute("aria-expanded","false"),Manipulator.removeDataAttribute(this._menu,"popper"),EventHandler$1.trigger(this._element,EVENT_HIDDEN$4,e);}}_getConfig(e){if("object"==typeof(e=super._getConfig(e)).reference&&!isElement$1(e.reference)&&"function"!=typeof e.reference.getBoundingClientRect)throw new TypeError(`${NAME$a.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createPopper(){if(void 0===Popper)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let e=this._element;"parent"===this._config.reference?e=this._parent:isElement$1(this._config.reference)?e=getElement(this._config.reference):"object"==typeof this._config.reference&&(e=this._config.reference);const t=this._getPopperConfig();this._popper=createPopper(e,this._menu,t);}_isShown(){return this._menu.classList.contains("show")}_getPlacement(){const e=this._parent;if(e.classList.contains("dropend"))return PLACEMENT_RIGHT;if(e.classList.contains("dropstart"))return PLACEMENT_LEFT;if(e.classList.contains("dropup-center"))return "top";if(e.classList.contains("dropdown-center"))return "bottom";const t="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return e.classList.contains("dropup")?t?PLACEMENT_TOPEND:PLACEMENT_TOP:t?PLACEMENT_BOTTOMEND:PLACEMENT_BOTTOM}_detectNavbar(){return null!==this._element.closest(".navbar")}_getOffset(){const{offset:e}=this._config;return "string"==typeof e?e.split(",").map((e=>Number.parseInt(e,10))):"function"==typeof e?t=>e(t,this._element):e}_getPopperConfig(){const e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return (this._inNavbar||"static"===this._config.display)&&(Manipulator.setDataAttribute(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),{...e,..."function"==typeof this._config.popperConfig?this._config.popperConfig(e):this._config.popperConfig}}_selectMenuItem({key:e,target:t}){const n=SelectorEngine$1.find(SELECTOR_VISIBLE_ITEMS,this._menu).filter((e=>isVisible(e)));n.length&&getNextActiveElement(n,t,e===ARROW_DOWN_KEY$2,!n.includes(t)).focus();}static jQueryInterface(e){return this.each((function(){const t=Dropdown$2.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]();}}))}static clearMenus(e){if(2===e.button||"keyup"===e.type&&"Tab"!==e.key)return;const t=SelectorEngine$1.find(SELECTOR_DATA_TOGGLE_SHOWN);for(const n of t){const t=Dropdown$2.getInstance(n);if(!t||!1===t._config.autoClose)continue;const o=e.composedPath(),r=o.includes(t._menu);if(o.includes(t._element)||"inside"===t._config.autoClose&&!r||"outside"===t._config.autoClose&&r)continue;if(t._menu.contains(e.target)&&("keyup"===e.type&&"Tab"===e.key||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;const i={relatedTarget:t._element};"click"===e.type&&(i.clickEvent=e),t._completeHide(i);}}static dataApiKeydownHandler(e){const t=/input|textarea/i.test(e.target.tagName),n="Escape"===e.key,o=[ARROW_UP_KEY$2,ARROW_DOWN_KEY$2].includes(e.key);if(!o&&!n)return;if(t&&!n)return;e.preventDefault();const r=this.matches(SELECTOR_DATA_TOGGLE$4)?this:SelectorEngine$1.prev(this,SELECTOR_DATA_TOGGLE$4)[0]||SelectorEngine$1.next(this,SELECTOR_DATA_TOGGLE$4)[0]||SelectorEngine$1.findOne(SELECTOR_DATA_TOGGLE$4,e.delegateTarget.parentNode),i=Dropdown$2.getOrCreateInstance(r);if(o)return e.stopPropagation(),i.show(),void i._selectMenuItem(e);i._isShown()&&(e.stopPropagation(),i.hide(),r.focus());}}EventHandler$1.on(document,EVENT_KEYDOWN_DATA_API,SELECTOR_DATA_TOGGLE$4,Dropdown$2.dataApiKeydownHandler),EventHandler$1.on(document,EVENT_KEYDOWN_DATA_API,SELECTOR_MENU,Dropdown$2.dataApiKeydownHandler),EventHandler$1.on(document,EVENT_CLICK_DATA_API$2,Dropdown$2.clearMenus),EventHandler$1.on(document,EVENT_KEYUP_DATA_API,Dropdown$2.clearMenus),EventHandler$1.on(document,EVENT_CLICK_DATA_API$2,SELECTOR_DATA_TOGGLE$4,(function(e){e.preventDefault(),Dropdown$2.getOrCreateInstance(this).toggle();})),defineJQueryPlugin(Dropdown$2);
389
+ const NAME$c="dropdown",ARROW_UP_KEY$2="ArrowUp",ARROW_DOWN_KEY$2="ArrowDown",EVENT_HIDE$4="hide.bs.dropdown",EVENT_HIDDEN$4="hidden.bs.dropdown",EVENT_SHOW$4="show.bs.dropdown",EVENT_SHOWN$4="shown.bs.dropdown",EVENT_CLICK_DATA_API$2="click.bs.dropdown.data-api",EVENT_KEYDOWN_DATA_API="keydown.bs.dropdown.data-api",EVENT_KEYUP_DATA_API="keyup.bs.dropdown.data-api",SELECTOR_DATA_TOGGLE$5='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',SELECTOR_DATA_TOGGLE_SHOWN=`${SELECTOR_DATA_TOGGLE$5}.show`,SELECTOR_MENU=".dropdown-menu",SELECTOR_VISIBLE_ITEMS=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",PLACEMENT_TOP=isRTL()?"top-end":"top-start",PLACEMENT_TOPEND=isRTL()?"top-start":"top-end",PLACEMENT_BOTTOM=isRTL()?"bottom-end":"bottom-start",PLACEMENT_BOTTOMEND=isRTL()?"bottom-start":"bottom-end",PLACEMENT_RIGHT=isRTL()?"left-start":"right-start",PLACEMENT_LEFT=isRTL()?"right-start":"left-start",Default$a={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},DefaultType$9={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class Dropdown$2 extends BaseComponent{constructor(e,t){super(e,t),this._popper=null,this._parent=this._element.parentNode,this._menu=SelectorEngine$1.next(this._element,SELECTOR_MENU)[0]||SelectorEngine$1.prev(this._element,SELECTOR_MENU)[0]||SelectorEngine$1.findOne(SELECTOR_MENU,this._parent),this._inNavbar=this._detectNavbar();}static get Default(){return Default$a}static get DefaultType(){return DefaultType$9}static get NAME(){return NAME$c}toggle(){return this._isShown()?this.hide():this.show()}show(){if(isDisabled$1(this._element)||this._isShown())return;const e={relatedTarget:this._element};if(!EventHandler$1.trigger(this._element,EVENT_SHOW$4,e).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav"))for(const e of [].concat(...document.body.children))EventHandler$1.on(e,"mouseover",noop$2);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add("show"),this._element.classList.add("show"),EventHandler$1.trigger(this._element,EVENT_SHOWN$4,e);}}hide(){if(isDisabled$1(this._element)||!this._isShown())return;const e={relatedTarget:this._element};this._completeHide(e);}dispose(){this._popper&&this._popper.destroy(),super.dispose();}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update();}_completeHide(e){if(!EventHandler$1.trigger(this._element,EVENT_HIDE$4,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const e of [].concat(...document.body.children))EventHandler$1.off(e,"mouseover",noop$2);this._popper&&this._popper.destroy(),this._menu.classList.remove("show"),this._element.classList.remove("show"),this._element.setAttribute("aria-expanded","false"),Manipulator.removeDataAttribute(this._menu,"popper"),EventHandler$1.trigger(this._element,EVENT_HIDDEN$4,e);}}_getConfig(e){if("object"==typeof(e=super._getConfig(e)).reference&&!isElement$1(e.reference)&&"function"!=typeof e.reference.getBoundingClientRect)throw new TypeError(`${NAME$c.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createPopper(){if(void 0===Popper)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let e=this._element;"parent"===this._config.reference?e=this._parent:isElement$1(this._config.reference)?e=getElement(this._config.reference):"object"==typeof this._config.reference&&(e=this._config.reference);const t=this._getPopperConfig();this._popper=createPopper(e,this._menu,t);}_isShown(){return this._menu.classList.contains("show")}_getPlacement(){const e=this._parent;if(e.classList.contains("dropend"))return PLACEMENT_RIGHT;if(e.classList.contains("dropstart"))return PLACEMENT_LEFT;if(e.classList.contains("dropup-center"))return "top";if(e.classList.contains("dropdown-center"))return "bottom";const t="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return e.classList.contains("dropup")?t?PLACEMENT_TOPEND:PLACEMENT_TOP:t?PLACEMENT_BOTTOMEND:PLACEMENT_BOTTOM}_detectNavbar(){return null!==this._element.closest(".navbar")}_getOffset(){const{offset:e}=this._config;return "string"==typeof e?e.split(",").map((e=>Number.parseInt(e,10))):"function"==typeof e?t=>e(t,this._element):e}_getPopperConfig(){const e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return (this._inNavbar||"static"===this._config.display)&&(Manipulator.setDataAttribute(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),{...e,..."function"==typeof this._config.popperConfig?this._config.popperConfig(e):this._config.popperConfig}}_selectMenuItem({key:e,target:t}){const n=SelectorEngine$1.find(SELECTOR_VISIBLE_ITEMS,this._menu).filter((e=>isVisible(e)));n.length&&getNextActiveElement(n,t,e===ARROW_DOWN_KEY$2,!n.includes(t)).focus();}static jQueryInterface(e){return this.each((function(){const t=Dropdown$2.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]();}}))}static clearMenus(e){if(2===e.button||"keyup"===e.type&&"Tab"!==e.key)return;const t=SelectorEngine$1.find(SELECTOR_DATA_TOGGLE_SHOWN);for(const n of t){const t=Dropdown$2.getInstance(n);if(!t||!1===t._config.autoClose)continue;const o=e.composedPath(),r=o.includes(t._menu);if(o.includes(t._element)||"inside"===t._config.autoClose&&!r||"outside"===t._config.autoClose&&r)continue;if(t._menu.contains(e.target)&&("keyup"===e.type&&"Tab"===e.key||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;const i={relatedTarget:t._element};"click"===e.type&&(i.clickEvent=e),t._completeHide(i);}}static dataApiKeydownHandler(e){const t=/input|textarea/i.test(e.target.tagName),n="Escape"===e.key,o=[ARROW_UP_KEY$2,ARROW_DOWN_KEY$2].includes(e.key);if(!o&&!n)return;if(t&&!n)return;e.preventDefault();const r=this.matches(SELECTOR_DATA_TOGGLE$5)?this:SelectorEngine$1.prev(this,SELECTOR_DATA_TOGGLE$5)[0]||SelectorEngine$1.next(this,SELECTOR_DATA_TOGGLE$5)[0]||SelectorEngine$1.findOne(SELECTOR_DATA_TOGGLE$5,e.delegateTarget.parentNode),i=Dropdown$2.getOrCreateInstance(r);if(o)return e.stopPropagation(),i.show(),void i._selectMenuItem(e);i._isShown()&&(e.stopPropagation(),i.hide(),r.focus());}}EventHandler$1.on(document,EVENT_KEYDOWN_DATA_API,SELECTOR_DATA_TOGGLE$5,Dropdown$2.dataApiKeydownHandler),EventHandler$1.on(document,EVENT_KEYDOWN_DATA_API,SELECTOR_MENU,Dropdown$2.dataApiKeydownHandler),EventHandler$1.on(document,EVENT_CLICK_DATA_API$2,Dropdown$2.clearMenus),EventHandler$1.on(document,EVENT_KEYUP_DATA_API,Dropdown$2.clearMenus),EventHandler$1.on(document,EVENT_CLICK_DATA_API$2,SELECTOR_DATA_TOGGLE$5,(function(e){e.preventDefault(),Dropdown$2.getOrCreateInstance(this).toggle();})),defineJQueryPlugin(Dropdown$2);
388
390
 
389
391
  class Dropdown extends Dropdown$2{}const Dropdown$1 = Dropdown;
390
392
 
391
393
  const SELECTOR_FIXED_CONTENT=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top";class ScrollBarHelper{constructor(){this._element=document.body;}getWidth(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}hide(){const t=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,"padding-right",(e=>e+t)),this._setElementAttributes(SELECTOR_FIXED_CONTENT,"padding-right",(e=>e+t)),this._setElementAttributes(".sticky-top","margin-right",(e=>e-t));}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,"padding-right"),this._resetElementAttributes(SELECTOR_FIXED_CONTENT,"padding-right"),this._resetElementAttributes(".sticky-top","margin-right");}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden";}_setElementAttributes(t,e,i){const r=this.getWidth();this._applyManipulationCallback(t,(t=>{if(t!==this._element&&window.innerWidth>t.clientWidth+r)return;this._saveInitialAttribute(t,e);const n=window.getComputedStyle(t).getPropertyValue(e);t.style.setProperty(e,`${i(Number.parseFloat(n))}px`);}));}_saveInitialAttribute(t,e){const i=t.style.getPropertyValue(e);i&&Manipulator.setDataAttribute(t,e,i);}_resetElementAttributes(t,e){this._applyManipulationCallback(t,(t=>{const i=Manipulator.getDataAttribute(t,e);null!==i?(Manipulator.removeDataAttribute(t,e),t.style.setProperty(e,i)):t.style.removeProperty(e);}));}_applyManipulationCallback(t,e){if(isElement$1(t))e(t);else for(const i of SelectorEngine$1.find(t,this._element))e(i);}}
392
394
 
393
- const NAME$9="backdrop",EVENT_MOUSEDOWN=`mousedown.bs.${NAME$9}`,Default$8={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},DefaultType$8={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class Backdrop extends Config{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null;}static get Default(){return Default$8}static get DefaultType(){return DefaultType$8}static get NAME(){return NAME$9}show(e){if(!this._config.isVisible)return void execute(e);this._append();const t=this._getElement();this._config.isAnimated&&reflow(t),t.classList.add("show"),this._emulateAnimation((()=>{execute(e);}));}hide(e){this._config.isVisible?(this._getElement().classList.remove("show"),this._emulateAnimation((()=>{this.dispose(),execute(e);}))):execute(e);}dispose(){this._isAppended&&(EventHandler$1.off(this._element,EVENT_MOUSEDOWN),this._element.remove(),this._isAppended=!1);}_getElement(){if(!this._element){const e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add("fade"),this._element=e;}return this._element}_configAfterMerge(e){return e.rootElement=getElement(e.rootElement),e}_append(){if(this._isAppended)return;const e=this._getElement();this._config.rootElement.append(e),EventHandler$1.on(e,EVENT_MOUSEDOWN,(()=>{execute(this._config.clickCallback);})),this._isAppended=!0;}_emulateAnimation(e){executeAfterTransition(e,this._getElement(),this._config.isAnimated);}}
395
+ const NAME$b="backdrop",EVENT_MOUSEDOWN=`mousedown.bs.${NAME$b}`,Default$9={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},DefaultType$8={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class Backdrop extends Config$1{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null;}static get Default(){return Default$9}static get DefaultType(){return DefaultType$8}static get NAME(){return NAME$b}show(e){if(!this._config.isVisible)return void execute(e);this._append();const t=this._getElement();this._config.isAnimated&&reflow(t),t.classList.add("show"),this._emulateAnimation((()=>{execute(e);}));}hide(e){this._config.isVisible?(this._getElement().classList.remove("show"),this._emulateAnimation((()=>{this.dispose(),execute(e);}))):execute(e);}dispose(){this._isAppended&&(EventHandler$1.off(this._element,EVENT_MOUSEDOWN),this._element.remove(),this._isAppended=!1);}_getElement(){if(!this._element){const e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add("fade"),this._element=e;}return this._element}_configAfterMerge(e){return e.rootElement=getElement(e.rootElement),e}_append(){if(this._isAppended)return;const e=this._getElement();this._config.rootElement.append(e),EventHandler$1.on(e,EVENT_MOUSEDOWN,(()=>{execute(this._config.clickCallback);})),this._isAppended=!0;}_emulateAnimation(e){executeAfterTransition(e,this._getElement(),this._config.isAnimated);}}
394
396
 
395
- const NAME$8="focustrap",DATA_KEY$2="bs.focustrap",EVENT_KEY$3=`.${DATA_KEY$2}`,EVENT_FOCUSIN$1=`focusin${EVENT_KEY$3}`,EVENT_KEYDOWN_TAB=`keydown.tab${EVENT_KEY$3}`,Default$7={autofocus:!0,trapElement:null},DefaultType$7={autofocus:"boolean",trapElement:"element"};class FocusTrap extends Config{constructor(t){super(),this._config=this._getConfig(t),this._isActive=!1,this._lastTabNavDirection=null;}static get Default(){return Default$7}static get DefaultType(){return DefaultType$7}static get NAME(){return NAME$8}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),EventHandler$1.off(document,EVENT_KEY$3),EventHandler$1.on(document,EVENT_FOCUSIN$1,(t=>this._handleFocusin(t))),EventHandler$1.on(document,EVENT_KEYDOWN_TAB,(t=>this._handleKeydown(t))),this._isActive=!0);}deactivate(){this._isActive&&(this._isActive=!1,EventHandler$1.off(document,EVENT_KEY$3));}_handleFocusin(t){const{trapElement:e}=this._config;if(t.target===document||t.target===e||e.contains(t.target))return;const n=SelectorEngine$1.focusableChildren(e);0===n.length?e.focus():"backward"===this._lastTabNavDirection?n[n.length-1].focus():n[0].focus();}_handleKeydown(t){"Tab"===t.key&&(this._lastTabNavDirection=t.shiftKey?"backward":"forward");}}
397
+ const NAME$a="focustrap",DATA_KEY$2="bs.focustrap",EVENT_KEY$3=`.${DATA_KEY$2}`,EVENT_FOCUSIN$1=`focusin${EVENT_KEY$3}`,EVENT_KEYDOWN_TAB=`keydown.tab${EVENT_KEY$3}`,Default$8={autofocus:!0,trapElement:null},DefaultType$7={autofocus:"boolean",trapElement:"element"};class FocusTrap extends Config$1{constructor(t){super(),this._config=this._getConfig(t),this._isActive=!1,this._lastTabNavDirection=null;}static get Default(){return Default$8}static get DefaultType(){return DefaultType$7}static get NAME(){return NAME$a}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),EventHandler$1.off(document,EVENT_KEY$3),EventHandler$1.on(document,EVENT_FOCUSIN$1,(t=>this._handleFocusin(t))),EventHandler$1.on(document,EVENT_KEYDOWN_TAB,(t=>this._handleKeydown(t))),this._isActive=!0);}deactivate(){this._isActive&&(this._isActive=!1,EventHandler$1.off(document,EVENT_KEY$3));}_handleFocusin(t){const{trapElement:e}=this._config;if(t.target===document||t.target===e||e.contains(t.target))return;const n=SelectorEngine$1.focusableChildren(e);0===n.length?e.focus():"backward"===this._lastTabNavDirection?n[n.length-1].focus():n[0].focus();}_handleKeydown(t){"Tab"===t.key&&(this._lastTabNavDirection=t.shiftKey?"backward":"forward");}}
396
398
 
397
- const NAME$7="modal",EVENT_KEY$2=".bs.modal",EVENT_HIDE$3="hide.bs.modal",EVENT_HIDE_PREVENTED$1="hidePrevented.bs.modal",EVENT_HIDDEN$3="hidden.bs.modal",EVENT_SHOW$3="show.bs.modal",EVENT_SHOWN$3="shown.bs.modal",EVENT_RESIZE$1="resize.bs.modal",EVENT_CLICK_DISMISS="click.dismiss.bs.modal",EVENT_MOUSEDOWN_DISMISS="mousedown.dismiss.bs.modal",EVENT_KEYDOWN_DISMISS$1="keydown.dismiss.bs.modal",EVENT_CLICK_DATA_API$1="click.bs.modal.data-api",SELECTOR_DATA_TOGGLE$3='[data-bs-toggle="modal"]',Default$6={backdrop:!0,focus:!0,keyboard:!0},DefaultType$6={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class Modal$2 extends BaseComponent{constructor(e,t){super(e,t),this._dialog=SelectorEngine$1.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new ScrollBarHelper,this._addEventListeners();}static get Default(){return Default$6}static get DefaultType(){return DefaultType$6}static get NAME(){return NAME$7}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown||this._isTransitioning)return;EventHandler$1.trigger(this._element,EVENT_SHOW$3,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add("modal-open"),this._adjustDialog(),this._backdrop.show((()=>this._showElement(e))));}hide(){if(!this._isShown||this._isTransitioning)return;EventHandler$1.trigger(this._element,EVENT_HIDE$3).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove("show"),this._queueCallback((()=>this._hideModal()),this._element,this._isAnimated()));}dispose(){for(const e of [window,this._dialog])EventHandler$1.off(e,EVENT_KEY$2);this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose();}handleUpdate(){this._adjustDialog();}_initializeBackDrop(){return new Backdrop({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new FocusTrap({trapElement:this._element})}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const t=SelectorEngine$1.findOne(".modal-body",this._dialog);t&&(t.scrollTop=0),reflow(this._element),this._element.classList.add("show");this._queueCallback((()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,EventHandler$1.trigger(this._element,EVENT_SHOWN$3,{relatedTarget:e});}),this._dialog,this._isAnimated());}_addEventListeners(){EventHandler$1.on(this._element,EVENT_KEYDOWN_DISMISS$1,(e=>{if("Escape"===e.key)return this._config.keyboard?(e.preventDefault(),void this.hide()):void this._triggerBackdropTransition()})),EventHandler$1.on(window,EVENT_RESIZE$1,(()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog();})),EventHandler$1.on(this._element,EVENT_MOUSEDOWN_DISMISS,(e=>{EventHandler$1.one(this._element,EVENT_CLICK_DISMISS,(t=>{this._element===e.target&&this._element===t.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition());}));}));}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide((()=>{document.body.classList.remove("modal-open"),this._resetAdjustments(),this._scrollBar.reset(),EventHandler$1.trigger(this._element,EVENT_HIDDEN$3);}));}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(EventHandler$1.trigger(this._element,EVENT_HIDE_PREVENTED$1).defaultPrevented)return;const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._element.style.overflowY;"hidden"===t||this._element.classList.contains("modal-static")||(e||(this._element.style.overflowY="hidden"),this._element.classList.add("modal-static"),this._queueCallback((()=>{this._element.classList.remove("modal-static"),this._queueCallback((()=>{this._element.style.overflowY=t;}),this._dialog);}),this._dialog),this._element.focus());}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),i=t>0;if(i&&!e){const e=isRTL()?"paddingLeft":"paddingRight";this._element.style[e]=`${t}px`;}if(!i&&e){const e=isRTL()?"paddingRight":"paddingLeft";this._element.style[e]=`${t}px`;}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight="";}static jQueryInterface(e,t){return this.each((function(){const i=Modal$2.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===i[e])throw new TypeError(`No method named "${e}"`);i[e](t);}}))}}EventHandler$1.on(document,EVENT_CLICK_DATA_API$1,SELECTOR_DATA_TOGGLE$3,(function(e){const t=getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),EventHandler$1.one(t,EVENT_SHOW$3,(e=>{e.defaultPrevented||EventHandler$1.one(t,EVENT_HIDDEN$3,(()=>{isVisible(this)&&this.focus();}));}));const i=SelectorEngine$1.findOne(".modal.show");i&&Modal$2.getInstance(i).hide();Modal$2.getOrCreateInstance(t).toggle(this);})),enableDismissTrigger(Modal$2),defineJQueryPlugin(Modal$2);
399
+ const NAME$9="modal",EVENT_KEY$2=".bs.modal",EVENT_HIDE$3="hide.bs.modal",EVENT_HIDE_PREVENTED$1="hidePrevented.bs.modal",EVENT_HIDDEN$3="hidden.bs.modal",EVENT_SHOW$3="show.bs.modal",EVENT_SHOWN$3="shown.bs.modal",EVENT_RESIZE$1="resize.bs.modal",EVENT_CLICK_DISMISS="click.dismiss.bs.modal",EVENT_MOUSEDOWN_DISMISS="mousedown.dismiss.bs.modal",EVENT_KEYDOWN_DISMISS$1="keydown.dismiss.bs.modal",EVENT_CLICK_DATA_API$1="click.bs.modal.data-api",SELECTOR_DATA_TOGGLE$4='[data-bs-toggle="modal"]',Default$7={backdrop:!0,focus:!0,keyboard:!0},DefaultType$6={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class Modal$2 extends BaseComponent{constructor(e,t){super(e,t),this._dialog=SelectorEngine$1.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new ScrollBarHelper,this._addEventListeners();}static get Default(){return Default$7}static get DefaultType(){return DefaultType$6}static get NAME(){return NAME$9}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown||this._isTransitioning)return;EventHandler$1.trigger(this._element,EVENT_SHOW$3,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add("modal-open"),this._adjustDialog(),this._backdrop.show((()=>this._showElement(e))));}hide(){if(!this._isShown||this._isTransitioning)return;EventHandler$1.trigger(this._element,EVENT_HIDE$3).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove("show"),this._queueCallback((()=>this._hideModal()),this._element,this._isAnimated()));}dispose(){for(const e of [window,this._dialog])EventHandler$1.off(e,EVENT_KEY$2);this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose();}handleUpdate(){this._adjustDialog();}_initializeBackDrop(){return new Backdrop({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new FocusTrap({trapElement:this._element})}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const t=SelectorEngine$1.findOne(".modal-body",this._dialog);t&&(t.scrollTop=0),reflow(this._element),this._element.classList.add("show");this._queueCallback((()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,EventHandler$1.trigger(this._element,EVENT_SHOWN$3,{relatedTarget:e});}),this._dialog,this._isAnimated());}_addEventListeners(){EventHandler$1.on(this._element,EVENT_KEYDOWN_DISMISS$1,(e=>{if("Escape"===e.key)return this._config.keyboard?(e.preventDefault(),void this.hide()):void this._triggerBackdropTransition()})),EventHandler$1.on(window,EVENT_RESIZE$1,(()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog();})),EventHandler$1.on(this._element,EVENT_MOUSEDOWN_DISMISS,(e=>{EventHandler$1.one(this._element,EVENT_CLICK_DISMISS,(t=>{this._element===e.target&&this._element===t.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition());}));}));}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide((()=>{document.body.classList.remove("modal-open"),this._resetAdjustments(),this._scrollBar.reset(),EventHandler$1.trigger(this._element,EVENT_HIDDEN$3);}));}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(EventHandler$1.trigger(this._element,EVENT_HIDE_PREVENTED$1).defaultPrevented)return;const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._element.style.overflowY;"hidden"===t||this._element.classList.contains("modal-static")||(e||(this._element.style.overflowY="hidden"),this._element.classList.add("modal-static"),this._queueCallback((()=>{this._element.classList.remove("modal-static"),this._queueCallback((()=>{this._element.style.overflowY=t;}),this._dialog);}),this._dialog),this._element.focus());}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),i=t>0;if(i&&!e){const e=isRTL()?"paddingLeft":"paddingRight";this._element.style[e]=`${t}px`;}if(!i&&e){const e=isRTL()?"paddingRight":"paddingLeft";this._element.style[e]=`${t}px`;}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight="";}static jQueryInterface(e,t){return this.each((function(){const i=Modal$2.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===i[e])throw new TypeError(`No method named "${e}"`);i[e](t);}}))}}EventHandler$1.on(document,EVENT_CLICK_DATA_API$1,SELECTOR_DATA_TOGGLE$4,(function(e){const t=getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),EventHandler$1.one(t,EVENT_SHOW$3,(e=>{e.defaultPrevented||EventHandler$1.one(t,EVENT_HIDDEN$3,(()=>{isVisible(this)&&this.focus();}));}));const i=SelectorEngine$1.findOne(".modal.show");i&&Modal$2.getInstance(i).hide();Modal$2.getOrCreateInstance(t).toggle(this);})),enableDismissTrigger(Modal$2),defineJQueryPlugin(Modal$2);
398
400
 
399
401
  class Modal extends Modal$2{}const Modal$1 = Modal;
400
402
 
401
- const NAME$6="offcanvas",DATA_KEY$1="bs.offcanvas",EVENT_KEY$1=`.${DATA_KEY$1}`,EVENT_LOAD_DATA_API$1=`load${EVENT_KEY$1}.data-api`,CLASS_NAME_BACKDROP="offcanvas-backdrop",OPEN_SELECTOR=".offcanvas.show",EVENT_SHOW$2=`show${EVENT_KEY$1}`,EVENT_SHOWN$2=`shown${EVENT_KEY$1}`,EVENT_HIDE$2=`hide${EVENT_KEY$1}`,EVENT_HIDE_PREVENTED=`hidePrevented${EVENT_KEY$1}`,EVENT_HIDDEN$2=`hidden${EVENT_KEY$1}`,EVENT_RESIZE=`resize${EVENT_KEY$1}`,EVENT_CLICK_DATA_API=`click${EVENT_KEY$1}.data-api`,EVENT_KEYDOWN_DISMISS=`keydown.dismiss${EVENT_KEY$1}`,SELECTOR_DATA_TOGGLE$2='[data-bs-toggle="offcanvas"]',Default$5={backdrop:!0,keyboard:!0,scroll:!1},DefaultType$5={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class Offcanvas$2 extends BaseComponent{constructor(e,t){super(e,t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners();}static get Default(){return Default$5}static get DefaultType(){return DefaultType$5}static get NAME(){return NAME$6}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown)return;if(EventHandler$1.trigger(this._element,EVENT_SHOW$2,{relatedTarget:e}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||(new ScrollBarHelper).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add("showing");this._queueCallback((()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add("show"),this._element.classList.remove("showing"),EventHandler$1.trigger(this._element,EVENT_SHOWN$2,{relatedTarget:e});}),this._element,!0);}hide(){if(!this._isShown)return;if(EventHandler$1.trigger(this._element,EVENT_HIDE$2).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add("hiding"),this._backdrop.hide();this._queueCallback((()=>{this._element.classList.remove("show","hiding"),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new ScrollBarHelper).reset(),EventHandler$1.trigger(this._element,EVENT_HIDDEN$2);}),this._element,!0);}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose();}_initializeBackDrop(){const e=Boolean(this._config.backdrop);return new Backdrop({className:CLASS_NAME_BACKDROP,isVisible:e,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:e?()=>{"static"!==this._config.backdrop?this.hide():EventHandler$1.trigger(this._element,EVENT_HIDE_PREVENTED);}:null})}_initializeFocusTrap(){return new FocusTrap({trapElement:this._element})}_addEventListeners(){EventHandler$1.on(this._element,EVENT_KEYDOWN_DISMISS,(e=>{"Escape"===e.key&&(this._config.keyboard?this.hide():EventHandler$1.trigger(this._element,EVENT_HIDE_PREVENTED));}));}static jQueryInterface(e){return this.each((function(){const t=Offcanvas$2.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this);}}))}}EventHandler$1.on(document,EVENT_CLICK_DATA_API,SELECTOR_DATA_TOGGLE$2,(function(e){const t=getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),isDisabled(this))return;EventHandler$1.one(t,EVENT_HIDDEN$2,(()=>{isVisible(this)&&this.focus();}));const i=SelectorEngine$1.findOne(OPEN_SELECTOR);i&&i!==t&&Offcanvas$2.getInstance(i).hide();Offcanvas$2.getOrCreateInstance(t).toggle(this);})),EventHandler$1.on(window,EVENT_LOAD_DATA_API$1,(()=>{for(const e of SelectorEngine$1.find(OPEN_SELECTOR))Offcanvas$2.getOrCreateInstance(e).show();})),EventHandler$1.on(window,EVENT_RESIZE,(()=>{for(const e of SelectorEngine$1.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(e).position&&Offcanvas$2.getOrCreateInstance(e).hide();})),enableDismissTrigger(Offcanvas$2),defineJQueryPlugin(Offcanvas$2);
403
+ const NAME$8="offcanvas",DATA_KEY$1="bs.offcanvas",EVENT_KEY$1=`.${DATA_KEY$1}`,EVENT_LOAD_DATA_API$1=`load${EVENT_KEY$1}.data-api`,CLASS_NAME_BACKDROP="offcanvas-backdrop",OPEN_SELECTOR=".offcanvas.show",EVENT_SHOW$2=`show${EVENT_KEY$1}`,EVENT_SHOWN$2=`shown${EVENT_KEY$1}`,EVENT_HIDE$2=`hide${EVENT_KEY$1}`,EVENT_HIDE_PREVENTED=`hidePrevented${EVENT_KEY$1}`,EVENT_HIDDEN$2=`hidden${EVENT_KEY$1}`,EVENT_RESIZE=`resize${EVENT_KEY$1}`,EVENT_CLICK_DATA_API=`click${EVENT_KEY$1}.data-api`,EVENT_KEYDOWN_DISMISS=`keydown.dismiss${EVENT_KEY$1}`,SELECTOR_DATA_TOGGLE$3='[data-bs-toggle="offcanvas"]',Default$6={backdrop:!0,keyboard:!0,scroll:!1},DefaultType$5={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class Offcanvas$2 extends BaseComponent{constructor(e,t){super(e,t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners();}static get Default(){return Default$6}static get DefaultType(){return DefaultType$5}static get NAME(){return NAME$8}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown)return;if(EventHandler$1.trigger(this._element,EVENT_SHOW$2,{relatedTarget:e}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||(new ScrollBarHelper).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add("showing");this._queueCallback((()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add("show"),this._element.classList.remove("showing"),EventHandler$1.trigger(this._element,EVENT_SHOWN$2,{relatedTarget:e});}),this._element,!0);}hide(){if(!this._isShown)return;if(EventHandler$1.trigger(this._element,EVENT_HIDE$2).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add("hiding"),this._backdrop.hide();this._queueCallback((()=>{this._element.classList.remove("show","hiding"),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new ScrollBarHelper).reset(),EventHandler$1.trigger(this._element,EVENT_HIDDEN$2);}),this._element,!0);}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose();}_initializeBackDrop(){const e=Boolean(this._config.backdrop);return new Backdrop({className:CLASS_NAME_BACKDROP,isVisible:e,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:e?()=>{"static"!==this._config.backdrop?this.hide():EventHandler$1.trigger(this._element,EVENT_HIDE_PREVENTED);}:null})}_initializeFocusTrap(){return new FocusTrap({trapElement:this._element})}_addEventListeners(){EventHandler$1.on(this._element,EVENT_KEYDOWN_DISMISS,(e=>{"Escape"===e.key&&(this._config.keyboard?this.hide():EventHandler$1.trigger(this._element,EVENT_HIDE_PREVENTED));}));}static jQueryInterface(e){return this.each((function(){const t=Offcanvas$2.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this);}}))}}EventHandler$1.on(document,EVENT_CLICK_DATA_API,SELECTOR_DATA_TOGGLE$3,(function(e){const t=getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),isDisabled$1(this))return;EventHandler$1.one(t,EVENT_HIDDEN$2,(()=>{isVisible(this)&&this.focus();}));const i=SelectorEngine$1.findOne(OPEN_SELECTOR);i&&i!==t&&Offcanvas$2.getInstance(i).hide();Offcanvas$2.getOrCreateInstance(t).toggle(this);})),EventHandler$1.on(window,EVENT_LOAD_DATA_API$1,(()=>{for(const e of SelectorEngine$1.find(OPEN_SELECTOR))Offcanvas$2.getOrCreateInstance(e).show();})),EventHandler$1.on(window,EVENT_RESIZE,(()=>{for(const e of SelectorEngine$1.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(e).position&&Offcanvas$2.getOrCreateInstance(e).hide();})),enableDismissTrigger(Offcanvas$2),defineJQueryPlugin(Offcanvas$2);
402
404
 
403
405
  class Offcanvas extends Offcanvas$2{}const Offcanvas$1 = Offcanvas;
404
406
 
405
407
  const uriAttributes=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),ARIA_ATTRIBUTE_PATTERN=/^aria-[\w-]*$/i,SAFE_URL_PATTERN=/^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i,DATA_URL_PATTERN=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i,allowedAttribute=(e,t)=>{const o=e.nodeName.toLowerCase();return t.includes(o)?!uriAttributes.has(o)||Boolean(SAFE_URL_PATTERN.test(e.nodeValue)||DATA_URL_PATTERN.test(e.nodeValue)):t.filter((e=>e instanceof RegExp)).some((e=>e.test(o)))};const DefaultAllowlist={"*":["class","dir","id","lang","role",ARIA_ATTRIBUTE_PATTERN],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]};function sanitizeHtml(e,t,o){if(!e.length)return e;if(o&&"function"==typeof o)return o(e);const r=(new window.DOMParser).parseFromString(e,"text/html"),i=[].concat(...r.body.querySelectorAll("*"));for(const e of i){const o=e.nodeName.toLowerCase();if(!Object.keys(t).includes(o)){e.remove();continue}const r=[].concat(...e.attributes),i=[].concat(t["*"]||[],t[o]||[]);for(const t of r)allowedAttribute(t,i)||e.removeAttribute(t.nodeName);}return r.body.innerHTML}
406
408
 
407
- const NAME$5="TemplateFactory",Default$4={allowList:DefaultAllowlist,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},DefaultType$4={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},DefaultContentType={entry:"(string|element|function|null)",selector:"(string|element)"};class TemplateFactory extends Config{constructor(t){super(),this._config=this._getConfig(t);}static get Default(){return Default$4}static get DefaultType(){return DefaultType$4}static get NAME(){return NAME$5}getContent(){return Object.values(this._config.content).map((t=>this._resolvePossibleFunction(t))).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(t){return this._checkContent(t),this._config.content={...this._config.content,...t},this}toHtml(){const t=document.createElement("div");t.innerHTML=this._maybeSanitize(this._config.template);for(const[e,n]of Object.entries(this._config.content))this._setContent(t,n,e);const e=t.children[0],n=this._resolvePossibleFunction(this._config.extraClass);return n&&e.classList.add(...n.split(" ")),e}_typeCheckConfig(t){super._typeCheckConfig(t),this._checkContent(t.content);}_checkContent(t){for(const[e,n]of Object.entries(t))super._typeCheckConfig({selector:e,entry:n},DefaultContentType);}_setContent(t,e,n){const i=SelectorEngine$1.findOne(n,t);i&&((e=this._resolvePossibleFunction(e))?isElement$1(e)?this._putElementInTemplate(getElement(e),i):this._config.html?i.innerHTML=this._maybeSanitize(e):i.textContent=e:i.remove());}_maybeSanitize(t){return this._config.sanitize?sanitizeHtml(t,this._config.allowList,this._config.sanitizeFn):t}_resolvePossibleFunction(t){return "function"==typeof t?t(this):t}_putElementInTemplate(t,e){if(this._config.html)return e.innerHTML="",void e.append(t);e.textContent=t.textContent;}}
409
+ const NAME$7="TemplateFactory",Default$5={allowList:DefaultAllowlist,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},DefaultType$4={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},DefaultContentType={entry:"(string|element|function|null)",selector:"(string|element)"};class TemplateFactory extends Config$1{constructor(t){super(),this._config=this._getConfig(t);}static get Default(){return Default$5}static get DefaultType(){return DefaultType$4}static get NAME(){return NAME$7}getContent(){return Object.values(this._config.content).map((t=>this._resolvePossibleFunction(t))).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(t){return this._checkContent(t),this._config.content={...this._config.content,...t},this}toHtml(){const t=document.createElement("div");t.innerHTML=this._maybeSanitize(this._config.template);for(const[e,n]of Object.entries(this._config.content))this._setContent(t,n,e);const e=t.children[0],n=this._resolvePossibleFunction(this._config.extraClass);return n&&e.classList.add(...n.split(" ")),e}_typeCheckConfig(t){super._typeCheckConfig(t),this._checkContent(t.content);}_checkContent(t){for(const[e,n]of Object.entries(t))super._typeCheckConfig({selector:e,entry:n},DefaultContentType);}_setContent(t,e,n){const i=SelectorEngine$1.findOne(n,t);i&&((e=this._resolvePossibleFunction(e))?isElement$1(e)?this._putElementInTemplate(getElement(e),i):this._config.html?i.innerHTML=this._maybeSanitize(e):i.textContent=e:i.remove());}_maybeSanitize(t){return this._config.sanitize?sanitizeHtml(t,this._config.allowList,this._config.sanitizeFn):t}_resolvePossibleFunction(t){return "function"==typeof t?t(this):t}_putElementInTemplate(t,e){if(this._config.html)return e.innerHTML="",void e.append(t);e.textContent=t.textContent;}}
408
410
 
409
- const NAME$4="tooltip",DISALLOWED_ATTRIBUTES=new Set(["sanitize","allowList","sanitizeFn"]),AttachmentMap={AUTO:"auto",TOP:"top",RIGHT:isRTL()?"left":"right",BOTTOM:"bottom",LEFT:isRTL()?"right":"left"},Default$3={allowList:DefaultAllowlist,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,0],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},DefaultType$3={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class Tooltip$2 extends BaseComponent{constructor(t,e){if(void 0===Popper)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(t,e),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle();}static get Default(){return Default$3}static get DefaultType(){return DefaultType$3}static get NAME(){return NAME$4}enable(){this._isEnabled=!0;}disable(){this._isEnabled=!1;}toggleEnabled(){this._isEnabled=!this._isEnabled;}toggle(){this._isEnabled&&(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()?this._leave():this._enter());}dispose(){clearTimeout(this._timeout),EventHandler$1.off(this._element.closest(".modal"),"hide.bs.modal",this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose();}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const t=EventHandler$1.trigger(this._element,this.constructor.eventName("show")),e=(findShadowRoot(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(t.defaultPrevented||!e)return;this._disposePopper();const i=this._getTipElement();this._element.setAttribute("aria-describedby",i.getAttribute("id"));const{container:n}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(n.append(i),EventHandler$1.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(i),i.classList.add("show"),"ontouchstart"in document.documentElement)for(const t of [].concat(...document.body.children))EventHandler$1.on(t,"mouseover",noop);this._queueCallback((()=>{EventHandler$1.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1;}),this.tip,this._isAnimated());}hide(){if(!this._isShown())return;if(EventHandler$1.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented)return;if(this._getTipElement().classList.remove("show"),"ontouchstart"in document.documentElement)for(const t of [].concat(...document.body.children))EventHandler$1.off(t,"mouseover",noop);this._activeTrigger.click=!1,this._activeTrigger.focus=!1,this._activeTrigger.hover=!1,this._isHovered=null;this._queueCallback((()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),EventHandler$1.trigger(this._element,this.constructor.eventName("hidden")));}),this.tip,this._isAnimated());}update(){this._popper&&this._popper.update();}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(t){const e=this._getTemplateFactory(t).toHtml();if(!e)return null;e.classList.remove("fade","show"),e.classList.add(`bs-${this.constructor.NAME}-auto`);const i=getUID(this.constructor.NAME).toString();return e.setAttribute("id",i),this._isAnimated()&&e.classList.add("fade"),e}setContent(t){this._newContent=t,this._isShown()&&(this._disposePopper(),this.show());}_getTemplateFactory(t){return this._templateFactory?this._templateFactory.changeContent(t):this._templateFactory=new TemplateFactory({...this._config,content:t,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return {".tooltip-inner":this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(t){return this.constructor.getOrCreateInstance(t.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains("fade")}_isShown(){return this.tip&&this.tip.classList.contains("show")}_createPopper(t){const e="function"==typeof this._config.placement?this._config.placement.call(this,t,this._element):this._config.placement,i=AttachmentMap[e.toUpperCase()];return createPopper(this._element,t,this._getPopperConfig(i))}_getOffset(){const{offset:t}=this._config;return "string"==typeof t?t.split(",").map((t=>Number.parseInt(t,10))):"function"==typeof t?e=>t(e,this._element):t}_resolvePossibleFunction(t){return "function"==typeof t?t.call(this._element):t}_getPopperConfig(t){const e={placement:t,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:t=>{this._getTipElement().setAttribute("data-popper-placement",t.state.placement);}}]};return {...e,..."function"==typeof this._config.popperConfig?this._config.popperConfig(e):this._config.popperConfig}}_setListeners(){const t=this._config.trigger.split(" ");for(const e of t)if("click"===e)EventHandler$1.on(this._element,this.constructor.eventName("click"),this._config.selector,(t=>{this._initializeOnDelegatedTarget(t).toggle();}));else if("manual"!==e){const t="hover"===e?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),i="hover"===e?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");EventHandler$1.on(this._element,t,this._config.selector,(t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusin"===t.type?"focus":"hover"]=!0,e._enter();})),EventHandler$1.on(this._element,i,this._config.selector,(t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusout"===t.type?"focus":"hover"]=e._element.contains(t.relatedTarget),e._leave();}));}this._hideModalHandler=()=>{this._element&&this.hide();},EventHandler$1.on(this._element.closest(".modal"),"hide.bs.modal",this._hideModalHandler);}_fixTitle(){const t=this._element.getAttribute("title");t&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",t),this._element.setAttribute("data-bs-original-title",t),this._element.removeAttribute("title"));}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout((()=>{this._isHovered&&this.show();}),this._config.delay.show));}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout((()=>{this._isHovered||this.hide();}),this._config.delay.hide));}_setTimeout(t,e){clearTimeout(this._timeout),this._timeout=setTimeout(t,e);}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(t){const e=Manipulator.getDataAttributes(this._element);for(const t of Object.keys(e))DISALLOWED_ATTRIBUTES.has(t)&&delete e[t];return t={...e,..."object"==typeof t&&t?t:{}},t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t.container=!1===t.container?document.body:getElement(t.container),"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),t}_getDelegateConfig(){const t={};for(const e in this._config)this.constructor.Default[e]!==this._config[e]&&(t[e]=this._config[e]);return t.selector=!1,t.trigger="manual",t}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null);}static jQueryInterface(t){return this.each((function(){const e=Tooltip$2.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]();}}))}}defineJQueryPlugin(Tooltip$2);
411
+ const NAME$6="tooltip",DISALLOWED_ATTRIBUTES=new Set(["sanitize","allowList","sanitizeFn"]),AttachmentMap={AUTO:"auto",TOP:"top",RIGHT:isRTL()?"left":"right",BOTTOM:"bottom",LEFT:isRTL()?"right":"left"},Default$4={allowList:DefaultAllowlist,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,0],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},DefaultType$3={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class Tooltip$2 extends BaseComponent{constructor(t,e){if(void 0===Popper)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(t,e),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle();}static get Default(){return Default$4}static get DefaultType(){return DefaultType$3}static get NAME(){return NAME$6}enable(){this._isEnabled=!0;}disable(){this._isEnabled=!1;}toggleEnabled(){this._isEnabled=!this._isEnabled;}toggle(){this._isEnabled&&(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()?this._leave():this._enter());}dispose(){clearTimeout(this._timeout),EventHandler$1.off(this._element.closest(".modal"),"hide.bs.modal",this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose();}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const t=EventHandler$1.trigger(this._element,this.constructor.eventName("show")),e=(findShadowRoot(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(t.defaultPrevented||!e)return;this._disposePopper();const i=this._getTipElement();this._element.setAttribute("aria-describedby",i.getAttribute("id"));const{container:n}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(n.append(i),EventHandler$1.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(i),i.classList.add("show"),"ontouchstart"in document.documentElement)for(const t of [].concat(...document.body.children))EventHandler$1.on(t,"mouseover",noop$2);this._queueCallback((()=>{EventHandler$1.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1;}),this.tip,this._isAnimated());}hide(){if(!this._isShown())return;if(EventHandler$1.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented)return;if(this._getTipElement().classList.remove("show"),"ontouchstart"in document.documentElement)for(const t of [].concat(...document.body.children))EventHandler$1.off(t,"mouseover",noop$2);this._activeTrigger.click=!1,this._activeTrigger.focus=!1,this._activeTrigger.hover=!1,this._isHovered=null;this._queueCallback((()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),EventHandler$1.trigger(this._element,this.constructor.eventName("hidden")));}),this.tip,this._isAnimated());}update(){this._popper&&this._popper.update();}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(t){const e=this._getTemplateFactory(t).toHtml();if(!e)return null;e.classList.remove("fade","show"),e.classList.add(`bs-${this.constructor.NAME}-auto`);const i=getUID(this.constructor.NAME).toString();return e.setAttribute("id",i),this._isAnimated()&&e.classList.add("fade"),e}setContent(t){this._newContent=t,this._isShown()&&(this._disposePopper(),this.show());}_getTemplateFactory(t){return this._templateFactory?this._templateFactory.changeContent(t):this._templateFactory=new TemplateFactory({...this._config,content:t,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return {".tooltip-inner":this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(t){return this.constructor.getOrCreateInstance(t.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains("fade")}_isShown(){return this.tip&&this.tip.classList.contains("show")}_createPopper(t){const e="function"==typeof this._config.placement?this._config.placement.call(this,t,this._element):this._config.placement,i=AttachmentMap[e.toUpperCase()];return createPopper(this._element,t,this._getPopperConfig(i))}_getOffset(){const{offset:t}=this._config;return "string"==typeof t?t.split(",").map((t=>Number.parseInt(t,10))):"function"==typeof t?e=>t(e,this._element):t}_resolvePossibleFunction(t){return "function"==typeof t?t.call(this._element):t}_getPopperConfig(t){const e={placement:t,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:t=>{this._getTipElement().setAttribute("data-popper-placement",t.state.placement);}}]};return {...e,..."function"==typeof this._config.popperConfig?this._config.popperConfig(e):this._config.popperConfig}}_setListeners(){const t=this._config.trigger.split(" ");for(const e of t)if("click"===e)EventHandler$1.on(this._element,this.constructor.eventName("click"),this._config.selector,(t=>{this._initializeOnDelegatedTarget(t).toggle();}));else if("manual"!==e){const t="hover"===e?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),i="hover"===e?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");EventHandler$1.on(this._element,t,this._config.selector,(t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusin"===t.type?"focus":"hover"]=!0,e._enter();})),EventHandler$1.on(this._element,i,this._config.selector,(t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusout"===t.type?"focus":"hover"]=e._element.contains(t.relatedTarget),e._leave();}));}this._hideModalHandler=()=>{this._element&&this.hide();},EventHandler$1.on(this._element.closest(".modal"),"hide.bs.modal",this._hideModalHandler);}_fixTitle(){const t=this._element.getAttribute("title");t&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",t),this._element.setAttribute("data-bs-original-title",t),this._element.removeAttribute("title"));}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout((()=>{this._isHovered&&this.show();}),this._config.delay.show));}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout((()=>{this._isHovered||this.hide();}),this._config.delay.hide));}_setTimeout(t,e){clearTimeout(this._timeout),this._timeout=setTimeout(t,e);}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(t){const e=Manipulator.getDataAttributes(this._element);for(const t of Object.keys(e))DISALLOWED_ATTRIBUTES.has(t)&&delete e[t];return t={...e,..."object"==typeof t&&t?t:{}},t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t.container=!1===t.container?document.body:getElement(t.container),"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),t}_getDelegateConfig(){const t={};for(const e in this._config)this.constructor.Default[e]!==this._config[e]&&(t[e]=this._config[e]);return t.selector=!1,t.trigger="manual",t}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null);}static jQueryInterface(t){return this.each((function(){const e=Tooltip$2.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]();}}))}}defineJQueryPlugin(Tooltip$2);
410
412
 
411
- const NAME$3="popover",SELECTOR_TITLE=".popover-header",Default$2={...Tooltip$2.Default,content:"",offset:[0,8],placement:"right",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',trigger:"click"},DefaultType$2={...Tooltip$2.DefaultType,content:"(null|string|element|function)"};class Popover$2 extends Tooltip$2{static get Default(){return Default$2}static get DefaultType(){return DefaultType$2}static get NAME(){return NAME$3}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return {[SELECTOR_TITLE]:this._getTitle(),".popover-body":this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(t){return this.each((function(){const e=Popover$2.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]();}}))}}defineJQueryPlugin(Popover$2);
413
+ const NAME$5="popover",SELECTOR_TITLE=".popover-header",Default$3={...Tooltip$2.Default,content:"",offset:[0,8],placement:"right",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',trigger:"click"},DefaultType$2={...Tooltip$2.DefaultType,content:"(null|string|element|function)"};class Popover$2 extends Tooltip$2{static get Default(){return Default$3}static get DefaultType(){return DefaultType$2}static get NAME(){return NAME$5}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return {[SELECTOR_TITLE]:this._getTitle(),".popover-body":this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(t){return this.each((function(){const e=Popover$2.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]();}}))}}defineJQueryPlugin(Popover$2);
412
414
 
413
415
  class Popover extends Popover$2{}const Popover$1 = Popover;
414
416
 
415
- const NAME$2="scrollspy",DATA_KEY="bs.scrollspy",EVENT_KEY=`.${DATA_KEY}`,EVENT_ACTIVATE=`activate${EVENT_KEY}`,EVENT_CLICK=`click${EVENT_KEY}`,EVENT_LOAD_DATA_API=`load${EVENT_KEY}.data-api`,SELECTOR_DATA_SPY='[data-bs-spy="scroll"]',SELECTOR_LINK_ITEMS=".nav-link, .nav-item > .nav-link, .list-group-item",Default$1={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},DefaultType$1={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class ScrollSpy$2 extends BaseComponent{constructor(e,t){super(e,t),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh();}static get Default(){return Default$1}static get DefaultType(){return DefaultType$1}static get NAME(){return NAME$2}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const e of this._observableSections.values())this._observer.observe(e);}dispose(){this._observer.disconnect(),super.dispose();}_configAfterMerge(e){return e.target=getElement(e.target)||document.body,e.rootMargin=e.offset?`${e.offset}px 0px -30%`:e.rootMargin,"string"==typeof e.threshold&&(e.threshold=e.threshold.split(",").map((e=>Number.parseFloat(e)))),e}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(EventHandler$1.off(this._config.target,EVENT_CLICK),EventHandler$1.on(this._config.target,EVENT_CLICK,"[href]",(e=>{const t=this._observableSections.get(e.target.hash);if(t){e.preventDefault();const o=this._rootElement||window,s=t.offsetTop-this._element.offsetTop;if(o.scrollTo)return void o.scrollTo({top:s,behavior:"smooth"});o.scrollTop=s;}})));}_getNewObserver(){const e={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver((e=>this._observerCallback(e)),e)}_observerCallback(e){const t=e=>this._targetLinks.get(`#${e.target.id}`),o=e=>{this._previousScrollData.visibleEntryTop=e.target.offsetTop,this._process(t(e));},s=(this._rootElement||document.documentElement).scrollTop,r=s>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=s;for(const i of e){if(!i.isIntersecting){this._activeTarget=null,this._clearActiveClass(t(i));continue}const e=i.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(r&&e){if(o(i),!s)return}else r||e||o(i);}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const e=SelectorEngine$1.find("[href]",this._config.target);for(const t of e){if(!t.hash||isDisabled(t))continue;const e=SelectorEngine$1.findOne(t.hash,this._element);isVisible(e)&&(this._targetLinks.set(t.hash,t),this._observableSections.set(t.hash,e));}}_process(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add("active"),this._activateParents(e),EventHandler$1.trigger(this._element,EVENT_ACTIVATE,{relatedTarget:e}));}_activateParents(e){if(e.classList.contains("dropdown-item"))SelectorEngine$1.findOne(".dropdown-toggle",e.closest(".dropdown")).classList.add("active");else for(const t of SelectorEngine$1.parents(e,".nav, .list-group"))for(const e of SelectorEngine$1.prev(t,SELECTOR_LINK_ITEMS))e.classList.add("active");}_clearActiveClass(e){e.classList.remove("active");const t=SelectorEngine$1.find("[href].active",e);for(const e of t)e.classList.remove("active");}static jQueryInterface(e){return this.each((function(){const t=ScrollSpy$2.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]();}}))}}EventHandler$1.on(window,EVENT_LOAD_DATA_API,(()=>{for(const e of SelectorEngine$1.find(SELECTOR_DATA_SPY))ScrollSpy$2.getOrCreateInstance(e);})),defineJQueryPlugin(ScrollSpy$2);
417
+ const NAME$4="scrollspy",DATA_KEY="bs.scrollspy",EVENT_KEY=`.${DATA_KEY}`,EVENT_ACTIVATE=`activate${EVENT_KEY}`,EVENT_CLICK=`click${EVENT_KEY}`,EVENT_LOAD_DATA_API=`load${EVENT_KEY}.data-api`,SELECTOR_DATA_SPY='[data-bs-spy="scroll"]',SELECTOR_LINK_ITEMS=".nav-link, .nav-item > .nav-link, .list-group-item",Default$2={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},DefaultType$1={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class ScrollSpy$2 extends BaseComponent{constructor(e,t){super(e,t),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh();}static get Default(){return Default$2}static get DefaultType(){return DefaultType$1}static get NAME(){return NAME$4}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const e of this._observableSections.values())this._observer.observe(e);}dispose(){this._observer.disconnect(),super.dispose();}_configAfterMerge(e){return e.target=getElement(e.target)||document.body,e.rootMargin=e.offset?`${e.offset}px 0px -30%`:e.rootMargin,"string"==typeof e.threshold&&(e.threshold=e.threshold.split(",").map((e=>Number.parseFloat(e)))),e}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(EventHandler$1.off(this._config.target,EVENT_CLICK),EventHandler$1.on(this._config.target,EVENT_CLICK,"[href]",(e=>{const t=this._observableSections.get(e.target.hash);if(t){e.preventDefault();const o=this._rootElement||window,s=t.offsetTop-this._element.offsetTop;if(o.scrollTo)return void o.scrollTo({top:s,behavior:"smooth"});o.scrollTop=s;}})));}_getNewObserver(){const e={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver((e=>this._observerCallback(e)),e)}_observerCallback(e){const t=e=>this._targetLinks.get(`#${e.target.id}`),o=e=>{this._previousScrollData.visibleEntryTop=e.target.offsetTop,this._process(t(e));},s=(this._rootElement||document.documentElement).scrollTop,r=s>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=s;for(const i of e){if(!i.isIntersecting){this._activeTarget=null,this._clearActiveClass(t(i));continue}const e=i.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(r&&e){if(o(i),!s)return}else r||e||o(i);}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const e=SelectorEngine$1.find("[href]",this._config.target);for(const t of e){if(!t.hash||isDisabled$1(t))continue;const e=SelectorEngine$1.findOne(t.hash,this._element);isVisible(e)&&(this._targetLinks.set(t.hash,t),this._observableSections.set(t.hash,e));}}_process(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add("active"),this._activateParents(e),EventHandler$1.trigger(this._element,EVENT_ACTIVATE,{relatedTarget:e}));}_activateParents(e){if(e.classList.contains("dropdown-item"))SelectorEngine$1.findOne(".dropdown-toggle",e.closest(".dropdown")).classList.add("active");else for(const t of SelectorEngine$1.parents(e,".nav, .list-group"))for(const e of SelectorEngine$1.prev(t,SELECTOR_LINK_ITEMS))e.classList.add("active");}_clearActiveClass(e){e.classList.remove("active");const t=SelectorEngine$1.find("[href].active",e);for(const e of t)e.classList.remove("active");}static jQueryInterface(e){return this.each((function(){const t=ScrollSpy$2.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]();}}))}}EventHandler$1.on(window,EVENT_LOAD_DATA_API,(()=>{for(const e of SelectorEngine$1.find(SELECTOR_DATA_SPY))ScrollSpy$2.getOrCreateInstance(e);})),defineJQueryPlugin(ScrollSpy$2);
416
418
 
417
419
  class ScrollSpy extends ScrollSpy$2{}const ScrollSpy$1 = ScrollSpy;
418
420
 
419
- const NAME$1="tab",EVENT_HIDE$1="hide.bs.tab",EVENT_HIDDEN$1="hidden.bs.tab",EVENT_SHOW$1="show.bs.tab",EVENT_SHOWN$1="shown.bs.tab",EVENT_KEYDOWN="keydown.bs.tab",ARROW_LEFT_KEY$1="ArrowLeft",ARROW_RIGHT_KEY$1="ArrowRight",ARROW_UP_KEY$1="ArrowUp",ARROW_DOWN_KEY$1="ArrowDown",SELECTOR_TAB_PANEL='.list-group, .nav, [role="tablist"]',SELECTOR_OUTER=".nav-item, .list-group-item",SELECTOR_INNER='.nav-link:not(.dropdown-toggle), .list-group-item:not(.dropdown-toggle), [role="tab"]:not(.dropdown-toggle)',SELECTOR_DATA_TOGGLE$1='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',SELECTOR_INNER_ELEM=`${SELECTOR_INNER}, ${SELECTOR_DATA_TOGGLE$1}`,SELECTOR_DATA_TOGGLE_ACTIVE$1='.active[data-bs-toggle="tab"], .active[data-bs-toggle="pill"], .active[data-bs-toggle="list"]';class Tab$2 extends BaseComponent{constructor(t){super(t),this._parent=this._element.closest(SELECTOR_TAB_PANEL),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),EventHandler$1.on(this._element,EVENT_KEYDOWN,(t=>this._keydown(t))));}static get NAME(){return NAME$1}show(){const t=this._element;if(this._elemIsActive(t))return;const e=this._getActiveElem(),i=e?EventHandler$1.trigger(e,EVENT_HIDE$1,{relatedTarget:t}):null;EventHandler$1.trigger(t,EVENT_SHOW$1,{relatedTarget:e}).defaultPrevented||i&&i.defaultPrevented||(this._deactivate(e,t),this._activate(t,e));}_activate(t,e){if(!t)return;t.classList.add("active"),this._activate(getElementFromSelector(t));this._queueCallback((()=>{"tab"===t.getAttribute("role")?(t.removeAttribute("tabindex"),t.setAttribute("aria-selected",!0),this._toggleDropDown(t,!0),EventHandler$1.trigger(t,EVENT_SHOWN$1,{relatedTarget:e})):t.classList.add("show");}),t,t.classList.contains("fade"));}_deactivate(t,e){if(!t)return;t.classList.remove("active"),t.blur(),this._deactivate(getElementFromSelector(t));this._queueCallback((()=>{"tab"===t.getAttribute("role")?(t.setAttribute("aria-selected",!1),t.setAttribute("tabindex","-1"),this._toggleDropDown(t,!1),EventHandler$1.trigger(t,EVENT_HIDDEN$1,{relatedTarget:e})):t.classList.remove("show");}),t,t.classList.contains("fade"));}_keydown(t){if(![ARROW_LEFT_KEY$1,ARROW_RIGHT_KEY$1,ARROW_UP_KEY$1,ARROW_DOWN_KEY$1].includes(t.key))return;t.stopPropagation(),t.preventDefault();const e=[ARROW_RIGHT_KEY$1,ARROW_DOWN_KEY$1].includes(t.key),i=getNextActiveElement(this._getChildren().filter((t=>!isDisabled(t))),t.target,e,!0);i&&(i.focus({preventScroll:!0}),Tab$2.getOrCreateInstance(i).show());}_getChildren(){return SelectorEngine$1.find(SELECTOR_INNER_ELEM,this._parent)}_getActiveElem(){return this._getChildren().find((t=>this._elemIsActive(t)))||null}_setInitialAttributes(t,e){this._setAttributeIfNotExists(t,"role","tablist");for(const t of e)this._setInitialAttributesOnChild(t);}_setInitialAttributesOnChild(t){t=this._getInnerElement(t);const e=this._elemIsActive(t),i=this._getOuterElement(t);t.setAttribute("aria-selected",e),i!==t&&this._setAttributeIfNotExists(i,"role","presentation"),e||t.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(t,"role","tab"),this._setInitialAttributesOnTargetPanel(t);}_setInitialAttributesOnTargetPanel(t){const e=getElementFromSelector(t);e&&(this._setAttributeIfNotExists(e,"role","tabpanel"),t.id&&this._setAttributeIfNotExists(e,"aria-labelledby",`#${t.id}`));}_toggleDropDown(t,e){const i=this._getOuterElement(t);if(!i.classList.contains("dropdown"))return;const s=(t,s)=>{const n=SelectorEngine$1.findOne(t,i);n&&n.classList.toggle(s,e);};s(".dropdown-toggle","active"),s(".dropdown-menu","show"),i.setAttribute("aria-expanded",e);}_setAttributeIfNotExists(t,e,i){t.hasAttribute(e)||t.setAttribute(e,i);}_elemIsActive(t){return t.classList.contains("active")}_getInnerElement(t){return t.matches(SELECTOR_INNER_ELEM)?t:SelectorEngine$1.findOne(SELECTOR_INNER_ELEM,t)}_getOuterElement(t){return t.closest(SELECTOR_OUTER)||t}static jQueryInterface(t){return this.each((function(){const e=Tab$2.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]();}}))}}EventHandler$1.on(document,"click.bs.tab",SELECTOR_DATA_TOGGLE$1,(function(t){["A","AREA"].includes(this.tagName)&&t.preventDefault(),isDisabled(this)||Tab$2.getOrCreateInstance(this).show();})),EventHandler$1.on(window,"load.bs.tab",(()=>{for(const t of SelectorEngine$1.find(SELECTOR_DATA_TOGGLE_ACTIVE$1))Tab$2.getOrCreateInstance(t);})),defineJQueryPlugin(Tab$2);
421
+ const NAME$3="tab",EVENT_HIDE$1="hide.bs.tab",EVENT_HIDDEN$1="hidden.bs.tab",EVENT_SHOW$1="show.bs.tab",EVENT_SHOWN$1="shown.bs.tab",EVENT_KEYDOWN="keydown.bs.tab",ARROW_LEFT_KEY$1="ArrowLeft",ARROW_RIGHT_KEY$1="ArrowRight",ARROW_UP_KEY$1="ArrowUp",ARROW_DOWN_KEY$1="ArrowDown",SELECTOR_TAB_PANEL='.list-group, .nav, [role="tablist"]',SELECTOR_OUTER=".nav-item, .list-group-item",SELECTOR_INNER='.nav-link:not(.dropdown-toggle), .list-group-item:not(.dropdown-toggle), [role="tab"]:not(.dropdown-toggle)',SELECTOR_DATA_TOGGLE$2='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',SELECTOR_INNER_ELEM=`${SELECTOR_INNER}, ${SELECTOR_DATA_TOGGLE$2}`,SELECTOR_DATA_TOGGLE_ACTIVE$1='.active[data-bs-toggle="tab"], .active[data-bs-toggle="pill"], .active[data-bs-toggle="list"]';class Tab$2 extends BaseComponent{constructor(t){super(t),this._parent=this._element.closest(SELECTOR_TAB_PANEL),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),EventHandler$1.on(this._element,EVENT_KEYDOWN,(t=>this._keydown(t))));}static get NAME(){return NAME$3}show(){const t=this._element;if(this._elemIsActive(t))return;const e=this._getActiveElem(),i=e?EventHandler$1.trigger(e,EVENT_HIDE$1,{relatedTarget:t}):null;EventHandler$1.trigger(t,EVENT_SHOW$1,{relatedTarget:e}).defaultPrevented||i&&i.defaultPrevented||(this._deactivate(e,t),this._activate(t,e));}_activate(t,e){if(!t)return;t.classList.add("active"),this._activate(getElementFromSelector(t));this._queueCallback((()=>{"tab"===t.getAttribute("role")?(t.removeAttribute("tabindex"),t.setAttribute("aria-selected",!0),this._toggleDropDown(t,!0),EventHandler$1.trigger(t,EVENT_SHOWN$1,{relatedTarget:e})):t.classList.add("show");}),t,t.classList.contains("fade"));}_deactivate(t,e){if(!t)return;t.classList.remove("active"),t.blur(),this._deactivate(getElementFromSelector(t));this._queueCallback((()=>{"tab"===t.getAttribute("role")?(t.setAttribute("aria-selected",!1),t.setAttribute("tabindex","-1"),this._toggleDropDown(t,!1),EventHandler$1.trigger(t,EVENT_HIDDEN$1,{relatedTarget:e})):t.classList.remove("show");}),t,t.classList.contains("fade"));}_keydown(t){if(![ARROW_LEFT_KEY$1,ARROW_RIGHT_KEY$1,ARROW_UP_KEY$1,ARROW_DOWN_KEY$1].includes(t.key))return;t.stopPropagation(),t.preventDefault();const e=[ARROW_RIGHT_KEY$1,ARROW_DOWN_KEY$1].includes(t.key),i=getNextActiveElement(this._getChildren().filter((t=>!isDisabled$1(t))),t.target,e,!0);i&&(i.focus({preventScroll:!0}),Tab$2.getOrCreateInstance(i).show());}_getChildren(){return SelectorEngine$1.find(SELECTOR_INNER_ELEM,this._parent)}_getActiveElem(){return this._getChildren().find((t=>this._elemIsActive(t)))||null}_setInitialAttributes(t,e){this._setAttributeIfNotExists(t,"role","tablist");for(const t of e)this._setInitialAttributesOnChild(t);}_setInitialAttributesOnChild(t){t=this._getInnerElement(t);const e=this._elemIsActive(t),i=this._getOuterElement(t);t.setAttribute("aria-selected",e),i!==t&&this._setAttributeIfNotExists(i,"role","presentation"),e||t.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(t,"role","tab"),this._setInitialAttributesOnTargetPanel(t);}_setInitialAttributesOnTargetPanel(t){const e=getElementFromSelector(t);e&&(this._setAttributeIfNotExists(e,"role","tabpanel"),t.id&&this._setAttributeIfNotExists(e,"aria-labelledby",`#${t.id}`));}_toggleDropDown(t,e){const i=this._getOuterElement(t);if(!i.classList.contains("dropdown"))return;const s=(t,s)=>{const n=SelectorEngine$1.findOne(t,i);n&&n.classList.toggle(s,e);};s(".dropdown-toggle","active"),s(".dropdown-menu","show"),i.setAttribute("aria-expanded",e);}_setAttributeIfNotExists(t,e,i){t.hasAttribute(e)||t.setAttribute(e,i);}_elemIsActive(t){return t.classList.contains("active")}_getInnerElement(t){return t.matches(SELECTOR_INNER_ELEM)?t:SelectorEngine$1.findOne(SELECTOR_INNER_ELEM,t)}_getOuterElement(t){return t.closest(SELECTOR_OUTER)||t}static jQueryInterface(t){return this.each((function(){const e=Tab$2.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]();}}))}}EventHandler$1.on(document,"click.bs.tab",SELECTOR_DATA_TOGGLE$2,(function(t){["A","AREA"].includes(this.tagName)&&t.preventDefault(),isDisabled$1(this)||Tab$2.getOrCreateInstance(this).show();})),EventHandler$1.on(window,"load.bs.tab",(()=>{for(const t of SelectorEngine$1.find(SELECTOR_DATA_TOGGLE_ACTIVE$1))Tab$2.getOrCreateInstance(t);})),defineJQueryPlugin(Tab$2);
420
422
 
421
- const ARROW_LEFT_KEY="ArrowLeft",ARROW_RIGHT_KEY="ArrowRight",ARROW_UP_KEY="ArrowUp",ARROW_DOWN_KEY="ArrowDown",ENTER_KEY="Enter",SPACE_BAR_KEY=" ",SELECTOR_DATA_TOGGLE='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',SELECTOR_DATA_TOGGLE_ACTIVE='.active[data-bs-toggle="tab"], .active[data-bs-toggle="pill"], .active[data-bs-toggle="list"]';class Tab extends Tab$2{constructor(e){super(e);}_keydown(e){if(![ARROW_LEFT_KEY,ARROW_RIGHT_KEY,ARROW_UP_KEY,ARROW_DOWN_KEY,ENTER_KEY,SPACE_BAR_KEY].includes(e.key))return;if(e.stopPropagation(),e.preventDefault(),e.key===ENTER_KEY||e.key===SPACE_BAR_KEY)return void Tab.getOrCreateInstance(e.target).show();const t=[ARROW_RIGHT_KEY,ARROW_DOWN_KEY].includes(e.key),a=getNextActiveElement(this._getChildren().filter((e=>!isDisabled(e))),e.target,t,!0);a&&a.focus({preventScroll:!0});}}EventHandler$1.on(document,"click.bs.tab",SELECTOR_DATA_TOGGLE,(function(e){if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),isDisabled(this))return;Tab.getOrCreateInstance(this).dispose(),Tab.getOrCreateInstance(this).show();})),EventHandler$1.on(window,"load.bs.tab",(()=>{for(const e of SelectorEngine$1.find(SELECTOR_DATA_TOGGLE_ACTIVE)){Tab.getOrCreateInstance(e).dispose(),Tab.getOrCreateInstance(e);}})),defineJQueryPlugin(Tab);const Tab$1 = Tab;
423
+ const ARROW_LEFT_KEY="ArrowLeft",ARROW_RIGHT_KEY="ArrowRight",ARROW_UP_KEY="ArrowUp",ARROW_DOWN_KEY="ArrowDown",ENTER_KEY="Enter",SPACE_BAR_KEY=" ",SELECTOR_DATA_TOGGLE$1='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',SELECTOR_DATA_TOGGLE_ACTIVE='.active[data-bs-toggle="tab"], .active[data-bs-toggle="pill"], .active[data-bs-toggle="list"]';class Tab extends Tab$2{constructor(e){super(e);}_keydown(e){if(![ARROW_LEFT_KEY,ARROW_RIGHT_KEY,ARROW_UP_KEY,ARROW_DOWN_KEY,ENTER_KEY,SPACE_BAR_KEY].includes(e.key))return;if(e.stopPropagation(),e.preventDefault(),e.key===ENTER_KEY||e.key===SPACE_BAR_KEY)return void Tab.getOrCreateInstance(e.target).show();const t=[ARROW_RIGHT_KEY,ARROW_DOWN_KEY].includes(e.key),a=getNextActiveElement(this._getChildren().filter((e=>!isDisabled$1(e))),e.target,t,!0);a&&a.focus({preventScroll:!0});}}EventHandler$1.on(document,"click.bs.tab",SELECTOR_DATA_TOGGLE$1,(function(e){if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),isDisabled$1(this))return;Tab.getOrCreateInstance(this).dispose(),Tab.getOrCreateInstance(this).show();})),EventHandler$1.on(window,"load.bs.tab",(()=>{for(const e of SelectorEngine$1.find(SELECTOR_DATA_TOGGLE_ACTIVE)){Tab.getOrCreateInstance(e).dispose(),Tab.getOrCreateInstance(e);}})),defineJQueryPlugin(Tab);const Tab$1 = Tab;
422
424
 
423
- const NAME="toast",EVENT_MOUSEOVER="mouseover.bs.toast",EVENT_MOUSEOUT="mouseout.bs.toast",EVENT_FOCUSIN="focusin.bs.toast",EVENT_FOCUSOUT="focusout.bs.toast",EVENT_HIDE="hide.bs.toast",EVENT_HIDDEN="hidden.bs.toast",EVENT_SHOW="show.bs.toast",EVENT_SHOWN="shown.bs.toast",DefaultType={animation:"boolean",autohide:"boolean",delay:"number"},Default={animation:!0,autohide:!0,delay:5e3};class Toast$2 extends BaseComponent{constructor(e,t){super(e,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners();}static get Default(){return Default}static get DefaultType(){return DefaultType}static get NAME(){return NAME}show(){if(EventHandler$1.trigger(this._element,EVENT_SHOW).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");this._element.classList.remove("hide"),reflow(this._element),this._element.classList.add("show","showing"),this._queueCallback((()=>{this._element.classList.remove("showing"),EventHandler$1.trigger(this._element,EVENT_SHOWN),this._maybeScheduleHide();}),this._element,this._config.animation);}hide(){if(!this.isShown())return;if(EventHandler$1.trigger(this._element,EVENT_HIDE).defaultPrevented)return;this._element.classList.add("showing"),this._queueCallback((()=>{this._element.classList.add("hide"),this._element.classList.remove("showing","show"),EventHandler$1.trigger(this._element,EVENT_HIDDEN);}),this._element,this._config.animation);}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove("show"),super.dispose();}isShown(){return this._element.classList.contains("show")}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout((()=>{this.hide();}),this._config.delay)));}_onInteraction(e,t){switch(e.type){case"mouseover":case"mouseout":this._hasMouseInteraction=t;break;case"focusin":case"focusout":this._hasKeyboardInteraction=t;}if(t)return void this._clearTimeout();const s=e.relatedTarget;this._element===s||this._element.contains(s)||this._maybeScheduleHide();}_setListeners(){EventHandler$1.on(this._element,EVENT_MOUSEOVER,(e=>this._onInteraction(e,!0))),EventHandler$1.on(this._element,EVENT_MOUSEOUT,(e=>this._onInteraction(e,!1))),EventHandler$1.on(this._element,EVENT_FOCUSIN,(e=>this._onInteraction(e,!0))),EventHandler$1.on(this._element,EVENT_FOCUSOUT,(e=>this._onInteraction(e,!1)));}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null;}static jQueryInterface(e){return this.each((function(){const t=Toast$2.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e](this);}}))}}enableDismissTrigger(Toast$2),defineJQueryPlugin(Toast$2);
425
+ const NAME$2="toast",EVENT_MOUSEOVER="mouseover.bs.toast",EVENT_MOUSEOUT="mouseout.bs.toast",EVENT_FOCUSIN="focusin.bs.toast",EVENT_FOCUSOUT="focusout.bs.toast",EVENT_HIDE="hide.bs.toast",EVENT_HIDDEN="hidden.bs.toast",EVENT_SHOW="show.bs.toast",EVENT_SHOWN="shown.bs.toast",DefaultType={animation:"boolean",autohide:"boolean",delay:"number"},Default$1={animation:!0,autohide:!0,delay:5e3};class Toast$2 extends BaseComponent{constructor(e,t){super(e,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners();}static get Default(){return Default$1}static get DefaultType(){return DefaultType}static get NAME(){return NAME$2}show(){if(EventHandler$1.trigger(this._element,EVENT_SHOW).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");this._element.classList.remove("hide"),reflow(this._element),this._element.classList.add("show","showing"),this._queueCallback((()=>{this._element.classList.remove("showing"),EventHandler$1.trigger(this._element,EVENT_SHOWN),this._maybeScheduleHide();}),this._element,this._config.animation);}hide(){if(!this.isShown())return;if(EventHandler$1.trigger(this._element,EVENT_HIDE).defaultPrevented)return;this._element.classList.add("showing"),this._queueCallback((()=>{this._element.classList.add("hide"),this._element.classList.remove("showing","show"),EventHandler$1.trigger(this._element,EVENT_HIDDEN);}),this._element,this._config.animation);}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove("show"),super.dispose();}isShown(){return this._element.classList.contains("show")}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout((()=>{this.hide();}),this._config.delay)));}_onInteraction(e,t){switch(e.type){case"mouseover":case"mouseout":this._hasMouseInteraction=t;break;case"focusin":case"focusout":this._hasKeyboardInteraction=t;}if(t)return void this._clearTimeout();const s=e.relatedTarget;this._element===s||this._element.contains(s)||this._maybeScheduleHide();}_setListeners(){EventHandler$1.on(this._element,EVENT_MOUSEOVER,(e=>this._onInteraction(e,!0))),EventHandler$1.on(this._element,EVENT_MOUSEOUT,(e=>this._onInteraction(e,!1))),EventHandler$1.on(this._element,EVENT_FOCUSIN,(e=>this._onInteraction(e,!0))),EventHandler$1.on(this._element,EVENT_FOCUSOUT,(e=>this._onInteraction(e,!1)));}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null;}static jQueryInterface(e){return this.each((function(){const t=Toast$2.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e](this);}}))}}enableDismissTrigger(Toast$2),defineJQueryPlugin(Toast$2);
424
426
 
425
427
  class Toast extends Toast$2{}const Toast$1 = Toast;
426
428
 
427
429
  class Tooltip extends Tooltip$2{}const Tooltip$1 = Tooltip;
428
430
 
429
- loadPlugin(icons),init$1();const bootstrapItalia_entry = {Alert:Alert$1,Button:Button$1,Carousel:Carousel$1,Collapse:Collapse$1,Dropdown:Dropdown$1,Modal:Modal$1,Offcanvas:Offcanvas$1,Popover:Popover$1,ScrollSpy:ScrollSpy$1,Tab:Tab$1,Toast:Toast$1,Tooltip:Tooltip$1,Accordion:Accordion$1,BackToTop:BackToTop$1,CarouselBI:CarouselBI$1,Cookiebar:Cookiebar$1,Dimmer:Dimmer$1,FormValidate:FormValidate,Forward:Forward$1,HistoryBack:HistoryBack$1,Input:Input$1,InputNumber:InputNumber$1,InputPassword:InputPassword$1,InputSearchAutocomplete:InputSearchAutocomplete,List:List$1,Masonry:Masonry$1,NavBarCollapsible:NavBarCollapsible$1,NavScroll:NavScroll$1,Notification:Notification$1,ProgressDonut:ProgressDonut$1,SelectAutocomplete:SelectAutocomplete$1,Sticky:Sticky$1,HeaderSticky:HeaderSticky$1,Transfer:Transfer$1,UploadDragDrop:UploadDragDrop$1,ValidatorSelectAutocomplete:ValidatorSelectAutocomplete,loadFonts:loadFonts};
431
+ var window_1="undefined"!=typeof window?window:void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof self?self:{};
432
+
433
+ var slice=Array.prototype.slice,domWalk=iterativelyWalk;function iterativelyWalk(l,e){"length"in l||(l=[l]),l=slice.call(l);for(;l.length;){var t=l.shift(),i=e(t);if(i)return i;t.childNodes&&t.childNodes.length&&(l=slice.call(t.childNodes).concat(l));}}
434
+
435
+ var domComment=Comment$1;function Comment$1(t,o){if(!(this instanceof Comment$1))return new Comment$1(t,o);this.data=t,this.nodeValue=t,this.length=t.length,this.ownerDocument=o||null;}Comment$1.prototype.nodeType=8,Comment$1.prototype.nodeName="#comment",Comment$1.prototype.toString=function(){return "[object Comment]"};
436
+
437
+ var domText=DOMText;function DOMText(t,e){if(!(this instanceof DOMText))return new DOMText(t);this.data=t||"",this.length=this.data.length,this.ownerDocument=e||null;}DOMText.prototype.type="DOMTextNode",DOMText.prototype.nodeType=3,DOMText.prototype.nodeName="#text",DOMText.prototype.toString=function(){return this.data},DOMText.prototype.replaceData=function(t,e,o){var n=this.data,r=n.substring(0,t),a=n.substring(t+e,n.length);this.data=r+o+a,this.length=this.data.length;};
438
+
439
+ var dispatchEvent_1=dispatchEvent;function dispatchEvent(t){var e=this,n=t.type;t.target||(t.target=e),e.listeners||(e.listeners={});var r=e.listeners[n];if(r)return r.forEach((function(n){t.currentTarget=e,"function"==typeof n?n(t):n.handleEvent(t);}));e.parentNode&&e.parentNode.dispatchEvent(t);}
440
+
441
+ var addEventListener_1=addEventListener$1;function addEventListener$1(e,t){var s=this;s.listeners||(s.listeners={}),s.listeners[e]||(s.listeners[e]=[]),-1===s.listeners[e].indexOf(t)&&s.listeners[e].push(t);}
442
+
443
+ var removeEventListener_1=removeEventListener$1;function removeEventListener$1(e,r){var t=this;if(t.listeners&&t.listeners[e]){var n=t.listeners[e],s=n.indexOf(r);-1!==s&&n.splice(s,1);}}
444
+
445
+ var serialize=serializeNode,voidElements=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"];function serializeNode(e){switch(e.nodeType){case 3:return escapeText(e.data);case 8:return "\x3c!--"+e.data+"--\x3e";default:return serializeElement(e)}}function serializeElement(e){var t=[],r=e.tagName;return "http://www.w3.org/1999/xhtml"===e.namespaceURI&&(r=r.toLowerCase()),t.push("<"+r+properties(e)+datasetify(e)),voidElements.indexOf(r)>-1?t.push(" />"):(t.push(">"),e.childNodes.length?t.push.apply(t,e.childNodes.map(serializeNode)):e.textContent||e.innerText?t.push(escapeText(e.textContent||e.innerText)):e.innerHTML&&t.push(e.innerHTML),t.push("</"+r+">")),t.join("")}function isProperty(e,t){var r=typeof e[t];return "style"===t&&Object.keys(e.style).length>0||e.hasOwnProperty(t)&&("string"===r||"boolean"===r||"number"===r)&&"nodeName"!==t&&"className"!==t&&"tagName"!==t&&"textContent"!==t&&"innerText"!==t&&"namespaceURI"!==t&&"innerHTML"!==t}function stylify(e){if("string"==typeof e)return e;var t="";return Object.keys(e).forEach((function(r){var a=e[r];r=r.replace(/[A-Z]/g,(function(e){return "-"+e.toLowerCase()})),t+=r+":"+a+";";})),t}function datasetify(e){var t=e.dataset,r=[];for(var a in t)r.push({name:"data-"+a,value:t[a]});return r.length?stringify(r):""}function stringify(e){var t=[];return e.forEach((function(e){var r=e.name,a=e.value;"style"===r&&(a=stylify(a)),t.push(r+'="'+escapeAttributeValue(a)+'"');})),t.length?" "+t.join(" "):""}function properties(e){var t=[];for(var r in e)isProperty(e,r)&&t.push({name:r,value:e[r]});for(var a in e._attributes)for(var n in e._attributes[a]){var i=e._attributes[a][n],s=(i.prefix?i.prefix+":":"")+n;t.push({name:s,value:i.value});}return e.className&&t.push({name:"class",value:e.className}),t.length?stringify(t):""}function escapeText(e){var t="";return "string"==typeof e?t=e:e&&(t=e.toString()),t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function escapeAttributeValue(e){return escapeText(e).replace(/"/g,"&quot;")}
446
+
447
+ var htmlns="http://www.w3.org/1999/xhtml",domElement=DOMElement;function DOMElement(t,e,n){if(!(this instanceof DOMElement))return new DOMElement(t);var o=void 0===n?htmlns:n||null;this.tagName=o===htmlns?String(t).toUpperCase():t,this.nodeName=this.tagName,this.className="",this.dataset={},this.childNodes=[],this.parentNode=null,this.style={},this.ownerDocument=e||null,this.namespaceURI=o,this._attributes={},"INPUT"===this.tagName&&(this.type="text");}DOMElement.prototype.type="DOMElement",DOMElement.prototype.nodeType=1,DOMElement.prototype.appendChild=function(t){return t.parentNode&&t.parentNode.removeChild(t),this.childNodes.push(t),t.parentNode=this,t},DOMElement.prototype.replaceChild=function(t,e){t.parentNode&&t.parentNode.removeChild(t);var n=this.childNodes.indexOf(e);return e.parentNode=null,this.childNodes[n]=t,t.parentNode=this,e},DOMElement.prototype.removeChild=function(t){var e=this.childNodes.indexOf(t);return this.childNodes.splice(e,1),t.parentNode=null,t},DOMElement.prototype.insertBefore=function(t,e){t.parentNode&&t.parentNode.removeChild(t);var n=null==e?-1:this.childNodes.indexOf(e);return n>-1?this.childNodes.splice(n,0,t):this.childNodes.push(t),t.parentNode=this,t},DOMElement.prototype.setAttributeNS=function(t,e,n){var o=null,r=e,i=e.indexOf(":");(i>-1&&(o=e.substr(0,i),r=e.substr(i+1)),"INPUT"===this.tagName&&"type"===e)?this.type=n:(this._attributes[t]||(this._attributes[t]={}))[r]={value:n,prefix:o};},DOMElement.prototype.getAttributeNS=function(t,e){var n=this._attributes[t],o=n&&n[e]&&n[e].value;return "INPUT"===this.tagName&&"type"===e?this.type:"string"!=typeof o?null:o},DOMElement.prototype.removeAttributeNS=function(t,e){var n=this._attributes[t];n&&delete n[e];},DOMElement.prototype.hasAttributeNS=function(t,e){var n=this._attributes[t];return !!n&&e in n},DOMElement.prototype.setAttribute=function(t,e){return this.setAttributeNS(null,t,e)},DOMElement.prototype.getAttribute=function(t){return this.getAttributeNS(null,t)},DOMElement.prototype.removeAttribute=function(t){return this.removeAttributeNS(null,t)},DOMElement.prototype.hasAttribute=function(t){return this.hasAttributeNS(null,t)},DOMElement.prototype.removeEventListener=removeEventListener_1,DOMElement.prototype.addEventListener=addEventListener_1,DOMElement.prototype.dispatchEvent=dispatchEvent_1,DOMElement.prototype.focus=function(){},DOMElement.prototype.toString=function(){return serialize(this)},DOMElement.prototype.getElementsByClassName=function(t){var e=t.split(" "),n=[];return domWalk(this,(function(t){if(1===t.nodeType){var o=(t.className||"").split(" ");e.every((function(t){return -1!==o.indexOf(t)}))&&n.push(t);}})),n},DOMElement.prototype.getElementsByTagName=function(t){t=t.toLowerCase();var e=[];return domWalk(this.childNodes,(function(n){1!==n.nodeType||"*"!==t&&n.tagName.toLowerCase()!==t||e.push(n);})),e},DOMElement.prototype.contains=function(t){return domWalk(this,(function(e){return t===e}))||!1};
448
+
449
+ var domFragment=DocumentFragment$1;function DocumentFragment$1(e){if(!(this instanceof DocumentFragment$1))return new DocumentFragment$1;this.childNodes=[],this.parentNode=null,this.ownerDocument=e||null;}DocumentFragment$1.prototype.type="DocumentFragment",DocumentFragment$1.prototype.nodeType=11,DocumentFragment$1.prototype.nodeName="#document-fragment",DocumentFragment$1.prototype.appendChild=domElement.prototype.appendChild,DocumentFragment$1.prototype.replaceChild=domElement.prototype.replaceChild,DocumentFragment$1.prototype.removeChild=domElement.prototype.removeChild,DocumentFragment$1.prototype.toString=function(){return this.childNodes.map((function(e){return String(e)})).join("")};
450
+
451
+ var event=Event$1;function Event$1(t){}Event$1.prototype.initEvent=function(t,e,n){this.type=t,this.bubbles=e,this.cancelable=n;},Event$1.prototype.preventDefault=function(){};
452
+
453
+ var document$1=Document$1;function Document$1(){if(!(this instanceof Document$1))return new Document$1;this.head=this.createElement("head"),this.body=this.createElement("body"),this.documentElement=this.createElement("html"),this.documentElement.appendChild(this.head),this.documentElement.appendChild(this.body),this.childNodes=[this.documentElement],this.nodeType=9;}var proto=Document$1.prototype;proto.createTextNode=function(e){return new domText(e,this)},proto.createElementNS=function(e,t){var o=null===e?null:String(e);return new domElement(t,this,o)},proto.createElement=function(e){return new domElement(e,this)},proto.createDocumentFragment=function(){return new domFragment(this)},proto.createEvent=function(e){return new event(e)},proto.createComment=function(e){return new domComment(e,this)},proto.getElementById=function(e){return e=String(e),domWalk(this.childNodes,(function(t){if(String(t.id)===e)return t}))||null},proto.getElementsByClassName=domElement.prototype.getElementsByClassName,proto.getElementsByTagName=domElement.prototype.getElementsByTagName,proto.contains=domElement.prototype.contains,proto.removeEventListener=removeEventListener_1,proto.addEventListener=addEventListener_1,proto.dispatchEvent=dispatchEvent_1;
454
+
455
+ var minDocument=new document$1;
456
+
457
+ var doccy,topLevel=void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof window?window:{};"undefined"!=typeof document?doccy=document:(doccy=topLevel["__GLOBAL_DOCUMENT_CACHE@4"])||(doccy=topLevel["__GLOBAL_DOCUMENT_CACHE@4"]=minDocument);var document_1=doccy;
458
+
459
+ var keycode=createCommonjsModule((function(e,o){function r(e){if(e&&"object"==typeof e){var o=e.which||e.keyCode||e.charCode;o&&(e=o);}if("number"==typeof e)return n[e];var r,c=String(e);return (r=a[c.toLowerCase()])?r:(r=t[c.toLowerCase()])||(1===c.length?c.charCodeAt(0):void 0)}r.isEventKey=function(e,o){if(e&&"object"==typeof e){var r=e.which||e.keyCode||e.charCode;if(null==r)return !1;if("string"==typeof o){var c;if(c=a[o.toLowerCase()])return c===r;if(c=t[o.toLowerCase()])return c===r}else if("number"==typeof o)return o===r;return !1}};var a=(o=e.exports=r).code=o.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},t=o.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};
460
+ /*!
461
+ * Programatically add the following
462
+ */
463
+ for(c=97;c<123;c++)a[String.fromCharCode(c)]=c-32;for(var c=48;c<58;c++)a[c-48]=c;for(c=1;c<13;c++)a["f"+c]=c+111;for(c=0;c<10;c++)a["numpad "+c]=c+96;var n=o.names=o.title={};for(c in a)n[a[c]]=c;for(var s in t)a[s]=t[s];}));keycode.code;keycode.codes;keycode.aliases;keycode.names;keycode.title;
464
+
465
+ var tuple=SafeParseTuple;function SafeParseTuple(e,r){var p,t=null;try{p=JSON.parse(e,r);}catch(e){t=e;}return [t,p]}
466
+
467
+ function _extends$1(){return _extends$1=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);}return e},_extends$1.apply(this,arguments)}
468
+
469
+ var isFunction_1=isFunction,toString$1=Object.prototype.toString;function isFunction(t){if(!t)return !1;var n=toString$1.call(t);return "[object Function]"===n||"function"==typeof t&&"[object RegExp]"!==n||"undefined"!=typeof window&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)}
470
+
471
+ var httpResponseHandler=function(e,t){return void 0===t&&(t=!1),function(r,o,n){if(r)e(r);else if(o.statusCode>=400&&o.statusCode<=599){var a=n;if(t)if(window_1.TextDecoder){var i=getCharset(o.headers&&o.headers["content-type"]);try{a=new TextDecoder(i).decode(n);}catch(e){}}else a=String.fromCharCode.apply(null,new Uint8Array(n));e({cause:a});}else e(null,n);}};function getCharset(e){return void 0===e&&(e=""),e.toLowerCase().split(";").reduce((function(e,t){var r=t.split("="),o=r[0],n=r[1];return "charset"===o.trim()?n.trim():e}),"utf-8")}var httpHandler=httpResponseHandler;
472
+
473
+ createXHR.httpHandler=httpHandler;
474
+ /**
475
+ * @license
476
+ * slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
477
+ * Copyright (c) 2014 David Björklund
478
+ * Available under the MIT license
479
+ * <https://github.com/kesla/parse-headers/blob/master/LICENCE>
480
+ */
481
+ var parseHeaders=function(e){var t={};return e?(e.trim().split("\n").forEach((function(e){var r=e.indexOf(":"),n=e.slice(0,r).trim().toLowerCase(),o=e.slice(r+1).trim();void 0===t[n]?t[n]=o:Array.isArray(t[n])?t[n].push(o):t[n]=[t[n],o];})),t):t},lib=createXHR,default_1=createXHR;function forEachArray(e,t){for(var r=0;r<e.length;r++)t(e[r]);}function isEmpty(e){for(var t in e)if(e.hasOwnProperty(t))return !1;return !0}function initParams(e,t,r){var n=e;return isFunction_1(t)?(r=t,"string"==typeof e&&(n={uri:e})):n=_extends$1({},t,{uri:e}),n.callback=r,n}function createXHR(e,t,r){return _createXHR(t=initParams(e,t,r))}function _createXHR(e){if(void 0===e.callback)throw new Error("callback argument missing");var t=!1,r=function(r,n,o){t||(t=!0,e.callback(r,n,o));};function n(){var e=void 0;if(e=u.response?u.response:u.responseText||getXml(u),h)try{e=JSON.parse(e);}catch(e){}return e}function o(e){return clearTimeout(p),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,r(e,R)}function s(){if(!i){var t;clearTimeout(p),t=e.useXDR&&void 0===u.status?200:1223===u.status?204:u.status;var o=R,s=null;return 0!==t?(o={body:n(),statusCode:t,method:d,headers:{},url:c,rawRequest:u},u.getAllResponseHeaders&&(o.headers=parseHeaders(u.getAllResponseHeaders()))):s=new Error("Internal XMLHttpRequest Error"),r(s,o,o.body)}}var a,i,u=e.xhr||null;u||(u=e.cors||e.useXDR?new createXHR.XDomainRequest:new createXHR.XMLHttpRequest);var p,c=u.url=e.uri||e.url,d=u.method=e.method||"GET",l=e.body||e.data,m=u.headers=e.headers||{},f=!!e.sync,h=!1,R={body:void 0,headers:{},statusCode:0,method:d,url:c,rawRequest:u};if("json"in e&&!1!==e.json&&(h=!0,m.accept||m.Accept||(m.Accept="application/json"),"GET"!==d&&"HEAD"!==d&&(m["content-type"]||m["Content-Type"]||(m["Content-Type"]="application/json"),l=JSON.stringify(!0===e.json?l:e.json))),u.onreadystatechange=function(){4===u.readyState&&setTimeout(s,0);},u.onload=s,u.onerror=o,u.onprogress=function(){},u.onabort=function(){i=!0;},u.ontimeout=o,u.open(d,c,!f,e.username,e.password),f||(u.withCredentials=!!e.withCredentials),!f&&e.timeout>0&&(p=setTimeout((function(){if(!i){i=!0,u.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",o(e);}}),e.timeout)),u.setRequestHeader)for(a in m)m.hasOwnProperty(a)&&u.setRequestHeader(a,m[a]);else if(e.headers&&!isEmpty(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return "responseType"in e&&(u.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(u),u.send(l||null),u}function getXml(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(e){}return null}function noop$1(){}createXHR.XMLHttpRequest=window_1.XMLHttpRequest||noop$1,createXHR.XDomainRequest="withCredentials"in new createXHR.XMLHttpRequest?createXHR.XMLHttpRequest:window_1.XDomainRequest,forEachArray(["get","put","post","patch","head","delete"],(function(e){createXHR["delete"===e?"del":e]=function(t,r,n){return (r=initParams(t,r,n)).method=e.toUpperCase(),_createXHR(r)};}));lib.default=default_1;
482
+
483
+ var _objCreate=Object.create||function(){function t(){}return function(e){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return t.prototype=e,new t}}();function ParsingError(t,e){this.name="ParsingError",this.code=t.code,this.message=e||t.message;}function parseTimeStamp(t){function e(t,e,r,i){return 3600*(0|t)+60*(0|e)+(0|r)+(0|i)/1e3}var r=t.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return r?r[3]?e(r[1],r[2],r[3].replace(":",""),r[4]):r[1]>59?e(r[1],r[2],0,r[4]):e(0,r[1],r[2],r[4]):null}function Settings(){this.values=_objCreate(null);}function parseOptions(t,e,r,i){var n=i?t.split(i):[t];for(var o in n)if("string"==typeof n[o]){var s=n[o].split(r);if(2===s.length)e(s[0].trim(),s[1].trim());}}function parseCue(t,e,r){var i=t;function n(){var e=parseTimeStamp(t);if(null===e)throw new ParsingError(ParsingError.Errors.BadTimeStamp,"Malformed timestamp: "+i);return t=t.replace(/^[^\sa-zA-Z-]+/,""),e}function o(){t=t.replace(/^\s+/,"");}if(o(),e.startTime=n(),o(),"--\x3e"!==t.substr(0,3))throw new ParsingError(ParsingError.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+i);t=t.substr(3),o(),e.endTime=n(),o(),function(t,e){var i=new Settings;parseOptions(t,(function(t,e){switch(t){case"region":for(var n=r.length-1;n>=0;n--)if(r[n].id===e){i.set(t,r[n].region);break}break;case"vertical":i.alt(t,e,["rl","lr"]);break;case"line":var o=e.split(","),s=o[0];i.integer(t,s),i.percent(t,s)&&i.set("snapToLines",!1),i.alt(t,s,["auto"]),2===o.length&&i.alt("lineAlign",o[1],["start","center","end"]);break;case"position":o=e.split(","),i.percent(t,o[0]),2===o.length&&i.alt("positionAlign",o[1],["start","center","end"]);break;case"size":i.percent(t,e);break;case"align":i.alt(t,e,["start","center","end","left","right"]);}}),/:/,/\s/),e.region=i.get("region",null),e.vertical=i.get("vertical","");try{e.line=i.get("line","auto");}catch(t){}e.lineAlign=i.get("lineAlign","start"),e.snapToLines=i.get("snapToLines",!0),e.size=i.get("size",100);try{e.align=i.get("align","center");}catch(t){e.align=i.get("align","middle");}try{e.position=i.get("position","auto");}catch(t){e.position=i.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},e.align);}e.positionAlign=i.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},e.align);}(t,e);}ParsingError.prototype=_objCreate(Error.prototype),ParsingError.prototype.constructor=ParsingError,ParsingError.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},Settings.prototype={set:function(t,e){this.get(t)||""===e||(this.values[t]=e);},get:function(t,e,r){return r?this.has(t)?this.values[t]:e[r]:this.has(t)?this.values[t]:e},has:function(t){return t in this.values},alt:function(t,e,r){for(var i=0;i<r.length;++i)if(e===r[i]){this.set(t,e);break}},integer:function(t,e){/^-?\d+$/.test(e)&&this.set(t,parseInt(e,10));},percent:function(t,e){return !!(e.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(e=parseFloat(e))>=0&&e<=100)&&(this.set(t,e),!0)}};var TEXTAREA_ELEMENT=document_1.createElement&&document_1.createElement("textarea"),TAG_NAME={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},DEFAULT_COLOR_CLASS={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},TAG_ANNOTATION={v:"title",lang:"lang"},NEEDS_PARENT={rt:"ruby"};function parseContent(t,e){function r(){if(!e)return null;var t,r=e.match(/^([^<]*)(<[^>]*>?)?/);return t=r[1]?r[1]:r[2],e=e.substr(t.length),t}function i(t,e){return !NEEDS_PARENT[e.localName]||NEEDS_PARENT[e.localName]===t.localName}function n(e,r){var i=TAG_NAME[e];if(!i)return null;var n=t.document.createElement(i),o=TAG_ANNOTATION[e];return o&&r&&(n[o]=r.trim()),n}for(var o,s,a=t.document.createElement("div"),l=a,c=[];null!==(o=r());)if("<"!==o[0])l.appendChild(t.document.createTextNode((s=o,TEXTAREA_ELEMENT.innerHTML=s,s=TEXTAREA_ELEMENT.textContent,TEXTAREA_ELEMENT.textContent="",s)));else {if("/"===o[1]){c.length&&c[c.length-1]===o.substr(2).replace(">","")&&(c.pop(),l=l.parentNode);continue}var h,u=parseTimeStamp(o.substr(1,o.length-2));if(u){h=t.document.createProcessingInstruction("timestamp",u),l.appendChild(h);continue}var p=o.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!p)continue;if(!(h=n(p[1],p[3])))continue;if(!i(l,h))continue;if(p[2]){var f=p[2].split(".");f.forEach((function(t){var e=/^bg_/.test(t),r=e?t.slice(3):t;if(DEFAULT_COLOR_CLASS.hasOwnProperty(r)){var i=e?"background-color":"color",n=DEFAULT_COLOR_CLASS[r];h.style[i]=n;}})),h.className=f.join(" ");}c.push(p[1]),l.appendChild(h),l=h;}return a}var strongRTLRanges=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function isStrongRTLChar(t){for(var e=0;e<strongRTLRanges.length;e++){var r=strongRTLRanges[e];if(t>=r[0]&&t<=r[1])return !0}return !1}function determineBidi(t){var e=[],r="";if(!t||!t.childNodes)return "ltr";function i(t,e){for(var r=e.childNodes.length-1;r>=0;r--)t.push(e.childNodes[r]);}function n(t){if(!t||!t.length)return null;var e=t.pop(),r=e.textContent||e.innerText;if(r){var o=r.match(/^.*(\n|\r)/);return o?(t.length=0,o[0]):r}return "ruby"===e.tagName?n(t):e.childNodes?(i(t,e),n(t)):void 0}for(i(e,t);r=n(e);)for(var o=0;o<r.length;o++)if(isStrongRTLChar(r.charCodeAt(o)))return "rtl";return "ltr"}function computeLinePos(t){if("number"==typeof t.line&&(t.snapToLines||t.line>=0&&t.line<=100))return t.line;if(!t.track||!t.track.textTrackList||!t.track.textTrackList.mediaElement)return -1;for(var e=t.track,r=e.textTrackList,i=0,n=0;n<r.length&&r[n]!==e;n++)"showing"===r[n].mode&&i++;return -1*++i}function StyleBox(){}function CueStyleBox(t,e,r){StyleBox.call(this),this.cue=e,this.cueDiv=parseContent(t,e.text);var i={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:""===e.vertical?"horizontal-tb":"lr"===e.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(i,this.cueDiv),this.div=t.document.createElement("div"),i={direction:determineBidi(this.cueDiv),writingMode:""===e.vertical?"horizontal-tb":"lr"===e.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:"middle"===e.align?"center":e.align,font:r.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(i),this.div.appendChild(this.cueDiv);var n=0;switch(e.positionAlign){case"start":n=e.position;break;case"center":n=e.position-e.size/2;break;case"end":n=e.position-e.size;}""===e.vertical?this.applyStyles({left:this.formatStyle(n,"%"),width:this.formatStyle(e.size,"%")}):this.applyStyles({top:this.formatStyle(n,"%"),height:this.formatStyle(e.size,"%")}),this.move=function(t){this.applyStyles({top:this.formatStyle(t.top,"px"),bottom:this.formatStyle(t.bottom,"px"),left:this.formatStyle(t.left,"px"),right:this.formatStyle(t.right,"px"),height:this.formatStyle(t.height,"px"),width:this.formatStyle(t.width,"px")});};}function BoxPosition(t){var e,r,i,n;if(t.div){r=t.div.offsetHeight,i=t.div.offsetWidth,n=t.div.offsetTop;var o=(o=t.div.childNodes)&&(o=o[0])&&o.getClientRects&&o.getClientRects();t=t.div.getBoundingClientRect(),e=o?Math.max(o[0]&&o[0].height||0,t.height/o.length):0;}this.left=t.left,this.right=t.right,this.top=t.top||n,this.height=t.height||r,this.bottom=t.bottom||n+(t.height||r),this.width=t.width||i,this.lineHeight=void 0!==e?e:t.lineHeight;}function moveBoxToLinePosition(t,e,r,i){var n=new BoxPosition(e),o=e.cue,s=computeLinePos(o),a=[];if(o.snapToLines){var l;switch(o.vertical){case"":a=["+y","-y"],l="height";break;case"rl":a=["+x","-x"],l="width";break;case"lr":a=["-x","+x"],l="width";}var c=n.lineHeight,h=c*Math.round(s),u=r[l]+c,p=a[0];Math.abs(h)>u&&(h=h<0?-1:1,h*=Math.ceil(u/c)*c),s<0&&(h+=""===o.vertical?r.height:r.width,a=a.reverse()),n.move(p,h);}else {var f=n.lineHeight/r.height*100;switch(o.lineAlign){case"center":s-=f/2;break;case"end":s-=f;}switch(o.vertical){case"":e.applyStyles({top:e.formatStyle(s,"%")});break;case"rl":e.applyStyles({left:e.formatStyle(s,"%")});break;case"lr":e.applyStyles({right:e.formatStyle(s,"%")});}a=["+y","-x","+x","-y"],n=new BoxPosition(e);}var g=function(t,e){for(var n,o=new BoxPosition(t),s=1,a=0;a<e.length;a++){for(;t.overlapsOppositeAxis(r,e[a])||t.within(r)&&t.overlapsAny(i);)t.move(e[a]);if(t.within(r))return t;var l=t.intersectPercentage(r);s>l&&(n=new BoxPosition(t),s=l),t=new BoxPosition(o);}return n||o}(n,a);e.move(g.toCSSCompatValues(r));}function WebVTT$1(){}StyleBox.prototype.applyStyles=function(t,e){for(var r in e=e||this.div,t)t.hasOwnProperty(r)&&(e.style[r]=t[r]);},StyleBox.prototype.formatStyle=function(t,e){return 0===t?0:t+e},CueStyleBox.prototype=_objCreate(StyleBox.prototype),CueStyleBox.prototype.constructor=CueStyleBox,BoxPosition.prototype.move=function(t,e){switch(e=void 0!==e?e:this.lineHeight,t){case"+x":this.left+=e,this.right+=e;break;case"-x":this.left-=e,this.right-=e;break;case"+y":this.top+=e,this.bottom+=e;break;case"-y":this.top-=e,this.bottom-=e;}},BoxPosition.prototype.overlaps=function(t){return this.left<t.right&&this.right>t.left&&this.top<t.bottom&&this.bottom>t.top},BoxPosition.prototype.overlapsAny=function(t){for(var e=0;e<t.length;e++)if(this.overlaps(t[e]))return !0;return !1},BoxPosition.prototype.within=function(t){return this.top>=t.top&&this.bottom<=t.bottom&&this.left>=t.left&&this.right<=t.right},BoxPosition.prototype.overlapsOppositeAxis=function(t,e){switch(e){case"+x":return this.left<t.left;case"-x":return this.right>t.right;case"+y":return this.top<t.top;case"-y":return this.bottom>t.bottom}},BoxPosition.prototype.intersectPercentage=function(t){return Math.max(0,Math.min(this.right,t.right)-Math.max(this.left,t.left))*Math.max(0,Math.min(this.bottom,t.bottom)-Math.max(this.top,t.top))/(this.height*this.width)},BoxPosition.prototype.toCSSCompatValues=function(t){return {top:this.top-t.top,bottom:t.bottom-this.bottom,left:this.left-t.left,right:t.right-this.right,height:this.height,width:this.width}},BoxPosition.getSimpleBoxPosition=function(t){var e=t.div?t.div.offsetHeight:t.tagName?t.offsetHeight:0,r=t.div?t.div.offsetWidth:t.tagName?t.offsetWidth:0,i=t.div?t.div.offsetTop:t.tagName?t.offsetTop:0;return {left:(t=t.div?t.div.getBoundingClientRect():t.tagName?t.getBoundingClientRect():t).left,right:t.right,top:t.top||i,height:t.height||e,bottom:t.bottom||i+(t.height||e),width:t.width||r}},WebVTT$1.StringDecoder=function(){return {decode:function(t){if(!t)return "";if("string"!=typeof t)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))}}},WebVTT$1.convertCueToDOMTree=function(t,e){return t&&e?parseContent(t,e):null};var FONT_SIZE_PERCENT=.05,FONT_STYLE="sans-serif",CUE_BACKGROUND_PADDING="1.5%";WebVTT$1.processCues=function(t,e,r){if(!t||!e||!r)return null;for(;r.firstChild;)r.removeChild(r.firstChild);var i=t.document.createElement("div");if(i.style.position="absolute",i.style.left="0",i.style.right="0",i.style.top="0",i.style.bottom="0",i.style.margin=CUE_BACKGROUND_PADDING,r.appendChild(i),function(t){for(var e=0;e<t.length;e++)if(t[e].hasBeenReset||!t[e].displayState)return !0;return !1}(e)){var n=[],o=BoxPosition.getSimpleBoxPosition(i),s={font:Math.round(o.height*FONT_SIZE_PERCENT*100)/100+"px "+FONT_STYLE};!function(){for(var r,a,l=0;l<e.length;l++)a=e[l],r=new CueStyleBox(t,a,s),i.appendChild(r.div),moveBoxToLinePosition(t,r,o,n),a.displayState=r.div,n.push(BoxPosition.getSimpleBoxPosition(r));}();}else for(var a=0;a<e.length;a++)i.appendChild(e[a].displayState);},WebVTT$1.Parser=function(t,e,r){r||(r=e,e={}),e||(e={}),this.window=t,this.vttjs=e,this.state="INITIAL",this.buffer="",this.decoder=r||new TextDecoder("utf8"),this.regionList=[];},WebVTT$1.Parser.prototype={reportOrThrowError:function(t){if(!(t instanceof ParsingError))throw t;this.onparsingerror&&this.onparsingerror(t);},parse:function(t){var e=this;function r(){for(var t=e.buffer,r=0;r<t.length&&"\r"!==t[r]&&"\n"!==t[r];)++r;var i=t.substr(0,r);return "\r"===t[r]&&++r,"\n"===t[r]&&++r,e.buffer=t.substr(r),i}function i(t){t.match(/X-TIMESTAMP-MAP/)?parseOptions(t,(function(t,r){if("X-TIMESTAMP-MAP"===t)!function(t){var r=new Settings;parseOptions(t,(function(t,e){switch(t){case"MPEGT":r.integer(t+"S",e);break;case"LOCA":r.set(t+"L",parseTimeStamp(e));}}),/[^\d]:/,/,/),e.ontimestampmap&&e.ontimestampmap({MPEGTS:r.get("MPEGTS"),LOCAL:r.get("LOCAL")});}(r);}),/=/):parseOptions(t,(function(t,r){if("Region"===t)!function(t){var r=new Settings;if(parseOptions(t,(function(t,e){switch(t){case"id":r.set(t,e);break;case"width":r.percent(t,e);break;case"lines":r.integer(t,e);break;case"regionanchor":case"viewportanchor":var i=e.split(",");if(2!==i.length)break;var n=new Settings;if(n.percent("x",i[0]),n.percent("y",i[1]),!n.has("x")||!n.has("y"))break;r.set(t+"X",n.get("x")),r.set(t+"Y",n.get("y"));break;case"scroll":r.alt(t,e,["up"]);}}),/=/,/\s/),r.has("id")){var i=new(e.vttjs.VTTRegion||e.window.VTTRegion);i.width=r.get("width",100),i.lines=r.get("lines",3),i.regionAnchorX=r.get("regionanchorX",0),i.regionAnchorY=r.get("regionanchorY",100),i.viewportAnchorX=r.get("viewportanchorX",0),i.viewportAnchorY=r.get("viewportanchorY",100),i.scroll=r.get("scroll",""),e.onregion&&e.onregion(i),e.regionList.push({id:r.get("id"),region:i});}}(r);}),/:/);}t&&(e.buffer+=e.decoder.decode(t,{stream:!0}));try{var n;if("INITIAL"===e.state){if(!/\r\n|\n/.test(e.buffer))return this;var o=(n=r()).match(/^WEBVTT([ \t].*)?$/);if(!o||!o[0])throw new ParsingError(ParsingError.Errors.BadSignature);e.state="HEADER";}for(var s=!1;e.buffer;){if(!/\r\n|\n/.test(e.buffer))return this;switch(s?s=!1:n=r(),e.state){case"HEADER":/:/.test(n)?i(n):n||(e.state="ID");continue;case"NOTE":n||(e.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(n)){e.state="NOTE";break}if(!n)continue;e.cue=new(e.vttjs.VTTCue||e.window.VTTCue)(0,0,"");try{e.cue.align="center";}catch(t){e.cue.align="middle";}if(e.state="CUE",-1===n.indexOf("--\x3e")){e.cue.id=n;continue}case"CUE":try{parseCue(n,e.cue,e.regionList);}catch(t){e.reportOrThrowError(t),e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":var a=-1!==n.indexOf("--\x3e");if(!n||a&&(s=!0)){e.oncue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}e.cue.text&&(e.cue.text+="\n"),e.cue.text+=n.replace(/\u2028/g,"\n").replace(/u2029/g,"\n");continue;case"BADCUE":n||(e.state="ID");continue}}}catch(t){e.reportOrThrowError(t),"CUETEXT"===e.state&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state="INITIAL"===e.state?"BADWEBVTT":"BADCUE";}return this},flush:function(){var t=this;try{if(t.buffer+=t.decoder.decode(),(t.cue||"HEADER"===t.state)&&(t.buffer+="\n\n",t.parse()),"INITIAL"===t.state)throw new ParsingError(ParsingError.Errors.BadSignature)}catch(e){t.reportOrThrowError(e);}return t.onflush&&t.onflush(),this}};var vtt=WebVTT$1;
484
+
485
+ var autoKeyword="auto",directionSetting={"":1,lr:1,rl:1},alignSetting={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function findDirectionSetting(e){return "string"==typeof e&&(!!directionSetting[e.toLowerCase()]&&e.toLowerCase())}function findAlignSetting(e){return "string"==typeof e&&(!!alignSetting[e.toLowerCase()]&&e.toLowerCase())}function VTTCue(e,t,n){this.hasBeenReset=!1;var i="",r=!1,o=e,s=t,u=n,a=null,l="",f=!0,c="auto",g="start",h="auto",d="auto",m=100,w="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return i},set:function(e){i=""+e;}},pauseOnExit:{enumerable:!0,get:function(){return r},set:function(e){r=!!e;}},startTime:{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");o=e,this.hasBeenReset=!0;}},endTime:{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");s=e,this.hasBeenReset=!0;}},text:{enumerable:!0,get:function(){return u},set:function(e){u=""+e,this.hasBeenReset=!0;}},region:{enumerable:!0,get:function(){return a},set:function(e){a=e,this.hasBeenReset=!0;}},vertical:{enumerable:!0,get:function(){return l},set:function(e){var t=findDirectionSetting(e);if(!1===t)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");l=t,this.hasBeenReset=!0;}},snapToLines:{enumerable:!0,get:function(){return f},set:function(e){f=!!e,this.hasBeenReset=!0;}},line:{enumerable:!0,get:function(){return c},set:function(e){if("number"!=typeof e&&e!==autoKeyword)throw new SyntaxError("Line: an invalid number or illegal string was specified.");c=e,this.hasBeenReset=!0;}},lineAlign:{enumerable:!0,get:function(){return g},set:function(e){var t=findAlignSetting(e);t?(g=t,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.");}},position:{enumerable:!0,get:function(){return h},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");h=e,this.hasBeenReset=!0;}},positionAlign:{enumerable:!0,get:function(){return d},set:function(e){var t=findAlignSetting(e);t?(d=t,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.");}},size:{enumerable:!0,get:function(){return m},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");m=e,this.hasBeenReset=!0;}},align:{enumerable:!0,get:function(){return w},set:function(e){var t=findAlignSetting(e);if(!t)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");w=t,this.hasBeenReset=!0;}}}),this.displayState=void 0;}VTTCue.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var vttcue=VTTCue;
486
+
487
+ var scrollSetting={"":!0,up:!0};function findScrollSetting(e){return "string"==typeof e&&(!!scrollSetting[e.toLowerCase()]&&e.toLowerCase())}function isValidPercentValue(e){return "number"==typeof e&&e>=0&&e<=100}function VTTRegion(){var e=100,n=3,t=0,r=100,o=0,i=100,u="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(n){if(!isValidPercentValue(n))throw new Error("Width must be between 0 and 100.");e=n;}},lines:{enumerable:!0,get:function(){return n},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");n=e;}},regionAnchorY:{enumerable:!0,get:function(){return r},set:function(e){if(!isValidPercentValue(e))throw new Error("RegionAnchorX must be between 0 and 100.");r=e;}},regionAnchorX:{enumerable:!0,get:function(){return t},set:function(e){if(!isValidPercentValue(e))throw new Error("RegionAnchorY must be between 0 and 100.");t=e;}},viewportAnchorY:{enumerable:!0,get:function(){return i},set:function(e){if(!isValidPercentValue(e))throw new Error("ViewportAnchorY must be between 0 and 100.");i=e;}},viewportAnchorX:{enumerable:!0,get:function(){return o},set:function(e){if(!isValidPercentValue(e))throw new Error("ViewportAnchorX must be between 0 and 100.");o=e;}},scroll:{enumerable:!0,get:function(){return u},set:function(e){var n=findScrollSetting(e);!1===n?console.warn("Scroll: an invalid or illegal string was specified."):u=n;}}});}var vttregion=VTTRegion;
488
+
489
+ var browserIndex=createCommonjsModule((function(o){var e=o.exports={WebVTT:vtt,VTTCue:vttcue,VTTRegion:vttregion};window_1.vttjs=e,window_1.WebVTT=e.WebVTT;var r=e.VTTCue,n=e.VTTRegion,i=window_1.VTTCue,s=window_1.VTTRegion;e.shim=function(){window_1.VTTCue=r,window_1.VTTRegion=n;},e.restore=function(){window_1.VTTCue=i,window_1.VTTRegion=s;},window_1.VTTCue||e.shim();}));browserIndex.WebVTT;browserIndex.VTTCue;browserIndex.VTTRegion;
490
+
491
+ var urlToolkit=createCommonjsModule((function(r,e){var a,t,o,n,p;a=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,t=/^(?=([^\/?#]*))\1([^]*)$/,o=/(?:\/|^)\.(?=\/)/g,n=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,p={buildAbsoluteURL:function(r,e,a){if(a=a||{},r=r.trim(),!(e=e.trim())){if(!a.alwaysNormalize)return r;var o=p.parseURL(r);if(!o)throw new Error("Error trying to parse base URL.");return o.path=p.normalizePath(o.path),p.buildURLFromParts(o)}var n=p.parseURL(e);if(!n)throw new Error("Error trying to parse relative URL.");if(n.scheme)return a.alwaysNormalize?(n.path=p.normalizePath(n.path),p.buildURLFromParts(n)):e;var s=p.parseURL(r);if(!s)throw new Error("Error trying to parse base URL.");if(!s.netLoc&&s.path&&"/"!==s.path[0]){var l=t.exec(s.path);s.netLoc=l[1],s.path=l[2];}s.netLoc&&!s.path&&(s.path="/");var m={scheme:s.scheme,netLoc:n.netLoc,path:null,params:n.params,query:n.query,fragment:n.fragment};if(!n.netLoc&&(m.netLoc=s.netLoc,"/"!==n.path[0]))if(n.path){var i=s.path,h=i.substring(0,i.lastIndexOf("/")+1)+n.path;m.path=p.normalizePath(h);}else m.path=s.path,n.params||(m.params=s.params,n.query||(m.query=s.query));return null===m.path&&(m.path=a.alwaysNormalize?p.normalizePath(n.path):n.path),p.buildURLFromParts(m)},parseURL:function(r){var e=a.exec(r);return e?{scheme:e[1]||"",netLoc:e[2]||"",path:e[3]||"",params:e[4]||"",query:e[5]||"",fragment:e[6]||""}:null},normalizePath:function(r){for(r=r.split("").reverse().join("").replace(o,"");r.length!==(r=r.replace(n,"")).length;);return r.split("").reverse().join("")},buildURLFromParts:function(r){return r.scheme+r.netLoc+r.path+r.params+r.query+r.fragment}},r.exports=p;}));
492
+
493
+ var DEFAULT_LOCATION$1="http://example.com",resolveUrl$2=function(o,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(o)&&(o=window_1.location&&window_1.location.href||"");var i="function"==typeof window_1.URL,e=/^\/\//.test(o),l=!window_1.location&&!/\/\//i.test(o);if(i?o=new window_1.URL(o,window_1.location||DEFAULT_LOCATION$1):/\/\//i.test(o)||(o=urlToolkit.buildAbsoluteURL(window_1.location&&window_1.location.href||"",o)),i){var n=new URL(t,o);return l?n.href.slice(DEFAULT_LOCATION$1.length):e?n.href.slice(n.protocol.length):n.href}return urlToolkit.buildAbsoluteURL(o,t)};
494
+
495
+ var Stream=function(){function t(){this.listeners={};}var s=t.prototype;return s.on=function(t,s){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(s);},s.off=function(t,s){if(!this.listeners[t])return !1;var e=this.listeners[t].indexOf(s);return this.listeners[t]=this.listeners[t].slice(0),this.listeners[t].splice(e,1),e>-1},s.trigger=function(t){var s=this.listeners[t];if(s)if(2===arguments.length)for(var e=s.length,i=0;i<e;++i)s[i].call(this,arguments[1]);else for(var n=Array.prototype.slice.call(arguments,1),r=s.length,l=0;l<r;++l)s[l].apply(this,n);},s.dispose=function(){this.listeners={};},s.pipe=function(t){this.on("data",(function(s){t.push(s);}));},t}();
496
+
497
+ var atob$1=function(o){return window_1.atob?window_1.atob(o):Buffer.from(o,"base64").toString("binary")};function decodeB64ToUint8Array$1(o){for(var r=atob$1(o),n=new Uint8Array(r.length),t=0;t<r.length;t++)n[t]=r.charCodeAt(t);return n}
498
+
499
+ class LineStream extends Stream{constructor(){super(),this.buffer="";}push(t){let e;for(this.buffer+=t,e=this.buffer.indexOf("\n");e>-1;e=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,e)),this.buffer=this.buffer.substring(e+1);}}const TAB=String.fromCharCode(9),parseByterange=function(t){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(t||""),i={};return e[1]&&(i.length=parseInt(e[1],10)),e[2]&&(i.offset=parseInt(e[2],10)),i},parseAttributes$1=function(t){const e={};if(!t)return e;const i=t.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))'));let r,a=i.length;for(;a--;)""!==i[a]&&(r=/([^=]*)=(.*)/.exec(i[a]).slice(1),r[0]=r[0].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^['"](.*)['"]$/g,"$1"),e[r[0]]=r[1]);return e};class ParseStream extends Stream{constructor(){super(),this.customParsers=[],this.tagMappers=[];}push(t){let e,i;if(0===(t=t.trim()).length)return;if("#"!==t[0])return void this.trigger("data",{type:"uri",uri:t});this.tagMappers.reduce(((e,i)=>{const r=i(t);return r===t?e:e.concat([r])}),[t]).forEach((t=>{for(let e=0;e<this.customParsers.length;e++)if(this.customParsers[e].call(this,t))return;if(0===t.indexOf("#EXT"))if(t=t.replace("\r",""),e=/^#EXTM3U/.exec(t),e)this.trigger("data",{type:"tag",tagType:"m3u"});else {if(e=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(t),e)return i={type:"tag",tagType:"inf"},e[1]&&(i.duration=parseFloat(e[1])),e[2]&&(i.title=e[2]),void this.trigger("data",i);if(e=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(t),e)return i={type:"tag",tagType:"targetduration"},e[1]&&(i.duration=parseInt(e[1],10)),void this.trigger("data",i);if(e=/^#EXT-X-VERSION:([0-9.]*)?/.exec(t),e)return i={type:"tag",tagType:"version"},e[1]&&(i.version=parseInt(e[1],10)),void this.trigger("data",i);if(e=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(t),e)return i={type:"tag",tagType:"media-sequence"},e[1]&&(i.number=parseInt(e[1],10)),void this.trigger("data",i);if(e=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(t),e)return i={type:"tag",tagType:"discontinuity-sequence"},e[1]&&(i.number=parseInt(e[1],10)),void this.trigger("data",i);if(e=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(t),e)return i={type:"tag",tagType:"playlist-type"},e[1]&&(i.playlistType=e[1]),void this.trigger("data",i);if(e=/^#EXT-X-BYTERANGE:(.*)?$/.exec(t),e)return i=_extends$1(parseByterange(e[1]),{type:"tag",tagType:"byterange"}),void this.trigger("data",i);if(e=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(t),e)return i={type:"tag",tagType:"allow-cache"},e[1]&&(i.allowed=!/NO/.test(e[1])),void this.trigger("data",i);if(e=/^#EXT-X-MAP:(.*)$/.exec(t),e){if(i={type:"tag",tagType:"map"},e[1]){const t=parseAttributes$1(e[1]);t.URI&&(i.uri=t.URI),t.BYTERANGE&&(i.byterange=parseByterange(t.BYTERANGE));}this.trigger("data",i);}else if(e=/^#EXT-X-STREAM-INF:(.*)$/.exec(t),e){if(i={type:"tag",tagType:"stream-inf"},e[1]){if(i.attributes=parseAttributes$1(e[1]),i.attributes.RESOLUTION){const t=i.attributes.RESOLUTION.split("x"),e={};t[0]&&(e.width=parseInt(t[0],10)),t[1]&&(e.height=parseInt(t[1],10)),i.attributes.RESOLUTION=e;}i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes["FRAME-RATE"]&&(i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])),i.attributes["PROGRAM-ID"]&&(i.attributes["PROGRAM-ID"]=parseInt(i.attributes["PROGRAM-ID"],10));}this.trigger("data",i);}else {if(e=/^#EXT-X-MEDIA:(.*)$/.exec(t),e)return i={type:"tag",tagType:"media"},e[1]&&(i.attributes=parseAttributes$1(e[1])),void this.trigger("data",i);if(e=/^#EXT-X-ENDLIST/.exec(t),e)this.trigger("data",{type:"tag",tagType:"endlist"});else if(e=/^#EXT-X-DISCONTINUITY/.exec(t),e)this.trigger("data",{type:"tag",tagType:"discontinuity"});else {if(e=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(t),e)return i={type:"tag",tagType:"program-date-time"},e[1]&&(i.dateTimeString=e[1],i.dateTimeObject=new Date(e[1])),void this.trigger("data",i);if(e=/^#EXT-X-KEY:(.*)$/.exec(t),e)return i={type:"tag",tagType:"key"},e[1]&&(i.attributes=parseAttributes$1(e[1]),i.attributes.IV&&("0x"===i.attributes.IV.substring(0,2).toLowerCase()&&(i.attributes.IV=i.attributes.IV.substring(2)),i.attributes.IV=i.attributes.IV.match(/.{8}/g),i.attributes.IV[0]=parseInt(i.attributes.IV[0],16),i.attributes.IV[1]=parseInt(i.attributes.IV[1],16),i.attributes.IV[2]=parseInt(i.attributes.IV[2],16),i.attributes.IV[3]=parseInt(i.attributes.IV[3],16),i.attributes.IV=new Uint32Array(i.attributes.IV))),void this.trigger("data",i);if(e=/^#EXT-X-START:(.*)$/.exec(t),e)return i={type:"tag",tagType:"start"},e[1]&&(i.attributes=parseAttributes$1(e[1]),i.attributes["TIME-OFFSET"]=parseFloat(i.attributes["TIME-OFFSET"]),i.attributes.PRECISE=/YES/.test(i.attributes.PRECISE)),void this.trigger("data",i);if(e=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(t),e)return i={type:"tag",tagType:"cue-out-cont"},e[1]?i.data=e[1]:i.data="",void this.trigger("data",i);if(e=/^#EXT-X-CUE-OUT:(.*)?$/.exec(t),e)return i={type:"tag",tagType:"cue-out"},e[1]?i.data=e[1]:i.data="",void this.trigger("data",i);if(e=/^#EXT-X-CUE-IN:(.*)?$/.exec(t),e)return i={type:"tag",tagType:"cue-in"},e[1]?i.data=e[1]:i.data="",void this.trigger("data",i);if(e=/^#EXT-X-SKIP:(.*)$/.exec(t),e&&e[1])return i={type:"tag",tagType:"skip"},i.attributes=parseAttributes$1(e[1]),i.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(i.attributes["SKIPPED-SEGMENTS"]=parseInt(i.attributes["SKIPPED-SEGMENTS"],10)),i.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(i.attributes["RECENTLY-REMOVED-DATERANGES"]=i.attributes["RECENTLY-REMOVED-DATERANGES"].split(TAB)),void this.trigger("data",i);if(e=/^#EXT-X-PART:(.*)$/.exec(t),e&&e[1])return i={type:"tag",tagType:"part"},i.attributes=parseAttributes$1(e[1]),["DURATION"].forEach((function(t){i.attributes.hasOwnProperty(t)&&(i.attributes[t]=parseFloat(i.attributes[t]));})),["INDEPENDENT","GAP"].forEach((function(t){i.attributes.hasOwnProperty(t)&&(i.attributes[t]=/YES/.test(i.attributes[t]));})),i.attributes.hasOwnProperty("BYTERANGE")&&(i.attributes.byterange=parseByterange(i.attributes.BYTERANGE)),void this.trigger("data",i);if(e=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(t),e&&e[1])return i={type:"tag",tagType:"server-control"},i.attributes=parseAttributes$1(e[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach((function(t){i.attributes.hasOwnProperty(t)&&(i.attributes[t]=parseFloat(i.attributes[t]));})),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach((function(t){i.attributes.hasOwnProperty(t)&&(i.attributes[t]=/YES/.test(i.attributes[t]));})),void this.trigger("data",i);if(e=/^#EXT-X-PART-INF:(.*)$/.exec(t),e&&e[1])return i={type:"tag",tagType:"part-inf"},i.attributes=parseAttributes$1(e[1]),["PART-TARGET"].forEach((function(t){i.attributes.hasOwnProperty(t)&&(i.attributes[t]=parseFloat(i.attributes[t]));})),void this.trigger("data",i);if(e=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(t),e&&e[1])return i={type:"tag",tagType:"preload-hint"},i.attributes=parseAttributes$1(e[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach((function(t){if(i.attributes.hasOwnProperty(t)){i.attributes[t]=parseInt(i.attributes[t],10);const e="BYTERANGE-LENGTH"===t?"length":"offset";i.attributes.byterange=i.attributes.byterange||{},i.attributes.byterange[e]=i.attributes[t],delete i.attributes[t];}})),void this.trigger("data",i);if(e=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(t),e&&e[1])return i={type:"tag",tagType:"rendition-report"},i.attributes=parseAttributes$1(e[1]),["LAST-MSN","LAST-PART"].forEach((function(t){i.attributes.hasOwnProperty(t)&&(i.attributes[t]=parseInt(i.attributes[t],10));})),void this.trigger("data",i);this.trigger("data",{type:"tag",data:t.slice(4)});}}}else this.trigger("data",{type:"comment",text:t.slice(1)});}));}addParser({expression:t,customType:e,dataParser:i,segment:r}){"function"!=typeof i&&(i=t=>t),this.customParsers.push((a=>{if(t.exec(a))return this.trigger("data",{type:"custom",data:i(a),customType:e,segment:r}),!0}));}addTagMapper({expression:t,map:e}){this.tagMappers.push((i=>t.test(i)?e(i):i));}}const camelCaseKeys=function(t){const e={};return Object.keys(t).forEach((function(i){var r;e[(r=i,r.toLowerCase().replace(/-(\w)/g,(t=>t[1].toUpperCase())))]=t[i];})),e},setHoldBack=function(t){const{serverControl:e,targetDuration:i,partTargetDuration:r}=t;if(!e)return;const a="#EXT-X-SERVER-CONTROL",s="holdBack",n="partHoldBack",u=i&&3*i,o=r&&2*r;i&&!e.hasOwnProperty(s)&&(e[s]=u,this.trigger("info",{message:`${a} defaulting HOLD-BACK to targetDuration * 3 (${u}).`})),u&&e[s]<u&&(this.trigger("warn",{message:`${a} clamping HOLD-BACK (${e[s]}) to targetDuration * 3 (${u})`}),e[s]=u),r&&!e.hasOwnProperty(n)&&(e[n]=3*r,this.trigger("info",{message:`${a} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${e[n]}).`})),r&&e[n]<o&&(this.trigger("warn",{message:`${a} clamping PART-HOLD-BACK (${e[n]}) to partTargetDuration * 2 (${o}).`}),e[n]=o);};class Parser extends Stream{constructor(){super(),this.lineStream=new LineStream,this.parseStream=new ParseStream,this.lineStream.pipe(this.parseStream);const t=this,e=[];let i,r,a={},s=!1;const n=function(){},u={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}};let o=0;this.manifest={allowCache:!0,discontinuityStarts:[],segments:[]};let g=0,p=0;this.on("end",(()=>{a.uri||!a.parts&&!a.preloadHints||(!a.map&&i&&(a.map=i),!a.key&&r&&(a.key=r),a.timeline||"number"!=typeof o||(a.timeline=o),this.manifest.preloadSegment=a);})),this.parseStream.on("data",(function(d){let c,h;({tag(){({version(){d.version&&(this.manifest.version=d.version);},"allow-cache"(){this.manifest.allowCache=d.allowed,"allowed"in d||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0);},byterange(){const t={};"length"in d&&(a.byterange=t,t.length=d.length,"offset"in d||(d.offset=g)),"offset"in d&&(a.byterange=t,t.offset=d.offset),g=t.offset+t.length;},endlist(){this.manifest.endList=!0;},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),d.duration>0&&(a.duration=d.duration),0===d.duration&&(a.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=e;},key(){if(d.attributes)if("NONE"!==d.attributes.METHOD)if(d.attributes.URI){if("com.apple.streamingkeydelivery"===d.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:d.attributes});if("com.microsoft.playready"===d.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.microsoft.playready"]={uri:d.attributes.URI});if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===d.attributes.KEYFORMAT){return -1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(d.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===d.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==d.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):d.attributes.KEYID&&"0x"===d.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:d.attributes.KEYFORMAT,keyId:d.attributes.KEYID.substring(2)},pssh:decodeB64ToUint8Array$1(d.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}))}d.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),r={method:d.attributes.METHOD||"AES-128",uri:d.attributes.URI},void 0!==d.attributes.IV&&(r.iv=d.attributes.IV);}else this.trigger("warn",{message:"ignoring key declaration without URI"});else r=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"});},"media-sequence"(){isFinite(d.number)?this.manifest.mediaSequence=d.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+d.number});},"discontinuity-sequence"(){isFinite(d.number)?(this.manifest.discontinuitySequence=d.number,o=d.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+d.number});},"playlist-type"(){/VOD|EVENT/.test(d.playlistType)?this.manifest.playlistType=d.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+d.playlist});},map(){i={},d.uri&&(i.uri=d.uri),d.byterange&&(i.byterange=d.byterange),r&&(i.key=r);},"stream-inf"(){this.manifest.playlists=e,this.manifest.mediaGroups=this.manifest.mediaGroups||u,d.attributes?(a.attributes||(a.attributes={}),_extends$1(a.attributes,d.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"});},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||u,!(d.attributes&&d.attributes.TYPE&&d.attributes["GROUP-ID"]&&d.attributes.NAME))return void this.trigger("warn",{message:"ignoring incomplete or missing media group"});const t=this.manifest.mediaGroups[d.attributes.TYPE];t[d.attributes["GROUP-ID"]]=t[d.attributes["GROUP-ID"]]||{},c=t[d.attributes["GROUP-ID"]],h={default:/yes/i.test(d.attributes.DEFAULT)},h.default?h.autoselect=!0:h.autoselect=/yes/i.test(d.attributes.AUTOSELECT),d.attributes.LANGUAGE&&(h.language=d.attributes.LANGUAGE),d.attributes.URI&&(h.uri=d.attributes.URI),d.attributes["INSTREAM-ID"]&&(h.instreamId=d.attributes["INSTREAM-ID"]),d.attributes.CHARACTERISTICS&&(h.characteristics=d.attributes.CHARACTERISTICS),d.attributes.FORCED&&(h.forced=/yes/i.test(d.attributes.FORCED)),c[d.attributes.NAME]=h;},discontinuity(){o+=1,a.discontinuity=!0,this.manifest.discontinuityStarts.push(e.length);},"program-date-time"(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=d.dateTimeString,this.manifest.dateTimeObject=d.dateTimeObject),a.dateTimeString=d.dateTimeString,a.dateTimeObject=d.dateTimeObject;},targetduration(){!isFinite(d.duration)||d.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+d.duration}):(this.manifest.targetDuration=d.duration,setHoldBack.call(this,this.manifest));},start(){d.attributes&&!isNaN(d.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:d.attributes["TIME-OFFSET"],precise:d.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});},"cue-out"(){a.cueOut=d.data;},"cue-out-cont"(){a.cueOutCont=d.data;},"cue-in"(){a.cueIn=d.data;},skip(){this.manifest.skip=camelCaseKeys(d.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",d.attributes,["SKIPPED-SEGMENTS"]);},part(){s=!0;const t=this.manifest.segments.length,e=camelCaseKeys(d.attributes);a.parts=a.parts||[],a.parts.push(e),e.byterange&&(e.byterange.hasOwnProperty("offset")||(e.byterange.offset=p),p=e.byterange.offset+e.byterange.length);const i=a.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${i} for segment #${t}`,d.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(((t,e)=>{t.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${e} lacks required attribute(s): LAST-PART`});}));},"server-control"(){const t=this.manifest.serverControl=camelCaseKeys(d.attributes);t.hasOwnProperty("canBlockReload")||(t.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),setHoldBack.call(this,this.manifest),t.canSkipDateranges&&!t.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"});},"preload-hint"(){const t=this.manifest.segments.length,e=camelCaseKeys(d.attributes),i=e.type&&"PART"===e.type;a.preloadHints=a.preloadHints||[],a.preloadHints.push(e),e.byterange&&(e.byterange.hasOwnProperty("offset")||(e.byterange.offset=i?p:0,i&&(p=e.byterange.offset+e.byterange.length)));const r=a.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${r} for segment #${t}`,d.attributes,["TYPE","URI"]),e.type)for(let i=0;i<a.preloadHints.length-1;i++){const s=a.preloadHints[i];s.type&&(s.type===e.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${r} for segment #${t} has the same TYPE ${e.type} as preload hint #${i}`}));}},"rendition-report"(){const t=camelCaseKeys(d.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(t);const e=this.manifest.renditionReports.length-1,i=["LAST-MSN","URI"];s&&i.push("LAST-PART"),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${e}`,d.attributes,i);},"part-inf"(){this.manifest.partInf=camelCaseKeys(d.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",d.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),setHoldBack.call(this,this.manifest);}}[d.tagType]||n).call(t);},uri(){a.uri=d.uri,e.push(a),this.manifest.targetDuration&&!("duration"in a)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),a.duration=this.manifest.targetDuration),r&&(a.key=r),a.timeline=o,i&&(a.map=i),p=0,a={};},comment(){},custom(){d.segment?(a.custom=a.custom||{},a.custom[d.customType]=d.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[d.customType]=d.data);}})[d.type].call(t);}));}warnOnMissingAttributes_(t,e,i){const r=[];i.forEach((function(t){e.hasOwnProperty(t)||r.push(t);})),r.length&&this.trigger("warn",{message:`${t} lacks required attribute(s): ${r.join(", ")}`});}push(t){this.lineStream.push(t);}end(){this.lineStream.push("\n"),this.trigger("end");}addParser(t){this.parseStream.addParser(t);}addTagMapper(t){this.parseStream.addTagMapper(t);}}
500
+
501
+ var regexs={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},mediaTypes=["video","audio","text"],upperMediaTypes=["Video","Audio","Text"];var translateLegacyCodec=function(e){return e?e.replace(/avc1\.(\d+)\.(\d+)/i,(function(e,r,t){return "avc1."+("00"+Number(r).toString(16)).slice(-2)+"00"+("00"+Number(t).toString(16)).slice(-2)})):e};var parseCodecs=function(e){void 0===e&&(e="");var r=e.split(","),t=[];return r.forEach((function(e){var r;e=e.trim(),mediaTypes.forEach((function(o){var a=regexs[o].exec(e.toLowerCase());if(a&&!(a.length<=1)){r=o;var i=e.substring(0,a[1].length),n=e.replace(i,"");t.push({type:i,details:n,mediaType:o});}})),r||t.push({type:e,details:"",mediaType:"unknown"});})),t};var codecsFromDefault=function(e,r){if(!e.mediaGroups.AUDIO||!r)return null;var t=e.mediaGroups.AUDIO[r];if(!t)return null;for(var o in t){var a=t[o];if(a.default&&a.playlists)return parseCodecs(a.playlists[0].attributes.CODECS)}return null};var isAudioCodec=function(e){return void 0===e&&(e=""),regexs.audio.test(e.trim().toLowerCase())};var isTextCodec=function(e){return void 0===e&&(e=""),regexs.text.test(e.trim().toLowerCase())};var getMimeForCodec=function(e){if(e&&"string"==typeof e){var r=e.toLowerCase().split(",").map((function(e){return translateLegacyCodec(e.trim())})),t="video";1===r.length&&isAudioCodec(r[0])?t="audio":1===r.length&&isTextCodec(r[0])&&(t="application");var o="mp4";return r.every((function(e){return regexs.mp4.test(e)}))?o="mp4":r.every((function(e){return regexs.webm.test(e)}))?o="webm":r.every((function(e){return regexs.ogg.test(e)}))&&(o="ogg"),t+"/"+o+';codecs="'+e+'"'}};var browserSupportsCodec=function(e){return void 0===e&&(e=""),window_1.MediaSource&&window_1.MediaSource.isTypeSupported&&window_1.MediaSource.isTypeSupported(getMimeForCodec(e))||!1};var muxerSupportsCodec=function(e){return void 0===e&&(e=""),e.toLowerCase().split(",").every((function(e){e=e.trim();for(var r=0;r<upperMediaTypes.length;r++){var t=upperMediaTypes[r];if(regexs["muxer"+t].test(e))return !0}return !1}))};var DEFAULT_AUDIO_CODEC="mp4a.40.2";var DEFAULT_VIDEO_CODEC="avc1.4d400d";
502
+
503
+ var MPEGURL_REGEX=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,DASH_REGEX=/^application\/dash\+xml/i;var simpleTypeFromSourceType=function(p){return MPEGURL_REGEX.test(p)?"hls":DASH_REGEX.test(p)?"dash":"application/vnd.videojs.vhs+json"===p?"vhs-json":null};
504
+
505
+ var countBits=function(r){return r.toString(2).length};var countBytes=function(r){return Math.ceil(countBits(r)/8)};var isArrayBufferView=function(r){return "function"===ArrayBuffer.isView?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer};var isTypedArray=function(r){return isArrayBufferView(r)};var toUint8=function(r){return r instanceof Uint8Array?r:(Array.isArray(r)||isTypedArray(r)||r instanceof ArrayBuffer||(r="number"!=typeof r||"number"==typeof r&&r!=r?0:[r]),new Uint8Array(r&&r.buffer||r,r&&r.byteOffset||0,r&&r.byteLength||0))};var BigInt=window_1.BigInt||Number,BYTE_TABLE=[BigInt("0x1"),BigInt("0x100"),BigInt("0x10000"),BigInt("0x1000000"),BigInt("0x100000000"),BigInt("0x10000000000"),BigInt("0x1000000000000"),BigInt("0x100000000000000"),BigInt("0x10000000000000000")];(function(){var r=new Uint16Array([65484]),t=new Uint8Array(r.buffer,r.byteOffset,r.byteLength);return 255===t[0]?"big":204===t[0]?"little":"unknown"})();var bytesToNumber=function(r,t){var e=void 0===t?{}:t,n=e.signed,o=void 0!==n&&n,i=e.le,a=void 0!==i&&i;r=toUint8(r);var u=a?"reduce":"reduceRight",f=(r[u]?r[u]:Array.prototype[u]).call(r,(function(t,e,n){var o=a?n:Math.abs(n+1-r.length);return t+BigInt(e)*BYTE_TABLE[o]}),BigInt(0));if(o){var y=BYTE_TABLE[r.length]/BigInt(2)-BigInt(1);(f=BigInt(f))>y&&(f-=y,f-=y,f-=BigInt(2));}return Number(f)};var numberToBytes=function(r,t){var e=(void 0===t?{}:t).le,n=void 0!==e&&e;("bigint"!=typeof r&&"number"!=typeof r||"number"==typeof r&&r!=r)&&(r=0),r=BigInt(r);for(var o=countBytes(r),i=new Uint8Array(new ArrayBuffer(o)),a=0;a<o;a++){var u=n?a:Math.abs(a+1-i.length);i[u]=Number(r/BYTE_TABLE[a]&BigInt(255)),r<0&&(i[u]=Math.abs(~i[u]),i[u]-=0===a?1:2);}return i};var stringToBytes=function(r,t){if("string"!=typeof r&&r&&"function"==typeof r.toString&&(r=r.toString()),"string"!=typeof r)return new Uint8Array;t||(r=unescape(encodeURIComponent(r)));for(var e=new Uint8Array(r.length),n=0;n<r.length;n++)e[n]=r.charCodeAt(n);return e};var concatTypedArrays=function(){for(var r=arguments.length,t=new Array(r),e=0;e<r;e++)t[e]=arguments[e];if((t=t.filter((function(r){return r&&(r.byteLength||r.length)&&"string"!=typeof r}))).length<=1)return toUint8(t[0]);var n=t.reduce((function(r,t,e){return r+(t.byteLength||t.length)}),0),o=new Uint8Array(n),i=0;return t.forEach((function(r){r=toUint8(r),o.set(r,i),i+=r.byteLength;})),o};var bytesMatch=function(r,t,e){var n=void 0===e?{}:e,o=n.offset,i=void 0===o?0:o,a=n.mask,u=void 0===a?[]:a;r=toUint8(r);var f=(t=toUint8(t)).every?t.every:Array.prototype.every;return t.length&&r.length-i>=t.length&&f.call(t,(function(t,e){return t===(u[e]?u[e]&r[i+e]:r[i+e])}))};
506
+
507
+ var DEFAULT_LOCATION="http://example.com",resolveUrl$1=function(o,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(o)&&(o=window_1.location&&window_1.location.href||"");var i="function"==typeof window_1.URL,e=/^\/\//.test(o),l=!window_1.location&&!/\/\//i.test(o);if(i?o=new window_1.URL(o,window_1.location||DEFAULT_LOCATION):/\/\//i.test(o)||(o=urlToolkit.buildAbsoluteURL(window_1.location&&window_1.location.href||"",o)),i){var n=new URL(t,o);return l?n.href.slice(DEFAULT_LOCATION.length):e?n.href.slice(n.protocol.length):n.href}return urlToolkit.buildAbsoluteURL(o,t)};
508
+
509
+ var forEachMediaGroup$1=function(r,o,i){o.forEach((function(o){for(var a in r.mediaGroups[o])for(var n in r.mediaGroups[o][a]){var p=r.mediaGroups[o][a][n];i(p,o,a,n);}}));};
510
+
511
+ var atob=function(o){return window_1.atob?window_1.atob(o):Buffer.from(o,"base64").toString("binary")};function decodeB64ToUint8Array(o){for(var r=atob(o),n=new Uint8Array(r.length),t=0;t<r.length;t++)n[t]=r.charCodeAt(t);return n}
512
+
513
+ function find$1(e,t,n){if(void 0===n&&(n=Array.prototype),e&&"function"==typeof n.find)return n.find.call(e,t);for(var r=0;r<e.length;r++)if(Object.prototype.hasOwnProperty.call(e,r)){var o=e[r];if(t.call(void 0,o,r,e))return o}}function freeze(e,t){return void 0===t&&(t=Object),t&&"function"==typeof t.freeze?t.freeze(e):e}function assign(e,t){if(null===e||"object"!=typeof e)throw new TypeError("target is not an object");for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}var MIME_TYPE=freeze({HTML:"text/html",isHTML:function(e){return e===MIME_TYPE.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),NAMESPACE$3=freeze({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===NAMESPACE$3.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"}),assign_1=assign,find_1=find$1,freeze_1=freeze,MIME_TYPE_1=MIME_TYPE,NAMESPACE_1=NAMESPACE$3,conventions={assign:assign_1,find:find_1,freeze:freeze_1,MIME_TYPE:MIME_TYPE_1,NAMESPACE:NAMESPACE_1};
514
+
515
+ var find=conventions.find,NAMESPACE$2=conventions.NAMESPACE;function notEmptyString(e){return ""!==e}function splitOnASCIIWhitespace(e){return e?e.split(/[\t\n\f\r ]+/).filter(notEmptyString):[]}function orderedSetReducer(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function toOrderedSet(e){if(!e)return [];var t=splitOnASCIIWhitespace(e);return Object.keys(t.reduce(orderedSetReducer,{}))}function arrayIncludes(e){return function(t){return e&&-1!==e.indexOf(t)}}function copy(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);}function _extends(e,t){var n=e.prototype;if(!(n instanceof t)){function o(){}o.prototype=t.prototype,copy(n,o=new o),e.prototype=n=o;}n.constructor!=e&&("function"!=typeof e&&console.error("unknown Class:"+e),n.constructor=e);}var NodeType={},ELEMENT_NODE=NodeType.ELEMENT_NODE=1,ATTRIBUTE_NODE=NodeType.ATTRIBUTE_NODE=2,TEXT_NODE=NodeType.TEXT_NODE=3,CDATA_SECTION_NODE=NodeType.CDATA_SECTION_NODE=4,ENTITY_REFERENCE_NODE=NodeType.ENTITY_REFERENCE_NODE=5,ENTITY_NODE=NodeType.ENTITY_NODE=6,PROCESSING_INSTRUCTION_NODE=NodeType.PROCESSING_INSTRUCTION_NODE=7,COMMENT_NODE=NodeType.COMMENT_NODE=8,DOCUMENT_NODE=NodeType.DOCUMENT_NODE=9,DOCUMENT_TYPE_NODE=NodeType.DOCUMENT_TYPE_NODE=10,DOCUMENT_FRAGMENT_NODE=NodeType.DOCUMENT_FRAGMENT_NODE=11,NOTATION_NODE=NodeType.NOTATION_NODE=12,ExceptionCode={},ExceptionMessage={};ExceptionCode.INDEX_SIZE_ERR=(ExceptionMessage[1]="Index size error",1);ExceptionCode.DOMSTRING_SIZE_ERR=(ExceptionMessage[2]="DOMString size error",2);var HIERARCHY_REQUEST_ERR=ExceptionCode.HIERARCHY_REQUEST_ERR=(ExceptionMessage[3]="Hierarchy request error",3);ExceptionCode.WRONG_DOCUMENT_ERR=(ExceptionMessage[4]="Wrong document",4);ExceptionCode.INVALID_CHARACTER_ERR=(ExceptionMessage[5]="Invalid character",5);ExceptionCode.NO_DATA_ALLOWED_ERR=(ExceptionMessage[6]="No data allowed",6);ExceptionCode.NO_MODIFICATION_ALLOWED_ERR=(ExceptionMessage[7]="No modification allowed",7);var NOT_FOUND_ERR=ExceptionCode.NOT_FOUND_ERR=(ExceptionMessage[8]="Not found",8);ExceptionCode.NOT_SUPPORTED_ERR=(ExceptionMessage[9]="Not supported",9);var INUSE_ATTRIBUTE_ERR=ExceptionCode.INUSE_ATTRIBUTE_ERR=(ExceptionMessage[10]="Attribute in use",10);ExceptionCode.INVALID_STATE_ERR=(ExceptionMessage[11]="Invalid state",11);ExceptionCode.SYNTAX_ERR=(ExceptionMessage[12]="Syntax error",12);ExceptionCode.INVALID_MODIFICATION_ERR=(ExceptionMessage[13]="Invalid modification",13);ExceptionCode.NAMESPACE_ERR=(ExceptionMessage[14]="Invalid namespace",14);ExceptionCode.INVALID_ACCESS_ERR=(ExceptionMessage[15]="Invalid access",15);function DOMException(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,ExceptionMessage[e]),this.message=ExceptionMessage[e],Error.captureStackTrace&&Error.captureStackTrace(this,DOMException);return n.code=e,t&&(this.message=this.message+": "+t),n}function NodeList$1(){}function LiveNodeList(e,t){this._node=e,this._refresh=t,_updateLiveList(this);}function _updateLiveList(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var n=e._refresh(e._node);__set__(e,"length",n.length),copy(n,e),e._inc=t;}}function NamedNodeMap(){}function _findNodeIndex(e,t){for(var n=e.length;n--;)if(e[n]===t)return n}function _addNamedNode(e,t,n,o){if(o?t[_findNodeIndex(t,o)]=n:t[t.length++]=n,e){n.ownerElement=e;var i=e.ownerDocument;i&&(o&&_onRemoveAttribute(i,e,o),_onAddAttribute(i,e,n));}}function _removeNamedNode(e,t,n){var o=_findNodeIndex(t,n);if(!(o>=0))throw new DOMException(NOT_FOUND_ERR,new Error(e.tagName+"@"+n));for(var i=t.length-1;o<i;)t[o]=t[++o];if(t.length=i,e){var r=e.ownerDocument;r&&(_onRemoveAttribute(r,e,n),n.ownerElement=null);}}function DOMImplementation$1(){}function Node$1(){}function _xmlEncoder(e){return ("<"==e?"&lt;":">"==e&&"&gt;")||"&"==e&&"&amp;"||'"'==e&&"&quot;"||"&#"+e.charCodeAt()+";"}function _visitNode(e,t){if(t(e))return !0;if(e=e.firstChild)do{if(_visitNode(e,t))return !0}while(e=e.nextSibling)}function Document(){this.ownerDocument=this;}function _onAddAttribute(e,t,n){e&&e._inc++,n.namespaceURI===NAMESPACE$2.XMLNS&&(t._nsMap[n.prefix?n.localName:""]=n.value);}function _onRemoveAttribute(e,t,n,o){e&&e._inc++,n.namespaceURI===NAMESPACE$2.XMLNS&&delete t._nsMap[n.prefix?n.localName:""];}function _onUpdateChild(e,t,n){if(e&&e._inc){e._inc++;var o=t.childNodes;if(n)o[o.length++]=n;else {for(var i=t.firstChild,r=0;i;)o[r++]=i,i=i.nextSibling;o.length=r,delete o[o.length];}}}function _removeChild(e,t){var n=t.previousSibling,o=t.nextSibling;return n?n.nextSibling=o:e.firstChild=o,o?o.previousSibling=n:e.lastChild=n,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,_onUpdateChild(e.ownerDocument,e),t}function hasValidParentNodeType(e){return e&&(e.nodeType===Node$1.DOCUMENT_NODE||e.nodeType===Node$1.DOCUMENT_FRAGMENT_NODE||e.nodeType===Node$1.ELEMENT_NODE)}function hasInsertableNodeType(e){return e&&(isElementNode(e)||isTextNode$1(e)||isDocTypeNode(e)||e.nodeType===Node$1.DOCUMENT_FRAGMENT_NODE||e.nodeType===Node$1.COMMENT_NODE||e.nodeType===Node$1.PROCESSING_INSTRUCTION_NODE)}function isDocTypeNode(e){return e&&e.nodeType===Node$1.DOCUMENT_TYPE_NODE}function isElementNode(e){return e&&e.nodeType===Node$1.ELEMENT_NODE}function isTextNode$1(e){return e&&e.nodeType===Node$1.TEXT_NODE}function isElementInsertionPossible(e,t){var n=e.childNodes||[];if(find(n,isElementNode)||isDocTypeNode(t))return !1;var o=find(n,isDocTypeNode);return !(t&&o&&n.indexOf(o)>n.indexOf(t))}function isElementReplacementPossible(e,t){var n=e.childNodes||[];if(find(n,(function(e){return isElementNode(e)&&e!==t})))return !1;var o=find(n,isDocTypeNode);return !(t&&o&&n.indexOf(o)>n.indexOf(t))}function assertPreInsertionValidity1to5(e,t,n){if(!hasValidParentNodeType(e))throw new DOMException(HIERARCHY_REQUEST_ERR,"Unexpected parent node type "+e.nodeType);if(n&&n.parentNode!==e)throw new DOMException(NOT_FOUND_ERR,"child not in parent");if(!hasInsertableNodeType(t)||isDocTypeNode(t)&&e.nodeType!==Node$1.DOCUMENT_NODE)throw new DOMException(HIERARCHY_REQUEST_ERR,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)}function assertPreInsertionValidityInDocument(e,t,n){var o=e.childNodes||[],i=t.childNodes||[];if(t.nodeType===Node$1.DOCUMENT_FRAGMENT_NODE){var r=i.filter(isElementNode);if(r.length>1||find(i,isTextNode$1))throw new DOMException(HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(1===r.length&&!isElementInsertionPossible(e,n))throw new DOMException(HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(isElementNode(t)&&!isElementInsertionPossible(e,n))throw new DOMException(HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(isDocTypeNode(t)){if(find(o,isDocTypeNode))throw new DOMException(HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var a=find(o,isElementNode);if(n&&o.indexOf(a)<o.indexOf(n))throw new DOMException(HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element");if(!n&&a)throw new DOMException(HIERARCHY_REQUEST_ERR,"Doctype can not be appended since element is present")}}function assertPreReplacementValidityInDocument(e,t,n){var o=e.childNodes||[],i=t.childNodes||[];if(t.nodeType===Node$1.DOCUMENT_FRAGMENT_NODE){var r=i.filter(isElementNode);if(r.length>1||find(i,isTextNode$1))throw new DOMException(HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(1===r.length&&!isElementReplacementPossible(e,n))throw new DOMException(HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(isElementNode(t)&&!isElementReplacementPossible(e,n))throw new DOMException(HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(isDocTypeNode(t)){if(find(o,(function(e){return isDocTypeNode(e)&&e!==n})))throw new DOMException(HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var a=find(o,isElementNode);if(n&&o.indexOf(a)<o.indexOf(n))throw new DOMException(HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element")}}function _insertBefore(e,t,n,o){assertPreInsertionValidity1to5(e,t,n),e.nodeType===Node$1.DOCUMENT_NODE&&(o||assertPreInsertionValidityInDocument)(e,t,n);var i=t.parentNode;if(i&&i.removeChild(t),t.nodeType===DOCUMENT_FRAGMENT_NODE){var r=t.firstChild;if(null==r)return t;var a=t.lastChild;}else r=a=t;var s=n?n.previousSibling:e.lastChild;r.previousSibling=s,a.nextSibling=n,s?s.nextSibling=r:e.firstChild=r,null==n?e.lastChild=a:n.previousSibling=a;do{r.parentNode=e;}while(r!==a&&(r=r.nextSibling));return _onUpdateChild(e.ownerDocument||e,e),t.nodeType==DOCUMENT_FRAGMENT_NODE&&(t.firstChild=t.lastChild=null),t}function _appendSingleChild(e,t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=e,t.previousSibling=e.lastChild,t.nextSibling=null,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,e.lastChild=t,_onUpdateChild(e.ownerDocument,e,t),t}function Element$1(){this._nsMap={};}function Attr(){}function CharacterData(){}function Text(){}function Comment(){}function CDATASection(){}function DocumentType(){}function Notation(){}function Entity(){}function EntityReference(){}function DocumentFragment(){}function ProcessingInstruction(){}function XMLSerializer(){}function nodeSerializeToString(e,t){var n=[],o=9==this.nodeType&&this.documentElement||this,i=o.prefix,r=o.namespaceURI;if(r&&null==i&&null==(i=o.lookupPrefix(r)))var a=[{namespace:r,prefix:null}];return serializeToString(this,n,e,t,a),n.join("")}function needNamespaceDefine(e,t,n){var o=e.prefix||"",i=e.namespaceURI;if(!i)return !1;if("xml"===o&&i===NAMESPACE$2.XML||i===NAMESPACE$2.XMLNS)return !1;for(var r=n.length;r--;){var a=n[r];if(a.prefix===o)return a.namespace!==i}return !0}function addSerializedAttribute(e,t,n){e.push(" ",t,'="',n.replace(/[<>&"\t\n\r]/g,_xmlEncoder),'"');}function serializeToString(e,t,n,o,i){if(i||(i=[]),o){if(!(e=o(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case ELEMENT_NODE:var r=e.attributes,a=r.length,s=e.firstChild,d=e.tagName,c=d;if(!(n=NAMESPACE$2.isHTML(e.namespaceURI)||n)&&!e.prefix&&e.namespaceURI){for(var u,E=0;E<r.length;E++)if("xmlns"===r.item(E).name){u=r.item(E).value;break}if(!u)for(var N=i.length-1;N>=0;N--){if(""===(l=i[N]).prefix&&l.namespace===e.namespaceURI){u=l.namespace;break}}if(u!==e.namespaceURI)for(N=i.length-1;N>=0;N--){var l;if((l=i[N]).namespace===e.namespaceURI){l.prefix&&(c=l.prefix+":"+d);break}}}t.push("<",c);for(var p=0;p<a;p++){"xmlns"==(m=r.item(p)).prefix?i.push({prefix:m.localName,namespace:m.value}):"xmlns"==m.nodeName&&i.push({prefix:"",namespace:m.value});}for(p=0;p<a;p++){var m,f,_;if(needNamespaceDefine(m=r.item(p),n,i))addSerializedAttribute(t,(f=m.prefix||"")?"xmlns:"+f:"xmlns",_=m.namespaceURI),i.push({prefix:f,namespace:_});serializeToString(m,t,n,o,i);}if(d===c&&needNamespaceDefine(e,n,i))addSerializedAttribute(t,(f=e.prefix||"")?"xmlns:"+f:"xmlns",_=e.namespaceURI),i.push({prefix:f,namespace:_});if(s||n&&!/^(?:meta|link|img|br|hr|input)$/i.test(d)){if(t.push(">"),n&&/^script$/i.test(d))for(;s;)s.data?t.push(s.data):serializeToString(s,t,n,o,i.slice()),s=s.nextSibling;else for(;s;)serializeToString(s,t,n,o,i.slice()),s=s.nextSibling;t.push("</",c,">");}else t.push("/>");return;case DOCUMENT_NODE:case DOCUMENT_FRAGMENT_NODE:for(s=e.firstChild;s;)serializeToString(s,t,n,o,i.slice()),s=s.nextSibling;return;case ATTRIBUTE_NODE:return addSerializedAttribute(t,e.name,e.value);case TEXT_NODE:return t.push(e.data.replace(/[<&>]/g,_xmlEncoder));case CDATA_SECTION_NODE:return t.push("<![CDATA[",e.data,"]]>");case COMMENT_NODE:return t.push("\x3c!--",e.data,"--\x3e");case DOCUMENT_TYPE_NODE:var T=e.publicId,h=e.systemId;if(t.push("<!DOCTYPE ",e.name),T)t.push(" PUBLIC ",T),h&&"."!=h&&t.push(" ",h),t.push(">");else if(h&&"."!=h)t.push(" SYSTEM ",h,">");else {var D=e.internalSubset;D&&t.push(" [",D,"]"),t.push(">");}return;case PROCESSING_INSTRUCTION_NODE:return t.push("<?",e.target," ",e.data,"?>");case ENTITY_REFERENCE_NODE:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName);}}function importNode(e,t,n){var o;switch(t.nodeType){case ELEMENT_NODE:(o=t.cloneNode(!1)).ownerDocument=e;case DOCUMENT_FRAGMENT_NODE:break;case ATTRIBUTE_NODE:n=!0;}if(o||(o=t.cloneNode(!1)),o.ownerDocument=e,o.parentNode=null,n)for(var i=t.firstChild;i;)o.appendChild(importNode(e,i,n)),i=i.nextSibling;return o}function cloneNode(e,t,n){var o=new t.constructor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var r=t[i];"object"!=typeof r&&r!=o[i]&&(o[i]=r);}switch(t.childNodes&&(o.childNodes=new NodeList$1),o.ownerDocument=e,o.nodeType){case ELEMENT_NODE:var a=t.attributes,s=o.attributes=new NamedNodeMap,d=a.length;s._ownerElement=o;for(var c=0;c<d;c++)o.setAttributeNode(cloneNode(e,a.item(c),!0));break;case ATTRIBUTE_NODE:n=!0;}if(n)for(var u=t.firstChild;u;)o.appendChild(cloneNode(e,u,n)),u=u.nextSibling;return o}function __set__(e,t,n){e[t]=n;}DOMException.prototype=Error.prototype,copy(ExceptionCode,DOMException),NodeList$1.prototype={length:0,item:function(e){return this[e]||null},toString:function(e,t){for(var n=[],o=0;o<this.length;o++)serializeToString(this[o],n,e,t);return n.join("")},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}},LiveNodeList.prototype.item=function(e){return _updateLiveList(this),this[e]},_extends(LiveNodeList,NodeList$1),NamedNodeMap.prototype={length:0,item:NodeList$1.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var n=this[t];if(n.nodeName==e)return n}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new DOMException(INUSE_ATTRIBUTE_ERR);var n=this.getNamedItem(e.nodeName);return _addNamedNode(this._ownerElement,this,e,n),n},setNamedItemNS:function(e){var t,n=e.ownerElement;if(n&&n!=this._ownerElement)throw new DOMException(INUSE_ATTRIBUTE_ERR);return t=this.getNamedItemNS(e.namespaceURI,e.localName),_addNamedNode(this._ownerElement,this,e,t),t},removeNamedItem:function(e){var t=this.getNamedItem(e);return _removeNamedNode(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var n=this.getNamedItemNS(e,t);return _removeNamedNode(this._ownerElement,this,n),n},getNamedItemNS:function(e,t){for(var n=this.length;n--;){var o=this[n];if(o.localName==t&&o.namespaceURI==e)return o}return null}},DOMImplementation$1.prototype={hasFeature:function(e,t){return !0},createDocument:function(e,t,n){var o=new Document;if(o.implementation=this,o.childNodes=new NodeList$1,o.doctype=n||null,n&&o.appendChild(n),t){var i=o.createElementNS(e,t);o.appendChild(i);}return o},createDocumentType:function(e,t,n){var o=new DocumentType;return o.name=e,o.nodeName=e,o.publicId=t||"",o.systemId=n||"",o}},Node$1.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return _insertBefore(this,e,t)},replaceChild:function(e,t){_insertBefore(this,e,t,assertPreReplacementValidityInDocument),t&&this.removeChild(t);},removeChild:function(e){return _removeChild(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return cloneNode(this.ownerDocument||this,this,e)},normalize:function(){for(var e=this.firstChild;e;){var t=e.nextSibling;t&&t.nodeType==TEXT_NODE&&e.nodeType==TEXT_NODE?(this.removeChild(t),e.appendData(t.data)):(e.normalize(),e=t);}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n)for(var o in n)if(Object.prototype.hasOwnProperty.call(n,o)&&n[o]===e)return o;t=t.nodeType==ATTRIBUTE_NODE?t.ownerDocument:t.parentNode;}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&Object.prototype.hasOwnProperty.call(n,e))return n[e];t=t.nodeType==ATTRIBUTE_NODE?t.ownerDocument:t.parentNode;}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},copy(NodeType,Node$1),copy(NodeType,Node$1.prototype),Document.prototype={nodeName:"#document",nodeType:DOCUMENT_NODE,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==DOCUMENT_FRAGMENT_NODE){for(var n=e.firstChild;n;){var o=n.nextSibling;this.insertBefore(n,t),n=o;}return e}return _insertBefore(this,e,t),e.ownerDocument=this,null===this.documentElement&&e.nodeType===ELEMENT_NODE&&(this.documentElement=e),e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),_removeChild(this,e)},replaceChild:function(e,t){_insertBefore(this,e,t,assertPreReplacementValidityInDocument),e.ownerDocument=this,t&&this.removeChild(t),isElementNode(e)&&(this.documentElement=e);},importNode:function(e,t){return importNode(this,e,t)},getElementById:function(e){var t=null;return _visitNode(this.documentElement,(function(n){if(n.nodeType==ELEMENT_NODE&&n.getAttribute("id")==e)return t=n,!0})),t},getElementsByClassName:function(e){var t=toOrderedSet(e);return new LiveNodeList(this,(function(n){var o=[];return t.length>0&&_visitNode(n.documentElement,(function(i){if(i!==n&&i.nodeType===ELEMENT_NODE){var r=i.getAttribute("class");if(r){var a=e===r;if(!a){var s=toOrderedSet(r);a=t.every(arrayIncludes(s));}a&&o.push(i);}}})),o}))},createElement:function(e){var t=new Element$1;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new NodeList$1,(t.attributes=new NamedNodeMap)._ownerElement=t,t},createDocumentFragment:function(){var e=new DocumentFragment;return e.ownerDocument=this,e.childNodes=new NodeList$1,e},createTextNode:function(e){var t=new Text;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new Comment;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new CDATASection;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new ProcessingInstruction;return n.ownerDocument=this,n.tagName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new Attr;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new EntityReference;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new Element$1,o=t.split(":"),i=n.attributes=new NamedNodeMap;return n.childNodes=new NodeList$1,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,2==o.length?(n.prefix=o[0],n.localName=o[1]):n.localName=t,i._ownerElement=n,n},createAttributeNS:function(e,t){var n=new Attr,o=t.split(":");return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,2==o.length?(n.prefix=o[0],n.localName=o[1]):n.localName=t,n}},_extends(Document,Node$1),Element$1.prototype={nodeType:ELEMENT_NODE,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=""+t,this.setAttributeNode(n);},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t);},appendChild:function(e){return e.nodeType===DOCUMENT_FRAGMENT_NODE?this.insertBefore(e,null):_appendSingleChild(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n);},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||""},setAttributeNS:function(e,t,n){var o=this.ownerDocument.createAttributeNS(e,t);o.value=o.nodeValue=""+n,this.setAttributeNode(o);},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new LiveNodeList(this,(function(t){var n=[];return _visitNode(t,(function(o){o===t||o.nodeType!=ELEMENT_NODE||"*"!==e&&o.tagName!=e||n.push(o);})),n}))},getElementsByTagNameNS:function(e,t){return new LiveNodeList(this,(function(n){var o=[];return _visitNode(n,(function(i){i===n||i.nodeType!==ELEMENT_NODE||"*"!==e&&i.namespaceURI!==e||"*"!==t&&i.localName!=t||o.push(i);})),o}))}},Document.prototype.getElementsByTagName=Element$1.prototype.getElementsByTagName,Document.prototype.getElementsByTagNameNS=Element$1.prototype.getElementsByTagNameNS,_extends(Element$1,Node$1),Attr.prototype.nodeType=ATTRIBUTE_NODE,_extends(Attr,Node$1),CharacterData.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length;},insertData:function(e,t){this.replaceData(e,0,t);},appendChild:function(e){throw new Error(ExceptionMessage[HIERARCHY_REQUEST_ERR])},deleteData:function(e,t){this.replaceData(e,t,"");},replaceData:function(e,t,n){n=this.data.substring(0,e)+n+this.data.substring(e+t),this.nodeValue=this.data=n,this.length=n.length;}},_extends(CharacterData,Node$1),Text.prototype={nodeName:"#text",nodeType:TEXT_NODE,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var o=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(o,this.nextSibling),o}},_extends(Text,CharacterData),Comment.prototype={nodeName:"#comment",nodeType:COMMENT_NODE},_extends(Comment,CharacterData),CDATASection.prototype={nodeName:"#cdata-section",nodeType:CDATA_SECTION_NODE},_extends(CDATASection,CharacterData),DocumentType.prototype.nodeType=DOCUMENT_TYPE_NODE,_extends(DocumentType,Node$1),Notation.prototype.nodeType=NOTATION_NODE,_extends(Notation,Node$1),Entity.prototype.nodeType=ENTITY_NODE,_extends(Entity,Node$1),EntityReference.prototype.nodeType=ENTITY_REFERENCE_NODE,_extends(EntityReference,Node$1),DocumentFragment.prototype.nodeName="#document-fragment",DocumentFragment.prototype.nodeType=DOCUMENT_FRAGMENT_NODE,_extends(DocumentFragment,Node$1),ProcessingInstruction.prototype.nodeType=PROCESSING_INSTRUCTION_NODE,_extends(ProcessingInstruction,Node$1),XMLSerializer.prototype.serializeToString=function(e,t,n){return nodeSerializeToString.call(e,t,n)},Node$1.prototype.toString=nodeSerializeToString;try{if(Object.defineProperty){function getTextContent(e){switch(e.nodeType){case ELEMENT_NODE:case DOCUMENT_FRAGMENT_NODE:var t=[];for(e=e.firstChild;e;)7!==e.nodeType&&8!==e.nodeType&&t.push(getTextContent(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}}Object.defineProperty(LiveNodeList.prototype,"length",{get:function(){return _updateLiveList(this),this.$$length}}),Object.defineProperty(Node$1.prototype,"textContent",{get:function(){return getTextContent(this)},set:function(e){switch(this.nodeType){case ELEMENT_NODE:case DOCUMENT_FRAGMENT_NODE:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e;}}}),__set__=function(e,t,n){e["$$"+t]=n;};}}catch(e){}var DocumentType_1=DocumentType,DOMException_1=DOMException,DOMImplementation_1=DOMImplementation$1,Element_1=Element$1,Node_1=Node$1,NodeList_1=NodeList$1,XMLSerializer_1=XMLSerializer,dom={DocumentType:DocumentType_1,DOMException:DOMException_1,DOMImplementation:DOMImplementation_1,Element:Element_1,Node:Node_1,NodeList:NodeList_1,XMLSerializer:XMLSerializer_1};
516
+
517
+ var entities=createCommonjsModule((function(e,a){var i=conventions.freeze;a.XML_ENTITIES=i({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),a.HTML_ENTITIES=i({lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",times:"×",divide:"÷",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",euro:"€",trade:"™",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}),a.entityMap=a.HTML_ENTITIES;}));entities.XML_ENTITIES;entities.HTML_ENTITIES;entities.entityMap;
518
+
519
+ var NAMESPACE$1=conventions.NAMESPACE,nameStartChar=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,nameChar=new RegExp("[\\-\\.0-9"+nameStartChar.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),tagNamePattern=new RegExp("^"+nameStartChar.source+nameChar.source+"*(?::"+nameStartChar.source+nameChar.source+"*)?$"),S_TAG=0,S_ATTR=1,S_ATTR_SPACE=2,S_EQ=3,S_ATTR_NOQUOT_VALUE=4,S_ATTR_END=5,S_TAG_SPACE=6,S_TAG_CLOSE=7;function ParseError$1(e,r){this.message=e,this.locator=r,Error.captureStackTrace&&Error.captureStackTrace(this,ParseError$1);}function XMLReader$1(){}function parse$1(e,r,t,a,n){function s(e){var r=e.slice(1,-1);return Object.hasOwnProperty.call(t,r)?t[r]:"#"===r.charAt(0)?function(e){if(e>65535){var r=55296+((e-=65536)>>10),t=56320+(1023&e);return String.fromCharCode(r,t)}return String.fromCharCode(e)}(parseInt(r.substr(1).replace("x","0x"))):(n.error("entity not found:"+e),e)}function i(r){if(r>_){var t=e.substring(_,r).replace(/&#?\w+;/g,s);m&&c(_),a.characters(t,0,r-_),_=r;}}function c(r,t){for(;r>=u&&(t=l.exec(e));)o=t.index,u=o+t[0].length,m.lineNumber++;m.columnNumber=r-o+1;}for(var o=0,u=0,l=/.*(?:\r\n?|\n)|.*$/g,m=a.locator,p=[{currentNSMap:r}],f={},_=0;;){try{var S=e.indexOf("<",_);if(S<0){if(!e.substr(_).match(/^\s*$/)){var T=a.doc,A=T.createTextNode(e.substr(_));T.appendChild(A),a.currentElement=A;}return}switch(S>_&&i(S),e.charAt(S+1)){case"/":var d=e.indexOf(">",S+3),E=e.substring(S+2,d).replace(/[ \t\n\r]+$/g,""),h=p.pop();d<0?(E=e.substring(S+2).replace(/[\s<].*/,""),n.error("end tag name: "+E+" is not complete:"+h.tagName),d=S+1+E.length):E.match(/\s</)&&(E=E.replace(/[\s<].*/,""),n.error("end tag name: "+E+" maybe not complete"),d=S+1+E.length);var g=h.localNSMap,N=h.tagName==E;if(N||h.tagName&&h.tagName.toLowerCase()==E.toLowerCase()){if(a.endElement(h.uri,h.localName,E),g)for(var b in g)Object.prototype.hasOwnProperty.call(g,b)&&a.endPrefixMapping(b);N||n.fatalError("end tag name: "+E+" is not match the current start tagName:"+h.tagName);}else p.push(h);d++;break;case"?":m&&c(S),d=parseInstruction(e,S,a);break;case"!":m&&c(S),d=parseDCC(e,S,a,n);break;default:m&&c(S);var C=new ElementAttributes,x=p[p.length-1].currentNSMap,v=(d=parseElementStartPart(e,S,C,x,s,n),C.length);if(!C.closed&&fixSelfClosed(e,d,C.tagName,f)&&(C.closed=!0,t.nbsp||n.warning("unclosed xml attribute")),m&&v){for(var w=copyLocator(m,{}),P=0;P<v;P++){var R=C[P];c(R.offset),R.locator=copyLocator(m,{});}a.locator=w,appendElement$1(C,a,x)&&p.push(C),a.locator=m;}else appendElement$1(C,a,x)&&p.push(C);NAMESPACE$1.isHTML(C.uri)&&!C.closed?d=parseHtmlSpecialContent(e,d,C.tagName,s,a):d++;}}catch(e){if(e instanceof ParseError$1)throw e;n.error("element parse error: "+e),d=-1;}d>_?_=d:i(Math.max(S,_)+1);}}function copyLocator(e,r){return r.lineNumber=e.lineNumber,r.columnNumber=e.columnNumber,r}function parseElementStartPart(e,r,t,a,n,s){function i(e,r,a){t.attributeNames.hasOwnProperty(e)&&s.fatalError("Attribute "+e+" redefined"),t.addValue(e,r.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,n),a);}for(var c,o=++r,u=S_TAG;;){var l=e.charAt(o);switch(l){case"=":if(u===S_ATTR)c=e.slice(r,o),u=S_EQ;else {if(u!==S_ATTR_SPACE)throw new Error("attribute equal must after attrName");u=S_EQ;}break;case"'":case'"':if(u===S_EQ||u===S_ATTR){if(u===S_ATTR&&(s.warning('attribute value must after "="'),c=e.slice(r,o)),r=o+1,!((o=e.indexOf(l,r))>0))throw new Error("attribute value no end '"+l+"' match");i(c,m=e.slice(r,o),r-1),u=S_ATTR_END;}else {if(u!=S_ATTR_NOQUOT_VALUE)throw new Error('attribute value must after "="');i(c,m=e.slice(r,o),r),s.warning('attribute "'+c+'" missed start quot('+l+")!!"),r=o+1,u=S_ATTR_END;}break;case"/":switch(u){case S_TAG:t.setTagName(e.slice(r,o));case S_ATTR_END:case S_TAG_SPACE:case S_TAG_CLOSE:u=S_TAG_CLOSE,t.closed=!0;case S_ATTR_NOQUOT_VALUE:case S_ATTR:case S_ATTR_SPACE:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return s.error("unexpected end of input"),u==S_TAG&&t.setTagName(e.slice(r,o)),o;case">":switch(u){case S_TAG:t.setTagName(e.slice(r,o));case S_ATTR_END:case S_TAG_SPACE:case S_TAG_CLOSE:break;case S_ATTR_NOQUOT_VALUE:case S_ATTR:"/"===(m=e.slice(r,o)).slice(-1)&&(t.closed=!0,m=m.slice(0,-1));case S_ATTR_SPACE:u===S_ATTR_SPACE&&(m=c),u==S_ATTR_NOQUOT_VALUE?(s.warning('attribute "'+m+'" missed quot(")!'),i(c,m,r)):(NAMESPACE$1.isHTML(a[""])&&m.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+m+'" missed value!! "'+m+'" instead!!'),i(m,m,r));break;case S_EQ:throw new Error("attribute value missed!!")}return o;case"€":l=" ";default:if(l<=" ")switch(u){case S_TAG:t.setTagName(e.slice(r,o)),u=S_TAG_SPACE;break;case S_ATTR:c=e.slice(r,o),u=S_ATTR_SPACE;break;case S_ATTR_NOQUOT_VALUE:var m=e.slice(r,o);s.warning('attribute "'+m+'" missed quot(")!!'),i(c,m,r);case S_ATTR_END:u=S_TAG_SPACE;}else switch(u){case S_ATTR_SPACE:t.tagName;NAMESPACE$1.isHTML(a[""])&&c.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+c+'" missed value!! "'+c+'" instead2!!'),i(c,c,r),r=o,u=S_ATTR;break;case S_ATTR_END:s.warning('attribute space is required"'+c+'"!!');case S_TAG_SPACE:u=S_ATTR,r=o;break;case S_EQ:u=S_ATTR_NOQUOT_VALUE,r=o;break;case S_TAG_CLOSE:throw new Error("elements closed character '/' and '>' must be connected to")}}o++;}}function appendElement$1(e,r,t){for(var a=e.tagName,n=null,s=e.length;s--;){var i=e[s],c=i.qName,o=i.value;if((p=c.indexOf(":"))>0)var u=i.prefix=c.slice(0,p),l=c.slice(p+1),m="xmlns"===u&&l;else l=c,u=null,m="xmlns"===c&&"";i.localName=l,!1!==m&&(null==n&&(n={},_copy(t,t={})),t[m]=n[m]=o,i.uri=NAMESPACE$1.XMLNS,r.startPrefixMapping(m,o));}for(s=e.length;s--;){(u=(i=e[s]).prefix)&&("xml"===u&&(i.uri=NAMESPACE$1.XML),"xmlns"!==u&&(i.uri=t[u||""]));}var p;(p=a.indexOf(":"))>0?(u=e.prefix=a.slice(0,p),l=e.localName=a.slice(p+1)):(u=null,l=e.localName=a);var f=e.uri=t[u||""];if(r.startElement(f,l,a,e),!e.closed)return e.currentNSMap=t,e.localNSMap=n,!0;if(r.endElement(f,l,a),n)for(u in n)Object.prototype.hasOwnProperty.call(n,u)&&r.endPrefixMapping(u);}function parseHtmlSpecialContent(e,r,t,a,n){if(/^(?:script|textarea)$/i.test(t)){var s=e.indexOf("</"+t+">",r),i=e.substring(r+1,s);if(/[&<]/.test(i))return /^script$/i.test(t)?(n.characters(i,0,i.length),s):(i=i.replace(/&#?\w+;/g,a),n.characters(i,0,i.length),s)}return r+1}function fixSelfClosed(e,r,t,a){var n=a[t];return null==n&&((n=e.lastIndexOf("</"+t+">"))<r&&(n=e.lastIndexOf("</"+t)),a[t]=n),n<r}function _copy(e,r){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);}function parseDCC(e,r,t,a){if("-"===e.charAt(r+2))return "-"===e.charAt(r+3)?(n=e.indexOf("--\x3e",r+4))>r?(t.comment(e,r+4,n-r-4),n+3):(a.error("Unclosed comment"),-1):-1;if("CDATA["==e.substr(r+3,6)){var n=e.indexOf("]]>",r+9);return t.startCDATA(),t.characters(e,r+9,n-r-9),t.endCDATA(),n+3}var s=split(e,r),i=s.length;if(i>1&&/!doctype/i.test(s[0][0])){var c=s[1][0],o=!1,u=!1;i>3&&(/^public$/i.test(s[2][0])?(o=s[3][0],u=i>4&&s[4][0]):/^system$/i.test(s[2][0])&&(u=s[3][0]));var l=s[i-1];return t.startDTD(c,o,u),t.endDTD(),l.index+l[0].length}return -1}function parseInstruction(e,r,t){var a=e.indexOf("?>",r);if(a){var n=e.substring(r,a).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(n){n[0].length;return t.processingInstruction(n[1],n[2]),a+2}return -1}return -1}function ElementAttributes(){this.attributeNames={};}function split(e,r){var t,a=[],n=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(n.lastIndex=r,n.exec(e);t=n.exec(e);)if(a.push(t),t[1])return a}ParseError$1.prototype=new Error,ParseError$1.prototype.name=ParseError$1.name,XMLReader$1.prototype={parse:function(e,r,t){var a=this.domBuilder;a.startDocument(),_copy(r,r={}),parse$1(e,r,t,a,this.errorHandler),a.endDocument();}},ElementAttributes.prototype={setTagName:function(e){if(!tagNamePattern.test(e))throw new Error("invalid tagName:"+e);this.tagName=e;},addValue:function(e,r,t){if(!tagNamePattern.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:r,offset:t};},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}};var XMLReader_1=XMLReader$1,ParseError_1=ParseError$1,sax={XMLReader:XMLReader_1,ParseError:ParseError_1};
520
+
521
+ var DOMImplementation=dom.DOMImplementation,NAMESPACE=conventions.NAMESPACE,ParseError=sax.ParseError,XMLReader=sax.XMLReader;function normalizeLineEndings(t){return t.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function DOMParser$2(t){this.options=t||{locator:{}};}function buildErrorHandler(t,n,e){if(!t){if(n instanceof DOMHandler)return n;t=n;}var r={},o=t instanceof Function;function i(n){var i=t[n];!i&&o&&(i=2==t.length?function(e){t(n,e);}:t),r[n]=i&&function(t){i("[xmldom "+n+"]\t"+t+_locator(e));}||function(){};}return e=e||{},i("warning"),i("error"),i("fatalError"),r}function DOMHandler(){this.cdata=!1;}function position(t,n){n.lineNumber=t.lineNumber,n.columnNumber=t.columnNumber;}function _locator(t){if(t)return "\n@"+(t.systemId||"")+"#[line:"+t.lineNumber+",col:"+t.columnNumber+"]"}function _toString(t,n,e){return "string"==typeof t?t.substr(n,e):t.length>=n+e||n?new java.lang.String(t,n,e)+"":t}function appendElement(t,n){t.currentElement?t.currentElement.appendChild(n):t.doc.appendChild(n);}DOMParser$2.prototype.parseFromString=function(t,n){var e=this.options,r=new XMLReader,o=e.domBuilder||new DOMHandler,i=e.errorHandler,a=e.locator,s=e.xmlns||{},c=/\/x?html?$/.test(n),l=c?entities.HTML_ENTITIES:entities.XML_ENTITIES;a&&o.setDocumentLocator(a),r.errorHandler=buildErrorHandler(i,o,a),r.domBuilder=e.domBuilder||o,c&&(s[""]=NAMESPACE.HTML),s.xml=s.xml||NAMESPACE.XML;var m=e.normalizeLineEndings||normalizeLineEndings;return t&&"string"==typeof t?r.parse(m(t),s,l):r.errorHandler.error("invalid doc source"),o.doc},DOMHandler.prototype={startDocument:function(){this.doc=(new DOMImplementation).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId);},startElement:function(t,n,e,r){var o=this.doc,i=o.createElementNS(t,e||n),a=r.length;appendElement(this,i),this.currentElement=i,this.locator&&position(this.locator,i);for(var s=0;s<a;s++){t=r.getURI(s);var c=r.getValue(s),l=(e=r.getQName(s),o.createAttributeNS(t,e));this.locator&&position(r.getLocator(s),l),l.value=l.nodeValue=c,i.setAttributeNode(l);}},endElement:function(t,n,e){var r=this.currentElement;r.tagName;this.currentElement=r.parentNode;},startPrefixMapping:function(t,n){},endPrefixMapping:function(t){},processingInstruction:function(t,n){var e=this.doc.createProcessingInstruction(t,n);this.locator&&position(this.locator,e),appendElement(this,e);},ignorableWhitespace:function(t,n,e){},characters:function(t,n,e){if(t=_toString.apply(this,arguments)){if(this.cdata)var r=this.doc.createCDATASection(t);else r=this.doc.createTextNode(t);this.currentElement?this.currentElement.appendChild(r):/^\s*$/.test(t)&&this.doc.appendChild(r),this.locator&&position(this.locator,r);}},skippedEntity:function(t){},endDocument:function(){this.doc.normalize();},setDocumentLocator:function(t){(this.locator=t)&&(t.lineNumber=0);},comment:function(t,n,e){t=_toString.apply(this,arguments);var r=this.doc.createComment(t);this.locator&&position(this.locator,r),appendElement(this,r);},startCDATA:function(){this.cdata=!0;},endCDATA:function(){this.cdata=!1;},startDTD:function(t,n,e){var r=this.doc.implementation;if(r&&r.createDocumentType){var o=r.createDocumentType(t,n,e);this.locator&&position(this.locator,o),appendElement(this,o),this.doc.doctype=o;}},warning:function(t){console.warn("[xmldom warning]\t"+t,_locator(this.locator));},error:function(t){console.error("[xmldom error]\t"+t,_locator(this.locator));},fatalError:function(t){throw new ParseError(t,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(t){DOMHandler.prototype[t]=function(){return null};}));var __DOMHandler=DOMHandler,normalizeLineEndings_1=normalizeLineEndings,DOMParser_1=DOMParser$2,domParser={__DOMHandler:__DOMHandler,normalizeLineEndings:normalizeLineEndings_1,DOMParser:DOMParser_1};
522
+
523
+ var DOMParser$1=domParser.DOMParser;
524
+
525
+ const isObject$1=e=>!!e&&"object"==typeof e,merge$2=(...e)=>e.reduce(((e,t)=>("object"!=typeof t||Object.keys(t).forEach((i=>{Array.isArray(e[i])&&Array.isArray(t[i])?e[i]=e[i].concat(t[i]):isObject$1(e[i])&&isObject$1(t[i])?e[i]=merge$2(e[i],t[i]):e[i]=t[i];})),e)),{}),values=e=>Object.keys(e).map((t=>e[t])),range=(e,t)=>{const i=[];for(let n=e;n<t;n++)i.push(n);return i},flatten=e=>e.reduce(((e,t)=>e.concat(t)),[]),from=e=>{if(!e.length)return [];const t=[];for(let i=0;i<e.length;i++)t.push(e[i]);return t};var errors={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",MISSING_SEGMENT_INFORMATION:"MISSING_SEGMENT_INFORMATION",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};const urlTypeToSegment=({baseUrl:e="",source:t="",range:i="",indexRange:n=""})=>{const r={uri:t,resolvedUri:resolveUrl$1(e||"",t)};if(i||n){const e=(i||n).split("-");let t,s=window_1.BigInt?window_1.BigInt(e[0]):parseInt(e[0],10),a=window_1.BigInt?window_1.BigInt(e[1]):parseInt(e[1],10);s<Number.MAX_SAFE_INTEGER&&"bigint"==typeof s&&(s=Number(s)),a<Number.MAX_SAFE_INTEGER&&"bigint"==typeof a&&(a=Number(a)),t="bigint"==typeof a||"bigint"==typeof s?window_1.BigInt(a)-window_1.BigInt(s)+window_1.BigInt(1):a-s+1,"bigint"==typeof t&&t<Number.MAX_SAFE_INTEGER&&(t=Number(t)),r.byterange={length:t,offset:s};}return r},byteRangeToString=e=>{let t;return t="bigint"==typeof e.offset||"bigint"==typeof e.length?window_1.BigInt(e.offset)+window_1.BigInt(e.length)-window_1.BigInt(1):e.offset+e.length-1,`${e.offset}-${t}`},parseEndNumber=e=>(e&&"number"!=typeof e&&(e=parseInt(e,10)),isNaN(e)?null:e),segmentRange={static(e){const{duration:t,timescale:i=1,sourceDuration:n,periodDuration:r}=e,s=parseEndNumber(e.endNumber),a=t/i;return "number"==typeof s?{start:0,end:s}:"number"==typeof r?{start:0,end:r/a}:{start:0,end:n/a}},dynamic(e){const{NOW:t,clientOffset:i,availabilityStartTime:n,timescale:r=1,duration:s,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:u=1/0}=e,l=parseEndNumber(e.endNumber),d=(t+i)/1e3,m=n+a,c=d+o-m,p=Math.ceil(c*r/s),g=Math.floor((d-m-u)*r/s),f=Math.floor((d-m)*r/s);return {start:Math.max(0,g),end:"number"==typeof l?l:Math.min(p,f)}}},toSegments=e=>t=>{const{duration:i,timescale:n=1,periodStart:r,startNumber:s=1}=e;return {number:s+t,duration:i/n,timeline:r,time:t*i}},parseByDuration=e=>{const{type:t,duration:i,timescale:n=1,periodDuration:r,sourceDuration:s}=e,{start:a,end:o}=segmentRange[t](e),u=range(a,o).map(toSegments(e));if("static"===t){const e=u.length-1,t="number"==typeof r?r:s;u[e].duration=t-i/n*e;}return u},segmentsFromBase=e=>{const{baseUrl:t,initialization:i={},sourceDuration:n,indexRange:r="",periodStart:s,presentationTime:a,number:o=0,duration:u}=e;if(!t)throw new Error(errors.NO_BASE_URL);const l=urlTypeToSegment({baseUrl:t,source:i.sourceURL,range:i.range}),d=urlTypeToSegment({baseUrl:t,source:t,indexRange:r});if(d.map=l,u){const t=parseByDuration(e);t.length&&(d.duration=t[0].duration,d.timeline=t[0].timeline);}else n&&(d.duration=n,d.timeline=s);return d.presentationTime=a||s,d.number=o,[d]},addSidxSegmentsToPlaylist$1=(e,t,i)=>{const n=e.sidx.map?e.sidx.map:null,r=e.sidx.duration,s=e.timeline||0,a=e.sidx.byterange,o=a.offset+a.length,u=t.timescale,l=t.references.filter((e=>1!==e.referenceType)),d=[],m=e.endList?"static":"dynamic",c=e.sidx.timeline;let p,g=c,f=e.mediaSequence||0;p="bigint"==typeof t.firstOffset?window_1.BigInt(o)+t.firstOffset:o+t.firstOffset;for(let e=0;e<l.length;e++){const a=t.references[e],o=a.referencedSize,l=a.subsegmentDuration;let y;y="bigint"==typeof p?p+window_1.BigInt(o)-window_1.BigInt(1):p+o-1;const S=segmentsFromBase({baseUrl:i,timescale:u,timeline:s,periodStart:c,presentationTime:g,number:f,duration:l,sourceDuration:r,indexRange:`${p}-${y}`,type:m})[0];n&&(S.map=n),d.push(S),p+="bigint"==typeof p?window_1.BigInt(o):o,g+=l/u,f++;}return e.segments=d,e},SUPPORTED_MEDIA_TYPES=["AUDIO","SUBTITLES"],TIME_FUDGE=1/60,getUniqueTimelineStarts=e=>{return (t=e,i=({timeline:e})=>e,values(t.reduce(((e,t)=>(t.forEach((t=>{e[i(t)]=t;})),e)),{}))).sort(((e,t)=>e.timeline>t.timeline?1:-1));var t,i;},findPlaylistWithName=(e,t)=>{for(let i=0;i<e.length;i++)if(e[i].attributes.NAME===t)return e[i];return null},getMediaGroupPlaylists=e=>{let t=[];return forEachMediaGroup$1(e,SUPPORTED_MEDIA_TYPES,((e,i,n,r)=>{t=t.concat(e.playlists||[]);})),t},updateMediaSequenceForPlaylist=({playlist:e,mediaSequence:t})=>{e.mediaSequence=t,e.segments.forEach(((t,i)=>{t.number=e.mediaSequence+i;}));},updateSequenceNumbers=({oldPlaylists:e,newPlaylists:t,timelineStarts:i})=>{t.forEach((t=>{t.discontinuitySequence=i.findIndex((function({timeline:e}){return e===t.timeline}));const n=findPlaylistWithName(e,t.attributes.NAME);if(!n)return;if(t.sidx)return;const r=t.segments[0],s=n.segments.findIndex((function(e){return Math.abs(e.presentationTime-r.presentationTime)<TIME_FUDGE}));if(-1===s)return updateMediaSequenceForPlaylist({playlist:t,mediaSequence:n.mediaSequence+n.segments.length}),t.segments[0].discontinuity=!0,t.discontinuityStarts.unshift(0),void((!n.segments.length&&t.timeline>n.timeline||n.segments.length&&t.timeline>n.segments[n.segments.length-1].timeline)&&t.discontinuitySequence--);n.segments[s].discontinuity&&!r.discontinuity&&(r.discontinuity=!0,t.discontinuityStarts.unshift(0),t.discontinuitySequence--),updateMediaSequenceForPlaylist({playlist:t,mediaSequence:n.segments[s].number});}));},positionManifestOnTimeline=({oldManifest:e,newManifest:t})=>{const i=e.playlists.concat(getMediaGroupPlaylists(e)),n=t.playlists.concat(getMediaGroupPlaylists(t));return t.timelineStarts=getUniqueTimelineStarts([e.timelineStarts,t.timelineStarts]),updateSequenceNumbers({oldPlaylists:i,newPlaylists:n,timelineStarts:t.timelineStarts}),t},generateSidxKey=e=>e&&e.uri+"-"+byteRangeToString(e.byterange),mergeDiscontiguousPlaylists=e=>values(e.reduce(((e,t)=>{const i=t.attributes.id+(t.attributes.lang||"");return e[i]?(t.segments&&(t.segments[0]&&(t.segments[0].discontinuity=!0),e[i].segments.push(...t.segments)),t.attributes.contentProtection&&(e[i].attributes.contentProtection=t.attributes.contentProtection)):(e[i]=t,e[i].attributes.timelineStarts=[]),e[i].attributes.timelineStarts.push({start:t.attributes.periodStart,timeline:t.attributes.periodStart}),e}),{})).map((e=>{var t,i;return e.discontinuityStarts=(t=e.segments||[],i="discontinuity",t.reduce(((e,t,n)=>(t[i]&&e.push(n),e)),[])),e})),addSidxSegmentsToPlaylist=(e,t)=>{const i=generateSidxKey(e.sidx),n=i&&t[i]&&t[i].sidx;return n&&addSidxSegmentsToPlaylist$1(e,n,e.sidx.resolvedUri),e},addSidxSegmentsToPlaylists=(e,t={})=>{if(!Object.keys(t).length)return e;for(const i in e)e[i]=addSidxSegmentsToPlaylist(e[i],t);return e},formatAudioPlaylist=({attributes:e,segments:t,sidx:i,mediaSequence:n,discontinuitySequence:r,discontinuityStarts:s},a)=>{const o={attributes:{NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs,"PROGRAM-ID":1},uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:"",targetDuration:e.duration,discontinuitySequence:r,discontinuityStarts:s,timelineStarts:e.timelineStarts,mediaSequence:n,segments:t};return e.contentProtection&&(o.contentProtection=e.contentProtection),i&&(o.sidx=i),a&&(o.attributes.AUDIO="audio",o.attributes.SUBTITLES="subs"),o},formatVttPlaylist=({attributes:e,segments:t,mediaSequence:i,discontinuityStarts:n,discontinuitySequence:r})=>{void 0===t&&(t=[{uri:e.baseUrl,timeline:e.periodStart,resolvedUri:e.baseUrl||"",duration:e.sourceDuration,number:0}],e.duration=e.sourceDuration);const s={NAME:e.id,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1};return e.codecs&&(s.CODECS=e.codecs),{attributes:s,uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,timelineStarts:e.timelineStarts,discontinuityStarts:n,discontinuitySequence:r,mediaSequence:i,segments:t}},organizeAudioPlaylists=(e,t={},i=!1)=>{let n;const r=e.reduce(((e,r)=>{const s=r.attributes.role&&r.attributes.role.value||"",a=r.attributes.lang||"";let o=r.attributes.label||"main";if(a&&!r.attributes.label){const e=s?` (${s})`:"";o=`${r.attributes.lang}${e}`;}e[o]||(e[o]={language:a,autoselect:!0,default:"main"===s,playlists:[],uri:""});const u=addSidxSegmentsToPlaylist(formatAudioPlaylist(r,i),t);return e[o].playlists.push(u),void 0===n&&"main"===s&&(n=r,n.default=!0),e}),{});if(!n){r[Object.keys(r)[0]].default=!0;}return r},organizeVttPlaylists=(e,t={})=>e.reduce(((e,i)=>{const n=i.attributes.lang||"text";return e[n]||(e[n]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),e[n].playlists.push(addSidxSegmentsToPlaylist(formatVttPlaylist(i),t)),e}),{}),formatVideoPlaylist=({attributes:e,segments:t,sidx:i,discontinuityStarts:n})=>{const r={attributes:{NAME:e.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:e.width,height:e.height},CODECS:e.codecs,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1},uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:"",targetDuration:e.duration,discontinuityStarts:n,timelineStarts:e.timelineStarts,segments:t};return e.frameRate&&(r.attributes["FRAME-RATE"]=e.frameRate),e.contentProtection&&(r.contentProtection=e.contentProtection),i&&(r.sidx=i),r},videoOnly=({attributes:e})=>"video/mp4"===e.mimeType||"video/webm"===e.mimeType||"video"===e.contentType,audioOnly=({attributes:e})=>"audio/mp4"===e.mimeType||"audio/webm"===e.mimeType||"audio"===e.contentType,vttOnly=({attributes:e})=>"text/vtt"===e.mimeType||"text"===e.contentType,flattenMediaGroupPlaylists=e=>e?Object.keys(e).reduce(((t,i)=>{const n=e[i];return t.concat(n.playlists)}),[]):[],toM3u8=({dashPlaylists:e,locations:t,sidxMapping:i={},previousManifest:n})=>{if(!e.length)return {};const{sourceDuration:r,type:s,suggestedPresentationDelay:a,minimumUpdatePeriod:o}=e[0].attributes,u=mergeDiscontiguousPlaylists(e.filter(videoOnly)).map(formatVideoPlaylist),l=mergeDiscontiguousPlaylists(e.filter(audioOnly)),d=mergeDiscontiguousPlaylists(e.filter(vttOnly)),m=e.map((e=>e.attributes.captionServices)).filter(Boolean),c={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:r,playlists:addSidxSegmentsToPlaylists(u,i)};o>=0&&(c.minimumUpdatePeriod=1e3*o),t&&(c.locations=t),"dynamic"===s&&(c.suggestedPresentationDelay=a);const p=0===c.playlists.length,g=l.length?organizeAudioPlaylists(l,i,p):null,f=d.length?organizeVttPlaylists(d,i):null,y=u.concat(flattenMediaGroupPlaylists(g),flattenMediaGroupPlaylists(f)),S=y.map((({timelineStarts:e})=>e));var b,h;return c.timelineStarts=getUniqueTimelineStarts(S),b=y,h=c.timelineStarts,b.forEach((e=>{e.mediaSequence=0,e.discontinuitySequence=h.findIndex((function({timeline:t}){return t===e.timeline})),e.segments&&e.segments.forEach(((e,t)=>{e.number=t;}));})),g&&(c.mediaGroups.AUDIO.audio=g),f&&(c.mediaGroups.SUBTITLES.subs=f),m.length&&(c.mediaGroups["CLOSED-CAPTIONS"].cc=m.reduce(((e,t)=>t?(t.forEach((t=>{const{channel:i,language:n}=t;e[n]={autoselect:!1,default:!1,instreamId:i,language:n},t.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=t.aspectRatio),t.hasOwnProperty("easyReader")&&(e[n].easyReader=t.easyReader),t.hasOwnProperty("3D")&&(e[n]["3D"]=t["3D"]);})),e):e),{})),n?positionManifestOnTimeline({oldManifest:n,newManifest:c}):c},getLiveRValue=(e,t,i)=>{const{NOW:n,clientOffset:r,availabilityStartTime:s,timescale:a=1,periodStart:o=0,minimumUpdatePeriod:u=0}=e,l=(n+r)/1e3+u-(s+o);return Math.ceil((l*a-t)/i)},parseByTimeline=(e,t)=>{const{type:i,minimumUpdatePeriod:n=0,media:r="",sourceDuration:s,timescale:a=1,startNumber:o=1,periodStart:u}=e,l=[];let d=-1;for(let m=0;m<t.length;m++){const c=t[m],p=c.d,g=c.r||0,f=c.t||0;let y;if(d<0&&(d=f),f&&f>d&&(d=f),g<0){const o=m+1;y=o===t.length?"dynamic"===i&&n>0&&r.indexOf("$Number$")>0?getLiveRValue(e,d,p):(s*a-d)/p:(t[o].t-d)/p;}else y=g+1;const S=o+l.length+y;let b=o+l.length;for(;b<S;)l.push({number:b,duration:p/a,time:d,timeline:u}),d+=p,b++;}return l},identifierPattern=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,identifierReplacement=e=>(t,i,n,r)=>{if("$$"===t)return "$";if(void 0===e[i])return t;const s=""+e[i];return "RepresentationID"===i?s:(r=n?parseInt(r,10):1,s.length>=r?s:`${new Array(r-s.length+1).join("0")}${s}`)},constructTemplateUrl=(e,t)=>e.replace(identifierPattern,identifierReplacement(t)),parseTemplateInfo=(e,t)=>e.duration||t?e.duration?parseByDuration(e):parseByTimeline(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}],segmentsFromTemplate=(e,t)=>{const i={RepresentationID:e.id,Bandwidth:e.bandwidth||0},{initialization:n={sourceURL:"",range:""}}=e,r=urlTypeToSegment({baseUrl:e.baseUrl,source:constructTemplateUrl(n.sourceURL,i),range:n.range});return parseTemplateInfo(e,t).map((t=>{i.Number=t.number,i.Time=t.time;const n=constructTemplateUrl(e.media||"",i),s=e.timescale||1,a=e.presentationTimeOffset||0,o=e.periodStart+(t.time-a)/s;return {uri:n,timeline:t.timeline,duration:t.duration,resolvedUri:resolveUrl$1(e.baseUrl||"",n),map:r,number:t.number,presentationTime:o}}))},SegmentURLToSegmentObject=(e,t)=>{const{baseUrl:i,initialization:n={}}=e,r=urlTypeToSegment({baseUrl:i,source:n.sourceURL,range:n.range}),s=urlTypeToSegment({baseUrl:i,source:t.media,range:t.mediaRange});return s.map=r,s},segmentsFromList=(e,t)=>{const{duration:i,segmentUrls:n=[],periodStart:r}=e;if(!i&&!t||i&&t)throw new Error(errors.SEGMENT_TIME_UNSPECIFIED);const s=n.map((t=>SegmentURLToSegmentObject(e,t)));let a;i&&(a=parseByDuration(e)),t&&(a=parseByTimeline(e,t));return a.map(((t,i)=>{if(s[i]){const n=s[i],a=e.timescale||1,o=e.presentationTimeOffset||0;return n.timeline=t.timeline,n.duration=t.duration,n.number=t.number,n.presentationTime=r+(t.time-o)/a,n}})).filter((e=>e))},generateSegments=({attributes:e,segmentInfo:t})=>{let i,n;t.template?(n=segmentsFromTemplate,i=merge$2(e,t.template)):t.base?(n=segmentsFromBase,i=merge$2(e,t.base)):t.list&&(n=segmentsFromList,i=merge$2(e,t.list));const r={attributes:e};if(!n)return r;const s=n(i,t.segmentTimeline);if(i.duration){const{duration:e,timescale:t=1}=i;i.duration=e/t;}else s.length?i.duration=s.reduce(((e,t)=>Math.max(e,Math.ceil(t.duration))),0):i.duration=0;return r.attributes=i,r.segments=s,t.base&&i.indexRange&&(r.sidx=s[0],r.segments=[]),r},toPlaylists=e=>e.map(generateSegments),findChildren=(e,t)=>from(e.childNodes).filter((({tagName:e})=>e===t)),getContent=e=>e.textContent.trim(),parseDivisionValue=e=>parseFloat(e.split("/").reduce(((e,t)=>e/t))),parseDuration=e=>{const t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!t)return 0;const[i,n,r,s,a,o]=t.slice(1);return 31536e3*parseFloat(i||0)+2592e3*parseFloat(n||0)+86400*parseFloat(r||0)+3600*parseFloat(s||0)+60*parseFloat(a||0)+parseFloat(o||0)},parsers={mediaPresentationDuration:e=>parseDuration(e),availabilityStartTime(e){return /^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t=e)&&(t+="Z"),Date.parse(t)/1e3;var t;},minimumUpdatePeriod:e=>parseDuration(e),suggestedPresentationDelay:e=>parseDuration(e),type:e=>e,timeShiftBufferDepth:e=>parseDuration(e),start:e=>parseDuration(e),width:e=>parseInt(e,10),height:e=>parseInt(e,10),bandwidth:e=>parseInt(e,10),frameRate:e=>parseDivisionValue(e),startNumber:e=>parseInt(e,10),timescale:e=>parseInt(e,10),presentationTimeOffset:e=>parseInt(e,10),duration(e){const t=parseInt(e,10);return isNaN(t)?parseDuration(e):t},d:e=>parseInt(e,10),t:e=>parseInt(e,10),r:e=>parseInt(e,10),DEFAULT:e=>e},parseAttributes=e=>e&&e.attributes?from(e.attributes).reduce(((e,t)=>{const i=parsers[t.name]||parsers.DEFAULT;return e[t.name]=i(t.value),e}),{}):{},keySystemsMap={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"},buildBaseUrls=(e,t)=>t.length?flatten(e.map((function(e){return t.map((function(t){return resolveUrl$1(e,getContent(t))}))}))):e,getSegmentInformation=e=>{const t=findChildren(e,"SegmentTemplate")[0],i=findChildren(e,"SegmentList")[0],n=i&&findChildren(i,"SegmentURL").map((e=>merge$2({tag:"SegmentURL"},parseAttributes(e)))),r=findChildren(e,"SegmentBase")[0],s=i||t,a=s&&findChildren(s,"SegmentTimeline")[0],o=i||r||t,u=o&&findChildren(o,"Initialization")[0],l=t&&parseAttributes(t);l&&u?l.initialization=u&&parseAttributes(u):l&&l.initialization&&(l.initialization={sourceURL:l.initialization});const d={template:l,segmentTimeline:a&&findChildren(a,"S").map((e=>parseAttributes(e))),list:i&&merge$2(parseAttributes(i),{segmentUrls:n,initialization:parseAttributes(u)}),base:r&&merge$2(parseAttributes(r),{initialization:parseAttributes(u)})};return Object.keys(d).forEach((e=>{d[e]||delete d[e];})),d},inheritBaseUrls=(e,t,i)=>n=>{const r=findChildren(n,"BaseURL"),s=buildBaseUrls(t,r),a=merge$2(e,parseAttributes(n)),o=getSegmentInformation(n);return s.map((e=>({segmentInfo:merge$2(i,o),attributes:merge$2(a,{baseUrl:e})})))},parseCaptionServiceMetadata=e=>{if("urn:scte:dash:cc:cea-608:2015"===e.schemeIdUri){return ("string"!=typeof e.value?[]:e.value.split(";")).map((e=>{let t,i;return i=e,/^CC\d=/.test(e)?[t,i]=e.split("="):/^CC\d$/.test(e)&&(t=e),{channel:t,language:i}}))}if("urn:scte:dash:cc:cea-708:2015"===e.schemeIdUri){return ("string"!=typeof e.value?[]:e.value.split(";")).map((e=>{const t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){const[i,n=""]=e.split("=");t.channel=i,t.language=e,n.split(",").forEach((e=>{const[i,n]=e.split(":");"lang"===i?t.language=n:"er"===i?t.easyReader=Number(n):"war"===i?t.aspectRatio=Number(n):"3D"===i&&(t["3D"]=Number(n));}));}else t.language=e;return t.channel&&(t.channel="SERVICE"+t.channel),t}))}},toRepresentations=(e,t,i)=>n=>{const r=parseAttributes(n),s=buildBaseUrls(t,findChildren(n,"BaseURL")),a=findChildren(n,"Role")[0],o={role:parseAttributes(a)};let u=merge$2(e,r,o);const l=findChildren(n,"Accessibility")[0],d=parseCaptionServiceMetadata(parseAttributes(l));d&&(u=merge$2(u,{captionServices:d}));const m=findChildren(n,"Label")[0];if(m&&m.childNodes.length){const e=m.childNodes[0].nodeValue.trim();u=merge$2(u,{label:e});}const c=findChildren(n,"ContentProtection").reduce(((e,t)=>{const i=parseAttributes(t);i.schemeIdUri&&(i.schemeIdUri=i.schemeIdUri.toLowerCase());const n=keySystemsMap[i.schemeIdUri];if(n){e[n]={attributes:i};const r=findChildren(t,"cenc:pssh")[0];if(r){const t=getContent(r);e[n].pssh=t&&decodeB64ToUint8Array(t);}}return e}),{});Object.keys(c).length&&(u=merge$2(u,{contentProtection:c}));const p=getSegmentInformation(n),g=findChildren(n,"Representation"),f=merge$2(i,p);return flatten(g.map(inheritBaseUrls(u,s,f)))},toAdaptationSets=(e,t)=>(i,n)=>{const r=buildBaseUrls(t,findChildren(i.node,"BaseURL")),s=merge$2(e,{periodStart:i.attributes.start});"number"==typeof i.attributes.duration&&(s.periodDuration=i.attributes.duration);const a=findChildren(i.node,"AdaptationSet"),o=getSegmentInformation(i.node);return flatten(a.map(toRepresentations(s,r,o)))},getPeriodStart=({attributes:e,priorPeriodAttributes:t,mpdType:i})=>"number"==typeof e.start?e.start:t&&"number"==typeof t.start&&"number"==typeof t.duration?t.start+t.duration:t||"static"!==i?null:0,inheritAttributes=(e,t={})=>{const{manifestUri:i="",NOW:n=Date.now(),clientOffset:r=0}=t,s=findChildren(e,"Period");if(!s.length)throw new Error(errors.INVALID_NUMBER_OF_PERIOD);const a=findChildren(e,"Location"),o=parseAttributes(e),u=buildBaseUrls([i],findChildren(e,"BaseURL"));o.type=o.type||"static",o.sourceDuration=o.mediaPresentationDuration||0,o.NOW=n,o.clientOffset=r,a.length&&(o.locations=a.map(getContent));const l=[];return s.forEach(((e,t)=>{const i=parseAttributes(e),n=l[t-1];i.start=getPeriodStart({attributes:i,priorPeriodAttributes:n?n.attributes:null,mpdType:o.type}),l.push({node:e,attributes:i});})),{locations:o.locations,representationInfo:flatten(l.map(toAdaptationSets(o,u)))}},stringToMpdXml=e=>{if(""===e)throw new Error(errors.DASH_EMPTY_MANIFEST);const t=new DOMParser$1;let i,n;try{i=t.parseFromString(e,"application/xml"),n=i&&"MPD"===i.documentElement.tagName?i.documentElement:null;}catch(e){}if(!n||n&&n.getElementsByTagName("parsererror").length>0)throw new Error(errors.DASH_INVALID_XML);return n},parseUTCTimingScheme=e=>{const t=findChildren(e,"UTCTiming")[0];if(!t)return null;const i=parseAttributes(t);switch(i.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":i.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":i.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":i.method="DIRECT",i.value=Date.parse(i.value);break;default:throw new Error(errors.UNSUPPORTED_UTC_TIMING_SCHEME)}return i},parse=(e,t={})=>{const i=inheritAttributes(stringToMpdXml(e),t),n=toPlaylists(i.representationInfo);return toM3u8({dashPlaylists:n,locations:i.locations,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest})},parseUTCTiming=e=>parseUTCTimingScheme(stringToMpdXml(e));
526
+
527
+ var MAX_UINT32=Math.pow(2,32),getUint64$1=function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getBigUint64?(t=n.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(t):t:n.getUint32(0)*MAX_UINT32+n.getUint32(4)},numbers={getUint64:getUint64$1,MAX_UINT32:MAX_UINT32};
528
+
529
+ var getUint64=numbers.getUint64,parseSidx=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8)},i=12;0===r.version?(r.earliestPresentationTime=t.getUint32(i),r.firstOffset=t.getUint32(i+4),i+=8):(r.earliestPresentationTime=getUint64(e.subarray(i)),r.firstOffset=getUint64(e.subarray(i+8)),i+=16),i+=2;var s=t.getUint16(i);for(i+=2;s>0;i+=12,s--)r.references.push({referenceType:(128&e[i])>>>7,referencedSize:2147483647&t.getUint32(i),subsegmentDuration:t.getUint32(i+4),startsWithSap:!!(128&e[i+8]),sapType:(112&e[i+8])>>>4,sapDeltaTime:268435455&t.getUint32(i+8)});return r},parseSidx_1=parseSidx;
530
+
531
+ var ID3=toUint8([73,68,51]);var getId3Size=function(t,e){void 0===e&&(e=0);var o=(t=toUint8(t))[e+5],r=t[e+6]<<21|t[e+7]<<14|t[e+8]<<7|t[e+9];return (16&o)>>4?r+20:r+10};var getId3Offset=function t(e,o){return void 0===o&&(o=0),(e=toUint8(e)).length-o<10||!bytesMatch(e,ID3,{offset:o})?o:t(e,o+=getId3Size(e,o))};
532
+
533
+ var normalizePath$1=function(r){return "string"==typeof r?stringToBytes(r):r},normalizePaths$1=function(r){return Array.isArray(r)?r.map((function(r){return normalizePath$1(r)})):[normalizePath$1(r)]};var findBox=function r(e,t,a){void 0===a&&(a=!1),t=normalizePaths$1(t),e=toUint8(e);var s=[];if(!t.length)return s;for(var i=0;i<e.length;){var n=(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3])>>>0,o=e.subarray(i+4,i+8);if(0===n)break;var u=i+n;if(u>e.length){if(a)break;u=e.length;}var f=e.subarray(i+8,u);bytesMatch(o,t[0])&&(1===t.length?s.push(f):s.push.apply(s,r(f,t.slice(1),a))),i=u;}return s};
534
+
535
+ var EBML_TAGS={EBML:toUint8([26,69,223,163]),DocType:toUint8([66,130]),Segment:toUint8([24,83,128,103]),SegmentInfo:toUint8([21,73,169,102]),Tracks:toUint8([22,84,174,107]),Track:toUint8([174]),TrackNumber:toUint8([215]),DefaultDuration:toUint8([35,227,131]),TrackEntry:toUint8([174]),TrackType:toUint8([131]),FlagDefault:toUint8([136]),CodecID:toUint8([134]),CodecPrivate:toUint8([99,162]),VideoTrack:toUint8([224]),AudioTrack:toUint8([225]),Cluster:toUint8([31,67,182,117]),Timestamp:toUint8([231]),TimestampScale:toUint8([42,215,177]),BlockGroup:toUint8([160]),BlockDuration:toUint8([155]),Block:toUint8([161]),SimpleBlock:toUint8([163])};var LENGTH_TABLE=[128,64,32,16,8,4,2,1],getLength=function(t){for(var e=1,r=0;r<LENGTH_TABLE.length&&!(t&LENGTH_TABLE[r]);r++)e++;return e},getvint=function(t,e,r,a){void 0===r&&(r=!0),void 0===a&&(a=!1);var n=getLength(t[e]),o=t.subarray(e,e+n);return r&&((o=Array.prototype.slice.call(t,e,e+n))[0]^=LENGTH_TABLE[n-1]),{length:n,value:bytesToNumber(o,{signed:a}),bytes:o}},normalizePath=function t(e){return "string"==typeof e?e.match(/.{1,2}/g).map((function(e){return t(e)})):"number"==typeof e?numberToBytes(e):e},normalizePaths=function(t){return Array.isArray(t)?t.map((function(t){return normalizePath(t)})):[normalizePath(t)]},getInfinityDataSize=function t(e,r,a){if(a>=r.length)return r.length;var n=getvint(r,a,!1);if(bytesMatch(e.bytes,n.bytes))return a;var o=getvint(r,a+n.length);return t(e,r,a+o.length+o.value+n.length)};var findEbml=function t(e,r){r=normalizePaths(r),e=toUint8(e);var a=[];if(!r.length)return a;for(var n=0;n<e.length;){var o=getvint(e,n,!1),i=getvint(e,n+o.length),c=n+o.length+i.length;127===i.value&&(i.value=getInfinityDataSize(o,e,c),i.value!==e.length&&(i.value-=c));var l=c+i.value>e.length?e.length:c+i.value,s=e.subarray(c,l);bytesMatch(r[0],o.bytes)&&(1===r.length?a.push(s):a=a.concat(t(s,r.slice(1)))),n+=o.length+i.length+s.length;}return a};
536
+
537
+ var NAL_TYPE_ONE=toUint8([0,0,0,1]);var NAL_TYPE_TWO=toUint8([0,0,1]);var EMULATION_PREVENTION=toUint8([0,0,3]);var discardEmulationPreventionBytes=function(r){for(var t=[],n=1;n<r.length-2;)bytesMatch(r.subarray(n,n+3),EMULATION_PREVENTION)&&(t.push(n+2),n++),n++;if(0===t.length)return r;var e=r.length-t.length,a=new Uint8Array(e),i=0;for(n=0;n<e;i++,n++)i===t[0]&&(i++,t.shift()),a[n]=r[i];return a};var findNal=function(r,t,n,e){void 0===e&&(e=1/0),r=toUint8(r),n=[].concat(n);for(var a,i=0,o=0;i<r.length&&(o<e||a);){var s=void 0;if(bytesMatch(r.subarray(i),NAL_TYPE_ONE)?s=4:bytesMatch(r.subarray(i),NAL_TYPE_TWO)&&(s=3),s){if(o++,a)return discardEmulationPreventionBytes(r.subarray(a,i));var u=void 0;"h264"===t?u=31&r[i+s]:"h265"===t&&(u=r[i+s]>>1&63),-1!==n.indexOf(u)&&(a=i+s),i+=s+("h264"===t?1:2);}else i++;}return r.subarray(0,0)};var findH264Nal=function(r,t,n){return findNal(r,"h264",t,n)};var findH265Nal=function(r,t,n){return findNal(r,"h265",t,n)};
538
+
539
+ var CONSTANTS={webm:toUint8([119,101,98,109]),matroska:toUint8([109,97,116,114,111,115,107,97]),flac:toUint8([102,76,97,67]),ogg:toUint8([79,103,103,83]),ac3:toUint8([11,119]),riff:toUint8([82,73,70,70]),avi:toUint8([65,86,73]),wav:toUint8([87,65,86,69]),"3gp":toUint8([102,116,121,112,51,103]),mp4:toUint8([102,116,121,112]),fmp4:toUint8([115,116,121,112]),mov:toUint8([102,116,121,112,113,116]),moov:toUint8([109,111,111,118]),moof:toUint8([109,111,111,102])},_isLikely={aac:function(t){var e=getId3Offset(t);return bytesMatch(t,[255,16],{offset:e,mask:[255,22]})},mp3:function(t){var e=getId3Offset(t);return bytesMatch(t,[255,2],{offset:e,mask:[255,6]})},webm:function(t){var e=findEbml(t,[EBML_TAGS.EBML,EBML_TAGS.DocType])[0];return bytesMatch(e,CONSTANTS.webm)},mkv:function(t){var e=findEbml(t,[EBML_TAGS.EBML,EBML_TAGS.DocType])[0];return bytesMatch(e,CONSTANTS.matroska)},mp4:function(t){return !_isLikely["3gp"](t)&&!_isLikely.mov(t)&&(!(!bytesMatch(t,CONSTANTS.mp4,{offset:4})&&!bytesMatch(t,CONSTANTS.fmp4,{offset:4}))||(!(!bytesMatch(t,CONSTANTS.moof,{offset:4})&&!bytesMatch(t,CONSTANTS.moov,{offset:4}))||void 0))},mov:function(t){return bytesMatch(t,CONSTANTS.mov,{offset:4})},"3gp":function(t){return bytesMatch(t,CONSTANTS["3gp"],{offset:4})},ac3:function(t){var e=getId3Offset(t);return bytesMatch(t,CONSTANTS.ac3,{offset:e})},ts:function(t){if(t.length<189&&t.length>=1)return 71===t[0];for(var e=0;e+188<t.length&&e<188;){if(71===t[e]&&71===t[e+188])return !0;e+=1;}return !1},flac:function(t){var e=getId3Offset(t);return bytesMatch(t,CONSTANTS.flac,{offset:e})},ogg:function(t){return bytesMatch(t,CONSTANTS.ogg)},avi:function(t){return bytesMatch(t,CONSTANTS.riff)&&bytesMatch(t,CONSTANTS.avi,{offset:8})},wav:function(t){return bytesMatch(t,CONSTANTS.riff)&&bytesMatch(t,CONSTANTS.wav,{offset:8})},h264:function(t){return findH264Nal(t,7,3).length},h265:function(t){return findH265Nal(t,[32,33],3).length}},isLikelyTypes=Object.keys(_isLikely).filter((function(t){return "ts"!==t&&"h264"!==t&&"h265"!==t})).concat(["ts","h264","h265"]);isLikelyTypes.forEach((function(t){var e=_isLikely[t];_isLikely[t]=function(t){return e(toUint8(t))};}));var isLikely=_isLikely;var detectContainerForBytes=function(t){t=toUint8(t);for(var e=0;e<isLikelyTypes.length;e++){var n=isLikelyTypes[e];if(isLikely[n](t))return n}return ""};var isLikelyFmp4MediaSegment=function(t){return findBox(t,["moof"]).length>0};
540
+
541
+ var secondsToVideoTs,secondsToAudioTs,videoTsToSeconds,audioTsToSeconds,audioTsToVideoTs,videoTsToAudioTs,metadataTsToSeconds,ONE_SECOND_IN_TS=9e4;audioTsToVideoTs=function(o,s){return secondsToVideoTs(audioTsToSeconds(o,s))},videoTsToAudioTs=function(o,s){return secondsToAudioTs(videoTsToSeconds(o),s)},metadataTsToSeconds=function(o,s,T){return videoTsToSeconds(T?o:o-s)};var clock={ONE_SECOND_IN_TS:ONE_SECOND_IN_TS,secondsToVideoTs:secondsToVideoTs=function(o){return o*ONE_SECOND_IN_TS},secondsToAudioTs:secondsToAudioTs=function(o,s){return o*s},videoTsToSeconds:videoTsToSeconds=function(o){return o/ONE_SECOND_IN_TS},audioTsToSeconds:audioTsToSeconds=function(o,s){return o/s},audioTsToVideoTs:audioTsToVideoTs,videoTsToAudioTs:videoTsToAudioTs,metadataTsToSeconds:metadataTsToSeconds};var clock_1=clock.ONE_SECOND_IN_TS;
542
+
543
+ var version$6="8.0.4";const hooks_={},hooks=function(e,t){return hooks_[e]=hooks_[e]||[],t&&(hooks_[e]=hooks_[e].concat(t)),hooks_[e]},hook=function(e,t){hooks(e,t);},removeHook=function(e,t){const i=hooks(e).indexOf(t);return !(i<=-1)&&(hooks_[e]=hooks_[e].slice(),hooks_[e].splice(i,1),!0)},hookOnce=function(e,t){hooks(e,[].concat(t).map((t=>{const i=(...s)=>(removeHook(e,i),t(...s));return i})));},FullscreenApi={prefixed:!0},apiMap=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]],specApi=apiMap[0];let browserApi;for(let e=0;e<apiMap.length;e++)if(apiMap[e][1]in document_1){browserApi=apiMap[e];break}if(browserApi){for(let e=0;e<browserApi.length;e++)FullscreenApi[specApi[e]]=browserApi[e];FullscreenApi.prefixed=browserApi[0]!==specApi[0];}let history$1=[];const LogByTypeFactory=(e,t)=>(i,s,n)=>{const r=t.levels[s],a=new RegExp(`^(${r})$`);if("log"!==i&&n.unshift(i.toUpperCase()+":"),n.unshift(e+":"),history$1){history$1.push([].concat(n));const e=history$1.length-1e3;history$1.splice(0,e>0?e:0);}if(!window_1.console)return;let o=window_1.console[i];o||"debug"!==i||(o=window_1.console.info||window_1.console.log),o&&r&&a.test(i)&&o[Array.isArray(n)?"apply":"call"](window_1.console,n);};function createLogger$1(e){let t,i="info";const s=function(...e){t("log",i,e);};return t=LogByTypeFactory(e,s),s.createLogger=t=>createLogger$1(e+": "+t),s.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:i},s.level=e=>{if("string"==typeof e){if(!s.levels.hasOwnProperty(e))throw new Error(`"${e}" in not a valid log level`);i=e;}return i},(s.history=()=>history$1?[].concat(history$1):[]).filter=e=>(history$1||[]).filter((t=>new RegExp(`.*${e}.*`).test(t[0]))),s.history.clear=()=>{history$1&&(history$1.length=0);},s.history.disable=()=>{null!==history$1&&(history$1.length=0,history$1=null);},s.history.enable=()=>{null===history$1&&(history$1=[]);},s.error=(...e)=>t("error",i,e),s.warn=(...e)=>t("warn",i,e),s.debug=(...e)=>t("debug",i,e),s}const log$1=createLogger$1("VIDEOJS"),createLogger=log$1.createLogger,toString=Object.prototype.toString,keys=function(e){return isObject(e)?Object.keys(e):[]};function each(e,t){keys(e).forEach((i=>t(e[i],i)));}function reduce(e,t,i=0){return keys(e).reduce(((i,s)=>t(i,e[s],s)),i)}function isObject(e){return !!e&&"object"==typeof e}function isPlain(e){return isObject(e)&&"[object Object]"===toString.call(e)&&e.constructor===Object}function merge$1(...e){const t={};return e.forEach((e=>{e&&each(e,((e,i)=>{isPlain(e)?(isPlain(t[i])||(t[i]={}),t[i]=merge$1(t[i],e)):t[i]=e;}));})),t}function defineLazyProperty(e,t,i,s=!0){const n=i=>Object.defineProperty(e,t,{value:i,enumerable:!0,writable:!0}),r={configurable:!0,enumerable:!0,get(){const e=i();return n(e),e}};return s&&(r.set=n),Object.defineProperty(e,t,r)}var Obj=Object.freeze({__proto__:null,each:each,reduce:reduce,isObject:isObject,isPlain:isPlain,merge:merge$1,defineLazyProperty:defineLazyProperty});let ANDROID_VERSION,IS_IPOD=!1,IOS_VERSION=null,IS_ANDROID=!1,IS_FIREFOX=!1,IS_EDGE=!1,IS_CHROMIUM=!1,IS_CHROME=!1,CHROMIUM_VERSION=null,CHROME_VERSION=null,IE_VERSION=null,IS_SAFARI=!1,IS_WINDOWS=!1,IS_IPAD=!1,IS_IPHONE=!1;const TOUCH_ENABLED=Boolean(isReal()&&("ontouchstart"in window_1||window_1.navigator.maxTouchPoints||window_1.DocumentTouch&&window_1.document instanceof window_1.DocumentTouch)),UAD=window_1.navigator&&window_1.navigator.userAgentData;if(UAD&&(IS_ANDROID="Android"===UAD.platform,IS_EDGE=Boolean(UAD.brands.find((e=>"Microsoft Edge"===e.brand))),IS_CHROMIUM=Boolean(UAD.brands.find((e=>"Chromium"===e.brand))),IS_CHROME=!IS_EDGE&&IS_CHROMIUM,CHROMIUM_VERSION=CHROME_VERSION=(UAD.brands.find((e=>"Chromium"===e.brand))||{}).version||null,IS_WINDOWS="Windows"===UAD.platform),!IS_CHROMIUM){const e=window_1.navigator&&window_1.navigator.userAgent||"";IS_IPOD=/iPod/i.test(e),IOS_VERSION=function(){const t=e.match(/OS (\d+)_/i);return t&&t[1]?t[1]:null}(),IS_ANDROID=/Android/i.test(e),ANDROID_VERSION=function(){const t=e.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!t)return null;const i=t[1]&&parseFloat(t[1]),s=t[2]&&parseFloat(t[2]);return i&&s?parseFloat(t[1]+"."+t[2]):i||null}(),IS_FIREFOX=/Firefox/i.test(e),IS_EDGE=/Edg/i.test(e),IS_CHROMIUM=/Chrome/i.test(e)||/CriOS/i.test(e),IS_CHROME=!IS_EDGE&&IS_CHROMIUM,CHROMIUM_VERSION=CHROME_VERSION=function(){const t=e.match(/(Chrome|CriOS)\/(\d+)/);return t&&t[2]?parseFloat(t[2]):null}(),IE_VERSION=function(){const t=/MSIE\s(\d+)\.\d/.exec(e);let i=t&&parseFloat(t[1]);return !i&&/Trident\/7.0/i.test(e)&&/rv:11.0/.test(e)&&(i=11),i}(),IS_SAFARI=/Safari/i.test(e)&&!IS_CHROME&&!IS_ANDROID&&!IS_EDGE,IS_WINDOWS=/Windows/i.test(e),IS_IPAD=/iPad/i.test(e)||IS_SAFARI&&TOUCH_ENABLED&&!/iPhone/i.test(e),IS_IPHONE=/iPhone/i.test(e)&&!IS_IPAD;}const IS_IOS=IS_IPHONE||IS_IPAD||IS_IPOD,IS_ANY_SAFARI=(IS_SAFARI||IS_IOS)&&!IS_CHROME;var browser=Object.freeze({__proto__:null,get IS_IPOD(){return IS_IPOD},get IOS_VERSION(){return IOS_VERSION},get IS_ANDROID(){return IS_ANDROID},get ANDROID_VERSION(){return ANDROID_VERSION},get IS_FIREFOX(){return IS_FIREFOX},get IS_EDGE(){return IS_EDGE},get IS_CHROMIUM(){return IS_CHROMIUM},get IS_CHROME(){return IS_CHROME},get CHROMIUM_VERSION(){return CHROMIUM_VERSION},get CHROME_VERSION(){return CHROME_VERSION},get IE_VERSION(){return IE_VERSION},get IS_SAFARI(){return IS_SAFARI},get IS_WINDOWS(){return IS_WINDOWS},get IS_IPAD(){return IS_IPAD},get IS_IPHONE(){return IS_IPHONE},TOUCH_ENABLED:TOUCH_ENABLED,IS_IOS:IS_IOS,IS_ANY_SAFARI:IS_ANY_SAFARI});function isNonBlankString(e){return "string"==typeof e&&Boolean(e.trim())}function throwIfWhitespace(e){if(e.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function isReal(){return document_1===window_1.document}function isEl(e){return isObject(e)&&1===e.nodeType}function isInFrame(){try{return window_1.parent!==window_1.self}catch(e){return !0}}function createQuerier(e){return function(t,i){if(!isNonBlankString(t))return document_1[e](null);isNonBlankString(i)&&(i=document_1.querySelector(i));const s=isEl(i)?i:document_1;return s[e]&&s[e](t)}}function createEl(e="div",t={},i={},s){const n=document_1.createElement(e);return Object.getOwnPropertyNames(t).forEach((function(e){const i=t[e];"textContent"===e?textContent(n,i):n[e]===i&&"tabIndex"!==e||(n[e]=i);})),Object.getOwnPropertyNames(i).forEach((function(e){n.setAttribute(e,i[e]);})),s&&appendContent(n,s),n}function textContent(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function prependTo(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e);}function hasClass(e,t){return throwIfWhitespace(t),e.classList.contains(t)}function addClass(e,...t){return e.classList.add(...t.reduce(((e,t)=>e.concat(t.split(/\s+/))),[])),e}function removeClass(e,...t){return e?(e.classList.remove(...t.reduce(((e,t)=>e.concat(t.split(/\s+/))),[])),e):(log$1.warn("removeClass was called with an element that doesn't exist"),null)}function toggleClass(e,t,i){return "function"==typeof i&&(i=i(e,t)),"boolean"!=typeof i&&(i=void 0),t.split(/\s+/).forEach((t=>e.classList.toggle(t,i))),e}function setAttributes(e,t){Object.getOwnPropertyNames(t).forEach((function(i){const s=t[i];null==s||!1===s?e.removeAttribute(i):e.setAttribute(i,!0===s?"":s);}));}function getAttributes(e){const t={},i=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(e&&e.attributes&&e.attributes.length>0){const s=e.attributes;for(let n=s.length-1;n>=0;n--){const r=s[n].name;let a=s[n].value;"boolean"!=typeof e[r]&&-1===i.indexOf(","+r+",")||(a=null!==a),t[r]=a;}}return t}function getAttribute(e,t){return e.getAttribute(t)}function setAttribute(e,t,i){e.setAttribute(t,i);}function removeAttribute(e,t){e.removeAttribute(t);}function blockTextSelection(){document_1.body.focus(),document_1.onselectstart=function(){return !1};}function unblockTextSelection(){document_1.onselectstart=function(){return !0};}function getBoundingClientRect(e){if(e&&e.getBoundingClientRect&&e.parentNode){const t=e.getBoundingClientRect(),i={};return ["bottom","height","left","right","top","width"].forEach((e=>{void 0!==t[e]&&(i[e]=t[e]);})),i.height||(i.height=parseFloat(computedStyle(e,"height"))),i.width||(i.width=parseFloat(computedStyle(e,"width"))),i}}function findPosition(e){if(!e||e&&!e.offsetParent)return {left:0,top:0,width:0,height:0};const t=e.offsetWidth,i=e.offsetHeight;let s=0,n=0;for(;e.offsetParent&&e!==document_1[FullscreenApi.fullscreenElement];)s+=e.offsetLeft,n+=e.offsetTop,e=e.offsetParent;return {left:s,top:n,width:t,height:i}}function getPointerPosition(e,t){const i={x:0,y:0};if(IS_IOS){let t=e;for(;t&&"html"!==t.nodeName.toLowerCase();){const e=computedStyle(t,"transform");if(/^matrix/.test(e)){const t=e.slice(7,-1).split(/,\s/).map(Number);i.x+=t[4],i.y+=t[5];}else if(/^matrix3d/.test(e)){const t=e.slice(9,-1).split(/,\s/).map(Number);i.x+=t[12],i.y+=t[13];}t=t.parentNode;}}const s={},n=findPosition(t.target),r=findPosition(e),a=r.width,o=r.height;let l=t.offsetY-(r.top-n.top),d=t.offsetX-(r.left-n.left);return t.changedTouches&&(d=t.changedTouches[0].pageX-r.left,l=t.changedTouches[0].pageY+r.top,IS_IOS&&(d-=i.x,l-=i.y)),s.y=1-Math.max(0,Math.min(1,l/o)),s.x=Math.max(0,Math.min(1,d/a)),s}function isTextNode(e){return isObject(e)&&3===e.nodeType}function emptyEl(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function normalizeContent(e){return "function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map((e=>("function"==typeof e&&(e=e()),isEl(e)||isTextNode(e)?e:"string"==typeof e&&/\S/.test(e)?document_1.createTextNode(e):void 0))).filter((e=>e))}function appendContent(e,t){return normalizeContent(t).forEach((t=>e.appendChild(t))),e}function insertContent(e,t){return appendContent(emptyEl(e),t)}function isSingleLeftClick(e){return void 0===e.button&&void 0===e.buttons||(0===e.button&&void 0===e.buttons||("mouseup"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons))}const $=createQuerier("querySelector"),$$=createQuerier("querySelectorAll");function computedStyle(e,t){if(!e||!t)return "";if("function"==typeof window_1.getComputedStyle){let i;try{i=window_1.getComputedStyle(e);}catch(e){return ""}return i?i.getPropertyValue(t)||i[t]:""}return ""}var Dom=Object.freeze({__proto__:null,isReal:isReal,isEl:isEl,isInFrame:isInFrame,createEl:createEl,textContent:textContent,prependTo:prependTo,hasClass:hasClass,addClass:addClass,removeClass:removeClass,toggleClass:toggleClass,setAttributes:setAttributes,getAttributes:getAttributes,getAttribute:getAttribute,setAttribute:setAttribute,removeAttribute:removeAttribute,blockTextSelection:blockTextSelection,unblockTextSelection:unblockTextSelection,getBoundingClientRect:getBoundingClientRect,findPosition:findPosition,getPointerPosition:getPointerPosition,isTextNode:isTextNode,emptyEl:emptyEl,normalizeContent:normalizeContent,appendContent:appendContent,insertContent:insertContent,isSingleLeftClick:isSingleLeftClick,$:$,$$:$$,computedStyle:computedStyle});let videojs$1,_windowLoaded=!1;const autoSetup=function(){if(!1===videojs$1.options.autoSetup)return;const e=Array.prototype.slice.call(document_1.getElementsByTagName("video")),t=Array.prototype.slice.call(document_1.getElementsByTagName("audio")),i=Array.prototype.slice.call(document_1.getElementsByTagName("video-js")),s=e.concat(t,i);if(s&&s.length>0)for(let e=0,t=s.length;e<t;e++){const t=s[e];if(!t||!t.getAttribute){autoSetupTimeout(1);break}if(void 0===t.player){null!==t.getAttribute("data-setup")&&videojs$1(t);}}else _windowLoaded||autoSetupTimeout(1);};function autoSetupTimeout(e,t){isReal()&&(t&&(videojs$1=t),window_1.setTimeout(autoSetup,e));}function setWindowLoaded(){_windowLoaded=!0,window_1.removeEventListener("load",setWindowLoaded);}isReal()&&("complete"===document_1.readyState?setWindowLoaded():window_1.addEventListener("load",setWindowLoaded));const createStyleElement=function(e){const t=document_1.createElement("style");return t.className=e,t},setTextContent=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t;};var DomData=new WeakMap;let _supportsPassive,_guid=3;function newGUID(){return _guid++}function _cleanUpEvents(e,t){if(!DomData.has(e))return;const i=DomData.get(e);0===i.handlers[t].length&&(delete i.handlers[t],e.removeEventListener?e.removeEventListener(t,i.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,i.dispatcher)),Object.getOwnPropertyNames(i.handlers).length<=0&&(delete i.handlers,delete i.dispatcher,delete i.disabled),0===Object.getOwnPropertyNames(i).length&&DomData.delete(e);}function _handleMultipleEvents(e,t,i,s){i.forEach((function(i){e(t,i,s);}));}function fixEvent(e){if(e.fixed_)return e;function t(){return !0}function i(){return !1}if(!e||!e.isPropagationStopped||!e.isImmediatePropagationStopped){const s=e||window_1.event;e={};for(const t in s)"layerX"!==t&&"layerY"!==t&&"keyLocation"!==t&&"webkitMovementX"!==t&&"webkitMovementY"!==t&&"path"!==t&&("returnValue"===t&&s.preventDefault||(e[t]=s[t]));if(e.target||(e.target=e.srcElement||document_1),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){s.preventDefault&&s.preventDefault(),e.returnValue=!1,s.returnValue=!1,e.defaultPrevented=!0;},e.defaultPrevented=!1,e.stopPropagation=function(){s.stopPropagation&&s.stopPropagation(),e.cancelBubble=!0,s.cancelBubble=!0,e.isPropagationStopped=t;},e.isPropagationStopped=i,e.stopImmediatePropagation=function(){s.stopImmediatePropagation&&s.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation();},e.isImmediatePropagationStopped=i,null!==e.clientX&&void 0!==e.clientX){const t=document_1.documentElement,i=document_1.body;e.pageX=e.clientX+(t&&t.scrollLeft||i&&i.scrollLeft||0)-(t&&t.clientLeft||i&&i.clientLeft||0),e.pageY=e.clientY+(t&&t.scrollTop||i&&i.scrollTop||0)-(t&&t.clientTop||i&&i.clientTop||0);}e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0);}return e.fixed_=!0,e}const supportsPassive=function(){if("boolean"!=typeof _supportsPassive){_supportsPassive=!1;try{const e=Object.defineProperty({},"passive",{get(){_supportsPassive=!0;}});window_1.addEventListener("test",null,e),window_1.removeEventListener("test",null,e);}catch(e){}}return _supportsPassive},passiveEvents=["touchstart","touchmove"];function on(e,t,i){if(Array.isArray(t))return _handleMultipleEvents(on,e,t,i);DomData.has(e)||DomData.set(e,{});const s=DomData.get(e);if(s.handlers||(s.handlers={}),s.handlers[t]||(s.handlers[t]=[]),i.guid||(i.guid=newGUID()),s.handlers[t].push(i),s.dispatcher||(s.disabled=!1,s.dispatcher=function(t,i){if(s.disabled)return;t=fixEvent(t);const n=s.handlers[t.type];if(n){const s=n.slice(0);for(let n=0,r=s.length;n<r&&!t.isImmediatePropagationStopped();n++)try{s[n].call(e,t,i);}catch(e){log$1.error(e);}}}),1===s.handlers[t].length)if(e.addEventListener){let i=!1;supportsPassive()&&passiveEvents.indexOf(t)>-1&&(i={passive:!0}),e.addEventListener(t,s.dispatcher,i);}else e.attachEvent&&e.attachEvent("on"+t,s.dispatcher);}function off(e,t,i){if(!DomData.has(e))return;const s=DomData.get(e);if(!s.handlers)return;if(Array.isArray(t))return _handleMultipleEvents(off,e,t,i);const n=function(e,t){s.handlers[t]=[],_cleanUpEvents(e,t);};if(void 0===t){for(const t in s.handlers)Object.prototype.hasOwnProperty.call(s.handlers||{},t)&&n(e,t);return}const r=s.handlers[t];if(r)if(i){if(i.guid)for(let e=0;e<r.length;e++)r[e].guid===i.guid&&r.splice(e--,1);_cleanUpEvents(e,t);}else n(e,t);}function trigger(e,t,i){const s=DomData.has(e)?DomData.get(e):{},n=e.parentNode||e.ownerDocument;if("string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=fixEvent(t),s.dispatcher&&s.dispatcher.call(e,t,i),n&&!t.isPropagationStopped()&&!0===t.bubbles)trigger.call(null,n,t,i);else if(!n&&!t.defaultPrevented&&t.target&&t.target[t.type]){DomData.has(t.target)||DomData.set(t.target,{});const e=DomData.get(t.target);t.target[t.type]&&(e.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),e.disabled=!1);}return !t.defaultPrevented}function one(e,t,i){if(Array.isArray(t))return _handleMultipleEvents(one,e,t,i);const s=function(){off(e,t,s),i.apply(this,arguments);};s.guid=i.guid=i.guid||newGUID(),on(e,t,s);}function any(e,t,i){const s=function(){off(e,t,s),i.apply(this,arguments);};s.guid=i.guid=i.guid||newGUID(),on(e,t,s);}var Events=Object.freeze({__proto__:null,fixEvent:fixEvent,on:on,off:off,trigger:trigger,one:one,any:any});const bind_=function(e,t,i){t.guid||(t.guid=newGUID());const s=t.bind(e);return s.guid=i?i+"_"+t.guid:t.guid,s},throttle=function(e,t){let i=window_1.performance.now();return function(...s){const n=window_1.performance.now();n-i>=t&&(e(...s),i=n);}},debounce=function(e,t,i,s=window_1){let n;const r=function(){const r=this,a=arguments;let o=function(){n=null,o=null,i||e.apply(r,a);};!n&&i&&e.apply(r,a),s.clearTimeout(n),n=s.setTimeout(o,t);};return r.cancel=()=>{s.clearTimeout(n),n=null;},r};var Fn=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:30,bind_:bind_,throttle:throttle,debounce:debounce});let EVENT_MAP;class EventTarget$2{on(e,t){const i=this.addEventListener;this.addEventListener=()=>{},on(this,e,t),this.addEventListener=i;}off(e,t){off(this,e,t);}one(e,t){const i=this.addEventListener;this.addEventListener=()=>{},one(this,e,t),this.addEventListener=i;}any(e,t){const i=this.addEventListener;this.addEventListener=()=>{},any(this,e,t),this.addEventListener=i;}trigger(e){const t=e.type||e;"string"==typeof e&&(e={type:t}),e=fixEvent(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),trigger(this,e);}queueTrigger(e){EVENT_MAP||(EVENT_MAP=new Map);const t=e.type||e;let i=EVENT_MAP.get(this);i||(i=new Map,EVENT_MAP.set(this,i));const s=i.get(t);i.delete(t),window_1.clearTimeout(s);const n=window_1.setTimeout((()=>{i.delete(t),0===i.size&&(i=null,EVENT_MAP.delete(this)),this.trigger(e);}),0);i.set(t,n);}}EventTarget$2.prototype.allowedEvents_={},EventTarget$2.prototype.addEventListener=EventTarget$2.prototype.on,EventTarget$2.prototype.removeEventListener=EventTarget$2.prototype.off,EventTarget$2.prototype.dispatchEvent=EventTarget$2.prototype.trigger;const objName=e=>"function"==typeof e.name?e.name():"string"==typeof e.name?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e,isEvented=e=>e instanceof EventTarget$2||!!e.eventBusEl_&&["on","one","off","trigger"].every((t=>"function"==typeof e[t])),isValidEventType=e=>"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length,validateTarget=(e,t,i)=>{if(!e||!e.nodeName&&!isEvented(e))throw new Error(`Invalid target for ${objName(t)}#${i}; must be a DOM node or evented object.`)},validateEventType=(e,t,i)=>{if(!isValidEventType(e))throw new Error(`Invalid event type for ${objName(t)}#${i}; must be a non-empty string or array.`)},validateListener=(e,t,i)=>{if("function"!=typeof e)throw new Error(`Invalid listener for ${objName(t)}#${i}; must be a function.`)},normalizeListenArgs=(e,t,i)=>{const s=t.length<3||t[0]===e||t[0]===e.eventBusEl_;let n,r,a;return s?(n=e.eventBusEl_,t.length>=3&&t.shift(),[r,a]=t):[n,r,a]=t,validateTarget(n,e,i),validateEventType(r,e,i),validateListener(a,e,i),a=bind_(e,a),{isTargetingSelf:s,target:n,type:r,listener:a}},listen=(e,t,i,s)=>{validateTarget(e,e,t),e.nodeName?Events[t](e,i,s):e[t](i,s);},EventedMixin={on(...e){const{isTargetingSelf:t,target:i,type:s,listener:n}=normalizeListenArgs(this,e,"on");if(listen(i,"on",s,n),!t){const e=()=>this.off(i,s,n);e.guid=n.guid;const t=()=>this.off("dispose",e);t.guid=n.guid,listen(this,"on","dispose",e),listen(i,"on","dispose",t);}},one(...e){const{isTargetingSelf:t,target:i,type:s,listener:n}=normalizeListenArgs(this,e,"one");if(t)listen(i,"one",s,n);else {const e=(...t)=>{this.off(i,s,e),n.apply(null,t);};e.guid=n.guid,listen(i,"one",s,e);}},any(...e){const{isTargetingSelf:t,target:i,type:s,listener:n}=normalizeListenArgs(this,e,"any");if(t)listen(i,"any",s,n);else {const e=(...t)=>{this.off(i,s,e),n.apply(null,t);};e.guid=n.guid,listen(i,"any",s,e);}},off(e,t,i){if(!e||isValidEventType(e))off(this.eventBusEl_,e,t);else {const s=e,n=t;validateTarget(s,this,"off"),validateEventType(n,this,"off"),validateListener(i,this,"off"),i=bind_(this,i),this.off("dispose",i),s.nodeName?(off(s,n,i),off(s,"dispose",i)):isEvented(s)&&(s.off(n,i),s.off("dispose",i));}},trigger(e,t){validateTarget(this.eventBusEl_,this,"trigger");const i=e&&"string"!=typeof e?e.type:e;if(!isValidEventType(i))throw new Error(`Invalid event type for ${objName(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return trigger(this.eventBusEl_,e,t)}};function evented(e,t={}){const{eventBusKey:i}=t;if(i){if(!e[i].nodeName)throw new Error(`The eventBusKey "${i}" does not refer to an element.`);e.eventBusEl_=e[i];}else e.eventBusEl_=createEl("span",{className:"vjs-event-bus"});return Object.assign(e,EventedMixin),e.eventedCallbacks&&e.eventedCallbacks.forEach((e=>{e();})),e.on("dispose",(()=>{e.off(),[e,e.el_,e.eventBusEl_].forEach((function(e){e&&DomData.has(e)&&DomData.delete(e);})),window_1.setTimeout((()=>{e.eventBusEl_=null;}),0);})),e}const StatefulMixin={state:{},setState(e){let t;return "function"==typeof e&&(e=e()),each(e,((e,i)=>{this.state[i]!==e&&(t=t||{},t[i]={from:this.state[i],to:e}),this.state[i]=e;})),t&&isEvented(this)&&this.trigger({changes:t,type:"statechanged"}),t}};function stateful(e,t){return Object.assign(e,StatefulMixin),e.state=Object.assign({},e.state,t),"function"==typeof e.handleStateChanged&&isEvented(e)&&e.on("statechanged",e.handleStateChanged),e}const toLowerCase=function(e){return "string"!=typeof e?e:e.replace(/./,(e=>e.toLowerCase()))},toTitleCase$1=function(e){return "string"!=typeof e?e:e.replace(/./,(e=>e.toUpperCase()))},titleCaseEquals=function(e,t){return toTitleCase$1(e)===toTitleCase$1(t)};var Str=Object.freeze({__proto__:null,toLowerCase:toLowerCase,toTitleCase:toTitleCase$1,titleCaseEquals:titleCaseEquals});class Component$1{constructor(e,t,i){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=merge$1({},this.options_),t=this.options_=merge$1(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const t=e&&e.id&&e.id()||"no_player";this.id_=`${t}_component_${newGUID()}`;}this.name_=t.name||null,t.el?this.el_=t.el:!1!==t.createEl&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach((e=>this.addClass(e))),!1!==t.evented&&(evented(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),stateful(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,!1!==t.initChildren&&this.initChildren(),this.ready(i),!1!==t.reportTouchActivity&&this.enableTouchActivity();}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let e=this.children_.length-1;e>=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null;}}isDisposed(){return Boolean(this.isDisposed_)}player(){return this.player_}options(e){return e?(this.options_=merge$1(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,i){return createEl(e,t,i)}localize(e,t,i=e){const s=this.player_.language&&this.player_.language(),n=this.player_.languages&&this.player_.languages(),r=n&&n[s],a=s&&s.split("-")[0],o=n&&n[a];let l=i;return r&&r[e]?l=r[e]:o&&o[e]&&(l=o[e]),t&&(l=l.replace(/\{(\d+)\}/g,(function(e,i){const s=t[i-1];let n=s;return void 0===s&&(n=e),n}))),l}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce(((e,t)=>e.concat(t)),[]);let t=this;for(let i=0;i<e.length;i++)if(t=t.getChild(e[i]),!t||!t.getChild)return;return t}addChild(e,t={},i=this.children_.length){let s,n;if("string"==typeof e){n=toTitleCase$1(e);const i=t.componentClass||n;t.name=n;const r=Component$1.getComponent(i);if(!r)throw new Error(`Component ${i} does not exist`);if("function"!=typeof r)return null;s=new r(this.player_||this,t);}else s=e;if(s.parentComponent_&&s.parentComponent_.removeChild(s),this.children_.splice(i,0,s),s.parentComponent_=this,"function"==typeof s.id&&(this.childIndex_[s.id()]=s),n=n||s.name&&toTitleCase$1(s.name()),n&&(this.childNameIndex_[n]=s,this.childNameIndex_[toLowerCase(n)]=s),"function"==typeof s.el&&s.el()){let e=null;this.children_[i+1]&&(this.children_[i+1].el_?e=this.children_[i+1].el_:isEl(this.children_[i+1])&&(e=this.children_[i+1])),this.contentEl().insertBefore(s.el(),e);}return s}removeChild(e){if("string"==typeof e&&(e=this.getChild(e)),!e||!this.children_)return;let t=!1;for(let i=this.children_.length-1;i>=0;i--)if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[toTitleCase$1(e.name())]=null,this.childNameIndex_[toLowerCase(e.name())]=null;const i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el());}initChildren(){const e=this.options_.children;if(e){const t=this.options_,i=e=>{const i=e.name;let s=e.opts;if(void 0!==t[i]&&(s=t[i]),!1===s)return;!0===s&&(s={}),s.playerOptions=this.options_.playerOptions;const n=this.addChild(i,s);n&&(this[i]=n);};let s;const n=Component$1.getComponent("Tech");s=Array.isArray(e)?e:Object.keys(e),s.concat(Object.keys(this.options_).filter((function(e){return !s.some((function(t){return "string"==typeof t?e===t:e===t.name}))}))).map((t=>{let i,s;return "string"==typeof t?(i=t,s=e[i]||this.options_[i]||{}):(i=t.name,s=t),{name:i,opts:s}})).filter((e=>{const t=Component$1.getComponent(e.opts.componentClass||toTitleCase$1(e.name));return t&&!n.isTech(t)})).forEach(i);}}buildCSSClass(){return ""}ready(e,t=!1){if(e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))}triggerReady(){this.isReady_=!0,this.setTimeout((function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach((function(e){e.call(this);}),this),this.trigger("ready");}),1);}$(e,t){return $(e,t||this.contentEl())}$$(e,t){return $$(e,t||this.contentEl())}hasClass(e){return hasClass(this.el_,e)}addClass(...e){addClass(this.el_,...e);}removeClass(...e){removeClass(this.el_,...e);}toggleClass(e,t){toggleClass(this.el_,e,t);}show(){this.removeClass("vjs-hidden");}hide(){this.addClass("vjs-hidden");}lockShowing(){this.addClass("vjs-lock-showing");}unlockShowing(){this.removeClass("vjs-lock-showing");}getAttribute(e){return getAttribute(this.el_,e)}setAttribute(e,t){setAttribute(this.el_,e,t);}removeAttribute(e){removeAttribute(this.el_,e);}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t);}dimension(e,t,i){if(void 0!==t)return null!==t&&t==t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;const s=this.el_.style[e],n=s.indexOf("px");return -1!==n?parseInt(s.slice(0,n),10):parseInt(this.el_["offset"+toTitleCase$1(e)],10)}currentDimension(e){let t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if(t=computedStyle(this.el_,e),t=parseFloat(t),0===t||isNaN(t)){const i=`offset${toTitleCase$1(e)}`;t=this.el_[i];}return t}currentDimensions(){return {width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}focus(){this.el_.focus();}blur(){this.el_.blur();}handleKeyDown(e){this.player_&&(keycode.isEventKey(e,"Tab")||e.stopPropagation(),this.player_.handleKeyDown(e));}handleKeyPress(e){this.handleKeyDown(e);}emitTapEvents(){let e=0,t=null;let i;this.on("touchstart",(function(s){1===s.touches.length&&(t={pageX:s.touches[0].pageX,pageY:s.touches[0].pageY},e=window_1.performance.now(),i=!0);})),this.on("touchmove",(function(e){if(e.touches.length>1)i=!1;else if(t){const s=e.touches[0].pageX-t.pageX,n=e.touches[0].pageY-t.pageY;Math.sqrt(s*s+n*n)>10&&(i=!1);}}));const s=function(){i=!1;};this.on("touchleave",s),this.on("touchcancel",s),this.on("touchend",(function(s){if(t=null,!0===i){window_1.performance.now()-e<200&&(s.preventDefault(),this.trigger("tap"));}}));}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;const e=bind_(this.player(),this.player().reportUserActivity);let t;this.on("touchstart",(function(){e(),this.clearInterval(t),t=this.setInterval(e,250);}));const i=function(i){e(),this.clearInterval(t);};this.on("touchmove",e),this.on("touchend",i),this.on("touchcancel",i);}setTimeout(e,t){var i;return e=bind_(this,e),this.clearTimersOnDispose_(),i=window_1.setTimeout((()=>{this.setTimeoutIds_.has(i)&&this.setTimeoutIds_.delete(i),e();}),t),this.setTimeoutIds_.add(i),i}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),window_1.clearTimeout(e)),e}setInterval(e,t){e=bind_(this,e),this.clearTimersOnDispose_();const i=window_1.setInterval(e,t);return this.setIntervalIds_.add(i),i}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),window_1.clearInterval(e)),e}requestAnimationFrame(e){var t;return this.clearTimersOnDispose_(),e=bind_(this,e),t=window_1.requestAnimationFrame((()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e();})),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){if(this.namedRafs_.has(e))return;this.clearTimersOnDispose_(),t=bind_(this,t);const i=this.requestAnimationFrame((()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e);}));return this.namedRafs_.set(e,i),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e));}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),window_1.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",(()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach((([e,t])=>{this[e].forEach(((e,i)=>this[t](i)));})),this.clearingTimersOnDispose_=!1;})));}static registerComponent(e,t){if("string"!=typeof e||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const i=Component$1.getComponent("Tech"),s=i&&i.isTech(t),n=Component$1===t||Component$1.prototype.isPrototypeOf(t.prototype);if(s||!n){let t;throw t=s?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error(`Illegal component, "${e}"; ${t}.`)}e=toTitleCase$1(e),Component$1.components_||(Component$1.components_={});const r=Component$1.getComponent("Player");if("Player"===e&&r&&r.players){const e=r.players,t=Object.keys(e);if(e&&t.length>0&&t.map((t=>e[t])).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return Component$1.components_[e]=t,Component$1.components_[toLowerCase(e)]=t,t}static getComponent(e){if(e&&Component$1.components_)return Component$1.components_[e]}}function rangeCheck(e,t,i){if("number"!=typeof t||t<0||t>i)throw new Error(`Failed to execute '${e}' on 'TimeRanges': The index provided (${t}) is non-numeric or out of bounds (0-${i}).`)}function getRange(e,t,i,s){return rangeCheck(e,s,i.length-1),i[s][t]}function createTimeRangesObj(e){let t;return t=void 0===e||0===e.length?{length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:getRange.bind(null,"start",0,e),end:getRange.bind(null,"end",1,e)},window_1.Symbol&&window_1.Symbol.iterator&&(t[window_1.Symbol.iterator]=()=>(e||[]).values()),t}function createTimeRanges$1(e,t){return Array.isArray(e)?createTimeRangesObj(e):void 0===e||void 0===t?createTimeRangesObj():createTimeRangesObj([[e,t]])}Component$1.registerComponent("Component",Component$1);const defaultImplementation=function(e,t){e=e<0?0:e;let i=Math.floor(e%60),s=Math.floor(e/60%60),n=Math.floor(e/3600);const r=Math.floor(t/60%60),a=Math.floor(t/3600);return (isNaN(e)||e===1/0)&&(n=s=i="-"),n=n>0||a>0?n+":":"",s=((n||r>=10)&&s<10?"0"+s:s)+":",i=i<10?"0"+i:i,n+s+i};let implementation=defaultImplementation;function setFormatTime(e){implementation=e;}function resetFormatTime(){implementation=defaultImplementation;}function formatTime(e,t=e){return implementation(e,t)}var Time=Object.freeze({__proto__:null,createTimeRanges:createTimeRanges$1,createTimeRange:createTimeRanges$1,setFormatTime:setFormatTime,resetFormatTime:resetFormatTime,formatTime:formatTime});function bufferedPercent(e,t){let i,s,n=0;if(!t)return 0;e&&e.length||(e=createTimeRanges$1(0,0));for(let r=0;r<e.length;r++)i=e.start(r),s=e.end(r),s>t&&(s=t),n+=s-i;return n/t}function MediaError(e){if(e instanceof MediaError)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:isObject(e)&&("number"==typeof e.code&&(this.code=e.code),Object.assign(this,e)),this.message||(this.message=MediaError.defaultMessages[this.code]||"");}MediaError.prototype.code=0,MediaError.prototype.message="",MediaError.prototype.status=null,MediaError.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],MediaError.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(let e=0;e<MediaError.errorTypes.length;e++)MediaError[MediaError.errorTypes[e]]=e,MediaError.prototype[MediaError.errorTypes[e]]=e;function isPromise(e){return null!=e&&"function"==typeof e.then}function silencePromise(e){isPromise(e)&&e.then(null,(e=>{}));}const trackToJson_=function(e){return ["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(((t,i,s)=>(e[i]&&(t[i]=e[i]),t)),{cues:e.cues&&Array.prototype.map.call(e.cues,(function(e){return {startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}}))})},textTracksToJson=function(e){const t=e.$$("track"),i=Array.prototype.map.call(t,(e=>e.track));return Array.prototype.map.call(t,(function(e){const t=trackToJson_(e.track);return e.src&&(t.src=e.src),t})).concat(Array.prototype.filter.call(e.textTracks(),(function(e){return -1===i.indexOf(e)})).map(trackToJson_))},jsonToTextTracks=function(e,t){return e.forEach((function(e){const i=t.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach((e=>i.addCue(e)));})),t.textTracks()};var textTrackConverter={textTracksToJson:textTracksToJson,jsonToTextTracks:jsonToTextTracks,trackToJson_:trackToJson_};class ModalDialog extends Component$1{constructor(e,t){super(e,t),this.handleKeyDown_=e=>this.handleKeyDown(e),this.close_=e=>this.close(e),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=createEl("div",{className:"vjs-modal-dialog-content"},{role:"document"}),this.descEl_=createEl("p",{className:"vjs-modal-dialog-description vjs-control-text",id:this.el().getAttribute("aria-describedby")}),textContent(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_);}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose();}buildCSSClass(){return `vjs-modal-dialog vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(!this.opened_){const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0;}}opened(e){return "boolean"==typeof e&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose();}closeable(e){if("boolean"==typeof e){const t=this.closeable_=!!e;let i=this.getChild("closeButton");if(t&&!i){const e=this.contentEl_;this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=e,this.on(i,"close",this.close_);}!t&&i&&(this.off(i,"close",this.close_),this.removeChild(i),i.dispose());}return this.closeable_}fill(){this.fillWith(this.content());}fillWith(e){const t=this.contentEl(),i=t.parentNode,s=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),insertContent(t,e),this.trigger("modalfill"),s?i.insertBefore(t,s):i.appendChild(t);const n=this.getChild("closeButton");n&&i.appendChild(n.el_);}empty(){this.trigger("beforemodalempty"),emptyEl(this.contentEl()),this.trigger("modalempty");}content(e){return void 0!==e&&(this.content_=e),this.content_}conditionalFocus_(){const e=document_1.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus());}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null);}handleKeyDown(e){if(e.stopPropagation(),keycode.isEventKey(e,"Escape")&&this.closeable())return e.preventDefault(),void this.close();if(!keycode.isEventKey(e,"Tab"))return;const t=this.focusableEls_(),i=this.el_.querySelector(":focus");let s;for(let e=0;e<t.length;e++)if(i===t[e]){s=e;break}document_1.activeElement===this.el_&&(s=0),e.shiftKey&&0===s?(t[t.length-1].focus(),e.preventDefault()):e.shiftKey||s!==t.length-1||(t[0].focus(),e.preventDefault());}focusableEls_(){const e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,(e=>(e instanceof window_1.HTMLAnchorElement||e instanceof window_1.HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof window_1.HTMLInputElement||e instanceof window_1.HTMLSelectElement||e instanceof window_1.HTMLTextAreaElement||e instanceof window_1.HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof window_1.HTMLIFrameElement||e instanceof window_1.HTMLObjectElement||e instanceof window_1.HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable")))}}ModalDialog.prototype.options_={pauseOnOpen:!0,temporary:!0},Component$1.registerComponent("ModalDialog",ModalDialog);class TrackList extends EventTarget$2{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t<e.length;t++)this.addTrack(e[t]);}addTrack(e){const t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.tracks_[t]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=()=>{this.trigger({track:e,type:"labelchange",target:this});},isEvented(e)&&e.addEventListener("labelchange",e.labelchange_);}removeTrack(e){let t;for(let i=0,s=this.length;i<s;i++)if(this[i]===e){t=this[i],t.off&&t.off(),this.tracks_.splice(i,1);break}t&&this.trigger({track:t,type:"removetrack",target:this});}getTrackById(e){let t=null;for(let i=0,s=this.length;i<s;i++){const s=this[i];if(s.id===e){t=s;break}}return t}}TrackList.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const e in TrackList.prototype.allowedEvents_)TrackList.prototype["on"+e]=null;const disableOthers$1=function(e,t){for(let i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].enabled=!1);};class AudioTrackList extends TrackList{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){disableOthers$1(e,e[t]);break}super(e),this.changing_=!1;}addTrack(e){e.enabled&&disableOthers$1(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,disableOthers$1(this,e),this.changing_=!1,this.trigger("change"));},e.addEventListener("enabledchange",e.enabledChange_));}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null);}}const disableOthers=function(e,t){for(let i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].selected=!1);};class VideoTrackList extends TrackList{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){disableOthers(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let e=0;e<this.length;e++)if(this[e].selected)return e;return -1},set(){}});}addTrack(e){e.selected&&disableOthers(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,disableOthers(this,e),this.changing_=!1,this.trigger("change"));},e.addEventListener("selectedchange",e.selectedChange_));}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null);}}class TextTrackList extends TrackList{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_);-1===["metadata","chapters"].indexOf(e.kind)&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_);}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_));}}class HtmlTrackElementList{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,i=e.length;t<i;t++)this.addTrackElement_(e[t]);}addTrackElement_(e){const t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.trackElements_[t]}}),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e);}getTrackElementByTrack_(e){let t;for(let i=0,s=this.trackElements_.length;i<s;i++)if(e===this.trackElements_[i].track){t=this.trackElements_[i];break}return t}removeTrackElement_(e){for(let t=0,i=this.trackElements_.length;t<i;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&"function"==typeof this.trackElements_[t].track.off&&this.trackElements_[t].track.off(),"function"==typeof this.trackElements_[t].off&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}}}class TextTrackCueList{constructor(e){TextTrackCueList.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}});}setCues_(e){const t=this.length||0;let i=0;const s=e.length;this.cues_=e,this.length_=e.length;const n=function(e){""+e in this||Object.defineProperty(this,""+e,{get(){return this.cues_[e]}});};if(t<s)for(i=t;i<s;i++)n.call(this,i);}getCueById(e){let t=null;for(let i=0,s=this.length;i<s;i++){const s=this[i];if(s.id===e){t=s;break}}return t}}const VideoTrackKind={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},AudioTrackKind={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},TextTrackKind={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},TextTrackMode={disabled:"disabled",hidden:"hidden",showing:"showing"};class Track extends EventTarget$2{constructor(e={}){super();const t={id:e.id||"vjs_track_"+newGUID(),kind:e.kind||"",language:e.language||""};let i=e.label||"";for(const e in t)Object.defineProperty(this,e,{get:()=>t[e],set(){}});Object.defineProperty(this,"label",{get:()=>i,set(e){e!==i&&(i=e,this.trigger("labelchange"));}});}}const parseUrl=function(e){const t=["protocol","hostname","port","pathname","search","hash","host"],i=document_1.createElement("a");i.href=e;const s={};for(let e=0;e<t.length;e++)s[t[e]]=i[t[e]];return "http:"===s.protocol&&(s.host=s.host.replace(/:80$/,"")),"https:"===s.protocol&&(s.host=s.host.replace(/:443$/,"")),s.protocol||(s.protocol=window_1.location.protocol),s.host||(s.host=window_1.location.host),s},getAbsoluteURL=function(e){if(!e.match(/^https?:\/\//)){const t=document_1.createElement("a");t.href=e,e=t.href;}return e},getFileExtension=function(e){if("string"==typeof e){const t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e);if(t)return t.pop().toLowerCase()}return ""},isCrossOrigin=function(e,t=window_1.location){const i=parseUrl(e);return (":"===i.protocol?t.protocol:i.protocol)+i.host!==t.protocol+t.host};var Url=Object.freeze({__proto__:null,parseUrl:parseUrl,getAbsoluteURL:getAbsoluteURL,getFileExtension:getFileExtension,isCrossOrigin:isCrossOrigin});const parseCues=function(e,t){const i=new window_1.WebVTT.Parser(window_1,window_1.vttjs,window_1.WebVTT.StringDecoder()),s=[];i.oncue=function(e){t.addCue(e);},i.onparsingerror=function(e){s.push(e);},i.onflush=function(){t.trigger({type:"loadeddata",target:t});},i.parse(e),s.length>0&&(window_1.console&&window_1.console.groupCollapsed&&window_1.console.groupCollapsed(`Text Track parsing errors for ${t.src}`),s.forEach((e=>log$1.error(e))),window_1.console&&window_1.console.groupEnd&&window_1.console.groupEnd()),i.flush();},loadTrack=function(e,t){const i={uri:e},s=isCrossOrigin(e);s&&(i.cors=s);const n="use-credentials"===t.tech_.crossOrigin();n&&(i.withCredentials=n),lib(i,bind_(this,(function(e,i,s){if(e)return log$1.error(e,i);t.loaded_=!0,"function"!=typeof window_1.WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],(e=>{if("vttjserror"!==e.type)return parseCues(s,t);log$1.error(`vttjs failed to load, stopping trying to process ${t.src}`);})):parseCues(s,t);})));};class TextTrack extends Track{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=merge$1(e,{kind:TextTrackKind[e.kind]||"subtitles",language:e.language||e.srclang||""});let i=TextTrackMode[t.mode]||"disabled";const s=t.default;"metadata"!==t.kind&&"chapters"!==t.kind||(i="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=!1!==this.tech_.preloadTextTracks;const n=new TextTrackCueList(this.cues_),r=new TextTrackCueList(this.activeCues_);let a=!1;this.timeupdateHandler=bind_(this,(function(e={}){this.tech_.isDisposed()||(this.tech_.isReady_?(this.activeCues=this.activeCues,a&&(this.trigger("cuechange"),a=!1),"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))):"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)));}));this.tech_.one("dispose",(()=>{this.stopTracking();})),"disabled"!==i&&this.startTracking(),Object.defineProperties(this,{default:{get:()=>s,set(){}},mode:{get:()=>i,set(e){TextTrackMode[e]&&i!==e&&(i=e,this.preload_||"disabled"===i||0!==this.cues.length||loadTrack(this.src,this),this.stopTracking(),"disabled"!==i&&this.startTracking(),this.trigger("modechange"));}},cues:{get(){return this.loaded_?n:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(0===this.cues.length)return r;const e=this.tech_.currentTime(),t=[];for(let i=0,s=this.cues.length;i<s;i++){const s=this.cues[i];s.startTime<=e&&s.endTime>=e&&t.push(s);}if(a=!1,t.length!==this.activeCues_.length)a=!0;else for(let e=0;e<t.length;e++)-1===this.activeCues_.indexOf(t[e])&&(a=!0);return this.activeCues_=t,r.setCues_(this.activeCues_),r},set(){}}}),t.src?(this.src=t.src,this.preload_||(this.loaded_=!0),(this.preload_||"subtitles"!==t.kind&&"captions"!==t.kind)&&loadTrack(this.src,this)):this.loaded_=!0;}startTracking(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler);}stopTracking(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler);}addCue(e){let t=e;if(window_1.vttjs&&!(e instanceof window_1.vttjs.VTTCue)){t=new window_1.vttjs.VTTCue(e.startTime,e.endTime,e.text);for(const i in e)i in t||(t[i]=e[i]);t.id=e.id,t.originalCue_=e;}const i=this.tech_.textTracks();for(let e=0;e<i.length;e++)i[e]!==this&&i[e].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_);}removeCue(e){let t=this.cues_.length;for(;t--;){const i=this.cues_[t];if(i===e||i.originalCue_&&i.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}}TextTrack.prototype.allowedEvents_={cuechange:"cuechange"};class AudioTrack extends Track{constructor(e={}){const t=merge$1(e,{kind:AudioTrackKind[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"enabled",{get:()=>i,set(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("enabledchange"));}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0;}}class VideoTrack extends Track{constructor(e={}){const t=merge$1(e,{kind:VideoTrackKind[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"selected",{get:()=>i,set(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("selectedchange"));}}),t.selected&&(this.selected=t.selected);}}class HTMLTrackElement extends EventTarget$2{constructor(e={}){let t;super();const i=new TextTrack(e);this.kind=i.kind,this.src=i.src,this.srclang=i.language,this.label=i.label,this.default=i.default,Object.defineProperties(this,{readyState:{get:()=>t},track:{get:()=>i}}),t=HTMLTrackElement.NONE,i.addEventListener("loadeddata",(()=>{t=HTMLTrackElement.LOADED,this.trigger({type:"load",target:this});}));}}HTMLTrackElement.prototype.allowedEvents_={load:"load"},HTMLTrackElement.NONE=0,HTMLTrackElement.LOADING=1,HTMLTrackElement.LOADED=2,HTMLTrackElement.ERROR=3;const NORMAL={audio:{ListClass:AudioTrackList,TrackClass:AudioTrack,capitalName:"Audio"},video:{ListClass:VideoTrackList,TrackClass:VideoTrack,capitalName:"Video"},text:{ListClass:TextTrackList,TrackClass:TextTrack,capitalName:"Text"}};Object.keys(NORMAL).forEach((function(e){NORMAL[e].getterName=`${e}Tracks`,NORMAL[e].privateName=`${e}Tracks_`;}));const REMOTE={remoteText:{ListClass:TextTrackList,TrackClass:TextTrack,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:HtmlTrackElementList,TrackClass:HTMLTrackElement,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},ALL=Object.assign({},NORMAL,REMOTE);function createTrackHelper(e,t,i,s,n={}){const r=e.textTracks();n.kind=t,i&&(n.label=i),s&&(n.language=s),n.tech=e;const a=new ALL.text.TrackClass(n);return r.addTrack(a),a}REMOTE.names=Object.keys(REMOTE),NORMAL.names=Object.keys(NORMAL),ALL.names=[].concat(REMOTE.names).concat(NORMAL.names);class Tech extends Component$1{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=e=>this.onDurationChange(e),this.trackProgress_=e=>this.trackProgress(e),this.trackCurrentTime_=e=>this.trackCurrentTime(e),this.stopTrackingCurrentTime_=e=>this.stopTrackingCurrentTime(e),this.disposeSourceHandler_=e=>this.disposeSourceHandler(e),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",(function(){this.hasStarted_=!0;})),this.on("loadstart",(function(){this.hasStarted_=!1;})),ALL.names.forEach((t=>{const i=ALL[t];e&&e[i.getterName]&&(this[i.privateName]=e[i.getterName]);})),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach((t=>{!1===e[`native${t}Tracks`]&&(this[`featuresNative${t}Tracks`]=!1);})),!1===e.nativeCaptions||!1===e.nativeTextTracks?this.featuresNativeTextTracks=!1:!0!==e.nativeCaptions&&!0!==e.nativeTextTracks||(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=!1!==e.preloadTextTracks,this.autoRemoteTextTracks_=new ALL.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech");}triggerSourceset(e){this.isReady_||this.one("ready",(()=>this.setTimeout((()=>this.triggerSourceset(e)),1))),this.trigger({src:e,type:"sourceset"});}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_);}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_);}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(bind_(this,(function(){const e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress();})),500);}onDurationChange(e){this.duration_=this.duration();}buffered(){return createTimeRanges$1(0,0)}bufferedPercent(){return bufferedPercent(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval);}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_);}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_);}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval((function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0});}),250);}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0});}dispose(){this.clearTracks(NORMAL.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose();}clearTracks(e){(e=[].concat(e)).forEach((e=>{const t=this[`${e}Tracks`]()||[];let i=t.length;for(;i--;){const s=t[i];"text"===e&&this.removeRemoteTextTrack(s),t.removeTrack(s);}}));}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const i=e[t];this.removeRemoteTextTrack(i);}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return void 0!==e&&(this.error_=new MediaError(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?createTimeRanges$1(0,0):createTimeRanges$1()}play(){}setScrubbing(){}scrubbing(){}setCurrentTime(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0});}initTrackListeners(){NORMAL.names.forEach((e=>{const t=NORMAL[e],i=()=>{this.trigger(`${e}trackchange`);},s=this[t.getterName]();s.addEventListener("removetrack",i),s.addEventListener("addtrack",i),this.on("dispose",(()=>{s.removeEventListener("removetrack",i),s.removeEventListener("addtrack",i);}));}));}addWebVttScript_(){if(!window_1.WebVTT)if(document_1.body.contains(this.el())){if(!this.options_["vtt.js"]&&isPlain(browserIndex)&&Object.keys(browserIndex).length>0)return void this.trigger("vttjsloaded");const e=document_1.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded");},e.onerror=()=>{this.trigger("vttjserror");},this.on("dispose",(()=>{e.onload=null,e.onerror=null;})),window_1.WebVTT=!0,this.el().parentNode.appendChild(e);}else this.ready(this.addWebVttScript_);}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),i=t=>e.addTrack(t.track),s=t=>e.removeTrack(t.track);t.on("addtrack",i),t.on("removetrack",s),this.addWebVttScript_();const n=()=>this.trigger("texttrackchange"),r=()=>{n();for(let t=0;t<e.length;t++){const i=e[t];i.removeEventListener("cuechange",n),"showing"===i.mode&&i.addEventListener("cuechange",n);}};r(),e.addEventListener("change",r),e.addEventListener("addtrack",r),e.addEventListener("removetrack",r),this.on("dispose",(function(){t.off("addtrack",i),t.off("removetrack",s),e.removeEventListener("change",r),e.removeEventListener("addtrack",r),e.removeEventListener("removetrack",r);for(let t=0;t<e.length;t++){e[t].removeEventListener("cuechange",n);}}));}addTextTrack(e,t,i){if(!e)throw new Error("TextTrack kind is required but was not provided");return createTrackHelper(this,e,t,i)}createRemoteTextTrack(e){const t=merge$1(e,{tech:this});return new REMOTE.remoteTextEl.TrackClass(t)}addRemoteTextTrack(e={},t){const i=this.createRemoteTextTrack(e);return "boolean"!=typeof t&&(t=!1),this.remoteTextTrackEls().addTrackElement_(i),this.remoteTextTracks().addTrack(i.track),!1===t&&this.ready((()=>this.autoRemoteTextTracks_.addTrack(i.track))),i}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e);}getVideoPlaybackQuality(){return {}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return !0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=newGUID();return !this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",(()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e());}))):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e);}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(){}overrideNativeVideoTracks(){}canPlayType(){return ""}static canPlayType(){return ""}static canPlaySource(e,t){return Tech.canPlayType(e.type)}static isTech(e){return e.prototype instanceof Tech||e instanceof Tech||e===Tech}static registerTech(e,t){if(Tech.techs_||(Tech.techs_={}),!Tech.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!Tech.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!Tech.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=toTitleCase$1(e),Tech.techs_[e]=t,Tech.techs_[toLowerCase(e)]=t,"Tech"!==e&&Tech.defaultTechOrder_.push(e),t}static getTech(e){if(e)return Tech.techs_&&Tech.techs_[e]?Tech.techs_[e]:(e=toTitleCase$1(e),window_1&&window_1.videojs&&window_1.videojs[e]?(log$1.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),window_1.videojs[e]):void 0)}}ALL.names.forEach((function(e){const t=ALL[e];Tech.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]};})),Tech.prototype.featuresVolumeControl=!0,Tech.prototype.featuresMuteControl=!0,Tech.prototype.featuresFullscreenResize=!1,Tech.prototype.featuresPlaybackRate=!1,Tech.prototype.featuresProgressEvents=!1,Tech.prototype.featuresSourceset=!1,Tech.prototype.featuresTimeupdateEvents=!1,Tech.prototype.featuresNativeTextTracks=!1,Tech.prototype.featuresVideoFrameCallback=!1,Tech.withSourceHandlers=function(e){e.registerSourceHandler=function(t,i){let s=e.sourceHandlers;s||(s=e.sourceHandlers=[]),void 0===i&&(i=s.length),s.splice(i,0,t);},e.canPlayType=function(t){const i=e.sourceHandlers||[];let s;for(let e=0;e<i.length;e++)if(s=i[e].canPlayType(t),s)return s;return ""},e.selectSourceHandler=function(t,i){const s=e.sourceHandlers||[];let n;for(let e=0;e<s.length;e++)if(n=s[e].canHandleSource(t,i),n)return s[e];return null},e.canPlaySource=function(t,i){const s=e.selectSourceHandler(t,i);return s?s.canHandleSource(t,i):""};["seekable","seeking","duration"].forEach((function(e){const t=this[e];"function"==typeof t&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)});}),e.prototype),e.prototype.setSource=function(t){let i=e.selectSourceHandler(t,this.options_);i||(e.nativeSourceHandler?i=e.nativeSourceHandler:log$1.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),i!==e.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=i.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_);},e.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null);};},Component$1.registerComponent("Tech",Tech),Tech.registerTech("Tech",Tech),Tech.defaultTechOrder_=[];const middlewares={},middlewareInstances={},TERMINATOR={};function use(e,t){middlewares[e]=middlewares[e]||[],middlewares[e].push(t);}function setSource(e,t,i){e.setTimeout((()=>setSourceHelper(t,middlewares[t.type],i,e)),1);}function setTech(e,t){e.forEach((e=>e.setTech&&e.setTech(t)));}function get(e,t,i){return e.reduceRight(middlewareIterator(i),t[i]())}function set(e,t,i,s){return t[i](e.reduce(middlewareIterator(i),s))}function mediate(e,t,i,s=null){const n="call"+toTitleCase$1(i),r=e.reduce(middlewareIterator(n),s),a=r===TERMINATOR,o=a?null:t[i](r);return executeRight(e,i,o,a),o}const allowedGetters={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},allowedSetters={setCurrentTime:1,setMuted:1,setVolume:1},allowedMediators={play:1,pause:1};function middlewareIterator(e){return (t,i)=>t===TERMINATOR?TERMINATOR:i[e]?i[e](t):t}function executeRight(e,t,i,s){for(let n=e.length-1;n>=0;n--){const r=e[n];r[t]&&r[t](s,i);}}function clearCacheForPlayer(e){middlewareInstances[e.id()]=null;}function getOrCreateFactory(e,t){const i=middlewareInstances[e.id()];let s=null;if(null==i)return s=t(e),middlewareInstances[e.id()]=[[t,s]],s;for(let e=0;e<i.length;e++){const[n,r]=i[e];n===t&&(s=r);}return null===s&&(s=t(e),i.push([t,s])),s}function setSourceHelper(e={},t=[],i,s,n=[],r=!1){const[a,...o]=t;if("string"==typeof a)setSourceHelper(e,middlewares[a],i,s,n,r);else if(a){const t=getOrCreateFactory(s,a);if(!t.setSource)return n.push(t),setSourceHelper(e,o,i,s,n,r);t.setSource(Object.assign({},e),(function(a,l){if(a)return setSourceHelper(e,o,i,s,n,r);n.push(t),setSourceHelper(l,e.type===l.type?o:middlewares[l.type],i,s,n,r);}));}else o.length?setSourceHelper(e,o,i,s,n,r):r?i(e,n):setSourceHelper(e,middlewares["*"],i,s,n,!0);}const MimetypesKind={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},getMimetype=function(e=""){const t=getFileExtension(e);return MimetypesKind[t.toLowerCase()]||""},findMimetype=(e,t)=>{if(!t)return "";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;const i=e.cache_.sources.filter((e=>e.src===t));if(i.length)return i[0].type;const s=e.$$("source");for(let e=0;e<s.length;e++){const i=s[e];if(i.type&&i.src&&i.src===t)return i.type}return getMimetype(t)},filterSource=function(e){if(Array.isArray(e)){let t=[];e.forEach((function(e){e=filterSource(e),Array.isArray(e)?t=t.concat(e):isObject(e)&&t.push(e);})),e=t;}else e="string"==typeof e&&e.trim()?[fixSource({src:e})]:isObject(e)&&"string"==typeof e.src&&e.src&&e.src.trim()?[fixSource(e)]:[];return e};function fixSource(e){if(!e.type){const t=getMimetype(e.src);t&&(e.type=t);}return e}class MediaLoader extends Component$1{constructor(e,t,i){if(super(e,merge$1({createEl:!1},t),i),t.playerOptions.sources&&0!==t.playerOptions.sources.length)e.src(t.playerOptions.sources);else for(let i=0,s=t.playerOptions.techOrder;i<s.length;i++){const t=toTitleCase$1(s[i]);let n=Tech.getTech(t);if(t||(n=Component$1.getComponent(t)),n&&n.isSupported()){e.loadTech_(t);break}}}}Component$1.registerComponent("MediaLoader",MediaLoader);class ClickableComponent extends Component$1{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=e=>this.handleMouseOver(e),this.handleMouseOut_=e=>this.handleMouseOut(e),this.handleClick_=e=>this.handleClick(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.emitTapEvents(),this.enable();}createEl(e="div",t={},i={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),"button"===e&&log$1.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),i=Object.assign({role:"button"},i),this.tabIndex_=t.tabIndex;const s=createEl(e,t,i);return s.appendChild(createEl("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(s),s}dispose(){this.controlTextEl_=null,super.dispose();}createControlTextEl(e){return this.controlTextEl_=createEl("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(void 0===e)return this.controlText_||"Need Text";const i=this.localize(e);this.controlText_=e,textContent(this.controlTextEl_,i),this.nonIconControl||this.player_.options_.noUITitleAttributes||t.setAttribute("title",i);}buildCSSClass(){return `vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_));}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_);}handleLanguagechange(){this.controlText(this.controlText_);}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments);}handleKeyDown(e){keycode.isEventKey(e,"Space")||keycode.isEventKey(e,"Enter")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e);}}Component$1.registerComponent("ClickableComponent",ClickableComponent);class PosterImage extends ClickableComponent{constructor(e,t){super(e,t),this.update(),this.update_=e=>this.update(e),e.on("posterchange",this.update_);}dispose(){this.player().off("posterchange",this.update_),super.dispose();}createEl(){return createEl("picture",{className:"vjs-poster",tabIndex:-1},{},createEl("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))}crossOrigin(e){if(void 0===e)return this.el_?this.el_.querySelector("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;null===e||"anonymous"===e||"use-credentials"===e?this.el_.querySelector("img").crossOrigin=e:this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide();}setSrc(e){this.el_.querySelector("img").src=e;}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?silencePromise(this.player_.play()):this.player_.pause());}}PosterImage.prototype.crossorigin=PosterImage.prototype.crossOrigin,Component$1.registerComponent("PosterImage",PosterImage);const fontMap={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function constructColor(e,t){let i;if(4===e.length)i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else {if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");i=e.slice(1);}return "rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function tryUpdateStyle(e,t,i){try{e.style[t]=i;}catch(e){return}}class TextTrackDisplay extends Component$1{constructor(e,t,i){super(e,t,i);const s=e=>this.updateDisplay(e);e.on("loadstart",(e=>this.toggleDisplay(e))),e.on("texttrackchange",s),e.on("loadedmetadata",(e=>this.preselectTrack(e))),e.ready(bind_(this,(function(){if(e.tech_&&e.tech_.featuresNativeTextTracks)return void this.hide();e.on("fullscreenchange",s),e.on("playerresize",s);const t=window_1.screen.orientation||window_1,i=window_1.screen.orientation?"change":"orientationchange";t.addEventListener(i,s),e.on("dispose",(()=>t.removeEventListener(i,s)));const n=this.options_.playerOptions.tracks||[];for(let e=0;e<n.length;e++)this.player_.addRemoteTextTrack(n[e],!0);this.preselectTrack();})));}preselectTrack(){const e={captions:1,subtitles:1},t=this.player_.textTracks(),i=this.player_.cache_.selectedLanguage;let s,n,r;for(let a=0;a<t.length;a++){const o=t[a];i&&i.enabled&&i.language&&i.language===o.language&&o.kind in e?o.kind===i.kind?r=o:r||(r=o):i&&!i.enabled?(r=null,s=null,n=null):o.default&&("descriptions"!==o.kind||s?o.kind in e&&!n&&(n=o):s=o);}r?r.mode="showing":n?n.mode="showing":s&&(s.mode="showing");}toggleDisplay(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show();}createEl(){return super.createEl("div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})}clearDisplay(){"function"==typeof window_1.WebVTT&&window_1.WebVTT.processCues(window_1,[],this.el_);}updateDisplay(){const e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){const t=[];for(let i=0;i<e.length;++i){const s=e[i];"showing"===s.mode&&t.push(s);}return void this.updateForTrack(t)}let i=null,s=null,n=e.length;for(;n--;){const t=e[n];"showing"===t.mode&&("descriptions"===t.kind?i=t:s=t);}s?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(s)):i&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(i));}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),i=e.activeCues;let s=i.length;for(;s--;){const e=i[s];if(!e)continue;const n=e.displayState;if(t.color&&(n.firstChild.style.color=t.color),t.textOpacity&&tryUpdateStyle(n.firstChild,"color",constructColor(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(n.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&tryUpdateStyle(n.firstChild,"backgroundColor",constructColor(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?tryUpdateStyle(n,"backgroundColor",constructColor(t.windowColor,t.windowOpacity)):n.style.backgroundColor=t.windowColor),t.edgeStyle&&("dropshadow"===t.edgeStyle?n.firstChild.style.textShadow="2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px #222":"raised"===t.edgeStyle?n.firstChild.style.textShadow="1px 1px #222, 2px 2px #222, 3px 3px #222":"depressed"===t.edgeStyle?n.firstChild.style.textShadow="1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px #222":"uniform"===t.edgeStyle&&(n.firstChild.style.textShadow="0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px #222")),t.fontPercent&&1!==t.fontPercent){const e=window_1.parseFloat(n.style.fontSize);n.style.fontSize=e*t.fontPercent+"px",n.style.height="auto",n.style.top="auto";}t.fontFamily&&"default"!==t.fontFamily&&("small-caps"===t.fontFamily?n.firstChild.style.fontVariant="small-caps":n.firstChild.style.fontFamily=fontMap[t.fontFamily]);}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),"function"!=typeof window_1.WebVTT||e.every((e=>!e.activeCues)))return;const t=[];for(let i=0;i<e.length;++i){const s=e[i];for(let e=0;e<s.activeCues.length;++e)t.push(s.activeCues[e]);}window_1.WebVTT.processCues(window_1,t,this.el_);for(let t=0;t<e.length;++t){const i=e[t];for(let e=0;e<i.activeCues.length;++e){const s=i.activeCues[e].displayState;addClass(s,"vjs-text-track-cue","vjs-text-track-cue-"+(i.language?i.language:t)),i.language&&setAttribute(s,"lang",i.language);}this.player_.textTrackSettings&&this.updateDisplayState(i);}}}Component$1.registerComponent("TextTrackDisplay",TextTrackDisplay);class LoadingSpinner extends Component$1{createEl(){const e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"Video Player"),i=createEl("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[t])}),s=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});return s.appendChild(i),s}}Component$1.registerComponent("LoadingSpinner",LoadingSpinner);class Button extends ClickableComponent{createEl(e,t={},i={}){const s=createEl("button",t=Object.assign({className:this.buildCSSClass()},t),i=Object.assign({type:"button"},i));return s.appendChild(createEl("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(s),s}addChild(e,t={}){const i=this.constructor.name;return log$1.warn(`Adding an actionable (user controllable) child to a Button (${i}) is not supported; use a ClickableComponent instead.`),Component$1.prototype.addChild.call(this,e,t)}enable(){super.enable(),this.el_.removeAttribute("disabled");}disable(){super.disable(),this.el_.setAttribute("disabled","disabled");}handleKeyDown(e){keycode.isEventKey(e,"Space")||keycode.isEventKey(e,"Enter")?e.stopPropagation():super.handleKeyDown(e);}}Component$1.registerComponent("Button",Button);class BigPlayButton extends Button{constructor(e,t){super(e,t),this.mouseused_=!1,this.on("mousedown",(e=>this.handleMouseDown(e)));}buildCSSClass(){return "vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY)return silencePromise(t),void(this.player_.tech(!0)&&this.player_.tech(!0).focus());const i=this.player_.getChild("controlBar"),s=i&&i.getChild("playToggle");if(!s)return void this.player_.tech(!0).focus();const n=()=>s.focus();isPromise(t)?t.then(n,(()=>{})):this.setTimeout(n,1);}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e);}handleMouseDown(e){this.mouseused_=!0;}}BigPlayButton.prototype.controlText_="Play Video",Component$1.registerComponent("BigPlayButton",BigPlayButton);class CloseButton extends Button{constructor(e,t){super(e,t),this.controlText(t&&t.controlText||this.localize("Close"));}buildCSSClass(){return `vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1});}handleKeyDown(e){keycode.isEventKey(e,"Esc")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e);}}Component$1.registerComponent("CloseButton",CloseButton);class PlayToggle extends Button{constructor(e,t={}){super(e,t),t.replay=void 0===t.replay||t.replay,this.on(e,"play",(e=>this.handlePlay(e))),this.on(e,"pause",(e=>this.handlePause(e))),t.replay&&this.on(e,"ended",(e=>this.handleEnded(e)));}buildCSSClass(){return `vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?silencePromise(this.player_.play()):this.player_.pause();}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e);}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause");}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play");}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",(e=>this.handleSeeked(e)));}}PlayToggle.prototype.controlText_="Play",Component$1.registerComponent("PlayToggle",PlayToggle);class TimeDisplay extends Component$1{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended"],(e=>this.updateContent(e))),this.updateTextNode_();}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),i=createEl("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return t.appendChild(i),this.contentEl_=createEl("span",{className:`${e}-display`},{"aria-live":"off",role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose();}updateTextNode_(e=0){e=formatTime(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",(()=>{if(!this.contentEl_)return;let e=this.textNode_;e&&this.contentEl_.firstChild!==e&&(e=null,log$1.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=document_1.createTextNode(this.formattedTime_),this.textNode_&&(e?this.contentEl_.replaceChild(this.textNode_,e):this.contentEl_.appendChild(this.textNode_));})));}updateContent(e){}}TimeDisplay.prototype.labelText_="Time",TimeDisplay.prototype.controlText_="Time",Component$1.registerComponent("TimeDisplay",TimeDisplay);class CurrentTimeDisplay extends TimeDisplay{buildCSSClass(){return "vjs-current-time"}updateContent(e){let t;t=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t);}}CurrentTimeDisplay.prototype.labelText_="Current Time",CurrentTimeDisplay.prototype.controlText_="Current Time",Component$1.registerComponent("CurrentTimeDisplay",CurrentTimeDisplay);class DurationDisplay extends TimeDisplay{constructor(e,t){super(e,t);const i=e=>this.updateContent(e);this.on(e,"durationchange",i),this.on(e,"loadstart",i),this.on(e,"loadedmetadata",i);}buildCSSClass(){return "vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t);}}DurationDisplay.prototype.labelText_="Duration",DurationDisplay.prototype.controlText_="Duration",Component$1.registerComponent("DurationDisplay",DurationDisplay);class TimeDivider extends Component$1{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),i=super.createEl("span",{textContent:"/"});return t.appendChild(i),e.appendChild(t),e}}Component$1.registerComponent("TimeDivider",TimeDivider);class RemainingTimeDisplay extends TimeDisplay{constructor(e,t){super(e,t),this.on(e,"durationchange",(e=>this.updateContent(e)));}buildCSSClass(){return "vjs-remaining-time"}createEl(){const e=super.createEl();return !1!==this.options_.displayNegative&&e.insertBefore(createEl("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if("number"!=typeof this.player_.duration())return;let t;t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t);}}RemainingTimeDisplay.prototype.labelText_="Remaining Time",RemainingTimeDisplay.prototype.controlText_="Remaining Time",Component$1.registerComponent("RemainingTimeDisplay",RemainingTimeDisplay);class LiveDisplay extends Component$1{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",(e=>this.updateShowing(e)));}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=createEl("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(createEl("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(document_1.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose();}updateShowing(e){this.player().duration()===1/0?this.show():this.hide();}}Component$1.registerComponent("LiveDisplay",LiveDisplay);class SeekToLive extends Button{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=e=>this.updateLiveEdgeStatus(e),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_));}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=createEl("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"));}handleClick(){this.player_.liveTracker.seekToLiveEdge();}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose();}}function clamp(e,t,i){return e=Number(e),Math.min(i,Math.max(t,isNaN(e)?t:e))}SeekToLive.prototype.controlText_="Seek to live, currently playing live",Component$1.registerComponent("SeekToLive",SeekToLive);var Num=Object.freeze({__proto__:null,clamp:clamp});class Slider extends Component$1{constructor(e,t){super(e,t),this.handleMouseDown_=e=>this.handleMouseDown(e),this.handleMouseUp_=e=>this.handleMouseUp(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.handleClick_=e=>this.handleClick(e),this.handleMouseMove_=e=>this.handleMouseMove(e),this.update_=e=>this.update(e),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable();}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0);}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1;}createEl(e,t={},i={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),i=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},i),super.createEl(e,t,i)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||IS_CHROME||e.preventDefault(),blockTextSelection(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0);}handleMouseMove(e){}handleMouseUp(){const e=this.bar.el_.ownerDocument;unblockTextSelection(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.update();}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",(()=>{const t=this.vertical()?"height":"width";this.bar.el().style[t]=(100*e).toFixed(2)+"%";}))),e}getProgress(){return Number(clamp(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=getPointerPosition(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){keycode.isEventKey(e,"Left")||keycode.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepBack()):keycode.isEventKey(e,"Right")||keycode.isEventKey(e,"Up")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e);}handleClick(e){e.stopPropagation(),e.preventDefault();}vertical(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal");}}Component$1.registerComponent("Slider",Slider);const percentify=(e,t)=>clamp(e/t*100,0,100).toFixed(2)+"%";class LoadProgressBar extends Component$1{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",(e=>this.update(e)));}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=createEl("span",{className:"vjs-control-text"}),i=createEl("span",{textContent:this.localize("Loaded")}),s=document_1.createTextNode(": ");return this.percentageEl_=createEl("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(i),t.appendChild(s),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose();}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",(()=>{const e=this.player_.liveTracker,t=this.player_.buffered(),i=e&&e.isLive()?e.seekableEnd():this.player_.duration(),s=this.player_.bufferedEnd(),n=this.partEls_,r=percentify(s,i);this.percent_!==r&&(this.el_.style.width=r,textContent(this.percentageEl_,r),this.percent_=r);for(let e=0;e<t.length;e++){const i=t.start(e),r=t.end(e);let a=n[e];a||(a=this.el_.appendChild(createEl()),n[e]=a),a.dataset.start===i&&a.dataset.end===r||(a.dataset.start=i,a.dataset.end=r,a.style.left=percentify(i,s),a.style.width=percentify(r-i,s));}for(let e=n.length;e>t.length;e--)this.el_.removeChild(n[e-1]);n.length=t.length;}));}}Component$1.registerComponent("LoadProgressBar",LoadProgressBar);class TimeTooltip extends Component$1{constructor(e,t){super(e,t),this.update=throttle(bind_(this,this.update),30);}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,i){const s=findPosition(this.el_),n=getBoundingClientRect(this.player_.el()),r=e.width*t;if(!n||!s)return;const a=e.left-n.left+r,o=e.width-r+(n.right-e.right);let l=s.width/2;a<l?l+=l-a:o<l&&(l=o),l<0?l=0:l>s.width&&(l=s.width),l=Math.round(l),this.el_.style.right=`-${l}px`,this.write(i);}write(e){textContent(this.el_,e);}updateTime(e,t,i,s){this.requestNamedAnimationFrame("TimeTooltip#updateTime",(()=>{let n;const r=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const e=this.player_.liveTracker.liveWindow(),i=e-t*e;n=(i<1?"":"-")+formatTime(i,e);}else n=formatTime(i,r);this.update(e,t,n),s&&s();}));}}Component$1.registerComponent("TimeTooltip",TimeTooltip);class PlayProgressBar extends Component$1{constructor(e,t){super(e,t),this.update=throttle(bind_(this,this.update),30);}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t){const i=this.getChild("timeTooltip");if(!i)return;const s=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(e,t,s);}}PlayProgressBar.prototype.options_={children:[]},IS_IOS||IS_ANDROID||PlayProgressBar.prototype.options_.children.push("timeTooltip"),Component$1.registerComponent("PlayProgressBar",PlayProgressBar);class MouseTimeDisplay extends Component$1{constructor(e,t){super(e,t),this.update=throttle(bind_(this,this.update),30);}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const i=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,i,(()=>{this.el_.style.left=e.width*t+"px";}));}}MouseTimeDisplay.prototype.options_={children:["timeTooltip"]},Component$1.registerComponent("MouseTimeDisplay",MouseTimeDisplay);class SeekBar extends Slider{constructor(e,t){super(e,t),this.setEventHandlers_();}setEventHandlers_(){this.update_=bind_(this,this.update),this.update=throttle(this.update_,30),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in document_1&&"visibilityState"in document_1&&this.on(document_1,"visibilitychange",this.toggleVisibility_);}toggleVisibility_(e){"hidden"===document_1.visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update());}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,30));}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null);}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if("hidden"===document_1.visibilityState)return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",(()=>{const e=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),i=this.player_.liveTracker;let s=this.player_.duration();i&&i.isLive()&&(s=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.percent_=t),this.currentTime_===e&&this.duration_===s||(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[formatTime(e,s),formatTime(s,s)],"{1} of {2}")),this.currentTime_=e,this.duration_=s),this.bar&&this.bar.update(getBoundingClientRect(this.el()),this.getProgress());})),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e);}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}getPercent(){const e=this.getCurrentTime_();let t;const i=this.player_.liveTracker;return i&&i.isLive()?(t=(e-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){isSingleLeftClick(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),super.handleMouseDown(e));}handleMouseMove(e,t=!1){if(!isSingleLeftClick(e))return;let i;t||this.player_.scrubbing()||this.player_.scrubbing(!0);const s=this.calculateDistance(e),n=this.player_.liveTracker;if(n&&n.isLive()){if(s>=.99)return void n.seekToLiveEdge();const e=n.seekableStart(),t=n.liveCurrentTime();if(i=e+s*n.liveWindow(),i>=t&&(i=t),i<=e&&(i=e+.1),i===1/0)return}else i=s*this.player_.duration(),i===this.player_.duration()&&(i-=.1);this.userSeek_(i);}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show();}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide();}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?silencePromise(this.player_.play()):this.update_();}stepForward(){this.userSeek_(this.player_.currentTime()+5);}stepBack(){this.userSeek_(this.player_.currentTime()-5);}handleAction(e){this.player_.paused()?this.player_.play():this.player_.pause();}handleKeyDown(e){const t=this.player_.liveTracker;if(keycode.isEventKey(e,"Space")||keycode.isEventKey(e,"Enter"))e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(keycode.isEventKey(e,"Home"))e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(keycode.isEventKey(e,"End"))e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(keycode(e))){e.preventDefault(),e.stopPropagation();const i=10*(keycode.codes[keycode(e)]-keycode.codes[0])/100;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*i):this.userSeek_(this.player_.duration()*i);}else keycode.isEventKey(e,"PgDn")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):keycode.isEventKey(e,"PgUp")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):super.handleKeyDown(e);}dispose(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in document_1&&"visibilityState"in document_1&&this.off(document_1,"visibilitychange",this.toggleVisibility_),super.dispose();}}SeekBar.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},IS_IOS||IS_ANDROID||SeekBar.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),Component$1.registerComponent("SeekBar",SeekBar);class ProgressControl extends Component$1{constructor(e,t){super(e,t),this.handleMouseMove=throttle(bind_(this,this.handleMouseMove),30),this.throttledHandleMouseSeek=throttle(bind_(this,this.handleMouseSeek),30),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.handleMouseDownHandler_=e=>this.handleMouseDown(e),this.enable();}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const i=t.getChild("playProgressBar"),s=t.getChild("mouseTimeDisplay");if(!i&&!s)return;const n=t.el(),r=findPosition(n);let a=getPointerPosition(n,e).x;a=clamp(a,0,1),s&&s.update(r,a),i&&i.update(r,t.getProgress());}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e);}enabled(){return this.enabled_}disable(){if(this.children().forEach((e=>e.disable&&e.disable())),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&silencePromise(this.player_.play());}}enable(){this.children().forEach((e=>e.enable&&e.enable())),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0);}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_);}handleMouseDown(e){const t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_);}handleMouseUp(e){const t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart();}}ProgressControl.prototype.options_={children:["seekBar"]},Component$1.registerComponent("ProgressControl",ProgressControl);class PictureInPictureToggle extends Button{constructor(e,t){super(e,t),this.on(e,["enterpictureinpicture","leavepictureinpicture"],(e=>this.handlePictureInPictureChange(e))),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],(e=>this.handlePictureInPictureEnabledChange(e))),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],(()=>{"audio"===e.currentType().substring(0,5)||e.audioPosterMode()||e.audioOnlyMode()?(e.isInPictureInPicture()&&e.exitPictureInPicture(),this.hide()):this.show();})),this.disable();}buildCSSClass(){return `vjs-picture-in-picture-control ${super.buildCSSClass()}`}handlePictureInPictureEnabledChange(){document_1.pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()?this.enable():this.disable();}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange();}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture();}}PictureInPictureToggle.prototype.controlText_="Picture-in-Picture",Component$1.registerComponent("PictureInPictureToggle",PictureInPictureToggle);class FullscreenToggle extends Button{constructor(e,t){super(e,t),this.on(e,"fullscreenchange",(e=>this.handleFullscreenChange(e))),!1===document_1[e.fsApi_.fullscreenEnabled]&&this.disable();}buildCSSClass(){return `vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?this.controlText("Exit Fullscreen"):this.controlText("Fullscreen");}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen();}}FullscreenToggle.prototype.controlText_="Fullscreen",Component$1.registerComponent("FullscreenToggle",FullscreenToggle);const checkVolumeSupport=function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden");}));};class VolumeLevel extends Component$1{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}Component$1.registerComponent("VolumeLevel",VolumeLevel);class VolumeLevelTooltip extends Component$1{constructor(e,t){super(e,t),this.update=throttle(bind_(this,this.update),30);}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,i,s){if(!i){const i=getBoundingClientRect(this.el_),s=getBoundingClientRect(this.player_.el()),n=e.width*t;if(!s||!i)return;const r=e.left-s.left+n,a=e.width-n+(s.right-e.right);let o=i.width/2;r<o?o+=o-r:a<o&&(o=a),o<0?o=0:o>i.width&&(o=i.width),this.el_.style.right=`-${o}px`;}this.write(`${s}%`);}write(e){textContent(this.el_,e);}updateVolume(e,t,i,s,n){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",(()=>{this.update(e,t,i,s.toFixed(0)),n&&n();}));}}Component$1.registerComponent("VolumeLevelTooltip",VolumeLevelTooltip);class MouseVolumeLevelDisplay extends Component$1{constructor(e,t){super(e,t),this.update=throttle(bind_(this,this.update),30);}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,i){const s=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,s,(()=>{i?this.el_.style.bottom=e.height*t+"px":this.el_.style.left=e.width*t+"px";}));}}MouseVolumeLevelDisplay.prototype.options_={children:["volumeLevelTooltip"]},Component$1.registerComponent("MouseVolumeLevelDisplay",MouseVolumeLevelDisplay);class VolumeBar extends Slider{constructor(e,t){super(e,t),this.on("slideractive",(e=>this.updateLastVolume_(e))),this.on(e,"volumechange",(e=>this.updateARIAAttributes(e))),e.ready((()=>this.updateARIAAttributes()));}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){isSingleLeftClick(e)&&super.handleMouseDown(e);}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const i=this.el(),s=getBoundingClientRect(i),n=this.vertical();let r=getPointerPosition(i,e);r=n?r.y:r.x,r=clamp(r,0,1),t.update(s,r,n);}isSingleLeftClick(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)));}checkMuted(){this.player_.muted()&&this.player_.muted(!1);}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1);}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1);}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%");}volumeAsPercentage_(){return Math.round(100*this.player_.volume())}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",(()=>{0===this.player_.volume()&&this.player_.lastVolume_(e);}));}}VolumeBar.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},IS_IOS||IS_ANDROID||VolumeBar.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),VolumeBar.prototype.playerEvent="volumechange",Component$1.registerComponent("VolumeBar",VolumeBar);class VolumeControl extends Component$1{constructor(e,t={}){t.vertical=t.vertical||!1,(void 0===t.volumeBar||isPlain(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),checkVolumeSupport(this,e),this.throttledHandleMouseMove=throttle(bind_(this,this.handleMouseMove),30),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.on("mousedown",(e=>this.handleMouseDown(e))),this.on("touchstart",(e=>this.handleMouseDown(e))),this.on("mousemove",(e=>this.handleMouseMove(e))),this.on(this.volumeBar,["focus","slideractive"],(()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive");})),this.on(this.volumeBar,["blur","sliderinactive"],(()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive");}));}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_);}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_);}handleMouseMove(e){this.volumeBar.handleMouseMove(e);}}VolumeControl.prototype.options_={children:["volumeBar"]},Component$1.registerComponent("VolumeControl",VolumeControl);const checkMuteSupport=function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden");}));};class MuteToggle extends Button{constructor(e,t){super(e,t),checkMuteSupport(this,e),this.on(e,["loadstart","volumechange"],(e=>this.update(e)));}buildCSSClass(){return `vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),i=this.player_.lastVolume_();if(0===t){const e=i<.1?.1:i;this.player_.volume(e),this.player_.muted(!1);}else this.player_.muted(!this.player_.muted());}update(e){this.updateIcon_(),this.updateControlText_();}updateIcon_(){const e=this.player_.volume();let t=3;IS_IOS&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2),removeClass(this.el_,[0,1,2,3].reduce(((e,t)=>e+`${t?" ":""}vjs-vol-${t}`),"")),addClass(this.el_,`vjs-vol-${t}`);}updateControlText_(){const e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e);}}MuteToggle.prototype.controlText_="Mute",Component$1.registerComponent("MuteToggle",MuteToggle);class VolumePanel extends Component$1{constructor(e,t={}){void 0!==t.inline?t.inline=t.inline:t.inline=!0,(void 0===t.volumeControl||isPlain(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=e=>this.handleKeyPress(e),this.on(e,["loadstart"],(e=>this.volumePanelState_(e))),this.on(this.muteToggle,"keyup",(e=>this.handleKeyPress(e))),this.on(this.volumeControl,"keyup",(e=>this.handleVolumeControlKeyUp(e))),this.on("keydown",(e=>this.handleKeyPress(e))),this.on("mouseover",(e=>this.handleMouseOver(e))),this.on("mouseout",(e=>this.handleMouseOut(e))),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_);}sliderActive_(){this.addClass("vjs-slider-active");}sliderInactive_(){this.removeClass("vjs-slider-active");}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only");}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose();}handleVolumeControlKeyUp(e){keycode.isEventKey(e,"Esc")&&this.muteToggle.focus();}handleMouseOver(e){this.addClass("vjs-hover"),on(document_1,"keyup",this.handleKeyPressHandler_);}handleMouseOut(e){this.removeClass("vjs-hover"),off(document_1,"keyup",this.handleKeyPressHandler_);}handleKeyPress(e){keycode.isEventKey(e,"Esc")&&this.handleMouseOut();}}VolumePanel.prototype.options_={children:["muteToggle","volumeControl"]},Component$1.registerComponent("VolumePanel",VolumePanel);class Menu extends Component$1{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",(e=>this.handleKeyDown(e))),this.boundHandleBlur_=e=>this.handleBlur(e),this.boundHandleTapClick_=e=>this.handleTapClick(e);}addEventListenerForItem(e){e instanceof Component$1&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_));}removeEventListenerForItem(e){e instanceof Component$1&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_));}removeChild(e){"string"==typeof e&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e);}addItem(e){const t=this.addChild(e);t&&this.addEventListenerForItem(t);}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=createEl(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),on(t,"click",(function(e){e.preventDefault(),e.stopImmediatePropagation();})),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose();}handleBlur(e){const t=e.relatedTarget||document_1.activeElement;if(!this.children().some((e=>e.el()===t))){const e=this.menuButton_;e&&e.buttonPressed_&&t!==e.el().firstChild&&e.unpressButton();}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const i=t.filter((t=>t.el()===e.target))[0];if(!i)return;"CaptionSettingsMenuItem"!==i.name()&&this.menuButton_.focus();}}handleKeyDown(e){keycode.isEventKey(e,"Left")||keycode.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(keycode.isEventKey(e,"Right")||keycode.isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack());}stepForward(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e);}stepBack(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e);}focus(e=0){const t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus());}}Component$1.registerComponent("Menu",Menu);class MenuButton extends Component$1{constructor(e,t={}){super(e,t),this.menuButton_=new Button(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const i=Button.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+i,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const s=e=>this.handleClick(e);this.handleMenuKeyUp_=e=>this.handleMenuKeyUp(e),this.on(this.menuButton_,"tap",s),this.on(this.menuButton_,"click",s),this.on(this.menuButton_,"keydown",(e=>this.handleKeyDown(e))),this.on(this.menuButton_,"mouseenter",(()=>{this.addClass("vjs-hover"),this.menu.show(),on(document_1,"keyup",this.handleMenuKeyUp_);})),this.on("mouseleave",(e=>this.handleMouseLeave(e))),this.on("keydown",(e=>this.handleSubmenuKeyDown(e)));}update(){const e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"));}createMenu(){const e=new Menu(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=createEl("li",{className:"vjs-menu-title",textContent:toTitleCase$1(this.options_.title),tabIndex:-1}),i=new Component$1(this.player_,{el:t});e.addItem(i);}if(this.items=this.createItems(),this.items)for(let t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e}createItems(){}createEl(){return super.createEl("div",{className:this.buildWrapperCSSClass()},{})}buildWrapperCSSClass(){let e="vjs-menu-button";!0===this.options_.inline?e+="-inline":e+="-popup";return `vjs-menu-button ${e} ${Button.prototype.buildCSSClass()} ${super.buildCSSClass()}`}buildCSSClass(){let e="vjs-menu-button";return !0===this.options_.inline?e+="-inline":e+="-popup",`vjs-menu-button ${e} ${super.buildCSSClass()}`}controlText(e,t=this.menuButton_.el()){return this.menuButton_.controlText(e,t)}dispose(){this.handleMouseLeave(),super.dispose();}handleClick(e){this.buttonPressed_?this.unpressButton():this.pressButton();}handleMouseLeave(e){this.removeClass("vjs-hover"),off(document_1,"keyup",this.handleMenuKeyUp_);}focus(){this.menuButton_.focus();}blur(){this.menuButton_.blur();}handleKeyDown(e){keycode.isEventKey(e,"Esc")||keycode.isEventKey(e,"Tab")?(this.buttonPressed_&&this.unpressButton(),keycode.isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus())):(keycode.isEventKey(e,"Up")||keycode.isEventKey(e,"Down"))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()));}handleMenuKeyUp(e){(keycode.isEventKey(e,"Esc")||keycode.isEventKey(e,"Tab"))&&this.removeClass("vjs-hover");}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e);}handleSubmenuKeyDown(e){(keycode.isEventKey(e,"Esc")||keycode.isEventKey(e,"Tab"))&&(this.buttonPressed_&&this.unpressButton(),keycode.isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus()));}pressButton(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),IS_IOS&&isInFrame())return;this.menu.focus();}}unpressButton(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"));}disable(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable();}enable(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable();}}Component$1.registerComponent("MenuButton",MenuButton);class TrackButton extends MenuButton{constructor(e,t){const i=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),!i)return;const s=bind_(this,this.update);i.addEventListener("removetrack",s),i.addEventListener("addtrack",s),i.addEventListener("labelchange",s),this.player_.on("ready",s),this.player_.on("dispose",(function(){i.removeEventListener("removetrack",s),i.removeEventListener("addtrack",s),i.removeEventListener("labelchange",s);}));}}Component$1.registerComponent("TrackButton",TrackButton);const MenuKeys=["Tab","Esc","Up","Down","Right","Left"];class MenuItem extends ClickableComponent{constructor(e,t){super(e,t),this.selectable=t.selectable,this.isSelected_=t.selected||!1,this.multiSelectable=t.multiSelectable,this.selected(this.isSelected_),this.selectable?this.multiSelectable?this.el_.setAttribute("role","menuitemcheckbox"):this.el_.setAttribute("role","menuitemradio"):this.el_.setAttribute("role","menuitem");}createEl(e,t,i){this.nonIconControl=!0;const s=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),i);return s.replaceChild(createEl("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)}),s.querySelector(".vjs-icon-placeholder")),s}handleKeyDown(e){MenuKeys.some((t=>keycode.isEventKey(e,t)))||super.handleKeyDown(e);}handleClick(e){this.selected(!0);}selected(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1));}}Component$1.registerComponent("MenuItem",MenuItem);class TextTrackMenuItem extends MenuItem{constructor(e,t){const i=t.track,s=e.textTracks();t.label=i.label||i.language||"Unknown",t.selected="showing"===i.mode,super(e,t),this.track=i,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);const n=(...e)=>{this.handleTracksChange.apply(this,e);},r=(...e)=>{this.handleSelectedLanguageChange.apply(this,e);};if(e.on(["loadstart","texttrackchange"],n),s.addEventListener("change",n),s.addEventListener("selectedlanguagechange",r),this.on("dispose",(function(){e.off(["loadstart","texttrackchange"],n),s.removeEventListener("change",n),s.removeEventListener("selectedlanguagechange",r);})),void 0===s.onchange){let e;this.on(["tap","click"],(function(){if("object"!=typeof window_1.Event)try{e=new window_1.Event("change");}catch(e){}e||(e=document_1.createEvent("Event"),e.initEvent("change",!0,!0)),s.dispatchEvent(e);}));}this.handleTracksChange();}handleClick(e){const t=this.track,i=this.player_.textTracks();if(super.handleClick(e),i)for(let e=0;e<i.length;e++){const s=i[e];-1!==this.kinds.indexOf(s.kind)&&(s===t?"showing"!==s.mode&&(s.mode="showing"):"disabled"!==s.mode&&(s.mode="disabled"));}}handleTracksChange(e){const t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t);}handleSelectedLanguageChange(e){if("showing"===this.track.mode){const e=this.player_.cache_.selectedLanguage;if(e&&e.enabled&&e.language===this.track.language&&e.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind};}}dispose(){this.track=null,super.dispose();}}Component$1.registerComponent("TextTrackMenuItem",TextTrackMenuItem);class OffTextTrackMenuItem extends TextTrackMenuItem{constructor(e,t){t.track={player:e,kind:t.kind,kinds:t.kinds,default:!1,mode:"disabled"},t.kinds||(t.kinds=[t.kind]),t.label?t.track.label=t.label:t.track.label=t.kinds.join(" and ")+" off",t.selectable=!0,t.multiSelectable=!1,super(e,t);}handleTracksChange(e){const t=this.player().textTracks();let i=!0;for(let e=0,s=t.length;e<s;e++){const s=t[e];if(this.options_.kinds.indexOf(s.kind)>-1&&"showing"===s.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i);}handleSelectedLanguageChange(e){const t=this.player().textTracks();let i=!0;for(let e=0,s=t.length;e<s;e++){const s=t[e];if(["captions","descriptions","subtitles"].indexOf(s.kind)>-1&&"showing"===s.mode){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1});}}Component$1.registerComponent("OffTextTrackMenuItem",OffTextTrackMenuItem);class TextTrackButton extends TrackButton{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t);}createItems(e=[],t=TextTrackMenuItem){let i;this.label_&&(i=`${this.label_} off`),e.push(new OffTextTrackMenuItem(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;const s=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let i=0;i<s.length;i++){const n=s[i];if(this.kinds_.indexOf(n.kind)>-1){const i=new t(this.player_,{track:n,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});i.addClass(`vjs-${n.kind}-menu-item`),e.push(i);}}return e}}Component$1.registerComponent("TextTrackButton",TextTrackButton);class ChaptersTrackMenuItem extends MenuItem{constructor(e,t){const i=t.track,s=t.cue,n=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=s.text,t.selected=s.startTime<=n&&n<s.endTime,super(e,t),this.track=i,this.cue=s;}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime);}}Component$1.registerComponent("ChaptersTrackMenuItem",ChaptersTrackMenuItem);class ChaptersButton extends TextTrackButton{constructor(e,t,i){super(e,t,i),this.selectCurrentItem_=()=>{this.items.forEach((e=>{e.selected(this.track_.activeCues[0]===e.cue);}));};}buildCSSClass(){return `vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return `vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&"chapters"!==e.track.kind)return;const t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update();}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null;}if(this.track_=e,this.track_){this.track_.mode="hidden";const e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_);}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){const i=e[t];if(i.kind===this.kind_)return i}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(toTitleCase$1(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let i=0,s=t.length;i<s;i++){const s=t[i],n=new ChaptersTrackMenuItem(this.player_,{track:this.track_,cue:s});e.push(n);}return e}}ChaptersButton.prototype.kind_="chapters",ChaptersButton.prototype.controlText_="Chapters",Component$1.registerComponent("ChaptersButton",ChaptersButton);class DescriptionsButton extends TextTrackButton{constructor(e,t,i){super(e,t,i);const s=e.textTracks(),n=bind_(this,this.handleTracksChange);s.addEventListener("change",n),this.on("dispose",(function(){s.removeEventListener("change",n);}));}handleTracksChange(e){const t=this.player().textTracks();let i=!1;for(let e=0,s=t.length;e<s;e++){const s=t[e];if(s.kind!==this.kind_&&"showing"===s.mode){i=!0;break}}i?this.disable():this.enable();}buildCSSClass(){return `vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return `vjs-descriptions-button ${super.buildWrapperCSSClass()}`}}DescriptionsButton.prototype.kind_="descriptions",DescriptionsButton.prototype.controlText_="Descriptions",Component$1.registerComponent("DescriptionsButton",DescriptionsButton);class SubtitlesButton extends TextTrackButton{constructor(e,t,i){super(e,t,i);}buildCSSClass(){return `vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return `vjs-subtitles-button ${super.buildWrapperCSSClass()}`}}SubtitlesButton.prototype.kind_="subtitles",SubtitlesButton.prototype.controlText_="Subtitles",Component$1.registerComponent("SubtitlesButton",SubtitlesButton);class CaptionSettingsMenuItem extends TextTrackMenuItem{constructor(e,t){t.track={player:e,kind:t.kind,label:t.kind+" settings",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="CaptionSettingsMenuItem",super(e,t),this.addClass("vjs-texttrack-settings"),this.controlText(", opens "+t.kind+" settings dialog");}handleClick(e){this.player().getChild("textTrackSettings").open();}}Component$1.registerComponent("CaptionSettingsMenuItem",CaptionSettingsMenuItem);class CaptionsButton extends TextTrackButton{constructor(e,t,i){super(e,t,i);}buildCSSClass(){return `vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return `vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){const e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new CaptionSettingsMenuItem(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}}CaptionsButton.prototype.kind_="captions",CaptionsButton.prototype.controlText_="Captions",Component$1.registerComponent("CaptionsButton",CaptionsButton);class SubsCapsMenuItem extends TextTrackMenuItem{createEl(e,t,i){const s=super.createEl(e,t,i),n=s.querySelector(".vjs-menu-item-text");return "captions"===this.options_.track.kind&&(n.appendChild(createEl("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(createEl("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))),s}}Component$1.registerComponent("SubsCapsMenuItem",SubsCapsMenuItem);class SubsCapsButton extends TextTrackButton{constructor(e,t={}){super(e,t),this.label_="subtitles",["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)>-1&&(this.label_="captions"),this.menuButton_.controlText(toTitleCase$1(this.label_));}buildCSSClass(){return `vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return `vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new CaptionSettingsMenuItem(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,SubsCapsMenuItem),e}}SubsCapsButton.prototype.kinds_=["captions","subtitles"],SubsCapsButton.prototype.controlText_="Subtitles",Component$1.registerComponent("SubsCapsButton",SubsCapsButton);class AudioTrackMenuItem extends MenuItem{constructor(e,t){const i=t.track,s=e.audioTracks();t.label=i.label||i.language||"Unknown",t.selected=i.enabled,super(e,t),this.track=i,this.addClass(`vjs-${i.kind}-menu-item`);const n=(...e)=>{this.handleTracksChange.apply(this,e);};s.addEventListener("change",n),this.on("dispose",(()=>{s.removeEventListener("change",n);}));}createEl(e,t,i){const s=super.createEl(e,t,i),n=s.querySelector(".vjs-menu-item-text");return "main-desc"===this.options_.track.kind&&(n.appendChild(createEl("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(createEl("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),s}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const e=this.player_.audioTracks();for(let t=0;t<e.length;t++){const i=e[t];i!==this.track&&(i.enabled=i===this.track);}}}handleTracksChange(e){this.selected(this.track.enabled);}}Component$1.registerComponent("AudioTrackMenuItem",AudioTrackMenuItem);class AudioTrackButton extends TrackButton{constructor(e,t={}){t.tracks=e.audioTracks(),super(e,t);}buildCSSClass(){return `vjs-audio-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return `vjs-audio-button ${super.buildWrapperCSSClass()}`}createItems(e=[]){this.hideThreshold_=1;const t=this.player_.audioTracks();for(let i=0;i<t.length;i++){const s=t[i];e.push(new AudioTrackMenuItem(this.player_,{track:s,selectable:!0,multiSelectable:!1}));}return e}}AudioTrackButton.prototype.controlText_="Audio Track",Component$1.registerComponent("AudioTrackButton",AudioTrackButton);class PlaybackRateMenuItem extends MenuItem{constructor(e,t){const i=t.rate,s=parseFloat(i,10);t.label=i,t.selected=s===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=i,this.rate=s,this.on(e,"ratechange",(e=>this.update(e)));}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate);}update(e){this.selected(this.player().playbackRate()===this.rate);}}PlaybackRateMenuItem.prototype.contentElType="button",Component$1.registerComponent("PlaybackRateMenuItem",PlaybackRateMenuItem);class PlaybackRateMenuButton extends MenuButton{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",(e=>this.updateVisibility(e))),this.on(e,"ratechange",(e=>this.updateLabel(e))),this.on(e,"playbackrateschange",(e=>this.handlePlaybackRateschange(e)));}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=createEl("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose();}buildCSSClass(){return `vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return `vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),t=[];for(let i=e.length-1;i>=0;i--)t.push(new PlaybackRateMenuItem(this.player(),{rate:e[i]+"x"}));return t}handlePlaybackRateschange(e){this.update();}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden");}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x");}}PlaybackRateMenuButton.prototype.controlText_="Playback Rate",Component$1.registerComponent("PlaybackRateMenuButton",PlaybackRateMenuButton);class Spacer extends Component$1{buildCSSClass(){return `vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},i={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,i)}}Component$1.registerComponent("Spacer",Spacer);class CustomControlSpacer extends Spacer{buildCSSClass(){return `vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}}Component$1.registerComponent("CustomControlSpacer",CustomControlSpacer);class ControlBar extends Component$1{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}ControlBar.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},"exitPictureInPicture"in document_1&&ControlBar.prototype.options_.children.splice(ControlBar.prototype.options_.children.length-1,0,"pictureInPictureToggle"),Component$1.registerComponent("ControlBar",ControlBar);class ErrorDisplay extends ModalDialog{constructor(e,t){super(e,t),this.on(e,"error",(e=>this.open(e)));}buildCSSClass(){return `vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}ErrorDisplay.prototype.options_=Object.assign({},ModalDialog.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),Component$1.registerComponent("ErrorDisplay",ErrorDisplay);const LOCAL_STORAGE_KEY$1="vjs-text-track-settings",COLOR_BLACK=["#000","Black"],COLOR_BLUE=["#00F","Blue"],COLOR_CYAN=["#0FF","Cyan"],COLOR_GREEN=["#0F0","Green"],COLOR_MAGENTA=["#F0F","Magenta"],COLOR_RED=["#F00","Red"],COLOR_WHITE=["#FFF","White"],COLOR_YELLOW=["#FF0","Yellow"],OPACITY_OPAQUE=["1","Opaque"],OPACITY_SEMI=["0.5","Semi-Transparent"],OPACITY_TRANS=["0","Transparent"],selectConfigs={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[COLOR_BLACK,COLOR_WHITE,COLOR_RED,COLOR_GREEN,COLOR_BLUE,COLOR_YELLOW,COLOR_MAGENTA,COLOR_CYAN]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[OPACITY_OPAQUE,OPACITY_SEMI,OPACITY_TRANS]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[COLOR_WHITE,COLOR_BLACK,COLOR_RED,COLOR_GREEN,COLOR_BLUE,COLOR_YELLOW,COLOR_MAGENTA,COLOR_CYAN]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:e=>"1.00"===e?null:Number(e)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[OPACITY_OPAQUE,OPACITY_SEMI]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[OPACITY_TRANS,OPACITY_SEMI,OPACITY_OPAQUE]}};function parseOptionValue(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}function getSelectedOptionValue(e,t){return parseOptionValue(e.options[e.options.selectedIndex].value,t)}function setSelectedOption(e,t,i){if(t)for(let s=0;s<e.options.length;s++)if(parseOptionValue(e.options[s].value,i)===t){e.selectedIndex=s;break}}selectConfigs.windowColor.options=selectConfigs.backgroundColor.options;class TextTrackSettings extends ModalDialog{constructor(e,t){t.temporary=!1,super(e,t),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.endDialog=createEl("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")}),this.el().appendChild(this.endDialog),this.setDefaults(),void 0===t.persistTextTrackSettings&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings),this.on(this.$(".vjs-done-button"),"click",(()=>{this.saveSettings(),this.close();})),this.on(this.$(".vjs-default-button"),"click",(()=>{this.setDefaults(),this.updateDisplay();})),each(selectConfigs,(e=>{this.on(this.$(e.selector),"change",this.updateDisplay);})),this.options_.persistTextTrackSettings&&this.restoreSettings();}dispose(){this.endDialog=null,super.dispose();}createElSelect_(e,t="",i="label"){const s=selectConfigs[e],n=s.id.replace("%s",this.id_),r=[t,n].join(" ").trim();return [`<${i} id="${n}" class="${"label"===i?"vjs-label":""}">`,this.localize(s.label),`</${i}>`,`<select aria-labelledby="${r}">`].concat(s.options.map((e=>{const t=n+"-"+e[1].replace(/\W+/g,"");return [`<option id="${t}" value="${e[0]}" `,`aria-labelledby="${r} ${t}">`,this.localize(e[1]),"</option>"].join("")}))).concat("</select>").join("")}createElFgColor_(){const e=`captions-text-legend-${this.id_}`;return ['<fieldset class="vjs-fg-color vjs-track-setting">',`<legend id="${e}">`,this.localize("Text"),"</legend>",this.createElSelect_("color",e),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",e),"</span>","</fieldset>"].join("")}createElBgColor_(){const e=`captions-background-${this.id_}`;return ['<fieldset class="vjs-bg-color vjs-track-setting">',`<legend id="${e}">`,this.localize("Background"),"</legend>",this.createElSelect_("backgroundColor",e),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",e),"</span>","</fieldset>"].join("")}createElWinColor_(){const e=`captions-window-${this.id_}`;return ['<fieldset class="vjs-window-color vjs-track-setting">',`<legend id="${e}">`,this.localize("Window"),"</legend>",this.createElSelect_("windowColor",e),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",e),"</span>","</fieldset>"].join("")}createElColors_(){return createEl("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})}createElFont_(){return createEl("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})}createElControls_(){const e=this.localize("restore all settings to the default values");return createEl("div",{className:"vjs-track-settings-controls",innerHTML:[`<button type="button" class="vjs-default-button" title="${e}">`,this.localize("Reset"),`<span class="vjs-control-text"> ${e}</span>`,"</button>",`<button type="button" class="vjs-done-button">${this.localize("Done")}</button>`].join("")})}content(){return [this.createElColors_(),this.createElFont_(),this.createElControls_()]}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return reduce(selectConfigs,((e,t,i)=>{const s=getSelectedOptionValue(this.$(t.selector),t.parser);return void 0!==s&&(e[i]=s),e}),{})}setValues(e){each(selectConfigs,((t,i)=>{setSelectedOption(this.$(t.selector),e[i],t.parser);}));}setDefaults(){each(selectConfigs,(e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t;}));}restoreSettings(){let e;try{e=JSON.parse(window_1.localStorage.getItem(LOCAL_STORAGE_KEY$1));}catch(e){log$1.warn(e);}e&&this.setValues(e);}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?window_1.localStorage.setItem(LOCAL_STORAGE_KEY$1,JSON.stringify(e)):window_1.localStorage.removeItem(LOCAL_STORAGE_KEY$1);}catch(e){log$1.warn(e);}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay();}conditionalBlur_(){this.previouslyActiveEl_=null;const e=this.player_.controlBar,t=e&&e.subsCapsButton,i=e&&e.captionsButton;t?t.focus():i&&i.focus();}}Component$1.registerComponent("TextTrackSettings",TextTrackSettings);class ResizeManager extends Component$1{constructor(e,t){let i=t.ResizeObserver||window_1.ResizeObserver;null===t.ResizeObserver&&(i=!1);super(e,merge$1({createEl:!i,reportTouchActivity:!1},t)),this.ResizeObserver=t.ResizeObserver||window_1.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=debounce((()=>{this.resizeHandler();}),100,!1,this),i?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const e=this.debouncedHandler_;let t=this.unloadListener_=function(){off(this,"resize",e),off(this,"unload",t),t=null;};on(this.el_.contentWindow,"unload",t),on(this.el_.contentWindow,"resize",e);},this.one("load",this.loadListener_));}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize");}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose();}}Component$1.registerComponent("ResizeManager",ResizeManager);const defaults={trackingThreshold:20,liveTolerance:15};class LiveTracker extends Component$1{constructor(e,t){super(e,merge$1(defaults,t,{createEl:!1})),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=e=>this.handlePlay(e),this.handleFirstTimeupdate_=e=>this.handleFirstTimeupdate(e),this.handleSeeked_=e=>this.handleSeeked(e),this.seekToLiveEdge_=e=>this.seekToLiveEdge(e),this.reset_(),this.on(this.player_,"durationchange",(e=>this.handleDurationchange(e))),this.on(this.player_,"canplay",(()=>this.toggleTracking()));}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(window_1.performance.now().toFixed(4)),i=-1===this.lastTime_?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+i;const s=this.liveCurrentTime(),n=this.player_.currentTime();let r=this.player_.paused()||this.seekedBehindLive_||Math.abs(s-n)>this.options_.liveTolerance;this.timeupdateSeen_&&s!==1/0||(r=!1),r!==this.behindLiveEdge_&&(this.behindLiveEdge_=r,this.trigger("liveedgechange"));}handleDurationchange(){this.toggleTracking();}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking());}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,30),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)));}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_);}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_();}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_);}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_);}nextSeekedFromUser(){this.nextSeekedFromUser_=!0;}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"));}seekableEnd(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return !this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return -1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return "number"==typeof this.trackingInterval_}seekToLiveEdge(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()));}dispose(){this.stopTracking(),super.dispose();}}Component$1.registerComponent("LiveTracker",LiveTracker);class TitleBar extends Component$1{constructor(e,t){super(e,t),this.on("statechanged",(e=>this.updateDom_())),this.updateDom_();}createEl(){return this.els={title:createEl("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${newGUID()}`}),description:createEl("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${newGUID()}`})},createEl("div",{className:"vjs-title-bar"},{},Object.values(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,i={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach((e=>{const s=this.state[e],n=this.els[e],r=i[e];emptyEl(n),s&&textContent(n,s),t&&(t.removeAttribute(r),s&&t.setAttribute(r,n.id));})),this.state.title||this.state.description?this.show():this.hide();}update(e){this.setState(e);}dispose(){const e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null;}}Component$1.registerComponent("TitleBar",TitleBar);const sourcesetLoad=e=>{const t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;const i=e.$$("source"),s=[];let n="";if(!i.length)return !1;for(let e=0;e<i.length;e++){const t=i[e].src;t&&-1===s.indexOf(t)&&s.push(t);}return !!s.length&&(1===s.length&&(n=s[0]),e.triggerSourceset(n),!0)},innerHTMLDescriptorPolyfill=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(e){const t=document_1.createElement(this.nodeName.toLowerCase());t.innerHTML=e;const i=document_1.createDocumentFragment();for(;t.childNodes.length;)i.appendChild(t.childNodes[0]);return this.innerText="",window_1.Element.prototype.appendChild.call(this,i),this.innerHTML}}),getDescriptor=(e,t)=>{let i={};for(let s=0;s<e.length&&(i=Object.getOwnPropertyDescriptor(e[s],t),!(i&&i.set&&i.get));s++);return i.enumerable=!0,i.configurable=!0,i},getInnerHTMLDescriptor=e=>getDescriptor([e.el(),window_1.HTMLMediaElement.prototype,window_1.Element.prototype,innerHTMLDescriptorPolyfill],"innerHTML"),firstSourceWatch=function(e){const t=e.el();if(t.resetSourceWatch_)return;const i={},s=getInnerHTMLDescriptor(e),n=i=>(...s)=>{const n=i.apply(t,s);return sourcesetLoad(e),n};["append","appendChild","insertAdjacentHTML"].forEach((e=>{t[e]&&(i[e]=t[e],t[e]=n(i[e]));})),Object.defineProperty(t,"innerHTML",merge$1(s,{set:n(s.set)})),t.resetSourceWatch_=()=>{t.resetSourceWatch_=null,Object.keys(i).forEach((e=>{t[e]=i[e];})),Object.defineProperty(t,"innerHTML",s);},e.one("sourceset",t.resetSourceWatch_);},srcDescriptorPolyfill=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?getAbsoluteURL(window_1.Element.prototype.getAttribute.call(this,"src")):""},set(e){return window_1.Element.prototype.setAttribute.call(this,"src",e),e}}),getSrcDescriptor=e=>getDescriptor([e.el(),window_1.HTMLMediaElement.prototype,srcDescriptorPolyfill],"src"),setupSourceset=function(e){if(!e.featuresSourceset)return;const t=e.el();if(t.resetSourceset_)return;const i=getSrcDescriptor(e),s=t.setAttribute,n=t.load;Object.defineProperty(t,"src",merge$1(i,{set:s=>{const n=i.set.call(t,s);return e.triggerSourceset(t.src),n}})),t.setAttribute=(i,n)=>{const r=s.call(t,i,n);return /src/i.test(i)&&e.triggerSourceset(t.src),r},t.load=()=>{const i=n.call(t);return sourcesetLoad(e)||(e.triggerSourceset(""),firstSourceWatch(e)),i},t.currentSrc?e.triggerSourceset(t.currentSrc):sourcesetLoad(e)||firstSourceWatch(e),t.resetSourceset_=()=>{t.resetSourceset_=null,t.load=n,t.setAttribute=s,Object.defineProperty(t,"src",i),t.resetSourceWatch_&&t.resetSourceWatch_();};};class Html5 extends Tech{constructor(e,t){super(e,t);const i=e.source;let s=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&"VIDEO"===this.el_.tagName,i&&(this.el_.currentSrc!==i.src||e.tag&&3===e.tag.initNetworkState_)?this.setSource(i):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const e=this.el_.childNodes;let t=e.length;const i=[];for(;t--;){const n=e[t];"track"===n.nodeName.toLowerCase()&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(n),this.remoteTextTracks().addTrack(n.track),this.textTracks().addTrack(n.track),s||this.el_.hasAttribute("crossorigin")||!isCrossOrigin(n.src)||(s=!0)):i.push(n));}for(let e=0;e<i.length;e++)this.el_.removeChild(i[e]);}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&s&&log$1.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading."),this.restoreMetadataTracksInIOSNativePlayer_(),(TOUCH_ENABLED||IS_IPHONE)&&!0===e.nativeControlsForTouch&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady();}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),Html5.disposeMediaElement(this.el_),this.options_=null,super.dispose();}setupSourcesetHandling_(){setupSourceset(this);}restoreMetadataTracksInIOSNativePlayer_(){const e=this.textTracks();let t;const i=()=>{t=[];for(let i=0;i<e.length;i++){const s=e[i];"metadata"===s.kind&&t.push({track:s,storedMode:s.mode});}};i(),e.addEventListener("change",i),this.on("dispose",(()=>e.removeEventListener("change",i)));const s=()=>{for(let e=0;e<t.length;e++){const i=t[e];"disabled"===i.track.mode&&i.track.mode!==i.storedMode&&(i.track.mode=i.storedMode);}e.removeEventListener("change",s);};this.on("webkitbeginfullscreen",(()=>{e.removeEventListener("change",i),e.removeEventListener("change",s),e.addEventListener("change",s);})),this.on("webkitendfullscreen",(()=>{e.removeEventListener("change",i),e.addEventListener("change",i),e.removeEventListener("change",s);}));}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const i=e.toLowerCase();this[`${i}TracksListeners_`]&&Object.keys(this[`${i}TracksListeners_`]).forEach((e=>{this.el()[`${i}Tracks`].removeEventListener(e,this[`${i}TracksListeners_`][e]);})),this[`featuresNative${e}Tracks`]=!t,this[`${i}TracksListeners_`]=null,this.proxyNativeTracksForType_(i);}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e);}overrideNativeVideoTracks(e){this.overrideNative_("Video",e);}proxyNativeTracksForType_(e){const t=NORMAL[e],i=this.el()[t.getterName],s=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!i||!i.addEventListener)return;const n={change:t=>{const i={type:"change",target:s,currentTarget:s,srcElement:s};s.trigger(i),"text"===e&&this[REMOTE.remoteText.getterName]().trigger(i);},addtrack(e){s.addTrack(e.track);},removetrack(e){s.removeTrack(e.track);}},r=function(){const e=[];for(let t=0;t<s.length;t++){let n=!1;for(let e=0;e<i.length;e++)if(i[e]===s[t]){n=!0;break}n||e.push(s[t]);}for(;e.length;)s.removeTrack(e.shift());};this[t.getterName+"Listeners_"]=n,Object.keys(n).forEach((e=>{const t=n[e];i.addEventListener(e,t),this.on("dispose",(s=>i.removeEventListener(e,t)));})),this.on("loadstart",r),this.on("dispose",(e=>this.off("loadstart",r)));}proxyNativeTracks_(){NORMAL.names.forEach((e=>{this.proxyNativeTracksForType_(e);}));}createEl(){let e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){const t=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(t,e),Html5.disposeMediaElement(e),e=t;}else {e=document_1.createElement("video");const t=merge$1({},this.options_.tag&&getAttributes(this.options_.tag));TOUCH_ENABLED&&!0===this.options_.nativeControlsForTouch||delete t.controls,setAttributes(e,Object.assign(t,{id:this.options_.techId,class:"vjs-tech"}));}e.playerId=this.options_.playerId;}void 0!==this.options_.preload&&setAttribute(e,"preload",this.options_.preload),void 0!==this.options_.disablePictureInPicture&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let i=0;i<t.length;i++){const s=t[i],n=this.options_[s];void 0!==n&&(n?setAttribute(e,s,s):removeAttribute(e,s),e[s]=n);}return e}handleLateInit_(e){if(0===e.networkState||3===e.networkState)return;if(0===e.readyState){let e=!1;const t=function(){e=!0;};this.on("loadstart",t);const i=function(){e||this.trigger("loadstart");};return this.on("loadedmetadata",i),void this.ready((function(){this.off("loadstart",t),this.off("loadedmetadata",i),e||this.trigger("loadstart");}))}const t=["loadstart"];t.push("loadedmetadata"),e.readyState>=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready((function(){t.forEach((function(e){this.trigger(e);}),this);}));}setScrubbing(e){this.isScrubbing_=e;}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&IS_ANY_SAFARI?this.el_.fastSeek(e):this.el_.currentTime=e;}catch(e){log$1(e,"Video is not ready. (Video.js)");}}duration(){if(this.el_.duration===1/0&&IS_ANDROID&&IS_CHROME&&0===this.el_.currentTime){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e));};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1);},t=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}));};this.on("webkitbeginfullscreen",t),this.on("dispose",(()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e);}));}supportsFullScreen(){return "function"==typeof this.el_.webkitEnterFullScreen}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)silencePromise(this.el_.play()),this.setTimeout((function(){e.pause();try{e.webkitEnterFullScreen();}catch(e){this.trigger("fullscreenerror",e);}}),0);else try{e.webkitEnterFullScreen();}catch(e){this.trigger("fullscreenerror",e);}}exitFullScreen(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"));}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e);}src(e){if(void 0===e)return this.el_.src;this.setSrc(e);}reset(){Html5.resetMediaElement(this.el_);}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e;}addTextTrack(e,t,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,i):super.addTextTrack(e,t,i)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=document_1.createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){const i=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(i),i}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let i=t.length;for(;i--;)e!==t[i]&&e!==t[i].track||this.el().removeChild(t[i]);}}getVideoPlaybackQuality(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();const e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),window_1.performance&&(e.creationTime=window_1.performance.now()),e}}defineLazyProperty(Html5,"TEST_VID",(function(){if(!isReal())return;const e=document_1.createElement("video"),t=document_1.createElement("track");return t.kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e})),Html5.isSupported=function(){try{Html5.TEST_VID.volume=.5;}catch(e){return !1}return !(!Html5.TEST_VID||!Html5.TEST_VID.canPlayType)},Html5.canPlayType=function(e){return Html5.TEST_VID.canPlayType(e)},Html5.canPlaySource=function(e,t){return Html5.canPlayType(e.type)},Html5.canControlVolume=function(){try{const e=Html5.TEST_VID.volume;Html5.TEST_VID.volume=e/2+.1;const t=e!==Html5.TEST_VID.volume;return t&&IS_IOS?(window_1.setTimeout((()=>{Html5&&Html5.prototype&&(Html5.prototype.featuresVolumeControl=e!==Html5.TEST_VID.volume);})),!1):t}catch(e){return !1}},Html5.canMuteVolume=function(){try{const e=Html5.TEST_VID.muted;return Html5.TEST_VID.muted=!e,Html5.TEST_VID.muted?setAttribute(Html5.TEST_VID,"muted","muted"):removeAttribute(Html5.TEST_VID,"muted","muted"),e!==Html5.TEST_VID.muted}catch(e){return !1}},Html5.canControlPlaybackRate=function(){if(IS_ANDROID&&IS_CHROME&&CHROME_VERSION<58)return !1;try{const e=Html5.TEST_VID.playbackRate;return Html5.TEST_VID.playbackRate=e/2+.1,e!==Html5.TEST_VID.playbackRate}catch(e){return !1}},Html5.canOverrideAttributes=function(){try{const e=()=>{};Object.defineProperty(document_1.createElement("video"),"src",{get:e,set:e}),Object.defineProperty(document_1.createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(document_1.createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(document_1.createElement("audio"),"innerHTML",{get:e,set:e});}catch(e){return !1}return !0},Html5.supportsNativeTextTracks=function(){return IS_ANY_SAFARI||IS_IOS&&IS_CHROME},Html5.supportsNativeVideoTracks=function(){return !(!Html5.TEST_VID||!Html5.TEST_VID.videoTracks)},Html5.supportsNativeAudioTracks=function(){return !(!Html5.TEST_VID||!Html5.TEST_VID.audioTracks)},Html5.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach((function([e,t]){defineLazyProperty(Html5.prototype,e,(()=>Html5[t]()),!0);})),Html5.prototype.featuresVolumeControl=Html5.canControlVolume(),Html5.prototype.movingMediaElementInDOM=!IS_IOS,Html5.prototype.featuresFullscreenResize=!0,Html5.prototype.featuresProgressEvents=!0,Html5.prototype.featuresTimeupdateEvents=!0,Html5.prototype.featuresVideoFrameCallback=!(!Html5.TEST_VID||!Html5.TEST_VID.requestVideoFrameCallback),Html5.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load();}catch(e){}}();}},Html5.resetMediaElement=function(e){if(!e)return;const t=e.querySelectorAll("source");let i=t.length;for(;i--;)e.removeChild(t[i]);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load();}catch(e){}}();},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach((function(e){Html5.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)};})),["muted","defaultMuted","autoplay","loop","playsinline"].forEach((function(e){Html5.prototype["set"+toTitleCase$1(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e);};})),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach((function(e){Html5.prototype[e]=function(){return this.el_[e]};})),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach((function(e){Html5.prototype["set"+toTitleCase$1(e)]=function(t){this.el_[e]=t;};})),["pause","load","play"].forEach((function(e){Html5.prototype[e]=function(){return this.el_[e]()};})),Tech.withSourceHandlers(Html5),Html5.nativeSourceHandler={},Html5.nativeSourceHandler.canPlayType=function(e){try{return Html5.TEST_VID.canPlayType(e)}catch(e){return ""}},Html5.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return Html5.nativeSourceHandler.canPlayType(e.type);if(e.src){const t=getFileExtension(e.src);return Html5.nativeSourceHandler.canPlayType(`video/${t}`)}return ""},Html5.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src);},Html5.nativeSourceHandler.dispose=function(){},Html5.registerSourceHandler(Html5.nativeSourceHandler),Tech.registerTech("Html5",Html5);const TECH_EVENTS_RETRIGGER=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],TECH_EVENTS_QUEUE={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},BREAKPOINT_ORDER=["tiny","xsmall","small","medium","large","xlarge","huge"],BREAKPOINT_CLASSES={};BREAKPOINT_ORDER.forEach((e=>{const t="x"===e.charAt(0)?`x-${e.substring(1)}`:e;BREAKPOINT_CLASSES[e]=`vjs-layout-${t}`;}));const DEFAULT_BREAKPOINTS={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class Player extends Component$1{constructor(e,t,i){if(e.id=e.id||t.id||`vjs_video_${newGUID()}`,(t=Object.assign(Player.getTagSettings(e),t)).initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const i=e.closest("[lang]");i&&(t.language=i.getAttribute("lang"));}if(super(null,t,i),this.boundDocumentFullscreenChange_=e=>this.documentFullscreenChange_(e),this.boundFullWindowOnEscKey_=e=>this.fullWindowOnEscKey(e),this.boundUpdateStyleEl_=e=>this.updateStyleEl_(e),this.boundApplyInitTime_=e=>this.applyInitTime_(e),this.boundUpdateCurrentBreakpoint_=e=>this.updateCurrentBreakpoint_(e),this.boundHandleTechClick_=e=>this.handleTechClick_(e),this.boundHandleTechDoubleClick_=e=>this.handleTechDoubleClick_(e),this.boundHandleTechTouchStart_=e=>this.handleTechTouchStart_(e),this.boundHandleTechTouchMove_=e=>this.handleTechTouchMove_(e),this.boundHandleTechTouchEnd_=e=>this.handleTechTouchEnd_(e),this.boundHandleTechTap_=e=>this.handleTechTap_(e),this.isFullscreen_=!1,this.log=createLogger(this.id_),this.fsApi_=FullscreenApi,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&getAttributes(e),this.language(this.options_.language),t.languages){const e={};Object.getOwnPropertyNames(t.languages).forEach((function(i){e[i.toLowerCase()]=t.languages[i];})),this.languages_=e;}else this.languages_=Player.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach((e=>{if("function"!=typeof this[e])throw new Error(`plugin "${e}" does not exist`)})),this.scrubbing_=!1,this.el_=this.createEl(),evented(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(on(document_1,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const s=merge$1(this.options_);t.plugins&&Object.keys(t.plugins).forEach((e=>{this[e](t.plugins[e]);})),t.debug&&this.debug(!0),this.options_.playerOptions=s,this.middleware_=[],this.playbackRates(t.playbackRates),this.initChildren(),this.isAudio("audio"===e.nodeName.toLowerCase()),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),TOUCH_ENABLED&&this.addClass("vjs-touch-enabled"),IS_IOS||this.addClass("vjs-workinghover"),Player.players[this.id_]=this;const n=version$6.split(".")[0];this.addClass(`vjs-v${n}`),this.userActive(!0),this.reportUserActivity(),this.one("play",(e=>this.listenForUserActivity_(e))),this.on("keydown",(e=>this.handleKeyDown(e))),this.on("languagechange",(e=>this.handleLanguagechange(e))),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",(()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode);}));}dispose(){this.trigger("dispose"),this.off("dispose"),off(document_1,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),off(document_1,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),Player.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),clearCacheForPlayer(this),ALL.names.forEach((e=>{const t=this[ALL[e].getterName]();t&&t.off&&t.off();})),super.dispose({restoreEl:this.options_.restoreEl});}createEl(){let e,t=this.tag,i=this.playerElIngest_=t.parentNode&&t.parentNode.hasAttribute&&t.parentNode.hasAttribute("data-vjs-player");const s="video-js"===this.tag.tagName.toLowerCase();i?e=this.el_=t.parentNode:s||(e=this.el_=super.createEl("div"));const n=getAttributes(t);if(s){for(e=this.el_=t,t=this.tag=document_1.createElement("video");e.children.length;)t.appendChild(e.firstChild);hasClass(e,"video-js")||addClass(e,"video-js"),e.appendChild(t),i=this.playerElIngest_=e,Object.keys(e).forEach((i=>{try{t[i]=e[i];}catch(e){}}));}if(t.setAttribute("tabindex","-1"),n.tabindex="-1",IS_CHROME&&IS_WINDOWS&&(t.setAttribute("role","application"),n.role="application"),t.removeAttribute("width"),t.removeAttribute("height"),"width"in n&&delete n.width,"height"in n&&delete n.height,Object.getOwnPropertyNames(n).forEach((function(i){s&&"class"===i||e.setAttribute(i,n[i]),s&&t.setAttribute(i,n[i]);})),t.playerId=t.id,t.id+="_html5_api",t.className="vjs-tech",t.player=e.player=this,this.addClass("vjs-paused"),!0!==window_1.VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=createStyleElement("vjs-styles-dimensions");const e=$(".vjs-styles-defaults"),t=$("head");t.insertBefore(this.styleEl_,e?e.nextSibling:t.firstChild);}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const r=t.getElementsByTagName("a");for(let e=0;e<r.length;e++){const t=r.item(e);addClass(t,"vjs-hidden"),t.setAttribute("hidden","hidden");}return t.initNetworkState_=t.networkState,t.parentNode&&!i&&t.parentNode.insertBefore(e,t),prependTo(t,e),this.children_.unshift(t),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=e,e}crossOrigin(e){if(void 0===e)return this.techGet_("crossOrigin");null===e||"anonymous"===e||"use-credentials"===e?(this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e)):log$1.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,t){const i=e+"_";if(void 0===t)return this[i]||0;if(""===t||"auto"===t)return this[i]=void 0,void this.updateStyleEl_();const s=parseFloat(t);isNaN(s)?log$1.error(`Improper value "${t}" supplied for for ${e}`):(this[i]=s,this.updateStyleEl_());}fluid(e){if(void 0===e)return !!this.fluid_;var t,i;this.fluid_=!!e,isEvented(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),i=()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_);},isEvented(t=this)?i():(t.eventedCallbacks||(t.eventedCallbacks=[]),t.eventedCallbacks.push(i))):this.removeClass("vjs-fluid"),this.updateStyleEl_();}fill(e){if(void 0===e)return !!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill");}aspectRatio(e){if(void 0===e)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_();}updateStyleEl_(){if(!0===window_1.VIDEOJS_NO_DYNAMIC_STYLE){const e="number"==typeof this.width_?this.width_:this.options_.width,t="number"==typeof this.height_?this.height_:this.options_.height,i=this.tech_&&this.tech_.el();return void(i&&(e>=0&&(i.width=e),t>=0&&(i.height=t)))}let e,t,i,s;i=void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9";const n=i.split(":"),r=n[1]/n[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/r:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*r,s=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(s),setTextContent(this.styleEl_,`\n .${s} {\n width: ${e}px;\n height: ${t}px;\n }\n\n .${s}.vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: ${100*r}%;\n }\n `);}loadTech_(e,t){this.tech_&&this.unloadTech_();const i=toTitleCase$1(e),s=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==i&&this.tag&&(Tech.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=i,this.isReady_=!1;let n=this.autoplay();("string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(n=!1);const r={source:t,autoplay:n,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${s}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};ALL.names.forEach((e=>{const t=ALL[e];r[t.getterName]=this[t.privateName];})),Object.assign(r,this.options_[i]),Object.assign(r,this.options_[s]),Object.assign(r,this.options_[e.toLowerCase()]),this.tag&&(r.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(r.startTime=this.cache_.currentTime);const a=Tech.getTech(e);if(!a)throw new Error(`No Tech named '${i}' exists! '${i}' should be registered using videojs.registerTech()'`);this.tech_=new a(r),this.tech_.ready(bind_(this,this.handleTechReady_),!0),textTrackConverter.jsonToTextTracks(this.textTracksJson_||[],this.tech_),TECH_EVENTS_RETRIGGER.forEach((e=>{this.on(this.tech_,e,(t=>this[`handleTech${toTitleCase$1(e)}_`](t)));})),Object.keys(TECH_EVENTS_QUEUE).forEach((e=>{this.on(this.tech_,e,(t=>{0===this.tech_.playbackRate()&&this.tech_.seeking()?this.queuedCallbacks_.push({callback:this[`handleTech${TECH_EVENTS_QUEUE[e]}_`].bind(this),event:t}):this[`handleTech${TECH_EVENTS_QUEUE[e]}_`](t);}));})),this.on(this.tech_,"loadstart",(e=>this.handleTechLoadStart_(e))),this.on(this.tech_,"sourceset",(e=>this.handleTechSourceset_(e))),this.on(this.tech_,"waiting",(e=>this.handleTechWaiting_(e))),this.on(this.tech_,"ended",(e=>this.handleTechEnded_(e))),this.on(this.tech_,"seeking",(e=>this.handleTechSeeking_(e))),this.on(this.tech_,"play",(e=>this.handleTechPlay_(e))),this.on(this.tech_,"pause",(e=>this.handleTechPause_(e))),this.on(this.tech_,"durationchange",(e=>this.handleTechDurationChange_(e))),this.on(this.tech_,"fullscreenchange",((e,t)=>this.handleTechFullscreenChange_(e,t))),this.on(this.tech_,"fullscreenerror",((e,t)=>this.handleTechFullscreenError_(e,t))),this.on(this.tech_,"enterpictureinpicture",(e=>this.handleTechEnterPictureInPicture_(e))),this.on(this.tech_,"leavepictureinpicture",(e=>this.handleTechLeavePictureInPicture_(e))),this.on(this.tech_,"error",(e=>this.handleTechError_(e))),this.on(this.tech_,"posterchange",(e=>this.handleTechPosterChange_(e))),this.on(this.tech_,"textdata",(e=>this.handleTechTextData_(e))),this.on(this.tech_,"ratechange",(e=>this.handleTechRateChange_(e))),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===i&&this.tag||prependTo(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null);}unloadTech_(){ALL.names.forEach((e=>{const t=ALL[e];this[t.privateName]=this[t.getterName]();})),this.textTracksJson_=textTrackConverter.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1;}tech(e){return void 0===e&&log$1.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_);}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_);}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_();}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay());}manualAutoplay_(e){if(!this.tech_||"string"!=typeof e)return;const t=()=>{const e=this.muted();this.muted(!0);const t=()=>{this.muted(e);};this.playTerminatedQueue_.push(t);const i=this.play();if(isPromise(i))return i.catch((e=>{throw t(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${e||""}`)}))};let i;return "any"!==e||this.muted()?i="muted"!==e||this.muted()?this.play():t():(i=this.play(),isPromise(i)&&(i=i.catch(t))),isPromise(i)?i.then((()=>{this.trigger({type:"autoplay-success",autoplay:e});})).catch((()=>{this.trigger({type:"autoplay-failure",autoplay:e});})):void 0}updateSourceCaches_(e=""){let t=e,i="";"string"!=typeof t&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=findMimetype(this,t)),this.cache_.source=merge$1({},e,{src:t,type:i});const s=this.cache_.sources.filter((e=>e.src&&e.src===t)),n=[],r=this.$$("source"),a=[];for(let e=0;e<r.length;e++){const i=getAttributes(r[e]);n.push(i),i.src&&i.src===t&&a.push(i.src);}a.length&&!s.length?this.cache_.sources=n:s.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t;}handleTechSourceset_(e){if(!this.changingSrc_){let t=e=>this.updateSourceCaches_(e);const i=this.currentSource().src,s=e.src;i&&!/^blob:/.test(i)&&/^blob:/.test(s)&&(!this.lastSource_||this.lastSource_.tech!==s&&this.lastSource_.player!==i)&&(t=()=>{}),t(s),e.src||this.tech_.any(["sourceset","loadstart"],(e=>{if("sourceset"===e.type)return;const t=this.techGet("currentSrc");this.lastSource_.tech=t,this.updateSourceCaches_(t);}));}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"});}hasStarted(e){if(void 0===e)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"));}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play");}handleTechRateChange_(){this.tech_.playbackRate()>0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach((e=>e.callback(e.event))),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange");}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t));};this.on("timeupdate",t);}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay");}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough");}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing");}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking");}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked");}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause");}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended");}handleTechDurationChange_(){this.duration(this.techGet_("duration"));}handleTechClick_(e){this.controls_&&(void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.click&&!1===this.options_.userActions.click||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.click?this.options_.userActions.click.call(this,e):this.paused()?silencePromise(this.play()):this.pause()));}handleTechDoubleClick_(e){if(!this.controls_)return;Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),(t=>t.contains(e.target)))||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen());}handleTechTap_(){this.userActive(!this.userActive());}handleTechTouchStart_(){this.userWasActive=this.userActive();}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity();}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault();}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen");}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this)return;const i=this.el();let s=document_1[this.fsApi_.fullscreenElement]===i;!s&&i.matches?s=i.matches(":"+this.fsApi_.fullscreen):!s&&i.msMatchesSelector&&(s=i.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(s);}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",(()=>{this.removeClass("vjs-ios-native-fs");}))),this.isFullscreen(t.isFullscreen));}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t);}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture");}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0);}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1);}handleTechError_(){const e=this.tech_.error();this.error(e);}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e);}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1};}techCall_(e,t){this.ready((function(){if(e in allowedSetters)return set(this.middleware_,this.tech_,e,t);if(e in allowedMediators)return mediate(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t);}catch(e){throw log$1(e),e}}),!0);}techGet_(e){if(this.tech_&&this.tech_.isReady_){if(e in allowedGetters)return get(this.middleware_,this.tech_,e);if(e in allowedMediators)return mediate(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw log$1(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t;if("TypeError"===t.name)throw log$1(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t;throw log$1(t),t}}}play(){return new Promise((e=>{this.play_(e);}))}play_(e=silencePromise){this.playCallbacks_.push(e);const t=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc()));if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t)return this.waitToPlay_=e=>{this.play_();},this.one(["ready","loadstart"],this.waitToPlay_),void(t||!IS_ANY_SAFARI&&!IS_IOS||this.load());const i=this.techGet_("play");null===i?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(i);}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach((function(e){e();}));}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach((function(t){t(e);}));}pause(){this.techCall_("pause");}paused(){return !1!==this.techGet_("paused")}played(){return this.techGet_("played")||createTimeRanges$1(0,0)}scrubbing(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing");}currentTime(e){return void 0!==e?(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),void(this.cache_.initTime=0)):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_))):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)}applyInitTime_(){this.currentTime(this.cache_.initTime);}duration(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"));}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return e&&e.length||(e=createTimeRanges$1(0,0)),e}bufferedPercent(){return bufferedPercent(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let i=e.end(e.length-1);return i>t&&(i=t),i}volume(e){let t;return void 0!==e?(t=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)}muted(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e);}defaultMuted(e){return void 0!==e?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1}lastVolume_(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e;}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(void 0!==e){const t=this.isFullscreen_;return this.isFullscreen_=Boolean(e),this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise(((i,s)=>{function n(){t.off("fullscreenerror",a),t.off("fullscreenchange",r);}function r(){n(),i();}function a(e,t){n(),s(t);}t.one("fullscreenchange",r),t.one("fullscreenerror",a);const o=t.requestFullscreenHelper_(e);o&&(o.then(n,n),o.then(i,s));}))}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(t=e)),this.fsApi_.requestFullscreen){const e=this.el_[this.fsApi_.requestFullscreen](t);return e&&e.then((()=>this.isFullscreen(!0)),(()=>this.isFullscreen(!1))),e}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow();}exitFullscreen(){const e=this;return new Promise(((t,i)=>{function s(){e.off("fullscreenerror",r),e.off("fullscreenchange",n);}function n(){s(),t();}function r(e,t){s(),i(t);}e.one("fullscreenchange",n),e.one("fullscreenerror",r);const a=e.exitFullscreenHelper_();a&&(a.then(s,s),a.then(t,i));}))}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=document_1[this.fsApi_.exitFullscreen]();return e&&silencePromise(e.then((()=>this.isFullscreen(!1)))),e}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow();}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=document_1.documentElement.style.overflow,on(document_1,"keydown",this.boundFullWindowOnEscKey_),document_1.documentElement.style.overflow="hidden",addClass(document_1.body,"vjs-full-window"),this.trigger("enterFullWindow");}fullWindowOnEscKey(e){keycode.isEventKey(e,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen());}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,off(document_1,"keydown",this.boundFullWindowOnEscKey_),document_1.documentElement.style.overflow=this.docOrigOverflow,removeClass(document_1.body,"vjs-full-window"),this.trigger("exitFullWindow");}disablePictureInPicture(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged");}isInPictureInPicture(e){return void 0!==e?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_}requestPictureInPicture(){if("pictureInPictureEnabled"in document_1&&!1===this.disablePictureInPicture())return this.techGet_("requestPictureInPicture")}exitPictureInPicture(){if("pictureInPictureEnabled"in document_1)return document_1.exitPictureInPicture()}handleKeyDown(e){const{userActions:t}=this.options_;if(!t||!t.hotkeys)return;(e=>{const t=e.tagName.toLowerCase();if(e.isContentEditable)return !0;if("input"===t)return -1===["button","checkbox","hidden","radio","reset","submit"].indexOf(e.type);return -1!==["textarea"].indexOf(t)})(this.el_.ownerDocument.activeElement)||("function"==typeof t.hotkeys?t.hotkeys.call(this,e):this.handleHotkeys(e));}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:i=(e=>keycode.isEventKey(e,"f")),muteKey:s=(e=>keycode.isEventKey(e,"m")),playPauseKey:n=(e=>keycode.isEventKey(e,"k")||keycode.isEventKey(e,"Space"))}=t;if(i.call(this,e)){e.preventDefault(),e.stopPropagation();const t=Component$1.getComponent("FullscreenToggle");!1!==document_1[this.fsApi_.fullscreenEnabled]&&t.prototype.handleClick.call(this,e);}else if(s.call(this,e)){e.preventDefault(),e.stopPropagation();Component$1.getComponent("MuteToggle").prototype.handleClick.call(this,e);}else if(n.call(this,e)){e.preventDefault(),e.stopPropagation();Component$1.getComponent("PlayToggle").prototype.handleClick.call(this,e);}}canPlayType(e){let t;for(let i=0,s=this.options_.techOrder;i<s.length;i++){const n=s[i];let r=Tech.getTech(n);if(r||(r=Component$1.getComponent(n)),r){if(r.isSupported()&&(t=r.canPlayType(e),t))return t}else log$1.error(`The "${n}" tech is undefined. Skipped browser support check for that tech.`);}return ""}selectSource(e){const t=this.options_.techOrder.map((e=>[e,Tech.getTech(e)])).filter((([e,t])=>t?t.isSupported():(log$1.error(`The "${e}" tech is undefined. Skipped browser support check for that tech.`),!1))),i=function(e,t,i){let s;return e.some((e=>t.some((t=>{if(s=i(e,t),s)return !0})))),s};let s;const n=([e,t],i)=>{if(t.canPlaySource(i,this.options_[e.toLowerCase()]))return {source:i,tech:e}};var r;return s=this.options_.sourceOrder?i(e,t,(r=n,(e,t)=>r(t,e))):i(t,e,n),s||!1}handleSrc_(e,t){if(void 0===e)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const i=filterSource(e);if(i.length){if(this.changingSrc_=!0,t||(this.cache_.sources=i),this.updateSourceCaches_(i[0]),setSource(this,i[0],((e,s)=>{this.middleware_=s,t||(this.cache_.sources=i),this.updateSourceCaches_(e);if(this.src_(e))return i.length>1?this.handleSrc_(i.slice(1)):(this.changingSrc_=!1,this.setTimeout((function(){this.error({code:4,message:this.options_.notSupportedMessage});}),0),void this.triggerReady());setTech(s,this.tech_);})),i.length>1){const e=()=>{this.error(null),this.handleSrc_(i.slice(1),!0);},t=()=>{this.off("error",e);};this.one("error",e),this.one("playing",t),this.resetRetryOnError_=()=>{this.off("error",e),this.off("playing",t);};}}else this.setTimeout((function(){this.error({code:4,message:this.options_.notSupportedMessage});}),0);}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return !t||(titleCaseEquals(t.tech,this.techName_)?(this.ready((function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1;}),!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready((()=>{this.changingSrc_=!1;})),!1))}load(){this.techCall_("load");}reset(){if(this.paused())this.doReset_();else {silencePromise(this.play().then((()=>this.doReset_())));}}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),isEvented(this)&&this.trigger("playerreset");}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_();}resetProgressBar_(){this.currentTime(0);const{durationDisplay:e,remainingTimeDisplay:t}=this.controlBar||{};e&&e.updateContent(),t&&t.updateContent();}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_();}resetVolumeBar_(){this.volume(1),this.trigger("volumechange");}currentSources(){const e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")}autoplay(e){if(void 0===e)return this.options_.autoplay||!1;let t;"string"==typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"==typeof e?e:"play"),t=!1):this.options_.autoplay=!!e,t=void 0===t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t);}playsinline(e){return void 0!==e?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")}loop(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")}poster(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"));}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"));}}controls(e){if(void 0===e)return !!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()));}usingNativeControls(e){if(void 0===e)return !!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")));}error(e){if(void 0===e)return this.error_||null;if(hooks("beforeerror").forEach((t=>{const i=t(this,e);isObject(i)&&!Array.isArray(i)||"string"==typeof i||"number"==typeof i||null===i?e=i:this.log.error("please return a value that MediaError expects in beforeerror hooks");})),this.options_.suppressNotSupportedError&&e&&4===e.code){const t=function(){this.error(e);};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),void this.one("loadstart",(function(){this.off(["click","touchstart"],t);}))}if(null===e)return this.error_=e,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new MediaError(e),this.addClass("vjs-error"),log$1.error(`(CODE:${this.error_.code} ${MediaError.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),hooks("error").forEach((e=>e(this,this.error_)));}reportUserActivity(e){this.userActivity_=!0;}userActive(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",(function(e){e.stopPropagation(),e.preventDefault();})),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive");}}listenForUserActivity_(){let e,t,i;const s=bind_(this,this.reportUserActivity),n=function(t){s(),this.clearInterval(e);};this.on("mousedown",(function(){s(),this.clearInterval(e),e=this.setInterval(s,250);})),this.on("mousemove",(function(e){e.screenX===t&&e.screenY===i||(t=e.screenX,i=e.screenY,s());})),this.on("mouseup",n),this.on("mouseleave",n);const r=this.getChild("controlBar");let a;!r||IS_IOS||IS_ANDROID||(r.on("mouseenter",(function(e){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0;})),r.on("mouseleave",(function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout;}))),this.on("keydown",s),this.on("keyup",s),this.setInterval((function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(a);const e=this.options_.inactivityTimeout;e<=0||(a=this.setTimeout((function(){this.userActivity_||this.userActive(!1);}),e));}),250);}playbackRate(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e);}defaultPlaybackRate(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(void 0===e)return !!this.isAudio_;this.isAudio_=!!e;}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),i=t&&t.currentHeight();e.forEach((e=>{e!==t&&e.el_&&!e.hasClass("vjs-hidden")&&(e.hide(),this.audioOnlyCache_.hiddenChildren.push(e));})),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.height(i),this.trigger("audioonlymodechange");}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.audioOnlyCache_.hiddenChildren.forEach((e=>e.show())),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange");}audioOnlyMode(e){if("boolean"!=typeof e||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const e=[];return this.isInPictureInPicture()&&e.push(this.exitPictureInPicture()),this.isFullscreen()&&e.push(this.exitFullscreen()),this.audioPosterMode()&&e.push(this.audioPosterMode(!1)),Promise.all(e).then((()=>this.enableAudioOnlyUI_()))}return Promise.resolve().then((()=>this.disableAudioOnlyUI_()))}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange");}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange");}audioPosterMode(e){if("boolean"!=typeof e||e===this.audioPosterMode_)return this.audioPosterMode_;if(this.audioPosterMode_=e,e){if(this.audioOnlyMode()){return this.audioOnlyMode(!1).then((()=>{this.enablePosterModeUI_();}))}return Promise.resolve().then((()=>{this.enablePosterModeUI_();}))}return Promise.resolve().then((()=>{this.disablePosterModeUI_();}))}addTextTrack(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),isEvented(this)&&this.trigger("languagechange"));}languages(){return merge$1(Player.prototype.options_.languages,this.languages_)}toJSON(){const e=merge$1(this.options_),t=e.tracks;e.tracks=[];for(let i=0;i<t.length;i++){let s=t[i];s=merge$1(s),s.player=void 0,e.tracks[i]=s;}return e}createModal(e,t){(t=t||{}).content=e||"";const i=new ModalDialog(this,t);return this.addChild(i),i.on("dispose",(()=>{this.removeChild(i);})),i.open(),i}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let i=0;i<BREAKPOINT_ORDER.length;i++){const s=BREAKPOINT_ORDER[i];if(t<=this.breakpoints_[s]){if(e===s)return;e&&this.removeClass(BREAKPOINT_CLASSES[e]),this.addClass(BREAKPOINT_CLASSES[s]),this.breakpoint_=s;break}}}removeCurrentBreakpoint_(){const e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e);}breakpoints(e){return void 0===e||(this.breakpoint_="",this.breakpoints_=Object.assign({},DEFAULT_BREAKPOINTS,e),this.updateCurrentBreakpoint_()),Object.assign(this.breakpoints_)}responsive(e){if(void 0===e)return this.responsive_;return (e=Boolean(e))!==this.responsive_?(this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e):void 0}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return BREAKPOINT_CLASSES[this.breakpoint_]||""}loadMedia(e,t){if(!e||"object"!=typeof e)return;this.reset(),this.cache_.media=merge$1(e);const{artist:i,artwork:s,description:n,poster:r,src:a,textTracks:o,title:l}=this.cache_.media;!s&&r&&(this.cache_.media.artwork=[{src:r,type:getMimetype(r)}]),a&&this.src(a),r&&this.poster(r),Array.isArray(o)&&o.forEach((e=>this.addRemoteTextTrack(e,!1))),this.titleBar&&this.titleBar.update({title:l,description:n||i||""}),this.ready(t);}getMedia(){if(!this.cache_.media){const e=this.poster(),t={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),(e=>({kind:e.kind,label:e.label,language:e.language,src:e.src})))};return e&&(t.poster=e,t.artwork=[{src:t.poster,type:getMimetype(t.poster)}]),t}return merge$1(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},i=getAttributes(e),s=i["data-setup"];if(hasClass(e,"vjs-fill")&&(i.fill=!0),hasClass(e,"vjs-fluid")&&(i.fluid=!0),null!==s){const[e,t]=tuple(s||"{}");e&&log$1.error(e),Object.assign(i,t);}if(Object.assign(t,i),e.hasChildNodes()){const i=e.childNodes;for(let e=0,s=i.length;e<s;e++){const s=i[e],n=s.nodeName.toLowerCase();"source"===n?t.sources.push(getAttributes(s)):"track"===n&&t.tracks.push(getAttributes(s));}}return t}debug(e){if(void 0===e)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1);}playbackRates(e){if(void 0===e)return this.cache_.playbackRates;Array.isArray(e)&&e.every((e=>"number"==typeof e))&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"));}}ALL.names.forEach((function(e){const t=ALL[e];Player.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])};})),Player.prototype.crossorigin=Player.prototype.crossOrigin,Player.players={};const navigator$1=window_1.navigator;Player.prototype.options_={techOrder:Tech.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:navigator$1&&(navigator$1.languages&&navigator$1.languages[0]||navigator$1.userLanguage||navigator$1.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1},["ended","seeking","seekable","networkState","readyState"].forEach((function(e){Player.prototype[e]=function(){return this.techGet_(e)};})),TECH_EVENTS_RETRIGGER.forEach((function(e){Player.prototype[`handleTech${toTitleCase$1(e)}_`]=function(){return this.trigger(e)};})),Component$1.registerComponent("Player",Player);const pluginStorage={},pluginExists=e=>pluginStorage.hasOwnProperty(e),getPlugin=e=>pluginExists(e)?pluginStorage[e]:void 0,markPluginAsActive=(e,t)=>{e.activePlugins_=e.activePlugins_||{},e.activePlugins_[t]=!0;},triggerSetupEvent=(e,t,i)=>{const s=(i?"before":"")+"pluginsetup";e.trigger(s,t),e.trigger(s+":"+t.name,t);},createBasicPlugin=function(e,t){const i=function(){triggerSetupEvent(this,{name:e,plugin:t,instance:null},!0);const i=t.apply(this,arguments);return markPluginAsActive(this,e),triggerSetupEvent(this,{name:e,plugin:t,instance:i}),i};return Object.keys(t).forEach((function(e){i[e]=t[e];})),i},createPluginFactory=(e,t)=>(t.prototype.name=e,function(...i){triggerSetupEvent(this,{name:e,plugin:t,instance:null},!0);const s=new t(...[this,...i]);return this[e]=()=>s,triggerSetupEvent(this,s.getEventHash()),s});class Plugin{constructor(e){if(this.constructor===Plugin)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),evented(this),delete this.trigger,stateful(this,this.constructor.defaultState),markPluginAsActive(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose);}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return trigger(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t.activePlugins_[e]=!1,this.player=this.state=null,t[e]=createPluginFactory(e,pluginStorage[e]);}static isBasic(e){const t="string"==typeof e?getPlugin(e):e;return "function"==typeof t&&!Plugin.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if("string"!=typeof e)throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(pluginExists(e))log$1.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(Player.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if("function"!=typeof t)throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return pluginStorage[e]=t,"plugin"!==e&&(Plugin.isBasic(t)?Player.prototype[e]=createBasicPlugin(e,t):Player.prototype[e]=createPluginFactory(e,t)),t}static deregisterPlugin(e){if("plugin"===e)throw new Error("Cannot de-register base plugin.");pluginExists(e)&&(delete pluginStorage[e],delete Player.prototype[e]);}static getPlugins(e=Object.keys(pluginStorage)){let t;return e.forEach((e=>{const i=getPlugin(e);i&&(t=t||{},t[e]=i);})),t}static getPluginVersion(e){const t=getPlugin(e);return t&&t.VERSION||""}}function deprecate(e,t){let i=!1;return function(...s){return i||log$1.warn(e),i=!0,t.apply(this,s)}}function deprecateForMajor(e,t,i,s){return deprecate(`${t} is deprecated and will be removed in ${e}.0; please use ${i} instead.`,s)}Plugin.getPlugin=getPlugin,Plugin.BASE_PLUGIN_NAME="plugin",Plugin.registerPlugin("plugin",Plugin),Player.prototype.usingPlugin=function(e){return !!this.activePlugins_&&!0===this.activePlugins_[e]},Player.prototype.hasPlugin=function(e){return !!pluginExists(e)};const normalizeId=e=>0===e.indexOf("#")?e.slice(1):e;function videojs(e,t,i){let s=videojs.getPlayer(e);if(s)return t&&log$1.warn(`Player "${e}" is already initialised. Options will not be applied.`),i&&s.ready(i),s;const n="string"==typeof e?$("#"+normalizeId(e)):e;if(!isEl(n))throw new TypeError("The element or ID supplied is not valid. (videojs)");n.ownerDocument.defaultView&&n.ownerDocument.body.contains(n)||log$1.warn("The element supplied is not included in the DOM"),!0===(t=t||{}).restoreEl&&(t.restoreEl=(n.parentNode&&n.parentNode.hasAttribute("data-vjs-player")?n.parentNode:n).cloneNode(!0)),hooks("beforesetup").forEach((e=>{const i=e(n,merge$1(t));isObject(i)&&!Array.isArray(i)?t=merge$1(t,i):log$1.error("please return an object in beforesetup hooks");}));const r=Component$1.getComponent("Player");return s=new r(n,t,i),hooks("setup").forEach((e=>e(s))),s}if(videojs.hooks_=hooks_,videojs.hooks=hooks,videojs.hook=hook,videojs.hookOnce=hookOnce,videojs.removeHook=removeHook,!0!==window_1.VIDEOJS_NO_DYNAMIC_STYLE&&isReal()){let e=$(".vjs-styles-defaults");if(!e){e=createStyleElement("vjs-styles-defaults");const t=$("head");t&&t.insertBefore(e,t.firstChild),setTextContent(e,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: 56.25%\n }\n ");}}autoSetupTimeout(1,videojs),videojs.VERSION=version$6,videojs.options=Player.prototype.options_,videojs.getPlayers=()=>Player.players,videojs.getPlayer=e=>{const t=Player.players;let i;if("string"==typeof e){const s=normalizeId(e),n=t[s];if(n)return n;i=$("#"+s);}else i=e;if(isEl(i)){const{player:e,playerId:s}=i;if(e||t[s])return e||t[s]}},videojs.getAllPlayers=()=>Object.keys(Player.players).map((e=>Player.players[e])).filter(Boolean),videojs.players=Player.players,videojs.getComponent=Component$1.getComponent,videojs.registerComponent=(e,t)=>{Tech.isTech(t)&&log$1.warn(`The ${e} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),Component$1.registerComponent.call(Component$1,e,t);},videojs.getTech=Tech.getTech,videojs.registerTech=Tech.registerTech,videojs.use=use,Object.defineProperty(videojs,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(videojs.middleware,"TERMINATOR",{value:TERMINATOR,writeable:!1,enumerable:!0}),videojs.browser=browser,videojs.obj=Obj,videojs.mergeOptions=deprecateForMajor(9,"videojs.mergeOptions","videojs.obj.merge",merge$1),videojs.defineLazyProperty=deprecateForMajor(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",defineLazyProperty),videojs.bind=deprecateForMajor(9,"videojs.bind","native Function.prototype.bind",bind_),videojs.registerPlugin=Plugin.registerPlugin,videojs.deregisterPlugin=Plugin.deregisterPlugin,videojs.plugin=(e,t)=>(log$1.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Plugin.registerPlugin(e,t)),videojs.getPlugins=Plugin.getPlugins,videojs.getPlugin=Plugin.getPlugin,videojs.getPluginVersion=Plugin.getPluginVersion,videojs.addLanguage=function(e,t){return e=(""+e).toLowerCase(),videojs.options.languages=merge$1(videojs.options.languages,{[e]:t}),videojs.options.languages[e]},videojs.log=log$1,videojs.createLogger=createLogger,videojs.time=Time,videojs.createTimeRange=deprecateForMajor(9,"videojs.createTimeRange","videojs.time.createTimeRanges",createTimeRanges$1),videojs.createTimeRanges=deprecateForMajor(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",createTimeRanges$1),videojs.formatTime=deprecateForMajor(9,"videojs.formatTime","videojs.time.formatTime",formatTime),videojs.setFormatTime=deprecateForMajor(9,"videojs.setFormatTime","videojs.time.setFormatTime",setFormatTime),videojs.resetFormatTime=deprecateForMajor(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",resetFormatTime),videojs.parseUrl=deprecateForMajor(9,"videojs.parseUrl","videojs.url.parseUrl",parseUrl),videojs.isCrossOrigin=deprecateForMajor(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",isCrossOrigin),videojs.EventTarget=EventTarget$2,videojs.any=any,videojs.on=on,videojs.one=one,videojs.off=off,videojs.trigger=trigger,videojs.xhr=lib,videojs.TextTrack=TextTrack,videojs.AudioTrack=AudioTrack,videojs.VideoTrack=VideoTrack,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach((e=>{videojs[e]=function(){return log$1.warn(`videojs.${e}() is deprecated; use videojs.dom.${e}() instead`),Dom[e].apply(null,arguments)};})),videojs.computedStyle=deprecateForMajor(9,"videojs.computedStyle","videojs.dom.computedStyle",computedStyle),videojs.dom=Dom,videojs.fn=Fn,videojs.num=Num,videojs.str=Str,videojs.url=Url;
544
+ /*! @name videojs-contrib-quality-levels @version 3.0.0 @license Apache-2.0 */
545
+ class QualityLevel{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get:()=>t.enabled_(),set(e){t.enabled_(e);}}),t}}class QualityLevelList extends videojs.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get:()=>e.selectedIndex_}),Object.defineProperty(e,"length",{get:()=>e.levels_.length}),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const i=this.levels_.length;return t=new QualityLevel(e),""+i in this||Object.defineProperty(this,i,{get(){return this.levels_[i]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let i=0,s=this.length;i<s;i++)if(this[i]===e){t=this.levels_.splice(i,1)[0],this.selectedIndex_===i?this.selectedIndex_=-1:this.selectedIndex_>i&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,i=this.length;t<i;t++){const i=this[t];if(i.id===e)return i}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0;}}QualityLevelList.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const e in QualityLevelList.prototype.allowedEvents_)QualityLevelList.prototype["on"+e]=null;var version$5="3.0.0";const registerPlugin=videojs.registerPlugin||videojs.plugin,initPlugin$1=function(e,t){const i=e.qualityLevels,s=new QualityLevelList,n=function(){s.dispose(),e.qualityLevels=i,e.off("dispose",n);};return e.on("dispose",n),e.qualityLevels=()=>s,e.qualityLevels.VERSION=version$5,s},qualityLevels=function(e){return initPlugin$1(this,videojs.mergeOptions({},e))};registerPlugin("qualityLevels",qualityLevels),qualityLevels.VERSION=version$5;
546
+ /*! @name @videojs/http-streaming @version 3.0.0 @license Apache-2.0 */
547
+ const resolveUrl=resolveUrl$2,resolveManifestRedirect=(e,t)=>t&&t.responseURL&&e!==t.responseURL?t.responseURL:e,logger=e=>videojs.log.debug?videojs.log.debug.bind(videojs,"VHS:",`${e} >`):function(){};function merge(...e){const t=videojs.obj||videojs;return (t.merge||t.mergeOptions).apply(t,e)}function createTimeRanges(...e){const t=videojs.time||videojs;return (t.createTimeRanges||t.createTimeRanges).apply(t,e)}const TIME_FUDGE_FACTOR=1/30,filterRanges=function(e,t){const i=[];let s;if(e&&e.length)for(s=0;s<e.length;s++)t(e.start(s),e.end(s))&&i.push([e.start(s),e.end(s)]);return createTimeRanges(i)},findRange=function(e,t){return filterRanges(e,(function(e,i){return e-.1<=t&&i+.1>=t}))},findNextRange=function(e,t){return filterRanges(e,(function(e){return e-TIME_FUDGE_FACTOR>=t}))},findGaps=function(e){if(e.length<2)return createTimeRanges();const t=[];for(let i=1;i<e.length;i++){const s=e.end(i-1),n=e.start(i);t.push([s,n]);}return createTimeRanges(t)},bufferIntersection=function(e,t){let i=null,s=null,n=0;const r=[],a=[];if(!(e&&e.length&&t&&t.length))return createTimeRanges();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?(n++,2===n&&(i=r[o].time)):"end"===r[o].type&&(n--,1===n&&(s=r[o].time)),null!==i&&null!==s&&(a.push([i,s]),i=null,s=null);return createTimeRanges(a)},printableRange=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(", ")},timeUntilRebuffer=function(e,t,i=1){return ((e.length?e.end(e.length-1):0)-t)/i},timeRangesToArray=e=>{const t=[];for(let i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t},isRangeDifferent=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},lastBufferedEnd=function(e){if(e&&e.length&&e.end)return e.end(e.length-1)},timeAheadOf=function(e,t){let i=0;if(!e||!e.length)return i;for(let s=0;s<e.length;s++){const n=e.start(s),r=e.end(s);t>r||(i+=t>n&&t<=r?r-t:r-n);}return i},segmentDurationWithParts=(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},getPartsAndSegments=e=>(e.segments||[]).reduce(((e,t,i)=>(t.parts?t.parts.forEach((function(s,n){e.push({duration:s.duration,segmentIndex:i,partIndex:n,part:s,segment:t});})):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e)),[]),getLastParts=e=>{const t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},getKnownPartCount=({preloadSegment:e})=>{if(!e)return;const{parts:t,preloadHints:i}=e;let s=(i||[]).reduce(((e,t)=>e+("PART"===t.type?1:0)),0);return s+=t&&t.length?t.length:0,s},liveEdgeDelay=(e,t)=>{if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;const i=getLastParts(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},backwardDuration=function(e,t){let i=0,s=t-e.mediaSequence,n=e.segments[s];if(n){if(void 0!==n.start)return {result:n.start,precise:!0};if(void 0!==n.end)return {result:n.end-n.duration,precise:!0}}for(;s--;){if(n=e.segments[s],void 0!==n.end)return {result:i+n.end,precise:!0};if(i+=segmentDurationWithParts(e,n),void 0!==n.start)return {result:i+n.start,precise:!0}}return {result:i,precise:!1}},forwardDuration=function(e,t){let i,s=0,n=t-e.mediaSequence;for(;n<e.segments.length;n++){if(i=e.segments[n],void 0!==i.start)return {result:i.start-s,precise:!0};if(s+=segmentDurationWithParts(e,i),void 0!==i.end)return {result:i.end-s,precise:!0}}return {result:-1,precise:!1}},intervalDuration=function(e,t,i){if(void 0===t&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence)return 0;const s=backwardDuration(e,t);if(s.precise)return s.result;const n=forwardDuration(e,t);return n.precise?n.result:s.result+i},duration=function(e,t,i){if(!e)return 0;if("number"!=typeof i&&(i=0),void 0===t){if(e.totalDuration)return e.totalDuration;if(!e.endList)return window_1.Infinity}return intervalDuration(e,t,i)},sumDurations=function({defaultDuration:e,durationList:t,startIndex:i,endIndex:s}){let n=0;if(i>s&&([i,s]=[s,i]),i<0){for(let t=i;t<Math.min(0,s);t++)n+=e;i=0;}for(let e=i;e<s;e++)n+=t[e].duration;return n},playlistEnd=function(e,t,i,s){if(!e||!e.segments)return null;if(e.endList)return duration(e);if(null===t)return null;t=t||0;let n=intervalDuration(e,e.mediaSequence+e.segments.length,t);return i&&(n-=s="number"==typeof s?s:liveEdgeDelay(null,e)),Math.max(0,n)},seekable=function(e,t,i){const s=t||0,n=playlistEnd(e,t,!0,i);return null===n?createTimeRanges():createTimeRanges(s,n)},getMediaInfoForTime=function({playlist:e,currentTime:t,startingSegmentIndex:i,startingPartIndex:s,startTime:n,exactManifestTimings:r}){let a=t-n;const o=getPartsAndSegments(e);let l=0;for(let e=0;e<o.length;e++){const t=o[e];if(i===t.segmentIndex&&("number"!=typeof s||"number"!=typeof t.partIndex||s===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+TIME_FUDGE_FACTOR<=0)continue;return {partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:n-sumDurations({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];if(a-=i.duration,r){if(a>0)continue}else if(a-TIME_FUDGE_FACTOR>=0)continue;return {partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:n+sumDurations({defaultDuration:e.targetDuration,durationList:o,startIndex:l,endIndex:t})}}return {segmentIndex:o[o.length-1].segmentIndex,partIndex:o[o.length-1].partIndex,startTime:t}},isExcluded=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},isIncompatible=function(e){return e.excludeUntil&&e.excludeUntil===1/0},isEnabled=function(e){const t=isExcluded(e);return !e.disabled&&!t},isDisabled=function(e){return e.disabled},isAes=function(e){for(let t=0;t<e.segments.length;t++)if(e.segments[t].key)return !0;return !1},hasAttribute=function(e,t){return t.attributes&&t.attributes[e]},estimateSegmentRequestTime=function(e,t,i,s=0){if(!hasAttribute("BANDWIDTH",i))return NaN;return (e*i.attributes.BANDWIDTH-8*s)/t},isLowestEnabledRendition=(e,t)=>{if(1===e.playlists.length)return !0;const i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter((e=>!!isEnabled(e)&&(e.attributes.BANDWIDTH||0)<i)).length},playlistMatch=(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)))),someAudioVariant=function(e,t){const i=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{};let s=!1;for(const e in i){for(const n in i[e])if(s=t(i[e][n]),s)break;if(s)break}return !!s},isAudioOnly=e=>{if(!e||!e.playlists||!e.playlists.length){return someAudioVariant(e,(e=>e.playlists&&e.playlists.length||e.uri))}for(let t=0;t<e.playlists.length;t++){const i=e.playlists[t],s=i.attributes&&i.attributes.CODECS;if(s&&s.split(",").every((e=>isAudioCodec(e))))continue;if(!someAudioVariant(e,(e=>playlistMatch(i,e))))return !1}return !0};var Playlist={liveEdgeDelay:liveEdgeDelay,duration:duration,seekable:seekable,getMediaInfoForTime:getMediaInfoForTime,isEnabled:isEnabled,isDisabled:isDisabled,isExcluded:isExcluded,isIncompatible:isIncompatible,playlistEnd:playlistEnd,isAes:isAes,hasAttribute:hasAttribute,estimateSegmentRequestTime:estimateSegmentRequestTime,isLowestEnabledRendition:isLowestEnabledRendition,isAudioOnly:isAudioOnly,playlistMatch:playlistMatch,segmentDurationWithParts:segmentDurationWithParts};const{log:log}=videojs,createPlaylistID=(e,t)=>`${e}-${t}`,parseManifest=({onwarn:e,oninfo:t,manifestString:i,customTagParsers:s=[],customTagMappers:n=[],llhls:r})=>{const a=new Parser;e&&a.on("warn",e),t&&a.on("info",t),s.forEach((e=>a.addParser(e))),n.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(`manifest has no targetDuration defaulting to ${t}`),o.targetDuration=t;}const l=getLastParts(o);if(l.length&&!o.partTargetDuration){const t=l.reduce(((e,t)=>Math.max(e,t.duration)),0);e&&(e(`manifest has no partTargetDuration defaulting to ${t}`),log.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},forEachMediaGroup=(e,t)=>{e.mediaGroups&&["AUDIO","SUBTITLES"].forEach((i=>{if(e.mediaGroups[i])for(const s in e.mediaGroups[i])for(const n in e.mediaGroups[i][s]){const r=e.mediaGroups[i][s][n];t(r,i,s,n);}}));},setupMediaPlaylist=({playlist:e,uri:t,id:i})=>{e.id=i,e.playlistErrors_=0,t&&(e.uri=t),e.attributes=e.attributes||{};},setupMediaPlaylists=e=>{let t=e.playlists.length;for(;t--;){const i=e.playlists[t];setupMediaPlaylist({playlist:i,id:createPlaylistID(t,i.uri)}),i.resolvedUri=resolveUrl(e.uri,i.uri),e.playlists[i.id]=i,e.playlists[i.uri]=i,i.attributes.BANDWIDTH||log.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.");}},resolveMediaGroupUris=e=>{forEachMediaGroup(e,(t=>{t.uri&&(t.resolvedUri=resolveUrl(e.uri,t.uri));}));},mainForMedia=(e,t)=>{const i=createPlaylistID(0,t),s={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:window_1.location.href,resolvedUri:window_1.location.href,playlists:[{uri:t,id:i,resolvedUri:t,attributes:{}}]};return s.playlists[i]=s.playlists[0],s.playlists[t]=s.playlists[0],s},addPropertiesToMain=(e,t)=>{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 i=isAudioOnly(e);forEachMediaGroup(e,((t,s,n,r)=>{const a=`placeholder-uri-${s}-${n}-${r}`;if(!t.playlists||!t.playlists.length){if(i&&"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===n)return}t.playlists=[_extends$1({},t)];}t.playlists.forEach((function(t,i){const s=createPlaylistID(i,a);t.uri?t.resolvedUri=t.resolvedUri||resolveUrl(e.uri,t.uri):(t.uri=0===i?a:s,t.resolvedUri=t.uri),t.id=t.id||s,t.attributes=t.attributes||{},e.playlists[t.id]=t,e.playlists[t.uri]=t;}));})),setupMediaPlaylists(e),resolveMediaGroupUris(e);},{EventTarget:EventTarget$1}=videojs,addLLHLSQueryDirectives=(e,t)=>{if(t.endList||!t.serverControl)return e;const i={};if(t.serverControl.canBlockReload){const{preloadSegment:e}=t;let s=t.mediaSequence+t.segments.length;if(e){const n=e.parts||[],r=getKnownPartCount(t)-1;r>-1&&r!==n.length-1&&(i._HLS_part=r),(r>-1||n.length)&&s--;}i._HLS_msn=s;}if(t.serverControl&&t.serverControl.canSkipUntil&&(i._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(i).length){const t=new window_1.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},updateSegment=(e,t)=>{if(!e)return t;const i=merge(e,t);if(e.preloadHints&&!t.preloadHints&&delete i.preloadHints,e.parts&&!t.parts)delete i.parts;else if(e.parts&&t.parts)for(let s=0;s<t.parts.length;s++)e.parts&&e.parts[s]&&(i.parts[s]=merge(e.parts[s],t.parts[s]));return !e.skipped&&t.skipped&&(i.skipped=!1),e.preload&&!t.preload&&(i.preload=!1),i},updateSegments=(e,t,i)=>{const s=e.slice(),n=t.slice();i=i||0;const r=[];let a;for(let e=0;e<n.length;e++){const t=s[e+i],o=n[e];t?(a=t.map||a,r.push(updateSegment(t,o))):(a&&!o.map&&(o.map=a),r.push(o));}return r},resolveSegmentUris=(e,t)=>{!e.resolvedUri&&e.uri&&(e.resolvedUri=resolveUrl(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=resolveUrl(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=resolveUrl(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=resolveUrl(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach((e=>{e.resolvedUri||(e.resolvedUri=resolveUrl(t,e.uri));})),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach((e=>{e.resolvedUri||(e.resolvedUri=resolveUrl(t,e.uri));}));},getAllSegments=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},isPlaylistUnchanged=(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,updateMain$1=(e,t,i=isPlaylistUnchanged)=>{const s=merge(e,{}),n=s.playlists[t.id];if(!n)return null;if(i(n,t))return null;t.segments=getAllSegments(t);const r=merge(n,t);if(r.preloadSegment&&!t.preloadSegment&&delete r.preloadSegment,n.segments){if(t.skip){t.segments=t.segments||[];for(let e=0;e<t.skip.skippedSegments;e++)t.segments.unshift({skipped:!0});}r.segments=updateSegments(n.segments,t.segments,t.mediaSequence-n.mediaSequence);}r.segments.forEach((e=>{resolveSegmentUris(e,r.resolvedUri);}));for(let e=0;e<s.playlists.length;e++)s.playlists[e].id===t.id&&(s.playlists[e]=r);return s.playlists[t.id]=r,s.playlists[t.uri]=r,forEachMediaGroup(e,((e,i,s,n)=>{if(e.playlists)for(let i=0;i<e.playlists.length;i++)t.id===e.playlists[i].id&&(e.playlists[i]=r);})),s},refreshDelay=(e,t)=>{const i=e.segments||[],s=i[i.length-1],n=s&&s.parts&&s.parts[s.parts.length-1],r=n&&n.duration||s&&s.duration;return t&&r?1e3*r:500*(e.partTargetDuration||e.targetDuration||10)};class PlaylistLoader extends EventTarget$1{constructor(e,t,i={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=logger("PlaylistLoader");const{withCredentials:s=!1}=i;this.src=e,this.vhs_=t,this.withCredentials=s;const n=t.options_;this.customTagParsers=n&&n.customTagParsers||[],this.customTagMappers=n&&n.customTagMappers||[],this.llhls=n&&n.llhls,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_);}handleMediaupdatetimeout_(){if("HAVE_METADATA"!==this.state)return;const e=this.media();let t=resolveUrl(this.main.uri,e.uri);this.llhls&&(t=addLLHLSQueryDirectives(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials},((e,t)=>{if(this.request)return e?this.playlistRequestError(this.request,this.media(),"HAVE_METADATA"):void this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}));}playlistRequestError(e,t,i){const{uri:s,id:n}=t;this.request=null,i&&(this.state=i),this.error={playlist:this.main.playlists[n],status:e.status,message:`HLS playlist request error at URL: ${s}.`,responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error");}parseManifest_({url:e,manifestString:t}){return parseManifest({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})}haveMetadata({playlistString:e,playlistObject:t,url:i,id:s}){this.request=null,this.state="HAVE_METADATA";const n=t||this.parseManifest_({url:i,manifestString:e});n.lastRequest=Date.now(),setupMediaPlaylist({playlist:n,uri:i,id:s});const r=updateMain$1(this.main,n);this.targetDuration=n.partTargetDuration||n.targetDuration,this.pendingMedia_=null,r?(this.main=r,this.media_=this.main.playlists[s]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(refreshDelay(this.media(),!!r)),this.trigger("loadedplaylist");}dispose(){this.trigger("dispose"),this.stopRequest(),window_1.clearTimeout(this.mediaUpdateTimeout),window_1.clearTimeout(this.finalRenditionTimeout),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(window_1.clearTimeout(this.finalRenditionTimeout),t){const t=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;return void(this.finalRenditionTimeout=window_1.setTimeout(this.media.bind(this,e,!1),t))}const i=this.state,s=!this.media_||e.id!==this.media_.id,n=this.main.playlists[e.id];if(n&&n.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(s&&(this.trigger("mediachanging"),"HAVE_MAIN_MANIFEST"===i?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(refreshDelay(e,!0)),s){if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null;}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},((t,s)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=resolveManifestRedirect(e.resolvedUri,s),t)return this.playlistRequestError(this.request,e,i);this.haveMetadata({playlistString:s.responseText,url:e.uri,id:e.id}),"HAVE_MAIN_MANIFEST"===i?this.trigger("loadedmetadata"):this.trigger("mediachange");}}));}}pause(){this.mediaUpdateTimeout&&(window_1.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA");}load(e){this.mediaUpdateTimeout&&(window_1.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const e=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=window_1.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&&(window_1.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=window_1.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=window_1.location.href),this.src.resolvedUri=this.src.uri,void setTimeout((()=>{this.setupInitialPlaylist(this.src);}),0);this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},((e,t)=>{if(!this.request)return;if(this.request=null,e)return this.error={status:t.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:t.responseText,code:2},"HAVE_NOTHING"===this.state&&(this.started=!1),this.trigger("error");this.src=resolveManifestRedirect(this.src,t);const i=this.parseManifest_({manifestString:t.responseText,url:this.src});this.setupInitialPlaylist(i);}));}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,addPropertiesToMain(this.main,this.srcUri()),e.playlists.forEach((e=>{e.segments=getAllSegments(e),e.segments.forEach((t=>{resolveSegmentUris(t,e.resolvedUri);}));})),this.trigger("loadedplaylist"),void(this.request||this.media(this.main.playlists[0]));const t=this.srcUri()||window_1.location.href;this.main=mainForMedia(0,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata");}}const{xhr:videojsXHR}=videojs,callbackWrapper=function(e,t,i,s){const n="arraybuffer"===e.responseType?e.response:e.responseText;!t&&n&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=n.byteLength||n.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*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&&(n||e.responseText)))),s(t,e);},xhrFactory=function(){const e=function e(t,i){t=merge({timeout:45e3},t);const s=e.beforeRequest||videojs.Vhs.xhr.beforeRequest;if(s&&"function"==typeof s){const e=s(t);e&&(t=e);}const n=(!0===videojs.Vhs.xhr.original?videojsXHR:videojs.Vhs.xhr)(t,(function(e,t){return callbackWrapper(n,e,t,i)})),r=n.abort;return n.abort=function(){return n.aborted=!0,r.apply(n,arguments)},n.uri=t.uri,n.requestTime=Date.now(),n};return e.original=!0,e},byterangeStr=function(e){let t;const i=e.offset;return t="bigint"==typeof e.offset||"bigint"==typeof e.length?window_1.BigInt(e.offset)+window_1.BigInt(e.length)-window_1.BigInt(1):e.offset+e.length-1,"bytes="+i+"-"+t},segmentXhrHeaders=function(e){const t={};return e.byterange&&(t.Range=byterangeStr(e.byterange)),t},textRange=function(e,t){return e.start(t)+"-"+e.end(t)},formatHexString=function(e,t){const i=e.toString(16);return "00".substring(0,2-i.length)+i+(t%2?" ":"")},formatAsciiString=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},createTransferableMessage=function(e){const t={};return Object.keys(e).forEach((i=>{const s=e[i];isArrayBufferView(s)?t[i]={bytes:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength}:t[i]=s;})),t},initSegmentId=function(e){const t=e.byterange||{length:1/0,offset:0};return [t.length,t.offset,e.resolvedUri].join(",")},segmentKeyId=function(e){return e.resolvedUri},hexDump=e=>{const t=Array.prototype.slice.call(e),i=16;let s,n,r="";for(let e=0;e<t.length/i;e++)s=t.slice(e*i,e*i+i).map(formatHexString).join(""),n=t.slice(e*i,e*i+i).map(formatAsciiString).join(""),r+=s+" "+n+"\n";return r},tagDump=({bytes:e})=>hexDump(e),textRanges=e=>{let t,i="";for(t=0;t<e.length;t++)i+=textRange(e,t)+" ";return i};var utils=Object.freeze({__proto__:null,createTransferableMessage:createTransferableMessage,initSegmentId:initSegmentId,segmentKeyId:segmentKeyId,hexDump:hexDump,tagDump:tagDump,textRanges:textRanges});const playerTimeToProgramTime=(e,t)=>{if(!t.dateTimeObject)return null;const i=t.videoTimingInfo.transmuxerPrependedSeconds,s=e-(t.videoTimingInfo.transmuxedPresentationStart+i);return new Date(t.dateTimeObject.getTime()+1e3*s)},findSegmentForProgramTime=(e,t)=>{let i;try{i=new Date(e);}catch(e){return null}if(!t||!t.segments||0===t.segments.length)return null;let s=t.segments[0];if(i<s.dateTimeObject)return null;for(let e=0;e<t.segments.length-1;e++){s=t.segments[e];if(i<t.segments[e+1].dateTimeObject)break}const n=t.segments[t.segments.length-1],r=n.dateTimeObject,a=n.videoTimingInfo?(o=n.videoTimingInfo).transmuxedPresentationEnd-o.transmuxedPresentationStart-o.transmuxerPrependedSeconds:n.duration+.25*n.duration;var o;return i>new Date(r.getTime()+1e3*a)?null:(i>r&&(s=n),{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:Playlist.duration(t,t.mediaSequence+t.segments.indexOf(s)),type:s.videoTimingInfo?"accurate":"estimate"})},findSegmentForPlayerTime=(e,t)=>{if(!t||!t.segments||0===t.segments.length)return null;let i,s=0;for(let n=0;n<t.segments.length&&(i=t.segments[n],s=i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationEnd:s+i.duration,!(e<=s));n++);const n=t.segments[t.segments.length-1];if(n.videoTimingInfo&&n.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>s){if(e>s+.25*n.duration)return null;i=n;}return {segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:s-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}},getOffsetFromTimestamp=(e,t)=>{let i,s;try{i=new Date(e),s=new Date(t);}catch(e){}const n=i.getTime();return (s.getTime()-n)/1e3},verifyProgramDateTimeTags=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},getProgramTime=({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 s=findSegmentForPlayerTime(t,e);if(!s)return i({message:"valid programTime was not found"});if("estimate"===s.type)return i({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:s.estimatedStart});const n={mediaSeconds:t},r=playerTimeToProgramTime(t,s.segment);return r&&(n.programDateTime=r.toISOString()),i(null,n)},seekToProgramTime=({programTime:e,playlist:t,retryCount:i=2,seekTo:s,pauseAfterSeek:n=!0,tech:r,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if(void 0===e||!t||!s)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(!verifyProgramDateTimeTags(t))return a({message:"programDateTime tags must be provided in the manifest "+t.resolvedUri});const o=findSegmentForProgramTime(e,t);if(!o)return a({message:`${e} was not found in the stream`});const l=o.segment,d=getOffsetFromTimestamp(l.dateTimeObject,e);if("estimate"===o.type)return 0===i?a({message:`${e} is not buffered yet. Try again`}):(s(o.estimatedStart+d),void r.one("seeked",(()=>{seekToProgramTime({programTime:e,playlist:t,retryCount:i-1,seekTo:s,pauseAfterSeek:n,tech:r,callback:a});})));const h=l.start+d;r.one("seeked",(()=>a(null,r.currentTime()))),n&&r.pause(),s(h);},callbackOnCompleted=(e,t)=>{if(4===e.readyState)return t()},containerRequest=(e,t,i)=>{let s,n=[],r=!1;const a=function(e,t,s,n){return t.abort(),r=!0,i(e,t,s,n)},o=function(e,t){if(r)return;if(e)return a(e,t,"",n);const i=t.responseText.substring(n&&n.byteLength||0,t.responseText.length);if(n=concatTypedArrays(n,stringToBytes(i,!0)),s=s||getId3Offset(n),n.length<10||s&&n.length<s+2)return callbackOnCompleted(t,(()=>a(e,t,"",n)));const o=detectContainerForBytes(n);return "ts"===o&&n.length<188||!o&&n.length<376?callbackOnCompleted(t,(()=>a(e,t,"",n))):a(null,t,o,n)},l={uri:e,beforeSend(e){e.overrideMimeType("text/plain; charset=x-user-defined"),e.addEventListener("progress",(function({total:t,loaded:i}){return callbackWrapper(e,null,{statusCode:e.status},o)}));}},d=t(l,(function(e,t){return callbackWrapper(d,e,t,o)}));return d},{EventTarget:EventTarget}=videojs,dashPlaylistUnchanged=function(e,t){if(!isPlaylistUnchanged(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 s=e.segments[i],n=t.segments[i];if(s.uri!==n.uri)return !1;if(!s.byterange&&!n.byterange)continue;const r=s.byterange,a=n.byterange;if(r&&!a||!r&&a)return !1;if(r.offset!==a.offset||r.length!==a.length)return !1}return !0},parseMainXml=({mainXml:e,srcUrl:t,clientOffset:i,sidxMapping:s,previousManifest:n})=>{const r=parse(e,{manifestUri:t,clientOffset:i,sidxMapping:s,previousManifest:n});return addPropertiesToMain(r,t),r},updateMain=(e,t,i)=>{let s=!0,n=merge(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=generateSidxKey(r.sidx);i&&i[e]&&i[e].sidx&&addSidxSegmentsToPlaylist$1(r,i[e].sidx,r.sidx.resolvedUri);}const a=updateMain$1(n,r,dashPlaylistUnchanged);a&&(n=a,s=!1);}return forEachMediaGroup(t,((e,t,i,r)=>{if(e.playlists&&e.playlists.length){const a=e.playlists[0].id,o=updateMain$1(n,e.playlists[0],dashPlaylistUnchanged);o&&(n=o,n.mediaGroups[t][i][r].playlists[0]=n.playlists[a],s=!1);}})),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(s=!1),s?null:n},compareSidxEntry=(e,t)=>{const i={};for(const r in e){const a=e[r].sidx;if(a){const e=generateSidxKey(a);if(!t[e])break;const r=t[e].sidxInfo;s=r,n=a,(Boolean(!s.map&&!n.map)||Boolean(s.map&&n.map&&s.map.byterange.offset===n.map.byterange.offset&&s.map.byterange.length===n.map.byterange.length))&&s.uri===n.uri&&s.byterange.offset===n.byterange.offset&&s.byterange.length===n.byterange.length&&(i[e]=t[e]);}}var s,n;return i},filterChangedSidxMappings=(e,t)=>{let i=compareSidxEntry(e.playlists,t);return forEachMediaGroup(e,((e,s,n,r)=>{if(e.playlists&&e.playlists.length){const s=e.playlists;i=merge(i,compareSidxEntry(s,t));}})),i};class DashPlaylistLoader extends EventTarget{constructor(e,t,i={},s){super(),this.mainPlaylistLoader_=s||this,s||(this.isMain_=!0);const{withCredentials:n=!1}=i;if(this.vhs_=t,this.withCredentials=n,!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_=logger("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e;}requestErrored_(e,t,i){return !this.request||(this.request=null,e?(this.error="object"!=typeof e||e instanceof Error?{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2}:e,i&&(this.state=i),this.trigger("error"),!0):void 0)}addSidxSegments_(e,t,i){const s=e.sidx&&generateSidxKey(e.sidx);if(!e.sidx||!s||this.mainPlaylistLoader_.sidxMapping_[s])return void(this.mediaRequest_=window_1.setTimeout((()=>i(!1)),0));const n=resolveManifestRedirect(e.sidx.resolvedUri),r=(n,r)=>{if(this.requestErrored_(n,r,t))return;const a=this.mainPlaylistLoader_.sidxMapping_;let o;try{o=parseSidx_1(toUint8(r.response).subarray(8));}catch(e){return void this.requestErrored_(e,r,t)}return a[s]={sidxInfo:e.sidx,sidx:o},addSidxSegmentsToPlaylist$1(e,o,e.sidx.resolvedUri),i(!0)};this.request=containerRequest(n,this.vhs_.xhr,((t,i,s,a)=>{if(t)return r(t,i);if(!s||"mp4"!==s)return r({status:i.status,message:`Unsupported ${s||"unknown"} container type for sidx segment at URL: ${n}`,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:n,responseType:"arraybuffer",headers:segmentXhrHeaders({byterange:e.sidx.byterange})},r);}));}dispose(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},window_1.clearTimeout(this.minimumUpdatePeriodTimeout_),window_1.clearTimeout(this.mediaRequest_),window_1.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,this.mediaRequest_=null,this.refreshMedia_(t.id),"HAVE_MAIN_MANIFEST"===e?this.trigger("loadedmetadata"):this.trigger("mediachange");}pause(){this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),window_1.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(window_1.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1);}load(e){window_1.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const e=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=window_1.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(){this.started=!0,this.isMain_?this.requestMain_(((e,t)=>{this.haveMain_(),this.hasPendingRequest()||this.media_||this.media(this.mainPlaylistLoader_.main.playlists[0]);})):this.mediaRequest_=window_1.setTimeout((()=>this.haveMain_()),0);}requestMain_(e){this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},((t,i)=>{if(this.requestErrored_(t,i))return void("HAVE_NOTHING"===this.state&&(this.started=!1));const s=i.responseText!==this.mainPlaylistLoader_.mainXml_;return this.mainPlaylistLoader_.mainXml_=i.responseText,i.responseHeaders&&i.responseHeaders.date?this.mainLoaded_=Date.parse(i.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=resolveManifestRedirect(this.mainPlaylistLoader_.srcUrl,i),s?(this.handleMain_(),void this.syncClientServerClock_((()=>e(i,s)))):e(i,s)}));}syncClientServerClock_(e){const t=parseUTCTiming(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:resolveUrl(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials},((i,s)=>{if(!this.request)return;if(i)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();let n;n="HEAD"===t.method?s.responseHeaders&&s.responseHeaders.date?Date.parse(s.responseHeaders.date):this.mainLoaded_:Date.parse(s.responseText),this.mainPlaylistLoader_.clientOffset_=n-Date.now(),e();})))}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_);}handleMain_(){this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main;let t=parseMainXml({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e});e&&(t=updateMain(e,t,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=t||e;const i=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];return i&&i!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=i),(!e||t&&t.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),Boolean(t)}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(window_1.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_=window_1.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_=filterChangedSidxMappings(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=window_1.setTimeout((()=>{this.trigger("mediaupdatetimeout"),e();}),refreshDelay(this.media(),Boolean(i))));};e();}this.trigger("loadedplaylist");}}var Config={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 stringToArrayBuffer=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},browserWorkerPolyFill=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},createObjectURL=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())}},factory=function(e){return function(){const t=createObjectURL(e),i=browserWorkerPolyFill(new Worker(t));i.objURL=t;const s=i.terminate;return i.on=i.addEventListener,i.off=i.removeEventListener,i.terminate=function(){return URL.revokeObjectURL(t),s.call(this)},i}},transform=function(e){return `var browserWorkerPolyFill = ${browserWorkerPolyFill.toString()};\nbrowserWorkerPolyFill(self);\n`+e},getWorkerString=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)},workerCode$1=transform(getWorkerString((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 s;return !!e[t]&&(s=e[t].indexOf(i),e[t]=e[t].slice(),e[t].splice(s,1),s>-1)},this.trigger=function(t){var i,s,n,r;if(i=e[t])if(2===arguments.length)for(n=i.length,s=0;s<n;++s)i[s].call(this,arguments[1]);else {for(r=[],s=arguments.length,s=1;s<arguments.length;++s)r.push(arguments[s]);for(n=i.length,s=0;s<n;++s)i[s].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,s,n,r,a,o,l,d,h,u,c,p,m,g,f,_,y,T,v,b,S,C,k,E,w,I,x,A,P,L,O,D,M,R,U,$,B,N,F,j,H=t,V=Math.pow(2,32),q={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},W=q.MAX_UINT32;!function(){var e;if(C={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 C)C.hasOwnProperty(e)&&(C[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);k=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),w=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),E=new Uint8Array([0,0,0,1]),I=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]),x=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:I,audio:x},O=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,R=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),U=D,P=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]);}}(),i=function(e){var t,i,s=[],n=0;for(t=1;t<arguments.length;t++)s.push(arguments[t]);for(t=s.length;t--;)n+=s[t].byteLength;for(i=new Uint8Array(n+8),new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,i.byteLength),i.set(e,4),t=0,n=8;t<s.length;t++)i.set(s[t],n),n+=s[t].byteLength;return i},s=function(){return i(C.dinf,i(C.dref,O))},n=function(e){return i(C.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]))},f=function(e){return i(C.hdlr,A[e])},g=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(C.mdhd,t)},m=function(e){return i(C.mdia,g(e),f(e.type),o(e))},a=function(e){return i(C.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},o=function(e){return i(C.minf,"video"===e.type?i(C.vmhd,P):i(C.smhd,L),s(),y(e))},l=function(e,t){for(var s=[],n=t.length;n--;)s[n]=v(t[n]);return i.apply(null,[C.moof,a(e)].concat(s))},d=function(e){for(var t=e.length,s=[];t--;)s[t]=c(e[t]);return i.apply(null,[C.moov,u(4294967295)].concat(s).concat(h(e)))},h=function(e){for(var t=e.length,s=[];t--;)s[t]=b(e[t]);return i.apply(null,[C.mvex].concat(s))},u=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(C.mvhd,t)},_=function(e){var t,s,n=e.samples||[],r=new Uint8Array(4+n.length);for(s=0;s<n.length;s++)t=n[s].flags,r[s+4]=t.dependsOn<<4|t.isDependedOn<<2|t.hasRedundancy;return i(C.sdtp,r)},y=function(e){return i(C.stbl,T(e),i(C.stts,U),i(C.stsc,M),i(C.stsz,R),i(C.stco,D))},T=function(e){return i(C.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===e.type?$(e):B(e))},$=function(e){var t,s,n=e.sps||[],r=e.pps||[],a=[],o=[];for(t=0;t<n.length;t++)a.push((65280&n[t].byteLength)>>>8),a.push(255&n[t].byteLength),a=a.concat(Array.prototype.slice.call(n[t]));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(s=[C.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(C.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([n.length],a,[r.length],o))),i(C.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio){var l=e.sarRatio[0],d=e.sarRatio[1];s.push(i(C.pasp,new Uint8Array([(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l,(4278190080&d)>>24,(16711680&d)>>16,(65280&d)>>8,255&d])));}return i.apply(null,s)},B=function(e){return i(C.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),n(e))},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(C.tkhd,t)},v=function(e){var t,s,n,r,a,o;return t=i(C.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/W),o=Math.floor(e.baseMediaDecodeTime%W),s=i(C.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?(n=S(e,92),i(C.traf,t,s,n)):(r=_(e),n=S(e,r.length+92),i(C.traf,t,s,n,r))},c=function(e){return e.duration=e.duration||4294967295,i(C.trak,p(e),m(e))},b=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(C.trex,t)},j=function(e,t){var i=0,s=0,n=0,r=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(s=2),void 0!==e[0].flags&&(n=4),void 0!==e[0].compositionTimeOffset&&(r=8)),[0,0,i|s|n|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]},F=function(e,t){var s,n,r,a,o,l;for(t+=20+16*(a=e.samples||[]).length,r=j(a,t),(n=new Uint8Array(r.length+16*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,n[s++]=o.flags.isLeading<<2|o.flags.dependsOn,n[s++]=o.flags.isDependedOn<<6|o.flags.hasRedundancy<<4|o.flags.paddingValue<<1|o.flags.isNonSyncSample,n[s++]=61440&o.flags.degradationPriority,n[s++]=15&o.flags.degradationPriority,n[s++]=(4278190080&o.compositionTimeOffset)>>>24,n[s++]=(16711680&o.compositionTimeOffset)>>>16,n[s++]=(65280&o.compositionTimeOffset)>>>8,n[s++]=255&o.compositionTimeOffset;return i(C.trun,n)},N=function(e,t){var s,n,r,a,o,l;for(t+=20+8*(a=e.samples||[]).length,r=j(a,t),(s=new Uint8Array(r.length+8*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;return i(C.trun,s)},S=function(e,t){return "audio"===e.type?N(e,t):F(e,t)};var G,K,z,Q,Y,X,J,Z,ee={ftyp:r=function(){return i(C.ftyp,k,E,k,w)},mdat:function(e){return i(C.mdat,e)},moof:l,moov:d,initSegment:function(e){var t,i=r(),s=d(e);return (t=new Uint8Array(i.byteLength+s.byteLength)).set(i),t.set(s,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,s=[],n=[];for(n.byteLength=0,n.nalCount=0,n.duration=0,s.byteLength=0,t=0;t<e.length;t++)"access_unit_delimiter_rbsp"===(i=e[t]).nalUnitType?(s.length&&(s.duration=i.dts-s.dts,n.byteLength+=s.byteLength,n.nalCount+=s.length,n.duration+=s.duration,n.push(s)),(s=[i]).byteLength=i.data.byteLength,s.pts=i.pts,s.dts=i.dts):("slice_layer_without_partitioning_rbsp_idr"===i.nalUnitType&&(s.keyFrame=!0),s.duration=i.dts-s.dts,s.byteLength+=i.data.byteLength,s.push(i));return n.length&&(!s.duration||s.duration<=0)&&(s.duration=n[n.length-1].duration),n.byteLength+=s.byteLength,n.nalCount+=s.length,n.duration+=s.duration,n.push(s),n},groupFramesIntoGops:function(e){var t,i,s=[],n=[];for(s.byteLength=0,s.nalCount=0,s.duration=0,s.pts=e[0].pts,s.dts=e[0].dts,n.byteLength=0,n.nalCount=0,n.duration=0,n.pts=e[0].pts,n.dts=e[0].dts,t=0;t<e.length;t++)(i=e[t]).keyFrame?(s.length&&(n.push(s),n.byteLength+=s.byteLength,n.nalCount+=s.nalCount,n.duration+=s.duration),(s=[i]).nalCount=i.length,s.byteLength=i.byteLength,s.pts=i.pts,s.dts=i.dts,s.duration=i.duration):(s.duration+=i.duration,s.nalCount+=i.length,s.byteLength+=i.byteLength,s.push(i));return n.length&&s.duration<=0&&(s.duration=n[n.length-1].duration),n.byteLength+=s.byteLength,n.nalCount+=s.nalCount,n.duration+=s.duration,n.push(s),n},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,s,n,r,a,o=t||0,l=[];for(i=0;i<e.length;i++)for(r=e[i],s=0;s<r.length;s++)a=r[s],o+=(n=te(a,o)).size,l.push(n);return l},concatenateNalData:function(e){var t,i,s,n,r,a,o=0,l=e.byteLength,d=e.nalCount,h=new Uint8Array(l+4*d),u=new DataView(h.buffer);for(t=0;t<e.length;t++)for(n=e[t],i=0;i<n.length;i++)for(r=n[i],s=0;s<r.length;s++)a=r[s],u.setUint32(o,a.data.byteLength),o+=4,h.set(a.data,o),o+=a.data.byteLength;return h},generateSampleTableForFrame:function(e,t){var i,s=[];return i=te(e,t||0),s.push(i),s},concatenateNalDataForFrame:function(e){var t,i,s=0,n=e.byteLength,r=e.length,a=new Uint8Array(n+4*r),o=new DataView(a.buffer);for(t=0;t<e.length;t++)i=e[t],o.setUint32(s,i.data.byteLength),s+=4,a.set(i.data,s),s+=i.data.byteLength;return a}},se=[33,16,5,32,164,27],ne=[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;X=function(e,t){return K(Y(e,t))},J=function(e,t){return z(Q(e),t)},Z=function(e,t,i){return Q(i?e:e-t)};var oe={ONE_SECOND_IN_TS:ae,secondsToVideoTs:K=function(e){return e*ae},secondsToAudioTs:z=function(e,t){return e*t},videoTsToSeconds:Q=function(e){return e/ae},audioTsToSeconds:Y=function(e,t){return e/t},audioTsToVideoTs:X,videoTsToAudioTs:J,metadataTsToSeconds:Z},le=function(){if(!G){var e={96e3:[se,[227,64],re(154),[56]],88200:[se,[231],re(170),[56]],64e3:[se,[248,192],re(240),[56]],48e3:[se,[255,192],re(268),[55,148,128],re(54),[112]],44100:[se,[255,192],re(268),[55,163,128],re(84),[112]],32e3:[se,[255,192],re(268),[55,234],re(226),[112]],24e3:[se,[255,192],re(268),[55,255,128],re(268),[111,112],re(126),[224]],16e3:[se,[255,192],re(268),[55,255,128],re(268),[111,255],re(269),[223,108],re(195),[1,192]],12e3:[ne,re(268),[3,127,248],re(268),[6,255,240],re(268),[13,255,224],re(268),[27,253,128],re(259),[56]],11025:[ne,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:[ne,re(268),[3,121,16],re(47),[7]]};t=e,G=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 G},de=oe,he={prefixWithSilence:function(e,t,i,s){var n,r,a,o,l,d=0,h=0,u=0;if(t.length&&(n=de.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),r=Math.ceil(de.ONE_SECOND_IN_TS/(e.samplerate/1024)),i&&s&&(d=n-Math.max(i,s),u=(h=Math.floor(d/r))*r),!(h<1||u>de.ONE_SECOND_IN_TS/2))){for((a=le()[e.samplerate])||(a=t[0].data),o=0;o<h;o++)l=t[0],t.splice(0,0,{data:a,dts:l.dts-r,pts:l.pts-r});return e.baseMediaDecodeTime-=Math.floor(de.videoTsToAudioTs(u,e.samplerate)),u}},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,s=[];for(t=0;t<e.length;t++)i=e[t],s.push({size:i.data.byteLength,duration:1024});return s},concatenateFrameData:function(e){var t,i,s=0,n=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],n.set(i.data,s),s+=i.data.byteLength;return n}},ue=oe.ONE_SECOND_IN_TS,ce={clearDtsInfo:function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts;},calculateTrackBaseMediaDecodeTime:function(e,t){var i,s=e.minSegmentDts;return t||(s-=e.timelineStartInfo.dts),i=e.timelineStartInfo.baseMediaDecodeTime,i+=s,i=Math.max(0,i),"audio"===e.type&&(i*=e.samplerate/ue,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},s=0,n=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)s+=255,t++;for(s+=e[t++];255===e[t];)n+=255,t++;if(n+=e[t++],!i.payload&&4===s){if("GA94"===String.fromCharCode(e[t+3],e[t+4],e[t+5],e[t+6])){i.payloadType=s,i.payloadSize=n,i.payload=e.subarray(t,t+n);break}i.payload=void 0;}t+=n,s=0,n=0;}return i},parseUserData:function(e){return 181!==e.payload[0]||49!=(e.payload[1]<<8|e.payload[2])||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},parseCaptionPackets:function(e,t){var i,s,n,r,a=[];if(!(64&t[0]))return a;for(s=31&t[0],i=0;i<s;i++)r={type:3&t[(n=3*i)+2],pts:e},4&t[n+2]&&(r.ccData=t[n+3]<<8|t[n+4],a.push(r));return a},discardEmulationPreventionBytes:function(e){for(var t,i,s=e.byteLength,n=[],r=1;r<s-2;)0===e[r]&&0===e[r+1]&&3===e[r+2]?(n.push(r+2),r+=2):r++;if(0===n.length)return e;t=s-n.length,i=new Uint8Array(t);var a=0;for(r=0;r<t;a++,r++)a===n[0]&&(a++,n.shift()),i[r]=e[a];return i},USER_DATA_REGISTERED_ITU_T_T35:4},me=H,ge=pe,fe=function(e){e=e||{},fe.prototype.init.call(this),this.parse708captions_="boolean"!=typeof e.parse708captions||e.parse708captions,this.captionPackets_=[],this.ccStreams_=[new we(0,0),new we(0,1),new we(1,0),new we(1,1)],this.parse708captions_&&(this.cc708Stream_=new be({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")));};fe.prototype=new me,fe.prototype.push=function(e){var t,i,s;if("sei_rbsp"===e.nalUnitType&&(t=ge.parseSei(e.escapedRBSP)).payload&&t.payloadType===ge.USER_DATA_REGISTERED_ITU_T_T35&&(i=ge.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));s=ge.parseCaptionPackets(e.pts,i),this.captionPackets_=this.captionPackets_.concat(s),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts;}},fe.prototype.flushCCStreams=function(e){this.ccStreams_.forEach((function(t){return "flush"===e?t.flush():t.partialFlush()}),this);},fe.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);},fe.prototype.flush=function(){return this.flushStream("flush")},fe.prototype.partialFlush=function(){return this.flushStream("partialFlush")},fe.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach((function(e){e.reset();}));},fe.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);},fe.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},fe.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)},fe.prototype.setsTextOrXDSActive=function(e){return 256==(28928&e.ccData)||4138==(30974&e.ccData)||6186==(30974&e.ccData)},fe.prototype.dispatchCea708Packet=function(e){this.parse708captions_&&this.cc708Stream_.push(e);};var _e={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},ye=function(e){return 32<=e&&e<=127||160<=e&&e<=255},Te=function(e){this.windowNum=e,this.reset();};Te.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;},Te.prototype.getText=function(){return this.rows.join("\n")},Te.prototype.clearText=function(){this.rows=[""],this.rowIdx=0;},Te.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--;},Te.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},Te.prototype.addText=function(e){this.rows[this.rowIdx]+=e;},Te.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1);}};var ve=function(e,t,i){this.serviceNum=e,this.text="",this.currentWindow=new Te(-1),this.windows=[],this.stream=i,"string"==typeof t&&this.createTextDecoder(t);};ve.prototype.init=function(e,t){this.startPts=e;for(var i=0;i<8;i++)this.windows[i]=new Te(i),"function"==typeof t&&(this.windows[i].beforeRowOverflow=t);},ve.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e];},ve.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 be=function(e){e=e||{},be.prototype.init.call(this);var t,i=this,s=e.captionServices||{},n={};Object.keys(s).forEach((e=>{t=s[e],/^SERVICE/.test(e)&&(n[e]=t.encoding);})),this.serviceEncodings=n,this.current708Packet=null,this.services={},this.push=function(e){3===e.type?(i.new708Packet(),i.add708Bytes(e)):(null===i.current708Packet&&i.new708Packet(),i.add708Bytes(e));};};be.prototype=new me,be.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]};},be.prototype.add708Bytes=function(e){var t=e.ccData,i=t>>>8,s=255&t;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(i),this.current708Packet.data.push(s);},be.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,i=null,s=null,n=0,r=t[n++];for(e.seq=r>>6,e.sizeCode=63&r;n<t.length;n++)s=31&(r=t[n++]),7===(i=r>>5)&&s>0&&(i=r=t[n++]),this.pushServiceBlock(i,n,s),s>0&&(n+=s-1);},be.prototype.pushServiceBlock=function(e,t,i){var s,n=t,r=this.current708Packet.data,a=this.services[e];for(a||(a=this.initService(e,n));n<t+i&&n<r.length;n++)s=r[n],ye(s)?n=this.handleText(n,a):24===s?n=this.multiByteCharacter(n,a):16===s?n=this.extendedCommands(n,a):128<=s&&s<=135?n=this.setCurrentWindow(n,a):152<=s&&s<=159?n=this.defineWindow(n,a):136===s?n=this.clearWindows(n,a):140===s?n=this.deleteWindows(n,a):137===s?n=this.displayWindows(n,a):138===s?n=this.hideWindows(n,a):139===s?n=this.toggleWindows(n,a):151===s?n=this.setWindowAttributes(n,a):144===s?n=this.setPenAttributes(n,a):145===s?n=this.setPenColor(n,a):146===s?n=this.setPenLocation(n,a):143===s?a=this.reset(n,a):8===s?a.currentWindow.backspace():12===s?a.currentWindow.clearText():13===s?a.currentWindow.pendingNewLine=!0:14===s?a.currentWindow.clearText():141===s&&n++;},be.prototype.extendedCommands=function(e,t){var i=this.current708Packet.data[++e];return ye(i)&&(e=this.handleText(e,t,{isExtended:!0})),e},be.prototype.getPts=function(e){return this.current708Packet.ptsVals[Math.floor(e/2)]},be.prototype.initService=function(e,t){var i,s,n=this;return (i="SERVICE"+e)in this.serviceEncodings&&(s=this.serviceEncodings[i]),this.services[e]=new ve(e,s,n),this.services[e].init(this.getPts(t),(function(t){n.flushDisplayed(t,n.services[e]);})),this.services[e]},be.prototype.handleText=function(e,t,i){var s,n,r,a,o=i&&i.isExtended,l=i&&i.isMultiByte,d=this.current708Packet.data,h=o?4096:0,u=d[e],c=d[e+1],p=t.currentWindow;return t.textDecoder_&&!o?(l?(n=[u,c],e++):n=[u],s=t.textDecoder_.decode(new Uint8Array(n))):(a=_e[r=h|u]||r,s=4096&r&&r===a?"":String.fromCharCode(a)),p.pendingNewLine&&!p.isEmpty()&&p.newLine(this.getPts(e)),p.pendingNewLine=!1,p.addText(s),e},be.prototype.multiByteCharacter=function(e,t){var i=this.current708Packet.data,s=i[e+1],n=i[e+2];return ye(s)&&ye(n)&&(e=this.handleText(++e,t,{isMultiByte:!0})),e},be.prototype.setCurrentWindow=function(e,t){var i=7&this.current708Packet.data[e];return t.setCurrentWindow(i),e},be.prototype.defineWindow=function(e,t){var i=this.current708Packet.data,s=i[e],n=7&s;t.setCurrentWindow(n);var r=t.currentWindow;return s=i[++e],r.visible=(32&s)>>5,r.rowLock=(16&s)>>4,r.columnLock=(8&s)>>3,r.priority=7&s,s=i[++e],r.relativePositioning=(128&s)>>7,r.anchorVertical=127&s,s=i[++e],r.anchorHorizontal=s,s=i[++e],r.anchorPoint=(240&s)>>4,r.rowCount=15&s,s=i[++e],r.columnCount=63&s,s=i[++e],r.windowStyle=(56&s)>>3,r.penStyle=7&s,r.virtualRowCount=r.rowCount+1,e},be.prototype.setWindowAttributes=function(e,t){var i=this.current708Packet.data,s=i[e],n=t.currentWindow.winAttr;return s=i[++e],n.fillOpacity=(192&s)>>6,n.fillRed=(48&s)>>4,n.fillGreen=(12&s)>>2,n.fillBlue=3&s,s=i[++e],n.borderType=(192&s)>>6,n.borderRed=(48&s)>>4,n.borderGreen=(12&s)>>2,n.borderBlue=3&s,s=i[++e],n.borderType+=(128&s)>>5,n.wordWrap=(64&s)>>6,n.printDirection=(48&s)>>4,n.scrollDirection=(12&s)>>2,n.justify=3&s,s=i[++e],n.effectSpeed=(240&s)>>4,n.effectDirection=(12&s)>>2,n.displayEffect=3&s,e},be.prototype.flushDisplayed=function(e,t){for(var i=[],s=0;s<8;s++)t.windows[s].visible&&!t.windows[s].isEmpty()&&i.push(t.windows[s].getText());t.endPts=e,t.text=i.join("\n\n"),this.pushCaption(t),t.startPts=e;},be.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);},be.prototype.displayWindows=function(e,t){var i=this.current708Packet.data[++e],s=this.getPts(e);this.flushDisplayed(s,t);for(var n=0;n<8;n++)i&1<<n&&(t.windows[n].visible=1);return e},be.prototype.hideWindows=function(e,t){var i=this.current708Packet.data[++e],s=this.getPts(e);this.flushDisplayed(s,t);for(var n=0;n<8;n++)i&1<<n&&(t.windows[n].visible=0);return e},be.prototype.toggleWindows=function(e,t){var i=this.current708Packet.data[++e],s=this.getPts(e);this.flushDisplayed(s,t);for(var n=0;n<8;n++)i&1<<n&&(t.windows[n].visible^=1);return e},be.prototype.clearWindows=function(e,t){var i=this.current708Packet.data[++e],s=this.getPts(e);this.flushDisplayed(s,t);for(var n=0;n<8;n++)i&1<<n&&t.windows[n].clearText();return e},be.prototype.deleteWindows=function(e,t){var i=this.current708Packet.data[++e],s=this.getPts(e);this.flushDisplayed(s,t);for(var n=0;n<8;n++)i&1<<n&&t.windows[n].reset();return e},be.prototype.setPenAttributes=function(e,t){var i=this.current708Packet.data,s=i[e],n=t.currentWindow.penAttr;return s=i[++e],n.textTag=(240&s)>>4,n.offset=(12&s)>>2,n.penSize=3&s,s=i[++e],n.italics=(128&s)>>7,n.underline=(64&s)>>6,n.edgeType=(56&s)>>3,n.fontStyle=7&s,e},be.prototype.setPenColor=function(e,t){var i=this.current708Packet.data,s=i[e],n=t.currentWindow.penColor;return s=i[++e],n.fgOpacity=(192&s)>>6,n.fgRed=(48&s)>>4,n.fgGreen=(12&s)>>2,n.fgBlue=3&s,s=i[++e],n.bgOpacity=(192&s)>>6,n.bgRed=(48&s)>>4,n.bgGreen=(12&s)>>2,n.bgBlue=3&s,s=i[++e],n.edgeRed=(48&s)>>4,n.edgeGreen=(12&s)>>2,n.edgeBlue=3&s,e},be.prototype.setPenLocation=function(e,t){var i=this.current708Packet.data,s=i[e],n=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,s=i[++e],n.row=15&s,s=i[++e],n.column=63&s,e},be.prototype.reset=function(e,t){var i=this.getPts(e);return this.flushDisplayed(i,t),this.initService(t.serviceNum,e)};var Se={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},Ce=function(e){return null===e?"":(e=Se[e]||e,String.fromCharCode(e))},ke=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Ee=function(){for(var e=[],t=15;t--;)e.push("");return e},we=function(e,t){we.prototype.init.call(this),this.field_=e||0,this.dataChannel_=t||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,i,s,n,r;if((t=32639&e.ccData)!==this.lastControlCode_){if(4096==(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),s=t>>>8,n=255&t,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(t===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(t===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=Ee();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Ee();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=Ee()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(s,n))r=Ce((s=(3&s)<<8)|n),this[this.mode_](e.pts,r),this.column_++;else if(this.isExtCharacter(s,n))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),r=Ce((s=(3&s)<<8)|n),this[this.mode_](e.pts,r),this.column_++;else if(this.isMidRowCode(s,n))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14==(14&n)&&this.addFormatting(e.pts,["i"]),1==(1&n)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(s,n))this.column_+=3&n;else if(this.isPAC(s,n)){var a=ke.indexOf(7968&t);"rollUp"===this.mode_&&(a-this.rollUpRows_+1<0&&(a=this.rollUpRows_-1),this.setRollUp(e.pts,a)),a!==this.row_&&(this.clearFormatting(e.pts),this.row_=a),1&n&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16==(16&t)&&(this.column_=4*((14&t)>>1)),this.isColorPAC(n)&&14==(14&n)&&this.addFormatting(e.pts,["i"]);}else this.isNormalChar(s)&&(0===n&&(n=null),r=Ce(s),r+=Ce(n),this[this.mode_](e.pts,r),this.column_+=r.length);}else this.lastControlCode_=null;};};we.prototype=new me,we.prototype.flushDisplayed=function(e){var t=this.displayed_.map((function(e,t){try{return e.trim()}catch(e){return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+t+"."}),""}}),this).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_});},we.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Ee(),this.nonDisplayed_=Ee(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[];},we.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_;},we.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},we.prototype.isExtCharacter=function(e,t){return (e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},we.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},we.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},we.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},we.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},we.prototype.isNormalChar=function(e){return e>=32&&e<=127},we.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=Ee(),this.displayed_=Ee()),void 0!==t&&t!==this.row_)for(var i=0;i<this.rollUpRows_;i++)this.displayed_[t-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]="";void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1;},we.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);},we.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);}},we.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_];i+=t,this.nonDisplayed_[this.row_]=i;},we.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_];i+=t,this.displayed_[this.row_]=i;},we.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++)this.displayed_[e]="";for(e=this.row_+1;e<15;e++)this.displayed_[e]="";for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]="";},we.prototype.paintOn=function(e,t){var i=this.displayed_[this.row_];i+=t,this.displayed_[this.row_]=i;};var Ie={CaptionStream:fe,Cea608Stream:we,Cea708Stream:be},xe={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Ae=H,Pe="shared",Le=function(e,t){var i=1;for(e>t&&(i=-1);Math.abs(t-e)>4294967296;)e+=8589934592*i;return e},Oe=function(e){var t,i;Oe.prototype.init.call(this),this.type_=e||Pe,this.push=function(e){this.type_!==Pe&&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.flush=function(){i=t,this.trigger("done");},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline");},this.discontinuity=function(){i=void 0,t=void 0;},this.reset=function(){this.discontinuity(),this.trigger("reset");};};Oe.prototype=new Ae;var De,Me={TimestampRolloverStream:Oe,handleRollover:Le},Re=(e,t,i)=>{if(!e)return -1;for(var s=i;s<e.length;s++)if(e[s]===t)return s;return -1},Ue=xe,$e=Re,Be=3,Ne=function(e,t,i){var s,n="";for(s=t;s<i;s++)n+="%"+("00"+e[s].toString(16)).slice(-2);return n},Fe=function(e,t,i){return decodeURIComponent(Ne(e,t,i))},je=function(e,t,i){return unescape(Ne(e,t,i))},He=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},Ve={APIC:function(e){var t,i,s=1;e.data[0]===Be&&((t=$e(e.data,0,s))<0||(e.mimeType=je(e.data,s,t),s=t+1,e.pictureType=e.data[s],s++,(i=$e(e.data,0,s))<0||(e.description=Fe(e.data,s,i),s=i+1,"--\x3e"===e.mimeType?e.url=je(e.data,s,e.data.length):e.pictureData=e.data.subarray(s,e.data.length))));},"T*":function(e){e.data[0]===Be&&(e.value=Fe(e.data,1,e.data.length).replace(/\0*$/,""),e.values=e.value.split("\0"));},TXXX:function(e){var t;e.data[0]===Be&&-1!==(t=$e(e.data,0,1))&&(e.description=Fe(e.data,1,t),e.value=Fe(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]===Be&&-1!==(t=$e(e.data,0,1))&&(e.description=Fe(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;}};(De=function(e){var t,i={descriptor:e&&e.descriptor},s=0,n=[],r=0;if(De.prototype.init.call(this),this.dispatchType=Ue.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,n.length=0),0===n.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(n.push(e),r+=e.data.byteLength,1===n.length&&(s=He(e.data.subarray(6,10)),s+=10),!(r<s)){for(t={data:new Uint8Array(s),frames:[],pts:n[0].pts,dts:n[0].dts},l=0;l<s;)t.data.set(n[0].data.subarray(0,s-l),l),l+=n[0].data.byteLength,r-=n[0].data.byteLength,n.shift();i=10,64&t.data[5]&&(i+=4,i+=He(t.data.subarray(10,14)),s-=He(t.data.subarray(16,20)));do{if((a=He(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,Ve[o.id]?Ve[o.id](o):"T"===o.id[0]?Ve["T*"](o):"W"===o.id[0]&&Ve["W*"](o),"com.apple.streaming.transportStreamTimestamp"===o.owner){var d=o.data,h=(1&d[3])<<30|d[4]<<22|d[5]<<14|d[6]<<6|d[7]>>>2;h*=4,h+=3&d[7],o.timeStamp=h,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<s);this.trigger("data",t);}};}).prototype=new H;var qe,We,Ge,Ke=De,ze=H,Qe=Ie,Ye=xe,Xe=Me.TimestampRolloverStream,Je=188;(qe=function(){var e=new Uint8Array(Je),t=0;qe.prototype.init.call(this),this.push=function(i){var s,n=0,r=Je;for(t?((s=new Uint8Array(i.byteLength+t)).set(e.subarray(0,t)),s.set(i,t),t=0):s=i;r<s.byteLength;)71!==s[n]||71!==s[r]?(n++,r++):(this.trigger("data",s.subarray(n,r)),n+=Je,r+=Je);n<s.byteLength&&(e.set(s.subarray(n),0),t=s.byteLength-n);},this.flush=function(){t===Je&&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 ze,We=function(){var e,t,i,s;We.prototype.init.call(this),s=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,s){var n=0;s.payloadUnitStartIndicator&&(n+=e[n]+1),"pat"===s.type?t(e.subarray(n),s):i(e.subarray(n),s);},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],s.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=s.pmtPid;},i=function(e,t){var i,n;if(1&e[5]){for(s.programMapTable={video:null,audio:null,"timed-metadata":{}},i=3+((15&e[1])<<8|e[2])-4,n=12+((15&e[10])<<8|e[11]);n<i;){var r=e[n],a=(31&e[n+1])<<8|e[n+2];r===Ye.H264_STREAM_TYPE&&null===s.programMapTable.video?s.programMapTable.video=a:r===Ye.ADTS_STREAM_TYPE&&null===s.programMapTable.audio?s.programMapTable.audio=a:r===Ye.METADATA_STREAM_TYPE&&(s.programMapTable["timed-metadata"][a]=r),n+=5+((15&e[n+3])<<8|e[n+4]);}t.programMapTable=s.programMapTable;}},this.push=function(t){var i={},s=4;if(i.payloadUnitStartIndicator=!!(64&t[1]),i.pid=31&t[1],i.pid<<=8,i.pid|=t[2],(48&t[3])>>>4>1&&(s+=t[s]+1),0===i.pid)i.type="pat",e(t.subarray(s),i),this.trigger("data",i);else if(i.pid===this.pmtPid)for(i.type="pmt",e(t.subarray(s),i),this.trigger("data",i);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,s,i]):this.processPes_(t,s,i);},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=Ye.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=Ye.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i);};},We.prototype=new ze,We.STREAM_TYPES={h264:27,adts:15},Ge=function(){var e,t=this,i=!1,s={data:[],size:0},n={data:[],size:0},r={data:[],size:0},a=function(e,i,s){var n,r,a=new Uint8Array(e.size),o={type:i},l=0,d=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,d),d+=r.data.byteLength;!function(e,t){var i;const s=e[0]<<16|e[1]<<8|e[2];t.data=new Uint8Array,1===s&&(t.packetLength=6+(e[4]<<8|e[5]),t.dataAlignmentIndicator=0!=(4&e[6]),192&(i=e[7])&&(t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&i&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1)),t.data=e.subarray(9+e[8]));}(a,o),n="video"===i||o.packetLength<=e.size,(s||n)&&(e.size=0,e.data.length=0),n&&t.trigger("data",o);}};Ge.prototype.init.call(this),this.push=function(o){({pat:function(){},pes:function(){var e,t;switch(o.streamType){case Ye.H264_STREAM_TYPE:e=s,t="video";break;case Ye.ADTS_STREAM_TYPE:e=n,t="audio";break;case Ye.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 s={type:"metadata",tracks:[]};null!==(e=o.programMapTable).video&&s.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&s.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),i=!0,t.trigger("data",s);}})[o.type]();},this.reset=function(){s.size=0,s.data.length=0,n.size=0,n.data.length=0,this.trigger("reset");},this.flushStreams_=function(){a(s,"video"),a(n,"audio"),a(r,"timed-metadata");},this.flush=function(){if(!i&&e){var s={type:"metadata",tracks:[]};null!==e.video&&s.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&s.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),t.trigger("data",s);}i=!1,this.flushStreams_(),this.trigger("done");};},Ge.prototype=new ze;var Ze={PAT_PID:0,MP2T_PACKET_LENGTH:Je,TransportPacketStream:qe,TransportParseStream:We,ElementaryStream:Ge,TimestampRolloverStream:Xe,CaptionStream:Qe.CaptionStream,Cea608Stream:Qe.Cea608Stream,Cea708Stream:Qe.Cea708Stream,MetadataStream:Ke};for(var et in Ye)Ye.hasOwnProperty(et)&&(Ze[et]=Ye[et]);var tt,it=Ze,st=oe.ONE_SECOND_IN_TS,nt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];(tt=function(e){var t,i=0;tt.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(s){var n,r,a,o,l,d=0;if(e||(i=0),"audio"===s.type){var h;for(t&&t.length?(a=t,(t=new Uint8Array(a.byteLength+s.data.byteLength)).set(a),t.set(s.data,a.byteLength)):t=s.data;d+7<t.length;)if(255===t[d]&&240==(246&t[d+1])){if("number"==typeof h&&(this.skipWarn_(h,d),h=null),r=2*(1&~t[d+1]),n=(3&t[d+3])<<11|t[d+4]<<3|(224&t[d+5])>>5,l=(o=1024*(1+(3&t[d+6])))*st/nt[(60&t[d+2])>>>2],t.byteLength-d<n)break;this.trigger("data",{pts:s.pts+i*l,dts:s.dts+i*l,sampleCount:o,audioobjecttype:1+(t[d+2]>>>6&3),channelcount:(1&t[d+2])<<2|(192&t[d+3])>>>6,samplerate:nt[(60&t[d+2])>>>2],samplingfrequencyindex:(60&t[d+2])>>>2,samplesize:16,data:t.subarray(d+7+r,d+n)}),i++,d+=n;}else "number"!=typeof h&&(h=d),d++;"number"==typeof h&&(this.skipWarn_(h,d),h=null),t=t.subarray(d);}},this.flush=function(){i=0,this.trigger("done");},this.reset=function(){t=void 0,this.trigger("reset");},this.endTimeline=function(){t=void 0,this.trigger("endedtimeline");};}).prototype=new H;var rt,at,ot,lt=tt,dt=H,ht=function(e){var t=e.byteLength,i=0,s=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+s},this.loadWord=function(){var n=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(n,n+a)),i=new DataView(r.buffer).getUint32(0),s=8*a,t-=a;},this.skipBits=function(e){var n;s>e?(i<<=e,s-=e):(e-=s,e-=8*(n=Math.floor(e/8)),t-=n,this.loadWord(),i<<=e,s-=e);},this.readBits=function(e){var n=Math.min(s,e),r=i>>>32-n;return (s-=n)>0?i<<=n:t>0&&this.loadWord(),(n=e-n)>0?r<<n|this.readBits(n):r},this.skipLeadingZeros=function(){var e;for(e=0;e<s;++e)if(0!=(i&2147483648>>>e))return i<<=e,s-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros());},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros());},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord();};(at=function(){var e,t,i=0;at.prototype.init.call(this),this.push=function(s){var n;t?((n=new Uint8Array(t.byteLength+s.data.byteLength)).set(t),n.set(s.data,t.byteLength),t=n):t=s.data;for(var r=t.byteLength;i<r-3;i++)if(1===t[i+2]){e=i+5;break}for(;e<r;)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}i+3!==e-2&&this.trigger("data",t.subarray(i+3,e-2));do{e++;}while(1!==t[e]&&e<r);i=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(i+3,e-2)),i=e-2,e+=3;break;default:e+=3;}t=t.subarray(i),e-=i,i=0;},this.reset=function(){t=null,i=0,this.trigger("reset");},this.flush=function(){t&&t.byteLength>3&&this.trigger("data",t.subarray(i+3)),t=null,i=0,this.trigger("done");},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline");};}).prototype=new dt,ot={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},rt=function(){var e,t,i,s,n,r,a,o=new at;rt.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,i=e.pts,s=e.dts,o.push(e));},o.on("data",(function(a){var o={trackId:t,pts:i,dts:s,data:a,nalUnitTypeCode:31&a[0]};switch(o.nalUnitTypeCode){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=n(a.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=n(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,s=8,n=8;for(i=0;i<e;i++)0!==n&&(n=(s+t.readExpGolomb()+256)%256),s=0===n?s:n;},n=function(e){for(var t,i,s=e.byteLength,n=[],r=1;r<s-2;)0===e[r]&&0===e[r+1]&&3===e[r+2]?(n.push(r+2),r+=2):r++;if(0===n.length)return e;t=s-n.length,i=new Uint8Array(t);var a=0;for(r=0;r<t;a++,r++)a===n[0]&&(a++,n.shift()),i[r]=e[a];return i},r=function(e){var t,i,s,n,r,o,l,d,h,u,c,p,m=0,g=0,f=0,_=0,y=[1,1];if(i=(t=new ht(e)).readUnsignedByte(),n=t.readUnsignedByte(),s=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),ot[i]&&(3===(r=t.readUnsignedExpGolomb())&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(c=3!==r?8:12,p=0;p<c;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),d=t.readUnsignedExpGolomb(),h=t.readUnsignedExpGolomb(),0===(u=t.readBits(1))&&t.skipBits(1),t.skipBits(1),t.readBoolean()&&(m=t.readUnsignedExpGolomb(),g=t.readUnsignedExpGolomb(),f=t.readUnsignedExpGolomb(),_=t.readUnsignedExpGolomb()),t.readBoolean()&&t.readBoolean()){switch(t.readUnsignedByte()){case 1:y=[1,1];break;case 2:y=[12,11];break;case 3:y=[10,11];break;case 4:y=[16,11];break;case 5:y=[40,33];break;case 6:y=[24,11];break;case 7:y=[20,11];break;case 8:y=[32,11];break;case 9:y=[80,33];break;case 10:y=[18,11];break;case 11:y=[15,11];break;case 12:y=[64,33];break;case 13:y=[160,99];break;case 14:y=[4,3];break;case 15:y=[3,2];break;case 16:y=[2,1];break;case 255:y=[t.readUnsignedByte()<<8|t.readUnsignedByte(),t.readUnsignedByte()<<8|t.readUnsignedByte()];}y&&(y[0],y[1]);}return {profileIdc:i,levelIdc:s,profileCompatibility:n,width:16*(d+1)-2*m-2*g,height:(2-u)*(h+1)*16-2*f-2*_,sarRatio:y}};},rt.prototype=new dt;var ut,ct={H264Stream:rt,NalByteStream:at},pt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],mt=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},gt=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+=mt(e,t),gt(e,t))},ft=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},_t={isLikelyAacData:function(e){var t=gt(e,0);return e.length>=t+2&&255==(255&e[t])&&240==(240&e[t+1])&&16==(22&e[t+1])},parseId3TagSize:mt,parseAdtsSize:function(e,t){var i=(224&e[t+5])>>5,s=e[t+4]<<3;return 6144&e[t+3]|s|i},parseType:function(e,t){return e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)?"timed-metadata":!0&e[t]&&240==(240&e[t+1])?"audio":null},parseSampleRate:function(e){for(var t=0;t+5<e.length;){if(255===e[t]&&240==(246&e[t+1]))return pt[(60&e[t+2])>>>2];t++;}return null},parseAacTimestamp:function(e){var t,i,s;t=10,64&e[5]&&(t+=4,t+=ft(e.subarray(10,14)));do{if((i=ft(e.subarray(t+4,t+8)))<1)return null;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){s=e.subarray(t+10,t+i+10);for(var n=0;n<s.byteLength;n++)if(0===s[n]){var r=unescape(function(e,t,i){var s,n="";for(s=t;s<i;s++)n+="%"+("00"+e[s].toString(16)).slice(-2);return n}(s,0,n));if("com.apple.streaming.transportStreamTimestamp"===r){var a=s.subarray(n+1),o=(1&a[3])<<30|a[4]<<22|a[5]<<14|a[6]<<6|a[7]>>>2;return o*=4,o+=3&a[7]}break}}t+=10,t+=i;}while(t<e.byteLength);return null}},yt=_t;(ut=function(){var e=new Uint8Array,t=0;ut.prototype.init.call(this),this.setTimestamp=function(e){t=e;},this.push=function(i){var s,n,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!=(255&e[l])||240!=(240&e[l+1]))l++;else {if(e.length-l<7)break;if(l+(o=yt.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=yt.parseId3TagSize(e,l))>e.length)break;n={type:"timed-metadata",data:e.subarray(l,l+o)},this.trigger("data",n),l+=o;}s=e.length-l,e=s>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 H;var Tt,vt,bt,St,Ct=H,kt=ee,Et=ie,wt=he,It=ce,xt=it,At=oe,Pt=lt,Lt=ct.H264Stream,Ot=ut,Dt=_t.isLikelyAacData,Mt=oe.ONE_SECOND_IN_TS,Rt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Ut=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],$t=function(e,t){t.stream=e,this.trigger("log",t);},Bt=function(e,t){for(var i=Object.keys(t),s=0;s<i.length;s++){var n=i[s];"headOfPipeline"!==n&&t[n].on&&t[n].on("log",$t.bind(e,n));}},Nt=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},Ft=function(e,t,i,s,n,r){return {start:{dts:e,pts:e+(i-t)},end:{dts:e+(s-t),pts:e+(n-i)},prependedContentDuration:r,baseMediaDecodeTime:e}};vt=function(e,t){var i,s=[],n=0,r=0,a=1/0;i=(t=t||{}).firstSequenceNumber||0,vt.prototype.init.call(this),this.push=function(t){It.collectDtsInfo(e,t),e&&Rt.forEach((function(i){e[i]=t[i];})),s.push(t);},this.setEarliestDts=function(e){n=e;},this.setVideoBaseMediaDecodeTime=function(e){a=e;},this.setAudioAppendStart=function(e){r=e;},this.flush=function(){var o,l,d,h,u,c,p;0!==s.length?(o=wt.trimAdtsFramesByEarliestDts(s,e,n),e.baseMediaDecodeTime=It.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),p=wt.prefixWithSilence(e,o,r,a),e.samples=wt.generateSampleTable(o),d=kt.mdat(wt.concatenateFrameData(o)),s=[],l=kt.moof(i,[e]),h=new Uint8Array(l.byteLength+d.byteLength),i++,h.set(l),h.set(d,l.byteLength),It.clearDtsInfo(e),u=Math.ceil(1024*Mt/e.samplerate),o.length&&(c=o.length*u,this.trigger("segmentTimingInfo",Ft(At.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),o[0].dts,o[0].pts,o[0].dts+c,o[0].pts+c,p||0)),this.trigger("timingInfo",{start:o[0].pts,end:o[0].pts+c})),this.trigger("data",{track:e,boxes:h}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream");},this.reset=function(){It.clearDtsInfo(e),s=[],this.trigger("reset");};},vt.prototype=new Ct,Tt=function(e,t){var i,s,n,r=[],a=[];i=(t=t||{}).firstSequenceNumber||0,Tt.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){It.collectDtsInfo(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||s||(s=t.config,e.sps=[t.data],Ut.forEach((function(t){e[t]=s[t];}),this)),"pic_parameter_set_rbsp"!==t.nalUnitType||n||(n=t.data,e.pps=[t.data]),r.push(t);},this.flush=function(){for(var s,n,o,l,d,h,u,c,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(s=Et.groupNalsIntoFrames(r),(o=Et.groupFramesIntoGops(s))[0][0].keyFrame||((n=this.getGopForFusion_(r[0],e))?(p=n.duration,o.unshift(n),o.byteLength+=n.byteLength,o.nalCount+=n.nalCount,o.pts=n.pts,o.dts=n.dts,o.duration+=n.duration):o=Et.extendFirstKeyFrame(o)),a.length){var m;if(!(m=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");It.clearDtsInfo(e),o=m;}It.collectDtsInfo(e,o),e.samples=Et.generateSampleTable(o),d=kt.mdat(Et.concatenateNalData(o)),e.baseMediaDecodeTime=It.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",o.map((function(e){return {pts:e.pts,dts:e.dts,byteLength:e.byteLength}}))),u=o[0],c=o[o.length-1],this.trigger("segmentTimingInfo",Ft(e.baseMediaDecodeTime,u.dts,u.pts,c.dts+c.duration,c.pts+c.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=kt.moof(i,[e]),h=new Uint8Array(l.byteLength+d.byteLength),i++,h.set(l),h.set(d,l.byteLength),this.trigger("data",{track:e,boxes:h}),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(){It.clearDtsInfo(e),s=void 0,n=void 0;},this.getGopForFusion_=function(t){var i,s,n,r,a,o=1/0;for(a=0;a<this.gopCache_.length;a++)n=(r=this.gopCache_[a]).gop,e.pps&&Nt(e.pps[0],r.pps[0])&&e.sps&&Nt(e.sps[0],r.sps[0])&&(n.dts<e.timelineStartInfo.dts||(i=t.dts-n.dts-n.duration)>=-1e4&&i<=45e3&&(!s||o>i)&&(s=r,o=i));return s?s.gop:null},this.alignGopsAtStart_=function(e){var t,i,s,n,r,o,l,d;for(r=e.byteLength,o=e.nalCount,l=e.duration,t=i=0;t<a.length&&i<e.length&&(s=a[t],n=e[i],s.pts!==n.pts);)n.pts>s.pts?t++:(i++,r-=n.byteLength,o-=n.nalCount,l-=n.duration);return 0===i?e:i===e.length?null:((d=e.slice(i)).byteLength=r,d.duration=l,d.nalCount=o,d.pts=d[0].pts,d.dts=d[0].dts,d)},this.alignGopsAtEnd_=function(e){var t,i,s,n,r,o,l;for(t=a.length-1,i=e.length-1,r=null,o=!1;t>=0&&i>=0;){if(s=a[t],n=e[i],s.pts===n.pts){o=!0;break}s.pts>n.pts?t--:(t===a.length-1&&(r=i),i--);}if(!o&&null===r)return null;if(0===(l=o?i:r))return e;var d=e.slice(l),h=d.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 d.byteLength=h.byteLength,d.duration=h.duration,d.nalCount=h.nalCount,d.pts=d[0].pts,d.dts=d[0].dts,d},this.alignGopsWith=function(e){a=e;};},Tt.prototype=new Ct,St=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,St.prototype.init.call(this),this.push=function(e){return e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),void("audio"===e.track.type&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes))))};},St.prototype=new Ct,St.prototype.flush=function(e){var t,i,s,n,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,Ut.forEach((function(e){a.info[e]=this.videoTrack[e];}),this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,Rt.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,s=kt.initSegment(this.pendingTracks),a.initSegment=new Uint8Array(s.byteLength),a.initSegment.set(s),a.data=new Uint8Array(this.pendingBytes),n=0;n<this.pendingBoxes.length;n++)a.data.set(this.pendingBoxes[n],r),r+=this.pendingBoxes[n].byteLength;for(n=0;n<this.pendingCaptions.length;n++)(t=this.pendingCaptions[n]).startTime=At.metadataTsToSeconds(t.startPts,o,this.keepOriginalTimestamps),t.endTime=At.metadataTsToSeconds(t.endPts,o,this.keepOriginalTimestamps),a.captionStreams[t.stream]=!0,a.captions.push(t);for(n=0;n<this.pendingMetadata.length;n++)(i=this.pendingMetadata[n]).cueTime=At.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),n=0;n<a.captions.length;n++)t=a.captions[n],this.trigger("caption",t);for(n=0;n<a.metadata.length;n++)i=a.metadata[n],this.trigger("id3Frame",i);}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);},St.prototype.setRemux=function(e){this.remuxTracks=e;},(bt=function(e){var t,i,s=this,n=!0;bt.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var n={};this.transmuxPipeline_=n,n.type="aac",n.metadataStream=new xt.MetadataStream,n.aacStream=new Ot,n.audioTimestampRolloverStream=new xt.TimestampRolloverStream("audio"),n.timedMetadataTimestampRolloverStream=new xt.TimestampRolloverStream("timed-metadata"),n.adtsStream=new Pt,n.coalesceStream=new St(e,n.metadataStream),n.headOfPipeline=n.aacStream,n.aacStream.pipe(n.audioTimestampRolloverStream).pipe(n.adtsStream),n.aacStream.pipe(n.timedMetadataTimestampRolloverStream).pipe(n.metadataStream).pipe(n.coalesceStream),n.metadataStream.on("timestamp",(function(e){n.aacStream.setTimestamp(e.timeStamp);})),n.aacStream.on("data",(function(r){"timed-metadata"!==r.type&&"audio"!==r.type||n.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:s.baseMediaDecodeTime},codec:"adts",type:"audio"},n.coalesceStream.numberOfTracks++,n.audioSegmentStream=new vt(i,e),n.audioSegmentStream.on("log",s.getLogTrigger_("audioSegmentStream")),n.audioSegmentStream.on("timingInfo",s.trigger.bind(s,"audioTimingInfo")),n.adtsStream.pipe(n.audioSegmentStream).pipe(n.coalesceStream),s.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t}));})),n.coalesceStream.on("data",this.trigger.bind(this,"data")),n.coalesceStream.on("done",this.trigger.bind(this,"done")),Bt(this,n);},this.setupTsPipeline=function(){var n={};this.transmuxPipeline_=n,n.type="ts",n.metadataStream=new xt.MetadataStream,n.packetStream=new xt.TransportPacketStream,n.parseStream=new xt.TransportParseStream,n.elementaryStream=new xt.ElementaryStream,n.timestampRolloverStream=new xt.TimestampRolloverStream,n.adtsStream=new Pt,n.h264Stream=new Lt,n.captionStream=new xt.CaptionStream(e),n.coalesceStream=new St(e,n.metadataStream),n.headOfPipeline=n.packetStream,n.packetStream.pipe(n.parseStream).pipe(n.elementaryStream).pipe(n.timestampRolloverStream),n.timestampRolloverStream.pipe(n.h264Stream),n.timestampRolloverStream.pipe(n.adtsStream),n.timestampRolloverStream.pipe(n.metadataStream).pipe(n.coalesceStream),n.h264Stream.pipe(n.captionStream).pipe(n.coalesceStream),n.elementaryStream.on("data",(function(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=s.baseMediaDecodeTime):(t=r.tracks[a]).timelineStartInfo.baseMediaDecodeTime=s.baseMediaDecodeTime;t&&!n.videoSegmentStream&&(n.coalesceStream.numberOfTracks++,n.videoSegmentStream=new Tt(t,e),n.videoSegmentStream.on("log",s.getLogTrigger_("videoSegmentStream")),n.videoSegmentStream.on("timelineStartInfo",(function(t){i&&!e.keepOriginalTimestamps&&(i.timelineStartInfo=t,n.audioSegmentStream.setEarliestDts(t.dts-s.baseMediaDecodeTime));})),n.videoSegmentStream.on("processedGopsInfo",s.trigger.bind(s,"gopInfo")),n.videoSegmentStream.on("segmentTimingInfo",s.trigger.bind(s,"videoSegmentTimingInfo")),n.videoSegmentStream.on("baseMediaDecodeTime",(function(e){i&&n.audioSegmentStream.setVideoBaseMediaDecodeTime(e);})),n.videoSegmentStream.on("timingInfo",s.trigger.bind(s,"videoTimingInfo")),n.h264Stream.pipe(n.videoSegmentStream).pipe(n.coalesceStream)),i&&!n.audioSegmentStream&&(n.coalesceStream.numberOfTracks++,n.audioSegmentStream=new vt(i,e),n.audioSegmentStream.on("log",s.getLogTrigger_("audioSegmentStream")),n.audioSegmentStream.on("timingInfo",s.trigger.bind(s,"audioTimingInfo")),n.audioSegmentStream.on("segmentTimingInfo",s.trigger.bind(s,"audioSegmentTimingInfo")),n.adtsStream.pipe(n.audioSegmentStream).pipe(n.coalesceStream)),s.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t});}})),n.coalesceStream.on("data",this.trigger.bind(this,"data")),n.coalesceStream.on("id3Frame",(function(e){e.dispatchType=n.metadataStream.dispatchType,s.trigger("id3Frame",e);})),n.coalesceStream.on("caption",this.trigger.bind(this,"caption")),n.coalesceStream.on("done",this.trigger.bind(this,"done")),Bt(this,n);},this.setBaseMediaDecodeTime=function(s){var n=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=s),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,It.clearDtsInfo(i),n.audioTimestampRolloverStream&&n.audioTimestampRolloverStream.discontinuity()),t&&(n.videoSegmentStream&&(n.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,It.clearDtsInfo(t),n.captionStream.reset()),n.timestampRolloverStream&&n.timestampRolloverStream.discontinuity();},this.setAudioAppendStart=function(e){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e);},this.setRemux=function(t){var i=this.transmuxPipeline_;e.remux=t,i&&i.coalesceStream&&i.coalesceStream.setRemux(t);},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e);},this.getLogTrigger_=function(e){var t=this;return function(i){i.stream=e,t.trigger("log",i);}},this.push=function(e){if(n){var t=Dt(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),n=!1;}this.transmuxPipeline_.headOfPipeline.push(e);},this.flush=function(){n=!0,this.transmuxPipeline_.headOfPipeline.flush();},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline();},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset();},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset();};}).prototype=new Ct;var jt,Ht,Vt,qt,Wt={Transmuxer:bt,VideoSegmentStream:Tt,AudioSegmentStream:vt,AUDIO_PROPERTIES:Rt,VIDEO_PROPERTIES:Ut,generateSegmentTimingInfo:Ft},Gt=function(e){return e>>>0},Kt=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=Gt,Qt=Kt,Yt=function(e,t){var i,s,n,r,a,o=[];if(!t.length)return null;for(i=0;i<e.byteLength;)s=zt(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3]),n=Qt(e.subarray(i+4,i+8)),r=s>1?i+s:e.byteLength,n===t[0]&&(1===t.length?o.push(e.subarray(i+8,r)):(a=Yt(e.subarray(i+8,r),t.slice(1))).length&&(o=o.concat(a))),i=r;return o},Xt=Gt,Jt=q.getUint64,Zt=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4))};return 1===t.version?t.baseMediaDecodeTime=Jt(e.subarray(4)):t.baseMediaDecodeTime=Xt(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),t},ei=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]}},ti=function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},s=new DataView(e.buffer,e.byteOffset,e.byteLength),n=1&i.flags[2],r=4&i.flags[2],a=1&i.flags[1],o=2&i.flags[1],l=4&i.flags[1],d=8&i.flags[1],h=s.getUint32(4),u=8;for(n&&(i.dataOffset=s.getInt32(u),u+=4),r&&h&&(t={flags:ei(e.subarray(u,u+4))},u+=4,a&&(t.duration=s.getUint32(u),u+=4),o&&(t.size=s.getUint32(u),u+=4),d&&(1===i.version?t.compositionTimeOffset=s.getInt32(u):t.compositionTimeOffset=s.getUint32(u),u+=4),i.samples.push(t),h--);h--;)t={},a&&(t.duration=s.getUint32(u),u+=4),o&&(t.size=s.getUint32(u),u+=4),l&&(t.flags=ei(e.subarray(u,u+4)),u+=4),d&&(1===i.version?t.compositionTimeOffset=s.getInt32(u):t.compositionTimeOffset=s.getUint32(u),u+=4),i.samples.push(t);return i},ii=function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),s={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:i.getUint32(4)},n=1&s.flags[2],r=2&s.flags[2],a=8&s.flags[2],o=16&s.flags[2],l=32&s.flags[2],d=65536&s.flags[0],h=131072&s.flags[0];return t=8,n&&(t+=4,s.baseDataOffset=i.getUint32(12),t+=4),r&&(s.sampleDescriptionIndex=i.getUint32(t),t+=4),a&&(s.defaultSampleDuration=i.getUint32(t),t+=4),o&&(s.defaultSampleSize=i.getUint32(t),t+=4),l&&(s.defaultSampleFlags=i.getUint32(t)),d&&(s.durationIsEmpty=!0),!n&&h&&(s.baseDataOffsetIsMoof=!0),s},si=(jt="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},pe.discardEmulationPreventionBytes),ni=Ie.CaptionStream,ri=Yt,ai=Zt,oi=ti,li=ii,di=jt,hi=function(e,t){for(var i=e,s=0;s<t.length;s++){var n=t[s];if(i<n.size)return n;i-=n.size;}return null},ui=function(e,t){var i=ri(e,["moof","traf"]),s=ri(e,["mdat"]),n={},r=[];return s.forEach((function(e,t){var s=i[t];r.push({mdat:e,traf:s});})),r.forEach((function(e){var i,s,r=e.mdat,a=e.traf,o=ri(a,["tfhd"]),l=li(o[0]),d=l.trackId,h=ri(a,["tfdt"]),u=h.length>0?ai(h[0]).baseMediaDecodeTime:0,c=ri(a,["trun"]);t===d&&c.length>0&&(i=function(e,t,i){var s=t,n=i.defaultSampleDuration||0,r=i.defaultSampleSize||0,a=i.trackId,o=[];return e.forEach((function(e){var t=oi(e).samples;t.forEach((function(e){void 0===e.duration&&(e.duration=n),void 0===e.size&&(e.size=r),e.trackId=a,e.dts=s,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),"bigint"==typeof s?(e.pts=s+di.BigInt(e.compositionTimeOffset),s+=di.BigInt(e.duration)):(e.pts=s+e.compositionTimeOffset,s+=e.duration);})),o=o.concat(t);})),o}(c,u,l),s=function(e,t,i){var s,n,r,a,o=new DataView(e.buffer,e.byteOffset,e.byteLength),l={logs:[],seiNals:[]};for(n=0;n+4<e.length;n+=r)if(r=o.getUint32(n),n+=4,!(r<=0))switch(31&e[n]){case 6:var d=e.subarray(n+1,n+1+r),h=hi(n,t);if(s={nalUnitType:"sei_rbsp",size:r,data:d,escapedRBSP:si(d),trackId:i},h)s.pts=h.pts,s.dts=h.dts,a=h;else {if(!a){l.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+n+" for trackId "+i+". See mux.js#223."});break}s.pts=a.pts,s.dts=a.dts;}l.seiNals.push(s);}return l}(r,i,d),n[d]||(n[d]={seiNals:[],logs:[]}),n[d].seiNals=n[d].seiNals.concat(s.seiNals),n[d].logs=n[d].logs.concat(s.logs));})),n},ci=function(){var e,t,i,s,n,r,a=!1;this.isInitialized=function(){return a},this.init=function(t){e=new ni,a=!0,r=!!t&&t.isPartial,e.on("data",(function(e){e.startTime=e.startPts/s,e.endTime=e.endPts/s,n.captions.push(e),n.captionStreams[e.stream]=!0;})),e.on("log",(function(e){n.logs.push(e);}));},this.isNewInit=function(e,t){return !(e&&0===e.length||t&&"object"==typeof t&&0===Object.keys(t).length)&&(i!==e[0]||s!==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],s=a[i];else if(null===i||!s)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 s=ui(e,t)[t]||{};return {seiNals:s.seiNals,logs:s.logs,timescale:i}}(e,i,s),o&&o.logs&&(n.logs=n.logs.concat(o.logs)),null!==o&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),n):n.logs.length?{logs:n.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach((function(t){e.push(t);}));},this.flushStream=function(){if(!this.isInitialized())return null;r?e.partialFlush():e.flush();},this.clearParsedCaptions=function(){n.captions=[],n.captionStreams={},n.logs=[];},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset();},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream();},this.reset=function(){t=[],i=null,s=null,n?this.clearParsedCaptions():n={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream();},this.reset();},pi=Gt,mi=function(e){return ("00"+e.toString(16)).slice(-2)},gi=Yt,fi=Kt,vi=q.getUint64,bi=jt;Ht=function(e,t){var i=gi(t,["moof","traf"]).reduce((function(t,i){var s,n=gi(i,["tfhd"])[0],r=pi(n[4]<<24|n[5]<<16|n[6]<<8|n[7]),a=e[r]||9e4,o=gi(i,["tfdt"])[0],l=new DataView(o.buffer,o.byteOffset,o.byteLength);let d;return "bigint"==typeof(s=1===o[0]?vi(o.subarray(4,12)):l.getUint32(4))?d=s/bi.BigInt(a):"number"!=typeof s||isNaN(s)||(d=s/a),d<Number.MAX_SAFE_INTEGER&&(d=Number(d)),d<t&&(t=d),t}),1/0);return "bigint"==typeof i||isFinite(i)?i:0},qt=function(e){var t=0===e[0]?12:20;return pi(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])},Vt=function(e){var t=gi(e,["moov","trak"]),i=[];return t.forEach((function(e){var t,s,n={},r=gi(e,["tkhd"])[0];r&&(s=(t=new DataView(r.buffer,r.byteOffset,r.byteLength)).getUint8(0),n.id=0===s?t.getUint32(12):t.getUint32(20));var a=gi(e,["mdia","hdlr"])[0];if(a){var o=fi(a.subarray(8,12));n.type="vide"===o?"video":"soun"===o?"audio":o;}var l=gi(e,["mdia","minf","stbl","stsd"])[0];if(l){var d=l.subarray(8);n.codec=fi(d.subarray(4,8));var h,u=gi(d,[n.codec])[0];u&&(/^[asm]vc[1-9]$/i.test(n.codec)?(h=u.subarray(78),"avcC"===fi(h.subarray(4,8))&&h.length>11?(n.codec+=".",n.codec+=mi(h[9]),n.codec+=mi(h[10]),n.codec+=mi(h[11])):n.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(n.codec)?(h=u.subarray(28),"esds"===fi(h.subarray(4,8))&&h.length>20&&0!==h[19]?(n.codec+="."+mi(h[19]),n.codec+="."+mi(h[20]>>>2&63).replace(/^0/,"")):n.codec="mp4a.40.2"):n.codec=n.codec.toLowerCase());}var c=gi(e,["mdia","mdhd"])[0];c&&(n.timescale=qt(c)),i.push(n);})),i};var Si=Ht,Ci=Vt,ki=xe,Ei=function(e){var t=31&e[1];return t<<=8,t|=e[2]},wi=function(e){return !!(64&e[1])},Ii=function(e){var t=0;return (48&e[3])>>>4>1&&(t+=e[4]+1),t},xi=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}},Ai={parseType:function(e,t){var i=Ei(e);return 0===i?"pat":i===t?"pmt":t?"pes":null},parsePat:function(e){var t=wi(e),i=4+Ii(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},parsePmt:function(e){var t={},i=wi(e),s=4+Ii(e);if(i&&(s+=e[s]+1),1&e[s+5]){var n;n=3+((15&e[s+1])<<8|e[s+2])-4;for(var r=12+((15&e[s+10])<<8|e[s+11]);r<n;){var a=s+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:wi,parsePesType:function(e,t){switch(t[Ei(e)]){case ki.H264_STREAM_TYPE:return "video";case ki.ADTS_STREAM_TYPE:return "audio";case ki.METADATA_STREAM_TYPE:return "timed-metadata";default:return null}},parsePesTime:function(e){if(!wi(e))return null;var t=4+Ii(e);if(t>=e.byteLength)return null;var i,s=null;return 192&(i=e[t+7])&&((s={}).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,s.pts*=4,s.pts+=(6&e[t+13])>>>1,s.dts=s.pts,64&i&&(s.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,s.dts*=4,s.dts+=(6&e[t+18])>>>1)),s},videoPacketContainsKeyFrame:function(e){for(var t=4+Ii(e),i=e.subarray(t),s=0,n=0,r=!1;n<i.byteLength-3;n++)if(1===i[n+2]){s=n+5;break}for(;s<i.byteLength;)switch(i[s]){case 0:if(0!==i[s-1]){s+=2;break}if(0!==i[s-2]){s++;break}n+3!==s-2&&"slice_layer_without_partitioning_rbsp_idr"===xi(31&i[n+3])&&(r=!0);do{s++;}while(1!==i[s]&&s<i.length);n=s-2,s+=3;break;case 1:if(0!==i[s-1]||0!==i[s-2]){s+=3;break}"slice_layer_without_partitioning_rbsp_idr"===xi(31&i[n+3])&&(r=!0),n=s-2,s+=3;break;default:s+=3;}return i=i.subarray(n),s-=n,n=0,i&&i.byteLength>3&&"slice_layer_without_partitioning_rbsp_idr"===xi(31&i[n+3])&&(r=!0),r}},Pi=xe,Li=Me.handleRollover,Oi={};Oi.ts=Ai,Oi.aac=_t;var Di=oe.ONE_SECOND_IN_TS,Mi=188,Ri=71,Ui=function(e,t,i){for(var s,n,r,a,o=0,l=Mi,d=!1;l<=e.byteLength;)if(e[o]!==Ri||e[l]!==Ri&&l!==e.byteLength)o++,l++;else {if(s=e.subarray(o,l),"pes"===Oi.ts.parseType(s,t.pid))n=Oi.ts.parsePesType(s,t.table),r=Oi.ts.parsePayloadUnitStartIndicator(s),"audio"===n&&r&&(a=Oi.ts.parsePesTime(s))&&(a.type="audio",i.audio.push(a),d=!0);if(d)break;o+=Mi,l+=Mi;}for(o=(l=e.byteLength)-Mi,d=!1;o>=0;)if(e[o]!==Ri||e[l]!==Ri&&l!==e.byteLength)o--,l--;else {if(s=e.subarray(o,l),"pes"===Oi.ts.parseType(s,t.pid))n=Oi.ts.parsePesType(s,t.table),r=Oi.ts.parsePayloadUnitStartIndicator(s),"audio"===n&&r&&(a=Oi.ts.parsePesTime(s))&&(a.type="audio",i.audio.push(a),d=!0);if(d)break;o-=Mi,l-=Mi;}},$i=function(e,t,i){for(var s,n,r,a,o,l,d,h=0,u=Mi,c=!1,p={data:[],size:0};u<e.byteLength;)if(e[h]!==Ri||e[u]!==Ri)h++,u++;else {if(s=e.subarray(h,u),"pes"===Oi.ts.parseType(s,t.pid))if(n=Oi.ts.parsePesType(s,t.table),r=Oi.ts.parsePayloadUnitStartIndicator(s),"video"===n&&(r&&!c&&(a=Oi.ts.parsePesTime(s))&&(a.type="video",i.video.push(a),c=!0),!i.firstKeyFrame)){if(r&&0!==p.size){for(o=new Uint8Array(p.size),l=0;p.data.length;)d=p.data.shift(),o.set(d,l),l+=d.byteLength;if(Oi.ts.videoPacketContainsKeyFrame(o)){var m=Oi.ts.parsePesTime(o);m?(i.firstKeyFrame=m,i.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.");}p.size=0;}p.data.push(s),p.size+=s.byteLength;}if(c&&i.firstKeyFrame)break;h+=Mi,u+=Mi;}for(h=(u=e.byteLength)-Mi,c=!1;h>=0;)if(e[h]!==Ri||e[u]!==Ri)h--,u--;else {if(s=e.subarray(h,u),"pes"===Oi.ts.parseType(s,t.pid))n=Oi.ts.parsePesType(s,t.table),r=Oi.ts.parsePayloadUnitStartIndicator(s),"video"===n&&r&&(a=Oi.ts.parsePesTime(s))&&(a.type="video",i.video.push(a),c=!0);if(c)break;h-=Mi,u-=Mi;}},Bi=function(e){var t={pid:null,table:null},i={};for(var s in function(e,t){for(var i,s=0,n=Mi;n<e.byteLength;)if(e[s]!==Ri||e[n]!==Ri)s++,n++;else {switch(i=e.subarray(s,n),Oi.ts.parseType(i,t.pid)){case"pat":t.pid=Oi.ts.parsePat(i);break;case"pmt":var r=Oi.ts.parsePmt(i);t.table=t.table||{},Object.keys(r).forEach((function(e){t.table[e]=r[e];}));}s+=Mi,n+=Mi;}}(e,t),t.table){if(t.table.hasOwnProperty(s))switch(t.table[s]){case Pi.H264_STREAM_TYPE:i.video=[],$i(e,t,i),0===i.video.length&&delete i.video;break;case Pi.ADTS_STREAM_TYPE:i.audio=[],Ui(e,t,i),0===i.audio.length&&delete i.audio;}}return i},Ni=function(e,t){var i;return i=Oi.aac.isLikelyAacData(e)?function(e){for(var t,i=!1,s=0,n=null,r=null,a=0,o=0;e.length-o>=3;){switch(Oi.aac.parseType(e,o)){case"timed-metadata":if(e.length-o<10){i=!0;break}if((a=Oi.aac.parseId3TagSize(e,o))>e.length){i=!0;break}null===r&&(t=e.subarray(o,o+a),r=Oi.aac.parseAacTimestamp(t)),o+=a;break;case"audio":if(e.length-o<7){i=!0;break}if((a=Oi.aac.parseAdtsSize(e,o))>e.length){i=!0;break}null===n&&(t=e.subarray(o,o+a),n=Oi.aac.parseSampleRate(t)),s++,o+=a;break;default:o++;}if(i)return null}if(null===n||null===r)return null;var l=Di/n;return {audio:[{type:"audio",dts:r,pts:r},{type:"audio",dts:r+1024*s*l,pts:r+1024*s*l}]}}(e):Bi(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=Li(e.dts,i),e.pts=Li(e.pts,i),e.dtsTime=e.dts/Di,e.ptsTime=e.pts/Di;}));}if(e.video&&e.video.length){var s=t;if((void 0===s||isNaN(s))&&(s=e.video[0].dts),e.video.forEach((function(e){e.dts=Li(e.dts,s),e.pts=Li(e.pts,s),e.dtsTime=e.dts/Di,e.ptsTime=e.pts/Di;})),e.firstKeyFrame){var n=e.firstKeyFrame;n.dts=Li(n.dts,s),n.pts=Li(n.pts,s),n.dtsTime=n.dts/Di,n.ptsTime=n.pts/Di;}}}(i,t),i):null};class Fi{constructor(e,t){this.options=t||{},this.self=e,this.init();}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Wt.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 s=t.data;t.data=s.buffer,e.postMessage({action:"data",segment:t,byteOffset:s.byteOffset,byteLength:s.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 ci,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]);}probeMp4StartTime({timescales:e,data:t}){const i=Si(e,t);this.self.postMessage({action:"probeMp4StartTime",startTime:i,data:t},[t.buffer]);}probeMp4Tracks({data:e}){const t=Ci(e);this.self.postMessage({action:"probeMp4Tracks",tracks:t,data:e},[e.buffer]);}probeTs({data:e,baseStartTime:t}){const i="number"!=typeof t||isNaN(t)?void 0:t*oe.ONE_SECOND_IN_TS,s=Ni(e,i);let n=null;s&&(n={hasVideo:s.video&&2===s.video.length||!1,hasAudio:s.audio&&2===s.audio.length||!1},n.hasVideo&&(n.videoStart=s.video[0].ptsTime),n.hasAudio&&(n.audioStart=s.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:n,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 Fi(self,e.data.options):(this.messageHandlers||(this.messageHandlers=new Fi(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data));};})));var TransmuxWorker=factory(workerCode$1);const handleData_=(e,t,i)=>{const{type:s,initSegment:n,captions:r,captionStreams:a,metadata:o,videoFrameDtsTime:l,videoFramePtsTime:d}=e.data.segment;t.buffer.push({captions:r,captionStreams:a,metadata:o});const h=e.data.segment.boxes||{data:e.data.segment.data},u={type:s,data:new Uint8Array(h.data,h.data.byteOffset,h.data.byteLength),initSegment:new Uint8Array(n.data,n.byteOffset,n.byteLength)};void 0!==l&&(u.videoFrameDtsTime=l),void 0!==d&&(u.videoFramePtsTime=d),i(u);},handleDone_=({transmuxedData:e,callback:t})=>{e.buffer=[],t(e);},handleGopInfo_=(e,t)=>{t.gopInfo=e.data.gopInfo;},processTransmux=e=>{const{transmuxer:t,bytes:i,audioAppendStart:s,gopsToAlignWith:n,remux:r,onData:a,onTrackInfo:o,onAudioTimingInfo:l,onVideoTimingInfo:d,onVideoSegmentTimingInfo:h,onAudioSegmentTimingInfo:u,onId3:c,onCaptions:p,onDone:m,onEndedTimeline:g,onTransmuxerLog:f,isEndOfTimeline:_}=e,y={buffer:[]};let T=_;if(t.onmessage=i=>{t.currentTransmux===e&&("data"===i.data.action&&handleData_(i,y,a),"trackinfo"===i.data.action&&o(i.data.trackInfo),"gopInfo"===i.data.action&&handleGopInfo_(i,y),"audioTimingInfo"===i.data.action&&l(i.data.audioTimingInfo),"videoTimingInfo"===i.data.action&&d(i.data.videoTimingInfo),"videoSegmentTimingInfo"===i.data.action&&h(i.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===i.data.action&&u(i.data.audioSegmentTimingInfo),"id3Frame"===i.data.action&&c([i.data.id3Frame],i.data.id3Frame.dispatchType),"caption"===i.data.action&&p(i.data.caption),"endedtimeline"===i.data.action&&(T=!1,g()),"log"===i.data.action&&f(i.data.log),"transmuxed"===i.data.type&&(T||(t.onmessage=null,handleDone_({transmuxedData:y,callback:m}),dequeue(t))));},s&&t.postMessage({action:"setAudioAppendStart",appendStart:s}),Array.isArray(n)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:n}),void 0!==r&&t.postMessage({action:"setRemux",remux:r}),i.byteLength){const e=i instanceof ArrayBuffer?i:i.buffer,s=i instanceof ArrayBuffer?0:i.byteOffset;t.postMessage({action:"push",data:e,byteOffset:s,byteLength:i.byteLength},[e]);}_&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"});},dequeue=e=>{e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():processTransmux(e.currentTransmux));},processAction=(e,t)=>{e.postMessage({action:t}),dequeue(e);},enqueueAction=(e,t)=>{if(!t.currentTransmux)return t.currentTransmux=e,void processAction(t,e);t.transmuxQueue.push(processAction.bind(null,t,e));},reset=e=>{enqueueAction("reset",e);},endTimeline=e=>{enqueueAction("endTimeline",e);},transmux=e=>{if(!e.transmuxer.currentTransmux)return e.transmuxer.currentTransmux=e,void processTransmux(e);e.transmuxer.transmuxQueue.push(e);},createTransmuxer=e=>{const t=new TransmuxWorker;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};var segmentTransmuxer={reset:reset,endTimeline:endTimeline,transmux:transmux,createTransmuxer:createTransmuxer};const workerCallback=function(e){const t=e.transmuxer,i=e.endAction||e.action,s=e.callback,n=_extends$1({},e,{endAction:null,transmuxer:null,callback:null}),r=n=>{n.data.action===i&&(t.removeEventListener("message",r),n.data.data&&(n.data.data=new Uint8Array(n.data.data,e.byteOffset||0,e.byteLength||n.data.data.byteLength),e.data&&(e.data=n.data.data)),s(n.data));};if(t.addEventListener("message",r),e.data){const i=e.data instanceof ArrayBuffer;n.byteOffset=i?0:e.data.byteOffset,n.byteLength=e.data.byteLength;const s=[i?e.data:e.data.buffer];t.postMessage(n,s);}else t.postMessage(n);},REQUEST_ERRORS={FAILURE:2,TIMEOUT:-101,ABORTED:-102},abortAll=e=>{e.forEach((e=>{e.abort();}));},getRequestStats=e=>({bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}),getProgressStats=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},handleErrors=(e,t)=>t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:REQUEST_ERRORS.TIMEOUT,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:REQUEST_ERRORS.ABORTED,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:REQUEST_ERRORS.FAILURE,xhr:t}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:REQUEST_ERRORS.FAILURE,xhr:t}:null,handleKeyResponse=(e,t,i)=>(s,n)=>{const r=n.response,a=handleErrors(s,n);if(a)return i(a,e);if(16!==r.byteLength)return i({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:REQUEST_ERRORS.FAILURE,xhr:n},e);const o=new DataView(r),l=new Uint32Array([o.getUint32(0),o.getUint32(4),o.getUint32(8),o.getUint32(12)]);for(let e=0;e<t.length;e++)t[e].bytes=l;return i(null,e)},parseInitSegment=(e,t)=>{const i=detectContainerForBytes(e.map.bytes);if("mp4"!==i){const s=e.map.resolvedUri||e.map.uri;return t({internal:!0,message:`Found unsupported ${i||"unknown"} container for initialization segment at URL: ${s}`,code:REQUEST_ERRORS.FAILURE})}workerCallback({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:({tracks:i,data:s})=>(e.map.bytes=s,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));})),t(null))});},handleInitSegmentResponse=({segment:e,finishProcessingFn:t})=>(i,s)=>{const n=handleErrors(i,s);if(n)return t(n,e);const r=new Uint8Array(s.response);if(e.map.key)return e.map.encryptedBytes=r,t(null,e);e.map.bytes=r,parseInitSegment(e,(function(i){if(i)return i.xhr=s,i.status=s.status,t(i,e);t(null,e);}));},handleSegmentResponse=({segment:e,finishProcessingFn:t,responseType:i})=>(s,n)=>{const r=handleErrors(s,n);if(r)return t(r,e);const a="arraybuffer"!==i&&n.responseText?stringToArrayBuffer(n.responseText.substring(e.lastReachedChar||0)):n.response;return e.stats=getRequestStats(n),e.key?e.encryptedBytes=new Uint8Array(a):e.bytes=new Uint8Array(a),t(null,e)},transmuxAndNotify=({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:h,doneFn:u,onTransmuxerLog:c})=>{const p=e.map&&e.map.tracks||{},m=Boolean(p.audio&&p.video);let g=s.bind(null,e,"audio","start");const f=s.bind(null,e,"audio","end");let _=s.bind(null,e,"video","start");const y=s.bind(null,e,"video","end");workerCallback({action:"probeTs",transmuxer:e.transmuxer,data:t,baseStartTime:e.baseStartTime,callback:s=>{e.bytes=t=s.data;const p=s.result;p&&(i(e,{hasAudio:p.hasAudio,hasVideo:p.hasVideo,isMuxed:m}),i=null,p.hasAudio&&!m&&g(p.audioStart),p.hasVideo&&_(p.videoStart),g=null,_=null),transmux({bytes:t,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,remux:m,onData:t=>{t.type="combined"===t.type?"video":t.type,h(e,t);},onTrackInfo:t=>{i&&(m&&(t.isMuxed=!0),i(e,t));},onAudioTimingInfo:e=>{g&&void 0!==e.start&&(g(e.start),g=null),f&&void 0!==e.end&&f(e.end);},onVideoTimingInfo:e=>{_&&void 0!==e.start&&(_(e.start),_=null),y&&void 0!==e.end&&y(e.end);},onVideoSegmentTimingInfo:e=>{n(e);},onAudioSegmentTimingInfo:e=>{r(e);},onId3:(t,i)=>{a(e,t,i);},onCaptions:t=>{o(e,[t]);},isEndOfTimeline:l,onEndedTimeline:()=>{d();},onTransmuxerLog:c,onDone:t=>{u&&(t.type="combined"===t.type?"video":t.type,u(null,e,t));}});}});},handleSegmentBytes=({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:h,doneFn:u,onTransmuxerLog:c})=>{let p=new Uint8Array(t);if(isLikelyFmp4MediaSegment(p)){e.isFmp4=!0;const{tracks:n}=e.map,r={isFmp4:!0,hasVideo:!!n.video,hasAudio:!!n.audio};n.audio&&n.audio.codec&&"enca"!==n.audio.codec&&(r.audioCodec=n.audio.codec),n.video&&n.video.codec&&"encv"!==n.video.codec&&(r.videoCodec=n.video.codec),n.video&&n.audio&&(r.isMuxed=!0),i(e,r);const a=t=>{h(e,{data:p,type:r.hasAudio&&!r.isMuxed?"audio":"video"}),t&&t.length&&o(e,t),u(null,e,{});};workerCallback({action:"probeMp4StartTime",timescales:e.map.timescales,data:p,transmuxer:e.transmuxer,callback:({data:i,startTime:o})=>{t=i.buffer,e.bytes=p=i,r.hasAudio&&!r.isMuxed&&s(e,"audio","start",o),r.hasVideo&&s(e,"video","start",o),n.video&&i.byteLength&&e.transmuxer?workerCallback({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:e.transmuxer,data:p,timescales:e.map.timescales,trackIds:[n.video.id],callback:i=>{t=i.data.buffer,e.bytes=p=i.data,i.logs.forEach((function(e){c(merge(e,{stream:"mp4CaptionParser"}));})),a(i.captions);}}):a();}});}else if(e.transmuxer){if(void 0===e.container&&(e.container=detectContainerForBytes(p)),"ts"!==e.container&&"aac"!==e.container)return i(e,{hasAudio:!1,hasVideo:!1}),void u(null,e,{});transmuxAndNotify({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:h,doneFn:u,onTransmuxerLog:c});}else u(null,e,{});},decrypt=function({id:e,key:t,encryptedBytes:i,decryptionWorker:s},n){const r=t=>{if(t.data.source===e){s.removeEventListener("message",r);const e=t.data.decrypted;n(new Uint8Array(e.bytes,e.byteOffset,e.byteLength));}};let a;s.addEventListener("message",r),a=t.bytes.slice?t.bytes.slice():new Uint32Array(Array.prototype.slice.call(t.bytes)),s.postMessage(createTransferableMessage({source:e,encrypted:i,key:a,iv:t.iv}),[i.buffer,a.buffer]);},decryptSegment=({decryptionWorker:e,segment:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:h,doneFn:u,onTransmuxerLog:c})=>{decrypt({id:t.requestId,key:t.key,encryptedBytes:t.encryptedBytes,decryptionWorker:e},(e=>{t.bytes=e,handleSegmentBytes({segment:t,bytes:t.bytes,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:h,doneFn:u,onTransmuxerLog:c});}));},waitForCompletion=({activeXhrs:e,decryptionWorker:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:h,doneFn:u,onTransmuxerLog:c})=>{let p=0,m=!1;return (g,f)=>{if(!m){if(g)return m=!0,abortAll(e),u(g,f);if(p+=1,p===e.length){const p=function(){if(f.encryptedBytes)return decryptSegment({decryptionWorker:t,segment:f,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:h,doneFn:u,onTransmuxerLog:c});handleSegmentBytes({segment:f,bytes:f.bytes,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:h,doneFn:u,onTransmuxerLog:c});};if(f.endOfAllRequests=Date.now(),f.map&&f.map.encryptedBytes&&!f.map.bytes)return decrypt({decryptionWorker:t,id:f.requestId+"-init",encryptedBytes:f.map.encryptedBytes,key:f.map.key},(t=>{f.map.bytes=t,parseInitSegment(f,(t=>{if(t)return abortAll(e),u(t,f);p();}));}));p();}}}},handleLoadEnd=({loadendState:e,abortFn:t})=>i=>{i.target.aborted&&t&&!e.calledAbortFn&&(t(),e.calledAbortFn=!0);},handleProgress=({segment:e,progressFn:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:h})=>i=>{if(!i.target.aborted)return e.stats=merge(e.stats,getProgressStats(i)),!e.stats.firstBytesReceivedAt&&e.stats.bytesReceived&&(e.stats.firstBytesReceivedAt=Date.now()),t(i,e)},mediaSegmentRequest=({xhr:e,xhrOptions:t,decryptionWorker:i,segment:s,abortFn:n,progressFn:r,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:d,id3Fn:h,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:p,dataFn:m,doneFn:g,onTransmuxerLog:f})=>{const _=[],y=waitForCompletion({activeXhrs:_,decryptionWorker:i,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:d,id3Fn:h,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:p,dataFn:m,doneFn:g,onTransmuxerLog:f});if(s.key&&!s.key.bytes){const i=[s.key];s.map&&!s.map.bytes&&s.map.key&&s.map.key.resolvedUri===s.key.resolvedUri&&i.push(s.map.key);const n=e(merge(t,{uri:s.key.resolvedUri,responseType:"arraybuffer"}),handleKeyResponse(s,i,y));_.push(n);}if(s.map&&!s.map.bytes){if(s.map.key&&(!s.key||s.key.resolvedUri!==s.map.key.resolvedUri)){const i=e(merge(t,{uri:s.map.key.resolvedUri,responseType:"arraybuffer"}),handleKeyResponse(s,[s.map.key],y));_.push(i);}const i=e(merge(t,{uri:s.map.resolvedUri,responseType:"arraybuffer",headers:segmentXhrHeaders(s.map)}),handleInitSegmentResponse({segment:s,finishProcessingFn:y}));_.push(i);}const T=merge(t,{uri:s.part&&s.part.resolvedUri||s.resolvedUri,responseType:"arraybuffer",headers:segmentXhrHeaders(s)}),v=e(T,handleSegmentResponse({segment:s,finishProcessingFn:y,responseType:T.responseType}));v.addEventListener("progress",handleProgress({segment:s,progressFn:r,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:d,id3Fn:h,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:p,dataFn:m})),_.push(v);const b={};return _.forEach((e=>{e.addEventListener("loadend",handleLoadEnd({loadendState:b,abortFn:n}));})),()=>abortAll(_)},logFn$1=logger("CodecUtils"),getCodecs=function(e){const t=e.attributes||{};if(t.CODECS)return parseCodecs(t.CODECS)},isMaat=(e,t)=>{const i=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&i.AUDIO&&e.mediaGroups.AUDIO[i.AUDIO]},isMuxed=(e,t)=>{if(!isMaat(e,t))return !0;const i=t.attributes||{},s=e.mediaGroups.AUDIO[i.AUDIO];for(const e in s)if(!s[e].uri&&!s[e].playlists)return !0;return !1},unwrapCodecList=function(e){const t={};return e.forEach((({mediaType:e,type:i,details:s})=>{t[e]=t[e]||[],t[e].push(translateLegacyCodec(`${i}${s}`));})),Object.keys(t).forEach((function(e){if(t[e].length>1)return logFn$1(`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},codecCount=function(e){let t=0;return e.audio&&t++,e.video&&t++,t},codecsForPlaylist=function(e,t){const i=t.attributes||{},s=unwrapCodecList(getCodecs(t)||[]);if(isMaat(e,t)&&!s.audio&&!isMuxed(e,t)){const t=unwrapCodecList(codecsFromDefault(e,i.AUDIO)||[]);t.audio&&(s.audio=t.audio);}return s},logFn=logger("PlaylistSelector"),representationToString=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||""})},safeGetComputedStyle=function(e,t){if(!e)return "";const i=window_1.getComputedStyle(e);return i?i[t]:""},stableSort=function(e,t){const i=e.slice();e.sort((function(e,s){const n=t(e,s);return 0===n?i.indexOf(e)-i.indexOf(s):n}));},comparePlaylistBandwidth=function(e,t){let i,s;return e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||window_1.Number.MAX_VALUE,t.attributes.BANDWIDTH&&(s=t.attributes.BANDWIDTH),s=s||window_1.Number.MAX_VALUE,i-s},comparePlaylistResolution=function(e,t){let i,s;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||window_1.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(s=t.attributes.RESOLUTION.width),s=s||window_1.Number.MAX_VALUE,i===s&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-s};let simpleSelector=function(e,t,i,s,n,r){if(!e)return;const a={bandwidth:t,width:i,height:s,limitRenditionByPlayerDimensions:n};let o=e.playlists;Playlist.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,s=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return t=e.attributes&&e.attributes.BANDWIDTH,t=t||window_1.Number.MAX_VALUE,{bandwidth:t,width:i,height:s,playlist:e}}));stableSort(l,((e,t)=>e.bandwidth-t.bandwidth)),l=l.filter((e=>!Playlist.isIncompatible(e.playlist)));let d=l.filter((e=>Playlist.isEnabled(e.playlist)));d.length||(d=l.filter((e=>!Playlist.isDisabled(e.playlist))));const h=d.filter((e=>e.bandwidth*Config.BANDWIDTH_VARIANCE<t));let u=h[h.length-1];const c=h.filter((e=>e.bandwidth===u.bandwidth))[0];if(!1===n){const e=c||d[0]||l[0];if(e&&e.playlist){let t="sortedPlaylistReps";return c&&(t="bandwidthBestRep"),d[0]&&(t="enabledPlaylistReps"),logFn(`choosing ${representationToString(e)} using ${t} with options`,a),e.playlist}return logFn("could not choose a playlist with options",a),null}const p=h.filter((e=>e.width&&e.height));stableSort(p,((e,t)=>e.width-t.width));const m=p.filter((e=>e.width===i&&e.height===s));u=m[m.length-1];const g=m.filter((e=>e.bandwidth===u.bandwidth))[0];let f,_,y,T;if(g||(f=p.filter((e=>e.width>i||e.height>s)),_=f.filter((e=>e.width===f[0].width&&e.height===f[0].height)),u=_[_.length-1],y=_.filter((e=>e.bandwidth===u.bandwidth))[0]),r.leastPixelDiffSelector){const e=p.map((e=>(e.pixelDiff=Math.abs(e.width-i)+Math.abs(e.height-s),e)));stableSort(e,((e,t)=>e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff)),T=e[0];}const v=T||y||g||c||d[0]||l[0];if(v&&v.playlist){let e="sortedPlaylistReps";return T?e="leastPixelDiffRep":y?e="resolutionPlusOneRep":g?e="resolutionBestRep":c?e="bandwidthBestRep":d[0]&&(e="enabledPlaylistReps"),logFn(`choosing ${representationToString(v)} using ${e} with options`,a),v.playlist}return logFn("could not choose a playlist with options",a),null};const lastBandwidthSelector=function(){const e=this.useDevicePixelRatio&&window_1.devicePixelRatio||1;return simpleSelector(this.playlists.main,this.systemBandwidth,parseInt(safeGetComputedStyle(this.tech_.el(),"width"),10)*e,parseInt(safeGetComputedStyle(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.playlistController_)},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(){const s=this.useDevicePixelRatio&&window_1.devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(t=e*this.systemBandwidth+(1-e)*t,i=this.systemBandwidth),simpleSelector(this.playlists.main,t,parseInt(safeGetComputedStyle(this.tech_.el(),"width"),10)*s,parseInt(safeGetComputedStyle(this.tech_.el(),"height"),10)*s,this.limitRenditionByPlayerDimensions,this.playlistController_)}},minRebufferMaxBandwidthSelector=function(e){const{main:t,currentTime:i,bandwidth:s,duration:n,segmentDuration:r,timeUntilRebuffer:a,currentTimeline:o,syncController:l}=e,d=t.playlists.filter((e=>!Playlist.isIncompatible(e)));let h=d.filter(Playlist.isEnabled);h.length||(h=d.filter((e=>!Playlist.isDisabled(e))));const u=h.filter(Playlist.hasAttribute.bind(null,"BANDWIDTH")).map((e=>{const t=l.getSyncPoint(e,n,o,i)?1:2;return {playlist:e,rebufferingImpact:Playlist.estimateSegmentRequestTime(r,s,e)*t-a}})),c=u.filter((e=>e.rebufferingImpact<=0));return stableSort(c,((e,t)=>comparePlaylistBandwidth(t.playlist,e.playlist))),c.length?c[0]:(stableSort(u,((e,t)=>e.rebufferingImpact-t.rebufferingImpact)),u[0]||null)},lowestBitrateCompatibleVariantSelector=function(){const e=this.playlists.main.playlists.filter(Playlist.isEnabled);stableSort(e,((e,t)=>comparePlaylistBandwidth(e,t)));return e.filter((e=>!!codecsForPlaylist(this.playlists.main,e).video))[0]||null},concatSegments=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},createCaptionsTrackIfNotExists=function(e,t,i){if(!e[i]){t.trigger({type:"usage",name:"vhs-608"});let s=i;/^cc708_/.test(i)&&(s="SERVICE"+i.split("_")[1]);const n=t.textTracks().getTrackById(s);if(n)e[i]=n;else {let n=i,r=i,a=!1;const o=(t.options_.vhs&&t.options_.vhs.captionServices||{})[s];o&&(n=o.label,r=o.language,a=o.default),e[i]=t.addRemoteTextTrack({kind:"captions",id:s,default:a,label:n,language:r},!1).track;}}},addCaptionData=function({inbandTextTracks:e,captionArray:t,timestampOffset:i}){if(!t)return;const s=window_1.WebKitDataCue||window_1.VTTCue;t.forEach((t=>{const n=t.stream;e[n].addCue(new s(t.startTime+i,t.endTime+i,t.text));}));},deprecateOldCue=function(e){Object.defineProperties(e.frame,{id:{get:()=>(videojs.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key)},value:{get:()=>(videojs.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data)},privateData:{get:()=>(videojs.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data)}});},addMetadata=({inbandTextTracks:e,metadataArray:t,timestampOffset:i,videoDuration:s})=>{if(!t)return;const n=window_1.WebKitDataCue||window_1.VTTCue,r=e.metadataTrack_;if(!r)return;if(t.forEach((e=>{const t=e.cueTime+i;!("number"!=typeof t||window_1.isNaN(t)||t<0)&&t<1/0&&e.frames.forEach((e=>{const i=new n(t,t,e.value||e.url||e.data||"");i.frame=e,i.value=e,deprecateOldCue(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}),{}),d=Object.keys(l).sort(((e,t)=>Number(e)-Number(t)));d.forEach(((e,t)=>{const i=l[e],n=Number(d[t+1])||s;i.forEach((e=>{e.endTime=n;}));}));},createMetadataTrackIfNotExists=(e,t,i)=>{e.metadataTrack_||(e.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,e.metadataTrack_.inBandMetadataTrackDispatchType=t);},removeCuesFromTrack=function(e,t,i){let s,n;if(i&&i.cues)for(s=i.cues.length;s--;)n=i.cues[s],n.startTime>=e&&n.endTime<=t&&i.removeCue(n);},removeDuplicateCuesFromTrack=function(e){const t=e.cues;if(t)for(let i=0;i<t.length;i++){const s=[];let n=0;for(let e=0;e<t.length;e++)t[i].startTime===t[e].startTime&&t[i].endTime===t[e].endTime&&t[i].text===t[e].text&&(n++,n>1&&s.push(t[e]));s.length&&s.forEach((t=>e.removeCue(t)));}},gopsSafeToAlignWith=(e,t,i)=>{if(null==t||!e.length)return [];const s=Math.ceil((t-i+3)*clock_1);let n;for(n=0;n<e.length&&!(e[n].pts>s);n++);return e.slice(n)},updateGopBuffer=(e,t,i)=>{if(!t.length)return e;if(i)return t.slice();const s=t[0].pts;let n=0;for(;n<e.length&&!(e[n].pts>=s);n++);return e.slice(0,n).concat(t)},removeGopBuffer=(e,t,i,s)=>{const n=Math.ceil((t-s)*clock_1),r=Math.ceil((i-s)*clock_1),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<=n););return l=Math.max(l,0),a.splice(l,o-l+1),a},shallowEqual=function(e,t){if(!e&&!t||!e&&t||e&&!t)return !1;if(e===t)return !0;const i=Object.keys(e).sort(),s=Object.keys(t).sort();if(i.length!==s.length)return !1;for(let n=0;n<i.length;n++){const r=i[n];if(r!==s[n])return !1;if(e[r]!==t[r])return !1}return !0},getSyncSegmentCandidate=function(e,t,i){t=t||[];const s=[];let n=0;for(let r=0;r<t.length;r++){const a=t[r];if(e===a.timeline&&(s.push(r),n+=a.duration,n>i))return r}return 0===s.length?0:s[s.length-1]},finite=e=>"number"==typeof e&&isFinite(e),illegalMediaSwitch=(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,safeBackBufferTrimTime=(e,t,i)=>{let s=t-Config.BACK_BUFFER_LENGTH;e.length&&(s=Math.max(s,e.start(0)));const n=t-i;return Math.min(n,s)},segmentInfoString=e=>{const{startOfSegment:t,duration:i,segment:s,part:n,playlist:{mediaSequence:r,id:a,segments:o=[]},mediaIndex:l,partIndex:d,timeline:h}=e,u=o.length-1;let c="mediaIndex/partIndex increment";e.getMediaInfoForTime?c=`getMediaInfoForTime (${e.getMediaInfoForTime})`:e.isSyncRequest&&(c="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(c+=` with independent ${e.independent}`);const p="number"==typeof d,m=e.segment.uri?"segment":"pre-segment",g=p?getKnownPartCount({preloadSegment:s})-1:0;return `${m} [${r+l}/${r+u}]`+(p?` part [${d}/${g}]`:"")+` segment start/end [${s.start} => ${s.end}]`+(p?` part start/end [${n.start} => ${n.end}]`:"")+` startOfSegment [${t}]`+` duration [${i}]`+` timeline [${h}]`+` selected by [${c}]`+` playlist [${a}]`},timingInfoPropertyForMedia=e=>`${e}TimingInfo`,timestampOffsetForSegment=({segmentTimeline:e,currentTimeline:t,startOfSegment:i,buffered:s,overrideCheck:n})=>n||e!==t?e<t?i:s.length?s.end(s.length-1):i:null,shouldWaitForTimelineChange=({timelineChangeController:e,currentTimeline:t,segmentTimeline:i,loaderType:s,audioDisabled:n})=>{if(t===i)return !1;if("audio"===s){const t=e.lastTimelineChange({type:"main"});return !t||t.to!==i}if("main"===s&&n){const t=e.pendingTimelineChange({type:"audio"});return !t||t.to!==i}return !1},mediaDuration=e=>{let t=0;return ["video","audio"].forEach((function(i){const s=e[`${i}TimingInfo`];if(!s)return;const{start:n,end:r}=s;let a;"bigint"==typeof n||"bigint"==typeof r?a=window_1.BigInt(r)-window_1.BigInt(n):"number"==typeof n&&"number"==typeof r&&(a=r-n),void 0!==a&&a>t&&(t=a);})),"bigint"==typeof t&&t<Number.MAX_SAFE_INTEGER&&(t=Number(t)),t},segmentTooLong=({segmentDuration:e,maxDuration:t})=>!!e&&Math.round(e)>t+TIME_FUDGE_FACTOR,getTroublesomeSegmentDurationMessage=(e,t)=>{if("hls"!==t)return null;const i=mediaDuration({audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo});if(!i)return null;const s=e.playlist.targetDuration,n=segmentTooLong({segmentDuration:i,maxDuration:2*s}),r=segmentTooLong({segmentDuration:i,maxDuration:s}),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 ${s}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return n||r?{severity:n?"warn":"info",message:a}:null};class SegmentLoader extends videojs.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.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=videojs.browser.IE_VERSION>=11,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_=logger(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(e){e!==this.state_&&(this.logger_(`${this.state_} -> ${e}`),this.state_=e,this.trigger("statechange"));}}),this.sourceUpdater_.on("ready",(()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_();})),"main"===this.loaderType_&&this.timelineChangeController_.on("pendingtimelinechange",(()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_();})),"audio"===this.loaderType_&&this.timelineChangeController_.on("timelinechange",(()=>{this.hasEnoughInfoToLoad_()&&this.processLoadQueue_(),this.hasEnoughInfoToAppend_()&&this.processCallQueue_();}));}createTransmuxer_(){return segmentTransmuxer.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0;}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&window_1.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off();}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_());}abort(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null);}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,window_1.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_&&segmentTransmuxer.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended");}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return createTimeRanges();if("main"===this.loaderType_){const{hasAudio:t,hasVideo:i,isMuxed:s}=e;if(i&&t&&!this.audioDisabled_&&!s)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const i=initSegmentId(e);let s=this.initSegments_[i];return t&&!s&&e.bytes&&(this.initSegments_[i]=s={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),s||e}segmentKey(e,t=!1){if(!e)return null;const i=segmentKeyId(e);let s=this.keyCache_[i];this.cacheEncryptionKeys_&&t&&!s&&e.bytes&&(this.keyCache_[i]=s={resolvedUri:e.resolvedUri,bytes:e.bytes});const n={resolvedUri:(s||e).resolvedUri};return s&&(n.bytes=s.bytes),n}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;const i=this.playlist_,s=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));let n=null;if(i&&(i.id?n=i.id:i.uri&&(n=i.uri)),this.logger_(`playlist update [${n} => ${e.id||e.uri}]`),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri)return null!==this.mediaIndex&&(e.endList?this.resyncLoader():this.resetLoader()),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;}}s&&(s.mediaIndex-=r,s.mediaIndex<0?(s.mediaIndex=null,s.partIndex=null):(s.mediaIndex>=0&&(s.segment=e.segments[s.mediaIndex]),s.partIndex>=0&&s.segment.parts&&(s.part=s.segment.parts[s.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e);}pause(){this.checkBufferTimeout_&&(window_1.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null);}paused(){return null===this.checkBufferTimeout_}resetEverything(e){this.ended_=!1,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}));}resetLoader(){this.fetchAtBuffer_=!1,this.resyncLoader();}resyncLoader(){this.transmuxer_&&segmentTransmuxer.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"});}remove(e,t,i=(()=>{}),s=!1){if(t===1/0&&(t=this.duration_()),t<=e)return void this.logger_("skipping remove because end ${end} is <= start ${start}");if(!this.sourceUpdater_||!this.getMediaInfo_())return void this.logger_("skipping remove because no source updater or starting media info");let n=1;const r=()=>{n--,0===n&&i();};!s&&this.audioDisabled_||(n++,this.sourceUpdater_.removeAudio(e,t,r)),(s||"main"===this.loaderType_)&&(this.gopBuffer_=removeGopBuffer(this.gopBuffer_,e,t,this.timeMapping_),n++,this.sourceUpdater_.removeVideo(e,t,r));for(const i in this.inbandTextTracks_)removeCuesFromTrack(e,t,this.inbandTextTracks_[i]);removeCuesFromTrack(e,t,this.segmentMetadataTrack_),r();}monitorBuffer_(){this.checkBufferTimeout_&&window_1.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=window_1.setTimeout(this.monitorBufferTick_.bind(this),1);}monitorBufferTick_(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&window_1.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=window_1.setTimeout(this.monitorBufferTick_.bind(this),500);}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();e&&("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 s="number"==typeof e&&t.segments[e],n=e+1===t.segments.length,r=!s||!s.parts||i+1===s.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&n&&r}chooseNextRequest_(){const e=this.buffered_(),t=lastBufferedEnd(e)||0,i=timeAheadOf(e,this.currentTime_()),s=!this.hasPlayed_()&&i>=1,n=i>=this.goalBufferLength_(),r=this.playlist_.segments;if(!r.length||s||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());const a={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(a.isSyncRequest)a.mediaIndex=getSyncSegmentCandidate(this.currentTimeline_,r,t);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 {const{segmentIndex:e,startTime:i,partIndex:s}=Playlist.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?t:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});a.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${t}`:`currentTime ${this.currentTime_()}`,a.mediaIndex=e,a.startOfSegment=i,a.partIndex=s;}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;if("number"!=typeof a.partIndex&&o.parts&&(a.partIndex=0,l=o.parts[0]),!i&&l&&!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 d=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return a.mediaIndex>=r.length-1&&d&&!this.seeking_()?null:this.generateSegmentInfo_(a)}generateSegmentInfo_(e){const{independent:t,playlist:i,mediaIndex:s,startOfSegment:n,isSyncRequest:r,partIndex:a,forceTimestampOffset:o,getMediaInfoForTime:l}=e,d=i.segments[s],h="number"==typeof a&&d.parts[a],u={requestId:"segment-loader-"+Math.random(),uri:h&&h.resolvedUri||d.resolvedUri,mediaIndex:s,partIndex:h?a:null,isSyncRequest:r,startOfSegment:n,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:d.timeline,duration:h&&h.duration||d.duration,segment:d,part:h,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:l,independent:t},c=void 0!==o?o:this.isPendingTimestampOffset_;u.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:d.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:c});const p=lastBufferedEnd(this.sourceUpdater_.audioBuffered());return "number"==typeof p&&(u.audioAppendStart=p-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(u.gopsToAlignWith=gopsSafeToAlignWith(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),u}timestampOffsetForSegment_(e){return timestampOffsetForSegment(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,s=this.pendingSegment_.duration,n=Playlist.estimateSegmentRequestTime(s,i,this.playlist_,e.bytesReceived),r=timeUntilRebuffer(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=r)return;const a=minRebufferMaxBandwidthSelector({main:this.vhs_.playlists.main,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:s,timeUntilRebuffer:r,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!a)return;const o=n-r-a.rebufferingImpact;let l=.5;r<=TIME_FUDGE_FACTOR&&(l=1),!a.playlist||a.playlist.uri===this.playlist_.uri||o<l||(this.bandwidth=a.playlist.attributes.BANDWIDTH*Config.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"));}handleAbort_(e){this.logger_(`Aborting ${segmentInfoString(e)}`),this.mediaRequestsAborted+=1;}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),this.checkForAbort_(t.requestId)||this.trigger("progress");}handleTrackInfo_(e,t){this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||this.checkForIllegalMediaSwitch(t)||(t=t||{},shallowEqual(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_()));}handleTimingInfo_(e,t,i,s){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const n=this.pendingSegment_,r=timingInfoPropertyForMedia(t);n[r]=n[r]||{},n[r][i]=s,this.logger_(`timinginfo: ${t} - ${i} - ${s}`),this.hasEnoughInfoToAppend_()&&this.processCallQueue_();}handleCaptions_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))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(),s={};t.forEach((e=>{s[e.stream]=s[e.stream]||{startTime:1/0,captions:[],endTime:0};const t=s[e.stream];t.startTime=Math.min(t.startTime,e.startTime+i),t.endTime=Math.max(t.endTime,e.endTime+i),t.captions.push(e);})),Object.keys(s).forEach((e=>{const{startTime:t,endTime:n,captions:r}=s[e],a=this.inbandTextTracks_;this.logger_(`adding cues from ${t} -> ${n} for ${e}`),createCaptionsTrackIfNotExists(a,this.vhs_.tech_,e),removeCuesFromTrack(t,n,a[e]),addCaptionData({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;if(!this.pendingSegment_.hasAppendedData_)return void this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i));const s=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();createMetadataTrackIfNotExists(this.inbandTextTracks_,i,this.vhs_.tech_),addMetadata({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:s,videoDuration:this.duration_()});}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_()||!shouldWaitForTimelineChange({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_}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:s,isMuxed:n}=t;return !(s&&!e.videoTimingInfo)&&(!(i&&!this.audioDisabled_&&!n&&!e.audioTimingInfo)&&!shouldWaitForTimelineChange({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 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[timingInfoPropertyForMedia(t.type)].start;else {const e=this.getCurrentMediaInfo_(),t="main"===this.loaderType_&&e&&e.hasVideo;let s;t&&(s=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:s,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:s}){if(i){const e=initSegmentId(i);if(this.activeInitSegmentId_===e)return null;t=this.initSegmentForMap(i,!0).bytes,this.activeInitSegmentId_=e;}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=s,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i},s){const n=this.sourceUpdater_.audioBuffered(),r=this.sourceUpdater_.videoBuffered();n.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+timeRangesToArray(n).join(", ")),r.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+timeRangesToArray(r).join(", "));const a=n.length?n.start(0):0,o=n.length?n.end(n.length-1):0,l=r.length?r.start(0):0,d=r.length?r.end(r.length-1):0;if(o-a<=1&&d-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: ${timeRangesToArray(n).join(", ")}, video buffer: ${timeRangesToArray(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 h=this.currentTime_()-1;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${h}`),this.remove(0,h,(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=window_1.setTimeout((()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_();}),1e3);}),!0);}handleAppendError_({segmentInfo:e,type:t,bytes:i},s){s&&(22!==s.code?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",s),this.error(`${t} append of ${i.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i}));}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:i,data:s,bytes:n}){if(!n){const e=[s];let t=s.byteLength;i&&(e.unshift(i),t+=i.byteLength),n=concatSegments({bytes:t,segments:e});}this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:n},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:n}));}handleSegmentTimingInfo_(e,t,i){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const s=this.pendingSegment_.segment,n=`${e}TimingInfo`;s[n]||(s[n]={}),s[n].transmuxerPrependedSeconds=i.prependedContentDuration||0,s[n].transmuxedPresentationStart=i.start.presentation,s[n].transmuxedDecodeStart=i.start.decode,s[n].transmuxedPresentationEnd=i.end.presentation,s[n].transmuxedDecodeEnd=i.end.decode,s[n].baseMediaDecodeTime=i.baseMediaDecodeTime;}appendData_(e,t){const{type:i,data:s}=t;if(!s||!s.byteLength)return;if("audio"===i&&this.audioDisabled_)return;const n=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:n,data:s});}loadSegment_(e){this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(e):this.loadQueue_.push((()=>{const t=_extends$1({},e,{forceTimestampOffset:!0});_extends$1(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e);}));}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),i=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),s=null!==this.mediaIndex,n=e.timeline!==this.currentTimeline_&&e.timeline>0,r=i||s&&n;this.logger_(`Requesting ${segmentInfoString(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=mediaSegmentRequest({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:s})=>{this.logger_(`${segmentInfoString(e)} logged from transmuxer stream ${s} as a ${i}: ${t}`);}});}trimBackBuffer_(e){const t=safeBackBufferTrimTime(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t);}createSimplifiedSegmentObj_(e){const t=e.segment,i=e.part,s={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},n=e.playlist.segments[e.mediaIndex-1];if(n&&n.timeline===t.timeline&&(n.videoTimingInfo?s.baseStartTime=n.videoTimingInfo.transmuxedDecodeEnd:n.audioTimingInfo&&(s.baseStartTime=n.audioTimingInfo.transmuxedDecodeEnd)),t.key){const i=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);s.key=this.segmentKey(t.key),s.key.iv=i;}return t.map&&(s.map=this.initSegmentForMap(t.map)),s}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime);}saveBandwidthRelatedStats_(e,t){this.pendingSegment_.byteLength=t.bytesReceived,e<.016666666666666666?this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record 0.016666666666666666`):(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===REQUEST_ERRORS.ABORTED)return;return this.pause(),e.code===REQUEST_ERRORS.TIMEOUT?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error"))}const s=this.pendingSegment_;this.saveBandwidthRelatedStats_(s.duration,t.stats),s.endOfAllRequests=t.endOfAllRequests,i.gopInfo&&(this.gopBuffer_=updateGopBuffer(this.gopBuffer_,i.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(s);}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:s,currentVideoTimestampOffset:n,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===s+n?a.start:s}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:s,isMuxed:n}=t,r="main"===this.loaderType_&&s,a=!this.audioDisabled_&&i&&!n;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=illegalMediaSwitch(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_&&this.trigger("appendsdone"),!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());const e=this.pendingSegment_;this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_});const t=getTroublesomeSegmentDurationMessage(e,this.sourceType_);if(t&&("warn"===t.severity?videojs.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 ${segmentInfoString(e)}`);this.logger_(`Appended ${segmentInfoString(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,s=e.part,n=i.end&&this.currentTime_()-i.end>3*e.playlist.targetDuration,r=s&&s.end&&this.currentTime_()-s.end>3*e.playlist.partTargetDuration;if(n||r)return this.logger_(`bad ${n?"segment":"part"} ${segmentInfoString(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<.016666666666666666)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,s=Math.floor(e.byteLength/i*8*1e3);this.throughput.rate+=(s-t)/++this.throughput.count;}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;const t=e.segment,i=t.start,s=t.end;if(!finite(i)||!finite(s))return;removeCuesFromTrack(i,s,this.segmentMetadataTrack_);const n=window_1.WebKitDataCue||window_1.VTTCue,r={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:i,end:s},a=new n(i,s,JSON.stringify(r));a.value=r,this.segmentMetadataTrack_.addCue(a);}}function noop(){}const toTitleCase=function(e){return "string"!=typeof e?e:e.replace(/./,(e=>e.toUpperCase()))},bufferTypes=["video","audio"],updating=(e,t)=>{const i=t[`${e}Buffer`];return i&&i.updating||t.queuePending[e]},nextQueueIndexOfType=(e,t)=>{for(let i=0;i<t.length;i++){const s=t[i];if("mediaSource"===s.type)return null;if(s.type===e)return i}return null},shiftQueue=(e,t)=>{if(0===t.queue.length)return;let i=0,s=t.queue[i];if("mediaSource"!==s.type){if("mediaSource"!==e&&t.ready()&&"closed"!==t.mediaSource.readyState&&!updating(e,t)){if(s.type!==e){if(i=nextQueueIndexOfType(e,t.queue),null===i)return;s=t.queue[i];}return t.queue.splice(i,1),t.queuePending[e]=s,s.action(e,t),s.doneFn?void 0:(t.queuePending[e]=null,void shiftQueue(e,t))}}else t.updating()||"closed"===t.mediaSource.readyState||(t.queue.shift(),s.action(t),s.doneFn&&s.doneFn(),shiftQueue("audio",t),shiftQueue("video",t));},cleanupBuffer=(e,t)=>{const i=t[`${e}Buffer`],s=toTitleCase(e);i&&(i.removeEventListener("updateend",t[`on${s}UpdateEnd_`]),i.removeEventListener("error",t[`on${s}Error_`]),t.codecs[e]=null,t[`${e}Buffer`]=null);},inSourceBuffers=(e,t)=>e&&t&&-1!==Array.prototype.indexOf.call(e.sourceBuffers,t),actions={appendBuffer:(e,t,i)=>(s,n)=>{const r=n[`${s}Buffer`];if(inSourceBuffers(n.mediaSource,r)){n.logger_(`Appending segment ${t.mediaIndex}'s ${e.length} bytes to ${s}Buffer`);try{r.appendBuffer(e);}catch(e){n.logger_(`Error with code ${e.code} `+(22===e.code?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${t.mediaIndex} to ${s}Buffer`),n.queuePending[s]=null,i(e);}}},remove:(e,t)=>(i,s)=>{const n=s[`${i}Buffer`];if(inSourceBuffers(s.mediaSource,n)){s.logger_(`Removing ${e} to ${t} from ${i}Buffer`);try{n.remove(e,t);}catch(n){s.logger_(`Remove ${e} to ${t} from ${i}Buffer failed`);}}},timestampOffset:e=>(t,i)=>{const s=i[`${t}Buffer`];inSourceBuffers(i.mediaSource,s)&&(i.logger_(`Setting ${t}timestampOffset to ${e}`),s.timestampOffset=e);},callback:e=>(t,i)=>{e();},endOfStream:e=>t=>{if("open"===t.mediaSource.readyState){t.logger_(`Calling mediaSource endOfStream(${e||""})`);try{t.mediaSource.endOfStream(e);}catch(e){videojs.log.warn("Failed to call media source endOfStream",e);}}},duration:e=>t=>{t.logger_(`Setting mediaSource duration to ${e}`);try{t.mediaSource.duration=e;}catch(e){videojs.log.warn("Failed to set media source duration",e);}},abort:()=>(e,t)=>{if("open"!==t.mediaSource.readyState)return;const i=t[`${e}Buffer`];if(inSourceBuffers(t.mediaSource,i)){t.logger_(`calling abort on ${e}Buffer`);try{i.abort();}catch(t){videojs.log.warn(`Failed to abort on ${e}Buffer`,t);}}},addSourceBuffer:(e,t)=>i=>{const s=toTitleCase(e),n=getMimeForCodec(t);i.logger_(`Adding ${e}Buffer with codec ${t} to mediaSource`);const r=i.mediaSource.addSourceBuffer(n);r.addEventListener("updateend",i[`on${s}UpdateEnd_`]),r.addEventListener("error",i[`on${s}Error_`]),i.codecs[e]=t,i[`${e}Buffer`]=r;},removeSourceBuffer:e=>t=>{const i=t[`${e}Buffer`];if(cleanupBuffer(e,t),inSourceBuffers(t.mediaSource,i)){t.logger_(`Removing ${e}Buffer with codec ${t.codecs[e]} from mediaSource`);try{t.mediaSource.removeSourceBuffer(i);}catch(t){videojs.log.warn(`Failed to removeSourceBuffer ${e}Buffer`,t);}}},changeType:e=>(t,i)=>{const s=i[`${t}Buffer`],n=getMimeForCodec(e);inSourceBuffers(i.mediaSource,s)&&i.codecs[t]!==e&&(i.logger_(`changing ${t}Buffer codec from ${i.codecs[t]} to ${e}`),s.changeType(n),i.codecs[t]=e);}},pushQueue=({type:e,sourceUpdater:t,action:i,doneFn:s,name:n})=>{t.queue.push({type:e,action:i,doneFn:s,name:n}),shiftQueue(e,t);},onUpdateend=(e,t)=>i=>{if(t.queuePending[e]){const i=t.queuePending[e].doneFn;t.queuePending[e]=null,i&&i(t[`${e}Error_`]);}shiftQueue(e,t);};class SourceUpdater extends videojs.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>shiftQueue("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=logger("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=onUpdateend("video",this),this.onAudioUpdateEnd_=onUpdateend("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){pushQueue({type:"mediaSource",sourceUpdater:this,action:actions.addSourceBuffer(e,t),name:"addSourceBuffer"});}abort(e){pushQueue({type:e,sourceUpdater:this,action:actions.abort(e),name:"abort"});}removeSourceBuffer(e){this.canRemoveSourceBuffer()?pushQueue({type:"mediaSource",sourceUpdater:this,action:actions.removeSourceBuffer(e),name:"removeSourceBuffer"}):videojs.log.error("removeSourceBuffer is not supported!");}canRemoveSourceBuffer(){return !videojs.browser.IE_VERSION&&!videojs.browser.IS_FIREFOX&&window_1.MediaSource&&window_1.MediaSource.prototype&&"function"==typeof window_1.MediaSource.prototype.removeSourceBuffer}static canChangeType(){return window_1.SourceBuffer&&window_1.SourceBuffer.prototype&&"function"==typeof window_1.SourceBuffer.prototype.changeType}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){this.canChangeType()?pushQueue({type:e,sourceUpdater:this,action:actions.changeType(t),name:"changeType"}):videojs.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:s,bytes:n}=e;if(this.processedAppend_=!0,"audio"===s&&this.videoBuffer&&!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([e,t]),void this.logger_(`delayed audio append of ${n.length} until video append`);if(pushQueue({type:s,sourceUpdater:this,action:actions.appendBuffer(n,i||{mediaIndex:-1},t),doneFn:t,name:"appendBuffer"}),"video"===s){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 inSourceBuffers(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:createTimeRanges()}videoBuffered(){return inSourceBuffers(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:createTimeRanges()}buffered(){const e=inSourceBuffers(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=inSourceBuffers(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():bufferIntersection(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=noop){pushQueue({type:"mediaSource",sourceUpdater:this,action:actions.duration(e),name:"duration",doneFn:t});}endOfStream(e=null,t=noop){"string"!=typeof e&&(e=void 0),pushQueue({type:"mediaSource",sourceUpdater:this,action:actions.endOfStream(e),name:"endOfStream",doneFn:t});}removeAudio(e,t,i=noop){this.audioBuffered().length&&0!==this.audioBuffered().end(0)?pushQueue({type:"audio",sourceUpdater:this,action:actions.remove(e,t),doneFn:i,name:"remove"}):i();}removeVideo(e,t,i=noop){this.videoBuffered().length&&0!==this.videoBuffered().end(0)?pushQueue({type:"video",sourceUpdater:this,action:actions.remove(e,t),doneFn:i,name:"remove"}):i();}updating(){return !(!updating("audio",this)&&!updating("video",this))}audioTimestampOffset(e){return void 0!==e&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(pushQueue({type:"audio",sourceUpdater:this,action:actions.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return void 0!==e&&this.videoBuffer&&this.videoTimestampOffset!==e&&(pushQueue({type:"video",sourceUpdater:this,action:actions.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&pushQueue({type:"audio",sourceUpdater:this,action:actions.callback(e),name:"callback"});}videoQueueCallback(e){this.videoBuffer&&pushQueue({type:"video",sourceUpdater:this,action:actions.callback(e),name:"callback"});}dispose(){this.trigger("dispose"),bufferTypes.forEach((e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`]((()=>cleanupBuffer(e,this)));})),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off();}}const uint8ToUtf8=e=>decodeURIComponent(escape(String.fromCharCode.apply(null,e))),VTT_LINE_TERMINATORS=new Uint8Array("\n\n".split("").map((e=>e.charCodeAt(0))));class VTTSegmentLoader extends SegmentLoader{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.loaderType_="subtitle",this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.shouldSaveSegmentTimingInfo_=!1;}createTransmuxer_(){return null}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return createTimeRanges();const e=this.subtitlesTrack_.cues;return createTimeRanges([[e[0].startTime,e[e.length-1].startTime]])}initSegmentForMap(e,t=!1){if(!e)return null;const i=initSegmentId(e);let s=this.initSegments_[i];if(t&&!s&&e.bytes){const t=VTT_LINE_TERMINATORS.byteLength+e.bytes.byteLength,n=new Uint8Array(t);n.set(e.bytes),n.set(VTT_LINE_TERMINATORS,e.bytes.byteLength),this.initSegments_[i]=s={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:n};}return s||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return void 0===e||(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_}remove(e,t){removeCuesFromTrack(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===REQUEST_ERRORS.TIMEOUT&&this.handleTimeout_(),e.code===REQUEST_ERRORS.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);const s=this.pendingSegment_;this.saveBandwidthRelatedStats_(s.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const n=s.segment;if(n.map&&(n.map.bytes=t.map.bytes),s.bytes=t.bytes,"function"!=typeof window_1.WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){let s;const n=()=>{this.subtitlesTrack_.tech_.off("vttjsloaded",s),this.stopForError({message:"Error loading vtt.js"});};return s=()=>{this.subtitlesTrack_.tech_.off("vttjserror",n),this.segmentRequestFinished_(e,t,i);},this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",s),void this.subtitlesTrack_.tech_.one("vttjserror",n)}n.requested=!0;try{this.parseVTTCues_(s);}catch(e){return void this.stopForError({message:e.message})}if(this.updateTimeMapping_(s,this.syncController_.timelines[s.timeline],this.playlist_),s.cues.length?s.timingInfo={start:s.cues[0].startTime,end:s.cues[s.cues.length-1].endTime}:s.timingInfo={start:s.startOfSegment,end:s.startOfSegment+s.duration},s.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");s.byteLength=s.bytes.byteLength,this.mediaSecondsLoaded+=n.duration,s.cues.forEach((e=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new window_1.VTTCue(e.startTime,e.endTime,e.text):e);})),removeDuplicateCuesFromTrack(this.subtitlesTrack_),this.handleAppendsDone_();}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(e){let t,i=!1;"function"==typeof window_1.TextDecoder?t=new window_1.TextDecoder("utf8"):(t=window_1.WebVTT.StringDecoder(),i=!0);const s=new window_1.WebVTT.Parser(window_1,window_1.vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},s.oncue=e.cues.push.bind(e.cues),s.ontimestampmap=t=>{e.timestampmap=t;},s.onparsingerror=e=>{videojs.log.warn("Error encountered when parsing cues: "+e.message);},e.segment.map){let t=e.segment.map.bytes;i&&(t=uint8ToUtf8(t)),s.parse(t);}let n=e.bytes;i&&(n=uint8ToUtf8(n)),s.parse(n),s.flush();}updateTimeMapping_(e,t,i){const s=e.segment;if(!t)return;if(!e.cues.length)return void(s.empty=!0);const n=e.timestampmap,r=n.MPEGTS/clock_1-n.LOCAL+t.mapping;if(e.cues.forEach((e=>{e.startTime+=r,e.endTime+=r;})),!i.syncInfo){const t=e.cues[0].startTime,n=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(t,n-s.duration)};}}}const findAdCue=function(e,t){const i=e.cues;for(let e=0;e<i.length;e++){const s=i[e];if(t>=s.adStartTime&&t<=s.adEndTime)return s}return null},updateAdCues=function(e,t,i=0){if(!e.segments)return;let s,n=i;for(let i=0;i<e.segments.length;i++){const r=e.segments[i];if(s||(s=findAdCue(t,n+r.duration/2)),s){if("cueIn"in r){s.endTime=n,s.adEndTime=n,n+=r.duration,s=null;continue}if(n<s.endTime){n+=r.duration;continue}s.endTime+=r.duration;}else if("cueOut"in r&&(s=new window_1.VTTCue(n,n+r.duration,r.cueOut),s.adStartTime=n,s.adEndTime=n+parseFloat(r.cueOut),t.addCue(s)),"cueOutCont"in r){const[e,i]=r.cueOutCont.split("/").map(parseFloat);s=new window_1.VTTCue(n,n+r.duration,""),s.adStartTime=n-e,s.adEndTime=s.adStartTime+i,t.addCue(s);}n+=r.duration;}},syncPointStrategies=[{name:"VOD",run:(e,t,i,s,n)=>{if(i!==1/0){return {time:0,segmentIndex:0,partIndex:null}}return null}},{name:"ProgramDateTime",run:(e,t,i,s,n)=>{if(!Object.keys(e.timelineToDatetimeMappings).length)return null;let r=null,a=null;const o=getPartsAndSegments(t);n=n||0;for(let i=0;i<o.length;i++){const s=o[t.endList||0===n?i:o.length-(i+1)],l=s.segment,d=e.timelineToDatetimeMappings[l.timeline];if(!d||!l.dateTimeObject)continue;let h=l.dateTimeObject.getTime()/1e3+d;if(l.parts&&"number"==typeof s.partIndex)for(let e=0;e<s.partIndex;e++)h+=l.parts[e].duration;const u=Math.abs(n-h);if(null!==a&&(0===u||a<u))break;a=u,r={time:h,segmentIndex:s.segmentIndex,partIndex:s.partIndex};}return r}},{name:"Segment",run:(e,t,i,s,n)=>{let r=null,a=null;n=n||0;const o=getPartsAndSegments(t);for(let e=0;e<o.length;e++){const i=o[t.endList||0===n?e:o.length-(e+1)],l=i.segment,d=i.part&&i.part.start||l&&l.start;if(l.timeline===s&&void 0!==d){const e=Math.abs(n-d);if(null!==a&&a<e)break;(!r||null===a||a>=e)&&(a=e,r={time:d,segmentIndex:i.segmentIndex,partIndex:i.partIndex});}}return r}},{name:"Discontinuity",run:(e,t,i,s,n)=>{let r=null;if(n=n||0,t.discontinuityStarts&&t.discontinuityStarts.length){let i=null;for(let s=0;s<t.discontinuityStarts.length;s++){const a=t.discontinuityStarts[s],o=t.discontinuitySequence+s+1,l=e.discontinuities[o];if(l){const e=Math.abs(n-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,s,n)=>{if(t.syncInfo){return {time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}}return null}}];class SyncController extends videojs.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={},this.logger_=logger("SyncController");}getSyncPoint(e,t,i,s){const n=this.runStrategies_(e,t,i,s);return n.length?this.selectSyncPoint_(n,{key:"time",value:s}):null}getExpiredTime(e,t){if(!e||!e.segments)return null;const i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length)return null;const s=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});return s.segmentIndex>0&&(s.time*=-1),Math.abs(s.time+sumDurations({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:s.segmentIndex,endIndex:0}))}runStrategies_(e,t,i,s){const n=[];for(let r=0;r<syncPointStrategies.length;r++){const a=syncPointStrategies[r],o=a.run(this,e,t,i,s);o&&(o.strategy=a.name,n.push({strategy:a.name,syncPoint:o}));}return n}selectSyncPoint_(e,t){let i=e[0].syncPoint,s=Math.abs(e[0].syncPoint[t.key]-t.value),n=e[0].strategy;for(let r=1;r<e.length;r++){const a=Math.abs(e[r].syncPoint[t.key]-t.value);a<s&&(s=a,i=e[r].syncPoint,n=e[r].strategy);}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${n}]: [time:${i.time}, segmentIndex:${i.segmentIndex}`+("number"==typeof i.partIndex?`,partIndex:${i.partIndex}`:"")+"]"),i}saveExpiredSegmentInfo(e,t){const i=t.mediaSequence-e.mediaSequence;if(i>86400)videojs.log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);else for(let s=i-1;s>=0;s--){const i=e.segments[s];if(i&&void 0!==i.start){t.syncInfo={mediaSequence:e.mediaSequence+s,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),s=e.segment;i&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:s.start}));const n=s.dateTimeObject;s.discontinuity&&t&&n&&(this.timelineToDatetimeMappings[s.timeline]=-n.getTime()/1e3);}timestampOffsetForTimeline(e){return void 0===this.timelines[e]?null:this.timelines[e].time}mappingForTimeline(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,i){const s=e.segment,n=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 n&&(n.start=r,n.end=a),(!s.start||r<s.start)&&(s.start=r),s.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 s=0;s<t.discontinuityStarts.length;s++){const n=t.discontinuityStarts[s],r=t.discontinuitySequence+s+1,a=n-e.mediaIndex,o=Math.abs(a);if(!this.discontinuities[r]||this.discontinuities[r].accuracy>o){let s;s=a<0?i.start-sumDurations({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:n}):i.end+sumDurations({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:n}),this.discontinuities[r]={time:s,accuracy:o};}}}dispose(){this.trigger("dispose"),this.off();}}class TimelineChangeController extends videojs.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={};}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange");}pendingTimelineChange({type:e,from:t,to:i}){return "number"==typeof t&&"number"==typeof i&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:i},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:i}){return "number"==typeof t&&"number"==typeof i&&(this.lastTimelineChanges_[e]={type:e,from:t,to:i},delete this.pendingTimelineChanges_[e],this.trigger("timelinechange")),this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off();}}const workerCode=transform(getWorkerString((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,s=0;s<i;++s)t[s].call(this,arguments[1]);else for(var n=Array.prototype.slice.call(arguments,1),r=t.length,a=0;a<r;++a)t[a].apply(this,n);},t.dispose=function(){this.listeners={};},t.pipe=function(e){this.on("data",(function(t){e.push(t);}));},e}();
548
+ /*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */let t=null;class i{constructor(e){let i,s,n;t||(t=function(){const e=[[[],[],[],[],[]],[[],[],[],[],[]]],t=e[0],i=e[1],s=t[4],n=i[4];let r,a,o;const l=[],d=[];let h,u,c,p,m,g;for(r=0;r<256;r++)d[(l[r]=r<<1^283*(r>>7))^r]=r;for(a=o=0;!s[a];a^=h||1,o=d[o]||1)for(p=o^o<<1^o<<2^o<<3^o<<4,p=p>>8^255&p^99,s[a]=p,n[p]=a,c=l[u=l[h=l[a]]],g=16843009*c^65537*u^257*h^16843008*a,m=257*l[p]^16843008*p,r=0;r<4;r++)t[r][a]=m=m<<24^m>>>8,i[r][p]=g=g<<24^g>>>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 d=e.slice(0),h=[];for(this._key=[d,h],i=o;i<4*o+28;i++)n=d[i-1],(i%o==0||8===o&&i%o==4)&&(n=r[n>>>24]<<24^r[n>>16&255]<<16^r[n>>8&255]<<8^r[255&n],i%o==0&&(n=n<<8^n>>>24^l<<24,l=l<<1^283*(l>>7))),d[i]=d[i-o]^n;for(s=0;i;s++,i--)n=d[3&s?i:i-4],h[s]=i<=4||s<4?n:a[0][r[n>>>24]]^a[1][r[n>>16&255]]^a[2][r[n>>8&255]]^a[3][r[255&n]];}decrypt(e,t,i,s,n,r){const a=this._key[1];let o,l,d,h=e^a[0],u=s^a[1],c=i^a[2],p=t^a[3];const m=a.length/4-2;let g,f=4;const _=this._tables[1],y=_[0],T=_[1],v=_[2],b=_[3],S=_[4];for(g=0;g<m;g++)o=y[h>>>24]^T[u>>16&255]^v[c>>8&255]^b[255&p]^a[f],l=y[u>>>24]^T[c>>16&255]^v[p>>8&255]^b[255&h]^a[f+1],d=y[c>>>24]^T[p>>16&255]^v[h>>8&255]^b[255&u]^a[f+2],p=y[p>>>24]^T[h>>16&255]^v[u>>8&255]^b[255&c]^a[f+3],f+=4,h=o,u=l,c=d;for(g=0;g<4;g++)n[(3&-g)+r]=S[h>>>24]<<24^S[u>>16&255]<<16^S[c>>8&255]<<8^S[255&p]^a[f++],o=h,h=u,u=c,c=p,p=o;}}class s 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 n=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),d=new Uint8Array(e.byteLength);let h=0;for(this.asyncStream_=new s,this.asyncStream_.push(this.decryptChunk_(l.subarray(h,h+o),t,i,d)),h=o;h<l.length;h+=o)i=new Uint32Array([n(l[h-4]),n(l[h-3]),n(l[h-2]),n(l[h-1])]),this.asyncStream_.push(this.decryptChunk_(l.subarray(h,h+o),t,i,d));this.asyncStream_.push((function(){var e;
549
+ /*! @name aes-decrypter @version 4.0.1 @license Apache-2.0 */a(null,(e=d).subarray(0,e.byteLength-e[e.byteLength-1]));}));}static get STEP(){return 32e3}decryptChunk_(e,t,s,r){return function(){const a=function(e,t,s){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 d,h,u,c,p,m,g,f,_;for(d=s[0],h=s[1],u=s[2],c=s[3],_=0;_<r.length;_+=4)p=n(r[_]),m=n(r[_+1]),g=n(r[_+2]),f=n(r[_+3]),a.decrypt(p,m,g,f,l,_),l[_]=n(l[_]^d),l[_+1]=n(l[_+1]^h),l[_+2]=n(l[_+2]^u),l[_+3]=n(l[_+3]^c),d=p,h=m,u=g,c=f;return o}(e,t,s);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,d,h=a.BigInt||Number;h("0x1"),h("0x100"),h("0x10000"),h("0x1000000"),h("0x100000000"),h("0x10000000000"),h("0x1000000000000"),h("0x100000000000000"),h("0x10000000000000000"),l=new Uint16Array([65484]),255===(d=new Uint8Array(l.buffer,l.byteOffset,l.byteLength))[0]||d[0];const u=function(e){const t={};return Object.keys(e).forEach((i=>{const s=e[i];var n;n=s,("function"===ArrayBuffer.isView?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer)?t[i]={bytes:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength}:t[i]=s;})),t};self.onmessage=function(e){const t=e.data,i=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),s=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),n=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new r(i,s,n,(function(e,i){self.postMessage(u({source:t.source,decrypted:i}),[i.buffer]);}));};})));var Decrypter=factory(workerCode);const audioTrackKind_=e=>{let t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},stopLoaders=(e,t)=>{e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null);},startLoaders=(e,t)=>{t.activePlaylistLoader=e,e.load();},onGroupChanged=(e,t)=>()=>{const{segmentLoaders:{[e]:i,main:s},mediaTypes:{[e]:n}}=t,r=n.activeTrack(),a=n.getActiveGroup(),o=n.activePlaylistLoader,l=n.lastGroup_;a&&l&&a.id===l.id||(n.lastGroup_=a,n.lastTrack_=r,stopLoaders(i,n),a&&!a.isMainPlaylist&&(a.playlistLoader?(i.resyncLoader(),startLoaders(a.playlistLoader,n)):o&&s.resetEverything()));},onGroupChanging=(e,t)=>()=>{const{segmentLoaders:{[e]:i},mediaTypes:{[e]:s}}=t;s.lastGroup_=null,i.abort(),i.pause();},onTrackChanged=(e,t)=>()=>{const{mainPlaylistLoader:i,segmentLoaders:{[e]:s,main:n},mediaTypes:{[e]:r}}=t,a=r.activeTrack(),o=r.getActiveGroup(),l=r.activePlaylistLoader,d=r.lastTrack_;if((!d||!a||d.id!==a.id)&&(r.lastGroup_=o,r.lastTrack_=a,stopLoaders(s,r),o)){if(o.isMainPlaylist){if(!a||!d||a.id===d.id)return;const e=t.vhs.playlistController_,s=e.selectPlaylist();if(e.media()===s)return;return r.logger_(`track change. Switching main audio from ${d.id} to ${a.id}`),i.pause(),n.resetEverything(),void e.fastQualityChange_(s)}if("AUDIO"===e){if(!o.playlistLoader)return n.setAudio(!0),void n.resetEverything();s.setAudio(!0),n.setAudio(!1);}l!==o.playlistLoader?(s.track&&s.track(a),s.resetEverything(),startLoaders(o.playlistLoader,r)):startLoaders(o.playlistLoader,r);}},onError={AUDIO:(e,t)=>()=>{const{segmentLoaders:{[e]:i},mediaTypes:{[e]:s},excludePlaylist:n}=t;stopLoaders(i,s);const r=s.activeTrack(),a=s.activeGroup(),o=(a.filter((e=>e.default))[0]||a[0]).id,l=s.tracks[o];if(r!==l){videojs.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const e in s.tracks)s.tracks[e].enabled=s.tracks[e]===l;s.onTrackChanged();}else n({error:{message:"Problem encountered loading the default audio track."}});},SUBTITLES:(e,t)=>()=>{const{segmentLoaders:{[e]:i},mediaTypes:{[e]:s}}=t;videojs.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),stopLoaders(i,s);const n=s.activeTrack();n&&(n.mode="disabled"),s.onTrackChanged();}},setupListeners={AUDIO:(e,t,i)=>{if(!t)return;const{tech:s,requestOptions:n,segmentLoaders:{[e]:r}}=i;t.on("loadedmetadata",(()=>{const e=t.media();r.playlist(e,n),(!s.paused()||e.endList&&"none"!==s.preload())&&r.load();})),t.on("loadedplaylist",(()=>{r.playlist(t.media(),n),s.paused()||r.load();})),t.on("error",onError[e](e,i));},SUBTITLES:(e,t,i)=>{const{tech:s,requestOptions:n,segmentLoaders:{[e]:r},mediaTypes:{[e]:a}}=i;t.on("loadedmetadata",(()=>{const e=t.media();r.playlist(e,n),r.track(a.activeTrack()),(!s.paused()||e.endList&&"none"!==s.preload())&&r.load();})),t.on("loadedplaylist",(()=>{r.playlist(t.media(),n),s.paused()||r.load();})),t.on("error",onError[e](e,i));}},initialize={AUDIO:(e,t)=>{const{vhs:i,sourceType:s,segmentLoaders:{[e]:n},requestOptions:r,main:{mediaGroups:a},mediaTypes:{[e]:{groups:o,tracks:l,logger_:d}},mainPlaylistLoader:h}=t,u=isAudioOnly(h.main);a[e]&&0!==Object.keys(a[e]).length||(a[e]={main:{default:{default:!0}}},u&&(a[e].main.default.playlists=h.main.playlists));for(const n in a[e]){o[n]||(o[n]=[]);for(const c in a[e][n]){let p,m=a[e][n][c];if(u?(d(`AUDIO group '${n}' label '${c}' is a main playlist`),m.isMainPlaylist=!0,p=null):p="vhs-json"===s&&m.playlists?new PlaylistLoader(m.playlists[0],i,r):m.resolvedUri?new PlaylistLoader(m.resolvedUri,i,r):m.playlists&&"dash"===s?new DashPlaylistLoader(m.playlists[0],i,r,h):null,m=merge({id:c,playlistLoader:p},m),setupListeners[e](e,m.playlistLoader,t),o[n].push(m),void 0===l[c]){const e=new videojs.AudioTrack({id:c,kind:audioTrackKind_(m),enabled:!1,language:m.language,default:m.default,label:c});l[c]=e;}}}n.on("error",onError[e](e,t));},SUBTITLES:(e,t)=>{const{tech:i,vhs:s,sourceType:n,segmentLoaders:{[e]:r},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[e]:{groups:l,tracks:d}},mainPlaylistLoader:h}=t;for(const r in o[e]){l[r]||(l[r]=[]);for(const u in o[e][r]){if(o[e][r][u].forced)continue;let c,p=o[e][r][u];if("hls"===n)c=new PlaylistLoader(p.resolvedUri,s,a);else if("dash"===n){if(!p.playlists.filter((e=>e.excludeUntil!==1/0)).length)return;c=new DashPlaylistLoader(p.playlists[0],s,a,h);}else "vhs-json"===n&&(c=new PlaylistLoader(p.playlists?p.playlists[0]:p.resolvedUri,s,a));if(p=merge({id:u,playlistLoader:c},p),setupListeners[e](e,p.playlistLoader,t),l[r].push(p),void 0===d[u]){const e=i.addRemoteTextTrack({id:u,kind:"subtitles",default:p.default&&p.autoselect,language:p.language,label:u},!1).track;d[u]=e;}}}r.on("error",onError[e](e,t));},"CLOSED-CAPTIONS":(e,t)=>{const{tech:i,main:{mediaGroups:s},mediaTypes:{[e]:{groups:n,tracks:r}}}=t;for(const t in s[e]){n[t]||(n[t]=[]);for(const a in s[e][t]){const o=s[e][t][a];if(!/^(?:CC|SERVICE)/.test(o.instreamId))continue;const l=i.options_.vhs&&i.options_.vhs.captionServices||{};let d={label:a,language:o.language,instreamId:o.instreamId,default:o.default&&o.autoselect};if(l[d.instreamId]&&(d=merge(d,l[d.instreamId])),void 0===d.default&&delete d.default,n[t].push(merge({id:a},o)),void 0===r[a]){const e=i.addRemoteTextTrack({id:d.instreamId,kind:"captions",default:d.default,language:d.language,label:d.label},!1).track;r[a]=e;}}}}},groupMatch=(e,t)=>{for(let i=0;i<e.length;i++){if(playlistMatch(t,e[i]))return !0;if(e[i].playlists&&groupMatch(e[i].playlists,t))return !0}return !1},activeGroup=(e,t)=>i=>{const{mainPlaylistLoader:s,mediaTypes:{[e]:{groups:n}}}=t,r=s.media();if(!r)return null;let a=null;r.attributes[e]&&(a=n[r.attributes[e]]);const o=Object.keys(n);if(!a)if("AUDIO"===e&&o.length>1&&isAudioOnly(t.main))for(let e=0;e<o.length;e++){const t=n[o[e]];if(groupMatch(t,r)){a=t;break}}else n.main?a=n.main:1===o.length&&(a=n[o[0]]);return void 0===i?a:null!==i&&a&&a.filter((e=>e.id===i.id))[0]||null},activeTrack={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}},getActiveGroup=(e,{mediaTypes:t})=>()=>{const i=t[e].activeTrack();return i?t[e].activeGroup(i):null},setupMediaGroups=e=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((t=>{initialize[t](t,e);}));const{mediaTypes:t,mainPlaylistLoader:i,tech:s,vhs:n,segmentLoaders:{AUDIO:r,main:a}}=e;["AUDIO","SUBTITLES"].forEach((i=>{t[i].activeGroup=activeGroup(i,e),t[i].activeTrack=activeTrack[i](i,e),t[i].onGroupChanged=onGroupChanged(i,e),t[i].onGroupChanging=onGroupChanging(i,e),t[i].onTrackChanged=onTrackChanged(i,e),t[i].getActiveGroup=getActiveGroup(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(),s.trigger({type:"usage",name:"vhs-audio-change"});};s.audioTracks().addEventListener("change",l),s.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),n.on("dispose",(()=>{s.audioTracks().removeEventListener("change",l),s.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged);})),s.clearTracks("audio");for(const e in t.AUDIO.tracks)s.audioTracks().addTrack(t.AUDIO.tracks[e]);},createMediaTypes=()=>{const e={};return ["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((t=>{e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:noop,activeTrack:noop,getActiveGroup:noop,onGroupChanged:noop,onTrackChanged:noop,lastTrack_:null,logger_:logger(`MediaGroups[${t}]`)};})),e};let Vhs$1;const loaderStats=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],sumLoaderStat=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},shouldSwitchToMedia=function({currentPlaylist:e,buffered:t,currentTime:i,nextPlaylist:s,bufferLowWaterLine:n,bufferHighWaterLine:r,duration:a,bufferBasedABR:o,log:l}){if(!s)return videojs.log.warn("We received no playlist to switch to. Please check your stream."),!1;const d=`allowing switch ${e&&e.id||"null"} -> ${s.id}`;if(!e)return l(`${d} as current playlist is not set`),!0;if(s.id===e.id)return !1;const h=Boolean(findRange(t,i).length);if(!e.endList)return h||"number"!=typeof e.partTargetDuration?(l(`${d} as current playlist is live`),!0):(l(`not ${d} as current playlist is live llhls, but currentTime isn't in buffered.`),!1);const u=timeAheadOf(t,i),c=o?Config.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Config.MAX_BUFFER_LOW_WATER_LINE;if(a<c)return l(`${d} as duration < max low water line (${a} < ${c})`),!0;const p=s.attributes.BANDWIDTH,m=e.attributes.BANDWIDTH;if(p<m&&(!o||u<r)){let e=`${d} as next bandwidth < current bandwidth (${p} < ${m})`;return o&&(e+=` and forwardBuffer < bufferHighWaterLine (${u} < ${r})`),l(e),!0}if((!o||p>m)&&u>=n){let e=`${d} as forwardBuffer >= bufferLowWaterLine (${u} >= ${n})`;return o&&(e+=` and next bandwidth > current bandwidth (${p} > ${m})`),l(e),!0}return l(`not ${d} as no switching criteria met`),!1};class PlaylistController extends videojs.EventTarget{constructor(e){super();const{src:t,withCredentials:i,tech:s,bandwidth:n,externVhs:r,useCueTags:a,playlistExclusionDuration:o,enableLowInitialPlaylist:l,sourceType:d,cacheEncryptionKeys:h,bufferBasedABR:u,leastPixelDiffSelector:c,captionServices:p}=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),Vhs$1=r,this.bufferBasedABR=Boolean(u),this.leastPixelDiffSelector=Boolean(c),this.withCredentials=i,this.tech_=s,this.vhs_=s.vhs,this.sourceType_=d,this.useCueTags_=a,this.playlistExclusionDuration=o,this.maxPlaylistRetries=m,this.enableLowInitialPlaylist=l,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:i,maxPlaylistRetries:m,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=createMediaTypes(),this.mediaSource=new window_1.MediaSource,this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.seekable_=createTimeRanges(),this.hasPlayed_=!1,this.syncController_=new SyncController(e),this.segmentMetadataTrack_=s.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new Decrypter,this.sourceUpdater_=new SourceUpdater(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new TimelineChangeController;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:n,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:h,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings};this.mainPlaylistLoader_="dash"===this.sourceType_?new DashPlaylistLoader(t,this.vhs_,this.requestOptions_):new PlaylistLoader(t,this.vhs_,this.requestOptions_),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new SegmentLoader(merge(g,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new SegmentLoader(merge(g,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new VTTSegmentLoader(merge(g,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks}),e),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",(()=>this.startABRTimer_())),this.tech_.on("pause",(()=>this.stopABRTimer_())),this.tech_.on("play",(()=>this.startABRTimer_()))),loaderStats.forEach((e=>{this[e+"_"]=sumLoaderStat.bind(this,e);})),this.logger_=logger("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 f="none"===this.tech_.preload()?"play":"loadstart";this.tech_.one(f,(()=>{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 s=this.media(),n=s&&(s.id||s.uri),r=e.id||e.uri;n&&n!==r&&(this.logger_(`switch media ${n} -> ${r} from ${t}`),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})),this.mainPlaylistLoader_.media(e,i);}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=window_1.setInterval((()=>this.checkABR_()),250);}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(window_1.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,s=Object.keys(i);let n;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)n=this.mediaTypes_.AUDIO.activeTrack();else {const e=i.main||s.length&&i[s[0]];for(const t in e)if(e[t].default){n={label:t};break}}if(!n)return t;const r=[];for(const t in i)if(i[t][n.label]){const s=i[t][n.label];if(s.playlists&&s.playlists.length)r.push.apply(r,s.playlists);else if(s.uri)r.push(s);else if(e.playlists.length)for(let i=0;i<e.playlists.length;i++){const s=e.playlists[i];s.attributes&&s.attributes.AUDIO&&s.attributes.AUDIO===t&&r.push(s);}}return r.length?r:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",(()=>{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;isLowestEnabledRendition(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()),setupMediaGroups({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),e),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",(()=>{this.trigger("selectedinitialmedia");}));})),this.mainPlaylistLoader_.on("loadedplaylist",(()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let e=this.mainPlaylistLoader_.media();if(!e){let t;if(this.excludeUnsupportedVariants_(),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;isLowestEnabledRendition(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0});})),this.mainPlaylistLoader_.on("playlistunchanged",(()=>{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"});}));}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load());}triggerPresenceUsage_(e,t){const i=e.mediaGroups||{};let s=!0;const n=Object.keys(i.AUDIO);for(const e in i.AUDIO)for(const t in i.AUDIO[e]){i.AUDIO[e][t].uri||(s=!1);}s&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),Vhs$1.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),n.length&&Object.keys(i.AUDIO[n[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"});}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,i=this.tech_.currentTime(),s=this.bufferLowWaterLine(),n=this.bufferHighWaterLine(),r=this.tech_.buffered();return shouldSwitchToMedia({buffered:r,currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:s,bufferHighWaterLine:n,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",(()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate");})),this.mainSegmentLoader_.on("timeout",(()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load();})),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",(()=>{this.trigger("progress");})),this.mainSegmentLoader_.on("error",(()=>{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.mainSegmentLoader_.on("earlyabort",(e=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:120}));}));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();}));}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load();}fastQualityChange_(e=this.selectPlaylist()){e!==this.mainPlaylistLoader_.media()?(this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything((()=>{videojs.browser.IE_VERSION||videojs.browser.IS_EDGE?this.tech_.setCurrentTime(this.tech_.currentTime()+.04):this.tech_.setCurrentTime(this.tech_.currentTime());}))):this.logger_("skipping fastQualityChange because new media is same as old");}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){const e=this.seekable();if(!e.length)return !1;if(videojs.browser.IE_VERSION&&0===this.tech_.readyState())return this.tech_.one("loadedmetadata",(()=>{this.trigger("firstplay"),this.tech_.setCurrentTime(e.end(0)),this.hasPlayed_=!0;})),!1;this.trigger("firstplay"),this.tech_.setCurrentTime(e.end(0));}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){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=Vhs$1.Playlist.playlistEnd(e,t),s=this.tech_.currentTime(),n=this.tech_.buffered();if(!n.length)return i-s<=.1;const r=n.end(n.length-1);return r-s<=.1&&i-r<=.1}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 s=this.mainPlaylistLoader_.main.playlists,n=s.filter(isEnabled),r=1===n.length&&n[0]===e;if(1===s.length&&i!==1/0)return videojs.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){let t=!1;s.forEach((i=>{if(i===e)return;const s=i.excludeUntil;void 0!==s&&s!==1/0&&(t=!0,delete i.excludeUntil);})),t&&(videojs.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_:videojs.log.warn,d=t.message?" "+t.message:"";l(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${d} 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 h=o.targetDuration/2*1e3||5e3,u="number"==typeof o.lastRequest&&Date.now()-o.lastRequest<=h;return this.switchMedia_(o,"exclude",r||u)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_();}delegateLoaders_(e,t){const i=[],s="all"===e;(s||"main"===e)&&i.push(this.mainPlaylistLoader_);const n=[];(s||"audio"===e)&&n.push("AUDIO"),(s||"subtitle"===e)&&(n.push("CLOSED-CAPTIONS"),n.push("SUBTITLES")),n.forEach((e=>{const t=this.mediaTypes_[e]&&this.mediaTypes_[e].activePlaylistLoader;t&&i.push(t);})),["main","audio","subtitle"].forEach((t=>{const s=this[`${t}SegmentLoader_`];!s||e!==t&&"all"!==e||i.push(s);})),i.forEach((e=>t.forEach((t=>{"function"==typeof e[t]&&e[t]();}))));}setCurrentTime(e){const t=findRange(this.tech_.buffered(),e);return this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media()&&this.mainPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Vhs$1.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}onSyncInfoUpdate_(){let e;if(!this.mainPlaylistLoader_)return;let t=this.mainPlaylistLoader_.media();if(!t)return;let i=this.syncController_.getExpiredTime(t,this.duration());if(null===i)return;const s=this.mainPlaylistLoader_.main,n=Vhs$1.Playlist.seekable(t,i,Vhs$1.Playlist.liveEdgeDelay(s,t));if(0===n.length)return;if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),i=this.syncController_.getExpiredTime(t,this.duration()),null===i)return;if(e=Vhs$1.Playlist.seekable(t,i,Vhs$1.Playlist.liveEdgeDelay(s,t)),0===e.length)return}let r,a;this.seekable_&&this.seekable_.length&&(r=this.seekable_.end(0),a=this.seekable_.start(0)),e?e.start(0)>n.end(0)||n.start(0)>e.end(0)?this.seekable_=n:this.seekable_=createTimeRanges([[e.start(0)>n.start(0)?e.start(0):n.start(0),e.end(0)<n.end(0)?e.end(0):n.end(0)]]):this.seekable_=n,this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===r&&this.seekable_.start(0)===a||(this.logger_(`seekable updated [${printableRange(this.seekable_)}]`),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=Vhs$1.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.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_()||{}};e.video=e.main;const t=codecsForPlaylist(this.main(),this.media()),i={},s=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(i.video=t.video||e.main.videoCodec||DEFAULT_VIDEO_CODEC),e.main.isMuxed&&(i.video+=`,${t.audio||e.main.audioCodec||DEFAULT_AUDIO_CODEC}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||s)&&(i.audio=t.audio||e.main.audioCodec||e.audio.audioCodec||DEFAULT_AUDIO_CODEC,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!i.audio&&!i.video)return void this.excludePlaylist({playlistToExclude:this.media(),error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});const n={};let r;if(["video","audio"].forEach((function(t){if(i.hasOwnProperty(t)&&(s=e[t].isFmp4,a=i[t],!(s?browserSupportsCodec(a):muxerSupportsCodec(a)))){const s=e[t].isFmp4?"browser":"muxer";n[s]=n[s]||[],n[s].push(i[t]),"audio"===t&&(r=s);}var s,a;})),s&&r&&this.media().attributes.AUDIO){const e=this.media().attributes.AUDIO;this.main().playlists.forEach((t=>{(t.attributes&&t.attributes.AUDIO)===e&&t!==this.media()&&(t.excludeUntil=1/0);})),this.logger_(`excluding audio group ${e} as ${r} does not support codec(s): "${i.audio}"`);}if(!Object.keys(n).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const e=[];if(["video","audio"].forEach((t=>{const s=(parseCodecs(this.sourceUpdater_.codecs[t]||"")[0]||{}).type,n=(parseCodecs(i[t]||"")[0]||{}).type;s&&n&&s.toLowerCase()!==n.toLowerCase()&&e.push(`"${this.sourceUpdater_.codecs[t]}" -> "${i[t]}"`);})),e.length)return void this.excludePlaylist({playlistToExclude:this.media(),error:{message:`Codec switching not supported: ${e.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0})}return i}{const e=Object.keys(n).reduce(((e,t)=>(e&&(e+=", "),e+=`${t} does not support codec(s): "${n[t].join(",")}"`)),"")+".";this.excludePlaylist({playlistToExclude:this.media(),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 s=e[i];if(-1!==t.indexOf(s.id))return;t.push(s.id);const n=codecsForPlaylist(this.main,s),r=[];!n.audio||muxerSupportsCodec(n.audio)||browserSupportsCodec(n.audio)||r.push(`audio codec ${n.audio}`),!n.video||muxerSupportsCodec(n.video)||browserSupportsCodec(n.video)||r.push(`video codec ${n.video}`),n.text&&"stpp.ttml.im1t"===n.text&&r.push(`text codec ${n.text}`),r.length&&(s.excludeUntil=1/0,this.logger_(`excluding ${s.id} for unsupported: ${r.join(", ")}`));}));}excludeIncompatibleVariants_(e){const t=[],i=this.main().playlists,s=unwrapCodecList(parseCodecs(e)),n=codecCount(s),r=s.video&&parseCodecs(s.video)[0]||null,a=s.audio&&parseCodecs(s.audio)[0]||null;Object.keys(i).forEach((e=>{const s=i[e];if(-1!==t.indexOf(s.id)||s.excludeUntil===1/0)return;t.push(s.id);const o=[],l=codecsForPlaylist(this.mainPlaylistLoader_.main,s),d=codecCount(l);if(l.audio||l.video){if(d!==n&&o.push(`codec count "${d}" !== "${n}"`),!this.sourceUpdater_.canChangeType()){const e=l.video&&parseCodecs(l.video)[0]||null,t=l.audio&&parseCodecs(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&&(s.excludeUntil=1/0,this.logger_(`excluding ${s.id}: ${o.join(" && ")}`));}}));}updateAdCues_(e){let t=0;const i=this.seekable();i.length&&(t=i.start(0)),updateAdCues(e,this.cueTagsTrack_,t);}goalBufferLength(){const e=this.tech_.currentTime(),t=Config.GOAL_BUFFER_LENGTH,i=Config.GOAL_BUFFER_LENGTH_RATE,s=Math.max(t,Config.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,s)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=Config.BUFFER_LOW_WATER_LINE,i=Config.BUFFER_LOW_WATER_LINE_RATE,s=Math.max(t,Config.MAX_BUFFER_LOW_WATER_LINE),n=Math.max(t,Config.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?n:s)}bufferHighWaterLine(){return Config.BUFFER_HIGH_WATER_LINE}}class Representation{constructor(e,t,i){const{playlistController_:s}=e,n=s.fastQualityChange_.bind(s);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=codecsForPlaylist(s.main(),t),this.playlist=t,this.id=i,this.enabled=(r=e.playlists,a=t.id,o=n,e=>{const t=r.main.playlists[a],i=isIncompatible(t),s=isEnabled(t);return void 0===e?s:(e?delete t.disabled:t.disabled=!0,e===s||i||(o(),e?r.trigger("renditionenabled"):r.trigger("renditiondisabled")),e)});}}const timerCancelEvents=["seeking","seeked","pause","playing","error"];class PlaybackWatcher{constructor(e){this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=logger("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),i=()=>this.monitorCurrentTime_(),s=()=>this.techWaiting_(),n=()=>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",s),this.tech_.on(timerCancelEvents,n),this.tech_.on("canplay",i),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",s),this.tech_.off(timerCancelEvents,n),this.tech_.off("canplay",i),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),a.forEach((e=>{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_&&window_1.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_();};}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&window_1.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=window_1.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_`],s=i.buffered_(),n=isRangeDifferent(this[`${e}Buffered_`],s);this[`${e}Buffered_`]=s,n?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:timeRangesToArray(s)}),this[`${e}StalledDownloads_`]<10||(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),"subtitle"!==e&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0})));}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+.1>=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e);}resetTimeUpdate_(){this.consecutiveUpdates=0;}fixesBadSeeks_(){if(!this.tech_.seeking())return !1;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:.1);}if(void 0!==i)return this.logger_(`Trying to seek outside of seekable at time ${t} with seekable range ${printableRange(e)}. Seeking to ${i}.`),this.tech_.setCurrentTime(i),!0;const s=this.playlistController_.sourceUpdater_,n=this.tech_.buffered(),r=s.audioBuffer?s.audioBuffered():null,a=s.videoBuffer?s.videoBuffered():null,o=this.media(),l=o.partTargetDuration?o.partTargetDuration:2*(o.targetDuration-TIME_FUDGE_FACTOR),d=[r,a];for(let e=0;e<d.length;e++){if(!d[e])continue;if(timeAheadOf(d[e],t)<l)return !1}const h=findNextRange(n,t);return 0!==h.length&&(i=h.start(0)+.1,this.logger_(`Buffered region starts (${h.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=findRange(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_,s=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 n=findNextRange(s,t);return n.length>0&&(this.logger_(`Stopped at ${t} and seeking to ${n.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0)}afterSeekableWindow_(e,t,i,s=!1){if(!e.length)return !1;let n=e.end(e.length-1)+.1;return !i.endList&&s&&(n=e.end(e.length-1)+3*i.targetDuration),t>n}beforeSeekableWindow_(e,t){return !!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:i}){if(!e)return;let s;if(e.length&&t.length){const n=findRange(e,i-3),r=findRange(e,i),a=findRange(t,i);a.length&&!r.length&&n.length&&(s={start:n.end(0),end:a.end(0)});}else {findNextRange(e,i).length||(s=this.gapFromVideoUnderflow_(e,i));}return !!s&&(this.logger_(`Encountered a gap in video from ${s.start} to ${s.end}. Seeking to current time ${i}`),!0)}skipTheGap_(e){const t=this.tech_.buffered(),i=this.tech_.currentTime(),s=findNextRange(t,i);this.resetTimeUpdate_(),0!==s.length&&i===e&&(this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",s.start(0)),this.tech_.setCurrentTime(s.start(0)+TIME_FUDGE_FACTOR),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}));}gapFromVideoUnderflow_(e,t){const i=findGaps(e);for(let e=0;e<i.length;e++){const s=i.start(e),n=i.end(e);if(t-s<4&&t-s>2)return {start:s,end:n}}return null}}const defaultOptions={errorInterval:30,getSource(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},initPlugin=function(e,t){let i=0,s=0;const n=merge(defaultOptions,t);e.ready((()=>{e.trigger({type:"usage",name:"vhs-error-reload-initialized"});}));const r=function(){s&&e.currentTime(s);},a=function(t){null!=t&&(s=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*n.errorInterval)e.trigger({type:"usage",name:"vhs-error-reload-canceled"});else {if(n.getSource&&"function"==typeof n.getSource)return i=Date.now(),n.getSource.call(e,a);videojs.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(),initPlugin(e,t);};},reloadSourceOnError=function(e){initPlugin(this,e);};var version$4="3.0.0",version$3="6.2.0",version$2="1.0.1",version$1="6.0.0",version="4.0.1";const Vhs={PlaylistLoader:PlaylistLoader,Playlist:Playlist,utils:utils,STANDARD_PLAYLIST_SELECTOR:lastBandwidthSelector,INITIAL_PLAYLIST_SELECTOR:lowestBitrateCompatibleVariantSelector,lastBandwidthSelector:lastBandwidthSelector,movingAverageBandwidthSelector:movingAverageBandwidthSelector,comparePlaylistBandwidth:comparePlaylistBandwidth,comparePlaylistResolution:comparePlaylistResolution,xhr:xhrFactory()};Object.keys(Config).forEach((e=>{Object.defineProperty(Vhs,e,{get:()=>(videojs.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),Config[e]),set(t){videojs.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),"number"!=typeof t||t<0?videojs.log.warn(`value of Vhs.${e} must be greater than or equal to 0`):Config[e]=t;}});}));const handleVhsMediaChange=function(e,t){const i=t.media();let s=-1;for(let t=0;t<e.length;t++)if(e[t].id===i.id){s=t;break}e.selectedIndex_=s,e.trigger({selectedIndex:s,type:"change"});},handleVhsLoadedMetadata=function(e,t){t.representations().forEach((t=>{e.addQualityLevel(t);})),handleVhsMediaChange(e,t.playlists);};Vhs.canPlaySource=function(){return videojs.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const emeKeySystems=(e,t,i)=>{if(!e)return e;let s={};t&&t.attributes&&t.attributes.CODECS&&(s=unwrapCodecList(parseCodecs(t.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(s.audio=i.attributes.CODECS);const n=getMimeForCodec(s.video),r=getMimeForCodec(s.audio),a={};for(const i in e)a[i]={},r&&(a[i].audioContentType=r),n&&(a[i].videoContentType=n),t.contentProtection&&t.contentProtection[i]&&t.contentProtection[i].pssh&&(a[i].pssh=t.contentProtection[i].pssh),"string"==typeof e[i]&&(a[i].url=e[i]);return merge(e,a)},getAllPsshKeySystemsOptions=(e,t)=>e.reduce(((e,i)=>{if(!i.contentProtection)return e;const s=t.reduce(((e,t)=>{const s=i.contentProtection[t];return s&&s.pssh&&(e[t]={pssh:s.pssh}),e}),{});return Object.keys(s).length&&e.push(s),e}),[]),waitForKeySessionCreation=({player:e,sourceKeySystems:t,audioMedia:i,mainPlaylists:s})=>{if(!e.eme.initializeMediaKeys)return Promise.resolve();const n=i?s.concat([i]):s,r=getAllPsshKeySystemsOptions(n,Object.keys(t)),a=[],o=[];return r.forEach((t=>{o.push(new Promise(((t,i)=>{e.tech_.one("keysessioncreated",t);}))),a.push(new Promise(((i,s)=>{e.eme.initializeMediaKeys({keySystems:t},(e=>{e?s(e):i();}));})));})),Promise.race([Promise.all(a),Promise.race(o)])},setupEmeOptions=({player:e,sourceKeySystems:t,media:i,audioMedia:s})=>{const n=emeKeySystems(t,i,s);return !!n&&(e.currentSource().keySystems=n,!(n&&!e.eme)||(videojs.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1))},getVhsLocalStorage=()=>{if(!window_1.localStorage)return null;const e=window_1.localStorage.getItem("videojs-vhs");if(!e)return null;try{return JSON.parse(e)}catch(e){return null}},updateVhsLocalStorage=e=>{if(!window_1.localStorage)return !1;let t=getVhsLocalStorage();t=t?merge(t,e):e;try{window_1.localStorage.setItem("videojs-vhs",JSON.stringify(t));}catch(e){return !1}return t};Vhs.supportsNativeHls=function(){if(!document_1||!document_1.createElement)return !1;const e=document_1.createElement("video");if(!videojs.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))}))}(),Vhs.supportsNativeDash=!!(document_1&&document_1.createElement&&videojs.getTech("Html5").isSupported())&&/maybe|probably/i.test(document_1.createElement("video").canPlayType("application/dash+xml")),Vhs.supportsTypeNatively=e=>"hls"===e?Vhs.supportsNativeHls:"dash"===e&&Vhs.supportsNativeDash,Vhs.isSupported=function(){return videojs.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const Component=videojs.getComponent("Component");class VhsHandler extends Component{constructor(e,t,i){if(super(t,i.vhs),"number"==typeof i.initialBandwidth&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=logger("VhsHandler"),t.options_&&t.options_.playerId){const e=videojs.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(document_1,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],(e=>{const t=document_1.fullscreenElement||document_1.webkitFullscreenElement||document_1.mozFullScreenElement||document_1.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_(){if(this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.useBandwidthFromLocalStorage=void 0!==this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=!1!==this.options_.llhls,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,"number"!=typeof this.options_.playlistExclusionDuration&&(this.options_.playlistExclusionDuration=300),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){const e=getVhsLocalStorage();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=Config.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Config.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach((e=>{void 0!==this.source_[e]&&(this.options_[e]=this.source_[e]);})),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio;}src(e,t){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=Vhs,this.options_.sourceType=simpleTypeFromSourceType(t),this.options_.seekTo=e=>{this.tech_.setCurrentTime(e);},this.playlistController_=new PlaylistController(this.options_);const s=merge({liveRangeSafeTimeDelta:.1},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new PlaybackWatcher(s),this.playlistController_.on("error",(()=>{const e=videojs.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 n=this.options_.bufferBasedABR?Vhs.movingAverageBandwidthSelector(.55):Vhs.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):n.bind(this),this.playlistController_.selectInitialPlaylist=Vhs.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=window_1.navigator.connection||window_1.navigator.mozConnection||window_1.navigator.webkitConnection,i=1e7;if(this.options_.useNetworkInformationApi&&t){const s=1e3*t.downlink*1e3;e=s>=i&&e>=i?Math.max(e,s):s;}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(){videojs.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:()=>timeRangesToArray(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:()=>timeRangesToArray(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&&updateVhsLocalStorage({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)});})),this.playlistController_.on("selectedinitialmedia",(()=>{var e;(e=this).representations=()=>{const t=e.playlistController_.main(),i=isAudioOnly(t)?e.playlistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter((e=>!isIncompatible(e))).map(((t,i)=>new Representation(e,t,t.id))):[]};})),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",(()=>{this.setupEme_();})),this.on(this.playlistController_,"progress",(function(){this.tech_.trigger("progress");})),this.on(this.playlistController_,"firstplay",(function(){this.ignoreNextSeekingEvent_=!0;})),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=window_1.URL.createObjectURL(this.playlistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_));}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),waitForKeySessionCreation({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=setupEmeOptions({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});this.player_.tech_.on("keystatuschange",(e=>{if("output-restricted"!==e.status)return;const t=this.playlistController_.main();if(!t||!t.playlists)return;const i=[];t.playlists.forEach((e=>{e&&e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height>=720&&(!e.excludeUntil||e.excludeUntil<1/0)&&(e.excludeUntil=1/0,i.push(e));})),i.length&&(videojs.log.warn('DRM keystatus changed to "output-restricted." Removing the following HD playlists that will most likely fail to play and clearing the buffer. This may be due to HDCP restrictions on the stream and the capabilities of the current device.',...i),this.playlistController_.fastQualityChange_());})),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),11!==videojs.browser.IE_VERSION&&t?this.createKeySessions_():this.playlistController_.sourceUpdater_.initializedEme();}setupQualityLevels_(){const e=videojs.players[this.tech_.options_.playerId];e&&e.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",(()=>{handleVhsLoadedMetadata(this.qualityLevels_,this);})),this.playlists.on("mediachange",(()=>{handleVhsMediaChange(this.qualityLevels_,this.playlists);})));}static version(){return {"@videojs/http-streaming":version$4,"mux.js":version$3,"mpd-parser":version$2,"m3u8-parser":version$1,"aes-decrypter":version}}version(){return this.constructor.version()}canChangeType(){return SourceUpdater.canChangeType()}play(){this.playlistController_.play();}setCurrentTime(e){this.playlistController_.setCurrentTime(e);}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&window_1.URL.revokeObjectURL&&(window_1.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose();}convertToProgramTime(e,t){return getProgramTime({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=!0,s=2){return seekToProgramTime({programTime:e,playlist:this.playlistController_.media(),retryCount:s,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}}const VhsSourceHandler={name:"videojs-http-streaming",VERSION:version$4,canHandleSource(e,t={}){const i=merge(videojs.options,t);return VhsSourceHandler.canPlayType(e.type,i)},handleSource(e,t,i={}){const s=merge(videojs.options,i);return t.vhs=new VhsHandler(e,t,s),t.vhs.xhr=xhrFactory(),t.vhs.src(e.src,e.type),t.vhs},canPlayType(e,t={}){const{vhs:{overrideNative:i=!videojs.browser.IS_ANY_SAFARI}={}}=merge(videojs.options,t),s=simpleTypeFromSourceType(e);return s&&(!Vhs.supportsTypeNatively(s)||i)?"maybe":""}};browserSupportsCodec("avc1.4d400d,mp4a.40.2")&&videojs.getTech("Html5").registerSourceHandler(VhsSourceHandler,0),videojs.VhsHandler=VhsHandler,videojs.VhsSourceHandler=VhsSourceHandler,videojs.Vhs=Vhs,videojs.use||videojs.registerComponent("Vhs",Vhs),videojs.options.vhs=videojs.options.vhs||{},videojs.getPlugin&&videojs.getPlugin("reloadSourceOnError")||videojs.registerPlugin("reloadSourceOnError",reloadSourceOnError);
550
+
551
+ const NAME$1="videoplayer",SELECTOR_TOGGLE="[data-bs-video]",itLang={"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 del 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:"Muto",Unmute:"Audio","Playback Rate":"Tasso 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":"Riprduci 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 della trascrizione dei sottotitoli","subtitles settings":"Parametri dei sottotitoli","descriptions settings":"Parametri delle 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",Dropshadow:"Ombreggiatura","Font Family":"Famiglia di caratteri","Proportional Sans-Serif":"Carattere a spaziatura variabile senza grazie (Proportional Sans-Serif)","Monospace Sans-Serif":"Carattere a spaziatura fissa senza grazie (Monospace Sans-Serif)","Proportional Serif":"Carattere a spaziatura variabile con grazie (Proportional Serif)","Monospace Serif":"Carattere a spaziatura fissa con grazie (Monospace Serif)","Small Caps":"Maiuscoletto",Reset:"Reinizializza","restore all settings to the default values":"Ripristina i valori predefiniti per tutti i parametri",Done:"Operazione completata","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"},DEFAULT_CONFIG={languages:{it:itLang},language:"it"},Default={};window.videojs=videojs;class VideoPlayer extends BaseComponent{constructor(e,i){super(e),e.classList.add("video-js","vjs-theme-bootstrap-italia","vjs-fluid","vjs-big-play-centered"),this._config=this._getConfig(i),this.player=videojs(e,DEFAULT_CONFIG);}setYouTubeVideo(e){this.player.tech("youtube"),this.player.src({type:"video/youtube",src:e});}static get NAME(){return NAME$1}_getConfig(e){return e={...Default,...Manipulator.getDataAttributes(this._element),..."object"==typeof e?e:{}}}}const players=SelectorEngine$1.find(SELECTOR_TOGGLE);players.length>0&&players.forEach((e=>{VideoPlayer.getOrCreateInstance(e);}));const VideoPlayer$1 = VideoPlayer;
552
+
553
+ const NAME="acceptoverlay",SELECTOR_DATA_TOGGLE="[data-bs-accept-from]",SELECTOR_DATA_REMEMBER="[data-bs-accept-remember]";class AcceptOverlay extends BaseComponent{constructor(e,t){super(e.closest(".acceptoverlay"));const s=cookies.isChoiceRemembered(t.service);if(this._isShown=!0,this._toggleElement=e,s)return this.hide(),void setTimeout((()=>{this._toggleElement.dispatchEvent(new Event("click"));}),100);this._toggleElement.addEventListener("click",(()=>{this.hide(),this._remember=this._toggleElement.parentElement.querySelector(SELECTOR_DATA_REMEMBER).checked,cookies.rememberChoice(t.service,this._remember);}));}static get NAME(){return NAME}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("show"),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&&reflow(this._element),this._element.classList.add("show");this._queueCallback((()=>{this._isTransitioning=!1;}),this._element,e);}_hideElement(){this._element.setAttribute("aria-hidden",!0),this._isTransitioning=!1;}}const acceptOverlays=SelectorEngine$1.find(SELECTOR_DATA_TOGGLE);acceptOverlays.length>0&&acceptOverlays.forEach((e=>{AcceptOverlay.getOrCreateInstance(e,{service:e.dataset.bsAcceptFrom});}));const AcceptOverlay$1 = AcceptOverlay;
554
+
555
+ loadPlugin(icons),init$1();const bootstrapItalia_entry = {Alert:Alert$1,Button:Button$2,Carousel:Carousel$1,Collapse:Collapse$1,Dropdown:Dropdown$1,Modal:Modal$1,Offcanvas:Offcanvas$1,Popover:Popover$1,ScrollSpy:ScrollSpy$1,Tab:Tab$1,Toast:Toast$1,Tooltip:Tooltip$1,VideoPlayer:VideoPlayer$1,AcceptOverlay:AcceptOverlay$1,Accordion:Accordion$1,BackToTop:BackToTop$1,CarouselBI:CarouselBI$1,Cookiebar:Cookiebar$1,Dimmer:Dimmer$1,FormValidate:FormValidate,Forward:Forward$1,HistoryBack:HistoryBack$1,Input:Input$1,InputNumber:InputNumber$1,InputPassword:InputPassword$1,InputSearchAutocomplete:InputSearchAutocomplete,List:List$1,Masonry:Masonry$1,NavBarCollapsible:NavBarCollapsible$1,NavScroll:NavScroll$1,Notification:Notification$1,ProgressDonut:ProgressDonut$1,SelectAutocomplete:SelectAutocomplete$1,Sticky:Sticky$1,HeaderSticky:HeaderSticky$1,Transfer:Transfer$1,UploadDragDrop:UploadDragDrop$1,ValidatorSelectAutocomplete:ValidatorSelectAutocomplete,loadFonts:loadFonts,cookies:cookies};
430
556
 
431
557
  return bootstrapItalia_entry;
432
558