!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).VintomPlayer={})}(this,(function(exports){"use strict";var __defProp2=Object.defineProperty,__typeError=e=>{throw TypeError(e)},__defNormalProp2=(e,t,r)=>t in e?__defProp2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__publicField2=(e,t,r)=>__defNormalProp2(e,"symbol"!=typeof t?t+"":t,r),__accessCheck=(e,t,r)=>t.has(e)||__typeError("Cannot "+r),__privateGet=(e,t,r)=>(__accessCheck(e,t,"read from private field"),r?r.call(e):t.get(e)),__privateAdd=(e,t,r)=>t.has(e)?__typeError("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),__privateSet=(e,t,r,n)=>(__accessCheck(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),__privateMethod=(e,t,r)=>(__accessCheck(e,t,"access private method"),r),_a,_e2,_e3,_t,_n,_d_instances,i_fn,o_fn,r_fn,a_fn,s_fn,_c,_u,_d2,_u2,_l,_u3,_b,_c2,_p,_f,_g2,_m2,_h2,_v,_Ce_instances,y_fn,w_fn,I_fn,M_fn,b_fn,_t2,_n2,_s,_a2,_r,_D_instances,o_fn2,_t3,_t4,_c3,_d3,_d4,_e4,_l2,_u4,_h3,_v2,_g3,_b2,_S,_p2,_f2,_m3,_y,_X_instances,C_fn,w_fn2,O_fn,F_fn,P_fn,I_fn2,R_fn,j_fn,B_fn,M_fn2,A_fn,N_fn,x_fn,_f3;!function(e){function t(t,r){var n=e.createEvent("Event");n.initEvent(t,!0,!1),r.dispatchEvent(n)}function r(t){return function(r,i){return t!==s.exit||e[n.element]?(e.addEventListener(n.events.change,(function t(){r(),e.removeEventListener(n.events.change,t,!1)}),!1),void e.addEventListener(n.events.error,(function t(){i(new TypeError),e.removeEventListener(n.events.error,t,!1)}),!1)):void setTimeout((function(){i(new TypeError)}),1)}}var n,i,a={w3:{enabled:"fullscreenEnabled",element:"fullscreenElement",request:"requestFullscreen",exit:"exitFullscreen",events:{change:"fullscreenchange",error:"fullscreenerror"}},webkit:{enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:{change:"webkitfullscreenchange",error:"webkitfullscreenerror"}},moz:{enabled:"mozFullScreenEnabled",element:"mozFullScreenElement",request:"mozRequestFullScreen",exit:"mozCancelFullScreen",events:{change:"mozfullscreenchange",error:"mozfullscreenerror"}},ms:{enabled:"msFullscreenEnabled",element:"msFullscreenElement",request:"msRequestFullscreen",exit:"msExitFullscreen",events:{change:"MSFullscreenChange",error:"MSFullscreenError"}}},s=a.w3;for(i in a)if(a[i].enabled in e){n=a[i];break}s.enabled in e||!n||(e.addEventListener(n.events.change,(function(r){r.stopPropagation(),r.stopImmediatePropagation(),e[s.enabled]=e[n.enabled],e[s.element]=e[n.element],t(s.events.change,r.target)}),!1),e.addEventListener(n.events.error,(function(e){t(s.events.error,e.target)}),!1),e[s.enabled]=e[n.enabled],e[s.element]=e[n.element],e[s.exit]=function(){var t=e[n.exit]();return!t&&Promise?new Promise(r(s.exit)):t},Element.prototype[s.request]=function(){var e=this[n.request].apply(this,arguments);return!e&&Promise?new Promise(r(s.request)):e})}(document);var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function getAugmentedNamespace(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}var _Reflect={},hasRequired_Reflect; /*! ***************************************************************************** Copyright (C) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */function require_Reflect(){return hasRequired_Reflect||(hasRequired_Reflect=1,t=e||(e={}),function(){var e="object"==typeof globalThis?globalThis:"object"==typeof commonjsGlobal?commonjsGlobal:"object"==typeof self?self:"object"==typeof this?this:function(){try{return Function("return this;")()}catch(e){}}()||function(){try{return(0,eval)("(function() { return this; })()")}catch(e){}}(),r=n(t);function n(e,t){return function(r,n){Object.defineProperty(e,r,{configurable:!0,writable:!0,value:n}),t&&t(r,n)}}void 0!==e.Reflect&&(r=n(e.Reflect,r)),function(e,t){var r=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,i=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",a=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",s="function"==typeof Object.create,o={__proto__:[]}instanceof Array,l=!s&&!o,u={create:s?function(){return de(Object.create(null))}:o?function(){return de({__proto__:null})}:function(){return de({})},has:l?function(e,t){return r.call(e,t)}:function(e,t){return t in e},get:l?function(e,t){return r.call(e,t)?e[t]:void 0}:function(e,t){return e[t]}},c=Object.getPrototypeOf(Function),d="function"==typeof Map&&"function"==typeof Map.prototype.entries?Map:le(),h="function"==typeof Set&&"function"==typeof Set.prototype.entries?Set:ue(),p="function"==typeof WeakMap?WeakMap:ce(),f=n?Symbol.for("@reflect-metadata:registry"):void 0,m=ie(),g=ae(m);function y(e,t,r,n){if(F(r)){if(!G(e))throw new TypeError;if(!Z(t))throw new TypeError;return k(e,t)}if(!G(e))throw new TypeError;if(!U(t))throw new TypeError;if(!U(n)&&!F(n)&&!B(n))throw new TypeError;return B(n)&&(n=void 0),P(e,t,r=H(r),n)}function v(e,t){function r(r,n){if(!U(r))throw new TypeError;if(!F(n)&&!K(n))throw new TypeError;M(e,t,r,n)}return r}function _(e,t,r,n){if(!U(r))throw new TypeError;return F(n)||(n=H(n)),M(e,t,r,n)}function b(e,t,r){if(!U(t))throw new TypeError;return F(r)||(r=H(r)),x(e,t,r)}function T(e,t,r){if(!U(t))throw new TypeError;return F(r)||(r=H(r)),I(e,t,r)}function S(e,t,r){if(!U(t))throw new TypeError;return F(r)||(r=H(r)),R(e,t,r)}function E(e,t,r){if(!U(t))throw new TypeError;return F(r)||(r=H(r)),D(e,t,r)}function w(e,t){if(!U(e))throw new TypeError;return F(t)||(t=H(t)),L(e,t)}function A(e,t){if(!U(e))throw new TypeError;return F(t)||(t=H(t)),O(e,t)}function C(e,t,r){if(!U(t))throw new TypeError;if(F(r)||(r=H(r)),!U(t))throw new TypeError;F(r)||(r=H(r));var n=oe(t,r,!1);return!F(n)&&n.OrdinaryDeleteMetadata(e,t,r)}function k(e,t){for(var r=e.length-1;r>=0;--r){var n=(0,e[r])(t);if(!F(n)&&!B(n)){if(!Z(n))throw new TypeError;t=n}}return t}function P(e,t,r,n){for(var i=e.length-1;i>=0;--i){var a=(0,e[i])(t,r,n);if(!F(a)&&!B(a)){if(!U(a))throw new TypeError;n=a}}return n}function x(e,t,r){if(I(e,t,r))return!0;var n=re(t);return!B(n)&&x(e,n,r)}function I(e,t,r){var n=oe(t,r,!1);return!F(n)&&V(n.OrdinaryHasOwnMetadata(e,t,r))}function R(e,t,r){if(I(e,t,r))return D(e,t,r);var n=re(t);return B(n)?void 0:R(e,n,r)}function D(e,t,r){var n=oe(t,r,!1);if(!F(n))return n.OrdinaryGetOwnMetadata(e,t,r)}function M(e,t,r,n){oe(r,n,!0).OrdinaryDefineOwnMetadata(e,t,r,n)}function L(e,t){var r=O(e,t),n=re(e);if(null===n)return r;var i=L(n,t);if(i.length<=0)return r;if(r.length<=0)return i;for(var a=new h,s=[],o=0,l=r;o=0&&e=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:r,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var r=this._find(e,!0);return this._values[r]=t,this},t.prototype.delete=function(t){var r=this._find(t,!1);if(r>=0){for(var n=this._keys.length,i=r+1;i{var e,t,r,n,i,a,s,o,l,u,c,d,h,p,f,m,g;const y={instance:null,initialize:null};e=new WeakMap,t=new WeakSet,r=function(){return null!=y.instance},n=function(){__privateMethod(this,t,a).call(this),y.instance.ready((()=>{__privateSet(this,e,!0),__privateMethod(this,t,s).call(this)}))},i=function(e){return __privateMethod(this,t,f).call(this),__privateMethod(this,t,u).call(this,e,null)},a=function(){this.futureInstantTasks.forEach((e=>e())),this.futureInstantTasks=[]},s=function(){this.futureAfterReadyTasks.forEach((e=>e())),this.futureAfterReadyTasks=[]},o=function(e){__privateMethod(this,t,f).call(this),__privateGet(this,t,r)?e(y.instance):this.futureInstantTasks.push((()=>e(y.instance)))},l=function(r){__privateMethod(this,t,f).call(this),__privateGet(this,e)?r(y.instance):this.futureAfterReadyTasks.push((()=>r(y.instance)))},u=function(e,n){return __privateMethod(this,t,f).call(this),__privateGet(this,t,r)?e(y.instance):n instanceof Function?n():n},c=function(e){if(this.listenersBindingMap.has(e))return this.listenersBindingMap.get(e);const r=r=>{const n={...r,data:__privateMethod(this,t,m).call(this,r.data),target:this};e.call(this,n)};return this.listenersBindingMap.set(e,r),r},d=function(e,r){__privateMethod(this,t,g).call(this,e);const n=__privateMethod(this,t,c).call(this,r);y.instance.on(e,n)},h=function(e,r){__privateMethod(this,t,g).call(this,e);const n=__privateMethod(this,t,c).call(this,r);y.instance.once(e,n)},p=function(e,t){const r=this.listenersBindingMap.get(t);r&&(y.instance.off(e,r),this.listenersBindingMap.delete(t))},f=function(){if(this.isApiDisposed)throw new Error("Cannot interact with disposed player.");if(this.lastError)throw new Error("Player is in error state.")},m=function(e){const t={...e};return t.element&&(t.element={id:e.element.id}),t},g=function(e){if(e.startsWith("_"))throw new Error("Event names should only contain A-Z, 0-9 and .")};return{api:new class{constructor(){__privateAdd(this,t),__publicField2(this,"lastError",null),__publicField2(this,"isApiDisposed",!1),__publicField2(this,"futureInstantTasks",[]),__publicField2(this,"futureAfterReadyTasks",[]),__privateAdd(this,e,!1),__publicField2(this,"listenersBindingMap",new Map),y.initialize=()=>__privateMethod(this,t,n).call(this)}isLoading(){return __privateMethod(this,t,u).call(this,(e=>e.isLoading()),!1)}setCurrentTime(e){__privateMethod(this,t,l).call(this,(t=>t.setCurrentTime(e)))}getCurrentTime(){return __privateMethod(this,t,u).call(this,(e=>e.getCurrentTime()),0)}setPlaybackRate(e){__privateMethod(this,t,o).call(this,(t=>t.setPlaybackRate(e)))}getPlaybackRate(){return __privateMethod(this,t,u).call(this,(e=>e.getPlaybackRate()),1)}getDuration(){return __privateMethod(this,t,u).call(this,(e=>e.getDuration()),NaN)}getPlaybackState(){return __privateMethod(this,t,u).call(this,(e=>e.getPlaybackState()),"initializing")}getCurrentScenarioElement(){return __privateMethod(this,t,u).call(this,(e=>({id:e.getCurrentScenarioElement().id})),null)}setIsMuted(e){__privateMethod(this,t,o).call(this,(t=>t.setIsMuted(e)))}isMuted(){return __privateMethod(this,t,u).call(this,(e=>e.isMuted()),!1)}getVideoId(){return __privateMethod(this,t,u).call(this,(e=>e.getVideoId()),"")}getVolume(){return __privateMethod(this,t,u).call(this,(e=>e.getVolume()),1)}setVolume(e){__privateMethod(this,t,o).call(this,(t=>t.setVolume(e)))}trigger(e,r){__privateMethod(this,t,o).call(this,(t=>t.trigger(e,r)))}isEnded(){return __privateMethod(this,t,u).call(this,(e=>e.isEnded()),!1)}isPaused(){return __privateMethod(this,t,u).call(this,(e=>e.isPaused()),!1)}isPlaying(){return __privateMethod(this,t,u).call(this,(e=>e.isPlaying()),!1)}goToScenarioElement(e,t){return this.callAsyncMethod((r=>r.goToScenarioElement(e,t)))}getElement(){return __privateMethod(this,t,u).call(this,(e=>e.getElement()),null)}ready(e){__privateMethod(this,t,o).call(this,(t=>t.ready(e)))}play(){__privateMethod(this,t,l).call(this,(e=>e.play()))}replay(){__privateMethod(this,t,l).call(this,(e=>e.replay()))}pause(){__privateMethod(this,t,l).call(this,(e=>e.pause()))}off(e,r){__privateMethod(this,t,o).call(this,(()=>__privateMethod(this,t,p).call(this,e,r)))}on(e,r){__privateMethod(this,t,o).call(this,(()=>__privateMethod(this,t,d).call(this,e,r)))}once(e,r){__privateMethod(this,t,o).call(this,(()=>__privateMethod(this,t,h).call(this,e,r)))}dispose(){__privateMethod(this,t,o).call(this,(e=>{e.dispose(),y.instance=null,this.listenersBindingMap.clear()})),this.isApiDisposed=!0}isDisposed(){return __privateMethod(this,t,u).call(this,(e=>e.isDisposed()),this.isApiDisposed)}getPlugin(e){return __privateMethod(this,t,i).call(this,(t=>t.getPlugin(e)))}isLooping(){return __privateMethod(this,t,u).call(this,(e=>e.isLooping()),!1)}isIdle(){return __privateMethod(this,t,u).call(this,(e=>e.isIdle()),!1)}startLooping(e){__privateMethod(this,t,l).call(this,(t=>t.startLooping(e)))}stopLooping(){__privateMethod(this,t,l).call(this,(e=>e.stopLooping()))}setDebugModeEnabled(e){__privateMethod(this,t,o).call(this,(t=>t.setDebugModeEnabled(e)))}isDebugModeEnabled(){return __privateMethod(this,t,u).call(this,(e=>e.isDebugModeEnabled()),!1)}areSubtitlesEnabled(){return __privateMethod(this,t,u).call(this,(e=>e.areSubtitlesEnabled()),!1)}setSubtitlesEnabled(e){__privateMethod(this,t,o).call(this,(t=>t.setSubtitlesEnabled(e)))}callAsyncMethod(r){return __privateMethod(this,t,f).call(this),__privateGet(this,e)?r(y.instance):new Promise(((e,t)=>{this.futureAfterReadyTasks.push((()=>r(y.instance).then(e).catch(t)))}))}},initialize:e=>{if(y.instance)throw new Error("Player already initialized");y.instance=e,y.initialize()}}};function e(e){return("object"==typeof e&&null!==e||"function"==typeof e)&&"function"==typeof e.then}function t$1(e){switch(typeof e){case"string":case"symbol":return e.toString();case"function":return e.name;default:throw new Error(`Unexpected ${typeof e} service id type`)}}const n$1=Symbol.for("@inversifyjs/common/islazyServiceIdentifier");_a=n$1;class r{constructor(e){__publicField2(this,_a),__privateAdd(this,_e2),__privateSet(this,_e2,e),this[n$1]=!0}static is(e){return"object"==typeof e&&null!==e&&!0===e[n$1]}unwrap(){return __privateGet(this,_e2).call(this)}}function t(e,t){return Reflect.getOwnMetadata(t,e)}function n(e,t,r){Reflect.defineMetadata(t,r,e)}function a(e,r,n,i){const a=i(t(e,r)??n());Reflect.defineMetadata(r,a,e)}_e2=new WeakMap;const s={Request:"Request",Singleton:"Singleton",Transient:"Transient"},c={ConstantValue:"ConstantValue",DynamicValue:"DynamicValue",Factory:"Factory",Instance:"Instance",Provider:"Provider",ResolvedValue:"ResolvedValue",ServiceRedirection:"ServiceRedirection"};function*u(...e){for(const t of e)yield*t}const _d=class e{constructor(e){__privateAdd(this,_d_instances),__privateAdd(this,_e3),__privateAdd(this,_t),__privateAdd(this,_n),__privateSet(this,_e3,new Map),__privateSet(this,_t,{});for(const t of Reflect.ownKeys(e))__privateGet(this,_t)[t]=new Map;__privateSet(this,_n,e)}add(e,t){__privateMethod(this,_d_instances,i_fn).call(this,e).push(t);for(const r of Reflect.ownKeys(t))__privateMethod(this,_d_instances,o_fn).call(this,r,t[r]).push(e)}clone(){const t=Reflect.ownKeys(__privateGet(this,_n)),r=new e(__privateGet(this,_n));__privateMethod(this,_d_instances,r_fn).call(this,__privateGet(this,_e3),__privateGet(r,_e3));for(const e of t)__privateMethod(this,_d_instances,r_fn).call(this,__privateGet(this,_t)[e],__privateGet(r,_t)[e]);return r}get(e,t){return __privateGet(this,_t)[e].get(t)}getAllKeys(e){return __privateGet(this,_t)[e].keys()}removeByRelation(e,t){const r=this.get(e,t);if(void 0===r)return;const n=new Set(r);for(const i of n){const r=__privateGet(this,_e3).get(i);if(void 0===r)throw new Error("Expecting model relation, none found");for(const n of r)n[e]===t&&__privateMethod(this,_d_instances,a_fn).call(this,i,n);__privateGet(this,_e3).delete(i)}}};_e3=new WeakMap,_t=new WeakMap,_n=new WeakMap,_d_instances=new WeakSet,i_fn=function(e){let t=__privateGet(this,_e3).get(e);return void 0===t&&(t=[],__privateGet(this,_e3).set(e,t)),t},o_fn=function(e,t){let r=__privateGet(this,_t)[e].get(t);return void 0===r&&(r=[],__privateGet(this,_t)[e].set(t,r)),r},r_fn=function(e,t){for(const[r,n]of e)t.set(r,[...n])},a_fn=function(e,t){for(const r of Reflect.ownKeys(t))__privateMethod(this,_d_instances,s_fn).call(this,e,r,t[r])},s_fn=function(e,t,r){const n=__privateGet(this,_t)[t].get(r);if(void 0!==n){const i=n.indexOf(e);-1!==i&&n.splice(i,1),0===n.length&&__privateGet(this,_t)[t].delete(r)}};let d=_d;var l,p,f,e2;e2=l||(l={}),e2.moduleId="moduleId",e2.serviceId="serviceId";const _g=class e{constructor(e,t){__privateAdd(this,_c),__privateAdd(this,_u),__privateSet(this,_c,t??new d({moduleId:{isOptional:!0},serviceId:{isOptional:!1}})),__privateSet(this,_u,e)}static build(t){return new e(t)}add(e,t){__privateGet(this,_c).add(e,t)}clone(){return new e(__privateGet(this,_u),__privateGet(this,_c).clone())}get(e){var t;const r=[],n=__privateGet(this,_c).get(l.serviceId,e);void 0!==n&&r.push(n);const i=null==(t=__privateGet(this,_u))?void 0:t.get(e);if(void 0!==i&&r.push(i),0!==r.length)return u(...r)}removeAllByModuleId(e){__privateGet(this,_c).removeByRelation(l.moduleId,e)}removeAllByServiceId(e){__privateGet(this,_c).removeByRelation(l.serviceId,e)}};_c=new WeakMap,_u=new WeakMap;let g=_g;!function(e){e.id="id",e.moduleId="moduleId",e.serviceId="serviceId"}(p||(p={}));const _m=class e{constructor(e,t){__privateAdd(this,_d2),__privateAdd(this,_u2),__privateSet(this,_d2,t??new d({id:{isOptional:!1},moduleId:{isOptional:!0},serviceId:{isOptional:!1}})),__privateSet(this,_u2,e)}static build(t){return new e(t)}clone(){return new e(__privateGet(this,_u2),__privateGet(this,_d2).clone())}get(e){var t;return this.getNonParentBindings(e)??(null==(t=__privateGet(this,_u2))?void 0:t.get(e))}getById(e){var t;return __privateGet(this,_d2).get(p.id,e)??(null==(t=__privateGet(this,_u2))?void 0:t.getById(e))}getByModuleId(e){var t;return __privateGet(this,_d2).get(p.moduleId,e)??(null==(t=__privateGet(this,_u2))?void 0:t.getByModuleId(e))}getNonParentBindings(e){return __privateGet(this,_d2).get(p.serviceId,e)}getNonParentBoundServices(){return __privateGet(this,_d2).getAllKeys(p.serviceId)}removeById(e){__privateGet(this,_d2).removeByRelation(p.id,e)}removeAllByModuleId(e){__privateGet(this,_d2).removeByRelation(p.moduleId,e)}removeAllByServiceId(e){__privateGet(this,_d2).removeByRelation(p.serviceId,e)}set(e){const t={[p.id]:e.id,[p.serviceId]:e.serviceIdentifier};void 0!==e.moduleId&&(t[p.moduleId]=e.moduleId),__privateGet(this,_d2).add(e,t)}};_d2=new WeakMap,_u2=new WeakMap;let m=_m;!function(e){e.moduleId="moduleId",e.serviceId="serviceId"}(f||(f={}));const _h=class e{constructor(e,t){__privateAdd(this,_l),__privateAdd(this,_u3),__privateSet(this,_l,t??new d({moduleId:{isOptional:!0},serviceId:{isOptional:!1}})),__privateSet(this,_u3,e)}static build(t){return new e(t)}add(e,t){__privateGet(this,_l).add(e,t)}clone(){return new e(__privateGet(this,_u3),__privateGet(this,_l).clone())}get(e){var t;const r=[],n=__privateGet(this,_l).get(f.serviceId,e);void 0!==n&&r.push(n);const i=null==(t=__privateGet(this,_u3))?void 0:t.get(e);if(void 0!==i&&r.push(i),0!==r.length)return u(...r)}removeAllByModuleId(e){__privateGet(this,_l).removeByRelation(f.moduleId,e)}removeAllByServiceId(e){__privateGet(this,_l).removeByRelation(f.serviceId,e)}};_l=new WeakMap,_u3=new WeakMap;let h=_h;const y="@inversifyjs/core/classMetadataReflectKey";function M$1(){return{constructorArguments:[],lifecycle:{postConstructMethodName:void 0,preDestroyMethodName:void 0},properties:new Map,scope:void 0}}const I$1="@inversifyjs/core/pendingClassMetadataCountReflectKey",w$1=Symbol.for("@inversifyjs/core/InversifyCoreError");class b extends(_c2=Error,_b=w$1,_c2){constructor(e,t,r){super(t,r),__publicField2(this,_b),__publicField2(this,"kind"),this[w$1]=!0,this.kind=e}static is(e){return"object"==typeof e&&null!==e&&!0===e[w$1]}static isErrorOfKind(e,t){return b.is(e)&&e.kind===t}}var j$1,T$1,C$1;function S(e){const r=t(e,y)??M$1();if(!function(e){const r=t(e,I$1);return void 0!==r&&0!==r}(e))return function(e,t){const r=[];if(t.length0)throw new b(j$1.missingInjectionDecorator,`Found unexpected missing metadata on type "${e.name}" at constructor indexes "${r.join('", "')}".\n\nAre you using @inject, @multiInject or @unmanaged decorators at those indexes?\n\nIf you're using typescript and want to rely on auto injection, set "emitDecoratorMetadata" compiler option to true`)}(e,r.constructorArguments),r;!function(e,t){const r=[];for(let n=0;n{void 0!==t&&t.kind===T$1.unknown&&a(e,I$1,A$1,(e=>e-1))}}function x$1(e,t){return(...r)=>n=>{if(void 0===n)return e(...r);if(n.kind===C$1.unmanaged)throw new b(j$1.injectionDecoratorConflict,"Unexpected injection found. Multiple @inject, @multiInject or @unmanaged decorators found");return t(n,...r)}}function B$1(e){if(e.kind!==T$1.unknown&&!0!==e.isFromTypescriptParamType)throw new b(j$1.injectionDecoratorConflict,"Unexpected injection found. Multiple @inject, @multiInject or @unmanaged decorators found")}!function(e){e[e.injectionDecoratorConflict=0]="injectionDecoratorConflict",e[e.missingInjectionDecorator=1]="missingInjectionDecorator",e[e.planning=2]="planning",e[e.resolution=3]="resolution",e[e.unknown=4]="unknown"}(j$1||(j$1={})),function(e){e[e.unknown=32]="unknown"}(T$1||(T$1={})),function(e){e[e.multipleInjection=0]="multipleInjection",e[e.singleInjection=1]="singleInjection",e[e.unmanaged=2]="unmanaged"}(C$1||(C$1={}));const R$1=x$1((function(e,t){return{kind:e,name:void 0,optional:!1,tags:new Map,value:t}}),(function(e,t,r){return B$1(e),{...e,kind:t,value:r}}));function k$1(e,t){return r=>{const n=r.properties.get(t);return r.properties.set(t,e(n)),r}}var P$1;function D$1(e,t,r,n){if(b.isErrorOfKind(n,j$1.injectionDecoratorConflict)){const i=function(e,t,r){if(void 0===r){if(void 0===t)throw new b(j$1.unknown,"Unexpected undefined property and index values");return{kind:P$1.property,property:t,targetClass:e.constructor}}return"number"==typeof r?{index:r,kind:P$1.parameter,targetClass:e}:{kind:P$1.method,method:t,targetClass:e}}(e,t,r);throw new b(j$1.injectionDecoratorConflict,`Unexpected injection error.\n\nCause:\n\n${n.message}\n\nDetails\n\n${function(e){switch(e.kind){case P$1.method:return`[class: "${e.targetClass.name}", method: "${e.method.toString()}"]`;case P$1.parameter:return`[class: "${e.targetClass.name}", index: "${e.index.toString()}"]`;case P$1.property:return`[class: "${e.targetClass.name}", property: "${e.property.toString()}"]`}}(i)}`,{cause:n})}throw n}function V$1(e,t){return(r,n,i)=>{try{void 0===i?function(e,t){const r=F$1(e,t);return(e,t)=>{a(e.constructor,y,M$1,k$1(r(e),t))}}(e,t)(r,n):"number"==typeof i?function(e,t){const r=F$1(e,t);return(e,t,n)=>{if(!function(e,t){return"function"==typeof e&&void 0===t}(e,t))throw new b(j$1.injectionDecoratorConflict,`Found an @inject decorator in a non constructor parameter.\nFound @inject decorator at method "${(null==t?void 0:t.toString())??""}" at class "${e.constructor.name}"`);a(e,y,M$1,function(e,t){return r=>{const n=r.constructorArguments[t];return r.constructorArguments[t]=e(n),r}}(r(e),n))}}(e,t)(r,n,i):function(e,t){const r=F$1(e,t);return(e,t,n)=>{if(void 0===n.set)throw new b(j$1.injectionDecoratorConflict,`Found an @inject decorator in a non setter property method.\nFound @inject decorator at method "${t.toString()}" at class "${e.constructor.name}"`);a(e.constructor,y,M$1,k$1(r(e),t))}}(e,t)(r,n,i)}catch(s){D$1(r,n,i,s)}}}function F$1(e,t){return r=>{const n=t(r);return t=>(n(t),e(t))}}function O$1(e){return V$1(R$1(C$1.singleInjection,e),$$1)}!function(e){e[e.method=0]="method",e[e.parameter=1]="parameter",e[e.property=2]="property"}(P$1||(P$1={}));const N$1="@inversifyjs/core/classIsInjectableFlagReflectKey",E$1=[Array,BigInt,Boolean,Function,Number,Object,String];function U$1(e){const r=t(e,"design:paramtypes");void 0!==r&&a(e,y,M$1,function(e){return t=>(e.forEach(((e,r)=>{var n,i;void 0!==t.constructorArguments[r]||(n=e,E$1.includes(n))||(t.constructorArguments[r]=(i=e,{isFromTypescriptParamType:!0,kind:C$1.singleInjection,name:void 0,optional:!1,tags:new Map,value:i}))})),t)}(r))}function K(e){return e=>{!function(e){if(void 0!==t(e,N$1))throw new b(j$1.injectionDecoratorConflict,`Cannot apply @injectable decorator multiple times at class "${e.name}"`);n(e,N$1,!0)}(e),U$1(e)}}function J(e){return V$1(R$1(C$1.multipleInjection,e),$$1)}var oe;!function(e){e[e.multipleInjection=0]="multipleInjection",e[e.singleInjection=1]="singleInjection"}(oe||(oe={}));const _re=class e{constructor(e){__privateAdd(this,_p),__privateSet(this,_p,e)}get name(){return __privateGet(this,_p).elem.name}get serviceIdentifier(){return __privateGet(this,_p).elem.serviceIdentifier}get tags(){return __privateGet(this,_p).elem.tags}getAncestor(){if(void 0!==__privateGet(this,_p).previous)return new e(__privateGet(this,_p).previous)}};_p=new WeakMap;let re=_re;class ae{constructor(e){__publicField2(this,"last"),this.last=e}concat(e){return new ae({elem:e,previous:this.last})}[Symbol.iterator](){let e=this.last;return{next:()=>{if(void 0===e)return{done:!0,value:void 0};const t=e.elem;return e=e.previous,{done:!1,value:t}}}}}function se(e,t,r){const n=(null==r?void 0:r.customServiceIdentifier)??t.serviceIdentifier,i=[...e.getBindings(n)??[]].filter((e=>e.isSatisfiedBy(t)));if(0===i.length&&void 0!==e.autobindOptions&&"function"==typeof n){const t=(a=e.autobindOptions,{cache:{isRight:!1,value:void 0},id:0,implementationType:s=n,isSatisfiedBy:()=>!0,moduleId:void 0,onActivation:void 0,onDeactivation:void 0,scope:a.scope,serviceIdentifier:s,type:c.Instance});e.setBinding(t),i.push(t)}var a,s;return i}function ce(e){return void 0!==e.redirections}function ue(e,t,r,n){var i;let a,s;var o,l,u,d;ce(r)?(a=r.binding.targetServiceIdentifier,s=r.binding.serviceIdentifier):(a=r.serviceIdentifier,s=null==(i=r.parent)?void 0:i.binding.serviceIdentifier),Array.isArray(e)?function(e,t,r,n,i){if(0!==e.length){const t=`Ambiguous bindings found for service: "${t$1(r)}".\n\nRegistered bindings:\n\n${e.map((e=>function(e){switch(e.type){case c.Instance:return`[ type: "${e.type}", serviceIdentifier: "${t$1(e.serviceIdentifier)}", scope: "${e.scope}", implementationType: "${e.implementationType.name}" ]`;case c.ServiceRedirection:return`[ type: "${e.type}", serviceIdentifier: "${t$1(e.serviceIdentifier)}", redirection: "${t$1(e.targetServiceIdentifier)}" ]`;default:return`[ type: "${e.type}", serviceIdentifier: "${t$1(e.serviceIdentifier)}", scope: "${e.scope}" ]`}}(e.binding))).join("\n")}\n\nTrying to resolve bindings for "${le(r,n)}".\n\n${pe(i)}`;throw new b(j$1.planning,t)}t||de(r,n,i)}(e,t,a,s,n):(o=t,l=a,u=s,d=n,void 0!==e||o||de(l,u,d))}function de(e,t,r){const n=`No bindings found for service: "${t$1(e)}".\n\nTrying to resolve bindings for "${le(e,t)}".\n\n${pe(r)}`;throw new b(j$1.planning,n)}function le(e,t){return void 0===t?`${t$1(e)} (Root service)`:t$1(t)}function pe(e){var t;const r=0===e.tags.size?"":`\n- tags:\n - ${[...e.tags.keys()].map((e=>e.toString())).join("\n - ")}`;return`Binding constraints:\n- service identifier: ${t$1(e.serviceIdentifier)}\n- name: ${(null==(t=e.name)?void 0:t.toString())??"-"}${r}`}function fe(e,t,r){if(1!==e.redirections.length)ue(e.redirections,t,e,r);else{const[n]=e.redirections;ce(n)&&fe(n,t,r)}}function ge(e,t,r){if(Array.isArray(e.bindings)&&1===e.bindings.length){const[n]=e.bindings;ce(n)&&fe(n,t,r)}else ue(e.bindings,t,e,r)}function me(e,t){if((r=t)instanceof Error&&(r instanceof RangeError&&/stack space|call stack|too much recursion/i.test(r.message)||"InternalError"===r.name&&/too much recursion/.test(r.message))){const r=function(e){const t=[...e];return 0===t.length?"(No dependency trace)":t.map(t$1).join(" -> ")}(function(e){const t=new Set;for(const r of e.servicesBranch){if(t.has(r))return[...t,r];t.add(r)}return[...t]}(e));throw new b(j$1.planning,`Circular dependency found: ${r}`,{cause:t})}var r;throw t}function he(e){try{const t=new Map;void 0!==e.rootConstraints.tag&&t.set(e.rootConstraints.tag.key,e.rootConstraints.tag.value);const r=new ae({elem:{name:e.rootConstraints.name,serviceIdentifier:e.rootConstraints.serviceIdentifier,tags:t},previous:void 0}),n=new re(r.last),i=se(e,n),a=[],s={bindings:a,parent:void 0,serviceIdentifier:e.rootConstraints.serviceIdentifier};if(a.push(...we(e,r,i,s)),!e.rootConstraints.isMultiple){ge(s,e.rootConstraints.isOptional??!1,n);const[t]=a;s.bindings=t}return{tree:{root:s}}}catch(t){me(e,t)}}function ve(e,t,r,n){const i={binding:t,classMetadata:e.getClassMetadata(t.implementationType),constructorParams:[],parent:n,propertyParams:new Map};return je({autobindOptions:e.autobindOptions,getBindings:e.getBindings,getClassMetadata:e.getClassMetadata,node:i,servicesBranch:e.servicesBranch,setBinding:e.setBinding},r)}function ye(e,t,n){if(n.kind===C$1.unmanaged)return;const i=r.is(n.value)?n.value.unwrap():n.value,a=t.concat({name:n.name,serviceIdentifier:i,tags:n.tags}),s=new re(a.last),o=se(e,s),l=[],u={bindings:l,parent:e.node,serviceIdentifier:i};if(l.push(...we(e,a,o,u)),n.kind===C$1.singleInjection){ge(u,n.optional,s);const[e]=l;u.bindings=e}return u}function Me(e,t,n){const i=r.is(n.value)?n.value.unwrap():n.value,a=t.concat({name:n.name,serviceIdentifier:i,tags:n.tags}),s=new re(a.last),o=se(e,s),l=[],u={bindings:l,parent:e.node,serviceIdentifier:i};if(l.push(...we(e,a,o,u)),n.kind===oe.singleInjection){ge(u,n.optional,s);const[e]=l;u.bindings=e}return u}function Ie(e,t,r,n){const i={binding:t,params:[],parent:n};return je({autobindOptions:e.autobindOptions,getBindings:e.getBindings,getClassMetadata:e.getClassMetadata,node:i,servicesBranch:e.servicesBranch,setBinding:e.setBinding},r)}function we(e,t,r,n){const i=ce(n)?n.binding.targetServiceIdentifier:n.serviceIdentifier;e.servicesBranch.push(i);const a=[];for(const s of r)switch(s.type){case c.Instance:a.push(ve(e,s,t,n));break;case c.ResolvedValue:a.push(Ie(e,s,t,n));break;case c.ServiceRedirection:{const r=be(e,t,s,n);a.push(r);break}default:a.push({binding:s,parent:n})}return e.servicesBranch.pop(),a}function be(e,t,r,n){const i={binding:r,parent:n,redirections:[]},a=se(e,new re(t.last),{customServiceIdentifier:r.targetServiceIdentifier});return i.redirections.push(...we(e,t,a,i)),i}function je(e,t){return e.node.binding.type===c.Instance?function(e,t,r){const n=t.classMetadata;for(const[i,a]of n.constructorArguments.entries())t.constructorParams[i]=ye(e,r,a);for(const[i,a]of n.properties){const n=ye(e,r,a);void 0!==n&&t.propertyParams.set(i,n)}return e.node}(e,e.node,t):function(e,t,r){const n=t.binding.metadata;for(const[i,a]of n.arguments.entries())t.params[i]=Me(e,r,a);return e.node}(e,e.node,t)}var Te;!function(e){e[e.singleMandatory=0]="singleMandatory",e[e.singleOptional=1]="singleOptional",e[e.multipleMandatory=2]="multipleMandatory",e[e.multipleOptional=3]="multipleOptional",e[e.length=4]="length"}(Te||(Te={}));class Ce{constructor(){__privateAdd(this,_Ce_instances),__privateAdd(this,_f),__privateAdd(this,_g2),__privateAdd(this,_m2),__privateAdd(this,_h2),__privateAdd(this,_v),__privateSet(this,_f,__privateMethod(this,_Ce_instances,y_fn).call(this)),__privateSet(this,_g2,__privateMethod(this,_Ce_instances,y_fn).call(this)),__privateSet(this,_h2,__privateMethod(this,_Ce_instances,y_fn).call(this)),__privateSet(this,_m2,__privateMethod(this,_Ce_instances,y_fn).call(this)),__privateSet(this,_v,[])}clearCache(){for(const e of __privateMethod(this,_Ce_instances,M_fn).call(this))e.clear();for(const e of __privateGet(this,_v))e.clearCache()}get(e){var t,r,n,i,a,s;return void 0===e.name?void 0===e.tag?__privateMethod(this,_Ce_instances,I_fn).call(this,__privateGet(this,_f),e).get(e.serviceIdentifier):null==(r=null==(t=__privateMethod(this,_Ce_instances,I_fn).call(this,__privateGet(this,_m2),e).get(e.serviceIdentifier))?void 0:t.get(e.tag.key))?void 0:r.get(e.tag.value):void 0===e.tag?null==(n=__privateMethod(this,_Ce_instances,I_fn).call(this,__privateGet(this,_g2),e).get(e.serviceIdentifier))?void 0:n.get(e.name):null==(s=null==(a=null==(i=__privateMethod(this,_Ce_instances,I_fn).call(this,__privateGet(this,_h2),e).get(e.serviceIdentifier))?void 0:i.get(e.name))?void 0:a.get(e.tag.key))?void 0:s.get(e.tag.value)}set(e,t){void 0===e.name?void 0===e.tag?__privateMethod(this,_Ce_instances,I_fn).call(this,__privateGet(this,_f),e).set(e.serviceIdentifier,t):__privateMethod(this,_Ce_instances,w_fn).call(this,__privateMethod(this,_Ce_instances,w_fn).call(this,__privateMethod(this,_Ce_instances,I_fn).call(this,__privateGet(this,_m2),e),e.serviceIdentifier),e.tag.key).set(e.tag.value,t):void 0===e.tag?__privateMethod(this,_Ce_instances,w_fn).call(this,__privateMethod(this,_Ce_instances,I_fn).call(this,__privateGet(this,_g2),e),e.serviceIdentifier).set(e.name,t):__privateMethod(this,_Ce_instances,w_fn).call(this,__privateMethod(this,_Ce_instances,w_fn).call(this,__privateMethod(this,_Ce_instances,w_fn).call(this,__privateMethod(this,_Ce_instances,I_fn).call(this,__privateGet(this,_h2),e),e.serviceIdentifier),e.name),e.tag.key).set(e.tag.value,t)}subscribe(e){__privateGet(this,_v).push(e)}}function Se(t,r){return e(r)?(t.cache={isRight:!0,value:r},r.then((e=>Ae(t,e)))):Ae(t,r)}function Ae(e,t){return e.cache={isRight:!0,value:t},t}function $e(t,r,n){const i=t.getActivations(r);return void 0===i?n:e(n)?xe(t,n,i[Symbol.iterator]()):function(t,r,n){let i=r,a=n.next();for(;!0!==a.done;){const r=a.value(t.context,i);if(e(r))return xe(t,r,n);i=r,a=n.next()}return i}(t,n,i[Symbol.iterator]())}async function xe(e,t,r){let n=await t,i=r.next();for(;!0!==i.done;)n=await i.value(e.context,n),i=r.next();return n}function Be(t,r,n){let i=n;if(void 0!==r.onActivation){const n=r.onActivation;i=e(i)?i.then((e=>n(t.context,e))):n(t.context,i)}return $e(t,r.serviceIdentifier,i)}function Re(e){return(t,r)=>r.cache.isRight?r.cache.value:Se(r,Be(t,r,e(t,r)))}_f=new WeakMap,_g2=new WeakMap,_m2=new WeakMap,_h2=new WeakMap,_v=new WeakMap,_Ce_instances=new WeakSet,y_fn=function(){const e=new Array(Te.length);for(let t=0;t{const i=e(n);switch(i.scope){case s.Singleton:return i.cache.isRight?i.cache.value:Se(i,Be(r,i,t(r,n)));case s.Request:{if(r.requestScopeCache.has(i.id))return r.requestScopeCache.get(i.id);const e=Be(r,i,t(r,n));return r.requestScopeCache.set(i.id,e),e}case s.Transient:return Be(r,i,t(r,n))}}}const Ve=De(Pe,(function(e,t){return t.value(e.context)})),Fe=Re((function(e,t){return t.factory(e.context)}));function Oe(t,r,n){const i=function(t,r,n){if(void 0!==n){if(!(n in t))throw new b(j$1.resolution,`Expecting a "${n.toString()}" property when resolving "${r.implementationType.name}" class @postConstruct decorated method, none found.`);if("function"!=typeof t[n])throw new b(j$1.resolution,`Expecting a "${n.toString()}" method when resolving "${r.implementationType.name}" class @postConstruct decorated method, a non function property was found instead.`);{let i;try{i=t[n]()}catch(e2){throw new b(j$1.resolution,`Unexpected error found when calling "${n.toString()}" @postConstruct decorated method on class "${r.implementationType.name}"`,{cause:e2})}if(e(i))return async function(e,t,r){try{await r}catch(n){throw new b(j$1.resolution,`Unexpected error found when calling "${t.toString()}" @postConstruct decorated method on class "${e.implementationType.name}"`,{cause:n})}}(r,n,i)}}}(t,r,n);return e(i)?i.then((()=>t)):t}function Ne(t){return(r,n,i)=>{const a=new i.binding.implementationType(...r),s=t(n,a,i);return e(s)?s.then((()=>Oe(a,i.binding,i.classMetadata.lifecycle.postConstructMethodName))):Oe(a,i.binding,i.classMetadata.lifecycle.postConstructMethodName)}}const Ee=Re((function(e,t){return t.provider(e.context)}));function Ue(e){return e.binding}function Ke(e){return e.binding}const qe=function(t){return(r,n,i)=>{const a=[];for(const[s,o]of i.propertyParams){const l=i.classMetadata.properties.get(s);if(void 0===l)throw new b(j$1.resolution,`Expecting metadata at property "${s.toString()}", none found`);l.kind!==C$1.unmanaged&&void 0!==o.bindings&&(n[s]=t(r,o),e(n[s])&&a.push((async()=>{n[s]=await n[s]})()))}if(a.length>0)return Promise.all(a).then((()=>{}))}}(Xe),ze=function(e){return function t(r,n){const i=[];for(const a of n.redirections)ce(a)?i.push(...t(r,a)):i.push(e(r,a));return i}}(We),Ge=function(t,r,n){return(i,a)=>{const s=t(i,a);return e(s)?r(s,i,a):n(s,i,a)}}(function(t){return(r,n)=>{const i=[];for(const e of n.constructorParams)void 0===e?i.push(void 0):i.push(t(r,e));return i.some(e)?Promise.all(i):i}}(Xe),function(e){return async(t,r,n)=>{const i=await t;return e(i,r,n)}}(Ne(qe)),Ne(qe)),He=function(t){return(r,n)=>{const i=t(r,n);return e(i)?i.then((e=>n.binding.factory(...e))):n.binding.factory(...i)}}(function(t){return(r,n)=>{const i=[];for(const e of n.params)i.push(t(r,e));return i.some(e)?Promise.all(i):i}}(Xe)),Je=(e=>De(Ue,e))(Ge),Le=(e=>De(Ke,e))(He);function Qe(e){return Xe(e,e.planResult.tree.root)}function We(e,t){switch(t.binding.type){case c.ConstantValue:return ke(e,t.binding);case c.DynamicValue:return Ve(e,t.binding);case c.Factory:return Fe(e,t.binding);case c.Instance:return Je(e,t);case c.Provider:return Ee(e,t.binding);case c.ResolvedValue:return Le(e,t)}}function Xe(t,r){if(void 0!==r.bindings)return Array.isArray(r.bindings)?function(t,r){const n=[];for(const e of r)ce(e)?n.push(...ze(t,e)):n.push(We(t,e));return n.some(e)?Promise.all(n):n}(t,r.bindings):function(e,t){if(ce(t)){const r=ze(e,t);if(1===r.length)return r[0];throw new b(j$1.resolution,"Unexpected multiple resolved values on single injection")}return We(e,t)}(t,r.bindings)}function Ye(e){return void 0!==e.scope}function Ze(e,t){if(void 0!==e.lifecycle.preDestroyMethodName&&"function"==typeof t[e.lifecycle.preDestroyMethodName])return t[e.lifecycle.preDestroyMethodName]()}function _e(t,r,n){const i=t.getDeactivations(r);if(void 0!==i)return e(n)?et(n,i[Symbol.iterator]()):function(t,r){let n=r.next();for(;!0!==n.done;){if(e(n.value(t)))return et(t,r);n=r.next()}}(n,i[Symbol.iterator]())}async function et(e,t){const r=await e;let n=t.next();for(;!0!==n.done;)await n.value(r),n=t.next()}function tt(t,r){const n=function(t,r){if(r.type===c.Instance){const n=t.getClassMetadata(r.implementationType),i=r.cache.value;return e(i)?i.then((e=>Ze(n,e))):Ze(n,i)}}(t,r);return void 0===n?nt(t,r):n.then((()=>nt(t,r)))}function nt(t,r){const n=r.cache;return e(n.value)?n.value.then((e=>it(t,r,e))):it(t,r,n.value)}function it(e,t,r){let n;return void 0!==t.onDeactivation&&(n=(0,t.onDeactivation)(r)),void 0===n?_e(e,t.serviceIdentifier,r):n.then((()=>_e(e,t.serviceIdentifier,r)))}function ot(e,t){if(void 0===t)return;const r=function(e){const t=[];for(const r of e)Ye(r)&&r.scope===s.Singleton&&r.cache.isRight&&t.push(r);return t}(t),n=[];for(const i of r){const t=tt(e,i);void 0!==t&&n.push(t)}return n.length>0?Promise.all(n).then((()=>{})):void 0}function rt(e,t){const r=e.getBindingsFromModule(t);return ot(e,r)}function at(e,t){const r=e.getBindings(t);return ot(e,r)}const w=Symbol.for("@inversifyjs/container/bindingIdentifier");class I{}__publicField2(I,"always",(e=>!0));const A="@inversifyjs/container/bindingId";function P(){const e=t(Object,A)??0;return e===Number.MAX_SAFE_INTEGER?n(Object,A,Number.MIN_SAFE_INTEGER):a(Object,A,(()=>e),(e=>e+1)),e}function R(e){return{[w]:!0,id:e.id}}function B(e){return t=>{for(let r=t.getAncestor();void 0!==r;r=r.getAncestor())if(e(r))return!0;return!1}}function C(e){return t=>t.name===e}function M(e){return t=>t.serviceIdentifier===e}function N(e,t){return r=>r.tags.has(e)&&r.tags.get(e)===t}function x(e){return void 0===e.name&&0===e.tags.size}function O(e){const t=B(e);return e=>!t(e)}function F(e){return t=>{const r=t.getAncestor();return void 0===r||!e(r)}}function j(e){return t=>{const r=t.getAncestor();return void 0!==r&&e(r)}}class k{constructor(e){__privateAdd(this,_t2),__privateSet(this,_t2,e)}getIdentifier(){return R(__privateGet(this,_t2))}inRequestScope(){return __privateGet(this,_t2).scope=s.Request,new V(__privateGet(this,_t2))}inSingletonScope(){return __privateGet(this,_t2).scope=s.Singleton,new V(__privateGet(this,_t2))}inTransientScope(){return __privateGet(this,_t2).scope=s.Transient,new V(__privateGet(this,_t2))}}_t2=new WeakMap;class D{constructor(e,t,r,n){__privateAdd(this,_D_instances),__privateAdd(this,_n2),__privateAdd(this,_s),__privateAdd(this,_a2),__privateAdd(this,_r),__privateSet(this,_n2,e),__privateSet(this,_s,t),__privateSet(this,_a2,r),__privateSet(this,_r,n)}to(e){const t=S(e),r={cache:{isRight:!1,value:void 0},id:P(),implementationType:e,isSatisfiedBy:I.always,moduleId:__privateGet(this,_s),onActivation:void 0,onDeactivation:void 0,scope:t.scope??__privateGet(this,_a2),serviceIdentifier:__privateGet(this,_r),type:c.Instance};return __privateGet(this,_n2).call(this,r),new _(r)}toSelf(){if("function"!=typeof __privateGet(this,_r))throw new Error('"toSelf" function can only be applied when a newable function is used as service identifier');return this.to(__privateGet(this,_r))}toConstantValue(e){const t={cache:{isRight:!1,value:void 0},id:P(),isSatisfiedBy:I.always,moduleId:__privateGet(this,_s),onActivation:void 0,onDeactivation:void 0,scope:s.Singleton,serviceIdentifier:__privateGet(this,_r),type:c.ConstantValue,value:e};return __privateGet(this,_n2).call(this,t),new V(t)}toDynamicValue(e){const t={cache:{isRight:!1,value:void 0},id:P(),isSatisfiedBy:I.always,moduleId:__privateGet(this,_s),onActivation:void 0,onDeactivation:void 0,scope:__privateGet(this,_a2),serviceIdentifier:__privateGet(this,_r),type:c.DynamicValue,value:e};return __privateGet(this,_n2).call(this,t),new _(t)}toResolvedValue(e,t){const r={cache:{isRight:!1,value:void 0},factory:e,id:P(),isSatisfiedBy:I.always,metadata:__privateMethod(this,_D_instances,o_fn2).call(this,t),moduleId:__privateGet(this,_s),onActivation:void 0,onDeactivation:void 0,scope:__privateGet(this,_a2),serviceIdentifier:__privateGet(this,_r),type:c.ResolvedValue};return __privateGet(this,_n2).call(this,r),new _(r)}toFactory(e){const t={cache:{isRight:!1,value:void 0},factory:e,id:P(),isSatisfiedBy:I.always,moduleId:__privateGet(this,_s),onActivation:void 0,onDeactivation:void 0,scope:s.Singleton,serviceIdentifier:__privateGet(this,_r),type:c.Factory};return __privateGet(this,_n2).call(this,t),new V(t)}toProvider(e){const t={cache:{isRight:!1,value:void 0},id:P(),isSatisfiedBy:I.always,moduleId:__privateGet(this,_s),onActivation:void 0,onDeactivation:void 0,provider:e,scope:s.Singleton,serviceIdentifier:__privateGet(this,_r),type:c.Provider};return __privateGet(this,_n2).call(this,t),new V(t)}toService(e){const t={id:P(),isSatisfiedBy:I.always,moduleId:__privateGet(this,_s),serviceIdentifier:__privateGet(this,_r),targetServiceIdentifier:e,type:c.ServiceRedirection};__privateGet(this,_n2).call(this,t)}}_n2=new WeakMap,_s=new WeakMap,_a2=new WeakMap,_r=new WeakMap,_D_instances=new WeakSet,o_fn2=function(e){return{arguments:(e??[]).map((e=>{return"object"!=typeof(t=e)||r.is(t)?{kind:oe.singleInjection,name:void 0,optional:!1,tags:new Map,value:e}:{kind:!0===e.isMultiple?oe.multipleInjection:oe.singleInjection,name:e.name,optional:e.optional??!1,tags:new Map((e.tags??[]).map((e=>[e.key,e.value]))),value:e.serviceIdentifier};var t}))}};class E{constructor(e){__privateAdd(this,_t3),__privateSet(this,_t3,e)}getIdentifier(){return R(__privateGet(this,_t3))}onActivation(e){return __privateGet(this,_t3).onActivation=e,new T(__privateGet(this,_t3))}onDeactivation(e){return __privateGet(this,_t3).onDeactivation=e,new T(__privateGet(this,_t3))}}_t3=new WeakMap;class T{constructor(e){__privateAdd(this,_t4),__privateSet(this,_t4,e)}getIdentifier(){return R(__privateGet(this,_t4))}when(e){return __privateGet(this,_t4).isSatisfiedBy=e,new E(__privateGet(this,_t4))}whenAnyAncestor(e){return this.when(B(e))}whenAnyAncestorIs(e){return this.when(B(M(e)))}whenAnyAncestorNamed(e){return this.when(B(C(e)))}whenAnyAncestorTagged(e,t){return this.when(B(N(e,t)))}whenDefault(){return this.when(x)}whenNamed(e){return this.when(C(e))}whenNoParent(e){return this.when(F(e))}whenNoParentIs(e){return this.when(F(M(e)))}whenNoParentNamed(e){return this.when(F(C(e)))}whenNoParentTagged(e,t){return this.when(F(N(e,t)))}whenParent(e){return this.when(j(e))}whenParentIs(e){return this.when(j(M(e)))}whenParentNamed(e){return this.when(j(C(e)))}whenParentTagged(e,t){return this.when(j(N(e,t)))}whenTagged(e,t){return this.when(N(e,t))}whenNoAncestor(e){return this.when(O(e))}whenNoAncestorIs(e){return this.when(O(M(e)))}whenNoAncestorNamed(e){return this.when(O(C(e)))}whenNoAncestorTagged(e,t){return this.when(O(N(e,t)))}}_t4=new WeakMap;class V extends T{constructor(e){super(e),__privateAdd(this,_c3),__privateSet(this,_c3,new E(e))}onActivation(e){return __privateGet(this,_c3).onActivation(e)}onDeactivation(e){return __privateGet(this,_c3).onDeactivation(e)}}_c3=new WeakMap;class _ extends V{constructor(e){super(e),__privateAdd(this,_d3),__privateSet(this,_d3,new k(e))}inRequestScope(){return __privateGet(this,_d3).inRequestScope()}inSingletonScope(){return __privateGet(this,_d3).inSingletonScope()}inTransientScope(){return __privateGet(this,_d3).inTransientScope()}}_d3=new WeakMap;const G=Symbol.for("@inversifyjs/container/InversifyContainerError");class q extends(_e4=Error,_d4=G,_e4){constructor(e,t,r){super(t,r),__publicField2(this,_d4),__publicField2(this,"kind"),this[G]=!0,this.kind=e}static is(e){return"object"==typeof e&&null!==e&&!0===e[G]}static isErrorOfKind(e,t){return q.is(e)&&e.kind===t}}var L,i2;i2=L||(L={}),i2[i2.invalidOperation=0]="invalidOperation";const U=s.Transient;class X{constructor(e){__privateAdd(this,_X_instances),__privateAdd(this,_l2),__privateAdd(this,_u4),__privateAdd(this,_h3),__privateAdd(this,_v2),__privateAdd(this,_g3),__privateAdd(this,_b2),__privateAdd(this,_S),__privateAdd(this,_p2),__privateAdd(this,_f2),__privateAdd(this,_m3),__privateAdd(this,_y),__privateSet(this,_h3,__privateMethod(this,_X_instances,w_fn2).call(this)),__privateSet(this,_g3,(e=>__privateGet(this,_l2).get(e))),__privateSet(this,_p2,new Ce),__privateSet(this,_f2,__privateMethod(this,_X_instances,I_fn2).call(this)),void 0===(null==e?void 0:e.parent)?(__privateSet(this,_l2,g.build(void 0)),__privateSet(this,_u4,m.build(void 0)),__privateSet(this,_v2,h.build(void 0))):(__privateSet(this,_l2,g.build(__privateGet(e.parent,_l2))),__privateSet(this,_u4,m.build(__privateGet(e.parent,_u4))),__privateSet(this,_v2,h.build(__privateGet(e.parent,_v2))),__privateGet(e.parent,_p2).subscribe(__privateGet(this,_p2))),__privateSet(this,_b2,__privateGet(this,_u4).get.bind(__privateGet(this,_u4))),__privateSet(this,_m3,__privateMethod(this,_X_instances,A_fn).bind(this)),__privateSet(this,_S,{autobind:(null==e?void 0:e.autobind)??!1,defaultScope:(null==e?void 0:e.defaultScope)??U}),__privateSet(this,_y,[])}bind(e){return new D((e=>{__privateMethod(this,_X_instances,A_fn).call(this,e)}),void 0,__privateGet(this,_S).defaultScope,e)}get(t,r){const n=__privateMethod(this,_X_instances,P_fn).call(this,!1,t,r),i=__privateMethod(this,_X_instances,R_fn).call(this,n);if(e(i))throw new q(L.invalidOperation,`Unexpected asyncronous service when resolving service "${t$1(t)}"`);return i}getAll(t,r){const n=__privateMethod(this,_X_instances,P_fn).call(this,!0,t,r),i=__privateMethod(this,_X_instances,R_fn).call(this,n);if(e(i))throw new q(L.invalidOperation,`Unexpected asyncronous service when resolving service "${t$1(t)}"`);return i}async getAllAsync(e,t){const r=__privateMethod(this,_X_instances,P_fn).call(this,!0,e,t);return __privateMethod(this,_X_instances,R_fn).call(this,r)}async getAsync(e,t){const r=__privateMethod(this,_X_instances,P_fn).call(this,!1,e,t);return __privateMethod(this,_X_instances,R_fn).call(this,r)}isBound(e,t){const r=__privateGet(this,_u4).get(e);return __privateMethod(this,_X_instances,B_fn).call(this,e,r,t)}isCurrentBound(e,t){const r=__privateGet(this,_u4).getNonParentBindings(e);return __privateMethod(this,_X_instances,B_fn).call(this,e,r,t)}async load(...e){await Promise.all(e.map((async e=>e.load(__privateMethod(this,_X_instances,C_fn).call(this,e.id)))))}onActivation(e,t){__privateGet(this,_l2).add(t,{serviceId:e})}onDeactivation(e,t){__privateGet(this,_v2).add(t,{serviceId:e})}restore(){const e=__privateGet(this,_y).pop();if(void 0===e)throw new q(L.invalidOperation,"No snapshot available to restore");__privateSet(this,_l2,e.activationService),__privateSet(this,_u4,e.bindingService),__privateSet(this,_v2,e.deactivationService),__privateMethod(this,_X_instances,M_fn2).call(this)}snapshot(){__privateGet(this,_y).push({activationService:__privateGet(this,_l2).clone(),bindingService:__privateGet(this,_u4).clone(),deactivationService:__privateGet(this,_v2).clone()})}async unbind(e){var t;"object"==typeof(t=e)&&null!==t&&!0===t[w]?await __privateMethod(this,_X_instances,N_fn).call(this,e):await __privateMethod(this,_X_instances,x_fn).call(this,e)}async unbindAll(){const e=[...__privateGet(this,_u4).getNonParentBoundServices()];await Promise.all(e.map((async e=>at(__privateGet(this,_h3),e))));for(const t of e)__privateGet(this,_l2).removeAllByServiceId(t),__privateGet(this,_u4).removeAllByServiceId(t),__privateGet(this,_v2).removeAllByServiceId(t);__privateGet(this,_p2).clearCache()}async unload(...e){await Promise.all(e.map((e=>rt(__privateGet(this,_h3),e.id))));for(const t of e)__privateGet(this,_l2).removeAllByModuleId(t.id),__privateGet(this,_u4).removeAllByModuleId(t.id),__privateGet(this,_v2).removeAllByModuleId(t.id);__privateGet(this,_p2).clearCache()}}_l2=new WeakMap,_u4=new WeakMap,_h3=new WeakMap,_v2=new WeakMap,_g3=new WeakMap,_b2=new WeakMap,_S=new WeakMap,_p2=new WeakMap,_f2=new WeakMap,_m3=new WeakMap,_y=new WeakMap,_X_instances=new WeakSet,C_fn=function(e){return{bind:t=>new D((e=>{__privateMethod(this,_X_instances,A_fn).call(this,e)}),e,__privateGet(this,_S).defaultScope,t),isBound:this.isBound.bind(this),onActivation:(t,r)=>{__privateGet(this,_l2).add(r,{moduleId:e,serviceId:t})},onDeactivation:(t,r)=>{__privateGet(this,_v2).add(r,{moduleId:e,serviceId:t})},unbind:this.unbind.bind(this)}},w_fn2=function(){return{getBindings:e=>__privateGet(this,_u4).get(e),getBindingsFromModule:e=>__privateGet(this,_u4).getByModuleId(e),getClassMetadata:S,getDeactivations:e=>__privateGet(this,_v2).get(e)}},O_fn=function(e,t,r){return{isMultiple:e,name:null==r?void 0:r.name,optional:null==r?void 0:r.optional,serviceIdentifier:t,tag:null==r?void 0:r.tag}},F_fn=function(e,t,r){const n={autobindOptions:(null==r?void 0:r.autobind)??__privateGet(this,_S).autobind?{scope:__privateGet(this,_S).defaultScope}:void 0,getBindings:__privateGet(this,_b2),getClassMetadata:S,rootConstraints:{isMultiple:t,serviceIdentifier:e},servicesBranch:[],setBinding:__privateGet(this,_m3)};return __privateMethod(this,_X_instances,j_fn).call(this,n,r),n},P_fn=function(e,t,r){const n=__privateMethod(this,_X_instances,O_fn).call(this,e,t,r),i=__privateGet(this,_p2).get(n);if(void 0!==i)return i;const a=he(__privateMethod(this,_X_instances,F_fn).call(this,t,e,r));return __privateGet(this,_p2).set(n,a),a},I_fn2=function(){return{get:this.get.bind(this),getAll:this.getAll.bind(this),getAllAsync:this.getAllAsync.bind(this),getAsync:this.getAsync.bind(this)}},R_fn=function(e){return Qe({context:__privateGet(this,_f2),getActivations:__privateGet(this,_g3),planResult:e,requestScopeCache:new Map})},j_fn=function(e,t){void 0!==t&&(void 0!==t.name&&(e.rootConstraints.name=t.name),!0===t.optional&&(e.rootConstraints.isOptional=!0),void 0!==t.tag&&(e.rootConstraints.tag={key:t.tag.key,value:t.tag.value}))},B_fn=function(e,t,r){if(void 0===t)return!1;const n={getAncestor:()=>{},name:null==r?void 0:r.name,serviceIdentifier:e,tags:new Map};void 0!==(null==r?void 0:r.tag)&&n.tags.set(r.tag.key,r.tag.value);for(const i of t)if(i.isSatisfiedBy(n))return!0;return!1},M_fn2=function(){__privateGet(this,_p2).clearCache(),__privateSet(this,_g3,(e=>__privateGet(this,_l2).get(e))),__privateSet(this,_b2,__privateGet(this,_u4).get.bind(__privateGet(this,_u4))),__privateSet(this,_f2,__privateMethod(this,_X_instances,I_fn2).call(this)),__privateSet(this,_m3,__privateMethod(this,_X_instances,A_fn).bind(this))},A_fn=function(e){__privateGet(this,_u4).set(e),__privateGet(this,_p2).clearCache()},N_fn=async function(e){const t=__privateGet(this,_u4).getById(e.id);await ot(__privateGet(this,_h3),t),__privateGet(this,_u4).removeById(e.id),__privateGet(this,_p2).clearCache()},x_fn=async function(e){await at(__privateGet(this,_h3),e),__privateGet(this,_l2).removeAllByServiceId(e),__privateGet(this,_u4).removeAllByServiceId(e),__privateGet(this,_v2).removeAllByServiceId(e),__privateGet(this,_p2).clearCache()};var __getOwnPropDesc$y=Object.getOwnPropertyDescriptor,__decorateClass$y=(e,t,r,n)=>{for(var i,a=n>1?void 0:n?__getOwnPropDesc$y(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=i(a)||a);return a};let PlayerEventsImpl=class{constructor(){__publicField2(this,"eventListeners",{}),__publicField2(this,"isDisposed",!1)}on(e,t){this.eventListeners[e]||(this.eventListeners[e]=[]),this.eventListeners[e].push(t)}off(e,t){this.eventListeners[e]=(this.eventListeners[e]||[]).filter((e=>e!==t))}once(e,t){const r=n=>{t.call(this,n),this.off(e,r)};this.on(e,r)}trigger(e,t,r){const n=this.eventListeners[t]||[],i=this.eventListeners["*"]||[],a={type:t,target:e,data:r};for(const s of[...n,...i])this.isDisposed||s(a)}dispose(){this.isDisposed=!0,this.eventListeners={}}};PlayerEventsImpl=__decorateClass$y([K()],PlayerEventsImpl);var AUDIO=new Blob([new Uint8Array([255,227,24,196,0,0,0,3,72,1,64,0,0,4,132,16,31,227,192,225,76,255,67,12,255,221,27,255,228,97,73,63,255,195,131,69,192,232,223,255,255,207,102,239,255,255,255,101,158,206,70,20,59,255,254,95,70,149,66,4,16,128,0,2,2,32,240,138,255,36,106,183,255,227,24,196,59,11,34,62,80,49,135,40,0,253,29,191,209,200,141,71,7,255,252,152,74,15,130,33,185,6,63,255,252,195,70,203,86,53,15,255,255,247,103,76,121,64,32,47,255,34,227,194,209,138,76,65,77,69,51,46,57,55,170,170,170,170,170,170,170,170,170,170,255,227,24,196,73,13,153,210,100,81,135,56,0,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170])],{type:"audio/mpeg"}),VIDEO=new Blob([new Uint8Array([0,0,0,28,102,116,121,112,105,115,111,109,0,0,2,0,105,115,111,109,105,115,111,50,109,112,52,49,0,0,0,8,102,114,101,101,0,0,2,239,109,100,97,116,33,16,5,32,164,27,255,192,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,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,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,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,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,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,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,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,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,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,55,167,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,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,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,0,0,0,0,0,0,0,0,0,0,0,112,33,16,5,32,164,27,255,192,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,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,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,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,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,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,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,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,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,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,55,167,128,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,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,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,0,0,0,0,0,0,0,0,0,0,0,112,0,0,2,194,109,111,111,118,0,0,0,108,109,118,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,232,0,0,0,47,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,0,0,0,3,0,0,1,236,116,114,97,107,0,0,0,92,116,107,104,100,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,47,0,0,0,0,0,0,0,0,0,0,0,1,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,0,0,0,0,0,0,0,0,0,0,0,36,101,100,116,115,0,0,0,28,101,108,115,116,0,0,0,0,0,0,0,1,0,0,0,47,0,0,0,0,0,1,0,0,0,0,1,100,109,100,105,97,0,0,0,32,109,100,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,68,0,0,8,0,85,196,0,0,0,0,0,45,104,100,108,114,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,0,0,1,15,109,105,110,102,0,0,0,16,115,109,104,100,0,0,0,0,0,0,0,0,0,0,0,36,100,105,110,102,0,0,0,28,100,114,101,102,0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1,0,0,0,211,115,116,98,108,0,0,0,103,115,116,115,100,0,0,0,0,0,0,0,1,0,0,0,87,109,112,52,97,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,16,0,0,0,0,172,68,0,0,0,0,0,51,101,115,100,115,0,0,0,0,3,128,128,128,34,0,2,0,4,128,128,128,20,64,21,0,0,0,0,1,244,0,0,1,243,249,5,128,128,128,2,18,16,6,128,128,128,1,2,0,0,0,24,115,116,116,115,0,0,0,0,0,0,0,1,0,0,0,2,0,0,4,0,0,0,0,28,115,116,115,99,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,28,115,116,115,122,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,115,0,0,1,116,0,0,0,20,115,116,99,111,0,0,0,0,0,0,0,1,0,0,0,44,0,0,0,98,117,100,116,97,0,0,0,90,109,101,116,97,0,0,0,0,0,0,0,33,104,100,108,114,0,0,0,0,0,0,0,0,109,100,105,114,97,112,112,108,0,0,0,0,0,0,0,0,0,0,0,0,45,105,108,115,116,0,0,0,37,169,116,111,111,0,0,0,29,100,97,116,97,0,0,0,1,0,0,0,0,76,97,118,102,53,54,46,52,48,46,49,48,49])],{type:"video/mp4"});function setupDefaultValues(e){return Object.assign({muted:!1,timeout:250,inline:!1},e)}function startPlayback(e,t){var r=e.muted,n=e.timeout,i=e.inline,a=t(),s=a.element,o=a.source,l=void 0,u=void 0,c=void 0;return s.muted=r,!0===r&&s.setAttribute("muted","muted"),!0===i&&s.setAttribute("playsinline","playsinline"),s.src=o,new Promise((function(e){l=s.play(),u=setTimeout((function(){c(!1,new Error("Timeout "+n+" ms has been reached"))}),n),c=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;s.remove(),s.srcObject=null,clearTimeout(u),e({result:t,error:r})},void 0!==l?l.then((function(){return c(!0)})).catch((function(e){return c(!1,e)})):c(!0)}))}function video(e){return startPlayback(e=setupDefaultValues(e),(function(){return{element:document.createElement("video"),source:URL.createObjectURL(VIDEO)}}))}function audio(e){return startPlayback(e=setupDefaultValues(e),(function(){return{element:document.createElement("audio"),source:URL.createObjectURL(AUDIO)}}))}var index$1={audio:audio,video:video};const Types={PlayerConfig:"PlayerConfig",ScenarioPreferences:"ScenarioPreferences",Player:"Player",PlayerEvents:"PlayerEvents",music:{MusicManager:"MusicManager",MusicPlayer:"MusicPlayer",VolumeTransitionManager:"VolumeTransitionManager"},analytics:{Handlers:"AnalyticsHandlers",EventFactory:"AnalyticsEventFactory",AnalyticsLogger:"AnalyticsLogger",AnalyticsReporter:"AnalyticsReporter"},personalizer:{AnimationPersonalizerStrategies:"AnimationPersonalizerStrategies",AnimationPersonalizer:"AnimationPersonalizer"},layer:{PlayerContainer:"PlayerContainer",AnimationLayer:"AnimationLayer",CTALayer:"CTALayer",VideoLayer:"VideoLayer",PlayerLayers:"PlayerLayers"},loaders:{ResourceLoader:"ResourceLoader",ScenarioLoader:"ScenarioLoader",PosterLoader:"PosterLoader"},layerManagers:{PlayerContainerManager:"PlayerContainerManager",CTALayerManager:"CTALayerManager",AnimationLayerManager:"DependentAnimationLayerManager",VideoLayerManager:"VideoLayerManager",DebugLayerManager:"PlaybackInformationHandle"},PlayerPlugin:"PlayerPlugin"};var md5={},hasRequiredMd5;function requireMd5(){if(hasRequiredMd5)return md5;hasRequiredMd5=1,Object.defineProperty(md5,"__esModule",{value:!0});var e=function(){function e(){this._state=new Int32Array(4),this._buffer=new ArrayBuffer(68),this._buffer8=new Uint8Array(this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()}return e.hashStr=function(e,t){return void 0===t&&(t=!1),this.onePassHasher.start().appendStr(e).end(t)},e.hashAsciiStr=function(e,t){return void 0===t&&(t=!1),this.onePassHasher.start().appendAsciiStr(e).end(t)},e._hex=function(t){var r,n,i,a,s=e.hexChars,o=e.hexOut;for(a=0;a<4;a+=1)for(n=8*a,r=t[a],i=0;i<8;i+=2)o[n+1+i]=s.charAt(15&r),r>>>=4,o[n+0+i]=s.charAt(15&r),r>>>=4;return o.join("")},e._md5cycle=function(e,t){var r=e[0],n=e[1],i=e[2],a=e[3];n=((n+=((i=((i+=((a=((a+=((r=((r+=(n&i|~n&a)+t[0]-680876936|0)<<7|r>>>25)+n|0)&n|~r&i)+t[1]-389564586|0)<<12|a>>>20)+r|0)&r|~a&n)+t[2]+606105819|0)<<17|i>>>15)+a|0)&a|~i&r)+t[3]-1044525330|0)<<22|n>>>10)+i|0,n=((n+=((i=((i+=((a=((a+=((r=((r+=(n&i|~n&a)+t[4]-176418897|0)<<7|r>>>25)+n|0)&n|~r&i)+t[5]+1200080426|0)<<12|a>>>20)+r|0)&r|~a&n)+t[6]-1473231341|0)<<17|i>>>15)+a|0)&a|~i&r)+t[7]-45705983|0)<<22|n>>>10)+i|0,n=((n+=((i=((i+=((a=((a+=((r=((r+=(n&i|~n&a)+t[8]+1770035416|0)<<7|r>>>25)+n|0)&n|~r&i)+t[9]-1958414417|0)<<12|a>>>20)+r|0)&r|~a&n)+t[10]-42063|0)<<17|i>>>15)+a|0)&a|~i&r)+t[11]-1990404162|0)<<22|n>>>10)+i|0,n=((n+=((i=((i+=((a=((a+=((r=((r+=(n&i|~n&a)+t[12]+1804603682|0)<<7|r>>>25)+n|0)&n|~r&i)+t[13]-40341101|0)<<12|a>>>20)+r|0)&r|~a&n)+t[14]-1502002290|0)<<17|i>>>15)+a|0)&a|~i&r)+t[15]+1236535329|0)<<22|n>>>10)+i|0,n=((n+=((i=((i+=((a=((a+=((r=((r+=(n&a|i&~a)+t[1]-165796510|0)<<5|r>>>27)+n|0)&i|n&~i)+t[6]-1069501632|0)<<9|a>>>23)+r|0)&n|r&~n)+t[11]+643717713|0)<<14|i>>>18)+a|0)&r|a&~r)+t[0]-373897302|0)<<20|n>>>12)+i|0,n=((n+=((i=((i+=((a=((a+=((r=((r+=(n&a|i&~a)+t[5]-701558691|0)<<5|r>>>27)+n|0)&i|n&~i)+t[10]+38016083|0)<<9|a>>>23)+r|0)&n|r&~n)+t[15]-660478335|0)<<14|i>>>18)+a|0)&r|a&~r)+t[4]-405537848|0)<<20|n>>>12)+i|0,n=((n+=((i=((i+=((a=((a+=((r=((r+=(n&a|i&~a)+t[9]+568446438|0)<<5|r>>>27)+n|0)&i|n&~i)+t[14]-1019803690|0)<<9|a>>>23)+r|0)&n|r&~n)+t[3]-187363961|0)<<14|i>>>18)+a|0)&r|a&~r)+t[8]+1163531501|0)<<20|n>>>12)+i|0,n=((n+=((i=((i+=((a=((a+=((r=((r+=(n&a|i&~a)+t[13]-1444681467|0)<<5|r>>>27)+n|0)&i|n&~i)+t[2]-51403784|0)<<9|a>>>23)+r|0)&n|r&~n)+t[7]+1735328473|0)<<14|i>>>18)+a|0)&r|a&~r)+t[12]-1926607734|0)<<20|n>>>12)+i|0,n=((n+=((i=((i+=((a=((a+=((r=((r+=(n^i^a)+t[5]-378558|0)<<4|r>>>28)+n|0)^n^i)+t[8]-2022574463|0)<<11|a>>>21)+r|0)^r^n)+t[11]+1839030562|0)<<16|i>>>16)+a|0)^a^r)+t[14]-35309556|0)<<23|n>>>9)+i|0,n=((n+=((i=((i+=((a=((a+=((r=((r+=(n^i^a)+t[1]-1530992060|0)<<4|r>>>28)+n|0)^n^i)+t[4]+1272893353|0)<<11|a>>>21)+r|0)^r^n)+t[7]-155497632|0)<<16|i>>>16)+a|0)^a^r)+t[10]-1094730640|0)<<23|n>>>9)+i|0,n=((n+=((i=((i+=((a=((a+=((r=((r+=(n^i^a)+t[13]+681279174|0)<<4|r>>>28)+n|0)^n^i)+t[0]-358537222|0)<<11|a>>>21)+r|0)^r^n)+t[3]-722521979|0)<<16|i>>>16)+a|0)^a^r)+t[6]+76029189|0)<<23|n>>>9)+i|0,n=((n+=((i=((i+=((a=((a+=((r=((r+=(n^i^a)+t[9]-640364487|0)<<4|r>>>28)+n|0)^n^i)+t[12]-421815835|0)<<11|a>>>21)+r|0)^r^n)+t[15]+530742520|0)<<16|i>>>16)+a|0)^a^r)+t[2]-995338651|0)<<23|n>>>9)+i|0,n=((n+=((a=((a+=(n^((r=((r+=(i^(n|~a))+t[0]-198630844|0)<<6|r>>>26)+n|0)|~i))+t[7]+1126891415|0)<<10|a>>>22)+r|0)^((i=((i+=(r^(a|~n))+t[14]-1416354905|0)<<15|i>>>17)+a|0)|~r))+t[5]-57434055|0)<<21|n>>>11)+i|0,n=((n+=((a=((a+=(n^((r=((r+=(i^(n|~a))+t[12]+1700485571|0)<<6|r>>>26)+n|0)|~i))+t[3]-1894986606|0)<<10|a>>>22)+r|0)^((i=((i+=(r^(a|~n))+t[10]-1051523|0)<<15|i>>>17)+a|0)|~r))+t[1]-2054922799|0)<<21|n>>>11)+i|0,n=((n+=((a=((a+=(n^((r=((r+=(i^(n|~a))+t[8]+1873313359|0)<<6|r>>>26)+n|0)|~i))+t[15]-30611744|0)<<10|a>>>22)+r|0)^((i=((i+=(r^(a|~n))+t[6]-1560198380|0)<<15|i>>>17)+a|0)|~r))+t[13]+1309151649|0)<<21|n>>>11)+i|0,n=((n+=((a=((a+=(n^((r=((r+=(i^(n|~a))+t[4]-145523070|0)<<6|r>>>26)+n|0)|~i))+t[11]-1120210379|0)<<10|a>>>22)+r|0)^((i=((i+=(r^(a|~n))+t[2]+718787259|0)<<15|i>>>17)+a|0)|~r))+t[9]-343485551|0)<<21|n>>>11)+i|0,e[0]=r+e[0]|0,e[1]=n+e[1]|0,e[2]=i+e[2]|0,e[3]=a+e[3]|0},e.prototype.start=function(){return this._dataLength=0,this._bufferLength=0,this._state.set(e.stateIdentity),this},e.prototype.appendStr=function(t){var r,n,i=this._buffer8,a=this._buffer32,s=this._bufferLength;for(n=0;n>>6),i[s++]=63&r|128;else if(r<55296||r>56319)i[s++]=224+(r>>>12),i[s++]=r>>>6&63|128,i[s++]=63&r|128;else{if((r=1024*(r-55296)+(t.charCodeAt(++n)-56320)+65536)>1114111)throw new Error("Unicode standard supports code points up to U+10FFFF");i[s++]=240+(r>>>18),i[s++]=r>>>12&63|128,i[s++]=r>>>6&63|128,i[s++]=63&r|128}s>=64&&(this._dataLength+=64,e._md5cycle(this._state,a),s-=64,a[0]=a[16])}return this._bufferLength=s,this},e.prototype.appendAsciiStr=function(t){for(var r,n=this._buffer8,i=this._buffer32,a=this._bufferLength,s=0;;){for(r=Math.min(t.length-s,64-a);r--;)n[a++]=t.charCodeAt(s++);if(a<64)break;this._dataLength+=64,e._md5cycle(this._state,i),a=0}return this._bufferLength=a,this},e.prototype.appendByteArray=function(t){for(var r,n=this._buffer8,i=this._buffer32,a=this._bufferLength,s=0;;){for(r=Math.min(t.length-s,64-a);r--;)n[a++]=t[s++];if(a<64)break;this._dataLength+=64,e._md5cycle(this._state,i),a=0}return this._bufferLength=a,this},e.prototype.getState=function(){var e=this,t=e._state;return{buffer:String.fromCharCode.apply(null,e._buffer8),buflen:e._bufferLength,length:e._dataLength,state:[t[0],t[1],t[2],t[3]]}},e.prototype.setState=function(e){var t,r=e.buffer,n=e.state,i=this._state;for(this._dataLength=e.length,this._bufferLength=e.buflen,i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=n[3],t=0;t>2);if(this._dataLength+=n,i[n]=128,i[n+1]=i[n+2]=i[n+3]=0,a.set(e.buffer32Identity.subarray(s),s),n>55&&(e._md5cycle(this._state,a),a.set(e.buffer32Identity)),(r=8*this._dataLength)<=4294967295)a[14]=r;else{var o=r.toString(16).match(/(.*?)(.{0,8})$/);if(null===o)return;var l=parseInt(o[2],16),u=parseInt(o[1],16)||0;a[14]=l,a[15]=u}return e._md5cycle(this._state,a),t?this._state:e._hex(this._state)},e.stateIdentity=new Int32Array([1732584193,-271733879,-1732584194,271733878]),e.buffer32Identity=new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),e.hexChars="0123456789abcdef",e.hexOut=[],e.onePassHasher=new e,e}();return md5.Md5=e,"5d41402abc4b2a76b9719d911017c592"!==e.hashStr("hello")&&console.error("Md5 self test failed."),md5}var md5Exports=requireMd5();const setCookie=(e,t)=>{document.cookie=void 0!==t?`${e}=${t}; Path=/`:`${e}=`},readCookie=e=>{const t=document.cookie.split(";").map((e=>e.trim())).find((t=>t.startsWith(e)));return t&&t.replace(`${e}=`,"")},Cookies={setCookie:setCookie,readCookie:readCookie};var __defProp$b=Object.defineProperty,__getOwnPropDesc$x=Object.getOwnPropertyDescriptor,__defNormalProp$4=(e,t,r)=>t in e?__defProp$b(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__decorateClass$x=(e,t,r,n)=>{for(var i,a=n>1?void 0:n?__getOwnPropDesc$x(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=i(a)||a);return a},__decorateParam$h=(e,t)=>(r,n)=>t(r,n,e),__publicField$4=(e,t,r)=>__defNormalProp$4(e,t+"",r);const defaultPreferences={bookmarks:[],isDebugModeEnabled:!1,showSubtitles:"auto",subtitlesLanguage:void 0,volume:1,isMuted:!1,enabledLoggers:void 0,playbackRate:1};let ScenarioPreferences=class{constructor(e){__publicField2(this,"preferences"),__publicField2(this,"changeListeners",[]),__publicField2(this,"defaultValues"),__publicField2(this,"projectId"),this.projectId=e.project.projectId,this.defaultValues=defaultPreferences,this.preferences={...defaultPreferences,...this.readFromStorage()}}updatePreferences(e){this.preferences={...this.preferences,...e},this.saveToStorage(),this.notifyListeners()}getPreference(e){return this.preferences[e]??this.defaultValues[e]}getPreferences(){return this.preferences}addChangeListener(e){this.changeListeners.push(e)}removeChangeListener(e){this.changeListeners=this.changeListeners.filter((t=>t!==e))}clear(){this.preferences={...this.defaultValues},this.saveToStorage(),this.notifyListeners()}getKey(){return ScenarioPreferences.STORAGE_KEY+this.projectId}saveToStorage(){const e=this.getKey(),t=JSON.stringify(this.preferences);localStorage.setItem(e,t)}readFromStorage(){const e=this.getKey(),t=localStorage.getItem(e);return t?JSON.parse(t):{...defaultPreferences}}notifyListeners(){this.changeListeners.forEach((e=>{e(this.preferences)}))}};__publicField$4(ScenarioPreferences,"STORAGE_KEY","VintomPref/"),ScenarioPreferences=__decorateClass$x([K(),__decorateParam$h(0,O$1(Types.PlayerConfig))],ScenarioPreferences);var __defProp$a=Object.defineProperty,__getOwnPropDesc$w=Object.getOwnPropertyDescriptor,__defNormalProp$3=(e,t,r)=>t in e?__defProp$a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__decorateClass$w=(e,t,r,n)=>{for(var i,a=n>1?void 0:n?__getOwnPropDesc$w(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=i(a)||a);return a},__decorateParam$g=(e,t)=>(r,n)=>t(r,n,e),__publicField$3=(e,t,r)=>__defNormalProp$3(e,t+"",r);let AnalyticsEventFactory=class{constructor(e,t){__publicField2(this,"currentScenarioId"),__publicField2(this,"currentVolume"),__publicField2(this,"currentDuration"),this.playerConfig=e,this.playerEvents=t,this.playerEvents.on("scenarioelement.start",(e=>{this.currentScenarioId=e.target.getCurrentScenarioElement().id})),this.playerEvents.on("timeupdate",(e=>{this.currentVolume=e.target.getVolume(),this.currentDuration=e.target.getDuration()}))}createPlayerInitEvent(){return this.createEvent("playerInit")}createMiscEvent(e){return this.createEvent("miscEvent",{...e,isMiscelaneous:!0})}createPlayerStartEvent(){return this.createEvent("playerStart")}createPlayerErrorEvent(e){return this.createEvent("playerError",{error:e})}createScenarioElementStartEvent(){return this.createEvent("scenarioElementStart",{volume:this.currentVolume,duration:this.currentDuration})}createReportPlayedSegmentEvent(e){return this.createEvent("reportSegmentPlayed",{volume:this.currentVolume,duration:this.currentDuration,segment:e})}createScenarioElementProgressEvent(e){return this.createEvent("scenarioElementProgress",{progress:e})}createCTAShowEvent(e){return this.createEvent("ctaShow",{ctaId:e})}createCTAActionEvent(e,t,r){return this.createEvent("ctaAction",{ctaId:e,actionId:t,actionAdditionalData:r})}createNotSupportedBrowserEvent(){return this.createEvent("notSupportedBrowser")}createEvent(e,t){const r=this.playerConfig.project;return{type:e,projectId:r.projectId,groupId:r.groupId,videoId:r.videoId,videoDate:r.videoDate,scenarioElementId:this.currentScenarioId,timestamp:Date.now(),userIdentifier:this.getUserIdentifier(),...t}}getUserIdentifier(){let e=Cookies.readCookie(AnalyticsEventFactory.USER_IDENTIFIER_COOKIE_NAME);if(!e){const t=crypto.getRandomValues(new Uint32Array(1));e=md5Exports.Md5.hashStr(t[0]+""),Cookies.setCookie(AnalyticsEventFactory.USER_IDENTIFIER_COOKIE_NAME,e)}return e}};__publicField$3(AnalyticsEventFactory,"USER_IDENTIFIER_COOKIE_NAME","Vintom/UserID"),AnalyticsEventFactory=__decorateClass$w([K(),__decorateParam$g(0,O$1(Types.PlayerConfig)),__decorateParam$g(1,O$1(Types.PlayerEvents))],AnalyticsEventFactory);var __getOwnPropDesc$v=Object.getOwnPropertyDescriptor,__decorateClass$v=(e,t,r,n)=>{for(var i,a=n>1?void 0:n?__getOwnPropDesc$v(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=i(a)||a);return a},__decorateParam$f=(e,t)=>(r,n)=>t(r,n,e);let AnalyticsLogger=class{constructor(e,t){__publicField2(this,"handlers"),__publicField2(this,"factory"),this.handlers=e,this.factory=t}logPlayerInit(){const e=this.factory.createPlayerInitEvent();this.log(e)}logMiscEvent(e){const t=this.factory.createMiscEvent(e);this.log(t)}logPlayerStart(){const e=this.factory.createPlayerStartEvent();this.log(e)}logPlayerError(e){const t=this.factory.createPlayerErrorEvent(e);this.log(t)}logScenarioElementStart(){const e=this.factory.createScenarioElementStartEvent();this.log(e)}logReportPlayedSegment(e){const t=this.factory.createReportPlayedSegmentEvent(e);this.log(t)}logScenarioElementProgress(e){const t=this.factory.createScenarioElementProgressEvent(e);this.log(t)}logCTAShow(e){const t=this.factory.createCTAShowEvent(e);this.log(t)}logCTAAction(e,t,r){const n=this.factory.createCTAActionEvent(e,t,r);this.log(n)}logNotSupportedBrowser(){const e=this.factory.createNotSupportedBrowserEvent();this.log(e)}log(e){this.handlers.forEach((t=>{t.handleEvent(e)}))}};AnalyticsLogger=__decorateClass$v([K(),__decorateParam$f(0,J(Types.analytics.Handlers)),__decorateParam$f(1,O$1(Types.analytics.EventFactory))],AnalyticsLogger);const niceColors=["#FF4136","#FF851B","#2ECC40","#0074D9","#B10DC9","#01FF70","#FF1493","#00FFFF","#FFD700"],getNiceColor=e=>void 0===e?niceColors[Math.floor(Math.random()*niceColors.length)]:niceColors[e%niceColors.length],parseColor=e=>{if(!e.startsWith("#")||![4,7].includes(e.length))throw new Error("Invalid hex color format. Must be #RGB or #RRGGBB");const t=4===e.length?`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`:e;return{hex:t,r:parseInt(t.slice(1,3),16),g:parseInt(t.slice(3,5),16),b:parseInt(t.slice(5,7),16)}},brightenColor=(e,t)=>{const{r:r,g:n,b:i}=parseColor(e),a=Math.round(2.55*Math.max(-100,Math.min(100,t))),s=e=>Math.max(0,Math.min(255,e));return"#"+(16777216+65536*s(r+a)+256*s(n+a)+s(i+a)).toString(16).slice(1)},getContrastingText=e=>{const{r:t,g:r,b:n}=parseColor(e);return.299*t+.587*r+.114*n>128?"#000000":"#ffffff"},Colors={parse:parseColor,brighten:brightenColor,getContrastingText:getContrastingText},isDevMode=()=>!1,_Logger=class e{constructor(t,r){__publicField2(this,"name"),__publicField2(this,"color"),__publicField2(this,"textColor"),__publicField2(this,"level","info"),__publicField2(this,"enabled"),this.name=t,this.level=r,this.color=getNiceColor(e.colorIndex++),this.textColor=Colors.getContrastingText(this.color),this.enabled=isDevMode()}enable(){this.enabled=!0}disable(){this.enabled=!1}isEnabled(){return this.enabled}info(...e){this.log("info",e)}debug(...e){this.log("debug",e)}warn(...e){this.log("warn",e)}error(...e){this.log("error",e)}log(e,t){if(!this.enabled||!this.canPassLevel(e))return;const r=this.getConsoleArgs(t);switch(e){case"info":console.log(...r);break;case"debug":console.debug(...r);break;case"warn":console.warn(...r);break;case"error":console.error(...r);break;default:console.error(`Unknown log level: ${this.level}`)}}canPassLevel(e){switch(this.level){case"off":default:return!1;case"error":return"error"===e;case"warn":return"error"===e||"warn"===e;case"info":return"error"===e||"warn"===e||"info"===e;case"debug":return!0}}getConsoleArgs(e){return"string"==typeof e[0]?[`%c[Player/${this.name}]%c ${e[0]}`,`background-color: ${this.color}; color: ${this.textColor}`,"",...e.slice(1)]:[`%c[Player/${this.name}]`,`background-color: ${this.color}; color: white`,...e]}};__publicField2(_Logger,"colorIndex",0);let Logger=_Logger;class LoggerFactory{constructor(){__publicField2(this,"loggers"),__publicField2(this,"instanceIds"),__publicField2(this,"defaultLevel"),this.loggers=new Map,this.instanceIds=new Map,this.setDefaultLevel("warn")}setDefaultLevel(e){this.defaultLevel=e}obtainLogger(e){if(!this.loggers.has(e)){const t=new Logger(e,this.defaultLevel);this.loggers.set(e,t)}return this.loggers.get(e)}obtainInstanceLogger(e){const t=this.obtainLogger(e),r=this.instanceIds.get(e)??0,n=new Logger(e+` (#${r})`,this.defaultLevel);return n.level=t.level,n.color=t.color,n.textColor=t.textColor,this.instanceIds.set(e,r+1),n}getLoggerInstances(){return Array.from(this.loggers.values())}}const loggerFactory=new LoggerFactory,getLogger=e=>loggerFactory.obtainLogger(e),getInstanceLogger=e=>loggerFactory.obtainInstanceLogger(e);var __getOwnPropDesc$u=Object.getOwnPropertyDescriptor,__decorateClass$u=(e,t,r,n)=>{for(var i,a=n>1?void 0:n?__getOwnPropDesc$u(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=i(a)||a);return a},__decorateParam$e=(e,t)=>(r,n)=>t(r,n,e);let AnalyticsReporter=class{constructor(e){__publicField2(this,"name","PlayerAnalyticsPlugin"),__publicField2(this,"logger",getLogger("AnalyticsReporter")),__publicField2(this,"isPlaying",!1),__publicField2(this,"isHidden",!1),__publicField2(this,"isLooping",!1),__publicField2(this,"isUISeeking",!1),__publicField2(this,"hasLoggedPlayerStart",!1),__publicField2(this,"currentSegmentStart",null),__publicField2(this,"currentSegmentEnd",null),__publicField2(this,"lastTimeIntervalWasReported",null),__publicField2(this,"lastPercentageProgressWasReported",null),__publicField2(this,"reportSegmentsInterval",10),__publicField2(this,"reportProgressPercentage",25),__publicField2(this,"ignoreSeekSegmentsSmallerThan",.5),__publicField2(this,"informationRetrievers",null),this.analytics=e}useInformationRetrievers(e){this.informationRetrievers=e}configure(e){const{reportSegmentsInterval:t,reportProgressPercentage:r,ignoreSeekSegmentsSmallerThan:n}=e;this.reportSegmentsInterval=t??this.reportSegmentsInterval,this.reportProgressPercentage=r??this.reportProgressPercentage,this.ignoreSeekSegmentsSmallerThan=n??this.ignoreSeekSegmentsSmallerThan,this.reportProgressPercentage>1&&(this.reportProgressPercentage/=100)}onPlayerInit(){this.analytics.logPlayerInit()}onPlayerStart(){this.analytics.logPlayerStart()}onLoopStart(){this.analytics.logMiscEvent({type:"loop.start"}),this.isLooping=!0}onCTAShown(e){this.isIgnoreEvents()||this.analytics.logCTAShow(e)}onCTAAction(e,t,r){this.analytics.logCTAAction(e,t,r)}onError(e){this.analytics.logPlayerError(e)}tick(){this.isIgnoreEvents()||(this.getCurrentTime()-this.lastTimeIntervalWasReported>this.reportSegmentsInterval&&(this.lastTimeIntervalWasReported=this.getCurrentTime(),this.setSegmentEnd("interval")),this.tickProgress(this.getCurrentTime()))}reportProgress(e){this.analytics.logScenarioElementProgress(e)}onScenarioElementPrepare(){}onScenarioElementStart(){this.lastTimeIntervalWasReported=this.getCurrentTime(),this.hasLoggedPlayerStart||(this.analytics.logPlayerStart(),this.hasLoggedPlayerStart=!0),this.setSegmentStart("scenarioStart"),this.analytics.logScenarioElementStart()}onScenarioElementEnd(){this.isPlaying=!1,this.tickProgress(this.getDuration()),this.setSegmentEnd("end",this.getDuration())}onPlay(){this.isPlaying=!0,this.setSegmentStart("play")}onPause(){this.isPlaying=!1,this.setSegmentEnd("pause")}onLoopEnd(){this.setSegmentStart("loopEnd"),this.isLooping=!1}onHidden(){this.isHidden=!0,this.setSegmentEnd("hidden")}onVisible(){this.isHidden=!1}logSegmentPlayed(){if(!this.hasSegmentStart())return void this.logger.warn("No segment to report");!this.currentSegmentStart||this.currentSegmentEnd;const e={start:this.currentSegmentStart.time,end:this.currentSegmentEnd.time,endReason:this.getEndReason(this.currentSegmentEnd.basis)};console.log("CURRENT SEGMENT",e),e.start!==e.end?(this.analytics.logReportPlayedSegment(e),this.clearSegment()):this.logger.debug("Segment has no duration, skipping")}getEndReason(e){switch(e){case"pause":return"pause";case"seek":return"seek";case"end":return"end";case"hidden":return"hidden";default:return null}}onInstantSeek(){if(this.isIgnoreEvents())return;const e=this.getCurrentTime();this.currentSegmentStart&&e-this.currentSegmentStart.time=(this.lastPercentageProgressWasReported??0)+this.reportProgressPercentage&&(this.lastPercentageProgressWasReported=Math.floor(t/this.reportProgressPercentage)*this.reportProgressPercentage,this.reportProgress(t))}};AnalyticsReporter=__decorateClass$u([K(),__decorateParam$e(0,O$1(Types.analytics.AnalyticsLogger))],AnalyticsReporter);var dist={},ga4={},gtag={},hasRequiredGtag;function requireGtag(){return hasRequiredGtag||(hasRequiredGtag=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=function(){for(var e=arguments.length,t=new Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:"",n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=e||"";n&&(a=e.toString().trim().replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g,(function(e,r,n){return r>0&&r+e.length!==n.length&&e.search(t)>-1&&":"!==n.charAt(r-2)&&("-"!==n.charAt(r+e.length)||"-"===n.charAt(r-1))&&n.charAt(r-1).search(/[^\s-]/)<0?e.toLowerCase():e.substr(1).search(/[A-Z]|\../)>-1?e:e.charAt(0).toUpperCase()+e.substr(1)})));i&&(a=function(e){if(function(e){return"string"==typeof e&&-1!==e.indexOf("@")}(e))return console.warn("This arg looks like an email address, redacting."),r;return e}(a));return a};var t=/^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i;var r="REDACTED (Potential Email Address)"}(format)),format}function requireGa4(){return hasRequiredGa4||(hasRequiredGa4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.GA4=void 0;var t=s(requireGtag()),r=s(requireFormat()),n=["eventCategory","eventAction","eventLabel","eventValue","hitType"],i=["title","location"],a=["page","hitType"];function s(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e){return function(e){if(Array.isArray(e))return f(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||p(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&void 0!==arguments[2]?arguments[2]:"https://www.googletagmanager.com/gtag/js";if("undefined"!=typeof window&&"undefined"!=typeof document&&!s._hasLoadedGA){var n=document.createElement("script");n.async=!0,n.src="".concat(r,"?id=").concat(e),t&&n.setAttribute("nonce",t),document.body.appendChild(n),window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)},s._hasLoadedGA=!0}})),g(this,"_toGtagOptions",(function(e){if(e){var t={cookieUpdate:"cookie_update",cookieExpires:"cookie_expires",cookieDomain:"cookie_domain",cookieFlags:"cookie_flags",userId:"user_id",clientId:"client_id",anonymizeIp:"anonymize_ip",contentGroup1:"content_group1",contentGroup2:"content_group2",contentGroup3:"content_group3",contentGroup4:"content_group4",contentGroup5:"content_group5",allowAdFeatures:"allow_google_signals",allowAdPersonalizationSignals:"allow_ad_personalization_signals",nonInteraction:"non_interaction",page:"page_path",hitCallback:"event_callback"};return Object.entries(e).reduce((function(e,r){var n=h(r,2),i=n[0],a=n[1];return t[i]?e[t[i]]=a:e[i]=a,e}),{})}})),g(this,"initialize",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)throw new Error("Require GA_MEASUREMENT_ID");var r="string"==typeof e?[{trackingId:e}]:e;s._currentMeasurementId=r[0].trackingId;var n=t.gaOptions,i=t.gtagOptions,a=t.nonce,o=t.testMode,l=void 0!==o&&o,c=t.gtagUrl;if(s._testMode=l,l||s._loadGA(s._currentMeasurementId,a,c),s.isInitialized||(s._gtag("js",new Date),r.forEach((function(e){var t=d(d(d({},s._toGtagOptions(d(d({},n),e.gaOptions))),i),e.gtagOptions);Object.keys(t).length?s._gtag("config",e.trackingId,t):s._gtag("config",e.trackingId)}))),s.isInitialized=!0,!l){var h=u(s._queueGtag);for(s._queueGtag=[],s._isQueuing=!1;h.length;){var p=h.shift();s._gtag.apply(s,u(p)),"get"===p[0]&&(s._isQueuing=!0)}}})),g(this,"set",(function(e){e?"object"===l(e)?(0===Object.keys(e).length&&console.warn("empty `fieldsObject` given to .set()"),s._gaCommand("set",e)):console.warn("Expected `fieldsObject` arg to be an Object"):console.warn("`fieldsObject` is required in .set()")})),g(this,"_gaCommandSendEvent",(function(e,t,r,n,i){s._gtag("event",t,d(d({event_category:e,event_label:r,value:n},i&&{non_interaction:i.nonInteraction}),s._toGtagOptions(i)))})),g(this,"_gaCommandSendEventParameters",(function(){for(var e=arguments.length,t=new Array(e),r=0;r1?t-1:0),n=1;n{for(var i,a=n>1?void 0:n?__getOwnPropDesc$t(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=i(a)||a);return a},__decorateParam$d=(e,t)=>(r,n)=>t(r,n,e);let GoogleAnalyticsHandler=class{constructor(e){__publicField2(this,"projectId");const t=e.analyticsEndpoints.filter((e=>"GA"===e.provider)).map((e=>e.gaServiceTracker));0!==t.length&&(this.projectId=e.project.projectId,ReactGA.initialize(t.map((e=>({trackingId:e,debug_mode:!0,gtagOptions:{campaign_name:this.projectId}})))))}handleEvent(e){if(null==this.projectId||e.isMiscelaneous)return;const t="scenarioElementProgress"===e.type?`PROGRESS_${e.progress}`:e.type,r=this.serializeEventToAction(e);void 0!==t&&"reportSegmentPlayed"!==e.type&&"scenarioElementStart"!==e.type&&ReactGA.event({category:this.projectId,action:this.projectId+": "+t,label:r})}serializeEventToAction(e){const t=`scenario element id: ${e.scenarioElementId}`;switch(e.type){case"playerInit":case"playerStart":case"scenarioElementStart":case"scenarioElementProgress":case"notSupportedBrowser":return t;case"playerError":return`${t}, message: ${e.error.message}`;case"ctaShow":return`${t}, cta id: ${e.ctaId}`;case"ctaAction":return`${t}, cta id: ${e.ctaId}, action id: ${e.actionId}`;default:return}}};GoogleAnalyticsHandler=__decorateClass$t([K(),__decorateParam$d(0,O$1(Types.PlayerConfig))],GoogleAnalyticsHandler);var __getOwnPropDesc$s=Object.getOwnPropertyDescriptor,__decorateClass$s=(e,t,r,n)=>{for(var i,a=n>1?void 0:n?__getOwnPropDesc$s(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=i(a)||a);return a};let LocalServerHandler=class{constructor(){__publicField2(this,"endpoint","http://localhost:7100/analytics"),__publicField2(this,"isConnectedToServer",!1),__publicField2(this,"connectionTimeout",3e3),__publicField2(this,"eventQueue",[]),__publicField2(this,"respondToMiscelaneousEvents",!0)}async initializeConnection(){const e=new AbortController,t=setTimeout((()=>e.abort()),this.connectionTimeout);try{const r=await fetch(this.endpoint,{method:"HEAD",signal:e.signal});clearTimeout(t),r.ok?(this.isConnectedToServer=!0,console.log(`Successfully connected to local analytics server: ${this.endpoint}`),this.processEventQueue()):console.warn(`Failed to connect to local analytics server: ${this.endpoint}. Status: ${r.status}`)}catch(r){clearTimeout(t),r instanceof Error&&"AbortError"===r.name?console.warn(`Connection to local analytics server ${this.endpoint} timed out after ${this.connectionTimeout}ms.`):console.warn(`Error connecting to local analytics server ${this.endpoint}:`,r)}}serializeEvent(e){const t={...e};return["scenarioElementId","type","volume","groupId","userIdentifier","timestamp","projectId","isMiscelaneous","videoId","videoDate"].forEach((e=>{delete t[e]})),{name:e.isMiscelaneous?"Misc("+e.type+")":e.type,data:{...t,id:e.scenarioElementId}}}sendEventPayload(e){const t=this.serializeEvent(e);fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},keepalive:!0,body:JSON.stringify(t)}).then((t=>{t.ok||console.warn(`Failed to send event to ${this.endpoint}. Status: ${t.status}. Event:`,e)})).catch((t=>{console.warn(`Error sending event to ${this.endpoint}:`,t,"Event:",e)}))}processEventQueue(){for(;this.eventQueue.length>0;){const e=this.eventQueue.shift();e&&this.sendEventPayload(e)}}handleEvent(e){this.isConnectedToServer?this.sendEventPayload(e):this.eventQueue.push(e)}};LocalServerHandler=__decorateClass$s([K()],LocalServerHandler);var __getOwnPropDesc$r=Object.getOwnPropertyDescriptor,__decorateClass$r=(e,t,r,n)=>{for(var i,a=n>1?void 0:n?__getOwnPropDesc$r(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=i(a)||a);return a};let LogAnalyticsHandler=class{constructor(){__publicField2(this,"logger",getLogger("Analytics"))}handleEvent(e){}};LogAnalyticsHandler=__decorateClass$r([K()],LogAnalyticsHandler);let clientHints=null;const getClientHints=async()=>{if(!navigator.userAgentData)return{platformVersion:void 0};if(clientHints)return{...clientHints};const e=await navigator.userAgentData.getHighEntropyValues(["platformVersion"]);return clientHints={platformVersion:e.platformVersion},{...clientHints}};var __getOwnPropDesc$q=Object.getOwnPropertyDescriptor,__decorateClass$q=(e,t,r,n)=>{for(var i,a=n>1?void 0:n?__getOwnPropDesc$q(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=i(a)||a);return a},__decorateParam$c=(e,t)=>(r,n)=>t(r,n,e);let VintomAnalyticsHandler=class{constructor(e){__publicField2(this,"endpoints",[]),this.endpoints=e.analyticsEndpoints.filter((e=>"vintom"===e.provider)).map((e=>e.vintomServer))}handleEvent(e){e.isMiscelaneous||this.sendEvent(e)}async sendEvent(e){const t=this.serializeEvent(e),{platformVersion:r}=await getClientHints();r&&(t.pv=r),t&&this.sendSerializedData({...t})}sendSerializedData(e){this.endpoints.forEach((async t=>{try{await fetch(t,{method:"POST",keepalive:!0,headers:{"Content-Type":"application/json; charset=UTF-8"},body:JSON.stringify(e)})}catch(r){}}))}serializeEvent(e){switch(e.type){case"playerInit":case"playerStart":case"notSupportedBrowser":return this.serialize(e);case"playerError":return this.serialize(e,{ei:e.error.errorCode,em:e.error.message});case"ctaShow":return this.serialize(e,{ct:e.ctaId});case"ctaAction":return this.serialize(e,{ct:e.ctaId,ac:e.actionId,ds:e.actionAdditionalData});case"scenarioElementStart":return this.serialize(e,{d:this.toMs(e.duration),vo:100*e.volume});case"reportSegmentPlayed":return this.serialize(e,{vo:100*e.volume,d:this.toMs(e.duration),t:this.toMs(e.segment.end),ts:this.toMs(e.segment.start),er:this.mapEndReasonToLegacy(e.segment.endReason)});default:return}}serialize(e,t){return{type:this.mapTypeToLegacy(e.type),dttm:e.timestamp,se:e.scenarioElementId,c:e.videoId,vui:e.userIdentifier,vd:e.videoDate,pc:e.projectId,gr:e.groupId,pv:void 0,...t}}mapTypeToLegacy(e){const t={playerInit:"PLAYER_INIT",playerStart:"PLAYER_START",playerError:"PLAYER_ERROR",scenarioElementStart:"SCENARIO_ELEMENT_START",reportSegmentPlayed:"SCENARIO_ELEMENT_PLAYING",scenarioElementProgress:"SCENARIO_ELEMENT_PROGRESS",ctaShow:"CTA_SHOW",ctaAction:"CTA_ACTION",notSupportedBrowser:"NOT_SUPPORTED_BROWSER"}[e];if(!t)throw new Error(`Unknown event type: ${e}`);return t}mapEndReasonToLegacy(e){if(null==e)return;const t={seek:"SEEKED",end:"FINISHED",hidden:"HIDDEN",pause:"PAUSED"}[e];if(!t)throw new Error(`Unknown end reason: ${e}`);return t}toMs(e){return Math.round(1e3*e)}};VintomAnalyticsHandler=__decorateClass$q([K(),__decorateParam$c(0,O$1(Types.PlayerConfig))],VintomAnalyticsHandler);var __defProp$9=Object.defineProperty,__getOwnPropDesc$p=Object.getOwnPropertyDescriptor,__decorateClass$p=(e,t,r,n)=>{for(var i,a=n>1?void 0:n?__getOwnPropDesc$p(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n?i(t,r,a):i(a))||a);return n&&a&&__defProp$9(t,r,a),a};let PosterLoaderImpl=class{constructor(){__publicField2(this,"hasPreloadedPosters"),__publicField2(this,"cachedPosters",new Map),__publicField2(this,"config")}preloadPoster(e){const t="string"==typeof e,r=t?e:e.id,n=t?e:e.poster;return this.cachedPosters.has(r)?Promise.resolve(this.cachedPosters.get(r)):new Promise((e=>{const t=new Image;t.onload=()=>{this.cachedPosters.set(r,t),e(t)},t.src=n,t.complete&&e(t)}))}preloadPosters(){if(this.hasPreloadedPosters)return;const e=this.config.scenarioElements.flatMap((e=>[e.poster,...e.ctas.map((e=>e.poster))])).filter((e=>!!e));for(const t of e){if(document.querySelector(`link[rel=preload][href="${t}"]`))continue;const e=document.createElement("link");e.rel="preload",e.as="image",e.href=t,document.head.appendChild(e)}this.hasPreloadedPosters=!0}};__decorateClass$p([O$1(Types.PlayerConfig)],PosterLoaderImpl.prototype,"config",2),PosterLoaderImpl=__decorateClass$p([K()],PosterLoaderImpl);const _BookmarkURLEncoder=class e{constructor(){}static encode(t){var r;const n=[t.time.toFixed(2),t.scenarioElementId,(null==(r=t.debugInfoIndex)?void 0:r.toString())??""].join(e.SEPARATOR);return btoa(n).replace(/=/g,e.PADDING_REPLACEMENT)}static decode(t){const r=t.replace(new RegExp(e.PADDING_REPLACEMENT,"g"),e.PADDING_CHAR);let n;try{n=atob(r)}catch(c){throw new Error("Invalid base64 encoding for BookmarkURLEncoder decoding")}const i=n.split(e.SEPARATOR);if(3!==i.length)throw new Error("Invalid data format for BookmarkURLEncoder decoding");const[a,s,o]=i,l=Number(a),u=o?Number(o):void 0;if(isNaN(l)||"string"!=typeof s||void 0!==u&&isNaN(u))throw new Error("Invalid data types for BookmarkURLEncoder decoding");return{label:e.DEFAULT_LABEL,time:l,scenarioElementId:s,debugInfoIndex:u}}};__publicField2(_BookmarkURLEncoder,"SEPARATOR",""),__publicField2(_BookmarkURLEncoder,"PADDING_CHAR","="),__publicField2(_BookmarkURLEncoder,"PADDING_REPLACEMENT","_"),__publicField2(_BookmarkURLEncoder,"DEFAULT_LABEL","TEMPORARY URL BOOKMARK");let BookmarkURLEncoder=_BookmarkURLEncoder;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),Symbol$1=root.Symbol,objectProto$5=Object.prototype,hasOwnProperty$5=objectProto$5.hasOwnProperty,nativeObjectToString$1=objectProto$5.toString,symToStringTag$1=Symbol$1?Symbol$1.toStringTag:void 0;function getRawTag(e){var t=hasOwnProperty$5.call(e,symToStringTag$1),r=e[symToStringTag$1];try{e[symToStringTag$1]=void 0;var n=!0}catch(e2){}var i=nativeObjectToString$1.call(e);return n&&(t?e[symToStringTag$1]=r:delete e[symToStringTag$1]),i}var objectProto$4=Object.prototype,nativeObjectToString=objectProto$4.toString;function objectToString(e){return nativeObjectToString.call(e)}var nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=Symbol$1?Symbol$1.toStringTag:void 0;function baseGetTag(e){return null==e?void 0===e?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(e)?getRawTag(e):objectToString(e)}function isObjectLike(e){return null!=e&&"object"==typeof e}var symbolTag="[object Symbol]";function isSymbol(e){return"symbol"==typeof e||isObjectLike(e)&&baseGetTag(e)==symbolTag}function arrayMap(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r-1&&e%1==0&&e-1}function listCacheSet(e,t){var r=this.__data__,n=assocIndexOf(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function ListCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t{const t=new URL(window.location.href);return t.searchParams.set("t",BookmarkURLEncoder.encode(e)),t.toString()},getGlobalVintomNamespace=()=>{const e=Symbol.for("Vintom"),t=window;return t[e]||(t[e]={}),t[e]},setGlobalVintom=(e,t)=>{set$1(getGlobalVintomNamespace(),e,t)},getGlobalVintom=e=>get$1(getGlobalVintomNamespace(),e),globalVintom={set:setGlobalVintom,get:getGlobalVintom};class AssetRepository{constructor(){__publicField2(this,"assets",new Map)}addAsset(e,t){this.assets.set(e,t)}getAsset(e){return this.assets.get(e)}hasAsset(e){return this.assets.has(e)}deleteAsset(e){this.assets.delete(e)}}const getOrCreateRepository=e=>(globalVintom.get(e)||globalVintom.set(e,new AssetRepository),globalVintom.get(e)),assetRepository=getOrCreateRepository("assets"),animationRepository=getOrCreateRepository("animations"),ctaRepository=getOrCreateRepository("ctas");var loadjs_umd$1={exports:{}},loadjs_umd=loadjs_umd$1.exports,hasRequiredLoadjs_umd;function requireLoadjs_umd(){return hasRequiredLoadjs_umd||(hasRequiredLoadjs_umd=1,loadjs_umd$1.exports=function(){var e=function(){},t={},r={},n={};function i(e,t){e=e.push?e:[e];var i,a,s,o=[],l=e.length,u=l;for(i=function(e,r){r.length&&o.push(e),--u||t(o)};l--;)a=e[l],(s=r[a])?i(a,s):(n[a]=n[a]||[]).push(i)}function a(e,t){if(e){var i=n[e];if(r[e]=t,i)for(;i.length;)i[0](e,t),i.splice(0,1)}}function s(t,r){t.call&&(t={success:t}),r.length?(t.error||e)(r):(t.success||e)(t)}function o(t,r,n,i){var a,s,l=document,u=n.async,c=(n.numRetries||0)+1,d=n.before||e,h=t.replace(/^(css|img)!/,"");i=i||0,/(^css!|\.css$)/.test(t)?(a=!0,(s=l.createElement("link")).rel="stylesheet",s.href=h):/(^img!|\.(png|gif|jpg|svg)$)/.test(t)?(s=l.createElement("img")).src=h:((s=l.createElement("script")).src=t,s.async=void 0===u||u),s.onload=s.onerror=s.onbeforeload=function(e){var l=e.type[0];if(a&&"hideFocus"in s)try{s.sheet.cssText.length||(l="e")}catch(u){18!=u.code&&(l="e")}if("e"==l&&(i+=1){for(var i,a=n>1?void 0:n?__getOwnPropDesc$o(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=i(a)||a);return a};let ResourceLoaderImpl=class{loadResources(e,t){const r=e.filter((e=>!assetRepository.hasAsset(e.location))),n=e.filter((e=>assetRepository.hasAsset(e.location))).map((e=>assetRepository.getAsset(e.location))),i=r.filter((e=>"CSS"===e.type)).map((e=>e.location)),a=r.filter((e=>"JS"===e.type)).map((e=>e.location));return Promise.all([...n,this.loadCssResources(i,t),this.loadJsResources(a,t)]).then((()=>Promise.resolve()))}loadJsResources(e,t){return e.length?Promise.all(e.map((e=>this.loadJSResource(e,t)))).then((()=>Promise.resolve())):Promise.resolve()}loadJSResource(e,t){const r=new Promise(((r,n)=>{loadjs([e],e,{error:()=>t?r():n(),success:r})})).then((()=>Promise.resolve()));return assetRepository.addAsset(e,r),r}loadCssResources(e,t){return Promise.all(e.map((e=>this.loadCssResource(e,t)))).then((()=>Promise.resolve()))}loadCssResource(e,t){const r=document.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("type","text/css"),r.setAttribute("href",e);const n=new Promise(((e,n)=>{document.head.appendChild(r),r.onload=()=>e(),r.onerror=()=>t?e():n()})).then((()=>Promise.resolve()));return assetRepository.addAsset(e,n),n}};ResourceLoaderImpl=__decorateClass$o([K()],ResourceLoaderImpl);const version$7="3.0.0";let Config$1=(_f3=class{},__publicField2(_f3,"defaultconfigServerUrl","https://vintom.com/"),__publicField2(_f3,"defaultCTAStorageUrl","https://player2.vintom.com/"),__publicField2(_f3,"defaultAnimationsAssetsUrl","https://player2.vintom.com/html-anims/"),__publicField2(_f3,"vintomNamespace","vintom"),__publicField2(_f3,"placeholderStartMarker","["),__publicField2(_f3,"placeholderEndMarker","]"),__publicField2(_f3,"placeholder",(e=>`${_f3.placeholderStartMarker}${e}${_f3.placeholderEndMarker}`)),__publicField2(_f3,"ctaStorageUrlPlaceholder",`${_f3.placeholder("ctaStorageUrl")}`),__publicField2(_f3,"ctaTypePlaceholder",`${_f3.placeholder("type")}`),__publicField2(_f3,"jsCTAStorageUrlPattern",`${_f3.ctaStorageUrlPlaceholder}cta/${_f3.ctaTypePlaceholder}/cta.js`),__publicField2(_f3,"htmlCTAStorageUrlPattern",`${_f3.ctaStorageUrlPlaceholder}cta/${_f3.ctaTypePlaceholder}/cta.html`),__publicField2(_f3,"cssCTAStorageUrlPattern",`${_f3.ctaStorageUrlPlaceholder}cta/${_f3.ctaTypePlaceholder}/cta.css`),__publicField2(_f3,"videoConfigurationUrl",((e,t)=>{const r=`${e||_f3.defaultconfigServerUrl}/videoConfiguration/v2`;return t?`${r}/${t}`:r})),__publicField2(_f3,"videoLogUrl",(e=>`${_f3.defaultconfigServerUrl}video/logError/${e}`)),_f3);var uaParser$1={exports:{}},uaParser=uaParser$1.exports,hasRequiredUaParser;function requireUaParser(){return hasRequiredUaParser||(hasRequiredUaParser=1,e=uaParser$1,t=uaParser$1.exports,function(r,n){var i="function",a="undefined",s="object",o="string",l="major",u="model",c="name",d="type",h="vendor",p="version",f="architecture",m="console",g="mobile",y="tablet",v="smarttv",_="wearable",b="embedded",T="Amazon",S="Apple",E="ASUS",w="BlackBerry",A="Browser",C="Chrome",k="Firefox",P="Google",x="Huawei",I="LG",R="Microsoft",D="Motorola",M="Opera",L="Samsung",O="Sharp",N="Sony",F="Xiaomi",B="Zebra",$="Facebook",U="Chromium OS",j="Mac OS",q=" Browser",V=function(e){for(var t={},r=0;r0?2===l.length?typeof l[1]==i?this[l[0]]=l[1].call(this,c):this[l[0]]=l[1]:3===l.length?typeof l[1]!==i||l[1].exec&&l[1].test?this[l[0]]=c?c.replace(l[1],l[2]):n:this[l[0]]=c?l[1].call(this,c,l[2]):n:4===l.length&&(this[l[0]]=c?l[3].call(this,c.replace(l[1],l[2])):n):this[l]=c||n;d+=2}},Z=function(e,t){for(var r in t)if(typeof t[r]===s&&t[r].length>0){for(var i=0;i2&&(e[u]="iPad",e[d]=y),e},this.getEngine=function(){var e={};return e[c]=n,e[p]=n,W.call(e,v,b.engine),e},this.getOS=function(){var e={};return e[c]=n,e[p]=n,W.call(e,v,b.os),T&&!e[c]&&_&&_.platform&&"Unknown"!=_.platform&&(e[c]=_.platform.replace(/chrome os/i,U).replace(/macos/i,j)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return v},this.setUA=function(e){return v=typeof e===o&&e.length>500?G(e,500):e,this},this.setUA(v),this};Y.VERSION="1.0.40",Y.BROWSER=V([c,p,l]),Y.CPU=V([f]),Y.DEVICE=V([u,h,d,m,g,v,y,_,b]),Y.ENGINE=Y.OS=V([c,p]),e.exports&&(t=e.exports=Y),t.UAParser=Y;var Q=typeof r!==a&&(r.jQuery||r.Zepto);if(Q&&!Q.ua){var J=new Y;Q.ua=J.getResult(),Q.ua.get=function(){return J.getUA()},Q.ua.set=function(e){J.setUA(e);var t=J.getResult();for(var r in t)Q.ua[r]=t[r]}}}("object"==typeof window?window:uaParser)),uaParser$1.exports;var e,t}var uaParserExports=requireUaParser();const _BrowserInformationDetector=class e{constructor(){__publicField2(this,"parser"),__publicField2(this,"supportedBrowsers",[{name:"chrome",minVersion:51},{name:"chromium",minVersion:51},{name:"edge",minVersion:15},{name:"firefox",minVersion:54},{name:"firefox",minVersion:60,os:"XP"},{name:"ios",minVersion:10},{name:"ios",minVersion:10,device:"iPhone"},{name:"webkit",minVersion:601,device:"iPhone"},{name:"webkit",minVersion:601,device:"iPad"},{name:"opera",minVersion:38},{name:"opera mobile",minVersion:16},{name:"safari",minVersion:10},{name:"mobile safari",minVersion:10},{name:"samsung",minVersion:7},{name:"samsung browser",minVersion:7},{name:"samsung internet",minVersion:7},{name:"android browser",minVersion:12},{name:"chrome webview",minVersion:51},{name:"gsa",minVersion:60},{name:"facebook",minVersion:150},{name:"ucbrowser",minVersion:12},{name:"vivaldi",minVersion:2},{name:"huawei browser",minVersion:11},{name:"miui browser",minVersion:10}]),this.parser=new uaParserExports.UAParser(navigator.userAgent)}static getInstance(){return e.instance||(e.instance=new e),e.instance}isAndroid(){return/Android/i.test(navigator.userAgent)}isMobileDevice(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}isTablet(){return/(tablet|ipad|playbook|silk)|(android(?!.*mobile))/i.test(navigator.userAgent)}isFullscreenSupported(){return"ios"!==this.getOS().toLowerCase()&&!this.isSafari()}isFullscreenImitationSupported(){return!this.isFullscreenSupported()&&!this.isInIframe()}getBrowserName(){return this.parser.getBrowser().name.toLowerCase()}isSafari(){return-1!==this.getBrowserName().indexOf("safari")||"ios"===this.getBrowserName()}isIE(){return"ie"===this.getBrowserName()}isFirefox(){return"firefox"===this.getBrowserName()}isChrome(){return"chrome"===this.getBrowserName()||"crios"===this.getBrowserName()}isDashSupported(){return!this.isSafari()}getBrowserMajorVersion(){return Number(this.parser.getBrowser().version.split(".")[0])}getOS(){return this.parser.getOS().version}getOSName(){return this.parser.getOS().name.toLowerCase()}isIOS(){return"ios"===this.getOSName()}isInIframe(){return window.self!==window.top}isIOS9Supported(){if("mobile safari"===this.getBrowserName()&&9===this.getBrowserMajorVersion()){return Number(this.getOS().split(".")[0]+(this.getOS().split(".")[1]?"."+this.getOS().split(".")[1]:""))>=9.1}return!0}isBrowserSupported(){if(!this.isIOS9Supported())return!1;const e=this.supportedBrowsers.filter((e=>e.name===this.getBrowserName()));if(e.length){const t=e.find((e=>e.device&&new RegExp(e.device,"i").test(navigator.userAgent))),r=e.find((e=>e.os&&e.os===this.getOS()));if(r)return r.minVersion<=this.getBrowserMajorVersion();if(t)return t.minVersion<=this.getBrowserMajorVersion();{const t=e.find((e=>!e.device));return!!t&&t.minVersion<=this.getBrowserMajorVersion()}}return!1}};__publicField2(_BrowserInformationDetector,"instance");let BrowserInformationDetector=_BrowserInformationDetector;const BrowserInfo=BrowserInformationDetector.getInstance(),_VintomError=class e extends Error{constructor(t,r,n){super(r),__publicField2(this,"options"),__publicField2(this,"errorAdditionalInfo"),__publicField2(this,"stackTrace"),this.errorCode=t,this.message=r,this.name="VintomError("+t+")",this.options={...e.DEFAULT_OPTIONS,...n||{}},this.errorAdditionalInfo={},this.errorAdditionalInfo.playerVersion=version$7,navigator.userAgent&&(this.errorAdditionalInfo.userAgent=navigator.userAgent),BrowserInfo.getBrowserMajorVersion()&&(this.errorAdditionalInfo.browserMajorVersion=BrowserInfo.getBrowserMajorVersion()),BrowserInfo.getBrowserName()&&(this.errorAdditionalInfo.browserName=BrowserInfo.getBrowserName()),BrowserInfo.getOS()&&(this.errorAdditionalInfo.operatingSystem=BrowserInfo.getOS()),this.stack=new Error(r).stack}toString(){return this.message}async sendErrorToAnalytics(e,t){const r=Config$1.videoLogUrl(e),n={errorCode:this.errorCode,message:this.message,projectId:t,userAgent:this.errorAdditionalInfo.userAgent,playerVersion:this.errorAdditionalInfo.playerVersion,operatingSystem:this.errorAdditionalInfo.operatingSystem,browserName:this.errorAdditionalInfo.browserName,browserMajorVersion:this.errorAdditionalInfo.browserMajorVersion,stackTrace:this.stackTrace};await fetch(r,{method:"POST",body:JSON.stringify(n)}).catch((e=>{console.error("Failed to send error to analytics",e)}))}};__publicField2(_VintomError,"DEFAULT_OPTIONS",{isLogAndSendToAnalytics:!0,isDisplayToUser:!0});let VintomError=_VintomError;const replacePlayerDataPlaceholders=(e,t,r)=>{if(!e)return e;const n=new RegExp("\\[[A-Za-z0-9-_]+]","g");if("string"==typeof e){const i=e.match(n);return(null==i?void 0:i.reduce(((e,n)=>{const i=n.slice(1,-1),a=t[i],s=(null==r?void 0:r(a))??a;return e.replace(n,s??n)}),e))??e}return Object.fromEntries(Object.entries(e).map((([e,n])=>[e,replacePlayerDataPlaceholders(n,t,r)])))},SECONDS_IN_MINUTE=60,SECONDS_IN_HOUR=60*SECONDS_IN_MINUTE,formatTime$1=(e,t)=>{const r=Math.floor(e/SECONDS_IN_HOUR),n=Math.floor((e-r*SECONDS_IN_HOUR)/SECONDS_IN_MINUTE),i=Math.floor(e-r*SECONDS_IN_HOUR-n*SECONDS_IN_MINUTE),a=("00"+Math.floor(1e3*(e-r*SECONDS_IN_HOUR-n*SECONDS_IN_MINUTE-i))).slice(-3),s=i<10?`0${i}`:`${i}`,o=t?`${s}.${a}`:s;return r?`${r}:${n<10?`0${n}`:`${n}`}:${o}`:n?`${n}:${o}`:`0:${o}`},hashCode=e=>{let t=0;if(0===e.length)return t;for(let r=0;r{if(!e.length)return"";const t=e[0];return/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?`${t.replace(/\/+$/,"")}/${e.slice(1).filter(Boolean).map((e=>e.replace(/^\/+|\/+$/g,""))).filter(Boolean).join("/")}`:/^[a-z][a-z0-9+.-]*$/i.test(t)?`${t}://${e.slice(1).filter(Boolean).map((e=>e.replace(/^\/+|\/+$/g,""))).filter(Boolean).join("/")}`:e.filter(Boolean).map((e=>e.replace(/^\/+|\/+$/g,""))).filter(Boolean).join("/")},parseAspectRatio=e=>{if(!e)return 0;const t=e.includes(":")?e.split(":"):e.split("/");if(2!==t.length)return 0;const r=parseFloat(t[0]),n=parseFloat(t[1]);return n?r/n:0};class CTAResource{constructor(e,t){this.ctaFactory=e,this.html=t}}const createLegacyApiForCTAs=e=>({jumpToScenarioElement(t,r){e.goToScenarioElement(t,{progress:null==r?void 0:r.progress})},replay(){e.setCurrentTime(0),e.play()},onCTAAction(t,r,n){e.trigger("cta.action",{ctaId:t,actionId:r,extra:n})}}),convertLegacyCTAToNewCTA=e=>t=>{const r=createLegacyApiForCTAs(t.player);return e(r,t.id,t.target,t.data),{}},ACTION_ID=0,clickableAreaConditionalCTAFunction=(e,t,r,n)=>{const i=document.createElement("div"),a=n.conditionalParam&&n.conditionalValue,s=a&&n.conditionalParam.toLowerCase()===n.conditionalValue.toLowerCase();a&&!s||(i.setAttribute("class","clickableAreaItem"),i.style.top=`${parseInt(n.top,10)}%`,i.style.bottom=`${parseInt(n.bottom,10)}%`,i.style.left=`${parseInt(n.left,10)}%`,i.style.right=`${parseInt(n.right,10)}%`,i.style.position="absolute",i.style.pointerEvents="all",i.style.cursor="pointer"),i.onclick=()=>{n.scenarioElementId?e.jumpToScenarioElement(n.scenarioElementId):window.open(n.url,n.target?n.target:"_blank"),e.onCTAAction(t,ACTION_ID)};return r.querySelector("[data-role='container']").appendChild(i),{action:()=>{}}},clickableAreaConditionalHTML='
\r\n',createLegacyPrepackagedCTAs=()=>{const e=new Map;return e.set("clickableArea",new CTAResource(convertLegacyCTAToNewCTA(clickableAreaConditionalCTAFunction),clickableAreaConditionalHTML)),e.set("clickableareaconditional_new",new CTAResource(convertLegacyCTAToNewCTA(clickableAreaConditionalCTAFunction),clickableAreaConditionalHTML)),e.set("clickableAreaConditional",new CTAResource(convertLegacyCTAToNewCTA(clickableAreaConditionalCTAFunction),clickableAreaConditionalHTML)),e},createPrepackagedCTAs=()=>{const e=new Map,t=createLegacyPrepackagedCTAs();for(const[r,n]of t)e.set(r,n);return e},prepackagedCTAs=createPrepackagedCTAs();var __getOwnPropDesc$n=Object.getOwnPropertyDescriptor,__decorateClass$n=(e,t,r,n)=>{for(var i,a=n>1?void 0:n?__getOwnPropDesc$n(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=i(a)||a);return a},__decorateParam$b=(e,t)=>(r,n)=>t(r,n,e);class ResourcesCache{constructor(){__publicField2(this,"animationsBySrc",new Map),__publicField2(this,"ctasByType",new Map)}}let ScenarioLoaderImpl=class{constructor(e,t,r){__publicField2(this,"cache",new ResourcesCache),__publicField2(this,"player"),this.animationPersonalizer=e,this.resourceLoader=t,this.playerConfig=r}setPlayerDelegate(e){this.player=e}async loadResources(){var e;const t=null==(e=this.playerConfig.animationSettings)?void 0:e.sourceUrl;t&&await this.resourceLoader.loadResources([{location:t,type:"JS"}])}async loadScenarioElementResources(e){this.loadPrepackagedCTAResources();const{personalizationData:t,urls:r}=this.playerConfig;return await Promise.all([this.loadAndPersonalizeAnimationResources(e,t),this.loadAndPersonalizeCTAResources(e,t,r.ctaFolderUrl)]),this.cache}loadPrepackagedCTAResources(){Array.from(prepackagedCTAs.keys()).forEach((e=>{const{html:t,ctaFactory:r}=prepackagedCTAs.get(e);this.cache.ctasByType.set(e,{html:t,ctaFactory:this.createAppliedCTAFactory(r)})}))}async loadAndPersonalizeAnimationResources(e,t){await Promise.all(e.animations.map((e=>{this.loadAndPersonalizeAnimationResource(e,t)})))}async loadAndPersonalizeAnimationResource(e,t){let r;try{const t=await fetch(e.src);r=await t.json()}catch(n){throw new VintomError("ResourceLoadingFailure",`Failed to load animation ${e.src}`)}try{const n=this.animationPersonalizer.personalize(r,e,t);this.cache.animationsBySrc.set(e.src,n)}catch(n){throw new VintomError("ResourceLoadingFailure",`Failed to personalize animation ${e.src}`)}}loadAndPersonalizeCTAResources(e,t,r){const n=e.ctas.map((e=>e.type));return e.ctas.forEach((e=>{e.customAttributes&&(e.customAttributes=replacePlayerDataPlaceholders(e.customAttributes,t,ScenarioLoaderImpl.ctaEscapeFunction))})),Promise.all(n.map((e=>{const t=Config$1.htmlCTAStorageUrlPattern.replace(Config$1.ctaStorageUrlPlaceholder,r).replace(Config$1.ctaTypePlaceholder,e),n=Config$1.jsCTAStorageUrlPattern.replace(Config$1.ctaStorageUrlPlaceholder,r).replace(Config$1.ctaTypePlaceholder,e),i=Config$1.cssCTAStorageUrlPattern.replace(Config$1.ctaStorageUrlPlaceholder,r).replace(Config$1.ctaTypePlaceholder,e);return this.loadCTAResource(e,t,n,i)}))).then((()=>Promise.resolve()))}loadCTAResource(e,t,r,n){if(this.cache.ctasByType.get(e))return Promise.resolve();const i=fetch(t).then((e=>e.text())),a=this.resourceLoader.loadResources([{location:r,type:"JS"}]),s=this.resourceLoader.loadResources([{location:n,type:"CSS"}],!0);return Promise.all([i,a,s]).catch((()=>Promise.reject(new VintomError("ResourceLoadingFailure",`Failed to load CTA for type ${e}`)))).then((([t])=>{const r=ctaRepository.getAsset(e);if(!r)return Promise.reject(new VintomError("ResourceLoadingFailure",`Missing CTA function in cta.js file.\n Please make sure to add cta function to vintom.cta dictionary (vintom.cta.${e} = function(....) { .... }))`));this.cache.ctasByType.set(e,{html:t,ctaFactory:this.createAppliedCTAFactory(r)})}))}createAppliedCTAFactory(e){return t=>e({...t,player:this.player,dispatchAction:e=>this.player.trigger("cta.action",{ctaId:t.id,actionId:e})})||{}}static ctaEscapeFunction(e){return e?e.replace("\n","
"):e}};ScenarioLoaderImpl=__decorateClass$n([K(),__decorateParam$b(0,O$1(Types.personalizer.AnimationPersonalizer)),__decorateParam$b(1,O$1(Types.loaders.ResourceLoader)),__decorateParam$b(2,O$1(Types.PlayerConfig))],ScenarioLoaderImpl);const SilentMusic="data:audio/wav;base64,UklGRjIAAABXQVZFZm10IBIAAAABAAEAQB8AAEAfAAABA\nAgAAABmYWN0BAAAAAAAAABkYXRhAAAAAA==",BlankVideo="data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAA\nAIZnJlZQAAAW9tZGF0AAFRgAAAAAIJEAAAABZnTUAKllYhNCAAAAMAIAAABgG0EQinAAAABGjOPIAAAAAzBgUvAv\nhhUPxwQXK3Mkjzpyo9NE1pY3Jvc29mdCBILjI2NCBFbmNvZGVyIFYxLjUuMwCAAAAA4gYF3suyE5KYc0PaqKbHQp\ng1bPVzcmM6MyBoOjY0IHc6NjQgZnBzOjI0LjAwMCBwZjo3NyBsdmw6MCBiOjIgYnFwOjMgZ29wOjI0IGlkcjoyNC\nBzbGM6MSBjbXA6MCByYzowIHFwOjI2IHJhdGU6MCBwZWFrOjAgYnVmZjowIHJlZjoyIHNyY2g6MzIgYXNyY2g6MS\nBzdWJwOjEgcGFyOjYgMyAzIHJuZDowIGNhYmFjOjAgbHA6MiBjdG50OjAgYXVkOjEgbGF0OjAgd3JrOjE2IHZ1aT\noxIGx5cjoxIDw8AIAAAAAaZYiAQAT///w9FAAEB/3331111111111114AAAAU6bW9vdgAAAGxtdmhkAAAAAOO5W3\nLjuVtyAAAwAAAAAgAAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAl90cmFrAAAAXHRraGQAAAAD47lbcuO5W3IAAAABAAAAAAAAAg\nAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAEAAAABAAAAAAAAkZW\nR0cwAAABxlbHN0AAAAAAAAAAEAAAIAAAAAAAABAAAAAAAUdHJlZgAAAAx0bWNkAAAAAgAAAcNtZGlhAAAAIG1kaG\nQAAAAA47lbcuO5W3IAADAAAAACAFXEAAAAAAAtaGRscgAAAAAAAAAAdmlkZQAAAAAAAAAAAAAAAFZpZGVvSGFuZG\nxlcgAAAAFubWluZgAAABR2bWhkAAAAAQAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAA\nABAAABLnN0YmwAAADKc3RzZAAAAAAAAAABAAAAumF2YzEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAQABAAEgAAA\nBIAAAAAAAAAAEFSC4yNjQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY//8AAAAtYXZjQwFNQAr/4QAWZ01ACp\nZWITQgAAADACAAAAYBtBEIpwEABGjOPIAAAAATY29scm5jbHgAAQABAAYAAAAAEHBhc3AAAAABAAAAAQAAABRidH\nJ0AAAAAAABCkAAAQpAAAAAGHN0dHMAAAAAAAAAAQAAAAEAAAIAAAAAHHN0c2MAAAAAAAAAAQAAAAEAAAABAAAAAQ\nAAABRzdHN6AAAAAAAAAWMAAAABAAAAFHN0Y28AAAAAAAAAAQAAADQAAAGwdHJhawAAAFx0a2hkAAAAA+O5W3LjuV\ntyAAAAAgAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAA\nAAAAAAAAAAAAAAJGVkdHMAAAAcZWxzdAAAAAAAAAABAAACAAAAAAAAAQAAAAABKG1kaWEAAAAgbWRoZAAAAADjuV\nty47lbcgAAMAAAAAIAAAAAAAAAADBoZGxyAAAAAAAAAAB0bWNkAAAAAAAAAAAAAAAAVGltZUNvZGVIYW5kbGVyAA\nAAANBtaW5mAAAADG5taGQAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAAAmHN0YmwAAA\nA0c3RzZAAAAAAAAAABAAAAJHRtY2QAAAAAAAAAAQAAAAAAAAAAAAAwAAAAAgAYAAAAAAAAGHN0dHMAAAAAAAAAAQ\nAAAAEAAAIAAAAAHHN0c2MAAAAAAAAAAQAAAAEAAAABAAAAAQAAABRzdHN6AAAAAAAAAAQAAAABAAAAFHN0Y28AAA\nAAAAAAAQAAADAAAAB2dWR0YQAAAG5tZXRhAAAAAAAAACFoZGxyAAAAAAAAAABtZGlyYXBwbAAAAAAAAAAAAAAAAE\nFpbHN0AAAAOal0b28AAAAxZGF0YQAAAAEAAAAAQmxhY2ttYWdpYyBEZXNpZ24gRGFWaW5jaSBSZXNvbHZlAAAAQW\n1ldGEAAAAhaGRscgAAAAAAAAAAbWR0YQAAAAAAAAAAAAAAAAAAAAAQa2V5cwAAAAAAAAAAAAAACGlsc3Q=",BlankAssets={SilentMusic:SilentMusic.replace(/\s+/g,""),BlankVideo:BlankVideo.replace(/\s+/g,"")};var __getOwnPropDesc$m=Object.getOwnPropertyDescriptor,__decorateClass$m=(e,t,r,n)=>{for(var i,a=n>1?void 0:n?__getOwnPropDesc$m(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=i(a)||a);return a};let MusicPlayerImpl=class{constructor(){__publicField2(this,"context"),__publicField2(this,"shouldBePlaying"),__publicField2(this,"safariInitialized"),__publicField2(this,"audio"),__publicField2(this,"gainNode"),__publicField2(this,"volumeValue"),this.audio=new Audio,this.audio.crossOrigin="anonymous",this.audio.volume=1,BrowserInfo.isSafari()&&(this.audio.src=BlankAssets.SilentMusic);const e=async()=>{window.removeEventListener("click",e),this.gainNode=this.createConnectedGainNode(),this.volume=this.volumeValue,this.audio.muted=!1,BrowserInfo.isSafari()&&await this.initializeSafari()};window.addEventListener("click",e),this.loop=!1,window.AUDIO=this}get playbackRate(){return this.audio.playbackRate}set playbackRate(e){this.audio.playbackRate=e}get isPlaying(){return!this.audio.paused}get currentTime(){return this.audio.currentTime}set currentTime(e){this.audio.currentTime=e}get volume(){return this.audio.muted?0:this.volumeValue}set volume(e){this.volumeValue=e,this.gainNode?this.gainNode.gain.value=this.volumeValue:this.audio.muted=!0}get loop(){return this.audio.loop}set loop(e){this.audio.loop=e}set src(e){this.audio.src=e,this.audio.load()}get src(){return this.audio.src}async play(){if(this.shouldBePlaying=!0,!BrowserInfo.isSafari()||this.safariInitialized||this.audio.paused||this.audio.pause(),!this.audio.ended||this.loop)return this.audio.play()}pause(){this.shouldBePlaying=!1,this.audio.pause()}async initializeSafari(){this.gainNode.gain.value=0,this.audio.readyState<2&&await new Promise((e=>{const t=()=>{this.audio.removeEventListener("loadeddata",t),e()};this.audio.addEventListener("loadeddata",t)})),await this.audio.play(),this.safariInitialized=!0,this.shouldBePlaying||this.pause(),this.gainNode.gain.value=this.volumeValue}createConnectedGainNode(){const e=new(window.AudioContext||window.webkitAudioContext);this.context=e;const t=e.createGain(),r=e.createMediaElementSource(this.audio);return t.connect(e.destination),r.connect(t),t}};MusicPlayerImpl=__decorateClass$m([K()],MusicPlayerImpl);var __defProp$8=Object.defineProperty,__getOwnPropDesc$l=Object.getOwnPropertyDescriptor,__defNormalProp$2=(e,t,r)=>t in e?__defProp$8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__decorateClass$l=(e,t,r,n)=>{for(var i,a=n>1?void 0:n?__getOwnPropDesc$l(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=i(a)||a);return a},__decorateParam$a=(e,t)=>(r,n)=>t(r,n,e),__publicField$2=(e,t,r)=>__defNormalProp$2(e,t+"",r);let PlayerMusicManagerImpl=class{constructor(e,t,r,n){__publicField2(this,"afterEndTime",0),__publicField2(this,"lastUpdateTime",0),__publicField2(this,"shouldBePlaying",!1),__publicField2(this,"startDelay",0),__publicField2(this,"initialized",!1),__publicField2(this,"loopIntervalId",null),__publicField2(this,"syncOnPlay",!0),__publicField2(this,"waitOnBuffering",!0),__publicField2(this,"reportUpdateError",(e=>{console.error("Error during music player update",e)})),this.volumeTransitionManager=e,this.musicPlayer=t,this.videoLayer=r,this.playerEvents=n,this.volumeTransitionManager.updateTransitions(0)}get src(){return this.musicPlayer.src}set src(e){this.musicPlayer.src=e}set playbackRate(e){this.musicPlayer.playbackRate=e}get playbackRate(){return this.musicPlayer.playbackRate}get player(){return this.videoLayer.getPlayer()}get currentTime(){return this.videoLayer.getCurrentSeekTime()+this.afterEndTime}setDelay(e){this.startDelay=e}pause(){this.shouldBePlaying=!1,this.update().catch(this.reportUpdateError)}play(){this.shouldBePlaying=!0,this.src&&(this.initialized||(this.installLoop(),this.initialized=!0),this.update().catch(this.reportUpdateError))}loadSoundtrackTransitions(e){this.resetTransitions();const{fadeInDuration:t,startOffset:r,endOffset:n,fadeOutDuration:i}=e;r&&this.setDelay(r),t&&(this.addVolumeTransition(-1,0,0),this.addVolumeTransition(this.startDelay,1,t)),i&&this.playerEvents.once("scenarioelement.loaded",(()=>{this.addVolumeTransition(this.player.duration()-i-n,0,i)}))}resetTransitions(){this.startDelay=0,this.volumeTransitionManager.resetTransitions()}addVolumeTransition(e,t,r){this.volumeTransitionManager.addTransition(e,t,r)}dispose(){this.musicPlayer.pause(),this.musicPlayer.src="",clearInterval(this.loopIntervalId)}sync(e=0){const t=this.player.currentTime()-this.startDelay;Math.abs(this.musicPlayer.currentTime-t)>e&&(this.musicPlayer.currentTime=t)}async update(){const e=!!this.waitOnBuffering&&(this.videoLayer.getIsWaiting()&&this.player.readyState()<=2);this.updateTimes(),this.shouldBePlaying&&this.currentTime>=this.startDelay&&!e?(!this.musicPlayer.isPlaying&&this.syncOnPlay&&this.sync(.1),this.player.paused()||this.player.muted()||await this.musicPlayer.play()):this.musicPlayer.pause(),this.volumeTransitionManager.baseVolume=this.videoLayer.getIsMuted()?0:this.videoLayer.getVolume(),this.volumeTransitionManager.updateTransitions(this.currentTime)}updateTimes(){if(this.player.ended()){const e=performance.now()-this.lastUpdateTime;this.afterEndTime+=e/1e3,this.lastUpdateTime=performance.now()}else this.afterEndTime=0}installLoop(){this.lastUpdateTime=performance.now(),this.loopIntervalId=setInterval((()=>{this.update().catch(this.reportUpdateError)}),PlayerMusicManagerImpl.INTERVAL)}};__publicField$2(PlayerMusicManagerImpl,"INTERVAL",30),PlayerMusicManagerImpl=__decorateClass$l([K(),__decorateParam$a(0,O$1(Types.music.VolumeTransitionManager)),__decorateParam$a(1,O$1(Types.music.MusicPlayer)),__decorateParam$a(2,O$1(Types.layer.VideoLayer)),__decorateParam$a(3,O$1(Types.PlayerEvents))],PlayerMusicManagerImpl);var __getOwnPropDesc$k=Object.getOwnPropertyDescriptor,__decorateClass$k=(e,t,r,n)=>{for(var i,a=n>1?void 0:n?__getOwnPropDesc$k(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=i(a)||a);return a},__decorateParam$9=(e,t)=>(r,n)=>t(r,n,e);let VolumeTransitionManagerImpl=class{constructor(e){__publicField2(this,"baseVolume",1),__publicField2(this,"transitions",[]),this.media=e}addTransition(e,t,r){const n=this.transitions.findIndex((t=>t.time===e));-1!==n?this.transitions[n]={time:e,targetVolume:t,duration:r}:this.transitions.push({time:e,targetVolume:t,duration:r}),this.transitions.sort(((e,t)=>e.time-t.time))}resetTransitions(){this.transitions=[]}updateTransitions(e){const t=this.getActiveTransition(e),r=this.getPreviousTransition(e);if(t){const n=r?r.targetVolume:this.baseVolume;this.media.volume=this.baseVolume*this.getTransitionVolume(e,n,t)}else this.media.volume=r?r.targetVolume*this.baseVolume:this.baseVolume;this.media.volume}getActiveTransition(e){for(const t of this.transitions){const r=t.time+t.duration;if(e>=t.time&&e<=r)return t}return null}getPreviousTransition(e){const t=this.transitions;for(let r=t.length-1;r>=0;r--){const n=t[r];if(n.time+n.duration-1}}function require_listCacheSet(){if(hasRequired_listCacheSet)return _listCacheSet;hasRequired_listCacheSet=1;var e=require_assocIndexOf();return _listCacheSet=function(t,r){var n=this.__data__,i=e(n,t);return i<0?(++this.size,n.push([t,r])):n[i][1]=r,this}}function require_ListCache(){if(hasRequired_ListCache)return _ListCache;hasRequired_ListCache=1;var e=require_listCacheClear(),t=require_listCacheDelete(),r=require_listCacheGet(),n=require_listCacheHas(),i=require_listCacheSet();function a(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e<=9007199254740991}}function requireIsArrayLike(){if(hasRequiredIsArrayLike)return isArrayLike_1;hasRequiredIsArrayLike=1;var e=requireIsFunction$1(),t=requireIsLength();return isArrayLike_1=function(r){return null!=r&&t(r.length)&&!e(r)}}function requireIsArrayLikeObject(){if(hasRequiredIsArrayLikeObject)return isArrayLikeObject_1;hasRequiredIsArrayLikeObject=1;var e=requireIsArrayLike(),t=requireIsObjectLike();return isArrayLikeObject_1=function(r){return t(r)&&e(r)}}_cloneBuffer.exports;var isBuffer={exports:{}},stubFalse_1,hasRequiredStubFalse,hasRequiredIsBuffer,isPlainObject_1,hasRequiredIsPlainObject,_baseIsTypedArray,hasRequired_baseIsTypedArray,_baseUnary,hasRequired_baseUnary;function requireStubFalse(){if(hasRequiredStubFalse)return stubFalse_1;return hasRequiredStubFalse=1,stubFalse_1=function(){return!1}}function requireIsBuffer(){return hasRequiredIsBuffer||(hasRequiredIsBuffer=1,e=isBuffer,t=isBuffer.exports,r=require_root(),n=requireStubFalse(),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,s=a&&a.exports===i?r.Buffer:void 0,o=(s?s.isBuffer:void 0)||n,e.exports=o),isBuffer.exports;var e,t,r,n,i,a,s,o}function requireIsPlainObject(){if(hasRequiredIsPlainObject)return isPlainObject_1;hasRequiredIsPlainObject=1;var e=require_baseGetTag(),t=require_getPrototype(),r=requireIsObjectLike(),n=Function.prototype,i=Object.prototype,a=n.toString,s=i.hasOwnProperty,o=a.call(Object);return isPlainObject_1=function(n){if(!r(n)||"[object Object]"!=e(n))return!1;var i=t(n);if(null===i)return!0;var l=s.call(i,"constructor")&&i.constructor;return"function"==typeof l&&l instanceof l&&a.call(l)==o}}function require_baseIsTypedArray(){if(hasRequired_baseIsTypedArray)return _baseIsTypedArray;hasRequired_baseIsTypedArray=1;var e=require_baseGetTag(),t=requireIsLength(),r=requireIsObjectLike(),n={};return n["[object Float32Array]"]=n["[object Float64Array]"]=n["[object Int8Array]"]=n["[object Int16Array]"]=n["[object Int32Array]"]=n["[object Uint8Array]"]=n["[object Uint8ClampedArray]"]=n["[object Uint16Array]"]=n["[object Uint32Array]"]=!0,n["[object Arguments]"]=n["[object Array]"]=n["[object ArrayBuffer]"]=n["[object Boolean]"]=n["[object DataView]"]=n["[object Date]"]=n["[object Error]"]=n["[object Function]"]=n["[object Map]"]=n["[object Number]"]=n["[object Object]"]=n["[object RegExp]"]=n["[object Set]"]=n["[object String]"]=n["[object WeakMap]"]=!1,_baseIsTypedArray=function(i){return r(i)&&t(i.length)&&!!n[e(i)]}}function require_baseUnary(){if(hasRequired_baseUnary)return _baseUnary;return hasRequired_baseUnary=1,_baseUnary=function(e){return function(t){return e(t)}}}isBuffer.exports;var _nodeUtil={exports:{}},hasRequired_nodeUtil,isTypedArray_1,hasRequiredIsTypedArray,_safeGet,hasRequired_safeGet,_assignValue,hasRequired_assignValue,_copyObject,hasRequired_copyObject,_baseTimes,hasRequired_baseTimes,_isIndex,hasRequired_isIndex,_arrayLikeKeys,hasRequired_arrayLikeKeys,_nativeKeysIn,hasRequired_nativeKeysIn,_baseKeysIn,hasRequired_baseKeysIn,keysIn_1,hasRequiredKeysIn,toPlainObject_1,hasRequiredToPlainObject,_baseMergeDeep,hasRequired_baseMergeDeep,_baseMerge,hasRequired_baseMerge,identity_1,hasRequiredIdentity,_apply,hasRequired_apply,_overRest,hasRequired_overRest,constant_1,hasRequiredConstant,_baseSetToString,hasRequired_baseSetToString,_shortOut,hasRequired_shortOut,_setToString,hasRequired_setToString,_baseRest,hasRequired_baseRest,_isIterateeCall,hasRequired_isIterateeCall,_createAssigner,hasRequired_createAssigner,merge_1,hasRequiredMerge;function require_nodeUtil(){return hasRequired_nodeUtil||(hasRequired_nodeUtil=1,e=_nodeUtil,t=_nodeUtil.exports,r=require_freeGlobal(),n=t&&!t.nodeType&&t,i=n&&e&&!e.nodeType&&e,a=i&&i.exports===n&&r.process,s=function(){try{var e=i&&i.require&&i.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(e2){}}(),e.exports=s),_nodeUtil.exports;var e,t,r,n,i,a,s}function requireIsTypedArray(){if(hasRequiredIsTypedArray)return isTypedArray_1;hasRequiredIsTypedArray=1;var e=require_baseIsTypedArray(),t=require_baseUnary(),r=require_nodeUtil(),n=r&&r.isTypedArray,i=n?t(n):e;return isTypedArray_1=i}function require_safeGet(){if(hasRequired_safeGet)return _safeGet;return hasRequired_safeGet=1,_safeGet=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}}function require_assignValue(){if(hasRequired_assignValue)return _assignValue;hasRequired_assignValue=1;var e=require_baseAssignValue(),t=requireEq(),r=Object.prototype.hasOwnProperty;return _assignValue=function(n,i,a){var s=n[i];r.call(n,i)&&t(s,a)&&(void 0!==a||i in n)||e(n,i,a)}}function require_copyObject(){if(hasRequired_copyObject)return _copyObject;hasRequired_copyObject=1;var e=require_assignValue(),t=require_baseAssignValue();return _copyObject=function(r,n,i,a){var s=!i;i||(i={});for(var o=-1,l=n.length;++o-1&&t%1==0&&t0){if(++r>=800)return arguments[0]}else r=0;return t.apply(void 0,arguments)}},_shortOut}function require_setToString(){if(hasRequired_setToString)return _setToString;hasRequired_setToString=1;var e=require_baseSetToString(),t=require_shortOut()(e);return _setToString=t}function require_baseRest(){if(hasRequired_baseRest)return _baseRest;hasRequired_baseRest=1;var e=requireIdentity(),t=require_overRest(),r=require_setToString();return _baseRest=function(n,i){return r(t(n,i,e),n+"")}}function require_isIterateeCall(){if(hasRequired_isIterateeCall)return _isIterateeCall;hasRequired_isIterateeCall=1;var e=requireEq(),t=requireIsArrayLike(),r=require_isIndex(),n=requireIsObject();return _isIterateeCall=function(i,a,s){if(!n(s))return!1;var o=typeof a;return!!("number"==o?t(s)&&r(a,s.length):"string"==o&&a in s)&&e(s[a],i)}}function require_createAssigner(){if(hasRequired_createAssigner)return _createAssigner;hasRequired_createAssigner=1;var e=require_baseRest(),t=require_isIterateeCall();return _createAssigner=function(r){return e((function(e,n){var i=-1,a=n.length,s=a>1?n[a-1]:void 0,o=a>2?n[2]:void 0;for(s=r.length>3&&"function"==typeof s?(a--,s):void 0,o&&t(n[0],n[1],o)&&(s=a<3?void 0:s,a=1),e=Object(e);++i{t.t.d.k[0].s.t=e}))}updateImage(e){this.each((t=>{const r=this.lottieManipulator.findAssetByRefId(t.refId),n=e.lastIndexOf("/");r.u=e.substring(0,n)+"/",r.p=e.substring(n+1,e.length)}))}updateEffect(e,t,r){this.each((n=>{let i=n.ef;for(let t=1;t{switch(e){case"Anchor Point":this.setMultiDimensionalValue(n.ks.a,t,r);break;case"Position":this.setMultiDimensionalValue(n.ks.p,t,r);break;case"Scale":this.setMultiDimensionalValue(n.ks.s,t,r);break;case"Rotation":this.setValue(n.ks.r,t,r);break;case"Opacity":this.setValue(n.ks.o,t,r);break;case"Position X":this.setValue(n.ks.px,t,r);break;case"Position Y":this.setValue(n.ks.py,t,r);break;case"Position Z":this.setValue(n.ks.pz,t,r);break;case"Skew":this.setValue(n.ks.sk,t,r);break;case"Skew Axis":this.setValue(n.ks.sa,t,r);break;default:throw new Error(`Invalid animation configuration (transform ${e} not supported)`)}}))}setMultiDimensionalValue(e,t,r){void 0===r?e.k=t:e.k[r].s=2===t.length?[...t,0]:t}setValue(e,t,r){if(void 0===r)e.k="number"==typeof e.k?Number(t):t;else{const n=e.k[r],i="number"==typeof n.s[0];let a=t;Array.isArray(t)||(a=i?[Number(t)]:[t]),n.s=a}}findJSONElementByName(e,t){for(const r in e)if(e.hasOwnProperty(r)){const n=e[r];if("object"==typeof n){const e=this.findJSONElementByName(n,t);if(e)return e}else if("nm"===r&&n===t)return e}return null}updateShape(e,t,r){this.each((n=>{let i=n.shapes;for(let t=1;tt.nm===e));return new LottieAnimationLayersManipulator(this,t)}findAssetByRefId(e){return this.lottieAnimation.assets.find((t=>t.id===e))||null}}var __getOwnPropDesc$j=Object.getOwnPropertyDescriptor,__decorateClass$j=(e,t,r,n)=>{for(var i,a=n>1?void 0:n?__getOwnPropDesc$j(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=i(a)||a);return a},__decorateParam$8=(e,t)=>(r,n)=>t(r,n,e);let FnAnimationPersonalizerStrategy=class{constructor(e){var t;__publicField2(this,"logger",getLogger("AnimationPersonalizerStrategy.v1")),__publicField2(this,"animationData",{}),this.playerConfig=e,this.animationData=merge$2((null==(t=this.playerConfig.animationSettings)?void 0:t.data)??{},this.playerConfig.personalizationData)}canPersonalizeAnimation(e){const t=this.getAnimationScripts();return t&&"v1"===t.version&&null!==e.id&&null==e.customAttributes}personalizeAnimation(e,t){const r=this.getAnimationScripts(),n=r.layersPersonalization[t.id],i=new LottieAnimationManipulator(e);if(n){this.logger.debug("Using animation scripts: ",r);for(const[e,t]of Object.entries(n)){const r=i.layers(e);t.forEach((t=>{const n=t.path.split("|"),i=this.callTransformer(e,t);void 0!==i&&("Text"===n[0]?r.updateText(i):"Transform"===n[0]?r.updateTransform(n[1],i,t.keyframeNumber):"Effects"===n[0]?r.updateEffect(n,i,t.keyframeNumber):"Image"===n[0]?r.updateImage(i):"Contents"===n[0]&&r.updateShape(n,i,t.keyframeNumber))}))}}return e}callTransformer(e,t){const r=this.getAnimationScripts(),n=r.variablesMap[t.sourceName];n||this.logger.warn("No matching dataKey found for name: "+e);const i=new Proxy({},{get:(e,t)=>{if(!r.variablesMap.hasOwnProperty(t))return void this.logger.error(`Variable '${t.toString()}' not found in variablesMap`);const i=r.variablesMap[t.toString()];return this.playerConfig.personalizationData[t.toString()]?this.playerConfig.personalizationData[t.toString()]:this.playerConfig.personalizationData[n]?this.playerConfig.personalizationData[n]:this.animationData[i]},set:()=>{throw new Error("Setting properties is not allowed")}}),a={dataValue:this.playerConfig.personalizationData[t.sourceName]??this.animationData[n]??this.animationData[t.sourceName],sourceName:t.sourceName,defaultValue:t.defaultValue,parameters:i,asset:this.createAssetFunction()},s=a.dataValue??a.defaultValue,o=t.transformer?t.transformer(s,a):this.defaultTransformer(s),l=this.interpretResult(o,t);return l===a&&t.transformer?(this.logger.warn("Animation transformer returned it's parameter, this shouldn't happen"),s):l}getAnimationScripts(){return animationRepository.getAsset(this.playerConfig.project.projectId)}defaultTransformer(e){return e}interpretResult(e,t){if("Transform|Opacity"===t.path)return e?[100]:[0];if("Image"===t.path){let r=e.toString();return-1===r.indexOf(".")&&(r+="."+t.extension),makeUrl(this.playerConfig.urls.animationAssetsFolderUrl,this.playerConfig.project.projectId,"images",r)}return e}createAssetFunction(){return e=>makeUrl(this.playerConfig.urls.animationAssetsFolderUrl,e)}};var _arrayEach,hasRequired_arrayEach,_nativeKeys,hasRequired_nativeKeys,_baseKeys,hasRequired_baseKeys,keys_1,hasRequiredKeys,_baseAssign,hasRequired_baseAssign,_baseAssignIn,hasRequired_baseAssignIn,_arrayFilter,hasRequired_arrayFilter,stubArray_1,hasRequiredStubArray,_getSymbols,hasRequired_getSymbols,_copySymbols,hasRequired_copySymbols,_arrayPush,hasRequired_arrayPush,_getSymbolsIn,hasRequired_getSymbolsIn,_copySymbolsIn,hasRequired_copySymbolsIn,_baseGetAllKeys,hasRequired_baseGetAllKeys,_getAllKeys,hasRequired_getAllKeys,_getAllKeysIn,hasRequired_getAllKeysIn,_DataView,hasRequired_DataView,_Promise,hasRequired_Promise,_Set,hasRequired_Set,_WeakMap,hasRequired_WeakMap,_getTag,hasRequired_getTag,_initCloneArray,hasRequired_initCloneArray,_cloneDataView,hasRequired_cloneDataView,_cloneRegExp,hasRequired_cloneRegExp,_cloneSymbol,hasRequired_cloneSymbol,_initCloneByTag,hasRequired_initCloneByTag,_baseIsMap,hasRequired_baseIsMap,isMap_1,hasRequiredIsMap,_baseIsSet,hasRequired_baseIsSet,isSet_1,hasRequiredIsSet,_baseClone,hasRequired_baseClone,cloneDeep_1,hasRequiredCloneDeep;function require_arrayEach(){if(hasRequired_arrayEach)return _arrayEach;return hasRequired_arrayEach=1,_arrayEach=function(e,t){for(var r=-1,n=null==e?0:e.length;++r{for(var i,a=n>1?void 0:n?__getOwnPropDesc$i(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=i(a)||a);return a},__decorateParam$7=(e,t)=>(r,n)=>t(r,n,e);let AnimationPersonalizer=class{constructor(e){__publicField2(this,"logger",getLogger("AnimationPersonalizer")),this.strategies=e}personalize(e,t,r){const n=this.strategies.filter((e=>e.canPersonalizeAnimation(t)));return 0===n.length&&(t.customAttributes&&!t.id?this.logger.error("This animation is not compatible with the current version of the player. Either use version 2 of the player or update the animation."):this.logger.error("No suitable animation customization strategies found. Ensure that the version of your animation is correct.")),n.reduce(((e,n)=>{let i;try{i=n.personalizeAnimation(e,t,r),this.logger.debug("Animation personalized",{original:e,personalized:i})}catch(e2){this.logger.error("Error while personalizing animation",e2)}return i}),cloneDeep(e))}};AnimationPersonalizer=__decorateClass$i([K(),__decorateParam$7(0,J(Types.personalizer.AnimationPersonalizerStrategies))],AnimationPersonalizer);var __defProp$7=Object.defineProperty,__getOwnPropDesc$h=Object.getOwnPropertyDescriptor,__defNormalProp$1=(e,t,r)=>t in e?__defProp$7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__decorateClass$h=(e,t,r,n)=>{for(var i,a=n>1?void 0:n?__getOwnPropDesc$h(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=i(a)||a);return a},__publicField$1=(e,t,r)=>__defNormalProp$1(e,t+"",r);let PlayerEventLogPlugin=class{constructor(){__publicField2(this,"logger",getLogger("PlayerEventLogPlugin")),__publicField2(this,"name")}connect(e){e.ready((()=>{e.on("*",(t=>{e.isDisposed()||PlayerEventLogPlugin.ignoreEvents.includes(t.type)||this.logger.info(`Player event: ${t.type}`,{event:t,state:{playbackState:e.getPlaybackState(),currentElement:e.getCurrentScenarioElement(),currentTime:e.getCurrentTime()}})}))}))}};__publicField$1(PlayerEventLogPlugin,"ignoreEvents",["dispose","timeupdate"]),PlayerEventLogPlugin=__decorateClass$h([K()],PlayerEventLogPlugin);var __getOwnPropDesc$g=Object.getOwnPropertyDescriptor,__decorateClass$g=(e,t,r,n)=>{for(var i,a=n>1?void 0:n?__getOwnPropDesc$g(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=i(a)||a);return a};let PlayerPartsNavigator=class{constructor(){__publicField2(this,"name","PlayerPartsNavigator"),__publicField2(this,"player"),__publicField2(this,"config")}connect(e){this.player=e,this.config=e.getConfig()}getCurrentTime(){return this.player.getCurrentTime()}setCurrentTime(e){this.player.setCurrentTime(e)}getPartTimeRange(){const e=this.config.getDebugPartAtTime(this.getCurrentTime());return e?{start:e.startTime,end:e.endTime}:{start:0,end:this.player.getDuration()}}onGoToPartStartOrPrevious(){const e=this.getPartTimeRange();if(this.getCurrentTime()-.5e.end){const e=this.config.getDebugPartAtTime(this.getCurrentTime()+r);if(e)return void this.setCurrentTime(e.startTime)}this.setCurrentTime(this.getPartTimeRange().end-r+.05)}};PlayerPartsNavigator=__decorateClass$g([K()],PlayerPartsNavigator);var __getOwnPropDesc$f=Object.getOwnPropertyDescriptor,__decorateClass$f=(e,t,r,n)=>{for(var i,a=n>1?void 0:n?__getOwnPropDesc$f(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=i(a)||a);return a},__decorateParam$6=(e,t)=>(r,n)=>t(r,n,e);let BookmarksPlugin=class{constructor(e,t){__publicField2(this,"logger",getLogger("BookmarksPlugin")),__publicField2(this,"name","BookmarksPlugin"),__publicField2(this,"player"),this.scenarioPreferences=e,this.config=t}connect(e){this.player=e}disconnect(){this.player=null}createBookmark(e){const t=this.config.getDebugPartAtTime(this.player.getCurrentTime()),r=this.config.debugParts.findIndex((e=>t&&e.startTime===t.startTime)),n=this.scenarioPreferences.getPreference("bookmarks").length;let i=this.player.getCurrentTime();if(-1!==r){i-=this.config.debugParts[r].startTime}return{time:i,label:e??`Bookmark ${n+1}`,scenarioElementId:this.player.getCurrentScenarioElement().id,debugInfoIndex:-1===r?void 0:r}}goToBookmark(e){let t=e.time;if(null!=e.debugInfoIndex){t+=this.config.debugParts[e.debugInfoIndex].startTime}this.player.goToScenarioElement(e.scenarioElementId,{time:t})}};BookmarksPlugin=__decorateClass$f([K(),__decorateParam$6(0,O$1(Types.ScenarioPreferences)),__decorateParam$6(1,O$1(Types.PlayerConfig))],BookmarksPlugin);var __defProp$6=Object.defineProperty,__getOwnPropDesc$e=Object.getOwnPropertyDescriptor,__decorateClass$e=(e,t,r,n)=>{for(var i,a=n>1?void 0:n?__getOwnPropDesc$e(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n?i(t,r,a):i(a))||a);return n&&a&&__defProp$6(t,r,a),a};let ResumeFromQueryPlugin=class{constructor(){__publicField2(this,"name","ResumeFromQueryPlugin"),__publicField2(this,"config"),__publicField2(this,"bookmarkPlugin"),__publicField2(this,"player"),__publicField2(this,"queryParamName")}connect(e){var t,r;try{this.bookmarkPlugin=e.getPlugin(BookmarksPlugin)}catch(n){console.warn("Failed to get BookmarksPlugin:",n)}this.player=e,this.queryParamName=(null==(r=null==(t=this.config.pluginSettings[this.name])?void 0:t.resumeFromUrl)?void 0:r.query)??"t",this.player.on("ready",(()=>{this.restoreTime(e)}))}restoreTime(e){const t=new URLSearchParams(window.location.search).get(this.queryParamName);if(t)try{const r=BookmarkURLEncoder.decode(t);e.pause(),this.bookmarkPlugin.goToBookmark(r)}catch(r){console.warn("Failed to deserialize player state from URL parameter:",r)}}};__decorateClass$e([O$1(Types.PlayerConfig)],ResumeFromQueryPlugin.prototype,"config",2),ResumeFromQueryPlugin=__decorateClass$e([K()],ResumeFromQueryPlugin);const documentListeners={},windowListeners={},getListenersAndTargetForName=e=>{switch(e){case"document":return{listeners:documentListeners,target:document};case"window":return{listeners:windowListeners,target:window};default:throw new Error(`Unknown target name '${e}'`)}},addEventHandler=(e,t,r)=>{const{listeners:n,target:i}=getListenersAndTargetForName(e),a=n[t]||[];a.push(r),n[t]=a,i.addEventListener(t,r)},removeEventHandler=(e,t,r)=>{const{listeners:n,target:i}=getListenersAndTargetForName(e);let a=n[t]||[];const s=a.findIndex((e=>e===r));s>-1&&(a=a.splice(s,1),n[t]=a),i.removeEventListener(t,r)},removeAllEventHandlers=()=>{Object.keys(documentListeners).forEach((e=>documentListeners[e].forEach((t=>document.removeEventListener(e,t))))),Object.keys(windowListeners).forEach((e=>windowListeners[e].forEach((t=>window.removeEventListener(e,t)))))},ListenerHelper={addEventListener:addEventHandler,removeEventListener:removeEventHandler,removeAllEventListeners:removeAllEventHandlers};var __getOwnPropDesc$d=Object.getOwnPropertyDescriptor,__decorateClass$d=(e,t,r,n)=>{for(var i,a=n>1?void 0:n?__getOwnPropDesc$d(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=i(a)||a);return a};let AutoPausePlugin=class{constructor(){__publicField2(this,"logger",getLogger("AutoPausePlugin")),__publicField2(this,"name","AutoPausePlugin"),__publicField2(this,"player"),__publicField2(this,"shouldResume")}connect(e){BrowserInfo.isMobileDevice()&&(this.player=e,ListenerHelper.addEventListener("window","visibilitychange",(()=>{"hidden"===document.visibilityState?this.onBlur():this.onFocus()})))}disconnect(){this.player=null}onBlur(){this.logger.info("Window is hidden, pausing the player"),this.elligibleForPause()&&(this.shouldResume=this.player.isPlaying(),this.player.pause())}onFocus(){this.logger.info("Window is visible, should the player be resumed?",this.shouldResume),!0===this.shouldResume&&this.player.play()}elligibleForPause(){return"ended"!==this.player.getPlaybackState()&&!this.player.isLooping()}};AutoPausePlugin=__decorateClass$d([K()],AutoPausePlugin);var __getOwnPropDesc$c=Object.getOwnPropertyDescriptor,__decorateClass$c=(e,t,r,n)=>{for(var i,a=n>1?void 0:n?__getOwnPropDesc$c(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=i(a)||a);return a};let KeyboardSupportPlugin=class{constructor(){__publicField2(this,"name","KeyboardSupportPlugin"),__publicField2(this,"player"),__publicField2(this,"onKeyDown",(e=>{if(this.player.getElement().contains(document.activeElement)||this.player.getElement().contains(document.fullscreenElement)){switch(e.code){case"Space":this.player.isPlaying()?this.player.pause():this.player.play();break;case"ArrowRight":this.player.setCurrentTime(this.player.getCurrentTime()+5);break;case"ArrowLeft":this.player.setCurrentTime(this.player.getCurrentTime()-5);break;case"ArrowUp":this.player.setVolume(this.player.getVolume()+.1);break;case"ArrowDown":this.player.setVolume(this.player.getVolume()-.1);break;case"KeyM":this.player.setIsMuted(!this.player.isMuted());break;case"KeyS":this.player.setSubtitlesEnabled(!this.player.areSubtitlesEnabled());break;default:return}e.preventDefault()}}))}connect(e){this.player=e,window.addEventListener("keydown",this.onKeyDown)}disconnect(){window.removeEventListener("keydown",this.onKeyDown)}};KeyboardSupportPlugin=__decorateClass$c([K()],KeyboardSupportPlugin);var __defProp$5=Object.defineProperty,__getOwnPropDesc$b=Object.getOwnPropertyDescriptor,__decorateClass$b=(e,t,r,n)=>{for(var i,a=n>1?void 0:n?__getOwnPropDesc$b(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n?i(t,r,a):i(a))||a);return n&&a&&__defProp$5(t,r,a),a};let LegacyIframeNotifierPlugin=class{constructor(){__publicField2(this,"name","LegacyIframeNotifierPlugin"),__publicField2(this,"playerConfig"),__publicField2(this,"eventNameMap",{ready:"vintomPlayerReady",ended:"vintomPlayerFinish",play:"vintomPlayerStart",pause:"vintomPlayerPause",error:"vintomPlayerError","cta.action":"vintomPlayerAction"})}connect(e){if(window.self!==window.parent)for(const t of Object.keys(this.eventNameMap))e.on(t,(e=>this.triggerIframeEvent(e)))}triggerIframeEvent(e){const t=this.constructIframePayload(e);window.parent.postMessage(t,"*")}constructIframePayload(e){switch(e.type){case"ready":return this.createBasePayload(e);case"error":return this.constructIframeErrorPayload(e);case"cta.action":return this.constructIframeActionPayload(e);default:return this.createPlayerPayload(e)}}createPlayerPayload(e){return{...this.createBasePayload(e),time:e.target.getCurrentTime(),playing:"playing"===e.target.getPlaybackState(),part:e.target.getCurrentScenarioElement().partId,scenarioElementId:e.target.getCurrentScenarioElement().id}}createBasePayload(e){const t=this.eventNameMap[e.type];if(!t)throw new Error(`Event name ${e.type} is not supported by the iframe notifier plugin`);return{code:this.playerConfig.project.videoId,type:t}}constructIframeErrorPayload(e){const t=this.createBasePayload(e),r={...e.data.error,...t};return Object.setPrototypeOf(r,VintomError.prototype),r}constructIframeActionPayload(e){return{...this.createPlayerPayload(e),ctaId:e.data.ctaId,actionId:e.data.actionId,actionAdditionalData:{}}}};__decorateClass$b([O$1(Types.PlayerConfig)],LegacyIframeNotifierPlugin.prototype,"playerConfig",2),LegacyIframeNotifierPlugin=__decorateClass$b([K()],LegacyIframeNotifierPlugin);var __defProp$4=Object.defineProperty,__getOwnPropDesc$a=Object.getOwnPropertyDescriptor,__decorateClass$a=(e,t,r,n)=>{for(var i,a=n>1?void 0:n?__getOwnPropDesc$a(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n?i(t,r,a):i(a))||a);return n&&a&&__defProp$4(t,r,a),a};let MusicPlugin=class{constructor(){__publicField2(this,"logger",getLogger("MusicPlugin")),__publicField2(this,"name","MusicPlugin"),__publicField2(this,"config"),__publicField2(this,"musicManager")}connect(e){this.config.behavior.globalMusicUrl&&(this.musicManager.src=this.config.behavior.globalMusicUrl,this.musicManager.syncOnPlay=!1);let t=!1;e.on("scenarioelement.prepare",(e=>{this.prepareMusicForScenarioElement(e.data.element)})),e.on("ratechange",(e=>{this.musicManager.playbackRate=e.target.getPlaybackRate()})),e.on("play",(()=>{this.logger.info("Music play started at time",e.getCurrentTime()),this.musicManager.play()})),e.on("pause",(()=>{this.logger.info("Music play paused at time",e.getCurrentTime()),this.musicManager.pause()})),e.on("ended",(()=>{this.logger.info("Music play paused due to finish"),this.musicManager.pause()})),e.on("seeking",(()=>{t=e.isPlaying(),this.musicManager.pause()})),e.on("seeked",(()=>{t&&this.musicManager.play()})),e.on("error",(()=>{this.musicManager.pause()})),e.on("dispose",(()=>{this.musicManager.dispose()}))}prepareMusicForScenarioElement(e){e.music?(this.config.behavior.globalMusicUrl&&e.music.musicUrl?this.logger.warn("Scenario elements shouldn't have musicUrl if scenario has scenarioMusicUrl"):this.config.behavior.globalMusicUrl||(this.musicManager.src=e.music.musicUrl),this.musicManager.loadSoundtrackTransitions(e.music),this.logger.info("Music prepared for scenario element",e.id,e.music)):(this.musicManager.resetTransitions(),this.logger.info("No music for scenario element",e.id))}};__decorateClass$a([O$1(Types.PlayerConfig)],MusicPlugin.prototype,"config",2),__decorateClass$a([O$1(Types.music.MusicManager)],MusicPlugin.prototype,"musicManager",2),MusicPlugin=__decorateClass$a([K()],MusicPlugin);var __defProp$3=Object.defineProperty,__getOwnPropDesc$9=Object.getOwnPropertyDescriptor,__decorateClass$9=(e,t,r,n)=>{for(var i,a=n>1?void 0:n?__getOwnPropDesc$9(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n?i(t,r,a):i(a))||a);return n&&a&&__defProp$3(t,r,a),a};let PlayerAnalyticsPlugin=class{constructor(){__publicField2(this,"analytics"),__publicField2(this,"name","PlayerAnalyticsPlugin"),__publicField2(this,"player"),__publicField2(this,"timeUpdateTask"),__publicField2(this,"callHistory",[]),__publicField2(this,"onPageVisibilityChange",(()=>{document.hidden?this.callAnalytics("onHidden"):document.hidden||this.callAnalytics("onVisible")})),__publicField2(this,"eventListenersMap",{play:this.onPlay.bind(this),pause:this.onPause.bind(this),seeking:this.onSeekingEvent.bind(this),error:this.onError.bind(this),"scenarioelement.prepare":this.onScenarioElementPrepare.bind(this),"scenarioelement.start":this.onScenarioElementStart.bind(this),"scenarioelement.end":this.onScenarioElementEnd.bind(this),"cta.shown":this.onCTAShown.bind(this),"cta.action":this.onCTAAction.bind(this),"_ui.seekstart.prepare":this.onUISeekStart.bind(this),"ui.seekend":this.onUISeekEnd.bind(this),"loop.start":this.onLoopStart.bind(this),"loop.end":this.onLoopEnd.bind(this)})}connect(e){this.player=e,this.connectListeners(),this.startTimeUpdateTask(),this.analytics.onPlayerInit(),this.analytics.useInformationRetrievers({getCurrentTime:()=>this.player.getCurrentTime(),getDuration:()=>this.player.getDuration()})}onLoopStart(){this.callAnalytics("onLoopStart")}onCTAShown(e){this.callAnalytics("onCTAShown",e.data.ctaId)}onCTAAction(e){this.callAnalytics("onCTAAction",e.data.ctaId,e.data.actionId,e.data.extra)}disconnect(){this.stopTimeUpdateTask(),this.analytics.useInformationRetrievers(void 0),setTimeout((()=>{this.disconnectListeners(),this.player=null}),100)}onError(e){this.callAnalytics("onError",e.data.error)}onScenarioElementPrepare(){this.callAnalytics("onScenarioElementPrepare")}onScenarioElementStart(){this.analytics.configure({reportSegmentsInterval:this.player.getDuration()>120?20:10,reportProgressPercentage:25}),this.callAnalytics("onScenarioElementStart")}onScenarioElementEnd(){this.callAnalytics("onScenarioElementEnd")}onPlay(){this.callAnalytics("onPlay")}onLoopEnd(){this.callAnalytics("onLoopEnd")}onPause(){this.callAnalytics("onPause")}connectListeners(){for(const[e,t]of Object.entries(this.eventListenersMap))this.player.on(e,t);window.addEventListener("visibilitychange",this.onPageVisibilityChange)}disconnectListeners(){for(const[e,t]of Object.entries(this.eventListenersMap))this.player.off(e,t);window.removeEventListener("visibilitychange",this.onPageVisibilityChange)}onSeekingEvent(){this.callAnalytics("onInstantSeek")}onUISeekStart(){this.callAnalytics("onUISeekStart")}onUISeekEnd(){this.callAnalytics("onUISeekEnd")}startTimeUpdateTask(){this.timeUpdateTask=setInterval((()=>{this.player.isPlaying()&&this.callAnalytics("tick")}),1e3)}stopTimeUpdateTask(){clearInterval(this.timeUpdateTask)}callAnalytics(e,...t){this.analytics[e](...t)}saveToHistory(e,t){const r={methodName:e,currentTime:this.player.getCurrentTime()};t.length>0&&(r.args=t),this.callHistory.push(r)}clearHistory(){this.callHistory=[]}getHistory(){return this.callHistory}};__decorateClass$9([O$1(Types.analytics.AnalyticsReporter)],PlayerAnalyticsPlugin.prototype,"analytics",2),PlayerAnalyticsPlugin=__decorateClass$9([K()],PlayerAnalyticsPlugin);var __defProp$2=Object.defineProperty,__getOwnPropDesc$8=Object.getOwnPropertyDescriptor,__decorateClass$8=(e,t,r,n)=>{for(var i,a=n>1?void 0:n?__getOwnPropDesc$8(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n?i(t,r,a):i(a))||a);return n&&a&&__defProp$2(t,r,a),a};let ThemeUpdaterPlugin=class{constructor(){__publicField2(this,"name","ThemeUpdaterPlugin"),__publicField2(this,"config"),__publicField2(this,"cleanup")}connect(e){const t=this.config.ui.colors.accent,r=e.getElement();t&&(r.style.setProperty("--theme-color",t),this.cleanup=()=>{r.style.removeProperty("--theme-color")})}disconnect(){this.cleanup(),this.cleanup=null}};__decorateClass$8([O$1(Types.PlayerConfig)],ThemeUpdaterPlugin.prototype,"config",2),ThemeUpdaterPlugin=__decorateClass$8([K()],ThemeUpdaterPlugin);class QualityLevel{constructor(e,t,r,n,i){__publicField2(this,"id"),__publicField2(this,"width"),__publicField2(this,"height"),__publicField2(this,"bandwidth"),__publicField2(this,"isCurrent"),__publicField2(this,"dimension"),this.id=e,this.width=t,this.height=r,this.bandwidth=n,this.isCurrent=i,this.dimension=t+"x"+r}}const CustomDataKey=Symbol("CustomDataKey"),VideoJsUtils={getPlayerTech:e=>e.tech({IWillNotUseThisInPlugins:!0}).vhs,getQualityLevels(e){const t=this.getPlayerTech(e),r=t.selectPlaylist().id;return t.representations().map((e=>new QualityLevel(e.id,e.width,e.height,e.bandwidth,e.id===r))).sort(((e,t)=>e.bandwidth-t.bandwidth))},setCustomData(e,t,r){e&&(e[CustomDataKey]||(e[CustomDataKey]={}),e[CustomDataKey][t]=r)},getCustomData(e,t){var r;return null==(r=null==e?void 0:e[CustomDataKey])?void 0:r[t]},getCurrentQualityLevel(e){return this.getQualityLevels(e).find((e=>e.isCurrent))},setAllowedQualityLevels(e,t){const r=this.getPlayerTech(e).representations().find((e=>e.width===t.width&&e.height===t.height));return void 0!==r&&r.enabled(!0),r},isPrebufferingSupported:e=>void 0!==e.tech({IWillNotUseThisInPlugins:!0}).vhs},VideoUtils={increaseVideoTimePrecision(e){const t=Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype,"currentTime");let r=null,n=null,i=null,a=!1,s=!1;Object.defineProperty(e,"currentTime",{get(){const o=t.get.call(e),l=e.readyState>2,u=o0||u)&&(i=e),a=!1}return s=c,i},set(e){isNaN(e)||(t.set.call(this,e),a=!0)}})}};function getPlayableBufferDuration(e){const t=e.currentTime,r=e.buffered;let n=r.length;for(;n--&&!(r.start(n)<=t&&t<=r.end(n)););let i=0;return-1!==n&&(i=r.end(n)-t),i}function asArray(e){return Array.isArray(e)?e:[e]}function sourcesEqual(e,t){return e.src===t.src&&e.type===t.type}class LibraryRepositoryImpl{constructor(){__publicField2(this,"loadingTask"),__publicField2(this,"libraries")}async loadLibraries(){return this.libraries?this.libraries:this.loadingTask?this.loadingTask:(this.loadingTask=this.importLibraries(),this.libraries=await this.loadingTask,this.loadingTask=null,this.libraries)}getLibraries(){if(!this.libraries)throw new Error("Libraries not loaded. Please call loadPlayerResources() first.");return this.libraries}async importLibraries(){const e=globalVintom.get("libraries");if(e&&e.videojs&&e.lottie)return e;const[t,r]=await Promise.all([Promise.resolve().then((()=>video_es)),Promise.resolve().then((()=>lottie_min))]);return globalVintom.set("libraries",{videojs:t.default,lottie:r.default}),globalVintom.get("libraries")}}const libraryRepository=new LibraryRepositoryImpl;class VideoJsPreloaderWorker{constructor(e,t){__publicField2(this,"isRunning"),__publicField2(this,"isFinished",!1),__publicField2(this,"player"),__publicField2(this,"container",VideoJsPreloaderWorker.getContainer()),__publicField2(this,"lastTime"),__publicField2(this,"observers",new Set),this.streamData=e,this.quality=t,this.player=this.createPlayer(e),this.player.on("canplaythrough",this.onBufferingFinished.bind(this)),this.lastTime=0,this.isRunning=!1,this.setPlayerDimensions(window.innerWidth,window.innerHeight)}static getContainer(){let e=document.getElementById("video-js-preloaders");return null===e&&(e=document.createElement("div"),e.id="video-js-preloaders",e.style.display="none",document.body.append(e)),e}start(){this.isRunning||(this.isRunning=!0,this.player.src(this.streamData),this.player.currentTime(this.lastTime),this.player.volume(0),this.player.play().then((()=>{const e=VideoJsUtils.setAllowedQualityLevels(this.player,this.quality);this.createMediaServiceManifestPreloaderElements(e)})))}pause(){this.isRunning&&(this.isRunning=!1,this.lastTime=this.player.currentTime(),this.player.reset(),this.player.pause())}addObserver(e){this.observers.add(e)}removeObserver(e){this.observers.delete(e)}dispose(){this.pause(),this.player.isDisposed()||this.player.dispose()}setPlayerDimensions(e,t){this.player.width(e),this.player.height(t)}onBufferingFinished(){this.isFinished||(this.isFinished=!0,setTimeout((()=>this.finish()),1e3))}trigger(e){this.observers.forEach((t=>{var r;return null==(r=t[e])?void 0:r.call(t,this.streamData)}))}finish(){this.isRunning=!1,this.trigger("onFinish"),this.dispose()}createPlayer(e){const t=document.createElement("video"),{videojs:r}=libraryRepository.getLibraries();this.container.append(t);const n=r(t);if(""===n.canPlayType(e.type))throw new Error("Video.js cannot play "+e.type);return n}createMediaServiceManifestPreloaderElements(e){if(-1!==this.streamData.src.indexOf("filter=prebuffering-filter")){const t=document.createElement("link");t.rel="preload",t.as="image",t.href=this.streamData.src.replace(",filter=prebuffering-filter",""),this.container.appendChild(t);const r=document.createElement("link");r.rel="preload",r.as="image",r.href=this.streamData.src.replace("manifest(format=m3u8-aapl,audio-only=false,filter=prebuffering-filter)",e.playlist.uri).replace(",filter=prebuffering-filter",""),this.container.appendChild(r)}}}class SingleQualityVideoJsPreloader{constructor(e,t=4){__publicField2(this,"logger",getInstanceLogger("SingleQualityVideoJsPreloader")),__publicField2(this,"queued",new Array),__publicField2(this,"finished",new Array),__publicField2(this,"runningWorkers",new Map),__publicField2(this,"isPaused",!0),this.quality=e,this.maxSimultaneousConnections=t}queue(e){for(const t of asArray(e))this.checkIfAlreadyQueued(t)||this.queued.push(t);this.logger.info("Adding "+asArray(e).length+" sources to queue"),this.doUpdate()}start(){this.logger.info("Starting preloader"),this.isPaused=!1,this.doUpdate()}pause(){this.logger.info("Pausing preloader"),this.isPaused=!0,this.doUpdate()}cancelAll(){this.eachPreloader((e=>{e.pause(),e.dispose()})),this.runningWorkers.clear(),this.queued.splice(0,this.queued.length)}cancel(e){for(const t of asArray(e)){const e=this.runningWorkers.get(t.src);e&&(e.pause(),e.dispose());const r=this.queued.findIndex((e=>sourcesEqual(e,t)));-1!==r&&this.queued.splice(r,1)}this.doUpdate()}createWorker(e){return new VideoJsPreloaderWorker(e,this.quality)}checkIfAlreadyQueued(e){return new Set(this.getAllSources()).has(e)}getAllSources(){const e=Array.from(this.runningWorkers.values()).map((e=>e.streamData));return[].concat(this.queued).concat(this.finished).concat(e)}eachPreloader(e){for(const t of Array.from(this.runningWorkers.values()))e(t)}doUpdate(){this.createTasks(),this.startOrPauseTasks()}createTasks(){for(;this.runningWorkers.sizee.dispose()))}}class PlayerAwareVideoJsPreloader{constructor(e,t={}){__publicField2(this,"logger",getInstanceLogger("PlayerAwareVideoJsPreloader")),__publicField2(this,"preloaders",new Map),__publicField2(this,"queued",new Array),__publicField2(this,"options"),__publicField2(this,"intervalId",null),__publicField2(this,"currentQuality"),__publicField2(this,"isPreloadingOn"),__publicField2(this,"videoElement"),this.player=e;const r=()=>{this.intervalId=setInterval(this.doUpdate.bind(this),1e3),e.off("play",r)};e.on("play",r),this.options={minimumBufferTime:10,minimumTimeToEnd:60,maxSimultaneousConnections:4,...t}}cancel(e){this.eachPreloader((t=>t.cancel(e)))}cancelAll(){this.eachPreloader((e=>e.cancelAll()))}pause(){this.isPreloadingOn=!1}queue(e){this.queued.push(...asArray(e)),this.eachPreloader((t=>t.queue(e)))}start(){this.isPreloadingOn=!0}dispose(){this.eachPreloader((e=>e.dispose())),clearInterval(this.intervalId)}doUpdate(){var e,t,r;if(VideoJsUtils.isPrebufferingSupported(this.player)){this.videoElement=this.player.el().querySelector("video");let n=this.isPreloadingOn;n=n&&this.isBufferLongEnough(),n=n&&this.isEndOfCurrentVideoIsNearEnough();const i=VideoJsUtils.getCurrentQualityLevel(this.player);n&&(null==(e=this.currentQuality)?void 0:e.id)!==i.id?(this.currentQuality!==i&&(null==(r=this.preloaders.get(null==(t=this.currentQuality)?void 0:t.id))||r.pause(),this.currentQuality=i),this.logger.info("Starting preloader with "+this.currentQuality.dimension+" quality",{quality:i}),this.startPreloader(i)):n||null==this.currentQuality||(this.logger.info("Pausing preloading",{canPreload:n,isPreloadingOn:this.isPreloadingOn,isBufferLongEnough:this.isBufferLongEnough(),isEndOfCurrentVideoIsNearEnough:this.isEndOfCurrentVideoIsNearEnough()}),this.eachPreloader((e=>e.pause())),this.currentQuality=null)}else this.logger.warn("Prebuffering is not supported on this platform")}isBufferLongEnough(){return getPlayableBufferDuration(this.videoElement)>=this.options.minimumBufferTime}isEndOfCurrentVideoIsNearEnough(){return this.videoElement.duration-this.videoElement.currentTime<=this.options.minimumTimeToEnd}startPreloader(e){if(!this.preloaders.has(e.id)){const t=this.initializePreloader(e);this.preloaders.set(e.id,t)}this.preloaders.get(e.id).start()}initializePreloader(e){const t=new SingleQualityVideoJsPreloader(e,this.options.maxSimultaneousConnections);return t.queue(this.queued),t}eachPreloader(e){for(const t of Object.values(this.preloaders))e(t)}}var __defProp$1=Object.defineProperty,__getOwnPropDesc$7=Object.getOwnPropertyDescriptor,__decorateClass$7=(e,t,r,n)=>{for(var i,a=n>1?void 0:n?__getOwnPropDesc$7(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n?i(t,r,a):i(a))||a);return n&&a&&__defProp$1(t,r,a),a};let VideoPreloaderPlugin=class{constructor(){__publicField2(this,"name","VideoPreloaderPlugin"),__publicField2(this,"player"),__publicField2(this,"videoPreloader"),__publicField2(this,"videoLayer")}connect(e){this.player=e,e.on("scenarioelement.start",(()=>{this.ensurePreloaderInitialized(),this.preloadNextScenarioElement()}))}disconnect(){var e;null==(e=this.videoPreloader)||e.dispose(),this.player=null}ensurePreloaderInitialized(){this.videoPreloader||(this.videoPreloader=new PlayerAwareVideoJsPreloader(this.videoLayer.getPlayer()))}preloadNextScenarioElement(){var e;const t=this.videoLayer.getPlayer(),r=null==(e=this.player.getCurrentScenarioElement().sourcesToPreload)?void 0:e.map((({sources:e})=>e.find((({type:e})=>t.canPlayType(e)))));this.videoPreloader.cancelAll(),this.videoPreloader.queue(r??[]),this.videoPreloader.start()}};__decorateClass$7([O$1(Types.layer.VideoLayer)],VideoPreloaderPlugin.prototype,"videoLayer",2),VideoPreloaderPlugin=__decorateClass$7([K()],VideoPreloaderPlugin);const plugins=[BookmarksPlugin,AutoPausePlugin,PlayerAnalyticsPlugin,LegacyIframeNotifierPlugin,ThemeUpdaterPlugin,VideoPreloaderPlugin,MusicPlugin,KeyboardSupportPlugin,ResumeFromQueryPlugin,PlayerEventLogPlugin,PlayerPartsNavigator],bindPlayerPluginsToContainer=e=>{plugins.forEach((t=>{e.bind(Types.PlayerPlugin).to(t).inSingletonScope()}))},getTimeFromVideoStart=(e,t)=>t<0?e+t:t,ScenarioTimeHelper={getTimeFromVideoStart:getTimeFromVideoStart};var __getOwnPropDesc$6=Object.getOwnPropertyDescriptor,__decorateClass$6=(e,t,r,n)=>{for(var i,a=n>1?void 0:n?__getOwnPropDesc$6(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=i(a)||a);return a},__decorateParam$5=(e,t)=>(r,n)=>t(r,n,e);let CTALayerManagerImpl=class{constructor(e){__publicField2(this,"observer"),__publicField2(this,"reusableCTAs"),__publicField2(this,"currentCTAs",[]),__publicField2(this,"currentElement"),__publicField2(this,"config"),__publicField2(this,"ctasByType"),__publicField2(this,"duration"),this.layer=e}updateState(e){this.config=e.config,this.updateCurrentElement(e.currentElement),this.setAspectRatio(e.config.project.aspectRatio),this.resourcesLoaded(e.resources,e.playbackData.duration),this.setDuration(e.playbackData.duration)}updateCurrentElement(e){this.currentElement=e}setAspectRatio(e){this.layer.setAspectRatio(e)}resourcesLoaded(e,t){this.ctasByType=e.ctasByType,this.duration=t,this.intializeReusableCTAs(),this.removeCTAs(this.currentCTAs)}setDuration(e){this.duration=e}registerObserver(e){this.observer=e}moveTo(e){const t=this.findCTAsAtTime(e);this.displayCTAs(t)}performAction(e,t,...r){this.layer.performAction(e,t,r)}displayAllCTAsForCTAOnlyElemnt(){const e=this.currentElement.ctas;e.filter((e=>e.stopsPlayback)),this.displayCTAs(e)}intializeReusableCTAs(){if(!this.reusableCTAs){const e=new Map;for(const r of this.config.scenarioElements)for(const t of r.ctas){const r=e.get(t.hashCode)||0;e.set(t.hashCode,r+1)}const t=Array.from(e.entries()).filter((e=>e[1]>1)).map((e=>e[0]));this.reusableCTAs=t}}displayCTAs(e){const t=e.map((e=>e.hashCode)),r=this.currentCTAs.filter((e=>t.indexOf(e.hashCode)<0)),n=e.filter((e=>!this.currentCTAs.find((t=>t.id===e.id))));this.removeCTAs(r),this.loadCTAs(n),this.observer.onTimeMove(e)}removeCTAs(e){for(const t of e)this.currentCTAs=this.currentCTAs.filter((t=>!e.find((e=>e.id===t.id)))),this.layer.removeCTA(t.id,t.hashCode),this.observer.onCTAHidden(t)}loadCTAs(e){for(const r of e){const e=this.ctasByType.get(r.type);if(e){this.currentCTAs.push(r);const t=this.reusableCTAs.indexOf(r.hashCode)>-1;this.layer.loadCTA(r.hashCode,t,r.id,e,r.customAttributes),this.observer.onCTAShow(r)}}const t=e.find((e=>!!e.poster));t&&t.poster}findCTAsAtTime(e){const t=this.currentElement.ctas.filter((e=>"RANGE"===e.triggerType)).filter((t=>ScenarioTimeHelper.getTimeFromVideoStart(this.duration,t.visibilityRange.startTime)<=e&&("END"===t.visibilityRange.endTime||ScenarioTimeHelper.getTimeFromVideoStart(this.duration,t.visibilityRange.endTime)>=e)));if(e>=this.duration){const e=this.currentElement.ctas.filter((e=>"END"===e.triggerType));return t.concat(e)}return t}};CTALayerManagerImpl=__decorateClass$6([K(),__decorateParam$5(0,O$1(Types.layer.CTALayer))],CTALayerManagerImpl);var __getOwnPropDesc$5=Object.getOwnPropertyDescriptor,__decorateClass$5=(e,t,r,n)=>{for(var i,a=n>1?void 0:n?__getOwnPropDesc$5(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=i(a)||a);return a},__decorateParam$4=(e,t)=>(r,n)=>t(r,n,e);let Layers=class{constructor(e,t,r){__publicField2(this,"video"),__publicField2(this,"cta"),__publicField2(this,"animation"),this.video=e,this.cta=t,this.animation=r}all(){return[this.video,this.cta,this.animation]}dispose(){this.all().forEach((e=>{var t;return null==(t=e.dispose)?void 0:t.call(e)}))}};Layers=__decorateClass$5([K(),__decorateParam$4(0,O$1(Types.layerManagers.VideoLayerManager)),__decorateParam$4(1,O$1(Types.layerManagers.CTALayerManager)),__decorateParam$4(2,O$1(Types.layerManagers.AnimationLayerManager))],Layers);const _SeekbarHistory=class e{constructor(e,t){__publicField2(this,"currentPart"),__publicField2(this,"allElements"),__publicField2(this,"pastParts"),__publicField2(this,"futureParts"),__publicField2(this,"allParts"),this.allElements=e,this.allParts=[...t],this.futureParts=[...t],this.pastParts=[]}get hasMultipleParts(){return this.allParts.length>1}get currentPartNumber(){return this.pastParts.length+1}get isLastPart(){return 0===this.futureParts.length}get currentElementId(){return this.currentPart&&this.currentPart.scenarioElement.id}get currentElement(){return this.currentPart&&this.currentPart.scenarioElement}get displayedPastParts(){return this.pastParts.filter((e=>e.size))}get displayedFutureParts(){return this.futureParts.filter((e=>e.size))}get initialElement(){return this.allElements.find((e=>e.initial))}getAllElements(){return this.allElements}getCurrentPart(){return this.currentPart}hasElementPlayedAlready(e){return this.pastParts.some((t=>{var r;return(null==(r=t.scenarioElement)?void 0:r.id)===(null==e?void 0:e.id)}))}withNowPlaying(t){if(this.currentPart&&this.currentPart.scenarioElement.id===t.id)return this;const r=this.copy();if(!r.allParts.length)return r.currentPart={id:void 0,size:e.FULL_LENGTH,scenarioElement:t},r;const n=r.allParts.findIndex((e=>e.id===t.partId)),i=r.currentPart&&r.allParts.findIndex((e=>e.id===r.currentPart.id));r.currentPart&&(r.pastParts[i]=r.currentPart),r.futureParts=[...r.allParts].slice(n+1),r.pastParts=r.pastParts.slice(0,n);for(let e=0;e{for(var i,a=n>1?void 0:n?__getOwnPropDesc$4(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=i(a)||a);return a},__decorateParam$3=(e,t)=>(r,n)=>t(r,n,e);let PlayerContainerManagerImpl=class{constructor(e,t){__publicField2(this,"UPDATES_PER_SECOND",60),__publicField2(this,"lastUpdateTimestamp",0),__publicField2(this,"player"),__publicField2(this,"areCTAsVisible"),__publicField2(this,"seekbarHistory"),__publicField2(this,"currentSubtitleText"),__publicField2(this,"updateState",(()=>{var e,t;if(!this.shouldUpdate())return;const r=this.player.getConfig(),n=this.player,i=this.getCurrentTime(n),a={controls:r.ui.controls,duration:n.getDuration(),currentTime:i,isLooping:n.isLooping(),isMuted:n.isMuted(),playbackState:n.getPlaybackState(),playbackRate:n.getPlaybackRate(),volume:n.getVolume(),isDebugMode:n.isDebugModeEnabled(),currentElement:n.getCurrentScenarioElement(),isLoading:n.isLoading(),disableIcon:!1,seekbarHistory:this.seekbarHistory,isPlaybackBlockingCTADisplayed:!1,areCTAsVisible:this.areCTAsVisible,bufferedTime:this.videoLayer.getBufferedTime(),debugInfo:r.getDebugPartAtTime(i),subtitles:{enabled:n.areSubtitlesEnabled(),available:r.areSubtitlesAvailable(),currentText:(null==(e=this.currentSubtitleText)?void 0:e.text)||"",verticalOffset:(null==(t=this.currentSubtitleText)?void 0:t.verticalPosition)||0}};this.container.updateState(a)})),this.container=e,this.videoLayer=t,e.registerObserver({})}setPlayerDelegate(e){this.player&&this.player.off("timeupdate",this.updateState);const t=e.getConfig();let r;this.container.setPlayerDelegate(e),this.player=e,this.seekbarHistory=new SeekbarHistory(t.scenarioElements,t.ui.seekbarParts),e.ready((()=>{r=setInterval((()=>{try{this.updateState()}catch(e2){console.error("Error during updateState",e2),clearInterval(r)}}),this.UPDATES_PER_SECOND)})),e.on("scenarioelement.loaded",(e=>{this.seekbarHistory=this.seekbarHistory.withNowPlaying(e.data.element)})),e.on("dispose",(()=>clearInterval(r)))}getElement(){return this.container.getElement()}setCurrentSubtitleText(e){this.currentSubtitleText=e}setAreCTAsVisible(e){this.areCTAsVisible=e}shouldUpdate(){const e=Date.now(),t=1e3/this.UPDATES_PER_SECOND;return!(e-this.lastUpdateTimestamp{for(var i,a=n>1?void 0:n?__getOwnPropDesc$3(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=i(a)||a);return a},__decorateParam$2=(e,t)=>(r,n)=>t(r,n,e);let VideoLayerManagerImpl=class{constructor(e){__publicField2(this,"getCurrentSeekTime",(()=>this.layer.getCurrentSeekTime())),__publicField2(this,"getCurrentFrameTime",(()=>this.layer.getCurrentFrameTime())),__publicField2(this,"getBufferedTime",(()=>this.layer.getBufferedTime())),__publicField2(this,"getDuration",(()=>this.layer.getDuration())),__publicField2(this,"getVolume",(()=>this.layer.getVolume())),__publicField2(this,"getIsPlaying",(()=>this.layer.getIsPlaying())),__publicField2(this,"getIsFullyLoaded",(()=>this.layer.getIsFullyLoaded())),__publicField2(this,"getIsWaiting",(()=>this.layer.getIsWaiting())),__publicField2(this,"play",(()=>this.layer.play())),__publicField2(this,"pause",(()=>this.layer.pause())),__publicField2(this,"seekTo",(e=>this.layer.moveTo(e))),__publicField2(this,"seekBy",(e=>this.layer.moveTo(this.layer.getCurrentSeekTime()+e))),__publicField2(this,"reloadFrame",(()=>this.layer.reloadFrame())),__publicField2(this,"setVolume",(e=>this.layer.changeVolume(e))),__publicField2(this,"changeMuted",(e=>this.layer.changeMuted(e))),__publicField2(this,"getBandwidth",(()=>this.layer.getBandwidth())),__publicField2(this,"getQualityLevels",(()=>this.layer.getQualityLevels())),__publicField2(this,"getCurrentQualityLevel",(()=>this.layer.getCurrentQualityLevel())),__publicField2(this,"setSubtitleSources",(e=>this.layer.setSubtitlesSource(e))),__publicField2(this,"registerObserver",(e=>this.layer.registerObserver(e))),this.layer=e}updateState(e){}setPoster(e){this.layer.setPoster(e)}loadSources(e,t){return this.layer.loadSources(e,t)}getPlayer(){return this.layer.getPlayer()}reloadVideo(){this.layer.reloadVideo()}dispose(){this.layer.dispose()}};VideoLayerManagerImpl=__decorateClass$3([K(),__decorateParam$2(0,O$1(Types.layer.VideoLayer))],VideoLayerManagerImpl);var __getOwnPropDesc$2=Object.getOwnPropertyDescriptor,__decorateClass$2=(e,t,r,n)=>{for(var i,a=n>1?void 0:n?__getOwnPropDesc$2(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=i(a)||a);return a},__decorateParam$1=(e,t)=>(r,n)=>t(r,n,e);let AnimationLayerManagerImpl=class{constructor(e){__publicField2(this,"scenarioElement"),__publicField2(this,"animationsBySrc"),__publicField2(this,"duration"),__publicField2(this,"currentAnimationSources",[]),this.layer=e}updateState(e){this.scenarioElement=e.currentElement,this.setDuration(e.playbackData.duration),this.resourcesLoaded(e.resources,e.playbackData.duration)}setDuration(e){this.duration=e}moveTo(e){const t=1e3*e,r=this.findAnimationsAtTime(t),n=r.filter((e=>-1===this.currentAnimationSources.indexOf(e.src))),i=r.map((e=>e.src)),a=this.currentAnimationSources.filter((e=>-1===i.indexOf(e)));for(const l of n)this.layer.loadAnimation(l.src,this.animationsBySrc.get(l.src),l.animationBlur);for(const l of a)this.layer.removeAnimation(l);const s=n.map((e=>e.src));this.currentAnimationSources=this.currentAnimationSources.concat(s),this.currentAnimationSources=this.currentAnimationSources.filter((e=>-1===a.indexOf(e)));const o=r.filter((e=>this.currentAnimationSources.indexOf(e.src)>-1));for(const l of o)this.layer.moveTo(l.src,this.getAnimationRelativeTime(t,l))}findAnimationsAtTime(e){return this.scenarioElement.animations.filter((t=>ScenarioTimeHelper.getTimeFromVideoStart(this.duration,t.startTimeMillis)<=e&&(void 0===t.endTimeMillis||ScenarioTimeHelper.getTimeFromVideoStart(this.duration,t.endTimeMillis)>=e)))}getAnimationRelativeTime(e,t){return e-t.startTimeMillis}resourcesLoaded(e,t){this.animationsBySrc=e.animationsBySrc,this.duration=t,this.findAnimationsAtTime(0).filter((e=>!0===e.displayAbovePoster)).length>0&&this.moveTo(0)}};AnimationLayerManagerImpl=__decorateClass$2([K(),__decorateParam$1(0,O$1(Types.layer.AnimationLayer))],AnimationLayerManagerImpl);const bindSingleton=(e,t,r)=>{e.bind(t).to(r).inSingletonScope()},bindConstantValue=(e,t,r)=>{e.bind(t).toConstantValue(r)},createBaseContext=e=>{const t=new X;return bindPlayerPluginsToContainer(t),bindConstantValue(t,Types.PlayerConfig,e),bindSingleton(t,Types.PlayerEvents,PlayerEventsImpl),bindSingleton(t,Types.analytics.AnalyticsLogger,AnalyticsLogger),bindSingleton(t,Types.analytics.AnalyticsReporter,AnalyticsReporter),bindSingleton(t,Types.analytics.EventFactory,AnalyticsEventFactory),bindSingleton(t,Types.analytics.Handlers,VintomAnalyticsHandler),bindSingleton(t,Types.analytics.Handlers,GoogleAnalyticsHandler),bindSingleton(t,Types.analytics.Handlers,LogAnalyticsHandler),bindSingleton(t,Types.analytics.Handlers,LocalServerHandler),bindSingleton(t,Types.personalizer.AnimationPersonalizer,AnimationPersonalizer),bindSingleton(t,Types.loaders.ResourceLoader,ResourceLoaderImpl),bindSingleton(t,Types.loaders.ScenarioLoader,ScenarioLoaderImpl),bindSingleton(t,Types.loaders.PosterLoader,PosterLoaderImpl),bindSingleton(t,Types.ScenarioPreferences,ScenarioPreferences),bindSingleton(t,Types.personalizer.AnimationPersonalizerStrategies,FnAnimationPersonalizerStrategy),t},createPlayerContext=(e,t)=>{const r=new X({parent:e});if(!e.get(Types.PlayerConfig))throw new Error("PlayerConfig is not defined in the base container");return bindConstantValue(r,Types.layer.PlayerContainer,t),bindConstantValue(r,Types.layer.AnimationLayer,t.animationLayer),bindConstantValue(r,Types.layer.CTALayer,t.ctaLayer),bindConstantValue(r,Types.layer.VideoLayer,t.videoLayer),bindConstantValue(r,Types.layerManagers.DebugLayerManager,t.playbackInformation),bindSingleton(r,Types.layerManagers.PlayerContainerManager,PlayerContainerManagerImpl),bindSingleton(r,Types.layerManagers.CTALayerManager,CTALayerManagerImpl),bindSingleton(r,Types.layerManagers.AnimationLayerManager,AnimationLayerManagerImpl),bindSingleton(r,Types.layer.PlayerLayers,Layers),bindSingleton(r,Types.layerManagers.VideoLayerManager,VideoLayerManagerImpl),bindSingleton(r,Types.music.MusicManager,PlayerMusicManagerImpl),bindSingleton(r,Types.music.MusicPlayer,MusicPlayerImpl),bindSingleton(r,Types.music.VolumeTransitionManager,VolumeTransitionManagerImpl),bindSingleton(r,Types.Player,Player$1),r},getTimeFromScenarioElementLoadOptions=(e,t)=>"number"==typeof e?e:e&&"object"==typeof e?"time"in e&&"number"==typeof e.time?e.time:"progress"in e&&"number"==typeof e.progress?e.progress*t:void 0:void 0;var __getOwnPropDesc$1=Object.getOwnPropertyDescriptor,__decorateClass$1=(e,t,r,n)=>{for(var i,a=n>1?void 0:n?__getOwnPropDesc$1(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=i(a)||a);return a},__decorateParam=(e,t)=>(r,n)=>t(r,n,e);let Player$1=class{constructor(e,t,r,n,i,a,s){__publicField2(this,"currentElement"),__publicField2(this,"plugins",new Map),__publicField2(this,"currentPlayerLoopId",0),__publicField2(this,"currentResources"),__publicField2(this,"onceTasksMapping",new Map),__publicField2(this,"seekRequest"),__publicField2(this,"goToScenarioElementCurrentTask"),__publicField2(this,"shouldResumePlayingAfterSwitch",!1),__publicField2(this,"playbackState","initializing"),__publicField2(this,"isLoadingContent"),__publicField2(this,"hasBeenDisposed",!1),__publicField2(this,"autoplayEnabled"),__publicField2(this,"isPreparingForScenarioElement",!1),__publicField2(this,"hasPlayedAtLeastOnce",!1),__publicField2(this,"hasPlayedInitialLoop",!1),__publicField2(this,"currentLoop"),__publicField2(this,"hasNotifiedOfScenarioElementStart"),__publicField2(this,"hasNotifiedOfBeingReady"),__publicField2(this,"hasEnsuredGlobalStateInitialized"),this.config=e,this.scenarioLoader=t,this.scenarioPreferences=r,this.layers=n,this.events=i,this.containerManager=a,this.scenarioLoader.setPlayerDelegate(this),this.containerManager.setPlayerDelegate(this),this.resetObservers(),s.forEach((e=>this.installPlugin(e))),ListenerHelper.addEventListener("window","beforeunload",(()=>this.dispose()))}getPlugin(e){for(const t of this.plugins.values())if(t instanceof e)return t;throw new Error(`Plugin of type ${e.name} not found`)}getScenarioElements(){throw new Error("Method not implemented.")}getPlaybackState(){return this.playbackState}getCurrentScenarioElement(){return this.currentElement}getConfig(){return this.config}mute(){this.setIsMuted(!0)}unMute(){this.setIsMuted(!1)}ready(e){this.hasNotifiedOfBeingReady?e():this.once("ready",e)}once(e,t){this.events.once(e,t)}installPlugin(e){var t,r;const n=e.name;this.plugins.has(n)&&(console.warn("Plugin named "+n+" is already installed. Only one instance of a plugin should be installed at a time."),null==(r=(t=this.plugins.get(n)).disconnect)||r.call(t)),this.plugins.set(n,e),e.connect(this)}getElement(){return this.containerManager.getElement()}isLooping(){return null!=this.currentLoop}startLooping(e){this.currentLoop={interruptable:!0,...e},this.trigger("loop.start",{loop:e}),this.applyLoopOverrides(),e.muteVolume&&!this.isPlaying()&&this.video.play()}stopLooping(){const e=this.currentLoop;this.currentLoop=void 0,null!=(null==e?void 0:e.jumpAfterLoop)&&this.setCurrentTime(e.jumpAfterLoop),this.trigger("loop.end",{loop:e}),this.applyLoopOverrides()}isPlaying(){return"playing"===this.playbackState}isPaused(){return"paused"===this.playbackState}isEnded(){return"ended"===this.playbackState}isIdle(){return"idle"===this.playbackState}getCurrentLoop(){return this.currentLoop}getVolume(){return this.video.getVolume()}setVolume(e){this.scenarioPreferences.updatePreferences({volume:e}),this.video.setVolume(e)}setPlaybackRate(e){this.scenarioPreferences.updatePreferences({playbackRate:e}),this.video.getPlayer().playbackRate(e)}getPlaybackRate(){return this.video.getPlayer().playbackRate()}getDuration(){return this.video.getDuration()}isLoading(){return this.isLoadingContent||"switching"===this.playbackState}areSubtitlesEnabled(){const e=this.scenarioPreferences.getPreference("showSubtitles");return!("auto"!==e||!this.config.behavior.subtitlesActiveOnStart)||"auto"!==e&&e}setSubtitlesEnabled(e){this.scenarioPreferences.updatePreferences({showSubtitles:e}),this.loadSubtitlesFromCurrentElement()}loadSubtitlesFromCurrentElement(){var e;const t=this.areSubtitlesEnabled()&&!this.isSubtitlesDisplayOverrideEnabled?null==(e=this.currentElement.video)?void 0:e.subtitlesSource:void 0;this.video.setSubtitleSources(t)}async goToScenarioElement(e,t){if(this.goToScenarioElementCurrentTask){const r=this.executeGoToScenarioElement(e,t);this.goToScenarioElementCurrentTask=this.goToScenarioElementCurrentTask.then((()=>r)).catch((e=>(console.error("[PlayerImpl.goToScenarioElement()] Error while switching to scenario element",e),r))).finally((()=>{this.goToScenarioElementCurrentTask=r}))}else this.goToScenarioElementCurrentTask=this.executeGoToScenarioElement(e,t);return this.goToScenarioElementCurrentTask}async executeGoToScenarioElement(e,t){const r=this.config.findScenarioElement(e);if(this.currentElement&&r.id===this.currentElement.id)this.setCurrentTime(this.getTimeFromScenarioElementLoadOptions(t)??0);else{this.pauseBeforeSwitch(),r||this.onError(new VintomError("RuntimeError",`Scenario element with id ${e} not found.`));try{await this.prepareForScenarioElement(r),await this.loadVideoFor(r,t),this.runScenarioElement(r)}catch(e2){this.onError(new VintomError("RuntimeError",`Error while switching to scenario element ${e}: ${e2.message}`))}}}getCurrentTime(){return this.video.getCurrentSeekTime()}getVideoId(){return this.config.project.videoId}isMuted(){return this.scenarioPreferences.getPreference("isMuted")}setIsMuted(e){this.scenarioPreferences.updatePreferences({isMuted:e}),this.isMuteOverrideEnabled?this.video.changeMuted(!0):this.video.changeMuted(e)}setCurrentTime(e){(e=this.clampTime(e)).05&&this.breakInterruptableLoop(),this.isPreparingForScenarioElement?this.seekRequest=()=>this.video.seekTo(e):this.video.seekTo(e)}run(){this.startPlayer().then((e=>{})).catch((e=>{console.error("Unable to start player",e)}))}play(){this.breakInterruptableLoop(),this.autoplayEnabled&&!this.hasPlayedAtLeastOnce&&(this.hasPlayedAtLeastOnce=!0),this.playbackState="playing",this.hasNotifiedOfScenarioElementStart||(this.trigger("scenarioelement.start",{element:this.currentElement}),this.hasNotifiedOfScenarioElementStart=!0),this.video.play()}breakInterruptableLoop(){var e;this.isLooping()&&(null==(e=this.currentLoop)?void 0:e.interruptable)&&this.stopLooping()}pause(){this.playbackState="paused",this.video.pause()}isDisposed(){return this.hasBeenDisposed}dispose(){this.hasBeenDisposed||(this.hasBeenDisposed=!0,this.plugins.forEach((e=>{var t;return null==(t=e.disconnect)?void 0:t.call(e)})),this.layers.dispose(),ListenerHelper.removeAllEventListeners(),this.stopPlayerLoop(),this.trigger("dispose"),this.events.dispose())}notifyReady(){this.hasNotifiedOfBeingReady||this.hasBeenDisposed||(this.trigger("ready"),this.hasNotifiedOfBeingReady=!0)}onError(e){this.config.behavior.adminMode&&(console.trace(),console.error(e)),this.stopPlayerLoop();try{this.trigger("error",{error:e})}catch(e2){console.error("Error while trying to report error event!",{originalError:e,error:e2})}}replay(){this.goToScenarioElement(this.config.getInitialScenarioElement().id).then((()=>{this.play()}))}setDebugModeEnabled(e){this.scenarioPreferences.updatePreferences({isDebugModeEnabled:e})}isDebugModeEnabled(){return this.scenarioPreferences.getPreference("isDebugModeEnabled")}async startPlayer(){const e=this.config.getInitialScenarioElement(),t=!!(await index$1.video({muted:this.shouldBeMutedOnStart()})).result;this.autoplayEnabled=this.config.behavior.autoplay&&t,this.layers.all().forEach((e=>{var t;return null==(t=e.initialize)?void 0:t.call(e)})),await this.scenarioLoader.loadResources(),await this.goToScenarioElement(e.id)}on(e,t){this.events.on(e,t)}off(e,t){this.events.off(e,t)}trigger(e,t){try{this.events.trigger(this,e,t)}catch(e2){console.error(e2)}}triggerIfStarted(e,t){this.hasNotifiedOfScenarioElementStart&&"initializing"!==this.playbackState&&this.trigger(e,t)}async prepareForScenarioElement(e){this.stopPlayerLoop(),this.ensureGlobalStateInitialized(),this.isPreparingForScenarioElement=!0;const t=this.loadScenarioElementResources(e);this.hasPlayedAtLeastOnce&&(this.playbackState="switching"),this.trigger("scenarioelement.prepare",{element:e}),this.currentResources=await t}runScenarioElement(e){this.currentElement=e,this.hasNotifiedOfScenarioElementStart=!1,this.resetObservers();const t=this.createUpdateDataForLayerManagers();this.layers.all().forEach((e=>e.updateState(t))),this.startPlayback(),this.startPlayerLoop(),this.loadInitialLoopFromCurrentElement(),this.loadSubtitlesFromCurrentElement(),this.notifyReady(),this.seekRequest?(this.once("seeked",(()=>{this.isPreparingForScenarioElement=!1,this.seekRequest=null})),this.seekRequest()):this.isPreparingForScenarioElement=!1}loadInitialLoopFromCurrentElement(){var e;this.hasPlayedInitialLoop||(this.currentElement.loop&&this.startLooping(this.currentElement.loop),(null==(e=this.currentLoop)?void 0:e.muteVolume)&&!this.hasPlayedAtLeastOnce&&this.video.play(),this.hasPlayedInitialLoop=!0)}async loadScenarioElementResources(e){if(e.animations.some((e=>!e.id&&null!=e.customAttributes))){const e=new VintomError("InvalidAnimationVersion","Invalid animation version");this.onError(e)}return this.scenarioLoader.loadScenarioElementResources(e)}loadNextElement(){this.isPreparingForScenarioElement||(this.config.isLastScenarioElement(this.currentElement)?(this.playbackState="ended",this.trigger("ended")):null!=this.currentElement.nextScenarioElementId?this.goToScenarioElement(this.currentElement.nextScenarioElementId):(this.saveShouldResumePlayingAfterSwitch(),this.playbackState="idle"),this.trigger("scenarioelement.end",{element:this.currentElement}))}get video(){return this.layers.video}doUpdate(){const e=this.video.getIsWaiting(),t=this.video.getCurrentFrameTime();this.layers.cta.moveTo(t),this.layers.animation.moveTo(t);const r=BrowserInfo.isIOS()&&!this.hasPlayedAtLeastOnce?this.video.getPlayer().readyState()>=1:this.video.getPlayer().readyState()>2;!this.isPreparingForScenarioElement&&r?this.isLoadingContent=!1:this.canLoaderBeShown()&&(this.isLoadingContent=!0),e&&this.getCurrentTime()>.1&&(this.isLoadingContent=!0),this.updateLoop(),this.trigger("timeupdate")}updateLoop(){if(!this.currentLoop)return;const e=this.currentLoop.start??0,t=e+this.currentLoop.duration;this.getCurrentTime()>=t&&this.setCurrentTime(e)}stopPlayerLoop(){this.currentPlayerLoopId++}startPlayerLoop(){const e=++this.currentPlayerLoopId,t=e=>{this.onError(new VintomError("RuntimeError",e.stack.toString()))};(async()=>{for(;this.currentPlayerLoopId===e;){try{this.doUpdate()}catch(e2){t(e2)}await new Promise((e=>requestAnimationFrame(e)))}})()}ensureGlobalStateInitialized(){this.hasEnsuredGlobalStateInitialized||(this.scenarioPreferences.getPreference("volume")&&this.setVolume(this.scenarioPreferences.getPreference("volume")),this.shouldBeMutedOnStart()&&this.setIsMuted(!0),this.shouldResumePlayingAfterSwitch=this.shouldBeMutedOnStart()&&this.autoplayEnabled,this.ready((()=>this.loadSubtitlesState())),this.hasEnsuredGlobalStateInitialized=!0)}startPlayback(){this.currentElement.video?this.hasPlayedAtLeastOnce||this.autoplayEnabled?this.playAfterSwitch():this.pause():this.layers.cta.displayAllCTAsForCTAOnlyElemnt()}onSeeked(){"idle"===this.playbackState&&this.playAfterSwitch(),this.trigger("seeked")}createUpdateDataForLayerManagers(){return{config:this.config,currentElement:this.currentElement,resources:this.currentResources,playbackData:this.getState()}}resetObservers(){this.registerVideoLayerObserver(),this.registerCTALayerObserver()}registerVideoLayerObserver(){this.video.registerObserver({onEnded:()=>this.loadNextElement(),onError:e=>this.trigger("error",{error:e}),onSubtitlesChange:e=>{this.containerManager.setCurrentSubtitleText(e)},onSeeked:()=>this.onSeeked(),onSeeking:()=>this.trigger("seeking"),onPlay:()=>{navigator.userActivation.isActive&&(this.hasPlayedAtLeastOnce=!0),this.triggerIfStarted("play")},onPause:()=>this.triggerIfStarted("pause"),onWaiting:()=>{},onPlaying:()=>this.triggerIfStarted("playing"),onRateChange:()=>this.trigger("ratechange")})}registerCTALayerObserver(){this.layers.cta.registerObserver({onCTAShow:e=>this.trigger("cta.shown",{ctaId:e.id}),onCTAHidden:e=>this.trigger("cta.hidden",{ctaId:e.id}),onTimeMove:e=>this.containerManager.setAreCTAsVisible(e.length>0)})}getState(){var e,t;return{volume:this.getVolume(),isMuted:this.isMuted(),currentTime:this.video.getCurrentSeekTime(),duration:this.video.getDuration(),scenarioElementId:null==(e=this.currentElement)?void 0:e.id,partNumber:null==(t=this.currentElement)?void 0:t.partId,playbackState:this.playbackState,playbackRate:this.getPlaybackRate()}}async loadVideoFor(e,t){if(e.video){const r=this.getPlaybackRate();this.video.setPoster(e.poster),await new Promise(((r,n)=>{requestAnimationFrame((async()=>{try{await this.video.loadSources(e.video,t),this.trigger("scenarioelement.loaded",{element:e}),r()}catch(i){this.trigger("error",{error:new VintomError("RuntimeError",i.stack.toString())}),n(i)}}))})),this.setPlaybackRate(r)}}canLoaderBeShown(){return"ended"!==this.playbackState&&"idle"!==this.playbackState}getTimeFromScenarioElementLoadOptions(e){return getTimeFromScenarioElementLoadOptions(e,this.video.getDuration())}isTransientState(){return"idle"===this.playbackState||"switching"===this.playbackState}pauseBeforeSwitch(){this.isTransientState()||(this.saveShouldResumePlayingAfterSwitch(),this.isPaused()||this.isEnded()||!this.hasPlayedAtLeastOnce||this.pause())}playAfterSwitch(){this.shouldResumePlayingAfterSwitch?this.play():this.pause()}applyLoopOverrides(){this.setIsMuted(this.isMuted()),this.setSubtitlesEnabled(this.areSubtitlesEnabled())}get isMuteOverrideEnabled(){var e;return this.isLooping()&&(null==(e=this.currentLoop)?void 0:e.muteVolume)}get isSubtitlesDisplayOverrideEnabled(){var e;return this.isLooping()&&(null==(e=this.currentLoop)?void 0:e.hideSubtitles)}loadSubtitlesState(){const e=this.scenarioPreferences.getPreference("showSubtitles");"auto"===e&&this.config.behavior.subtitlesActiveOnStart?this.loadSubtitlesFromCurrentElement():"boolean"==typeof e&&this.setSubtitlesEnabled(e)}clampTime(e){return Math.max(0,Math.min(e,this.video.getDuration()))}saveShouldResumePlayingAfterSwitch(){this.shouldResumePlayingAfterSwitch="playing"===this.playbackState}shouldBeMutedOnStart(){return this.config.behavior.startMuted||this.scenarioPreferences.getPreference("isMuted")}};Player$1=__decorateClass$1([K(),__decorateParam(0,O$1(Types.PlayerConfig)),__decorateParam(1,O$1(Types.loaders.ScenarioLoader)),__decorateParam(2,O$1(Types.ScenarioPreferences)),__decorateParam(3,O$1(Types.layer.PlayerLayers)),__decorateParam(4,O$1(Types.PlayerEvents)),__decorateParam(5,O$1(Types.layerManagers.PlayerContainerManager)),__decorateParam(6,J(Types.PlayerPlugin))],Player$1);const getDataForPlaybackState=(e,t)=>{switch(e){case"ended":return t.onEnded;case"paused":return t.onPaused;case"playing":case"seeking":return t.onPlaying;case"initializing":case"switching":return t.onLoading;case"idle":return t.onIdle??t.onPaused;default:return}};class PlayerConfiguration{constructor(e,t,r,n,i,a,s,o,l,u,c){__publicField2(this,"subtitlesAvailable"),this.version=e,this.project=t,this.behavior=r,this.ui=n,this.urls=i,this.animationSettings=a,this.analyticsEndpoints=s,this.debugParts=o,this.scenarioElements=l,this.personalizationData=u,this.pluginSettings=c,this.subtitlesAvailable=this.scenarioElements.some((e=>{var t;return null==(t=e.video)?void 0:t.subtitlesSource}))}findScenarioElement(e){return this.scenarioElements.find((t=>t.id===e))}getInitialScenarioElement(){return this.scenarioElements.find((e=>e.initial))||this.scenarioElements[0]}isDebugModeEnabled(){return this.debugParts.length>0}hasScenarioElementWithAnimation(){return this.scenarioElements.some((e=>e.animations.length>0))}hasScenarioElementWithVideo(){return this.scenarioElements.some((e=>void 0!==e.video))}getDebugPartAtTime(e){return this.debugParts.find((t=>t.startTime<=e&&t.endTime>=e))}isLastScenarioElement(e){return this.scenarioElements[this.scenarioElements.length-1]===e}isMultiElementScenario(){return this.ui.seekbarParts.length>1}areSubtitlesAvailable(){return this.subtitlesAvailable}clone(e){return new PlayerConfiguration(e.version??this.version,e.project??this.project,e.behavior??this.behavior,e.ui??this.ui,e.urls??this.urls,e.animationSettings??this.animationSettings,e.analyticsEndpoints??this.analyticsEndpoints,e.debugParts??this.debugParts,e.scenarioElements??this.scenarioElements,e.personalizationData??this.personalizationData,e.pluginSettings??this.pluginSettings)}}function $constructor(e,t,r){function n(r,n){var i;Object.defineProperty(r,"_zod",{value:r._zod??{},enumerable:!1}),(i=r._zod).traits??(i.traits=new Set),r._zod.traits.add(e),t(r,n);for(const e in s.prototype)e in r||Object.defineProperty(r,e,{value:s.prototype[e].bind(r)});r._zod.constr=s,r._zod.def=n}const i=(null==r?void 0:r.Parent)??Object;class a extends i{}function s(e){var t;const i=(null==r?void 0:r.Parent)?new a:this;n(i,e),(t=i._zod).deferred??(t.deferred=[]);for(const r of i._zod.deferred)r();return i}return Object.defineProperty(a,"name",{value:e}),Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>{var n,i;return!!((null==r?void 0:r.Parent)&&t instanceof r.Parent)||(null==(i=null==(n=null==t?void 0:t._zod)?void 0:n.traits)?void 0:i.has(e))}}),Object.defineProperty(s,"name",{value:e}),s}class $ZodAsyncError extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const globalConfig={};function config(e){return globalConfig}function getEnumValues(e){const t=Object.values(e).filter((e=>"number"==typeof e));return Object.entries(e).filter((([e,r])=>-1===t.indexOf(+e))).map((([e,t])=>t))}function jsonStringifyReplacer(e,t){return"bigint"==typeof t?t.toString():t}function cached(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function nullish(e){return null==e}function cleanRegex(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function floatSafeRemainder(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}function defineLazy(e,t,r){Object.defineProperty(e,t,{get(){{const n=r();return e[t]=n,n}},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function assignProp(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function randomString$2(e=10){const t="abcdefghijklmnopqrstuvwxyz";let r="";for(let n=0;n{};function isObject$2(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const allowsEval=cached((()=>{var e;if("undefined"!=typeof navigator&&(null==(e=null==navigator?void 0:navigator.userAgent)?void 0:e.includes("Cloudflare")))return!1;try{return new Function(""),!0}catch(t){return!1}}));function isPlainObject(e){if(!1===isObject$2(e))return!1;const t=e.constructor;if(void 0===t)return!0;const r=t.prototype;return!1!==isObject$2(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}const propertyKeyTypes=new Set(["string","number","symbol"]);function escapeRegex(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function clone$1(e,t,r){const n=new e._zod.constr(t??e._zod.def);return t&&!(null==r?void 0:r.parent)||(n._zod.parent=e),n}function normalizeParams(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==(null==t?void 0:t.message)){if(void 0!==(null==t?void 0:t.error))throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}function optionalKeys(e){return Object.keys(e).filter((t=>"optional"===e[t]._zod.optin&&"optional"===e[t]._zod.optout))}const NUMBER_FORMAT_RANGES={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function pick(e,t){const r={},n=e._zod.def;for(const i in t){if(!(i in n.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(r[i]=n.shape[i])}return clone$1(e,{...e._zod.def,shape:r,checks:[]})}function omit$1(e,t){const r={...e._zod.def.shape},n=e._zod.def;for(const i in t){if(!(i in n.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&delete r[i]}return clone$1(e,{...e._zod.def,shape:r,checks:[]})}function extend$1(e,t){const r={...e._zod.def,get shape(){const r={...e._zod.def.shape,...t};return assignProp(this,"shape",r),r},checks:[]};return clone$1(e,r)}function merge$1(e,t){return clone$1(e,{...e._zod.def,get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return assignProp(this,"shape",r),r},catchall:t._zod.def.catchall,checks:[]})}function partial(e,t,r){const n=t._zod.def.shape,i={...n};if(r)for(const a in r){if(!(a in n))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=e?new e({type:"optional",innerType:n[a]}):n[a])}else for(const a in n)i[a]=e?new e({type:"optional",innerType:n[a]}):n[a];return clone$1(t,{...t._zod.def,shape:i,checks:[]})}function required(e,t,r){const n=t._zod.def.shape,i={...n};if(r)for(const a in r){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=new e({type:"nonoptional",innerType:n[a]}))}else for(const a in n)i[a]=new e({type:"nonoptional",innerType:n[a]});return clone$1(t,{...t._zod.def,shape:i,checks:[]})}function aborted(e,t=0){for(let r=t;r{var r;return(r=t).path??(r.path=[]),t.path.unshift(e),t}))}function unwrapMessage(e){return"string"==typeof e?e:null==e?void 0:e.message}function finalizeIssue(e,t,r){var n,i,a,s,o,l;const u={...e,path:e.path??[]};if(!e.message){const c=unwrapMessage(null==(a=null==(i=null==(n=e.inst)?void 0:n._zod.def)?void 0:i.error)?void 0:a.call(i,e))??unwrapMessage(null==(s=null==t?void 0:t.error)?void 0:s.call(t,e))??unwrapMessage(null==(o=r.customError)?void 0:o.call(r,e))??unwrapMessage(null==(l=r.localeError)?void 0:l.call(r,e))??"Invalid input";u.message=c}return delete u.inst,delete u.continue,(null==t?void 0:t.reportInput)||delete u.input,u}function getLengthableOrigin(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function issue(...e){const[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}}const initializer$1=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get:()=>JSON.stringify(t,jsonStringifyReplacer,2),enumerable:!0})},$ZodError=$constructor("$ZodError",initializer$1),$ZodRealError=$constructor("$ZodError",initializer$1,{Parent:Error});function flattenError(e,t=e=>e.message){const r={},n=[];for(const i of e.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):n.push(t(i));return{formErrors:n,fieldErrors:r}}function formatError(e,t){const r=t||function(e){return e.message},n={_errors:[]},i=e=>{for(const t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map((e=>i({issues:e})));else if("invalid_key"===t.code)i({issues:t.issues});else if("invalid_element"===t.code)i({issues:t.issues});else if(0===t.path.length)n._errors.push(r(t));else{let e=n,i=0;for(;ie.path.length-t.path.length));for(const i of n)r.push(`✖ ${i.message}`),(null==(t=i.path)?void 0:t.length)&&r.push(` → at ${toDotPath(i.path)}`);return r.join("\n")}const _parse=e=>(t,r,n,i)=>{const a=n?Object.assign(n,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},a);if(s instanceof Promise)throw new $ZodAsyncError;if(s.issues.length){const t=new((null==i?void 0:i.Err)??e)(s.issues.map((e=>finalizeIssue(e,a,config()))));throw captureStackTrace(t,null==i?void 0:i.callee),t}return s.value},_parseAsync=e=>async(t,r,n,i)=>{const a=n?Object.assign(n,{async:!0}):{async:!0};let s=t._zod.run({value:r,issues:[]},a);if(s instanceof Promise&&(s=await s),s.issues.length){const t=new((null==i?void 0:i.Err)??e)(s.issues.map((e=>finalizeIssue(e,a,config()))));throw captureStackTrace(t,null==i?void 0:i.callee),t}return s.value},_safeParse=e=>(t,r,n)=>{const i=n?{...n,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new $ZodAsyncError;return a.issues.length?{success:!1,error:new(e??$ZodError)(a.issues.map((e=>finalizeIssue(e,i,config()))))}:{success:!0,data:a.value}},safeParse$1=_safeParse($ZodRealError),_safeParseAsync=e=>async(t,r,n)=>{const i=n?Object.assign(n,{async:!0}):{async:!0};let a=t._zod.run({value:r,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map((e=>finalizeIssue(e,i,config()))))}:{success:!0,data:a.value}},safeParseAsync$1=_safeParseAsync($ZodRealError),cuid=/^[cC][^\s-]{8,}$/,cuid2=/^[0-9a-z]+$/,ulid=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,xid=/^[0-9a-vA-V]{20}$/,ksuid=/^[A-Za-z0-9]{27}$/,nanoid=/^[a-zA-Z0-9_-]{21}$/,duration$2=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,guid=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,uuid=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,email=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,_emoji$1="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function emoji(){return new RegExp(_emoji$1,"u")}const ipv4=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv6=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,cidrv4=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,cidrv6=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,base64url=/^[A-Za-z0-9_-]*$/,hostname=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,e164=/^\+(?:[0-9]){6,14}[0-9]$/,dateSource="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",date$1=new RegExp(`^${dateSource}$`);function timeSource(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function time$1(e){return new RegExp(`^${timeSource(e)}$`)}function datetime$1(e){const t=timeSource({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-]\\d{2}:\\d{2})");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${dateSource}T(?:${n})$`)}const string$1=e=>{const t=e?`[\\s\\S]{${(null==e?void 0:e.minimum)??0},${(null==e?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},integer=/^\d+$/,number$1=/^-?\d+(?:\.\d+)?/i,boolean$1=/true|false/i,lowercase=/^[^A-Z]*$/,uppercase=/^[^a-z]*$/,$ZodCheck=$constructor("$ZodCheck",((e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])})),numericOriginMap={number:"number",bigint:"bigint",object:"date"},$ZodCheckLessThan=$constructor("$ZodCheckLessThan",((e,t)=>{$ZodCheck.init(e,t);const r=numericOriginMap[typeof t.value];e._zod.onattach.push((e=>{const r=e._zod.bag,n=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value{(t.inclusive?n.value<=t.value:n.value{$ZodCheck.init(e,t);const r=numericOriginMap[typeof t.value];e._zod.onattach.push((e=>{const r=e._zod.bag,n=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>n&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)})),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),$ZodCheckMultipleOf=$constructor("$ZodCheckMultipleOf",((e,t)=>{$ZodCheck.init(e,t),e._zod.onattach.push((e=>{var r;(r=e._zod.bag).multipleOf??(r.multipleOf=t.value)})),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof r.value?r.value%t.value===BigInt(0):0===floatSafeRemainder(r.value,t.value))||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}})),$ZodCheckNumberFormat=$constructor("$ZodCheckNumberFormat",((e,t)=>{var r;$ZodCheck.init(e,t),t.format=t.format||"float64";const n=null==(r=t.format)?void 0:r.includes("int"),i=n?"int":"number",[a,s]=NUMBER_FORMAT_RANGES[t.format];e._zod.onattach.push((e=>{const r=e._zod.bag;r.format=t.format,r.minimum=a,r.maximum=s,n&&(r.pattern=integer)})),e._zod.check=r=>{const o=r.value;if(n){if(!Number.isInteger(o))return void r.issues.push({expected:i,format:t.format,code:"invalid_type",input:o,inst:e});if(!Number.isSafeInteger(o))return void(o>0?r.issues.push({input:o,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}):r.issues.push({input:o,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}))}os&&r.issues.push({origin:"number",input:o,code:"too_big",maximum:s,inst:e})}})),$ZodCheckMaxLength=$constructor("$ZodCheckMaxLength",((e,t)=>{$ZodCheck.init(e,t),e._zod.when=e=>{const t=e.value;return!nullish(t)&&void 0!==t.length},e._zod.onattach.push((e=>{const r=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum{const n=r.value;if(n.length<=t.maximum)return;const i=getLengthableOrigin(n);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}})),$ZodCheckMinLength=$constructor("$ZodCheckMinLength",((e,t)=>{$ZodCheck.init(e,t),e._zod.when=e=>{const t=e.value;return!nullish(t)&&void 0!==t.length},e._zod.onattach.push((e=>{const r=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(e._zod.bag.minimum=t.minimum)})),e._zod.check=r=>{const n=r.value;if(n.length>=t.minimum)return;const i=getLengthableOrigin(n);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}})),$ZodCheckLengthEquals=$constructor("$ZodCheckLengthEquals",((e,t)=>{$ZodCheck.init(e,t),e._zod.when=e=>{const t=e.value;return!nullish(t)&&void 0!==t.length},e._zod.onattach.push((e=>{const r=e._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length})),e._zod.check=r=>{const n=r.value,i=n.length;if(i===t.length)return;const a=getLengthableOrigin(n),s=i>t.length;r.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},input:r.value,inst:e,continue:!t.abort})}})),$ZodCheckStringFormat=$constructor("$ZodCheckStringFormat",((e,t)=>{var r;$ZodCheck.init(e,t),e._zod.onattach.push((e=>{const r=e._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))})),(r=e._zod).check??(r.check=r=>{if(!t.pattern)throw new Error("Not implemented.");t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})})})),$ZodCheckRegex=$constructor("$ZodCheckRegex",((e,t)=>{$ZodCheckStringFormat.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}})),$ZodCheckLowerCase=$constructor("$ZodCheckLowerCase",((e,t)=>{t.pattern??(t.pattern=lowercase),$ZodCheckStringFormat.init(e,t)})),$ZodCheckUpperCase=$constructor("$ZodCheckUpperCase",((e,t)=>{t.pattern??(t.pattern=uppercase),$ZodCheckStringFormat.init(e,t)})),$ZodCheckIncludes=$constructor("$ZodCheckIncludes",((e,t)=>{$ZodCheck.init(e,t);const r=escapeRegex(t.includes),n=new RegExp("number"==typeof t.position?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}})),$ZodCheckStartsWith=$constructor("$ZodCheckStartsWith",((e,t)=>{$ZodCheck.init(e,t);const r=new RegExp(`^${escapeRegex(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)})),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}})),$ZodCheckEndsWith=$constructor("$ZodCheckEndsWith",((e,t)=>{$ZodCheck.init(e,t);const r=new RegExp(`.*${escapeRegex(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)})),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}})),$ZodCheckOverwrite=$constructor("$ZodCheckOverwrite",((e,t)=>{$ZodCheck.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}));class Doc{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter((e=>e)),r=Math.min(...t.map((e=>e.length-e.trimStart().length))),n=t.map((e=>e.slice(r))).map((e=>" ".repeat(2*this.indent)+e));for(const i of n)this.content.push(i)}compile(){return new Function(...null==this?void 0:this.args,[...((null==this?void 0:this.content)??[""]).map((e=>` ${e}`))].join("\n"))}}const version$6={major:4,minor:0,patch:0},$ZodType=$constructor("$ZodType",((e,t)=>{var r,n;e??(e={}),defineLazy(e._zod,"id",(()=>t.type+"_"+randomString$2(10))),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=version$6;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const a of i)for(const t of a._zod.onattach)t(e);if(0===i.length)(n=e._zod).deferred??(n.deferred=[]),null==(r=e._zod.deferred)||r.push((()=>{e._zod.run=e._zod.parse}));else{const t=(e,t,r)=>{let n,i=aborted(e);for(const a of t){if(a._zod.when){if(!a._zod.when(e))continue}else if(i)continue;const t=e.issues.length,s=a._zod.check(e);if(s instanceof Promise&&!1===(null==r?void 0:r.async))throw new $ZodAsyncError;if(n||s instanceof Promise)n=(n??Promise.resolve()).then((async()=>{await s;e.issues.length!==t&&(i||(i=aborted(e,t)))}));else{if(e.issues.length===t)continue;i||(i=aborted(e,t))}}return n?n.then((()=>e)):e};e._zod.run=(r,n)=>{const a=e._zod.parse(r,n);if(a instanceof Promise){if(!1===n.async)throw new $ZodAsyncError;return a.then((e=>t(e,i,n)))}return t(a,i,n)}}e["~standard"]={validate:t=>{var r;try{const n=safeParse$1(e,t);return n.success?{value:n.data}:{issues:null==(r=n.error)?void 0:r.issues}}catch(n){return safeParseAsync$1(e,t).then((e=>{var t;return e.success?{value:e.data}:{issues:null==(t=e.error)?void 0:t.issues}}))}},vendor:"zod",version:1}})),$ZodString=$constructor("$ZodString",((e,t)=>{var r;$ZodType.init(e,t),e._zod.pattern=[...(null==(r=null==e?void 0:e._zod.bag)?void 0:r.patterns)??[]].pop()??string$1(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(i){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}})),$ZodStringFormat=$constructor("$ZodStringFormat",((e,t)=>{$ZodCheckStringFormat.init(e,t),$ZodString.init(e,t)})),$ZodGUID=$constructor("$ZodGUID",((e,t)=>{t.pattern??(t.pattern=guid),$ZodStringFormat.init(e,t)})),$ZodUUID=$constructor("$ZodUUID",((e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=uuid(e))}else t.pattern??(t.pattern=uuid());$ZodStringFormat.init(e,t)})),$ZodEmail=$constructor("$ZodEmail",((e,t)=>{t.pattern??(t.pattern=email),$ZodStringFormat.init(e,t)})),$ZodURL=$constructor("$ZodURL",((e,t)=>{$ZodStringFormat.init(e,t),e._zod.check=r=>{try{const n=new URL(r.value);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:hostname.source,input:r.value,inst:e,continue:!t.abort})),void(t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})))}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}})),$ZodEmoji=$constructor("$ZodEmoji",((e,t)=>{t.pattern??(t.pattern=emoji()),$ZodStringFormat.init(e,t)})),$ZodNanoID=$constructor("$ZodNanoID",((e,t)=>{t.pattern??(t.pattern=nanoid),$ZodStringFormat.init(e,t)})),$ZodCUID=$constructor("$ZodCUID",((e,t)=>{t.pattern??(t.pattern=cuid),$ZodStringFormat.init(e,t)})),$ZodCUID2=$constructor("$ZodCUID2",((e,t)=>{t.pattern??(t.pattern=cuid2),$ZodStringFormat.init(e,t)})),$ZodULID=$constructor("$ZodULID",((e,t)=>{t.pattern??(t.pattern=ulid),$ZodStringFormat.init(e,t)})),$ZodXID=$constructor("$ZodXID",((e,t)=>{t.pattern??(t.pattern=xid),$ZodStringFormat.init(e,t)})),$ZodKSUID=$constructor("$ZodKSUID",((e,t)=>{t.pattern??(t.pattern=ksuid),$ZodStringFormat.init(e,t)})),$ZodISODateTime=$constructor("$ZodISODateTime",((e,t)=>{t.pattern??(t.pattern=datetime$1(t)),$ZodStringFormat.init(e,t),e._zod.check})),$ZodISODate=$constructor("$ZodISODate",((e,t)=>{t.pattern??(t.pattern=date$1),$ZodStringFormat.init(e,t)})),$ZodISOTime=$constructor("$ZodISOTime",((e,t)=>{t.pattern??(t.pattern=time$1(t)),$ZodStringFormat.init(e,t),e._zod.check})),$ZodISODuration=$constructor("$ZodISODuration",((e,t)=>{t.pattern??(t.pattern=duration$2),$ZodStringFormat.init(e,t)})),$ZodIPv4=$constructor("$ZodIPv4",((e,t)=>{t.pattern??(t.pattern=ipv4),$ZodStringFormat.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv4"}))})),$ZodIPv6=$constructor("$ZodIPv6",((e,t)=>{t.pattern??(t.pattern=ipv6),$ZodStringFormat.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv6"})),e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}})),$ZodCIDRv4=$constructor("$ZodCIDRv4",((e,t)=>{t.pattern??(t.pattern=cidrv4),$ZodStringFormat.init(e,t)})),$ZodCIDRv6=$constructor("$ZodCIDRv6",((e,t)=>{t.pattern??(t.pattern=cidrv6),$ZodStringFormat.init(e,t),e._zod.check=r=>{const[n,i]=r.value.split("/");try{if(!i)throw new Error;const e=Number(i);if(`${e}`!==i)throw new Error;if(e<0||e>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}}));function isValidBase64(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const $ZodBase64=$constructor("$ZodBase64",((e,t)=>{t.pattern??(t.pattern=base64),$ZodStringFormat.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64"})),e._zod.check=r=>{isValidBase64(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}));function isValidBase64URL(e){if(!base64url.test(e))return!1;const t=e.replace(/[-_]/g,(e=>"-"===e?"+":"/"));return isValidBase64(t.padEnd(4*Math.ceil(t.length/4),"="))}const $ZodBase64URL=$constructor("$ZodBase64URL",((e,t)=>{t.pattern??(t.pattern=base64url),$ZodStringFormat.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64url"})),e._zod.check=r=>{isValidBase64URL(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}})),$ZodE164=$constructor("$ZodE164",((e,t)=>{t.pattern??(t.pattern=e164),$ZodStringFormat.init(e,t)}));function isValidJWT(e,t=null){try{const r=e.split(".");if(3!==r.length)return!1;const[n]=r,i=JSON.parse(atob(n));return(!("typ"in i)||"JWT"===(null==i?void 0:i.typ))&&(!!i.alg&&(!t||"alg"in i&&i.alg===t))}catch{return!1}}const $ZodJWT=$constructor("$ZodJWT",((e,t)=>{$ZodStringFormat.init(e,t),e._zod.check=r=>{isValidJWT(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}})),$ZodNumber=$constructor("$ZodNumber",((e,t)=>{$ZodType.init(e,t),e._zod.pattern=e._zod.bag.pattern??number$1,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch(s){}const i=r.value;if("number"==typeof i&&!Number.isNaN(i)&&Number.isFinite(i))return r;const a="number"==typeof i?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...a?{received:a}:{}}),r}})),$ZodNumberFormat=$constructor("$ZodNumber",((e,t)=>{$ZodCheckNumberFormat.init(e,t),$ZodNumber.init(e,t)})),$ZodBoolean=$constructor("$ZodBoolean",((e,t)=>{$ZodType.init(e,t),e._zod.pattern=boolean$1,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Boolean(r.value)}catch(a){}const i=r.value;return"boolean"==typeof i||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}})),$ZodAny=$constructor("$ZodAny",((e,t)=>{$ZodType.init(e,t),e._zod.parse=e=>e})),$ZodUnknown=$constructor("$ZodUnknown",((e,t)=>{$ZodType.init(e,t),e._zod.parse=e=>e})),$ZodNever=$constructor("$ZodNever",((e,t)=>{$ZodType.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}));function handleArrayResult(e,t,r){e.issues.length&&t.issues.push(...prefixIssues(r,e.issues)),t.value[r]=e.value}const $ZodArray=$constructor("$ZodArray",((e,t)=>{$ZodType.init(e,t),e._zod.parse=(r,n)=>{const i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);const a=[];for(let e=0;ehandleArrayResult(t,r,e)))):handleArrayResult(o,r,e)}return a.length?Promise.all(a).then((()=>r)):r}}));function handleObjectResult(e,t,r){e.issues.length&&t.issues.push(...prefixIssues(r,e.issues)),t.value[r]=e.value}function handleOptionalObjectResult(e,t,r,n){e.issues.length?void 0===n[r]?t.value[r]=r in n?void 0:e.value:t.issues.push(...prefixIssues(r,e.issues)):void 0===e.value?r in n&&(t.value[r]=void 0):t.value[r]=e.value}const $ZodObject=$constructor("$ZodObject",((e,t)=>{$ZodType.init(e,t);const r=cached((()=>{const e=Object.keys(t.shape);for(const n of e)if(!(t.shape[n]instanceof $ZodType))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const r=optionalKeys(t.shape);return{shape:t.shape,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}));defineLazy(e._zod,"propValues",(()=>{const e=t.shape,r={};for(const t in e){const n=e[t]._zod;if(n.values){r[t]??(r[t]=new Set);for(const e of n.values)r[t].add(e)}}return r}));let n;const i=isObject$2,a=!globalConfig.jitless,s=a&&allowsEval.value,{catchall:o}=t;let l;e._zod.parse=(u,c)=>{l??(l=r.value);const d=u.value;if(!i(d))return u.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),u;const h=[];if(a&&s&&!1===(null==c?void 0:c.async)&&!0!==c.jitless)n||(n=(e=>{const t=new Doc(["shape","payload","ctx"]),{keys:n,optionalKeys:i}=r.value,a=e=>{const t=esc(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const s=Object.create(null);for(const r of n)s[r]=randomString$2(15);t.write("const newResult = {}");for(const r of n)if(i.has(r)){const e=s[r];t.write(`const ${e} = ${a(r)};`);const n=esc(r);t.write(`\n if (${e}.issues.length) {\n if (input[${n}] === undefined) {\n if (${n} in input) {\n newResult[${n}] = undefined;\n }\n } else {\n payload.issues = payload.issues.concat(\n ${e}.issues.map((iss) => ({\n ...iss,\n path: iss.path ? [${n}, ...iss.path] : [${n}],\n }))\n );\n }\n } else if (${e}.value === undefined) {\n if (${n} in input) newResult[${n}] = undefined;\n } else {\n newResult[${n}] = ${e}.value;\n }\n `)}else{const e=s[r];t.write(`const ${e} = ${a(r)};`),t.write(`\n if (${e}.issues.length) payload.issues = payload.issues.concat(${e}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${esc(r)}, ...iss.path] : [${esc(r)}]\n })));`),t.write(`newResult[${esc(r)}] = ${e}.value`)}t.write("payload.value = newResult;"),t.write("return payload;");const o=t.compile();return(t,r)=>o(e,t,r)})(t.shape)),u=n(u,c);else{u.value={};const e=l.shape;for(const t of l.keys){const r=e[t],n=r._zod.run({value:d[t],issues:[]},c),i="optional"===r._zod.optin&&"optional"===r._zod.optout;n instanceof Promise?h.push(n.then((e=>i?handleOptionalObjectResult(e,u,t,d):handleObjectResult(e,u,t)))):i?handleOptionalObjectResult(n,u,t,d):handleObjectResult(n,u,t)}}if(!o)return h.length?Promise.all(h).then((()=>u)):u;const p=[],f=l.keySet,m=o._zod,g=m.def.type;for(const e of Object.keys(d)){if(f.has(e))continue;if("never"===g){p.push(e);continue}const t=m.run({value:d[e],issues:[]},c);t instanceof Promise?h.push(t.then((t=>handleObjectResult(t,u,e)))):handleObjectResult(t,u,e)}return p.length&&u.issues.push({code:"unrecognized_keys",keys:p,input:d,inst:e}),h.length?Promise.all(h).then((()=>u)):u}}));function handleUnionResults(e,t,r,n){for(const i of e)if(0===i.issues.length)return t.value=i.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map((e=>e.issues.map((e=>finalizeIssue(e,n,config())))))}),t}const $ZodUnion=$constructor("$ZodUnion",((e,t)=>{$ZodType.init(e,t),defineLazy(e._zod,"values",(()=>{if(t.options.every((e=>e._zod.values)))return new Set(t.options.flatMap((e=>Array.from(e._zod.values))))})),defineLazy(e._zod,"pattern",(()=>{if(t.options.every((e=>e._zod.pattern))){const e=t.options.map((e=>e._zod.pattern));return new RegExp(`^(${e.map((e=>cleanRegex(e.source))).join("|")})$`)}})),e._zod.parse=(r,n)=>{let i=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:r.value,issues:[]},n);if(t instanceof Promise)a.push(t),i=!0;else{if(0===t.issues.length)return t;a.push(t)}}return i?Promise.all(a).then((t=>handleUnionResults(t,r,e,n))):handleUnionResults(a,r,e,n)}})),$ZodIntersection=$constructor("$ZodIntersection",((e,t)=>{$ZodType.init(e,t),e._zod.parse=(e,r)=>{const{value:n}=e,i=t.left._zod.run({value:n,issues:[]},r),a=t.right._zod.run({value:n,issues:[]},r);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then((([t,r])=>handleIntersectionResults(e,t,r))):handleIntersectionResults(e,i,a)}}));function mergeValues(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(isPlainObject(e)&&isPlainObject(t)){const r=Object.keys(t),n=Object.keys(e).filter((e=>-1!==r.indexOf(e))),i={...e,...t};for(const a of n){const r=mergeValues(e[a],t[a]);if(!r.valid)return{valid:!1,mergeErrorPath:[a,...r.mergeErrorPath]};i[a]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n{$ZodType.init(e,t),e._zod.parse=(r,n)=>{const i=r.value;if(!isPlainObject(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;const a=[];if(t.keyType._zod.values){const s=t.keyType._zod.values;r.value={};for(const e of s)if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){const s=t.valueType._zod.run({value:i[e],issues:[]},n);s instanceof Promise?a.push(s.then((t=>{t.issues.length&&r.issues.push(...prefixIssues(e,t.issues)),r.value[e]=t.value}))):(s.issues.length&&r.issues.push(...prefixIssues(e,s.issues)),r.value[e]=s.value)}let o;for(const e in i)s.has(e)||(o=o??[],o.push(e));o&&o.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:o})}else{r.value={};for(const s of Reflect.ownKeys(i)){if("__proto__"===s)continue;const o=t.keyType._zod.run({value:s,issues:[]},n);if(o instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(o.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:o.issues.map((e=>finalizeIssue(e,n,config()))),input:s,path:[s],inst:e}),r.value[o.value]=o.value;continue}const l=t.valueType._zod.run({value:i[s],issues:[]},n);l instanceof Promise?a.push(l.then((e=>{e.issues.length&&r.issues.push(...prefixIssues(s,e.issues)),r.value[o.value]=e.value}))):(l.issues.length&&r.issues.push(...prefixIssues(s,l.issues)),r.value[o.value]=l.value)}}return a.length?Promise.all(a).then((()=>r)):r}})),$ZodEnum=$constructor("$ZodEnum",((e,t)=>{$ZodType.init(e,t);const r=getEnumValues(t.entries);e._zod.values=new Set(r),e._zod.pattern=new RegExp(`^(${r.filter((e=>propertyKeyTypes.has(typeof e))).map((e=>"string"==typeof e?escapeRegex(e):e.toString())).join("|")})$`),e._zod.parse=(t,n)=>{const i=t.value;return e._zod.values.has(i)||t.issues.push({code:"invalid_value",values:r,input:i,inst:e}),t}})),$ZodTransform=$constructor("$ZodTransform",((e,t)=>{$ZodType.init(e,t),e._zod.parse=(e,r)=>{const n=t.transform(e.value,e);if(r.async){return(n instanceof Promise?n:Promise.resolve(n)).then((t=>(e.value=t,e)))}if(n instanceof Promise)throw new $ZodAsyncError;return e.value=n,e}})),$ZodOptional=$constructor("$ZodOptional",((e,t)=>{$ZodType.init(e,t),e._zod.optin="optional",e._zod.optout="optional",defineLazy(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0)),defineLazy(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${cleanRegex(e.source)})?$`):void 0})),e._zod.parse=(e,r)=>void 0===e.value?e:t.innerType._zod.run(e,r)})),$ZodNullable=$constructor("$ZodNullable",((e,t)=>{$ZodType.init(e,t),defineLazy(e._zod,"optin",(()=>t.innerType._zod.optin)),defineLazy(e._zod,"optout",(()=>t.innerType._zod.optout)),defineLazy(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${cleanRegex(e.source)}|null)$`):void 0})),defineLazy(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0)),e._zod.parse=(e,r)=>null===e.value?e:t.innerType._zod.run(e,r)})),$ZodDefault=$constructor("$ZodDefault",((e,t)=>{$ZodType.init(e,t),e._zod.optin="optional",defineLazy(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,r)=>{if(void 0===e.value)return e.value=t.defaultValue,e;const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then((e=>handleDefaultResult(e,t))):handleDefaultResult(n,t)}}));function handleDefaultResult(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const $ZodPrefault=$constructor("$ZodPrefault",((e,t)=>{$ZodType.init(e,t),e._zod.optin="optional",defineLazy(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,r)=>(void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))})),$ZodNonOptional=$constructor("$ZodNonOptional",((e,t)=>{$ZodType.init(e,t),defineLazy(e._zod,"values",(()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter((e=>void 0!==e))):void 0})),e._zod.parse=(r,n)=>{const i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then((t=>handleNonOptionalResult(t,e))):handleNonOptionalResult(i,e)}}));function handleNonOptionalResult(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const $ZodCatch=$constructor("$ZodCatch",((e,t)=>{$ZodType.init(e,t),defineLazy(e._zod,"optin",(()=>t.innerType._zod.optin)),defineLazy(e._zod,"optout",(()=>t.innerType._zod.optout)),defineLazy(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,r)=>{const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then((n=>(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map((e=>finalizeIssue(e,r,config())))},input:e.value}),e.issues=[]),e))):(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map((e=>finalizeIssue(e,r,config())))},input:e.value}),e.issues=[]),e)}})),$ZodPipe=$constructor("$ZodPipe",((e,t)=>{$ZodType.init(e,t),defineLazy(e._zod,"values",(()=>t.in._zod.values)),defineLazy(e._zod,"optin",(()=>t.in._zod.optin)),defineLazy(e._zod,"optout",(()=>t.out._zod.optout)),e._zod.parse=(e,r)=>{const n=t.in._zod.run(e,r);return n instanceof Promise?n.then((e=>handlePipeResult(e,t,r))):handlePipeResult(n,t,r)}}));function handlePipeResult(e,t,r){return aborted(e)?e:t.out._zod.run({value:e.value,issues:e.issues},r)}const $ZodReadonly=$constructor("$ZodReadonly",((e,t)=>{$ZodType.init(e,t),defineLazy(e._zod,"propValues",(()=>t.innerType._zod.propValues)),defineLazy(e._zod,"optin",(()=>t.innerType._zod.optin)),defineLazy(e._zod,"optout",(()=>t.innerType._zod.optout)),e._zod.parse=(e,r)=>{const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(handleReadonlyResult):handleReadonlyResult(n)}}));function handleReadonlyResult(e){return e.value=Object.freeze(e.value),e}const $ZodCustom=$constructor("$ZodCustom",((e,t)=>{$ZodCheck.init(e,t),$ZodType.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=r=>{const n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then((t=>handleRefineResult(t,r,n,e)));handleRefineResult(i,r,n,e)}}));function handleRefineResult(e,t,r,n){if(!e){const e={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(e.params=n._zod.def.params),t.issues.push(issue(e))}}class $ZodRegistry{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const r=t[0];if(this._map.set(e,r),r&&"object"==typeof r&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,e)}return this}remove(e){return this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const r={...this.get(t)??{}};return delete r.id,{...r,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}}function registry(){return new $ZodRegistry}const globalRegistry=registry();function _string(e,t){return new e({type:"string",...normalizeParams(t)})}function _email(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...normalizeParams(t)})}function _guid$1(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...normalizeParams(t)})}function _uuid(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...normalizeParams(t)})}function _uuidv4(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...normalizeParams(t)})}function _uuidv6(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...normalizeParams(t)})}function _uuidv7(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...normalizeParams(t)})}function _url(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...normalizeParams(t)})}function _emoji(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...normalizeParams(t)})}function _nanoid(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...normalizeParams(t)})}function _cuid(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...normalizeParams(t)})}function _cuid2(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...normalizeParams(t)})}function _ulid(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...normalizeParams(t)})}function _xid(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...normalizeParams(t)})}function _ksuid(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...normalizeParams(t)})}function _ipv4(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...normalizeParams(t)})}function _ipv6(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...normalizeParams(t)})}function _cidrv4(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...normalizeParams(t)})}function _cidrv6(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...normalizeParams(t)})}function _base64(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...normalizeParams(t)})}function _base64url(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...normalizeParams(t)})}function _e164(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...normalizeParams(t)})}function _jwt(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...normalizeParams(t)})}function _isoDateTime(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...normalizeParams(t)})}function _isoDate(e,t){return new e({type:"string",format:"date",check:"string_format",...normalizeParams(t)})}function _isoTime(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...normalizeParams(t)})}function _isoDuration(e,t){return new e({type:"string",format:"duration",check:"string_format",...normalizeParams(t)})}function _number(e,t){return new e({type:"number",checks:[],...normalizeParams(t)})}function _int(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...normalizeParams(t)})}function _boolean(e,t){return new e({type:"boolean",...normalizeParams(t)})}function _any(e){return new e({type:"any"})}function _unknown(e){return new e({type:"unknown"})}function _never(e,t){return new e({type:"never",...normalizeParams(t)})}function _lt(e,t){return new $ZodCheckLessThan({check:"less_than",...normalizeParams(t),value:e,inclusive:!1})}function _lte(e,t){return new $ZodCheckLessThan({check:"less_than",...normalizeParams(t),value:e,inclusive:!0})}function _gt(e,t){return new $ZodCheckGreaterThan({check:"greater_than",...normalizeParams(t),value:e,inclusive:!1})}function _gte(e,t){return new $ZodCheckGreaterThan({check:"greater_than",...normalizeParams(t),value:e,inclusive:!0})}function _multipleOf(e,t){return new $ZodCheckMultipleOf({check:"multiple_of",...normalizeParams(t),value:e})}function _maxLength(e,t){return new $ZodCheckMaxLength({check:"max_length",...normalizeParams(t),maximum:e})}function _minLength(e,t){return new $ZodCheckMinLength({check:"min_length",...normalizeParams(t),minimum:e})}function _length(e,t){return new $ZodCheckLengthEquals({check:"length_equals",...normalizeParams(t),length:e})}function _regex(e,t){return new $ZodCheckRegex({check:"string_format",format:"regex",...normalizeParams(t),pattern:e})}function _lowercase(e){return new $ZodCheckLowerCase({check:"string_format",format:"lowercase",...normalizeParams(e)})}function _uppercase(e){return new $ZodCheckUpperCase({check:"string_format",format:"uppercase",...normalizeParams(e)})}function _includes(e,t){return new $ZodCheckIncludes({check:"string_format",format:"includes",...normalizeParams(t),includes:e})}function _startsWith(e,t){return new $ZodCheckStartsWith({check:"string_format",format:"starts_with",...normalizeParams(t),prefix:e})}function _endsWith(e,t){return new $ZodCheckEndsWith({check:"string_format",format:"ends_with",...normalizeParams(t),suffix:e})}function _overwrite(e){return new $ZodCheckOverwrite({check:"overwrite",tx:e})}function _normalize(e){return _overwrite((t=>t.normalize(e)))}function _trim(){return _overwrite((e=>e.trim()))}function _toLowerCase(){return _overwrite((e=>e.toLowerCase()))}function _toUpperCase(){return _overwrite((e=>e.toUpperCase()))}function _array(e,t,r){return new e({type:"array",element:t,...normalizeParams(r)})}function _refine(e,t,r){return new e({type:"custom",check:"custom",fn:t,...normalizeParams(r)})}const ZodISODateTime=$constructor("ZodISODateTime",((e,t)=>{$ZodISODateTime.init(e,t),ZodStringFormat.init(e,t)}));function datetime(e){return _isoDateTime(ZodISODateTime,e)}const ZodISODate=$constructor("ZodISODate",((e,t)=>{$ZodISODate.init(e,t),ZodStringFormat.init(e,t)}));function date(e){return _isoDate(ZodISODate,e)}const ZodISOTime=$constructor("ZodISOTime",((e,t)=>{$ZodISOTime.init(e,t),ZodStringFormat.init(e,t)}));function time(e){return _isoTime(ZodISOTime,e)}const ZodISODuration=$constructor("ZodISODuration",((e,t)=>{$ZodISODuration.init(e,t),ZodStringFormat.init(e,t)}));function duration$1(e){return _isoDuration(ZodISODuration,e)}const initializer=(e,t)=>{$ZodError.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>formatError(e,t)},flatten:{value:t=>flattenError(e,t)},addIssue:{value:t=>e.issues.push(t)},addIssues:{value:t=>e.issues.push(...t)},isEmpty:{get:()=>0===e.issues.length}})},ZodError=$constructor("ZodError",initializer),ZodRealError=$constructor("ZodError",initializer,{Parent:Error}),parse$2=_parse(ZodRealError),parseAsync=_parseAsync(ZodRealError),safeParse=_safeParse(ZodRealError),safeParseAsync=_safeParseAsync(ZodRealError),ZodType=$constructor("ZodType",((e,t)=>($ZodType.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map((e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e))]}),e.clone=(t,r)=>clone$1(e,t,r),e.brand=()=>e,e.register=(t,r)=>(t.add(e,r),e),e.parse=(t,r)=>parse$2(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>safeParse(e,t,r),e.parseAsync=async(t,r)=>parseAsync(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>safeParseAsync(e,t,r),e.spa=e.safeParseAsync,e.refine=(t,r)=>e.check(refine(t,r)),e.superRefine=t=>e.check(superRefine(t)),e.overwrite=t=>e.check(_overwrite(t)),e.optional=()=>optional(e),e.nullable=()=>nullable(e),e.nullish=()=>optional(nullable(e)),e.nonoptional=t=>nonoptional(e,t),e.array=()=>array(e),e.or=t=>union$1([e,t]),e.and=t=>intersection(e,t),e.transform=t=>pipe(e,transform$1(t)),e.default=t=>_default(e,t),e.prefault=t=>prefault(e,t),e.catch=t=>_catch(e,t),e.pipe=t=>pipe(e,t),e.readonly=()=>readonly(e),e.describe=t=>{const r=e.clone();return globalRegistry.add(r,{description:t}),r},Object.defineProperty(e,"description",{get(){var t;return null==(t=globalRegistry.get(e))?void 0:t.description},configurable:!0}),e.meta=(...t)=>{if(0===t.length)return globalRegistry.get(e);const r=e.clone();return globalRegistry.add(r,t[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e))),_ZodString=$constructor("_ZodString",((e,t)=>{$ZodString.init(e,t),ZodType.init(e,t);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...t)=>e.check(_regex(...t)),e.includes=(...t)=>e.check(_includes(...t)),e.startsWith=(...t)=>e.check(_startsWith(...t)),e.endsWith=(...t)=>e.check(_endsWith(...t)),e.min=(...t)=>e.check(_minLength(...t)),e.max=(...t)=>e.check(_maxLength(...t)),e.length=(...t)=>e.check(_length(...t)),e.nonempty=(...t)=>e.check(_minLength(1,...t)),e.lowercase=t=>e.check(_lowercase(t)),e.uppercase=t=>e.check(_uppercase(t)),e.trim=()=>e.check(_trim()),e.normalize=(...t)=>e.check(_normalize(...t)),e.toLowerCase=()=>e.check(_toLowerCase()),e.toUpperCase=()=>e.check(_toUpperCase())})),ZodString=$constructor("ZodString",((e,t)=>{$ZodString.init(e,t),_ZodString.init(e,t),e.email=t=>e.check(_email(ZodEmail,t)),e.url=t=>e.check(_url(ZodURL,t)),e.jwt=t=>e.check(_jwt(ZodJWT,t)),e.emoji=t=>e.check(_emoji(ZodEmoji,t)),e.guid=t=>e.check(_guid$1(ZodGUID,t)),e.uuid=t=>e.check(_uuid(ZodUUID,t)),e.uuidv4=t=>e.check(_uuidv4(ZodUUID,t)),e.uuidv6=t=>e.check(_uuidv6(ZodUUID,t)),e.uuidv7=t=>e.check(_uuidv7(ZodUUID,t)),e.nanoid=t=>e.check(_nanoid(ZodNanoID,t)),e.guid=t=>e.check(_guid$1(ZodGUID,t)),e.cuid=t=>e.check(_cuid(ZodCUID,t)),e.cuid2=t=>e.check(_cuid2(ZodCUID2,t)),e.ulid=t=>e.check(_ulid(ZodULID,t)),e.base64=t=>e.check(_base64(ZodBase64,t)),e.base64url=t=>e.check(_base64url(ZodBase64URL,t)),e.xid=t=>e.check(_xid(ZodXID,t)),e.ksuid=t=>e.check(_ksuid(ZodKSUID,t)),e.ipv4=t=>e.check(_ipv4(ZodIPv4,t)),e.ipv6=t=>e.check(_ipv6(ZodIPv6,t)),e.cidrv4=t=>e.check(_cidrv4(ZodCIDRv4,t)),e.cidrv6=t=>e.check(_cidrv6(ZodCIDRv6,t)),e.e164=t=>e.check(_e164(ZodE164,t)),e.datetime=t=>e.check(datetime(t)),e.date=t=>e.check(date(t)),e.time=t=>e.check(time(t)),e.duration=t=>e.check(duration$1(t))}));function string(e){return _string(ZodString,e)}const ZodStringFormat=$constructor("ZodStringFormat",((e,t)=>{$ZodStringFormat.init(e,t),_ZodString.init(e,t)})),ZodEmail=$constructor("ZodEmail",((e,t)=>{$ZodEmail.init(e,t),ZodStringFormat.init(e,t)})),ZodGUID=$constructor("ZodGUID",((e,t)=>{$ZodGUID.init(e,t),ZodStringFormat.init(e,t)})),ZodUUID=$constructor("ZodUUID",((e,t)=>{$ZodUUID.init(e,t),ZodStringFormat.init(e,t)})),ZodURL=$constructor("ZodURL",((e,t)=>{$ZodURL.init(e,t),ZodStringFormat.init(e,t)})),ZodEmoji=$constructor("ZodEmoji",((e,t)=>{$ZodEmoji.init(e,t),ZodStringFormat.init(e,t)})),ZodNanoID=$constructor("ZodNanoID",((e,t)=>{$ZodNanoID.init(e,t),ZodStringFormat.init(e,t)})),ZodCUID=$constructor("ZodCUID",((e,t)=>{$ZodCUID.init(e,t),ZodStringFormat.init(e,t)})),ZodCUID2=$constructor("ZodCUID2",((e,t)=>{$ZodCUID2.init(e,t),ZodStringFormat.init(e,t)})),ZodULID=$constructor("ZodULID",((e,t)=>{$ZodULID.init(e,t),ZodStringFormat.init(e,t)})),ZodXID=$constructor("ZodXID",((e,t)=>{$ZodXID.init(e,t),ZodStringFormat.init(e,t)})),ZodKSUID=$constructor("ZodKSUID",((e,t)=>{$ZodKSUID.init(e,t),ZodStringFormat.init(e,t)})),ZodIPv4=$constructor("ZodIPv4",((e,t)=>{$ZodIPv4.init(e,t),ZodStringFormat.init(e,t)})),ZodIPv6=$constructor("ZodIPv6",((e,t)=>{$ZodIPv6.init(e,t),ZodStringFormat.init(e,t)})),ZodCIDRv4=$constructor("ZodCIDRv4",((e,t)=>{$ZodCIDRv4.init(e,t),ZodStringFormat.init(e,t)})),ZodCIDRv6=$constructor("ZodCIDRv6",((e,t)=>{$ZodCIDRv6.init(e,t),ZodStringFormat.init(e,t)})),ZodBase64=$constructor("ZodBase64",((e,t)=>{$ZodBase64.init(e,t),ZodStringFormat.init(e,t)})),ZodBase64URL=$constructor("ZodBase64URL",((e,t)=>{$ZodBase64URL.init(e,t),ZodStringFormat.init(e,t)})),ZodE164=$constructor("ZodE164",((e,t)=>{$ZodE164.init(e,t),ZodStringFormat.init(e,t)})),ZodJWT=$constructor("ZodJWT",((e,t)=>{$ZodJWT.init(e,t),ZodStringFormat.init(e,t)})),ZodNumber=$constructor("ZodNumber",((e,t)=>{$ZodNumber.init(e,t),ZodType.init(e,t),e.gt=(t,r)=>e.check(_gt(t,r)),e.gte=(t,r)=>e.check(_gte(t,r)),e.min=(t,r)=>e.check(_gte(t,r)),e.lt=(t,r)=>e.check(_lt(t,r)),e.lte=(t,r)=>e.check(_lte(t,r)),e.max=(t,r)=>e.check(_lte(t,r)),e.int=t=>e.check(int(t)),e.safe=t=>e.check(int(t)),e.positive=t=>e.check(_gt(0,t)),e.nonnegative=t=>e.check(_gte(0,t)),e.negative=t=>e.check(_lt(0,t)),e.nonpositive=t=>e.check(_lte(0,t)),e.multipleOf=(t,r)=>e.check(_multipleOf(t,r)),e.step=(t,r)=>e.check(_multipleOf(t,r)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null}));function number(e){return _number(ZodNumber,e)}const ZodNumberFormat=$constructor("ZodNumberFormat",((e,t)=>{$ZodNumberFormat.init(e,t),ZodNumber.init(e,t)}));function int(e){return _int(ZodNumberFormat,e)}const ZodBoolean=$constructor("ZodBoolean",((e,t)=>{$ZodBoolean.init(e,t),ZodType.init(e,t)}));function boolean(e){return _boolean(ZodBoolean,e)}const ZodAny=$constructor("ZodAny",((e,t)=>{$ZodAny.init(e,t),ZodType.init(e,t)}));function any$1(){return _any(ZodAny)}const ZodUnknown=$constructor("ZodUnknown",((e,t)=>{$ZodUnknown.init(e,t),ZodType.init(e,t)}));function unknown(){return _unknown(ZodUnknown)}const ZodNever=$constructor("ZodNever",((e,t)=>{$ZodNever.init(e,t),ZodType.init(e,t)}));function never(e){return _never(ZodNever,e)}const ZodArray=$constructor("ZodArray",((e,t)=>{$ZodArray.init(e,t),ZodType.init(e,t),e.element=t.element,e.min=(t,r)=>e.check(_minLength(t,r)),e.nonempty=t=>e.check(_minLength(1,t)),e.max=(t,r)=>e.check(_maxLength(t,r)),e.length=(t,r)=>e.check(_length(t,r)),e.unwrap=()=>e.element}));function array(e,t){return _array(ZodArray,e,t)}const ZodObject=$constructor("ZodObject",((e,t)=>{$ZodObject.init(e,t),ZodType.init(e,t),defineLazy(e,"shape",(()=>t.shape)),e.keyof=()=>_enum(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:unknown()}),e.loose=()=>e.clone({...e._zod.def,catchall:unknown()}),e.strict=()=>e.clone({...e._zod.def,catchall:never()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>extend$1(e,t),e.merge=t=>merge$1(e,t),e.pick=t=>pick(e,t),e.omit=t=>omit$1(e,t),e.partial=(...t)=>partial(ZodOptional,e,t[0]),e.required=(...t)=>required(ZodNonOptional,e,t[0])}));function object(e,t){const r={type:"object",get shape(){return assignProp(this,"shape",{...e}),this.shape},...normalizeParams(t)};return new ZodObject(r)}const ZodUnion=$constructor("ZodUnion",((e,t)=>{$ZodUnion.init(e,t),ZodType.init(e,t),e.options=t.options}));function union$1(e,t){return new ZodUnion({type:"union",options:e,...normalizeParams(t)})}const ZodIntersection=$constructor("ZodIntersection",((e,t)=>{$ZodIntersection.init(e,t),ZodType.init(e,t)}));function intersection(e,t){return new ZodIntersection({type:"intersection",left:e,right:t})}const ZodRecord=$constructor("ZodRecord",((e,t)=>{$ZodRecord.init(e,t),ZodType.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType}));function record(e,t,r){return new ZodRecord({type:"record",keyType:e,valueType:t,...normalizeParams(r)})}const ZodEnum=$constructor("ZodEnum",((e,t)=>{$ZodEnum.init(e,t),ZodType.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(e,n)=>{const i={};for(const a of e){if(!r.has(a))throw new Error(`Key ${a} not found in enum`);i[a]=t.entries[a]}return new ZodEnum({...t,checks:[],...normalizeParams(n),entries:i})},e.exclude=(e,n)=>{const i={...t.entries};for(const t of e){if(!r.has(t))throw new Error(`Key ${t} not found in enum`);delete i[t]}return new ZodEnum({...t,checks:[],...normalizeParams(n),entries:i})}}));function _enum(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e;return new ZodEnum({type:"enum",entries:r,...normalizeParams(t)})}const ZodTransform=$constructor("ZodTransform",((e,t)=>{$ZodTransform.init(e,t),ZodType.init(e,t),e._zod.parse=(r,n)=>{r.addIssue=n=>{if("string"==typeof n)r.issues.push(issue(n,r.value,t));else{const t=n;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=r.value),t.inst??(t.inst=e),t.continue??(t.continue=!0),r.issues.push(issue(t))}};const i=t.transform(r.value,r);return i instanceof Promise?i.then((e=>(r.value=e,r))):(r.value=i,r)}}));function transform$1(e){return new ZodTransform({type:"transform",transform:e})}const ZodOptional=$constructor("ZodOptional",((e,t)=>{$ZodOptional.init(e,t),ZodType.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function optional(e){return new ZodOptional({type:"optional",innerType:e})}const ZodNullable=$constructor("ZodNullable",((e,t)=>{$ZodNullable.init(e,t),ZodType.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function nullable(e){return new ZodNullable({type:"nullable",innerType:e})}const ZodDefault=$constructor("ZodDefault",((e,t)=>{$ZodDefault.init(e,t),ZodType.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}));function _default(e,t){return new ZodDefault({type:"default",innerType:e,get defaultValue(){return"function"==typeof t?t():t}})}const ZodPrefault=$constructor("ZodPrefault",((e,t)=>{$ZodPrefault.init(e,t),ZodType.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function prefault(e,t){return new ZodPrefault({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof t?t():t}})}const ZodNonOptional=$constructor("ZodNonOptional",((e,t)=>{$ZodNonOptional.init(e,t),ZodType.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function nonoptional(e,t){return new ZodNonOptional({type:"nonoptional",innerType:e,...normalizeParams(t)})}const ZodCatch=$constructor("ZodCatch",((e,t)=>{$ZodCatch.init(e,t),ZodType.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}));function _catch(e,t){return new ZodCatch({type:"catch",innerType:e,catchValue:"function"==typeof t?t:()=>t})}const ZodPipe=$constructor("ZodPipe",((e,t)=>{$ZodPipe.init(e,t),ZodType.init(e,t),e.in=t.in,e.out=t.out}));function pipe(e,t){return new ZodPipe({type:"pipe",in:e,out:t})}const ZodReadonly=$constructor("ZodReadonly",((e,t)=>{$ZodReadonly.init(e,t),ZodType.init(e,t)}));function readonly(e){return new ZodReadonly({type:"readonly",innerType:e})}const ZodCustom=$constructor("ZodCustom",((e,t)=>{$ZodCustom.init(e,t),ZodType.init(e,t)}));function check(e,t){const r=new $ZodCheck({check:"custom",...normalizeParams(t)});return r._zod.check=e,r}function refine(e,t={}){return _refine(ZodCustom,e,t)}function superRefine(e,t){const r=check((t=>(t.addIssue=e=>{if("string"==typeof e)t.issues.push(issue(e,t.value,r._zod.def));else{const n=e;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=t.value),n.inst??(n.inst=r),n.continue??(n.continue=!r._zod.def.abort),t.issues.push(issue(n))}},e(t.value,t))),t);return r}function preprocess(e,t){return pipe(transform$1(e),t)}const ZodIssueCode={custom:"custom"};var lodash$1={exports:{}},lodash=lodash$1.exports,hasRequiredLodash; /** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */function requireLodash(){return hasRequiredLodash||(hasRequiredLodash=1,e=lodash$1,t=lodash$1.exports,function(){var r,n="Expected a function",i="__lodash_hash_undefined__",a="__lodash_placeholder__",s=32,o=128,l=256,u=1/0,c=9007199254740991,d=NaN,h=4294967295,p=[["ary",o],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",s],["partialRight",64],["rearg",l]],f="[object Arguments]",m="[object Array]",g="[object Boolean]",y="[object Date]",v="[object Error]",_="[object Function]",b="[object GeneratorFunction]",T="[object Map]",S="[object Number]",E="[object Object]",w="[object Promise]",A="[object RegExp]",C="[object Set]",k="[object String]",P="[object Symbol]",x="[object WeakMap]",I="[object ArrayBuffer]",R="[object DataView]",D="[object Float32Array]",M="[object Float64Array]",L="[object Int8Array]",O="[object Int16Array]",N="[object Int32Array]",F="[object Uint8Array]",B="[object Uint8ClampedArray]",$="[object Uint16Array]",U="[object Uint32Array]",j=/\b__p \+= '';/g,q=/\b(__p \+=) '' \+/g,V=/(__e\(.*?\)|\b__t\)) \+\n'';/g,z=/&(?:amp|lt|gt|quot|#39);/g,H=/[&<>"']/g,G=RegExp(z.source),W=RegExp(H.source),Z=/<%-([\s\S]+?)%>/g,K=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,Y=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,J=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ee=/[\\^$.*+?()[\]{}|]/g,te=RegExp(ee.source),re=/^\s+/,ne=/\s/,ie=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ae=/\{\n\/\* \[wrapped with (.+)\] \*/,se=/,? & /,oe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,le=/[()=,{}\[\]\/\s]/,ue=/\\(\\)?/g,ce=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,de=/\w*$/,he=/^[-+]0x[0-9a-f]+$/i,pe=/^0b[01]+$/i,fe=/^\[object .+?Constructor\]$/,me=/^0o[0-7]+$/i,ge=/^(?:0|[1-9]\d*)$/,ye=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ve=/($^)/,_e=/['\n\r\u2028\u2029\\]/g,be="\\ud800-\\udfff",Te="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Se="\\u2700-\\u27bf",Ee="a-z\\xdf-\\xf6\\xf8-\\xff",we="A-Z\\xc0-\\xd6\\xd8-\\xde",Ae="\\ufe0e\\ufe0f",Ce="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ke="['’]",Pe="["+be+"]",xe="["+Ce+"]",Ie="["+Te+"]",Re="\\d+",De="["+Se+"]",Me="["+Ee+"]",Le="[^"+be+Ce+Re+Se+Ee+we+"]",Oe="\\ud83c[\\udffb-\\udfff]",Ne="[^"+be+"]",Fe="(?:\\ud83c[\\udde6-\\uddff]){2}",Be="[\\ud800-\\udbff][\\udc00-\\udfff]",$e="["+we+"]",Ue="\\u200d",je="(?:"+Me+"|"+Le+")",qe="(?:"+$e+"|"+Le+")",Ve="(?:['’](?:d|ll|m|re|s|t|ve))?",ze="(?:['’](?:D|LL|M|RE|S|T|VE))?",He="(?:"+Ie+"|"+Oe+")?",Ge="["+Ae+"]?",We=Ge+He+"(?:"+Ue+"(?:"+[Ne,Fe,Be].join("|")+")"+Ge+He+")*",Ze="(?:"+[De,Fe,Be].join("|")+")"+We,Ke="(?:"+[Ne+Ie+"?",Ie,Fe,Be,Pe].join("|")+")",Xe=RegExp(ke,"g"),Ye=RegExp(Ie,"g"),Qe=RegExp(Oe+"(?="+Oe+")|"+Ke+We,"g"),Je=RegExp([$e+"?"+Me+"+"+Ve+"(?="+[xe,$e,"$"].join("|")+")",qe+"+"+ze+"(?="+[xe,$e+je,"$"].join("|")+")",$e+"?"+je+"+"+Ve,$e+"+"+ze,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Re,Ze].join("|"),"g"),et=RegExp("["+Ue+be+Te+Ae+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],nt=-1,it={};it[D]=it[M]=it[L]=it[O]=it[N]=it[F]=it[B]=it[$]=it[U]=!0,it[f]=it[m]=it[I]=it[g]=it[R]=it[y]=it[v]=it[_]=it[T]=it[S]=it[E]=it[A]=it[C]=it[k]=it[x]=!1;var at={};at[f]=at[m]=at[I]=at[R]=at[g]=at[y]=at[D]=at[M]=at[L]=at[O]=at[N]=at[T]=at[S]=at[E]=at[A]=at[C]=at[k]=at[P]=at[F]=at[B]=at[$]=at[U]=!0,at[v]=at[_]=at[x]=!1;var st={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ot=parseFloat,lt=parseInt,ut="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,ct="object"==typeof self&&self&&self.Object===Object&&self,dt=ut||ct||Function("return this")(),ht=t&&!t.nodeType&&t,pt=ht&&e&&!e.nodeType&&e,ft=pt&&pt.exports===ht,mt=ft&&ut.process,gt=function(){try{var e=pt&&pt.require&&pt.require("util").types;return e||mt&&mt.binding&&mt.binding("util")}catch(e2){}}(),yt=gt&>.isArrayBuffer,vt=gt&>.isDate,_t=gt&>.isMap,bt=gt&>.isRegExp,Tt=gt&>.isSet,St=gt&>.isTypedArray;function Et(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function wt(e,t,r,n){for(var i=-1,a=null==e?0:e.length;++i-1}function It(e,t,r){for(var n=-1,i=null==e?0:e.length;++n-1;);return r}function Jt(e,t){for(var r=e.length;r--&&$t(t,e[r],0)>-1;);return r}var er=zt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),tr=zt({"&":"&","<":"<",">":">",'"':""","'":"'"});function rr(e){return"\\"+st[e]}function nr(e){return et.test(e)}function ir(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function ar(e,t){return function(r){return e(t(r))}}function sr(e,t){for(var r=-1,n=e.length,i=0,s=[];++r",""":'"',"'":"'"}),hr=function e(t){var ne=(t=null==t?dt:hr.defaults(dt.Object(),t,hr.pick(dt,rt))).Array,be=t.Date,Te=t.Error,Se=t.Function,Ee=t.Math,we=t.Object,Ae=t.RegExp,Ce=t.String,ke=t.TypeError,Pe=ne.prototype,xe=Se.prototype,Ie=we.prototype,Re=t["__core-js_shared__"],De=xe.toString,Me=Ie.hasOwnProperty,Le=0,Oe=function(){var e=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ne=Ie.toString,Fe=De.call(we),Be=dt._,$e=Ae("^"+De.call(Me).replace(ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ue=ft?t.Buffer:r,je=t.Symbol,qe=t.Uint8Array,Ve=Ue?Ue.allocUnsafe:r,ze=ar(we.getPrototypeOf,we),He=we.create,Ge=Ie.propertyIsEnumerable,We=Pe.splice,Ze=je?je.isConcatSpreadable:r,Ke=je?je.iterator:r,Qe=je?je.toStringTag:r,et=function(){try{var e=la(we,"defineProperty");return e({},"",{}),e}catch(e2){}}(),st=t.clearTimeout!==dt.clearTimeout&&t.clearTimeout,ut=be&&be.now!==dt.Date.now&&be.now,ct=t.setTimeout!==dt.setTimeout&&t.setTimeout,ht=Ee.ceil,pt=Ee.floor,mt=we.getOwnPropertySymbols,gt=Ue?Ue.isBuffer:r,Nt=t.isFinite,zt=Pe.join,pr=ar(we.keys,we),fr=Ee.max,mr=Ee.min,gr=be.now,yr=t.parseInt,vr=Ee.random,_r=Pe.reverse,br=la(t,"DataView"),Tr=la(t,"Map"),Sr=la(t,"Promise"),Er=la(t,"Set"),wr=la(t,"WeakMap"),Ar=la(we,"create"),Cr=wr&&new wr,kr={},Pr=Fa(br),xr=Fa(Tr),Ir=Fa(Sr),Rr=Fa(Er),Dr=Fa(wr),Mr=je?je.prototype:r,Lr=Mr?Mr.valueOf:r,Or=Mr?Mr.toString:r;function Nr(e){if(eo(e)&&!Vs(e)&&!(e instanceof Ur)){if(e instanceof $r)return e;if(Me.call(e,"__wrapped__"))return Ba(e)}return new $r(e)}var Fr=function(){function e(){}return function(t){if(!Js(t))return{};if(He)return He(t);e.prototype=t;var n=new e;return e.prototype=r,n}}();function Br(){}function $r(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function Ur(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=h,this.__views__=[]}function jr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function an(e,t,n,i,a,s){var o,l=1&t,u=2&t,c=4&t;if(n&&(o=a?n(e,i,a,s):n(e)),o!==r)return o;if(!Js(e))return e;var d=Vs(e);if(d){if(o=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&Me.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!l)return Ci(e,o)}else{var h=da(e),p=h==_||h==b;if(Ws(e))return bi(e,l);if(h==E||h==f||p&&!a){if(o=u||p?{}:pa(e),!l)return u?function(e,t){return ki(e,ca(e),t)}(e,function(e,t){return e&&ki(t,Do(t),e)}(o,e)):function(e,t){return ki(e,ua(e),t)}(e,en(o,e))}else{if(!at[h])return a?e:{};o=function(e,t,r){var n,i=e.constructor;switch(t){case I:return Ti(e);case g:case y:return new i(+e);case R:return function(e,t){var r=t?Ti(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case D:case M:case L:case O:case N:case F:case B:case $:case U:return Si(e,r);case T:return new i;case S:case k:return new i(e);case A:return function(e){var t=new e.constructor(e.source,de.exec(e));return t.lastIndex=e.lastIndex,t}(e);case C:return new i;case P:return n=e,Lr?we(Lr.call(n)):{}}}(e,h,l)}}s||(s=new Hr);var m=s.get(e);if(m)return m;s.set(e,o),ao(e)?e.forEach((function(r){o.add(an(r,t,n,r,e,s))})):to(e)&&e.forEach((function(r,i){o.set(i,an(r,t,n,i,e,s))}));var v=d?r:(c?u?ta:ea:u?Do:Ro)(e);return At(v||e,(function(r,i){v&&(r=e[i=r]),Yr(o,i,an(r,t,n,i,e,s))})),o}function sn(e,t,n){var i=n.length;if(null==e)return!i;for(e=we(e);i--;){var a=n[i],s=t[a],o=e[a];if(o===r&&!(a in e)||!s(o))return!1}return!0}function on(e,t,i){if("function"!=typeof e)throw new ke(n);return ka((function(){e.apply(r,i)}),t)}function ln(e,t,r,n){var i=-1,a=xt,s=!0,o=e.length,l=[],u=t.length;if(!o)return l;r&&(t=Rt(t,Kt(r))),n?(a=It,s=!1):t.length>=200&&(a=Yt,s=!1,t=new zr(t));e:for(;++i-1},qr.prototype.set=function(e,t){var r=this.__data__,n=Qr(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Vr.prototype.clear=function(){this.size=0,this.__data__={hash:new jr,map:new(Tr||qr),string:new jr}},Vr.prototype.delete=function(e){var t=sa(this,e).delete(e);return this.size-=t?1:0,t},Vr.prototype.get=function(e){return sa(this,e).get(e)},Vr.prototype.has=function(e){return sa(this,e).has(e)},Vr.prototype.set=function(e,t){var r=sa(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},zr.prototype.add=zr.prototype.push=function(e){return this.__data__.set(e,i),this},zr.prototype.has=function(e){return this.__data__.has(e)},Hr.prototype.clear=function(){this.__data__=new qr,this.size=0},Hr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Hr.prototype.get=function(e){return this.__data__.get(e)},Hr.prototype.has=function(e){return this.__data__.has(e)},Hr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof qr){var n=r.__data__;if(!Tr||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Vr(n)}return r.set(e,t),this.size=r.size,this};var un=Ii(yn),cn=Ii(vn,!0);function dn(e,t){var r=!0;return un(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function hn(e,t,n){for(var i=-1,a=e.length;++i0&&r(o)?t>1?fn(o,t-1,r,n,i):Dt(i,o):n||(i[i.length]=o)}return i}var mn=Ri(),gn=Ri(!0);function yn(e,t){return e&&mn(e,t,Ro)}function vn(e,t){return e&&gn(e,t,Ro)}function _n(e,t){return Pt(t,(function(t){return Xs(e[t])}))}function bn(e,t){for(var n=0,i=(t=gi(t,e)).length;null!=e&&nt}function wn(e,t){return null!=e&&Me.call(e,t)}function An(e,t){return null!=e&&t in we(e)}function Cn(e,t,n){for(var i=n?It:xt,a=e[0].length,s=e.length,o=s,l=ne(s),u=1/0,c=[];o--;){var d=e[o];o&&t&&(d=Rt(d,Kt(t))),u=mr(d.length,u),l[o]=!n&&(t||a>=120&&d.length>=120)?new zr(o&&d):r}d=e[0];var h=-1,p=l[0];e:for(;++h=o?l:l*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}))}function qn(e,t,r){for(var n=-1,i=t.length,a={};++n-1;)o!==e&&We.call(o,l,1),We.call(e,l,1);return e}function zn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==a){var a=i;ma(i)?We.call(e,i,1):li(e,i)}}return e}function Hn(e,t){return e+pt(vr()*(t-e+1))}function Gn(e,t){var r="";if(!e||t<1||t>c)return r;do{t%2&&(r+=e),(t=pt(t/2))&&(e+=e)}while(t);return r}function Wn(e,t){return Pa(Ea(e,t,nl),e+"")}function Zn(e){return Wr(Uo(e))}function Kn(e,t){var r=Uo(e);return Ra(r,nn(t,0,r.length))}function Xn(e,t,n,i){if(!Js(e))return e;for(var a=-1,s=(t=gi(t,e)).length,o=s-1,l=e;null!=l&&++ai?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=ne(i);++n>>1,s=e[a];null!==s&&!oo(s)&&(r?s<=t:s=200){var u=t?null:Gi(e);if(u)return or(u);s=!1,i=Yt,l=new zr}else l=t?[]:o;e:for(;++n=i?e:ei(e,t,n)}var _i=st||function(e){return dt.clearTimeout(e)};function bi(e,t){if(t)return e.slice();var r=e.length,n=Ve?Ve(r):new e.constructor(r);return e.copy(n),n}function Ti(e){var t=new e.constructor(e.byteLength);return new qe(t).set(new qe(e)),t}function Si(e,t){var r=t?Ti(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Ei(e,t){if(e!==t){var n=e!==r,i=null===e,a=e==e,s=oo(e),o=t!==r,l=null===t,u=t==t,c=oo(t);if(!l&&!c&&!s&&e>t||s&&o&&u&&!l&&!c||i&&o&&u||!n&&u||!a)return 1;if(!i&&!s&&!c&&e1?n[a-1]:r,o=a>2?n[2]:r;for(s=e.length>3&&"function"==typeof s?(a--,s):r,o&&ga(n[0],n[1],o)&&(s=a<3?r:s,a=1),t=we(t);++i-1?a[s?t[o]:o]:r}}function Ni(e){return Ji((function(t){var i=t.length,a=i,s=$r.prototype.thru;for(e&&t.reverse();a--;){var o=t[a];if("function"!=typeof o)throw new ke(n);if(s&&!l&&"wrapper"==na(o))var l=new $r([],!0)}for(a=l?a:i;++a1&&_.reverse(),h&&cl))return!1;var c=s.get(e),d=s.get(t);if(c&&d)return c==t&&d==e;var h=-1,p=!0,f=2&n?new zr:r;for(s.set(e,t),s.set(t,e);++h-1&&e%1==0&&e1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(ie,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return At(p,(function(r){var n="_."+r[0];t&r[1]&&!xt(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(ae);return t?t[1].split(se):[]}(n),r)))}function Ia(e){var t=0,n=0;return function(){var i=gr(),a=16-(i-n);if(n=i,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function Ra(e,t){var n=-1,i=e.length,a=i-1;for(t=t===r?i:t;++n1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,is(e,n)}));function ds(e){var t=Nr(e);return t.__chain__=!0,t}function hs(e,t){return t(e)}var ps=Ji((function(e){var t=e.length,n=t?e[0]:0,i=this.__wrapped__,a=function(t){return rn(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Ur&&ma(n)?((i=i.slice(n,+n+(t?1:0))).__actions__.push({func:hs,args:[a],thisArg:r}),new $r(i,this.__chain__).thru((function(e){return t&&!e.length&&e.push(r),e}))):this.thru(a)})),fs=Pi((function(e,t,r){Me.call(e,r)?++e[r]:tn(e,r,1)})),ms=Oi(qa),gs=Oi(Va);function ys(e,t){return(Vs(e)?At:un)(e,aa(t,3))}function vs(e,t){return(Vs(e)?Ct:cn)(e,aa(t,3))}var _s=Pi((function(e,t,r){Me.call(e,r)?e[r].push(t):tn(e,r,[t])})),bs=Wn((function(e,t,r){var n=-1,i="function"==typeof t,a=Hs(e)?ne(e.length):[];return un(e,(function(e){a[++n]=i?Et(t,e,r):kn(e,t,r)})),a})),Ts=Pi((function(e,t,r){tn(e,r,t)}));function Ss(e,t){return(Vs(e)?Rt:Nn)(e,aa(t,3))}var Es=Pi((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]})),ws=Wn((function(e,t){if(null==e)return[];var r=t.length;return r>1&&ga(e,t[0],t[1])?t=[]:r>2&&ga(t[0],t[1],t[2])&&(t=[t[0]]),jn(e,fn(t,1),[])})),As=ut||function(){return dt.Date.now()};function Cs(e,t,n){return t=n?r:t,t=e&&null==t?e.length:t,Zi(e,o,r,r,r,r,t)}function ks(e,t){var i;if("function"!=typeof t)throw new ke(n);return e=fo(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=r),i}}var Ps=Wn((function(e,t,r){var n=1;if(r.length){var i=sr(r,ia(Ps));n|=s}return Zi(e,n,t,r,i)})),xs=Wn((function(e,t,r){var n=3;if(r.length){var i=sr(r,ia(xs));n|=s}return Zi(t,n,e,r,i)}));function Is(e,t,i){var a,s,o,l,u,c,d=0,h=!1,p=!1,f=!0;if("function"!=typeof e)throw new ke(n);function m(t){var n=a,i=s;return a=s=r,d=t,l=e.apply(i,n)}function g(e){var n=e-c;return c===r||n>=t||n<0||p&&e-d>=o}function y(){var e=As();if(g(e))return v(e);u=ka(y,function(e){var r=t-(e-c);return p?mr(r,o-(e-d)):r}(e))}function v(e){return u=r,f&&a?m(e):(a=s=r,l)}function _(){var e=As(),n=g(e);if(a=arguments,s=this,c=e,n){if(u===r)return function(e){return d=e,u=ka(y,t),h?m(e):l}(c);if(p)return _i(u),u=ka(y,t),m(c)}return u===r&&(u=ka(y,t)),l}return t=go(t)||0,Js(i)&&(h=!!i.leading,o=(p="maxWait"in i)?fr(go(i.maxWait)||0,t):o,f="trailing"in i?!!i.trailing:f),_.cancel=function(){u!==r&&_i(u),d=0,a=c=s=u=r},_.flush=function(){return u===r?l:v(As())},_}var Rs=Wn((function(e,t){return on(e,1,t)})),Ds=Wn((function(e,t,r){return on(e,go(t)||0,r)}));function Ms(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new ke(n);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var s=e.apply(this,n);return r.cache=a.set(i,s)||a,s};return r.cache=new(Ms.Cache||Vr),r}function Ls(e){if("function"!=typeof e)throw new ke(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ms.Cache=Vr;var Os=yi((function(e,t){var r=(t=1==t.length&&Vs(t[0])?Rt(t[0],Kt(aa())):Rt(fn(t,1),Kt(aa()))).length;return Wn((function(n){for(var i=-1,a=mr(n.length,r);++i=t})),qs=Pn(function(){return arguments}())?Pn:function(e){return eo(e)&&Me.call(e,"callee")&&!Ge.call(e,"callee")},Vs=ne.isArray,zs=yt?Kt(yt):function(e){return eo(e)&&Sn(e)==I};function Hs(e){return null!=e&&Qs(e.length)&&!Xs(e)}function Gs(e){return eo(e)&&Hs(e)}var Ws=gt||gl,Zs=vt?Kt(vt):function(e){return eo(e)&&Sn(e)==y};function Ks(e){if(!eo(e))return!1;var t=Sn(e);return t==v||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!no(e)}function Xs(e){if(!Js(e))return!1;var t=Sn(e);return t==_||t==b||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ys(e){return"number"==typeof e&&e==fo(e)}function Qs(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=c}function Js(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function eo(e){return null!=e&&"object"==typeof e}var to=_t?Kt(_t):function(e){return eo(e)&&da(e)==T};function ro(e){return"number"==typeof e||eo(e)&&Sn(e)==S}function no(e){if(!eo(e)||Sn(e)!=E)return!1;var t=ze(e);if(null===t)return!0;var r=Me.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&De.call(r)==Fe}var io=bt?Kt(bt):function(e){return eo(e)&&Sn(e)==A},ao=Tt?Kt(Tt):function(e){return eo(e)&&da(e)==C};function so(e){return"string"==typeof e||!Vs(e)&&eo(e)&&Sn(e)==k}function oo(e){return"symbol"==typeof e||eo(e)&&Sn(e)==P}var lo=St?Kt(St):function(e){return eo(e)&&Qs(e.length)&&!!it[Sn(e)]},uo=Vi(On),co=Vi((function(e,t){return e<=t}));function ho(e){if(!e)return[];if(Hs(e))return so(e)?ur(e):Ci(e);if(Ke&&e[Ke])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Ke]());var t=da(e);return(t==T?ir:t==C?or:Uo)(e)}function po(e){return e?(e=go(e))===u||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function fo(e){var t=po(e),r=t%1;return t==t?r?t-r:t:0}function mo(e){return e?nn(fo(e),0,h):0}function go(e){if("number"==typeof e)return e;if(oo(e))return d;if(Js(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Js(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Zt(e);var r=pe.test(e);return r||me.test(e)?lt(e.slice(2),r?2:8):he.test(e)?d:+e}function yo(e){return ki(e,Do(e))}function vo(e){return null==e?"":si(e)}var _o=xi((function(e,t){if(ba(t)||Hs(t))ki(t,Ro(t),e);else for(var r in t)Me.call(t,r)&&Yr(e,r,t[r])})),bo=xi((function(e,t){ki(t,Do(t),e)})),To=xi((function(e,t,r,n){ki(t,Do(t),e,n)})),So=xi((function(e,t,r,n){ki(t,Ro(t),e,n)})),Eo=Ji(rn),wo=Wn((function(e,t){e=we(e);var n=-1,i=t.length,a=i>2?t[2]:r;for(a&&ga(t[0],t[1],a)&&(i=1);++n1),t})),ki(e,ta(e),r),n&&(r=an(r,7,Yi));for(var i=t.length;i--;)li(r,t[i]);return r})),No=Ji((function(e,t){return null==e?{}:function(e,t){return qn(e,t,(function(t,r){return ko(e,r)}))}(e,t)}));function Fo(e,t){if(null==e)return{};var r=Rt(ta(e),(function(e){return[e]}));return t=aa(t),qn(e,r,(function(e,r){return t(e,r[0])}))}var Bo=Wi(Ro),$o=Wi(Do);function Uo(e){return null==e?[]:Xt(e,Ro(e))}var jo=Mi((function(e,t,r){return t=t.toLowerCase(),e+(r?qo(t):t)}));function qo(e){return Xo(vo(e).toLowerCase())}function Vo(e){return(e=vo(e))&&e.replace(ye,er).replace(Ye,"")}var zo=Mi((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),Ho=Mi((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Go=Di("toLowerCase"),Wo=Mi((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()})),Zo=Mi((function(e,t,r){return e+(r?" ":"")+Xo(t)})),Ko=Mi((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Xo=Di("toUpperCase");function Yo(e,t,n){return e=vo(e),(t=n?r:t)===r?function(e){return tt.test(e)}(e)?function(e){return e.match(Je)||[]}(e):function(e){return e.match(oe)||[]}(e):e.match(t)||[]}var Qo=Wn((function(e,t){try{return Et(e,r,t)}catch(e2){return Ks(e2)?e2:new Te(e2)}})),Jo=Ji((function(e,t){return At(t,(function(t){t=Na(t),tn(e,t,Ps(e[t],e))})),e}));function el(e){return function(){return e}}var tl=Ni(),rl=Ni(!0);function nl(e){return e}function il(e){return Dn("function"==typeof e?e:an(e,1))}var al=Wn((function(e,t){return function(r){return kn(r,e,t)}})),sl=Wn((function(e,t){return function(r){return kn(e,r,t)}}));function ol(e,t,r){var n=Ro(t),i=_n(t,n);null!=r||Js(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=_n(t,Ro(t)));var a=!(Js(r)&&"chain"in r&&!r.chain),s=Xs(e);return At(i,(function(r){var n=t[r];e[r]=n,s&&(e.prototype[r]=function(){var t=this.__chain__;if(a||t){var r=e(this.__wrapped__);return(r.__actions__=Ci(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,Dt([this.value()],arguments))})})),e}function ll(){}var ul=Ui(Rt),cl=Ui(kt),dl=Ui(Ot);function hl(e){return ya(e)?Vt(Na(e)):function(e){return function(t){return bn(t,e)}}(e)}var pl=qi(),fl=qi(!0);function ml(){return[]}function gl(){return!1}var yl,vl=$i((function(e,t){return e+t}),0),_l=Hi("ceil"),bl=$i((function(e,t){return e/t}),1),Tl=Hi("floor"),Sl=$i((function(e,t){return e*t}),1),El=Hi("round"),wl=$i((function(e,t){return e-t}),0);return Nr.after=function(e,t){if("function"!=typeof t)throw new ke(n);return e=fo(e),function(){if(--e<1)return t.apply(this,arguments)}},Nr.ary=Cs,Nr.assign=_o,Nr.assignIn=bo,Nr.assignInWith=To,Nr.assignWith=So,Nr.at=Eo,Nr.before=ks,Nr.bind=Ps,Nr.bindAll=Jo,Nr.bindKey=xs,Nr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Vs(e)?e:[e]},Nr.chain=ds,Nr.chunk=function(e,t,n){t=(n?ga(e,t,n):t===r)?1:fr(fo(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var a=0,s=0,o=ne(ht(i/t));aa?0:a+n),(i=i===r||i>a?a:fo(i))<0&&(i+=a),i=n>i?0:mo(i);n>>0)?(e=vo(e))&&("string"==typeof t||null!=t&&!io(t))&&!(t=si(t))&&nr(e)?vi(ur(e),0,n):e.split(t,n):[]},Nr.spread=function(e,t){if("function"!=typeof e)throw new ke(n);return t=null==t?0:fr(fo(t),0),Wn((function(r){var n=r[t],i=vi(r,0,t);return n&&Dt(i,n),Et(e,this,i)}))},Nr.tail=function(e){var t=null==e?0:e.length;return t?ei(e,1,t):[]},Nr.take=function(e,t,n){return e&&e.length?ei(e,0,(t=n||t===r?1:fo(t))<0?0:t):[]},Nr.takeRight=function(e,t,n){var i=null==e?0:e.length;return i?ei(e,(t=i-(t=n||t===r?1:fo(t)))<0?0:t,i):[]},Nr.takeRightWhile=function(e,t){return e&&e.length?ci(e,aa(t,3),!1,!0):[]},Nr.takeWhile=function(e,t){return e&&e.length?ci(e,aa(t,3)):[]},Nr.tap=function(e,t){return t(e),e},Nr.throttle=function(e,t,r){var i=!0,a=!0;if("function"!=typeof e)throw new ke(n);return Js(r)&&(i="leading"in r?!!r.leading:i,a="trailing"in r?!!r.trailing:a),Is(e,t,{leading:i,maxWait:t,trailing:a})},Nr.thru=hs,Nr.toArray=ho,Nr.toPairs=Bo,Nr.toPairsIn=$o,Nr.toPath=function(e){return Vs(e)?Rt(e,Na):oo(e)?[e]:Ci(Oa(vo(e)))},Nr.toPlainObject=yo,Nr.transform=function(e,t,r){var n=Vs(e),i=n||Ws(e)||lo(e);if(t=aa(t,4),null==r){var a=e&&e.constructor;r=i?n?new a:[]:Js(e)&&Xs(a)?Fr(ze(e)):{}}return(i?At:yn)(e,(function(e,n,i){return t(r,e,n,i)})),r},Nr.unary=function(e){return Cs(e,1)},Nr.union=es,Nr.unionBy=ts,Nr.unionWith=rs,Nr.uniq=function(e){return e&&e.length?oi(e):[]},Nr.uniqBy=function(e,t){return e&&e.length?oi(e,aa(t,2)):[]},Nr.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?oi(e,r,t):[]},Nr.unset=function(e,t){return null==e||li(e,t)},Nr.unzip=ns,Nr.unzipWith=is,Nr.update=function(e,t,r){return null==e?e:ui(e,t,mi(r))},Nr.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:ui(e,t,mi(n),i)},Nr.values=Uo,Nr.valuesIn=function(e){return null==e?[]:Xt(e,Do(e))},Nr.without=as,Nr.words=Yo,Nr.wrap=function(e,t){return Ns(mi(t),e)},Nr.xor=ss,Nr.xorBy=os,Nr.xorWith=ls,Nr.zip=us,Nr.zipObject=function(e,t){return pi(e||[],t||[],Yr)},Nr.zipObjectDeep=function(e,t){return pi(e||[],t||[],Xn)},Nr.zipWith=cs,Nr.entries=Bo,Nr.entriesIn=$o,Nr.extend=bo,Nr.extendWith=To,ol(Nr,Nr),Nr.add=vl,Nr.attempt=Qo,Nr.camelCase=jo,Nr.capitalize=qo,Nr.ceil=_l,Nr.clamp=function(e,t,n){return n===r&&(n=t,t=r),n!==r&&(n=(n=go(n))==n?n:0),t!==r&&(t=(t=go(t))==t?t:0),nn(go(e),t,n)},Nr.clone=function(e){return an(e,4)},Nr.cloneDeep=function(e){return an(e,5)},Nr.cloneDeepWith=function(e,t){return an(e,5,t="function"==typeof t?t:r)},Nr.cloneWith=function(e,t){return an(e,4,t="function"==typeof t?t:r)},Nr.conformsTo=function(e,t){return null==t||sn(e,t,Ro(t))},Nr.deburr=Vo,Nr.defaultTo=function(e,t){return null==e||e!=e?t:e},Nr.divide=bl,Nr.endsWith=function(e,t,n){e=vo(e),t=si(t);var i=e.length,a=n=n===r?i:nn(fo(n),0,i);return(n-=t.length)>=0&&e.slice(n,a)==t},Nr.eq=$s,Nr.escape=function(e){return(e=vo(e))&&W.test(e)?e.replace(H,tr):e},Nr.escapeRegExp=function(e){return(e=vo(e))&&te.test(e)?e.replace(ee,"\\$&"):e},Nr.every=function(e,t,n){var i=Vs(e)?kt:dn;return n&&ga(e,t,n)&&(t=r),i(e,aa(t,3))},Nr.find=ms,Nr.findIndex=qa,Nr.findKey=function(e,t){return Ft(e,aa(t,3),yn)},Nr.findLast=gs,Nr.findLastIndex=Va,Nr.findLastKey=function(e,t){return Ft(e,aa(t,3),vn)},Nr.floor=Tl,Nr.forEach=ys,Nr.forEachRight=vs,Nr.forIn=function(e,t){return null==e?e:mn(e,aa(t,3),Do)},Nr.forInRight=function(e,t){return null==e?e:gn(e,aa(t,3),Do)},Nr.forOwn=function(e,t){return e&&yn(e,aa(t,3))},Nr.forOwnRight=function(e,t){return e&&vn(e,aa(t,3))},Nr.get=Co,Nr.gt=Us,Nr.gte=js,Nr.has=function(e,t){return null!=e&&ha(e,t,wn)},Nr.hasIn=ko,Nr.head=Ha,Nr.identity=nl,Nr.includes=function(e,t,r,n){e=Hs(e)?e:Uo(e),r=r&&!n?fo(r):0;var i=e.length;return r<0&&(r=fr(i+r,0)),so(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&$t(e,t,r)>-1},Nr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:fo(r);return i<0&&(i=fr(n+i,0)),$t(e,t,i)},Nr.inRange=function(e,t,n){return t=po(t),n===r?(n=t,t=0):n=po(n),function(e,t,r){return e>=mr(t,r)&&e=-9007199254740991&&e<=c},Nr.isSet=ao,Nr.isString=so,Nr.isSymbol=oo,Nr.isTypedArray=lo,Nr.isUndefined=function(e){return e===r},Nr.isWeakMap=function(e){return eo(e)&&da(e)==x},Nr.isWeakSet=function(e){return eo(e)&&"[object WeakSet]"==Sn(e)},Nr.join=function(e,t){return null==e?"":zt.call(e,t)},Nr.kebabCase=zo,Nr.last=Ka,Nr.lastIndexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var a=i;return n!==r&&(a=(a=fo(n))<0?fr(i+a,0):mr(a,i-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,a):Bt(e,jt,a,!0)},Nr.lowerCase=Ho,Nr.lowerFirst=Go,Nr.lt=uo,Nr.lte=co,Nr.max=function(e){return e&&e.length?hn(e,nl,En):r},Nr.maxBy=function(e,t){return e&&e.length?hn(e,aa(t,2),En):r},Nr.mean=function(e){return qt(e,nl)},Nr.meanBy=function(e,t){return qt(e,aa(t,2))},Nr.min=function(e){return e&&e.length?hn(e,nl,On):r},Nr.minBy=function(e,t){return e&&e.length?hn(e,aa(t,2),On):r},Nr.stubArray=ml,Nr.stubFalse=gl,Nr.stubObject=function(){return{}},Nr.stubString=function(){return""},Nr.stubTrue=function(){return!0},Nr.multiply=Sl,Nr.nth=function(e,t){return e&&e.length?Un(e,fo(t)):r},Nr.noConflict=function(){return dt._===this&&(dt._=Be),this},Nr.noop=ll,Nr.now=As,Nr.pad=function(e,t,r){e=vo(e);var n=(t=fo(t))?lr(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return ji(pt(i),r)+e+ji(ht(i),r)},Nr.padEnd=function(e,t,r){e=vo(e);var n=(t=fo(t))?lr(e):0;return t&&nt){var i=e;e=t,t=i}if(n||e%1||t%1){var a=vr();return mr(e+a*(t-e+ot("1e-"+((a+"").length-1))),t)}return Hn(e,t)},Nr.reduce=function(e,t,r){var n=Vs(e)?Mt:Ht,i=arguments.length<3;return n(e,aa(t,4),r,i,un)},Nr.reduceRight=function(e,t,r){var n=Vs(e)?Lt:Ht,i=arguments.length<3;return n(e,aa(t,4),r,i,cn)},Nr.repeat=function(e,t,n){return t=(n?ga(e,t,n):t===r)?1:fo(t),Gn(vo(e),t)},Nr.replace=function(){var e=arguments,t=vo(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Nr.result=function(e,t,n){var i=-1,a=(t=gi(t,e)).length;for(a||(a=1,e=r);++ic)return[];var r=h,n=mr(e,h);t=aa(t),e-=h;for(var i=Wt(n,t);++r=s)return e;var l=n-lr(i);if(l<1)return i;var u=o?vi(o,0,l).join(""):e.slice(0,l);if(a===r)return u+i;if(o&&(l+=u.length-l),io(a)){if(e.slice(l).search(a)){var c,d=u;for(a.global||(a=Ae(a.source,vo(de.exec(a))+"g")),a.lastIndex=0;c=a.exec(d);)var h=c.index;u=u.slice(0,h===r?l:h)}}else if(e.indexOf(si(a),l)!=l){var p=u.lastIndexOf(a);p>-1&&(u=u.slice(0,p))}return u+i},Nr.unescape=function(e){return(e=vo(e))&&G.test(e)?e.replace(z,dr):e},Nr.uniqueId=function(e){var t=++Le;return vo(e)+t},Nr.upperCase=Ko,Nr.upperFirst=Xo,Nr.each=ys,Nr.eachRight=vs,Nr.first=Ha,ol(Nr,(yl={},yn(Nr,(function(e,t){Me.call(Nr.prototype,t)||(yl[t]=e)})),yl),{chain:!1}),Nr.VERSION="4.17.21",At(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Nr[e].placeholder=Nr})),At(["drop","take"],(function(e,t){Ur.prototype[e]=function(n){n=n===r?1:fr(fo(n),0);var i=this.__filtered__&&!t?new Ur(this):this.clone();return i.__filtered__?i.__takeCount__=mr(n,i.__takeCount__):i.__views__.push({size:mr(n,h),type:e+(i.__dir__<0?"Right":"")}),i},Ur.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),At(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;Ur.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:aa(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),At(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Ur.prototype[e]=function(){return this[r](1).value()[0]}})),At(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Ur.prototype[e]=function(){return this.__filtered__?new Ur(this):this[r](1)}})),Ur.prototype.compact=function(){return this.filter(nl)},Ur.prototype.find=function(e){return this.filter(e).head()},Ur.prototype.findLast=function(e){return this.reverse().find(e)},Ur.prototype.invokeMap=Wn((function(e,t){return"function"==typeof e?new Ur(this):this.map((function(r){return kn(r,e,t)}))})),Ur.prototype.reject=function(e){return this.filter(Ls(aa(e)))},Ur.prototype.slice=function(e,t){e=fo(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Ur(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(n=(t=fo(t))<0?n.dropRight(-t):n.take(t-e)),n)},Ur.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Ur.prototype.toArray=function(){return this.take(h)},yn(Ur.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),a=Nr[i?"take"+("last"==t?"Right":""):t],s=i||/^find/.test(t);a&&(Nr.prototype[t]=function(){var t=this.__wrapped__,o=i?[1]:arguments,l=t instanceof Ur,u=o[0],c=l||Vs(t),d=function(e){var t=a.apply(Nr,Dt([e],o));return i&&h?t[0]:t};c&&n&&"function"==typeof u&&1!=u.length&&(l=c=!1);var h=this.__chain__,p=!!this.__actions__.length,f=s&&!h,m=l&&!p;if(!s&&c){t=m?t:new Ur(this);var g=e.apply(t,o);return g.__actions__.push({func:hs,args:[d],thisArg:r}),new $r(g,h)}return f&&m?e.apply(this,o):(g=this.thru(d),f?i?g.value()[0]:g.value():g)})})),At(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Pe[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Nr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Vs(i)?i:[],e)}return this[r]((function(r){return t.apply(Vs(r)?r:[],e)}))}})),yn(Ur.prototype,(function(e,t){var r=Nr[t];if(r){var n=r.name+"";Me.call(kr,n)||(kr[n]=[]),kr[n].push({name:t,func:r})}})),kr[Fi(r,2).name]=[{name:"wrapper",func:r}],Ur.prototype.clone=function(){var e=new Ur(this.__wrapped__);return e.__actions__=Ci(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ci(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ci(this.__views__),e},Ur.prototype.reverse=function(){if(this.__filtered__){var e=new Ur(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Ur.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=Vs(e),n=t<0,i=r?e.length:0,a=function(e,t,r){for(var n=-1,i=r.length;++n=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},Nr.prototype.plant=function(e){for(var t,n=this;n instanceof Br;){var i=Ba(n);i.__index__=0,i.__values__=r,t?a.__wrapped__=i:t=i;var a=i;n=n.__wrapped__}return a.__wrapped__=e,t},Nr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Ur){var t=e;return this.__actions__.length&&(t=new Ur(this)),(t=t.reverse()).__actions__.push({func:hs,args:[Ja],thisArg:r}),new $r(t,this.__chain__)}return this.thru(Ja)},Nr.prototype.toJSON=Nr.prototype.valueOf=Nr.prototype.value=function(){return di(this.__wrapped__,this.__actions__)},Nr.prototype.first=Nr.prototype.head,Ke&&(Nr.prototype[Ke]=function(){return this}),Nr}();pt?((pt.exports=hr)._=hr,ht._=hr):dt._=hr}.call(lodash)),lodash$1.exports;var e,t}var lodashExports=requireLodash();const RenderedPartAnimationSchema=object({animationId:string(),startOffset:number().optional(),endOffset:number().optional()}),RenderedPartAnimationPreprocessor=(e={})=>({animationId:e.id,startOffset:e.so,endOffset:e.eo}),RenderedPartAnimationParser=preprocess(RenderedPartAnimationPreprocessor,RenderedPartAnimationSchema),BitrateVariantSchema=object({type:_enum(["VIDEO","AUDIO"]),id:string(),height:number().optional(),width:number().optional(),bitrate:number(),codec:string()}),BitrateVariantPreprocessor=(e={})=>({type:e.t,id:e.id,height:e.h,width:e.w,bitrate:e.b,codec:e.c}),BitrateVariantParser=preprocess(BitrateVariantPreprocessor,BitrateVariantSchema),RenderedPartDashSchema=object({videoChunkDurationList:array(number()),audioChunkDurationList:array(number()),bitrateVariants:array(BitrateVariantParser)}),RenderedPartDashPreprocessor=(e={})=>({videoChunkDurationList:e.vcd,audioChunkDurationList:e.acd,bitrateVariants:e.bv}),RenderedPartDashParser=preprocess(RenderedPartDashPreprocessor,RenderedPartDashSchema),RenderedPartSubtitleSchema=object({startTime:number(),endTime:number(),text:string()}),RenderedPartSubtitlePreprocessor=(e={})=>({startTime:e.s,endTime:e.e,text:e.t}),RenderedPartSubtitleParser=preprocess(RenderedPartSubtitlePreprocessor,RenderedPartSubtitleSchema),RenderedPartSchema=object({duration:number(),renderedPartDash:RenderedPartDashParser,renderedPartHLSDurations:array(number()).default([]),subtitles:array(RenderedPartSubtitleParser).optional(),animations:array(RenderedPartAnimationParser).optional()}),RenderedPartPreprocessor=(e={})=>({duration:e.l,renderedPartDash:e.md,renderedPartHLSDurations:e.hd,subtitles:e.su,animations:e.an}),RenderedPartParser=preprocess(RenderedPartPreprocessor,RenderedPartSchema);var buffer={},base64Js={},hasRequiredBase64Js;function requireBase64Js(){if(hasRequiredBase64Js)return base64Js;hasRequiredBase64Js=1,base64Js.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},base64Js.toByteArray=function(e){var n,i,s=a(e),o=s[0],l=s[1],u=new r(function(e,t,r){return 3*(t+r)/4-r}(0,o,l)),c=0,d=l>0?o-4:o;for(i=0;i>16&255,u[c++]=n>>8&255,u[c++]=255&n;2===l&&(n=t[e.charCodeAt(i)]<<2|t[e.charCodeAt(i+1)]>>4,u[c++]=255&n);1===l&&(n=t[e.charCodeAt(i)]<<10|t[e.charCodeAt(i+1)]<<4|t[e.charCodeAt(i+2)]>>2,u[c++]=n>>8&255,u[c++]=255&n);return u},base64Js.fromByteArray=function(t){for(var r,n=t.length,i=n%3,a=[],o=16383,l=0,u=n-i;lu?u:l+o));1===i?(r=t[n-1],a.push(e[r>>2]+e[r<<4&63]+"==")):2===i&&(r=(t[n-2]<<8)+t[n-1],a.push(e[r>>10]+e[r>>4&63]+e[r<<2&63]+"="));return a.join("")};for(var e=[],t=[],r="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0;i<64;++i)e[i]=n[i],t[n.charCodeAt(i)]=i;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function s(t,r,n){for(var i,a,s=[],o=r;o>18&63]+e[a>>12&63]+e[a>>6&63]+e[63&a]);return s.join("")}return t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63,base64Js}var ieee754={},hasRequiredIeee754,hasRequiredBuffer; /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */function requireIeee754(){return hasRequiredIeee754||(hasRequiredIeee754=1,ieee754.read=function(e,t,r,n,i){var a,s,o=8*i-n-1,l=(1<>1,c=-7,d=r?i-1:0,h=r?-1:1,p=e[t+d];for(d+=h,a=p&(1<<-c)-1,p>>=-c,c+=o;c>0;a=256*a+e[t+d],d+=h,c-=8);for(s=a&(1<<-c)-1,a>>=-c,c+=n;c>0;s=256*s+e[t+d],d+=h,c-=8);if(0===a)a=1-u;else{if(a===l)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),a-=u}return(p?-1:1)*s*Math.pow(2,a-n)},ieee754.write=function(e,t,r,n,i,a){var s,o,l,u=8*a-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,f=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+d>=1?h/l:h*Math.pow(2,1-d))*l>=2&&(s++,l/=2),s+d>=c?(o=0,s=c):s+d>=1?(o=(t*l-1)*Math.pow(2,i),s+=d):(o=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&o,p+=f,o/=256,i-=8);for(s=s<0;e[r+p]=255&s,p+=f,s/=256,u-=8);e[r+p-f]|=128*m}),ieee754} /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */function requireBuffer(){return hasRequiredBuffer||(hasRequiredBuffer=1,function(e){const t=requireBase64Js(),r=requireIeee754(),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=s,e.SlowBuffer=function(e){+e!=e&&(e=0);return s.alloc(+e)},e.INSPECT_MAX_BYTES=50;const i=2147483647;function a(e){if(e>i)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return o(e,t,r)}function o(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!s.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|p(e,t);let n=a(r);const i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(W(e,Uint8Array)){const t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return c(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(W(e,ArrayBuffer)||e&&W(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(W(e,SharedArrayBuffer)||e&&W(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return s.from(n,t,r);const i=function(e){if(s.isBuffer(e)){const t=0|h(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||Z(e.length)?a(0):c(e);if("Buffer"===e.type&&Array.isArray(e.data))return c(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return s.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return l(e),a(e<0?0:0|h(e))}function c(e){const t=e.length<0?0:0|h(e.length),r=a(t);for(let n=0;n=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function p(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||W(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(e).length;default:if(i)return n?-1:z(e).length;t=(""+t).toLowerCase(),i=!0}}function f(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,r);case"utf8":case"utf-8":return w(this,t,r);case"ascii":return C(this,t,r);case"latin1":case"binary":return k(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Z(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=s.from(t,n)),s.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,n,i){let a,s=1,o=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,o/=2,l/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(a=r;ao&&(r=o-l),a=r;a>=0;a--){let r=!0;for(let n=0;ni&&(n=i):n=i;const a=t.length;let s;for(n>a/2&&(n=a/2),s=0;s>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function E(e,r,n){return 0===r&&n===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,n))}function w(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,o,l;switch(s){case 1:t<128&&(a=t);break;case 2:r=e[i+1],128==(192&r)&&(l=(31&t)<<6|63&r,l>127&&(a=l));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(l=(15&t)<<12|(63&r)<<6|63&n,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:r=e[i+1],n=e[i+2],o=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&o)&&(l=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&o,l>65535&&l<1114112&&(a=l))}}null===a?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=s}return function(e){const t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn.length?(s.isBuffer(t)||(t=s.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!s.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},s.byteLength=p,s.prototype._isBuffer=!0,s.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tr&&(t+=" ... "),""},n&&(s.prototype[n]=s.prototype.inspect),s.prototype.compare=function(e,t,r,n,i){if(W(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0);const l=Math.min(a,o),u=this.slice(n,i),c=e.slice(t,r);for(let s=0;s>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return b(this,e,t,r);case"base64":return T(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const A=4096;function C(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;in)&&(r=n);let i="";for(let a=t;ar)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,r,n,i,a){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function D(e,t,r,n,i){U(t,n,i,e,r,7);let a=Number(t&BigInt(4294967295));e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function M(e,t,r,n,i){U(t,n,i,e,r,7);let a=Number(t&BigInt(4294967295));e[r+7]=a,a>>=8,e[r+6]=a,a>>=8,e[r+5]=a,a>>=8,e[r+4]=a;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function L(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(e,t,n,i,a){return t=+t,n>>>=0,a||L(e,0,n,4),r.write(e,t,n,i,23,4),n+4}function N(e,t,n,i,a){return t=+t,n>>>=0,a||L(e,0,n,8),r.write(e,t,n,i,52,8),n+8}s.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||I(e,t,this.length);let n=this[e],i=1,a=0;for(;++a>>=0,t>>>=0,r||I(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e>>>=0,t||I(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||I(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||I(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||I(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readBigUInt64LE=X((function(e){j(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||q(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||q(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<>>=0,t>>>=0,r||I(e,t,this.length);let n=this[e],i=1,a=0;for(;++a=i&&(n-=Math.pow(2,8*t)),n},s.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||I(e,t,this.length);let n=t,i=1,a=this[e+--n];for(;n>0&&(i*=256);)a+=this[e+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*t)),a},s.prototype.readInt8=function(e,t){return e>>>=0,t||I(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||I(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(e,t){e>>>=0,t||I(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readBigInt64LE=X((function(e){j(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||q(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||q(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<>>=0,t||I(e,4,this.length),r.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||I(e,4,this.length),r.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||I(e,8,this.length),r.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||I(e,8,this.length),r.read(this,e,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){R(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=1,a=0;for(this[t]=255&e;++a>>=0,r>>>=0,!n){R(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,1,255,0),this[t]=255&e,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeBigUInt64LE=X((function(e,t=0){return D(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),s.prototype.writeBigUInt64BE=X((function(e,t=0){return M(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),s.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);R(this,e,t,r,n-1,-n)}let i=0,a=1,s=0;for(this[t]=255&e;++i>>=0,!n){const n=Math.pow(2,8*r-1);R(this,e,t,r,n-1,-n)}let i=r-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a|0)-s&255;return t+r},s.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeBigInt64LE=X((function(e,t=0){return D(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),s.prototype.writeBigInt64BE=X((function(e,t=0){return M(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),s.prototype.writeFloatLE=function(e,t,r){return O(this,e,t,!0,r)},s.prototype.writeFloatBE=function(e,t,r){return O(this,e,t,!1,r)},s.prototype.writeDoubleLE=function(e,t,r){return N(this,e,t,!0,r)},s.prototype.writeDoubleBE=function(e,t,r){return N(this,e,t,!1,r)},s.prototype.copy=function(e,t,r,n){if(!s.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function U(e,t,r,n,i,a){if(e>r||e= 0${r} and < 2${r} ** ${8*(a+1)}${r}`:`>= -(2${r} ** ${8*(a+1)-1}${r}) and < 2 ** ${8*(a+1)-1}${r}`,new F.ERR_OUT_OF_RANGE("value",n,e)}!function(e,t,r){j(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||q(t,e.length-(r+1))}(n,i,a)}function j(e,t){if("number"!=typeof e)throw new F.ERR_INVALID_ARG_TYPE(t,"number",e)}function q(e,t,r){if(Math.floor(e)!==e)throw j(e,r),new F.ERR_OUT_OF_RANGE("offset","an integer",e);if(t<0)throw new F.ERR_BUFFER_OUT_OF_BOUNDS;throw new F.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${t}`,e)}B("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),B("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),B("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=$(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=$(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const V=/[^+/0-9A-Za-z-_]/g;function z(e,t){let r;t=t||1/0;const n=e.length;let i=null;const a=[];for(let s=0;s55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function H(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(e,t,r,n){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function W(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Z(e){return e!=e}const K=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?Y:e}function Y(){throw new Error("BigInt not supported")}}(buffer)),buffer}var bufferExports=requireBuffer();const getBase64ManifestRepresentation=(e,t)=>`data:${e};base64,${bufferExports.Buffer.from(t).toString("base64")}`,reduceStreamDuration=(e,t)=>{const r=1e3*t;let n=0,i=0;return e.map((e=>{const t=e.renderedPartHLSDurations.filter((e=>n(i{t+=this.generateStreamInfo(r),t+=this.generateVariantManifest(r,e)})),t}filterParts(){return this.duration?reduceStreamDuration(this.partsConfiguration,this.duration):this.partsConfiguration}getVideoVariants(){return this.template.bitrateVariants.filter((e=>"VIDEO"===e.type)).sort(((e,t)=>t.height-e.height))}generateStreamInfo(e){return`#EXT-X-STREAM-INF:BANDWIDTH=${1e3*e.bitrate},RESOLUTION=${e.width}x${e.height},CODECS="avc1.4d401f,mp4a.40.2"\n`}generateVariantManifest(e,t){const r=this.getHlsBitrateVariantManifest(e,t);return getBase64ManifestRepresentation("application/x-mpegurl",r)+"\n"}getHlsBitrateVariantManifest(e,t){let r="#EXTM3U\n#EXT-X-PLAYLIST-TYPE:VOD\n#EXT-X-VERSION:4\n#EXT-X-MEDIA-SEQUENCE:0\n#EXT-X-TARGETDURATION:4\n";return t.forEach((t=>{r+=this.generateSegments(t,e),r+="#EXT-X-DISCONTINUITY\n"})),r+="#EXT-X-ENDLIST",r}generateSegments(e,t){let r="";const n=this.template.bitrateVariants.filter((e=>"VIDEO"===e.type)).indexOf(t);return e.renderedPartHLSDurations.forEach(((t,i)=>{r+=`#EXTINF:${parseFloat(t.toString()).toFixed(6)},\n`,r+=`${this.template.videoStreamFolderUrl}${e.hash}${e.partNumber}${n}_${i}.ts\n`})),r}}class DashManifestGenerator{constructor(e,t,r={}){__publicField2(this,"template"),__publicField2(this,"renderedParts"),__publicField2(this,"duration"),this.template=e,this.renderedParts=t,this.duration=r.duration}generateManifest(){const e=this.getPartsWithProperDuration();if(0===e.length)return null;const t=this.calculateTotalDuration(e);return this.buildManifest(e,t)}getPartsWithProperDuration(){return this.duration?reduceStreamDuration(this.renderedParts,this.duration):this.renderedParts}calculateTotalDuration(e){return e.reduce(((e,t)=>e+t.duration),0)}buildManifest(e,t){return`${this.buildManifestHeader(t)}${e.map(((e,t)=>this.buildPeriod(e,t+1))).join("")}`}buildManifestHeader(e){return`\n `}buildPeriod(e,t){return`${this.buildPeriodHeader(e,t)}${this.buildAdaptationSet(e,"video")}${this.buildAdaptationSet(e,"audio")}`}buildPeriodHeader(e,t){let r=``;return t>1&&(r+=``),r}buildAdaptationSet(e,t){const r="video"===t?"1":"2",n=`${t}/mp4`,i=this.buildSegmentName(e,"init"),a=this.buildSegmentName(e,"media"),s="video"===t?e.renderedPartDash.videoChunkDurationList:e.renderedPartDash.audioChunkDurationList,o=this.template.bitrateVariants.filter((e=>e.type===t.toUpperCase()));return this.getDashAdaptationSet(r,t,n,i,a,s,o)}buildSegmentName(e,t){const r=`${this.template.videoStreamFolderUrl}${e.hash}${e.partNumber}$RepresentationID$`;return"init"===t?`${r}.m4s`:`${r}$Number%03d$.m4s`}iso8601Duration(e){const t=Math.floor(e/3600),r=Math.floor(e%3600/60),n=e%60;return`PT${t>0?`${t}H`:""}${r>0?`${r}M`:""}${n>0?`${n}S`:""}`}getDashAdaptationSet(e,t,r,n,i,a,s){return`\n \n ${this.buildSegmentTimeline(a)}\n \n ${this.buildRepresentations(s)}\n `}buildSegmentTimeline(e){let t="",r=null,n=0,i=!0;return e.forEach(((a,s)=>{null!==r&&r!==a&&(t+=this.buildSegmentTimelineEntry(r,n,i),n=0,i=!1),r=a,n++,s===e.length-1&&(t+=this.buildSegmentTimelineEntry(a,n,i))})),t}buildSegmentTimelineEntry(e,t,r){return`1?` r="${t-1}"`:""}/>`}buildRepresentations(e){return e.sort(((e,t)=>t.height-e.height)).map((e=>``)).join("")}}const generateManifest=(e,t,r={type:"hls"})=>{const{duration:n,type:i}=r;if("hls"===i){return new HlsManifestGenerator(e,t,{duration:n}).generateManifest()}if("dash"===i){return new DashManifestGenerator(e,t,{duration:n}).generateManifest()}};class OnPremiseVideoConfiguration{constructor(e,t,r){this.template=e,this.personalizationData=t,this.scenarioElements=r}get videoStreamFolderUrl(){return this.template.videoStreamFolderUrl}get templateParts(){return this.template.templateParts}get templateScenarioElements(){return this.template.templateScenarioElements}getTemplateScenarioElementById(e){const t=this.templateScenarioElements.find((t=>t.scenarioElementId===e));if(!t)throw new VintomError("ConfigurationParsingFailure","Scenario element "+e+" not found in template configuration");return t}async getScenarioElementsFromTemplate(){const e=this.scenarioElements.map((async e=>{if(null==e.video&&null==e.animations)return e;const t=this.getTemplateScenarioElementById(e.id),r=await this.getRenderedParts(t);return this.cloneScenarioElement(e,{video:{sources:this.getSources(r),subtitlesSource:this.getSubtitlesSource(r)},animations:this.personalizeAnimations(e,r),ctas:this.personalizeCTAs(e,r),poster:this.personalizePoster(e),sourcesToPreload:await this.personalizePrebufferedSources(t.preBufferedScenarioElementIds)})}));return Promise.all(e)}async getRenderedParts(e){const t=e.partNumbers.map((e=>{const t=this.templateParts[e-1];return{partNumber:e,hash:this.getHash(t.personalizedVariables)}})).map((({partNumber:e,hash:t})=>this.fetchRenderedPart(e,t)));return Promise.all(t)}async fetchRenderedPart(e,t){const r=this.videoStreamFolderUrl+t+e+".json",n=await fetch(r);try{return{hash:t,partNumber:e,...RenderedPartParser.parse(await n.json())}}catch(e2){throw console.error(e2),new VintomError("ResourceLoadingFailure",`Failed to load part configuration from '${r}'`)}}cloneScenarioElement(e,t){const r={...e,...t},n=JSON.parse(JSON.stringify(r));return Object.setPrototypeOf(n,Object.getPrototypeOf(e)),n}getHash(e){const t=e.sort().map((e=>this.personalizationData[e]||""));return t.push(this.template.projectId),md5Exports.Md5.hashStr(t.join("cKq*@#dLadk"))}getSources(e,t){if(e.length<=0)return null;const r=[],n=generateManifest(this.template,e,{type:"dash",duration:t}),i=generateManifest(this.template,e,{type:"hls",duration:t});return n&&r.push({src:getBase64ManifestRepresentation("application/dash+xml",n),type:"application/dash+xml"}),i&&r.push({src:getBase64ManifestRepresentation("application/x-mpegurl",i),type:"application/x-mpegurl"}),r}getSubtitlesSource(e){const t=[];let r=0;e.forEach((e=>{null!=e.subtitles&&t.push(...e.subtitles.map((e=>({startTime:r+e.startTime,endTime:r+e.endTime,text:e.text})))),r+=e.duration}));const n=t.reduce(((e,t)=>e+`${this.subtitlesTimeFormat(t.startTime)} --\x3e ${this.subtitlesTimeFormat(t.endTime)}\n${t.text}\n\n`),"WEBVTT FILE\n\n");return getBase64ManifestRepresentation("text/plain",n)}personalizeAnimations(e,t){const r=[],n=t.map((e=>e.partNumber)),i=t.map((e=>e.duration)).reduce(((e,t)=>e+t),0),a=t.filter((e=>e.animations&&e.animations.length>0)).flatMap((e=>e.animations.map((r=>{const i=this.getPartStartTime(t,n.indexOf(e.partNumber)+1);return{animationId:r.animationId,startOffset:null!=r.startOffset?i+1e3*r.startOffset:null,endOffset:null!=r.endOffset?i+1e3*r.endOffset:null}})))).sort(((e,t)=>e.animationId!==t.animationId?e.animationId.localeCompare(t.animationId):e.startOffset?e.startOffset:e.endOffset-t.startOffset?t.startOffset:t.endOffset)).reduce(((e,t)=>(e[t.animationId]||(e[t.animationId]=[]),e[t.animationId].push(t),e)),{});return Object.keys(a).forEach((e=>{let t=null;a[e].forEach((n=>{if(null!=n.startOffset&&null==n.endOffset)t=n;else if(null!=n.endOffset&&(null!=t||null!=n.startOffset)){const i=(t||n).startOffset;Math.round(i){const r=e.animations.filter((e=>e.id===t.animationId));if(r.length>0)return r.map((e=>({src:e.src,startTimeMillis:t.startOffset,endTimeMillis:t.endOffset,type:e.type,displayAbovePoster:e.displayAbovePoster,animationBlur:e.animationBlur,id:t.animationId,customAttributes:e.customAttributes})));throw new VintomError("ConfigurationParsingFailure","VideoConfiguration: animation with id: "+t.animationId+" not found in the campaign configuration!")}))}personalizeCTAs(e,t){return e.ctas.map((e=>(e.visibilityRange&&null!=e.visibilityRange.startTimePattern&&(e.visibilityRange.startTime=this.calculatePersonalizedTime(e.visibilityRange.startTimePattern,t)/1e3),e.visibilityRange&&null!=e.visibilityRange.endTimePattern&&(e.visibilityRange.endTime=this.calculatePersonalizedTime(e.visibilityRange.endTimePattern,t)/1e3),e)))}subtitlesTimeFormat(e){const t=new Date(1e3*e),r=(e,t)=>e.toString().padStart(t,"0");return`${r(t.getUTCHours(),2)}:${r(t.getUTCMinutes(),2)}:${r(t.getUTCSeconds(),2)}.${r(t.getUTCMilliseconds(),3)}`}getPartStartTime(e,t){return e.filter((e=>e.partNumber1e3*e.duration)).reduce(((e,t)=>e+t),0)}personalizePoster(e){if(this.template.thumbnailPersonalizedVariables){const e=this.getHash(this.template.thumbnailPersonalizedVariables);return this.template.videoStreamFolderUrl+e+"_thumbnail.jpg"}return e.poster}calculatePersonalizedTime(e,t){const r=new RegExp("(\\[part(\\d+)])?\\s*([+-]?)\\s*(\\d+)?").exec(e),n=Number(r[2]);let i=t.filter((e=>e.partNumber1e3*e.duration)).reduce(((e,t)=>e+t),0);return i+=Number(r[3]+(r[4]??"0")),i}async personalizePrebufferedSources(e){return null==e||0===e.length?null:Promise.all(e.map((async e=>{const t=this.getTemplateScenarioElementById(e),r=await this.getRenderedParts(t);return{sources:this.getSources(r,5),subtitles:null}})))}}const defaultUrls={configServerUrl:Config$1.defaultconfigServerUrl,ctaFolderUrl:Config$1.defaultCTAStorageUrl,animationAssetsFolderUrl:Config$1.defaultAnimationsAssetsUrl,videoStreamFolderUrl:""};var __getOwnPropDesc=Object.getOwnPropertyDescriptor,__decorateClass=(e,t,r,n)=>{for(var i,a=n>1?void 0:n?__getOwnPropDesc(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(a=i(a)||a);return a};let PlayerConfigurationBuilder=class{constructor(){__publicField2(this,"version","1.0.0"),__publicField2(this,"project"),__publicField2(this,"behavior"),__publicField2(this,"ui"),__publicField2(this,"urls"),__publicField2(this,"animationSettings",{}),__publicField2(this,"analyticsEndpoints",[]),__publicField2(this,"debugParts",[]),__publicField2(this,"scenarioElements",[]),__publicField2(this,"personalizationData",{}),__publicField2(this,"pluginSettings",{}),__publicField2(this,"transformConfig")}fromExternalConfiguration(e){var t;return e=lodashExports.cloneDeep(e),this.version="1.0.0",this.project={videoId:e.code,projectId:e.campaign,status:e.status,groupId:e.groupId,aspectRatio:e.aspectRatio,videoDate:e.videoDate},this.behavior={adminMode:e.adminMode??!1,autoplay:e.autoplay??!1,startMuted:e.mutedStart??!1,subtitlesActiveOnStart:e.subtitlesActiveOnStart??!1,globalMusicUrl:e.scenarioMusicUrl??""},this.ui={colors:{accent:(null==(t=e.skin)?void 0:t.color)??"#dba600"},seekbarParts:e.parts??[],controls:{...this.getLogoParts(e.playerControls),fullscreenEnabled:e.playerControls.fullscreenEnabled??!1,controlsEnabled:e.playerControls.controlsEnabled??!0,hideControlsDelay:e.playerControls.hideControlsDelay??0,overlayButtonEnabled:e.playerControls.overlayButtonEnabled??!0,seekbarAlwaysVisible:e.playerControls.seekbarAlwaysVisible??!1,showControlsOnStart:e.playerControls.showControlsOnStart??!0,seekbarEnabled:e.playerControls.seekbarEnabled??!0,socialButtonEnabled:e.playerControls.socialButtonEnabled??!0,hideOverlayDuringCTA:e.playerControls.hideOverlayDuringCTA??!1,keepControlsVisibleAtEnd:e.playerControls.keepControlsVisibleAtEnd??!1}},this.urls={...defaultUrls},this.animationSettings=e.animationSettings??{},this.analyticsEndpoints=e.analyticsEndpoints??[],this.debugParts=e.partsDebugInfo??[],this.scenarioElements=e.scenarioElements??[],this.personalizationData={},this.pluginSettings={},this}async applyOnPremiseTemplate(e){const t=new OnPremiseVideoConfiguration(e,this.personalizationData,[...this.scenarioElements]);return this.scenarioElements=await t.getScenarioElementsFromTemplate(),this}withSettings(e){if(e.urls&&(this.urls=lodashExports.merge({},this.urls,e.urls)),e.behavior&&(this.behavior=lodashExports.merge({},this.behavior,e.behavior)),e.ui&&(this.ui=lodashExports.merge({},this.ui,e.ui),this.ui.controls=lodashExports.merge({},this.ui.controls,this.getLogoParts(e.ui.controls))),e.plugins&&(this.pluginSettings=lodashExports.merge({},this.pluginSettings,e.plugins)),e.transformConfig&&(this.transformConfig=e.transformConfig),e.personalizationData&&(this.personalizationData=e.personalizationData),e.loop){const t=this.scenarioElements.find((e=>e.initial));if(t){const r={...e.loop,muteVolume:!0};t.loop=r}}return this}build(){if(!(this.project&&this.behavior&&this.ui&&this.urls))throw new Error("PlayerConfiguration is missing required fields. Use fromExternalConfiguration first.");return(this.transformConfig??(e=>e))(new PlayerConfiguration(this.version,this.project,this.behavior,this.ui,this.urls,this.animationSettings,this.analyticsEndpoints,this.debugParts,this.scenarioElements,this.personalizationData,this.pluginSettings))}getLogoParts(e={}){var t;let{logo:r,logoTarget:n,logoVisiblePermanently:i}=e;return!r&&i&&(n=`https://www.vintom.com/?utm_source=vintom-player&utm_medium=player&utm_campaign=${null==(t=this.project)?void 0:t.projectId}`),{logo:r,logoVisiblePermanently:i,logoTarget:n}}};PlayerConfigurationBuilder=__decorateClass([K()],PlayerConfigurationBuilder);const logger$3=getLogger("FetchConfig"),createConfigurationRequest=(e,t,r={})=>({url:Config$1.videoConfigurationUrl(e,t),fetchParams:Object.keys(r).length>0?{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}}:{method:"GET"}}),fetchRawConfiguration=async e=>{const{videoId:t,configServerUrl:r,personalizationData:n={}}=e,{url:i,fetchParams:a}=createConfigurationRequest(r,t,n);logger$3.info("Fetching raw configuration using video id: "+t+" from "+i);try{const e=await fetch(i,a);if(!e.ok){if(404===e.status)throw new VintomError("InvalidVideoId",`Video ID "${t}" is invalid`);throw new VintomError("ResourceLoadingFailure",`Failed to load configuration from '${i}', server responded with status ${e.status}`)}return await e.json()}catch(e2){if(logger$3.error("Failed to download configuration",e2),e2 instanceof VintomError)throw e2;throw new VintomError("ResourceLoadingFailure",`Failed to load configuration from '${i}', status code: ${e2.status}`)}},AnalyticsEndpointSchema=object({provider:_enum(["GA","vintom"]),gaServiceTracker:string().optional(),vintomServer:string().optional()}).refine((e=>!("GA"===e.provider&&!e.gaServiceTracker)),{message:"Google Analytics endpoint has to have gaServiceTracker defined"}).refine((e=>!("vintom"===e.provider&&!e.vintomServer)),{message:"Vintom Analytics endpoint has to have vintomServer defined"}),AnalyticsEndpointPreprocessor=(e={})=>({provider:e.pr,gaServiceTracker:e.st,vintomServer:e.vs}),AnalyticsEndpointParser=preprocess(AnalyticsEndpointPreprocessor,AnalyticsEndpointSchema),AnimationSettingsSchema=object({sourceUrl:string().optional(),data:record(string(),any$1()).optional()}),AnimationSettingsPreprocessor=(e={})=>({sourceUrl:e.su,data:e.d}),AnimationSettingsParser=preprocess(AnimationSettingsPreprocessor,AnimationSettingsSchema),constructParameters=(e,t)=>{if(e.length!==t.length)throw new Error("Parameters and values arrays must have the same length");return e.map(((e,r)=>({name:e,value:t[r],html:!1})))},DebugPartShape=object({index:number(),startTime:number(),endTime:number(),markerName:string(),parentVideoId:string().optional(),parentVideoCode:string().optional(),parameters:array(string()),values:array(string())}).transform((e=>({...e,parameters:constructParameters(e.parameters,e.values),parentVideoId:e.parentVideoId||e.parentVideoCode}))).refine((e=>e.parentVideoId||e.parentVideoCode),{message:"Parent videoId is required",path:["parentVideoId"]}),DebugPartPreprocessor=(e={})=>e,DebugPartParser=preprocess(DebugPartPreprocessor,DebugPartShape),PartSchema=object({id:number(),size:number()}),PartPreprocessor=(e={})=>({id:e.id,size:e.s}),PartParser=preprocess(PartPreprocessor,PartSchema),PlayerControlsSchema=object({logo:string().optional(),logoVisiblePermanently:boolean().default(!0),logoTarget:string().optional(),seekbarEnabled:boolean().default(!0),seekbarAlwaysVisible:boolean().default(!1),controlsEnabled:boolean().default(!0),overlayButtonEnabled:boolean().default(!0),fullscreenEnabled:boolean().default(!0),socialButtonEnabled:boolean().default(!0),showControlsOnStart:boolean().default(!0),hideControlsDelay:number().default(3e3)}),PlayerControlsPreprocessor=(e={})=>({logo:e.l,logoVisiblePermanently:e.lv,seekbarEnabled:e.se,seekbarAlwaysVisible:e.sav,controlsEnabled:e.ce,overlayButtonEnabled:e.pe,fullscreenEnabled:e.fe,socialButtonEnabled:e.soe,hideControlsDelay:e.hcd,showControlsOnStart:e.cos}),PlayerControlsParser=preprocess(PlayerControlsPreprocessor,PlayerControlsSchema),getParametersFromRecord=e=>Object.entries(e).map((([e,t])=>({name:e,value:t,html:!0}))),AnimationSchema=object({src:string(),startTimeMillis:number().default(0),endTimeMillis:number().optional(),type:_enum(["L"]).default("L"),displayAbovePoster:boolean().default(!0),animationBlur:string().default("0.4px"),id:string().optional(),customAttributes:record(string(),any$1()).optional(),debugParameters:record(string(),any$1()).optional()}).transform((e=>{const t=e.debugParameters?getParametersFromRecord(e.debugParameters):[];return{...e,debugParameters:t}})),AnimationPreprocessor=(e={})=>({src:e.s,startTimeMillis:e.st,endTimeMillis:e.et,type:e.t,displayAbovePoster:e.da,animationBlur:e.blr,id:e.id,customAttributes:e.c,debugParameters:e.dp}),AnimationParser=preprocess(AnimationPreprocessor,AnimationSchema);var jsonify={},parse$1,hasRequiredParse,stringify,hasRequiredStringify,hasRequiredJsonify,jsonStableStringify,hasRequiredJsonStableStringify;function requireParse(){if(hasRequiredParse)return parse$1;var e,t;hasRequiredParse=1;var r,n={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function i(t){throw{name:"SyntaxError",message:t,at:e,text:r}}function a(n){return n&&n!==t&&i("Expected '"+n+"' instead of '"+t+"'"),t=r.charAt(e),e+=1,t}function s(){var e,r="";for("-"===t&&(r="-",a("-"));t>="0"&&t<="9";)r+=t,a();if("."===t)for(r+=".";a()&&t>="0"&&t<="9";)r+=t;if("e"===t||"E"===t)for(r+=t,a(),"-"!==t&&"+"!==t||(r+=t,a());t>="0"&&t<="9";)r+=t,a();return e=Number(r),isFinite(e)||i("Bad number"),e}function o(){var e,r,s,o="";if('"'===t)for(;a();){if('"'===t)return a(),o;if("\\"===t)if(a(),"u"===t){for(s=0,r=0;r<4&&(e=parseInt(a(),16),isFinite(e));r+=1)s=16*s+e;o+=String.fromCharCode(s)}else{if("string"!=typeof n[t])break;o+=n[t]}else o+=t}i("Bad string")}function l(){for(;t&&t<=" ";)a()}function u(){switch(l(),t){case"{":return function(){var e,r={};if("{"===t){if(a("{"),l(),"}"===t)return a("}"),r;for(;t;){if(e=o(),l(),a(":"),Object.prototype.hasOwnProperty.call(r,e)&&i('Duplicate key "'+e+'"'),r[e]=u(),l(),"}"===t)return a("}"),r;a(","),l()}}i("Bad object")}();case"[":return function(){var e=[];if("["===t){if(a("["),l(),"]"===t)return a("]"),e;for(;t;){if(e.push(u()),l(),"]"===t)return a("]"),e;a(","),l()}}i("Bad array")}();case'"':return o();case"-":return s();default:return t>="0"&&t<="9"?s():function(){switch(t){case"t":return a("t"),a("r"),a("u"),a("e"),!0;case"f":return a("f"),a("a"),a("l"),a("s"),a("e"),!1;case"n":return a("n"),a("u"),a("l"),a("l"),null;default:i("Unexpected '"+t+"'")}}()}}return parse$1=function(n,a){var s;return r=n,e=0,t=" ",s=u(),l(),t&&i("Syntax error"),"function"==typeof a?function e(t,r){var n,i,s=t[r];if(s&&"object"==typeof s)for(n in u)Object.prototype.hasOwnProperty.call(s,n)&&(void 0===(i=e(s,n))?delete s[n]:s[n]=i);return a.call(t,r,s)}({"":s},""):s}}function requireStringify(){if(hasRequiredStringify)return stringify;hasRequiredStringify=1;var e,t,r,n=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,i={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function a(e){return n.lastIndex=0,n.test(e)?'"'+e.replace(n,(function(e){var t=i[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'}function s(n,i){var o,l,u,c,d,h=e,p=i[n];switch(p&&"object"==typeof p&&"function"==typeof p.toJSON&&(p=p.toJSON(n)),"function"==typeof r&&(p=r.call(i,n,p)),typeof p){case"string":return a(p);case"number":return isFinite(p)?String(p):"null";case"boolean":case"null":return String(p);case"object":if(!p)return"null";if(e+=t,d=[],"[object Array]"===Object.prototype.toString.apply(p)){for(c=p.length,o=0;oe.startOffset||e.startTimePattern),{message:"Either startOffset or startTimePattern must be provided",path:["startOffset","startTimePattern"]}).refine((e=>e.endOffset||e.endTimePattern),{message:"Either endOffset or endTimePattern must be provided",path:["endOffset","endTimePattern"]}).refine((e=>!isNaN(Number(e.startOffset??0))),{message:"startOffset must be a string that can be parsed as number",path:["startOffset"]}).refine((e=>!isNaN(Number(e.endOffset??0))||"END"===e.endOffset),{message:"endOffset must be a string that can be parsed as number or 'END'",path:["endOffset"]}).transform((e=>({endTime:"END"===e.endOffset?"END":null!=e.endOffset?Number(e.endOffset)/1e3:void 0,startTime:e.startOffset?Number(e.startOffset)/1e3:0,endTimePattern:e.endTimePattern,startTimePattern:e.startTimePattern}))),VisibilityRangePreprocessor=(e={})=>({startOffset:e.s,endOffset:e.e,startTimePattern:e.sp,endTimePattern:e.ep}),VisibilityRangeParser=preprocess(VisibilityRangePreprocessor,VisibilityRangeSchema),CTASchema=object({id:number(),type:string(),triggerType:_enum(["RANGE","END"]),poster:string().nullish(),customAttributes:record(string(),any$1()).optional(),remarketingData:string().optional(),visibilityRange:VisibilityRangeParser.optional().nullish(),stopsPlayback:boolean().default(!0)}).refine((e=>"RANGE"===e.triggerType==!!e.visibilityRange),{message:"visibility range can't be null for RANGE trigger type"}).refine((e=>!e.poster||"END"===e.triggerType),{message:"poster can be set only for END trigger type"}).transform((e=>({...e,hashCode:hashCode(stableStringify(e.customAttributes||{})+e.type)}))),CTAPreprocessor=(e={})=>({id:e.id,type:e.t,triggerType:e.tt,poster:e.p,customAttributes:e.c,remarketingData:e.re,visibilityRange:e.vr,stopsPlayback:e.sp}),CTAParser=preprocess(CTAPreprocessor,CTASchema),LoopSchema=object({start:number().default(0),duration:number(),jumpAfterLoop:number().optional()}).transform((e=>({start:e.start/1e3,duration:e.duration/1e3,jumpAfterLoop:"number"==typeof e.jumpAfterLoop?e.jumpAfterLoop/1e3:void 0,interruptable:!0,muteVolume:!0,hideSubtitles:!0}))),LoopPreprocessor=(e={})=>({start:e.s,duration:e.d,jumpAfterLoop:e.jop}),LoopParser=preprocess(LoopPreprocessor,LoopSchema),SoundtrackSchema=object({musicUrl:string(),startOffset:number().default(0),endOffset:number().default(0),fadeInDuration:number().default(0),fadeOutDuration:number().default(1500)}).transform((e=>({...e,startOffset:e.startOffset/1e3,endOffset:e.endOffset/1e3,fadeInDuration:e.fadeInDuration/1e3,fadeOutDuration:e.fadeOutDuration/1e3}))),SoundtrackPreprocessor=(e={})=>({musicUrl:e.u,startOffset:e.so,endOffset:e.eo,fadeInDuration:e.fid,fadeOutDuration:e.fod}),SoundtrackParser=preprocess(SoundtrackPreprocessor,SoundtrackSchema),SourceShape=object({src:string(),type:string()}),SourcePreprecessor=(e={})=>({src:e.s,type:e.t}),SourceSchema=preprocess(SourcePreprecessor,SourceShape),SubtitleShape=object({source:string(),label:string().nullish()}),SubtitlePreprocessor=(e={})=>({source:e.s,label:e.l}),SubtitleSchema=preprocess(SubtitlePreprocessor,SubtitleShape),VideoSourcesSchema=object({sources:array(SourceSchema),subtitles:array(SubtitleSchema).default([])}).refine((e=>e.sources.length>0),{message:"VideoSources must have at least one source",path:["sources"]}).transform((e=>{var t;const r=null==(t=e.subtitles.find((e=>e.source)))?void 0:t.source;return{sources:e.sources,subtitlesSource:r}})),VideoSourcesPreprocessor=(e={})=>({sources:e.so,subtitles:e.su}),VideoSourcesParser=preprocess(VideoSourcesPreprocessor,VideoSourcesSchema),ScenarioElementSchema=object({id:string(),poster:string().optional(),ctas:array(CTAParser).default([]),partId:number().default(1),music:SoundtrackParser.optional(),initial:boolean().default(!1),video:VideoSourcesParser.optional(),sourcesToPreload:array(VideoSourcesParser).default([]),nextScenarioElementId:string().optional(),animations:array(AnimationParser).default([]),loop:LoopParser.optional()}).superRefine(((e,t)=>{!e.video&&e.animations.length>1&&t.addIssue({code:ZodIssueCode.custom,message:"Scenario elements without video must contain at most one animation"}),e.video||e.animations.length||!e.ctas.length||t.addIssue({code:ZodIssueCode.custom,message:"Scenario elements without video and animation aren't supported in version 3"}),e.ctas.filter((e=>e.poster)).length>1&&t.addIssue({code:ZodIssueCode.custom,message:"Scenario element must have at most one CTA with poster"})})),ScenarioElementPreprocessor=(e={})=>({id:e.id,poster:e.p,ctas:e.c,partId:e.pa,music:e.mu,initial:e.i,video:e.v,sourcesToPreload:e.pv,nextScenarioElementId:e.ns,animations:e.an,loop:e.l}),ScenarioElementParser=preprocess(ScenarioElementPreprocessor,ScenarioElementSchema),SkinSchema=object({color:string().regex(/^#[0-9a-f]{6}$/i).optional()}),SkinPreprocessor=(e={})=>({color:e.c}),SkinParser=preprocess(SkinPreprocessor,SkinSchema),VideoConfigurationSchema=object({aspectRatio:string(),code:string(),animationSettings:AnimationSettingsParser,scenarioMusicUrl:string().optional(),scenarioElements:array(ScenarioElementParser),analyticsEndpoints:array(AnalyticsEndpointParser),parts:array(PartParser).default([]),partsDebugInfo:array(DebugPartParser).default([]),videoDate:number(),playerControls:PlayerControlsParser,campaign:string().optional(),groupId:number().optional(),skin:SkinParser.optional(),adminMode:boolean().default(!1),autoplay:boolean().default(!1),mutedStart:boolean().default(!1),autoRefreshBeforeReady:boolean().default(!1),subtitlesActiveOnStart:boolean().default(!0),status:_enum(["READY","PREPARING","DELETED"]).default("READY"),jsAssetsUrl:string().optional()}).transform((e=>({...e,aspectRatio:parseAspectRatio(e.aspectRatio)}))),VideoConfigurationPreprocessor=(e={})=>({aspectRatio:e.ar,code:e.c,animationSettings:e.as,scenarioMusicUrl:e.smu,scenarioElements:e.se,analyticsEndpoints:e.ae,parts:e.pa,partsDebugInfo:e.dmp,videoDate:e.d,playerControls:e.pc,campaign:e.cm,groupId:e.gr,skin:e.sk,adminMode:e.am,autoplay:e.ap,mutedStart:e.ms,autoRefreshBeforeReady:e.arbr,subtitlesActiveOnStart:e.sa,status:e.st,jsAssetsUrl:e.ju}),VideoConfigurationParser=preprocess(VideoConfigurationPreprocessor,VideoConfigurationSchema),TemplatePartSchema=object({personalizedVariables:array(string())}),TemplatePartPreprocessor=(e={})=>({personalizedVariables:e.pv}),TemplatePartParser=preprocess(TemplatePartPreprocessor,TemplatePartSchema),TemplateScenarioElementSchema=object({scenarioElementId:string(),partNumbers:array(number()),preBufferedScenarioElementIds:array(string()).default([])}),TemplateScenarioElementPreprocessor=(e={})=>({scenarioElementId:e.sei,partNumbers:e.pn,preBufferedScenarioElementIds:e.pv}),TemplateScenarioElementParser=preprocess(TemplateScenarioElementPreprocessor,TemplateScenarioElementSchema),TemplateSchema=object({projectId:string(),videoStreamFolderUrl:string(),templateParts:array(TemplatePartParser),templateScenarioElements:array(TemplateScenarioElementParser),bitrateVariants:array(BitrateVariantParser),thumbnailPersonalizedVariables:array(string()).optional()}),TemplatePreprocessor=(e={})=>({projectId:e.c,videoStreamFolderUrl:e.vsfu,templateParts:e.tp,templateScenarioElements:e.tsc,bitrateVariants:e.bv,thumbnailPersonalizedVariables:e.tpv}),TemplateParser=preprocess(TemplatePreprocessor,TemplateSchema),logger$2=getLogger("PlayerConfig"),modifyConfigToWorkWithTemplate=e=>{var t;const r=JSON.parse(JSON.stringify(e));return r.c="videoId",null==(t=r.se)||t.forEach((e=>e.v={so:[{s:"",t:""}]})),r.d=(new Date).getTime(),r},parseObfuscatedExternalConfig=e=>{logger$2.info("Parsing inline configuration",e),e.onPremiseTemplate&&(e=modifyConfigToWorkWithTemplate(e));try{return VideoConfigurationParser.parse(e)}catch(e2){if(e2 instanceof ZodError)throw new VintomError("ConfigurationParsingFailure",prettifyError(e2));throw logger$2.error("Failed to parse configuration",e2),new VintomError("ConfigurationParsingFailure",e2.message)}},getConfigParts=e=>{let{base:t,template:r}={base:e,template:null};return e.base&&(t=e.base),e.template&&(r=e.template),r&&(t=modifyConfigToWorkWithTemplate(t)),{base:t,template:r}},createPlayerConfig=async e=>{var t,r;let n=null;e.videoId&&(n=await fetchRawConfiguration({videoId:e.videoId,personalizationData:e.personalizationData,configServerUrl:null==(t=e.urls)?void 0:t.configServerUrl}));const{base:i,template:a}=getConfigParts(n??e.config),s=parseObfuscatedExternalConfig(i),o=(new PlayerConfigurationBuilder).fromExternalConfiguration(s).withSettings(e);if(a){const t=TemplateParser.parse(a);(null==(r=e.urls)?void 0:r.videoStreamFolderUrl)&&(t.videoStreamFolderUrl=e.urls.videoStreamFolderUrl),await o.applyOnPremiseTemplate(t)}return o.build()};var react={exports:{}},react_production_min={},hasRequiredReact_production_min,hasRequiredReact;function requireReact_production_min(){if(hasRequiredReact_production_min)return react_production_min;hasRequiredReact_production_min=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),d=Symbol.iterator;var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p=Object.assign,f={};function m(e,t,r){this.props=e,this.context=t,this.refs=f,this.updater=r||h}function g(){}function y(e,t,r){this.props=e,this.context=t,this.refs=f,this.updater=r||h}m.prototype.isReactComponent={},m.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},m.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},g.prototype=m.prototype;var v=y.prototype=new g;v.constructor=y,p(v,m.prototype),v.isPureReactComponent=!0;var _=Array.isArray,b=Object.prototype.hasOwnProperty,T={current:null},S={key:!0,ref:!0,__self:!0,__source:!0};function E(t,r,n){var i,a={},s=null,o=null;if(null!=r)for(i in void 0!==r.ref&&(o=r.ref),void 0!==r.key&&(s=""+r.key),r)b.call(r,i)&&!S.hasOwnProperty(i)&&(a[i]=r[i]);var l=arguments.length-2;if(1===l)a.children=n;else if(1>>1,a=e[n];if(!(0>>1;ni(l,r))ui(c,l)?(e[n]=c,e[u]=r,n=u):(e[n]=l,e[o]=r,n=o);else{if(!(ui(c,r)))break e;e[n]=c,e[u]=r,n=u}}}return t}function i(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var a=performance;e.unstable_now=function(){return a.now()}}else{var s=Date,o=s.now();e.unstable_now=function(){return s.now()-o}}var l=[],u=[],c=1,d=null,h=3,p=!1,f=!1,m=!1,g="function"==typeof setTimeout?setTimeout:null,y="function"==typeof clearTimeout?clearTimeout:null,v="undefined"!=typeof setImmediate?setImmediate:null;function _(e){for(var i=r(u);null!==i;){if(null===i.callback)n(u);else{if(!(i.startTime<=e))break;n(u),i.sortIndex=i.expirationTime,t(l,i)}i=r(u)}}function b(e){if(m=!1,_(e),!f)if(null!==r(l))f=!0,D(T);else{var t=r(u);null!==t&&M(b,t.startTime-e)}}function T(t,i){f=!1,m&&(m=!1,y(A),A=-1),p=!0;var a=h;try{for(_(i),d=r(l);null!==d&&(!(d.expirationTime>i)||t&&!P());){var s=d.callback;if("function"==typeof s){d.callback=null,h=d.priorityLevel;var o=s(d.expirationTime<=i);i=e.unstable_now(),"function"==typeof o?d.callback=o:d===r(l)&&n(l),_(i)}else n(l);d=r(l)}if(null!==d)var c=!0;else{var g=r(u);null!==g&&M(b,g.startTime-i),c=!1}return c}finally{d=null,h=a,p=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var S,E=!1,w=null,A=-1,C=5,k=-1;function P(){return!(e.unstable_now()-ke||125s?(n.sortIndex=a,t(u,n),null===r(l)&&n===r(u)&&(m?(y(A),A=-1):m=!0,M(b,a-s))):(n.sortIndex=o,t(l,n),f||p||(f=!0,D(T))),n},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(e){var t=h;return function(){var r=h;h=t;try{return e.apply(this,arguments)}finally{h=r}}}}(scheduler_production_min)),scheduler_production_min}function requireScheduler(){return hasRequiredScheduler||(hasRequiredScheduler=1,scheduler.exports=requireScheduler_production_min()),scheduler.exports} /** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */function requireReactDom_production_min(){if(hasRequiredReactDom_production_min)return reactDom_production_min;hasRequiredReactDom_production_min=1;var e=requireReact(),t=requireScheduler();function r(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r