@inappstory/js-sdk 3.8.4 → 3.8.5

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.
@@ -2106,11 +2106,11 @@ class StoryManagerAdapter {
2106
2106
  return StoryManagerAdapter.instance;
2107
2107
  }
2108
2108
  get sdkVersionName() {
2109
- const sdkVersionName = "3.8.4";
2109
+ const sdkVersionName = "3.8.5";
2110
2110
  return sdkVersionName || "0.0.0";
2111
2111
  }
2112
2112
  get sdkVersionCode() {
2113
- const sdkVersionCode = 30804;
2113
+ const sdkVersionCode = 30805;
2114
2114
  return sdkVersionCode ? parseInt(sdkVersionCode) : 0;
2115
2115
  }
2116
2116
  get deviceId() {
package/dist/index.umd.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@inappstory/react-sdk"),require("react/jsx-runtime"),require("react-dom/client"),require("react"),require("react-dom"));else if("function"==typeof define&&define.amd)define(["@inappstory/react-sdk","react/jsx-runtime","react-dom/client","react","react-dom"],t);else{var r="object"==typeof exports?t(require("@inappstory/react-sdk"),require("react/jsx-runtime"),require("react-dom/client"),require("react"),require("react-dom")):t(e["@inappstory/react-sdk"],e["react/jsx-runtime"],e["react-dom/client"],e.react,e["react-dom"]);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(self,((e,t,r,n,o)=>(()=>{var a={432:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(935),o=r.n(n)()((function(e){return e[1]}));o.push([e.id,".favorite-story-list-modal--xWjHA{position:fixed;inset:0px;z-index:1090}.favorite-story-list-modal--xWjHA .container--GZBjv{width:100%;height:100%;background:var(--storiesFavoriteBackgroundColor, #333333);display:flex;flex-direction:column;position:relative;overflow-y:auto}.favorite-story-list-modal--xWjHA .header--TjHMD{display:flex;align-content:center;justify-content:center;align-items:center;flex-shrink:0;position:-webkit-sticky;position:sticky;top:0;z-index:100;background:var(--storiesFavoriteTitleBackgroundColor, #333333);box-shadow:0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12),0 1px 3px 0 rgba(0,0,0,.2);padding-top:var(--storiesFavoriteHeaderTopOffset, 0px);margin-bottom:25px}.favorite-story-list-modal--xWjHA .header--TjHMD .title--Dk04x{margin-top:1rem;margin-bottom:1rem;font-size:1.2em;color:var(--storiesFavoriteTitleColor, white);font-family:var(--storiesFavoriteTitleFontFamily);font-weight:normal;font-size:1.4rem;line-height:normal;font:var(--storiesFavoriteTitleFont, normal)}@media(min-width: 640px){.favorite-story-list-modal--xWjHA .header--TjHMD .title--Dk04x{margin-top:25px;margin-bottom:25px}}@media(min-width: 640px){.favorite-story-list-modal--xWjHA .header--TjHMD{margin-bottom:50px}}.favorite-story-list-modal--xWjHA .header__close-btn--Jojm-{border:0;padding:0;background:rgba(0,0,0,0);position:absolute;top:50%;transform:translateY(-50%);z-index:1140;pointer-events:all;cursor:pointer;outline:none;right:10px;width:30px;height:30px;display:flex;justify-content:center;align-items:center}.favorite-story-list-modal--xWjHA .header__close-btn--Jojm-:focus{outline:none}.favorite-story-list-modal--xWjHA .header__close-btn--Jojm- svg{overflow:visible}.favorite-story-list-modal--xWjHA .footer--edEpn{width:100%;height:25px}@media(min-width: 640px){.favorite-story-list-modal--xWjHA .footer--edEpn{height:50px}}.favorite-story-list-modal--xWjHA .bottom-offset--baiTh{position:-webkit-sticky;position:sticky;z-index:100;background:inherit;bottom:0;width:100%;height:var(--storiesFavoriteBottomOffset, 0px)}.favorite-story-list-modal--xWjHA .content--qCPkX{display:flex;justify-content:center;width:100%;padding:0 25px 25px;box-sizing:border-box}.favorite-story-list-modal--xWjHA .content--qCPkX .favorite-story-list--MISMx{width:100%}@media(min-width: 640px){.favorite-story-list-modal--xWjHA .content--qCPkX .favorite-story-list--MISMx{max-width:640px}}@media(min-width: 768px){.favorite-story-list-modal--xWjHA .content--qCPkX .favorite-story-list--MISMx{max-width:768px}}@media(min-width: 1024px){.favorite-story-list-modal--xWjHA .content--qCPkX .favorite-story-list--MISMx{max-width:1024px}}@media(min-width: 1280px){.favorite-story-list-modal--xWjHA .content--qCPkX .favorite-story-list--MISMx{max-width:1280px}}",""]),o.locals={"favorite-story-list-modal":"favorite-story-list-modal--xWjHA",container:"container--GZBjv",header:"header--TjHMD",title:"title--Dk04x","header__close-btn":"header__close-btn--Jojm-",footer:"footer--edEpn","bottom-offset":"bottom-offset--baiTh",content:"content--qCPkX","favorite-story-list":"favorite-story-list--MISMx"};const a=o},935:e=>{"use strict";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 o={};if(n)for(var a=0;a<this.length;a++){var i=this[a][0];null!=i&&(o[i]=!0)}for(var s=0;s<e.length;s++){var c=[].concat(e[s]);n&&o[c[0]]||(r&&(c[2]?c[2]="".concat(r," and ").concat(c[2]):c[2]=r),t.push(c))}},t}},46:e=>{"use strict";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 o=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 o(r){e.removeListener(t,a),n(r)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}g(e,t,a,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&g(e,"error",t,r)}(e,o,{once:!0})}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var i=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function l(e,t,r,n){var o,a,i,l;if(s(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),i=a[t]),void 0===i)i=a[t]=r,++e._eventsCount;else if("function"==typeof i?i=a[t]=n?[r,i]:[i,r]:n?i.unshift(r):i.push(r),(o=c(e))>0&&i.length>o&&!i.warned){i.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=e,d.type=t,d.count=i.length,l=d,console&&console.warn&&console.warn(l)}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 u(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=d.bind(n);return o.listener=r,n.wrapFn=o,o}function p(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]: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}(o):h(o,o.length)}function f(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 h(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function g(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 o(a){n.once&&e.removeEventListener(t,o),r(a)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return i},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");i=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||o(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 c(this)},a.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var o="error"===e,a=this._events;if(void 0!==a)o=o&&void 0===a.error;else if(!o)return!1;if(o){var i;if(t.length>0&&(i=t[0]),i instanceof Error)throw i;var s=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw s.context=i,s}var c=a[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else{var l=c.length,d=h(c,l);for(r=0;r<l;++r)n(d[r],this,t)}return!0},a.prototype.addListener=function(e,t){return l(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return l(this,e,t,!0)},a.prototype.once=function(e,t){return s(t),this.on(e,u(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,u(this,e,t)),this},a.prototype.removeListener=function(e,t){var r,n,o,a,i;if(s(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(o=-1,a=r.length-1;a>=0;a--)if(r[a]===t||r[a].listener===t){i=r[a].listener,o=a;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,i||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 o,a=Object.keys(r);for(n=0;n<a.length;++n)"removeListener"!==(o=a[n])&&this.removeAllListeners(o);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 p(this,e,!0)},a.prototype.rawListeners=function(e){return p(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},a.prototype.listenerCount=f,a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},650:(e,t,r)=>{var n=r(942).Symbol;e.exports=n},379:(e,t,r)=>{var n=r(650),o=r(870),a=r(5),i=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?o(e):a(e)}},967:(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},870:(e,t,r)=>{var n=r(650),o=Object.prototype,a=o.hasOwnProperty,i=o.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=a.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var o=i.call(e);return n&&(t?e[s]=r:delete e[s]),o}},5:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},942:(e,t,r)=>{var n=r(967),o="object"==typeof self&&self&&self.Object===Object&&self,a=n||o||Function("return this")();e.exports=a},655:(e,t,r)=>{var n=r(379),o=r(580);e.exports=function(e){if(!o(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},580:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},591:(e,t,r)=>{"use strict";var n,o=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},a=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]}}(),i=[];function s(e){for(var t=-1,r=0;r<i.length;r++)if(i[r].identifier===e){t=r;break}return t}function c(e,t){for(var r={},n=[],o=0;o<e.length;o++){var a=e[o],c=t.base?a[0]+t.base:a[0],l=r[c]||0,d="".concat(c," ").concat(l);r[c]=l+1;var u=s(d),p={css:a[1],media:a[2],sourceMap:a[3]};-1!==u?(i[u].references++,i[u].updater(p)):i.push({identifier:d,updater:y(p,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 o=r.nc;o&&(n.nonce=o)}if(Object.keys(n).forEach((function(e){t.setAttribute(e,n[e])})),"function"==typeof e.insert)e.insert(t);else{var i=a(e.insert||"head");if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(t)}return t}var d,u=(d=[],function(e,t){return d[e]=t,d.filter(Boolean).join("\n")});function p(e,t,r,n){var o=r?"":n.media?"@media ".concat(n.media," {").concat(n.css,"}"):n.css;if(e.styleSheet)e.styleSheet.cssText=u(t,o);else{var a=document.createTextNode(o),i=e.childNodes;i[t]&&e.removeChild(i[t]),i.length?e.insertBefore(a,i[t]):e.appendChild(a)}}function f(e,t,r){var n=r.css,o=r.media,a=r.sourceMap;if(o?e.setAttribute("media",o):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 h=null,g=0;function y(e,t){var r,n,o;if(t.singleton){var a=g++;r=h||(h=l(t)),n=p.bind(null,r,a,!1),o=p.bind(null,r,a,!0)}else r=l(t),n=f.bind(null,r,t),o=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 o()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=o());var r=c(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 o=s(r[n]);i[o].references--}for(var a=c(e,t),l=0;l<r.length;l++){var d=s(r[l]);0===i[d].references&&(i[d].updater(),i.splice(d,1))}r=a}}}},494:t=>{"use strict";t.exports=e},155:e=>{"use strict";e.exports=n},514:e=>{"use strict";e.exports=o},236:e=>{"use strict";e.exports=r},272:e=>{"use strict";e.exports=t}},i={};function s(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={id:e,exports:{}};return a[e](r,r.exports,s),r.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.nc=void 0;var c={};return(()=>{"use strict";s.r(c),s.d(c,{AppearanceManager:()=>e.AppearanceManager,CloseButtonPosition:()=>e.CloseButtonPosition,GoodsWidgetRenderingType:()=>e.GoodsWidgetRenderingType,IamCheckDisplayTimeRangeError:()=>e.IamCheckDisplayTimeRangeError,IamFrequencyLimitError:()=>e.IamFrequencyLimitError,IamMessageLimitExceededError:()=>e.IamMessageLimitExceededError,IamMessageOpenError:()=>e.IamMessageOpenError,IamNotFoundByEventError:()=>e.IamNotFoundByEventError,IamNotFoundByIdError:()=>e.IamNotFoundByIdError,IamNotFoundLimitError:()=>e.IamNotFoundLimitError,IamOtherReaderIsOpenError:()=>e.IamOtherReaderIsOpenError,IamShowOnlyIfLoadedError:()=>e.IamShowOnlyIfLoadedError,IasNetworkError:()=>e.IasNetworkError,InAppStoryManager:()=>D,StoriesListCardCoverQuality:()=>e.StoriesListCardCoverQuality,StoriesListCardTitlePosition:()=>e.StoriesListCardTitlePosition,StoriesListCardTitleTextAlign:()=>e.StoriesListCardTitleTextAlign,StoriesListCardViewVariant:()=>e.StoriesListCardViewVariant,StoriesListDirection:()=>e.StoriesListDirection,StoryReaderSwipeStyle:()=>e.StoryReaderSwipeStyle});var e=s(494);class t extends Error{constructor(e){super(`Appearance Manager must be an object, but passed ${e.toUpperCase()}. Please check your code.`),this.name="IasAppearanceManagerTypeofError"}}const r=e=>{if(null==e||"object"!=typeof e)throw new t(null==e?"null":typeof e)};class n extends Error{constructor(){super("[IAS]: The <StoryManager> instance has been destroyed, you must create a new instance"),this.name="IasInAppStoryManagerReferenceError"}}class o extends Error{constructor(e){super(`[IAS]: Mount point ${e} is not present in DOM at initialization time`),this.name="IasMountPointReferenceError"}}var a=s(46);class i extends a.EventEmitter{constructor(e,t){super(),Object.defineProperty(this,"_mountSelector",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"app",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_mountPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._mountPoint=this.getMountPoint(e),this.app.addItem(this).catch(console.error)}get mountPoint(){return this._mountPoint}get mountSelector(){return this._mountSelector}destroy(){this.app.removeItem(this)}getMountPoint(e){const t=document.querySelector(e);if(!t)throw new o(e);return t}}class l extends i{constructor(e,t,n,o){super(e,n),Object.defineProperty(this,"_appearanceManager",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"_ugcCardClickHandler",{enumerable:!0,configurable:!0,writable:!0,value:()=>{}}),Object.defineProperty(this,"_api",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),r(t)}get appearanceManager(){return this._appearanceManager}get type(){return e.StoryFeedType.DEFAULT}get identityFields(){return{feedSlug:this.feedSlug}}get feedSlug(){var e;return null===(e=this.params)||void 0===e?void 0:e.feed}get testKey(){var e;return null===(e=this.params)||void 0===e?void 0:e.testKey}get useUgcCard(){var e;return Boolean(null===(e=this.params)||void 0===e?void 0:e.useUgcCard)}set ugcCardClickHandler(e){this._ugcCardClickHandler=e}get ugcCardClickHandler(){return this._ugcCardClickHandler}set api(e){this._api=e}async reload(){var e;return null===(e=this._api)||void 0===e?void 0:e.reload()}}class d extends l{constructor(t,n,o,a){super(t,n,o,{feed:e.UGCFeedSlug,testKey:null==a?void 0:a.testKey,useUgcCard:null==a?void 0:a.useUgcCard}),Object.defineProperty(this,"ugcParams",{enumerable:!0,configurable:!0,writable:!0,value:a}),r(n)}get type(){return e.StoryFeedType.UGC}get filter(){var e;return null===(e=this.ugcParams)||void 0===e?void 0:e.filter}}var u=s(272),p=s(236),f=s(155),h=s(591),g=s.n(h),y=s(432),v={insert:"head",singleton:!1};g()(y.A,v);const m=y.A.locals||{};var b;!function(e){e.LTR="ltr",e.RTL="rtl"}(b||(b={}));const M=({open:t,options:r,storyListOptions:n,onClose:o})=>{var a,i;(0,f.useLayoutEffect)((()=>{if(!t)return;const e=document.documentElement.style.overflow;return document.documentElement.style.overflow="hidden",()=>{document.documentElement.style.overflow=e}}),[t]);return t?(0,u.jsx)("div",{className:m["favorite-story-list-modal"],style:(()=>{var e,t,n,o;return{"--storiesFavoriteTitleColor":r.title.color,"--storiesFavoriteTitleFontFamily":"InternalPrimaryFont","--storiesFavoriteTitleFont":r.title.font,"--storiesFavoriteTitleBackgroundColor":r.title.backgroundColor,"--storiesFavoriteHeaderTopOffset":parseFloat(null!==(t=null===(e=r.headerTopOffset)||void 0===e?void 0:e.toString())&&void 0!==t?t:"0")+"px","--storiesFavoriteBottomOffset":parseFloat(null!==(o=null===(n=r.bottomOffset)||void 0===n?void 0:n.toString())&&void 0!==o?o:"0")+"px","--storiesFavoriteBackgroundColor":r.backgroundColor}})(),children:(0,u.jsxs)("div",{className:m.container,children:[(0,u.jsxs)("div",{className:m.header,children:[(0,u.jsx)("p",{className:m.title,children:r.title.content}),(0,u.jsx)("button",{onClick:e=>{e.preventDefault(),e.stopPropagation(),o()},className:m["header__close-btn"],style:(()=>{var t;const n="start"===r.closeButtonPosition||"left"===r.closeButtonPosition,o=(null===(t=e.storyManager.config)||void 0===t?void 0:t.dir)===b.LTR;return{[n&&o||!n&&!o?"left":"right"]:"10px"}})(),dangerouslySetInnerHTML:{__html:null!==(i=null===(a=r.closeButton)||void 0===a?void 0:a.svgSrc.baseState)&&void 0!==i?i:""}})]}),(0,u.jsx)("div",{className:m.content,children:(0,u.jsx)("div",{className:m["favorite-story-list"],children:(0,u.jsx)(e.FavoriteStoryList,{options:Object.assign(Object.assign(Object.assign({},n),{sidePadding:0}),{direction:e.StoriesListDirection.COLUMN,layout:{height:"auto"}})})})}),(0,u.jsx)("div",{className:m.footer}),(0,u.jsx)("div",{className:m["bottom-offset"]})]})}):null};var S=s(514);const w=e=>{(0,f.useEffect)((()=>{const t=e.mountPoint,r=()=>{console.warn(`[IAS]: The node has been removed from DOM. Unsafe destruction of story feed ${e.mountSelector}`),e.destroy()};if(!document.body.contains(t))return void r();const n=new MutationObserver((()=>{document.body.contains(t)||(r(),n.disconnect())}));return n.observe(document.body,{childList:!0,subtree:!0}),()=>{n.disconnect()}}),[e])};var x;!function(e){e.START_LOADER="startLoad",e.END_LOADER="endLoad"}(x||(x={}));const C=({storyList:t,onStoryCardClick:r,onFavoriteCardClick:n})=>{const[o,a]=(0,f.useState)(t.appearanceManager.storiesListOptions),i=(0,f.useRef)(null);return w(t),(0,f.useEffect)((()=>{t.api=i.current}),[]),(0,f.useEffect)((()=>(t.appearanceManager.on(e.AppearanceManagerEvents.EVENT_UPDATED_STORIES_LIST_OPTIONS,a),()=>{t.appearanceManager.off(e.AppearanceManagerEvents.EVENT_UPDATED_STORIES_LIST_OPTIONS,a)})),[t.appearanceManager]),(0,S.createPortal)((0,u.jsx)(e.StoryList,{ref:i,options:o,hasFavorite:t.appearanceManager.commonOptions.hasFavorite,testKey:t.testKey,useUgcCard:t.useUgcCard,feedSlug:t.feedSlug,onLoadStart:()=>{t.emit(x.START_LOADER)},onLoadEnd:e=>{t.emit(x.END_LOADER,e)},onUgcCardClick:()=>{t.ugcCardClickHandler()},onFavoriteCardClick:n,onStoryCardClick:r}),t.mountPoint)};var L;!function(e){e.START_LOADER="startLoad",e.END_LOADER="endLoad"}(L||(L={}));const O=({ugcStoryList:t,onStoryCardClick:r})=>{const[n,o]=(0,f.useState)(t.appearanceManager.storiesListOptions),a=(0,f.useRef)(null);return w(t),(0,f.useEffect)((()=>{t.api=a.current}),[]),(0,f.useEffect)((()=>(t.appearanceManager.on(e.AppearanceManagerEvents.EVENT_UPDATED_STORIES_LIST_OPTIONS,o),()=>{t.appearanceManager.off(e.AppearanceManagerEvents.EVENT_UPDATED_STORIES_LIST_OPTIONS,o)})),[t.appearanceManager]),(0,S.createPortal)((0,u.jsx)(e.UGCStoryList,{ref:a,options:n,filter:t.filter,testKey:t.testKey,useUgcCard:t.useUgcCard,onStoryCardClick:r,onLoadStart:()=>{t.emit(L.START_LOADER)},onLoadEnd:e=>{t.emit(L.END_LOADER,e)},onUgcCardClick:()=>{t.ugcCardClickHandler()}}),t.mountPoint)},E=t=>{const[r,n]=(0,f.useState)(!1);return(0,u.jsxs)(e.IASContainer,{config:t.storyManagerConfigDto,storyReaderOptions:t.appearanceManager.storyReaderOptions,commonOptions:t.appearanceManager.commonOptions,gameReaderOptions:t.appearanceManager.gameReaderOptions,goodsWidgetOptions:t.appearanceManager.goodsWidgetOptions,children:[t.items.map((e=>e instanceof d?(0,u.jsx)(O,{ugcStoryList:e,onStoryCardClick:()=>{t.onAppearanceManagerChange(e.appearanceManager)}},e.mountSelector):e instanceof l?(0,u.jsx)(C,{onFavoriteCardClick:()=>{n(!0)},onStoryCardClick:()=>{t.onAppearanceManagerChange(e.appearanceManager)},storyList:e},e.mountSelector):void 0)),(0,u.jsx)(M,{open:r,onClose:()=>n(!1),options:t.appearanceManager.storyFavoriteReaderOptions,storyListOptions:t.appearanceManager.storiesListOptions})]})};class j{constructor(){Object.defineProperty(this,"_items",{enumerable:!0,configurable:!0,writable:!0,value:[]})}get items(){return this._items}addItem(e){this._items.push(e)}removeItem(e){const t=this._items.findIndex((t=>t===e));-1!==t&&this._items.splice(t,1)}destroy(){this._items=[]}}class A{constructor(t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"root",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"storyManagerConfigDto",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"appearanceManager",{enumerable:!0,configurable:!0,writable:!0,value:new e.AppearanceManager}),Object.defineProperty(this,"rootElement",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"appItemManager",{enumerable:!0,configurable:!0,writable:!0,value:new j}),this.createAppRoot(),this.handleAppearanceManagerUpdate=this.handleAppearanceManagerUpdate.bind(this),this.setAppearanceManager=this.setAppearanceManager.bind(this)}async addItem(e){try{this.appItemManager.addItem(e),await this.storyManager.waitForConfig(),this.render()}catch(t){throw this.removeItem(e),t}}async removeItem(e){this.appItemManager.removeItem(e),this.render()}setStoryManagerConfig(e){this.storyManagerConfigDto=Object.assign(Object.assign({},this.storyManagerConfigDto),e),this.render()}setAppearanceManager(e){r(e),this.unscubscribeToAppearanceManagerEvents(),this.appearanceManager=e,this.subscribeToAppearanceManagerEvents(),this.render()}render(){var e;null===(e=this.root)||void 0===e||e.render((0,u.jsx)(E,{storyManagerConfigDto:this.storyManagerConfigDto,appearanceManager:this.appearanceManager,items:this.appItemManager.items.slice(),onAppearanceManagerChange:this.setAppearanceManager}))}destroy(){this.rootElement&&this.root&&(this.appItemManager.destroy(),this.unscubscribeToAppearanceManagerEvents(),this.root.unmount(),document.body.removeChild(this.rootElement),this.rootElement=null,this.root=null)}createAppRoot(){this.rootElement=document.createElement("div"),this.rootElement.id="ias-app",document.body.append(this.rootElement),this.root=(0,p.createRoot)(this.rootElement)}subscribeToAppearanceManagerEvents(){this.appearanceManager.on(e.AppearanceManagerEvents.UPDATE,this.handleAppearanceManagerUpdate)}unscubscribeToAppearanceManagerEvents(){this.appearanceManager.off(e.AppearanceManagerEvents.UPDATE,this.handleAppearanceManagerUpdate)}handleAppearanceManagerUpdate(){this.render()}}var _,I=s(655),T=s.n(I);!function(e){e.START_LOADING="startLoading",e.END_LOADING="endLoading",e.CLOSE_STORY_READER="closeStoryReader"}(_||(_={}));class P extends a.EventEmitter{constructor(e,t,n,o,a){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"app",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:a}),r(t),this.handleCloseStoryReader=this.handleCloseStoryReader.bind(this),this.showSharePage(e,t)}async showSharePage(e,t){try{this.app.setAppearanceManager(t),this.handleStartLoad(),await this.storyManager.showSharePage(e),this.storyManager.once("closeStoryReader",this.handleCloseStoryReader),this.handleEndLoad(!0)}catch(e){this.handleEndLoad(!1)}}async closeStoryReader(){this.storyManager.closeStoryReader()}handleStartLoad(){setTimeout((()=>{var e;this.emit(_.START_LOADING),T()(null===(e=this.options)||void 0===e?void 0:e.handleStartLoad)&&this.options.handleStartLoad()}))}handleEndLoad(e){var t;this.emit(_.END_LOADING,{result:e}),T()(null===(t=this.options)||void 0===t?void 0:t.handleStopLoad)&&this.options.handleStopLoad(e)}handleCloseStoryReader(){var e,t,r;if(T()(null===(e=this.options)||void 0===e?void 0:e.handleStoryReaderClose)||this.listenerCount(_.CLOSE_STORY_READER)>0)try{T()(null===(t=this.options)||void 0===t?void 0:t.handleStoryReaderClose)&&(null===(r=this.options)||void 0===r||r.handleStoryReaderClose()),this.emit(_.CLOSE_STORY_READER)}catch(e){console.error(e)}else{const e=window.location;window.open(`${e.protocol}//${e.host}`,"_parent")}}}class k extends a.EventEmitter{constructor(t,n,o,a){super(),Object.defineProperty(this,"appearanceManager",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"app",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"stackedStoryListViewModel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),r(t),this.handleUpdate=this.handleUpdate.bind(this),this.stackedStoryListViewModel=new e.StackedStoryListViewModel(this.options),this.stackedStoryListViewModel.on("update",this.handleUpdate),this.loadStories().catch(console.error)}get stories(){return this.stackedStoryListViewModel.stories}get length(){return this.stackedStoryListViewModel.length}get activeIndex(){return this.stackedStoryListViewModel.activeIndex}get feedCoverSrc(){return this.stackedStoryListViewModel.feedCoverSrc}get top(){return this.stackedStoryListViewModel.top}async reload(){return this.stackedStoryListViewModel.reload()}destroy(){this.stackedStoryListViewModel.destroy(),this.stackedStoryListViewModel.removeAllListeners()}showStory(e){this.app.setAppearanceManager(this.appearanceManager),this.stackedStoryListViewModel.showStory(e)}on(e,t){return"update"===e?super.on(e,t):(this.stackedStoryListViewModel.on(e,t),this)}once(e,t){return this.stackedStoryListViewModel.once(e,t),this}off(e,t){return this.stackedStoryListViewModel.off(e,t),this}handleUpdate(e){this.emit("update",{id:e.id,title:e.title,titleColor:e.titleColor,hasAudio:e.hasAudio,hasSwipeUp:e.hasSwipeUp,isOpened:e.isOpened,deeplink:e.deeplink,gameInstanceId:e.gameInstanceId,hideInReader:e.hideInReader,hide_timeline:e.hideTimeline,cover:e.getCover(this.appearanceManager.storiesListOptions.card.coverQuality)})}async loadStories(){await this.storyManager.waitForConfig(),this.stackedStoryListViewModel.loadStories()}}const R=()=>{if(!D.instance)throw new n};class D{constructor(t){return Object.defineProperty(this,"storyManagerConfigDto",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"__IAS_INTERNAL_API__",{enumerable:!0,configurable:!0,writable:!0,value:e.__IAS_INTERNAL_API__}),Object.defineProperty(this,"app",{enumerable:!0,configurable:!0,writable:!0,value:new A(e.storyManager)}),Object.defineProperty(this,"StoriesList",{enumerable:!0,configurable:!0,writable:!0,value:class extends l{constructor(e,t,r){R(),super(e,t,D.instance.app,r)}}}),Object.defineProperty(this,"UGCStoriesList",{enumerable:!0,configurable:!0,writable:!0,value:class extends d{constructor(e,t,r){R(),super(e,t,D.instance.app,r)}}}),Object.defineProperty(this,"SharePage",{enumerable:!0,configurable:!0,writable:!0,value:class extends P{constructor(t,r,n){R(),super(t,r,e.storyManager,D.instance.app,n)}}}),Object.defineProperty(this,"StackedStoryList",{enumerable:!0,configurable:!0,writable:!0,value:class extends k{constructor(t,r){R(),super(t,e.storyManager,D.instance.app,r)}}}),Object.defineProperty(this,"inAppMessaging",{enumerable:!0,configurable:!0,writable:!0,value:e.storyManager.inAppMessaging}),Object.defineProperty(this,"products",{enumerable:!0,configurable:!0,writable:!0,value:e.storyManager.products}),D.instance?(console.warn("StoryManager singleton is created multiple times\nuse IAS.StoryManager.getInstance() instead"),D.instance):(e.storyManager.setUserAgent(`InAppStoryJSSDK/${this.sdkVersionCode}`),D.instance=this,this.app.setStoryManagerConfig(t),D.instance)}get sdkVersionName(){return"3.8.4"}get sdkVersionCode(){return parseInt(30804)}get deviceId(){return e.storyManager.deviceId}get userAgent(){return e.storyManager.userAgent}set storyLinkClickHandler(t){e.storyManager.storyLinkClickHandler=t}set shareHandler(t){e.storyManager.shareHandler=t}static getInstance(){return D.instance?D.instance:null}static use(t,r){t.install({INTERNAL_API:e.__IAS_INTERNAL_API__,HOST:D},r)}getConfig(){return e.storyManager.config}getNonce(){return e.storyManager.getNonce()}async showOnboardingStories(t,r){return R(),this.app.setAppearanceManager(t),e.storyManager.showOnboardingStories(r)}async showStory(t,r,n){R(),this.app.setAppearanceManager(r),await e.storyManager.showStory(t,n)}async showStoryOnce(t,r,n){return R(),this.app.setAppearanceManager(r),e.storyManager.showStoryOnce(t,n)}async showSharePage(t,r,n){return R(),this.app.setAppearanceManager(r),e.storyManager.showSharePage(t,n)}closeAllReaders(){e.storyManager.closeAllReaders()}async openGame(t,r,n={}){return R(),this.app.setAppearanceManager(r),e.storyManager.openGame(t,n)}async closeGame(){return e.storyManager.closeGame()}async closeStoryReader(){return e.storyManager.closeStoryReader()}getUgcEditorConfig(){return e.storyManager.getUgcEditorConfig()}closeGoodsWidget(){e.storyManager.closeGoodsWidget()}setLang(e){this.storyManagerConfigDto.lang=e,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}async setUserId(e,t){R(),this.storyManagerConfigDto.userId=e,this.storyManagerConfigDto.userIdSign=t,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}async userLogoug(){return this.setUserId("")}setOptions(e){R(),this.storyManagerConfigDto.options=e,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}setTags(e){R(),this.storyManagerConfigDto.tags=e,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}setPlaceholders(e){R(),this.storyManagerConfigDto.placeholders=e,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}setImagePlaceholders(e){R(),this.storyManagerConfigDto.imagePlaceholders=e,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}on(t,r){return e.storyManager.on(t,r),this}once(t,r){return e.storyManager.once(t,r),this}off(t,r){return e.storyManager.off(t,r),this}destroy(){null!=D.instance&&(D.instance=null,this.closeAllReaders(),this.app.destroy())}}})(),c})()));
1
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@inappstory/react-sdk"),require("react/jsx-runtime"),require("react-dom/client"),require("react"),require("react-dom"));else if("function"==typeof define&&define.amd)define(["@inappstory/react-sdk","react/jsx-runtime","react-dom/client","react","react-dom"],t);else{var r="object"==typeof exports?t(require("@inappstory/react-sdk"),require("react/jsx-runtime"),require("react-dom/client"),require("react"),require("react-dom")):t(e["@inappstory/react-sdk"],e["react/jsx-runtime"],e["react-dom/client"],e.react,e["react-dom"]);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(self,((e,t,r,n,o)=>(()=>{var a={432:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(935),o=r.n(n)()((function(e){return e[1]}));o.push([e.id,".favorite-story-list-modal--xWjHA{position:fixed;inset:0px;z-index:1090}.favorite-story-list-modal--xWjHA .container--GZBjv{width:100%;height:100%;background:var(--storiesFavoriteBackgroundColor, #333333);display:flex;flex-direction:column;position:relative;overflow-y:auto}.favorite-story-list-modal--xWjHA .header--TjHMD{display:flex;align-content:center;justify-content:center;align-items:center;flex-shrink:0;position:-webkit-sticky;position:sticky;top:0;z-index:100;background:var(--storiesFavoriteTitleBackgroundColor, #333333);box-shadow:0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12),0 1px 3px 0 rgba(0,0,0,.2);padding-top:var(--storiesFavoriteHeaderTopOffset, 0px);margin-bottom:25px}.favorite-story-list-modal--xWjHA .header--TjHMD .title--Dk04x{margin-top:1rem;margin-bottom:1rem;font-size:1.2em;color:var(--storiesFavoriteTitleColor, white);font-family:var(--storiesFavoriteTitleFontFamily);font-weight:normal;font-size:1.4rem;line-height:normal;font:var(--storiesFavoriteTitleFont, normal)}@media(min-width: 640px){.favorite-story-list-modal--xWjHA .header--TjHMD .title--Dk04x{margin-top:25px;margin-bottom:25px}}@media(min-width: 640px){.favorite-story-list-modal--xWjHA .header--TjHMD{margin-bottom:50px}}.favorite-story-list-modal--xWjHA .header__close-btn--Jojm-{border:0;padding:0;background:rgba(0,0,0,0);position:absolute;top:50%;transform:translateY(-50%);z-index:1140;pointer-events:all;cursor:pointer;outline:none;right:10px;width:30px;height:30px;display:flex;justify-content:center;align-items:center}.favorite-story-list-modal--xWjHA .header__close-btn--Jojm-:focus{outline:none}.favorite-story-list-modal--xWjHA .header__close-btn--Jojm- svg{overflow:visible}.favorite-story-list-modal--xWjHA .footer--edEpn{width:100%;height:25px}@media(min-width: 640px){.favorite-story-list-modal--xWjHA .footer--edEpn{height:50px}}.favorite-story-list-modal--xWjHA .bottom-offset--baiTh{position:-webkit-sticky;position:sticky;z-index:100;background:inherit;bottom:0;width:100%;height:var(--storiesFavoriteBottomOffset, 0px)}.favorite-story-list-modal--xWjHA .content--qCPkX{display:flex;justify-content:center;width:100%;padding:0 25px 25px;box-sizing:border-box}.favorite-story-list-modal--xWjHA .content--qCPkX .favorite-story-list--MISMx{width:100%}@media(min-width: 640px){.favorite-story-list-modal--xWjHA .content--qCPkX .favorite-story-list--MISMx{max-width:640px}}@media(min-width: 768px){.favorite-story-list-modal--xWjHA .content--qCPkX .favorite-story-list--MISMx{max-width:768px}}@media(min-width: 1024px){.favorite-story-list-modal--xWjHA .content--qCPkX .favorite-story-list--MISMx{max-width:1024px}}@media(min-width: 1280px){.favorite-story-list-modal--xWjHA .content--qCPkX .favorite-story-list--MISMx{max-width:1280px}}",""]),o.locals={"favorite-story-list-modal":"favorite-story-list-modal--xWjHA",container:"container--GZBjv",header:"header--TjHMD",title:"title--Dk04x","header__close-btn":"header__close-btn--Jojm-",footer:"footer--edEpn","bottom-offset":"bottom-offset--baiTh",content:"content--qCPkX","favorite-story-list":"favorite-story-list--MISMx"};const a=o},935:e=>{"use strict";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 o={};if(n)for(var a=0;a<this.length;a++){var i=this[a][0];null!=i&&(o[i]=!0)}for(var s=0;s<e.length;s++){var c=[].concat(e[s]);n&&o[c[0]]||(r&&(c[2]?c[2]="".concat(r," and ").concat(c[2]):c[2]=r),t.push(c))}},t}},46:e=>{"use strict";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 o=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 o(r){e.removeListener(t,a),n(r)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}g(e,t,a,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&g(e,"error",t,r)}(e,o,{once:!0})}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var i=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function l(e,t,r,n){var o,a,i,l;if(s(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),i=a[t]),void 0===i)i=a[t]=r,++e._eventsCount;else if("function"==typeof i?i=a[t]=n?[r,i]:[i,r]:n?i.unshift(r):i.push(r),(o=c(e))>0&&i.length>o&&!i.warned){i.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=e,d.type=t,d.count=i.length,l=d,console&&console.warn&&console.warn(l)}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 u(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=d.bind(n);return o.listener=r,n.wrapFn=o,o}function p(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]: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}(o):h(o,o.length)}function f(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 h(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function g(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 o(a){n.once&&e.removeEventListener(t,o),r(a)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return i},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");i=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||o(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 c(this)},a.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var o="error"===e,a=this._events;if(void 0!==a)o=o&&void 0===a.error;else if(!o)return!1;if(o){var i;if(t.length>0&&(i=t[0]),i instanceof Error)throw i;var s=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw s.context=i,s}var c=a[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else{var l=c.length,d=h(c,l);for(r=0;r<l;++r)n(d[r],this,t)}return!0},a.prototype.addListener=function(e,t){return l(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return l(this,e,t,!0)},a.prototype.once=function(e,t){return s(t),this.on(e,u(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,u(this,e,t)),this},a.prototype.removeListener=function(e,t){var r,n,o,a,i;if(s(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(o=-1,a=r.length-1;a>=0;a--)if(r[a]===t||r[a].listener===t){i=r[a].listener,o=a;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,i||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 o,a=Object.keys(r);for(n=0;n<a.length;++n)"removeListener"!==(o=a[n])&&this.removeAllListeners(o);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 p(this,e,!0)},a.prototype.rawListeners=function(e){return p(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},a.prototype.listenerCount=f,a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},650:(e,t,r)=>{var n=r(942).Symbol;e.exports=n},379:(e,t,r)=>{var n=r(650),o=r(870),a=r(5),i=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?o(e):a(e)}},967:(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},870:(e,t,r)=>{var n=r(650),o=Object.prototype,a=o.hasOwnProperty,i=o.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=a.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var o=i.call(e);return n&&(t?e[s]=r:delete e[s]),o}},5:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},942:(e,t,r)=>{var n=r(967),o="object"==typeof self&&self&&self.Object===Object&&self,a=n||o||Function("return this")();e.exports=a},655:(e,t,r)=>{var n=r(379),o=r(580);e.exports=function(e){if(!o(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},580:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},591:(e,t,r)=>{"use strict";var n,o=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},a=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]}}(),i=[];function s(e){for(var t=-1,r=0;r<i.length;r++)if(i[r].identifier===e){t=r;break}return t}function c(e,t){for(var r={},n=[],o=0;o<e.length;o++){var a=e[o],c=t.base?a[0]+t.base:a[0],l=r[c]||0,d="".concat(c," ").concat(l);r[c]=l+1;var u=s(d),p={css:a[1],media:a[2],sourceMap:a[3]};-1!==u?(i[u].references++,i[u].updater(p)):i.push({identifier:d,updater:y(p,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 o=r.nc;o&&(n.nonce=o)}if(Object.keys(n).forEach((function(e){t.setAttribute(e,n[e])})),"function"==typeof e.insert)e.insert(t);else{var i=a(e.insert||"head");if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(t)}return t}var d,u=(d=[],function(e,t){return d[e]=t,d.filter(Boolean).join("\n")});function p(e,t,r,n){var o=r?"":n.media?"@media ".concat(n.media," {").concat(n.css,"}"):n.css;if(e.styleSheet)e.styleSheet.cssText=u(t,o);else{var a=document.createTextNode(o),i=e.childNodes;i[t]&&e.removeChild(i[t]),i.length?e.insertBefore(a,i[t]):e.appendChild(a)}}function f(e,t,r){var n=r.css,o=r.media,a=r.sourceMap;if(o?e.setAttribute("media",o):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 h=null,g=0;function y(e,t){var r,n,o;if(t.singleton){var a=g++;r=h||(h=l(t)),n=p.bind(null,r,a,!1),o=p.bind(null,r,a,!0)}else r=l(t),n=f.bind(null,r,t),o=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 o()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=o());var r=c(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 o=s(r[n]);i[o].references--}for(var a=c(e,t),l=0;l<r.length;l++){var d=s(r[l]);0===i[d].references&&(i[d].updater(),i.splice(d,1))}r=a}}}},494:t=>{"use strict";t.exports=e},155:e=>{"use strict";e.exports=n},514:e=>{"use strict";e.exports=o},236:e=>{"use strict";e.exports=r},272:e=>{"use strict";e.exports=t}},i={};function s(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={id:e,exports:{}};return a[e](r,r.exports,s),r.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.nc=void 0;var c={};return(()=>{"use strict";s.r(c),s.d(c,{AppearanceManager:()=>e.AppearanceManager,CloseButtonPosition:()=>e.CloseButtonPosition,GoodsWidgetRenderingType:()=>e.GoodsWidgetRenderingType,IamCheckDisplayTimeRangeError:()=>e.IamCheckDisplayTimeRangeError,IamFrequencyLimitError:()=>e.IamFrequencyLimitError,IamMessageLimitExceededError:()=>e.IamMessageLimitExceededError,IamMessageOpenError:()=>e.IamMessageOpenError,IamNotFoundByEventError:()=>e.IamNotFoundByEventError,IamNotFoundByIdError:()=>e.IamNotFoundByIdError,IamNotFoundLimitError:()=>e.IamNotFoundLimitError,IamOtherReaderIsOpenError:()=>e.IamOtherReaderIsOpenError,IamShowOnlyIfLoadedError:()=>e.IamShowOnlyIfLoadedError,IasNetworkError:()=>e.IasNetworkError,InAppStoryManager:()=>D,StoriesListCardCoverQuality:()=>e.StoriesListCardCoverQuality,StoriesListCardTitlePosition:()=>e.StoriesListCardTitlePosition,StoriesListCardTitleTextAlign:()=>e.StoriesListCardTitleTextAlign,StoriesListCardViewVariant:()=>e.StoriesListCardViewVariant,StoriesListDirection:()=>e.StoriesListDirection,StoryReaderSwipeStyle:()=>e.StoryReaderSwipeStyle});var e=s(494);class t extends Error{constructor(e){super(`Appearance Manager must be an object, but passed ${e.toUpperCase()}. Please check your code.`),this.name="IasAppearanceManagerTypeofError"}}const r=e=>{if(null==e||"object"!=typeof e)throw new t(null==e?"null":typeof e)};class n extends Error{constructor(){super("[IAS]: The <StoryManager> instance has been destroyed, you must create a new instance"),this.name="IasInAppStoryManagerReferenceError"}}class o extends Error{constructor(e){super(`[IAS]: Mount point ${e} is not present in DOM at initialization time`),this.name="IasMountPointReferenceError"}}var a=s(46);class i extends a.EventEmitter{constructor(e,t){super(),Object.defineProperty(this,"_mountSelector",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"app",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_mountPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._mountPoint=this.getMountPoint(e),this.app.addItem(this).catch(console.error)}get mountPoint(){return this._mountPoint}get mountSelector(){return this._mountSelector}destroy(){this.app.removeItem(this)}getMountPoint(e){const t=document.querySelector(e);if(!t)throw new o(e);return t}}class l extends i{constructor(e,t,n,o){super(e,n),Object.defineProperty(this,"_appearanceManager",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"_ugcCardClickHandler",{enumerable:!0,configurable:!0,writable:!0,value:()=>{}}),Object.defineProperty(this,"_api",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),r(t)}get appearanceManager(){return this._appearanceManager}get type(){return e.StoryFeedType.DEFAULT}get identityFields(){return{feedSlug:this.feedSlug}}get feedSlug(){var e;return null===(e=this.params)||void 0===e?void 0:e.feed}get testKey(){var e;return null===(e=this.params)||void 0===e?void 0:e.testKey}get useUgcCard(){var e;return Boolean(null===(e=this.params)||void 0===e?void 0:e.useUgcCard)}set ugcCardClickHandler(e){this._ugcCardClickHandler=e}get ugcCardClickHandler(){return this._ugcCardClickHandler}set api(e){this._api=e}async reload(){var e;return null===(e=this._api)||void 0===e?void 0:e.reload()}}class d extends l{constructor(t,n,o,a){super(t,n,o,{feed:e.UGCFeedSlug,testKey:null==a?void 0:a.testKey,useUgcCard:null==a?void 0:a.useUgcCard}),Object.defineProperty(this,"ugcParams",{enumerable:!0,configurable:!0,writable:!0,value:a}),r(n)}get type(){return e.StoryFeedType.UGC}get filter(){var e;return null===(e=this.ugcParams)||void 0===e?void 0:e.filter}}var u=s(272),p=s(236),f=s(155),h=s(591),g=s.n(h),y=s(432),v={insert:"head",singleton:!1};g()(y.A,v);const m=y.A.locals||{};var b;!function(e){e.LTR="ltr",e.RTL="rtl"}(b||(b={}));const M=({open:t,options:r,storyListOptions:n,onClose:o})=>{var a,i;(0,f.useLayoutEffect)((()=>{if(!t)return;const e=document.documentElement.style.overflow;return document.documentElement.style.overflow="hidden",()=>{document.documentElement.style.overflow=e}}),[t]);return t?(0,u.jsx)("div",{className:m["favorite-story-list-modal"],style:(()=>{var e,t,n,o;return{"--storiesFavoriteTitleColor":r.title.color,"--storiesFavoriteTitleFontFamily":"InternalPrimaryFont","--storiesFavoriteTitleFont":r.title.font,"--storiesFavoriteTitleBackgroundColor":r.title.backgroundColor,"--storiesFavoriteHeaderTopOffset":parseFloat(null!==(t=null===(e=r.headerTopOffset)||void 0===e?void 0:e.toString())&&void 0!==t?t:"0")+"px","--storiesFavoriteBottomOffset":parseFloat(null!==(o=null===(n=r.bottomOffset)||void 0===n?void 0:n.toString())&&void 0!==o?o:"0")+"px","--storiesFavoriteBackgroundColor":r.backgroundColor}})(),children:(0,u.jsxs)("div",{className:m.container,children:[(0,u.jsxs)("div",{className:m.header,children:[(0,u.jsx)("p",{className:m.title,children:r.title.content}),(0,u.jsx)("button",{onClick:e=>{e.preventDefault(),e.stopPropagation(),o()},className:m["header__close-btn"],style:(()=>{var t;const n="start"===r.closeButtonPosition||"left"===r.closeButtonPosition,o=(null===(t=e.storyManager.config)||void 0===t?void 0:t.dir)===b.LTR;return{[n&&o||!n&&!o?"left":"right"]:"10px"}})(),dangerouslySetInnerHTML:{__html:null!==(i=null===(a=r.closeButton)||void 0===a?void 0:a.svgSrc.baseState)&&void 0!==i?i:""}})]}),(0,u.jsx)("div",{className:m.content,children:(0,u.jsx)("div",{className:m["favorite-story-list"],children:(0,u.jsx)(e.FavoriteStoryList,{options:Object.assign(Object.assign(Object.assign({},n),{sidePadding:0}),{direction:e.StoriesListDirection.COLUMN,layout:{height:"auto"}})})})}),(0,u.jsx)("div",{className:m.footer}),(0,u.jsx)("div",{className:m["bottom-offset"]})]})}):null};var S=s(514);const w=e=>{(0,f.useEffect)((()=>{const t=e.mountPoint,r=()=>{console.warn(`[IAS]: The node has been removed from DOM. Unsafe destruction of story feed ${e.mountSelector}`),e.destroy()};if(!document.body.contains(t))return void r();const n=new MutationObserver((()=>{document.body.contains(t)||(r(),n.disconnect())}));return n.observe(document.body,{childList:!0,subtree:!0}),()=>{n.disconnect()}}),[e])};var x;!function(e){e.START_LOADER="startLoad",e.END_LOADER="endLoad"}(x||(x={}));const C=({storyList:t,onStoryCardClick:r,onFavoriteCardClick:n})=>{const[o,a]=(0,f.useState)(t.appearanceManager.storiesListOptions),i=(0,f.useRef)(null);return w(t),(0,f.useEffect)((()=>{t.api=i.current}),[]),(0,f.useEffect)((()=>(t.appearanceManager.on(e.AppearanceManagerEvents.EVENT_UPDATED_STORIES_LIST_OPTIONS,a),()=>{t.appearanceManager.off(e.AppearanceManagerEvents.EVENT_UPDATED_STORIES_LIST_OPTIONS,a)})),[t.appearanceManager]),(0,S.createPortal)((0,u.jsx)(e.StoryList,{ref:i,options:o,hasFavorite:t.appearanceManager.commonOptions.hasFavorite,testKey:t.testKey,useUgcCard:t.useUgcCard,feedSlug:t.feedSlug,onLoadStart:()=>{t.emit(x.START_LOADER)},onLoadEnd:e=>{t.emit(x.END_LOADER,e)},onUgcCardClick:()=>{t.ugcCardClickHandler()},onFavoriteCardClick:n,onStoryCardClick:r}),t.mountPoint)};var L;!function(e){e.START_LOADER="startLoad",e.END_LOADER="endLoad"}(L||(L={}));const O=({ugcStoryList:t,onStoryCardClick:r})=>{const[n,o]=(0,f.useState)(t.appearanceManager.storiesListOptions),a=(0,f.useRef)(null);return w(t),(0,f.useEffect)((()=>{t.api=a.current}),[]),(0,f.useEffect)((()=>(t.appearanceManager.on(e.AppearanceManagerEvents.EVENT_UPDATED_STORIES_LIST_OPTIONS,o),()=>{t.appearanceManager.off(e.AppearanceManagerEvents.EVENT_UPDATED_STORIES_LIST_OPTIONS,o)})),[t.appearanceManager]),(0,S.createPortal)((0,u.jsx)(e.UGCStoryList,{ref:a,options:n,filter:t.filter,testKey:t.testKey,useUgcCard:t.useUgcCard,onStoryCardClick:r,onLoadStart:()=>{t.emit(L.START_LOADER)},onLoadEnd:e=>{t.emit(L.END_LOADER,e)},onUgcCardClick:()=>{t.ugcCardClickHandler()}}),t.mountPoint)},E=t=>{const[r,n]=(0,f.useState)(!1);return(0,u.jsxs)(e.IASContainer,{config:t.storyManagerConfigDto,storyReaderOptions:t.appearanceManager.storyReaderOptions,commonOptions:t.appearanceManager.commonOptions,gameReaderOptions:t.appearanceManager.gameReaderOptions,goodsWidgetOptions:t.appearanceManager.goodsWidgetOptions,children:[t.items.map((e=>e instanceof d?(0,u.jsx)(O,{ugcStoryList:e,onStoryCardClick:()=>{t.onAppearanceManagerChange(e.appearanceManager)}},e.mountSelector):e instanceof l?(0,u.jsx)(C,{onFavoriteCardClick:()=>{n(!0)},onStoryCardClick:()=>{t.onAppearanceManagerChange(e.appearanceManager)},storyList:e},e.mountSelector):void 0)),(0,u.jsx)(M,{open:r,onClose:()=>n(!1),options:t.appearanceManager.storyFavoriteReaderOptions,storyListOptions:t.appearanceManager.storiesListOptions})]})};class j{constructor(){Object.defineProperty(this,"_items",{enumerable:!0,configurable:!0,writable:!0,value:[]})}get items(){return this._items}addItem(e){this._items.push(e)}removeItem(e){const t=this._items.findIndex((t=>t===e));-1!==t&&this._items.splice(t,1)}destroy(){this._items=[]}}class A{constructor(t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"root",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"storyManagerConfigDto",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"appearanceManager",{enumerable:!0,configurable:!0,writable:!0,value:new e.AppearanceManager}),Object.defineProperty(this,"rootElement",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"appItemManager",{enumerable:!0,configurable:!0,writable:!0,value:new j}),this.createAppRoot(),this.handleAppearanceManagerUpdate=this.handleAppearanceManagerUpdate.bind(this),this.setAppearanceManager=this.setAppearanceManager.bind(this)}async addItem(e){try{this.appItemManager.addItem(e),await this.storyManager.waitForConfig(),this.render()}catch(t){throw this.removeItem(e),t}}async removeItem(e){this.appItemManager.removeItem(e),this.render()}setStoryManagerConfig(e){this.storyManagerConfigDto=Object.assign(Object.assign({},this.storyManagerConfigDto),e),this.render()}setAppearanceManager(e){r(e),this.unscubscribeToAppearanceManagerEvents(),this.appearanceManager=e,this.subscribeToAppearanceManagerEvents(),this.render()}render(){var e;null===(e=this.root)||void 0===e||e.render((0,u.jsx)(E,{storyManagerConfigDto:this.storyManagerConfigDto,appearanceManager:this.appearanceManager,items:this.appItemManager.items.slice(),onAppearanceManagerChange:this.setAppearanceManager}))}destroy(){this.rootElement&&this.root&&(this.appItemManager.destroy(),this.unscubscribeToAppearanceManagerEvents(),this.root.unmount(),document.body.removeChild(this.rootElement),this.rootElement=null,this.root=null)}createAppRoot(){this.rootElement=document.createElement("div"),this.rootElement.id="ias-app",document.body.append(this.rootElement),this.root=(0,p.createRoot)(this.rootElement)}subscribeToAppearanceManagerEvents(){this.appearanceManager.on(e.AppearanceManagerEvents.UPDATE,this.handleAppearanceManagerUpdate)}unscubscribeToAppearanceManagerEvents(){this.appearanceManager.off(e.AppearanceManagerEvents.UPDATE,this.handleAppearanceManagerUpdate)}handleAppearanceManagerUpdate(){this.render()}}var _,I=s(655),T=s.n(I);!function(e){e.START_LOADING="startLoading",e.END_LOADING="endLoading",e.CLOSE_STORY_READER="closeStoryReader"}(_||(_={}));class P extends a.EventEmitter{constructor(e,t,n,o,a){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"app",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:a}),r(t),this.handleCloseStoryReader=this.handleCloseStoryReader.bind(this),this.showSharePage(e,t)}async showSharePage(e,t){try{this.app.setAppearanceManager(t),this.handleStartLoad(),await this.storyManager.showSharePage(e),this.storyManager.once("closeStoryReader",this.handleCloseStoryReader),this.handleEndLoad(!0)}catch(e){this.handleEndLoad(!1)}}async closeStoryReader(){this.storyManager.closeStoryReader()}handleStartLoad(){setTimeout((()=>{var e;this.emit(_.START_LOADING),T()(null===(e=this.options)||void 0===e?void 0:e.handleStartLoad)&&this.options.handleStartLoad()}))}handleEndLoad(e){var t;this.emit(_.END_LOADING,{result:e}),T()(null===(t=this.options)||void 0===t?void 0:t.handleStopLoad)&&this.options.handleStopLoad(e)}handleCloseStoryReader(){var e,t,r;if(T()(null===(e=this.options)||void 0===e?void 0:e.handleStoryReaderClose)||this.listenerCount(_.CLOSE_STORY_READER)>0)try{T()(null===(t=this.options)||void 0===t?void 0:t.handleStoryReaderClose)&&(null===(r=this.options)||void 0===r||r.handleStoryReaderClose()),this.emit(_.CLOSE_STORY_READER)}catch(e){console.error(e)}else{const e=window.location;window.open(`${e.protocol}//${e.host}`,"_parent")}}}class k extends a.EventEmitter{constructor(t,n,o,a){super(),Object.defineProperty(this,"appearanceManager",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"app",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"stackedStoryListViewModel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),r(t),this.handleUpdate=this.handleUpdate.bind(this),this.stackedStoryListViewModel=new e.StackedStoryListViewModel(this.options),this.stackedStoryListViewModel.on("update",this.handleUpdate),this.loadStories().catch(console.error)}get stories(){return this.stackedStoryListViewModel.stories}get length(){return this.stackedStoryListViewModel.length}get activeIndex(){return this.stackedStoryListViewModel.activeIndex}get feedCoverSrc(){return this.stackedStoryListViewModel.feedCoverSrc}get top(){return this.stackedStoryListViewModel.top}async reload(){return this.stackedStoryListViewModel.reload()}destroy(){this.stackedStoryListViewModel.destroy(),this.stackedStoryListViewModel.removeAllListeners()}showStory(e){this.app.setAppearanceManager(this.appearanceManager),this.stackedStoryListViewModel.showStory(e)}on(e,t){return"update"===e?super.on(e,t):(this.stackedStoryListViewModel.on(e,t),this)}once(e,t){return this.stackedStoryListViewModel.once(e,t),this}off(e,t){return this.stackedStoryListViewModel.off(e,t),this}handleUpdate(e){this.emit("update",{id:e.id,title:e.title,titleColor:e.titleColor,hasAudio:e.hasAudio,hasSwipeUp:e.hasSwipeUp,isOpened:e.isOpened,deeplink:e.deeplink,gameInstanceId:e.gameInstanceId,hideInReader:e.hideInReader,hide_timeline:e.hideTimeline,cover:e.getCover(this.appearanceManager.storiesListOptions.card.coverQuality)})}async loadStories(){await this.storyManager.waitForConfig(),this.stackedStoryListViewModel.loadStories()}}const R=()=>{if(!D.instance)throw new n};class D{constructor(t){return Object.defineProperty(this,"storyManagerConfigDto",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"__IAS_INTERNAL_API__",{enumerable:!0,configurable:!0,writable:!0,value:e.__IAS_INTERNAL_API__}),Object.defineProperty(this,"app",{enumerable:!0,configurable:!0,writable:!0,value:new A(e.storyManager)}),Object.defineProperty(this,"StoriesList",{enumerable:!0,configurable:!0,writable:!0,value:class extends l{constructor(e,t,r){R(),super(e,t,D.instance.app,r)}}}),Object.defineProperty(this,"UGCStoriesList",{enumerable:!0,configurable:!0,writable:!0,value:class extends d{constructor(e,t,r){R(),super(e,t,D.instance.app,r)}}}),Object.defineProperty(this,"SharePage",{enumerable:!0,configurable:!0,writable:!0,value:class extends P{constructor(t,r,n){R(),super(t,r,e.storyManager,D.instance.app,n)}}}),Object.defineProperty(this,"StackedStoryList",{enumerable:!0,configurable:!0,writable:!0,value:class extends k{constructor(t,r){R(),super(t,e.storyManager,D.instance.app,r)}}}),Object.defineProperty(this,"inAppMessaging",{enumerable:!0,configurable:!0,writable:!0,value:e.storyManager.inAppMessaging}),Object.defineProperty(this,"products",{enumerable:!0,configurable:!0,writable:!0,value:e.storyManager.products}),D.instance?(console.warn("StoryManager singleton is created multiple times\nuse IAS.StoryManager.getInstance() instead"),D.instance):(e.storyManager.setUserAgent(`InAppStoryJSSDK/${this.sdkVersionCode}`),D.instance=this,this.app.setStoryManagerConfig(t),D.instance)}get sdkVersionName(){return"3.8.5"}get sdkVersionCode(){return parseInt(30805)}get deviceId(){return e.storyManager.deviceId}get userAgent(){return e.storyManager.userAgent}set storyLinkClickHandler(t){e.storyManager.storyLinkClickHandler=t}set shareHandler(t){e.storyManager.shareHandler=t}static getInstance(){return D.instance?D.instance:null}static use(t,r){t.install({INTERNAL_API:e.__IAS_INTERNAL_API__,HOST:D},r)}getConfig(){return e.storyManager.config}getNonce(){return e.storyManager.getNonce()}async showOnboardingStories(t,r){return R(),this.app.setAppearanceManager(t),e.storyManager.showOnboardingStories(r)}async showStory(t,r,n){R(),this.app.setAppearanceManager(r),await e.storyManager.showStory(t,n)}async showStoryOnce(t,r,n){return R(),this.app.setAppearanceManager(r),e.storyManager.showStoryOnce(t,n)}async showSharePage(t,r,n){return R(),this.app.setAppearanceManager(r),e.storyManager.showSharePage(t,n)}closeAllReaders(){e.storyManager.closeAllReaders()}async openGame(t,r,n={}){return R(),this.app.setAppearanceManager(r),e.storyManager.openGame(t,n)}async closeGame(){return e.storyManager.closeGame()}async closeStoryReader(){return e.storyManager.closeStoryReader()}getUgcEditorConfig(){return e.storyManager.getUgcEditorConfig()}closeGoodsWidget(){e.storyManager.closeGoodsWidget()}setLang(e){this.storyManagerConfigDto.lang=e,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}async setUserId(e,t){R(),this.storyManagerConfigDto.userId=e,this.storyManagerConfigDto.userIdSign=t,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}async userLogoug(){return this.setUserId("")}setOptions(e){R(),this.storyManagerConfigDto.options=e,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}setTags(e){R(),this.storyManagerConfigDto.tags=e,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}setPlaceholders(e){R(),this.storyManagerConfigDto.placeholders=e,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}setImagePlaceholders(e){R(),this.storyManagerConfigDto.imagePlaceholders=e,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}on(t,r){return e.storyManager.on(t,r),this}once(t,r){return e.storyManager.once(t,r),this}off(t,r){return e.storyManager.off(t,r),this}destroy(){null!=D.instance&&(D.instance=null,this.closeAllReaders(),this.app.destroy())}}})(),c})()));
@@ -153,15 +153,6 @@ export interface CloseGameEvent {
153
153
  /** Game ID */
154
154
  id: string;
155
155
  }
156
-
157
- /** Event: mini-game finished */
158
- export interface FinishGameEvent {
159
- /** Game ID */
160
- id: string;
161
- /** Game result */
162
- result: Record<string, any>;
163
- }
164
-
165
156
  /** Generic game event */
166
157
  export interface EventGameEvent {
167
158
  /** Event name */
@@ -215,8 +206,6 @@ export interface StoryManagerEvents {
215
206
  startGame: StartGameEvent;
216
207
  /** Game closed */
217
208
  closeGame: CloseGameEvent;
218
- /** Game finished */
219
- finishGame: FinishGameEvent;
220
209
  /** Custom game event */
221
210
  eventGame: EventGameEvent;
222
211
  /** Close story reader event */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inappstory/js-sdk",
3
- "version": "3.8.4",
3
+ "version": "3.8.5",
4
4
  "description": "JS SDK",
5
5
  "keywords": [
6
6
  "stories",
@@ -58,7 +58,7 @@
58
58
  "Samsung >= 5"
59
59
  ],
60
60
  "dependencies": {
61
- "@inappstory/react-sdk": "^1.9.4",
61
+ "@inappstory/react-sdk": "^1.9.5",
62
62
  "react": "^18.2.0",
63
63
  "react-dom": "^18.2.0"
64
64
  },
@@ -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,".bnr---mqC-{width:100%;height:100%;position:relative;backface-visibility:hidden;transform:translateZ(0);clip-path:inset(0 round var(--ias-banner-border-radius, 0px))}.bnr-slides--Oc1j-{position:relative;width:100%;height:100%;display:block}",""]),i.locals={bnr:"bnr---mqC-","bnr-slides":"bnr-slides--Oc1j-"};const a=i},243:(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,".bnr-place--GbC1J{width:100%;height:100%;position:relative;border-radius:var(--ias-bnr-place-border-radius, 0px)}.bnr-slider__slider_visible--LrMXv{border:solid 1px green}",""]),i.locals={"bnr-place":"bnr-place--GbC1J","bnr-slider__slider_visible":"bnr-slider__slider_visible--LrMXv"};const a=i},883:(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,".bnr-place--Dj\\+2-{width:100%;height:100%;display:flex;flex-direction:column;position:relative}",""]),i.locals={"bnr-place":"bnr-place--Dj+2-"};const a=i},713:(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,".bnr-place--1RkrK{width:100%;height:100%;position:relative}",""]),i.locals={"bnr-place":"bnr-place--1RkrK"};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;user-select:none;border-radius:inherit}.slider__track--JSOcI{display:flex;transition:transform .3s ease;width:100%;height:100%;will-change:transform}.slider__slide--oGmUT{width:100%;flex-shrink:0;position:relative;display:flex}.slider--vertical--qUwAP .slider__track--JSOcI{flex-direction:column}.slider--vertical--qUwAP .slider__slide--oGmUT{justify-content:center}",""]),i.locals={slider:"slider--ggy2P",slider__track:"slider__track--JSOcI",slider__slide:"slider__slide--oGmUT","slider--vertical":"slider--vertical--qUwAP"};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:1.5rem;height:1.5rem;transform:translate3d(0, -50%, 0);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--start--uVL4-{left:1.5rem}.slider__controls-btn--end--fV\\+p9{right:1.5rem}.slider__controls--CjPin.slider__controls--vertical--5wOuK .slider__controls-btn--HubN5{top:auto;left:50%;transform:translate3d(-50%, 0, 0)}.slider__controls--CjPin.slider__controls--vertical--5wOuK .slider__controls-btn--start--uVL4-{top:0;transform:rotate(90deg)}.slider__controls--CjPin.slider__controls--vertical--5wOuK .slider__controls-btn--end--fV\\+p9{bottom:0;transform:rotate(90deg)}.slider__controls--CjPin:not(.slider__controls--vertical--5wOuK) .slider__controls-btn--start--uVL4-.slider__controls-btn--dir--rtl--ICofD{left:auto;right:0;transform:translate3d(0, -50%, 0) rotate(180deg)}.slider__controls--CjPin:not(.slider__controls--vertical--5wOuK) .slider__controls-btn--end--fV\\+p9.slider__controls-btn--dir--rtl--ICofD{left:0;right:auto;transform:translate3d(0, -50%, 0) rotate(180deg)}.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--start":"slider__controls-btn--start--uVL4-","slider__controls-btn--end":"slider__controls-btn--end--fV+p9",slider__controls:"slider__controls--CjPin","slider__controls--vertical":"slider__controls--vertical--5wOuK","slider__controls-btn--dir--rtl":"slider__controls-btn--dir--rtl--ICofD","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:var(--ias-banners-pagination-inactive-color, hsla(0, 0%, 100%, 0.5));width:var(--ias-banners-pagination-width, 0.5rem);height:var(--ias-banners-pagination-height, 0.5rem);padding:0;border-radius:50%;border:.25rem 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)}.slider-bullets--XDc5n.slider-bullets--vertical--QuatQ{transform:translate3d(0, -50%, 0);left:auto;bottom:auto;right:1.5rem;top:50%;display:flex;flex-direction:column}.slider-bullets--XDc5n.slider-bullets--vertical--QuatQ .slider-bullets__bullet--83aBh{margin:.25em 0}",""]),i.locals={"slider-bullets":"slider-bullets--XDc5n","slider-bullets__bullet":"slider-bullets__bullet--83aBh","slider-bullets__bullet--active":"slider-bullets__bullet--active--RDBez","slider-bullets--vertical":"slider-bullets--vertical--QuatQ"};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:1;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,{AF:()=>Ce,M6:()=>ze,RE:()=>Ce,Sr:()=>Be,YL:()=>lr,Ay:()=>cr}),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})({forwardRef:()=>t.forwardRef,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 w=d(81);b()(w.A,{insert:"head",singleton:!1});const y=w.A.locals||{},_=(e=>{var t={};return d.d(t,e),t})({default:()=>n.default}),P=({onClick:e,className:t})=>(0,l.jsx)("div",{className:(0,_.default)(y.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"})})}),S=(0,u.observer)((e=>{const t=e.needShowErrorScreen,r=e.needShowLoaderScreen;return r||t?(0,l.jsx)("div",{className:(0,_.default)(g.loader),style:Object.assign({"--loader-background":e.background,"--loaderBackgroundColor":e.color},e.style),onClick:e=>{e.preventDefault()},children:t?(0,l.jsx)(P,{className:g["loader__refresh-btn"],onClick:t=>{t.stopPropagation(),e.onReload()}}):r&&(0,l.jsx)("div",{className:g.loader__spinner})}):null})),T=()=>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}))}})}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",T()),this.styleElement=r,null===(t=this.shadowRoot)||void 0===t||t.prepend(r)}async init(e){this.mountPoint&&(this.banner=e,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 E(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("bnr-slides-container")||customElements.define("bnr-slides-container",x);const O=(0,u.observer)((0,c.forwardRef)(((e,t)=>{var{banner:r,direction:n="row"}=e,i=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","direction"]);const a=(0,c.useRef)(null),s=r.canBeShown;(0,c.useLayoutEffect)((()=>{a.current&&a.current.setStyle(r.context.style)}),[r.context.style]),(0,c.useLayoutEffect)((()=>{if(!a.current)return;const e=a.current;return e.init(r),()=>{e.destroy()}}),[r]),(0,c.useEffect)((()=>{if(i.isActive&&s)return r.start(),()=>{r.stop()}}),[r,i.isActive,s]);const o="row"===n?{height:`${Math.ceil(r.width/r.contentRatio)}px`}:{width:`${Math.ceil(r.height*r.contentRatio)}px`};return(0,l.jsxs)("div",{className:(0,_.default)(m.bnr,"ias-bnr",i.className),ref:t,style:Object.assign(Object.assign({},o),{background:r.appearance.background,"--ias-banner-border-radius":`${i.clientAppearance.borderRadius}px`}),children:[(0,l.jsx)("bnr-slides-container",{style:{opacity:s?1:0},class:m["bnr-slides"],ref:a,"allow-click":i.allowClick.toString(),dir:r.dir}),(0,l.jsx)(S,{needShowErrorScreen:r.needShowErrorScreen,needShowLoaderScreen:r.needShowLoaderScreen,onReload:async()=>{r.activeSlide.restart()},background:r.appearance.background,color:E(r.appearance.background)?"black":"white"})]})})));var j=d(243);b()(j.A,{insert:"head",singleton:!1});const I=j.A.locals||{};var C=d(55);b()(C.A,{insert:"head",singleton:!1});const L=C.A.locals||{},k=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",{dir:e.langDirection,className:(0,_.default)(L["slider-bullets"],{[L["slider-bullets--vertical"]]:"column"===e.direction},"ias-bnr-bullets"),children:Array.from({length:e.totalPages}).map(((t,n)=>(0,l.jsx)("div",{className:(0,_.default)("ias-bnr__bullet",L["slider-bullets__bullet"],{[L["slider-bullets__bullet--active"]]:n===e.activeIndex,"ias-bnr__bullet--active":n===e.activeIndex}),onClick:()=>(t=>{r(t),e.onClick(t)})(n)},n)))})};var A=d(41);b()(A.A,{insert:"head",singleton:!1});const B=A.A.locals||{};var M=d(379);b()(M.A,{insert:"head",singleton:!1});const R=M.A.locals||{},D=e=>(0,l.jsxs)("div",{className:(0,_.default)(R.slider__controls,{[R["slider__controls--vertical"]]:"column"===e.direction}),children:[(0,l.jsx)("button",{onClick:e.onPrevClick,className:(0,_.default)("ias-bnr__controls-btn","ias-bnr__controls-btn--prev","ias-bnr__controls-btn--start",R["slider__controls-btn"],R["slider__controls-btn--start"],{[R["slider__controls-btn--disabled"]]:e.prevDisabled,[R["slider__controls-btn--dir--rtl"]]:"rtl"===e.langDirection,"ias-bnr__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-bnr__controls-btn","ias-bnr__controls-btn--next","ias-bnr__controls-btn--end",R["slider__controls-btn"],R["slider__controls-btn--end"],{[R["slider__controls-btn--disabled"]]:e.nextDisabled,[R["slider__controls-btn--dir--rtl"]]:"rtl"===e.langDirection,"ias-bnr__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 N{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 z;!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",e.AutoplayTimerTick="autoplayTimerTick"}(z||(z={}));class W{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,"startPosition",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"startTranslate",{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=>{if(this.slider.animating||!this._enabled)return;e.stopPropagation();const{startPosition:t,startTranslate:r}=this.getTouchStartState(e);this.startPosition=t,this.startTranslate=r,this.isTouched=!0,this.setGrabCursor(!1),this.slider.autoplay.pause()}}),Object.defineProperty(this,"onTouchMove",{enumerable:!0,configurable:!0,writable:!0,value:e=>{if(!this.isTouched)return;e.stopPropagation();const t=this.getTouchDiff(e);if(!(Math.abs(t)>20||this._isMoved))return;this.setGrabCursor(!0),this._isMoved||(this.slider.emit(z.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(z.TouchMove);let n=this.startTranslate+t+r;this.applyLoopFix(n),n=this.startTranslate+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(z.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}enable(){this._enabled=!0}disable(){this._enabled=!1}enableHorizontalSwipeGesture(){this._enabled=!0}disableHorizontalSwipeGesture(){this._enabled=!1}enableVerticalSwipeGesture(){this._enabled=!0}disableVerticalSwipeGesture(){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)}getTouchStartState(e){let t=0,r=0;return"row"===this.slider.options.direction?(t=e instanceof MouseEvent?e.pageX:e.touches[0].clientX,r=this.slider.currentTranslateX):(t=e instanceof MouseEvent?e.pageY:e.touches[0].clientY,r=this.slider.currentTranslateY),{startPosition:t,startTranslate:r}}getTouchDiff(e){let t=0;return"row"===this.slider.options.direction?(t=(e instanceof MouseEvent?e.pageX:e.touches[0].clientX)-this.startPosition,t*=1):(t=(e instanceof MouseEvent?e.pageY:e.touches[0].clientY)-this.startPosition,t*=1),t}setTranslate(e){e=this.applyEdgeResistance(e),this.slider.setTranslate(e)}applyLoopFix(e){if(!this.loopModule.enabled)return;e=this.slider.langDirSign*-e;const t=this.slider.langDirSign*(this.slider.slideSize+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.startTranslate-=t):e>n&&this.loopModule.applyLoopFix({targetIndex:this.slider.slides.length-this.slider.options.slidesPerView,direction:"next"})&&(this.startTranslate+=t)}updateActiveIndex(){if(!this.slider.slides.length)return;const{currentTranslate:e,options:t}=this.slider,r=this.slider.slideSize+t.spaceBetween;let n=this.slider.langDirSign*-Math.round(e/r);const i=this.slider.totalPages-1;n=Math.min(i,Math.max(0,n)),this.slider.slideTo(n)}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.slideSize),1);return.3+.7*Math.exp(3*-t)}applyEdgeResistance(e){if(this.loopModule.enabled)return e;const t=this.slider.langDirSign,r=-t*e,n=this.slider.getMinTranslate(),i=this.slider.getMaxTranslate();let a=r;if(a>i){const e=a-i;a=i+e*this.getResistanceCoeff(e)}else if(a<n){const e=n-a;a=n-e*this.getResistanceCoeff(e)}return-t*a}getSwipeDirection(e){return this.slider.langDirSign*e>0?"prev":"next"}}var F,V=d(46);!function(e){e.Start="start",e.Stop="stop",e.Pause="pause",e.Resume="resume",e.Progress="progress",e.Complete="complete"}(F||(F={}));class U extends V.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(F.Start),this.setTimer(e)))}restart(){this.stop(),this.start(this.timeout)}stop(){this.isCompleted||(this.clearTimer(),this.emit(F.Stop),this.isCompleted=!0,this.timerPaused=!1)}pause(){this.isCompleted||(this.timerPaused=!0,this.clearTimer(),this.progressBeforePause=this.currentProgress,this.emit(F.Pause))}resume(){if(!this.timerPaused)return;this.timerPaused=!1;const e=1-this.progressBeforePause,t=this.timeout*e;this.setTimer(t),this.emit(F.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(F.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(F.Progress,{percents:r,totalTime:this.timeout,currentTime:this.currentProgress*this.timeout})}runTimerTicks(e){const t=performance.now(),r=n=>{let i=(n-t)/e;i>1&&(i=1);const a=i;this.updateProgress(a),i<1&&(this.rafId=requestAnimationFrame(r))};this.rafId=requestAnimationFrame(r)}}class q{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 U}),Object.defineProperty(this,"delay",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"handleTimerComplete",{enumerable:!0,configurable:!0,writable:!0,value:({forceEnd:e})=>{e||this.slider.emit(z.AutoplayTimeLeft)}}),Object.defineProperty(this,"handleTimerProgress",{enumerable:!0,configurable:!0,writable:!0,value:e=>{this.slider.emit(z.AutoplayTimerTick,{currentTime:e.currentTime,totalTime:e.totalTime,percents:e.percents})}}),this.timer.on(F.Complete,this.handleTimerComplete),this.timer.on(F.Progress,this.handleTimerProgress)}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(F.Complete,this.handleTimerComplete),this.timer.off(F.Progress,this.handleTimerProgress),this.stop()}}class H extends V.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,direction:"row",langDirection:"ltr",allowTouchMove:!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,"_currentTranslateY",{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,"_slideHeight",{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(z.Resize)}}),this.track=e,this.container=e.parentElement,this.loopModule=new N(this),this.touchModule=new W(this,this.loopModule),this.autoplay=new q(this,this.loopModule),this.options.updateOnWindowResize&&window.addEventListener("resize",this.handleResize),this.collectSlides(),this.update(t)}get langDirSign(){return"column"===this.options.direction||"ltr"===this.options.langDirection?1:-1}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 currentTranslateY(){return this._currentTranslateY}get currentTranslate(){return"row"===this.options.direction?this._currentTranslateX:this._currentTranslateY}get isMoved(){return this.touchModule.isMoved}get slideWidth(){return this._slideWidth}get slideHeight(){return this._slideHeight}get slideSize(){return"row"===this.options.direction?this.slideWidth:this.slideHeight}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(),this.updateSize(),this.loopModule.update(),this.testAttraction(),this.options.allowTouchMove?this.touchModule.enable():this.touchModule.disable()}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 Math.abs(this.getSlideOffset(this.totalPages-1))}setTranslate(e){"row"===this.options.direction?(this.track.style.transform=`translate3d(${e}px, 0px, 0px)`,this._currentTranslateX=e,this._currentTranslateY=0):(this.track.style.transform=`translate3d(0px, ${e}px, 0px)`,this._currentTranslateX=0,this._currentTranslateY=e),this.testAttraction()}enableHorizontalSwipeGesture(){this.touchModule.enableHorizontalSwipeGesture()}disableHorizontalSwipeGesture(){this.touchModule.disableHorizontalSwipeGesture()}getSlideOffset(e){return this.slides.length?-e*(("row"===this.options.direction?this.slides[0].clientWidth:this.slides[0].clientHeight)+this.options.spaceBetween):0}updateSize(){const e=this.slideWidth,t=this.slideHeight;"row"===this.options.direction?this.calculateSlideWidths():this.calculateSlideHeight(),e===this.slideWidth&&t===this.slideHeight||this.emit(z.SlidesUpdated),this.slideTo(this._activeIndex,0)}getTrackWidth(){return this.track.clientWidth-this.options.spaceBetween*(this.options.slidesPerView-1)}getTrackHeight(){return this.track.clientHeight-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(z.RealIndexChnage,t),n!==e&&this.emit(z.ActiveIndexChange,e)}setupTrackStyles(){Object.assign(this.track.style,{display:"flex",transition:`transform ${this.options.speed}ms ease`,gap:`${this.options.spaceBetween}px`})}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`,e.style.height=""}))}calculateSlideHeight(){this._slideHeight=Math.ceil(this.getTrackHeight()/this.options.slidesPerView),this.slides.forEach((e=>{e.style.height=`${this._slideHeight}px`,e.style.width=""}))}translateSlidesTrack(e,t){this.track.style.transitionDuration=`${t}ms`,this.setTranslate(this.langDirSign*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(z.TransitionStart),await this.waitTransitionEnd(),this.emit(z.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();let r=!this.loopModule.enabled&&this.langDirSign*this.currentTranslate>=e,n=!this.loopModule.enabled&&this.langDirSign*-this.currentTranslate>=t;this.options.slidesPerView===this.slides.length&&(r=!0,n=!0),r!==this._reachStart&&(this._reachStart=r,this.emit(z.ReachStart,r)),n!==this._reachEnd&&(this._reachEnd=n,this.emit(z.ReachEnd,n))}normalizeOptions(e){var t,r,n,i,a,s,o,l,c,d,h;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,direction:null!==(c=e.direction)&&void 0!==c?c:this.options.direction,allowTouchMove:null!==(d=e.allowTouchMove)&&void 0!==d?d:this.options.allowTouchMove,langDirection:null!==(h=e.langDirection)&&void 0!==h?h:this.options.langDirection}}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 $=(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 H(n.current,{autoplay:e.autoplay,speed:e.speed,loop:e.loop,slidesPerView:e.slidesPerView,spaceBetween:e.spaceBetween,allowTouchMove:e.allowTouchMove,direction:e.direction,langDirection:e.langDirection});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,allowTouchMove:e.allowTouchMove,direction:e.direction,langDirection:e.langDirection})}),[t,e.autoplay,e.speed,e.loop,e.langDirection,e.slidesPerView,e.spaceBetween,e.slidesCount,e.allowTouchMove,e.direction]),(0,l.jsxs)("div",{className:(0,_.default)("ias-bnr-slider",B.slider,{[B["slider--vertical"]]:"column"===e.direction}),children:[(0,l.jsx)("div",{dir:e.langDirection,ref:n,className:(0,_.default)("ias-bnr-slider__track",B.slider__track),children:e.children}),t&&e.pagination.enabled&&(0,l.jsx)(k,{direction:e.direction,langDirection:e.langDirection,totalPages:t.totalPages,activeIndex:t.realIndex,onClick:r=>{e.loop?t.slideToLoop(r):t.slideTo(r)}}),t&&e.navigation.enabled&&(0,l.jsx)(D,{direction:e.direction,langDirection:e.langDirection,onPrevClick:()=>{t.toPrevSlide()},onNextClick:()=>{t.toNextSlide()},nextDisabled:t.reachEnd,prevDisabled:t.reachStart})]})})),G=e=>(0,l.jsx)("div",{className:(0,_.default)(B.slider__slide,e.className),style:e.style,children:e.children});class X{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 Y{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 X(this.slider)})}getTotalPages(){return this.slider.totalPages}getActiveIndex(){return this.slider.realIndex}toNextSlide(){this.slider.isMoved||this.slider.toNextSlide()}toPrevSlide(){this.slider.isMoved||this.slider.toPrevSlide()}slideTo(e,t){this.slider.isMoved||this.slider.slideToLoop(e,t)}enableHorizontalSwipeGesture(){this.slider.enableHorizontalSwipeGesture()}disableHorizontalSwipeGesture(){this.slider.disableHorizontalSwipeGesture()}updateSize(){this.slider.updateSize()}}const Q=(e=>{var t={};return d.d(t,e),t})({action:()=>i.action,computed:()=>i.computed,observable:()=>i.observable,reaction:()=>i.reaction});var K=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 J=(()=>{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,K(this,n,void 0)),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:K(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(){const e=Math.trunc(Date.now()/1e3);return(!this.displayFrom||e>=this.displayFrom)&&(!this.displayTo||e<=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=[Q.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 Z{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 ee{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 te(e,t,r){return String(e).replace(new RegExp(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(t),"g"),(()=>r))}var re=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 ne=(()=>{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}get payload(){return this._payload}constructor(e){t.set(this,re(this,n,void 0)),Object.defineProperty(this,"_payload",{enumerable:!0,configurable:!0,writable:!0,value:re(this,i)}),this._html=this.replaceSlideNonce(e.html),this._payload=e.payload}updatePlaceholders(e){let t=this._html;for(const r of e)t=te(t,`%${r.key}%`,r.value);this._html=t}replaceSlideNonce(e){var t;return te(e,"{{nonce}}",null!==(t=T())&&void 0!==t?t:"")}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[Q.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 ie=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 ae=(()=>{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,ie(this,n,[])),ie(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=[Q.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 se=(e,t)=>{if("number"==typeof e)return e;if("string"==typeof e){const t=parseFloat(e);if(!isNaN(t))return t}return t};var oe=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},le=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},ce=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)},de=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 he=(()=>{var e,t;let r,n=[],i=[];return e=class{get borderRadius(){return ce(this,t,"f")}set borderRadius(e){de(this,t,e,"f")}update(e){this.borderRadius=se(null==e?void 0:e.borderRadius,this.borderRadius)}constructor(){t.set(this,le(this,n,12)),le(this,i)}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[Q.observable],oe(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})(),ue=(()=>{var e,t,r,n,i,a,s,o,l,c;let d,h,u,p,b,f,m,v,g,w=[],y=[],_=[],P=[],S=[],T=[],x=[],E=[],O=[],j=[],I=[],C=[],L=[],k=[],A=[],B=[],M=[],R=[];return e=class{get loop(){return ce(this,t,"f")}set loop(e){de(this,t,e,"f")}get gap(){return ce(this,r,"f")}set gap(e){de(this,r,e,"f")}get autoplay(){return ce(this,n,"f")}set autoplay(e){de(this,n,e,"f")}get animationSpeed(){return ce(this,i,"f")}set animationSpeed(e){de(this,i,e,"f")}get slidesPerView(){return ce(this,a,"f")}set slidesPerView(e){de(this,a,e,"f")}get navigation(){return ce(this,s,"f")}set navigation(e){de(this,s,e,"f")}get pagination(){return ce(this,o,"f")}set pagination(e){de(this,o,e,"f")}get direction(){return ce(this,l,"f")}set direction(e){de(this,l,e,"f")}get allowTouchMove(){return ce(this,c,"f")}set allowTouchMove(e){de(this,c,e,"f")}constructor(e){t.set(this,le(this,w,!0)),r.set(this,(le(this,y),le(this,_,16))),n.set(this,(le(this,P),le(this,S,!0))),i.set(this,(le(this,T),le(this,x,300))),a.set(this,(le(this,E),le(this,O,1))),s.set(this,(le(this,j),le(this,I,{enabled:!0}))),o.set(this,(le(this,C),le(this,L,{enabled:!0}))),l.set(this,(le(this,k),le(this,A,"row"))),c.set(this,(le(this,B),le(this,M,!0))),Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:(le(this,R),new he)}),e&&this.update(e)}update(e){var t,r,n,i,a,s,o,l;this.loop=null!==(t=null==e?void 0:e.loop)&&void 0!==t?t:this.loop,this.gap=se(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=se(null==e?void 0:e.animationSpeed,this.animationSpeed),this.slidesPerView=Math.max(se(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.direction=null!==(o=e.direction)&&void 0!==o?o:this.direction,this.allowTouchMove=null!==(l=e.allowTouchMove)&&void 0!==l?l:this.allowTouchMove,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,l=new WeakMap,c=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;d=[Q.observable],h=[Q.observable],u=[Q.observable],p=[Q.observable],b=[Q.observable],f=[Q.observable],m=[Q.observable],v=[Q.observable],g=[Q.observable],oe(e,null,d,{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},w,y),oe(e,null,h,{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},_,P),oe(e,null,u,{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},S,T),oe(e,null,p,{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},x,E),oe(e,null,b,{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},O,j),oe(e,null,f,{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},I,C),oe(e,null,m,{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},L,k),oe(e,null,v,{kind:"accessor",name:"direction",static:!1,private:!1,access:{has:e=>"direction"in e,get:e=>e.direction,set:(e,t)=>{e.direction=t}},metadata:t},A,B),oe(e,null,g,{kind:"accessor",name:"allowTouchMove",static:!1,private:!1,access:{has:e=>"allowTouchMove"in e,get:e=>e.allowTouchMove,set:(e,t)=>{e.allowTouchMove=t}},metadata:t},M,R),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();const pe=(e=>{var t={};return d.d(t,e),t})({v4:()=>a.v4});class be{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,pe.v4)()})}get type(){return"view"}toQueryParams(){return{ei:this.eventId,ii:this.payload.iterationId,si:this.payload.slideIndex,st:this.payload.slideTotal}}}class fe{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,pe.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)}}class me{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 ve,ge=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},we=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},ye=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)},_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");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r};!function(e){e.LoadStart="loadStart",e.LoadEnd="loadEnd",e.LoadError="loadError",e.ActiveIndexChange="activeIndexChange",e.AutoplayTimeLeft="autoplayTimeLeft",e.AutoplayTimerTick="autoplayTimerTick",e.ShowBanner="showBanner",e.ShowBannerFailed="showBannerFailed",e.BannerWidget="bannerWidget"}(ve||(ve={}));let Pe=(()=>{var e,t,r,n,i,a;let s,o,l,c,d,h=V.EventEmitter,u=[],p=[],b=[],f=[],m=[],v=[],g=[],w=[],y=[],_=[];return e=class extends h{get _banners(){return ye(this,t,"f")}set _banners(e){_e(this,t,e,"f")}get _bannerPlace(){return ye(this,r,"f")}set _bannerPlace(e){_e(this,r,e,"f")}get _isLoading(){return ye(this,n,"f")}set _isLoading(e){_e(this,n,e,"f")}get _isLoaded(){return ye(this,i,"f")}set _isLoaded(e){_e(this,i,e,"f")}get _error(){return ye(this,a,"f")}set _error(e){_e(this,a,e,"f")}constructor(e,s,o,l,c){super(),Object.defineProperty(this,"placeId",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"bannerStatisticService",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"bannerStore",{enumerable:!0,configurable:!0,writable:!0,value:l}),Object.defineProperty(this,"bannerViewModelFactory",{enumerable:!0,configurable:!0,writable:!0,value:c}),t.set(this,we(this,u,[])),r.set(this,(we(this,p),we(this,b,null))),n.set(this,(we(this,f),we(this,m,!1))),i.set(this,(we(this,v),we(this,g,!1))),a.set(this,(we(this,w),we(this,y,null))),Object.defineProperty(this,"appearance",{enumerable:!0,configurable:!0,writable:!0,value:(we(this,_),new ue)}),Object.defineProperty(this,"sliderController",{enumerable:!0,configurable:!0,writable:!0,value:new me}),this.ctx.addBannerPlace(this)}get dir(){return this.ctx.getConfig().dir}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 error(){return this._error}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 me;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(await this.ctx.waitForConfig()).anonymous?(console.warn("[IAS]: You can't fetch banners in anonymous access mode"),[]):this._isLoading?[]:(this._isLoading=!0,this._isLoaded=!1,this._error=null,this.emit(ve.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(ve.LoadError,e),this._error=e,e}finally{this.emit(ve.LoadEnd,{banners:this._banners.slice()}),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,a=new WeakMap,(()=>{var t;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=h[Symbol.metadata])&&void 0!==t?t:null):void 0;s=[Q.observable],o=[Q.observable],l=[Q.observable],c=[Q.observable],d=[Q.observable],ge(e,null,s,{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},u,p),ge(e,null,o,{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},b,f),ge(e,null,l,{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},m,v),ge(e,null,c,{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},g,w),ge(e,null,d,{kind:"accessor",name:"_error",static:!1,private:!1,access:{has:e=>"_error"in e,get:e=>e._error,set:(e,t)=>{e._error=t}},metadata:r},y,_),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),e})();const Se=e=>((0,c.useEffect)((()=>(e.onLoadStart&&e.bannerPlace.on(ve.LoadStart,e.onLoadStart),e.onLoadEnd&&e.bannerPlace.on(ve.LoadEnd,e.onLoadEnd),e.onLoadError&&e.bannerPlace.on(ve.LoadError,e.onLoadError),e.onActiveIndexChange&&e.bannerPlace.on(ve.ActiveIndexChange,e.onActiveIndexChange),e.onAutoplayTimeLeft&&e.bannerPlace.on(ve.AutoplayTimeLeft,e.onAutoplayTimeLeft),e.onAutoplayTimerTick&&e.bannerPlace.on(ve.AutoplayTimerTick,e.onAutoplayTimerTick),e.onShowBanner&&e.bannerPlace.on(ve.ShowBanner,e.onShowBanner),e.onShowBannerFailed&&e.bannerPlace.on(ve.ShowBannerFailed,e.onShowBannerFailed),e.onBannerWidget&&e.bannerPlace.on(ve.BannerWidget,e.onBannerWidget),()=>{e.onLoadStart&&e.bannerPlace.off(ve.LoadStart,e.onLoadStart),e.onLoadEnd&&e.bannerPlace.off(ve.LoadEnd,e.onLoadEnd),e.onLoadError&&e.bannerPlace.off(ve.LoadError,e.onLoadError),e.onActiveIndexChange&&e.bannerPlace.off(ve.ActiveIndexChange,e.onActiveIndexChange),e.onAutoplayTimeLeft&&e.bannerPlace.off(ve.AutoplayTimeLeft,e.onAutoplayTimeLeft),e.onAutoplayTimerTick&&e.bannerPlace.off(ve.AutoplayTimerTick,e.onAutoplayTimerTick),e.onShowBanner&&e.bannerPlace.off(ve.ShowBanner,e.onShowBanner),e.onShowBannerFailed&&e.bannerPlace.off(ve.ShowBannerFailed,e.onShowBannerFailed),e.onBannerWidget&&e.bannerPlace.off(ve.BannerWidget,e.onBannerWidget)})),[e.bannerPlace,e.onLoadStart,e.onLoadError,e.onLoadEnd,e.onActiveIndexChange,e.onAutoplayTimeLeft,e.onAutoplayTimerTick,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),Te=e=>{(0,c.useEffect)((()=>{e.appearance&&e.bannerPlace.updateAppearance(e.appearance)}),[e.bannerPlace,JSON.stringify(e.appearance)])},xe=({bannerPlace:e,bannerPlaceRef:t})=>{const[r,n]=(0,c.useState)(!1),[i,a]=(0,c.useState)(null),s=(0,c.useRef)();return(0,c.useEffect)((()=>{if(e.banners.length)return(async(e=5e3)=>new Promise(((r,n)=>{s.current=setTimeout((()=>{n(new Error("[IAS]: Unable to calculate banner place width. Check if you are using ad blockers such as AdBlock, uBlock Origin, etc."))}),e);const i=()=>{if(t.current&&t.current.clientWidth>0)return clearTimeout(s.current),void r();requestAnimationFrame(i)};requestAnimationFrame(i)})))().then((()=>{n(!0)})).catch((e=>{a(e),console.error(e)})),()=>{clearTimeout(s.current),n(!1)}}),[e.isLoaded,e.banners.length]),{canBeShown:r,error:i}},Ee=(0,u.observer)((e=>{const t=(0,c.useRef)(null),r=Se(e);Te(e);const{realIndex:n,allowClick:i,slider:a,isAnimating:s,setSlider:o,isMoved:d}=(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),[w,y]=(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)},P=()=>{t.current=setTimeout((()=>d(!0)),100),o(!1),((e,t)=>{t.banners.forEach((e=>e.resume()))})(0,e)},S=()=>{a(!0),d(!1)},T=()=>{a(!1),d(!0)},x=t=>{m(t),e.emit(ve.ActiveIndexChange,t)},E=e=>{b(e)},O=()=>{h&&g(h.reachStart)},j=()=>{h&&y(h.reachEnd)},I=()=>{},C=()=>{e.refreshSizes(),requestAnimationFrame((()=>{e.refreshSizes(),n((e=>!e))}))},L=()=>{e.emit(ve.AutoplayTimeLeft),e.notifyTimerEnd()},k=t=>{e.emit(ve.AutoplayTimerTick,Object.assign(Object.assign({},t),{bannerIndex:e.activeIndex}))};return(0,c.useEffect)((()=>{if(!h)return;const t=new Y(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(z.TouchStart,_),h.on(z.TouchEnd,P),h.on(z.TransitionStart,S),h.on(z.TransitionEnd,T),h.on(z.RealIndexChnage,x),h.on(z.ActiveIndexChange,E),h.on(z.ReachStart,O),h.on(z.ReachEnd,j),h.on(z.Resize,I),h.on(z.SlidesUpdated,C),h.on(z.AutoplayTimeLeft,L),h.on(z.AutoplayTimerTick,k),O(),j(),()=>{h.off(z.TouchStart,_),h.off(z.TouchEnd,P),h.off(z.TransitionStart,S),h.off(z.TransitionEnd,T),h.off(z.RealIndexChnage,x),h.off(z.ActiveIndexChange,E),h.off(z.ReachStart,O),h.off(z.ReachEnd,j),h.off(z.Resize,I),h.off(z.SlidesUpdated,C),h.off(z.AutoplayTimeLeft,L),h.off(z.AutoplayTimerTick,k)}}),[e,h]),{reachStart:v,reachEnd:w,activeIndex:p,realIndex:f,isMoved:s,isAnimating:i,slider:h,setSlider:u,allowClick:l}})(e.bannerPlace),{error:h,canBeShown:u}=xe({bannerPlace:e.bannerPlace,bannerPlaceRef:t});(0,c.useEffect)((()=>{a&&u&&(a.updateSize(),e.bannerPlace.refreshSizes(),requestAnimationFrame((()=>{e.bannerPlace.refreshSizes()})))}),[e.bannerPlace,u]);const p=e.bannerPlace.appearance;return!e.bannerPlace.banners.length||h?null:(0,l.jsx)("div",{className:(0,_.default)(I["bnr-place"],e.className),style:Object.assign(Object.assign({},e.style),{"--ias-bnr-place-border-radius":`${p.banner.borderRadius}px`}),ref:t,children:(0,l.jsx)($,{onInit:o,autoplay:p.autoplay,speed:p.animationSpeed,loop:p.loop,slidesPerView:p.slidesPerView,spaceBetween:p.gap,slidesCount:r.length,navigation:p.navigation,pagination:p.pagination,direction:p.direction,allowTouchMove:p.allowTouchMove,langDirection:e.bannerPlace.dir,children:r.map(((e,t)=>{const r=Boolean(null==a?void 0:a.isSlideVisible(t))&&u;return(0,l.jsx)(G,{children:(0,l.jsx)(O,{index:t,isActive:r,canBeInited:r,banner:e,className:I["bnr-slider__slide"],allowClick:i,clientAppearance:p.banner,direction:p.direction})},e.id)}))})})})),Oe=(e=>{var t={};return d.d(t,e),t})({createRoot:()=>s.createRoot});class je{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,Oe.createRoot)(this.rootElement)}get dir(){return this.bannerPlace.dir}get activeIndex(){return this.bannerPlace.activeIndex}get activeBanner(){return this.bannerPlace.activeBanner}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 error(){return this.bannerPlace.error}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)(Ee,{appearance:null===(e=this.params)||void 0===e?void 0:e.appearance,bannerPlace:this.bannerPlace}))}}class Ie extends je{render(){var e;this.root.render((0,l.jsx)(Ne,{appearance:null===(e=this.params)||void 0===e?void 0:e.appearance,bannerPlace:this.bannerPlace}))}}const Ce=e=>{const[t,r]=(0,c.useState)(null);return(0,c.useEffect)((()=>{var t;const n=sr().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)(Ee,Object.assign({bannerPlace:t},e)):null};var Le=d(713);b()(Le.A,{insert:"head",singleton:!1});const ke=Le.A.locals||{},Ae=(0,u.observer)((e=>{const t=Se(e),r=(0,c.useRef)(null),{error:n,canBeShown:i}=xe({bannerPlace:e.bannerPlace,bannerPlaceRef:r}),a=t[0];return(0,c.useEffect)((()=>{i&&(e.bannerPlace.refreshSizes(),requestAnimationFrame((()=>{e.bannerPlace.refreshSizes()})))}),[e.bannerPlace,i]),e.bannerPlace.error||n?null:(0,l.jsx)("div",{className:ke["bnr-place"],ref:r,children:a&&i&&!e.bannerPlace.isLoading?(0,l.jsx)(O,{index:0,isActive:!0,canBeInited:!0,banner:a,allowClick:!0,clientAppearance:e.bannerPlace.appearance.banner}):(0,l.jsx)(S,{needShowErrorScreen:!1,needShowLoaderScreen:!0,onReload:()=>{}})})})),Be=e=>{const[t,r]=(0,c.useState)(null);return(0,c.useEffect)((()=>{var t;const n=sr().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)(Ae,Object.assign({bannerPlace:t},e)):null};var Me=d(883);b()(Me.A,{insert:"head",singleton:!1});const Re=Me.A.locals||{},De=({banner:e,index:t,clientAppearance:r,canBeShown:n})=>{const[i,a]=(0,c.useState)(!1),s=(0,c.useRef)(null);return(0,c.useEffect)((()=>{const e=new IntersectionObserver((e=>{e.forEach((e=>{e.intersectionRatio>=.5?a(!0):a(!1)}))}),{threshold:[0,.5,1]});return s.current&&e.observe(s.current),()=>{s.current&&e.unobserve(s.current)}}),[]),(0,l.jsx)(O,{index:t,isActive:i&&n,canBeInited:i&&n,banner:e,allowClick:!0,clientAppearance:r,direction:"row",ref:s},e.id)},Ne=(0,u.observer)((e=>{const t=(0,c.useRef)(null),r=Se(e);Te(e);const{error:n,canBeShown:i}=xe({bannerPlace:e.bannerPlace,bannerPlaceRef:t});(0,c.useEffect)((()=>{i&&(e.bannerPlace.refreshSizes(),requestAnimationFrame((()=>{e.bannerPlace.refreshSizes()})))}),[e.bannerPlace,i]);const a=e.bannerPlace.appearance;return!e.bannerPlace.banners.length||n?null:(0,l.jsx)("div",{className:(0,_.default)(Re["bnr-place"],e.className),style:Object.assign(Object.assign({},e.style),{gap:a.gap}),ref:t,children:r.map(((e,t)=>(0,l.jsx)(De,{banner:e,canBeShown:i,index:t,clientAppearance:a.banner},e.id)))})})),ze=e=>{const[t,r]=(0,c.useState)(null);return(0,c.useEffect)((()=>{var t;const n=sr().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)(Ne,Object.assign({bannerPlace:t},e)):null};var We=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},Fe=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},Ve=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)},Ue=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 qe=(()=>{var e,t,r,n,i;let a,s,o,l,c=V.EventEmitter,d=[],h=[],u=[],p=[],b=[],f=[],m=[],v=[];return e=class extends c{get _banners(){return Ve(this,t,"f")}set _banners(e){Ue(this,t,e,"f")}get _isLoading(){return Ve(this,r,"f")}set _isLoading(e){Ue(this,r,e,"f")}get _isLoaded(){return Ve(this,n,"f")}set _isLoaded(e){Ue(this,n,e,"f")}get _error(){return Ve(this,i,"f")}set _error(e){Ue(this,i,e,"f")}constructor(e,a,s,o){super(),Object.defineProperty(this,"bannerId",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"bannerStore",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"bannerViewModelFactory",{enumerable:!0,configurable:!0,writable:!0,value:o}),t.set(this,Fe(this,d,[])),r.set(this,(Fe(this,h),Fe(this,u,!1))),n.set(this,(Fe(this,p),Fe(this,b,!1))),i.set(this,(Fe(this,f),Fe(this,m,null))),Object.defineProperty(this,"appearance",{enumerable:!0,configurable:!0,writable:!0,value:(Fe(this,v),new ue)}),this.ctx.addBannerPlace(this)}get dir(){return this.ctx.getConfig().dir}get activeIndex(){return 0}get activeBanner(){return this._banners[0]}get id(){return"__BANNER_PREVIEW__"}get slider(){return new me}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}get error(){return this._error}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._error=null,this._isLoading=!0,this._isLoaded=!1,this.emit(ve.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(ve.LoadError,e),this._error=e,e}finally{this.emit(ve.LoadEnd),this._isLoading=!1}}},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=[Q.observable],s=[Q.observable],o=[Q.observable],l=[Q.observable],We(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),We(e,null,s,{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},u,p),We(e,null,o,{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},b,f),We(e,null,l,{kind:"accessor",name:"_error",static:!1,private:!1,access:{has:e=>"_error"in e,get:e=>e._error,set:(e,t)=>{e._error=t}},metadata:r},m,v),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),e})();class He{constructor(e){Object.defineProperty(this,"bannerStatisticApi",{enumerable:!0,configurable:!0,writable:!0,value:e})}async sendViewEvent(e,t){const r=new be(t);await this.bannerStatisticApi.sendViewEvent(e,r)}async sendWidgetEvent(e,t){const r=new fe(t);await this.bannerStatisticApi.sendWidgetEvent(e,r)}}class $e{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 Ge{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.pause(),t.once("close",(()=>{this.bannerPlaceViewModel.resume()}))}catch(e){console.error(e)}}}var Xe,Ye,Qe,Ke,Je,Ze,et,tt,rt,nt,it,at,st,ot,lt,ct,dt,ht,ut,pt;!function(e){e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end"}(Xe||(Xe={})),Xe.END,function(e){e.Text="text",e.Link="link",e.Image="image"}(Ye||(Ye={})),function(e){e.DEFAULT="default",e.CUSTOM_CARD="customCard"}(Qe||(Qe={})),Qe.DEFAULT,Qe.DEFAULT,function(e){e.CENTER="center",e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end"}(Ke||(Ke={})),function(e){e.CIRCLE="circle",e.QUAD="quad",e.RECTANGLE="rectangle"}(Je||(Je={})),function(e){e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end",e.CENTER="center"}(Ze||(Ze={})),function(e){e.CARD_INSIDE_BOTTOM="cardInsideBottom",e.CARD_OUTSIDE_TOP="cardOutsideTop",e.CARD_OUTSIDE_BOTTOM="cardOutsideBottom"}(et||(et={})),function(e){e.Medium="medium",e.High="high"}(tt||(tt={})),function(e){e.COLUMN="vertical",e.ROW="horizontal"}(rt||(rt={})),function(e){e.START_LOADER="startLoad",e.END_LOADER="endLoad"}(nt||(nt={})),rt.ROW,Ze.START,et.CARD_INSIDE_BOTTOM,tt.High,Je.RECTANGLE,Ze.START,et.CARD_INSIDE_BOTTOM,tt.High,Je.CIRCLE,Ke.START,Ze.START,et.CARD_INSIDE_BOTTOM,tt.High,Je.CIRCLE,function(e){e.WidgetEvent="widgetEvent",e.ClickOnButton="clickOnButton"}(it||(it={})),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"}(at||(at={})),function(e){e.FLAT="flat",e.COVER="cover",e.CUBE="cube"}(st||(st={})),function(e){e.Classic="classic",e.Modern="modern"}(ot||(ot={})),st.FLAT,ot.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"}(lt||(lt={})),function(e){e.direct="direct",e.onboarding="onboarding",e.list="list",e.favorite="favorite"}(ct||(ct={})),function(e){e[e.default=0]="default",e[e.favorite=1]="favorite",e[e.stacked=2]="stacked"}(dt||(dt={})),function(e){e.LTR="ltr",e.RTL="rtl"}(ht||(ht={})),function(e){e.StoryList="storyList",e.StoryReader="storyReader",e.GameReader="gameReader",e.StackStoryList="stackStoryList",e.IamReader="iamReader",e.Banners="banners"}(ut||(ut={}));class bt{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),r={src:ut.Banners,data:{id:this.banner.id,index:this.banner.activeSlideIndex,url:t,elementId:e.elementId}};this.storyManager.storyLinkClickHandler(r),this.storyManager.emit("clickOnButton",r)}catch(t){t instanceof URIError?console.error(`[Banners]: the URL <${e.linkTarget}> has an invalid format`):console.error(t)}}}class ft{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{const t={src:ut.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)}}}class mt{constructor(){Object.defineProperty(this,"textArea",{enumerable:!0,configurable:!0,writable:!0,value:null})}async copy(e){try{navigator.clipboard&&window.isSecureContext?await navigator.clipboard.writeText(e):this.copyLegacy(e)}catch(t){this.copyLegacy(e)}}isIOS(){return/ipad|iphone/i.test(navigator.userAgent)}createTextArea(e){this.textArea=document.createElement("textarea"),this.textArea.value=e,document.body.appendChild(this.textArea)}selectText(){if(this.textArea)if(this.isIOS()){const e=document.createRange();e.selectNodeContents(this.textArea);const t=window.getSelection();t&&(t.removeAllRanges(),t.addRange(e)),this.textArea.setSelectionRange(0,999999)}else this.textArea.select()}copyLegacy(e){this.createTextArea(e),this.selectText();try{document.execCommand("copy")}catch(e){console.error("Copy failed:",e)}this.textArea&&(document.body.removeChild(this.textArea),this.textArea=null)}}class vt{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 gt{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}}Object.defineProperty(gt,"name",{enumerable:!0,configurable:!0,writable:!0,value:"bannerWidget"});class wt{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}}Object.defineProperty(wt,"name",{enumerable:!0,configurable:!0,writable:!0,value:"showBanner"});class yt{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}}Object.defineProperty(yt,"name",{enumerable:!0,configurable:!0,writable:!0,value:"showBannerFailed"});class _t{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 $e}),Object.defineProperty(this,"narrativeDataCache",{enumerable:!0,configurable:!0,writable:!0,value:new $e})}onWidgetRequirePauseUI(){this.banner.pause()}onWidgetRequireResumeUI(){this.banner.resume()}productCartUpdate(e){return Promise.reject({message:"Not implemented"})}productCartClicked(){}async productCartGetState(){return Promise.reject("Not implemented")}onEvent(e,t){}onCardLoadingStateChange(e){}updateCardServerDataLocally(e){this.banner.context.updateNarrativeSavedData(e)}async updateTimeline(e,t,r,n,i,a){"before_start"!==t&&(i?this.banner.showLoaderScreen():this.banner.activeSlide.inited&&this.banner.hideLoaderScreen(),a?this.banner.showErrorScreen():this.banner.hideErrorScreen()),new vt(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}),this.bannerPlace.emit(gt.name,new gt({id:this.banner.id,bannerPlace:this.bannerPlace.id,widgetEventName:e,widgetData:null!=r?r:{}}).payload),this.storyManager.emit("widgetEvent",{name:e,data:r})}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 ft(this.storyManager,this.bannerPlace,this.banner).handle({storyId:e,slideIndex:t})}openGame(e){new Ge(this.storyManager,this.bannerPlace,this.banner).handle({gameInstanceId:e})}writeToClipboard(e){(new mt).copy(e.textValue)}openUrl(e){"swipeUpItems"!==e.type&&new bt(this.storyManager,this.banner).handle({elementId:e.elementId,linkTarget:e.link.target})}}!function(e){e.Top="top",e.Bottom="bottom"}(pt||(pt={}));const Pt=pt.Bottom;class St{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:Pt}),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:Pt}}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 Tt=(e=>{var t={};return d.d(t,e),t})({SlideApi:()=>o.SlideApi});let xt;xt=function(){},new Error("timeout while waiting for mutex to become available"),new Error("mutex already locked");const Et=new Error("request for lock canceled");class Ot{constructor(e,t=Et){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=jt(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=jt(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 jt(e,t){for(let r=e.length-1;r>=0;r--)if(t(e[r]))return r;return-1}class It{constructor(e){this._semaphore=new Ot(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 Ct{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 It}),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,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){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 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 Lt{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 kt=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},At=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},Bt=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)},Mt=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 Rt=(()=>{var e,t,r,n,i,a,s,o;let l,c,d,h,u,p,b,f,m,v,g,w,y,_,P=[],S=[],x=[],E=[],O=[],j=[],I=[],C=[],L=[],k=[],A=[],B=[],M=[],R=[],D=[];return e=class{get _$root(){return Bt(this,t,"f")}set _$root(e){Mt(this,t,e,"f")}get _needShowErrorScreen(){return Bt(this,r,"f")}set _needShowErrorScreen(e){Mt(this,r,e,"f")}get _needShowLoaderScreen(){return Bt(this,n,"f")}set _needShowLoaderScreen(e){Mt(this,n,e,"f")}get _width(){return Bt(this,i,"f")}set _width(e){Mt(this,i,e,"f")}get _height(){return Bt(this,a,"f")}set _height(e){Mt(this,a,e,"f")}get _slides(){return Bt(this,s,"f")}set _slides(e){Mt(this,s,e,"f")}get isInited(){return Bt(this,o,"f")}set isInited(e){Mt(this,o,e,"f")}constructor(e,l,c,d,h){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(kt(this,P),e)}),Object.defineProperty(this,"bannerPlace",{enumerable:!0,configurable:!0,writable:!0,value:l}),Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:c}),Object.defineProperty(this,"bannerStatisticService",{enumerable:!0,configurable:!0,writable:!0,value:d}),Object.defineProperty(this,"bannerStore",{enumerable:!0,configurable:!0,writable:!0,value:h}),t.set(this,kt(this,S,null)),r.set(this,(kt(this,x),kt(this,E,!1))),n.set(this,(kt(this,O),kt(this,j,!1))),i.set(this,(kt(this,I),kt(this,C,0))),a.set(this,(kt(this,L),kt(this,k,0))),s.set(this,(kt(this,A),kt(this,B,[]))),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:(kt(this,M),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:()=>{}}),o.set(this,kt(this,R,!1)),Object.defineProperty(this,"attachRoot",{enumerable:!0,configurable:!0,writable:!0,value:(kt(this,D),async e=>{this._$root||(this._$root=e,this.slideApi=this.createSlideApi(e),this._slides=[new Ct(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 _t(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 height(){return this._height}get activeSlide(){var e;return null!==(e=this._slides[this.activeSlideIndex])&&void 0!==e?e:new Lt}get needShowErrorScreen(){return this._needShowErrorScreen}get needShowLoaderScreen(){return this._needShowLoaderScreen}get canBeShown(){return Boolean(this._$root)&&this.isInited}get iterationId(){return this._iterationId}get durationMs(){return Date.now()-this._startTime}async init(){this.isInited||(this.showLoaderScreen(),await this.activeSlide.init(),this._initPromiseResolver(),this.isInited=!0)}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 r=this.activeSlide;this._slides=[],this._$root=null,this.isInited=!1,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 St(Object.assign({mountPoint:t},e)),this.toast.show(e.content)}detachRoot(){var e;this.isInited=!1,this._$root=null,this._slides.forEach((e=>e.destroy())),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,pe.v4)(),this.banner.markAsOpened(),this.markWasShown()}async waitInit(){await 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 Tt.SlideApi(this.slideApiImpl,{root:e,slideRatio:this.banner.appearance.contentRatio,isFullscreen:!1,nonce:T(),viewport:window,userResizeHandler:e=>{this._width=e.viewportWidth,this._height=e.viewportHeight},VODPlayer:this.storyManager.globalProperties.$videoOnDemand,overlappingActionBarHeight:0,useSdkCacheForMultislideMode:!1})}emitShowBannerEvent(){this.bannerPlace.emit(wt.name,new wt({id:this.id,bannerPlace:this.bannerPlace.id,payload:this.activeSlide.payload}).payload)}emitShowBannerFailedEvent(e){this.bannerPlace.emit(yt.name,new yt({id:this.id,bannerPlace:this.bannerPlace.id,error:e,payload:this.activeSlide.payload}).payload)}},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=[Q.observable],c=[Q.observable],d=[Q.observable],h=[Q.observable],u=[Q.observable],p=[Q.observable],b=[Q.observable],f=[Q.computed],m=[Q.computed],v=[Q.computed],g=[Q.action],w=[Q.action],y=[Q.action],_=[Q.action],At(e,null,l,{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},S,x),At(e,null,c,{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},E,O),At(e,null,d,{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},j,I),At(e,null,h,{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},C,L),At(e,null,u,{kind:"accessor",name:"_height",static:!1,private:!1,access:{has:e=>"_height"in e,get:e=>e._height,set:(e,t)=>{e._height=t}},metadata:t},k,A),At(e,null,p,{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},B,M),At(e,null,b,{kind:"accessor",name:"isInited",static:!1,private:!1,access:{has:e=>"isInited"in e,get:e=>e.isInited,set:(e,t)=>{e.isInited=t}},metadata:t},R,D),At(e,null,f,{kind:"getter",name:"activeSlide",static:!1,private:!1,access:{has:e=>"activeSlide"in e,get:e=>e.activeSlide},metadata:t},null,P),At(e,null,m,{kind:"getter",name:"needShowLoaderScreen",static:!1,private:!1,access:{has:e=>"needShowLoaderScreen"in e,get:e=>e.needShowLoaderScreen},metadata:t},null,P),At(e,null,v,{kind:"getter",name:"canBeShown",static:!1,private:!1,access:{has:e=>"canBeShown"in e,get:e=>e.canBeShown},metadata:t},null,P),At(e,null,g,{kind:"method",name:"showErrorScreen",static:!1,private:!1,access:{has:e=>"showErrorScreen"in e,get:e=>e.showErrorScreen},metadata:t},null,P),At(e,null,w,{kind:"method",name:"showLoaderScreen",static:!1,private:!1,access:{has:e=>"showLoaderScreen"in e,get:e=>e.showLoaderScreen},metadata:t},null,P),At(e,null,y,{kind:"method",name:"hideLoaderScreen",static:!1,private:!1,access:{has:e=>"hideLoaderScreen"in e,get:e=>e.hideLoaderScreen},metadata:t},null,P),At(e,null,_,{kind:"method",name:"hideErrorScreen",static:!1,private:!1,access:{has:e=>"hideErrorScreen"in e,get:e=>e.hideErrorScreen},metadata:t},null,P),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class Dt{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 Rt(this.storyManager,e,t,this.bannerStatisticService,this.bannerStore)}}function Nt(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 zt extends Error{constructor(e){super(`[IAS]: Banner with ID ${e} not found`),this.name="IasBannerNotFoundError"}}class Wt extends Error{constructor(e){super(`[IAS]: Banner slot with ID ${e} not found`),this.name="IasBannerPlaceNotFoundError"}}var Ft=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},Vt=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 Ut=(()=>{var e;let t,r,n,i,a=[];return e=class{constructor(e){Object.defineProperty(this,"httpClient",{enumerable:!0,configurable:!0,writable:!0,value:(Ft(this,a),e)})}async fetchBannerPlaceById(e){const t=await this.httpClient.post(`banner/place/${e.placeId}`,{tags:e.tags.join(","),options:e.options},{params:{expand:"banners.slides"}});if(t.data)return t.data;throw new Wt(e.placeId)}async fetchBannerById(e){const t=await this.httpClient.get(`banner/${e}`,{params:{expand:"slides"}});if(t.data)return t.data;throw new zt(e)}async fetchContextWithStyles({needFetchStyles:e}){return(await this.httpClient.get("banner/context",{params:{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=[Nt],r=[Nt],n=[Nt],i=[Nt],Vt(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),Vt(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),Vt(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),Vt(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 qt{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}`,{},{params:t.toQueryParams()})}catch(e){console.error(e)}}}var Ht;!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"}(Ht||(Ht={}));var $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};(()=>{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=[Nt],r=[Nt],$t(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),$t(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 Gt{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 qt(this.storyManager.httpClient,this.storyManager),i=new He(n),a=new Dt(this.storyManager,this.bannerStore,i);return new Pe(null!==(r=null==t?void 0:t.toString())&&void 0!==r?r:"default",e,i,this.bannerStore,a)}createBannerPreviewPlace(e,t){const r=new qt(this.storyManager.httpClient,this.storyManager),n=new He(r),i=new Dt(this.storyManager,this.bannerStore,n);return new qe(t.toString(),e,this.bannerStore,i)}}class Xt{static toDomain(e,t){return new J({id:e.id,name:e.name,slides:e.slides.map((e=>{var t;return new ne({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 Z(e.appearance),context:new ee(e.id,t),frequencyLimit:e.frequency_limit})}}class Yt{static toDomain(e,t,r){const n=e.banners.map((e=>Xt.toDomain(e,t)));return new ae({id:e.id,banners:n,placeholders:r,style:t.style})}}var Qt=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},Kt=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},Jt=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)},Zt=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 er=(()=>{var e,t,r;let n,i,a,s,o=[],l=[],c=[],d=[],h=[];return e=class{get _bannerPlaces(){return Jt(this,t,"f")}set _bannerPlaces(e){Zt(this,t,e,"f")}get _banners(){return Jt(this,r,"f")}set _banners(e){Zt(this,r,e,"f")}constructor(e,n){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(Qt(this,o),e)}),Object.defineProperty(this,"bannerApi",{enumerable:!0,configurable:!0,writable:!0,value:n}),t.set(this,Qt(this,l,Q.observable.map())),r.set(this,(Qt(this,c),Qt(this,d,Q.observable.map()))),Object.defineProperty(this,"bannerCSS",{enumerable:!0,configurable:!0,writable:!0,value:(Qt(this,h),"")}),(0,Q.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.waitForConfig();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);const t=await this.storyManager.waitForConfig(),r=await this.fetchBannerContext(),n=await this.bannerApi.fetchBannerPlaceById({placeId:e.placeId,tags:t.tags,options:t.options});return this.addBannerPlace(n,r)}clearCache(){this._bannerPlaces=Q.observable.map(),this._banners=Q.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=Yt.toDomain(e,t,r);return this._bannerPlaces.set(e.id,n),n}addBanner(e,t){const r=this.storyManager.rootStore.placeholderStore.placeholders,n=Xt.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=[Q.observable],i=[Q.observable],a=[Q.computed],s=[Nt],Kt(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),Kt(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),Kt(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),Kt(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 tr{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 Ut(e.httpClient);this.bannerStore=new er(this.storyManager,t)}}class rr extends Error{constructor(){super("[IAS]: you must create an instance of BannersProvider"),this.name="IasBannersProviderReferenceError"}}class nr extends Error{constructor(e){super(`[IAS]: Mount point ${e} is not present in DOM at initialization time`),this.name="IasMountPointReferenceError"}}class ir extends je{render(){this.root.render((0,l.jsx)(Ae,{bannerPlace:this.bannerPlace}))}}class ar{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 tr(e),this.bannerPlaceViewModelFactory=new Gt(e,this.rootStore.bannerStore),this.storyManager.waitForConfig().then((e=>{e.on("requestSDKReload",this.reloadAllBanners)}))}async waitForConfig(){return await this.storyManager.waitForConfig()}getConfig(){return this.storyManager.config}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 ar.instance||(ar.instance=new ar(e)),ar.instance}mountBannerPlace(e,t){return this.mountBannerCarousel(e,t)}mountBannerCarousel(e,t){const r=document.querySelector(e);if(!r)throw new nr(e);const n=this.createBannerPlace(null==t?void 0:t.placeId),i=new je(r,n,t);return i.render(),i}mountBannerList(e,t){const r=document.querySelector(e);if(!r)throw new nr(e);const n=this.createBannerPlace(null==t?void 0:t.placeId),i=new Ie(r,n,t);return i.render(),i}mountBannerPreviewPlace(e,t){const r=document.querySelector(e);if(!r)throw new nr(e);const n=this.createBannerPreviewPlace(t.bannerId),i=new ir(r,n);return i.render(),i}}const sr=()=>{if(!ar.instance)throw new rr;return ar.instance},or=ar;class lr{constructor(){Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ias-banners"})}install(e){const t=or.create(e.INTERNAL_API);e.HOST.prototype.banners=t}uninstall(){}}const cr=new lr})();var u=h.AF,p=h.M6,b=h.RE,f=h.Sr,m=h.YL,v=h.Ay;export{u as IasBannerCarousel,p as IasBannerList,b as IasBannerPlace,f as IasBannerPreview,m as IasBannersPlugin,v as default};
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,".bnr---mqC-{width:100%;height:100%;position:relative;backface-visibility:hidden;transform:translateZ(0);clip-path:inset(0 round var(--ias-banner-border-radius, 0px))}.bnr-slides--Oc1j-{position:relative;width:100%;height:100%;display:block}",""]),i.locals={bnr:"bnr---mqC-","bnr-slides":"bnr-slides--Oc1j-"};const a=i},243:(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,".bnr-place--GbC1J{width:100%;height:100%;position:relative;border-radius:var(--ias-bnr-place-border-radius, 0px)}.bnr-slider__slider_visible--LrMXv{border:solid 1px green}",""]),i.locals={"bnr-place":"bnr-place--GbC1J","bnr-slider__slider_visible":"bnr-slider__slider_visible--LrMXv"};const a=i},883:(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,".bnr-place--Dj\\+2-{width:100%;height:100%;display:flex;flex-direction:column;position:relative}",""]),i.locals={"bnr-place":"bnr-place--Dj+2-"};const a=i},713:(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,".bnr-place--1RkrK{width:100%;height:100%;position:relative}",""]),i.locals={"bnr-place":"bnr-place--1RkrK"};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;user-select:none;border-radius:inherit}.slider__track--JSOcI{display:flex;transition:transform .3s ease;width:100%;height:100%;will-change:transform}.slider__slide--oGmUT{width:100%;flex-shrink:0;position:relative;display:flex}.slider--vertical--qUwAP .slider__track--JSOcI{flex-direction:column}.slider--vertical--qUwAP .slider__slide--oGmUT{justify-content:center}",""]),i.locals={slider:"slider--ggy2P",slider__track:"slider__track--JSOcI",slider__slide:"slider__slide--oGmUT","slider--vertical":"slider--vertical--qUwAP"};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:1.5rem;height:1.5rem;transform:translate3d(0, -50%, 0);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--start--uVL4-{left:1.5rem}.slider__controls-btn--end--fV\\+p9{right:1.5rem}.slider__controls--CjPin.slider__controls--vertical--5wOuK .slider__controls-btn--HubN5{top:auto;left:50%;transform:translate3d(-50%, 0, 0)}.slider__controls--CjPin.slider__controls--vertical--5wOuK .slider__controls-btn--start--uVL4-{top:0;transform:rotate(90deg)}.slider__controls--CjPin.slider__controls--vertical--5wOuK .slider__controls-btn--end--fV\\+p9{bottom:0;transform:rotate(90deg)}.slider__controls--CjPin:not(.slider__controls--vertical--5wOuK) .slider__controls-btn--start--uVL4-.slider__controls-btn--dir--rtl--ICofD{left:auto;right:0;transform:translate3d(0, -50%, 0) rotate(180deg)}.slider__controls--CjPin:not(.slider__controls--vertical--5wOuK) .slider__controls-btn--end--fV\\+p9.slider__controls-btn--dir--rtl--ICofD{left:0;right:auto;transform:translate3d(0, -50%, 0) rotate(180deg)}.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--start":"slider__controls-btn--start--uVL4-","slider__controls-btn--end":"slider__controls-btn--end--fV+p9",slider__controls:"slider__controls--CjPin","slider__controls--vertical":"slider__controls--vertical--5wOuK","slider__controls-btn--dir--rtl":"slider__controls-btn--dir--rtl--ICofD","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:var(--ias-banners-pagination-inactive-color, hsla(0, 0%, 100%, 0.5));width:var(--ias-banners-pagination-width, 0.5rem);height:var(--ias-banners-pagination-height, 0.5rem);padding:0;border-radius:50%;border:.25rem 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)}.slider-bullets--XDc5n.slider-bullets--vertical--QuatQ{transform:translate3d(0, -50%, 0);left:auto;bottom:auto;right:1.5rem;top:50%;display:flex;flex-direction:column}.slider-bullets--XDc5n.slider-bullets--vertical--QuatQ .slider-bullets__bullet--83aBh{margin:.25em 0}",""]),i.locals={"slider-bullets":"slider-bullets--XDc5n","slider-bullets__bullet":"slider-bullets__bullet--83aBh","slider-bullets__bullet--active":"slider-bullets__bullet--active--RDBez","slider-bullets--vertical":"slider-bullets--vertical--QuatQ"};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,{AF:()=>Ce,M6:()=>ze,RE:()=>Ce,Sr:()=>Be,YL:()=>lr,Ay:()=>cr}),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})({forwardRef:()=>t.forwardRef,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 w=d(81);b()(w.A,{insert:"head",singleton:!1});const y=w.A.locals||{},_=(e=>{var t={};return d.d(t,e),t})({default:()=>n.default}),P=({onClick:e,className:t})=>(0,l.jsx)("div",{className:(0,_.default)(y.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"})})}),S=(0,u.observer)((e=>{const t=e.needShowErrorScreen,r=e.needShowLoaderScreen;return r||t?(0,l.jsx)("div",{className:(0,_.default)(g.loader),style:Object.assign({"--loader-background":e.background,"--loaderBackgroundColor":e.color},e.style),onClick:e=>{e.preventDefault()},children:t?(0,l.jsx)(P,{className:g["loader__refresh-btn"],onClick:t=>{t.stopPropagation(),e.onReload()}}):r&&(0,l.jsx)("div",{className:g.loader__spinner})}):null})),T=()=>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}))}})}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",T()),this.styleElement=r,null===(t=this.shadowRoot)||void 0===t||t.prepend(r)}async init(e){this.mountPoint&&(this.banner=e,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 E(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("bnr-slides-container")||customElements.define("bnr-slides-container",x);const O=(0,u.observer)((0,c.forwardRef)(((e,t)=>{var{banner:r,direction:n="row"}=e,i=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","direction"]);const a=(0,c.useRef)(null),s=r.canBeShown;(0,c.useLayoutEffect)((()=>{a.current&&a.current.setStyle(r.context.style)}),[r.context.style]),(0,c.useLayoutEffect)((()=>{if(!a.current)return;const e=a.current;return e.init(r),()=>{e.destroy()}}),[r]),(0,c.useEffect)((()=>{if(i.isActive&&s)return r.start(),()=>{r.stop()}}),[r,i.isActive,s]);const o="row"===n?{height:`${Math.ceil(r.width/r.contentRatio)}px`}:{width:`${Math.ceil(r.height*r.contentRatio)}px`};return(0,l.jsxs)("div",{className:(0,_.default)(m.bnr,"ias-bnr",i.className),ref:t,style:Object.assign(Object.assign({},o),{background:r.appearance.background,"--ias-banner-border-radius":`${i.clientAppearance.borderRadius}px`}),children:[(0,l.jsx)("bnr-slides-container",{style:{opacity:s?1:0},class:m["bnr-slides"],ref:a,"allow-click":i.allowClick.toString(),dir:r.dir}),(0,l.jsx)(S,{needShowErrorScreen:r.needShowErrorScreen,needShowLoaderScreen:r.needShowLoaderScreen,onReload:async()=>{r.activeSlide.restart()},background:r.appearance.background,color:E(r.appearance.background)?"black":"white"})]})})));var j=d(243);b()(j.A,{insert:"head",singleton:!1});const I=j.A.locals||{};var C=d(55);b()(C.A,{insert:"head",singleton:!1});const L=C.A.locals||{},k=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",{dir:e.langDirection,className:(0,_.default)(L["slider-bullets"],{[L["slider-bullets--vertical"]]:"column"===e.direction},"ias-bnr-bullets"),children:Array.from({length:e.totalPages}).map(((t,n)=>(0,l.jsx)("div",{className:(0,_.default)("ias-bnr__bullet",L["slider-bullets__bullet"],{[L["slider-bullets__bullet--active"]]:n===e.activeIndex,"ias-bnr__bullet--active":n===e.activeIndex}),onClick:()=>(t=>{r(t),e.onClick(t)})(n)},n)))})};var A=d(41);b()(A.A,{insert:"head",singleton:!1});const B=A.A.locals||{};var M=d(379);b()(M.A,{insert:"head",singleton:!1});const R=M.A.locals||{},D=e=>(0,l.jsxs)("div",{className:(0,_.default)(R.slider__controls,{[R["slider__controls--vertical"]]:"column"===e.direction}),children:[(0,l.jsx)("button",{onClick:e.onPrevClick,className:(0,_.default)("ias-bnr__controls-btn","ias-bnr__controls-btn--prev","ias-bnr__controls-btn--start",R["slider__controls-btn"],R["slider__controls-btn--start"],{[R["slider__controls-btn--disabled"]]:e.prevDisabled,[R["slider__controls-btn--dir--rtl"]]:"rtl"===e.langDirection,"ias-bnr__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-bnr__controls-btn","ias-bnr__controls-btn--next","ias-bnr__controls-btn--end",R["slider__controls-btn"],R["slider__controls-btn--end"],{[R["slider__controls-btn--disabled"]]:e.nextDisabled,[R["slider__controls-btn--dir--rtl"]]:"rtl"===e.langDirection,"ias-bnr__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 N{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 z;!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",e.AutoplayTimerTick="autoplayTimerTick"}(z||(z={}));class W{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,"startPosition",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"startTranslate",{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=>{if(this.slider.animating||!this._enabled)return;e.stopPropagation();const{startPosition:t,startTranslate:r}=this.getTouchStartState(e);this.startPosition=t,this.startTranslate=r,this.isTouched=!0,this.setGrabCursor(!1),this.slider.autoplay.pause()}}),Object.defineProperty(this,"onTouchMove",{enumerable:!0,configurable:!0,writable:!0,value:e=>{if(!this.isTouched)return;e.stopPropagation();const t=this.getTouchDiff(e);if(!(Math.abs(t)>20||this._isMoved))return;this.setGrabCursor(!0),this._isMoved||(this.slider.emit(z.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(z.TouchMove);let n=this.startTranslate+t+r;this.applyLoopFix(n),n=this.startTranslate+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(z.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}enable(){this._enabled=!0}disable(){this._enabled=!1}enableHorizontalSwipeGesture(){this._enabled=!0}disableHorizontalSwipeGesture(){this._enabled=!1}enableVerticalSwipeGesture(){this._enabled=!0}disableVerticalSwipeGesture(){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)}getTouchStartState(e){let t=0,r=0;return"row"===this.slider.options.direction?(t=e instanceof MouseEvent?e.pageX:e.touches[0].clientX,r=this.slider.currentTranslateX):(t=e instanceof MouseEvent?e.pageY:e.touches[0].clientY,r=this.slider.currentTranslateY),{startPosition:t,startTranslate:r}}getTouchDiff(e){let t=0;return"row"===this.slider.options.direction?(t=(e instanceof MouseEvent?e.pageX:e.touches[0].clientX)-this.startPosition,t*=1):(t=(e instanceof MouseEvent?e.pageY:e.touches[0].clientY)-this.startPosition,t*=1),t}setTranslate(e){e=this.applyEdgeResistance(e),this.slider.setTranslate(e)}applyLoopFix(e){if(!this.loopModule.enabled)return;e=this.slider.langDirSign*-e;const t=this.slider.langDirSign*(this.slider.slideSize+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.startTranslate-=t):e>n&&this.loopModule.applyLoopFix({targetIndex:this.slider.slides.length-this.slider.options.slidesPerView,direction:"next"})&&(this.startTranslate+=t)}updateActiveIndex(){if(!this.slider.slides.length)return;const{currentTranslate:e,options:t}=this.slider,r=this.slider.slideSize+t.spaceBetween;let n=this.slider.langDirSign*-Math.round(e/r);const i=this.slider.totalPages-1;n=Math.min(i,Math.max(0,n)),this.slider.slideTo(n)}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.slideSize),1);return.3+.7*Math.exp(3*-t)}applyEdgeResistance(e){if(this.loopModule.enabled)return e;const t=this.slider.langDirSign,r=-t*e,n=this.slider.getMinTranslate(),i=this.slider.getMaxTranslate();let a=r;if(a>i){const e=a-i;a=i+e*this.getResistanceCoeff(e)}else if(a<n){const e=n-a;a=n-e*this.getResistanceCoeff(e)}return-t*a}getSwipeDirection(e){return this.slider.langDirSign*e>0?"prev":"next"}}var F,V=d(46);!function(e){e.Start="start",e.Stop="stop",e.Pause="pause",e.Resume="resume",e.Progress="progress",e.Complete="complete"}(F||(F={}));class U extends V.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(F.Start),this.setTimer(e)))}restart(){this.stop(),this.start(this.timeout)}stop(){this.isCompleted||(this.clearTimer(),this.emit(F.Stop),this.isCompleted=!0,this.timerPaused=!1)}pause(){this.isCompleted||(this.timerPaused=!0,this.clearTimer(),this.progressBeforePause=this.currentProgress,this.emit(F.Pause))}resume(){if(!this.timerPaused)return;this.timerPaused=!1;const e=1-this.progressBeforePause,t=this.timeout*e;this.setTimer(t),this.emit(F.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(F.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(F.Progress,{percents:r,totalTime:this.timeout,currentTime:this.currentProgress*this.timeout})}runTimerTicks(e){const t=performance.now(),r=n=>{let i=(n-t)/e;i>1&&(i=1);const a=i;this.updateProgress(a),i<1&&(this.rafId=requestAnimationFrame(r))};this.rafId=requestAnimationFrame(r)}}class q{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 U}),Object.defineProperty(this,"delay",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"handleTimerComplete",{enumerable:!0,configurable:!0,writable:!0,value:({forceEnd:e})=>{e||this.slider.emit(z.AutoplayTimeLeft)}}),Object.defineProperty(this,"handleTimerProgress",{enumerable:!0,configurable:!0,writable:!0,value:e=>{this.slider.emit(z.AutoplayTimerTick,{currentTime:e.currentTime,totalTime:e.totalTime,percents:e.percents})}}),this.timer.on(F.Complete,this.handleTimerComplete),this.timer.on(F.Progress,this.handleTimerProgress)}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(F.Complete,this.handleTimerComplete),this.timer.off(F.Progress,this.handleTimerProgress),this.stop()}}class H extends V.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,direction:"row",langDirection:"ltr",allowTouchMove:!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,"_currentTranslateY",{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,"_slideHeight",{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(z.Resize)}}),this.track=e,this.container=e.parentElement,this.loopModule=new N(this),this.touchModule=new W(this,this.loopModule),this.autoplay=new q(this,this.loopModule),this.options.updateOnWindowResize&&window.addEventListener("resize",this.handleResize),this.collectSlides(),this.update(t)}get langDirSign(){return"column"===this.options.direction||"ltr"===this.options.langDirection?1:-1}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 currentTranslateY(){return this._currentTranslateY}get currentTranslate(){return"row"===this.options.direction?this._currentTranslateX:this._currentTranslateY}get isMoved(){return this.touchModule.isMoved}get slideWidth(){return this._slideWidth}get slideHeight(){return this._slideHeight}get slideSize(){return"row"===this.options.direction?this.slideWidth:this.slideHeight}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(),this.updateSize(),this.loopModule.update(),this.testAttraction(),this.options.allowTouchMove?this.touchModule.enable():this.touchModule.disable()}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 Math.abs(this.getSlideOffset(this.totalPages-1))}setTranslate(e){"row"===this.options.direction?(this.track.style.transform=`translate3d(${e}px, 0px, 0px)`,this._currentTranslateX=e,this._currentTranslateY=0):(this.track.style.transform=`translate3d(0px, ${e}px, 0px)`,this._currentTranslateX=0,this._currentTranslateY=e),this.testAttraction()}enableHorizontalSwipeGesture(){this.touchModule.enableHorizontalSwipeGesture()}disableHorizontalSwipeGesture(){this.touchModule.disableHorizontalSwipeGesture()}getSlideOffset(e){return this.slides.length?-e*(("row"===this.options.direction?this.slides[0].clientWidth:this.slides[0].clientHeight)+this.options.spaceBetween):0}updateSize(){const e=this.slideWidth,t=this.slideHeight;"row"===this.options.direction?this.calculateSlideWidths():this.calculateSlideHeight(),e===this.slideWidth&&t===this.slideHeight||this.emit(z.SlidesUpdated),this.slideTo(this._activeIndex,0)}getTrackWidth(){return this.track.clientWidth-this.options.spaceBetween*(this.options.slidesPerView-1)}getTrackHeight(){return this.track.clientHeight-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(z.RealIndexChnage,t),n!==e&&this.emit(z.ActiveIndexChange,e)}setupTrackStyles(){Object.assign(this.track.style,{display:"flex",transition:`transform ${this.options.speed}ms ease`,gap:`${this.options.spaceBetween}px`})}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`,e.style.height=""}))}calculateSlideHeight(){this._slideHeight=Math.ceil(this.getTrackHeight()/this.options.slidesPerView),this.slides.forEach((e=>{e.style.height=`${this._slideHeight}px`,e.style.width=""}))}translateSlidesTrack(e,t){this.track.style.transitionDuration=`${t}ms`,this.setTranslate(this.langDirSign*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(z.TransitionStart),await this.waitTransitionEnd(),this.emit(z.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();let r=!this.loopModule.enabled&&this.langDirSign*this.currentTranslate>=e,n=!this.loopModule.enabled&&this.langDirSign*-this.currentTranslate>=t;this.options.slidesPerView===this.slides.length&&(r=!0,n=!0),r!==this._reachStart&&(this._reachStart=r,this.emit(z.ReachStart,r)),n!==this._reachEnd&&(this._reachEnd=n,this.emit(z.ReachEnd,n))}normalizeOptions(e){var t,r,n,i,a,s,o,l,c,d,h;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,direction:null!==(c=e.direction)&&void 0!==c?c:this.options.direction,allowTouchMove:null!==(d=e.allowTouchMove)&&void 0!==d?d:this.options.allowTouchMove,langDirection:null!==(h=e.langDirection)&&void 0!==h?h:this.options.langDirection}}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 $=(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 H(n.current,{autoplay:e.autoplay,speed:e.speed,loop:e.loop,slidesPerView:e.slidesPerView,spaceBetween:e.spaceBetween,allowTouchMove:e.allowTouchMove,direction:e.direction,langDirection:e.langDirection});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,allowTouchMove:e.allowTouchMove,direction:e.direction,langDirection:e.langDirection})}),[t,e.autoplay,e.speed,e.loop,e.langDirection,e.slidesPerView,e.spaceBetween,e.slidesCount,e.allowTouchMove,e.direction]),(0,l.jsxs)("div",{className:(0,_.default)("ias-bnr-slider",B.slider,{[B["slider--vertical"]]:"column"===e.direction}),children:[(0,l.jsx)("div",{dir:e.langDirection,ref:n,className:(0,_.default)("ias-bnr-slider__track",B.slider__track),children:e.children}),t&&e.pagination.enabled&&(0,l.jsx)(k,{direction:e.direction,langDirection:e.langDirection,totalPages:t.totalPages,activeIndex:t.realIndex,onClick:r=>{e.loop?t.slideToLoop(r):t.slideTo(r)}}),t&&e.navigation.enabled&&(0,l.jsx)(D,{direction:e.direction,langDirection:e.langDirection,onPrevClick:()=>{t.toPrevSlide()},onNextClick:()=>{t.toNextSlide()},nextDisabled:t.reachEnd,prevDisabled:t.reachStart})]})})),G=e=>(0,l.jsx)("div",{className:(0,_.default)(B.slider__slide,e.className),style:e.style,children:e.children});class X{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 Y{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 X(this.slider)})}getTotalPages(){return this.slider.totalPages}getActiveIndex(){return this.slider.realIndex}toNextSlide(){this.slider.isMoved||this.slider.toNextSlide()}toPrevSlide(){this.slider.isMoved||this.slider.toPrevSlide()}slideTo(e,t){this.slider.isMoved||this.slider.slideToLoop(e,t)}enableHorizontalSwipeGesture(){this.slider.enableHorizontalSwipeGesture()}disableHorizontalSwipeGesture(){this.slider.disableHorizontalSwipeGesture()}updateSize(){this.slider.updateSize()}}const Q=(e=>{var t={};return d.d(t,e),t})({action:()=>i.action,computed:()=>i.computed,observable:()=>i.observable,reaction:()=>i.reaction});var K=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 J=(()=>{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,K(this,n,void 0)),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:K(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(){const e=Math.trunc(Date.now()/1e3);return(!this.displayFrom||e>=this.displayFrom)&&(!this.displayTo||e<=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=[Q.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 Z{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 ee{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 te(e,t,r){return String(e).replace(new RegExp(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(t),"g"),(()=>r))}var re=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 ne=(()=>{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}get payload(){return this._payload}constructor(e){t.set(this,re(this,n,void 0)),Object.defineProperty(this,"_payload",{enumerable:!0,configurable:!0,writable:!0,value:re(this,i)}),this._html=this.replaceSlideNonce(e.html),this._payload=e.payload}updatePlaceholders(e){let t=this._html;for(const r of e)t=te(t,`%${r.key}%`,r.value);this._html=t}replaceSlideNonce(e){var t;return te(e,"{{nonce}}",null!==(t=T())&&void 0!==t?t:"")}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[Q.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 ie=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 ae=(()=>{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,ie(this,n,[])),ie(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=[Q.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 se=(e,t)=>{if("number"==typeof e)return e;if("string"==typeof e){const t=parseFloat(e);if(!isNaN(t))return t}return t};var oe=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},le=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},ce=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)},de=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 he=(()=>{var e,t;let r,n=[],i=[];return e=class{get borderRadius(){return ce(this,t,"f")}set borderRadius(e){de(this,t,e,"f")}update(e){this.borderRadius=se(null==e?void 0:e.borderRadius,this.borderRadius)}constructor(){t.set(this,le(this,n,12)),le(this,i)}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[Q.observable],oe(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})(),ue=(()=>{var e,t,r,n,i,a,s,o,l,c;let d,h,u,p,b,f,m,v,g,w=[],y=[],_=[],P=[],S=[],T=[],x=[],E=[],O=[],j=[],I=[],C=[],L=[],k=[],A=[],B=[],M=[],R=[];return e=class{get loop(){return ce(this,t,"f")}set loop(e){de(this,t,e,"f")}get gap(){return ce(this,r,"f")}set gap(e){de(this,r,e,"f")}get autoplay(){return ce(this,n,"f")}set autoplay(e){de(this,n,e,"f")}get animationSpeed(){return ce(this,i,"f")}set animationSpeed(e){de(this,i,e,"f")}get slidesPerView(){return ce(this,a,"f")}set slidesPerView(e){de(this,a,e,"f")}get navigation(){return ce(this,s,"f")}set navigation(e){de(this,s,e,"f")}get pagination(){return ce(this,o,"f")}set pagination(e){de(this,o,e,"f")}get direction(){return ce(this,l,"f")}set direction(e){de(this,l,e,"f")}get allowTouchMove(){return ce(this,c,"f")}set allowTouchMove(e){de(this,c,e,"f")}constructor(e){t.set(this,le(this,w,!0)),r.set(this,(le(this,y),le(this,_,16))),n.set(this,(le(this,P),le(this,S,!0))),i.set(this,(le(this,T),le(this,x,300))),a.set(this,(le(this,E),le(this,O,1))),s.set(this,(le(this,j),le(this,I,{enabled:!0}))),o.set(this,(le(this,C),le(this,L,{enabled:!0}))),l.set(this,(le(this,k),le(this,A,"row"))),c.set(this,(le(this,B),le(this,M,!0))),Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:(le(this,R),new he)}),e&&this.update(e)}update(e){var t,r,n,i,a,s,o,l;this.loop=null!==(t=null==e?void 0:e.loop)&&void 0!==t?t:this.loop,this.gap=se(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=se(null==e?void 0:e.animationSpeed,this.animationSpeed),this.slidesPerView=Math.max(se(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.direction=null!==(o=e.direction)&&void 0!==o?o:this.direction,this.allowTouchMove=null!==(l=e.allowTouchMove)&&void 0!==l?l:this.allowTouchMove,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,l=new WeakMap,c=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;d=[Q.observable],h=[Q.observable],u=[Q.observable],p=[Q.observable],b=[Q.observable],f=[Q.observable],m=[Q.observable],v=[Q.observable],g=[Q.observable],oe(e,null,d,{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},w,y),oe(e,null,h,{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},_,P),oe(e,null,u,{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},S,T),oe(e,null,p,{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},x,E),oe(e,null,b,{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},O,j),oe(e,null,f,{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},I,C),oe(e,null,m,{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},L,k),oe(e,null,v,{kind:"accessor",name:"direction",static:!1,private:!1,access:{has:e=>"direction"in e,get:e=>e.direction,set:(e,t)=>{e.direction=t}},metadata:t},A,B),oe(e,null,g,{kind:"accessor",name:"allowTouchMove",static:!1,private:!1,access:{has:e=>"allowTouchMove"in e,get:e=>e.allowTouchMove,set:(e,t)=>{e.allowTouchMove=t}},metadata:t},M,R),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();const pe=(e=>{var t={};return d.d(t,e),t})({v4:()=>a.v4});class be{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,pe.v4)()})}get type(){return"view"}toQueryParams(){return{ei:this.eventId,ii:this.payload.iterationId,si:this.payload.slideIndex,st:this.payload.slideTotal}}}class fe{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,pe.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)}}class me{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 ve,ge=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},we=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},ye=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)},_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");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r};!function(e){e.LoadStart="loadStart",e.LoadEnd="loadEnd",e.LoadError="loadError",e.ActiveIndexChange="activeIndexChange",e.AutoplayTimeLeft="autoplayTimeLeft",e.AutoplayTimerTick="autoplayTimerTick",e.ShowBanner="showBanner",e.ShowBannerFailed="showBannerFailed",e.BannerWidget="bannerWidget"}(ve||(ve={}));let Pe=(()=>{var e,t,r,n,i,a;let s,o,l,c,d,h=V.EventEmitter,u=[],p=[],b=[],f=[],m=[],v=[],g=[],w=[],y=[],_=[];return e=class extends h{get _banners(){return ye(this,t,"f")}set _banners(e){_e(this,t,e,"f")}get _bannerPlace(){return ye(this,r,"f")}set _bannerPlace(e){_e(this,r,e,"f")}get _isLoading(){return ye(this,n,"f")}set _isLoading(e){_e(this,n,e,"f")}get _isLoaded(){return ye(this,i,"f")}set _isLoaded(e){_e(this,i,e,"f")}get _error(){return ye(this,a,"f")}set _error(e){_e(this,a,e,"f")}constructor(e,s,o,l,c){super(),Object.defineProperty(this,"placeId",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"bannerStatisticService",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"bannerStore",{enumerable:!0,configurable:!0,writable:!0,value:l}),Object.defineProperty(this,"bannerViewModelFactory",{enumerable:!0,configurable:!0,writable:!0,value:c}),t.set(this,we(this,u,[])),r.set(this,(we(this,p),we(this,b,null))),n.set(this,(we(this,f),we(this,m,!1))),i.set(this,(we(this,v),we(this,g,!1))),a.set(this,(we(this,w),we(this,y,null))),Object.defineProperty(this,"appearance",{enumerable:!0,configurable:!0,writable:!0,value:(we(this,_),new ue)}),Object.defineProperty(this,"sliderController",{enumerable:!0,configurable:!0,writable:!0,value:new me}),this.ctx.addBannerPlace(this)}get dir(){return this.ctx.getConfig().dir}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 error(){return this._error}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 me;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(await this.ctx.waitForConfig()).anonymous?(console.warn("[IAS]: You can't fetch banners in anonymous access mode"),[]):this._isLoading?[]:(this._isLoading=!0,this._isLoaded=!1,this._error=null,this.emit(ve.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(ve.LoadError,e),this._error=e,e}finally{this.emit(ve.LoadEnd,{banners:this._banners.slice()}),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,a=new WeakMap,(()=>{var t;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=h[Symbol.metadata])&&void 0!==t?t:null):void 0;s=[Q.observable],o=[Q.observable],l=[Q.observable],c=[Q.observable],d=[Q.observable],ge(e,null,s,{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},u,p),ge(e,null,o,{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},b,f),ge(e,null,l,{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},m,v),ge(e,null,c,{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},g,w),ge(e,null,d,{kind:"accessor",name:"_error",static:!1,private:!1,access:{has:e=>"_error"in e,get:e=>e._error,set:(e,t)=>{e._error=t}},metadata:r},y,_),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),e})();const Se=e=>((0,c.useEffect)((()=>(e.onLoadStart&&e.bannerPlace.on(ve.LoadStart,e.onLoadStart),e.onLoadEnd&&e.bannerPlace.on(ve.LoadEnd,e.onLoadEnd),e.onLoadError&&e.bannerPlace.on(ve.LoadError,e.onLoadError),e.onActiveIndexChange&&e.bannerPlace.on(ve.ActiveIndexChange,e.onActiveIndexChange),e.onAutoplayTimeLeft&&e.bannerPlace.on(ve.AutoplayTimeLeft,e.onAutoplayTimeLeft),e.onAutoplayTimerTick&&e.bannerPlace.on(ve.AutoplayTimerTick,e.onAutoplayTimerTick),e.onShowBanner&&e.bannerPlace.on(ve.ShowBanner,e.onShowBanner),e.onShowBannerFailed&&e.bannerPlace.on(ve.ShowBannerFailed,e.onShowBannerFailed),e.onBannerWidget&&e.bannerPlace.on(ve.BannerWidget,e.onBannerWidget),()=>{e.onLoadStart&&e.bannerPlace.off(ve.LoadStart,e.onLoadStart),e.onLoadEnd&&e.bannerPlace.off(ve.LoadEnd,e.onLoadEnd),e.onLoadError&&e.bannerPlace.off(ve.LoadError,e.onLoadError),e.onActiveIndexChange&&e.bannerPlace.off(ve.ActiveIndexChange,e.onActiveIndexChange),e.onAutoplayTimeLeft&&e.bannerPlace.off(ve.AutoplayTimeLeft,e.onAutoplayTimeLeft),e.onAutoplayTimerTick&&e.bannerPlace.off(ve.AutoplayTimerTick,e.onAutoplayTimerTick),e.onShowBanner&&e.bannerPlace.off(ve.ShowBanner,e.onShowBanner),e.onShowBannerFailed&&e.bannerPlace.off(ve.ShowBannerFailed,e.onShowBannerFailed),e.onBannerWidget&&e.bannerPlace.off(ve.BannerWidget,e.onBannerWidget)})),[e.bannerPlace,e.onLoadStart,e.onLoadError,e.onLoadEnd,e.onActiveIndexChange,e.onAutoplayTimeLeft,e.onAutoplayTimerTick,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),Te=e=>{(0,c.useEffect)((()=>{e.appearance&&e.bannerPlace.updateAppearance(e.appearance)}),[e.bannerPlace,JSON.stringify(e.appearance)])},xe=({bannerPlace:e,bannerPlaceRef:t})=>{const[r,n]=(0,c.useState)(!1),[i,a]=(0,c.useState)(null),s=(0,c.useRef)();return(0,c.useEffect)((()=>{if(e.banners.length)return(async(e=5e3)=>new Promise(((r,n)=>{s.current=setTimeout((()=>{n(new Error("[IAS]: Unable to calculate banner place width. Check if you are using ad blockers such as AdBlock, uBlock Origin, etc."))}),e);const i=()=>{if(t.current&&t.current.clientWidth>0)return clearTimeout(s.current),void r();requestAnimationFrame(i)};requestAnimationFrame(i)})))().then((()=>{n(!0)})).catch((e=>{a(e),console.error(e)})),()=>{clearTimeout(s.current),n(!1)}}),[e.isLoaded,e.banners.length]),{canBeShown:r,error:i}},Ee=(0,u.observer)((e=>{const t=(0,c.useRef)(null),r=Se(e);Te(e);const{realIndex:n,allowClick:i,slider:a,isAnimating:s,setSlider:o,isMoved:d}=(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),[w,y]=(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)},P=()=>{t.current=setTimeout((()=>d(!0)),100),o(!1),((e,t)=>{t.banners.forEach((e=>e.resume()))})(0,e)},S=()=>{a(!0),d(!1)},T=()=>{a(!1),d(!0)},x=t=>{m(t),e.emit(ve.ActiveIndexChange,t)},E=e=>{b(e)},O=()=>{h&&g(h.reachStart)},j=()=>{h&&y(h.reachEnd)},I=()=>{},C=()=>{e.refreshSizes(),requestAnimationFrame((()=>{e.refreshSizes(),n((e=>!e))}))},L=()=>{e.emit(ve.AutoplayTimeLeft),e.notifyTimerEnd()},k=t=>{e.emit(ve.AutoplayTimerTick,Object.assign(Object.assign({},t),{bannerIndex:e.activeIndex}))};return(0,c.useEffect)((()=>{if(!h)return;const t=new Y(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(z.TouchStart,_),h.on(z.TouchEnd,P),h.on(z.TransitionStart,S),h.on(z.TransitionEnd,T),h.on(z.RealIndexChnage,x),h.on(z.ActiveIndexChange,E),h.on(z.ReachStart,O),h.on(z.ReachEnd,j),h.on(z.Resize,I),h.on(z.SlidesUpdated,C),h.on(z.AutoplayTimeLeft,L),h.on(z.AutoplayTimerTick,k),O(),j(),()=>{h.off(z.TouchStart,_),h.off(z.TouchEnd,P),h.off(z.TransitionStart,S),h.off(z.TransitionEnd,T),h.off(z.RealIndexChnage,x),h.off(z.ActiveIndexChange,E),h.off(z.ReachStart,O),h.off(z.ReachEnd,j),h.off(z.Resize,I),h.off(z.SlidesUpdated,C),h.off(z.AutoplayTimeLeft,L),h.off(z.AutoplayTimerTick,k)}}),[e,h]),{reachStart:v,reachEnd:w,activeIndex:p,realIndex:f,isMoved:s,isAnimating:i,slider:h,setSlider:u,allowClick:l}})(e.bannerPlace),{error:h,canBeShown:u}=xe({bannerPlace:e.bannerPlace,bannerPlaceRef:t});(0,c.useEffect)((()=>{a&&u&&(a.updateSize(),e.bannerPlace.refreshSizes(),requestAnimationFrame((()=>{e.bannerPlace.refreshSizes()})))}),[e.bannerPlace,u]);const p=e.bannerPlace.appearance;return!e.bannerPlace.banners.length||h?null:(0,l.jsx)("div",{className:(0,_.default)(I["bnr-place"],e.className),style:Object.assign(Object.assign({},e.style),{"--ias-bnr-place-border-radius":`${p.banner.borderRadius}px`}),ref:t,children:(0,l.jsx)($,{onInit:o,autoplay:p.autoplay,speed:p.animationSpeed,loop:p.loop,slidesPerView:p.slidesPerView,spaceBetween:p.gap,slidesCount:r.length,navigation:p.navigation,pagination:p.pagination,direction:p.direction,allowTouchMove:p.allowTouchMove,langDirection:e.bannerPlace.dir,children:r.map(((e,t)=>{const r=Boolean(null==a?void 0:a.isSlideVisible(t))&&u;return(0,l.jsx)(G,{children:(0,l.jsx)(O,{index:t,isActive:r,canBeInited:r,banner:e,className:I["bnr-slider__slide"],allowClick:i,clientAppearance:p.banner,direction:p.direction})},e.id)}))})})})),Oe=(e=>{var t={};return d.d(t,e),t})({createRoot:()=>s.createRoot});class je{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,Oe.createRoot)(this.rootElement)}get dir(){return this.bannerPlace.dir}get activeIndex(){return this.bannerPlace.activeIndex}get activeBanner(){return this.bannerPlace.activeBanner}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 error(){return this.bannerPlace.error}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)(Ee,{appearance:null===(e=this.params)||void 0===e?void 0:e.appearance,bannerPlace:this.bannerPlace}))}}class Ie extends je{render(){var e;this.root.render((0,l.jsx)(Ne,{appearance:null===(e=this.params)||void 0===e?void 0:e.appearance,bannerPlace:this.bannerPlace}))}}const Ce=e=>{const[t,r]=(0,c.useState)(null);return(0,c.useEffect)((()=>{var t;const n=sr().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)(Ee,Object.assign({bannerPlace:t},e)):null};var Le=d(713);b()(Le.A,{insert:"head",singleton:!1});const ke=Le.A.locals||{},Ae=(0,u.observer)((e=>{const t=Se(e),r=(0,c.useRef)(null),{error:n,canBeShown:i}=xe({bannerPlace:e.bannerPlace,bannerPlaceRef:r}),a=t[0];return(0,c.useEffect)((()=>{i&&(e.bannerPlace.refreshSizes(),requestAnimationFrame((()=>{e.bannerPlace.refreshSizes()})))}),[e.bannerPlace,i]),e.bannerPlace.error||n?null:(0,l.jsx)("div",{className:ke["bnr-place"],ref:r,children:a&&i&&!e.bannerPlace.isLoading?(0,l.jsx)(O,{index:0,isActive:!0,canBeInited:!0,banner:a,allowClick:!0,clientAppearance:e.bannerPlace.appearance.banner}):(0,l.jsx)(S,{needShowErrorScreen:!1,needShowLoaderScreen:!0,onReload:()=>{}})})})),Be=e=>{const[t,r]=(0,c.useState)(null);return(0,c.useEffect)((()=>{var t;const n=sr().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)(Ae,Object.assign({bannerPlace:t},e)):null};var Me=d(883);b()(Me.A,{insert:"head",singleton:!1});const Re=Me.A.locals||{},De=({banner:e,index:t,clientAppearance:r,canBeShown:n})=>{const[i,a]=(0,c.useState)(!1),s=(0,c.useRef)(null);return(0,c.useEffect)((()=>{const e=new IntersectionObserver((e=>{e.forEach((e=>{e.intersectionRatio>=.5?a(!0):a(!1)}))}),{threshold:[0,.5,1]});return s.current&&e.observe(s.current),()=>{s.current&&e.unobserve(s.current)}}),[]),(0,l.jsx)(O,{index:t,isActive:i&&n,canBeInited:i&&n,banner:e,allowClick:!0,clientAppearance:r,direction:"row",ref:s},e.id)},Ne=(0,u.observer)((e=>{const t=(0,c.useRef)(null),r=Se(e);Te(e);const{error:n,canBeShown:i}=xe({bannerPlace:e.bannerPlace,bannerPlaceRef:t});(0,c.useEffect)((()=>{i&&(e.bannerPlace.refreshSizes(),requestAnimationFrame((()=>{e.bannerPlace.refreshSizes()})))}),[e.bannerPlace,i]);const a=e.bannerPlace.appearance;return!e.bannerPlace.banners.length||n?null:(0,l.jsx)("div",{className:(0,_.default)(Re["bnr-place"],e.className),style:Object.assign(Object.assign({},e.style),{gap:a.gap}),ref:t,children:r.map(((e,t)=>(0,l.jsx)(De,{banner:e,canBeShown:i,index:t,clientAppearance:a.banner},e.id)))})})),ze=e=>{const[t,r]=(0,c.useState)(null);return(0,c.useEffect)((()=>{var t;const n=sr().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)(Ne,Object.assign({bannerPlace:t},e)):null};var We=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},Fe=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},Ve=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)},Ue=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 qe=(()=>{var e,t,r,n,i;let a,s,o,l,c=V.EventEmitter,d=[],h=[],u=[],p=[],b=[],f=[],m=[],v=[];return e=class extends c{get _banners(){return Ve(this,t,"f")}set _banners(e){Ue(this,t,e,"f")}get _isLoading(){return Ve(this,r,"f")}set _isLoading(e){Ue(this,r,e,"f")}get _isLoaded(){return Ve(this,n,"f")}set _isLoaded(e){Ue(this,n,e,"f")}get _error(){return Ve(this,i,"f")}set _error(e){Ue(this,i,e,"f")}constructor(e,a,s,o){super(),Object.defineProperty(this,"bannerId",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"bannerStore",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"bannerViewModelFactory",{enumerable:!0,configurable:!0,writable:!0,value:o}),t.set(this,Fe(this,d,[])),r.set(this,(Fe(this,h),Fe(this,u,!1))),n.set(this,(Fe(this,p),Fe(this,b,!1))),i.set(this,(Fe(this,f),Fe(this,m,null))),Object.defineProperty(this,"appearance",{enumerable:!0,configurable:!0,writable:!0,value:(Fe(this,v),new ue)}),this.ctx.addBannerPlace(this)}get dir(){return this.ctx.getConfig().dir}get activeIndex(){return 0}get activeBanner(){return this._banners[0]}get id(){return"__BANNER_PREVIEW__"}get slider(){return new me}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}get error(){return this._error}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._error=null,this._isLoading=!0,this._isLoaded=!1,this.emit(ve.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(ve.LoadError,e),this._error=e,e}finally{this.emit(ve.LoadEnd),this._isLoading=!1}}},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=[Q.observable],s=[Q.observable],o=[Q.observable],l=[Q.observable],We(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),We(e,null,s,{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},u,p),We(e,null,o,{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},b,f),We(e,null,l,{kind:"accessor",name:"_error",static:!1,private:!1,access:{has:e=>"_error"in e,get:e=>e._error,set:(e,t)=>{e._error=t}},metadata:r},m,v),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),e})();class He{constructor(e){Object.defineProperty(this,"bannerStatisticApi",{enumerable:!0,configurable:!0,writable:!0,value:e})}async sendViewEvent(e,t){const r=new be(t);await this.bannerStatisticApi.sendViewEvent(e,r)}async sendWidgetEvent(e,t){const r=new fe(t);await this.bannerStatisticApi.sendWidgetEvent(e,r)}}class $e{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 Ge{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.pause(),t.once("close",(()=>{this.bannerPlaceViewModel.resume()}))}catch(e){console.error(e)}}}var Xe,Ye,Qe,Ke,Je,Ze,et,tt,rt,nt,it,at,st,ot,lt,ct,dt,ht,ut,pt;!function(e){e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end"}(Xe||(Xe={})),Xe.END,function(e){e.Text="text",e.Link="link",e.Image="image"}(Ye||(Ye={})),function(e){e.DEFAULT="default",e.CUSTOM_CARD="customCard"}(Qe||(Qe={})),Qe.DEFAULT,Qe.DEFAULT,function(e){e.CENTER="center",e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end"}(Ke||(Ke={})),function(e){e.CIRCLE="circle",e.QUAD="quad",e.RECTANGLE="rectangle"}(Je||(Je={})),function(e){e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end",e.CENTER="center"}(Ze||(Ze={})),function(e){e.CARD_INSIDE_BOTTOM="cardInsideBottom",e.CARD_OUTSIDE_TOP="cardOutsideTop",e.CARD_OUTSIDE_BOTTOM="cardOutsideBottom"}(et||(et={})),function(e){e.Medium="medium",e.High="high"}(tt||(tt={})),function(e){e.COLUMN="vertical",e.ROW="horizontal"}(rt||(rt={})),function(e){e.START_LOADER="startLoad",e.END_LOADER="endLoad"}(nt||(nt={})),rt.ROW,Ze.START,et.CARD_INSIDE_BOTTOM,tt.High,Je.RECTANGLE,Ze.START,et.CARD_INSIDE_BOTTOM,tt.High,Je.CIRCLE,Ke.START,Ze.START,et.CARD_INSIDE_BOTTOM,tt.High,Je.CIRCLE,function(e){e.WidgetEvent="widgetEvent",e.ClickOnButton="clickOnButton"}(it||(it={})),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"}(at||(at={})),function(e){e.FLAT="flat",e.COVER="cover",e.CUBE="cube"}(st||(st={})),function(e){e.Classic="classic",e.Modern="modern"}(ot||(ot={})),st.FLAT,ot.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"}(lt||(lt={})),function(e){e.direct="direct",e.onboarding="onboarding",e.list="list",e.favorite="favorite"}(ct||(ct={})),function(e){e[e.default=0]="default",e[e.favorite=1]="favorite",e[e.stacked=2]="stacked"}(dt||(dt={})),function(e){e.LTR="ltr",e.RTL="rtl"}(ht||(ht={})),function(e){e.StoryList="storyList",e.StoryReader="storyReader",e.GameReader="gameReader",e.StackStoryList="stackStoryList",e.IamReader="iamReader",e.Banners="banners"}(ut||(ut={}));class bt{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),r={src:ut.Banners,data:{id:this.banner.id,index:this.banner.activeSlideIndex,url:t,elementId:e.elementId}};this.storyManager.storyLinkClickHandler(r),this.storyManager.emit("clickOnButton",r)}catch(t){t instanceof URIError?console.error(`[Banners]: the URL <${e.linkTarget}> has an invalid format`):console.error(t)}}}class ft{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{const t={src:ut.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)}}}class mt{constructor(){Object.defineProperty(this,"textArea",{enumerable:!0,configurable:!0,writable:!0,value:null})}async copy(e){try{navigator.clipboard&&window.isSecureContext?await navigator.clipboard.writeText(e):this.copyLegacy(e)}catch(t){this.copyLegacy(e)}}isIOS(){return/ipad|iphone/i.test(navigator.userAgent)}createTextArea(e){this.textArea=document.createElement("textarea"),this.textArea.value=e,document.body.appendChild(this.textArea)}selectText(){if(this.textArea)if(this.isIOS()){const e=document.createRange();e.selectNodeContents(this.textArea);const t=window.getSelection();t&&(t.removeAllRanges(),t.addRange(e)),this.textArea.setSelectionRange(0,999999)}else this.textArea.select()}copyLegacy(e){this.createTextArea(e),this.selectText();try{document.execCommand("copy")}catch(e){console.error("Copy failed:",e)}this.textArea&&(document.body.removeChild(this.textArea),this.textArea=null)}}class vt{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 gt{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}}Object.defineProperty(gt,"name",{enumerable:!0,configurable:!0,writable:!0,value:"bannerWidget"});class wt{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}}Object.defineProperty(wt,"name",{enumerable:!0,configurable:!0,writable:!0,value:"showBanner"});class yt{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}}Object.defineProperty(yt,"name",{enumerable:!0,configurable:!0,writable:!0,value:"showBannerFailed"});class _t{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 $e}),Object.defineProperty(this,"narrativeDataCache",{enumerable:!0,configurable:!0,writable:!0,value:new $e})}onWidgetRequirePauseUI(){this.banner.pause()}onWidgetRequireResumeUI(){this.banner.resume()}productCartUpdate(e){return Promise.reject({message:"Not implemented"})}productCartClicked(){}async productCartGetState(){return Promise.reject("Not implemented")}onEvent(e,t){}onCardLoadingStateChange(e){}updateCardServerDataLocally(e){this.banner.context.updateNarrativeSavedData(e)}async updateTimeline(e,t,r,n,i,a){"before_start"!==t&&(i?this.banner.showLoaderScreen():this.banner.activeSlide.inited&&this.banner.hideLoaderScreen(),a?this.banner.showErrorScreen():this.banner.hideErrorScreen()),new vt(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}),this.bannerPlace.emit(gt.name,new gt({id:this.banner.id,bannerPlace:this.bannerPlace.id,widgetEventName:e,widgetData:null!=r?r:{}}).payload),this.storyManager.emit("widgetEvent",{name:e,data:r})}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 ft(this.storyManager,this.bannerPlace,this.banner).handle({storyId:e,slideIndex:t})}openGame(e){new Ge(this.storyManager,this.bannerPlace,this.banner).handle({gameInstanceId:e})}writeToClipboard(e){(new mt).copy(e.textValue)}openUrl(e){"swipeUpItems"!==e.type&&new bt(this.storyManager,this.banner).handle({elementId:e.elementId,linkTarget:e.link.target})}}!function(e){e.Top="top",e.Bottom="bottom"}(pt||(pt={}));const Pt=pt.Bottom;class St{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:Pt}),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:Pt}}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 Tt=(e=>{var t={};return d.d(t,e),t})({SlideApi:()=>o.SlideApi});let xt;xt=function(){},new Error("timeout while waiting for mutex to become available"),new Error("mutex already locked");const Et=new Error("request for lock canceled");class Ot{constructor(e,t=Et){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=jt(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=jt(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 jt(e,t){for(let r=e.length-1;r>=0;r--)if(t(e[r]))return r;return-1}class It{constructor(e){this._semaphore=new Ot(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 Ct{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 It}),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,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){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 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 Lt{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 kt=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},At=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},Bt=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)},Mt=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 Rt=(()=>{var e,t,r,n,i,a,s,o;let l,c,d,h,u,p,b,f,m,v,g,w,y,_,P=[],S=[],x=[],E=[],O=[],j=[],I=[],C=[],L=[],k=[],A=[],B=[],M=[],R=[],D=[];return e=class{get _$root(){return Bt(this,t,"f")}set _$root(e){Mt(this,t,e,"f")}get _needShowErrorScreen(){return Bt(this,r,"f")}set _needShowErrorScreen(e){Mt(this,r,e,"f")}get _needShowLoaderScreen(){return Bt(this,n,"f")}set _needShowLoaderScreen(e){Mt(this,n,e,"f")}get _width(){return Bt(this,i,"f")}set _width(e){Mt(this,i,e,"f")}get _height(){return Bt(this,a,"f")}set _height(e){Mt(this,a,e,"f")}get _slides(){return Bt(this,s,"f")}set _slides(e){Mt(this,s,e,"f")}get isInited(){return Bt(this,o,"f")}set isInited(e){Mt(this,o,e,"f")}constructor(e,l,c,d,h){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(kt(this,P),e)}),Object.defineProperty(this,"bannerPlace",{enumerable:!0,configurable:!0,writable:!0,value:l}),Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:c}),Object.defineProperty(this,"bannerStatisticService",{enumerable:!0,configurable:!0,writable:!0,value:d}),Object.defineProperty(this,"bannerStore",{enumerable:!0,configurable:!0,writable:!0,value:h}),t.set(this,kt(this,S,null)),r.set(this,(kt(this,x),kt(this,E,!1))),n.set(this,(kt(this,O),kt(this,j,!1))),i.set(this,(kt(this,I),kt(this,C,0))),a.set(this,(kt(this,L),kt(this,k,0))),s.set(this,(kt(this,A),kt(this,B,[]))),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:(kt(this,M),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:()=>{}}),o.set(this,kt(this,R,!1)),Object.defineProperty(this,"attachRoot",{enumerable:!0,configurable:!0,writable:!0,value:(kt(this,D),async e=>{this._$root||(this._$root=e,this.slideApi=this.createSlideApi(e),this._slides=[new Ct(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 _t(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 height(){return this._height}get activeSlide(){var e;return null!==(e=this._slides[this.activeSlideIndex])&&void 0!==e?e:new Lt}get needShowErrorScreen(){return this._needShowErrorScreen}get needShowLoaderScreen(){return this._needShowLoaderScreen}get canBeShown(){return Boolean(this._$root)&&this.isInited}get iterationId(){return this._iterationId}get durationMs(){return Date.now()-this._startTime}async init(){this.isInited||(this.showLoaderScreen(),await this.activeSlide.init(),this._initPromiseResolver(),this.isInited=!0)}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 r=this.activeSlide;this._slides=[],this._$root=null,this.isInited=!1,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 St(Object.assign({mountPoint:t},e)),this.toast.show(e.content)}detachRoot(){var e;this.isInited=!1,this._$root=null,this._slides.forEach((e=>e.destroy())),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,pe.v4)(),this.banner.markAsOpened(),this.markWasShown()}async waitInit(){await 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 Tt.SlideApi(this.slideApiImpl,{root:e,slideRatio:this.banner.appearance.contentRatio,isFullscreen:!1,nonce:T(),viewport:window,userResizeHandler:e=>{this._width=e.viewportWidth,this._height=e.viewportHeight},VODPlayer:this.storyManager.globalProperties.$videoOnDemand,overlappingActionBarHeight:0,useSdkCacheForMultislideMode:!1})}emitShowBannerEvent(){this.bannerPlace.emit(wt.name,new wt({id:this.id,bannerPlace:this.bannerPlace.id,payload:this.activeSlide.payload}).payload)}emitShowBannerFailedEvent(e){this.bannerPlace.emit(yt.name,new yt({id:this.id,bannerPlace:this.bannerPlace.id,error:e,payload:this.activeSlide.payload}).payload)}},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=[Q.observable],c=[Q.observable],d=[Q.observable],h=[Q.observable],u=[Q.observable],p=[Q.observable],b=[Q.observable],f=[Q.computed],m=[Q.computed],v=[Q.computed],g=[Q.action],w=[Q.action],y=[Q.action],_=[Q.action],At(e,null,l,{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},S,x),At(e,null,c,{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},E,O),At(e,null,d,{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},j,I),At(e,null,h,{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},C,L),At(e,null,u,{kind:"accessor",name:"_height",static:!1,private:!1,access:{has:e=>"_height"in e,get:e=>e._height,set:(e,t)=>{e._height=t}},metadata:t},k,A),At(e,null,p,{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},B,M),At(e,null,b,{kind:"accessor",name:"isInited",static:!1,private:!1,access:{has:e=>"isInited"in e,get:e=>e.isInited,set:(e,t)=>{e.isInited=t}},metadata:t},R,D),At(e,null,f,{kind:"getter",name:"activeSlide",static:!1,private:!1,access:{has:e=>"activeSlide"in e,get:e=>e.activeSlide},metadata:t},null,P),At(e,null,m,{kind:"getter",name:"needShowLoaderScreen",static:!1,private:!1,access:{has:e=>"needShowLoaderScreen"in e,get:e=>e.needShowLoaderScreen},metadata:t},null,P),At(e,null,v,{kind:"getter",name:"canBeShown",static:!1,private:!1,access:{has:e=>"canBeShown"in e,get:e=>e.canBeShown},metadata:t},null,P),At(e,null,g,{kind:"method",name:"showErrorScreen",static:!1,private:!1,access:{has:e=>"showErrorScreen"in e,get:e=>e.showErrorScreen},metadata:t},null,P),At(e,null,w,{kind:"method",name:"showLoaderScreen",static:!1,private:!1,access:{has:e=>"showLoaderScreen"in e,get:e=>e.showLoaderScreen},metadata:t},null,P),At(e,null,y,{kind:"method",name:"hideLoaderScreen",static:!1,private:!1,access:{has:e=>"hideLoaderScreen"in e,get:e=>e.hideLoaderScreen},metadata:t},null,P),At(e,null,_,{kind:"method",name:"hideErrorScreen",static:!1,private:!1,access:{has:e=>"hideErrorScreen"in e,get:e=>e.hideErrorScreen},metadata:t},null,P),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class Dt{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 Rt(this.storyManager,e,t,this.bannerStatisticService,this.bannerStore)}}function Nt(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 zt extends Error{constructor(e){super(`[IAS]: Banner with ID ${e} not found`),this.name="IasBannerNotFoundError"}}class Wt extends Error{constructor(e){super(`[IAS]: Banner slot with ID ${e} not found`),this.name="IasBannerPlaceNotFoundError"}}var Ft=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},Vt=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 Ut=(()=>{var e;let t,r,n,i,a=[];return e=class{constructor(e){Object.defineProperty(this,"httpClient",{enumerable:!0,configurable:!0,writable:!0,value:(Ft(this,a),e)})}async fetchBannerPlaceById(e){const t=await this.httpClient.post(`banner/place/${e.placeId}`,{tags:e.tags.join(","),options:e.options},{params:{expand:"banners.slides"}});if(t.data)return t.data;throw new Wt(e.placeId)}async fetchBannerById(e){const t=await this.httpClient.get(`banner/${e}`,{params:{expand:"slides"}});if(t.data)return t.data;throw new zt(e)}async fetchContextWithStyles({needFetchStyles:e}){return(await this.httpClient.get("banner/context",{params:{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=[Nt],r=[Nt],n=[Nt],i=[Nt],Vt(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),Vt(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),Vt(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),Vt(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 qt{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}`,{},{params:t.toQueryParams()})}catch(e){console.error(e)}}}var Ht;!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"}(Ht||(Ht={}));var $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};(()=>{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=[Nt],r=[Nt],$t(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),$t(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 Gt{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 qt(this.storyManager.httpClient,this.storyManager),i=new He(n),a=new Dt(this.storyManager,this.bannerStore,i);return new Pe(null!==(r=null==t?void 0:t.toString())&&void 0!==r?r:"default",e,i,this.bannerStore,a)}createBannerPreviewPlace(e,t){const r=new qt(this.storyManager.httpClient,this.storyManager),n=new He(r),i=new Dt(this.storyManager,this.bannerStore,n);return new qe(t.toString(),e,this.bannerStore,i)}}class Xt{static toDomain(e,t){return new J({id:e.id,name:e.name,slides:e.slides.map((e=>{var t;return new ne({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 Z(e.appearance),context:new ee(e.id,t),frequencyLimit:e.frequency_limit})}}class Yt{static toDomain(e,t,r){const n=e.banners.map((e=>Xt.toDomain(e,t)));return new ae({id:e.id,banners:n,placeholders:r,style:t.style})}}var Qt=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},Kt=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},Jt=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)},Zt=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 er=(()=>{var e,t,r;let n,i,a,s,o=[],l=[],c=[],d=[],h=[];return e=class{get _bannerPlaces(){return Jt(this,t,"f")}set _bannerPlaces(e){Zt(this,t,e,"f")}get _banners(){return Jt(this,r,"f")}set _banners(e){Zt(this,r,e,"f")}constructor(e,n){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(Qt(this,o),e)}),Object.defineProperty(this,"bannerApi",{enumerable:!0,configurable:!0,writable:!0,value:n}),t.set(this,Qt(this,l,Q.observable.map())),r.set(this,(Qt(this,c),Qt(this,d,Q.observable.map()))),Object.defineProperty(this,"bannerCSS",{enumerable:!0,configurable:!0,writable:!0,value:(Qt(this,h),"")}),(0,Q.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.waitForConfig();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);const t=await this.storyManager.waitForConfig(),r=await this.fetchBannerContext(),n=await this.bannerApi.fetchBannerPlaceById({placeId:e.placeId,tags:t.tags,options:t.options});return this.addBannerPlace(n,r)}clearCache(){this._bannerPlaces=Q.observable.map(),this._banners=Q.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=Yt.toDomain(e,t,r);return this._bannerPlaces.set(e.id,n),n}addBanner(e,t){const r=this.storyManager.rootStore.placeholderStore.placeholders,n=Xt.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=[Q.observable],i=[Q.observable],a=[Q.computed],s=[Nt],Kt(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),Kt(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),Kt(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),Kt(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 tr{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 Ut(e.httpClient);this.bannerStore=new er(this.storyManager,t)}}class rr extends Error{constructor(){super("[IAS]: you must create an instance of BannersProvider"),this.name="IasBannersProviderReferenceError"}}class nr extends Error{constructor(e){super(`[IAS]: Mount point ${e} is not present in DOM at initialization time`),this.name="IasMountPointReferenceError"}}class ir extends je{render(){this.root.render((0,l.jsx)(Ae,{bannerPlace:this.bannerPlace}))}}class ar{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 tr(e),this.bannerPlaceViewModelFactory=new Gt(e,this.rootStore.bannerStore),this.storyManager.waitForConfig().then((e=>{e.on("requestSDKReload",this.reloadAllBanners)}))}async waitForConfig(){return await this.storyManager.waitForConfig()}getConfig(){return this.storyManager.config}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 ar.instance||(ar.instance=new ar(e)),ar.instance}mountBannerPlace(e,t){return this.mountBannerCarousel(e,t)}mountBannerCarousel(e,t){const r=document.querySelector(e);if(!r)throw new nr(e);const n=this.createBannerPlace(null==t?void 0:t.placeId),i=new je(r,n,t);return i.render(),i}mountBannerList(e,t){const r=document.querySelector(e);if(!r)throw new nr(e);const n=this.createBannerPlace(null==t?void 0:t.placeId),i=new Ie(r,n,t);return i.render(),i}mountBannerPreviewPlace(e,t){const r=document.querySelector(e);if(!r)throw new nr(e);const n=this.createBannerPreviewPlace(t.bannerId),i=new ir(r,n);return i.render(),i}}const sr=()=>{if(!ar.instance)throw new rr;return ar.instance},or=ar;class lr{constructor(){Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ias-banners"})}install(e){const t=or.create(e.INTERNAL_API);e.HOST.prototype.banners=t}uninstall(){}}const cr=new lr})();var u=h.AF,p=h.M6,b=h.RE,f=h.Sr,m=h.YL,v=h.Ay;export{u as IasBannerCarousel,p as IasBannerList,b as IasBannerPlace,f as IasBannerPreview,m as IasBannersPlugin,v as default};