@claspo/components 1.1.15 → 1.2.0-theme.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/SysButtonComponent/SysButtonComponent.js +1 -1
- package/SysCalendarComponent/SysCalendarComponent.js +1 -1
- package/SysCheckboxListComponent/SysCheckboxListComponent.js +1 -1
- package/SysColumnComponent/SysColumnComponent.js +1 -1
- package/SysColumnsComponent/SysColumnsComponent.js +1 -1
- package/SysConsentComponent/SysConsentComponent.js +1 -1
- package/SysContainerComponent/SysContainerComponent.js +1 -1
- package/SysCountdownTimerComponent/SysCountdownTimerComponent.js +1 -1
- package/SysDateComponent/SysDateComponent.js +1 -1
- package/SysDropdownInputComponent/SysDropdownInputComponent.js +1 -1
- package/SysImageComponent/SysImageComponent.js +1 -1
- package/SysInAppColumnsComponent/SysInAppColumnsComponent.js +1 -1
- package/SysInputComponent/SysInputComponent.js +1 -1
- package/SysPhoneInputComponent/SysPhoneInputComponent.js +1 -1
- package/SysPromoCodeComponent/SysPromoCodeComponent.js +1 -1
- package/SysRadioGroupComponent/SysRadioGroupComponent.js +1 -1
- package/SysSlideComponent/SysSlideComponent.js +1 -1
- package/SysSliderComponent/SysSliderComponent.js +1 -1
- package/SysSocialComponent/SysSocialComponent.js +1 -1
- package/SysTextAreaComponent/SysTextAreaComponent.js +1 -1
- package/SysTextComponent/SysTextComponent.js +1 -1
- package/SysVideoComponent/SysVideoComponent.js +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const t="cl-";function e(e){return t+e}function n(t){return"cl-"+t}const o="VIEW",i="MODULE",r="CONTAINER",s="INPUT",l="BUTTON",a="CONSENT",c="COLUMN",p="SUBSCRIBE_CONTACT",h="REQUEST",d="SHOW_WIDGET",u="OPEN_LINK",m="CLOSE_WIDGET";class g{static sortActions(t){const e={[m]:-1,[u]:-2,[d]:1,[p]:2,[h]:3},n=t=>void 0!==e[t.type]?e[t.type]:0;return[...t].sort(((t,e)=>n(t)>n(e)?-1:n(t)<n(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,o){this.state=t;const i=o(),r=i.getAttribute(n("id"));this.listener=t=>{const e=t.composedPath().filter((t=>t instanceof HTMLElement&&t.getAttribute(n("type"))));let o=0;for(;e[o]&&e[o].getAttribute(n("id"))!==r;){let t=e[o].getAttribute(n("type"));if(g.IGNORING_VIEW_ENTRY_TYPES.includes(t))return;o++}this.eventsQueue.push({event:t}),this.postponed||this.execute()},this.targetElements=this.config.relativeSelector?Array.from((i.shadowRoot||i).querySelectorAll(this.config.relativeSelector)):[i],this.targetElements.forEach((t=>{t.addEventListener("click",this.listener)}))}async execute(){var t,e,n,o;try{for(var i,r=!0,s=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},o("next"),o("throw"),o("return"),e[Symbol.asyncIterator]=function(){return this},e);function o(n){e[n]=t[n]&&function(e){return new Promise((function(o,i){!function(t,e,n,o){Promise.resolve(o).then((function(e){t({value:e,done:n})}),e)}(o,i,(e=t[n](e)).done,e.value)}))}}}(this.eventsQueue);!(t=(i=await s.next()).done);){o=i.value,r=!1;try{const{event:t}=o;for(const e of this.actions)if(!await e.execute(this.state.getState(),t))break}finally{r=!0}}}catch(t){e={error:t}}finally{try{r||t||!(n=s.return)||await n.call(s)}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,s];const f="CLICK",b="COMPONENT_EVENT";class y{constructor(t,e){this.config=t,this.actions=e,this.componentEmitterListener=null}activate(t,e,n){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 f:return new g(t,e);case b:return new y(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class C{static generate(){let t,e="";for(let n=0;n<32;n++)8!==n&&12!==n&&16!==n&&20!==n||(e+="-"),t=Math.floor(16*Math.random()).toString(16).toUpperCase(),e+=t;return e}}class E{constructor(){this.listeners=E.createDefaultListenersState()}emit(t,e,n=null){const o=this.listeners[t];o&&Object.values(o).forEach((o=>o(e,t,n))),Object.values(this.listeners["*"]).forEach((o=>o(e,t,n)))}on(t,e){const n=C.generate(),o=this.listeners[t];return o?o[n]=e:this.listeners[t]={[n]:e},{off:()=>{var e,o;(null===(o=null===(e=this.listeners)||void 0===e?void 0:e[t])||void 0===o?void 0:o[n])&&delete this.listeners[t][n]}}}destroy(){this.listeners=E.createDefaultListenersState()}}E.createDefaultListenersState=()=>({"*":{}});const O=(t,e,n,o)=>{const{addEventListenerBase:i,addEventListener:r}=EventTarget.prototype;(i||r).call(t,e,n,o)};class T{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class S{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===i?Object.assign(Object.assign({},t),S.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})}}S.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"};class x extends E{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 A{static set(t,e){const n=t[A.accumulatorPropertyName]||{};t[A.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[A.accumulatorPropertyName]).forEach((n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""}))}}A.accumulatorPropertyName="clStyleAttributes";const w="CONTENT_LOCKER";class R{static applyHostStyles(t,e,n=null,i){var s,l,a;const p=null===(l=null===(s=null==n?void 0:n.props)||void 0===s?void 0:s.handlers)||void 0===l?void 0:l.find((t=>"CLICK"===t.type));p&&(null===(a=p.actions)||void 0===a?void 0:a.length)&&(e.style.cursor="pointer"),t!==o&&t!==r&&t!==c||(e.style.display=i===w&&t===o?"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,n,o,i,r){this.hostElement=e,this.documentModel=t,this.getSharedCb=n,this.getPropsCb=o,this.getEnvCb=i,this.httpClient=r,this.subscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(t){const e=String(t||"");if(e.includes("url")){const[t,n]=e.split("(")[1].split(")");return{url:t.replace(/['"]+/g,""),positionOptions:n.replace(";","")}}return{url:null,positionOptions:null}}apply(t){const e=this.getPropsCb();return e.backgroundDynamicInlineSVGElements[t].forEach((n=>{var o,i,r,s,l;const a=null===(i=null===(o=e.adaptiveStyles)||void 0===o?void 0:o[t])||void 0===i?void 0:i.find((t=>t.element===n)),c=(null===(r=e.styles)||void 0===r?void 0:r.find((t=>t.element===n)))||{},p=(null===(s=null==c?void 0:c.styleAttributes)||void 0===s?void 0:s.background)||(null===(l=null==a?void 0:a.styleAttributes)||void 0===l?void 0:l.background),h=this.parseBackground(p);h.url&&this.envUrlMaps[t].set(n,{originalSVGResourceURL:h.url,inlineSvgString:null,positionOptions:h.positionOptions})})),Promise.all([...this.envUrlMaps[t].entries()].map((([e,n])=>this.httpClient.execute(n.originalSVGResourceURL).then((t=>t.text())).then((o=>{this.envUrlMaps[t].set(e,Object.assign(Object.assign({},n),{inlineSvgString:o}))}))))).then((()=>{this._applyHostElementBackground(this.envUrlMaps[t].get("host"),this.getSharedCb().cssVars)})).catch((t=>{console.error(t),P.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${t}`)}))}on(){return this.subscription=this.documentModel.on("COLOR_SCHEMA_UPDATE",(t=>{this._applyHostElementBackground(this.envUrlMaps[this.getEnvCb()].get("host"),t)})),this}_applyHostElementBackground(t,e){t&&(this.hostElement.style.background=this._buildBackgroundUrl(t,e))}_buildBackgroundUrl(t,e){const n=t.inlineSvgString.trim().replace("var(--cl-schema-accent)",e["cl-schema-accent"]);return`url('data:image/svg+xml,${encodeURIComponent(n)}')${t.positionOptions}`}off(){var t;null===(t=this.subscription)||void 0===t||t.off()}}const L=new class{execute(t,e,n=null,o,i){const r={method:e,headers:Object.assign({"Content-Type":"text/plain"},o||{}),credentials:"same-origin",body:null,signal:i};return n&&(r.body="string"==typeof n?n:JSON.stringify(n)),fetch(t,r)}};function M(t,e){return Object.keys(t).filter((t=>!e.includes(t))).reduce(((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]})),{})}class _{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 k{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 I="COMPONENT_RESOURCES_LOADED",j="FAILED_TO_LOAD_COMPONENT_RESOURCE";class H{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(I,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(j,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=n,this.counters={pending:new k(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)}},B=D,F="props",W="shared",V="environment";function U(t,e,n,o){const i=t=>{let r=t instanceof DocumentFragment||(null==t?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?t.host:t;return r&&(o&&"function"==typeof o?o(r.getAttribute(e)):(null===(s=null==r?void 0:r.getAttribute)||void 0===s?void 0:s.call(r,e))===n)?r:r&&r.parentNode&&i(r.parentNode)||null;var s};return i(t)}const $="SUBMIT";function G(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach((n=>{"element"!==n&&"classes"!==n&&(e[n]&&"object"==typeof e[n]&&!Array.isArray(e[n])?t[n]=Object.assign(Object.assign({},t[n]||{}),e[n]):t[n]=e[n])})),t):t}function z(t,e,n){var o;return null===(o=t[e])||void 0===o?void 0:o.find((t=>t.element===n))}function Z(t){const{element:e,html:n,appendHtml:o}=t,i=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}(n);o?e.innerHTML+=i:e.innerHTML=i}class K extends Event{constructor(t,e,n){super(t,n),this.detail={},Object.defineProperty(this,"detail",{value:e})}}class q extends HTMLElement{constructor(){var o,i;super(),this.construct=()=>{let t;const e=this.getAttribute(n("id")),o=this.getWidgetContainerNode();if(!o)throw new Error("Widget container not found in construct");const i=o.closest(`[${n("widget-id")}]`);let r;i&&(r=i.getAttribute(n("widget-id")));let s=new K("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(n("path")),id:e,widgetId:r},{bubbles:!0,composed:!0});this.dispatchEvent(s),t=s.detail.props,Object.assign(this,t),this.observers=B(F,W,V),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 T,this.componentEventEmitter=new E,this.componentResourceManager=new H(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(F).forEach((e=>e(this.prevProps,t))),this.prevProps=t;const e=this.getHostElement(),o=n("floating");t.floating&&!e.getAttribute(o)?e.setAttribute(o,"true"):!t.floating&&e.getAttribute(o)&&e.removeAttribute(o)})),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()),L),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(V).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(F).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(W).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(V).push(t),t(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${n("element")}]`)).filter((t=>!t.hasAttribute(n("component"))))],this.getElement=(t,e)=>this.getElements().find((o=>e?o.getAttribute(n("element"))===t&&o.id===e:o.getAttribute(n("element"))===t)),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const o=this.getElements();if(!o.length)return;t=function(t,e){if(!e)return t||{desktop:[],mobile:[]};const n=JSON.parse(JSON.stringify(t||{desktop:[],mobile:[]}));return e.forEach((t=>{const e=t.element;let o=!1,i=!1;n.desktop&&n.desktop.forEach((n=>{n.element===e&&(G(n,t),o=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===e&&(G(n,t),i=!0)})),!o&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(t))),!i&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(t)))})),n}(t,e);const i=n("type"),r="element-styles";let s=this.getRootElement().querySelector(`style[${i}="${r}"]`);s||(s=document.createElement("style"),s.setAttribute(i,r),this.getRootElement().appendChild(s)),Z({element:s,html:""}),o.forEach((e=>{let o=e.getAttribute(n("element"));const i=this.getEnvironment();let r=z(t,i,o);if(r){if(this.resizeListener.isMobile()){const e=z(t,"desktop",o);e&&(r=Object.assign(Object.assign({},r),{styleAttributes:Object.assign(Object.assign({},e.styleAttributes),r.styleAttributes)}))}this.applyStylesToElement(e,this.applySharedClassesToElementModel(r),s)}})),this._addLinkColor(s,this.getShared())},this.registerComponentResourceManagement=()=>{this.viewResourceManager.registerComponent(this.model.id,this.componentResourceManager)},this.applyStyles=(t,e={})=>{if(!t||!t.style)return!1;for(const[n,o]of Object.entries(e))t.style[n]=o;return!0},this.applyStylesToElement=(t,e,o)=>{var i,r;const s=[];"host"===(e=q._resolveTogglableStylesForElementModel(e)).element&&(R.applyHostStyles(this.model.type,t,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(i=this.model.props.backgroundDynamicInlineSVGElements)||void 0===i?void 0:i.desktop)||"mobile"===this.getEnvironment()&&(null===(r=this.model.props.backgroundDynamicInlineSVGElements)||void 0===r?void 0:r.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),s.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:M(e.styleAttributes,s)});if(A.set(t,c),this._setClassAttributes(t,e),o){if(e.hoverStyleAttributes){let i=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 n=t.tagName.toLowerCase(),o=`flip-up-animation-${e.element}`;let r=this.getRootElement().querySelector(`#${o}`);r||(r=document.createElement("style"),r.id=o,t.appendChild(r)),Z({element:r,html:`\n ${n}::before {\n content: '';\n background: ${i.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 ${n}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),i=Object.assign(Object.assign({},e.hoverStyleAttributes),{background:"transparent",position:"relative"})}i.borderTopWidth&&"0px"!==i.borderTopWidth||delete i.borderTopColor,i.borderBottomWidth&&"0px"!==i.borderBottomWidth||delete i.borderBottomColor,i.borderLeftWidth&&"0px"!==i.borderLeftWidth||delete i.borderLeftColor,i.borderRightWidth&&"0px"!==i.borderRightWidth||delete i.borderRightColor,this._addStylesToStyleElement(o,e.element,i,`:not(.${n("no-hover")}):hover`,!0)}e.placeholderStyleAttributes&&this._addStylesToStyleElement(o,e.element,e.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(o,this.getShared()),this.stylesAppliedToElement(t,e,o)}},this._fixMarginOverflow=t=>{const e=this.getParentComponent(),o=e&&("flex"===e.style.display||"inline-flex"===e.style.display),i="host",r=t.getAttribute(n("element"))===i;if(!o||!r)return;const s=this.getProps(),l=this.getEnvironment(),{styleAttributes:a}=z(s.adaptiveStyles,l,i)||{};if(!a)return;const c=a.marginLeft||a.marginRight,p="100%"===a.width;if(c&&p){const e=(parseFloat(a.marginLeft)||0)+(parseFloat(a.marginRight)||0);e&&setTimeout((()=>{t.style.width=`calc(100% - ${e}px)`}))}},this.applySharedClassesToElementModel=e=>function(e,n){let o=e;return(o.classes||"").split(" ").filter((e=>e.startsWith(t))).forEach((t=>{var e;let i=null===(e=n.textClasses)||void 0===e?void 0:e[t];i&&(i.styleAttributes.fontFamily||(i.isHeader&&n.headerFontFamily&&(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),{fontFamily:n.headerFontFamily})})),!i.isHeader&&n.textFontFamily&&(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),{fontFamily:n.textFontFamily})}))),o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),i.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},o.placeholderStyleAttributes),i.placeholderStyleAttributes)}))})),o.styleAttributes.fontFamily||(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),{fontFamily:n.textFontFamily})})),o}(e,this.documentModel.getShared()),this.getModel=()=>this.model,this._addStylesToStyleElement=(t,e,o,i="",r)=>{const s=Object.keys(o).reduce(((t,e)=>t+` ${_.camelCaseToDashCase(e)}: ${o[e]}${r?" !important;":";"}`),"");Z({element:t,html:`[${n("element")}="${e}"]${i} { ${s} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{Z({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,o,i,r;e.linkColor&&Z({element:t,html:`a {color: ${e.linkColor}}, a:visited {color: ${e.linkColor}}`,appendHtml:!0}),(null===(n=e.linkParams)||void 0===n?void 0:n.color)&&Z({element:t,html:`a {color: ${null===(o=e.linkParams)||void 0===o?void 0:o.color}}, a:visited {color: ${null===(i=e.linkParams)||void 0===i?void 0:i.color}}`,appendHtml:!0}),(null===(r=e.linkParams)||void 0===r?void 0:r.removeUnderline)&&Z({element:t,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(n,o)=>{Array.from(n.classList).filter((t=>t!==e("hovered")&&t!==e("focused"))).forEach((e=>{e.startsWith(t)&&n.classList.remove(e)}));const i=((n.getAttribute("class")||"")+" "+o.classes).trim();n.setAttribute("class",i)},this.getParentComponent=()=>U(this.parentNode,n("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(n("path"));return t&&1===t.split(",").length?this.parentNode:U(this.parentNode,n("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,n)=>{if(e)return e;const o=function(t,e){if(!t)return null;if(e[t])return{translations:e[t],language:t};const n=function(t){return t.includes("-")?t.split("-")[0].toLowerCase():t.includes("_")?t.split("_")[0].toLowerCase():t}(t);return e[n]?{translations:e[n],language:n}:null}(n,t);return o||null}),null)}(t,this.getWidgetLanguages()),this.stylesAppliedToElement=(t,e,n)=>{},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,n;const o=t.control.name;if(["email","first_name","last_name"].includes(o))return o.toUpperCase();if(t.content.label&&(null===(n=null===(e=t.adaptiveStyles.desktop.find((t=>"label"===t.element)))||void 0===e?void 0:e.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 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||{},n=this.services.actionRegister.getRegisteredActions().find((t=>t.category===$));n?null==n||n.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===(o=this.define)||void 0===o?void 0:o.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()}static _resolveTogglableStylesForElementModel(t){const e=Object.assign({},t);return Object.keys(e).forEach((t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=q._resolveTogglableStyles(e[t]))})),e}static _resolveTogglableStyles(t){const e=Object.assign({},t),n=(t,n,o)=>{n in e&&(t.forEach((t=>{t in e&&(e[t]=e[n]?e[t]:o)})),delete e[n])};return n(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),n(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),e}}const Q={name:"SysPromoCodeComponent",componentType:"PROMO_CODE",version:"1.0.0",events:{dispatch:[],listen:[]},contextMenuModel:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}]}],floatingControlsModel:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"}]}],propertyPaneModel:{content:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["fixed","fill","hug"]}}},{type:"CONTROL",name:"TEXT_PARAMS",params:[{element:"text",isTextTransformAvailable:!0}]},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=text]","styleAttributes"]},{type:"CONTROL",name:"PROMOCODE_ICON",propPath:["styles","[element=icon]","styleAttributes"],params:{visibleDisplayValue:"flex"}},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=text]","styleAttributes"]},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=text]","styleAttributes"]},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=text]","styleAttributes"]},{type:"CONTROL",name:"HOVER_ANIMATION",propPath:["styles","[element=text]","hoverStyleAttributes"],params:{animationTypeProp:{propPath:["styles","[element=text]","hoverAnimationType"]}}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"text",params:{indentationType:"PADDING"}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"}}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["fixed","fill","hug"]}}},{type:"CONTROL",name:"TEXT_PARAMS",params:[{element:"text",isTextTransformAvailable:!0}]},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=text]","styleAttributes"]},{type:"CONTROL",name:"PROMOCODE_ICON",propPath:["styles","[element=icon]","styleAttributes"],params:{visibleDisplayValue:"flex"}},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=text]","styleAttributes"]},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=text]","styleAttributes"]},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=text]","styleAttributes"]},{type:"CONTROL",name:"HOVER_ANIMATION",propPath:["styles","[element=text]","hoverStyleAttributes"],params:{animationTypeProp:{propPath:["styles","[element=text]","hoverAnimationType"]}}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"text",params:{indentationType:"PADDING"}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"}}]}],general:[{type:"TEXT",params:{text:"DOCUMENT_CLICK_COMPONENT_TO_COPY_TO_CLIPBOARD",type:"SECONDARY"},displayCondition:"return !sdk.documentUtils.findComponentsByTypes(sdk.views ,['PRIZE_BASED_GAMING']).some(c => c.path[0] < sdk.component.path[0])"},{type:"CONTROL",name:"PRIZE_SETTINGS",propPath:["content","prize"],params:{linkedGamifiedComponentType:"PRIZE_BASED_GAMING"},displayCondition:"return sdk.documentUtils.findComponentsByTypes(sdk.views ,['PRIZE_BASED_GAMING']).some(c => c.path[0] < sdk.component.path[0])"},{type:"CONTROL",name:"SWITCH",propPath:["content","countAsTargetAction"],params:{label:"i18n_DOCUMENT_COUNT_AS_TARGET_ACTION_LABEL",boldLabel:!0,tooltip:"i18n_DOCUMENT_COUNT_AS_TARGET_ACTION_TOOLTIP"},displayCondition:"return sdk.widgetType === 'INFORMER'"}]},autoContrast:[{slave:{element:"text",elementProp:"styleAttributes",elementSubProp:"color"},master:{element:"text",elementProp:"styleAttributes",elementSubProp:"background"},enabledPropPath:["content","textContrastEnabled"]},{slave:{element:"icon",elementProp:"styleAttributes",elementSubProp:"color"},master:{element:"text",elementProp:"styleAttributes",elementSubProp:"background"},enabledPropPath:["content","iconContrastEnabled"]}],i18nPropPaths:["content,text"],props:{styles:[{element:"text",styleAttributes:{borderTopStyle:"dashed",borderRightStyle:"dashed",borderBottomStyle:"dashed",borderLeftStyle:"dashed",borderTopWidth:"2px",borderTopColor:"rgba(68, 68, 68, 1)",borderBottomWidth:"2px",borderBottomColor:"rgba(68, 68, 68, 1)",borderLeftWidth:"2px",borderLeftColor:"rgba(68, 68, 68, 1)",borderRightWidth:"2px",borderRightColor:"rgba(68, 68, 68, 1)",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none",background:"transparent"},hoverStyleAttributes:{}},{element:"icon",styleAttributes:{display:"flex",position:"static",marginLeft:"10px",right:"5px",color:"rgba(68, 68, 68, 1)","--clPromocodeIconWidth":"18px","--clPromocodeIconHeight":"18px"}}],adaptiveStyles:{desktop:[{element:"host",styleAttributes:{width:"auto",minWidth:null,height:"auto",minHeight:null,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1}},{element:"text",styleAttributes:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"20px",paddingRight:"20px",_paddingEnabled:!0,color:"rgba(68, 68, 68, 1)",textAlign:"center",lineHeight:"120%",fontWeight:"500",fontSize:"18px",textShadow:"none"},classes:""}],mobile:[{element:"host",styleAttributes:{width:"auto",minWidth:null,height:"auto",minHeight:null,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1}},{element:"text",styleAttributes:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"20px",paddingRight:"20px",_paddingEnabled:!0,color:"rgba(68, 68, 68, 1)",textAlign:"center",lineHeight:"120%",fontWeight:"500",fontSize:"18px",textShadow:"none"},classes:""}]},content:{text:"SALE_15",iconContent:0,iconContrastEnabled:!0,textContrastEnabled:!0}},metaDescription:{icon:"/SysPromoCodeComponent/assets/img/promo-code-component-icon.svg",label:{en:"Promo code",ru:"Промокод",uk:"Промокод",es:"Código promocional",fr:"Code promo",de:"Gutscheincode",it:"Codice promozionale",pt:"Código promocional",ro:"Cod promoțional",bg:"Промоционален код",cs:"Promo kód",el:"Κωδικός προσφοράς",nl:"Promotiecode",pl:"Kod promocyjny",sv:"Rabattkod",tr:"Promosyon kodu",ar:"الرمز الترويجي",zh:"促销码",da:"Kampagnekode",he:"קוד קידום",fi:"Alennuskoodi",hi:"प्रोमो कोड",hr:"Promotivni kod",hu:"Promo kód",id:"Kode promo",ja:"プロモコード",ko:"프로모션 코드",no:"Kampanjekode",sk:"Propagačný kód",sl:"Promocijska koda",sr:"Promo kod"}}},J={en:"Copied!",ru:"Скопировано!",uk:"Скопійовано!",es:"Copiado!",de:"Kopiert!",fr:"Copié!",it:"Copiato!",pt:"Copiado!",ro:"Copiat!",bg:"Копирано!",cs:"Zkopírováno!",el:"Αντιγράφηκε!",nl:"Gekopieerd!",pl:"Skopiowane!",sv:"Kopierade!",tr:"Kopyalandı!",ar:"نسخ!",hu:"Másolva!"},Y=['\n <svg xmlns="http://www.w3.org/2000/svg" width="25" height="24" viewBox="0 0 25 24">\n <path d="M7.9,9.5L0,3.8c1.2-1.6,3.4-2,5.1-0.9l8.5,6l3.1-2.2c-1.2-2-0.6-4.6,1.3-5.9c2-1.4,4.8-0.9,6.2,1.1 c1.4,2,0.9,4.8-1.1,6.3c-1.4,1-3.1,1.1-4.6,0.3l-3.8,2.7l3.8,2.7c1.4-0.7,3.2-0.6,4.6,0.3c2,1.4,2.5,4.2,1.1,6.3 c-1.4,2-4.2,2.5-6.2,1.1c-1.9-1.4-2.5-3.9-1.3-5.9l-4-2.7H7.4l3-1.7L7.9,9.5z M22.8,17.9c0-1.3-1-2.3-2.3-2.3c-1.3,0-2.3,1-2.3,2.3 c0,1.3,1,2.3,2.3,2.3C21.8,20.2,22.8,19.2,22.8,17.9z M22.8,4.5c0-1.3-1-2.3-2.3-2.3c-1.3,0-2.3,1-2.3,2.3s1,2.3,2.3,2.3 C21.8,6.8,22.8,5.8,22.8,4.5z" fill="currentColor"/>\n </svg>\n ','\n <svg xmlns="http://www.w3.org/2000/svg" width="25" height="24" viewBox="0 0 25 24" fill="none">\n <path d="M10.5278 12.0003L0.0870176 20.5846C0.0276258 20.6336 0.021828 20.72 0.0784574 20.7716C0.735083 21.3673 4.70771 24.1658 13.7643 14.862L15.2546 16.1708C15.0272 16.728 14.9013 17.3393 14.9013 17.9815C14.9013 20.571 16.9449 22.667 19.47 22.667C21.9952 22.667 24.0391 20.571 24.0391 17.9815C24.0391 15.392 21.9952 13.2961 19.47 13.2961C18.5938 13.2961 17.7758 13.5487 17.0811 13.9867L14.8192 12.0003L17.0811 10.0137C17.7761 10.4516 18.5941 10.7043 19.47 10.7043C21.9952 10.7043 24.0391 8.60803 24.0391 6.01913C24.0391 3.43022 21.9952 1.33366 19.47 1.33366C16.9449 1.33366 14.9013 3.42965 14.9013 6.01913C14.9013 6.66132 15.0272 7.27265 15.2546 7.82986L13.764 9.13947C4.70771 -0.164618 0.735083 2.63335 0.0784574 3.22909C0.021828 3.28093 0.0276258 3.36677 0.0870176 3.41606L10.5278 12.0003ZM19.47 15.7884C20.6518 15.7886 21.6087 16.7696 21.6087 17.9815C21.6087 19.1934 20.6518 20.1747 19.47 20.1747C18.2885 20.1747 17.3317 19.1934 17.3317 17.9815C17.3317 16.7696 18.2885 15.7884 19.47 15.7884ZM19.47 3.82625C20.6518 3.82625 21.6087 4.80725 21.6087 6.01913C21.6087 7.231 20.6518 8.21229 19.47 8.21229C18.2885 8.21229 17.3317 7.231 17.3317 6.01913C17.3317 4.80725 18.2885 3.82625 19.47 3.82625Z" fill="currentColor"/>\n </svg>\n '],X=['\n <svg width="16" height="18" viewBox="0 0 16 18" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M3 0H10C11.6569 0 13 1.34315 13 3V12C13 13.6569 11.6569 15 10 15H3C1.34315 15 0 13.6569 0 12V3C0 1.34314 1.34315 0 3 0ZM3 2C2.44772 2 2 2.44772 2 3V12C2 12.5523 2.44772 13 3 13H10C10.5523 13 11 12.5523 11 12V3C11 2.44772 10.5523 2 10 2H3Z" fill="currentColor"/>\n <path d="M3 15C3 16.6569 4.34315 18 6 18H13C14.6569 18 16 16.6569 16 15V6C16 4.34315 14.6569 3 13 3V5C13.5523 5 14 5.44772 14 6V15C14 15.5523 13.5523 16 13 16H6C5.44772 16 5 15.5523 5 15H3Z" fill="currentColor"/>\n </svg>\n ','\n <svg width="17" height="18" viewBox="0 0 17 18" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M10.8 1H2.2C1.53726 1 1 1.53726 1 2.2V12.8C1 13.4627 1.53726 14 2.2 14H10.8C11.4627 14 12 13.4627 12 12.8V2.2C12 1.53726 11.4627 1 10.8 1ZM2.2 0C0.984974 0 0 0.984973 0 2.2V12.8C0 14.015 0.984973 15 2.2 15H10.8C12.015 15 13 14.015 13 12.8V2.2C13 0.984974 12.015 0 10.8 0H2.2Z" fill="currentColor"/>\n <path d="M4 15V15.8C4 16.4627 4.53726 17 5.2 17H13.8C14.4627 17 15 16.4627 15 15.8V5.2C15 4.53726 14.4627 4 13.8 4H12.9492V3H13.8C15.015 3 16 3.98497 16 5.2V15.8C16 17.015 15.015 18 13.8 18H5.2C3.98497 18 3 17.015 3 15.8V15H4Z" fill="currentColor"/>\n </svg>\n ','\n <svg width="17" height="18" viewBox="0 0 17 18" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M2.2 0C0.984974 0 0 0.984973 0 2.2V12.8C0 14.015 0.984973 15 2.2 15H10.8C12.015 15 13 14.015 13 12.8V2.2C13 0.984974 12.015 0 10.8 0H2.2Z" fill="currentColor"/>\n <path d="M4 15V15.8C4 16.4627 4.53726 17 5.2 17H13.8C14.4627 17 15 16.4627 15 15.8V5.2C15 4.53726 14.4627 4 13.8 4H12.9492V3H13.8C15.015 3 16 3.98497 16 5.2V15.8C16 17.015 15.015 18 13.8 18H5.2C3.98497 18 3 17.015 3 15.8V15H4Z" fill="currentColor"/>\n </svg>\n ','\n <svg width="17" height="18" viewBox="0 0 17 18" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path d="M0 2C0 0.89543 0.895431 0 2 0H11C12.1046 0 13 0.895431 13 2V13C13 14.1046 12.1046 15 11 15H2C0.89543 15 0 14.1046 0 13V2Z" fill="currentColor"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M3 16C3 17.1046 3.89543 18 5 18H14C15.1046 18 16 17.1046 16 16V5C16 3.89543 15.1046 3 14 3V13C14 14.6569 12.6569 16 11 16H3ZM3 15V5C3 3.89543 3.89543 3 5 3H13V13C13 14.1046 12.1046 15 11 15H3Z" fill="currentColor"/>\n </svg>\n '];var tt="12px",et="14px";const nt="\n .cl-promo-code-tooltip-container {\n z-index: ".concat(String(Number.MAX_SAFE_INTEGER),";\n padding: 10px;\n display: inline-block;\n position: fixed;\n background: #000;\n opacity: 1;\n border: 2px solid #FFF;\n border-radius: 5px;\n max-height: fit-content;\n }\n \n .cl-promo-code-tooltip-container[cl-tooltip-position='top']:after {\n content: \"\";\n position: absolute;\n top: 100%;\n left: calc(50% - 5px);\n margin-left: -8px;\n margin-top: -2px;\n border-width: ").concat(tt,";\n border-style: solid;\n border-color: black transparent transparent transparent;\n }\n\n .cl-promo-code-tooltip-container[cl-tooltip-position='top']:before {\n content: \"\";\n position: absolute;\n top: 100%;\n left: calc(50% - 15px);\n border-width: ").concat(et,";\n border-style: solid;\n border-color: white transparent transparent transparent;\n }\n \n .cl-promo-code-tooltip-container[cl-tooltip-position='bottom']:after {\n content: \"\";\n position: absolute;\n top: -22px;\n left: calc(50% - 4px);\n margin-left: -5px;\n margin-bottom: -2px;\n border-width: ").concat(tt,";\n border-style: solid;\n border-color: transparent transparent black transparent;\n }\n\n .cl-promo-code-tooltip-container[cl-tooltip-position='bottom']:before {\n content: \"\";\n position: absolute;\n top: -28px;\n left: calc(50% - 11px);\n border-width: ").concat(et,";\n border-style: solid;\n border-color: transparent transparent white transparent;\n }\n");class ot{static size(t){return{width:this.width(t),height:this.height(t)}}static width(t){return t=t||document,Math.max(t.documentElement.clientWidth,t.defaultView.innerWidth||0)}static height(t){return t=t||document,Math.max(t.documentElement.clientHeight,t.defaultView.innerHeight||0)}static scrollbarWidth(t){return(t=t||document).defaultView.innerWidth-t.documentElement.clientWidth}}var it=[];for(var rt in{transparent:"#0000"})it.push(rt);var st="\\s*([.\\d%]+)\\s*",lt="\\("+[st,st,st]+"(?:,\\s*([.\\d]+)\\s*)?\\)",at="(?:rgb)a?",ct="("+it.join("|")+")";function pt(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}RegExp(at+lt,"i"),RegExp([ct,"(?:#([a-f0-9]{3,8}))",at+lt,"(?:hsl)a?"+lt].join("|"),"gi");var ht=Array.prototype.concat,dt=Array.prototype.slice,ut=function(t){for(var e=[],n=0,o=t.length;n<o;n++){var i=t[n];pt(i)?e=ht.call(e,dt.call(i)):e.push(i)}return e};ut.wrap=function(t){return function(){return t(ut(arguments))}};const mt=ut;var gt={},ft=Object.hasOwnProperty,bt=Object.create(null);for(var yt in gt)ft.call(gt,yt)&&(bt[gt[yt]]=yt);var vt={to:{},get:{}};function Ct(t,e,n){return Math.min(Math.max(e,t),n)}vt.get=function(t){var e,n;return"hsl"===t.substring(0,3).toLowerCase()?(e=vt.get.hsl(t),n="hsl"):(e=vt.get.rgb(t),n="rgb"),e?{model:n,value:e}:null},vt.get.rgb=function(t){if(!t)return null;var e,n,o,i=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(o=e[2],e=e[1],n=0;n<3;n++){var r=2*n;i[n]=parseInt(e.slice(r,r+2),16)}o&&(i[3]=parseInt(o,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(o=(e=e[1])[3],n=0;n<3;n++)i[n]=parseInt(e[n]+e[n],16);o&&(i[3]=parseInt(o+o,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)i[n]=parseInt(e[n+1],0);e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:ft.call(gt,e[1])?((i=gt[e[1]])[3]=1,i):null:null;for(n=0;n<3;n++)i[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}for(n=0;n<3;n++)i[n]=Ct(i[n],0,255);return i[3]=Ct(i[3],0,1),i},vt.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,Ct(parseFloat(e[2]),0,100),Ct(parseFloat(e[3]),0,100),Ct(isNaN(n)?1:n,0,1)]}return null},vt.to.rgb=function(){var t=mt(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},vt.to.hsl=function(){var t=mt(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"};const Et=vt,Ot={},Tt={};for(const t of Object.keys(Ot))Tt[Ot[t]]=t;const St={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"}};Math.pow(6/29,3);for(const t of Object.keys(St)){if(!("channels"in St[t]))throw new Error("missing channels property: "+t);if(!("labels"in St[t]))throw new Error("missing channel labels property: "+t);if(St[t].labels.length!==St[t].channels)throw new Error("channel and label counts mismatch: "+t);const{channels:e,labels:n}=St[t];delete St[t].channels,delete St[t].labels,Object.defineProperty(St[t],"channels",{value:e}),Object.defineProperty(St[t],"labels",{value:n})}St.rgb.hsl=function(t){const e=t[0]/255,n=t[1]/255,o=t[2]/255,i=Math.min(e,n,o),r=Math.max(e,n,o),s=r-i;let l,a;r===i?l=0:e===r?l=(n-o)/s:n===r?l=2+(o-e)/s:o===r&&(l=4+(e-n)/s),l=Math.min(60*l,360),l<0&&(l+=360);const c=(i+r)/2;return a=r===i?0:c<=.5?s/(r+i):s/(2-r-i),[l,100*a,100*c]},St.hsl.rgb=function(t){const e=t[0]/360,n=t[1]/100,o=t[2]/100;let i,r,s;if(0===n)return s=255*o,[s,s,s];i=o<.5?o*(1+n):o+n-o*n;const l=2*o-i,a=[0,0,0];for(let t=0;t<3;t++)r=e+1/3*-(t-1),r<0&&r++,r>1&&r--,s=6*r<1?l+6*(i-l)*r:2*r<1?i:3*r<2?l+(i-l)*(2/3-r)*6:l,a[t]=255*s;return a};const xt=St;function At(t,e){return function(n){return e(t(n))}}function wt(t,e){const n=[e[t].parent,t];let o=xt[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)n.unshift(e[i].parent),o=At(xt[e[i].parent][i],o),i=e[i].parent;return o.conversion=n,o}const Rt={};Object.keys(xt).forEach((t=>{Rt[t]={},Object.defineProperty(Rt[t],"channels",{value:xt[t].channels}),Object.defineProperty(Rt[t],"labels",{value:xt[t].labels});const e=function(t){const e=function(t){const e=function(){const t={},e=Object.keys(xt);for(let n=e.length,o=0;o<n;o++)t[e[o]]={distance:-1,parent:null};return t}(),n=[t];for(e[t].distance=0;n.length;){const t=n.pop(),o=Object.keys(xt[t]);for(let i=o.length,r=0;r<i;r++){const i=o[r],s=e[i];-1===s.distance&&(s.distance=e[t].distance+1,s.parent=t,n.unshift(i))}}return e}(t),n={},o=Object.keys(e);for(let t=o.length,i=0;i<t;i++){const t=o[i];null!==e[t].parent&&(n[t]=wt(t,e))}return n}(t);Object.keys(e).forEach((n=>{const o=e[n];Rt[t][n]=function(t){const e=function(...e){const n=e[0];if(null==n)return n;n.length>1&&(e=n);const o=t(e);if("object"==typeof o)for(let t=o.length,e=0;e<t;e++)o[e]=Math.round(o[e]);return o};return"conversion"in t&&(e.conversion=t.conversion),e}(o),Rt[t][n].raw=function(t){const e=function(...e){const n=e[0];return null==n?n:(n.length>1&&(e=n),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(o)}))}));const Pt=Rt,Nt=["keyword","gray","hex"],Lt={};for(const t of Object.keys(Pt))Lt[[...Pt[t].labels].sort().join("")]=t;const Mt={};function _t(t,e){if(!(this instanceof _t))return new _t(t,e);if(e&&e in Nt&&(e=null),e&&!(e in Pt))throw new Error("Unknown model: "+e);let n,o;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof _t)this.model=t.model,this.color=[...t.color],this.valpha=t.valpha;else if("string"==typeof t){const e=Et.get(t);if(null===e)throw new Error("Unable to parse color from string: "+t);this.model=e.model,o=Pt[this.model].channels,this.color=e.value.slice(0,o),this.valpha="number"==typeof e.value[o]?e.value[o]:1}else if(t.length>0){this.model=e||"rgb",o=Pt[this.model].channels;const n=Array.prototype.slice.call(t,0,o);this.color=jt(n,o),this.valpha="number"==typeof t[o]?t[o]:1}else if("number"==typeof t)this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;const e=Object.keys(t);"alpha"in t&&(e.splice(e.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);const o=e.sort().join("");if(!(o in Lt))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=Lt[o];const{labels:i}=Pt[this.model],r=[];for(n=0;n<i.length;n++)r.push(t[i[n]]);this.color=jt(r)}if(Mt[this.model])for(o=Pt[this.model].channels,n=0;n<o;n++){const t=Mt[this.model][n];t&&(this.color[n]=t(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}_t.prototype={toString(){return this.string()},string(t){let e=this.model in Et.to?this:this.rgb();e=e.round("number"==typeof t?t:1);const n=1===e.valpha?e.color:[...e.color,this.valpha];return Et.to[e.model](n)},round(t){return t=Math.max(t||0,0),new _t([...this.color.map(kt(t)),this.valpha],this.model)},alpha(t){return void 0!==t?new _t([...this.color,Math.max(0,Math.min(1,t))],this.model):this.valpha},lighten(t){const e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken(t){const e=this.hsl();return e.color[2]-=e.color[2]*t,e}};for(const t of Object.keys(Pt)){if(Nt.includes(t))continue;const{channels:e}=Pt[t];_t.prototype[t]=function(...e){return this.model===t?new _t(this):e.length>0?new _t(e,t):new _t([...It(Pt[this.model][t].raw(this.color)),this.valpha],t)},_t[t]=function(...n){let o=n[0];return"number"==typeof o&&(o=jt(n,e)),new _t(o,t)}}function kt(t){return function(e){return function(t,e){return Number(t.toFixed(e))}(e,t)}}function It(t){return Array.isArray(t)?t:[t]}function jt(t,e){for(let n=0;n<e;n++)"number"!=typeof t[n]&&(t[n]=0);return t}const Ht=_t;function Dt(t,e){Object.keys(e).forEach((n=>{t.style[n]=e[n]}))}function Bt(t,e,n){const o=function(t,e){const n=getComputedStyle(t)[e]||t.style.getPropertyValue(e);if(n&&n.includes("rgb")&&(!(n.split("rgb").length>2)||n.includes("#")))return n}(e,n);if(o){const e=Ht(o).alpha(.5).string();return t.classList.add("focus-outline-defined"),t.style.setProperty("--clFocusOutline",`3px solid ${e}`),e}return null}function Ft(t){const{width:e,height:n}=t.getBoundingClientRect(),{marginBottom:o,marginTop:i,marginLeft:r,marginRight:s}=window.getComputedStyle(t);return{width:e+parseInt(r,10)+parseInt(s,10),height:n+parseInt(i,10)+parseInt(o,10)}}function Wt(t,e,n,o,i){switch(t.position){case"top":return{left:`${Vt(e,n,o,i)}px`,top:t.availableSpaceAboveTriggerElem-t.contentHeight-t.verticalOffset+"px"};case"bottom":return{left:`${Vt(e,n,o,i)}px`,bottom:t.availableSpaceBelowTriggerElem-t.contentHeight-t.verticalOffset+"px"};case"left":return{left:t.availableSpaceToTheLeftSideOfTheTrigger-e.width-t.contentWidth-t.horizontalOffset+"px",top:`${Ut(0,t)}px`};case"right":return{right:t.availableSpaceToTheRightSideOfTheTrigger-t.contentWidth-t.horizontalOffset+"px",top:`${Ut(0,t)}px`}}}function Vt(t,e,n,o){let i=n?t.x+t.width/2-e.width/2:t.x;return i<0&&(i=0),i+e.width>ot.width(o)&&(i-=i+e.width-ot.width(o)),i}function Ut(t,e){let n=e.availableSpaceAboveTriggerElem;return e.contentHeight>e.availableSpaceBelowTriggerElem&&(n-=e.contentHeight-e.availableSpaceBelowTriggerElem),n}function $t(t){const{triggerElement:e,tooltipElement:n,offset:o=10,htmlDocumentObject:i}=t,r=function(t,e,n,o,i,r){const s=function(t,e,n,o,i){const r=function(t,e,n,o){const i=ot.width(o),{right:r}=t.getBoundingClientRect(),s=i-n-r-ot.scrollbarWidth(o);return{horizontalOffset:n,contentWidth:Ft(e).width,availableSpaceToTheLeftSideOfTheTrigger:r-n,availableSpaceToTheRightSideOfTheTrigger:s}}(t,e,n,i),s=function(t,e,n,o){const i=ot.height(o),{top:r,bottom:s}=t.getBoundingClientRect();return{verticalOffset:n,contentHeight:Ft(e).height,availableSpaceAboveTriggerElem:r-n,availableSpaceBelowTriggerElem:i-s-n}}(t,e,n,i);let l="undefined";const a={bottom:s.availableSpaceBelowTriggerElem>=s.contentHeight,top:s.availableSpaceAboveTriggerElem>=s.contentHeight,right:r.availableSpaceToTheRightSideOfTheTrigger>=r.contentWidth,left:r.availableSpaceToTheLeftSideOfTheTrigger>=r.contentWidth};if(a.top?l="top":a.bottom?l="bottom":a.right?l="right":a.left&&(l="left"),a[o]&&(l=o),"undefined"===l){const t=Math.max(s.availableSpaceBelowTriggerElem,s.availableSpaceAboveTriggerElem,r.availableSpaceToTheRightSideOfTheTrigger,r.availableSpaceToTheLeftSideOfTheTrigger);t===s.availableSpaceBelowTriggerElem?l="bottom":t===s.availableSpaceAboveTriggerElem?l="top":t===r.availableSpaceToTheRightSideOfTheTrigger?l="right":t===r.availableSpaceToTheLeftSideOfTheTrigger&&(l="left")}return Object.assign(Object.assign(Object.assign({},s),r),{position:l})}(t,e,n,o,r=r||document);return function(t,e){const{marginBottom:n,marginTop:o}=window.getComputedStyle(e);if("top"===t.position)Dt(e,{"margin-top":`${parseInt(o,10)+parseInt(n,10)}px`}),Dt(e,{"margin-bottom":"0px"});else if("bottom"===t.position)Dt(e,{"margin-bottom":`${parseInt(n,10)+parseInt(o,10)}px`}),Dt(e,{"margin-top":"0px"});else{const t=(parseInt(n,10)+parseInt(o,10))/2+"px";Dt(e,{"margin-top":t,"margin-bottom":t})}}(s,e),{coordinates:Wt(s,t.getBoundingClientRect(),e.getBoundingClientRect(),i,r),position:s.position}}(e,n,o,"top",!0,i);n.setAttribute("cl-tooltip-position",r.position),Dt(n,r.coordinates)}function Gt(t){return Gt="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},Gt(t)}function zt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,Xt(o.key),o)}}function Zt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Zt=function(){return!!t})()}function Kt(t,e,n,o){var i=qt(Qt(1&o?t.prototype:t),e,n);return 2&o&&"function"==typeof i?function(t){return i.apply(n,t)}:i}function qt(){return qt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var o=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Qt(t)););return t}(t,e);if(o){var i=Object.getOwnPropertyDescriptor(o,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},qt.apply(null,arguments)}function Qt(t){return Qt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Qt(t)}function Jt(t,e){return Jt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Jt(t,e)}function Yt(t,e,n){return(e=Xt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Xt(t){var e=function(t){if("object"!=Gt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Gt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Gt(e)?e:e+""}var te="lastPromoCode",ee=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),Yt(e=function(t,e,n){return e=Qt(e),function(t,e){if(e&&("object"==Gt(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,Zt()?Reflect.construct(e,n||[],Qt(t).constructor):e.apply(t,n))}(this,t),"manifest",Q),Yt(e,"tooltipContainerElement",void 0),Yt(e,"firstTooltipTimer",void 0),Yt(e,"secondTooltipTimer",void 0),Yt(e,"thirdTooltipTimer",void 0),Yt(e,"boundOnScrollHandler",void 0),Yt(e,"contextSubscriptions",[]),Yt(e,"tooltipStylesId","cl-promo-code-tooltip-styles"),Yt(e,"inlineEditPromocodeClass","cl--inline--edit"),Yt(e,"inlineEditAttributeName","cl-inline-edit"),Yt(e,"inlineEditAttributeValue","content, text"),Yt(e,"isByContainerWidth",!1),Yt(e,"isByContentWidth",!1),Yt(e,"renderTooltip",(function(t){var n=e.getTranslationsMap(J).translations;e.tooltipContainerElement=document.createElement("div"),e.tooltipContainerElement.classList.add("cl-promo-code-tooltip-container");var o=document.createElement("div");o.style.padding="5px",o.style.color="#fff",o.innerText=n,e.tooltipContainerElement.append(o),e.htmlDocumentObject.body.appendChild(e.tooltipContainerElement),e.firstTooltipTimer=setTimeout((function(){$t({triggerElement:t,tooltipElement:e.tooltipContainerElement,htmlDocumentObject:e.htmlDocumentObject}),e.boundOnScrollHandler=function(){return $t({triggerElement:t,tooltipElement:e.tooltipContainerElement,htmlDocumentObject:e.htmlDocumentObject})},document.addEventListener("scroll",e.boundOnScrollHandler,!0),e.secondTooltipTimer=setTimeout((function(){e.removeScrollListener(),e.tooltipContainerElement.style.transition="0.15s",e.tooltipContainerElement.style.top="".concat(t.getBoundingClientRect().top+window.pageYOffset,"px"),e.tooltipContainerElement.style.opacity="0",e.thirdTooltipTimer=setTimeout((function(){e.destroyTooltip()}),150)}),1500)}))})),Yt(e,"getTooltipTopPosition",(function(t,e,n){var o=t.getBoundingClientRect();return"".concat(o.top-e.height-n+window.pageYOffset,"px")})),Yt(e,"getTooltipLeftPosition",(function(t,e){var n=t.getBoundingClientRect();return"".concat(n.left+n.width/2-e.width/2+window.pageXOffset,"px")})),Yt(e,"destroyTooltip",(function(){e.tooltipContainerElement&&(e.tooltipContainerElement.remove(),e.tooltipContainerElement=null)})),Yt(e,"clearTooltipTimers",(function(){clearTimeout(e.firstTooltipTimer),clearTimeout(e.secondTooltipTimer),clearTimeout(e.thirdTooltipTimer)})),Yt(e,"removeScrollListener",(function(){document.removeEventListener("scroll",e.boundOnScrollHandler,!0)})),Yt(e,"mapStyleControlValuesToInnerContent",(function(){var t=e.getElement("text"),n=e.getRootElement().querySelector('[cl-inline-edit="content, text"]'),o=e.getElement("text").querySelector(".".concat(e.inlineEditPromocodeClass));o.style.display=e.isByContentWidth||e.isByContainerWidth?"contents":"",o.style.whiteSpace=e.isByContentWidth?"nowrap":"",t&&n&&(n.style.minWidth="20px",n.style.width="max-content",n.style.minHeight=t.style.fontSize,n.style.textAlign=t.style.textAlign,n.style.lineHeight=t.style.lineHeight,n.style.fontWeight=t.style.fontWeight,n.style.fontSize=t.style.fontSize,n.style.textShadow=t.style.textShadow,n.style.letterSpacing=t.style.letterSpacing,n.style.fontFamily=t.style.fontFamily)})),Yt(e,"mapAlignValueToTextElementContent",(function(t){"center"===t.style.textAlign&&(t.style.justifyContent="center"),"start"===t.style.textAlign&&(t.style.justifyContent="flex-start"),"end"===t.style.textAlign&&(t.style.justifyContent="flex-end")})),Yt(e,"handleSafariHeightIssue",(function(){var t=e.getHostElement();"auto"===t.style.height&&(t.style.height="fit-content")})),Yt(e,"storeStrokeTopWidthAsCssVar",(function(){var t=e.getElement("host"),n=e.getElement("text");t.style.setProperty("--clStrokeForIconWidth",n.style.borderTopWidth||0)})),Yt(e,"destroyExistingIcon",(function(){var t=e.getRootElement().querySelector('[cl-element="icon"]');t&&t.remove()})),Yt(e,"showIconIfAny",(function(t,n){var o=n.content.iconContent,i=parseFloat(o),r=!isNaN(i);if(e.destroyExistingIcon(),null!=o){if(r){var s=(n.styles?"absolute"===n.styles.find((function(t){return"icon"===t.element})).styleAttributes.position:"absolute"===n.adaptiveStyles[e.getEnvironment()].find((function(t){return"icon"===t.element})).styleAttributes.position)?Y[i]:X[i],l=document.createElement("span");l.classList.add("promocode-icon"),l.setAttribute("cl-element","icon"),Z({element:l,html:s}),t.appendChild(l)}else{var a=document.createElement("img");a.src=o,a.classList.add("promocode-icon"),a.setAttribute("cl-element","icon"),t.appendChild(a)}e.applyAutoAdaptiveStyles(n.adaptiveStyles,n.styles)}})),Yt(e,"addTooltipStyles",(function(){if(!e.htmlDocumentObject.head.querySelector("#".concat(e.tooltipStylesId))){var t=document.createElement("style");t.setAttribute("id",e.tooltipStylesId),Z({element:t,html:nt}),e.htmlDocumentObject.head.appendChild(t)}})),Yt(e,"removeTooltipStyles",(function(){var t=e.htmlDocumentObject.head.querySelector("#".concat(e.tooltipStylesId));t&&t.remove()})),Yt(e,"_handleContextRecord",(function(t){var n;if(!e.services.context.getKVMap().promoCode&&t.key===te){var o=e.getModel();if(!(t.value.viewIndex>=o.path[0])){var i=(null===(n=e.services.context.getRecord(te))||void 0===n?void 0:n.value.value)||null,r=e.getElement("text").querySelector(".".concat(e.inlineEditPromocodeClass));i?(r.removeAttribute(e.inlineEditAttributeName),r.innerText=i):r.setAttribute(e.inlineEditAttributeName,e.inlineEditAttributeValue)}}})),Yt(e,"checkWidthMode",(function(t){var n,o=e.getEnvironment(),i=null===(n=t.adaptiveStyles[o])||void 0===n||null===(n=n.find((function(t){return"host"===t.element})))||void 0===n?void 0:n.styleAttributes.width;e.isByContentWidth="auto"===i,e.isByContainerWidth="100%"===i})),e.getRootElement().innerHTML="\n <style>".concat("\n.text {\n outline: none;\n min-height: 20px;\n cursor: pointer;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n position: relative;\n}\n\n.promocode-icon {\n top: calc(((var(--clPromocodeIconHeight) / 2) * -1) - var(--clStrokeForIconWidth));\n width: var(--clPromocodeIconWidth);\n height: var(--clPromocodeIconHeight);\n}\n\n.promocode-icon svg {\n display: flex;\n width: 100%;\n height: auto;\n}\n\nbutton.focus-outline-defined:focus {\n outline: var(--clFocusOutline);\n}\n",'</style>\n <button class="text" cl-element="text">\n <span class="').concat(e.inlineEditPromocodeClass,'" ').concat(e.inlineEditAttributeName,'="').concat(e.inlineEditAttributeValue,'"></span>\n </button>'),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&&Jt(t,e)}(t,q),e=t,n=[{key:"connectedCallback",value:function(){var e=this;Kt(t,"connectedCallback",this,3)([]),this.addTooltipStyles();var n=this.getElement("text"),o=n.querySelector("[".concat(this.inlineEditAttributeName,'="').concat(this.inlineEditAttributeValue,'"]'));this.contextSubscriptions=[this.services.context.on("RECORD_ADDED",this._handleContextRecord.bind(this)),this.services.context.on("RECORD_UPDATED",this._handleContextRecord.bind(this)),this.services.context.on("RECORD_DELETED",this._handleContextRecord.bind(this))],"UPDATING"!==this.services.config.getConfig("entryModuleType")&&n.addEventListener("click",(function(t){var i,r;t.stopPropagation(),(i=o.textContent,(null===(r=navigator.clipboard)||void 0===r?void 0:r.writeText)?navigator.clipboard.writeText(String(i).trim().replace("<br>"," ")):Promise.reject()).then((function(){e.destroyTooltip(),e.clearTooltipTimers(),e.removeScrollListener(),e.renderTooltip(n)})).catch((function(t){return console.error("SysPromoCodeComponent couldn't write to clipboard",t)})),e.services.trackingService.send("FormClick_[Name]"),e.services.trackingService.trackClick(),e.services.trackingService.trackTargetAction(e.getProps().content.countAsTargetAction)})),this.observeProps((function(t,i){e.applyAutoAdaptiveStyles(i.adaptiveStyles,i.styles),e.checkWidthMode(i);var r=e.services.context.getKVMap().promoCode;r?o.innerText=r:Z({element:o,html:i.content.text});var s=e.services.context.getRecord(te);s&&e._handleContextRecord(s),e.mapAlignValueToTextElementContent(e.getElement("text")),e.mapStyleControlValuesToInnerContent(),e.showIconIfAny(n,i),e.storeStrokeTopWidthAsCssVar(),e.handleSafariHeightIssue(),function(t){let e;const n=t,o=["transparent","initial"];t&&(t.style.borderColor&&!o.includes(t.style.borderColor)&&(parseFloat(t.style.borderWidth)||parseFloat(t.style.borderBottomWidth))&&(e=Bt(n,t,"borderColor")),!e&&t.style.getPropertyValue("--borderBottomColor")&&!o.includes(t.style.getPropertyValue("--borderBottomColor"))&&parseFloat(t.style.getPropertyValue("--borderBottomWidth"))&&(e=Bt(n,t,"--borderBottomColor")),e||!t.style.backgroundColor||o.includes(t.style.backgroundColor)||(e=Bt(n,t,"backgroundColor")),e||!t.style.color||o.includes(t.style.color)||(e=Bt(n,t,"color")),e||n.classList.remove("focus-outline-defined"))}(e.getElement("text"))})),this.observeShared((function(){e.mapAlignValueToTextElementContent(e.getElement("text")),e.mapStyleControlValuesToInnerContent()})),this.observeEnvironment((function(){e.handleSafariHeightIssue(),e.mapStyleControlValuesToInnerContent()}))}},{key:"disconnectedCallback",value:function(){Kt(t,"disconnectedCallback",this,3)([]),this.destroyTooltip(),this.clearTooltipTimers(),this.removeScrollListener(),this.removeTooltipStyles(),this.contextSubscriptions.forEach((function(t){return t.off()}))}}],n&&zt(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();Yt(ee,"define",{name:"sys-promo-code",model:Q.name,manifest:Q});export{ee as default};window.clComponentClass_SysPromoCodeComponent=ee;
|
|
1
|
+
const t="cl-";function e(e){return t+e}function n(t){return"cl-"+t}const o="VIEW",i="MODULE",r="CONTAINER",s="INPUT",l="BUTTON",a="CONSENT",c="COLUMN",p="SUBSCRIBE_CONTACT",h="REQUEST",d="SHOW_WIDGET",u="OPEN_LINK",m="CLOSE_WIDGET";class g{static sortActions(t){const e={[m]:-1,[u]:-2,[d]:1,[p]:2,[h]:3},n=t=>void 0!==e[t.type]?e[t.type]:0;return[...t].sort(((t,e)=>n(t)>n(e)?-1:n(t)<n(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,o){this.state=t;const i=o(),r=i.getAttribute(n("id"));this.listener=t=>{const e=t.composedPath().filter((t=>t instanceof HTMLElement&&t.getAttribute(n("type"))));let o=0;for(;e[o]&&e[o].getAttribute(n("id"))!==r;){let t=e[o].getAttribute(n("type"));if(g.IGNORING_VIEW_ENTRY_TYPES.includes(t))return;o++}this.eventsQueue.push({event:t}),this.postponed||this.execute()},this.targetElements=this.config.relativeSelector?Array.from((i.shadowRoot||i).querySelectorAll(this.config.relativeSelector)):[i],this.targetElements.forEach((t=>{t.addEventListener("click",this.listener)}))}async execute(){var t,e,n,o;try{for(var i,r=!0,s=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},o("next"),o("throw"),o("return"),e[Symbol.asyncIterator]=function(){return this},e);function o(n){e[n]=t[n]&&function(e){return new Promise((function(o,i){!function(t,e,n,o){Promise.resolve(o).then((function(e){t({value:e,done:n})}),e)}(o,i,(e=t[n](e)).done,e.value)}))}}}(this.eventsQueue);!(t=(i=await s.next()).done);){o=i.value,r=!1;try{const{event:t}=o;for(const e of this.actions)if(!await e.execute(this.state.getState(),t))break}finally{r=!0}}}catch(t){e={error:t}}finally{try{r||t||!(n=s.return)||await n.call(s)}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,s];const b="CLICK",y="COMPONENT_EVENT";class f{constructor(t,e){this.config=t,this.actions=e,this.componentEmitterListener=null}activate(t,e,n){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 C{static generate(){let t,e="";for(let n=0;n<32;n++)8!==n&&12!==n&&16!==n&&20!==n||(e+="-"),t=Math.floor(16*Math.random()).toString(16).toUpperCase(),e+=t;return e}}class E{constructor(){this.listeners=E.createDefaultListenersState()}emit(t,e,n=null){const o=this.listeners[t];o&&Object.values(o).forEach((o=>o(e,t,n))),Object.values(this.listeners["*"]).forEach((o=>o(e,t,n)))}on(t,e){const n=C.generate(),o=this.listeners[t];return o?o[n]=e:this.listeners[t]={[n]:e},{off:()=>{var e,o;(null===(o=null===(e=this.listeners)||void 0===e?void 0:e[t])||void 0===o?void 0:o[n])&&delete this.listeners[t][n]}}}destroy(){this.listeners=E.createDefaultListenersState()}}E.createDefaultListenersState=()=>({"*":{}});const O=(t,e,n,o)=>{const{addEventListenerBase:i,addEventListener:r}=EventTarget.prototype;(i||r).call(t,e,n,o)};class T{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class S{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===i?Object.assign(Object.assign({},t),S.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})}}S.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"};class A extends E{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on("ENVIRONMENT_UPDATE",(({isMobileEnv:t})=>{this._isMobile=t,this.emit(A.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(A.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(A.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}A.changeEventName="CHANGE";class x{static set(t,e){const n=t[x.accumulatorPropertyName]||{};t[x.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[x.accumulatorPropertyName]).forEach((n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""}))}}x.accumulatorPropertyName="clStyleAttributes";const w="CONTENT_LOCKER";class R{static applyHostStyles(t,e,n=null,i){var s,l,a;const p=null===(l=null===(s=null==n?void 0:n.props)||void 0===s?void 0:s.handlers)||void 0===l?void 0:l.find((t=>"CLICK"===t.type));p&&(null===(a=p.actions)||void 0===a?void 0:a.length)&&(e.style.cursor="pointer"),t!==o&&t!==r&&t!==c||(e.style.display=i===w&&t===o?"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,n,o,i,r){this.hostElement=e,this.documentModel=t,this.getSharedCb=n,this.getPropsCb=o,this.getEnvCb=i,this.httpClient=r,this.subscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(t){const e=String(t||"");if(e.includes("url")){const[t,n]=e.split("(")[1].split(")");return{url:t.replace(/['"]+/g,""),positionOptions:n.replace(";","")}}return{url:null,positionOptions:null}}apply(t){const e=this.getPropsCb();return e.backgroundDynamicInlineSVGElements[t].forEach((n=>{var o,i,r,s,l;const a=null===(i=null===(o=e.adaptiveStyles)||void 0===o?void 0:o[t])||void 0===i?void 0:i.find((t=>t.element===n)),c=(null===(r=e.styles)||void 0===r?void 0:r.find((t=>t.element===n)))||{},p=(null===(s=null==c?void 0:c.styleAttributes)||void 0===s?void 0:s.background)||(null===(l=null==a?void 0:a.styleAttributes)||void 0===l?void 0:l.background),h=this.parseBackground(p);h.url&&this.envUrlMaps[t].set(n,{originalSVGResourceURL:h.url,inlineSvgString:null,positionOptions:h.positionOptions})})),Promise.all([...this.envUrlMaps[t].entries()].map((([e,n])=>this.httpClient.execute(n.originalSVGResourceURL).then((t=>t.text())).then((o=>{this.envUrlMaps[t].set(e,Object.assign(Object.assign({},n),{inlineSvgString:o}))}))))).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 n=t.inlineSvgString.trim().replace("var(--cl-schema-accent)",e.accent);return`url('data:image/svg+xml,${encodeURIComponent(n)}')${t.positionOptions}`}}const L=new class{execute(t,e,n=null,o,i){const r={method:e,headers:Object.assign({"Content-Type":"text/plain"},o||{}),credentials:"same-origin",body:null,signal:i};return n&&(r.body="string"==typeof n?n:JSON.stringify(n)),fetch(t,r)}};function M(t,e){return Object.keys(t).filter((t=>!e.includes(t))).reduce(((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]})),{})}class _{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 k{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 I="COMPONENT_RESOURCES_LOADED",j="FAILED_TO_LOAD_COMPONENT_RESOURCE";class D{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(I,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(j,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=n,this.counters={pending:new k(this.onCounterStateUpdate)}}}const H=(...t)=>{let e=t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:[]})),{});return{get:t=>e[t],clear:()=>H(...t)}},B=H,F="props",W="shared",V="environment";function U(t,e,n,o){const i=t=>{let r=t instanceof DocumentFragment||(null==t?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?t.host:t;return r&&(o&&"function"==typeof o?o(r.getAttribute(e)):(null===(s=null==r?void 0:r.getAttribute)||void 0===s?void 0:s.call(r,e))===n)?r:r&&r.parentNode&&i(r.parentNode)||null;var s};return i(t)}const $="SUBMIT";function G(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach((n=>{"element"!==n&&"classes"!==n&&(e[n]&&"object"==typeof e[n]&&!Array.isArray(e[n])?t[n]=Object.assign(Object.assign({},t[n]||{}),e[n]):t[n]=e[n])})),t):t}const z={DESKTOP:"desktop",MOBILE:"mobile"};function Z(t,e,n){var o;return null===(o=t[e])||void 0===o?void 0:o.find((t=>t.element===n))}function K(t=[]){return t.map((t=>Object.assign(Object.assign({},t),{styleAttributes:Object.assign({},t.styleAttributes)})))}function q(t){const{element:e,html:n,appendHtml:o}=t,i=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}(n);o?e.innerHTML+=i:e.innerHTML=i}class Q extends Event{constructor(t,e,n){super(t,n),this.detail={},Object.defineProperty(this,"detail",{value:e})}}class J extends HTMLElement{constructor(){var o,i;super(),this.construct=()=>{let t;const e=this.getAttribute(n("id")),o=this.getWidgetContainerNode();if(!o)throw new Error("Widget container not found in construct");const i=o.closest(`[${n("widget-id")}]`);let r;i&&(r=i.getAttribute(n("widget-id")));let s=new Q("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(n("path")),id:e,widgetId:r},{bubbles:!0,composed:!0});this.dispatchEvent(s),t=s.detail.props,Object.assign(this,t),this.observers=B(F,W,V),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 T,this.componentEventEmitter=new E,this.componentResourceManager=new D(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(F).forEach((e=>e(this.prevProps,t))),this.prevProps=t;const e=this.getHostElement(),o=n("floating");t.floating&&!e.getAttribute(o)?e.setAttribute(o,"true"):!t.floating&&e.getAttribute(o)&&e.removeAttribute(o)})),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()),L),this.colorSchemaListener.apply(this.getEnvironment()).then((()=>{this.subscriptions.push(this.colorSchemaListener.on())}))),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(A.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(V).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(F).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(W).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(V).push(t),t(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${n("element")}]`)).filter((t=>!t.hasAttribute(n("component"))))],this.getElement=(t,e)=>this.getElements().find((o=>e?o.getAttribute(n("element"))===t&&o.id===e:o.getAttribute(n("element"))===t)),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const o=this.getElements();if(!o.length)return;t=function(t,e){if(!e)return t||{desktop:[],mobile:[]};const n=JSON.parse(JSON.stringify(t||{desktop:[],mobile:[]}));return e.forEach((t=>{const e=t.element;let o=!1,i=!1;n.desktop&&n.desktop.forEach((n=>{n.element===e&&(G(n,t),o=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===e&&(G(n,t),i=!0)})),!o&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(t))),!i&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(t)))})),n}(t,e);const i=n("type"),r="element-styles";let s=this.getRootElement().querySelector(`style[${i}="${r}"]`);s||(s=document.createElement("style"),s.setAttribute(i,r),this.getRootElement().appendChild(s)),q({element:s,html:""}),o.forEach((e=>{let o=e.getAttribute(n("element"));const i=this.getEnvironment();let r=Z(t,i,o);if(r){if(this.resizeListener.isMobile()){const e=Z(t,"desktop",o);e&&(r=Object.assign(Object.assign({},r),{styleAttributes:Object.assign(Object.assign({},e.styleAttributes),r.styleAttributes)}))}this.applyStylesToElement(e,this.applySharedClassesToElementModel(r),s)}})),this._addLinkColor(s,this.getShared())},this.registerComponentResourceManagement=()=>{this.viewResourceManager.registerComponent(this.model.id,this.componentResourceManager)},this.applyStyles=(t,e={})=>{if(!t||!t.style)return!1;for(const[n,o]of Object.entries(e))t.style[n]=o;return!0},this.applyStylesToElement=(t,e,o)=>{var i,r;const s=[];"host"===(e=J._resolveTogglableStylesForElementModel(e)).element&&(R.applyHostStyles(this.model.type,t,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(i=this.model.props.backgroundDynamicInlineSVGElements)||void 0===i?void 0:i.desktop)||"mobile"===this.getEnvironment()&&(null===(r=this.model.props.backgroundDynamicInlineSVGElements)||void 0===r?void 0:r.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),s.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:M(e.styleAttributes,s)});if(x.set(t,c),this._setClassAttributes(t,e),o){if(e.hoverStyleAttributes){let i=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 n=t.tagName.toLowerCase(),o=`flip-up-animation-${e.element}`;let r=this.getRootElement().querySelector(`#${o}`);r||(r=document.createElement("style"),r.id=o,t.appendChild(r)),q({element:r,html:`\n ${n}::before {\n content: '';\n background: ${i.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 ${n}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),i=Object.assign(Object.assign({},e.hoverStyleAttributes),{background:"transparent",position:"relative"})}i.borderTopWidth&&"0px"!==i.borderTopWidth||delete i.borderTopColor,i.borderBottomWidth&&"0px"!==i.borderBottomWidth||delete i.borderBottomColor,i.borderLeftWidth&&"0px"!==i.borderLeftWidth||delete i.borderLeftColor,i.borderRightWidth&&"0px"!==i.borderRightWidth||delete i.borderRightColor,this._addStylesToStyleElement(o,e.element,i,`:not(.${n("no-hover")}):hover`,!0)}e.placeholderStyleAttributes&&this._addStylesToStyleElement(o,e.element,e.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(o,this.getShared()),this.stylesAppliedToElement(t,e,o)}},this._fixMarginOverflow=t=>{const e=this.getParentComponent(),o=e&&("flex"===e.style.display||"inline-flex"===e.style.display),i="host",r=t.getAttribute(n("element"))===i;if(!o||!r)return;const s=this.getProps(),l=this.getEnvironment(),{styleAttributes:a}=Z(s.adaptiveStyles,l,i)||{};if(!a)return;const c=a.marginLeft||a.marginRight,p="100%"===a.width;if(c&&p){const e=(parseFloat(a.marginLeft)||0)+(parseFloat(a.marginRight)||0);e&&setTimeout((()=>{t.style.width=`calc(100% - ${e}px)`}))}},this.applySharedClassesToElementModel=e=>function(e,n){let o=e;return(o.classes||"").split(" ").filter((e=>e.startsWith(t))).forEach((t=>{var e;let i=null===(e=n.textClasses)||void 0===e?void 0:e[t];i&&(i.styleAttributes.fontFamily||(i.isHeader&&n.headerFontFamily&&(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),{fontFamily:n.headerFontFamily})})),!i.isHeader&&n.textFontFamily&&(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),{fontFamily:n.textFontFamily})}))),o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),i.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},o.placeholderStyleAttributes),i.placeholderStyleAttributes)}))})),o.styleAttributes.fontFamily||(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),{fontFamily:n.textFontFamily})})),o}(e,this.documentModel.getShared()),this.getModel=()=>this.model,this._addStylesToStyleElement=(t,e,o,i="",r)=>{const s=Object.keys(o).reduce(((t,e)=>t+` ${_.camelCaseToDashCase(e)}: ${o[e]}${r?" !important;":";"}`),"");q({element:t,html:`[${n("element")}="${e}"]${i} { ${s} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{q({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,o,i,r;e.linkColor&&q({element:t,html:`a {color: ${e.linkColor}}, a:visited {color: ${e.linkColor}}`,appendHtml:!0}),(null===(n=e.linkParams)||void 0===n?void 0:n.color)&&q({element:t,html:`a {color: ${null===(o=e.linkParams)||void 0===o?void 0:o.color}}, a:visited {color: ${null===(i=e.linkParams)||void 0===i?void 0:i.color}}`,appendHtml:!0}),(null===(r=e.linkParams)||void 0===r?void 0:r.removeUnderline)&&q({element:t,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(n,o)=>{Array.from(n.classList).filter((t=>t!==e("hovered")&&t!==e("focused"))).forEach((e=>{e.startsWith(t)&&n.classList.remove(e)}));const i=((n.getAttribute("class")||"")+" "+o.classes).trim();n.setAttribute("class",i)},this.getParentComponent=()=>U(this.parentNode,n("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(n("path"));return t&&1===t.split(",").length?this.parentNode:U(this.parentNode,n("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,n)=>{if(e)return e;const o=function(t,e){if(!t)return null;if(e[t])return{translations:e[t],language:t};const n=function(t){return t.includes("-")?t.split("-")[0].toLowerCase():t.includes("_")?t.split("_")[0].toLowerCase():t}(t);return e[n]?{translations:e[n],language:n}:null}(n,t);return o||null}),null)}(t,this.getWidgetLanguages()),this.stylesAppliedToElement=(t,e,n)=>{},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,n;const o=t.control.name;if(["email","first_name","last_name"].includes(o))return o.toUpperCase();if(t.content.label&&(null===(n=null===(e=t.adaptiveStyles.desktop.find((t=>"label"===t.element)))||void 0===e?void 0:e.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 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||{},n=this.services.actionRegister.getRegisteredActions().find((t=>t.category===$));n?null==n||n.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===(o=this.define)||void 0===o?void 0:o.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()}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),n=(t,n,o)=>{n in e&&(t.forEach((t=>{t in e&&(e[t]=e[n]?e[t]:o)})),delete e[n])};return n(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),n(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),e}}const Y={name:"SysPromoCodeComponent",componentType:"PROMO_CODE",version:"1.0.0",events:{dispatch:[],listen:[]},contextMenuModel:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}]}],floatingControlsModel:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"}]}],propertyPaneModel:{content:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["fixed","fill","hug"]}}},{type:"CONTROL",name:"TEXT_PARAMS",params:[{element:"text",isTextTransformAvailable:!0}]},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=text]","styleAttributes"]},{type:"CONTROL",name:"PROMOCODE_ICON",propPath:["styles","[element=icon]","styleAttributes"],params:{visibleDisplayValue:"flex"}},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=text]","styleAttributes"]},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=text]","styleAttributes"]},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=text]","styleAttributes"]},{type:"CONTROL",name:"HOVER_ANIMATION",propPath:["styles","[element=text]","hoverStyleAttributes"],params:{animationTypeProp:{propPath:["styles","[element=text]","hoverAnimationType"]}}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"text",params:{indentationType:"PADDING"}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"}}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["fixed","fill","hug"]}}},{type:"CONTROL",name:"TEXT_PARAMS",params:[{element:"text",isTextTransformAvailable:!0}]},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=text]","styleAttributes"]},{type:"CONTROL",name:"PROMOCODE_ICON",propPath:["styles","[element=icon]","styleAttributes"],params:{visibleDisplayValue:"flex"}},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=text]","styleAttributes"]},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=text]","styleAttributes"]},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=text]","styleAttributes"]},{type:"CONTROL",name:"HOVER_ANIMATION",propPath:["styles","[element=text]","hoverStyleAttributes"],params:{animationTypeProp:{propPath:["styles","[element=text]","hoverAnimationType"]}}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"text",params:{indentationType:"PADDING"}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"}}]}],general:[{type:"TEXT",params:{text:"DOCUMENT_CLICK_COMPONENT_TO_COPY_TO_CLIPBOARD",type:"SECONDARY"},displayCondition:"return !sdk.documentUtils.findComponentsByTypes(sdk.views ,['PRIZE_BASED_GAMING']).some(c => c.path[0] < sdk.component.path[0])"},{type:"CONTROL",name:"PRIZE_SETTINGS",propPath:["content","prize"],params:{linkedGamifiedComponentType:"PRIZE_BASED_GAMING"},displayCondition:"return sdk.documentUtils.findComponentsByTypes(sdk.views ,['PRIZE_BASED_GAMING']).some(c => c.path[0] < sdk.component.path[0])"},{type:"CONTROL",name:"SWITCH",propPath:["content","countAsTargetAction"],params:{label:"i18n_DOCUMENT_COUNT_AS_TARGET_ACTION_LABEL",boldLabel:!0,tooltip:"i18n_DOCUMENT_COUNT_AS_TARGET_ACTION_TOOLTIP"},displayCondition:"return sdk.widgetType === 'INFORMER'"}]},autoContrast:[{slave:{element:"text",elementProp:"styleAttributes",elementSubProp:"color"},master:{element:"text",elementProp:"styleAttributes",elementSubProp:"background"},enabledPropPath:["content","textContrastEnabled"]},{slave:{element:"icon",elementProp:"styleAttributes",elementSubProp:"color"},master:{element:"text",elementProp:"styleAttributes",elementSubProp:"background"},enabledPropPath:["content","iconContrastEnabled"]}],i18nPropPaths:["content,text"],props:{styles:[{element:"text",styleAttributes:{borderTopStyle:"dashed",borderRightStyle:"dashed",borderBottomStyle:"dashed",borderLeftStyle:"dashed",borderTopWidth:"2px",borderTopColor:"var(--cl-schema-primary, rgb(68, 68, 68))",borderBottomWidth:"2px",borderBottomColor:"var(--cl-schema-primary, rgb(68, 68, 68))",borderLeftWidth:"2px",borderLeftColor:"var(--cl-schema-primary, rgb(68, 68, 68))",borderRightWidth:"2px",borderRightColor:"var(--cl-schema-primary, rgb(68, 68, 68))",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none",background:"transparent"},hoverStyleAttributes:{}},{element:"icon",styleAttributes:{display:"flex",position:"static",marginLeft:"10px",right:"5px",color:"var(--cl-schema-primary, rgb(68, 68, 68))","--clPromocodeIconWidth":"18px","--clPromocodeIconHeight":"18px"}}],adaptiveStyles:(X=[{element:"host",styleAttributes:{width:"auto",minWidth:null,height:"auto",minHeight:null,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1}},{element:"text",styleAttributes:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"20px",paddingRight:"20px",_paddingEnabled:!0,color:"var(--cl-schema-primary, rgb(68, 68, 68))",textAlign:"center",lineHeight:"120%",fontWeight:"500",fontSize:"18px",textShadow:"none"},classes:""}],Object.values(z).reduce(((t,e)=>Object.assign(t,{[e]:K(X)})),{[z.DESKTOP]:[],[z.MOBILE]:[]})),content:{text:"SALE_15",iconContent:0,iconContrastEnabled:!0,textContrastEnabled:!0}},metaDescription:{icon:"/SysPromoCodeComponent/assets/img/promo-code-component-icon.svg",label:{en:"Promo code",ru:"Промокод",uk:"Промокод",es:"Código promocional",fr:"Code promo",de:"Gutscheincode",it:"Codice promozionale",pt:"Código promocional",ro:"Cod promoțional",bg:"Промоционален код",cs:"Promo kód",el:"Κωδικός προσφοράς",nl:"Promotiecode",pl:"Kod promocyjny",sv:"Rabattkod",tr:"Promosyon kodu",ar:"الرمز الترويجي",zh:"促销码",da:"Kampagnekode",he:"קוד קידום",fi:"Alennuskoodi",hi:"प्रोमो कोड",hr:"Promotivni kod",hu:"Promo kód",id:"Kode promo",ja:"プロモコード",ko:"프로모션 코드",no:"Kampanjekode",sk:"Propagačný kód",sl:"Promocijska koda",sr:"Promo kod"}}};var X;const tt={en:"Copied!",ru:"Скопировано!",uk:"Скопійовано!",es:"Copiado!",de:"Kopiert!",fr:"Copié!",it:"Copiato!",pt:"Copiado!",ro:"Copiat!",bg:"Копирано!",cs:"Zkopírováno!",el:"Αντιγράφηκε!",nl:"Gekopieerd!",pl:"Skopiowane!",sv:"Kopierade!",tr:"Kopyalandı!",ar:"نسخ!",hu:"Másolva!"},et=['\n <svg xmlns="http://www.w3.org/2000/svg" width="25" height="24" viewBox="0 0 25 24">\n <path d="M7.9,9.5L0,3.8c1.2-1.6,3.4-2,5.1-0.9l8.5,6l3.1-2.2c-1.2-2-0.6-4.6,1.3-5.9c2-1.4,4.8-0.9,6.2,1.1 c1.4,2,0.9,4.8-1.1,6.3c-1.4,1-3.1,1.1-4.6,0.3l-3.8,2.7l3.8,2.7c1.4-0.7,3.2-0.6,4.6,0.3c2,1.4,2.5,4.2,1.1,6.3 c-1.4,2-4.2,2.5-6.2,1.1c-1.9-1.4-2.5-3.9-1.3-5.9l-4-2.7H7.4l3-1.7L7.9,9.5z M22.8,17.9c0-1.3-1-2.3-2.3-2.3c-1.3,0-2.3,1-2.3,2.3 c0,1.3,1,2.3,2.3,2.3C21.8,20.2,22.8,19.2,22.8,17.9z M22.8,4.5c0-1.3-1-2.3-2.3-2.3c-1.3,0-2.3,1-2.3,2.3s1,2.3,2.3,2.3 C21.8,6.8,22.8,5.8,22.8,4.5z" fill="currentColor"/>\n </svg>\n ','\n <svg xmlns="http://www.w3.org/2000/svg" width="25" height="24" viewBox="0 0 25 24" fill="none">\n <path d="M10.5278 12.0003L0.0870176 20.5846C0.0276258 20.6336 0.021828 20.72 0.0784574 20.7716C0.735083 21.3673 4.70771 24.1658 13.7643 14.862L15.2546 16.1708C15.0272 16.728 14.9013 17.3393 14.9013 17.9815C14.9013 20.571 16.9449 22.667 19.47 22.667C21.9952 22.667 24.0391 20.571 24.0391 17.9815C24.0391 15.392 21.9952 13.2961 19.47 13.2961C18.5938 13.2961 17.7758 13.5487 17.0811 13.9867L14.8192 12.0003L17.0811 10.0137C17.7761 10.4516 18.5941 10.7043 19.47 10.7043C21.9952 10.7043 24.0391 8.60803 24.0391 6.01913C24.0391 3.43022 21.9952 1.33366 19.47 1.33366C16.9449 1.33366 14.9013 3.42965 14.9013 6.01913C14.9013 6.66132 15.0272 7.27265 15.2546 7.82986L13.764 9.13947C4.70771 -0.164618 0.735083 2.63335 0.0784574 3.22909C0.021828 3.28093 0.0276258 3.36677 0.0870176 3.41606L10.5278 12.0003ZM19.47 15.7884C20.6518 15.7886 21.6087 16.7696 21.6087 17.9815C21.6087 19.1934 20.6518 20.1747 19.47 20.1747C18.2885 20.1747 17.3317 19.1934 17.3317 17.9815C17.3317 16.7696 18.2885 15.7884 19.47 15.7884ZM19.47 3.82625C20.6518 3.82625 21.6087 4.80725 21.6087 6.01913C21.6087 7.231 20.6518 8.21229 19.47 8.21229C18.2885 8.21229 17.3317 7.231 17.3317 6.01913C17.3317 4.80725 18.2885 3.82625 19.47 3.82625Z" fill="currentColor"/>\n </svg>\n '],nt=['\n <svg width="16" height="18" viewBox="0 0 16 18" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M3 0H10C11.6569 0 13 1.34315 13 3V12C13 13.6569 11.6569 15 10 15H3C1.34315 15 0 13.6569 0 12V3C0 1.34314 1.34315 0 3 0ZM3 2C2.44772 2 2 2.44772 2 3V12C2 12.5523 2.44772 13 3 13H10C10.5523 13 11 12.5523 11 12V3C11 2.44772 10.5523 2 10 2H3Z" fill="currentColor"/>\n <path d="M3 15C3 16.6569 4.34315 18 6 18H13C14.6569 18 16 16.6569 16 15V6C16 4.34315 14.6569 3 13 3V5C13.5523 5 14 5.44772 14 6V15C14 15.5523 13.5523 16 13 16H6C5.44772 16 5 15.5523 5 15H3Z" fill="currentColor"/>\n </svg>\n ','\n <svg width="17" height="18" viewBox="0 0 17 18" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M10.8 1H2.2C1.53726 1 1 1.53726 1 2.2V12.8C1 13.4627 1.53726 14 2.2 14H10.8C11.4627 14 12 13.4627 12 12.8V2.2C12 1.53726 11.4627 1 10.8 1ZM2.2 0C0.984974 0 0 0.984973 0 2.2V12.8C0 14.015 0.984973 15 2.2 15H10.8C12.015 15 13 14.015 13 12.8V2.2C13 0.984974 12.015 0 10.8 0H2.2Z" fill="currentColor"/>\n <path d="M4 15V15.8C4 16.4627 4.53726 17 5.2 17H13.8C14.4627 17 15 16.4627 15 15.8V5.2C15 4.53726 14.4627 4 13.8 4H12.9492V3H13.8C15.015 3 16 3.98497 16 5.2V15.8C16 17.015 15.015 18 13.8 18H5.2C3.98497 18 3 17.015 3 15.8V15H4Z" fill="currentColor"/>\n </svg>\n ','\n <svg width="17" height="18" viewBox="0 0 17 18" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M2.2 0C0.984974 0 0 0.984973 0 2.2V12.8C0 14.015 0.984973 15 2.2 15H10.8C12.015 15 13 14.015 13 12.8V2.2C13 0.984974 12.015 0 10.8 0H2.2Z" fill="currentColor"/>\n <path d="M4 15V15.8C4 16.4627 4.53726 17 5.2 17H13.8C14.4627 17 15 16.4627 15 15.8V5.2C15 4.53726 14.4627 4 13.8 4H12.9492V3H13.8C15.015 3 16 3.98497 16 5.2V15.8C16 17.015 15.015 18 13.8 18H5.2C3.98497 18 3 17.015 3 15.8V15H4Z" fill="currentColor"/>\n </svg>\n ','\n <svg width="17" height="18" viewBox="0 0 17 18" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path d="M0 2C0 0.89543 0.895431 0 2 0H11C12.1046 0 13 0.895431 13 2V13C13 14.1046 12.1046 15 11 15H2C0.89543 15 0 14.1046 0 13V2Z" fill="currentColor"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M3 16C3 17.1046 3.89543 18 5 18H14C15.1046 18 16 17.1046 16 16V5C16 3.89543 15.1046 3 14 3V13C14 14.6569 12.6569 16 11 16H3ZM3 15V5C3 3.89543 3.89543 3 5 3H13V13C13 14.1046 12.1046 15 11 15H3Z" fill="currentColor"/>\n </svg>\n '];var ot="12px",it="14px";const rt="\n .cl-promo-code-tooltip-container {\n z-index: ".concat(String(Number.MAX_SAFE_INTEGER),";\n padding: 10px;\n display: inline-block;\n position: fixed;\n background: #000;\n opacity: 1;\n border: 2px solid #FFF;\n border-radius: 5px;\n max-height: fit-content;\n }\n \n .cl-promo-code-tooltip-container[cl-tooltip-position='top']:after {\n content: \"\";\n position: absolute;\n top: 100%;\n left: calc(50% - 5px);\n margin-left: -8px;\n margin-top: -2px;\n border-width: ").concat(ot,";\n border-style: solid;\n border-color: black transparent transparent transparent;\n }\n\n .cl-promo-code-tooltip-container[cl-tooltip-position='top']:before {\n content: \"\";\n position: absolute;\n top: 100%;\n left: calc(50% - 15px);\n border-width: ").concat(it,";\n border-style: solid;\n border-color: white transparent transparent transparent;\n }\n \n .cl-promo-code-tooltip-container[cl-tooltip-position='bottom']:after {\n content: \"\";\n position: absolute;\n top: -22px;\n left: calc(50% - 4px);\n margin-left: -5px;\n margin-bottom: -2px;\n border-width: ").concat(ot,";\n border-style: solid;\n border-color: transparent transparent black transparent;\n }\n\n .cl-promo-code-tooltip-container[cl-tooltip-position='bottom']:before {\n content: \"\";\n position: absolute;\n top: -28px;\n left: calc(50% - 11px);\n border-width: ").concat(it,";\n border-style: solid;\n border-color: transparent transparent white transparent;\n }\n");class st{static size(t){return{width:this.width(t),height:this.height(t)}}static width(t){return t=t||document,Math.max(t.documentElement.clientWidth,t.defaultView.innerWidth||0)}static height(t){return t=t||document,Math.max(t.documentElement.clientHeight,t.defaultView.innerHeight||0)}static scrollbarWidth(t){return(t=t||document).defaultView.innerWidth-t.documentElement.clientWidth}}var lt=[];for(var at in{transparent:"#0000"})lt.push(at);var ct="\\s*([.\\d%]+)\\s*",pt="\\("+[ct,ct,ct]+"(?:,\\s*([.\\d]+)\\s*)?\\)",ht="(?:rgb)a?",dt="("+lt.join("|")+")";function ut(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}RegExp(ht+pt,"i"),RegExp([dt,"(?:#([a-f0-9]{3,8}))",ht+pt,"(?:hsl)a?"+pt].join("|"),"gi");var mt=Array.prototype.concat,gt=Array.prototype.slice,bt=function(t){for(var e=[],n=0,o=t.length;n<o;n++){var i=t[n];ut(i)?e=mt.call(e,gt.call(i)):e.push(i)}return e};bt.wrap=function(t){return function(){return t(bt(arguments))}};const yt=bt;var ft={},vt=Object.hasOwnProperty,Ct=Object.create(null);for(var Et in ft)vt.call(ft,Et)&&(Ct[ft[Et]]=Et);var Ot={to:{},get:{}};function Tt(t,e,n){return Math.min(Math.max(e,t),n)}Ot.get=function(t){var e,n;return"hsl"===t.substring(0,3).toLowerCase()?(e=Ot.get.hsl(t),n="hsl"):(e=Ot.get.rgb(t),n="rgb"),e?{model:n,value:e}:null},Ot.get.rgb=function(t){if(!t)return null;var e,n,o,i=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(o=e[2],e=e[1],n=0;n<3;n++){var r=2*n;i[n]=parseInt(e.slice(r,r+2),16)}o&&(i[3]=parseInt(o,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(o=(e=e[1])[3],n=0;n<3;n++)i[n]=parseInt(e[n]+e[n],16);o&&(i[3]=parseInt(o+o,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)i[n]=parseInt(e[n+1],0);e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:vt.call(ft,e[1])?((i=ft[e[1]])[3]=1,i):null:null;for(n=0;n<3;n++)i[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}for(n=0;n<3;n++)i[n]=Tt(i[n],0,255);return i[3]=Tt(i[3],0,1),i},Ot.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,Tt(parseFloat(e[2]),0,100),Tt(parseFloat(e[3]),0,100),Tt(isNaN(n)?1:n,0,1)]}return null},Ot.to.rgb=function(){var t=yt(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},Ot.to.hsl=function(){var t=yt(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"};const St=Ot,At={},xt={};for(const t of Object.keys(At))xt[At[t]]=t;const wt={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"}};Math.pow(6/29,3);for(const t of Object.keys(wt)){if(!("channels"in wt[t]))throw new Error("missing channels property: "+t);if(!("labels"in wt[t]))throw new Error("missing channel labels property: "+t);if(wt[t].labels.length!==wt[t].channels)throw new Error("channel and label counts mismatch: "+t);const{channels:e,labels:n}=wt[t];delete wt[t].channels,delete wt[t].labels,Object.defineProperty(wt[t],"channels",{value:e}),Object.defineProperty(wt[t],"labels",{value:n})}wt.rgb.hsl=function(t){const e=t[0]/255,n=t[1]/255,o=t[2]/255,i=Math.min(e,n,o),r=Math.max(e,n,o),s=r-i;let l,a;r===i?l=0:e===r?l=(n-o)/s:n===r?l=2+(o-e)/s:o===r&&(l=4+(e-n)/s),l=Math.min(60*l,360),l<0&&(l+=360);const c=(i+r)/2;return a=r===i?0:c<=.5?s/(r+i):s/(2-r-i),[l,100*a,100*c]},wt.hsl.rgb=function(t){const e=t[0]/360,n=t[1]/100,o=t[2]/100;let i,r,s;if(0===n)return s=255*o,[s,s,s];i=o<.5?o*(1+n):o+n-o*n;const l=2*o-i,a=[0,0,0];for(let t=0;t<3;t++)r=e+1/3*-(t-1),r<0&&r++,r>1&&r--,s=6*r<1?l+6*(i-l)*r:2*r<1?i:3*r<2?l+(i-l)*(2/3-r)*6:l,a[t]=255*s;return a};const Rt=wt;function Pt(t,e){return function(n){return e(t(n))}}function Nt(t,e){const n=[e[t].parent,t];let o=Rt[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)n.unshift(e[i].parent),o=Pt(Rt[e[i].parent][i],o),i=e[i].parent;return o.conversion=n,o}const Lt={};Object.keys(Rt).forEach((t=>{Lt[t]={},Object.defineProperty(Lt[t],"channels",{value:Rt[t].channels}),Object.defineProperty(Lt[t],"labels",{value:Rt[t].labels});const e=function(t){const e=function(t){const e=function(){const t={},e=Object.keys(Rt);for(let n=e.length,o=0;o<n;o++)t[e[o]]={distance:-1,parent:null};return t}(),n=[t];for(e[t].distance=0;n.length;){const t=n.pop(),o=Object.keys(Rt[t]);for(let i=o.length,r=0;r<i;r++){const i=o[r],s=e[i];-1===s.distance&&(s.distance=e[t].distance+1,s.parent=t,n.unshift(i))}}return e}(t),n={},o=Object.keys(e);for(let t=o.length,i=0;i<t;i++){const t=o[i];null!==e[t].parent&&(n[t]=Nt(t,e))}return n}(t);Object.keys(e).forEach((n=>{const o=e[n];Lt[t][n]=function(t){const e=function(...e){const n=e[0];if(null==n)return n;n.length>1&&(e=n);const o=t(e);if("object"==typeof o)for(let t=o.length,e=0;e<t;e++)o[e]=Math.round(o[e]);return o};return"conversion"in t&&(e.conversion=t.conversion),e}(o),Lt[t][n].raw=function(t){const e=function(...e){const n=e[0];return null==n?n:(n.length>1&&(e=n),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(o)}))}));const Mt=Lt,_t=["keyword","gray","hex"],kt={};for(const t of Object.keys(Mt))kt[[...Mt[t].labels].sort().join("")]=t;const It={};function jt(t,e){if(!(this instanceof jt))return new jt(t,e);if(e&&e in _t&&(e=null),e&&!(e in Mt))throw new Error("Unknown model: "+e);let n,o;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof jt)this.model=t.model,this.color=[...t.color],this.valpha=t.valpha;else if("string"==typeof t){const e=St.get(t);if(null===e)throw new Error("Unable to parse color from string: "+t);this.model=e.model,o=Mt[this.model].channels,this.color=e.value.slice(0,o),this.valpha="number"==typeof e.value[o]?e.value[o]:1}else if(t.length>0){this.model=e||"rgb",o=Mt[this.model].channels;const n=Array.prototype.slice.call(t,0,o);this.color=Bt(n,o),this.valpha="number"==typeof t[o]?t[o]:1}else if("number"==typeof t)this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;const e=Object.keys(t);"alpha"in t&&(e.splice(e.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);const o=e.sort().join("");if(!(o in kt))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=kt[o];const{labels:i}=Mt[this.model],r=[];for(n=0;n<i.length;n++)r.push(t[i[n]]);this.color=Bt(r)}if(It[this.model])for(o=Mt[this.model].channels,n=0;n<o;n++){const t=It[this.model][n];t&&(this.color[n]=t(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}jt.prototype={toString(){return this.string()},string(t){let e=this.model in St.to?this:this.rgb();e=e.round("number"==typeof t?t:1);const n=1===e.valpha?e.color:[...e.color,this.valpha];return St.to[e.model](n)},round(t){return t=Math.max(t||0,0),new jt([...this.color.map(Dt(t)),this.valpha],this.model)},alpha(t){return void 0!==t?new jt([...this.color,Math.max(0,Math.min(1,t))],this.model):this.valpha},lighten(t){const e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken(t){const e=this.hsl();return e.color[2]-=e.color[2]*t,e}};for(const t of Object.keys(Mt)){if(_t.includes(t))continue;const{channels:e}=Mt[t];jt.prototype[t]=function(...e){return this.model===t?new jt(this):e.length>0?new jt(e,t):new jt([...Ht(Mt[this.model][t].raw(this.color)),this.valpha],t)},jt[t]=function(...n){let o=n[0];return"number"==typeof o&&(o=Bt(n,e)),new jt(o,t)}}function Dt(t){return function(e){return function(t,e){return Number(t.toFixed(e))}(e,t)}}function Ht(t){return Array.isArray(t)?t:[t]}function Bt(t,e){for(let n=0;n<e;n++)"number"!=typeof t[n]&&(t[n]=0);return t}const Ft=jt;function Wt(t,e){Object.keys(e).forEach((n=>{t.style[n]=e[n]}))}function Vt(t,e,n){const o=function(t,e){const n=getComputedStyle(t)[e]||t.style.getPropertyValue(e);if(n&&n.includes("rgb")&&(!(n.split("rgb").length>2)||n.includes("#")))return n}(e,n);if(o){const e=Ft(o).alpha(.5).string();return t.classList.add("focus-outline-defined"),t.style.setProperty("--clFocusOutline",`3px solid ${e}`),e}return null}function Ut(t){const{width:e,height:n}=t.getBoundingClientRect(),{marginBottom:o,marginTop:i,marginLeft:r,marginRight:s}=window.getComputedStyle(t);return{width:e+parseInt(r,10)+parseInt(s,10),height:n+parseInt(i,10)+parseInt(o,10)}}function $t(t,e,n,o,i){switch(t.position){case"top":return{left:`${Gt(e,n,o,i)}px`,top:t.availableSpaceAboveTriggerElem-t.contentHeight-t.verticalOffset+"px"};case"bottom":return{left:`${Gt(e,n,o,i)}px`,bottom:t.availableSpaceBelowTriggerElem-t.contentHeight-t.verticalOffset+"px"};case"left":return{left:t.availableSpaceToTheLeftSideOfTheTrigger-e.width-t.contentWidth-t.horizontalOffset+"px",top:`${zt(0,t)}px`};case"right":return{right:t.availableSpaceToTheRightSideOfTheTrigger-t.contentWidth-t.horizontalOffset+"px",top:`${zt(0,t)}px`}}}function Gt(t,e,n,o){let i=n?t.x+t.width/2-e.width/2:t.x;return i<0&&(i=0),i+e.width>st.width(o)&&(i-=i+e.width-st.width(o)),i}function zt(t,e){let n=e.availableSpaceAboveTriggerElem;return e.contentHeight>e.availableSpaceBelowTriggerElem&&(n-=e.contentHeight-e.availableSpaceBelowTriggerElem),n}function Zt(t){const{triggerElement:e,tooltipElement:n,offset:o=10,htmlDocumentObject:i}=t,r=function(t,e,n,o,i,r){const s=function(t,e,n,o,i){const r=function(t,e,n,o){const i=st.width(o),{right:r}=t.getBoundingClientRect(),s=i-n-r-st.scrollbarWidth(o);return{horizontalOffset:n,contentWidth:Ut(e).width,availableSpaceToTheLeftSideOfTheTrigger:r-n,availableSpaceToTheRightSideOfTheTrigger:s}}(t,e,n,i),s=function(t,e,n,o){const i=st.height(o),{top:r,bottom:s}=t.getBoundingClientRect();return{verticalOffset:n,contentHeight:Ut(e).height,availableSpaceAboveTriggerElem:r-n,availableSpaceBelowTriggerElem:i-s-n}}(t,e,n,i);let l="undefined";const a={bottom:s.availableSpaceBelowTriggerElem>=s.contentHeight,top:s.availableSpaceAboveTriggerElem>=s.contentHeight,right:r.availableSpaceToTheRightSideOfTheTrigger>=r.contentWidth,left:r.availableSpaceToTheLeftSideOfTheTrigger>=r.contentWidth};if(a.top?l="top":a.bottom?l="bottom":a.right?l="right":a.left&&(l="left"),a[o]&&(l=o),"undefined"===l){const t=Math.max(s.availableSpaceBelowTriggerElem,s.availableSpaceAboveTriggerElem,r.availableSpaceToTheRightSideOfTheTrigger,r.availableSpaceToTheLeftSideOfTheTrigger);t===s.availableSpaceBelowTriggerElem?l="bottom":t===s.availableSpaceAboveTriggerElem?l="top":t===r.availableSpaceToTheRightSideOfTheTrigger?l="right":t===r.availableSpaceToTheLeftSideOfTheTrigger&&(l="left")}return Object.assign(Object.assign(Object.assign({},s),r),{position:l})}(t,e,n,o,r=r||document);return function(t,e){const{marginBottom:n,marginTop:o}=window.getComputedStyle(e);if("top"===t.position)Wt(e,{"margin-top":`${parseInt(o,10)+parseInt(n,10)}px`}),Wt(e,{"margin-bottom":"0px"});else if("bottom"===t.position)Wt(e,{"margin-bottom":`${parseInt(n,10)+parseInt(o,10)}px`}),Wt(e,{"margin-top":"0px"});else{const t=(parseInt(n,10)+parseInt(o,10))/2+"px";Wt(e,{"margin-top":t,"margin-bottom":t})}}(s,e),{coordinates:$t(s,t.getBoundingClientRect(),e.getBoundingClientRect(),i,r),position:s.position}}(e,n,o,"top",!0,i);n.setAttribute("cl-tooltip-position",r.position),Wt(n,r.coordinates)}function Kt(t){return Kt="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},Kt(t)}function qt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,ne(o.key),o)}}function Qt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Qt=function(){return!!t})()}function Jt(t,e,n,o){var i=Yt(Xt(1&o?t.prototype:t),e,n);return 2&o&&"function"==typeof i?function(t){return i.apply(n,t)}:i}function Yt(){return Yt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var o=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Xt(t)););return t}(t,e);if(o){var i=Object.getOwnPropertyDescriptor(o,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},Yt.apply(null,arguments)}function Xt(t){return Xt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xt(t)}function te(t,e){return te=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},te(t,e)}function ee(t,e,n){return(e=ne(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ne(t){var e=function(t){if("object"!=Kt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Kt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Kt(e)?e:e+""}var oe="lastPromoCode",ie=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),ee(e=function(t,e,n){return e=Xt(e),function(t,e){if(e&&("object"==Kt(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,Qt()?Reflect.construct(e,n||[],Xt(t).constructor):e.apply(t,n))}(this,t),"manifest",Y),ee(e,"tooltipContainerElement",void 0),ee(e,"firstTooltipTimer",void 0),ee(e,"secondTooltipTimer",void 0),ee(e,"thirdTooltipTimer",void 0),ee(e,"boundOnScrollHandler",void 0),ee(e,"contextSubscriptions",[]),ee(e,"tooltipStylesId","cl-promo-code-tooltip-styles"),ee(e,"inlineEditPromocodeClass","cl--inline--edit"),ee(e,"inlineEditAttributeName","cl-inline-edit"),ee(e,"inlineEditAttributeValue","content, text"),ee(e,"isByContainerWidth",!1),ee(e,"isByContentWidth",!1),ee(e,"renderTooltip",(function(t){var n=e.getTranslationsMap(tt).translations;e.tooltipContainerElement=document.createElement("div"),e.tooltipContainerElement.classList.add("cl-promo-code-tooltip-container");var o=document.createElement("div");o.style.padding="5px",o.style.color="#fff",o.innerText=n,e.tooltipContainerElement.append(o),e.htmlDocumentObject.body.appendChild(e.tooltipContainerElement),e.firstTooltipTimer=setTimeout((function(){Zt({triggerElement:t,tooltipElement:e.tooltipContainerElement,htmlDocumentObject:e.htmlDocumentObject}),e.boundOnScrollHandler=function(){return Zt({triggerElement:t,tooltipElement:e.tooltipContainerElement,htmlDocumentObject:e.htmlDocumentObject})},document.addEventListener("scroll",e.boundOnScrollHandler,!0),e.secondTooltipTimer=setTimeout((function(){e.removeScrollListener(),e.tooltipContainerElement.style.transition="0.15s",e.tooltipContainerElement.style.top="".concat(t.getBoundingClientRect().top+window.pageYOffset,"px"),e.tooltipContainerElement.style.opacity="0",e.thirdTooltipTimer=setTimeout((function(){e.destroyTooltip()}),150)}),1500)}))})),ee(e,"getTooltipTopPosition",(function(t,e,n){var o=t.getBoundingClientRect();return"".concat(o.top-e.height-n+window.pageYOffset,"px")})),ee(e,"getTooltipLeftPosition",(function(t,e){var n=t.getBoundingClientRect();return"".concat(n.left+n.width/2-e.width/2+window.pageXOffset,"px")})),ee(e,"destroyTooltip",(function(){e.tooltipContainerElement&&(e.tooltipContainerElement.remove(),e.tooltipContainerElement=null)})),ee(e,"clearTooltipTimers",(function(){clearTimeout(e.firstTooltipTimer),clearTimeout(e.secondTooltipTimer),clearTimeout(e.thirdTooltipTimer)})),ee(e,"removeScrollListener",(function(){document.removeEventListener("scroll",e.boundOnScrollHandler,!0)})),ee(e,"mapStyleControlValuesToInnerContent",(function(){var t=e.getElement("text"),n=e.getRootElement().querySelector('[cl-inline-edit="content, text"]'),o=e.getElement("text").querySelector(".".concat(e.inlineEditPromocodeClass));o.style.display=e.isByContentWidth||e.isByContainerWidth?"contents":"",o.style.whiteSpace=e.isByContentWidth?"nowrap":"",t&&n&&(n.style.minWidth="20px",n.style.width="max-content",n.style.minHeight=t.style.fontSize,n.style.textAlign=t.style.textAlign,n.style.lineHeight=t.style.lineHeight,n.style.fontWeight=t.style.fontWeight,n.style.fontSize=t.style.fontSize,n.style.textShadow=t.style.textShadow,n.style.letterSpacing=t.style.letterSpacing,n.style.fontFamily=t.style.fontFamily)})),ee(e,"mapAlignValueToTextElementContent",(function(t){"center"===t.style.textAlign&&(t.style.justifyContent="center"),"start"===t.style.textAlign&&(t.style.justifyContent="flex-start"),"end"===t.style.textAlign&&(t.style.justifyContent="flex-end")})),ee(e,"handleSafariHeightIssue",(function(){var t=e.getHostElement();"auto"===t.style.height&&(t.style.height="fit-content")})),ee(e,"storeStrokeTopWidthAsCssVar",(function(){var t=e.getElement("host"),n=e.getElement("text");t.style.setProperty("--clStrokeForIconWidth",n.style.borderTopWidth||0)})),ee(e,"destroyExistingIcon",(function(){var t=e.getRootElement().querySelector('[cl-element="icon"]');t&&t.remove()})),ee(e,"showIconIfAny",(function(t,n){var o=n.content.iconContent,i=parseFloat(o),r=!isNaN(i);if(e.destroyExistingIcon(),null!=o){if(r){var s=(n.styles?"absolute"===n.styles.find((function(t){return"icon"===t.element})).styleAttributes.position:"absolute"===n.adaptiveStyles[e.getEnvironment()].find((function(t){return"icon"===t.element})).styleAttributes.position)?et[i]:nt[i],l=document.createElement("span");l.classList.add("promocode-icon"),l.setAttribute("cl-element","icon"),q({element:l,html:s}),t.appendChild(l)}else{var a=document.createElement("img");a.src=o,a.classList.add("promocode-icon"),a.setAttribute("cl-element","icon"),t.appendChild(a)}e.applyAutoAdaptiveStyles(n.adaptiveStyles,n.styles)}})),ee(e,"addTooltipStyles",(function(){if(!e.htmlDocumentObject.head.querySelector("#".concat(e.tooltipStylesId))){var t=document.createElement("style");t.setAttribute("id",e.tooltipStylesId),q({element:t,html:rt}),e.htmlDocumentObject.head.appendChild(t)}})),ee(e,"removeTooltipStyles",(function(){var t=e.htmlDocumentObject.head.querySelector("#".concat(e.tooltipStylesId));t&&t.remove()})),ee(e,"_handleContextRecord",(function(t){var n;if(!e.services.context.getKVMap().promoCode&&t.key===oe){var o=e.getModel();if(!(t.value.viewIndex>=o.path[0])){var i=(null===(n=e.services.context.getRecord(oe))||void 0===n?void 0:n.value.value)||null,r=e.getElement("text").querySelector(".".concat(e.inlineEditPromocodeClass));i?(r.removeAttribute(e.inlineEditAttributeName),r.innerText=i):r.setAttribute(e.inlineEditAttributeName,e.inlineEditAttributeValue)}}})),ee(e,"checkWidthMode",(function(t){var n,o=e.getEnvironment(),i=null===(n=t.adaptiveStyles[o])||void 0===n||null===(n=n.find((function(t){return"host"===t.element})))||void 0===n?void 0:n.styleAttributes.width;e.isByContentWidth="auto"===i,e.isByContainerWidth="100%"===i})),e.getRootElement().innerHTML="\n <style>".concat("\n.text {\n outline: none;\n min-height: 20px;\n cursor: pointer;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n position: relative;\n}\n\n.promocode-icon {\n top: calc(((var(--clPromocodeIconHeight) / 2) * -1) - var(--clStrokeForIconWidth));\n width: var(--clPromocodeIconWidth);\n height: var(--clPromocodeIconHeight);\n}\n\n.promocode-icon svg {\n display: flex;\n width: 100%;\n height: auto;\n}\n\nbutton.focus-outline-defined:focus {\n outline: var(--clFocusOutline);\n}\n",'</style>\n <button class="text" cl-element="text">\n <span class="').concat(e.inlineEditPromocodeClass,'" ').concat(e.inlineEditAttributeName,'="').concat(e.inlineEditAttributeValue,'"></span>\n </button>'),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&&te(t,e)}(t,J),e=t,n=[{key:"connectedCallback",value:function(){var e=this;Jt(t,"connectedCallback",this,3)([]),this.addTooltipStyles();var n=this.getElement("text"),o=n.querySelector("[".concat(this.inlineEditAttributeName,'="').concat(this.inlineEditAttributeValue,'"]'));this.contextSubscriptions=[this.services.context.on("RECORD_ADDED",this._handleContextRecord.bind(this)),this.services.context.on("RECORD_UPDATED",this._handleContextRecord.bind(this)),this.services.context.on("RECORD_DELETED",this._handleContextRecord.bind(this))],"UPDATING"!==this.services.config.getConfig("entryModuleType")&&n.addEventListener("click",(function(t){var i,r;t.stopPropagation(),(i=o.textContent,(null===(r=navigator.clipboard)||void 0===r?void 0:r.writeText)?navigator.clipboard.writeText(String(i).trim().replace("<br>"," ")):Promise.reject()).then((function(){e.destroyTooltip(),e.clearTooltipTimers(),e.removeScrollListener(),e.renderTooltip(n)})).catch((function(t){return console.error("SysPromoCodeComponent couldn't write to clipboard",t)})),e.services.trackingService.send("FormClick_[Name]"),e.services.trackingService.trackClick(),e.services.trackingService.trackTargetAction(e.getProps().content.countAsTargetAction)})),this.observeProps((function(t,i){e.applyAutoAdaptiveStyles(i.adaptiveStyles,i.styles),e.checkWidthMode(i);var r=e.services.context.getKVMap().promoCode;r?o.innerText=r:q({element:o,html:i.content.text});var s=e.services.context.getRecord(oe);s&&e._handleContextRecord(s),e.mapAlignValueToTextElementContent(e.getElement("text")),e.mapStyleControlValuesToInnerContent(),e.showIconIfAny(n,i),e.storeStrokeTopWidthAsCssVar(),e.handleSafariHeightIssue(),function(t){let e;const n=t,o=["transparent","initial"];t&&(t.style.borderColor&&!o.includes(t.style.borderColor)&&(parseFloat(t.style.borderWidth)||parseFloat(t.style.borderBottomWidth))&&(e=Vt(n,t,"borderColor")),!e&&t.style.getPropertyValue("--borderBottomColor")&&!o.includes(t.style.getPropertyValue("--borderBottomColor"))&&parseFloat(t.style.getPropertyValue("--borderBottomWidth"))&&(e=Vt(n,t,"--borderBottomColor")),e||!t.style.backgroundColor||o.includes(t.style.backgroundColor)||(e=Vt(n,t,"backgroundColor")),e||!t.style.color||o.includes(t.style.color)||(e=Vt(n,t,"color")),e||n.classList.remove("focus-outline-defined"))}(e.getElement("text"))})),this.observeShared((function(){e.mapAlignValueToTextElementContent(e.getElement("text")),e.mapStyleControlValuesToInnerContent()})),this.observeEnvironment((function(){e.handleSafariHeightIssue(),e.mapStyleControlValuesToInnerContent()}))}},{key:"disconnectedCallback",value:function(){Jt(t,"disconnectedCallback",this,3)([]),this.destroyTooltip(),this.clearTooltipTimers(),this.removeScrollListener(),this.removeTooltipStyles(),this.contextSubscriptions.forEach((function(t){return t.off()}))}}],n&&qt(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();ee(ie,"define",{name:"sys-promo-code",model:Y.name,manifest:Y});export{ie as default};window.clComponentClass_SysPromoCodeComponent=ie;
|