@claspo/components 1.1.17 → 1.2.0-theme.16
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 e={name:"SysContainerComponent",componentType:"CONTAINER",version:"1.0.0",contextMenuModel:[{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT",params:{hideForEntryType:"VIEW"}}],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:"CONTROL",name:"PARENT_ALIGNMENT",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"},{type:"CONTROL",name:"PARENT_ALIGNMENT",elementProp:"styleAttributes",element:"host"}]}],propertyPaneModel:{content:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"ALIGNMENT",elementProp:"styleAttributes",element:"host",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["fixed","fill","hug"]}},displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType !== 'CONTENT_LOCKER' : true",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"BACKGROUND",elementProp:"styleAttributes",element:"host",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'",syncSelectOptions:["SAME_TYPE_CROSS_ENV_WHILE_VALUES_MATCH",null]},{type:"CONTROL",name:"BACKDROP_FILTER",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0,displayCondition:"return sdk.component.type === 'VIEW' ? (sdk.appConfig.allowBackdropFilterOnView ?? true) : true",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=host]","styleAttributes"],displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType !== 'CONTENT_LOCKER' : true",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=host]","styleAttributes"],displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType !== 'CONTENT_LOCKER' : true",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=host]","styleAttributes"],displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType !== 'CONTENT_LOCKER' : true",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"PADDING"},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"},displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType === 'BUILT_IN' : true",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"SWITCH",propPath:["styles","[element=host]","styleAttributes","overflow"],params:{label:"DOCUMENT_OVERFLOW_TITLE",boldLabel:!0,description:"DOCUMENT_OVERFLOW_ENABLED_DESCRIPTION",getValueMapper:{undefined:!1,"":!1,visible:!1,hidden:!0},setValueMapper:{true:"hidden",false:"visible"}},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"ALIGNMENT",elementProp:"styleAttributes",element:"host",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["fixed","fill","hug"]}},displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType !== 'CONTENT_LOCKER' : true",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"BACKGROUND",elementProp:"styleAttributes",element:"host",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'",syncSelectOptions:["SAME_TYPE_CROSS_ENV_WHILE_VALUES_MATCH",null]},{type:"CONTROL",name:"BACKDROP_FILTER",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0,displayCondition:"return sdk.component.type === 'VIEW' ? (sdk.appConfig.allowBackdropFilterOnView ?? true) : true",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=host]","styleAttributes"],displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType !== 'CONTENT_LOCKER' : true",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=host]","styleAttributes"],displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType !== 'CONTENT_LOCKER' : true",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=host]","styleAttributes"],displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType !== 'CONTENT_LOCKER' : true",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"PADDING"},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"},displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType === 'BUILT_IN' : true",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"SWITCH",propPath:["styles","[element=host]","styleAttributes","overflow"],params:{label:"DOCUMENT_OVERFLOW_TITLE",boldLabel:!0,description:"DOCUMENT_OVERFLOW_ENABLED_DESCRIPTION",getValueMapper:{undefined:!1,"":!1,visible:!1,hidden:!0},setValueMapper:{true:"hidden",false:"visible"}},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"}]}],general:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!0},displayCondition:"return sdk.widgetType !== 'TEASER'"}]},events:{dispatch:[],listen:[]},i18nPropertyPaneModel:{content:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!1},displayCondition:"return sdk.widgetType !== 'TEASER'"}]},i18nPropPaths:["handlers,[id],actions,[id],params,link","handlers,[id],actions,[id],params,customData"],props:{styles:[{element:"host",styleAttributes:{overflow:"visible",borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"0px",borderTopColor:"rgb(0, 0, 0)",borderBottomWidth:"0px",borderBottomColor:"rgb(0, 0, 0)",borderLeftWidth:"0px",borderLeftColor:"rgb(0, 0, 0)",borderRightWidth:"0px",borderRightColor:"rgb(0, 0, 0)",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none"},classes:""}],adaptiveStyles:{desktop:[{element:"host",styleAttributes:{position:"relative",width:"100%",minWidth:"min-content",height:"auto",minHeight:null,flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"10px",paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",_paddingEnabled:!0,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1,background:"rgba(0, 0, 0, 0.06)"},classes:""}],mobile:[{element:"host",styleAttributes:{position:"relative",width:"100%",minWidth:"min-content",height:"auto",minHeight:null,flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"10px",paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",_paddingEnabled:!0,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1,background:"rgba(0, 0, 0, 0.06)"},classes:""}]}},metaDescription:{icon:"/SysContainerComponent/assets/img/container-component-icon.svg",label:{en:"Container",ru:"Контейнер",uk:"Контейнер",es:"Envase",fr:"Récipient",de:"Container",it:"Contenitore",pt:"Embalagem",ro:"Container",bg:"Контейнер",cs:"Kontejner",el:"Περιέκτης",nl:"Container",pl:"Kontener",sv:"Behållare",tr:"Konteyner",ar:"الحاوية",zh:"容器",da:"Beholder",he:"קונטיינר",fi:"Säiliö",hi:"कंटेनर",hr:"Kontejner",hu:"Tárhely",id:"Kontainer",ja:"コンテナ",ko:"컨테이너",no:"Container",sk:"Krabica",sl:"Rezervoar",sr:"Kontejner"}},waitForResourcesLoad:!0,resourcesPropPaths:[["adaptiveStyles",":ENV","styleAttributes","background"]]},t="cl-";function n(e){return t+e}function i(e){return"cl-"+e}const o="VIEW",s="MODULE",r="CONTAINER",l="INPUT",a="BUTTON",c="CONSENT",p="COLUMN",d="SUBSCRIBE_CONTACT",u="REQUEST",h="SHOW_WIDGET",m="OPEN_LINK",y="CLOSE_WIDGET";class g{static sortActions(e){const t={[y]:-1,[m]:-2,[h]:1,[d]:2,[u]:3},n=e=>void 0!==t[e.type]?t[e.type]:0;return[...e].sort(((e,t)=>n(e)>n(t)?-1:n(e)<n(t)?1:0))}constructor(e,t){this.config=e,this.actions=g.sortActions(t),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(e,t,n){this.state=e;const o=n(),s=o.getAttribute(i("id"));this.listener=e=>{const t=e.composedPath().filter((e=>e instanceof HTMLElement&&e.getAttribute(i("type"))));let n=0;for(;t[n]&&t[n].getAttribute(i("id"))!==s;){let e=t[n].getAttribute(i("type"));if(g.IGNORING_VIEW_ENTRY_TYPES.includes(e))return;n++}this.eventsQueue.push({event:e}),this.postponed||this.execute()},this.targetElements=this.config.relativeSelector?Array.from((o.shadowRoot||o).querySelectorAll(this.config.relativeSelector)):[o],this.targetElements.forEach((e=>{e.addEventListener("click",this.listener)}))}async execute(){var e,t,n,i;try{for(var o,s=!0,r=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(n){t[n]=e[n]&&function(t){return new Promise((function(i,o){!function(e,t,n,i){Promise.resolve(i).then((function(t){e({value:t,done:n})}),t)}(i,o,(t=e[n](t)).done,t.value)}))}}}(this.eventsQueue);!(e=(o=await r.next()).done);){i=o.value,s=!1;try{const{event:e}=i;for(const t of this.actions)if(!await t.execute(this.state.getState(),e))break}finally{s=!0}}}catch(e){t={error:e}}finally{try{s||e||!(n=r.return)||await n.call(r)}finally{if(t)throw t.error}}this.eventsQueue=[]}postpone(){this.postponed=!0}release(){this.postponed=!1,this.execute()}destroy(){this.listener&&this.targetElements.length&&(this.targetElements.forEach((e=>{e.removeEventListener("click",this.listener)})),this.targetElements=[])}}g.IGNORING_VIEW_ENTRY_TYPES=[a,c,l];const b="CLICK",f="COMPONENT_EVENT";class v{constructor(e,t){this.config=e,this.actions=t,this.componentEmitterListener=null}activate(e,t,n){this.componentEmitterListener=t.on(this.config.eventName,(()=>{this.actions.forEach((t=>t.execute(e.getState(),this.config.params)))}))}destroy(){this.componentEmitterListener&&this.componentEmitterListener.off()}}class E{constructor(e,t){this.actionFactory=e,this.actionRegister=t}get(e){const t=e.actions.map((e=>this.actionFactory.get(e)));switch(t.forEach((e=>this.actionRegister.register(e))),e.type){case b:return new g(e,t);case f:return new v(e,t);default:throw new Error(`Not supported handler type ${e.type}`)}}}class O{static generate(){let e,t="";for(let n=0;n<32;n++)8!==n&&12!==n&&16!==n&&20!==n||(t+="-"),e=Math.floor(16*Math.random()).toString(16).toUpperCase(),t+=e;return t}}class S{constructor(){this.listeners=S.createDefaultListenersState()}emit(e,t,n=null){const i=this.listeners[e];i&&Object.values(i).forEach((i=>i(t,e,n))),Object.values(this.listeners["*"]).forEach((i=>i(t,e,n)))}on(e,t){const n=O.generate(),i=this.listeners[e];return i?i[n]=t:this.listeners[e]={[n]:t},{off:()=>{var t,i;(null===(i=null===(t=this.listeners)||void 0===t?void 0:t[e])||void 0===i?void 0:i[n])&&delete this.listeners[e][n]}}}destroy(){this.listeners=S.createDefaultListenersState()}}S.createDefaultListenersState=()=>({"*":{}});const T=(e,t,n,i)=>{const o=EventTarget.prototype,{addEventListenerBase:s,addEventListener:r}=o;(s||r).call(e,t,n,i)};class C{constructor(e){this.state=e||{}}getState(){return this.state}setState(e){this.state=Object.assign(Object.assign({},this.state),e)}destroy(){}}class R{static extract(e){const t=e.views.map((e=>{const t=e.children.map((e=>e.type===s?Object.assign(Object.assign({},e),R.moduleToContainerParams):e));return Object.assign(Object.assign({},e),{children:t})}));return Object.assign(Object.assign({},e),{views:t})}static sort(e,t){return e.index>t.index?1:-1}static reIndex(e,t){return Object.assign(Object.assign({},e),{index:t+e.index})}}R.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"};class A extends S{constructor(e,t){super(),this.config=t,this.handleMobileBreakpoint(e.getShared().mobileBreakpointWidth),e.on("ENVIRONMENT_UPDATE",(({isMobileEnv:e})=>{this._isMobile=e,this.emit(A.changeEventName,this._isMobile)}))}handleMobileBreakpoint(e){this.mobileBreakpointWidth=e;const t=Number.isInteger(this.mobileBreakpointWidth)?`${this.mobileBreakpointWidth}px`:this.mobileBreakpointWidth;this.mediaQueryList=window.matchMedia(`(max-width: ${t})`),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(e){this._isMobile=e.matches,this.emit(A.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}A.changeEventName="CHANGE";class N{static set(e,t){const n=e[N.accumulatorPropertyName]||{};e[N.accumulatorPropertyName]=Object.assign(Object.assign({},n),t.styleAttributes),Object.keys(e[N.accumulatorPropertyName]).forEach((n=>{n.includes("--")?e.style.setProperty(n,t.styleAttributes[n]||""):e.style[n]=t.styleAttributes[n]?t.styleAttributes[n]:""}))}}N.accumulatorPropertyName="clStyleAttributes";const L="CONTENT_LOCKER";class P{static applyHostStyles(e,t,n=null,i){var s,l,a;const c=null===(l=null===(s=null==n?void 0:n.props)||void 0===s?void 0:s.handlers)||void 0===l?void 0:l.find((e=>"CLICK"===e.type));c&&(null===(a=c.actions)||void 0===a?void 0:a.length)&&(t.style.cursor="pointer"),e!==o&&e!==r&&e!==p||(t.style.display=i===L&&e===o?"flex":"inline-flex",t.style.position="relative"),t.style.boxSizing="border-box"}constructor(){this.styles="/* common styles */ *, *:before, *:after { box-sizing: border-box; font-family: inherit; }"}setStyles(e=""){this.styles=`${this.styles} ${e}`}getStyles(){return this.styles}}class _{static log(e){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(e)):console.error(e)}}class w{constructor(e,t,n,i,o,s){this.hostElement=t,this.documentModel=e,this.getSharedCb=n,this.getPropsCb=i,this.getEnvCb=o,this.httpClient=s,this.subscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(e){const t=String(e||"");if(t.includes("url")){const[e,n]=t.split("(")[1].split(")");return{url:e.replace(/['"]+/g,""),positionOptions:n.replace(";","")}}return{url:null,positionOptions:null}}apply(e){const t=this.getPropsCb();return t.backgroundDynamicInlineSVGElements[e].forEach((n=>{var i,o,s,r,l;const a=null===(o=null===(i=t.adaptiveStyles)||void 0===i?void 0:i[e])||void 0===o?void 0:o.find((e=>e.element===n)),c=(null===(s=t.styles)||void 0===s?void 0:s.find((e=>e.element===n)))||{},p=(null===(r=null==c?void 0:c.styleAttributes)||void 0===r?void 0:r.background)||(null===(l=null==a?void 0:a.styleAttributes)||void 0===l?void 0:l.background),d=this.parseBackground(p);d.url&&this.envUrlMaps[e].set(n,{originalSVGResourceURL:d.url,inlineSvgString:null,positionOptions:d.positionOptions})})),Promise.all([...this.envUrlMaps[e].entries()].map((([t,n])=>this.httpClient.execute(n.originalSVGResourceURL).then((e=>e.text())).then((i=>{this.envUrlMaps[e].set(t,Object.assign(Object.assign({},n),{inlineSvgString:i}))}))))).then((()=>{this._applyHostElementBackground(this.envUrlMaps[e].get("host"),this.getSharedCb().cssVars)})).catch((e=>{console.error(e),_.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${e}`)}))}on(){return this.subscription=this.documentModel.on("COLOR_SCHEMA_UPDATE",(e=>{this._applyHostElementBackground(this.envUrlMaps[this.getEnvCb()].get("host"),e)})),this}_applyHostElementBackground(e,t){e&&t&&(this.hostElement.style.background=this._buildBackgroundUrl(e,t))}_buildBackgroundUrl(e,t){const n=e.inlineSvgString.trim().replace("var(--cl-schema-accent)",t["cl-schema-accent"]);return`url('data:image/svg+xml,${encodeURIComponent(n)}')${e.positionOptions}`}off(){var e;null===(e=this.subscription)||void 0===e||e.off()}}const k=new class{execute(e,t="GET",n=null,i,o){const s={method:t,headers:Object.assign({"Content-Type":"text/plain"},i||{}),credentials:"same-origin",body:null,signal:o};return n&&(s.body="string"==typeof n?n:JSON.stringify(n)),fetch(e,s)}};function x(e,t){return Object.keys(e).filter((e=>!t.includes(e))).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:e[n]})),{})}class M{static camelCaseToDashCase(e){return e.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase()))}static camelCaseToUpperSnakeCase(e){return e.replace(/[A-Z]/g,(e=>"_"+e)).toUpperCase()}}class I{constructor(e){this._count=0,this.onUpdateCb=e}increment(){this._count++,this.onUpdateCb(this.count())}decrement(){this._count>0&&this._count--,this.onUpdateCb(this.count())}count(){return this._count}}const j="COMPONENT_RESOURCES_LOADED",D="FAILED_TO_LOAD_COMPONENT_RESOURCE";class W{constructor(e,t,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=e=>{0===e&&this.systemEventEmitter.emit(j,this.componentId)},this.onResourceLoadFailure=e=>{this.isStaticEntryModule?this.systemEventEmitter.emit(D,`Failed to load: ${e}`):this.counters.pending.decrement()},this.componentId=e,this.systemEventEmitter=t,this.isStaticEntryModule=n,this.counters={pending:new I(this.onCounterStateUpdate)}}}const U=(...e)=>{let t=e.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:[]})),{});return{get:e=>t[e],clear:()=>U(...e)}},F=U,B="props",V="shared",H="environment";function $(e,t,n,i){const o=e=>{let s=e instanceof DocumentFragment||(null==e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?e.host:e;return s&&(i&&"function"==typeof i?i(s.getAttribute(t)):(null===(r=null==s?void 0:s.getAttribute)||void 0===r?void 0:r.call(s,t))===n)?s:s&&s.parentNode&&o(s.parentNode)||null;var r};return o(e)}const G="SUBMIT";function K(e,t){return t?(e.classes=`${e.classes||""} ${t.classes||""}`.trim(),Object.keys(t).forEach((n=>{if("element"===n||"classes"===n)return;const i=t[n];i&&"object"==typeof i&&!Array.isArray(i)?e[n]=Object.assign(Object.assign({},e[n]||{}),i):e[n]=i})),e):e}function z(e,t,n){var i;return null===(i=null==e?void 0:e[t])||void 0===i?void 0:i.find((e=>e.element===n))}function Q(e){const{element:t,html:n,appendHtml:i}=e,o=function(e){if(null==e)return"";if("string"!=typeof e)return String(e);if(""===e)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(e))return e;const t=(new DOMParser).parseFromString(e,"text/html");return t.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach((e=>e.remove())),t.querySelectorAll("*").forEach((e=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach((t=>e.removeAttribute(t))),Array.from(e.attributes).forEach((t=>{t.name.startsWith("on")&&e.removeAttribute(t.name)})),"A"===e.tagName||"AREA"===e.tagName){const t=e.getAttribute("href");t&&(t.startsWith("javascript:")||t.startsWith("data:"))&&e.removeAttribute("href")}if("IMG"===e.tagName||"IFRAME"===e.tagName){const t=e.getAttribute("src");t&&(t.startsWith("javascript:")||t.startsWith("data:text/html"))&&e.removeAttribute("src")}if("FORM"===e.tagName){const t=e.getAttribute("action");t&&t.startsWith("javascript:")&&e.removeAttribute("action")}})),t.body.innerHTML}(n);i?t.innerHTML+=o:t.innerHTML=o}class q extends Event{constructor(e,t,n){super(e,n),this.detail={},Object.defineProperty(this,"detail",{value:t})}}const Z="STATIC",J="UPDATING";class Y extends HTMLElement{constructor(){var e,o;super(),this.construct=()=>{let e;const t=this.getAttribute(i("id")),n=this.getWidgetContainerNode();if(!n)throw new Error("Widget container not found in construct");const o=n.closest(`[${i("widget-id")}]`);let s;o&&(s=o.getAttribute(i("widget-id")));let r=new q("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(i("path")),id:t,widgetId:s},{bubbles:!0,composed:!0});this.dispatchEvent(r),e=r.detail.props,Object.assign(this,e),this.observers=F(B,V,H),this.subscriptions=new class{constructor(){this.subscriptions=[]}push(e){this.subscriptions.push(e)}off(){this.subscriptions.forEach((e=>null==e?void 0:e.off()))}},this.state=new C({}),this.componentEventEmitter=new S,this.componentResourceManager=new W(this.model.id,this.services.eventEmitter,this.isStaticRenderMode),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new E(this._actionFactory,this.services.actionRegister),this.prevProps=this.model.props,this.prevEnvironment=this.getEnvironment(),this.documentModel.on(`COMPONENT_PROPS_UPDATE_${this.model.id}`,(e=>{this.model.props=e,this.observers.get(B).forEach((t=>t(this.prevProps,e))),this.prevProps=e;const t=this.getHostElement(),n=i("floating");e.floating&&!t.getAttribute(n)?t.setAttribute(n,"true"):!e.floating&&t.getAttribute(n)&&t.removeAttribute(n)})),this.documentModel.on(`COMPONENT_UPDATE_${this.model.id}`,(e=>{Object.assign(this.model,e)})),this.documentModel.on("SHARED_UPDATE_ALL",(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles),this.observers.get(V).forEach((e=>e(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new w(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),k),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 e=this.getEnvironment();this.observers.get(H).forEach((t=>t(this.prevEnvironment,e))),this.prevEnvironment=e})))},this.attachHandlers=()=>{this.getHandlers().map((e=>this._handlerFactory.get(e))).map((e=>()=>e.activate(this.state,this.componentEventEmitter,this.getHostElement.bind(this)))).forEach((e=>e()))},this.postponeHandlers=()=>{var e;null===(e=this.handlers)||void 0===e||e.forEach((e=>e.postpone()))},this.releaseHandlers=()=>{var e;null===(e=this.handlers)||void 0===e||e.forEach((e=>e.release()))},this.getProps=()=>{var e;return null===(e=this.getModel())||void 0===e?void 0:e.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=e=>{this.observers.get(B).push(e),e(null,this.prevProps)},this.observeShared=e=>{this.observers.get(V).push(e),e(this.getShared())},this.observeEnvironment=e=>{this.observers.get(H).push(e),e(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${i("element")}]`)).filter((e=>!e.hasAttribute(i("component"))))],this.getElement=(e,t)=>this.getElements().find((n=>t?n.getAttribute(i("element"))===e&&n.id===t:n.getAttribute(i("element"))===e)),this.applyAutoAdaptiveStyles=(e,t)=>{if(!e&&!t)return;const n=this.getElements();if(!n.length)return;const o=function(e,t){if(!t)return e||{desktop:[],mobile:[]};const n=JSON.parse(JSON.stringify(e||{desktop:[],mobile:[]}));return t.forEach((e=>{const t=e.element;let i=!1,o=!1;n.desktop&&n.desktop.forEach((n=>{n.element===t&&(K(n,e),i=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===t&&(K(n,e),o=!0)})),!i&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(e))),!o&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(e)))})),n}(e,t),s=i("type"),r="element-styles";let l=this.getRootElement().querySelector(`style[${s}="${r}"]`);l||(l=document.createElement("style"),l.setAttribute(s,r),this.getRootElement().appendChild(l)),Q({element:l,html:""}),n.forEach((e=>{let t=e.getAttribute(i("element"));const n=this.getEnvironment();let s=z(o,n,t);if(s){if(this.resizeListener.isMobile()){const e=z(o,"desktop",t);e&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},e.styleAttributes),s.styleAttributes)}))}this.applyStylesToElement(e,this.applySharedClassesToElementModel(s),l)}})),this._addLinkColor(l,this.getShared())},this.registerComponentResourceManagement=()=>{this.viewResourceManager.registerComponent(this.model.id,this.componentResourceManager)},this.applyStyles=(e,t={})=>{if(!e||!e.style)return!1;for(const[n,i]of Object.entries(t))e.style[n]=i;return!0},this.applyStylesToElement=(e,t,n)=>{var o,s;const r=[];"host"===(t=Y._resolveTogglableStylesForElementModel(t)).element&&(P.applyHostStyles(this.model.type,e,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(o=this.model.props.backgroundDynamicInlineSVGElements)||void 0===o?void 0:o.desktop)||"mobile"===this.getEnvironment()&&(null===(s=this.model.props.backgroundDynamicInlineSVGElements)||void 0===s?void 0:s.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),r.push("background")));let l=t.styleAttributes.background,a=l&&l.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&a){this.componentResourceManager.getPending().increment();const e=new Image;e.src=a[1],T(e,"load",(()=>{this.componentResourceManager.getPending().decrement()})),T(e,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(e.src),this.isUpdatingRenderMode&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},t),{styleAttributes:x(t.styleAttributes,r)});if(N.set(e,c),this._setClassAttributes(e,t),n){if(t.hoverStyleAttributes){let o=Object.assign({},t.hoverStyleAttributes);if("FILL_UP"===t.hoverAnimationType){e.style.boxShadow="inset 0px 0px 0px 0px rgb(0, 0, 0, 0)",e.style.overflow="hidden";const n=e.tagName.toLowerCase(),i=`flip-up-animation-${t.element}`;let s=this.getRootElement().querySelector(`#${i}`);s||(s=document.createElement("style"),s.id=i,e.appendChild(s)),Q({element:s,html:`\n ${n}::before {\n content: '';\n background: ${o.background};\n position: absolute;\n left: 0;\n top: ${e.getBoundingClientRect().height}px;\n height: ${e.getBoundingClientRect().height}px;\n width: 100%;\n z-index: -10;\n }\n ${n}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),o=Object.assign(Object.assign({},t.hoverStyleAttributes),{background:"transparent",position:"relative"})}o.borderTopWidth&&"0px"!==o.borderTopWidth||delete o.borderTopColor,o.borderBottomWidth&&"0px"!==o.borderBottomWidth||delete o.borderBottomColor,o.borderLeftWidth&&"0px"!==o.borderLeftWidth||delete o.borderLeftColor,o.borderRightWidth&&"0px"!==o.borderRightWidth||delete o.borderRightColor,this._addStylesToStyleElement(n,t.element,o,`:not(.${i("no-hover")}):hover`,!0)}t.placeholderStyleAttributes&&this._addStylesToStyleElement(n,t.element,t.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(n,this.getShared()),this.stylesAppliedToElement(e,t,n)}},this.applySharedClassesToElementModel=e=>function(e,n){let i=e;return(i.classes||"").split(" ").filter((e=>e.startsWith(t))).forEach((e=>{var t;let o=null===(t=n.textClasses)||void 0===t?void 0:t[e];o&&(o.styleAttributes.fontFamily||(o.isHeader&&n.headerFontFamily&&(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),{fontFamily:n.headerFontFamily})})),!o.isHeader&&n.textFontFamily&&(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),{fontFamily:n.textFontFamily})}))),i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),o.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},i.placeholderStyleAttributes),o.placeholderStyleAttributes)}))})),i.styleAttributes.fontFamily||(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),{fontFamily:n.textFontFamily})})),i}(e,this.documentModel.getShared()),this.getModel=()=>this.model,this._addStylesToStyleElement=(e,t,n,o="",s)=>{const r=Object.keys(n).reduce(((e,t)=>e+` ${M.camelCaseToDashCase(t)}: ${n[t]}${s?" !important;":";"}`),"");Q({element:e,html:`[${i("element")}="${t}"]${o} { ${r} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(e,t)=>{Q({element:e,html:`[cl-type] {font-family:${t.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(e,t)=>{var n,i,o,s;t.linkColor&&Q({element:e,html:`a {color: ${t.linkColor}}, a:visited {color: ${t.linkColor}}`,appendHtml:!0}),(null===(n=t.linkParams)||void 0===n?void 0:n.color)&&Q({element:e,html:`a {color: ${null===(i=t.linkParams)||void 0===i?void 0:i.color}}, a:visited {color: ${null===(o=t.linkParams)||void 0===o?void 0:o.color}}`,appendHtml:!0}),(null===(s=t.linkParams)||void 0===s?void 0:s.removeUnderline)&&Q({element:e,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(e,i)=>{Array.from(e.classList).filter((e=>e!==n("hovered")&&e!==n("focused"))).forEach((n=>{n.startsWith(t)&&e.classList.remove(n)}));const o=((e.getAttribute("class")||"")+" "+i.classes).trim();e.setAttribute("class",o)},this.getParentComponent=()=>$(this.parentNode,i("element"),"host"),this.getWidgetContainerNode=()=>{const e=null==this?void 0:this.getAttribute(i("path"));return e&&1===e.split(",").length?this.parentNode:$(this.parentNode,i("path"),void 0,(e=>e&&1===e.split(",").length))},this.getWidgetLanguages=()=>{return[(e=this.services.config).getConfig("appearanceLanguage"),e.getConfig("browserLanguage"),"en"].filter((e=>!!e));var e},this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=e=>function(e,t){return t.reduce(((t,n)=>{if(t)return t;const i=function(e,t){if(!e)return null;if(t[e])return{translations:t[e],language:e};const n=function(e){return e.includes("-")?e.split("-")[0].toLowerCase():e.includes("_")?e.split("_")[0].toLowerCase():e}(e);return t[n]?{translations:t[n],language:n}:null}(n,e);return i||null}),null)}(e,this.getWidgetLanguages()),this.stylesAppliedToElement=(e,t,n)=>{},this.updateContext=()=>{var e;const t=this.getModel();this.services.context.updateRecord(t.id,{label:this.getContextRecordLabel(t.props),viewIndex:null===(e=t.path)||void 0===e?void 0:e[0]})},this.addContextRecord=()=>{var e;const t=this.getModel();this.services.context.addRecord(t.id,{recordKey:t.id,id:t.props.control.name,label:this.getContextRecordLabel(t.props),value:t.props.control.defaultValue||"",viewIndex:null===(e=t.path)||void 0===e?void 0:e[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(t.props)}})},this.getContextRecordLabel=e=>{var t,n,i,o,s,r;const l=e.control.name;if(["email","first_name","last_name"].includes(l))return l.toUpperCase();if((null===(t=e.content)||void 0===t?void 0:t.label)&&(null===(o=null===(i=null===(n=e.adaptiveStyles)||void 0===n?void 0:n.desktop.find((e=>"label"===e.element)))||void 0===i?void 0:i.params)||void 0===o?void 0:o.enabled)){const t=(new DOMParser).parseFromString(e.content.label,"text/html");return this.capitalizeFirstLetter(t.body.textContent||"")}return(null===(s=e.content)||void 0===s?void 0:s.placeholder)?this.capitalizeFirstLetter(e.content.placeholder):(null===(r=e.control)||void 0===r?void 0:r.integrationName)?this.capitalizeFirstLetter(e.control.integrationName).replace(new RegExp("_","g")," "):void 0},this.capitalizeFirstLetter=e=>e.charAt(0).toUpperCase()+e.slice(1),this.getContextRecordExampleValue=e=>{var t;switch(null===(t=e.control)||void 0===t?void 0:t.name){case"email":return"myemail@example.com";case"first_name":return"Maria";case"last_name":return"Taylor";default:return this.getContextRecordLabel(e)}},this.completeSubmitAction=e=>{const t=e||{},n=this.services.actionRegister.getRegisteredActions().find((e=>e.category===G));n?null==n||n.execute(void 0,void 0,!0,t):this.services.actionFactory.get({type:u}).execute(void 0,void 0,!0,t)},this.getHandlers=()=>{var e;return(null===(e=this.getProps())||void 0===e?void 0:e.handlers)&&this.getProps().handlers.length?[...this.getProps().handlers]:[]},this.assets=(e="")=>`${this.services.config.getConfig("staticResourcesUrl").replace(/\/$/,"")}/${this.manifest.name}/assets${e?`/${e}`:""}`,this.attachShadow({mode:"open"}),this.manifest=this.manifest||(null===(e=this.define)||void 0===e?void 0:e.manifest)||(null===(o=this.constructor.define)||void 0===o?void 0:o.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then((()=>{this.attachHandlers()}))}disconnectedCallback(){var e;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(e=this.mergeTagsProcessor)||void 0===e||e.destroy()}get isStaticRenderMode(){return this.services.config.getConfig("renderMode")===Z}get isUpdatingRenderMode(){return this.services.config.getConfig("renderMode")===J}static _resolveTogglableStylesForElementModel(e){const t=Object.assign({},e);return Object.keys(t).forEach((e=>{e.toLowerCase().includes("styleattributes")&&(t[e]=Y._resolveTogglableStyles(t[e]))})),t}static _resolveTogglableStyles(e){const t=Object.assign({},e),n=(e,n,i)=>{n in t&&(e.forEach((e=>{e in t&&(t[e]=t[n]?t[e]:i)})),delete t[n])};return n(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),n(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),t}}function X(e){return X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},X(e)}function ee(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,le(i.key),i)}}function te(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(te=function(){return!!e})()}function ne(e,t,n,i){var o=ie(oe(1&i?e.prototype:e),t,n);return 2&i&&"function"==typeof o?function(e){return o.apply(n,e)}:o}function ie(){return ie="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=oe(e)););return e}(e,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},ie.apply(null,arguments)}function oe(e){return oe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},oe(e)}function se(e,t){return se=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},se(e,t)}function re(e,t,n){return(t=le(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function le(e){var t=function(e){if("object"!=X(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=X(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==X(t)?t:t+""}var ae=function(){function e(){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return re(t=function(e,t,n){return t=oe(t),function(e,t){if(t&&("object"==X(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,te()?Reflect.construct(t,n||[],oe(e).constructor):t.apply(e,n))}(this,e,[].concat(i)),"manifest",{name:"SysContainerComponent"}),re(t,"getComponentName",(function(){return t.manifest.name})),re(t,"processStyles",(function(){t.innerHTML+='\n <style>\n [cl-component="'.concat(t.getComponentName(),'"] {\n position: relative;\n min-width: 50px;\n min-height: 50px;\n }\n </style>')})),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&se(e,t)}(e,Y),t=e,(n=[{key:"connectedCallback",value:function(){var t=this;ne(e,"connectedCallback",this,3)([]),this.processStyles(),this.observeProps((function(e,n){t.applyAutoAdaptiveStyles(n.adaptiveStyles,n.styles)}))}},{key:"disconnectedCallback",value:function(){ne(e,"disconnectedCallback",this,3)([])}}])&&ee(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n}();function ce(e){return ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ce(e)}function pe(e,t){if(e){if("string"==typeof e)return de(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?de(e,t):void 0}}function de(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function ue(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,ve(i.key),i)}}function he(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(he=function(){return!!e})()}function me(e,t,n,i){var o=ye(ge(1&i?e.prototype:e),t,n);return 2&i&&"function"==typeof o?function(e){return o.apply(n,e)}:o}function ye(){return ye="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=ge(e)););return e}(e,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},ye.apply(null,arguments)}function ge(e){return ge=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ge(e)}function be(e,t){return be=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},be(e,t)}function fe(e,t,n){return(t=ve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ve(e){var t=function(e){if("object"!=ce(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ce(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ce(t)?t:t+""}var Ee=function(){function t(){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return fe(n=function(e,t,n){return t=ge(t),function(e,t){if(t&&("object"==ce(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,he()?Reflect.construct(t,n||[],ge(e).constructor):t.apply(e,n))}(this,t,[].concat(o)),"manifest",e),fe(n,"connectResizeObserver",(function(){n.resizeObserver=new ResizeObserver((function(e){var t,i=function(e){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=pe(e))){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,r=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return s=e.done,e},e:function(e){r=!0,o=e},f:function(){try{s||null==t.return||t.return()}finally{if(r)throw o}}}}(e);try{for(i.s();!(t=i.n()).done;)t.value.contentRect&&n.updateResponsiveRules(n.getResponsiveStyleElement())}catch(e){i.e(e)}finally{i.f()}})),n.resizeObserver.observe(n.getWidgetContainerNode())})),fe(n,"updateResponsiveRules",(function(e){if(n.getProps().isResponsive){var t=n.getWidgetContainerNode().getBoundingClientRect(),i=t.width,o=t.height;e.innerHTML='[cl-component="'.concat(n.getComponentName(),o/i>1.6?'"] {flex-direction: column !important;}':'"] {flex-direction: row !important;}')}else Q({element:e,html:""})})),fe(n,"getResponsiveStyleElement",(function(){return function(e){return function(e){if(Array.isArray(e))return de(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||pe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(n.children).find((function(e){return"responsive-styles"===e.getAttribute("name")}))})),fe(n,"appendResponsiveStyles",(function(){n.innerHTML+='<style name="responsive-styles">\n [cl-component="'.concat(n.getComponentName(),'"] {}\n </style>')})),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&be(e,t)}(t,ae),n=t,(i=[{key:"connectedCallback",value:function(){var e=this;me(t,"connectedCallback",this,3)([]),this.appendResponsiveStyles(),this.observeProps((function(t,n){n.isResponsive&&e.updateResponsiveRules(e.getResponsiveStyleElement())})),this.getProps().isResponsive&&this.connectResizeObserver()}},{key:"disconnectedCallback",value:function(){var e;me(t,"disconnectedCallback",this,3)([]),null===(e=this.resizeObserver)||void 0===e||e.disconnect()}}])&&ue(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}();fe(Ee,"define",{name:"sys-container",model:e.name,manifest:e});export{Ee as default};window.clComponentClass_SysContainerComponent=Ee;
|
|
1
|
+
const e={name:"SysContainerComponent",componentType:"CONTAINER",version:"1.0.0",contextMenuModel:[{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT",params:{hideForEntryType:"VIEW"}}],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:"CONTROL",name:"PARENT_ALIGNMENT",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"},{type:"CONTROL",name:"PARENT_ALIGNMENT",elementProp:"styleAttributes",element:"host"}]}],propertyPaneModel:{content:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"ALIGNMENT",elementProp:"styleAttributes",element:"host",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["fixed","fill","hug"]}},displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType !== 'CONTENT_LOCKER' : true",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"BACKGROUND",elementProp:"styleAttributes",element:"host",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'",syncSelectOptions:["SAME_TYPE_CROSS_ENV_WHILE_VALUES_MATCH",null]},{type:"CONTROL",name:"BACKDROP_FILTER",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0,displayCondition:"return sdk.component.type === 'VIEW' ? (sdk.appConfig.allowBackdropFilterOnView ?? true) : true",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=host]","styleAttributes"],displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType !== 'CONTENT_LOCKER' : true",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=host]","styleAttributes"],displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType !== 'CONTENT_LOCKER' : true",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=host]","styleAttributes"],displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType !== 'CONTENT_LOCKER' : true",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"PADDING"},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"},displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType === 'BUILT_IN' : true",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"SWITCH",propPath:["styles","[element=host]","styleAttributes","overflow"],params:{label:"DOCUMENT_OVERFLOW_TITLE",boldLabel:!0,description:"DOCUMENT_OVERFLOW_ENABLED_DESCRIPTION",getValueMapper:{undefined:!1,"":!1,visible:!1,hidden:!0},setValueMapper:{true:"hidden",false:"visible"}},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"ALIGNMENT",elementProp:"styleAttributes",element:"host",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["fixed","fill","hug"]}},displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType !== 'CONTENT_LOCKER' : true",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"BACKGROUND",elementProp:"styleAttributes",element:"host",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'",syncSelectOptions:["SAME_TYPE_CROSS_ENV_WHILE_VALUES_MATCH",null]},{type:"CONTROL",name:"BACKDROP_FILTER",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0,displayCondition:"return sdk.component.type === 'VIEW' ? (sdk.appConfig.allowBackdropFilterOnView ?? true) : true",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=host]","styleAttributes"],displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType !== 'CONTENT_LOCKER' : true",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=host]","styleAttributes"],displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType !== 'CONTENT_LOCKER' : true",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=host]","styleAttributes"],displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType !== 'CONTENT_LOCKER' : true",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"PADDING"},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"},displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType === 'BUILT_IN' : true",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"SWITCH",propPath:["styles","[element=host]","styleAttributes","overflow"],params:{label:"DOCUMENT_OVERFLOW_TITLE",boldLabel:!0,description:"DOCUMENT_OVERFLOW_ENABLED_DESCRIPTION",getValueMapper:{undefined:!1,"":!1,visible:!1,hidden:!0},setValueMapper:{true:"hidden",false:"visible"}},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"}]}],general:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!0},displayCondition:"return sdk.widgetType !== 'TEASER'"}]},events:{dispatch:[],listen:[]},i18nPropertyPaneModel:{content:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!1},displayCondition:"return sdk.widgetType !== 'TEASER'"}]},i18nPropPaths:["handlers,[id],actions,[id],params,link","handlers,[id],actions,[id],params,customData"],props:{styles:[{element:"host",styleAttributes:{overflow:"visible",borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"0px",borderTopColor:"rgb(0, 0, 0)",borderBottomWidth:"0px",borderBottomColor:"rgb(0, 0, 0)",borderLeftWidth:"0px",borderLeftColor:"rgb(0, 0, 0)",borderRightWidth:"0px",borderRightColor:"rgb(0, 0, 0)",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none"},classes:""}],adaptiveStyles:{desktop:[{element:"host",styleAttributes:{position:"relative",width:"100%",minWidth:"min-content",height:"auto",minHeight:null,flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"10px",paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",_paddingEnabled:!0,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1,background:"rgba(0, 0, 0, 0.06)"},classes:""}],mobile:[{element:"host",styleAttributes:{position:"relative",width:"100%",minWidth:"min-content",height:"auto",minHeight:null,flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"10px",paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",_paddingEnabled:!0,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1,background:"rgba(0, 0, 0, 0.06)"},classes:""}]}},metaDescription:{icon:"/SysContainerComponent/assets/img/container-component-icon.svg",label:{en:"Container",ru:"Контейнер",uk:"Контейнер",es:"Envase",fr:"Récipient",de:"Container",it:"Contenitore",pt:"Embalagem",ro:"Container",bg:"Контейнер",cs:"Kontejner",el:"Περιέκτης",nl:"Container",pl:"Kontener",sv:"Behållare",tr:"Konteyner",ar:"الحاوية",zh:"容器",da:"Beholder",he:"קונטיינר",fi:"Säiliö",hi:"कंटेनर",hr:"Kontejner",hu:"Tárhely",id:"Kontainer",ja:"コンテナ",ko:"컨테이너",no:"Container",sk:"Krabica",sl:"Rezervoar",sr:"Kontejner"}},waitForResourcesLoad:!0,resourcesPropPaths:[["adaptiveStyles",":ENV","styleAttributes","background"]]},t="cl-";function n(e){return t+e}function i(e){return"cl-"+e}const o="VIEW",s="MODULE",r="CONTAINER",l="INPUT",a="BUTTON",c="CONSENT",p="COLUMN",d="SUBSCRIBE_CONTACT",u="REQUEST",h="SHOW_WIDGET",m="OPEN_LINK",y="CLOSE_WIDGET";class g{static sortActions(e){const t={[y]:-1,[m]:-2,[h]:1,[d]:2,[u]:3},n=e=>void 0!==t[e.type]?t[e.type]:0;return[...e].sort(((e,t)=>n(e)>n(t)?-1:n(e)<n(t)?1:0))}constructor(e,t){this.config=e,this.actions=g.sortActions(t),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(e,t,n){this.state=e;const o=n(),s=o.getAttribute(i("id"));this.listener=e=>{const t=e.composedPath().filter((e=>e instanceof HTMLElement&&e.getAttribute(i("type"))));let n=0;for(;t[n]&&t[n].getAttribute(i("id"))!==s;){let e=t[n].getAttribute(i("type"));if(g.IGNORING_VIEW_ENTRY_TYPES.includes(e))return;n++}this.eventsQueue.push({event:e}),this.postponed||this.execute()},this.targetElements=this.config.relativeSelector?Array.from((o.shadowRoot||o).querySelectorAll(this.config.relativeSelector)):[o],this.targetElements.forEach((e=>{e.addEventListener("click",this.listener)}))}async execute(){var e,t,n,i;try{for(var o,s=!0,r=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(n){t[n]=e[n]&&function(t){return new Promise((function(i,o){!function(e,t,n,i){Promise.resolve(i).then((function(t){e({value:t,done:n})}),t)}(i,o,(t=e[n](t)).done,t.value)}))}}}(this.eventsQueue);!(e=(o=await r.next()).done);){i=o.value,s=!1;try{const{event:e}=i;for(const t of this.actions)if(!await t.execute(this.state.getState(),e))break}finally{s=!0}}}catch(e){t={error:e}}finally{try{s||e||!(n=r.return)||await n.call(r)}finally{if(t)throw t.error}}this.eventsQueue=[]}postpone(){this.postponed=!0}release(){this.postponed=!1,this.execute()}destroy(){this.listener&&this.targetElements.length&&(this.targetElements.forEach((e=>{e.removeEventListener("click",this.listener)})),this.targetElements=[])}}g.IGNORING_VIEW_ENTRY_TYPES=[a,c,l];const b="CLICK",f="COMPONENT_EVENT";class v{constructor(e,t){this.config=e,this.actions=t,this.componentEmitterListener=null}activate(e,t,n){this.componentEmitterListener=t.on(this.config.eventName,(()=>{this.actions.forEach((t=>t.execute(e.getState(),this.config.params)))}))}destroy(){this.componentEmitterListener&&this.componentEmitterListener.off()}}class E{constructor(e,t){this.actionFactory=e,this.actionRegister=t}get(e){const t=e.actions.map((e=>this.actionFactory.get(e)));switch(t.forEach((e=>this.actionRegister.register(e))),e.type){case b:return new g(e,t);case f:return new v(e,t);default:throw new Error(`Not supported handler type ${e.type}`)}}}class O{static generate(){let e,t="";for(let n=0;n<32;n++)8!==n&&12!==n&&16!==n&&20!==n||(t+="-"),e=Math.floor(16*Math.random()).toString(16).toUpperCase(),t+=e;return t}}class T{constructor(){this.listeners=T.createDefaultListenersState()}emit(e,t,n=null){const i=this.listeners[e];i&&Object.values(i).forEach((i=>i(t,e,n))),Object.values(this.listeners["*"]).forEach((i=>i(t,e,n)))}on(e,t){const n=O.generate(),i=this.listeners[e];return i?i[n]=t:this.listeners[e]={[n]:t},{off:()=>{var t,i;(null===(i=null===(t=this.listeners)||void 0===t?void 0:t[e])||void 0===i?void 0:i[n])&&delete this.listeners[e][n]}}}destroy(){this.listeners=T.createDefaultListenersState()}}T.createDefaultListenersState=()=>({"*":{}});const S=(e,t,n,i)=>{const o=EventTarget.prototype,{addEventListenerBase:s,addEventListener:r}=o;(s||r).call(e,t,n,i)};class C{constructor(e){this.state=e||{}}getState(){return this.state}setState(e){this.state=Object.assign(Object.assign({},this.state),e)}destroy(){}}class R{static extract(e){const t=e.views.map((e=>{const t=e.children.map((e=>e.type===s?Object.assign(Object.assign({},e),R.moduleToContainerParams):e));return Object.assign(Object.assign({},e),{children:t})}));return Object.assign(Object.assign({},e),{views:t})}static sort(e,t){return e.index>t.index?1:-1}static reIndex(e,t){return Object.assign(Object.assign({},e),{index:t+e.index})}}R.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"};class A extends T{constructor(e,t){super(),this.config=t,this.handleMobileBreakpoint(e.getShared().mobileBreakpointWidth),e.on("ENVIRONMENT_UPDATE",(({isMobileEnv:e})=>{this._isMobile=e,this.emit(A.changeEventName,this._isMobile)}))}handleMobileBreakpoint(e){this.mobileBreakpointWidth=e;const t=Number.isInteger(this.mobileBreakpointWidth)?`${this.mobileBreakpointWidth}px`:this.mobileBreakpointWidth;this.mediaQueryList=window.matchMedia(`(max-width: ${t})`),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(e){this._isMobile=e.matches,this.emit(A.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}A.changeEventName="CHANGE";class N{static set(e,t){const n=e[N.accumulatorPropertyName]||{};e[N.accumulatorPropertyName]=Object.assign(Object.assign({},n),t.styleAttributes),Object.keys(e[N.accumulatorPropertyName]).forEach((n=>{n.includes("--")?e.style.setProperty(n,t.styleAttributes[n]||""):e.style[n]=t.styleAttributes[n]?t.styleAttributes[n]:""}))}}N.accumulatorPropertyName="clStyleAttributes";const L="CONTENT_LOCKER";class P{static applyHostStyles(e,t,n=null,i){var s,l,a;const c=null===(l=null===(s=null==n?void 0:n.props)||void 0===s?void 0:s.handlers)||void 0===l?void 0:l.find((e=>"CLICK"===e.type));c&&(null===(a=c.actions)||void 0===a?void 0:a.length)&&(t.style.cursor="pointer"),e!==o&&e!==r&&e!==p||(t.style.display=i===L&&e===o?"flex":"inline-flex",t.style.position="relative"),t.style.boxSizing="border-box"}constructor(){this.styles="/* common styles */ *, *:before, *:after { box-sizing: border-box; font-family: inherit; }"}setStyles(e=""){this.styles=`${this.styles} ${e}`}getStyles(){return this.styles}}class _{static log(e){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(e)):console.error(e)}}var w,k,I,M,x,j,D;(w||(w={})).ACCENT="accent",(I=k||(k={})).TOP="TOP",I.CENTER="CENTER",I.BOTTOM="BOTTOM",function(e){e.LEFT="LEFT",e.CENTER="CENTER",e.RIGHT="RIGHT"}(M||(M={})),function(e){e.SLIDE_TO_TOP="SLIDE_TO_TOP",e.SLIDE_TO_BOTTOM="SLIDE_TO_BOTTOM",e.SLIDE_TO_LEFT="SLIDE_TO_LEFT",e.SLIDE_TO_RIGHT="SLIDE_TO_RIGHT"}(x||(x={})),function(e){e.PULSE="PULSE",e.VIBRATE="VIBRATE",e.WOBBLE="WOBBLE",e.SHAKE="SHAKE",e.JELLO="JELLO",e.BOUNCE="BOUNCE",e.BLINK="BLINK",e.FLICKER="FLICKER",e.PING="PING"}(j||(j={})),function(e){e.LEFT="LEFT",e.RIGHT="RIGHT"}(D||(D={}));class B{constructor(e,t,n,i,o,s){this.hostElement=t,this.documentModel=e,this.getSharedCb=n,this.getPropsCb=i,this.getEnvCb=o,this.httpClient=s,this.subscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(e){const t=String(e||"");if(t.includes("url")){const[e,n]=t.split("(")[1].split(")");return{url:e.replace(/['"]+/g,""),positionOptions:n.replace(";","")}}return{url:null,positionOptions:null}}apply(e){const t=this.getPropsCb();return t.backgroundDynamicInlineSVGElements[e].forEach((n=>{var i,o,s,r,l;const a=null===(o=null===(i=t.adaptiveStyles)||void 0===i?void 0:i[e])||void 0===o?void 0:o.find((e=>e.element===n)),c=(null===(s=t.styles)||void 0===s?void 0:s.find((e=>e.element===n)))||{},p=(null===(r=null==c?void 0:c.styleAttributes)||void 0===r?void 0:r.background)||(null===(l=null==a?void 0:a.styleAttributes)||void 0===l?void 0:l.background),d=this.parseBackground(p);d.url&&this.envUrlMaps[e].set(n,{originalSVGResourceURL:d.url,inlineSvgString:null,positionOptions:d.positionOptions})})),Promise.all([...this.envUrlMaps[e].entries()].map((([t,n])=>this.httpClient.execute(n.originalSVGResourceURL).then((e=>e.text())).then((i=>{this.envUrlMaps[e].set(t,Object.assign(Object.assign({},n),{inlineSvgString:i}))}))))).then((()=>{var t;this._applyHostElementBackground(this.envUrlMaps[e].get("host"),null===(t=this.getSharedCb().theme)||void 0===t?void 0:t.schema)})).catch((e=>{console.error(e),_.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${e}`)}))}on(){return this.subscription=this.documentModel.on("THEME_UPDATE",(e=>{this._applyHostElementBackground(this.envUrlMaps[this.getEnvCb()].get("host"),e.schema)})),this}_applyHostElementBackground(e,t){e&&t&&(this.hostElement.style.background=this._buildBackgroundUrl(e,t))}_buildBackgroundUrl(e,t){const n=e.inlineSvgString.trim().replace(`var(--cl-schema-${w.ACCENT})`,t[w.ACCENT]);return`url('data:image/svg+xml,${encodeURIComponent(n)}')${e.positionOptions}`}off(){var e;null===(e=this.subscription)||void 0===e||e.off()}}const F=new class{execute(e,t="GET",n=null,i,o){const s={method:t,headers:Object.assign({"Content-Type":"text/plain"},i||{}),credentials:"same-origin",body:null,signal:o};return n&&(s.body="string"==typeof n?n:JSON.stringify(n)),fetch(e,s)}};function W(e,t){return Object.keys(e).filter((e=>!t.includes(e))).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:e[n]})),{})}class U{static camelCaseToDashCase(e){return e.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase()))}static camelCaseToUpperSnakeCase(e){return e.replace(/[A-Z]/g,(e=>"_"+e)).toUpperCase()}}class H{constructor(e){this._count=0,this.onUpdateCb=e}increment(){this._count++,this.onUpdateCb(this.count())}decrement(){this._count>0&&this._count--,this.onUpdateCb(this.count())}count(){return this._count}}const V="COMPONENT_RESOURCES_LOADED",G="FAILED_TO_LOAD_COMPONENT_RESOURCE";class ${constructor(e,t,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=e=>{0===e&&this.systemEventEmitter.emit(V,this.componentId)},this.onResourceLoadFailure=e=>{this.isStaticEntryModule?this.systemEventEmitter.emit(G,`Failed to load: ${e}`):this.counters.pending.decrement()},this.componentId=e,this.systemEventEmitter=t,this.isStaticEntryModule=n,this.counters={pending:new H(this.onCounterStateUpdate)}}}const K=(...e)=>{let t=e.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:[]})),{});return{get:e=>t[e],clear:()=>K(...e)}},z=K,J="props",Q="shared",q="environment";function Z(e,t,n,i){const o=e=>{let s=e instanceof DocumentFragment||(null==e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?e.host:e;return s&&(i&&"function"==typeof i?i(s.getAttribute(t)):(null===(r=null==s?void 0:s.getAttribute)||void 0===r?void 0:r.call(s,t))===n)?s:s&&s.parentNode&&o(s.parentNode)||null;var r};return o(e)}const Y="SUBMIT";function X(e,t){return t?(e.classes=`${e.classes||""} ${t.classes||""}`.trim(),Object.keys(t).forEach((n=>{if("element"===n||"classes"===n)return;const i=t[n];i&&"object"==typeof i&&!Array.isArray(i)?e[n]=Object.assign(Object.assign({},e[n]||{}),i):e[n]=i})),e):e}function ee(e,t,n){var i;return null===(i=null==e?void 0:e[t])||void 0===i?void 0:i.find((e=>e.element===n))}function te(e){const{element:t,html:n,appendHtml:i}=e,o=function(e){if(null==e)return"";if("string"!=typeof e)return String(e);if(""===e)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(e))return e;const t=(new DOMParser).parseFromString(e,"text/html");return t.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach((e=>e.remove())),t.querySelectorAll("*").forEach((e=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach((t=>e.removeAttribute(t))),Array.from(e.attributes).forEach((t=>{t.name.startsWith("on")&&e.removeAttribute(t.name)})),"A"===e.tagName||"AREA"===e.tagName){const t=e.getAttribute("href");t&&(t.startsWith("javascript:")||t.startsWith("data:"))&&e.removeAttribute("href")}if("IMG"===e.tagName||"IFRAME"===e.tagName){const t=e.getAttribute("src");t&&(t.startsWith("javascript:")||t.startsWith("data:text/html"))&&e.removeAttribute("src")}if("FORM"===e.tagName){const t=e.getAttribute("action");t&&t.startsWith("javascript:")&&e.removeAttribute("action")}})),t.body.innerHTML}(n);i?t.innerHTML+=o:t.innerHTML=o}class ne extends Event{constructor(e,t,n){super(e,n),this.detail={},Object.defineProperty(this,"detail",{value:t})}}const ie="STATIC",oe="UPDATING";class se extends HTMLElement{constructor(){var e,o;super(),this.construct=()=>{let e;const t=this.getAttribute(i("id")),n=this.getWidgetContainerNode();if(!n)throw new Error("Widget container not found in construct");const o=n.closest(`[${i("widget-id")}]`);let s;o&&(s=o.getAttribute(i("widget-id")));let r=new ne("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(i("path")),id:t,widgetId:s},{bubbles:!0,composed:!0});this.dispatchEvent(r),e=r.detail.props,Object.assign(this,e),this.observers=z(J,Q,q),this.subscriptions=new class{constructor(){this.subscriptions=[]}push(e){this.subscriptions.push(e)}off(){this.subscriptions.forEach((e=>null==e?void 0:e.off()))}},this.state=new C({}),this.componentEventEmitter=new T,this.componentResourceManager=new $(this.model.id,this.services.eventEmitter,this.isStaticRenderMode),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new E(this._actionFactory,this.services.actionRegister),this.prevProps=this.model.props,this.prevEnvironment=this.getEnvironment(),this.documentModel.on(`COMPONENT_PROPS_UPDATE_${this.model.id}`,(e=>{this.model.props=e,this.observers.get(J).forEach((t=>t(this.prevProps,e))),this.prevProps=e;const t=this.getHostElement(),n=i("floating");e.floating&&!t.getAttribute(n)?t.setAttribute(n,"true"):!e.floating&&t.getAttribute(n)&&t.removeAttribute(n)})),this.documentModel.on(`COMPONENT_UPDATE_${this.model.id}`,(e=>{Object.assign(this.model,e)})),this.documentModel.on("SHARED_UPDATE_ALL",(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles),this.observers.get(Q).forEach((e=>e(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new B(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),F),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 e=this.getEnvironment();this.observers.get(q).forEach((t=>t(this.prevEnvironment,e))),this.prevEnvironment=e})))},this.attachHandlers=()=>{this.getHandlers().map((e=>this._handlerFactory.get(e))).map((e=>()=>e.activate(this.state,this.componentEventEmitter,this.getHostElement.bind(this)))).forEach((e=>e()))},this.postponeHandlers=()=>{var e;null===(e=this.handlers)||void 0===e||e.forEach((e=>e.postpone()))},this.releaseHandlers=()=>{var e;null===(e=this.handlers)||void 0===e||e.forEach((e=>e.release()))},this.getProps=()=>{var e;return null===(e=this.getModel())||void 0===e?void 0:e.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=e=>{this.observers.get(J).push(e),e(null,this.prevProps)},this.observeShared=e=>{this.observers.get(Q).push(e),e(this.getShared())},this.observeEnvironment=e=>{this.observers.get(q).push(e),e(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${i("element")}]`)).filter((e=>!e.hasAttribute(i("component"))))],this.getElement=(e,t)=>this.getElements().find((n=>t?n.getAttribute(i("element"))===e&&n.id===t:n.getAttribute(i("element"))===e)),this.applyAutoAdaptiveStyles=(e,t)=>{if(!e&&!t)return;const n=this.getElements();if(!n.length)return;const o=function(e,t){if(!t)return e||{desktop:[],mobile:[]};const n=JSON.parse(JSON.stringify(e||{desktop:[],mobile:[]}));return t.forEach((e=>{const t=e.element;let i=!1,o=!1;n.desktop&&n.desktop.forEach((n=>{n.element===t&&(X(n,e),i=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===t&&(X(n,e),o=!0)})),!i&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(e))),!o&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(e)))})),n}(e,t),s=i("type"),r="element-styles";let l=this.getRootElement().querySelector(`style[${s}="${r}"]`);l||(l=document.createElement("style"),l.setAttribute(s,r),this.getRootElement().appendChild(l)),te({element:l,html:""}),n.forEach((e=>{let t=e.getAttribute(i("element"));const n=this.getEnvironment();let s=ee(o,n,t);if(s){if(this.resizeListener.isMobile()){const e=ee(o,"desktop",t);e&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},e.styleAttributes),s.styleAttributes)}))}this.applyStylesToElement(e,this.applySharedClassesToElementModel(s),l)}})),this._addLinkColor(l,this.getShared())},this.registerComponentResourceManagement=()=>{this.viewResourceManager.registerComponent(this.model.id,this.componentResourceManager)},this.applyStyles=(e,t={})=>{if(!e||!e.style)return!1;for(const[n,i]of Object.entries(t))e.style[n]=i;return!0},this.applyStylesToElement=(e,t,n)=>{var o,s;const r=[];"host"===(t=se._resolveTogglableStylesForElementModel(t)).element&&(P.applyHostStyles(this.model.type,e,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(o=this.model.props.backgroundDynamicInlineSVGElements)||void 0===o?void 0:o.desktop)||"mobile"===this.getEnvironment()&&(null===(s=this.model.props.backgroundDynamicInlineSVGElements)||void 0===s?void 0:s.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),r.push("background")));let l=t.styleAttributes.background,a=l&&l.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&a){this.componentResourceManager.getPending().increment();const e=new Image;e.src=a[1],S(e,"load",(()=>{this.componentResourceManager.getPending().decrement()})),S(e,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(e.src),this.isUpdatingRenderMode&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},t),{styleAttributes:W(t.styleAttributes,r)});if(N.set(e,c),this._setClassAttributes(e,t),n){if(t.hoverStyleAttributes){let o=Object.assign({},t.hoverStyleAttributes);if("FILL_UP"===t.hoverAnimationType){e.style.boxShadow="inset 0px 0px 0px 0px rgb(0, 0, 0, 0)",e.style.overflow="hidden";const n=e.tagName.toLowerCase(),i=`flip-up-animation-${t.element}`;let s=this.getRootElement().querySelector(`#${i}`);s||(s=document.createElement("style"),s.id=i,e.appendChild(s)),te({element:s,html:`\n ${n}::before {\n content: '';\n background: ${o.background};\n position: absolute;\n left: 0;\n top: ${e.getBoundingClientRect().height}px;\n height: ${e.getBoundingClientRect().height}px;\n width: 100%;\n z-index: -10;\n }\n ${n}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),o=Object.assign(Object.assign({},t.hoverStyleAttributes),{background:"transparent",position:"relative"})}o.borderTopWidth&&"0px"!==o.borderTopWidth||delete o.borderTopColor,o.borderBottomWidth&&"0px"!==o.borderBottomWidth||delete o.borderBottomColor,o.borderLeftWidth&&"0px"!==o.borderLeftWidth||delete o.borderLeftColor,o.borderRightWidth&&"0px"!==o.borderRightWidth||delete o.borderRightColor,this._addStylesToStyleElement(n,t.element,o,`:not(.${i("no-hover")}):hover`,!0)}t.placeholderStyleAttributes&&this._addStylesToStyleElement(n,t.element,t.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(n,this.getShared()),this.stylesAppliedToElement(e,t,n)}},this.applySharedClassesToElementModel=e=>function(e,n){let i=e;return(i.classes||"").split(" ").filter((e=>e.startsWith(t))).forEach((e=>{var t;let o=null===(t=n.textClasses)||void 0===t?void 0:t[e];o&&(o.styleAttributes.fontFamily||(o.isHeader&&n.headerFontFamily&&(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),{fontFamily:n.headerFontFamily})})),!o.isHeader&&n.textFontFamily&&(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),{fontFamily:n.textFontFamily})}))),i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),o.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},i.placeholderStyleAttributes),o.placeholderStyleAttributes)}))})),i.styleAttributes.fontFamily||(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),{fontFamily:n.textFontFamily})})),i}(e,this.documentModel.getShared()),this.getModel=()=>this.model,this._addStylesToStyleElement=(e,t,n,o="",s)=>{const r=Object.keys(n).reduce(((e,t)=>e+` ${U.camelCaseToDashCase(t)}: ${n[t]}${s?" !important;":";"}`),"");te({element:e,html:`[${i("element")}="${t}"]${o} { ${r} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(e,t)=>{te({element:e,html:`[cl-type] {font-family:${t.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(e,t)=>{var n,i,o,s;t.linkColor&&te({element:e,html:`a {color: ${t.linkColor}}, a:visited {color: ${t.linkColor}}`,appendHtml:!0}),(null===(n=t.linkParams)||void 0===n?void 0:n.color)&&te({element:e,html:`a {color: ${null===(i=t.linkParams)||void 0===i?void 0:i.color}}, a:visited {color: ${null===(o=t.linkParams)||void 0===o?void 0:o.color}}`,appendHtml:!0}),(null===(s=t.linkParams)||void 0===s?void 0:s.removeUnderline)&&te({element:e,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(e,i)=>{Array.from(e.classList).filter((e=>e!==n("hovered")&&e!==n("focused"))).forEach((n=>{n.startsWith(t)&&e.classList.remove(n)}));const o=((e.getAttribute("class")||"")+" "+i.classes).trim();e.setAttribute("class",o)},this.getParentComponent=()=>Z(this.parentNode,i("element"),"host"),this.getWidgetContainerNode=()=>{const e=null==this?void 0:this.getAttribute(i("path"));return e&&1===e.split(",").length?this.parentNode:Z(this.parentNode,i("path"),void 0,(e=>e&&1===e.split(",").length))},this.getWidgetLanguages=()=>{return[(e=this.services.config).getConfig("appearanceLanguage"),e.getConfig("browserLanguage"),"en"].filter((e=>!!e));var e},this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=e=>function(e,t){return t.reduce(((t,n)=>{if(t)return t;const i=function(e,t){if(!e)return null;if(t[e])return{translations:t[e],language:e};const n=function(e){return e.includes("-")?e.split("-")[0].toLowerCase():e.includes("_")?e.split("_")[0].toLowerCase():e}(e);return t[n]?{translations:t[n],language:n}:null}(n,e);return i||null}),null)}(e,this.getWidgetLanguages()),this.stylesAppliedToElement=(e,t,n)=>{},this.updateContext=()=>{var e;const t=this.getModel();this.services.context.updateRecord(t.id,{label:this.getContextRecordLabel(t.props),viewIndex:null===(e=t.path)||void 0===e?void 0:e[0]})},this.addContextRecord=()=>{var e;const t=this.getModel();this.services.context.addRecord(t.id,{recordKey:t.id,id:t.props.control.name,label:this.getContextRecordLabel(t.props),value:t.props.control.defaultValue||"",viewIndex:null===(e=t.path)||void 0===e?void 0:e[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(t.props)}})},this.getContextRecordLabel=e=>{var t,n,i,o,s,r;const l=e.control.name;if(["email","first_name","last_name"].includes(l))return l.toUpperCase();if((null===(t=e.content)||void 0===t?void 0:t.label)&&(null===(o=null===(i=null===(n=e.adaptiveStyles)||void 0===n?void 0:n.desktop.find((e=>"label"===e.element)))||void 0===i?void 0:i.params)||void 0===o?void 0:o.enabled)){const t=(new DOMParser).parseFromString(e.content.label,"text/html");return this.capitalizeFirstLetter(t.body.textContent||"")}return(null===(s=e.content)||void 0===s?void 0:s.placeholder)?this.capitalizeFirstLetter(e.content.placeholder):(null===(r=e.control)||void 0===r?void 0:r.integrationName)?this.capitalizeFirstLetter(e.control.integrationName).replace(new RegExp("_","g")," "):void 0},this.capitalizeFirstLetter=e=>e.charAt(0).toUpperCase()+e.slice(1),this.getContextRecordExampleValue=e=>{var t;switch(null===(t=e.control)||void 0===t?void 0:t.name){case"email":return"myemail@example.com";case"first_name":return"Maria";case"last_name":return"Taylor";default:return this.getContextRecordLabel(e)}},this.completeSubmitAction=e=>{const t=e||{},n=this.services.actionRegister.getRegisteredActions().find((e=>e.category===Y));n?null==n||n.execute(void 0,void 0,!0,t):this.services.actionFactory.get({type:u}).execute(void 0,void 0,!0,t)},this.getHandlers=()=>{var e;return(null===(e=this.getProps())||void 0===e?void 0:e.handlers)&&this.getProps().handlers.length?[...this.getProps().handlers]:[]},this.assets=(e="")=>`${this.services.config.getConfig("staticResourcesUrl").replace(/\/$/,"")}/${this.manifest.name}/assets${e?`/${e}`:""}`,this.attachShadow({mode:"open"}),this.manifest=this.manifest||(null===(e=this.define)||void 0===e?void 0:e.manifest)||(null===(o=this.constructor.define)||void 0===o?void 0:o.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then((()=>{this.attachHandlers()}))}disconnectedCallback(){var e;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(e=this.mergeTagsProcessor)||void 0===e||e.destroy()}get isStaticRenderMode(){return this.services.config.getConfig("renderMode")===ie}get isUpdatingRenderMode(){return this.services.config.getConfig("renderMode")===oe}static _resolveTogglableStylesForElementModel(e){const t=Object.assign({},e);return Object.keys(t).forEach((e=>{e.toLowerCase().includes("styleattributes")&&(t[e]=se._resolveTogglableStyles(t[e]))})),t}static _resolveTogglableStyles(e){const t=Object.assign({},e),n=(e,n,i)=>{n in t&&(e.forEach((e=>{e in t&&(t[e]=t[n]?t[e]:i)})),delete t[n])};return n(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),n(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),t}}function re(e){return re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},re(e)}function le(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,me(i.key),i)}}function ae(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ae=function(){return!!e})()}function ce(e,t,n,i){var o=pe(de(1&i?e.prototype:e),t,n);return 2&i&&"function"==typeof o?function(e){return o.apply(n,e)}:o}function pe(){return pe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=de(e)););return e}(e,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},pe.apply(null,arguments)}function de(e){return de=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},de(e)}function ue(e,t){return ue=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ue(e,t)}function he(e,t,n){return(t=me(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function me(e){var t=function(e){if("object"!=re(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=re(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==re(t)?t:t+""}var ye=function(){function e(){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return he(t=function(e,t,n){return t=de(t),function(e,t){if(t&&("object"==re(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ae()?Reflect.construct(t,n||[],de(e).constructor):t.apply(e,n))}(this,e,[].concat(i)),"manifest",{name:"SysContainerComponent"}),he(t,"getComponentName",(function(){return t.manifest.name})),he(t,"processStyles",(function(){t.innerHTML+='\n <style>\n [cl-component="'.concat(t.getComponentName(),'"] {\n position: relative;\n min-width: 50px;\n min-height: 50px;\n }\n </style>')})),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ue(e,t)}(e,se),t=e,(n=[{key:"connectedCallback",value:function(){var t=this;ce(e,"connectedCallback",this,3)([]),this.processStyles(),this.observeProps((function(e,n){t.applyAutoAdaptiveStyles(n.adaptiveStyles,n.styles)}))}},{key:"disconnectedCallback",value:function(){ce(e,"disconnectedCallback",this,3)([])}}])&&le(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n}();function ge(e){return ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ge(e)}function be(e,t){if(e){if("string"==typeof e)return fe(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fe(e,t):void 0}}function fe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function ve(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,Ae(i.key),i)}}function Ee(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ee=function(){return!!e})()}function Oe(e,t,n,i){var o=Te(Se(1&i?e.prototype:e),t,n);return 2&i&&"function"==typeof o?function(e){return o.apply(n,e)}:o}function Te(){return Te="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Se(e)););return e}(e,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},Te.apply(null,arguments)}function Se(e){return Se=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Se(e)}function Ce(e,t){return Ce=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ce(e,t)}function Re(e,t,n){return(t=Ae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ae(e){var t=function(e){if("object"!=ge(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ge(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ge(t)?t:t+""}var Ne=function(){function t(){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return Re(n=function(e,t,n){return t=Se(t),function(e,t){if(t&&("object"==ge(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ee()?Reflect.construct(t,n||[],Se(e).constructor):t.apply(e,n))}(this,t,[].concat(o)),"manifest",e),Re(n,"connectResizeObserver",(function(){n.resizeObserver=new ResizeObserver((function(e){var t,i=function(e){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=be(e))){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,r=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return s=e.done,e},e:function(e){r=!0,o=e},f:function(){try{s||null==t.return||t.return()}finally{if(r)throw o}}}}(e);try{for(i.s();!(t=i.n()).done;)t.value.contentRect&&n.updateResponsiveRules(n.getResponsiveStyleElement())}catch(e){i.e(e)}finally{i.f()}})),n.resizeObserver.observe(n.getWidgetContainerNode())})),Re(n,"updateResponsiveRules",(function(e){if(n.getProps().isResponsive){var t=n.getWidgetContainerNode().getBoundingClientRect(),i=t.width,o=t.height;e.innerHTML='[cl-component="'.concat(n.getComponentName(),o/i>1.6?'"] {flex-direction: column !important;}':'"] {flex-direction: row !important;}')}else te({element:e,html:""})})),Re(n,"getResponsiveStyleElement",(function(){return function(e){return function(e){if(Array.isArray(e))return fe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||be(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(n.children).find((function(e){return"responsive-styles"===e.getAttribute("name")}))})),Re(n,"appendResponsiveStyles",(function(){n.innerHTML+='<style name="responsive-styles">\n [cl-component="'.concat(n.getComponentName(),'"] {}\n </style>')})),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ce(e,t)}(t,ye),n=t,(i=[{key:"connectedCallback",value:function(){var e=this;Oe(t,"connectedCallback",this,3)([]),this.appendResponsiveStyles(),this.observeProps((function(t,n){n.isResponsive&&e.updateResponsiveRules(e.getResponsiveStyleElement())})),this.getProps().isResponsive&&this.connectResizeObserver()}},{key:"disconnectedCallback",value:function(){var e;Oe(t,"disconnectedCallback",this,3)([]),null===(e=this.resizeObserver)||void 0===e||e.disconnect()}}])&&ve(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}();Re(Ne,"define",{name:"sys-container",model:e.name,manifest:e});export{Ne as default};window.clComponentClass_SysContainerComponent=Ne;
|