@claspo/components 1.2.0-theme.13 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/LICENSE.md +59 -0
  2. package/README.md +10 -0
  3. package/SysButtonComponent/SysButtonComponent.js +1 -1
  4. package/SysCalendarComponent/SysCalendarComponent.js +1 -1
  5. package/SysCheckboxListComponent/SysCheckboxListComponent.js +1 -1
  6. package/SysChoiceButtonsComponent/SysChoiceButtonsComponent.js +1 -0
  7. package/SysChoiceButtonsComponent/assets/img/component-icon.svg +3 -0
  8. package/SysColumnComponent/SysColumnComponent.js +1 -1
  9. package/SysColumnsComponent/SysColumnsComponent.js +1 -1
  10. package/SysConsentComponent/SysConsentComponent.js +1 -1
  11. package/SysContainerComponent/SysContainerComponent.js +1 -1
  12. package/SysCountdownTimerComponent/SysCountdownTimerComponent.js +1 -1
  13. package/SysDateComponent/SysDateComponent.js +1 -1
  14. package/SysDropdownInputComponent/SysDropdownInputComponent.js +1 -1
  15. package/SysImageComponent/SysImageComponent.js +1 -1
  16. package/SysInAppColumnsComponent/SysInAppColumnsComponent.js +1 -1
  17. package/SysInputComponent/SysInputComponent.js +1 -1
  18. package/SysPhoneInputComponent/SysPhoneInputComponent.js +1 -1
  19. package/SysPromoCodeComponent/SysPromoCodeComponent.js +1 -1
  20. package/SysRadioGroupComponent/SysRadioGroupComponent.js +1 -1
  21. package/SysSlideComponent/SysSlideComponent.js +1 -1
  22. package/SysSliderComponent/SysSliderComponent.js +1 -1
  23. package/SysSocialComponent/SysSocialComponent.js +1 -1
  24. package/SysTextAreaComponent/SysTextAreaComponent.js +1 -1
  25. package/SysTextComponent/SysTextComponent.js +1 -1
  26. package/SysVideoComponent/SysVideoComponent.js +1 -1
  27. package/package.json +6 -10
  28. /package/SysButtonComponent/assets/img/{button-component-icon.svg → component-icon.svg} +0 -0
  29. /package/SysCalendarComponent/assets/img/{calendar-component-icon.svg → component-icon.svg} +0 -0
  30. /package/SysCheckboxListComponent/assets/img/{checkbox-component-icon.svg → component-icon.svg} +0 -0
  31. /package/SysConsentComponent/assets/img/{consent-component-icon.svg → component-icon.svg} +0 -0
  32. /package/SysContainerComponent/assets/img/{container-component-icon.svg → component-icon.svg} +0 -0
  33. /package/SysCountdownTimerComponent/assets/img/{countdown-timer-component-icon.svg → component-icon.svg} +0 -0
  34. /package/SysDateComponent/assets/img/{date-component-icon.svg → component-icon.svg} +0 -0
  35. /package/SysDropdownInputComponent/assets/img/{dropdown-component-icon.svg → component-icon.svg} +0 -0
  36. /package/SysPhoneInputComponent/assets/img/{phone-input-component-icon.svg → component-icon.svg} +0 -0
  37. /package/SysPromoCodeComponent/assets/img/{promo-code-component-icon.svg → component-icon.svg} +0 -0
  38. /package/SysRadioGroupComponent/assets/img/{radio-btn-component-icon.svg → component-icon.svg} +0 -0
  39. /package/SysTextAreaComponent/assets/img/{text-area-component-icon.svg → component-icon.svg} +0 -0
  40. /package/SysTextComponent/assets/img/{text-component-icon.svg → component-icon.svg} +0 -0
  41. /package/SysVideoComponent/assets/img/{video-component-icon.svg → component-icon.svg} +0 -0
@@ -1 +1 @@
1
- const t="cl-";function e(e){return t+e}function s(t){return"cl-"+t}const i="VIEW",n="MODULE",o="CONTAINER",r="INPUT",l="BUTTON",a="CONSENT",c="COLUMN",d="SUBSCRIBE_CONTACT",h="REQUEST",p="SHOW_WIDGET",u="OPEN_LINK",m="CLOSE_WIDGET";class g{static sortActions(t){const e={[m]:-1,[u]:-2,[p]:1,[d]:2,[h]:3},s=t=>void 0!==e[t.type]?e[t.type]:0;return[...t].sort(((t,e)=>s(t)>s(e)?-1:s(t)<s(e)?1:0))}constructor(t,e){this.config=t,this.actions=g.sortActions(e),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(t,e,i){this.state=t;const n=i(),o=n.getAttribute(s("id"));this.listener=t=>{const e=t.composedPath().filter((t=>t instanceof HTMLElement&&t.getAttribute(s("type"))));let i=0;for(;e[i]&&e[i].getAttribute(s("id"))!==o;){let t=e[i].getAttribute(s("type"));if(g.IGNORING_VIEW_ENTRY_TYPES.includes(t))return;i++}this.eventsQueue.push({event:t}),this.postponed||this.execute()},this.targetElements=this.config.relativeSelector?Array.from((n.shadowRoot||n).querySelectorAll(this.config.relativeSelector)):[n],this.targetElements.forEach((t=>{t.addEventListener("click",this.listener)}))}async execute(){var t,e,s,i;try{for(var n,o=!0,r=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,s=t[Symbol.asyncIterator];return s?s.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(s){e[s]=t[s]&&function(e){return new Promise((function(i,n){!function(t,e,s,i){Promise.resolve(i).then((function(e){t({value:e,done:s})}),e)}(i,n,(e=t[s](e)).done,e.value)}))}}}(this.eventsQueue);!(t=(n=await r.next()).done);){i=n.value,o=!1;try{const{event:t}=i;for(const e of this.actions)if(!await e.execute(this.state.getState(),t))break}finally{o=!0}}}catch(t){e={error:t}}finally{try{o||t||!(s=r.return)||await s.call(r)}finally{if(e)throw e.error}}this.eventsQueue=[]}postpone(){this.postponed=!0}release(){this.postponed=!1,this.execute()}destroy(){this.listener&&this.targetElements.length&&(this.targetElements.forEach((t=>{t.removeEventListener("click",this.listener)})),this.targetElements=[])}}g.IGNORING_VIEW_ENTRY_TYPES=[l,a,r];const b="CLICK",y="COMPONENT_EVENT";class f{constructor(t,e){this.config=t,this.actions=e,this.componentEmitterListener=null}activate(t,e,s){this.componentEmitterListener=e.on(this.config.eventName,(()=>{this.actions.forEach((e=>e.execute(t.getState(),this.config.params)))}))}destroy(){this.componentEmitterListener&&this.componentEmitterListener.off()}}class v{constructor(t,e){this.actionFactory=t,this.actionRegister=e}get(t){const e=t.actions.map((t=>this.actionFactory.get(t)));switch(e.forEach((t=>this.actionRegister.register(t))),t.type){case b:return new g(t,e);case y:return new f(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class E{static generate(){let t,e="";for(let s=0;s<32;s++)8!==s&&12!==s&&16!==s&&20!==s||(e+="-"),t=Math.floor(16*Math.random()).toString(16).toUpperCase(),e+=t;return e}}class S{constructor(){this.listeners=S.createDefaultListenersState()}emit(t,e,s=null){const i=this.listeners[t];i&&Object.values(i).forEach((i=>i(e,t,s))),Object.values(this.listeners["*"]).forEach((i=>i(e,t,s)))}on(t,e){const s=E.generate(),i=this.listeners[t];return i?i[s]=e:this.listeners[t]={[s]:e},{off:()=>{var e,i;(null===(i=null===(e=this.listeners)||void 0===e?void 0:e[t])||void 0===i?void 0:i[s])&&delete this.listeners[t][s]}}}destroy(){this.listeners=S.createDefaultListenersState()}}S.createDefaultListenersState=()=>({"*":{}});const O=(t,e,s,i)=>{const{addEventListenerBase:n,addEventListener:o}=EventTarget.prototype;(n||o).call(t,e,s,i)};class A{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class C{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===n?Object.assign(Object.assign({},t),C.moduleToContainerParams):t));return Object.assign(Object.assign({},t),{children:e})}));return Object.assign(Object.assign({},t),{views:e})}static sort(t,e){return t.index>e.index?1:-1}static reIndex(t,e){return Object.assign(Object.assign({},t),{index:e+t.index})}}C.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"};class x extends S{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on("ENVIRONMENT_UPDATE",(({isMobileEnv:t})=>{this._isMobile=t,this.emit(x.changeEventName,this._isMobile)}))}handleMobileBreakpoint(t){this.mobileBreakpointWidth=t;const e=Number.isInteger(this.mobileBreakpointWidth)?`${this.mobileBreakpointWidth}px`:this.mobileBreakpointWidth;this.mediaQueryList=window.matchMedia(`(max-width: ${e})`),this.mediaQueryList.addListener(this.listener.bind(this)),this._isMobile=this.mediaQueryList.matches,this.emit(x.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(x.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}x.changeEventName="CHANGE";class R{static set(t,e){const s=t[R.accumulatorPropertyName]||{};t[R.accumulatorPropertyName]=Object.assign(Object.assign({},s),e.styleAttributes),Object.keys(t[R.accumulatorPropertyName]).forEach((s=>{s.includes("--")?t.style.setProperty(s,e.styleAttributes[s]||""):t.style[s]=e.styleAttributes[s]?e.styleAttributes[s]:""}))}}R.accumulatorPropertyName="clStyleAttributes";const T="CONTENT_LOCKER";class L{static applyHostStyles(t,e,s=null,n){var r,l,a;const d=null===(l=null===(r=null==s?void 0:s.props)||void 0===r?void 0:r.handlers)||void 0===l?void 0:l.find((t=>"CLICK"===t.type));d&&(null===(a=d.actions)||void 0===a?void 0:a.length)&&(e.style.cursor="pointer"),t!==i&&t!==o&&t!==c||(e.style.display=n===T&&t===i?"flex":"inline-flex",e.style.position="relative"),e.style.boxSizing="border-box"}constructor(){this.styles="/* common styles */ *, *:before, *:after { box-sizing: border-box; font-family: inherit; }"}setStyles(t=""){this.styles=`${this.styles} ${t}`}getStyles(){return this.styles}}class P{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class N{constructor(t,e,s,i,n,o){this.hostElement=e,this.documentModel=t,this.getSharedCb=s,this.getPropsCb=i,this.getEnvCb=n,this.httpClient=o,this.subscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(t){const e=String(t||"");if(e.includes("url")){const[t,s]=e.split("(")[1].split(")");return{url:t.replace(/['"]+/g,""),positionOptions:s.replace(";","")}}return{url:null,positionOptions:null}}apply(t){const e=this.getPropsCb();return e.backgroundDynamicInlineSVGElements[t].forEach((s=>{var i,n,o,r,l;const a=null===(n=null===(i=e.adaptiveStyles)||void 0===i?void 0:i[t])||void 0===n?void 0:n.find((t=>t.element===s)),c=(null===(o=e.styles)||void 0===o?void 0:o.find((t=>t.element===s)))||{},d=(null===(r=null==c?void 0:c.styleAttributes)||void 0===r?void 0:r.background)||(null===(l=null==a?void 0:a.styleAttributes)||void 0===l?void 0:l.background),h=this.parseBackground(d);h.url&&this.envUrlMaps[t].set(s,{originalSVGResourceURL:h.url,inlineSvgString:null,positionOptions:h.positionOptions})})),Promise.all([...this.envUrlMaps[t].entries()].map((([e,s])=>this.httpClient.execute(s.originalSVGResourceURL).then((t=>t.text())).then((i=>{this.envUrlMaps[t].set(e,Object.assign(Object.assign({},s),{inlineSvgString:i}))}))))).then((()=>{var e;this._applyHostElementBackground(this.envUrlMaps[t].get("host"),null===(e=this.getSharedCb().theme)||void 0===e?void 0:e.schema)})).catch((t=>{console.error(t),P.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${t}`)}))}on(){return this.subscription=this.documentModel.on("THEME_UPDATE",(t=>{this._applyHostElementBackground(this.envUrlMaps[this.getEnvCb()].get("host"),t.schema)})),this}_applyHostElementBackground(t,e={}){t&&(this.hostElement.style.background=this._buildBackgroundUrl(t,e))}_buildBackgroundUrl(t,e){const s=t.inlineSvgString.trim().replace("var(--cl-schema-accent)",e.accent);return`url('data:image/svg+xml,${encodeURIComponent(s)}')${t.positionOptions}`}}const _=new class{execute(t,e,s=null,i,n){const o={method:e,headers:Object.assign({"Content-Type":"text/plain"},i||{}),credentials:"same-origin",body:null,signal:n};return s&&(o.body="string"==typeof s?s:JSON.stringify(s)),fetch(t,o)}};function w(t,e){return Object.keys(t).filter((t=>!e.includes(t))).reduce(((e,s)=>Object.assign(Object.assign({},e),{[s]:t[s]})),{})}class M{static camelCaseToDashCase(t){return t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}static camelCaseToUpperSnakeCase(t){return t.replace(/[A-Z]/g,(t=>"_"+t)).toUpperCase()}}class j{constructor(t){this._count=0,this.onUpdateCb=t}increment(){this._count++,this.onUpdateCb(this.count())}decrement(){this._count>0&&this._count--,this.onUpdateCb(this.count())}count(){return this._count}}const k="COMPONENT_RESOURCES_LOADED",F="FAILED_TO_LOAD_COMPONENT_RESOURCE";class I{constructor(t,e,s){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(k,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(F,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=s,this.counters={pending:new j(this.onCounterStateUpdate)}}}const D=(...t)=>{let e=t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:[]})),{});return{get:t=>e[t],clear:()=>D(...t)}},U=D,B="props",W="shared",$="environment";function H(t,e,s,i){const n=t=>{let o=t instanceof DocumentFragment||(null==t?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?t.host:t;return o&&(i&&"function"==typeof i?i(o.getAttribute(e)):(null===(r=null==o?void 0:o.getAttribute)||void 0===r?void 0:r.call(o,e))===s)?o:o&&o.parentNode&&n(o.parentNode)||null;var r};return n(t)}const G="SUBMIT";function V(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach((s=>{"element"!==s&&"classes"!==s&&(e[s]&&"object"==typeof e[s]&&!Array.isArray(e[s])?t[s]=Object.assign(Object.assign({},t[s]||{}),e[s]):t[s]=e[s])})),t):t}function z(t,e,s){var i;return null===(i=t[e])||void 0===i?void 0:i.find((t=>t.element===s))}function Q(t){const{element:e,html:s,appendHtml:i}=t,n=function(t){if(null==t)return"";if("string"!=typeof t)return String(t);if(""===t)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(t))return t;const e=(new DOMParser).parseFromString(t,"text/html");return e.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach((t=>t.remove())),e.querySelectorAll("*").forEach((t=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach((e=>t.removeAttribute(e))),Array.from(t.attributes).forEach((e=>{e.name.startsWith("on")&&t.removeAttribute(e.name)})),"A"===t.tagName||"AREA"===t.tagName){const e=t.getAttribute("href");e&&(e.startsWith("javascript:")||e.startsWith("data:"))&&t.removeAttribute("href")}if("IMG"===t.tagName||"IFRAME"===t.tagName){const e=t.getAttribute("src");e&&(e.startsWith("javascript:")||e.startsWith("data:text/html"))&&t.removeAttribute("src")}if("FORM"===t.tagName){const e=t.getAttribute("action");e&&e.startsWith("javascript:")&&t.removeAttribute("action")}})),e.body.innerHTML}(s);i?e.innerHTML+=n:e.innerHTML=n}class q extends Event{constructor(t,e,s){super(t,s),this.detail={},Object.defineProperty(this,"detail",{value:e})}}class J extends HTMLElement{constructor(){var i,n;super(),this.construct=()=>{let t;const e=this.getAttribute(s("id")),i=this.getWidgetContainerNode();if(!i)throw new Error("Widget container not found in construct");const n=i.closest(`[${s("widget-id")}]`);let o;n&&(o=n.getAttribute(s("widget-id")));let r=new q("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(s("path")),id:e,widgetId:o},{bubbles:!0,composed:!0});this.dispatchEvent(r),t=r.detail.props,Object.assign(this,t),this.observers=U(B,W,$),this.subscriptions=new class{constructor(){this.subscriptions=[]}push(t){this.subscriptions.push(t)}off(){this.subscriptions.forEach((t=>null==t?void 0:t.off()))}},this.state=new A,this.componentEventEmitter=new S,this.componentResourceManager=new I(this.model.id,this.services.eventEmitter,"STATIC"===this.services.config.getConfig("entryModuleType")),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new v(this._actionFactory,this.services.actionRegister),this.prevProps=this.model.props,this.prevEnvironment=this.getEnvironment(),this.documentModel.on(`COMPONENT_PROPS_UPDATE_${this.model.id}`,(t=>{this.model.props=t,this.observers.get(B).forEach((e=>e(this.prevProps,t))),this.prevProps=t;const e=this.getHostElement(),i=s("floating");t.floating&&!e.getAttribute(i)?e.setAttribute(i,"true"):!t.floating&&e.getAttribute(i)&&e.removeAttribute(i)})),this.documentModel.on(`COMPONENT_UPDATE_${this.model.id}`,(t=>{Object.assign(this.model,t)})),this.documentModel.on("SHARED_UPDATE_ALL",(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles),this.observers.get(W).forEach((t=>t(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new N(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),_),this.colorSchemaListener.apply(this.getEnvironment()).then((()=>{this.subscriptions.push(this.colorSchemaListener.on())}))),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(x.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get($).forEach((e=>e(this.prevEnvironment,t))),this.prevEnvironment=t})))},this.attachHandlers=()=>{this.getHandlers().map((t=>this._handlerFactory.get(t))).map((t=>()=>t.activate(this.state,this.componentEventEmitter,this.getHostElement.bind(this)))).forEach((t=>t()))},this.postponeHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.postpone()))},this.releaseHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.release()))},this.getProps=()=>{var t;return null===(t=this.getModel())||void 0===t?void 0:t.props},this.getShared=()=>this.documentModel.getShared(),this.getEnvironment=()=>this.resizeListener.isMobile()?"mobile":"desktop",this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(B).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(W).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get($).push(t),t(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${s("element")}]`)).filter((t=>!t.hasAttribute(s("component"))))],this.getElement=(t,e)=>this.getElements().find((i=>e?i.getAttribute(s("element"))===t&&i.id===e:i.getAttribute(s("element"))===t)),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const i=this.getElements();if(!i.length)return;t=function(t,e){if(!e)return t||{desktop:[],mobile:[]};const s=JSON.parse(JSON.stringify(t||{desktop:[],mobile:[]}));return e.forEach((t=>{const e=t.element;let i=!1,n=!1;s.desktop&&s.desktop.forEach((s=>{s.element===e&&(V(s,t),i=!0)})),s.mobile&&s.mobile.forEach((s=>{s.element===e&&(V(s,t),n=!0)})),!i&&s.desktop&&s.desktop.push(JSON.parse(JSON.stringify(t))),!n&&s.mobile&&s.mobile.push(JSON.parse(JSON.stringify(t)))})),s}(t,e);const n=s("type"),o="element-styles";let r=this.getRootElement().querySelector(`style[${n}="${o}"]`);r||(r=document.createElement("style"),r.setAttribute(n,o),this.getRootElement().appendChild(r)),Q({element:r,html:""}),i.forEach((e=>{let i=e.getAttribute(s("element"));const n=this.getEnvironment();let o=z(t,n,i);if(o){if(this.resizeListener.isMobile()){const e=z(t,"desktop",i);e&&(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},e.styleAttributes),o.styleAttributes)}))}this.applyStylesToElement(e,this.applySharedClassesToElementModel(o),r)}})),this._addLinkColor(r,this.getShared())},this.registerComponentResourceManagement=()=>{this.viewResourceManager.registerComponent(this.model.id,this.componentResourceManager)},this.applyStyles=(t,e={})=>{if(!t||!t.style)return!1;for(const[s,i]of Object.entries(e))t.style[s]=i;return!0},this.applyStylesToElement=(t,e,i)=>{var n,o;const r=[];"host"===(e=J._resolveTogglableStylesForElementModel(e)).element&&(L.applyHostStyles(this.model.type,t,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(n=this.model.props.backgroundDynamicInlineSVGElements)||void 0===n?void 0:n.desktop)||"mobile"===this.getEnvironment()&&(null===(o=this.model.props.backgroundDynamicInlineSVGElements)||void 0===o?void 0:o.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),r.push("background")));let l=e.styleAttributes.background,a=l&&l.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&a){this.componentResourceManager.getPending().increment();const t=new Image;t.src=a[1],O(t,"load",(()=>{this.componentResourceManager.getPending().decrement()})),O(t,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(t.src),"UPDATING"===this.services.config.getConfig("entryModuleType")&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},e),{styleAttributes:w(e.styleAttributes,r)});if(R.set(t,c),this._setClassAttributes(t,e),i){if(e.hoverStyleAttributes){let n=Object.assign({},e.hoverStyleAttributes);if("FILL_UP"===e.hoverAnimationType){t.style.boxShadow="inset 0px 0px 0px 0px rgb(0, 0, 0, 0)",t.style.overflow="hidden";const s=t.tagName.toLowerCase(),i=`flip-up-animation-${e.element}`;let o=this.getRootElement().querySelector(`#${i}`);o||(o=document.createElement("style"),o.id=i,t.appendChild(o)),Q({element:o,html:`\n ${s}::before {\n content: '';\n background: ${n.background};\n position: absolute;\n left: 0;\n top: ${t.getBoundingClientRect().height}px;\n height: ${t.getBoundingClientRect().height}px;\n width: 100%;\n z-index: -10;\n }\n ${s}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),n=Object.assign(Object.assign({},e.hoverStyleAttributes),{background:"transparent",position:"relative"})}n.borderTopWidth&&"0px"!==n.borderTopWidth||delete n.borderTopColor,n.borderBottomWidth&&"0px"!==n.borderBottomWidth||delete n.borderBottomColor,n.borderLeftWidth&&"0px"!==n.borderLeftWidth||delete n.borderLeftColor,n.borderRightWidth&&"0px"!==n.borderRightWidth||delete n.borderRightColor,this._addStylesToStyleElement(i,e.element,n,`:not(.${s("no-hover")}):hover`,!0)}e.placeholderStyleAttributes&&this._addStylesToStyleElement(i,e.element,e.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(i,this.getShared()),this.stylesAppliedToElement(t,e,i)}},this._fixMarginOverflow=t=>{const e=this.getParentComponent(),i=e&&("flex"===e.style.display||"inline-flex"===e.style.display),n="host",o=t.getAttribute(s("element"))===n;if(!i||!o)return;const r=this.getProps(),l=this.getEnvironment(),{styleAttributes:a}=z(r.adaptiveStyles,l,n)||{};if(!a)return;const c=a.marginLeft||a.marginRight,d="100%"===a.width;if(c&&d){const e=(parseFloat(a.marginLeft)||0)+(parseFloat(a.marginRight)||0);e&&setTimeout((()=>{t.style.width=`calc(100% - ${e}px)`}))}},this.applySharedClassesToElementModel=e=>function(e,s){let i=e;return(i.classes||"").split(" ").filter((e=>e.startsWith(t))).forEach((t=>{var e;let n=null===(e=s.textClasses)||void 0===e?void 0:e[t];n&&(n.styleAttributes.fontFamily||(n.isHeader&&s.headerFontFamily&&(n=Object.assign(Object.assign({},n),{styleAttributes:Object.assign(Object.assign({},n.styleAttributes),{fontFamily:s.headerFontFamily})})),!n.isHeader&&s.textFontFamily&&(n=Object.assign(Object.assign({},n),{styleAttributes:Object.assign(Object.assign({},n.styleAttributes),{fontFamily:s.textFontFamily})}))),i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),n.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},i.placeholderStyleAttributes),n.placeholderStyleAttributes)}))})),i.styleAttributes.fontFamily||(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),{fontFamily:s.textFontFamily})})),i}(e,this.documentModel.getShared()),this.getModel=()=>this.model,this._addStylesToStyleElement=(t,e,i,n="",o)=>{const r=Object.keys(i).reduce(((t,e)=>t+` ${M.camelCaseToDashCase(e)}: ${i[e]}${o?" !important;":";"}`),"");Q({element:t,html:`[${s("element")}="${e}"]${n} { ${r} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{Q({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var s,i,n,o;e.linkColor&&Q({element:t,html:`a {color: ${e.linkColor}}, a:visited {color: ${e.linkColor}}`,appendHtml:!0}),(null===(s=e.linkParams)||void 0===s?void 0:s.color)&&Q({element:t,html:`a {color: ${null===(i=e.linkParams)||void 0===i?void 0:i.color}}, a:visited {color: ${null===(n=e.linkParams)||void 0===n?void 0:n.color}}`,appendHtml:!0}),(null===(o=e.linkParams)||void 0===o?void 0:o.removeUnderline)&&Q({element:t,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(s,i)=>{Array.from(s.classList).filter((t=>t!==e("hovered")&&t!==e("focused"))).forEach((e=>{e.startsWith(t)&&s.classList.remove(e)}));const n=((s.getAttribute("class")||"")+" "+i.classes).trim();s.setAttribute("class",n)},this.getParentComponent=()=>H(this.parentNode,s("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(s("path"));return t&&1===t.split(",").length?this.parentNode:H(this.parentNode,s("path"),void 0,(t=>t&&1===t.split(",").length))},this.getWidgetLanguages=()=>{return[(t=this.services.config).getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter((t=>!!t));var t},this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=t=>function(t,e){return e.reduce(((e,s)=>{if(e)return e;const i=function(t,e){if(!t)return null;if(e[t])return{translations:e[t],language:t};const s=function(t){return t.includes("-")?t.split("-")[0].toLowerCase():t.includes("_")?t.split("_")[0].toLowerCase():t}(t);return e[s]?{translations:e[s],language:s}:null}(s,t);return i||null}),null)}(t,this.getWidgetLanguages()),this.stylesAppliedToElement=(t,e,s)=>{},this.updateContext=()=>{var t;const e=this.getModel();this.services.context.updateRecord(e.id,{label:this.getContextRecordLabel(e.props),viewIndex:null===(t=e.path)||void 0===t?void 0:t[0]})},this.addContextRecord=()=>{var t;const e=this.getModel();this.services.context.addRecord(e.id,{recordKey:e.id,id:e.props.control.name,label:this.getContextRecordLabel(e.props),value:e.props.control.defaultValue||"",viewIndex:null===(t=e.path)||void 0===t?void 0:t[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(e.props)}})},this.getContextRecordLabel=t=>{var e,s;const i=t.control.name;if(["email","first_name","last_name"].includes(i))return i.toUpperCase();if(t.content.label&&(null===(s=null===(e=t.adaptiveStyles.desktop.find((t=>"label"===t.element)))||void 0===e?void 0:e.params)||void 0===s?void 0:s.enabled)){const e=(new DOMParser).parseFromString(t.content.label,"text/html");return this.capitalizeFirstLetter(e.body.textContent||"")}return t.content.placeholder?this.capitalizeFirstLetter(t.content.placeholder):t.control.integrationName?this.capitalizeFirstLetter(t.control.integrationName).replace(new RegExp("_","g")," "):void 0},this.capitalizeFirstLetter=t=>t.charAt(0).toUpperCase()+t.slice(1),this.getContextRecordExampleValue=t=>{switch(t.control.name){case"email":return"myemail@example.com";case"first_name":return"Maria";case"last_name":return"Taylor";default:return this.getContextRecordLabel(t)}},this.completeSubmitAction=t=>{const e=t||{},s=this.services.actionRegister.getRegisteredActions().find((t=>t.category===G));s?null==s||s.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:h}).execute(void 0,void 0,!0,e)},this.getHandlers=()=>this.getProps().handlers&&this.getProps().handlers.length?[...this.getProps().handlers]:[],this.assets=(t="")=>`${this.services.config.getConfig("staticResourcesUrl").replace(/\/$/,"")}/${this.manifest.name}/assets${t?`/${t}`:""}`,this.attachShadow({mode:"open"}),this.manifest=this.manifest||(null===(i=this.define)||void 0===i?void 0:i.manifest)||(null===(n=this.constructor.define)||void 0===n?void 0:n.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then((()=>{this.attachHandlers()}))}disconnectedCallback(){var t;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(t=this.mergeTagsProcessor)||void 0===t||t.destroy()}static _resolveTogglableStylesForElementModel(t){const e=Object.assign({},t);return Object.keys(e).forEach((t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=J._resolveTogglableStyles(e[t]))})),e}static _resolveTogglableStyles(t){const e=Object.assign({},t),s=(t,s,i)=>{s in e&&(t.forEach((t=>{t in e&&(e[t]=e[s]?e[t]:i)})),delete e[s])};return s(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),s(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),e}}const K={name:"SysSlideComponent",componentType:"SLIDE",version:"1.0.0",focusParentOnClick:!0,preventDraggable:!0,propertyPaneModel:{content:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"ALIGNMENT",elementProp:"styleAttributes",element:"host",hideSyncSelect:!0},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",hideSyncSelect:!0,params:{indentationType:"PADDING"}}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"ALIGNMENT",elementProp:"styleAttributes",element:"host",hideSyncSelect:!0},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",hideSyncSelect:!0,params:{indentationType:"PADDING"}}]}],general:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!0}}]},events:{dispatch:[],listen:[]},i18nPropertyPaneModel:{content:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!1}}]},i18nPropPaths:["handlers,[id],actions,[id],params,link"],props:{content:{name:null},styles:[{element:"host",styleAttributes:{background:"#FFFFFF"},classes:""}],adaptiveStyles:{desktop:[{element:"host",styleAttributes:{display:"inline-flex",position:"relative",width:"100%",minWidth:null,height:"auto",minHeight:null,overflow:"hidden",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"20px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",_paddingEnabled:!1,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1,borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"0px",borderTopColor:"rgb(0, 0, 0)",borderBottomWidth:"0px",borderBottomColor:"rgb(0, 0, 0)",borderLeftWidth:"0px",borderLeftColor:"rgb(0, 0, 0)",borderRightWidth:"0px",borderRightColor:"rgb(0, 0, 0)",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none"},classes:""}],mobile:[{element:"host",styleAttributes:{position:"relative",width:"100%",minWidth:null,height:"auto",minHeight:null,overflow:"hidden",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"20px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",_paddingEnabled:!1,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1,borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"0px",borderTopColor:"rgb(0, 0, 0)",borderBottomWidth:"0px",borderBottomColor:"rgb(0, 0, 0)",borderLeftWidth:"0px",borderLeftColor:"rgb(0, 0, 0)",borderRightWidth:"0px",borderRightColor:"rgb(0, 0, 0)",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none"},classes:""}]}},waitForResourcesLoad:!0,resourcesPropPaths:[["adaptiveStyles",":ENV","styleAttributes","background"],["styles","styleAttributes","background"]],metaDescription:{label:{en:"Slide",ru:"Слайд",uk:"Слайд",es:"Diapositiva",fr:"Diapositive",de:"Slide",it:"Slide",pt:"Diapositivo",ro:"Slide",bg:"Слайд",cs:"Slide",el:"Slide",nl:"Slide",pl:"Slajd",sv:"Slide",tr:"Slide",ar:"Slide",zh:"Slide",da:"Slide",he:"Slide",fi:"Slide",hi:"Slide",hr:"Slide",hu:"Slide",id:"Slide",ja:"Slide",ko:"Slide",no:"Slide",sk:"Slide",sl:"Slide",sr:"Slide"}}};function Y(t){return Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Y(t)}function Z(t,e){for(var s=0;s<e.length;s++){var i=e[s];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,nt(i.key),i)}}function X(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(X=function(){return!!t})()}function tt(){return tt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,s){var i=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=et(t)););return t}(t,e);if(i){var n=Object.getOwnPropertyDescriptor(i,e);return n.get?n.get.call(arguments.length<3?t:s):n.value}},tt.apply(null,arguments)}function et(t){return et=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},et(t)}function st(t,e){return st=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},st(t,e)}function it(t,e,s){return(e=nt(e))in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function nt(t){var e=function(t){if("object"!=Y(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var s=e.call(t,"string");if("object"!=Y(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Y(e)?e:e+""}var ot=function(){function t(){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),it(e=function(t,e,s){return e=et(e),function(t,e){if(e&&("object"==Y(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,X()?Reflect.construct(e,s||[],et(t).constructor):e.apply(t,s))}(this,t),"manifest",K),e.getRootElement().innerHTML="\n <style>\n :host {\n position: relative;\n flex: 0 0 100%;\n min-width: 20px;\n min-height: 20px;\n }\n </style>\n ",e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&st(t,e)}(t,J),e=t,s=[{key:"connectedCallback",value:function(){var e,s,i,n=this;(e=t,s=this,"function"==typeof(i=tt(et(1&3?e.prototype:e),"connectedCallback",s))?function(t){return i.apply(s,t)}:i)([]),this.observeProps((function(t,e){n.applyAutoAdaptiveStyles(e.adaptiveStyles,e.styles)}))}}],s&&Z(e.prototype,s),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,s}();it(ot,"define",{name:"sys-slide",model:K.name,manifest:K});export{ot as default};window.clComponentClass_SysSlideComponent=ot;
1
+ const t="cl-";function e(e){return t+e}function s(t){return"cl-"+t}const i="VIEW",n="MODULE",o="CONTAINER",r="INPUT",l="BUTTON",a="CONSENT",c="COLUMN";var d,h;(h=d||(d={})).SUBSCRIBE_CONTACT="SUBSCRIBE_CONTACT",h.REQUEST="REQUEST",h.DISPATCH_EVENT="DISPATCH_EVENT",h.GO_TO_VIEW="GO_TO_VIEW",h.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",h.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",h.SHOW_WIDGET="SHOW_WIDGET",h.OPEN_LINK="OPEN_LINK",h.CLOSE_WIDGET="CLOSE_WIDGET",h.CLICK="CLICK";const u=d;var p,m;class g{static sortActions(t){const e={[u.CLOSE_WIDGET]:-1,[u.OPEN_LINK]:-2,[u.SHOW_WIDGET]:1,[u.SUBSCRIBE_CONTACT]:2,[u.REQUEST]:3},s=t=>void 0!==e[t.type]?e[t.type]:0;return[...t].sort(((t,e)=>s(t)>s(e)?-1:s(t)<s(e)?1:0))}constructor(t,e){this.config=t,this.actions=g.sortActions(e),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(t,e,i){this.state=t;const n=i(),o=n.getAttribute(s("id"));this.listener=t=>{const e=t.composedPath().filter((t=>t instanceof HTMLElement&&t.getAttribute(s("type"))));let i=0;for(;e[i]&&e[i].getAttribute(s("id"))!==o;){let t=e[i].getAttribute(s("type"));if(g.IGNORING_VIEW_ENTRY_TYPES.includes(t))return;i++}this.eventsQueue.push({event:t}),this.postponed||this.execute()},this.targetElements=this.config.relativeSelector?Array.from((n.shadowRoot||n).querySelectorAll(this.config.relativeSelector)):[n],this.targetElements.forEach((t=>{t.addEventListener("click",this.listener)}))}async execute(){var t,e,s,i;try{for(var n,o=!0,r=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,s=t[Symbol.asyncIterator];return s?s.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(s){e[s]=t[s]&&function(e){return new Promise((function(i,n){!function(t,e,s,i){Promise.resolve(i).then((function(e){t({value:e,done:s})}),e)}(i,n,(e=t[s](e)).done,e.value)}))}}}(this.eventsQueue);!(t=(n=await r.next()).done);o=!0){i=n.value,o=!1;const{event:t}=i;for(const e of this.actions)if(!await e.execute(this.state.getState(),t))break}}catch(t){e={error:t}}finally{try{o||t||!(s=r.return)||await s.call(r)}finally{if(e)throw e.error}}this.eventsQueue=[]}postpone(){this.postponed=!0}release(){this.postponed=!1,this.execute()}destroy(){this.listener&&this.targetElements.length&&(this.targetElements.forEach((t=>{t.removeEventListener("click",this.listener)})),this.targetElements=[])}}g.IGNORING_VIEW_ENTRY_TYPES=[l,a,r],(m=p||(p={})).CLICK="CLICK",m.COMPONENT_EVENT="COMPONENT_EVENT";class b{constructor(t,e){this.config=t,this.actions=e,this.componentEmitterListener=null}activate(t,e,s){this.componentEmitterListener=e.on(this.config.eventName,(()=>{this.actions.forEach((e=>e.execute(t.getState(),this.config.params)))}))}destroy(){this.componentEmitterListener&&this.componentEmitterListener.off()}}class E{constructor(t,e){this.actionFactory=t,this.actionRegister=e}get(t){const e=t.actions.map((t=>this.actionFactory.get(t)));switch(e.forEach((t=>this.actionRegister.register(t))),t.type){case p.CLICK:return new g(t,e);case p.COMPONENT_EVENT:return new b(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class y{static generate(){let t,e="";for(let s=0;s<32;s++)8!==s&&12!==s&&16!==s&&20!==s||(e+="-"),t=Math.floor(16*Math.random()).toString(16).toUpperCase(),e+=t;return e}}class f{constructor(){this.listeners=f.createDefaultListenersState()}emit(t,e,s=null){const i=this.listeners[t];i&&Object.values(i).forEach((i=>i(e,t,s))),Object.values(this.listeners["*"]).forEach((i=>i(e,t,s)))}on(t,e){const s=y.generate(),i=this.listeners[t];return i?i[s]=e:this.listeners[t]={[s]:e},{off:()=>{var e,i;(null===(i=null===(e=this.listeners)||void 0===e?void 0:e[t])||void 0===i?void 0:i[s])&&delete this.listeners[t][s]}}}destroy(){this.listeners=f.createDefaultListenersState()}}f.createDefaultListenersState=()=>({"*":{}});const v=f,O=(t,e,s,i)=>{const n=EventTarget.prototype,{addEventListenerBase:o,addEventListener:r}=n;(o||r).call(t,e,s,i)};class S{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class T{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===n?Object.assign(Object.assign({},t),T.moduleToContainerParams):t));return Object.assign(Object.assign({},t),{children:e})}));return Object.assign(Object.assign({},t),{views:e})}static sort(t,e){return t.index>e.index?1:-1}static reIndex(t,e){return Object.assign(Object.assign({},t),{index:e+t.index})}}var C,_,A,N,L,R,I,P,x,M,D,U,k;T.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"},(_=C||(C={})).VIEW="VIEW",_.CONTAINER="CONTAINER",_.TEXT="TEXT",_.INPUT="INPUT",_.BUTTON="BUTTON",_.IMAGE="IMAGE",_.CONSENT="CONSENT",_.COUNTDOWN_TIMER="COUNTDOWN_TIMER",_.PROMO_CODE="PROMO_CODE",_.MULTIPLE_INPUT="MULTIPLE_INPUT",_.VIDEO="VIDEO",_.SLIDER="SLIDER",_.SLIDE="SLIDE",_.SOCIAL="SOCIAL",_.COLUMNS="COLUMNS",_.COLUMN="COLUMN",_.PRIZE_BASED_GAMING="PRIZE_BASED_GAMING",(A||(A={})).CLICK="CLICK",function(t){t.SHOW_WIDGET="SHOW_WIDGET",t.OPEN_LINK="OPEN_LINK",t.SUBSCRIBE_CONTACT="SUBSCRIBE_CONTACT",t.REQUEST="REQUEST",t.CLOSE_WIDGET="CLOSE_WIDGET",t.GO_TO_VIEW="GO_TO_VIEW",t.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",t.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",t.CLICK="CLICK"}(N||(N={})),function(t){t.SELF="_self",t.BLANK="_blank"}(L||(L={})),(R||(R={})).ACCENT="accent",function(t){t.TOP="TOP",t.CENTER="CENTER",t.BOTTOM="BOTTOM"}(I||(I={})),function(t){t.LEFT="LEFT",t.CENTER="CENTER",t.RIGHT="RIGHT"}(P||(P={})),function(t){t.SLIDE_TO_TOP="SLIDE_TO_TOP",t.SLIDE_TO_BOTTOM="SLIDE_TO_BOTTOM",t.SLIDE_TO_LEFT="SLIDE_TO_LEFT",t.SLIDE_TO_RIGHT="SLIDE_TO_RIGHT"}(x||(x={})),function(t){t.PULSE="PULSE",t.VIBRATE="VIBRATE",t.WOBBLE="WOBBLE",t.SHAKE="SHAKE",t.JELLO="JELLO",t.BOUNCE="BOUNCE",t.BLINK="BLINK",t.FLICKER="FLICKER",t.PING="PING"}(M||(M={})),function(t){t.LEFT="LEFT",t.RIGHT="RIGHT"}(D||(D={})),(k=U||(U={})).BEFORE="BEFORE",k.AFTER="AFTER",k.INSIDE="INSIDE",k.INSTEAD="INSTEAD";class w extends v{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on("ENVIRONMENT_UPDATE",(({isMobileEnv:t})=>{this._isMobile=t,this.emit(w.changeEventName,this._isMobile)}))}handleMobileBreakpoint(t){this.mobileBreakpointWidth=t;const e=Number.isInteger(this.mobileBreakpointWidth)?`${this.mobileBreakpointWidth}px`:this.mobileBreakpointWidth;this.mediaQueryList=window.matchMedia(`(max-width: ${e})`),this.mediaQueryList.addListener(this.listener.bind(this)),this._isMobile=this.mediaQueryList.matches,this.emit(w.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(w.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}w.changeEventName="CHANGE";const j=w;class B{static set(t,e){const s=t[B.accumulatorPropertyName]||{};t[B.accumulatorPropertyName]=Object.assign(Object.assign({},s),e.styleAttributes),Object.keys(t[B.accumulatorPropertyName]).forEach((s=>{s.includes("--")?t.style.setProperty(s,e.styleAttributes[s]||""):t.style[s]=e.styleAttributes[s]?e.styleAttributes[s]:""}))}}B.accumulatorPropertyName="clStyleAttributes";const F=B;var W;!function(t){t.BUILT_IN="BUILT_IN",t.DETACHED="DETACHED",t.FLOATING_BOX="FLOATING_BOX",t.FLOATING_BAR="FLOATING_BAR",t.LAUNCHER="LAUNCHER",t.CONTENT_LOCKER="CONTENT_LOCKER"}(W||(W={}));class G{static applyHostStyles(t,e,s=null,n){var r,l,a;const d=null===(l=null===(r=null==s?void 0:s.props)||void 0===r?void 0:r.handlers)||void 0===l?void 0:l.find((t=>"CLICK"===t.type));d&&(null===(a=d.actions)||void 0===a?void 0:a.length)&&(e.style.cursor="pointer"),t!==i&&t!==o&&t!==c||(e.style.display=n===W.CONTENT_LOCKER&&t===i?"flex":"inline-flex",e.style.position="relative"),e.style.boxSizing="border-box"}constructor(){this.styles="/* common styles */ *, *:before, *:after { box-sizing: border-box; font-family: inherit; }"}setStyles(t=""){this.styles=`${this.styles} ${t}`}getStyles(){return this.styles}}class H{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class V{constructor(t,e,s,i,n,o){this.hostElement=e,this.documentModel=t,this.getSharedCb=s,this.getPropsCb=i,this.getEnvCb=n,this.httpClient=o,this.schemaSubscription=null,this.themeSubscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(t){const e=String(t||"");if(e.includes("url")){const[t,s]=e.split("(")[1].split(")");return{url:t.replace(/['"]+/g,""),positionOptions:s.replace(";","")}}return{url:null,positionOptions:null}}apply(t){const e=this.getPropsCb();return e.backgroundDynamicInlineSVGElements[t].forEach((s=>{var i,n,o,r,l;const a=null===(n=null===(i=e.adaptiveStyles)||void 0===i?void 0:i[t])||void 0===n?void 0:n.find((t=>t.element===s)),c=(null===(o=e.styles)||void 0===o?void 0:o.find((t=>t.element===s)))||{},d=(null===(r=null==c?void 0:c.styleAttributes)||void 0===r?void 0:r.background)||(null===(l=null==a?void 0:a.styleAttributes)||void 0===l?void 0:l.background),h=this.parseBackground(d);h.url&&this.envUrlMaps[t].set(s,{originalSVGResourceURL:h.url,inlineSvgString:null,positionOptions:h.positionOptions})})),Promise.all([...this.envUrlMaps[t].entries()].map((([e,s])=>this.httpClient.execute(s.originalSVGResourceURL).then((t=>t.text())).then((i=>{this.envUrlMaps[t].set(e,Object.assign(Object.assign({},s),{inlineSvgString:i}))}))))).then((()=>{var e;const s=this.getSharedCb();return Object.keys((null===(e=s.theme)||void 0===e?void 0:e.schema)||{}).length>0?this._applyHostElementBackgroundFromTheme(this.envUrlMaps[t].get("host"),s.theme.schema):this._applyHostElementBackgroundFromCssVars(this.envUrlMaps[t].get("host"),s.cssVars)})).catch((t=>{console.error(t),H.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${t}`)}))}on(){return this.schemaSubscription=this.documentModel.on("COLOR_SCHEMA_UPDATE",(t=>{this._applyHostElementBackgroundFromCssVars(this.envUrlMaps[this.getEnvCb()].get("host"),t)})),this.themeSubscription=this.documentModel.on("THEME_UPDATE",(t=>{this._applyHostElementBackgroundFromTheme(this.envUrlMaps[this.getEnvCb()].get("host"),t.schema)})),this}_applyHostElementBackgroundFromCssVars(t,e){t&&e&&(this.hostElement.style.background=this._buildBackgroundUrlFromCssVars(t,e))}_applyHostElementBackgroundFromTheme(t,e){t&&e&&(this.hostElement.style.background=this._buildBackgroundUrlFromTheme(t,e))}_buildBackgroundUrlFromCssVars(t,e){const s=t.inlineSvgString.trim().replace("var(--cl-schema-accent)",e["cl-schema-accent"]);return`url('data:image/svg+xml,${encodeURIComponent(s)}')${t.positionOptions}`}_buildBackgroundUrlFromTheme(t,e){const s=t.inlineSvgString.trim();let i=s;return[...s.matchAll(/var\(--cl-schema-([^)]+)\)/g)].forEach((t=>{const s=function(t=""){return t.replace(/var\(\s*(--[^,\s)]+).*\)/,"$1").replace("--cl-schema-","")}(t[1]);var n;i=i.replace(`var(--${n=s,`cl-schema-${n}`})`,e[s])})),`url('data:image/svg+xml,${encodeURIComponent(i)}')${t.positionOptions}`}off(){var t,e;null===(t=this.schemaSubscription)||void 0===t||t.off(),null===(e=this.themeSubscription)||void 0===e||e.off()}}const $=new class{execute(t,e="GET",s=null,i,n){const o={method:e,headers:Object.assign({"Content-Type":"text/plain"},i||{}),credentials:"same-origin",body:null,signal:n};return s&&(o.body="string"==typeof s?s:JSON.stringify(s)),fetch(t,o)}};function K(t,e){return Object.keys(t).filter((t=>!e.includes(t))).reduce(((e,s)=>Object.assign(Object.assign({},e),{[s]:t[s]})),{})}class Q{static camelCaseToDashCase(t){return t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}static camelCaseToUpperSnakeCase(t){return t.replace(/[A-Z]/g,(t=>"_"+t)).toUpperCase()}}class z{constructor(t){this._count=0,this.onUpdateCb=t}increment(){this._count++,this.onUpdateCb(this.count())}decrement(){this._count>0&&this._count--,this.onUpdateCb(this.count())}count(){return this._count}}var X;!function(t){t.TOO_MANY_REQUESTS="TOO_MANY_REQUESTS",t.COMPONENT_RESOURCES_LOADED="COMPONENT_RESOURCES_LOADED",t.FAILED_TO_LOAD_COMPONENT_RESOURCE="FAILED_TO_LOAD_COMPONENT_RESOURCE",t.EXECUTE_ACTION_BY_PREDICATE="EXECUTE_ACTION_BY_PREDICATE"}(X||(X={}));const J=X;class q{constructor(t,e,s){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(J.COMPONENT_RESOURCES_LOADED,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(J.FAILED_TO_LOAD_COMPONENT_RESOURCE,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=s,this.counters={pending:new z(this.onCounterStateUpdate)}}}const Y=(...t)=>{let e=t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:[]})),{});return{get:t=>e[t],clear:()=>Y(...t)}},Z=Y,tt="props",et="shared",st="environment";function it(t,e,s,i){const n=t=>{let o=t instanceof DocumentFragment||(null==t?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?t.host:t;return o&&(i&&"function"==typeof i?i(o.getAttribute(e)):(null===(r=null==o?void 0:o.getAttribute)||void 0===r?void 0:r.call(o,e))===s)?o:o&&o.parentNode&&n(o.parentNode)||null;var r};return n(t)}const nt="SUBMIT";function ot(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach((s=>{if("element"===s||"classes"===s)return;const i=e[s];i&&"object"==typeof i&&!Array.isArray(i)?t[s]=Object.assign(Object.assign({},t[s]||{}),i):t[s]=i})),t):t}const rt={DESKTOP:"desktop",MOBILE:"mobile"};function lt(t,e,s){var i;return null===(i=null==t?void 0:t[e])||void 0===i?void 0:i.find((t=>t.element===s))}function at(t){const{element:e,html:s,appendHtml:i}=t,n=function(t){if(null==t)return"";if("string"!=typeof t)return String(t);if(""===t)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(t))return t;const e=(new DOMParser).parseFromString(t,"text/html");return e.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach((t=>t.remove())),e.querySelectorAll("*").forEach((t=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach((e=>t.removeAttribute(e))),Array.from(t.attributes).forEach((e=>{e.name.startsWith("on")&&t.removeAttribute(e.name)})),"A"===t.tagName||"AREA"===t.tagName){const e=t.getAttribute("href");e&&(e.startsWith("javascript:")||e.startsWith("data:"))&&t.removeAttribute("href")}if("IMG"===t.tagName||"IFRAME"===t.tagName){const e=t.getAttribute("src");e&&(e.startsWith("javascript:")||e.startsWith("data:text/html"))&&t.removeAttribute("src")}if("FORM"===t.tagName){const e=t.getAttribute("action");e&&e.startsWith("javascript:")&&t.removeAttribute("action")}})),e.body.innerHTML}(s);i?e.innerHTML+=n:e.innerHTML=n}class ct extends Event{constructor(t,e,s){super(t,s),this.detail={},Object.defineProperty(this,"detail",{value:e})}}var dt;!function(t){t.STATIC="STATIC",t.UPDATING="UPDATING"}(dt||(dt={}));class ht extends HTMLElement{constructor(){var i;super(),this.construct=()=>{let t;const e=this.getAttribute(s("id")),i=this.getWidgetContainerNode();if(!i)throw new Error("Widget container not found in construct");const n=i.closest(`[${s("widget-id")}]`);let o;n&&(o=n.getAttribute(s("widget-id")));let r=new ct("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(s("path")),id:e,widgetId:o},{bubbles:!0,composed:!0});this.dispatchEvent(r),t=r.detail.props,Object.assign(this,t),this.observers=Z(tt,et,st),this.subscriptions=new class{constructor(){this.subscriptions=[]}push(t){this.subscriptions.push(t)}off(){this.subscriptions.forEach((t=>null==t?void 0:t.off()))}},this.state=new S({}),this.componentEventEmitter=new v,this.componentResourceManager=new q(this.model.id,this.services.eventEmitter,this.isStaticRenderMode()),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new E(this._actionFactory,this.services.actionRegister),this.prevProps=this.model.props,this.prevEnvironment=this.getEnvironment(),this.documentModel.on(`COMPONENT_PROPS_UPDATE_${this.model.id}`,(t=>{this.model.props=t,this.observers.get(tt).forEach((e=>e(this.prevProps,t))),this.prevProps=t;const e=this.getHostElement(),i=s("floating");t.floating&&!e.getAttribute(i)?e.setAttribute(i,"true"):!t.floating&&e.getAttribute(i)&&e.removeAttribute(i)})),this.documentModel.on(`COMPONENT_UPDATE_${this.model.id}`,(t=>{Object.assign(this.model,t)})),this.documentModel.on("SHARED_UPDATE_ALL",(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles),this.observers.get(et).forEach((t=>t(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new V(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),$),this.colorSchemaListener.apply(this.getEnvironment()).then((()=>{this.subscriptions.push(this.colorSchemaListener.on())}))),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(j.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(st).forEach((e=>e(this.prevEnvironment,t))),this.prevEnvironment=t})))},this.attachHandlers=()=>{this.getHandlers().map((t=>this._handlerFactory.get(t))).map((t=>()=>t.activate(this.state,this.componentEventEmitter,this.getHostElement.bind(this)))).forEach((t=>t()))},this.postponeHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.postpone()))},this.releaseHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.release()))},this.getProps=()=>{var t;return null===(t=this.getModel())||void 0===t?void 0:t.props},this.getShared=()=>this.documentModel.getShared(),this.getEnvironment=()=>this.resizeListener.isMobile()?"mobile":"desktop",this.isStaticRenderMode=()=>this.services.config.getConfig("renderMode")===dt.STATIC,this.isUpdatingRenderMode=()=>this.services.config.getConfig("renderMode")===dt.UPDATING,this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(tt).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(et).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(st).push(t),t(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${s("element")}]`)).filter((t=>!t.hasAttribute(s("component"))))],this.getElement=(t,e)=>this.getElements().find((i=>e?i.getAttribute(s("element"))===t&&i.id===e:i.getAttribute(s("element"))===t)),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const i=this.getElements();if(!i.length)return;const n=function(t,e){if(!e)return t||{desktop:[],mobile:[]};const s=JSON.parse(JSON.stringify(t||{desktop:[],mobile:[]}));return e.forEach((t=>{const e=t.element;let i=!1,n=!1;s.desktop&&s.desktop.forEach((s=>{s.element===e&&(ot(s,t),i=!0)})),s.mobile&&s.mobile.forEach((s=>{s.element===e&&(ot(s,t),n=!0)})),!i&&s.desktop&&s.desktop.push(JSON.parse(JSON.stringify(t))),!n&&s.mobile&&s.mobile.push(JSON.parse(JSON.stringify(t)))})),s}(t,e),o=s("type"),r="element-styles";let l=this.getRootElement().querySelector(`style[${o}="${r}"]`);l||(l=document.createElement("style"),l.setAttribute(o,r),this.getRootElement().appendChild(l)),at({element:l,html:""}),i.forEach((t=>{let e=t.getAttribute(s("element"));const i=this.getEnvironment();let o=lt(n,i,e);if(o){if(this.resizeListener.isMobile()){const t=lt(n,"desktop",e);t&&(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},t.styleAttributes),o.styleAttributes)}))}this.applyStylesToElement(t,this.applySharedClassesToElementModel(o),l)}})),this._addLinkColor(l,this.getShared())},this.registerComponentResourceManagement=()=>{this.viewResourceManager.registerComponent(this.model.id,this.componentResourceManager)},this.applyStyles=(t,e={})=>{if(!t||!t.style)return!1;for(const[s,i]of Object.entries(e))t.style[s]=i;return!0},this.applyStylesToElement=(t,e,i)=>{var n,o;const r=[];"host"===(e=ht._resolveTogglableStylesForElementModel(e)).element&&(G.applyHostStyles(this.model.type,t,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(n=this.model.props.backgroundDynamicInlineSVGElements)||void 0===n?void 0:n.desktop)||"mobile"===this.getEnvironment()&&(null===(o=this.model.props.backgroundDynamicInlineSVGElements)||void 0===o?void 0:o.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),r.push("background")));let l=e.styleAttributes.background,a=l&&l.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&a){this.componentResourceManager.getPending().increment();const t=new Image;t.src=a[1],O(t,"load",(()=>{this.componentResourceManager.getPending().decrement()})),O(t,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(t.src),this.isUpdatingRenderMode&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},e),{styleAttributes:K(e.styleAttributes,r)});if(F.set(t,c),this._setClassAttributes(t,e),i){if(e.hoverStyleAttributes){let n=Object.assign({},e.hoverStyleAttributes);if("FILL_UP"===e.hoverAnimationType){t.style.boxShadow="inset 0px 0px 0px 0px rgb(0, 0, 0, 0)",t.style.overflow="hidden";const s=t.tagName.toLowerCase(),i=`flip-up-animation-${e.element}`;let o=this.getRootElement().querySelector(`#${i}`);o||(o=document.createElement("style"),o.id=i,t.appendChild(o)),at({element:o,html:`\n ${s}::before {\n content: '';\n background: ${n.background};\n position: absolute;\n left: 0;\n top: ${t.getBoundingClientRect().height}px;\n height: ${t.getBoundingClientRect().height}px;\n width: 100%;\n z-index: -10;\n }\n ${s}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),n=Object.assign(Object.assign({},e.hoverStyleAttributes),{background:"transparent",position:"relative"})}n.borderTopWidth&&"0px"!==n.borderTopWidth||delete n.borderTopColor,n.borderBottomWidth&&"0px"!==n.borderBottomWidth||delete n.borderBottomColor,n.borderLeftWidth&&"0px"!==n.borderLeftWidth||delete n.borderLeftColor,n.borderRightWidth&&"0px"!==n.borderRightWidth||delete n.borderRightColor,this._addStylesToStyleElement(i,e.element,n,`:not(.${s("no-hover")}):hover`,!0)}e.placeholderStyleAttributes&&this._addStylesToStyleElement(i,e.element,e.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(i,this.getShared()),this.stylesAppliedToElement(t,e,i)}},this.applySharedClassesToElementModel=e=>function(e,s){let i=e;return(i.classes||"").split(" ").filter((e=>e.startsWith(t))).forEach((t=>{var e;let n=null===(e=s.textClasses)||void 0===e?void 0:e[t];n&&(n.styleAttributes.fontFamily||(n.isHeader&&s.headerFontFamily&&(n=Object.assign(Object.assign({},n),{styleAttributes:Object.assign(Object.assign({},n.styleAttributes),{fontFamily:s.headerFontFamily})})),!n.isHeader&&s.textFontFamily&&(n=Object.assign(Object.assign({},n),{styleAttributes:Object.assign(Object.assign({},n.styleAttributes),{fontFamily:s.textFontFamily})}))),i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),n.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},i.placeholderStyleAttributes),n.placeholderStyleAttributes)}))})),i.styleAttributes.fontFamily||(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),{fontFamily:s.textFontFamily})})),i}(e,this.documentModel.getShared()),this.getModel=()=>this.model,this._addStylesToStyleElement=(t,e,i,n="",o)=>{const r=Object.keys(i).reduce(((t,e)=>t+` ${Q.camelCaseToDashCase(e)}: ${i[e]}${o?" !important;":";"}`),"");at({element:t,html:`[${s("element")}="${e}"]${n} { ${r} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{at({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var s,i,n,o;e.linkColor&&at({element:t,html:`a {color: ${e.linkColor}}, a:visited {color: ${e.linkColor}}`,appendHtml:!0}),(null===(s=e.linkParams)||void 0===s?void 0:s.color)&&at({element:t,html:`a {color: ${null===(i=e.linkParams)||void 0===i?void 0:i.color}}, a:visited {color: ${null===(n=e.linkParams)||void 0===n?void 0:n.color}}`,appendHtml:!0}),(null===(o=e.linkParams)||void 0===o?void 0:o.removeUnderline)&&at({element:t,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(s,i)=>{Array.from(s.classList).filter((t=>t!==e("hovered")&&t!==e("focused"))).forEach((e=>{e.startsWith(t)&&s.classList.remove(e)}));const n=((s.getAttribute("class")||"")+" "+i.classes).trim();s.setAttribute("class",n)},this.getParentComponent=()=>it(this.parentNode,s("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(s("path"));return t&&1===t.split(",").length?this.parentNode:it(this.parentNode,s("path"),void 0,(t=>t&&1===t.split(",").length))},this.getWidgetLanguages=()=>function(t){return[t.getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter((t=>!!t))}(this.services.config),this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=t=>function(t,e){return e.reduce(((e,s)=>{if(e)return e;const i=function(t,e){if(!t)return null;if(e[t])return{translations:e[t],language:t};const s=function(t){return t.includes("-")?t.split("-")[0].toLowerCase():t.includes("_")?t.split("_")[0].toLowerCase():t}(t);return e[s]?{translations:e[s],language:s}:null}(s,t);return i||null}),null)}(t,this.getWidgetLanguages()),this.stylesAppliedToElement=(t,e,s)=>{},this.updateContext=()=>{var t;const e=this.getModel();this.services.context.updateRecord(e.id,{label:this.getContextRecordLabel(e.props),viewIndex:null===(t=e.path)||void 0===t?void 0:t[0]})},this.addContextRecord=()=>{var t;const e=this.getModel();this.services.context.addRecord(e.id,{recordKey:e.id,id:e.props.control.name,label:this.getContextRecordLabel(e.props),value:e.props.control.defaultValue||"",viewIndex:null===(t=e.path)||void 0===t?void 0:t[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(e.props)}})},this.getContextRecordLabel=t=>{var e,s,i,n,o,r;const l=t.control.name;if(["email","first_name","last_name"].includes(l))return l.toUpperCase();if((null===(e=t.content)||void 0===e?void 0:e.label)&&(null===(n=null===(i=null===(s=t.adaptiveStyles)||void 0===s?void 0:s.desktop.find((t=>"label"===t.element)))||void 0===i?void 0:i.params)||void 0===n?void 0:n.enabled)){const e=(new DOMParser).parseFromString(t.content.label,"text/html");return this.capitalizeFirstLetter(e.body.textContent||"")}return(null===(o=t.content)||void 0===o?void 0:o.placeholder)?this.capitalizeFirstLetter(t.content.placeholder):(null===(r=t.control)||void 0===r?void 0:r.integrationName)?this.capitalizeFirstLetter(t.control.integrationName).replace(new RegExp("_","g")," "):void 0},this.capitalizeFirstLetter=t=>t.charAt(0).toUpperCase()+t.slice(1),this.getContextRecordExampleValue=t=>{var e;switch(null===(e=t.control)||void 0===e?void 0:e.name){case"email":return"myemail@example.com";case"first_name":return"Maria";case"last_name":return"Taylor";default:return this.getContextRecordLabel(t)}},this.completeSubmitAction=t=>{const e=t||{},s=this.services.actionRegister.getRegisteredActions().find((t=>t.category===nt));s?null==s||s.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:u.REQUEST}).execute(void 0,void 0,!0,e)},this.getHandlers=()=>{var t;return(null===(t=this.getProps())||void 0===t?void 0:t.handlers)&&this.getProps().handlers.length?[...this.getProps().handlers]:[]},this.assets=(t="")=>`${this.services.config.getConfig("staticResourcesUrl").replace(/\/$/,"")}/${this.manifest.name}/assets${t?`/${t}`:""}`,this.attachShadow({mode:"open"}),this.manifest=this.manifest||(null===(i=this.constructor.define)||void 0===i?void 0:i.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then((()=>{this.attachHandlers()}))}disconnectedCallback(){var t;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(t=this.mergeTagsProcessor)||void 0===t||t.destroy()}}ht._resolveTogglableStylesForElementModel=t=>{const e=Object.assign({},t);return Object.keys(e).forEach((t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=ht._resolveTogglableStyles(e[t]))})),e},ht._resolveTogglableStyles=t=>{const e=Object.assign({},t),s=(t,s,i)=>{s in e&&(t.forEach((t=>{t in e&&(e[t]=e[s]?e[t]:i)})),delete e[s])};return s(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),s(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),e};const ut=ht,pt={name:"SysSlideComponent",componentType:"SLIDE",version:"1.0.0",focusParentOnClick:!0,preventDraggable:!0,propertyPaneModel:{content:function(t){return Object.values(rt).map((e=>({type:"GROUP",propPath:["adaptiveStyles",e],children:t})))}([{type:"CONTROL",name:"ALIGNMENT",elementProp:"styleAttributes",element:"host",hideSyncSelect:!0},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",hideSyncSelect:!0,params:{indentationType:"PADDING"}}]),general:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!0}}]},events:{dispatch:[],listen:[]},i18nPropertyPaneModel:{content:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!1}}]},i18nPropPaths:["handlers,[id],actions,[id],params,link"],props:{content:{name:null},styles:[{element:"host",styleAttributes:{background:"#FFFFFF"},classes:""}],adaptiveStyles:{desktop:[{element:"host",styleAttributes:{display:"inline-flex",position:"relative",width:"100%",minWidth:null,height:"auto",minHeight:null,overflow:"hidden",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"20px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",_paddingEnabled:!1,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1,borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"0px",borderTopColor:"rgb(0, 0, 0)",borderBottomWidth:"0px",borderBottomColor:"rgb(0, 0, 0)",borderLeftWidth:"0px",borderLeftColor:"rgb(0, 0, 0)",borderRightWidth:"0px",borderRightColor:"rgb(0, 0, 0)",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none"},classes:""}],mobile:[{element:"host",styleAttributes:{position:"relative",width:"100%",minWidth:null,height:"auto",minHeight:null,overflow:"hidden",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"20px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",_paddingEnabled:!1,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1,borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"0px",borderTopColor:"rgb(0, 0, 0)",borderBottomWidth:"0px",borderBottomColor:"rgb(0, 0, 0)",borderLeftWidth:"0px",borderLeftColor:"rgb(0, 0, 0)",borderRightWidth:"0px",borderRightColor:"rgb(0, 0, 0)",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none"},classes:""}]}},waitForResourcesLoad:!0,resourcesPropPaths:[["adaptiveStyles",":ENV","styleAttributes","background"],["styles","styleAttributes","background"]],metaDescription:{label:{en:"Slide",ru:"Слайд",uk:"Слайд",es:"Diapositiva",fr:"Diapositive",de:"Slide",it:"Slide",pt:"Diapositivo",ro:"Slide",bg:"Слайд",cs:"Slide",el:"Slide",nl:"Slide",pl:"Slajd",sv:"Slide",tr:"Slide",ar:"Slide",zh:"Slide",da:"Slide",he:"Slide",fi:"Slide",hi:"Slide",hr:"Slide",hu:"Slide",id:"Slide",ja:"Slide",ko:"Slide",no:"Slide",sk:"Slide",sl:"Slide",sr:"Slide"}},syncEnabled:!0,stylesImitationEnabled:!0};function mt(t){return mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mt(t)}function gt(t,e){for(var s=0;s<e.length;s++){var i=e[s];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Ot(i.key),i)}}function bt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(bt=function(){return!!t})()}function Et(){return Et="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,s){var i=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=yt(t)););return t}(t,e);if(i){var n=Object.getOwnPropertyDescriptor(i,e);return n.get?n.get.call(arguments.length<3?t:s):n.value}},Et.apply(null,arguments)}function yt(t){return yt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},yt(t)}function ft(t,e){return ft=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ft(t,e)}function vt(t,e,s){return(e=Ot(e))in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Ot(t){var e=function(t){if("object"!=mt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var s=e.call(t,"string");if("object"!=mt(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==mt(e)?e:e+""}var St=function(){function t(){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),vt(e=function(t,e,s){return e=yt(e),function(t,e){if(e&&("object"==mt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,bt()?Reflect.construct(e,s||[],yt(t).constructor):e.apply(t,s))}(this,t),"manifest",pt),e.getRootElement().innerHTML="\n <style>\n :host {\n position: relative;\n flex: 0 0 100%;\n min-width: 20px;\n min-height: 20px;\n }\n </style>\n ",e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ft(t,e)}(t,ut),function(t,e){return e&&gt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"connectedCallback",value:function(){var e=this;!function(t,e,s){var i=Et(yt(t.prototype),"connectedCallback",s);return"function"==typeof i?function(t){return i.apply(s,t)}:i}(t,0,this)([]),this.observeProps((function(t,s){e.applyAutoAdaptiveStyles(s.adaptiveStyles,s.styles)}))}}])}();vt(St,"define",{name:"sys-slide",model:pt.name,manifest:pt});export{St as default};window.clComponentClass_SysSlideComponent=St;