@inappstory/react-sdk 1.8.0-rc.0 → 1.8.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.mjs +2 -2
- package/dist/index.umd.js +2 -2
- package/dist/types/ias-container/publicEvents.d.ts +0 -6
- package/dist/types/ias-container/storyManagerEventsProps.d.ts +7 -7
- package/dist/types/storyManager.d.ts +3 -6
- package/package.json +2 -2
- package/plugins/banners/index.esm.mjs +1 -1
- package/plugins/banners/types/bannerPlace.d.ts +43 -9
- package/plugins/banners/types/iasBannerPlace.d.ts +12 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react/jsx-runtime";import*as t from"react";import*as r from"mobx-react-lite";import*as n from"classnames";import*as i from"mobx";import*as a from"uuid";import*as s from"react-dom/client";import*as o from"@inappstory/slide-api";var l={371:(e,t,r)=>{r.d(t,{A:()=>a});var n=r(935),i=r.n(n)()((function(e){return e[1]}));i.push([e.id,".banner--EtvvP{width:100%;height:100%;position:relative;border-radius:var(--banner-border-radius, 0px);overflow:hidden}.banner-slides--3xhGF{position:relative;width:100%;height:100%;display:block}",""]),i.locals={banner:"banner--EtvvP","banner-slides":"banner-slides--3xhGF"};const a=i},369:(e,t,r)=>{r.d(t,{A:()=>a});var n=r(935),i=r.n(n)()((function(e){return e[1]}));i.push([e.id,".banner-place--6ZUZe{width:100%;height:100%;position:relative}.banner-slider__slider_visible--1nA2b{border:solid 1px green}",""]),i.locals={"banner-place":"banner-place--6ZUZe","banner-slider__slider_visible":"banner-slider__slider_visible--1nA2b"};const a=i},41:(e,t,r)=>{r.d(t,{A:()=>a});var n=r(935),i=r.n(n)()((function(e){return e[1]}));i.push([e.id,".slider--ggy2P{width:100%;height:100%;overflow:hidden;position:relative;justify-content:center}.slider__track--JSOcI{display:flex;transition:transform .3s ease;width:100%;height:100%;will-change:transform}.slider__slide--oGmUT{width:100%;height:100%;flex-shrink:0;position:relative;display:flex;align-items:center;justify-content:center;transform:translateZ(0)}",""]),i.locals={slider:"slider--ggy2P",slider__track:"slider__track--JSOcI",slider__slide:"slider__slide--oGmUT"};const a=i},379:(e,t,r)=>{r.d(t,{A:()=>a});var n=r(935),i=r.n(n)()((function(e){return e[1]}));i.push([e.id,".slider__controls-btn--HubN5{position:absolute;top:50%;z-index:1;width:24px;height:24px;margin-top:-9px;transition:all .2s ease-in-out;cursor:pointer;padding:0;background-color:rgba(0,0,0,0);color:#0c62f3;border:0;outline:0}.slider__controls-btn--prev--kfXCq{left:1.5rem}.slider__controls-btn--next--Jzq3Q{right:1.5rem}.slider__controls-btn--HubN5{transition:opacity .3s ease-in-out}.slider__controls-btn--disabled--m1P4q{opacity:0;pointer-events:none}",""]),i.locals={"slider__controls-btn":"slider__controls-btn--HubN5","slider__controls-btn--prev":"slider__controls-btn--prev--kfXCq","slider__controls-btn--next":"slider__controls-btn--next--Jzq3Q","slider__controls-btn--disabled":"slider__controls-btn--disabled--m1P4q"};const a=i},55:(e,t,r)=>{r.d(t,{A:()=>a});var n=r(935),i=r.n(n)()((function(e){return e[1]}));i.push([e.id,".slider-bullets--XDc5n{position:absolute;z-index:2;bottom:1.5rem;left:50%;display:inline-flex;list-style:none;transform:translate3d(-50%, 0, 0)}.slider-bullets__bullet--83aBh{background-color:rgba(255,255,255,.5);width:9px;height:9px;padding:0;border-radius:50%;border:2px solid rgba(0,0,0,0);cursor:pointer;line-height:0;box-shadow:0 .25em .5em 0 rgba(0,0,0,.1);margin:0 .25em;transition:transform 100ms ease-in;transform:scale(0.8)}.slider-bullets__bullet--active--RDBez{background-color:#0c62f3;transform:scale(1)}",""]),i.locals={"slider-bullets":"slider-bullets--XDc5n","slider-bullets__bullet":"slider-bullets__bullet--83aBh","slider-bullets__bullet--active":"slider-bullets__bullet--active--RDBez"};const a=i},126:(e,t,r)=>{r.d(t,{A:()=>a});var n=r(935),i=r.n(n)()((function(e){return e[1]}));i.push([e.id,".loader--4uMcs{position:absolute;z-index:10001;top:0;bottom:0;left:0;right:0;display:flex;justify-content:center;align-items:center;background:var(--loader-background, black)}.loader--4uMcs .loader__refresh-btn--5nwxY{color:#fff;cursor:pointer;position:absolute;left:50%;top:50%;transform:translate3d(-50%, -50%, 0);pointer-events:auto;padding:20px;width:32px;height:32px;box-sizing:content-box}.loader--4uMcs .loader__spinner--NRm8E{-ms-flex-negative:0;flex-shrink:0;display:inline-block;width:32px;height:32px;border-radius:50%;border:solid 2px var(--loaderBackgroundColor, white);border-color:var(--loaderBackgroundAccentColor, transparent) var(--loaderBackgroundColor, white) var(--loaderBackgroundColor, white) var(--loaderBackgroundColor, white);-webkit-animation:loading-spinner--LnXd0 .6s infinite linear;animation:loading-spinner--LnXd0 .6s infinite linear}@keyframes loading-spinner--LnXd0{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}",""]),i.locals={loader:"loader--4uMcs","loader__refresh-btn":"loader__refresh-btn--5nwxY",loader__spinner:"loader__spinner--NRm8E","loading-spinner":"loading-spinner--LnXd0"};const a=i},81:(e,t,r)=>{r.d(t,{A:()=>a});var n=r(935),i=r.n(n)()((function(e){return e[1]}));i.push([e.id,".icon--5RBkn{width:2rem;height:2rem}",""]),i.locals={icon:"icon--5RBkn"};const a=i},935:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r=e(t);return t[2]?"@media ".concat(t[2]," {").concat(r,"}"):r})).join("")},t.i=function(e,r,n){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(n)for(var a=0;a<this.length;a++){var s=this[a][0];null!=s&&(i[s]=!0)}for(var o=0;o<e.length;o++){var l=[].concat(e[o]);n&&i[l[0]]||(r&&(l[2]?l[2]="".concat(r," and ").concat(l[2]):l[2]=r),t.push(l))}},t}},46:e=>{var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,a),n(r)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}f(e,t,a,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&f(e,"error",t,{once:!0})}(e,i)}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var s=10;function o(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var i,a,s,c;if(o(r),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),s=a[t]),void 0===s)s=a[t]=r,++e._eventsCount;else if("function"==typeof s?s=a[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=l(e))>0&&s.length>i&&!s.warned){s.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=e,d.type=t,d.count=s.length,c=d,console&&console.warn&&console.warn(c)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=d.bind(n);return i.listener=r,n.wrapFn=i,i}function u(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):b(i,i.length)}function p(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function b(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function f(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(a){n.once&&e.removeEventListener(t,i),r(a)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return l(this)},a.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,a=this._events;if(void 0!==a)i=i&&void 0===a.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var l=a[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else{var c=l.length,d=b(l,c);for(r=0;r<c;++r)n(d[r],this,t)}return!0},a.prototype.addListener=function(e,t){return c(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return c(this,e,t,!0)},a.prototype.once=function(e,t){return o(t),this.on(e,h(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return o(t),this.prependListener(e,h(this,e,t)),this},a.prototype.removeListener=function(e,t){var r,n,i,a,s;if(o(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,a=r.length-1;a>=0;a--)if(r[a]===t||r[a].listener===t){s=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,a=Object.keys(r);for(n=0;n<a.length;++n)"removeListener"!==(i=a[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},a.prototype.listeners=function(e){return u(this,e,!0)},a.prototype.rawListeners=function(e){return u(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},a.prototype.listenerCount=p,a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},591:(e,t,r)=>{var n,i=function(){var e={};return function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}e[t]=r}return e[t]}}(),a=[];function s(e){for(var t=-1,r=0;r<a.length;r++)if(a[r].identifier===e){t=r;break}return t}function o(e,t){for(var r={},n=[],i=0;i<e.length;i++){var o=e[i],l=t.base?o[0]+t.base:o[0],c=r[l]||0,d="".concat(l," ").concat(c);r[l]=c+1;var h=s(d),u={css:o[1],media:o[2],sourceMap:o[3]};-1!==h?(a[h].references++,a[h].updater(u)):a.push({identifier:d,updater:f(u,t),references:1}),n.push(d)}return n}function l(e){var t=document.createElement("style"),n=e.attributes||{};if(void 0===n.nonce){var a=r.nc;a&&(n.nonce=a)}if(Object.keys(n).forEach((function(e){t.setAttribute(e,n[e])})),"function"==typeof e.insert)e.insert(t);else{var s=i(e.insert||"head");if(!s)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");s.appendChild(t)}return t}var c,d=(c=[],function(e,t){return c[e]=t,c.filter(Boolean).join("\n")});function h(e,t,r,n){var i=r?"":n.media?"@media ".concat(n.media," {").concat(n.css,"}"):n.css;if(e.styleSheet)e.styleSheet.cssText=d(t,i);else{var a=document.createTextNode(i),s=e.childNodes;s[t]&&e.removeChild(s[t]),s.length?e.insertBefore(a,s[t]):e.appendChild(a)}}function u(e,t,r){var n=r.css,i=r.media,a=r.sourceMap;if(i?e.setAttribute("media",i):e.removeAttribute("media"),a&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var p=null,b=0;function f(e,t){var r,n,i;if(t.singleton){var a=b++;r=p||(p=l(t)),n=h.bind(null,r,a,!1),i=h.bind(null,r,a,!0)}else r=l(t),n=u.bind(null,r,t),i=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(r)};return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else i()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=(void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n));var r=o(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var n=0;n<r.length;n++){var i=s(r[n]);a[i].references--}for(var l=o(e,t),c=0;c<r.length;c++){var d=s(r[c]);0===a[d].references&&(a[d].updater(),a.splice(d,1))}r=l}}}},968:(e,t,r)=>{const n=document.querySelector("[nonce]");n&&(r.nc=n.nonce||n.getAttribute("nonce"))}},c={};function d(e){var t=c[e];if(void 0!==t)return t.exports;var r=c[e]={id:e,exports:{}};return l[e](r,r.exports,d),r.exports}d.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return d.d(t,{a:t}),t},d.d=(e,t)=>{for(var r in t)d.o(t,r)&&!d.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),d.nc=void 0;var h={};(()=>{d.d(h,{RE:()=>je,Sr:()=>Ie,YL:()=>Qt,Ay:()=>Jt}),d(968);const l=(e=>{var t={};return d.d(t,e),t})({jsx:()=>e.jsx,jsxs:()=>e.jsxs}),c=(e=>{var t={};return d.d(t,e),t})({useEffect:()=>t.useEffect,useLayoutEffect:()=>t.useLayoutEffect,useRef:()=>t.useRef,useState:()=>t.useState}),u=(e=>{var t={};return d.d(t,e),t})({observer:()=>r.observer});var p=d(591),b=d.n(p),f=d(371);b()(f.A,{insert:"head",singleton:!1});const m=f.A.locals||{};var v=d(126);b()(v.A,{insert:"head",singleton:!1});const g=v.A.locals||{};var y=d(81);b()(y.A,{insert:"head",singleton:!1});const w=y.A.locals||{},_=(e=>{var t={};return d.d(t,e),t})({default:()=>n.default}),S=({onClick:e,className:t})=>(0,l.jsx)("div",{className:(0,_.default)(w.icon,t),onClick:e,children:(0,l.jsx)("svg",{viewBox:"0 0 24 24",children:(0,l.jsx)("path",{fill:"currentColor",d:"M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z"})})}),P=(0,u.observer)((e=>{const t=e.needShowErrorScreen,r=e.needShowLoaderScreen;return r||t?(0,l.jsx)("div",{className:(0,_.default)(g.loader),style:{"--loader-background":e.background,"--loaderBackgroundColor":e.color},onClick:e=>{e.preventDefault()},children:t?(0,l.jsx)(S,{className:g["loader__refresh-btn"],onClick:t=>{t.stopPropagation(),e.onReload()}}):r&&(0,l.jsx)("div",{className:g.loader__spinner})}):null})),E=()=>null!==d.nc&&void 0!==d.nc?d.nc:"";class x extends HTMLElement{constructor(){super(...arguments),Object.defineProperty(this,"styleElement",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"mountPoint",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"handleClick",{enumerable:!0,configurable:!0,writable:!0,value:e=>{var t;this.shadowRoot&&"true"===this.shadowRoot.host.getAttribute("allow-click")&&(null===(t=this.banner)||void 0===t||t.activeSlide.onClick({event:e,currentTarget:this.shadowRoot.host}))}})}setBanner(e){this.banner=e}setStyle(e){var t;this.styleElement&&this.styleElement.parentNode&&this.styleElement.parentNode.removeChild(this.styleElement);const r=document.createElement("style");r.textContent=e,r.setAttribute("nonce",E()),this.styleElement=r,null===(t=this.shadowRoot)||void 0===t||t.prepend(r)}async init(){this.mountPoint&&this.banner&&(this.mountPoint.addEventListener("click",this.handleClick),await this.banner.attachRoot(this.mountPoint))}destroy(){var e,t;null===(e=this.banner)||void 0===e||e.detachRoot(),null===(t=this.mountPoint)||void 0===t||t.removeEventListener("click",this.handleClick)}connectedCallback(){if(this.shadowRoot)return;const e=this.attachShadow({mode:"open"});this.mountPoint=document.createElement("div"),this.mountPoint.style.height="100%",this.mountPoint.style.width="100%",e.appendChild(this.mountPoint)}disconnectedCallback(){}}function T(e){const t=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)$/i);if(t){const[e,r,n,i]=t.map(Number);return(299*r+587*n+114*i)/1e3>128}if(e.startsWith("#")){const t=e.slice(1);let r,n,i;if(3===t.length)r=parseInt(t[0]+t[0],16),n=parseInt(t[1]+t[1],16),i=parseInt(t[2]+t[2],16);else{if(6!==t.length)return!1;r=parseInt(t.slice(0,2),16),n=parseInt(t.slice(2,4),16),i=parseInt(t.slice(4,6),16)}return(299*r+587*n+114*i)/1e3>128}return!0}customElements.get("banner-slides-container")||customElements.define("banner-slides-container",x);const O=(0,u.observer)((e=>{var{banner:t}=e,r=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(e,["banner"]);const n=(0,c.useRef)(null),i=(0,c.useRef)(null);return(0,c.useLayoutEffect)((()=>{n.current&&n.current.setStyle(t.context.style)}),[t.context.style]),(0,c.useLayoutEffect)((()=>{if(!n.current)return;const e=n.current;return e.setBanner(t),e.init(),()=>{e.destroy()}}),[t]),(0,c.useEffect)((()=>{if(r.isActive&&t.canBeShown)return t.start(),()=>{t.stop()}}),[t,r.isActive,t.canBeShown]),(0,l.jsxs)("div",{className:(0,_.default)(m.banner,"ias-banner",r.className),ref:i,style:{height:t.width/t.contentRatio+"px",opacity:t.canBeShown?1:0,background:t.appearance.background,"--banner-border-radius":`${r.clientAppearance.borderRadius}px`},children:[(0,l.jsx)("banner-slides-container",{class:m["banner-slides"],ref:n,"allow-click":r.allowClick.toString(),dir:t.dir}),(0,l.jsx)(P,{needShowErrorScreen:t.needShowErrorScreen,needShowLoaderScreen:t.needShowLoaderScreen,onReload:async()=>{t.activeSlide.restart()},background:t.appearance.background,color:T(t.appearance.background)?"black":"white"})]})}));var j=d(369);b()(j.A,{insert:"head",singleton:!1});const I=j.A.locals||{},L=(e=>{var t={};return d.d(t,e),t})({action:()=>i.action,computed:()=>i.computed,observable:()=>i.observable,reaction:()=>i.reaction});var C=function(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0};let k=(()=>{var e,t;let r,n=[],i=[];return e=class{get _context(){return function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}(this,t,"f")}set _context(e){!function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?i.call(e,r):i?i.value=r:t.set(e,r)}(this,t,e,"f")}constructor(e){t.set(this,C(this,n,void 0)),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:C(this,i)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"displayFrom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"displayTo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"appearance",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"slides",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_wasShown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_frequencyLimit",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_openTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_isOnceOpened",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this.id=e.id,this.name=e.name,this.displayFrom=e.displayFrom,this.displayTo=e.displayTo,this.slides=e.slides,this._context=e.context,this.appearance=e.appearance}get context(){return this._context}get withinDisplayTimeRange(){return(!this.displayFrom||Date.now()>=this.displayFrom)&&(!this.displayTo||Date.now()<=this.displayTo)}get wasShown(){return this._wasShown}get frequencyLimitTimeExceeded(){return null===this._frequencyLimit?this._isOnceOpened:0!==this._frequencyLimit&&Math.trunc(this.timeSinceLastShow/1e3)<=this._frequencyLimit}get timeSinceLastShow(){return Date.now()-this._openTime}get openTime(){return this._openTime}updatePlaceholders(e){for(const t of this.slides)t.updatePlaceholders(e)}markWasShown(){this._wasShown=!0}markAsOpened(){this._openTime=Date.now(),this._isOnceOpened=!0}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[L.observable],function(e,t,r,n,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?n.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),u=!1,p=r.length-1;p>=0;p--){var b={};for(var f in n)b[f]="access"===f?{}:n[f];for(var f in n.access)b.access[f]=n.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,n.name,h),u=!0}(e,null,r,{kind:"accessor",name:"_context",static:!1,private:!1,access:{has:e=>"_context"in e,get:e=>e._context,set:(e,t)=>{e._context=t}},metadata:t},n,i),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class A{constructor(e){var t;Object.defineProperty(this,"contentRatio",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"background",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.contentRatio=null!==(t=e.content_ratio)&&void 0!==t?t:1,this.background=this.mapBackgroundDtoToModel(e.background)}mapBackgroundDtoToModel(e){if(!e||0===e.alpha)return"transparent";if("solid"in e)return this.applyAlphaToColor(e.solid,e.alpha);if("linear_gradient"in e){const{angle:t,color_step_list:r}=e.linear_gradient;return`linear-gradient(${t}deg, ${r.map((t=>`${this.applyAlphaToColor(t.color,e.alpha)} ${t.position}%`)).join(", ")})`}return"transparent"}applyAlphaToColor(e,t){if(e.startsWith("#")){const r=e.slice(1),n=3===r.length;return`rgba(${parseInt(n?r[0]+r[0]:r.slice(0,2),16)}, ${parseInt(n?r[1]+r[1]:r.slice(2,4),16)}, ${parseInt(n?r[2]+r[2]:r.slice(4,6),16)}, ${t})`}return e}}class B{constructor(e,t){Object.defineProperty(this,"widgetsData",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"style",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.style=t.style,this.widgetsData=this.mapBannerContextDto(e,t)}mapBannerContextDto(e,t){var r;const n={},i=null!==(r=t.widgetsData)&&void 0!==r?r:{};for(const t in i)Array.isArray(i[t])||(n[t]=i[t][e]);return n}updateNarrativeSavedData(e){this.widgetsData._narrative_saved_data=e}}function M(e,t,r){return String(e).replace(new RegExp(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(t),"g"),(()=>r))}var R=function(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0};let D=(()=>{var e,t;let r,n=[],i=[];return e=class{get _html(){return function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}(this,t,"f")}set _html(e){!function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?i.call(e,r):i?i.value=r:t.set(e,r)}(this,t,e,"f")}get html(){return this._html}constructor(e){t.set(this,R(this,n,void 0)),R(this,i),this._html=this.replaceSlideNonce(e.html)}updatePlaceholders(e){let t=this._html;for(const r of e)t=M(t,`%${r.key}%`,r.value);this._html=t}replaceSlideNonce(e){var t;return M(e,"{{nonce}}",null!==(t=E())&&void 0!==t?t:"")}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[L.observable],function(e,t,r,n,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?n.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),u=!1,p=r.length-1;p>=0;p--){var b={};for(var f in n)b[f]="access"===f?{}:n[f];for(var f in n.access)b.access[f]=n.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,n.name,h),u=!0}(e,null,r,{kind:"accessor",name:"_html",static:!1,private:!1,access:{has:e=>"_html"in e,get:e=>e._html,set:(e,t)=>{e._html=t}},metadata:t},n,i),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();var N=function(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0};let z=(()=>{var e,t;let r,n=[],i=[];return e=class{get _banners(){return function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}(this,t,"f")}set _banners(e){!function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?i.call(e,r):i?i.value=r:t.set(e,r)}(this,t,e,"f")}constructor(e){Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"style",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),t.set(this,N(this,n,[])),N(this,i),this.id=e.id,this._banners=e.banners,this.style=e.style,this.updatePlaceholders(e.placeholders)}get banners(){return this._banners}updatePlaceholders(e){for(const t of this._banners)t.updatePlaceholders(e)}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[L.observable],function(e,t,r,n,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?n.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),u=!1,p=r.length-1;p>=0;p--){var b={};for(var f in n)b[f]="access"===f?{}:n[f];for(var f in n.access)b.access[f]=n.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,n.name,h),u=!0}(e,null,r,{kind:"accessor",name:"_banners",static:!1,private:!1,access:{has:e=>"_banners"in e,get:e=>e._banners,set:(e,t)=>{e._banners=t}},metadata:t},n,i),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();const W=(e,t)=>{if("number"==typeof e)return e;if("string"==typeof e){const t=parseFloat(e);if(!isNaN(t))return t}return t};var F=function(e,t,r,n,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?n.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),u=!1,p=r.length-1;p>=0;p--){var b={};for(var f in n)b[f]="access"===f?{}:n[f];for(var f in n.access)b.access[f]=n.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,n.name,h),u=!0},V=function(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0},U=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},q=function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r};let $=(()=>{var e,t;let r,n=[],i=[];return e=class{get borderRadius(){return U(this,t,"f")}set borderRadius(e){q(this,t,e,"f")}update(e){this.borderRadius=W(null==e?void 0:e.borderRadius,this.borderRadius)}constructor(){t.set(this,V(this,n,12)),V(this,i)}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[L.observable],F(e,null,r,{kind:"accessor",name:"borderRadius",static:!1,private:!1,access:{has:e=>"borderRadius"in e,get:e=>e.borderRadius,set:(e,t)=>{e.borderRadius=t}},metadata:t},n,i),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})(),G=(()=>{var e,t,r,n,i,a,s,o;let l,c,d,h,u,p,b,f=[],m=[],v=[],g=[],y=[],w=[],_=[],S=[],P=[],E=[],x=[],T=[],O=[],j=[];return e=class{get loop(){return U(this,t,"f")}set loop(e){q(this,t,e,"f")}get gap(){return U(this,r,"f")}set gap(e){q(this,r,e,"f")}get autoplay(){return U(this,n,"f")}set autoplay(e){q(this,n,e,"f")}get animationSpeed(){return U(this,i,"f")}set animationSpeed(e){q(this,i,e,"f")}get slidesPerView(){return U(this,a,"f")}set slidesPerView(e){q(this,a,e,"f")}get navigation(){return U(this,s,"f")}set navigation(e){q(this,s,e,"f")}get pagination(){return U(this,o,"f")}set pagination(e){q(this,o,e,"f")}constructor(e){t.set(this,V(this,f,!0)),r.set(this,(V(this,m),V(this,v,16))),n.set(this,(V(this,g),V(this,y,!1))),i.set(this,(V(this,w),V(this,_,300))),a.set(this,(V(this,S),V(this,P,1))),s.set(this,(V(this,E),V(this,x,{enabled:!0}))),o.set(this,(V(this,T),V(this,O,{enabled:!0}))),Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:(V(this,j),new $)}),e&&this.update(e)}update(e){var t,r,n,i,a,s;this.loop=null!==(t=null==e?void 0:e.loop)&&void 0!==t?t:this.loop,this.gap=W(null==e?void 0:e.gap,this.gap),this.autoplay=null!==(r=null==e?void 0:e.autoplay)&&void 0!==r?r:this.autoplay,this.animationSpeed=W(null==e?void 0:e.animationSpeed,this.animationSpeed),this.slidesPerView=Math.max(W(null==e?void 0:e.slidesPerView,this.slidesPerView),0),this.navigation={enabled:null!==(i=null===(n=null==e?void 0:e.navigation)||void 0===n?void 0:n.enabled)&&void 0!==i?i:this.navigation.enabled},this.pagination={enabled:null!==(s=null===(a=null==e?void 0:e.pagination)||void 0===a?void 0:a.enabled)&&void 0!==s?s:this.pagination.enabled},this.banner.update(e.banner)}},t=new WeakMap,r=new WeakMap,n=new WeakMap,i=new WeakMap,a=new WeakMap,s=new WeakMap,o=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;l=[L.observable],c=[L.observable],d=[L.observable],h=[L.observable],u=[L.observable],p=[L.observable],b=[L.observable],F(e,null,l,{kind:"accessor",name:"loop",static:!1,private:!1,access:{has:e=>"loop"in e,get:e=>e.loop,set:(e,t)=>{e.loop=t}},metadata:t},f,m),F(e,null,c,{kind:"accessor",name:"gap",static:!1,private:!1,access:{has:e=>"gap"in e,get:e=>e.gap,set:(e,t)=>{e.gap=t}},metadata:t},v,g),F(e,null,d,{kind:"accessor",name:"autoplay",static:!1,private:!1,access:{has:e=>"autoplay"in e,get:e=>e.autoplay,set:(e,t)=>{e.autoplay=t}},metadata:t},y,w),F(e,null,h,{kind:"accessor",name:"animationSpeed",static:!1,private:!1,access:{has:e=>"animationSpeed"in e,get:e=>e.animationSpeed,set:(e,t)=>{e.animationSpeed=t}},metadata:t},_,S),F(e,null,u,{kind:"accessor",name:"slidesPerView",static:!1,private:!1,access:{has:e=>"slidesPerView"in e,get:e=>e.slidesPerView,set:(e,t)=>{e.slidesPerView=t}},metadata:t},P,E),F(e,null,p,{kind:"accessor",name:"navigation",static:!1,private:!1,access:{has:e=>"navigation"in e,get:e=>e.navigation,set:(e,t)=>{e.navigation=t}},metadata:t},x,T),F(e,null,b,{kind:"accessor",name:"pagination",static:!1,private:!1,access:{has:e=>"pagination"in e,get:e=>e.pagination,set:(e,t)=>{e.pagination=t}},metadata:t},O,j),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();const H=(e=>{var t={};return d.d(t,e),t})({v4:()=>a.v4});class X{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"eventId",{enumerable:!0,configurable:!0,writable:!0,value:(0,H.v4)()})}get type(){return"view"}toQueryParams(){return{ei:this.eventId,ii:this.payload.iterationId,si:this.payload.slideIndex,st:this.payload.slideTotal}}}class Y{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"eventId",{enumerable:!0,configurable:!0,writable:!0,value:(0,H.v4)()})}get type(){return this.payload.type}toQueryParams(){return Object.assign({ei:this.eventId,ii:this.payload.iterationId,si:this.payload.slideIndex,st:this.payload.slideTotal,d:this.payload.durationMs},this.payload.widgetPayload)}}var Q=d(46);class J{constructor(){Object.defineProperty(this,"autoplay",{enumerable:!0,configurable:!0,writable:!0,value:{isPaused:function(){return!1},resume:function(){},pause:function(){},start:function(){},stop:function(){},setDelay:function(){}}})}updateSize(){}enableHorizontalSwipeGesture(){}disableHorizontalSwipeGesture(){}getTotalPages(){return 1}getActiveIndex(){return 0}toNextSlide(){}toPrevSlide(){}slideTo(e,t){}}var Z,K=function(e,t,r,n,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?n.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),u=!1,p=r.length-1;p>=0;p--){var b={};for(var f in n)b[f]="access"===f?{}:n[f];for(var f in n.access)b.access[f]=n.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,n.name,h),u=!0},ee=function(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0},te=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},re=function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r};!function(e){e.Play="play",e.Stop="stop",e.LoadStart="loadStart",e.LoadEnd="loadEnd",e.LoadError="loadError",e.ActiveIndexChange="activeIndexChange"}(Z||(Z={}));let ne=(()=>{var e,t,r,n,i;let a,s,o,l,c=Q.EventEmitter,d=[],h=[],u=[],p=[],b=[],f=[],m=[],v=[];return e=class extends c{get _banners(){return te(this,t,"f")}set _banners(e){re(this,t,e,"f")}get _bannerPlace(){return te(this,r,"f")}set _bannerPlace(e){re(this,r,e,"f")}get _isLoading(){return te(this,n,"f")}set _isLoading(e){re(this,n,e,"f")}get _isLoaded(){return te(this,i,"f")}set _isLoaded(e){re(this,i,e,"f")}constructor(e,a,s,o,l){super(),Object.defineProperty(this,"placeId",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"bannerStatisticService",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"bannerStore",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"bannerViewModelFactory",{enumerable:!0,configurable:!0,writable:!0,value:l}),t.set(this,ee(this,d,[])),r.set(this,(ee(this,h),ee(this,u,null))),n.set(this,(ee(this,p),ee(this,b,!1))),i.set(this,(ee(this,f),ee(this,m,!1))),Object.defineProperty(this,"appearance",{enumerable:!0,configurable:!0,writable:!0,value:(ee(this,v),new G)}),Object.defineProperty(this,"sliderController",{enumerable:!0,configurable:!0,writable:!0,value:new J}),this.ctx.addBannerPlace(this)}get id(){return this.placeId}get banners(){return this._banners}get contentRatio(){const e=this._banners.map((e=>e.contentRatio));return this.median(e)}get isLoaded(){return this._isLoaded}get isLoading(){return this._isLoading}get slider(){return this.sliderController}get activeIndex(){return this.sliderController.getActiveIndex()}refreshSizes(){this._banners.forEach((e=>e.refreshSizes()))}setSliderController(e){this.sliderController=e}updateAppearance(e){this.appearance.update(e)}play(){for(const e of this._banners)e.resume()}stop(){for(const e of this._banners)e.pause()}resume(){if(this.appearance.autoplay){this.slider.autoplay.resume();for(const e of this._banners)e.resumeByUser()}}pause(){if(this.appearance.autoplay){this.slider.autoplay.pause();for(const e of this._banners)e.pauseByUser()}}async reload(){this.bannerStore.removeBannerPlaceById(this.id),await Promise.all(this._banners.map((e=>e.destroy()))),this._banners=[],await this.fetchBanners()}destroy(){this.sliderController=new J;for(const e of this._banners)e.destroy();this._banners=[],this.ctx.removeBannerPlace(this)}async updateUserData(e){return this.bannerStore.updateBannerUserData(this.id,e)}async fetchBanners(){try{return this._isLoading?[]:(this._isLoading=!0,this._isLoaded=!1,this.emit(Z.LoadStart),this._bannerPlace=await this.bannerStore.getBannerPlaceById({placeId:this.placeId}),this._banners=this.filterBannersByTimeRange(this._bannerPlace.banners).map((e=>this.bannerViewModelFactory.create(this,e))),await Promise.allSettled(this._banners.map((e=>e.waitInit()))),this._isLoaded=!0,this._banners)}catch(e){throw this.emit(Z.LoadError,e),e}finally{this.emit(Z.LoadEnd),this._isLoading=!1}}filterBannersByTimeRange(e){return e.filter((e=>e.withinDisplayTimeRange))}median(e){const t=[...e].sort(((e,t)=>e-t)),r=Math.floor(t.length/2);return t.length%2==0?(t[r-1]+t[r])/2:t[r]}},t=new WeakMap,r=new WeakMap,n=new WeakMap,i=new WeakMap,(()=>{var t;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=c[Symbol.metadata])&&void 0!==t?t:null):void 0;a=[L.observable],s=[L.observable],o=[L.observable],l=[L.observable],K(e,null,a,{kind:"accessor",name:"_banners",static:!1,private:!1,access:{has:e=>"_banners"in e,get:e=>e._banners,set:(e,t)=>{e._banners=t}},metadata:r},d,h),K(e,null,s,{kind:"accessor",name:"_bannerPlace",static:!1,private:!1,access:{has:e=>"_bannerPlace"in e,get:e=>e._bannerPlace,set:(e,t)=>{e._bannerPlace=t}},metadata:r},u,p),K(e,null,o,{kind:"accessor",name:"_isLoading",static:!1,private:!1,access:{has:e=>"_isLoading"in e,get:e=>e._isLoading,set:(e,t)=>{e._isLoading=t}},metadata:r},b,f),K(e,null,l,{kind:"accessor",name:"_isLoaded",static:!1,private:!1,access:{has:e=>"_isLoaded"in e,get:e=>e._isLoaded,set:(e,t)=>{e._isLoaded=t}},metadata:r},m,v),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),e})();const ie=e=>((0,c.useEffect)((()=>(e.onLoadStart&&e.bannerPlace.on(Z.LoadStart,e.onLoadStart),e.onLoadEnd&&e.bannerPlace.on(Z.LoadEnd,e.onLoadEnd),e.onLoadError&&e.bannerPlace.on(Z.LoadError,e.onLoadError),()=>{e.onLoadStart&&e.bannerPlace.off(Z.LoadStart,e.onLoadStart),e.onLoadEnd&&e.bannerPlace.off(Z.LoadEnd,e.onLoadEnd),e.onLoadError&&e.bannerPlace.off(Z.LoadError,e.onLoadError)})),[e.bannerPlace,e.onLoadStart,e.onLoadError,e.onLoadEnd]),(0,c.useEffect)((()=>{(async e=>{try{await e.fetchBanners()}catch(e){console.error(e)}})(e.bannerPlace)}),[e.bannerPlace]),e.bannerPlace.banners);class ae{constructor(e){Object.defineProperty(this,"slider",{enumerable:!0,configurable:!0,writable:!0,value:e})}isPaused(){return this.slider.autoplay.paused}resume(){this.slider.autoplay.resume()}pause(){this.slider.autoplay.pause()}start(){this.slider.autoplay.start()}setDelay(e){this.slider.autoplay.setDelay(e)}stop(){this.slider.autoplay.stop()}}class se{constructor(e){Object.defineProperty(this,"slider",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"autoplay",{enumerable:!0,configurable:!0,writable:!0,value:new ae(this.slider)})}getTotalPages(){return this.slider.totalPages}getActiveIndex(){return this.slider.realIndex}toNextSlide(){this.slider.toNextSlide()}toPrevSlide(){this.slider.toPrevSlide()}slideTo(e,t){this.slider.slideToLoop(e,t)}enableHorizontalSwipeGesture(){this.slider.enableHorizontalSwipeGesture()}disableHorizontalSwipeGesture(){this.slider.disableHorizontalSwipeGesture()}updateSize(){this.slider.updateSize()}}var oe=d(55);b()(oe.A,{insert:"head",singleton:!1});const le=oe.A.locals||{},ce=e=>{const[t,r]=(0,c.useState)(-1);return(0,c.useEffect)((()=>{e.activeIndex===t&&r(-1)}),[e.activeIndex,t]),e.totalPages>1&&(0,l.jsx)("div",{className:(0,_.default)(le["slider-bullets"],"ias-slider-bullets"),children:Array.from({length:e.totalPages}).map(((t,n)=>(0,l.jsx)("div",{className:(0,_.default)("ias-slider-bullets__bullet",le["slider-bullets__bullet"],{[le["slider-bullets__bullet--active"]]:n===e.activeIndex,"ias-slider-bullets__bullet--active":n===e.activeIndex}),onClick:()=>(t=>{r(t),e.onClick(t)})(n)},n)))})};var de=d(41);b()(de.A,{insert:"head",singleton:!1});const he=de.A.locals||{};var ue=d(379);b()(ue.A,{insert:"head",singleton:!1});const pe=ue.A.locals||{},be=e=>(0,l.jsxs)("div",{children:[(0,l.jsx)("button",{onClick:e.onPrevClick,className:(0,_.default)("ias-slider__controls-btn","ias-slider__controls-btn--prev",pe["slider__controls-btn"],pe["slider__controls-btn--prev"],{[pe["slider__controls-btn--disabled"]]:e.prevDisabled,"ias-slider__controls-btn--disabled":e.prevDisabled}),children:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{d:"M0 12l10.975 11 2.848-2.828-6.176-6.176H24v-3.992H7.646l6.176-6.176L10.975 1 0 12z",fill:"currentColor"})})}),(0,l.jsx)("button",{onClick:e.onNextClick,className:(0,_.default)("ias-slider__controls-btn","ias-slider__controls-btn--next",pe["slider__controls-btn"],pe["slider__controls-btn--next"],{[pe["slider__controls-btn--disabled"]]:e.nextDisabled,"ias-slider__controls-btn--disabled":e.nextDisabled}),children:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{d:"M13.025 1l-2.847 2.828 6.176 6.176h-16.354v3.992h16.354l-6.176 6.176 2.847 2.828 10.975-11z",fill:"currentColor"})})})]});class fe{constructor(e){Object.defineProperty(this,"slider",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_enabled",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get enabled(){return this._enabled}update(){const e=this.slider.options.loop&&this.canUseLoop();this._enabled?e||(this._enabled=!1,this.destroy()):e&&(this._enabled=!0)}applyLoopFix({targetIndex:e,direction:t}){if(!this.enabled)return!1;const r="next"===t||!t,n="prev"!==t&&t?[]:this.getPrependSlidesIndexes(e),i=r?this.getAppendSlidesIndexes(e):[];return this.moveSlides(n,i),this.adjustPosition(n,i),n.length>0||i.length>0}destroy(){this.resetSlidesOrder()}resetSlidesOrder(){const e=[];this.slider.slides.forEach((t=>{const r=+t.dataset.index;e[r]=t})),e.forEach((e=>{this.slider.track.append(e)}))}canUseLoop(){return!(this.slider.slides.length<this.slider.options.slidesPerView+1&&(console.warn("IAS Banners Loop Warning: The number of slides is not enough for loop mode, it will be disabled or not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView parameters"),1))}getPrependSlidesIndexes(e){const t=this.slider.track.children,r=[];if(e<1)for(let n=0;n<1-e;n++){const e=t.length-n-1;r.push(e)}return r}getAppendSlidesIndexes(e){const t=[];if(e+this.slider.options.slidesPerView>this.slider.slides.length-1){const r=Math.max(e-(this.slider.slides.length-2),1);for(let e=0;e<r;e++){const r=e;t.push(r)}}return t}moveSlides(e,t){const r=this.slider.track,n=this.slider.slides.slice();e.forEach((e=>{r.prepend(n[e])})),t.forEach((e=>{r.append(n[e])}))}adjustPosition(e,t){e.length>0?this.slider.slideTo(this.slider.activeIndex+e.length,0):t.length>0&&this.slider.slideTo(this.slider.activeIndex-t.length,0)}}var me,ve;!function(e){e.TouchStart="touchStart",e.TouchMove="touchMove",e.TouchEnd="touchEnd",e.ReachStart="reachStart",e.ReachEnd="reachEnd",e.ActiveIndexChange="activeIndexChange",e.RealIndexChnage="realIndexChange",e.TransitionStart="transitionStart",e.TransitionEnd="transitionend",e.Resize="resize",e.SlidesUpdated="slidesUpdated"}(me||(me={}));class ge{constructor(e,t){Object.defineProperty(this,"slider",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"loopModule",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"startX",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"startTranslateX",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"isTouched",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isMoved",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_enabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"startDirection",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"onTouchStart",{enumerable:!0,configurable:!0,writable:!0,value:e=>{!this.slider.animating&&this._enabled&&(e.stopPropagation(),this.startX=e instanceof MouseEvent?e.pageX:e.touches[0].clientX,this.startTranslateX=this.slider.currentTranslateX,this.isTouched=!0,this.setGrabCursor(!1))}}),Object.defineProperty(this,"onTouchMove",{enumerable:!0,configurable:!0,writable:!0,value:e=>{if(!this.isTouched)return;e.stopPropagation();let t=(e instanceof MouseEvent?e.pageX:e.touches[0].clientX)-this.startX;if(t*=1,!(Math.abs(t)>20||this._isMoved))return;this.setGrabCursor(!0),this._isMoved||(this.slider.emit(me.TouchStart),this.slider.autoplay.pause(),this.slider.lockActiveIndex(),this.startDirection=this.getSwipeDirection(t)),this._isMoved=!0;const r="next"===this.startDirection?20:-20;this.slider.emit(me.TouchMove);let n=this.startTranslateX+t+r;this.applyLoopFix(n),n=this.startTranslateX+t+r,this.setTranslate(n)}}),Object.defineProperty(this,"onTouchEnd",{enumerable:!0,configurable:!0,writable:!0,value:()=>{this.isTouched&&(this.slider.unlockActiveIndex(),this.updateActiveIndex(),this.unsetGrabCursor(),this.isTouched=!1,this._isMoved=!1,this.slider.emit(me.TouchEnd),this.slider.autoplay.resume())}}),this.slider.track.addEventListener("mousedown",this.onTouchStart,{passive:!0}),document.addEventListener("mousemove",this.onTouchMove,{passive:!0}),document.addEventListener("mouseup",this.onTouchEnd),this.slider.track.addEventListener("touchstart",this.onTouchStart,{passive:!0}),document.addEventListener("touchmove",this.onTouchMove,{passive:!0}),document.addEventListener("touchend",this.onTouchEnd)}get isMoved(){return this._isMoved}enableHorizontalSwipeGesture(){this._enabled=!0}disableHorizontalSwipeGesture(){this._enabled=!1}destroy(){this.slider.track.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd),this.slider.track.removeEventListener("mousedown",this.onTouchStart),document.removeEventListener("mousemove",this.onTouchMove),document.removeEventListener("mouseup",this.onTouchEnd)}setTranslate(e){e=this.applyEdgeResistance(e),this.slider.setTranslate(e)}applyLoopFix(e){if(!this.loopModule.enabled)return;e=-e;const t=this.slider.slideWidth+this.slider.options.spaceBetween,r=this.slider.getMinTranslate(),n=Math.abs(this.slider.getSlideOffset(this.slider.slides.length-this.slider.options.slidesPerView));e<r?this.loopModule.applyLoopFix({targetIndex:0,direction:"prev"})&&(this.startTranslateX-=t):e>n&&this.loopModule.applyLoopFix({targetIndex:this.slider.slides.length-this.slider.options.slidesPerView,direction:"next"})&&(this.startTranslateX+=t)}updateActiveIndex(){var e;if(!this.slider.slides.length)return;const{currentTranslateX:t,slides:r,options:n}=this.slider,i=(null===(e=r[0])||void 0===e?void 0:e.clientWidth)+n.spaceBetween;let a=-Math.round(t/i);const s=this.slider.totalPages-1;a=Math.min(s,Math.max(0,a)),this.slider.slideTo(a)}setGrabCursor(e){this.slider.track.style.cursor="move",this.slider.track.style.cursor=e?"grabbing":"grab"}unsetGrabCursor(){this.slider.track.style.cursor=""}getResistanceCoeff(e){const t=Math.min(Math.abs(e)/(.5*this.slider.slides[0].clientWidth),1);return.3+.7*Math.exp(3*-t)}applyEdgeResistance(e){if(this.loopModule.enabled)return e;e=-e;const t=this.slider.getMinTranslate(),r=-this.slider.getMaxTranslate();if(e>r){const t=e-r;e=r+t*this.getResistanceCoeff(t)}else if(e<t){const r=t-e;e=t-r*this.getResistanceCoeff(r)}return-e}getSwipeDirection(e){return e>0?"prev":"next"}}!function(e){e.Start="start",e.Stop="stop",e.Pause="pause",e.Resume="resume",e.Progress="progress",e.Complete="complete"}(ve||(ve={}));class ye extends Q.EventEmitter{constructor(){super(...arguments),Object.defineProperty(this,"timerId",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"currentProgress",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"progressBeforePause",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"timerPaused",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"isCompleted",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"enabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"rafId",{enumerable:!0,configurable:!0,writable:!0,value:0})}get started(){return!this.isCompleted}get paused(){return this.timerPaused}setTimer(e){0!==e?(this.timerId=setTimeout((()=>this.complete({})),e),this.currentProgress=0,this.runTimerTicks(e)):this.forceEnd()}start(e){this.timerPaused||(this.stop(),this.progressBeforePause=0,this.timeout=e,this.enabled&&(this.isCompleted=!1,this.emit(ve.Start),this.setTimer(e)))}restart(){this.stop(),this.start(this.timeout)}stop(){this.isCompleted||(this.clearTimer(),this.emit(ve.Stop),this.isCompleted=!0,this.timerPaused=!1)}pause(){this.isCompleted||(this.timerPaused=!0,this.clearTimer(),this.progressBeforePause=this.currentProgress,this.emit(ve.Pause))}resume(){if(!this.timerPaused)return;this.timerPaused=!1;const e=1-this.progressBeforePause,t=this.timeout*e;this.setTimer(t),this.emit(ve.Resume)}forceEnd(){this.complete({forceEnd:!0})}disable(){this.enabled=!1,this.stop()}enable(){this.enabled=!0,this.start(this.timeout)}complete({forceEnd:e=!1}){this.isCompleted=!0,this.progressBeforePause=0,this.clearTimer(),this.emit(ve.Complete,{forceEnd:e})}clearTimer(){cancelAnimationFrame(this.rafId),null!==this.timerId&&(clearTimeout(this.timerId),this.timerId=null)}updateProgress(e){const t=1-this.progressBeforePause;this.currentProgress=this.progressBeforePause+e*t;const r=100*this.currentProgress;this.emit(ve.Progress,r)}runTimerTicks(e){let t=performance.now();const r=n=>{let i=(n-t)/e;i>1&&(i=1);let a=i;this.updateProgress(a),i<1&&(this.rafId=requestAnimationFrame(r))};this.rafId=requestAnimationFrame(r)}}class we{constructor(e,t){Object.defineProperty(this,"slider",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"loopModule",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:new ye}),Object.defineProperty(this,"delay",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"handleTimerComplete",{enumerable:!0,configurable:!0,writable:!0,value:async()=>{this.slider.reachEnd&&!this.loopModule.enabled?this.slider.slideTo(0):this.slider.toNextSlide()}}),Object.defineProperty(this,"handleVisibilityChange",{enumerable:!0,configurable:!0,writable:!0,value:()=>{document.hidden?this.pause():this.resume()}}),this.timer.on("complete",this.handleTimerComplete),document.addEventListener("visibilitychange",this.handleVisibilityChange)}get paused(){return this.timer.paused}start(){this.stop(),this.slider.options.autoplay&&this.timer.start(this.delay)}stop(){this.timer.stop()}pause(){this.timer.pause()}resume(){this.timer.resume()}setDelay(e){this.delay=e}destroy(){this.timer.off("complete",this.handleTimerComplete),document.removeEventListener("visibilitychange",this.handleVisibilityChange),this.stop()}}class _e extends Q.EventEmitter{constructor(e,t={}){super(),Object.defineProperty(this,"track",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:{autoplay:!1,speed:300,delay:3e3,loop:!1,slidesPerView:1,spaceBetween:0,initialSlide:0,updateOnWindowResize:!0}}),Object.defineProperty(this,"isAnimating",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_activeIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_realIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_currentTranslateX",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_reachEnd",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_reachStart",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"loopModule",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"touchModule",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_slideWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"autoplay",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_activeIndexLocked",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"handleResize",{enumerable:!0,configurable:!0,writable:!0,value:()=>{this.updateSize(),this.emit(me.Resize)}}),this.track=e,this.container=e.parentElement,this.loopModule=new fe(this),this.touchModule=new ge(this,this.loopModule),this.autoplay=new we(this,this.loopModule),this.options.updateOnWindowResize&&window.addEventListener("resize",this.handleResize),this.collectSlides(),this.update(t)}get activeIndex(){return this._activeIndex}get realIndex(){return this._realIndex}get reachEnd(){return this._reachEnd}get reachStart(){return this._reachStart}get slidesEl(){return this.track}get slides(){return Array.from(this.track.children)}get allSlides(){return this.slides}get animating(){return this.isAnimating}get currentTranslateX(){return this._currentTranslateX}get isMoved(){return this.touchModule.isMoved}get slideWidth(){return this._slideWidth}get totalPages(){return this.loopModule.enabled?this.slides.length:Math.max(this.slides.length-this.options.slidesPerView+1,1)}async slideToLoop(e,t=this.options.speed){if(!this.loopModule.enabled)return this.slideTo(e,t);if(this.isAnimating)return;const r=this.getPhysicalIndexByRealIndex(e),n=this.slides.length-r<this.options.slidesPerView,i=r-this._activeIndex-1<this.options.slidesPerView?"next":"prev";if(n){const e="next"===i?r+1:r-this.slides.length+1;this.loopModule.applyLoopFix({targetIndex:e,direction:i})}const a=this.getPhysicalIndexByRealIndex(e);requestAnimationFrame((()=>this.slideTo(a)))}async slideTo(e,t=this.options.speed){e=this.clamp(e,0,this.totalPages-1),this.isAnimating||(this.isAnimating=!0,await this.performTranslateToSlide(e,t),this._activeIndexLocked||this.updateIndexes(e),this.isAnimating=!1)}lockActiveIndex(){this._activeIndexLocked=!0}unlockActiveIndex(){this._activeIndexLocked=!1}toNextSlide(){this.isAnimating||(this.loopModule.enabled?this.toNextSlideByLoop():this.slideTo(this.normalizeIndex(this._realIndex+1)))}toPrevSlide(){this.isAnimating||(this.loopModule.enabled?this.toPrevSlideByLoop():this.slideTo(this.normalizeIndex(this._realIndex-1)))}update(e){this.options=this.normalizeOptions(Object.assign(Object.assign({},this.options),e)),this.setupTrackStyles();const t=this.slideWidth;this.calculateSlideWidths(),t!==this.slideWidth&&this.emit(me.SlidesUpdated),this.loopModule.update(),this.slideTo(this._activeIndex,0),this.testAttraction()}destroy(){window.removeEventListener("resize",this.handleResize),this.autoplay.destroy(),this.touchModule.destroy(),this.track.removeAttribute("style"),this._activeIndex=0,this._activeIndexLocked=!1,this.isAnimating=!1}isSlideVisible(e){const t=this.getPhysicalIndexByRealIndex(e);return t>=this._activeIndex&&t<this._activeIndex+this.options.slidesPerView}getVisibleSlideIndexes(){return this.slides.slice(this._activeIndex,this._activeIndex+this.options.slidesPerView).map((e=>+e.dataset.index))}getPhysicalIndexByRealIndex(e){const t=this.normalizeIndex(e);return this.slides.findIndex((e=>e.dataset.index===t.toString()))}getMinTranslate(){return 0}getMaxTranslate(){return this.getSlideOffset(this.totalPages-1)}setTranslate(e){this.track.style.transform=`translate3d(${e}px, 0px, 0px)`,this._currentTranslateX=e,this.testAttraction()}enableHorizontalSwipeGesture(){this.touchModule.enableHorizontalSwipeGesture()}disableHorizontalSwipeGesture(){this.touchModule.disableHorizontalSwipeGesture()}getSlideOffset(e){return this.slides.length?-e*(this.slides[0].clientWidth+this.options.spaceBetween):0}updateSize(){const e=this.slideWidth;this.calculateSlideWidths(),e!==this.slideWidth&&this.emit(me.SlidesUpdated),this.slideTo(this._activeIndex,0)}getTrackWidth(){return this.track.clientWidth-this.options.spaceBetween*(this.options.slidesPerView-1)}toNextSlideByLoop(){this.isAnimating||(this.loopModule.applyLoopFix({targetIndex:this._activeIndex,direction:"next"}),requestAnimationFrame((()=>this.slideTo(this._activeIndex+1))))}toPrevSlideByLoop(){this.isAnimating||(this.loopModule.applyLoopFix({targetIndex:this._activeIndex,direction:"prev"}),requestAnimationFrame((()=>this.slideTo(this._activeIndex-1))))}updateIndexes(e){if(!this.slides.length)return;const t=+this.slides[e].dataset.index,r=this._realIndex,n=this._activeIndex;this._realIndex=t,this._activeIndex=e,r!==t&&this.emit(me.RealIndexChnage,t),n!==e&&this.emit(me.ActiveIndexChange,e)}setupTrackStyles(){Object.assign(this.track.style,{display:"flex",transition:`transform ${this.options.speed}ms ease`,gap:`${this.options.spaceBetween}px`}),this.container.style.overflow="hidden"}collectSlides(){this.slides.forEach(((e,t)=>{e.dataset.index=t.toString()}))}calculateSlideWidths(){this._slideWidth=Math.ceil(this.getTrackWidth()/this.options.slidesPerView),this.slides.forEach((e=>{e.style.width=`${this._slideWidth}px`}))}translateSlidesTrack(e,t){this.track.style.transitionDuration=`${t}ms`,this.setTranslate(this.getSlideOffset(e))}async performTranslateToSlide(e,t){if(0===t)this.translateSlidesTrack(e,0);else{if(this._activeIndex===e&&!this.touchModule.isMoved)return;this.translateSlidesTrack(e,t),this.emit(me.TransitionStart),await this.waitTransitionEnd(),this.emit(me.TransitionEnd)}}waitTransitionEnd(){return new Promise((e=>{this.track.addEventListener("transitionend",(t=>{"transform"===t.propertyName&&(this.track.style.transitionDuration="0ms",e())}),{once:!0})}))}testAttraction(){const e=this.getMinTranslate(),t=this.getMaxTranslate(),r=!this.loopModule.enabled&&this._currentTranslateX>=e,n=!this.loopModule.enabled&&this._currentTranslateX<=t;r!==this._reachStart&&(this._reachStart=r,this.emit(me.ReachStart,r)),n!==this._reachEnd&&(this._reachEnd=n,this.emit(me.ReachEnd,n))}normalizeOptions(e){var t,r,n,i,a,s,o,l;return{autoplay:null!==(t=e.autoplay)&&void 0!==t?t:this.options.autoplay,speed:null!==(r=e.speed)&&void 0!==r?r:this.options.speed,delay:null!==(n=e.delay)&&void 0!==n?n:this.options.delay,loop:null!==(i=e.loop)&&void 0!==i?i:this.options.loop,slidesPerView:Math.max(Math.min(this.track.children.length,null!==(a=e.slidesPerView)&&void 0!==a?a:this.options.slidesPerView),0),spaceBetween:null!==(s=e.spaceBetween)&&void 0!==s?s:this.options.spaceBetween,initialSlide:null!==(o=e.initialSlide)&&void 0!==o?o:this.options.initialSlide,updateOnWindowResize:null!==(l=e.updateOnWindowResize)&&void 0!==l?l:this.options.updateOnWindowResize}}normalizeIndex(e){const t=this.slides.length;return(e%t+t)%t}clamp(e,t,r){return Math.max(t,Math.min(e,r))}}const Se=(0,u.observer)((e=>{const[t,r]=(0,c.useState)(null),n=(0,c.useRef)(null);return(0,c.useEffect)((()=>{if(!n.current||!e.slidesCount)return;const t=new _e(n.current,{autoplay:e.autoplay,speed:e.speed,loop:e.loop,slidesPerView:e.slidesPerView,spaceBetween:e.spaceBetween});return e.onInit(t),r(t),()=>{null==t||t.destroy()}}),[e.slidesCount]),(0,c.useEffect)((()=>{t&&t.update({autoplay:e.autoplay,speed:e.speed,loop:e.loop,slidesPerView:e.slidesPerView,spaceBetween:e.spaceBetween})}),[t,e.autoplay,e.speed,e.loop,e.slidesPerView,e.spaceBetween,e.slidesCount]),(0,l.jsxs)("div",{className:he.slider,style:{"--slider-border-radius":`${e.borderRadius}px`},children:[(0,l.jsx)("div",{ref:n,className:he.slider__track,children:e.children}),t&&e.pagination.enabled&&(0,l.jsx)(ce,{totalPages:t.totalPages,activeIndex:t.realIndex,onClick:r=>{e.loop?t.slideToLoop(r):t.slideTo(r)}}),t&&e.navigation.enabled&&(0,l.jsx)(be,{onPrevClick:()=>{t.toPrevSlide()},onNextClick:()=>{t.toNextSlide()},nextDisabled:t.reachEnd,prevDisabled:t.reachStart})]})})),Pe=e=>(0,l.jsx)("div",{className:(0,_.default)(he.slider__slide,e.className),style:e.style,children:e.children}),Ee=(0,u.observer)((e=>{const t=ie(e),r=(0,c.useRef)(null);return(0,l.jsx)("div",{className:I["banner-slot"],ref:r,children:t.length?(0,l.jsx)(O,{index:0,isActive:!0,canBeInited:!0,banner:t[0],allowClick:!0,clientAppearance:e.bannerPlace.appearance.banner}):(0,l.jsx)(P,{needShowErrorScreen:!1,needShowLoaderScreen:!0,onReload:()=>{}})})})),xe=(0,u.observer)((e=>{const t=(0,c.useRef)(null),r=ie(e);var n;n=e,(0,c.useEffect)((()=>{n.appearance&&n.bannerPlace.updateAppearance(n.appearance)}),[n.bannerPlace,JSON.stringify(n.appearance)]);const{realIndex:i,allowClick:a,slider:s,isAnimating:o,setSlider:d,isMoved:h}=(e=>{const t=(0,c.useRef)(null),[r,n]=(0,c.useState)(!1),[i,a]=(0,c.useState)(!1),[s,o]=(0,c.useState)(!1),[l,d]=(0,c.useState)(!0),[h,u]=(0,c.useState)(null),[p,b]=(0,c.useState)(0),[f,m]=(0,c.useState)(0),[v,g]=(0,c.useState)(!0),[y,w]=(0,c.useState)(!0),_=()=>{clearTimeout(t.current),d(!1),o(!0),((e,t)=>{e.getVisibleSlideIndexes().map((e=>t.banners[e])).forEach((e=>e.pause()))})(h,e)},S=()=>{t.current=setTimeout((()=>d(!0)),100),o(!1),((e,t)=>{t.banners.forEach((e=>e.resume()))})(0,e)},P=()=>{a(!0),d(!1)},E=()=>{a(!1),d(!0)},x=t=>{m(t),e.emit(Z.ActiveIndexChange,t)},T=e=>{b(e)},O=()=>{h&&g(h.reachStart)},j=()=>{h&&w(h.reachEnd)},I=()=>{},L=()=>{e.refreshSizes(),requestAnimationFrame((()=>{e.refreshSizes(),n((e=>!e))}))};return(0,c.useEffect)((()=>{if(!h)return;const t=new se(h);e.setSliderController(t)}),[e,h]),(0,c.useEffect)((()=>{h&&e&&e.banners[h.realIndex].markAsOpened()}),[e,h]),(0,c.useEffect)((()=>{if(h)return h.on(me.TouchStart,_),h.on(me.TouchEnd,S),h.on(me.TransitionStart,P),h.on(me.TransitionEnd,E),h.on(me.RealIndexChnage,x),h.on(me.ActiveIndexChange,T),h.on(me.ReachStart,O),h.on(me.ReachEnd,j),h.on(me.Resize,I),h.on(me.SlidesUpdated,L),O(),j(),()=>{h.off(me.TouchStart,_),h.off(me.TouchEnd,S),h.off(me.TransitionStart,P),h.off(me.TransitionEnd,E),h.off(me.RealIndexChnage,x),h.off(me.ActiveIndexChange,T),h.off(me.ReachStart,O),h.off(me.ReachEnd,j),h.off(me.Resize,I),h.off(me.SlidesUpdated,L)}}),[e,h]),{reachStart:v,reachEnd:y,activeIndex:p,realIndex:f,isMoved:s,isAnimating:i,slider:h,setSlider:u,allowClick:l}})(e.bannerPlace);(({bannerPlace:e,bannerPlaceRef:t,slider:r})=>{const[n,i]=(0,c.useState)(!1);(0,c.useEffect)((()=>((async(e=5e3)=>new Promise(((r,n)=>{const i=setTimeout((()=>{n(new Error("[IAS]: Timeout while waiting for BannerPlace clientWidth"))}),e),a=()=>{if(t.current&&t.current.clientWidth>0)return clearTimeout(i),void r();requestAnimationFrame(a)};requestAnimationFrame(a)})))().then((()=>{i(!0)})).catch(console.error),()=>{i(!1)})),[e.isLoaded]),(0,c.useEffect)((()=>{r&&n&&(r.updateSize(),e.refreshSizes(),requestAnimationFrame((()=>{e.refreshSizes()})))}),[r,e,n])})({bannerPlace:e.bannerPlace,slider:s,bannerPlaceRef:t});const u=e.bannerPlace.appearance;return(0,l.jsx)("div",{className:(0,_.default)(I["banner-place"],e.className),style:e.style,ref:t,children:(0,l.jsx)(Se,{onInit:d,autoplay:u.autoplay,speed:u.animationSpeed,loop:u.loop,slidesPerView:u.slidesPerView,spaceBetween:u.gap,slidesCount:r.length,navigation:u.navigation,pagination:u.pagination,children:r.map(((e,t)=>{const r=Boolean(null==s?void 0:s.isSlideVisible(t));return(0,l.jsx)(Pe,{children:(0,l.jsx)(O,{index:t,isActive:r,canBeInited:r,banner:e,className:I["banner-slider__slide"],allowClick:a,clientAppearance:u.banner})},e.id)}))})})})),Te=(e=>{var t={};return d.d(t,e),t})({createRoot:()=>s.createRoot});class Oe{constructor(e,t,r){Object.defineProperty(this,"mountPoint",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerPlace",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"root",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rootElement",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.rootElement=document.createElement("div"),this.rootElement.style.width="100%",this.rootElement.style.height="100%",e.appendChild(this.rootElement),this.root=(0,Te.createRoot)(this.rootElement)}get isLoaded(){return this.bannerPlace.isLoaded}get id(){return this.bannerPlace.id}get banners(){return this.bannerPlace.banners}get appearance(){return this.bannerPlace.appearance}get contentRatio(){return this.bannerPlace.contentRatio}get isLoading(){return this.bannerPlace.isLoading}get slider(){return this.bannerPlace.slider}refreshSizes(){}emit(e,...t){}setSliderController(e){this.bannerPlace.setSliderController(e)}updateAppearance(e){this.bannerPlace.updateAppearance(e)}play(){this.bannerPlace.play()}stop(){this.bannerPlace.stop()}resume(){this.bannerPlace.resume()}pause(){this.bannerPlace.pause()}reload(){return this.bannerPlace.reload()}destroy(){setTimeout((()=>{this.root.unmount()})),this.mountPoint.removeChild(this.rootElement),this.bannerPlace.destroy()}fetchBanners(){return this.bannerPlace.fetchBanners()}updateUserData(e){return Promise.resolve()}on(e,t){return this.bannerPlace.on(e,t),this}once(e,t){return this.bannerPlace.once(e,t),this}off(e,t){return this.bannerPlace.off(e,t),this}render(){var e;this.root.render((0,l.jsx)(xe,{appearance:null===(e=this.params)||void 0===e?void 0:e.appearance,bannerPlace:this.bannerPlace}))}}const je=e=>{const[t,r]=(0,c.useState)(null);return(0,c.useEffect)((()=>{var t;const n=Xt().createBannerPlace(e.placeId);return r(n),null===(t=e.onReady)||void 0===t||t.call(e,n),()=>{n.destroy()}}),[e.placeId]),t?(0,l.jsx)(xe,Object.assign({bannerPlace:t},e)):null},Ie=e=>{const[t,r]=(0,c.useState)(null);return(0,c.useEffect)((()=>{var t;const n=Xt().createBannerPreviewPlace(e.bannerId);return r(n),null===(t=e.onReady)||void 0===t||t.call(e,n),()=>{n.destroy()}}),[e.bannerId]),t?(0,l.jsx)(Ee,Object.assign({bannerPlace:t},e)):null};var Le=function(e,t,r,n,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?n.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),u=!1,p=r.length-1;p>=0;p--){var b={};for(var f in n)b[f]="access"===f?{}:n[f];for(var f in n.access)b.access[f]=n.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,n.name,h),u=!0},Ce=function(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0},ke=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},Ae=function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r};let Be=(()=>{var e,t,r,n;let i,a,s,o=Q.EventEmitter,l=[],c=[],d=[],h=[],u=[],p=[];return e=class extends o{get _banners(){return ke(this,t,"f")}set _banners(e){Ae(this,t,e,"f")}get _isLoading(){return ke(this,r,"f")}set _isLoading(e){Ae(this,r,e,"f")}get _isLoaded(){return ke(this,n,"f")}set _isLoaded(e){Ae(this,n,e,"f")}constructor(e,i,a,s){super(),Object.defineProperty(this,"bannerId",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"bannerStore",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"bannerViewModelFactory",{enumerable:!0,configurable:!0,writable:!0,value:s}),t.set(this,Ce(this,l,[])),r.set(this,(Ce(this,c),Ce(this,d,!1))),n.set(this,(Ce(this,h),Ce(this,u,!1))),Object.defineProperty(this,"appearance",{enumerable:!0,configurable:!0,writable:!0,value:(Ce(this,p),new G)}),this.ctx.addBannerPlace(this)}get id(){return"__BANNER_PREVIEW__"}get slider(){return new J}get banners(){return this._banners}get isLoading(){return this._isLoading}get isLoaded(){return this._isLoaded}get contentRatio(){var e,t;return null!==(t=null===(e=this._banners[0])||void 0===e?void 0:e.contentRatio)&&void 0!==t?t:1}refreshSizes(){this._banners.forEach((e=>e.refreshSizes()))}setSliderController(e){}updateAppearance(e){this.appearance.update(e)}play(){for(const e of this._banners)e.resume()}stop(){for(const e of this._banners)e.pause()}resume(){for(const e of this._banners)e.resume()}pause(){for(const e of this._banners)e.pause()}async reload(){this.bannerStore.removeBannerPlaceById(this.id),await Promise.all(this._banners.map((e=>e.destroy()))),this._banners=[],await this.fetchBanners()}destroy(){for(const e of this._banners)e.destroy();this._banners=[],this.ctx.removeBannerPlace(this)}async updateUserData(e){return this.bannerStore.updateBannerUserData(this.id,e)}async fetchBanners(){try{if(this._isLoading)return[];this._isLoading=!0,this._isLoaded=!1,this.emit(Z.LoadStart);const e=await this.bannerStore.getBannerById(this.bannerId);return this._banners=[this.bannerViewModelFactory.create(this,e)],this._isLoaded=!0,this._banners}catch(e){throw this.emit(Z.LoadError,e),e}finally{this.emit(Z.LoadEnd),this._isLoading=!1}}},t=new WeakMap,r=new WeakMap,n=new WeakMap,(()=>{var t;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=o[Symbol.metadata])&&void 0!==t?t:null):void 0;i=[L.observable],a=[L.observable],s=[L.observable],Le(e,null,i,{kind:"accessor",name:"_banners",static:!1,private:!1,access:{has:e=>"_banners"in e,get:e=>e._banners,set:(e,t)=>{e._banners=t}},metadata:r},l,c),Le(e,null,a,{kind:"accessor",name:"_isLoading",static:!1,private:!1,access:{has:e=>"_isLoading"in e,get:e=>e._isLoading,set:(e,t)=>{e._isLoading=t}},metadata:r},d,h),Le(e,null,s,{kind:"accessor",name:"_isLoaded",static:!1,private:!1,access:{has:e=>"_isLoaded"in e,get:e=>e._isLoaded,set:(e,t)=>{e._isLoaded=t}},metadata:r},u,p),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),e})();class Me{constructor(e){Object.defineProperty(this,"bannerStatisticApi",{enumerable:!0,configurable:!0,writable:!0,value:e})}async sendViewEvent(e,t){const r=new X(t);await this.bannerStatisticApi.sendViewEvent(e,r)}async sendWidgetEvent(e,t){const r=new Y(t);await this.bannerStatisticApi.sendWidgetEvent(e,r)}}class Re{constructor(){Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:{}})}set(e,t){this.cache[e]=t}clear(){this.cache={}}get(e){return this.cache[e]}}class De{constructor(e,t,r){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerPlaceViewModel",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:r})}async handle(e){try{const t=this.storyManager.gameReader;await t.openGame(e.gameInstanceId),this.bannerPlaceViewModel.stop(),t.once("close",(()=>{this.bannerPlaceViewModel.play()}))}catch(e){console.error(e)}}}var Ne,ze,We,Fe,Ve,Ue,qe,$e,Ge,He,Xe,Ye,Qe,Je,Ze,Ke,et,tt,rt;!function(e){e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end"}(Ne||(Ne={})),Ne.END,function(e){e.DEFAULT="default",e.CUSTOM_CARD="customCard"}(ze||(ze={})),ze.DEFAULT,ze.DEFAULT,function(e){e.CENTER="center",e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end"}(We||(We={})),function(e){e.CIRCLE="circle",e.QUAD="quad",e.RECTANGLE="rectangle"}(Fe||(Fe={})),function(e){e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end",e.CENTER="center"}(Ve||(Ve={})),function(e){e.CARD_INSIDE_BOTTOM="cardInsideBottom",e.CARD_OUTSIDE_TOP="cardOutsideTop",e.CARD_OUTSIDE_BOTTOM="cardOutsideBottom"}(Ue||(Ue={})),function(e){e.Medium="medium",e.High="high"}(qe||(qe={})),function(e){e.COLUMN="vertical",e.ROW="horizontal"}($e||($e={})),function(e){e.START_LOADER="startLoad",e.END_LOADER="endLoad"}(Ge||(Ge={})),$e.ROW,Ve.START,Ue.CARD_INSIDE_BOTTOM,qe.High,Fe.RECTANGLE,Ve.START,Ue.CARD_INSIDE_BOTTOM,qe.High,Fe.CIRCLE,We.START,Ve.START,Ue.CARD_INSIDE_BOTTOM,qe.High,Fe.CIRCLE,function(e){e.STORY_LIST="storyList",e.STORY_READER="storyReader",e.GAME_READER="gameReader",e.STACK_STORY_LIST="stackStoryList",e.IAM_READER="iamReader",e.BANNERS="banners"}(He||(He={})),function(e){e.FLAT="flat",e.COVER="cover",e.CUBE="cube"}(Xe||(Xe={})),function(e){e.Classic="classic",e.Modern="modern"}(Ye||(Ye={})),Xe.FLAT,Ye.Classic,function(e){e.STYLE_CIRCLE="circle",e.STYLE_QUAD="quad",e.STYLE_RECTANGLE="rectangle",e.SWIPE_CUBE="cube",e.SWIPE_FLAT="flat",e.SWIPE_COVER="cover",e.CLOSE_BUTTON_LEFT="left",e.CLOSE_BUTTON_RIGHT="right"}(Qe||(Qe={})),function(e){e.direct="direct",e.onboarding="onboarding",e.list="list",e.favorite="favorite"}(Je||(Je={})),function(e){e[e.default=0]="default",e[e.favorite=1]="favorite",e[e.stacked=2]="stacked"}(Ze||(Ze={})),function(e){e[e.default=0]="default",e[e.onboarding=1]="onboarding",e[e.favorite=2]="favorite",e[e.direct=3]="direct"}(Ke||(Ke={})),function(e){e.list="list",e.favorite="favorite"}(et||(et={})),function(e){e.CLICK_ON_STORY="clickOnStoryLink"}(tt||(tt={})),function(e){e.LTR="ltr",e.RTL="rtl"}(rt||(rt={}));class nt{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:t})}handle(e){try{const t=decodeURIComponent(e.linkTarget);this.emitWidgetLinkEvent(t,e),this.handleClickOnButton({id:this.banner.id,index:this.banner.activeSlideIndex,url:t,elementId:e.elementId,dataForSending:null,label:""})}catch(t){t instanceof URIError?console.error(`[Banners]: the URL <${e.linkTarget}> has an invalid format`):console.error(t)}}emitWidgetLinkEvent(e,t){}async handleClickOnButton(e){const t={src:He.BANNERS,data:e};this.storyManager.emit("clickOnButton",t)}}class it{constructor(e,t,r){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerPlace",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:r})}async handle(e){try{await this.emitClickOnButtonEvent({id:0,index:0,url:"",elementId:"",dataForSending:null,label:""}),this.bannerPlace.stop(),await this.storyManager.storyReader.showStory(e.storyId),this.storyManager.storyReader.once("closeStoryReader",(()=>{this.bannerPlace.play()}))}catch(e){console.error(e)}}async emitClickOnButtonEvent(e){const t={src:He.BANNERS,data:e};this.storyManager.emit("clickOnButton",t)}}let at;const st=e=>{!function(e){at=document.createElement("textarea"),at.value=e,document.body.appendChild(at)}(e),function(){let e,t;/ipad|iphone/i.test(navigator.userAgent)?(e=document.createRange(),at&&e.selectNodeContents(at),t=window.getSelection(),t&&(t.removeAllRanges(),t.addRange(e)),at&&at.setSelectionRange(0,999999)):null==at||at.select()}(),document.execCommand("copy"),at&&document.body.removeChild(at)};let ot;ot=function(){};class lt{constructor(e){Object.defineProperty(this,"bannerPlace",{enumerable:!0,configurable:!0,writable:!0,value:e})}manageTimer(e,t){if(!this.bannerPlace.slider)return;const r=this.bannerPlace.slider.autoplay;switch(e){case"start":this.startTimer(r,t);break;case"pause":r.pause();break;case"stop":case"before_start":r.stop()}}startTimer(e,t){e.isPaused()?e.resume():(e.setDelay(t),e.start())}}class ct{constructor(e,t,r,n){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerPlace",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"bannerStatisticService",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"sessionNarrativeDataCache",{enumerable:!0,configurable:!0,writable:!0,value:new Re}),Object.defineProperty(this,"narrativeDataCache",{enumerable:!0,configurable:!0,writable:!0,value:new Re})}updateCardServerDataLocally(e){this.banner.context.updateNarrativeSavedData(e)}updateTimeline(e,t,r,n,i,a){[...arguments].join(", "),this.banner.id,i?this.banner.showLoaderScreen():this.banner.activeSlide.inited&&this.banner.hideLoaderScreen(),a?this.banner.showErrorScreen():this.banner.hideErrorScreen(),new lt(this.bannerPlace).manageTimer(t,n)}clearNarrativeSessionDataCache(){this.sessionNarrativeDataCache.clear()}disableVerticalSwipeGesture(){}enableVerticalSwipeGesture(){}disableHorizontalSwipeGesture(){this.bannerPlace.slider.disableHorizontalSwipeGesture()}enableHorizontalSwipeGesture(){this.bannerPlace.slider.enableHorizontalSwipeGesture()}async getCardLocalData(){const e=this.narrativeDataCache.get(`banner_${this.banner.id}_data_${this.storyManager.rootStore.sessionStore.userId}`);return e?JSON.parse(e):{}}setCardLocalData(e,t){const r=JSON.stringify(e);this.narrativeDataCache.set(`banner_${this.banner.id}_data_${this.storyManager.rootStore.sessionStore.userId}`,r),this.banner.context.updateNarrativeSavedData(r),t&&this.banner.updateUserData(r).catch(console.error)}getCardServerData(e){var t;return null!==(t=this.banner.context.widgetsData._narrative_saved_data)&&void 0!==t?t:null}getSlideDuration(e,t){var r,n;return null!==(n=null===(r=this.banner.context.widgetsData._narrative_slides_duration)||void 0===r?void 0:r[t])&&void 0!==n?n:null}pauseUI(){this.banner.pause()}resumeUI(){this.banner.resume()}showCardTextInput(e,t){}setCardSessionValue(e,t){this.sessionNarrativeDataCache.set(e,t)}getCardSessionValue(e){return this.sessionNarrativeDataCache.get(e)}getWidgetsSharedData(e,t){const r=this.banner.context.widgetsData;switch(t){case"rangeSlider":return r._narrative_range_slider_data;case"poll":return r._narrative_poll_data;case"vote":return r._narrative_vote_data}return null}async sendApiRequest(e,t,r,n,i,a){var s,o,l;try{const a=await this.storyManager.httpClient.request({url:e,method:t,params:null!=r?r:{},headers:null!=n?n:{},data:null!=i?i:{}});return{status:a.status,headers:a.headers,data:a.data}}catch(e){if(e instanceof Error&&"IasNetworkError"===e.name)return{status:null!==(s=e.networkStatus)&&void 0!==s?s:400,headers:null===(o=e.response)||void 0===o?void 0:o.headers,data:null===(l=e.response)||void 0===l?void 0:l.data}}}share(e,t){}shareSlideScreenshot(e,t,r){}showLayer(e){this.banner.showLayerByIndex(e)}showCardSlide(e){this.bannerPlace.slider.slideTo(e)}cardShowNext(){this.bannerPlace.slider.toNextSlide()}showNextSlide(){this.bannerPlace.slider.toNextSlide()}sendStatisticEvent(e,t,r,n){this.bannerStatisticService.sendWidgetEvent(this.banner.id,{iterationId:this.banner.iterationId,type:e,slideIndex:this.banner.activeSlideIndex,slideTotal:this.banner.slides.length,durationMs:this.banner.durationMs,widgetPayload:t})}async resetCard(e){this.updateCardServerDataLocally({}),this.setCardLocalData({},!0),this.showCardSlide(0),this.showLayer(0)}getCardFonts(){var e,t;return null!==(t=null===(e=this.storyManager.rootStore.sessionStore.session)||void 0===e?void 0:e.fontsResources)&&void 0!==t?t:[]}showToast(e){this.banner.showToast({content:e})}closeCard(e){}openStory(e,t){new it(this.storyManager,this.bannerPlace,this.banner).handle({storyId:e,slideIndex:t})}openGame(e){new De(this.storyManager,this.bannerPlace,this.banner).handle({gameInstanceId:e})}writeToClipboard(e){st(e.textValue)}openUrl(e){"swipeUpItems"!==e.type&&new nt(this.storyManager,this.banner).handle({elementId:e.elementId,linkTarget:e.link.target})}}var dt;!function(e){e.Top="top",e.Bottom="bottom"}(dt||(dt={}));const ht=dt.Bottom;class ut{constructor(e){Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"timeoutId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"duration",{enumerable:!0,configurable:!0,writable:!0,value:3e3}),Object.defineProperty(this,"content",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"position",{enumerable:!0,configurable:!0,writable:!0,value:ht}),Object.defineProperty(this,"mountPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"toastContainer",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.initializeOptions(e),this.mountPoint=e.mountPoint}show(e){return this.content=e,this.destroy(),this.createAndShowToast(),!0}hide(){return!!this.toastContainer&&(clearTimeout(this.timeoutId),this.toastContainer.className+=" toast_fadeout",this.addAnimationEndListeners(this.toastContainer,(()=>{var e,t;null===(t=null===(e=this.toastContainer)||void 0===e?void 0:e.parentNode)||void 0===t||t.removeChild(this.toastContainer),this.toastContainer=null})),!0)}destroy(){var e;this.toastContainer&&(clearTimeout(this.timeoutId),null===(e=this.toastContainer.parentNode)||void 0===e||e.removeChild(this.toastContainer),this.toastContainer=null)}initializeOptions(e){if(e.duration&&(this.duration="string"==typeof e.duration?parseFloat(e.duration):e.duration),e.position){const t=e.position.toLowerCase();this.position="top"===t||"bottom"===t?t:ht}}createAndShowToast(){const e=this.createToastContainer(),t=this.createToastElement(),r=this.createToastTextElement();t.appendChild(r),e.appendChild(t),this.mountPoint.appendChild(e),this.timeoutId=window.setTimeout((()=>this.hide()),this.duration),this.toastContainer=e}createToastContainer(){const e=document.createElement("div");return e.id="toast_container",e.className="toast_fadein",e.style.zIndex="1130",e}createToastElement(){const e=document.createElement("div");return e.id="toast",e}createToastTextElement(){const e=document.createElement("span");return e.innerHTML=this.content,e}addAnimationEndListeners(e,t){["animationend","webkitAnimationEnd","msAnimationEnd","oAnimationEnd"].forEach((r=>{e.addEventListener(r,t,{once:!0})}))}}const pt=(e=>{var t={};return d.d(t,e),t})({SlideApi:()=>o.SlideApi}),bt=(new Error("timeout while waiting for mutex to become available"),new Error("mutex already locked"),new Error("request for lock canceled"));class ft{constructor(e,t=bt){this._value=e,this._cancelError=t,this._queue=[],this._weightedWaiters=[]}acquire(e=1,t=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise(((r,n)=>{const i={resolve:r,reject:n,weight:e,priority:t},a=mt(this._queue,(e=>t<=e.priority));-1===a&&e<=this._value?this._dispatchItem(i):this._queue.splice(a+1,0,i)}))}runExclusive(e){return function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function s(e){try{l(n.next(e))}catch(e){a(e)}}function o(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}l((n=n.apply(e,t||[])).next())}))}(this,arguments,void 0,(function*(e,t=1,r=0){const[n,i]=yield this.acquire(t,r);try{return yield e(n)}finally{i()}}))}waitForUnlock(e=1,t=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return this._couldLockImmediately(e,t)?Promise.resolve():new Promise((r=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),function(e,t){const r=mt(e,(e=>t.priority<=e.priority));e.splice(r+1,0,t)}(this._weightedWaiters[e-1],{resolve:r,priority:t})}))}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatchQueue()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatchQueue()}cancel(){this._queue.forEach((e=>e.reject(this._cancelError))),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(e){const t=this._value;this._value-=e.weight,e.resolve([t,this._newReleaser(e.weight)])}_newReleaser(e){let t=!1;return()=>{t||(t=!0,this.release(e))}}_drainUnlockWaiters(){if(0===this._queue.length)for(let e=this._value;e>0;e--){const t=this._weightedWaiters[e-1];t&&(t.forEach((e=>e.resolve())),this._weightedWaiters[e-1]=[])}else{const e=this._queue[0].priority;for(let t=this._value;t>0;t--){const r=this._weightedWaiters[t-1];if(!r)continue;const n=r.findIndex((t=>t.priority<=e));(-1===n?r:r.splice(0,n)).forEach((e=>e.resolve()))}}}_couldLockImmediately(e,t){return(0===this._queue.length||this._queue[0].priority<t)&&e<=this._value}}function mt(e,t){for(let r=e.length-1;r>=0;r--)if(t(e[r]))return r;return-1}class vt{constructor(e){this._semaphore=new ft(1,e)}acquire(){return function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function s(e){try{l(n.next(e))}catch(e){a(e)}}function o(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}l((n=n.apply(e,t||[])).next())}))}(this,arguments,void 0,(function*(e=0){const[,t]=yield this._semaphore.acquire(1,e);return t}))}runExclusive(e,t=0){return this._semaphore.runExclusive((()=>e()),1,t)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(e=0){return this._semaphore.waitForUnlock(1,e)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}}class gt{constructor(e,t,r){Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerSlide",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"mutex",{enumerable:!0,configurable:!0,writable:!0,value:new vt}),Object.defineProperty(this,"_inited",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get html(){return this.bannerSlide.html}get state(){return this.slideApi.state}get inited(){return this._inited}async init(){const e=await this.mutex.acquire();if(this._inited)return;let t=this.banner.needShowLoaderScreen,r=Date.now();const n=setTimeout((()=>{this.banner.showLoaderScreen(),t=!0,r=Date.now()}),500);try{this.banner.id,await this.slideApi.showSlide(this.html),this._inited=!0}catch(e){throw this.handleSlideError(e),e}finally{clearTimeout(n),await this.cleanupLoaderIfNeeded(Date.now()-r,t),e()}}async start(){const e=await this.mutex.acquire();try{this.banner.id,await this.slideApi.slideStart({muted:!0})}catch(e){this.handleSlideError(e)}finally{e()}}async restart(){const e=await this.mutex.acquire();try{this.banner.hideErrorScreen(),this.banner.showLoaderScreen(),await this.slideApi.slideRestart({muted:!0})}catch(e){this.handleSlideError(e)}finally{this.banner.hideLoaderScreen(),e()}}async resume(){const e=await this.mutex.acquire();try{this.banner.id,await this.slideApi.slideAppResume()}catch(e){this.handleSlideError(e)}finally{e()}}async pause(){const e=await this.mutex.acquire();try{this.banner.id,await this.slideApi.slideAppPause()}catch(e){this.handleSlideError(e)}finally{e()}}async pauseByUser(){const e=await this.mutex.acquire();try{this.banner.id,await this.slideApi.slideUserPause()}catch(e){this.handleSlideError(e)}finally{e()}}async resumeByUser(){const e=await this.mutex.acquire();try{this.banner.id,await this.slideApi.slideUserResume()}catch(e){this.handleSlideError(e)}finally{e()}}async stop(e){const t=await this.mutex.acquire();try{this.banner.id,await this.slideApi.slideStop(e)}catch(e){this.handleSlideError(e)}finally{t()}}refreshSizes(){this.slideApi.refreshSizes()}onClick({event:e,currentTarget:t}){if(e.target)try{e.preventDefault(),e.stopPropagation();const r=this.getNavigationDirection(e,t);this.slideApi.slideClickHandler(e.target,r>0?"forward":"backward")}catch(e){console.error(e)}}async destroy(){await this.stop({prepareForRestart:2})}showLayerByIndex(e){this.slideApi.showLayer(e)}handleSlideError(e){console.error(e),this.banner.showErrorScreen()}getNavigationDirection(e,t){const r=this.getClickPosition(e,t),n="ltr"===this.slideApi.layoutDirection?1:-1;return r>=.3?n:-n}getClickPosition(e,t){const r=t.getBoundingClientRect(),n=r.width;if(n<=0)return 0;let i;if(e instanceof MouseEvent)i=e.pageX-r.left;else{if(!(e.touches&&e.touches.length>0))return 0;i=e.touches[0].pageX-r.left}return Math.max(0,Math.min(1,i/n))}delay(e){return new Promise((t=>setTimeout(t,e)))}async cleanupLoaderIfNeeded(e,t){t&&await this.delay(Math.max(500-e,0)),this.banner.hideLoaderScreen()}}class yt{get html(){return""}get state(){return 0}async init(){}async start(){}async restart(){}async resume(){}async pause(){}async resumeByUser(){}async pauseByUser(){}async stop(e){}onClick({event:e,currentTarget:t}){}async destroy(){}showLayerByIndex(e){}refreshSizes(){}}var wt=function(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0},_t=function(e,t,r,n,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?n.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),u=!1,p=r.length-1;p>=0;p--){var b={};for(var f in n)b[f]="access"===f?{}:n[f];for(var f in n.access)b.access[f]=n.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,n.name,h),u=!0},St=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},Pt=function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r};let Et=(()=>{var e,t,r,n,i,a;let s,o,l,c,d,h,u,p,b,f,m,v,g=[],y=[],w=[],_=[],S=[],P=[],x=[],T=[],O=[],j=[],I=[];return e=class{get _$root(){return St(this,t,"f")}set _$root(e){Pt(this,t,e,"f")}get _needShowErrorScreen(){return St(this,r,"f")}set _needShowErrorScreen(e){Pt(this,r,e,"f")}get _needShowLoaderScreen(){return St(this,n,"f")}set _needShowLoaderScreen(e){Pt(this,n,e,"f")}get _width(){return St(this,i,"f")}set _width(e){Pt(this,i,e,"f")}get _slides(){return St(this,a,"f")}set _slides(e){Pt(this,a,e,"f")}constructor(e,s,o,l,c){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(wt(this,g),e)}),Object.defineProperty(this,"bannerPlace",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"bannerStatisticService",{enumerable:!0,configurable:!0,writable:!0,value:l}),Object.defineProperty(this,"bannerStore",{enumerable:!0,configurable:!0,writable:!0,value:c}),t.set(this,wt(this,y,null)),r.set(this,(wt(this,w),wt(this,_,!1))),n.set(this,(wt(this,S),wt(this,P,!1))),i.set(this,(wt(this,x),wt(this,T,0))),a.set(this,(wt(this,O),wt(this,j,[]))),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:(wt(this,I),null)}),Object.defineProperty(this,"slideApiImpl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"locked",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"toast",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_iterationId",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_startTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_initPromise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_initPromiseResolver",{enumerable:!0,configurable:!0,writable:!0,value:()=>{}}),Object.defineProperty(this,"attachRoot",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{this._$root||(this._$root=e,this.slideApi=this.createSlideApi(e),this._slides=[new gt(this,this.banner.slides[0],this.slideApi)],await this.init())}}),Object.defineProperty(this,"handleVisibilityChange",{enumerable:!0,configurable:!0,writable:!0,value:()=>{this.locked||("hidden"===document.visibilityState&&this.pause(),"visible"===document.visibilityState&&this.resume())}}),this.slideApiImpl=new ct(this.storyManager,this.bannerPlace,this,this.bannerStatisticService),this._initPromise=new Promise((e=>{this._initPromiseResolver=e}))}get id(){return this.banner.id}get context(){return this.banner.context}get appearance(){return this.banner.appearance}get contentRatio(){return this.banner.appearance.contentRatio}get name(){return this.banner.name}get dir(){return this.storyManager.config.dir}get slides(){return this._slides}get activeSlideIndex(){return 0}get width(){return this._width}get activeSlide(){var e;return null!==(e=this._slides[this.activeSlideIndex])&&void 0!==e?e:new yt}get needShowErrorScreen(){return this._needShowErrorScreen}get needShowLoaderScreen(){return this._needShowLoaderScreen}get canBeShown(){return Boolean(this._$root)}get iterationId(){return this._iterationId}get durationMs(){return Date.now()-this._startTime}async init(){this.showLoaderScreen(),await this.activeSlide.init(),this._initPromiseResolver()}async start(){if(!this._$root)throw new Error(`[IAS]: Slide API mount point not found for banner with ID ${this.id}`);document.addEventListener("visibilitychange",this.handleVisibilityChange),await this.activeSlide.start(),this._startTime=Date.now(),this.markAsOpened()}refreshSizes(){this.activeSlide.refreshSizes()}async restart(){await this.activeSlide.restart()}async resume(){await this.activeSlide.resume()}async pause(){await this.activeSlide.pause()}async resumeByUser(){await this.activeSlide.resumeByUser()}async pauseByUser(){await this.activeSlide.pauseByUser()}async stop(){var e;this.slideApiImpl.clearNarrativeSessionDataCache(),document.removeEventListener("visibilitychange",this.handleVisibilityChange),null===(e=this.toast)||void 0===e||e.destroy(),await this.activeSlide.stop({prepareForRestart:1})}async destroy(){var e,t;document.removeEventListener("visibilitychange",this.handleVisibilityChange);const r=this.activeSlide;this._slides=[],this._$root=null,await r.destroy(),null===(e=this.slideApi)||void 0===e||e.destroy(),null===(t=this.toast)||void 0===t||t.destroy()}showLayerByIndex(e){this.activeSlide.showLayerByIndex(e)}showToast(e){if(!this._$root)return;const t=this._$root;this.toast=new ut(Object.assign({mountPoint:t},e)),this.toast.show(e.content)}detachRoot(){var e;this._$root=null,null===(e=this.slideApi)||void 0===e||e.destroy()}showErrorScreen(){this._needShowErrorScreen=!0}showLoaderScreen(){this._needShowLoaderScreen=!0}hideLoaderScreen(){this._needShowLoaderScreen=!1}hideErrorScreen(){this._needShowErrorScreen=!1}markAsOpened(){this._iterationId=(0,H.v4)(),this.banner.markAsOpened(),this.markWasShown()}waitInit(){return this._initPromise}async markWasShown(){!this.banner.wasShown&&this._iterationId&&(this.banner.markWasShown(),this.bannerStatisticService.sendViewEvent(this.id,{iterationId:this._iterationId,slideIndex:this.activeSlideIndex,slideTotal:this.banner.slides.length}))}async updateUserData(e){return this.bannerStore.updateBannerUserData(this.id,e)}createSlideApi(e){return new pt.SlideApi(this.slideApiImpl,{root:e,slideRatio:this.banner.appearance.contentRatio,isFullscreen:!1,nonce:E(),viewport:window,userResizeHandler:e=>{this._width=e.viewportWidth},VODPlayer:this.storyManager.globalProperties.$videoOnDemand,overlappingActionBarHeight:0})}},t=new WeakMap,r=new WeakMap,n=new WeakMap,i=new WeakMap,a=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;s=[L.observable],o=[L.observable],l=[L.observable],c=[L.observable],d=[L.observable],h=[L.computed],u=[L.computed],p=[L.computed],b=[L.action],f=[L.action],m=[L.action],v=[L.action],_t(e,null,s,{kind:"accessor",name:"_$root",static:!1,private:!1,access:{has:e=>"_$root"in e,get:e=>e._$root,set:(e,t)=>{e._$root=t}},metadata:t},y,w),_t(e,null,o,{kind:"accessor",name:"_needShowErrorScreen",static:!1,private:!1,access:{has:e=>"_needShowErrorScreen"in e,get:e=>e._needShowErrorScreen,set:(e,t)=>{e._needShowErrorScreen=t}},metadata:t},_,S),_t(e,null,l,{kind:"accessor",name:"_needShowLoaderScreen",static:!1,private:!1,access:{has:e=>"_needShowLoaderScreen"in e,get:e=>e._needShowLoaderScreen,set:(e,t)=>{e._needShowLoaderScreen=t}},metadata:t},P,x),_t(e,null,c,{kind:"accessor",name:"_width",static:!1,private:!1,access:{has:e=>"_width"in e,get:e=>e._width,set:(e,t)=>{e._width=t}},metadata:t},T,O),_t(e,null,d,{kind:"accessor",name:"_slides",static:!1,private:!1,access:{has:e=>"_slides"in e,get:e=>e._slides,set:(e,t)=>{e._slides=t}},metadata:t},j,I),_t(e,null,h,{kind:"getter",name:"activeSlide",static:!1,private:!1,access:{has:e=>"activeSlide"in e,get:e=>e.activeSlide},metadata:t},null,g),_t(e,null,u,{kind:"getter",name:"needShowLoaderScreen",static:!1,private:!1,access:{has:e=>"needShowLoaderScreen"in e,get:e=>e.needShowLoaderScreen},metadata:t},null,g),_t(e,null,p,{kind:"getter",name:"canBeShown",static:!1,private:!1,access:{has:e=>"canBeShown"in e,get:e=>e.canBeShown},metadata:t},null,g),_t(e,null,b,{kind:"method",name:"showErrorScreen",static:!1,private:!1,access:{has:e=>"showErrorScreen"in e,get:e=>e.showErrorScreen},metadata:t},null,g),_t(e,null,f,{kind:"method",name:"showLoaderScreen",static:!1,private:!1,access:{has:e=>"showLoaderScreen"in e,get:e=>e.showLoaderScreen},metadata:t},null,g),_t(e,null,m,{kind:"method",name:"hideLoaderScreen",static:!1,private:!1,access:{has:e=>"hideLoaderScreen"in e,get:e=>e.hideLoaderScreen},metadata:t},null,g),_t(e,null,v,{kind:"method",name:"hideErrorScreen",static:!1,private:!1,access:{has:e=>"hideErrorScreen"in e,get:e=>e.hideErrorScreen},metadata:t},null,g),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class xt{constructor(e,t,r){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerStore",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"bannerStatisticService",{enumerable:!0,configurable:!0,writable:!0,value:r})}create(e,t){return new Et(this.storyManager,e,t,this.bannerStatisticService,this.bannerStore)}}function Tt(e,t){let r=null;return async function(...t){return r||(r=(async()=>{try{return await e.apply(this,t)}catch(e){throw e}finally{r=null}})(),r)}}class Ot extends Error{constructor(e){super(`[IAS]: Banner with ID ${e} not found`),this.name="IasBannerNotFoundError"}}class jt extends Error{constructor(e){super(`[IAS]: Banner slot with ID ${e} not found`),this.name="IasBannerPlaceNotFoundError"}}var It=function(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0},Lt=function(e,t,r,n,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?n.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),u=!1,p=r.length-1;p>=0;p--){var b={};for(var f in n)b[f]="access"===f?{}:n[f];for(var f in n.access)b.access[f]=n.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,n.name,h),u=!0};let Ct=(()=>{var e;let t,r,n,i,a=[];return e=class{constructor(e){Object.defineProperty(this,"httpClient",{enumerable:!0,configurable:!0,writable:!0,value:(It(this,a),e)})}async fetchBannerPlaceById(e){const t=await this.httpClient.get(`banner/place/${e.placeId}`,{expand:"banners.slides",tags:e.tags.join(",")});if(t.data)return t.data;throw new jt(e.placeId)}async fetchBannerById(e){const t=await this.httpClient.get(`banner/${e}`,{expand:"slides"});if(t.data)return t.data;throw new Ot(e)}async fetchContextWithStyles({needFetchStyles:e}){return(await this.httpClient.get("banner/context",{fields:"widgetsData"+(e?",style":"")})).data}async updateUserData(e,t){try{await this.httpClient.request({url:`banner/${e}/data`,method:"put",data:{data:t}})}catch(e){console.error(e)}}},(()=>{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;t=[Tt],r=[Tt],n=[Tt],i=[Tt],Lt(e,null,t,{kind:"method",name:"fetchBannerPlaceById",static:!1,private:!1,access:{has:e=>"fetchBannerPlaceById"in e,get:e=>e.fetchBannerPlaceById},metadata:s},null,a),Lt(e,null,r,{kind:"method",name:"fetchBannerById",static:!1,private:!1,access:{has:e=>"fetchBannerById"in e,get:e=>e.fetchBannerById},metadata:s},null,a),Lt(e,null,n,{kind:"method",name:"fetchContextWithStyles",static:!1,private:!1,access:{has:e=>"fetchContextWithStyles"in e,get:e=>e.fetchContextWithStyles},metadata:s},null,a),Lt(e,null,i,{kind:"method",name:"updateUserData",static:!1,private:!1,access:{has:e=>"updateUserData"in e,get:e=>e.updateUserData},metadata:s},null,a),s&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})})(),e})();class kt{constructor(e,t){Object.defineProperty(this,"httpClient",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:t})}async sendShowBannerEvent(e){throw new Error("Method not implemented.")}async sendClickOnBannerEvent(e){throw new Error("Method not implemented.")}async sendBannerCTREvent(e){throw new Error("Method not implemented.")}async sendViewEvent(e,t){await this.sendStatisticsEvent(e,t)}async sendWidgetEvent(e,t){await this.sendStatisticsEvent(e,t)}async sendStatisticsEvent(e,t){try{if(this.storyManager.isStatisticsDisabled)return void console.log("[BANNER STATISTICS]",Object.assign({bannerId:e,type:t.type},t.toQueryParams()));await this.httpClient.post(`/banner/${e}/event/${t.type}`,{},t.toQueryParams())}catch(e){console.error(e)}}}var At;!function(e){e[e.Base=0]="Base",e[e.Dynamic=1]="Dynamic",e[e.Game=2]="Game",e[e.Story=3]="Story",e[e.IAM=4]="IAM"}(At||(At={}));var Bt=function(e,t,r,n,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?n.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),u=!1,p=r.length-1;p>=0;p--){var b={};for(var f in n)b[f]="access"===f?{}:n[f];for(var f in n.access)b.access[f]=n.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,n.name,h),u=!0};(()=>{var e;let t,r,n=[];e=class{async fetchBannerPlaceById(e){return{id:"default",appearance:{single_banner_aspect_ratio:2,banners_gap:16,corner_radius:16,loop:!0,autoplay:!0,autoplay_delay:1e3,animation_speed:300},banners:[]}}async fetchContext(){return{style:"",widgetsData:{}}}updateUserData(e,t){throw new Error("Method not implemented.")}fetchBannerById(e){throw new Error("Method not implemented.")}constructor(){!function(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e)}(this,n)}},(()=>{const i="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;t=[Tt],r=[Tt],Bt(e,null,t,{kind:"method",name:"fetchBannerPlaceById",static:!1,private:!1,access:{has:e=>"fetchBannerPlaceById"in e,get:e=>e.fetchBannerPlaceById},metadata:i},null,n),Bt(e,null,r,{kind:"method",name:"fetchContext",static:!1,private:!1,access:{has:e=>"fetchContext"in e,get:e=>e.fetchContext},metadata:i},null,n),i&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i})})()})();class Mt{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerStore",{enumerable:!0,configurable:!0,writable:!0,value:t})}createBannerPlace(e,t){var r;const n=new kt(this.storyManager.httpClient,this.storyManager),i=new Me(n),a=new xt(this.storyManager,this.bannerStore,i);return new ne(null!==(r=null==t?void 0:t.toString())&&void 0!==r?r:"default",e,i,this.bannerStore,a)}createBannerPreviewPlace(e,t){const r=new kt(this.storyManager.httpClient,this.storyManager),n=new Me(r),i=new xt(this.storyManager,this.bannerStore,n);return new Be(t.toString(),e,this.bannerStore,i)}}class Rt{static toDomain(e,t){return new k({id:e.id,name:e.name,slides:e.slides.map((e=>new D({html:e.html,duration:e.duration}))),displayFrom:e.display_from,displayTo:e.display_to,appearance:new A(e.appearance),context:new B(e.id,t),frequencyLimit:e.frequency_limit})}}class Dt{static toDomain(e,t,r){const n=e.banners.map((e=>Rt.toDomain(e,t)));return new z({id:e.id,banners:n,placeholders:r,style:t.style})}}var Nt=function(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0},zt=function(e,t,r,n,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?n.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),u=!1,p=r.length-1;p>=0;p--){var b={};for(var f in n)b[f]="access"===f?{}:n[f];for(var f in n.access)b.access[f]=n.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,n.name,h),u=!0},Wt=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},Ft=function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r};let Vt=(()=>{var e,t,r;let n,i,a,s,o=[],l=[],c=[],d=[],h=[];return e=class{get _bannerPlaces(){return Wt(this,t,"f")}set _bannerPlaces(e){Ft(this,t,e,"f")}get _banners(){return Wt(this,r,"f")}set _banners(e){Ft(this,r,e,"f")}constructor(e,n){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(Nt(this,o),e)}),Object.defineProperty(this,"bannerApi",{enumerable:!0,configurable:!0,writable:!0,value:n}),t.set(this,Nt(this,l,L.observable.map())),r.set(this,(Nt(this,c),Nt(this,d,L.observable.map()))),Object.defineProperty(this,"bannerCSS",{enumerable:!0,configurable:!0,writable:!0,value:(Nt(this,h),"")}),(0,L.reaction)((()=>e.rootStore.placeholderStore.placeholders),(e=>{for(const t of this._bannerPlaces.values())t.updatePlaceholders(e)}))}get bannerPlaces(){return Array.from(this._bannerPlaces.values())}async getBannerById(e){if(this._banners.has(e))return this._banners.get(e);await this.storyManager.waitStoryManagerConfig();const t=await this.fetchBannerContext(),r=await this.bannerApi.fetchBannerById(e);return this.addBanner(r,t)}async getBannerPlaceById(e){if(this._bannerPlaces.has(e.placeId))return this._bannerPlaces.get(e.placeId);await this.storyManager.waitStoryManagerConfig();const t=await this.fetchBannerContext(),r=await this.bannerApi.fetchBannerPlaceById({placeId:e.placeId,tags:this.storyManager.config.tags});return this.addBannerPlace(r,t)}clearCache(){this._bannerPlaces=L.observable.map(),this._banners=L.observable.map()}removeBannerPlaceById(e){this._bannerPlaces.delete(e)}async updateBannerUserData(e,t){if(!this.storyManager.isStatisticsDisabled)return this.bannerApi.updateUserData(e,t);console.log("[IAM]: update user data",{bannerId:e,payload:t})}async fetchBannerContext(){await this.storyManager.rootStore.sessionStore.open();const e=await this.bannerApi.fetchContextWithStyles({needFetchStyles:!this.bannerCSS});return this.bannerCSS&&(e.style=this.bannerCSS),e}addBannerPlace(e,t){const r=this.storyManager.rootStore.placeholderStore.placeholders,n=Dt.toDomain(e,t,r);return this._bannerPlaces.set(e.id,n),n}addBanner(e,t){const r=this.storyManager.rootStore.placeholderStore.placeholders,n=Rt.toDomain(e,t);return n.updatePlaceholders(r),this._banners.set(n.id,n),n}},t=new WeakMap,r=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;n=[L.observable],i=[L.observable],a=[L.computed],s=[Tt],zt(e,null,n,{kind:"accessor",name:"_bannerPlaces",static:!1,private:!1,access:{has:e=>"_bannerPlaces"in e,get:e=>e._bannerPlaces,set:(e,t)=>{e._bannerPlaces=t}},metadata:t},l,c),zt(e,null,i,{kind:"accessor",name:"_banners",static:!1,private:!1,access:{has:e=>"_banners"in e,get:e=>e._banners,set:(e,t)=>{e._banners=t}},metadata:t},d,h),zt(e,null,a,{kind:"getter",name:"bannerPlaces",static:!1,private:!1,access:{has:e=>"bannerPlaces"in e,get:e=>e.bannerPlaces},metadata:t},null,o),zt(e,null,s,{kind:"method",name:"getBannerPlaceById",static:!1,private:!1,access:{has:e=>"getBannerPlaceById"in e,get:e=>e.getBannerPlaceById},metadata:t},null,o),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class Ut{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const t=new Ct(e.httpClient);this.bannerStore=new Vt(this.storyManager,t)}}class qt extends Error{constructor(){super("[IAS]: you must create an instance of BannersProvider"),this.name="IasBannersProviderReferenceError"}}class $t extends Error{constructor(e){super(`[IAS]: Mount point ${e} is not present in DOM at initialization time`),this.name="IasMountPointReferenceError"}}class Gt extends Oe{render(){this.root.render((0,l.jsx)(Ee,{bannerPlace:this.bannerPlace}))}}class Ht{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerPlaces",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"bannerPlaceViewModelFactory",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rootStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reloadAllBanners",{enumerable:!0,configurable:!0,writable:!0,value:()=>{this.rootStore.bannerStore.clearCache(),this.bannerPlaces.forEach((e=>{e.reload().catch(console.error)}))}}),this.rootStore=new Ut(e),this.bannerPlaceViewModelFactory=new Mt(e,this.rootStore.bannerStore),this.storyManager.rootStore.storyManagerConfigStore.waitStoryManagerConfig().then((()=>{this.storyManager.config.on("requestSDKReload",this.reloadAllBanners)}))}addBannerPlace(e){this.bannerPlaces.push(e)}removeBannerPlace(e){const t=this.bannerPlaces.indexOf(e);-1!==t&&this.bannerPlaces.splice(t,1)}clear(){for(const e of this.bannerPlaces)e.destroy();this.bannerPlaces=[]}createBannerPlace(e){return this.bannerPlaceViewModelFactory.createBannerPlace(this,e)}createBannerPreviewPlace(e){return this.bannerPlaceViewModelFactory.createBannerPreviewPlace(this,e)}static create(e){return Ht.instance||(Ht.instance=new Ht(e)),Ht.instance}mountBannerPlace(e,t){const r=document.querySelector(e);if(!r)throw new $t(e);const n=this.createBannerPlace(null==t?void 0:t.placeId),i=new Oe(r,n,t);return i.render(),i}mountBannerPreviewPlace(e,t){const r=document.querySelector(e);if(!r)throw new $t(e);const n=this.createBannerPreviewPlace(t.bannerId),i=new Gt(r,n);return i.render(),i}}const Xt=()=>{if(!Ht.instance)throw new qt;return Ht.instance},Yt=Ht;class Qt{constructor(){Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ias-banners"})}install(e){const t=Yt.create(e.INTERNAL_API);e.HOST.prototype.banners=t}uninstall(){}}const Jt=new Qt})();var u=h.RE,p=h.Sr,b=h.YL,f=h.Ay;export{u as IasBannerPlace,p as IasBannerPreview,b as IasBannersPlugin,f as default};
|
|
1
|
+
import*as e from"react/jsx-runtime";import*as t from"react";import*as n from"mobx-react-lite";import*as r from"classnames";import*as i from"mobx";import*as a from"uuid";import*as s from"react-dom/client";import*as o from"@inappstory/slide-api";var l={371:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(935),i=n.n(r)()((function(e){return e[1]}));i.push([e.id,".banner--EtvvP{width:100%;height:100%;position:relative;border-radius:var(--banner-border-radius, 0px);overflow:hidden}.banner-slides--3xhGF{position:relative;width:100%;height:100%;display:block}",""]),i.locals={banner:"banner--EtvvP","banner-slides":"banner-slides--3xhGF"};const a=i},369:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(935),i=n.n(r)()((function(e){return e[1]}));i.push([e.id,".banner-place--6ZUZe{width:100%;height:100%;position:relative}.banner-slider__slider_visible--1nA2b{border:solid 1px green}",""]),i.locals={"banner-place":"banner-place--6ZUZe","banner-slider__slider_visible":"banner-slider__slider_visible--1nA2b"};const a=i},41:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(935),i=n.n(r)()((function(e){return e[1]}));i.push([e.id,".slider--ggy2P{width:100%;height:100%;overflow:hidden;position:relative;justify-content:center}.slider__track--JSOcI{display:flex;transition:transform .3s ease;width:100%;height:100%;will-change:transform}.slider__slide--oGmUT{width:100%;height:100%;flex-shrink:0;position:relative;display:flex;align-items:center;justify-content:center;transform:translateZ(0)}",""]),i.locals={slider:"slider--ggy2P",slider__track:"slider__track--JSOcI",slider__slide:"slider__slide--oGmUT"};const a=i},379:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(935),i=n.n(r)()((function(e){return e[1]}));i.push([e.id,".slider__controls-btn--HubN5{position:absolute;top:50%;z-index:1;width:24px;height:24px;margin-top:-9px;transition:all .2s ease-in-out;cursor:pointer;padding:0;background-color:rgba(0,0,0,0);color:#0c62f3;border:0;outline:0}.slider__controls-btn--prev--kfXCq{left:1.5rem}.slider__controls-btn--next--Jzq3Q{right:1.5rem}.slider__controls-btn--HubN5{transition:opacity .3s ease-in-out}.slider__controls-btn--disabled--m1P4q{opacity:0;pointer-events:none}",""]),i.locals={"slider__controls-btn":"slider__controls-btn--HubN5","slider__controls-btn--prev":"slider__controls-btn--prev--kfXCq","slider__controls-btn--next":"slider__controls-btn--next--Jzq3Q","slider__controls-btn--disabled":"slider__controls-btn--disabled--m1P4q"};const a=i},55:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(935),i=n.n(r)()((function(e){return e[1]}));i.push([e.id,".slider-bullets--XDc5n{position:absolute;z-index:2;bottom:1.5rem;left:50%;display:inline-flex;list-style:none;transform:translate3d(-50%, 0, 0)}.slider-bullets__bullet--83aBh{background-color:var(--ias-banners-pagination-inactive-color, hsla(0, 0%, 100%, 0.5));width:var(--ias-banners-pagination-width, 8px);height:var(--ias-banners-pagination-height, 8px);padding:0;border-radius:50%;border:2px solid rgba(0,0,0,0);cursor:pointer;line-height:0;box-shadow:0 .25em .5em 0 rgba(0,0,0,.1);margin:0 .25em;transition:transform 100ms ease-in;transform:scale(0.8)}.slider-bullets__bullet--active--RDBez{background-color:#0c62f3;transform:scale(1)}",""]),i.locals={"slider-bullets":"slider-bullets--XDc5n","slider-bullets__bullet":"slider-bullets__bullet--83aBh","slider-bullets__bullet--active":"slider-bullets__bullet--active--RDBez"};const a=i},126:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(935),i=n.n(r)()((function(e){return e[1]}));i.push([e.id,".loader--4uMcs{position:absolute;z-index:10001;top:0;bottom:0;left:0;right:0;display:flex;justify-content:center;align-items:center;background:var(--loader-background, black)}.loader--4uMcs .loader__refresh-btn--5nwxY{color:#fff;cursor:pointer;position:absolute;left:50%;top:50%;transform:translate3d(-50%, -50%, 0);pointer-events:auto;padding:20px;width:32px;height:32px;box-sizing:content-box}.loader--4uMcs .loader__spinner--NRm8E{-ms-flex-negative:0;flex-shrink:0;display:inline-block;width:32px;height:32px;border-radius:50%;border:solid 2px var(--loaderBackgroundColor, white);border-color:var(--loaderBackgroundAccentColor, transparent) var(--loaderBackgroundColor, white) var(--loaderBackgroundColor, white) var(--loaderBackgroundColor, white);-webkit-animation:loading-spinner--LnXd0 .6s infinite linear;animation:loading-spinner--LnXd0 .6s infinite linear}@keyframes loading-spinner--LnXd0{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}",""]),i.locals={loader:"loader--4uMcs","loader__refresh-btn":"loader__refresh-btn--5nwxY",loader__spinner:"loader__spinner--NRm8E","loading-spinner":"loading-spinner--LnXd0"};const a=i},81:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(935),i=n.n(r)()((function(e){return e[1]}));i.push([e.id,".icon--5RBkn{width:2rem;height:2rem}",""]),i.locals={icon:"icon--5RBkn"};const a=i},935:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(r)for(var a=0;a<this.length;a++){var s=this[a][0];null!=s&&(i[s]=!0)}for(var o=0;o<e.length;o++){var l=[].concat(e[o]);r&&i[l[0]]||(n&&(l[2]?l[2]="".concat(n," and ").concat(l[2]):l[2]=n),t.push(l))}},t}},46:e=>{var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}f(e,t,a,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&f(e,"error",t,{once:!0})}(e,i)}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var s=10;function o(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function c(e,t,n,r){var i,a,s,c;if(o(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),s=a[t]),void 0===s)s=a[t]=n,++e._eventsCount;else if("function"==typeof s?s=a[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(i=l(e))>0&&s.length>i&&!s.warned){s.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=e,d.type=t,d.count=s.length,c=d,console&&console.warn&&console.warn(c)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=d.bind(r);return i.listener=n,r.wrapFn=i,i}function u(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):b(i,i.length)}function p(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function b(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function f(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(a){r.once&&e.removeEventListener(t,i),n(a)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return l(this)},a.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i="error"===e,a=this._events;if(void 0!==a)i=i&&void 0===a.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var l=a[e];if(void 0===l)return!1;if("function"==typeof l)r(l,this,t);else{var c=l.length,d=b(l,c);for(n=0;n<c;++n)r(d[n],this,t)}return!0},a.prototype.addListener=function(e,t){return c(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return c(this,e,t,!0)},a.prototype.once=function(e,t){return o(t),this.on(e,h(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return o(t),this.prependListener(e,h(this,e,t)),this},a.prototype.removeListener=function(e,t){var n,r,i,a,s;if(o(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){s=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,a=Object.keys(n);for(r=0;r<a.length;++r)"removeListener"!==(i=a[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},a.prototype.listeners=function(e){return u(this,e,!0)},a.prototype.rawListeners=function(e){return u(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},a.prototype.listenerCount=p,a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},591:(e,t,n)=>{var r,i=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),a=[];function s(e){for(var t=-1,n=0;n<a.length;n++)if(a[n].identifier===e){t=n;break}return t}function o(e,t){for(var n={},r=[],i=0;i<e.length;i++){var o=e[i],l=t.base?o[0]+t.base:o[0],c=n[l]||0,d="".concat(l," ").concat(c);n[l]=c+1;var h=s(d),u={css:o[1],media:o[2],sourceMap:o[3]};-1!==h?(a[h].references++,a[h].updater(u)):a.push({identifier:d,updater:f(u,t),references:1}),r.push(d)}return r}function l(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var a=n.nc;a&&(r.nonce=a)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var s=i(e.insert||"head");if(!s)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");s.appendChild(t)}return t}var c,d=(c=[],function(e,t){return c[e]=t,c.filter(Boolean).join("\n")});function h(e,t,n,r){var i=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=d(t,i);else{var a=document.createTextNode(i),s=e.childNodes;s[t]&&e.removeChild(s[t]),s.length?e.insertBefore(a,s[t]):e.appendChild(a)}}function u(e,t,n){var r=n.css,i=n.media,a=n.sourceMap;if(i?e.setAttribute("media",i):e.removeAttribute("media"),a&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var p=null,b=0;function f(e,t){var n,r,i;if(t.singleton){var a=b++;n=p||(p=l(t)),r=h.bind(null,n,a,!1),i=h.bind(null,n,a,!0)}else n=l(t),r=u.bind(null,n,t),i=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else i()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=(void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r));var n=o(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<n.length;r++){var i=s(n[r]);a[i].references--}for(var l=o(e,t),c=0;c<n.length;c++){var d=s(n[c]);0===a[d].references&&(a[d].updater(),a.splice(d,1))}n=l}}}},968:(e,t,n)=>{const r=document.querySelector("[nonce]");r&&(n.nc=r.nonce||r.getAttribute("nonce"))}},c={};function d(e){var t=c[e];if(void 0!==t)return t.exports;var n=c[e]={id:e,exports:{}};return l[e](n,n.exports,d),n.exports}d.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return d.d(t,{a:t}),t},d.d=(e,t)=>{for(var n in t)d.o(t,n)&&!d.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),d.nc=void 0;var h={};(()=>{d.d(h,{RE:()=>je,Sr:()=>Ie,YL:()=>Jt,Ay:()=>Zt}),d(968);const l=(e=>{var t={};return d.d(t,e),t})({jsx:()=>e.jsx,jsxs:()=>e.jsxs}),c=(e=>{var t={};return d.d(t,e),t})({useEffect:()=>t.useEffect,useLayoutEffect:()=>t.useLayoutEffect,useRef:()=>t.useRef,useState:()=>t.useState}),u=(e=>{var t={};return d.d(t,e),t})({observer:()=>n.observer});var p=d(591),b=d.n(p),f=d(371);b()(f.A,{insert:"head",singleton:!1});const m=f.A.locals||{};var v=d(126);b()(v.A,{insert:"head",singleton:!1});const y=v.A.locals||{};var g=d(81);b()(g.A,{insert:"head",singleton:!1});const w=g.A.locals||{},S=(e=>{var t={};return d.d(t,e),t})({default:()=>r.default}),P=({onClick:e,className:t})=>(0,l.jsx)("div",{className:(0,S.default)(w.icon,t),onClick:e,children:(0,l.jsx)("svg",{viewBox:"0 0 24 24",children:(0,l.jsx)("path",{fill:"currentColor",d:"M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z"})})}),_=(0,u.observer)((e=>{const t=e.needShowErrorScreen,n=e.needShowLoaderScreen;return n||t?(0,l.jsx)("div",{className:(0,S.default)(y.loader),style:{"--loader-background":e.background,"--loaderBackgroundColor":e.color},onClick:e=>{e.preventDefault()},children:t?(0,l.jsx)(P,{className:y["loader__refresh-btn"],onClick:t=>{t.stopPropagation(),e.onReload()}}):n&&(0,l.jsx)("div",{className:y.loader__spinner})}):null})),E=()=>null!==d.nc&&void 0!==d.nc?d.nc:"";class x extends HTMLElement{constructor(){super(...arguments),Object.defineProperty(this,"styleElement",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"mountPoint",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"handleClick",{enumerable:!0,configurable:!0,writable:!0,value:e=>{var t;this.shadowRoot&&"true"===this.shadowRoot.host.getAttribute("allow-click")&&(null===(t=this.banner)||void 0===t||t.activeSlide.onClick({event:e,currentTarget:this.shadowRoot.host}))}})}setBanner(e){this.banner=e}setStyle(e){var t;this.styleElement&&this.styleElement.parentNode&&this.styleElement.parentNode.removeChild(this.styleElement);const n=document.createElement("style");n.textContent=e,n.setAttribute("nonce",E()),this.styleElement=n,null===(t=this.shadowRoot)||void 0===t||t.prepend(n)}async init(){this.mountPoint&&this.banner&&(this.mountPoint.addEventListener("click",this.handleClick),await this.banner.attachRoot(this.mountPoint))}destroy(){var e,t;null===(e=this.banner)||void 0===e||e.detachRoot(),null===(t=this.mountPoint)||void 0===t||t.removeEventListener("click",this.handleClick)}connectedCallback(){if(this.shadowRoot)return;const e=this.attachShadow({mode:"open"});this.mountPoint=document.createElement("div"),this.mountPoint.style.height="100%",this.mountPoint.style.width="100%",e.appendChild(this.mountPoint)}disconnectedCallback(){}}function T(e){const t=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)$/i);if(t){const[e,n,r,i]=t.map(Number);return(299*n+587*r+114*i)/1e3>128}if(e.startsWith("#")){const t=e.slice(1);let n,r,i;if(3===t.length)n=parseInt(t[0]+t[0],16),r=parseInt(t[1]+t[1],16),i=parseInt(t[2]+t[2],16);else{if(6!==t.length)return!1;n=parseInt(t.slice(0,2),16),r=parseInt(t.slice(2,4),16),i=parseInt(t.slice(4,6),16)}return(299*n+587*r+114*i)/1e3>128}return!0}customElements.get("banner-slides-container")||customElements.define("banner-slides-container",x);const O=(0,u.observer)((e=>{var{banner:t}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["banner"]);const r=(0,c.useRef)(null),i=(0,c.useRef)(null),a=t.canBeShown;return(0,c.useLayoutEffect)((()=>{r.current&&r.current.setStyle(t.context.style)}),[t.context.style]),(0,c.useLayoutEffect)((()=>{if(!r.current)return;const e=r.current;return e.setBanner(t),e.init(),()=>{e.destroy()}}),[t]),(0,c.useEffect)((()=>{if(n.isActive&&a)return t.start(),()=>{t.stop()}}),[t,n.isActive,a]),(0,l.jsxs)("div",{className:(0,S.default)(m.banner,"ias-banner",n.className),ref:i,style:{height:t.width/t.contentRatio+"px",opacity:a?1:0,background:t.appearance.background,"--banner-border-radius":`${n.clientAppearance.borderRadius}px`},children:[(0,l.jsx)("banner-slides-container",{class:m["banner-slides"],ref:r,"allow-click":n.allowClick.toString(),dir:t.dir}),(0,l.jsx)(_,{needShowErrorScreen:t.needShowErrorScreen,needShowLoaderScreen:t.needShowLoaderScreen,onReload:async()=>{t.activeSlide.restart()},background:t.appearance.background,color:T(t.appearance.background)?"black":"white"})]})}));var j=d(369);b()(j.A,{insert:"head",singleton:!1});const I=j.A.locals||{},L=(e=>{var t={};return d.d(t,e),t})({action:()=>i.action,computed:()=>i.computed,observable:()=>i.observable,reaction:()=>i.reaction});var C=function(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0};let B=(()=>{var e,t;let n,r=[],i=[];return e=class{get _context(){return function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}(this,t,"f")}set _context(e){!function(e,t,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===r?i.call(e,n):i?i.value=n:t.set(e,n)}(this,t,e,"f")}constructor(e){t.set(this,C(this,r,void 0)),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:C(this,i)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"displayFrom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"displayTo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"appearance",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"slides",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_wasShown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_frequencyLimit",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_openTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_isOnceOpened",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this.id=e.id,this.name=e.name,this.displayFrom=e.displayFrom,this.displayTo=e.displayTo,this.slides=e.slides,this._context=e.context,this.appearance=e.appearance}get context(){return this._context}get withinDisplayTimeRange(){return(!this.displayFrom||Date.now()>=this.displayFrom)&&(!this.displayTo||Date.now()<=this.displayTo)}get wasShown(){return this._wasShown}get frequencyLimitTimeExceeded(){return null===this._frequencyLimit?this._isOnceOpened:0!==this._frequencyLimit&&Math.trunc(this.timeSinceLastShow/1e3)<=this._frequencyLimit}get timeSinceLastShow(){return Date.now()-this._openTime}get openTime(){return this._openTime}updatePlaceholders(e){for(const t of this.slides)t.updatePlaceholders(e)}markWasShown(){this._wasShown=!0}markAsOpened(){this._openTime=Date.now(),this._isOnceOpened=!0}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;n=[L.observable],function(e,t,n,r,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?r.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),u=!1,p=n.length-1;p>=0;p--){var b={};for(var f in r)b[f]="access"===f?{}:r[f];for(var f in r.access)b.access[f]=r.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,n[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,r.name,h),u=!0}(e,null,n,{kind:"accessor",name:"_context",static:!1,private:!1,access:{has:e=>"_context"in e,get:e=>e._context,set:(e,t)=>{e._context=t}},metadata:t},r,i),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class k{constructor(e){var t;Object.defineProperty(this,"contentRatio",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"background",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.contentRatio=null!==(t=e.content_ratio)&&void 0!==t?t:1,this.background=this.mapBackgroundDtoToModel(e.background)}mapBackgroundDtoToModel(e){if(!e||0===e.alpha)return"transparent";if("solid"in e)return this.applyAlphaToColor(e.solid,e.alpha);if("linear_gradient"in e){const{angle:t,color_step_list:n}=e.linear_gradient;return`linear-gradient(${t}deg, ${n.map((t=>`${this.applyAlphaToColor(t.color,e.alpha)} ${t.position}%`)).join(", ")})`}return"transparent"}applyAlphaToColor(e,t){if(e.startsWith("#")){const n=e.slice(1),r=3===n.length;return`rgba(${parseInt(r?n[0]+n[0]:n.slice(0,2),16)}, ${parseInt(r?n[1]+n[1]:n.slice(2,4),16)}, ${parseInt(r?n[2]+n[2]:n.slice(4,6),16)}, ${t})`}return e}}class A{constructor(e,t){Object.defineProperty(this,"widgetsData",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"style",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.style=t.style,this.widgetsData=this.mapBannerContextDto(e,t)}mapBannerContextDto(e,t){var n;const r={},i=null!==(n=t.widgetsData)&&void 0!==n?n:{};for(const t in i)Array.isArray(i[t])||(r[t]=i[t][e]);return r}updateNarrativeSavedData(e){this.widgetsData._narrative_saved_data=e}}function M(e,t,n){return String(e).replace(new RegExp(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(t),"g"),(()=>n))}var R=function(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0};let D=(()=>{var e,t;let n,r=[],i=[];return e=class{get _html(){return function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}(this,t,"f")}set _html(e){!function(e,t,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===r?i.call(e,n):i?i.value=n:t.set(e,n)}(this,t,e,"f")}get html(){return this._html}get payload(){return this._payload}constructor(e){t.set(this,R(this,r,void 0)),Object.defineProperty(this,"_payload",{enumerable:!0,configurable:!0,writable:!0,value:R(this,i)}),this._html=this.replaceSlideNonce(e.html),this._payload=e.payload}updatePlaceholders(e){let t=this._html;for(const n of e)t=M(t,`%${n.key}%`,n.value);this._html=t}replaceSlideNonce(e){var t;return M(e,"{{nonce}}",null!==(t=E())&&void 0!==t?t:"")}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;n=[L.observable],function(e,t,n,r,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?r.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),u=!1,p=n.length-1;p>=0;p--){var b={};for(var f in r)b[f]="access"===f?{}:r[f];for(var f in r.access)b.access[f]=r.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,n[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,r.name,h),u=!0}(e,null,n,{kind:"accessor",name:"_html",static:!1,private:!1,access:{has:e=>"_html"in e,get:e=>e._html,set:(e,t)=>{e._html=t}},metadata:t},r,i),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();var N=function(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0};let W=(()=>{var e,t;let n,r=[],i=[];return e=class{get _banners(){return function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}(this,t,"f")}set _banners(e){!function(e,t,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===r?i.call(e,n):i?i.value=n:t.set(e,n)}(this,t,e,"f")}constructor(e){Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"style",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),t.set(this,N(this,r,[])),N(this,i),this.id=e.id,this._banners=e.banners,this.style=e.style,this.updatePlaceholders(e.placeholders)}get banners(){return this._banners}updatePlaceholders(e){for(const t of this._banners)t.updatePlaceholders(e)}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;n=[L.observable],function(e,t,n,r,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?r.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),u=!1,p=n.length-1;p>=0;p--){var b={};for(var f in r)b[f]="access"===f?{}:r[f];for(var f in r.access)b.access[f]=r.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,n[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,r.name,h),u=!0}(e,null,n,{kind:"accessor",name:"_banners",static:!1,private:!1,access:{has:e=>"_banners"in e,get:e=>e._banners,set:(e,t)=>{e._banners=t}},metadata:t},r,i),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();const z=(e,t)=>{if("number"==typeof e)return e;if("string"==typeof e){const t=parseFloat(e);if(!isNaN(t))return t}return t};var F=function(e,t,n,r,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?r.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),u=!1,p=n.length-1;p>=0;p--){var b={};for(var f in r)b[f]="access"===f?{}:r[f];for(var f in r.access)b.access[f]=r.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,n[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,r.name,h),u=!0},U=function(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0},V=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)},q=function(e,t,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(e,n):i?i.value=n:t.set(e,n),n};let $=(()=>{var e,t;let n,r=[],i=[];return e=class{get borderRadius(){return V(this,t,"f")}set borderRadius(e){q(this,t,e,"f")}update(e){this.borderRadius=z(null==e?void 0:e.borderRadius,this.borderRadius)}constructor(){t.set(this,U(this,r,12)),U(this,i)}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;n=[L.observable],F(e,null,n,{kind:"accessor",name:"borderRadius",static:!1,private:!1,access:{has:e=>"borderRadius"in e,get:e=>e.borderRadius,set:(e,t)=>{e.borderRadius=t}},metadata:t},r,i),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})(),H=(()=>{var e,t,n,r,i,a,s,o;let l,c,d,h,u,p,b,f=[],m=[],v=[],y=[],g=[],w=[],S=[],P=[],_=[],E=[],x=[],T=[],O=[],j=[];return e=class{get loop(){return V(this,t,"f")}set loop(e){q(this,t,e,"f")}get gap(){return V(this,n,"f")}set gap(e){q(this,n,e,"f")}get autoplay(){return V(this,r,"f")}set autoplay(e){q(this,r,e,"f")}get animationSpeed(){return V(this,i,"f")}set animationSpeed(e){q(this,i,e,"f")}get slidesPerView(){return V(this,a,"f")}set slidesPerView(e){q(this,a,e,"f")}get navigation(){return V(this,s,"f")}set navigation(e){q(this,s,e,"f")}get pagination(){return V(this,o,"f")}set pagination(e){q(this,o,e,"f")}constructor(e){t.set(this,U(this,f,!0)),n.set(this,(U(this,m),U(this,v,16))),r.set(this,(U(this,y),U(this,g,!0))),i.set(this,(U(this,w),U(this,S,300))),a.set(this,(U(this,P),U(this,_,1))),s.set(this,(U(this,E),U(this,x,{enabled:!0}))),o.set(this,(U(this,T),U(this,O,{enabled:!0}))),Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:(U(this,j),new $)}),e&&this.update(e)}update(e){var t,n,r,i,a,s;this.loop=null!==(t=null==e?void 0:e.loop)&&void 0!==t?t:this.loop,this.gap=z(null==e?void 0:e.gap,this.gap),this.autoplay=null!==(n=null==e?void 0:e.autoplay)&&void 0!==n?n:this.autoplay,this.animationSpeed=z(null==e?void 0:e.animationSpeed,this.animationSpeed),this.slidesPerView=Math.max(z(null==e?void 0:e.slidesPerView,this.slidesPerView),0),this.navigation={enabled:null!==(i=null===(r=null==e?void 0:e.navigation)||void 0===r?void 0:r.enabled)&&void 0!==i?i:this.navigation.enabled},this.pagination={enabled:null!==(s=null===(a=null==e?void 0:e.pagination)||void 0===a?void 0:a.enabled)&&void 0!==s?s:this.pagination.enabled},this.banner.update(e.banner)}},t=new WeakMap,n=new WeakMap,r=new WeakMap,i=new WeakMap,a=new WeakMap,s=new WeakMap,o=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;l=[L.observable],c=[L.observable],d=[L.observable],h=[L.observable],u=[L.observable],p=[L.observable],b=[L.observable],F(e,null,l,{kind:"accessor",name:"loop",static:!1,private:!1,access:{has:e=>"loop"in e,get:e=>e.loop,set:(e,t)=>{e.loop=t}},metadata:t},f,m),F(e,null,c,{kind:"accessor",name:"gap",static:!1,private:!1,access:{has:e=>"gap"in e,get:e=>e.gap,set:(e,t)=>{e.gap=t}},metadata:t},v,y),F(e,null,d,{kind:"accessor",name:"autoplay",static:!1,private:!1,access:{has:e=>"autoplay"in e,get:e=>e.autoplay,set:(e,t)=>{e.autoplay=t}},metadata:t},g,w),F(e,null,h,{kind:"accessor",name:"animationSpeed",static:!1,private:!1,access:{has:e=>"animationSpeed"in e,get:e=>e.animationSpeed,set:(e,t)=>{e.animationSpeed=t}},metadata:t},S,P),F(e,null,u,{kind:"accessor",name:"slidesPerView",static:!1,private:!1,access:{has:e=>"slidesPerView"in e,get:e=>e.slidesPerView,set:(e,t)=>{e.slidesPerView=t}},metadata:t},_,E),F(e,null,p,{kind:"accessor",name:"navigation",static:!1,private:!1,access:{has:e=>"navigation"in e,get:e=>e.navigation,set:(e,t)=>{e.navigation=t}},metadata:t},x,T),F(e,null,b,{kind:"accessor",name:"pagination",static:!1,private:!1,access:{has:e=>"pagination"in e,get:e=>e.pagination,set:(e,t)=>{e.pagination=t}},metadata:t},O,j),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();const G=(e=>{var t={};return d.d(t,e),t})({v4:()=>a.v4});class X{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"eventId",{enumerable:!0,configurable:!0,writable:!0,value:(0,G.v4)()})}get type(){return"view"}toQueryParams(){return{ei:this.eventId,ii:this.payload.iterationId,si:this.payload.slideIndex,st:this.payload.slideTotal}}}class Q{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"eventId",{enumerable:!0,configurable:!0,writable:!0,value:(0,G.v4)()})}get type(){return this.payload.type}toQueryParams(){return Object.assign({ei:this.eventId,ii:this.payload.iterationId,si:this.payload.slideIndex,st:this.payload.slideTotal,d:this.payload.durationMs},this.payload.widgetPayload)}}var Y=d(46);class J{constructor(){Object.defineProperty(this,"autoplay",{enumerable:!0,configurable:!0,writable:!0,value:{isPaused:function(){return!1},resume:function(){},pause:function(){},start:function(){},stop:function(){},setDelay:function(){}}})}updateSize(){}enableHorizontalSwipeGesture(){}disableHorizontalSwipeGesture(){}getTotalPages(){return 1}getActiveIndex(){return 0}toNextSlide(){}toPrevSlide(){}slideTo(e,t){}}var Z,K=function(e,t,n,r,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?r.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),u=!1,p=n.length-1;p>=0;p--){var b={};for(var f in r)b[f]="access"===f?{}:r[f];for(var f in r.access)b.access[f]=r.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,n[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,r.name,h),u=!0},ee=function(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0},te=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)},ne=function(e,t,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(e,n):i?i.value=n:t.set(e,n),n};!function(e){e.LoadStart="loadStart",e.LoadEnd="loadEnd",e.LoadError="loadError",e.ActiveIndexChange="activeIndexChange",e.AutoplayTimeLeft="autoplayTimeLeft",e.ShowBanner="showBanner",e.ShowBannerFailed="showBannerFailed",e.BannerWidget="bannerWidget"}(Z||(Z={}));let re=(()=>{var e,t,n,r,i;let a,s,o,l,c=Y.EventEmitter,d=[],h=[],u=[],p=[],b=[],f=[],m=[],v=[];return e=class extends c{get _banners(){return te(this,t,"f")}set _banners(e){ne(this,t,e,"f")}get _bannerPlace(){return te(this,n,"f")}set _bannerPlace(e){ne(this,n,e,"f")}get _isLoading(){return te(this,r,"f")}set _isLoading(e){ne(this,r,e,"f")}get _isLoaded(){return te(this,i,"f")}set _isLoaded(e){ne(this,i,e,"f")}constructor(e,a,s,o,l){super(),Object.defineProperty(this,"placeId",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"bannerStatisticService",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"bannerStore",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"bannerViewModelFactory",{enumerable:!0,configurable:!0,writable:!0,value:l}),t.set(this,ee(this,d,[])),n.set(this,(ee(this,h),ee(this,u,null))),r.set(this,(ee(this,p),ee(this,b,!1))),i.set(this,(ee(this,f),ee(this,m,!1))),Object.defineProperty(this,"appearance",{enumerable:!0,configurable:!0,writable:!0,value:(ee(this,v),new H)}),Object.defineProperty(this,"sliderController",{enumerable:!0,configurable:!0,writable:!0,value:new J}),this.ctx.addBannerPlace(this)}get id(){return this.placeId}get banners(){return this._banners}get contentRatio(){const e=this._banners.map((e=>e.contentRatio));return this.median(e)}get isLoaded(){return this._isLoaded}get isLoading(){return this._isLoading}get slider(){return this.sliderController}get activeIndex(){return this.sliderController.getActiveIndex()}get activeBanner(){return this._banners[this.activeIndex]}get paginationBullets(){return this.sliderController.getTotalPages()}refreshSizes(){this._banners.forEach((e=>e.refreshSizes()))}setSliderController(e){this.sliderController=e}updateAppearance(e){this.appearance.update(e)}resume(){for(const e of this._banners)e.resumeByUser();this.appearance.autoplay&&this.slider.autoplay.resume()}pause(){for(const e of this._banners)e.pauseByUser();this.appearance.autoplay&&this.slider.autoplay.pause()}async reload(){this.bannerStore.removeBannerPlaceById(this.id),await Promise.all(this._banners.map((e=>e.destroy()))),this._banners=[],await this.fetchBanners()}destroy(){this.sliderController=new J;for(const e of this._banners)e.destroy();this._banners=[],this.ctx.removeBannerPlace(this)}notifyTimerEnd(){var e;null===(e=this.activeBanner)||void 0===e||e.notifyTimerEnd()}showNext(){this.sliderController.toNextSlide()}showPrevious(){this.sliderController.toPrevSlide()}showByIndex(e,t){this.sliderController.slideTo(e,t)}async updateUserData(e){return this.bannerStore.updateBannerUserData(this.id,e)}async fetchBanners(){try{return this._isLoading?[]:(this._isLoading=!0,this._isLoaded=!1,this.emit(Z.LoadStart),this._bannerPlace=await this.bannerStore.getBannerPlaceById({placeId:this.placeId}),this._banners=this.filterBannersByTimeRange(this._bannerPlace.banners).map((e=>this.bannerViewModelFactory.create(this,e))),await Promise.allSettled(this._banners.map((e=>e.waitInit()))),this._isLoaded=!0,this._banners)}catch(e){throw this.emit(Z.LoadError,e),e}finally{this.emit(Z.LoadEnd),this._isLoading=!1}}filterBannersByTimeRange(e){return e.filter((e=>e.withinDisplayTimeRange))}median(e){const t=[...e].sort(((e,t)=>e-t)),n=Math.floor(t.length/2);return t.length%2==0?(t[n-1]+t[n])/2:t[n]}},t=new WeakMap,n=new WeakMap,r=new WeakMap,i=new WeakMap,(()=>{var t;const n="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=c[Symbol.metadata])&&void 0!==t?t:null):void 0;a=[L.observable],s=[L.observable],o=[L.observable],l=[L.observable],K(e,null,a,{kind:"accessor",name:"_banners",static:!1,private:!1,access:{has:e=>"_banners"in e,get:e=>e._banners,set:(e,t)=>{e._banners=t}},metadata:n},d,h),K(e,null,s,{kind:"accessor",name:"_bannerPlace",static:!1,private:!1,access:{has:e=>"_bannerPlace"in e,get:e=>e._bannerPlace,set:(e,t)=>{e._bannerPlace=t}},metadata:n},u,p),K(e,null,o,{kind:"accessor",name:"_isLoading",static:!1,private:!1,access:{has:e=>"_isLoading"in e,get:e=>e._isLoading,set:(e,t)=>{e._isLoading=t}},metadata:n},b,f),K(e,null,l,{kind:"accessor",name:"_isLoaded",static:!1,private:!1,access:{has:e=>"_isLoaded"in e,get:e=>e._isLoaded,set:(e,t)=>{e._isLoaded=t}},metadata:n},m,v),n&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n})})(),e})();const ie=e=>((0,c.useEffect)((()=>(e.onLoadStart&&e.bannerPlace.on(Z.LoadStart,e.onLoadStart),e.onLoadEnd&&e.bannerPlace.on(Z.LoadEnd,e.onLoadEnd),e.onLoadError&&e.bannerPlace.on(Z.LoadError,e.onLoadError),e.onActiveIndexChange&&e.bannerPlace.on(Z.ActiveIndexChange,e.onActiveIndexChange),e.onAutoplayTimeLeft&&e.bannerPlace.on(Z.AutoplayTimeLeft,e.onAutoplayTimeLeft),e.onShowBanner&&e.bannerPlace.on(Z.ShowBanner,e.onShowBanner),e.onShowBannerFailed&&e.bannerPlace.on(Z.ShowBannerFailed,e.onShowBannerFailed),e.onBannerWidget&&e.bannerPlace.on(Z.BannerWidget,e.onBannerWidget),()=>{e.onLoadStart&&e.bannerPlace.off(Z.LoadStart,e.onLoadStart),e.onLoadEnd&&e.bannerPlace.off(Z.LoadEnd,e.onLoadEnd),e.onLoadError&&e.bannerPlace.off(Z.LoadError,e.onLoadError),e.onActiveIndexChange&&e.bannerPlace.off(Z.ActiveIndexChange,e.onActiveIndexChange),e.onAutoplayTimeLeft&&e.bannerPlace.off(Z.AutoplayTimeLeft,e.onAutoplayTimeLeft),e.onShowBanner&&e.bannerPlace.off(Z.ShowBanner,e.onShowBanner),e.onShowBannerFailed&&e.bannerPlace.off(Z.ShowBannerFailed,e.onShowBannerFailed),e.onBannerWidget&&e.bannerPlace.off(Z.BannerWidget,e.onBannerWidget)})),[e.bannerPlace,e.onLoadStart,e.onLoadError,e.onLoadEnd,e.onActiveIndexChange,e.onAutoplayTimeLeft,e.onShowBanner,e.onShowBannerFailed,e.onBannerWidget]),(0,c.useEffect)((()=>{(async e=>{try{await e.fetchBanners()}catch(e){console.error(e)}})(e.bannerPlace)}),[e.bannerPlace]),e.bannerPlace.banners);class ae{constructor(e){Object.defineProperty(this,"slider",{enumerable:!0,configurable:!0,writable:!0,value:e})}isPaused(){return this.slider.autoplay.paused}resume(){this.slider.autoplay.resume()}pause(){this.slider.autoplay.pause()}start(){this.slider.autoplay.start()}setDelay(e){this.slider.autoplay.setDelay(e)}stop(){this.slider.autoplay.stop()}}class se{constructor(e){Object.defineProperty(this,"slider",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"autoplay",{enumerable:!0,configurable:!0,writable:!0,value:new ae(this.slider)})}getTotalPages(){return this.slider.totalPages}getActiveIndex(){return this.slider.realIndex}toNextSlide(){this.slider.toNextSlide()}toPrevSlide(){this.slider.toPrevSlide()}slideTo(e,t){this.slider.slideToLoop(e,t)}enableHorizontalSwipeGesture(){this.slider.enableHorizontalSwipeGesture()}disableHorizontalSwipeGesture(){this.slider.disableHorizontalSwipeGesture()}updateSize(){this.slider.updateSize()}}var oe=d(55);b()(oe.A,{insert:"head",singleton:!1});const le=oe.A.locals||{},ce=e=>{const[t,n]=(0,c.useState)(-1);return(0,c.useEffect)((()=>{e.activeIndex===t&&n(-1)}),[e.activeIndex,t]),e.totalPages>1&&(0,l.jsx)("div",{className:(0,S.default)(le["slider-bullets"],"ias-banners-bullets"),children:Array.from({length:e.totalPages}).map(((t,r)=>(0,l.jsx)("div",{className:(0,S.default)("ias-banners__bullet",le["slider-bullets__bullet"],{[le["slider-bullets__bullet--active"]]:r===e.activeIndex,"ias-banners__bullet--active":r===e.activeIndex}),onClick:()=>(t=>{n(t),e.onClick(t)})(r)},r)))})};var de=d(41);b()(de.A,{insert:"head",singleton:!1});const he=de.A.locals||{};var ue=d(379);b()(ue.A,{insert:"head",singleton:!1});const pe=ue.A.locals||{},be=e=>(0,l.jsxs)("div",{children:[(0,l.jsx)("button",{onClick:e.onPrevClick,className:(0,S.default)("ias-banners__controls-btn","ias-banners__controls-btn--prev",pe["slider__controls-btn"],pe["slider__controls-btn--prev"],{[pe["slider__controls-btn--disabled"]]:e.prevDisabled,"ias-banners__controls-btn--disabled":e.prevDisabled}),children:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{d:"M0 12l10.975 11 2.848-2.828-6.176-6.176H24v-3.992H7.646l6.176-6.176L10.975 1 0 12z",fill:"currentColor"})})}),(0,l.jsx)("button",{onClick:e.onNextClick,className:(0,S.default)("ias-banners__controls-btn","ias-banners__controls-btn--next",pe["slider__controls-btn"],pe["slider__controls-btn--next"],{[pe["slider__controls-btn--disabled"]]:e.nextDisabled,"ias-banners__controls-btn--disabled":e.nextDisabled}),children:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{d:"M13.025 1l-2.847 2.828 6.176 6.176h-16.354v3.992h16.354l-6.176 6.176 2.847 2.828 10.975-11z",fill:"currentColor"})})})]});class fe{constructor(e){Object.defineProperty(this,"slider",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_enabled",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get enabled(){return this._enabled}update(){const e=this.slider.options.loop&&this.canUseLoop();this._enabled?e||(this._enabled=!1,this.destroy()):e&&(this._enabled=!0)}applyLoopFix({targetIndex:e,direction:t}){if(!this.enabled)return!1;const n="next"===t||!t,r="prev"!==t&&t?[]:this.getPrependSlidesIndexes(e),i=n?this.getAppendSlidesIndexes(e):[];return this.moveSlides(r,i),this.adjustPosition(r,i),r.length>0||i.length>0}destroy(){this.resetSlidesOrder()}resetSlidesOrder(){const e=[];this.slider.slides.forEach((t=>{const n=+t.dataset.index;e[n]=t})),e.forEach((e=>{this.slider.track.append(e)}))}canUseLoop(){return!(this.slider.slides.length<this.slider.options.slidesPerView+1&&(console.warn("IAS Banners Loop Warning: The number of slides is not enough for loop mode, it will be disabled or not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView parameters"),1))}getPrependSlidesIndexes(e){const t=this.slider.track.children,n=[];if(e<1)for(let r=0;r<1-e;r++){const e=t.length-r-1;n.push(e)}return n}getAppendSlidesIndexes(e){const t=[];if(e+this.slider.options.slidesPerView>this.slider.slides.length-1){const n=Math.max(e-(this.slider.slides.length-2),1);for(let e=0;e<n;e++){const n=e;t.push(n)}}return t}moveSlides(e,t){const n=this.slider.track,r=this.slider.slides.slice();e.forEach((e=>{n.prepend(r[e])})),t.forEach((e=>{n.append(r[e])}))}adjustPosition(e,t){e.length>0?this.slider.slideTo(this.slider.activeIndex+e.length,0):t.length>0&&this.slider.slideTo(this.slider.activeIndex-t.length,0)}}var me,ve;!function(e){e.TouchStart="touchStart",e.TouchMove="touchMove",e.TouchEnd="touchEnd",e.ReachStart="reachStart",e.ReachEnd="reachEnd",e.ActiveIndexChange="activeIndexChange",e.RealIndexChnage="realIndexChange",e.TransitionStart="transitionStart",e.TransitionEnd="transitionend",e.Resize="resize",e.SlidesUpdated="slidesUpdated",e.AutoplayTimeLeft="autoplayTimeLeft"}(me||(me={}));class ye{constructor(e,t){Object.defineProperty(this,"slider",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"loopModule",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"startX",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"startTranslateX",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"isTouched",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isMoved",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_enabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"startDirection",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"onTouchStart",{enumerable:!0,configurable:!0,writable:!0,value:e=>{!this.slider.animating&&this._enabled&&(e.stopPropagation(),this.startX=e instanceof MouseEvent?e.pageX:e.touches[0].clientX,this.startTranslateX=this.slider.currentTranslateX,this.isTouched=!0,this.setGrabCursor(!1))}}),Object.defineProperty(this,"onTouchMove",{enumerable:!0,configurable:!0,writable:!0,value:e=>{if(!this.isTouched)return;e.stopPropagation();let t=(e instanceof MouseEvent?e.pageX:e.touches[0].clientX)-this.startX;if(t*=1,!(Math.abs(t)>20||this._isMoved))return;this.setGrabCursor(!0),this._isMoved||(this.slider.emit(me.TouchStart),this.slider.autoplay.pause(),this.slider.lockActiveIndex(),this.startDirection=this.getSwipeDirection(t)),this._isMoved=!0;const n="next"===this.startDirection?20:-20;this.slider.emit(me.TouchMove);let r=this.startTranslateX+t+n;this.applyLoopFix(r),r=this.startTranslateX+t+n,this.setTranslate(r)}}),Object.defineProperty(this,"onTouchEnd",{enumerable:!0,configurable:!0,writable:!0,value:()=>{this.isTouched&&(this.slider.unlockActiveIndex(),this.updateActiveIndex(),this.unsetGrabCursor(),this.isTouched=!1,this._isMoved=!1,this.slider.emit(me.TouchEnd),this.slider.autoplay.resume())}}),this.slider.track.addEventListener("mousedown",this.onTouchStart,{passive:!0}),document.addEventListener("mousemove",this.onTouchMove,{passive:!0}),document.addEventListener("mouseup",this.onTouchEnd),this.slider.track.addEventListener("touchstart",this.onTouchStart,{passive:!0}),document.addEventListener("touchmove",this.onTouchMove,{passive:!0}),document.addEventListener("touchend",this.onTouchEnd)}get isMoved(){return this._isMoved}enableHorizontalSwipeGesture(){this._enabled=!0}disableHorizontalSwipeGesture(){this._enabled=!1}destroy(){this.slider.track.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd),this.slider.track.removeEventListener("mousedown",this.onTouchStart),document.removeEventListener("mousemove",this.onTouchMove),document.removeEventListener("mouseup",this.onTouchEnd)}setTranslate(e){e=this.applyEdgeResistance(e),this.slider.setTranslate(e)}applyLoopFix(e){if(!this.loopModule.enabled)return;e=-e;const t=this.slider.slideWidth+this.slider.options.spaceBetween,n=this.slider.getMinTranslate(),r=Math.abs(this.slider.getSlideOffset(this.slider.slides.length-this.slider.options.slidesPerView));e<n?this.loopModule.applyLoopFix({targetIndex:0,direction:"prev"})&&(this.startTranslateX-=t):e>r&&this.loopModule.applyLoopFix({targetIndex:this.slider.slides.length-this.slider.options.slidesPerView,direction:"next"})&&(this.startTranslateX+=t)}updateActiveIndex(){var e;if(!this.slider.slides.length)return;const{currentTranslateX:t,slides:n,options:r}=this.slider,i=(null===(e=n[0])||void 0===e?void 0:e.clientWidth)+r.spaceBetween;let a=-Math.round(t/i);const s=this.slider.totalPages-1;a=Math.min(s,Math.max(0,a)),this.slider.slideTo(a)}setGrabCursor(e){this.slider.track.style.cursor="move",this.slider.track.style.cursor=e?"grabbing":"grab"}unsetGrabCursor(){this.slider.track.style.cursor=""}getResistanceCoeff(e){const t=Math.min(Math.abs(e)/(.5*this.slider.slides[0].clientWidth),1);return.3+.7*Math.exp(3*-t)}applyEdgeResistance(e){if(this.loopModule.enabled)return e;e=-e;const t=this.slider.getMinTranslate(),n=-this.slider.getMaxTranslate();if(e>n){const t=e-n;e=n+t*this.getResistanceCoeff(t)}else if(e<t){const n=t-e;e=t-n*this.getResistanceCoeff(n)}return-e}getSwipeDirection(e){return e>0?"prev":"next"}}!function(e){e.Start="start",e.Stop="stop",e.Pause="pause",e.Resume="resume",e.Progress="progress",e.Complete="complete"}(ve||(ve={}));class ge extends Y.EventEmitter{constructor(){super(...arguments),Object.defineProperty(this,"timerId",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"currentProgress",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"progressBeforePause",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"timerPaused",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"isCompleted",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"enabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"rafId",{enumerable:!0,configurable:!0,writable:!0,value:0})}get started(){return!this.isCompleted}get paused(){return this.timerPaused}setTimer(e){0!==e?(this.timerId=setTimeout((()=>this.complete({})),e),this.currentProgress=0,this.runTimerTicks(e)):this.forceEnd()}start(e){this.timerPaused||(this.stop(),this.progressBeforePause=0,this.timeout=e,this.enabled&&(this.isCompleted=!1,this.emit(ve.Start),this.setTimer(e)))}restart(){this.stop(),this.start(this.timeout)}stop(){this.isCompleted||(this.clearTimer(),this.emit(ve.Stop),this.isCompleted=!0,this.timerPaused=!1)}pause(){this.isCompleted||(this.timerPaused=!0,this.clearTimer(),this.progressBeforePause=this.currentProgress,this.emit(ve.Pause))}resume(){if(!this.timerPaused)return;this.timerPaused=!1;const e=1-this.progressBeforePause,t=this.timeout*e;this.setTimer(t),this.emit(ve.Resume)}forceEnd(){this.complete({forceEnd:!0})}disable(){this.enabled=!1,this.stop()}enable(){this.enabled=!0,this.start(this.timeout)}complete({forceEnd:e=!1}){this.isCompleted=!0,this.progressBeforePause=0,this.clearTimer(),this.emit(ve.Complete,{forceEnd:e})}clearTimer(){cancelAnimationFrame(this.rafId),null!==this.timerId&&(clearTimeout(this.timerId),this.timerId=null)}updateProgress(e){const t=1-this.progressBeforePause;this.currentProgress=this.progressBeforePause+e*t;const n=100*this.currentProgress;this.emit(ve.Progress,n)}runTimerTicks(e){let t=performance.now();const n=r=>{let i=(r-t)/e;i>1&&(i=1);let a=i;this.updateProgress(a),i<1&&(this.rafId=requestAnimationFrame(n))};this.rafId=requestAnimationFrame(n)}}class we{constructor(e,t){Object.defineProperty(this,"slider",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"loopModule",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:new ge}),Object.defineProperty(this,"delay",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"handleTimerComplete",{enumerable:!0,configurable:!0,writable:!0,value:async({forceEnd:e})=>{e||this.slider.emit(me.AutoplayTimeLeft)}}),this.timer.on("complete",this.handleTimerComplete)}get paused(){return this.timer.paused}start(){this.slider.options.autoplay&&(this.stop(),this.timer.start(this.delay))}stop(){this.timer.stop()}pause(){this.slider.options.autoplay&&this.timer.pause()}resume(){this.slider.options.autoplay&&this.timer.resume()}setDelay(e){this.delay=e}destroy(){this.timer.off("complete",this.handleTimerComplete),this.stop()}}class Se extends Y.EventEmitter{constructor(e,t={}){super(),Object.defineProperty(this,"track",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:{autoplay:!1,speed:300,delay:3e3,loop:!1,slidesPerView:1,spaceBetween:0,initialSlide:0,updateOnWindowResize:!0}}),Object.defineProperty(this,"isAnimating",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_activeIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_realIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_currentTranslateX",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_reachEnd",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_reachStart",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"loopModule",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"touchModule",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_slideWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"autoplay",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_activeIndexLocked",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"handleResize",{enumerable:!0,configurable:!0,writable:!0,value:()=>{this.updateSize(),this.emit(me.Resize)}}),this.track=e,this.container=e.parentElement,this.loopModule=new fe(this),this.touchModule=new ye(this,this.loopModule),this.autoplay=new we(this,this.loopModule),this.options.updateOnWindowResize&&window.addEventListener("resize",this.handleResize),this.collectSlides(),this.update(t)}get activeIndex(){return this._activeIndex}get realIndex(){return this._realIndex}get reachEnd(){return this._reachEnd}get reachStart(){return this._reachStart}get slidesEl(){return this.track}get slides(){return Array.from(this.track.children)}get allSlides(){return this.slides}get animating(){return this.isAnimating}get currentTranslateX(){return this._currentTranslateX}get isMoved(){return this.touchModule.isMoved}get slideWidth(){return this._slideWidth}get totalPages(){return this.loopModule.enabled?this.slides.length:Math.max(this.slides.length-this.options.slidesPerView+1,1)}async slideToLoop(e,t=this.options.speed){if(!this.loopModule.enabled)return this.slideTo(e,t);if(this.isAnimating)return;const n=this.getPhysicalIndexByRealIndex(e),r=this.slides.length-n<this.options.slidesPerView,i=n-this._activeIndex-1<this.options.slidesPerView?"next":"prev";if(r){const e="next"===i?n+1:n-this.slides.length+1;this.loopModule.applyLoopFix({targetIndex:e,direction:i})}const a=this.getPhysicalIndexByRealIndex(e);requestAnimationFrame((()=>this.slideTo(a)))}async slideTo(e,t=this.options.speed){e=this.clamp(e,0,this.totalPages-1),this.isAnimating||(this.isAnimating=!0,await this.performTranslateToSlide(e,t),this._activeIndexLocked||this.updateIndexes(e),this.isAnimating=!1)}lockActiveIndex(){this._activeIndexLocked=!0}unlockActiveIndex(){this._activeIndexLocked=!1}toNextSlide(){this.isAnimating||(this.loopModule.enabled?this.toNextSlideByLoop():this.slideTo(this.normalizeIndex(this._realIndex+1)))}toPrevSlide(){this.isAnimating||(this.loopModule.enabled?this.toPrevSlideByLoop():this.slideTo(this.normalizeIndex(this._realIndex-1)))}update(e){this.options=this.normalizeOptions(Object.assign(Object.assign({},this.options),e)),this.setupTrackStyles();const t=this.slideWidth;this.calculateSlideWidths(),t!==this.slideWidth&&this.emit(me.SlidesUpdated),this.loopModule.update(),this.slideTo(this._activeIndex,0),this.testAttraction()}destroy(){window.removeEventListener("resize",this.handleResize),this.autoplay.destroy(),this.touchModule.destroy(),this.track.removeAttribute("style"),this._activeIndex=0,this._activeIndexLocked=!1,this.isAnimating=!1}isSlideVisible(e){const t=this.getPhysicalIndexByRealIndex(e);return t>=this._activeIndex&&t<this._activeIndex+this.options.slidesPerView}getVisibleSlideIndexes(){return this.slides.slice(this._activeIndex,this._activeIndex+this.options.slidesPerView).map((e=>+e.dataset.index))}getPhysicalIndexByRealIndex(e){const t=this.normalizeIndex(e);return this.slides.findIndex((e=>e.dataset.index===t.toString()))}getMinTranslate(){return 0}getMaxTranslate(){return this.getSlideOffset(this.totalPages-1)}setTranslate(e){this.track.style.transform=`translate3d(${e}px, 0px, 0px)`,this._currentTranslateX=e,this.testAttraction()}enableHorizontalSwipeGesture(){this.touchModule.enableHorizontalSwipeGesture()}disableHorizontalSwipeGesture(){this.touchModule.disableHorizontalSwipeGesture()}getSlideOffset(e){return this.slides.length?-e*(this.slides[0].clientWidth+this.options.spaceBetween):0}updateSize(){const e=this.slideWidth;this.calculateSlideWidths(),e!==this.slideWidth&&this.emit(me.SlidesUpdated),this.slideTo(this._activeIndex,0)}getTrackWidth(){return this.track.clientWidth-this.options.spaceBetween*(this.options.slidesPerView-1)}toNextSlideByLoop(){this.isAnimating||(this.loopModule.applyLoopFix({targetIndex:this._activeIndex,direction:"next"}),requestAnimationFrame((()=>this.slideTo(this._activeIndex+1))))}toPrevSlideByLoop(){this.isAnimating||(this.loopModule.applyLoopFix({targetIndex:this._activeIndex,direction:"prev"}),requestAnimationFrame((()=>this.slideTo(this._activeIndex-1))))}updateIndexes(e){if(!this.slides.length)return;const t=+this.slides[e].dataset.index,n=this._realIndex,r=this._activeIndex;this._realIndex=t,this._activeIndex=e,n!==t&&this.emit(me.RealIndexChnage,t),r!==e&&this.emit(me.ActiveIndexChange,e)}setupTrackStyles(){Object.assign(this.track.style,{display:"flex",transition:`transform ${this.options.speed}ms ease`,gap:`${this.options.spaceBetween}px`}),this.container.style.overflow="hidden"}collectSlides(){this.slides.forEach(((e,t)=>{e.dataset.index=t.toString()}))}calculateSlideWidths(){this._slideWidth=Math.ceil(this.getTrackWidth()/this.options.slidesPerView),this.slides.forEach((e=>{e.style.width=`${this._slideWidth}px`}))}translateSlidesTrack(e,t){this.track.style.transitionDuration=`${t}ms`,this.setTranslate(this.getSlideOffset(e))}async performTranslateToSlide(e,t){if(0===t)this.translateSlidesTrack(e,0);else{if(this._activeIndex===e&&!this.touchModule.isMoved)return;this.translateSlidesTrack(e,t),this.emit(me.TransitionStart),await this.waitTransitionEnd(),this.emit(me.TransitionEnd)}}waitTransitionEnd(){return new Promise((e=>{this.track.addEventListener("transitionend",(t=>{"transform"===t.propertyName&&(this.track.style.transitionDuration="0ms",e())}),{once:!0})}))}testAttraction(){const e=this.getMinTranslate(),t=this.getMaxTranslate(),n=!this.loopModule.enabled&&this._currentTranslateX>=e,r=!this.loopModule.enabled&&this._currentTranslateX<=t;n!==this._reachStart&&(this._reachStart=n,this.emit(me.ReachStart,n)),r!==this._reachEnd&&(this._reachEnd=r,this.emit(me.ReachEnd,r))}normalizeOptions(e){var t,n,r,i,a,s,o,l;return{autoplay:null!==(t=e.autoplay)&&void 0!==t?t:this.options.autoplay,speed:null!==(n=e.speed)&&void 0!==n?n:this.options.speed,delay:null!==(r=e.delay)&&void 0!==r?r:this.options.delay,loop:null!==(i=e.loop)&&void 0!==i?i:this.options.loop,slidesPerView:Math.max(Math.min(this.track.children.length,null!==(a=e.slidesPerView)&&void 0!==a?a:this.options.slidesPerView),0),spaceBetween:null!==(s=e.spaceBetween)&&void 0!==s?s:this.options.spaceBetween,initialSlide:null!==(o=e.initialSlide)&&void 0!==o?o:this.options.initialSlide,updateOnWindowResize:null!==(l=e.updateOnWindowResize)&&void 0!==l?l:this.options.updateOnWindowResize}}normalizeIndex(e){const t=this.slides.length;return(e%t+t)%t}clamp(e,t,n){return Math.max(t,Math.min(e,n))}}const Pe=(0,u.observer)((e=>{const[t,n]=(0,c.useState)(null),r=(0,c.useRef)(null);return(0,c.useEffect)((()=>{if(!r.current||!e.slidesCount)return;const t=new Se(r.current,{autoplay:e.autoplay,speed:e.speed,loop:e.loop,slidesPerView:e.slidesPerView,spaceBetween:e.spaceBetween});return e.onInit(t),n(t),()=>{null==t||t.destroy()}}),[e.slidesCount]),(0,c.useEffect)((()=>{t&&t.update({autoplay:e.autoplay,speed:e.speed,loop:e.loop,slidesPerView:e.slidesPerView,spaceBetween:e.spaceBetween})}),[t,e.autoplay,e.speed,e.loop,e.slidesPerView,e.spaceBetween,e.slidesCount]),(0,l.jsxs)("div",{className:he.slider,style:{"--slider-border-radius":`${e.borderRadius}px`},children:[(0,l.jsx)("div",{ref:r,className:he.slider__track,children:e.children}),t&&e.pagination.enabled&&(0,l.jsx)(ce,{totalPages:t.totalPages,activeIndex:t.realIndex,onClick:n=>{e.loop?t.slideToLoop(n):t.slideTo(n)}}),t&&e.navigation.enabled&&(0,l.jsx)(be,{onPrevClick:()=>{t.toPrevSlide()},onNextClick:()=>{t.toNextSlide()},nextDisabled:t.reachEnd,prevDisabled:t.reachStart})]})})),_e=e=>(0,l.jsx)("div",{className:(0,S.default)(he.slider__slide,e.className),style:e.style,children:e.children}),Ee=(0,u.observer)((e=>{const t=ie(e),n=(0,c.useRef)(null),r=t[0];return(0,l.jsx)("div",{className:I["banner-place"],ref:n,children:r?(0,l.jsx)(O,{index:0,isActive:!0,canBeInited:!0,banner:r,allowClick:!0,clientAppearance:e.bannerPlace.appearance.banner}):(0,l.jsx)(_,{needShowErrorScreen:!1,needShowLoaderScreen:!0,onReload:()=>{}})})})),xe=(0,u.observer)((e=>{const t=(0,c.useRef)(null),n=ie(e);var r;r=e,(0,c.useEffect)((()=>{r.appearance&&r.bannerPlace.updateAppearance(r.appearance)}),[r.bannerPlace,JSON.stringify(r.appearance)]);const{realIndex:i,allowClick:a,slider:s,isAnimating:o,setSlider:d,isMoved:h}=(e=>{const t=(0,c.useRef)(null),[n,r]=(0,c.useState)(!1),[i,a]=(0,c.useState)(!1),[s,o]=(0,c.useState)(!1),[l,d]=(0,c.useState)(!0),[h,u]=(0,c.useState)(null),[p,b]=(0,c.useState)(0),[f,m]=(0,c.useState)(0),[v,y]=(0,c.useState)(!0),[g,w]=(0,c.useState)(!0),S=()=>{clearTimeout(t.current),d(!1),o(!0),((e,t)=>{e.getVisibleSlideIndexes().map((e=>t.banners[e])).forEach((e=>e.pause()))})(h,e)},P=()=>{t.current=setTimeout((()=>d(!0)),100),o(!1),((e,t)=>{t.banners.forEach((e=>e.resume()))})(0,e)},_=()=>{a(!0),d(!1)},E=()=>{a(!1),d(!0)},x=t=>{m(t),e.emit(Z.ActiveIndexChange,t)},T=e=>{b(e)},O=()=>{h&&y(h.reachStart)},j=()=>{h&&w(h.reachEnd)},I=()=>{},L=()=>{e.refreshSizes(),requestAnimationFrame((()=>{e.refreshSizes(),r((e=>!e))}))},C=()=>{e.emit(Z.AutoplayTimeLeft),e.notifyTimerEnd()};return(0,c.useEffect)((()=>{if(!h)return;const t=new se(h);e.setSliderController(t)}),[e,h]),(0,c.useEffect)((()=>{h&&e&&e.banners[h.realIndex].markAsOpened()}),[e,h]),(0,c.useEffect)((()=>{if(h)return h.on(me.TouchStart,S),h.on(me.TouchEnd,P),h.on(me.TransitionStart,_),h.on(me.TransitionEnd,E),h.on(me.RealIndexChnage,x),h.on(me.ActiveIndexChange,T),h.on(me.ReachStart,O),h.on(me.ReachEnd,j),h.on(me.Resize,I),h.on(me.SlidesUpdated,L),h.on(me.AutoplayTimeLeft,C),O(),j(),()=>{h.off(me.TouchStart,S),h.off(me.TouchEnd,P),h.off(me.TransitionStart,_),h.off(me.TransitionEnd,E),h.off(me.RealIndexChnage,x),h.off(me.ActiveIndexChange,T),h.off(me.ReachStart,O),h.off(me.ReachEnd,j),h.off(me.Resize,I),h.off(me.SlidesUpdated,L),h.off(me.AutoplayTimeLeft,C)}}),[e,h]),{reachStart:v,reachEnd:g,activeIndex:p,realIndex:f,isMoved:s,isAnimating:i,slider:h,setSlider:u,allowClick:l}})(e.bannerPlace);(({bannerPlace:e,bannerPlaceRef:t,slider:n})=>{const[r,i]=(0,c.useState)(!1);(0,c.useEffect)((()=>((async(e=5e3)=>new Promise(((n,r)=>{const i=setTimeout((()=>{r(new Error("[IAS]: Timeout while waiting for BannerPlace clientWidth"))}),e),a=()=>{if(t.current&&t.current.clientWidth>0)return clearTimeout(i),void n();requestAnimationFrame(a)};requestAnimationFrame(a)})))().then((()=>{i(!0)})).catch(console.error),()=>{i(!1)})),[e.isLoaded]),(0,c.useEffect)((()=>{n&&r&&(n.updateSize(),e.refreshSizes(),requestAnimationFrame((()=>{e.refreshSizes()})))}),[n,e,r])})({bannerPlace:e.bannerPlace,slider:s,bannerPlaceRef:t});const u=e.bannerPlace.appearance;return(0,l.jsx)("div",{className:(0,S.default)(I["banner-place"],e.className),style:e.style,ref:t,children:(0,l.jsx)(Pe,{onInit:d,autoplay:u.autoplay,speed:u.animationSpeed,loop:u.loop,slidesPerView:u.slidesPerView,spaceBetween:u.gap,slidesCount:n.length,navigation:u.navigation,pagination:u.pagination,children:n.map(((e,t)=>{const n=Boolean(null==s?void 0:s.isSlideVisible(t));return(0,l.jsx)(_e,{children:(0,l.jsx)(O,{index:t,isActive:n,canBeInited:n,banner:e,className:I["banner-slider__slide"],allowClick:a,clientAppearance:u.banner})},e.id)}))})})})),Te=(e=>{var t={};return d.d(t,e),t})({createRoot:()=>s.createRoot});class Oe{constructor(e,t,n){Object.defineProperty(this,"mountPoint",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerPlace",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"root",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rootElement",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.rootElement=document.createElement("div"),this.rootElement.style.width="100%",this.rootElement.style.height="100%",e.appendChild(this.rootElement),this.root=(0,Te.createRoot)(this.rootElement)}get isLoaded(){return this.bannerPlace.isLoaded}get id(){return this.bannerPlace.id}get banners(){return this.bannerPlace.banners}get appearance(){return this.bannerPlace.appearance}get contentRatio(){return this.bannerPlace.contentRatio}get isLoading(){return this.bannerPlace.isLoading}get slider(){return this.bannerPlace.slider}get paginationBullets(){return this.bannerPlace.slider.getTotalPages()}refreshSizes(){}emit(e,...t){}setSliderController(e){this.bannerPlace.setSliderController(e)}updateAppearance(e){this.bannerPlace.updateAppearance(e)}resume(){this.bannerPlace.resume()}pause(){this.bannerPlace.pause()}reload(){return this.bannerPlace.reload()}destroy(){setTimeout((()=>{this.root.unmount()})),this.mountPoint.removeChild(this.rootElement),this.bannerPlace.destroy()}fetchBanners(){return this.bannerPlace.fetchBanners()}updateUserData(e){return Promise.resolve()}notifyTimerEnd(){this.bannerPlace.notifyTimerEnd()}showNext(){this.bannerPlace.showNext()}showPrevious(){this.bannerPlace.showPrevious()}showByIndex(e,t){this.bannerPlace.showByIndex(e,t)}on(e,t){return this.bannerPlace.on(e,t),this}once(e,t){return this.bannerPlace.once(e,t),this}off(e,t){return this.bannerPlace.off(e,t),this}render(){var e;this.root.render((0,l.jsx)(xe,{appearance:null===(e=this.params)||void 0===e?void 0:e.appearance,bannerPlace:this.bannerPlace}))}}const je=e=>{const[t,n]=(0,c.useState)(null);return(0,c.useEffect)((()=>{var t;const r=Qt().createBannerPlace(e.placeId);return n(r),null===(t=e.onReady)||void 0===t||t.call(e,r),()=>{r.destroy()}}),[e.placeId]),t?(0,l.jsx)(xe,Object.assign({bannerPlace:t},e)):null},Ie=e=>{const[t,n]=(0,c.useState)(null);return(0,c.useEffect)((()=>{var t;const r=Qt().createBannerPreviewPlace(e.bannerId);return n(r),null===(t=e.onReady)||void 0===t||t.call(e,r),()=>{r.destroy()}}),[e.bannerId]),t?(0,l.jsx)(Ee,Object.assign({bannerPlace:t},e)):null};var Le=function(e,t,n,r,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?r.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),u=!1,p=n.length-1;p>=0;p--){var b={};for(var f in r)b[f]="access"===f?{}:r[f];for(var f in r.access)b.access[f]=r.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,n[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,r.name,h),u=!0},Ce=function(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0},Be=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)},ke=function(e,t,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(e,n):i?i.value=n:t.set(e,n),n};let Ae=(()=>{var e,t,n,r;let i,a,s,o=Y.EventEmitter,l=[],c=[],d=[],h=[],u=[],p=[];return e=class extends o{get _banners(){return Be(this,t,"f")}set _banners(e){ke(this,t,e,"f")}get _isLoading(){return Be(this,n,"f")}set _isLoading(e){ke(this,n,e,"f")}get _isLoaded(){return Be(this,r,"f")}set _isLoaded(e){ke(this,r,e,"f")}constructor(e,i,a,s){super(),Object.defineProperty(this,"bannerId",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"bannerStore",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"bannerViewModelFactory",{enumerable:!0,configurable:!0,writable:!0,value:s}),t.set(this,Ce(this,l,[])),n.set(this,(Ce(this,c),Ce(this,d,!1))),r.set(this,(Ce(this,h),Ce(this,u,!1))),Object.defineProperty(this,"appearance",{enumerable:!0,configurable:!0,writable:!0,value:(Ce(this,p),new H)}),this.ctx.addBannerPlace(this)}get id(){return"__BANNER_PREVIEW__"}get slider(){return new J}get banners(){return this._banners}get isLoading(){return this._isLoading}get isLoaded(){return this._isLoaded}get contentRatio(){var e,t;return null!==(t=null===(e=this._banners[0])||void 0===e?void 0:e.contentRatio)&&void 0!==t?t:1}get paginationBullets(){return 1}refreshSizes(){this._banners.forEach((e=>e.refreshSizes()))}setSliderController(e){}updateAppearance(e){this.appearance.update(e)}resume(){for(const e of this._banners)e.resume()}pause(){for(const e of this._banners)e.pause()}async reload(){this.bannerStore.removeBannerPlaceById(this.id),await Promise.all(this._banners.map((e=>e.destroy()))),this._banners=[],await this.fetchBanners()}destroy(){for(const e of this._banners)e.destroy();this._banners=[],this.ctx.removeBannerPlace(this)}async updateUserData(e){return this.bannerStore.updateBannerUserData(this.id,e)}notifyTimerEnd(){}showNext(){}showPrevious(){}showByIndex(e,t){}async fetchBanners(){try{if(this._isLoading)return[];this._isLoading=!0,this._isLoaded=!1,this.emit(Z.LoadStart);const e=await this.bannerStore.getBannerById(this.bannerId);return this._banners=[this.bannerViewModelFactory.create(this,e)],this._isLoaded=!0,this._banners}catch(e){throw this.emit(Z.LoadError,e),e}finally{this.emit(Z.LoadEnd),this._isLoading=!1}}},t=new WeakMap,n=new WeakMap,r=new WeakMap,(()=>{var t;const n="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=o[Symbol.metadata])&&void 0!==t?t:null):void 0;i=[L.observable],a=[L.observable],s=[L.observable],Le(e,null,i,{kind:"accessor",name:"_banners",static:!1,private:!1,access:{has:e=>"_banners"in e,get:e=>e._banners,set:(e,t)=>{e._banners=t}},metadata:n},l,c),Le(e,null,a,{kind:"accessor",name:"_isLoading",static:!1,private:!1,access:{has:e=>"_isLoading"in e,get:e=>e._isLoading,set:(e,t)=>{e._isLoading=t}},metadata:n},d,h),Le(e,null,s,{kind:"accessor",name:"_isLoaded",static:!1,private:!1,access:{has:e=>"_isLoaded"in e,get:e=>e._isLoaded,set:(e,t)=>{e._isLoaded=t}},metadata:n},u,p),n&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n})})(),e})();class Me{constructor(e){Object.defineProperty(this,"bannerStatisticApi",{enumerable:!0,configurable:!0,writable:!0,value:e})}async sendViewEvent(e,t){const n=new X(t);await this.bannerStatisticApi.sendViewEvent(e,n)}async sendWidgetEvent(e,t){const n=new Q(t);await this.bannerStatisticApi.sendWidgetEvent(e,n)}}class Re{constructor(){Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:{}})}set(e,t){this.cache[e]=t}clear(){this.cache={}}get(e){return this.cache[e]}}class De{constructor(e,t,n){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerPlaceViewModel",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:n})}async handle(e){try{const t=this.storyManager.gameReader;await t.openGame(e.gameInstanceId),this.bannerPlaceViewModel.pause(),t.once("close",(()=>{this.bannerPlaceViewModel.resume()}))}catch(e){console.error(e)}}}var Ne,We,ze,Fe,Ue,Ve,qe,$e,He,Ge,Xe,Qe,Ye,Je,Ze,Ke,et;!function(e){e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end"}(Ne||(Ne={})),Ne.END,function(e){e.DEFAULT="default",e.CUSTOM_CARD="customCard"}(We||(We={})),We.DEFAULT,We.DEFAULT,function(e){e.CENTER="center",e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end"}(ze||(ze={})),function(e){e.CIRCLE="circle",e.QUAD="quad",e.RECTANGLE="rectangle"}(Fe||(Fe={})),function(e){e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end",e.CENTER="center"}(Ue||(Ue={})),function(e){e.CARD_INSIDE_BOTTOM="cardInsideBottom",e.CARD_OUTSIDE_TOP="cardOutsideTop",e.CARD_OUTSIDE_BOTTOM="cardOutsideBottom"}(Ve||(Ve={})),function(e){e.Medium="medium",e.High="high"}(qe||(qe={})),function(e){e.COLUMN="vertical",e.ROW="horizontal"}($e||($e={})),function(e){e.START_LOADER="startLoad",e.END_LOADER="endLoad"}(He||(He={})),$e.ROW,Ue.START,Ve.CARD_INSIDE_BOTTOM,qe.High,Fe.RECTANGLE,Ue.START,Ve.CARD_INSIDE_BOTTOM,qe.High,Fe.CIRCLE,ze.START,Ue.START,Ve.CARD_INSIDE_BOTTOM,qe.High,Fe.CIRCLE,function(e){e.STORY_LIST="storyList",e.STORY_READER="storyReader",e.GAME_READER="gameReader",e.STACK_STORY_LIST="stackStoryList",e.IAM_READER="iamReader",e.BANNERS="banners"}(Ge||(Ge={})),function(e){e.FLAT="flat",e.COVER="cover",e.CUBE="cube"}(Xe||(Xe={})),function(e){e.Classic="classic",e.Modern="modern"}(Qe||(Qe={})),Xe.FLAT,Qe.Classic,function(e){e.STYLE_CIRCLE="circle",e.STYLE_QUAD="quad",e.STYLE_RECTANGLE="rectangle",e.SWIPE_CUBE="cube",e.SWIPE_FLAT="flat",e.SWIPE_COVER="cover",e.CLOSE_BUTTON_LEFT="left",e.CLOSE_BUTTON_RIGHT="right"}(Ye||(Ye={})),function(e){e.direct="direct",e.onboarding="onboarding",e.list="list",e.favorite="favorite"}(Je||(Je={})),function(e){e[e.default=0]="default",e[e.favorite=1]="favorite",e[e.stacked=2]="stacked"}(Ze||(Ze={})),function(e){e.LTR="ltr",e.RTL="rtl"}(Ke||(Ke={})),function(e){e.StoryList="storyList",e.StoryReader="storyReader",e.GameReader="gameReader",e.StackStoryList="stackStoryList",e.IamReader="iamReader",e.Banners="banners"}(et||(et={}));class tt{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:t})}handle(e){try{const t=decodeURIComponent(e.linkTarget),n={src:et.Banners,data:{id:this.banner.id,index:this.banner.activeSlideIndex,url:t,elementId:e.elementId}};this.storyManager.storyLinkClickHandler(n),this.storyManager.emit("clickOnButton",n)}catch(t){t instanceof URIError?console.error(`[Banners]: the URL <${e.linkTarget}> has an invalid format`):console.error(t)}}}class nt{constructor(e,t,n){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerPlace",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:n})}async handle(e){try{const t={src:et.Banners,data:{id:this.banner.id,index:this.banner.activeSlideIndex,url:e.storyId.toString()}};this.storyManager.storyLinkClickHandler(t),this.storyManager.emit("clickOnButton",t),this.bannerPlace.pause(),await this.storyManager.storyReader.showStory(e.storyId),this.storyManager.storyReader.once("closeStoryReader",(()=>{this.bannerPlace.resume()}))}catch(e){console.error(e)}}}let rt;const it=e=>{!function(e){rt=document.createElement("textarea"),rt.value=e,document.body.appendChild(rt)}(e),function(){let e,t;/ipad|iphone/i.test(navigator.userAgent)?(e=document.createRange(),rt&&e.selectNodeContents(rt),t=window.getSelection(),t&&(t.removeAllRanges(),t.addRange(e)),rt&&rt.setSelectionRange(0,999999)):null==rt||rt.select()}(),document.execCommand("copy"),rt&&document.body.removeChild(rt)};let at;at=function(){};class st{constructor(e){Object.defineProperty(this,"bannerPlace",{enumerable:!0,configurable:!0,writable:!0,value:e})}manageTimer(e,t){if(!this.bannerPlace.slider)return;const n=this.bannerPlace.slider.autoplay;switch(e){case"start":this.startTimer(n,t);break;case"pause":n.pause();break;case"stop":case"before_start":n.stop()}}startTimer(e,t){e.isPaused()?e.resume():(e.setDelay(t),e.start())}}class ot{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}}Object.defineProperty(ot,"name",{enumerable:!0,configurable:!0,writable:!0,value:"bannerWidget"});class lt{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}}Object.defineProperty(lt,"name",{enumerable:!0,configurable:!0,writable:!0,value:"showBanner"});class ct{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}}Object.defineProperty(ct,"name",{enumerable:!0,configurable:!0,writable:!0,value:"showBannerFailed"});class dt{constructor(e,t,n,r){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerPlace",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"bannerStatisticService",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"sessionNarrativeDataCache",{enumerable:!0,configurable:!0,writable:!0,value:new Re}),Object.defineProperty(this,"narrativeDataCache",{enumerable:!0,configurable:!0,writable:!0,value:new Re})}updateCardServerDataLocally(e){this.banner.context.updateNarrativeSavedData(e)}updateTimeline(e,t,n,r,i,a){[...arguments].join(", "),this.banner.id,"before_start"!==t&&(i?this.banner.showLoaderScreen():this.banner.activeSlide.inited&&this.banner.hideLoaderScreen(),a?this.banner.showErrorScreen():this.banner.hideErrorScreen()),new st(this.bannerPlace).manageTimer(t,r)}clearNarrativeSessionDataCache(){this.sessionNarrativeDataCache.clear()}disableVerticalSwipeGesture(){}enableVerticalSwipeGesture(){}disableHorizontalSwipeGesture(){this.bannerPlace.slider.disableHorizontalSwipeGesture()}enableHorizontalSwipeGesture(){this.bannerPlace.slider.enableHorizontalSwipeGesture()}async getCardLocalData(){const e=this.narrativeDataCache.get(`banner_${this.banner.id}_data_${this.storyManager.rootStore.sessionStore.userId}`);return e?JSON.parse(e):{}}setCardLocalData(e,t){const n=JSON.stringify(e);this.narrativeDataCache.set(`banner_${this.banner.id}_data_${this.storyManager.rootStore.sessionStore.userId}`,n),this.banner.context.updateNarrativeSavedData(n),t&&this.banner.updateUserData(n).catch(console.error)}getCardServerData(e){var t;return null!==(t=this.banner.context.widgetsData._narrative_saved_data)&&void 0!==t?t:null}getSlideDuration(e,t){var n,r;return null!==(r=null===(n=this.banner.context.widgetsData._narrative_slides_duration)||void 0===n?void 0:n[t])&&void 0!==r?r:null}pauseUI(){this.banner.pause()}resumeUI(){this.banner.resume()}showCardTextInput(e,t){}setCardSessionValue(e,t){this.sessionNarrativeDataCache.set(e,t)}getCardSessionValue(e){return this.sessionNarrativeDataCache.get(e)}getWidgetsSharedData(e,t){const n=this.banner.context.widgetsData;switch(t){case"rangeSlider":return n._narrative_range_slider_data;case"poll":return n._narrative_poll_data;case"vote":return n._narrative_vote_data}return null}async sendApiRequest(e,t,n,r,i,a){var s,o,l;try{const a=await this.storyManager.httpClient.request({url:e,method:t,params:null!=n?n:{},headers:null!=r?r:{},data:null!=i?i:{}});return{status:a.status,headers:a.headers,data:a.data}}catch(e){if(e instanceof Error&&"IasNetworkError"===e.name)return{status:null!==(s=e.networkStatus)&&void 0!==s?s:400,headers:null===(o=e.response)||void 0===o?void 0:o.headers,data:null===(l=e.response)||void 0===l?void 0:l.data}}}share(e,t){}shareSlideScreenshot(e,t,n){}showLayer(e){this.banner.showLayerByIndex(e)}showCardSlide(e){this.bannerPlace.slider.slideTo(e)}cardShowNext(){this.bannerPlace.slider.toNextSlide()}showNextSlide(){this.bannerPlace.slider.toNextSlide()}sendStatisticEvent(e,t,n,r){this.bannerStatisticService.sendWidgetEvent(this.banner.id,{iterationId:this.banner.iterationId,type:e,slideIndex:this.banner.activeSlideIndex,slideTotal:this.banner.slides.length,durationMs:this.banner.durationMs,widgetPayload:t}),this.bannerPlace.emit(ot.name,new ot({id:this.banner.id,bannerPlace:this.bannerPlace.id,widgetEventName:e,widgetData:null!=n?n:{}}).payload)}async resetCard(e){this.updateCardServerDataLocally({}),this.setCardLocalData({},!0),this.showCardSlide(0),this.showLayer(0)}getCardFonts(){var e,t;return null!==(t=null===(e=this.storyManager.rootStore.sessionStore.session)||void 0===e?void 0:e.fontsResources)&&void 0!==t?t:[]}showToast(e){this.banner.showToast({content:e})}closeCard(e){}openStory(e,t){new nt(this.storyManager,this.bannerPlace,this.banner).handle({storyId:e,slideIndex:t})}openGame(e){new De(this.storyManager,this.bannerPlace,this.banner).handle({gameInstanceId:e})}writeToClipboard(e){it(e.textValue)}openUrl(e){"swipeUpItems"!==e.type&&new tt(this.storyManager,this.banner).handle({elementId:e.elementId,linkTarget:e.link.target})}}var ht;!function(e){e.Top="top",e.Bottom="bottom"}(ht||(ht={}));const ut=ht.Bottom;class pt{constructor(e){Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"timeoutId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"duration",{enumerable:!0,configurable:!0,writable:!0,value:3e3}),Object.defineProperty(this,"content",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"position",{enumerable:!0,configurable:!0,writable:!0,value:ut}),Object.defineProperty(this,"mountPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"toastContainer",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.initializeOptions(e),this.mountPoint=e.mountPoint}show(e){return this.content=e,this.destroy(),this.createAndShowToast(),!0}hide(){return!!this.toastContainer&&(clearTimeout(this.timeoutId),this.toastContainer.className+=" toast_fadeout",this.addAnimationEndListeners(this.toastContainer,(()=>{var e,t;null===(t=null===(e=this.toastContainer)||void 0===e?void 0:e.parentNode)||void 0===t||t.removeChild(this.toastContainer),this.toastContainer=null})),!0)}destroy(){var e;this.toastContainer&&(clearTimeout(this.timeoutId),null===(e=this.toastContainer.parentNode)||void 0===e||e.removeChild(this.toastContainer),this.toastContainer=null)}initializeOptions(e){if(e.duration&&(this.duration="string"==typeof e.duration?parseFloat(e.duration):e.duration),e.position){const t=e.position.toLowerCase();this.position="top"===t||"bottom"===t?t:ut}}createAndShowToast(){const e=this.createToastContainer(),t=this.createToastElement(),n=this.createToastTextElement();t.appendChild(n),e.appendChild(t),this.mountPoint.appendChild(e),this.timeoutId=window.setTimeout((()=>this.hide()),this.duration),this.toastContainer=e}createToastContainer(){const e=document.createElement("div");return e.id="toast_container",e.className="toast_fadein",e.style.zIndex="1130",e}createToastElement(){const e=document.createElement("div");return e.id="toast",e}createToastTextElement(){const e=document.createElement("span");return e.innerHTML=this.content,e}addAnimationEndListeners(e,t){["animationend","webkitAnimationEnd","msAnimationEnd","oAnimationEnd"].forEach((n=>{e.addEventListener(n,t,{once:!0})}))}}const bt=(e=>{var t={};return d.d(t,e),t})({SlideApi:()=>o.SlideApi}),ft=(new Error("timeout while waiting for mutex to become available"),new Error("mutex already locked"),new Error("request for lock canceled"));class mt{constructor(e,t=ft){this._value=e,this._cancelError=t,this._queue=[],this._weightedWaiters=[]}acquire(e=1,t=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise(((n,r)=>{const i={resolve:n,reject:r,weight:e,priority:t},a=vt(this._queue,(e=>t<=e.priority));-1===a&&e<=this._value?this._dispatchItem(i):this._queue.splice(a+1,0,i)}))}runExclusive(e){return function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function s(e){try{l(r.next(e))}catch(e){a(e)}}function o(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,o)}l((r=r.apply(e,t||[])).next())}))}(this,arguments,void 0,(function*(e,t=1,n=0){const[r,i]=yield this.acquire(t,n);try{return yield e(r)}finally{i()}}))}waitForUnlock(e=1,t=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return this._couldLockImmediately(e,t)?Promise.resolve():new Promise((n=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),function(e,t){const n=vt(e,(e=>t.priority<=e.priority));e.splice(n+1,0,t)}(this._weightedWaiters[e-1],{resolve:n,priority:t})}))}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatchQueue()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatchQueue()}cancel(){this._queue.forEach((e=>e.reject(this._cancelError))),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(e){const t=this._value;this._value-=e.weight,e.resolve([t,this._newReleaser(e.weight)])}_newReleaser(e){let t=!1;return()=>{t||(t=!0,this.release(e))}}_drainUnlockWaiters(){if(0===this._queue.length)for(let e=this._value;e>0;e--){const t=this._weightedWaiters[e-1];t&&(t.forEach((e=>e.resolve())),this._weightedWaiters[e-1]=[])}else{const e=this._queue[0].priority;for(let t=this._value;t>0;t--){const n=this._weightedWaiters[t-1];if(!n)continue;const r=n.findIndex((t=>t.priority<=e));(-1===r?n:n.splice(0,r)).forEach((e=>e.resolve()))}}}_couldLockImmediately(e,t){return(0===this._queue.length||this._queue[0].priority<t)&&e<=this._value}}function vt(e,t){for(let n=e.length-1;n>=0;n--)if(t(e[n]))return n;return-1}class yt{constructor(e){this._semaphore=new mt(1,e)}acquire(){return function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function s(e){try{l(r.next(e))}catch(e){a(e)}}function o(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,o)}l((r=r.apply(e,t||[])).next())}))}(this,arguments,void 0,(function*(e=0){const[,t]=yield this._semaphore.acquire(1,e);return t}))}runExclusive(e,t=0){return this._semaphore.runExclusive((()=>e()),1,t)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(e=0){return this._semaphore.waitForUnlock(1,e)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}}class gt{constructor(e,t,n){Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerSlide",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"mutex",{enumerable:!0,configurable:!0,writable:!0,value:new yt}),Object.defineProperty(this,"_inited",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get html(){return this.bannerSlide.html}get state(){return this.slideApi.state}get inited(){return this._inited}get payload(){return this.bannerSlide.payload}notifyTimerEnd(){this.slideApi.slideTimerEnd()}async init(){const e=await this.mutex.acquire();if(this._inited)return;let t=this.banner.needShowLoaderScreen,n=Date.now();const r=setTimeout((()=>{this.banner.showLoaderScreen(),t=!0,n=Date.now()}),500);try{this.banner.id,await this.slideApi.showSlide(this.html),this._inited=!0}catch(e){throw this.handleSlideError(e),e}finally{clearTimeout(r),await this.cleanupLoaderIfNeeded(Date.now()-n,t),e()}}async start(){const e=await this.mutex.acquire();try{this.banner.id,await this.slideApi.slideStart({muted:!0})}catch(e){throw this.handleSlideError(e),e}finally{e()}}async restart(){const e=await this.mutex.acquire();try{this.banner.hideErrorScreen(),this.banner.showLoaderScreen(),await this.slideApi.slideRestart({muted:!0})}catch(e){throw this.handleSlideError(e),e}finally{this.banner.hideLoaderScreen(),e()}}async resume(){const e=await this.mutex.acquire();try{this.banner.id,await this.slideApi.slideAppResume()}catch(e){this.handleSlideError(e)}finally{e()}}async pause(){const e=await this.mutex.acquire();try{this.banner.id,await this.slideApi.slideAppPause()}catch(e){this.handleSlideError(e)}finally{e()}}async pauseByUser(){const e=await this.mutex.acquire();try{this.banner.id,await this.slideApi.slideUserPause()}catch(e){this.handleSlideError(e)}finally{e()}}async resumeByUser(){const e=await this.mutex.acquire();try{this.banner.id,await this.slideApi.slideUserResume()}catch(e){this.handleSlideError(e)}finally{e()}}async stop(e){const t=await this.mutex.acquire();try{this.banner.id,await this.slideApi.slideStop(e)}catch(e){this.handleSlideError(e)}finally{t()}}refreshSizes(){this.slideApi.refreshSizes()}onClick({event:e,currentTarget:t}){if(e.target)try{e.preventDefault(),e.stopPropagation();const n=this.getNavigationDirection(e,t);this.slideApi.slideClickHandler(e.target,n>0?"forward":"backward")}catch(e){console.error(e)}}async destroy(){await this.stop({prepareForRestart:2})}showLayerByIndex(e){this.slideApi.showLayer(e)}handleSlideError(e){console.error(e),this.banner.showErrorScreen()}getNavigationDirection(e,t){const n=this.getClickPosition(e,t),r="ltr"===this.slideApi.layoutDirection?1:-1;return n>=.3?r:-r}getClickPosition(e,t){const n=t.getBoundingClientRect(),r=n.width;if(r<=0)return 0;let i;if(e instanceof MouseEvent)i=e.pageX-n.left;else{if(!(e.touches&&e.touches.length>0))return 0;i=e.touches[0].pageX-n.left}return Math.max(0,Math.min(1,i/r))}delay(e){return new Promise((t=>setTimeout(t,e)))}async cleanupLoaderIfNeeded(e,t){t&&await this.delay(Math.max(500-e,0)),this.banner.hideLoaderScreen()}}class wt{get html(){return""}get state(){return 0}async init(){}async start(){}async restart(){}async resume(){}async pause(){}async resumeByUser(){}async pauseByUser(){}async stop(e){}onClick({event:e,currentTarget:t}){}async destroy(){}showLayerByIndex(e){}refreshSizes(){}notifyTimerEnd(){}}var St=function(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0},Pt=function(e,t,n,r,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?r.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),u=!1,p=n.length-1;p>=0;p--){var b={};for(var f in r)b[f]="access"===f?{}:r[f];for(var f in r.access)b.access[f]=r.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,n[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,r.name,h),u=!0},_t=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)},Et=function(e,t,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(e,n):i?i.value=n:t.set(e,n),n};let xt=(()=>{var e,t,n,r,i,a;let s,o,l,c,d,h,u,p,b,f,m,v,y=[],g=[],w=[],S=[],P=[],_=[],x=[],T=[],O=[],j=[],I=[];return e=class{get _$root(){return _t(this,t,"f")}set _$root(e){Et(this,t,e,"f")}get _needShowErrorScreen(){return _t(this,n,"f")}set _needShowErrorScreen(e){Et(this,n,e,"f")}get _needShowLoaderScreen(){return _t(this,r,"f")}set _needShowLoaderScreen(e){Et(this,r,e,"f")}get _width(){return _t(this,i,"f")}set _width(e){Et(this,i,e,"f")}get _slides(){return _t(this,a,"f")}set _slides(e){Et(this,a,e,"f")}constructor(e,s,o,l,c){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(St(this,y),e)}),Object.defineProperty(this,"bannerPlace",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"bannerStatisticService",{enumerable:!0,configurable:!0,writable:!0,value:l}),Object.defineProperty(this,"bannerStore",{enumerable:!0,configurable:!0,writable:!0,value:c}),t.set(this,St(this,g,null)),n.set(this,(St(this,w),St(this,S,!1))),r.set(this,(St(this,P),St(this,_,!1))),i.set(this,(St(this,x),St(this,T,0))),a.set(this,(St(this,O),St(this,j,[]))),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:(St(this,I),null)}),Object.defineProperty(this,"slideApiImpl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"locked",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"toast",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_iterationId",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_startTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_initPromise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_initPromiseResolver",{enumerable:!0,configurable:!0,writable:!0,value:()=>{}}),Object.defineProperty(this,"attachRoot",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{this._$root||(this._$root=e,this.slideApi=this.createSlideApi(e),this._slides=[new gt(this,this.banner.slides[0],this.slideApi)],await this.init())}}),Object.defineProperty(this,"handleVisibilityChange",{enumerable:!0,configurable:!0,writable:!0,value:()=>{this.locked||("hidden"===document.visibilityState&&this.pause(),"visible"===document.visibilityState&&this.resume())}}),this.slideApiImpl=new dt(this.storyManager,this.bannerPlace,this,this.bannerStatisticService),this._initPromise=new Promise((e=>{this._initPromiseResolver=e}))}get id(){return this.banner.id}get context(){return this.banner.context}get appearance(){return this.banner.appearance}get contentRatio(){return this.banner.appearance.contentRatio}get name(){return this.banner.name}get dir(){return this.storyManager.config.dir}get slides(){return this._slides}get activeSlideIndex(){return 0}get width(){return this._width}get activeSlide(){var e;return null!==(e=this._slides[this.activeSlideIndex])&&void 0!==e?e:new wt}get needShowErrorScreen(){return this._needShowErrorScreen}get needShowLoaderScreen(){return this._needShowLoaderScreen}get canBeShown(){return Boolean(this._$root)}get iterationId(){return this._iterationId}get durationMs(){return Date.now()-this._startTime}async init(){this.showLoaderScreen(),await this.activeSlide.init(),this._initPromiseResolver()}async start(){if(!this._$root)throw new Error(`[IAS]: Slide API mount point not found for banner with ID ${this.id}`);document.addEventListener("visibilitychange",this.handleVisibilityChange);try{await this.activeSlide.start(),this._startTime=Date.now(),this.markAsOpened(),this.emitShowBannerEvent()}catch(e){this.emitShowBannerFailedEvent(e)}}refreshSizes(){this.activeSlide.refreshSizes()}async restart(){try{await this.activeSlide.restart(),this._startTime=Date.now(),this.markAsOpened(),this.emitShowBannerEvent()}catch(e){this.emitShowBannerFailedEvent(e)}}async resume(){await this.activeSlide.resume()}async pause(){await this.activeSlide.pause()}async resumeByUser(){await this.activeSlide.resumeByUser()}async pauseByUser(){await this.activeSlide.pauseByUser()}async stop(){var e;this.slideApiImpl.clearNarrativeSessionDataCache(),document.removeEventListener("visibilitychange",this.handleVisibilityChange),null===(e=this.toast)||void 0===e||e.destroy(),await this.activeSlide.stop({prepareForRestart:1})}async destroy(){var e,t;document.removeEventListener("visibilitychange",this.handleVisibilityChange);const n=this.activeSlide;this._slides=[],this._$root=null,await n.destroy(),null===(e=this.slideApi)||void 0===e||e.destroy(),null===(t=this.toast)||void 0===t||t.destroy()}showLayerByIndex(e){this.activeSlide.showLayerByIndex(e)}showToast(e){if(!this._$root)return;const t=this._$root;this.toast=new pt(Object.assign({mountPoint:t},e)),this.toast.show(e.content)}detachRoot(){var e;this._$root=null,null===(e=this.slideApi)||void 0===e||e.destroy()}showErrorScreen(){this._needShowErrorScreen=!0}showLoaderScreen(){this._needShowLoaderScreen=!0}hideLoaderScreen(){this._needShowLoaderScreen=!1}hideErrorScreen(){this._needShowErrorScreen=!1}markAsOpened(){this._iterationId=(0,G.v4)(),this.banner.markAsOpened(),this.markWasShown()}waitInit(){return this._initPromise}notifyTimerEnd(){this.activeSlide.notifyTimerEnd()}async markWasShown(){!this.banner.wasShown&&this._iterationId&&(this.banner.markWasShown(),this.bannerStatisticService.sendViewEvent(this.id,{iterationId:this._iterationId,slideIndex:this.activeSlideIndex,slideTotal:this.banner.slides.length}))}async updateUserData(e){return this.bannerStore.updateBannerUserData(this.id,e)}createSlideApi(e){return new bt.SlideApi(this.slideApiImpl,{root:e,slideRatio:this.banner.appearance.contentRatio,isFullscreen:!1,nonce:E(),viewport:window,userResizeHandler:e=>{this._width=e.viewportWidth},VODPlayer:this.storyManager.globalProperties.$videoOnDemand,overlappingActionBarHeight:0})}emitShowBannerEvent(){this.bannerPlace.emit(lt.name,new lt({id:this.id,bannerPlace:this.bannerPlace.id,payload:this.activeSlide.payload}).payload)}emitShowBannerFailedEvent(e){this.bannerPlace.emit(ct.name,new ct({id:this.id,bannerPlace:this.bannerPlace.id,error:e,payload:this.activeSlide.payload}).payload)}},t=new WeakMap,n=new WeakMap,r=new WeakMap,i=new WeakMap,a=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;s=[L.observable],o=[L.observable],l=[L.observable],c=[L.observable],d=[L.observable],h=[L.computed],u=[L.computed],p=[L.computed],b=[L.action],f=[L.action],m=[L.action],v=[L.action],Pt(e,null,s,{kind:"accessor",name:"_$root",static:!1,private:!1,access:{has:e=>"_$root"in e,get:e=>e._$root,set:(e,t)=>{e._$root=t}},metadata:t},g,w),Pt(e,null,o,{kind:"accessor",name:"_needShowErrorScreen",static:!1,private:!1,access:{has:e=>"_needShowErrorScreen"in e,get:e=>e._needShowErrorScreen,set:(e,t)=>{e._needShowErrorScreen=t}},metadata:t},S,P),Pt(e,null,l,{kind:"accessor",name:"_needShowLoaderScreen",static:!1,private:!1,access:{has:e=>"_needShowLoaderScreen"in e,get:e=>e._needShowLoaderScreen,set:(e,t)=>{e._needShowLoaderScreen=t}},metadata:t},_,x),Pt(e,null,c,{kind:"accessor",name:"_width",static:!1,private:!1,access:{has:e=>"_width"in e,get:e=>e._width,set:(e,t)=>{e._width=t}},metadata:t},T,O),Pt(e,null,d,{kind:"accessor",name:"_slides",static:!1,private:!1,access:{has:e=>"_slides"in e,get:e=>e._slides,set:(e,t)=>{e._slides=t}},metadata:t},j,I),Pt(e,null,h,{kind:"getter",name:"activeSlide",static:!1,private:!1,access:{has:e=>"activeSlide"in e,get:e=>e.activeSlide},metadata:t},null,y),Pt(e,null,u,{kind:"getter",name:"needShowLoaderScreen",static:!1,private:!1,access:{has:e=>"needShowLoaderScreen"in e,get:e=>e.needShowLoaderScreen},metadata:t},null,y),Pt(e,null,p,{kind:"getter",name:"canBeShown",static:!1,private:!1,access:{has:e=>"canBeShown"in e,get:e=>e.canBeShown},metadata:t},null,y),Pt(e,null,b,{kind:"method",name:"showErrorScreen",static:!1,private:!1,access:{has:e=>"showErrorScreen"in e,get:e=>e.showErrorScreen},metadata:t},null,y),Pt(e,null,f,{kind:"method",name:"showLoaderScreen",static:!1,private:!1,access:{has:e=>"showLoaderScreen"in e,get:e=>e.showLoaderScreen},metadata:t},null,y),Pt(e,null,m,{kind:"method",name:"hideLoaderScreen",static:!1,private:!1,access:{has:e=>"hideLoaderScreen"in e,get:e=>e.hideLoaderScreen},metadata:t},null,y),Pt(e,null,v,{kind:"method",name:"hideErrorScreen",static:!1,private:!1,access:{has:e=>"hideErrorScreen"in e,get:e=>e.hideErrorScreen},metadata:t},null,y),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class Tt{constructor(e,t,n){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerStore",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"bannerStatisticService",{enumerable:!0,configurable:!0,writable:!0,value:n})}create(e,t){return new xt(this.storyManager,e,t,this.bannerStatisticService,this.bannerStore)}}function Ot(e,t){let n=null;return async function(...t){return n||(n=(async()=>{try{return await e.apply(this,t)}catch(e){throw e}finally{n=null}})(),n)}}class jt extends Error{constructor(e){super(`[IAS]: Banner with ID ${e} not found`),this.name="IasBannerNotFoundError"}}class It extends Error{constructor(e){super(`[IAS]: Banner slot with ID ${e} not found`),this.name="IasBannerPlaceNotFoundError"}}var Lt=function(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0},Ct=function(e,t,n,r,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?r.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),u=!1,p=n.length-1;p>=0;p--){var b={};for(var f in r)b[f]="access"===f?{}:r[f];for(var f in r.access)b.access[f]=r.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,n[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,r.name,h),u=!0};let Bt=(()=>{var e;let t,n,r,i,a=[];return e=class{constructor(e){Object.defineProperty(this,"httpClient",{enumerable:!0,configurable:!0,writable:!0,value:(Lt(this,a),e)})}async fetchBannerPlaceById(e){const t=await this.httpClient.get(`banner/place/${e.placeId}`,{expand:"banners.slides",tags:e.tags.join(",")});if(t.data)return t.data;throw new It(e.placeId)}async fetchBannerById(e){const t=await this.httpClient.get(`banner/${e}`,{expand:"slides"});if(t.data)return t.data;throw new jt(e)}async fetchContextWithStyles({needFetchStyles:e}){return(await this.httpClient.get("banner/context",{fields:"widgetsData"+(e?",style":"")})).data}async updateUserData(e,t){try{await this.httpClient.request({url:`banner/${e}/data`,method:"put",data:{data:t}})}catch(e){console.error(e)}}},(()=>{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;t=[Ot],n=[Ot],r=[Ot],i=[Ot],Ct(e,null,t,{kind:"method",name:"fetchBannerPlaceById",static:!1,private:!1,access:{has:e=>"fetchBannerPlaceById"in e,get:e=>e.fetchBannerPlaceById},metadata:s},null,a),Ct(e,null,n,{kind:"method",name:"fetchBannerById",static:!1,private:!1,access:{has:e=>"fetchBannerById"in e,get:e=>e.fetchBannerById},metadata:s},null,a),Ct(e,null,r,{kind:"method",name:"fetchContextWithStyles",static:!1,private:!1,access:{has:e=>"fetchContextWithStyles"in e,get:e=>e.fetchContextWithStyles},metadata:s},null,a),Ct(e,null,i,{kind:"method",name:"updateUserData",static:!1,private:!1,access:{has:e=>"updateUserData"in e,get:e=>e.updateUserData},metadata:s},null,a),s&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})})(),e})();class kt{constructor(e,t){Object.defineProperty(this,"httpClient",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:t})}async sendShowBannerEvent(e){throw new Error("Method not implemented.")}async sendClickOnBannerEvent(e){throw new Error("Method not implemented.")}async sendBannerCTREvent(e){throw new Error("Method not implemented.")}async sendViewEvent(e,t){await this.sendStatisticsEvent(e,t)}async sendWidgetEvent(e,t){await this.sendStatisticsEvent(e,t)}async sendStatisticsEvent(e,t){try{if(this.storyManager.isStatisticsDisabled)return void console.log("[BANNER STATISTICS]",Object.assign({bannerId:e,type:t.type},t.toQueryParams()));await this.httpClient.post(`/banner/${e}/event/${t.type}`,{},t.toQueryParams())}catch(e){console.error(e)}}}var At;!function(e){e[e.Base=0]="Base",e[e.Dynamic=1]="Dynamic",e[e.Game=2]="Game",e[e.Story=3]="Story",e[e.IAM=4]="IAM"}(At||(At={}));var Mt=function(e,t,n,r,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?r.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),u=!1,p=n.length-1;p>=0;p--){var b={};for(var f in r)b[f]="access"===f?{}:r[f];for(var f in r.access)b.access[f]=r.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,n[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,r.name,h),u=!0};(()=>{var e;let t,n,r=[];e=class{async fetchBannerPlaceById(e){return{id:"default",appearance:{single_banner_aspect_ratio:2,banners_gap:16,corner_radius:16,loop:!0,autoplay:!0,autoplay_delay:1e3,animation_speed:300},banners:[]}}async fetchContext(){return{style:"",widgetsData:{}}}updateUserData(e,t){throw new Error("Method not implemented.")}fetchBannerById(e){throw new Error("Method not implemented.")}constructor(){!function(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e)}(this,r)}},(()=>{const i="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;t=[Ot],n=[Ot],Mt(e,null,t,{kind:"method",name:"fetchBannerPlaceById",static:!1,private:!1,access:{has:e=>"fetchBannerPlaceById"in e,get:e=>e.fetchBannerPlaceById},metadata:i},null,r),Mt(e,null,n,{kind:"method",name:"fetchContext",static:!1,private:!1,access:{has:e=>"fetchContext"in e,get:e=>e.fetchContext},metadata:i},null,r),i&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i})})()})();class Rt{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerStore",{enumerable:!0,configurable:!0,writable:!0,value:t})}createBannerPlace(e,t){var n;const r=new kt(this.storyManager.httpClient,this.storyManager),i=new Me(r),a=new Tt(this.storyManager,this.bannerStore,i);return new re(null!==(n=null==t?void 0:t.toString())&&void 0!==n?n:"default",e,i,this.bannerStore,a)}createBannerPreviewPlace(e,t){const n=new kt(this.storyManager.httpClient,this.storyManager),r=new Me(n),i=new Tt(this.storyManager,this.bannerStore,r);return new Ae(t.toString(),e,this.bannerStore,i)}}class Dt{static toDomain(e,t){return new B({id:e.id,name:e.name,slides:e.slides.map((e=>{var t;return new D({html:e.html,duration:e.duration,payload:null===(t=e.event_payload)||void 0===t?void 0:t.payload})})),displayFrom:e.display_from,displayTo:e.display_to,appearance:new k(e.appearance),context:new A(e.id,t),frequencyLimit:e.frequency_limit})}}class Nt{static toDomain(e,t,n){const r=e.banners.map((e=>Dt.toDomain(e,t)));return new W({id:e.id,banners:r,placeholders:n,style:t.style})}}var Wt=function(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0},zt=function(e,t,n,r,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?r.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),u=!1,p=n.length-1;p>=0;p--){var b={};for(var f in r)b[f]="access"===f?{}:r[f];for(var f in r.access)b.access[f]=r.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,n[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,r.name,h),u=!0},Ft=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)},Ut=function(e,t,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(e,n):i?i.value=n:t.set(e,n),n};let Vt=(()=>{var e,t,n;let r,i,a,s,o=[],l=[],c=[],d=[],h=[];return e=class{get _bannerPlaces(){return Ft(this,t,"f")}set _bannerPlaces(e){Ut(this,t,e,"f")}get _banners(){return Ft(this,n,"f")}set _banners(e){Ut(this,n,e,"f")}constructor(e,r){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(Wt(this,o),e)}),Object.defineProperty(this,"bannerApi",{enumerable:!0,configurable:!0,writable:!0,value:r}),t.set(this,Wt(this,l,L.observable.map())),n.set(this,(Wt(this,c),Wt(this,d,L.observable.map()))),Object.defineProperty(this,"bannerCSS",{enumerable:!0,configurable:!0,writable:!0,value:(Wt(this,h),"")}),(0,L.reaction)((()=>e.rootStore.placeholderStore.placeholders),(e=>{for(const t of this._bannerPlaces.values())t.updatePlaceholders(e)}))}get bannerPlaces(){return Array.from(this._bannerPlaces.values())}async getBannerById(e){if(this._banners.has(e))return this._banners.get(e);await this.storyManager.waitStoryManagerConfig();const t=await this.fetchBannerContext(),n=await this.bannerApi.fetchBannerById(e);return this.addBanner(n,t)}async getBannerPlaceById(e){if(this._bannerPlaces.has(e.placeId))return this._bannerPlaces.get(e.placeId);await this.storyManager.waitStoryManagerConfig();const t=await this.fetchBannerContext(),n=await this.bannerApi.fetchBannerPlaceById({placeId:e.placeId,tags:this.storyManager.config.tags});return this.addBannerPlace(n,t)}clearCache(){this._bannerPlaces=L.observable.map(),this._banners=L.observable.map()}removeBannerPlaceById(e){this._bannerPlaces.delete(e)}async updateBannerUserData(e,t){if(!this.storyManager.isStatisticsDisabled)return this.bannerApi.updateUserData(e,t);console.log("[IAM]: update user data",{bannerId:e,payload:t})}async fetchBannerContext(){await this.storyManager.rootStore.sessionStore.open();const e=await this.bannerApi.fetchContextWithStyles({needFetchStyles:!this.bannerCSS});return this.bannerCSS&&(e.style=this.bannerCSS),e}addBannerPlace(e,t){const n=this.storyManager.rootStore.placeholderStore.placeholders,r=Nt.toDomain(e,t,n);return this._bannerPlaces.set(e.id,r),r}addBanner(e,t){const n=this.storyManager.rootStore.placeholderStore.placeholders,r=Dt.toDomain(e,t);return r.updatePlaceholders(n),this._banners.set(r.id,r),r}},t=new WeakMap,n=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[L.observable],i=[L.observable],a=[L.computed],s=[Ot],zt(e,null,r,{kind:"accessor",name:"_bannerPlaces",static:!1,private:!1,access:{has:e=>"_bannerPlaces"in e,get:e=>e._bannerPlaces,set:(e,t)=>{e._bannerPlaces=t}},metadata:t},l,c),zt(e,null,i,{kind:"accessor",name:"_banners",static:!1,private:!1,access:{has:e=>"_banners"in e,get:e=>e._banners,set:(e,t)=>{e._banners=t}},metadata:t},d,h),zt(e,null,a,{kind:"getter",name:"bannerPlaces",static:!1,private:!1,access:{has:e=>"bannerPlaces"in e,get:e=>e.bannerPlaces},metadata:t},null,o),zt(e,null,s,{kind:"method",name:"getBannerPlaceById",static:!1,private:!1,access:{has:e=>"getBannerPlaceById"in e,get:e=>e.getBannerPlaceById},metadata:t},null,o),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class qt{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const t=new Bt(e.httpClient);this.bannerStore=new Vt(this.storyManager,t)}}class $t extends Error{constructor(){super("[IAS]: you must create an instance of BannersProvider"),this.name="IasBannersProviderReferenceError"}}class Ht extends Error{constructor(e){super(`[IAS]: Mount point ${e} is not present in DOM at initialization time`),this.name="IasMountPointReferenceError"}}class Gt extends Oe{render(){this.root.render((0,l.jsx)(Ee,{bannerPlace:this.bannerPlace}))}}class Xt{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerPlaces",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"bannerPlaceViewModelFactory",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rootStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reloadAllBanners",{enumerable:!0,configurable:!0,writable:!0,value:()=>{this.rootStore.bannerStore.clearCache(),this.bannerPlaces.forEach((e=>{e.reload().catch(console.error)}))}}),this.rootStore=new qt(e),this.bannerPlaceViewModelFactory=new Rt(e,this.rootStore.bannerStore),this.storyManager.rootStore.storyManagerConfigStore.waitStoryManagerConfig().then((()=>{this.storyManager.config.on("requestSDKReload",this.reloadAllBanners)}))}addBannerPlace(e){this.bannerPlaces.push(e)}removeBannerPlace(e){const t=this.bannerPlaces.indexOf(e);-1!==t&&this.bannerPlaces.splice(t,1)}clear(){for(const e of this.bannerPlaces)e.destroy();this.bannerPlaces=[]}createBannerPlace(e){return this.bannerPlaceViewModelFactory.createBannerPlace(this,e)}createBannerPreviewPlace(e){return this.bannerPlaceViewModelFactory.createBannerPreviewPlace(this,e)}static create(e){return Xt.instance||(Xt.instance=new Xt(e)),Xt.instance}mountBannerPlace(e,t){const n=document.querySelector(e);if(!n)throw new Ht(e);const r=this.createBannerPlace(null==t?void 0:t.placeId),i=new Oe(n,r,t);return i.render(),i}mountBannerPreviewPlace(e,t){const n=document.querySelector(e);if(!n)throw new Ht(e);const r=this.createBannerPreviewPlace(t.bannerId),i=new Gt(n,r);return i.render(),i}}const Qt=()=>{if(!Xt.instance)throw new $t;return Xt.instance},Yt=Xt;class Jt{constructor(){Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ias-banners"})}install(e){const t=Yt.create(e.INTERNAL_API);e.HOST.prototype.banners=t}uninstall(){}}const Zt=new Jt})();var u=h.RE,p=h.Sr,b=h.YL,f=h.Ay;export{u as IasBannerPlace,p as IasBannerPreview,b as IasBannersPlugin,f as default};
|