@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.
@@ -1 +1 @@
1
- const e="validationStatusChanged",t="touchedStatusChanged",n="cl-";function o(e){return n+e}function i(e){return"cl-"+e}class r{static size(e){return{width:this.width(e),height:this.height(e)}}static width(e){return e=e||document,Math.max(e.documentElement.clientWidth,e.defaultView.innerWidth||0)}static height(e){return e=e||document,Math.max(e.documentElement.clientHeight,e.defaultView.innerHeight||0)}static scrollbarWidth(e){return(e=e||document).defaultView.innerWidth-e.documentElement.clientWidth}}var s=[];for(var l in{transparent:"#0000"})s.push(l);var a="\\s*([.\\d%]+)\\s*",c="\\("+[a,a,a]+"(?:,\\s*([.\\d]+)\\s*)?\\)",d="(?:rgb)a?",p="("+s.join("|")+")";function h(e){return!(!e||"string"==typeof e)&&(e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&"String"!==e.constructor.name))}RegExp(d+c,"i"),RegExp([p,"(?:#([a-f0-9]{3,8}))",d+c,"(?:hsl)a?"+c].join("|"),"gi");var u=Array.prototype.concat,m=Array.prototype.slice,g=function(e){for(var t=[],n=0,o=e.length;n<o;n++){var i=e[n];h(i)?t=u.call(t,m.call(i)):t.push(i)}return t};g.wrap=function(e){return function(){return e(g(arguments))}};const b=g;var f={},y=Object.hasOwnProperty,v=Object.create(null);for(var E in f)y.call(f,E)&&(v[f[E]]=E);var C={to:{},get:{}};function O(e,t,n){return Math.min(Math.max(t,e),n)}C.get=function(e){var t,n;return"hsl"===e.substring(0,3).toLowerCase()?(t=C.get.hsl(e),n="hsl"):(t=C.get.rgb(e),n="rgb"),t?{model:n,value:t}:null},C.get.rgb=function(e){if(!e)return null;var t,n,o,i=[0,0,0,1];if(t=e.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(o=t[2],t=t[1],n=0;n<3;n++){var r=2*n;i[n]=parseInt(t.slice(r,r+2),16)}o&&(i[3]=parseInt(o,16)/255)}else if(t=e.match(/^#([a-f0-9]{3,4})$/i)){for(o=(t=t[1])[3],n=0;n<3;n++)i[n]=parseInt(t[n]+t[n],16);o&&(i[3]=parseInt(o+o,16)/255)}else if(t=e.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(t[n+1],0);t[4]&&(t[5]?i[3]=.01*parseFloat(t[4]):i[3]=parseFloat(t[4]))}else{if(!(t=e.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(t=e.match(/^(\w+)$/))?"transparent"===t[1]?[0,0,0,0]:y.call(f,t[1])?((i=f[t[1]])[3]=1,i):null:null;for(n=0;n<3;n++)i[n]=Math.round(2.55*parseFloat(t[n+1]));t[4]&&(t[5]?i[3]=.01*parseFloat(t[4]):i[3]=parseFloat(t[4]))}for(n=0;n<3;n++)i[n]=O(i[n],0,255);return i[3]=O(i[3],0,1),i},C.get.hsl=function(e){if(!e)return null;var t=e.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(t){var n=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,O(parseFloat(t[2]),0,100),O(parseFloat(t[3]),0,100),O(isNaN(n)?1:n,0,1)]}return null},C.to.rgb=function(){var e=b(arguments);return e.length<4||1===e[3]?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},C.to.hsl=function(){var e=b(arguments);return e.length<4||1===e[3]?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};const S=C,T={},R={};for(const e of Object.keys(T))R[T[e]]=e;const A={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"}};Math.pow(6/29,3);for(const e of Object.keys(A)){if(!("channels"in A[e]))throw new Error("missing channels property: "+e);if(!("labels"in A[e]))throw new Error("missing channel labels property: "+e);if(A[e].labels.length!==A[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:n}=A[e];delete A[e].channels,delete A[e].labels,Object.defineProperty(A[e],"channels",{value:t}),Object.defineProperty(A[e],"labels",{value:n})}A.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,o=e[2]/255,i=Math.min(t,n,o),r=Math.max(t,n,o),s=r-i;let l,a;r===i?l=0:t===r?l=(n-o)/s:n===r?l=2+(o-t)/s:o===r&&(l=4+(t-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]},A.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,o=e[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 e=0;e<3;e++)r=t+1/3*-(e-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[e]=255*s;return a};const P=A;function w(e,t){return function(n){return t(e(n))}}function x(e,t){const n=[t[e].parent,e];let o=P[t[e].parent][e],i=t[e].parent;for(;t[i].parent;)n.unshift(t[i].parent),o=w(P[t[i].parent][i],o),i=t[i].parent;return o.conversion=n,o}const L={};Object.keys(P).forEach((e=>{L[e]={},Object.defineProperty(L[e],"channels",{value:P[e].channels}),Object.defineProperty(L[e],"labels",{value:P[e].labels});const t=function(e){const t=function(e){const t=function(){const e={},t=Object.keys(P);for(let n=t.length,o=0;o<n;o++)e[t[o]]={distance:-1,parent:null};return e}(),n=[e];for(t[e].distance=0;n.length;){const e=n.pop(),o=Object.keys(P[e]);for(let i=o.length,r=0;r<i;r++){const i=o[r],s=t[i];-1===s.distance&&(s.distance=t[e].distance+1,s.parent=e,n.unshift(i))}}return t}(e),n={},o=Object.keys(t);for(let e=o.length,i=0;i<e;i++){const e=o[i];null!==t[e].parent&&(n[e]=x(e,t))}return n}(e);Object.keys(t).forEach((n=>{const o=t[n];L[e][n]=function(e){const t=function(...t){const n=t[0];if(null==n)return n;n.length>1&&(t=n);const o=e(t);if("object"==typeof o)for(let e=o.length,t=0;t<e;t++)o[t]=Math.round(o[t]);return o};return"conversion"in e&&(t.conversion=e.conversion),t}(o),L[e][n].raw=function(e){const t=function(...t){const n=t[0];return null==n?n:(n.length>1&&(t=n),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(o)}))}));const N=L,I=["keyword","gray","hex"],k={};for(const e of Object.keys(N))k[[...N[e].labels].sort().join("")]=e;const M={};function D(e,t){if(!(this instanceof D))return new D(e,t);if(t&&t in I&&(t=null),t&&!(t in N))throw new Error("Unknown model: "+t);let n,o;if(null==e)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof D)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if("string"==typeof e){const t=S.get(e);if(null===t)throw new Error("Unable to parse color from string: "+e);this.model=t.model,o=N[this.model].channels,this.color=t.value.slice(0,o),this.valpha="number"==typeof t.value[o]?t.value[o]:1}else if(e.length>0){this.model=t||"rgb",o=N[this.model].channels;const n=Array.prototype.slice.call(e,0,o);this.color=U(n,o),this.valpha="number"==typeof e[o]?e[o]:1}else if("number"==typeof e)this.model="rgb",this.color=[e>>16&255,e>>8&255,255&e],this.valpha=1;else{this.valpha=1;const t=Object.keys(e);"alpha"in e&&(t.splice(t.indexOf("alpha"),1),this.valpha="number"==typeof e.alpha?e.alpha:0);const o=t.sort().join("");if(!(o in k))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=k[o];const{labels:i}=N[this.model],r=[];for(n=0;n<i.length;n++)r.push(e[i[n]]);this.color=U(r)}if(M[this.model])for(o=N[this.model].channels,n=0;n<o;n++){const e=M[this.model][n];e&&(this.color[n]=e(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}D.prototype={toString(){return this.string()},string(e){let t=this.model in S.to?this:this.rgb();t=t.round("number"==typeof e?e:1);const n=1===t.valpha?t.color:[...t.color,this.valpha];return S.to[t.model](n)},round(e){return e=Math.max(e||0,0),new D([...this.color.map(_(e)),this.valpha],this.model)},alpha(e){return void 0!==e?new D([...this.color,Math.max(0,Math.min(1,e))],this.model):this.valpha},lighten(e){const t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){const t=this.hsl();return t.color[2]-=t.color[2]*e,t}};for(const e of Object.keys(N)){if(I.includes(e))continue;const{channels:t}=N[e];D.prototype[e]=function(...t){return this.model===e?new D(this):t.length>0?new D(t,e):new D([...j(N[this.model][e].raw(this.color)),this.valpha],e)},D[e]=function(...n){let o=n[0];return"number"==typeof o&&(o=U(n,t)),new D(o,e)}}function _(e){return function(t){return function(e,t){return Number(e.toFixed(t))}(t,e)}}function j(e){return Array.isArray(e)?e:[e]}function U(e,t){for(let n=0;n<t;n++)"number"!=typeof e[n]&&(e[n]=0);return e}const F=D;function B(e){const{element:t,html:n,appendHtml:o}=e,i=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);o?t.innerHTML+=i:t.innerHTML=i}function H(e,t){Object.keys(t).forEach((n=>{e.style[n]=t[n]}))}function V(e,t){var n,o;let i;return e.styles&&(i=null===(n=e.styles.find((e=>"label"===e.element)))||void 0===n?void 0:n.params),e.adaptiveStyles&&!i&&(i=null===(o=e.adaptiveStyles[t].find((e=>"label"===e.element)))||void 0===o?void 0:o.params),i}function W(e,t,n,o){const i=n.querySelector(o),r=V(e,t);if(!r)return;const s=n.querySelector(".label");B({element:s,html:e.content.label}),"TOP"===r.position?(i.style.flexDirection="column",i.style.alignItems="unset",H(s,{marginRight:0,marginBottom:`${r.margin}px`})):(i.style.flexDirection="row",i.style.alignItems="center",H(s,{marginRight:`${r.margin}px`,marginBottom:0})),r.enabled?s.style.display="":s.style.display="none"}function $(e,t,n,o,i){const r=function(e,t){var n;let o;if(e.styles){const t=null===(n=e.styles.find((e=>"input"===e.element)))||void 0===n?void 0:n.styleAttributes;(null==t?void 0:t.width)&&(o=t)}if(e.adaptiveStyles&&!o){const n=e.adaptiveStyles[t].find((e=>"input"===e.element)).styleAttributes;(null==n?void 0:n.width)&&(o=n)}return o}(e,t);if(!r)return;const s=V(e,t),l=i&&s&&s.enabled&&"TOP"===s.position?i.getBoundingClientRect().height+s.margin:0;r.width&&(r.width.includes("100%")?(o.style.width="100%",n.style.width=r.width):n.style.width="auto"),r.height&&(r.height.includes("100%")?(o.style.height="100%",n.style.height=r.height):n.style.height=`${parseFloat(r.height)+l}px`)}function G(e,t,n){const o=function(e,t){const n=getComputedStyle(e)[t]||e.style.getPropertyValue(t);if(n&&n.includes("rgb")&&(!(n.split("rgb").length>2)||n.includes("#")))return n}(t,n);if(o){const t=F(o).alpha(.5).string();return e.classList.add("focus-outline-defined"),e.style.setProperty("--clFocusOutline",`3px solid ${t}`),t}return null}function Q(e){const{width:t,height:n}=e.getBoundingClientRect(),{marginBottom:o,marginTop:i,marginLeft:r,marginRight:s}=window.getComputedStyle(e);return{width:t+parseInt(r,10)+parseInt(s,10),height:n+parseInt(i,10)+parseInt(o,10)}}function z(e,t,n,o,i){switch(e.position){case"top":return{left:`${q(t,n,o,i)}px`,top:e.availableSpaceAboveTriggerElem-e.contentHeight-e.verticalOffset+"px"};case"bottom":return{left:`${q(t,n,o,i)}px`,bottom:e.availableSpaceBelowTriggerElem-e.contentHeight-e.verticalOffset+"px"};case"left":return{left:e.availableSpaceToTheLeftSideOfTheTrigger-t.width-e.contentWidth-e.horizontalOffset+"px",top:`${K(0,e)}px`};case"right":return{right:e.availableSpaceToTheRightSideOfTheTrigger-e.contentWidth-e.horizontalOffset+"px",top:`${K(0,e)}px`}}}function q(e,t,n,o){let i=n?e.x+e.width/2-t.width/2:e.x;return i<0&&(i=0),i+t.width>r.width(o)&&(i-=i+t.width-r.width(o)),i}function K(e,t){let n=t.availableSpaceAboveTriggerElem;return t.contentHeight>t.availableSpaceBelowTriggerElem&&(n-=t.contentHeight-t.availableSpaceBelowTriggerElem),n}const Z="cl-tooltip-text-styles",J=`\n .cl-tooltip-text {\n z-index: ${Number.MAX_SAFE_INTEGER};\n width: max-content;\n height: fit-content;\n visibility: hidden;\n background-color: white;\n color: #000;\n border: 1px solid rgb(194, 194, 194);\n border-radius: 5px;\n padding: 5px 10px;\n position: fixed;\n max-width: 300px;\n max-height: 100vh;\n box-shadow: 0 1px 5px rgba(0,0,0,.28);\n font-size: 14px;\n }\n\n .cl-tooltip-text[cl-tooltip-position='top']:before {\n content: "";\n position: absolute;\n top: 100%;\n left: calc(50% - 13px);\n border-width: 12px;\n border-style: solid;\n border-color: rgb(194, 194, 194) transparent transparent transparent;\n }\n \n .cl-tooltip-text[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: 12px;\n border-style: solid;\n border-color: white transparent transparent transparent;\n }\n\n .cl-tooltip-text[cl-tooltip-position='bottom']:before {\n content: "";\n position: absolute;\n top: -24px;\n left: calc(50% - 9px);\n border-width: 12px;\n border-style: solid;\n border-color: transparent transparent rgb(194, 194, 194) transparent;\n }\n \n .cl-tooltip-text[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: 12px;\n border-style: solid;\n border-color: transparent transparent white transparent;\n }\n`;function Y(e,t,n,o){let i;o=o||document,e.classList.add("invalid"),t.style.visibility="visible",t.onmouseenter=()=>{(function(e){if((e=e||document).head.querySelector(`#${Z}`))return;const t=document.createElement("style");t.setAttribute("id",Z),B({element:t,html:J}),e.head.appendChild(t)})(o),i=function(e){const t="cl-overlay-tooltip-text",n=document.getElementById(t)||document.createElement("div");return n.classList.add("cl-tooltip-text"),n.textContent!==e&&(n.textContent=e,n.style=null),n.id||(n.id=t),n}(n),o.body.append(i),i.style.visibility="visible",function(e){const{triggerElement:t,tooltipElement:n,offset:o=10,htmlDocumentObject:i}=e,s=function(e,t,n,o,i,s){const l=function(e,t,n,o,i){const s=function(e,t,n,o){const i=r.width(o),{right:s}=e.getBoundingClientRect(),l=i-n-s-r.scrollbarWidth(o);return{horizontalOffset:n,contentWidth:Q(t).width,availableSpaceToTheLeftSideOfTheTrigger:s-n,availableSpaceToTheRightSideOfTheTrigger:l}}(e,t,n,i),l=function(e,t,n,o){const i=r.height(o),{top:s,bottom:l}=e.getBoundingClientRect();return{verticalOffset:n,contentHeight:Q(t).height,availableSpaceAboveTriggerElem:s-n,availableSpaceBelowTriggerElem:i-l-n}}(e,t,n,i);let a="undefined";const c={bottom:l.availableSpaceBelowTriggerElem>=l.contentHeight,top:l.availableSpaceAboveTriggerElem>=l.contentHeight,right:s.availableSpaceToTheRightSideOfTheTrigger>=s.contentWidth,left:s.availableSpaceToTheLeftSideOfTheTrigger>=s.contentWidth};if(c.top?a="top":c.bottom?a="bottom":c.right?a="right":c.left&&(a="left"),c[o]&&(a=o),"undefined"===a){const e=Math.max(l.availableSpaceBelowTriggerElem,l.availableSpaceAboveTriggerElem,s.availableSpaceToTheRightSideOfTheTrigger,s.availableSpaceToTheLeftSideOfTheTrigger);e===l.availableSpaceBelowTriggerElem?a="bottom":e===l.availableSpaceAboveTriggerElem?a="top":e===s.availableSpaceToTheRightSideOfTheTrigger?a="right":e===s.availableSpaceToTheLeftSideOfTheTrigger&&(a="left")}return Object.assign(Object.assign(Object.assign({},l),s),{position:a})}(e,t,n,o,s=s||document);return function(e,t){const{marginBottom:n,marginTop:o}=window.getComputedStyle(t);if("top"===e.position)H(t,{"margin-top":`${parseInt(o,10)+parseInt(n,10)}px`}),H(t,{"margin-bottom":"0px"});else if("bottom"===e.position)H(t,{"margin-bottom":`${parseInt(n,10)+parseInt(o,10)}px`}),H(t,{"margin-top":"0px"});else{const e=(parseInt(n,10)+parseInt(o,10))/2+"px";H(t,{"margin-top":e,"margin-bottom":e})}}(l,t),{coordinates:z(l,e.getBoundingClientRect(),t.getBoundingClientRect(),i,s),position:l.position}}(t,n,o,"top",!0,i);n.setAttribute("cl-tooltip-position",s.position),H(n,s.coordinates)}({triggerElement:t,tooltipElement:i,htmlDocumentObject:o})},t.onmouseleave=()=>{i&&(i.remove(),function(e){const t=(e=e||document).head.querySelector(`#${Z}`);t&&t.remove()}(o))}}function X(e){return[e.getConfig("appearanceLanguage"),e.getConfig("browserLanguage"),"en"].filter((e=>!!e))}function ee(e,t){return t.reduce(((t,n)=>{if(t)return t;const o=function(e,t){if(!e)return null;if(t[e])return{translations:t[e],language:e};const n=te(e);return t[n]?{translations:t[n],language:n}:null}(n,e);return o||null}),null)}function te(e){return e.includes("-")?e.split("-")[0].toLowerCase():e.includes("_")?e.split("_")[0].toLowerCase():e}const ne="VIEW",oe="MODULE",ie="CONTAINER",re="INPUT",se="BUTTON",le="CONSENT",ae="COLUMN",ce="SUBSCRIBE_CONTACT",de="REQUEST",pe="SHOW_WIDGET",he="OPEN_LINK",ue="CLOSE_WIDGET";class me{static sortActions(e){const t={[ue]:-1,[he]:-2,[pe]:1,[ce]:2,[de]: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=me.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(),r=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"))!==r;){let e=t[n].getAttribute(i("type"));if(me.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,o;try{for(var i,r=!0,s=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={},o("next"),o("throw"),o("return"),t[Symbol.asyncIterator]=function(){return this},t);function o(n){t[n]=e[n]&&function(t){return new Promise((function(o,i){!function(e,t,n,o){Promise.resolve(o).then((function(t){e({value:t,done:n})}),t)}(o,i,(t=e[n](t)).done,t.value)}))}}}(this.eventsQueue);!(e=(i=await s.next()).done);){o=i.value,r=!1;try{const{event:e}=o;for(const t of this.actions)if(!await t.execute(this.state.getState(),e))break}finally{r=!0}}}catch(e){t={error:e}}finally{try{r||e||!(n=s.return)||await n.call(s)}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=[])}}me.IGNORING_VIEW_ENTRY_TYPES=[se,le,re];const ge="CLICK",be="COMPONENT_EVENT";class fe{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 ye{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 ge:return new me(e,t);case be:return new fe(e,t);default:throw new Error(`Not supported handler type ${e.type}`)}}}class ve{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 Ee{constructor(){this.listeners=Ee.createDefaultListenersState()}emit(e,t,n=null){const o=this.listeners[e];o&&Object.values(o).forEach((o=>o(t,e,n))),Object.values(this.listeners["*"]).forEach((o=>o(t,e,n)))}on(e,t){const n=ve.generate(),o=this.listeners[e];return o?o[n]=t:this.listeners[e]={[n]:t},{off:()=>{var t,o;(null===(o=null===(t=this.listeners)||void 0===t?void 0:t[e])||void 0===o?void 0:o[n])&&delete this.listeners[e][n]}}}destroy(){this.listeners=Ee.createDefaultListenersState()}}Ee.createDefaultListenersState=()=>({"*":{}});const Ce=(e,t,n,o)=>{const{addEventListenerBase:i,addEventListener:r}=EventTarget.prototype;(i||r).call(e,t,n,o)};class Oe{constructor(e){this.state=e||{}}getState(){return this.state}setState(e){this.state=Object.assign(Object.assign({},this.state),e)}destroy(){}}class Se{static extract(e){const t=e.views.map((e=>{const t=e.children.map((e=>e.type===oe?Object.assign(Object.assign({},e),Se.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})}}Se.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"};class Te extends Ee{constructor(e,t){super(),this.config=t,this.handleMobileBreakpoint(e.getShared().mobileBreakpointWidth),e.on("ENVIRONMENT_UPDATE",(({isMobileEnv:e})=>{this._isMobile=e,this.emit(Te.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(Te.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(e){this._isMobile=e.matches,this.emit(Te.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}Te.changeEventName="CHANGE";class Re{static set(e,t){const n=e[Re.accumulatorPropertyName]||{};e[Re.accumulatorPropertyName]=Object.assign(Object.assign({},n),t.styleAttributes),Object.keys(e[Re.accumulatorPropertyName]).forEach((n=>{n.includes("--")?e.style.setProperty(n,t.styleAttributes[n]||""):e.style[n]=t.styleAttributes[n]?t.styleAttributes[n]:""}))}}Re.accumulatorPropertyName="clStyleAttributes";const Ae="CONTENT_LOCKER";class Pe{static applyHostStyles(e,t,n=null,o){var i,r,s;const l=null===(r=null===(i=null==n?void 0:n.props)||void 0===i?void 0:i.handlers)||void 0===r?void 0:r.find((e=>"CLICK"===e.type));l&&(null===(s=l.actions)||void 0===s?void 0:s.length)&&(t.style.cursor="pointer"),e!==ne&&e!==ie&&e!==ae||(t.style.display=o===Ae&&e===ne?"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 we{static log(e){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(e)):console.error(e)}}class xe{constructor(e,t,n,o,i,r){this.hostElement=t,this.documentModel=e,this.getSharedCb=n,this.getPropsCb=o,this.getEnvCb=i,this.httpClient=r,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 o,i,r,s,l;const a=null===(i=null===(o=t.adaptiveStyles)||void 0===o?void 0:o[e])||void 0===i?void 0:i.find((e=>e.element===n)),c=(null===(r=t.styles)||void 0===r?void 0:r.find((e=>e.element===n)))||{},d=(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),p=this.parseBackground(d);p.url&&this.envUrlMaps[e].set(n,{originalSVGResourceURL:p.url,inlineSvgString:null,positionOptions:p.positionOptions})})),Promise.all([...this.envUrlMaps[e].entries()].map((([t,n])=>this.httpClient.execute(n.originalSVGResourceURL).then((e=>e.text())).then((o=>{this.envUrlMaps[e].set(t,Object.assign(Object.assign({},n),{inlineSvgString:o}))}))))).then((()=>{this._applyHostElementBackground(this.envUrlMaps[e].get("host"),this.getSharedCb().cssVars)})).catch((e=>{console.error(e),we.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&&(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 Le=new class{execute(e,t,n=null,o,i){const r={method:t,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(e,r)}};function Ne(e,t){return Object.keys(e).filter((e=>!t.includes(e))).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:e[n]})),{})}class Ie{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 ke{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 Me="COMPONENT_RESOURCES_LOADED",De="FAILED_TO_LOAD_COMPONENT_RESOURCE";class _e{constructor(e,t,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=e=>{0===e&&this.systemEventEmitter.emit(Me,this.componentId)},this.onResourceLoadFailure=e=>{this.isStaticEntryModule?this.systemEventEmitter.emit(De,`Failed to load: ${e}`):this.counters.pending.decrement()},this.componentId=e,this.systemEventEmitter=t,this.isStaticEntryModule=n,this.counters={pending:new ke(this.onCounterStateUpdate)}}}const je=(...e)=>{let t=e.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:[]})),{});return{get:e=>t[e],clear:()=>je(...e)}},Ue=je,Fe="props",Be="shared",He="environment";function Ve(e,t,n,o){const i=e=>{let r=e instanceof DocumentFragment||(null==e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?e.host:e;return r&&(o&&"function"==typeof o?o(r.getAttribute(t)):(null===(s=null==r?void 0:r.getAttribute)||void 0===s?void 0:s.call(r,t))===n)?r:r&&r.parentNode&&i(r.parentNode)||null;var s};return i(e)}const We="SUBMIT";function $e(e,t){return t?(e.classes=`${e.classes||""} ${t.classes||""}`.trim(),Object.keys(t).forEach((n=>{"element"!==n&&"classes"!==n&&(t[n]&&"object"==typeof t[n]&&!Array.isArray(t[n])?e[n]=Object.assign(Object.assign({},e[n]||{}),t[n]):e[n]=t[n])})),e):e}function Ge(e,t,n){var o;return null===(o=e[t])||void 0===o?void 0:o.find((e=>e.element===n))}class Qe extends Event{constructor(e,t,n){super(e,n),this.detail={},Object.defineProperty(this,"detail",{value:t})}}class ze extends HTMLElement{constructor(){var e,t;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 r;o&&(r=o.getAttribute(i("widget-id")));let s=new Qe("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(i("path")),id:t,widgetId:r},{bubbles:!0,composed:!0});this.dispatchEvent(s),e=s.detail.props,Object.assign(this,e),this.observers=Ue(Fe,Be,He),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 Oe,this.componentEventEmitter=new Ee,this.componentResourceManager=new _e(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 ye(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(Fe).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(Be).forEach((e=>e(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new xe(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),Le),this.colorSchemaListener.apply(this.getEnvironment()).then((()=>{this.subscriptions.push(this.colorSchemaListener.on())}))),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(Te.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const e=this.getEnvironment();this.observers.get(He).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(Fe).push(e),e(null,this.prevProps)},this.observeShared=e=>{this.observers.get(Be).push(e),e(this.getShared())},this.observeEnvironment=e=>{this.observers.get(He).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;e=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 o=!1,i=!1;n.desktop&&n.desktop.forEach((n=>{n.element===t&&($e(n,e),o=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===t&&($e(n,e),i=!0)})),!o&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(e))),!i&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(e)))})),n}(e,t);const o=i("type"),r="element-styles";let s=this.getRootElement().querySelector(`style[${o}="${r}"]`);s||(s=document.createElement("style"),s.setAttribute(o,r),this.getRootElement().appendChild(s)),B({element:s,html:""}),n.forEach((t=>{let n=t.getAttribute(i("element"));const o=this.getEnvironment();let r=Ge(e,o,n);if(r){if(this.resizeListener.isMobile()){const t=Ge(e,"desktop",n);t&&(r=Object.assign(Object.assign({},r),{styleAttributes:Object.assign(Object.assign({},t.styleAttributes),r.styleAttributes)}))}this.applyStylesToElement(t,this.applySharedClassesToElementModel(r),s)}})),this._addLinkColor(s,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,o]of Object.entries(t))e.style[n]=o;return!0},this.applyStylesToElement=(e,t,n)=>{var o,r;const s=[];"host"===(t=ze._resolveTogglableStylesForElementModel(t)).element&&(Pe.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===(r=this.model.props.backgroundDynamicInlineSVGElements)||void 0===r?void 0:r.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),s.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],Ce(e,"load",(()=>{this.componentResourceManager.getPending().decrement()})),Ce(e,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(e.src),"UPDATING"===this.services.config.getConfig("entryModuleType")&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},t),{styleAttributes:Ne(t.styleAttributes,s)});if(Re.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 r=this.getRootElement().querySelector(`#${i}`);r||(r=document.createElement("style"),r.id=i,e.appendChild(r)),B({element:r,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._fixMarginOverflow=e=>{const t=this.getParentComponent(),n=t&&("flex"===t.style.display||"inline-flex"===t.style.display),o="host",r=e.getAttribute(i("element"))===o;if(!n||!r)return;const s=this.getProps(),l=this.getEnvironment(),{styleAttributes:a}=Ge(s.adaptiveStyles,l,o)||{};if(!a)return;const c=a.marginLeft||a.marginRight,d="100%"===a.width;if(c&&d){const t=(parseFloat(a.marginLeft)||0)+(parseFloat(a.marginRight)||0);t&&setTimeout((()=>{e.style.width=`calc(100% - ${t}px)`}))}},this.applySharedClassesToElementModel=e=>function(e,t){let o=e;return(o.classes||"").split(" ").filter((e=>e.startsWith(n))).forEach((e=>{var n;let i=null===(n=t.textClasses)||void 0===n?void 0:n[e];i&&(i.styleAttributes.fontFamily||(i.isHeader&&t.headerFontFamily&&(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),{fontFamily:t.headerFontFamily})})),!i.isHeader&&t.textFontFamily&&(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),{fontFamily:t.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:t.textFontFamily})})),o}(e,this.documentModel.getShared()),this.getModel=()=>this.model,this._addStylesToStyleElement=(e,t,n,o="",r)=>{const s=Object.keys(n).reduce(((e,t)=>e+` ${Ie.camelCaseToDashCase(t)}: ${n[t]}${r?" !important;":";"}`),"");B({element:e,html:`[${i("element")}="${t}"]${o} { ${s} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(e,t)=>{B({element:e,html:`[cl-type] {font-family:${t.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(e,t)=>{var n,o,i,r;t.linkColor&&B({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)&&B({element:e,html:`a {color: ${null===(o=t.linkParams)||void 0===o?void 0:o.color}}, a:visited {color: ${null===(i=t.linkParams)||void 0===i?void 0:i.color}}`,appendHtml:!0}),(null===(r=t.linkParams)||void 0===r?void 0:r.removeUnderline)&&B({element:e,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(e,t)=>{Array.from(e.classList).filter((e=>e!==o("hovered")&&e!==o("focused"))).forEach((t=>{t.startsWith(n)&&e.classList.remove(t)}));const i=((e.getAttribute("class")||"")+" "+t.classes).trim();e.setAttribute("class",i)},this.getParentComponent=()=>Ve(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:Ve(this.parentNode,i("path"),void 0,(e=>e&&1===e.split(",").length))},this.getWidgetLanguages=()=>X(this.services.config),this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=e=>ee(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;const o=e.control.name;if(["email","first_name","last_name"].includes(o))return o.toUpperCase();if(e.content.label&&(null===(n=null===(t=e.adaptiveStyles.desktop.find((e=>"label"===e.element)))||void 0===t?void 0:t.params)||void 0===n?void 0:n.enabled)){const t=(new DOMParser).parseFromString(e.content.label,"text/html");return this.capitalizeFirstLetter(t.body.textContent||"")}return e.content.placeholder?this.capitalizeFirstLetter(e.content.placeholder):e.control.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=>{switch(e.control.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===We));n?null==n||n.execute(void 0,void 0,!0,t):this.services.actionFactory.get({type:de}).execute(void 0,void 0,!0,t)},this.getHandlers=()=>this.getProps().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===(t=this.constructor.define)||void 0===t?void 0:t.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()}static _resolveTogglableStylesForElementModel(e){const t=Object.assign({},e);return Object.keys(t).forEach((e=>{e.toLowerCase().includes("styleattributes")&&(t[e]=ze._resolveTogglableStyles(t[e]))})),t}static _resolveTogglableStyles(e){const t=Object.assign({},e),n=(e,n,o)=>{n in t&&(e.forEach((e=>{e in t&&(t[e]=t[n]?t[e]:o)})),delete t[n])};return n(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),n(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),t}}const qe=Symbol("required");var Ke=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(n[o[i]]=e[o[i]])}return n};function Ze(){}const Je="pending",Ye="valid",Xe="invalid";class et extends ze{constructor(){super(...arguments),this._createControl=(e={},...t)=>{var{element:n}=e,o=Ke(e,["element"]);const i=this.getProps(),r=this.getModel(),s=Object.assign(Object.assign(Object.assign({},i.control),{componentId:r.id,viewIdx:r.path[0]}),o),l=this.services.form,a=[s,n,...t];return l.hasControl(i.control.name)?l.updateControl(...a):l.registerControl(...a)},this.createControlWithValidation=(e=[],t={})=>{var{element:n=this.getElement("input"),tooltipElement:o=this.getRootElement().querySelector(".input-tooltip"),validCallback:i=Ze,invalidCallback:r=Ze,pendingCallback:s=Ze,elementToListen:l=n,validationMap:a={},listenStatusChange:c=!0}=t,d=Ke(t,["element","tooltipElement","validCallback","invalidCallback","pendingCallback","elementToListen","validationMap","listenStatusChange"]);if(o&&(o.style.visibility="hidden"),!e||!Array.isArray(e))throw new Error("Validators should be an array");const p=this.getProps().control.validation,h=a[null==p?void 0:p.validator],u=e.some((e=>e[qe])),m=!!(null==p?void 0:p.required),g=m||u,b=[...e];m&&!u&&b.unshift(function(e="REQUIRED"){const t=t=>{let n;switch(typeof t){case"string":n=t&&t.length>0;break;case"boolean":n=t;break;case"number":n=!isNaN(t);break;default:n=!!t}return{isValid:n,errorKey:n?null:e}};return t[qe]=!0,t}()),h&&b.push(h);const f=this._prepareAsyncValidators(b),y=this._createControl({element:n,validation:{validator:"custom",required:g}},void 0,f);return c&&this._handleControlStatusChange(Object.assign({control:y,element:l,tooltipElement:o,configService:this.services.config,i18n:this.manifest.i18n,validCallback:i,invalidCallback:r,pendingCallback:s},d)),y},this._prepareAsyncValidators=(e=[])=>e.reduce(((e,t,n)=>"function"!=typeof t?(console.warn(`Validator ${n} should be a function, so it will be skipped`),e):(e[`custom_${n}`]=async(...e)=>{const n=await Promise.resolve(t(...e));return"object"==typeof n&&"isValid"in n?Object.assign(Object.assign({},n),{errorKey:n.isValid?null:n.errorKey}):{isValid:!1,errorKey:"INVALID_VALIDATOR_RESPONSE"}},e)),{}),this._handleControlStatusChange=n=>{n.control.on(e,(e=>{this._handleValidationStatus(n,e)})),n.control.on(t,(()=>{let e=Je;switch(!0){case n.control.pending:e=Je;break;case n.control.valid:e=Ye;break;default:e=Xe}this._handleValidationStatus(n,e)}))},this._handleValidationStatus=(e,t)=>{const{control:n,element:o,tooltipElement:i,validCallback:r,invalidCallback:s,errorMessageMapper:l,pendingCallback:a}=e,c=this.services.config,d=this.manifest.i18n;switch(t){case Ye:(function(e,t){e.classList.remove("invalid"),t.style.visibility="hidden"})(o,i),r&&r();break;case Xe:if(n.touched){const e=n.getErrorKeys();if(!e)break;const t=e[0];let r=function(e,t,n){const o=ee(t,X(e)).translations,i=Object.keys(o).find((e=>e.includes(n)));return i?o[i]:n}(c,d,t);l&&(r=l(t,r)),Y(o,i,r,this.htmlDocumentObject),s&&s()}break;case Je:n.touched&&(function(e,t){t.style.visibility="hidden",e.classList.contains("invalid")&&e.classList.remove("invalid")}(o,i),a&&a())}}}}const tt={name:"SysCalendarComponent",componentType:"INPUT",version:"1.0.0",mappingTypes:["DATE"],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:"input"},{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:"input"},{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:"input",elementProp:"styleAttributes",params:{width:{options:["fixed","fill"]},height:{options:["fixed","fill"]}}},{type:"CONTROL",name:"TEXT_PARAMS",params:[{element:"input",showPlaceholderControl:!0,isLineSpaceAvailable:!0,isTextTransformAvailable:!0},{element:"label",displayCondition:"return !!sdk.component.getProps().styles.find(element => element.element === 'label').params.enabled",isLineSpaceAvailable:!0,isTextTransformAvailable:!0}]},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=input]","styleAttributes"]},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=input]","styleAttributes"]},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=input]","styleAttributes"]},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=input]","styleAttributes"]},{type:"CONTROL",name:"INPUT_LABEL",propPath:["styles","[element=label]","params"]},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"input",params:{indentationType:"PADDING",horizontalOnly:!0}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"}}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SIZE",element:"input",elementProp:"styleAttributes",params:{width:{options:["fixed","fill"]},height:{options:["fixed","fill"]}}},{type:"CONTROL",name:"TEXT_PARAMS",params:[{element:"input",showPlaceholderControl:!0,isLineSpaceAvailable:!0,isTextTransformAvailable:!0},{element:"label",displayCondition:"return !!sdk.component.getProps().styles.find(element => element.element === 'label').params.enabled",isLineSpaceAvailable:!0,isTextTransformAvailable:!0}]},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=input]","styleAttributes"]},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=input]","styleAttributes"]},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=input]","styleAttributes"]},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=input]","styleAttributes"]},{type:"CONTROL",name:"INPUT_LABEL",propPath:["styles","[element=label]","params"]},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"input",params:{indentationType:"PADDING",horizontalOnly:!0}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"}}]}],general:[{type:"CONTROL",name:"INTEGRATION_FIELD_MAPPING",params:{integrationNamePropPath:["control","integrationName"],groupNamePropPath:["control","groupName"],fieldNamePropPath:["control","fieldName"],fieldTypePropPath:["control","fieldType"],validationPropPath:["control","validation"],placeholderPropPath:["content","placeholder"],labelPropPath:["content","label"],optionsPropPath:["control","options"]}},{type:"CONTROL",name:"INPUT_VALIDATION",params:{validationPropPath:["control","validation"],fieldTypePropPath:["control","fieldType"],required:!0}},{type:"CONTROL",name:"SWITCH",propPath:["content","onlyInFuture"],params:{label:"DOCUMENT_ONLY_IN_FUTURE"}}]},autoContrast:[{slave:{element:"input",elementProp:"styleAttributes",elementSubProp:"color"},master:{element:"input",propPath:["styles","[element=input]","styleAttributes","background"]},enabledPropPath:["content","textContrastEnabled"]},{slave:{element:"input",elementProp:"placeholderStyleAttributes",elementSubProp:"color",dimmed:!0},master:{element:"input",propPath:["styles","[element=input]","styleAttributes","background"]},enabledPropPath:["content","placeholderTextContrastEnabled"]}],focusableElements:["input","label"],events:{dispatch:[],listen:[]},i18nPropPaths:["content,label"],i18n:{en:{"control,validation,validationErrors,REQUIRED":"Required field","content,label":"Title"},ru:{"control,validation,validationErrors,REQUIRED":"Обязательное поле","content,label":"Заголовок"},uk:{"control,validation,validationErrors,REQUIRED":"Обов'язкове поле","content,label":"Заголовок"},es:{"control,validation,validationErrors,REQUIRED":"Campo obligatorio","content,label":"Título"},de:{"control,validation,validationErrors,REQUIRED":"Pflichtfeld","content,label":"Titel"},fr:{"control,validation,validationErrors,REQUIRED":"Champs requis","content,label":"Titre"},it:{"control,validation,validationErrors,REQUIRED":"Campo obbligatorio","content,label":"Titolo"},pt:{"control,validation,validationErrors,REQUIRED":"Campo obrigatório","content,label":"Título"},ro:{"control,validation,validationErrors,REQUIRED":"Câmp obligatoriu","content,label":"Titlu"},bg:{"control,validation,validationErrors,REQUIRED":"Изисквано поле","content,label":"Заглавие"},cs:{"control,validation,validationErrors,REQUIRED":"Vyžadované pole","content,label":"Titul"},el:{"control,validation,validationErrors,REQUIRED":"Απαιτητό πεδίο","content,label":"Τίτλος"},nl:{"control,validation,validationErrors,REQUIRED":"Verplicht veld","content,label":"Titel"},pl:{"control,validation,validationErrors,REQUIRED":"Wymagane pole","content,label":"Tytuł"},sv:{"control,validation,validationErrors,REQUIRED":"Obligatoriskt fält","content,label":"Tytuł"},tr:{"control,validation,validationErrors,REQUIRED":"Gerekli alan","content,label":"Başlık"},ar:{"control,validation,validationErrors,REQUIRED":"الحقل المطلوب","content,label":"عنوان"},zh:{"control,validation,validationErrors,REQUIRED":"必填字段","content,label":"Title"},da:{"control,validation,validationErrors,REQUIRED":"Påkrævet felt","content,label":"Titel"},he:{"control,validation,validationErrors,REQUIRED":"שדה נדרש","content,label":"Title"},fi:{"control,validation,validationErrors,REQUIRED":"Vaadittu kenttä","content,label":"Title"},hi:{"control,validation,validationErrors,REQUIRED":"आवश्यक फील्ड","content,label":"Title"},hr:{"control,validation,validationErrors,REQUIRED":"Obavezno polje","content,label":"Title"},hu:{"control,validation,validationErrors,REQUIRED":"Kötelező mező","content,label":"Title"},id:{"control,validation,validationErrors,REQUIRED":"Bidang yang wajib diisi","content,label":"Title"},ja:{"control,validation,validationErrors,REQUIRED":"必須フィールド","content,label":"Title"},ko:{"control,validation,validationErrors,REQUIRED":"필수 칸","content,label":"Title"},no:{"control,validation,validationErrors,REQUIRED":"Obligatorisk felt","content,label":"Title"},sk:{"control,validation,validationErrors,REQUIRED":"Povinné pole","content,label":"Title"},sl:{"control,validation,validationErrors,REQUIRED":"Obvezno polje","content,label":"Title"},sr:{"control,validation,validationErrors,REQUIRED":"Obavezno polje","content,label":"Title"}},props:{content:{label:"Title",onlyInFuture:!0,textContrastEnabled:!0,placeholderTextContrastEnabled:!0},control:{name:"calendar",integrationName:"calendar",defaultValue:null,validation:{required:!0,validator:"SYS_CALENDAR"}},styles:[{element:"input",styleAttributes:{background:"rgb(255, 255, 255)",borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"1px",borderTopColor:"rgba(0, 0, 0, 0.1)",borderBottomWidth:"1px",borderBottomColor:"rgba(0, 0, 0, 0.1)",borderLeftWidth:"1px",borderLeftColor:"rgba(0, 0, 0, 0.1)",borderRightWidth:"1px",borderRightColor:"rgba(0, 0, 0, 0.1)",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none"}},{element:"label",params:{enabled:!1,position:"TOP",margin:5}}],adaptiveStyles:{desktop:[{element:"host",styleAttributes:{marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1},classes:""},{element:"input",styleAttributes:{width:"100%",minWidth:null,height:"35px",minHeight:"35px",color:"rgb(0, 0, 0)",textAlign:"start",lineHeight:"120%",fontWeight:"400",fontSize:"16px",textShadow:"none"},placeholderStyleAttributes:{color:"rgb(81, 81, 81)"},classes:""},{element:"label",styleAttributes:{color:"rgb(0, 0, 0)",textAlign:"start",lineHeight:"120%",fontWeight:"400",fontSize:"16px",textShadow:"none"},classes:""}],mobile:[{element:"host",styleAttributes:{marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1},classes:""},{element:"input",styleAttributes:{width:"100%",minWidth:null,height:"35px",minHeight:"35px",color:"rgb(0, 0, 0)",textAlign:"start",lineHeight:"120%",fontWeight:"400",fontSize:"16px",textShadow:"none"},placeholderStyleAttributes:{color:"rgb(81, 81, 81)"},classes:""},{element:"label",styleAttributes:{color:"rgb(0, 0, 0)",textAlign:"start",lineHeight:"120%",fontWeight:"400",fontSize:"16px",textShadow:"none"},classes:""}]}},metaDescription:{icon:"/SysCalendarComponent/assets/img/calendar-component-icon.svg",label:{en:"Calendar",ru:"Календарь",uk:"Календар",es:"Calendario",de:"Kalender",fr:"Calendrier",it:"Calendario",pt:"Calendário",ro:"Calendar",bg:"Календар",cs:"Kalendář",el:"Ημερολόγιο",nl:"Kalender",pl:"Kalendarz",sv:"Kalender",tr:"Takvim",ar:"التقويم",zh:"日历",da:"Kalender",he:"לוח שנה",fi:"Kalenteri",hi:"कैलेंडर",hr:"Kalendar",hu:"Naptár",id:"Kalender",ja:"カレンダー",ko:"달력",no:"Kalender",sk:"Kalendár",sl:"Koledar",sr:"Kalendar"}}};function nt(e){return(e?new Date(e):new Date).toISOString().slice(0,10)}function ot(e){return ot="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},ot(e)}function it(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,pt(o.key),o)}}function rt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(rt=function(){return!!e})()}function st(e,t,n,o){var i=lt(at(1&o?e.prototype:e),t,n);return 2&o&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function lt(){return lt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var o=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=at(e)););return e}(e,t);if(o){var i=Object.getOwnPropertyDescriptor(o,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},lt.apply(null,arguments)}function at(e){return at=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},at(e)}function ct(e,t){return ct=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ct(e,t)}function dt(e,t,n){return(t=pt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pt(e){var t=function(e){if("object"!=ot(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ot(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ot(t)?t:t+""}var ht=function(){function e(){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),dt(t=function(e,t,n){return t=at(t),function(e,t){if(t&&("object"==ot(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,rt()?Reflect.construct(t,n||[],at(e).constructor):t.apply(e,n))}(this,e),"manifest",tt),dt(t,"registeredControl",void 0),dt(t,"isCalendarDisplayed",!1),dt(t,"DEFAULT_PLACEHOLDER_VALUE",{en:"Choose a date",ru:"Выберите дату",uk:"Оберіть дату",es:"Elige una fecha"}),dt(t,"markCalendarDisplayFalseIfClickedOutsideListenerCb",void 0),dt(t,"markCalendarDisplayFalseListenerCb",void 0),dt(t,"closeCalendarOnEscapeIfItPresentListenerCb",void 0),dt(t,"setPlaceholder",(function(e,n){t.setCalendarPlaceholder(),t.applyPlaceholderColor(e,n)})),dt(t,"applyPlaceholderColor",(function(e,o){var i=function(e,t,o){let i="rgb(0, 0, 0)";const r=e.adaptiveStyles[t].find((e=>"input"===e.element));if(r.placeholderStyleAttributes&&r.placeholderStyleAttributes.color)return r.placeholderStyleAttributes.color;const s=(r.classes||"").split(" ").filter((e=>e.startsWith(n)));if(!s.length)return i;let l=o.textClasses[s[0]];return l&&l.placeholderStyleAttributes&&l.placeholderStyleAttributes.color?l.placeholderStyleAttributes.color:i}(e,o,t.getShared());t.getHostElement().style.setProperty("--cl-calendar-input-placeholder-color",i)})),dt(t,"setCalendarPlaceholder",(function(){var e=t.getRootElement().querySelector(".selected-date-value"),n=t.registeredControl.getValue();if(e&&!n){var o=t.getTranslationsMap(t.DEFAULT_PLACEHOLDER_VALUE).translations;B({element:e,html:'<span class="calendar-placeholder" style="color: var(--cl-calendar-input-placeholder-color)">'.concat(o,"</span>")})}})),dt(t,"registerControl",(function(e){"UPDATING"===t.services.config.getConfig("entryModuleType")&&(e.querySelector("#cl-date-input").style.pointerEvents="none");var n=e.querySelector(".input-ui-override");t.registeredControl=t.createControlWithValidation([],{element:t.getHostElement()},{elementToListen:n})})),dt(t,"formatCurrentLocaleDate",(function(e,t){var n=te(e),o=t?new Date(t+"T00:00:00Z"):new Date;return new Intl.DateTimeFormat(n,{timeZone:"UTC",year:"numeric",month:"numeric",day:"numeric"}).format(o)})),dt(t,"setTime",(function(e,n){var o=e.querySelector("#cl-date-input");o.value=n,o.dispatchEvent(new Event("change")),t.registeredControl.setValue(n)})),dt(t,"setMinTimeRange",(function(e){e.querySelector("#cl-date-input").min=nt()})),dt(t,"clearMinTimeRange",(function(e){e.querySelector("#cl-date-input").removeAttribute("min")})),dt(t,"setUpdatedValueOnChange",(function(e){var n=e.querySelector("#cl-date-input");n.addEventListener("change",(function(){if(t.registeredControl.setValue(n.value||null),n.value){var o=t.getPreferredWidgetLanguage();e.querySelector(".selected-date-value").textContent=t.formatCurrentLocaleDate(o,n.value)}else t.setCalendarPlaceholder()}))})),dt(t,"handleDateFocusOut",(function(){navigator.userAgent.toLowerCase().indexOf("firefox")>-1||t.markCalendarDisplayFalse()})),dt(t,"markCalendarDisplayFalse",(function(){t.isCalendarDisplayed=!1})),dt(t,"addCalendarRelatedEventListeners",(function(e){var n=e.querySelector("#cl-date-input");"UPDATING"===t.services.config.getConfig("entryModuleType")||(t.removeListeners(),n.addEventListener("click",(function(e){return t.showCalendarProgrammatically(e)})),n.addEventListener("change",(function(){return t.closeNativeCalendarProgrammatically()})),n.addEventListener("focusout",(function(){return t.handleDateFocusOut()})),t.markCalendarDisplayFalseIfClickedOutsideListenerCb=function(e){return t.markCalendarDisplayFalseIfClickedOutside(e)},t.markCalendarDisplayFalseListenerCb=function(){return t.markCalendarDisplayFalse()},t.closeCalendarOnEscapeIfItPresentListenerCb=function(e){return t.closeCalendarOnEscapeIfItPresent(e)},window.addEventListener("click",t.markCalendarDisplayFalseIfClickedOutsideListenerCb),window.addEventListener("mousewheel",t.markCalendarDisplayFalseListenerCb),window.addEventListener("keyup",t.closeCalendarOnEscapeIfItPresentListenerCb,!0))})),dt(t,"markCalendarDisplayFalseIfClickedOutside",(function(e){var n=e.composedPath()[0]&&"cl-date-input"===e.composedPath()[0].id;t.isCalendarDisplayed=n})),dt(t,"showCalendarProgrammatically",(function(e){var n;if(null!==(n=e.target)&&void 0!==n&&n.showPicker){try{e.target.showPicker()}catch(e){return}t.isCalendarDisplayed=!0}})),dt(t,"closeCalendarOnEscapeIfItPresent",(function(e){"Escape"===e.key&&t.isCalendarDisplayed&&(e.preventDefault(),e.stopImmediatePropagation(),t.closeNativeCalendarProgrammatically())})),dt(t,"closeNativeCalendarProgrammatically",(function(){var e=t.getRootElement().querySelector("#cl-date-input");e.setAttribute("type","text"),e.setAttribute("type","date"),t.isCalendarDisplayed=!1})),dt(t,"removeListeners",(function(){window.removeEventListener("click",t.markCalendarDisplayFalseIfClickedOutsideListenerCb),window.removeEventListener("mousewheel",t.markCalendarDisplayFalseListenerCb),window.removeEventListener("keyup",t.closeCalendarOnEscapeIfItPresentListenerCb,!0)})),dt(t,"setCalendarIconStyles",(function(){var e=t.getElement("input").style.color;t.getRootElement().querySelector(".calendar-icon").style.color=e})),t.getRootElement().innerHTML="\n ".concat('\n <style>\n .main-container {\n height: 100%;\n }\n \n .label-and-controls-container {\n height: 100%;\n display: flex;\n position: relative;\n }\n \n .input-ui-override {\n height: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n \n .selected-date-value {\n width: 100%;\n }\n \n input[type="date"] {\n position: absolute;\n left: 0;\n top: 0;\n background: transparent;\n text-indent: 999px;\n opacity: 0.01;\n border: none;\n cursor: pointer;\n }\n \n input[type="date"]::-webkit-calendar-picker-indicator {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n opacity: 0;\n cursor: pointer;\n }\n \n .label {\n min-height: 10px;\n }\n\n .label.cl-focused {\n min-height: auto;\n }\n \n .calendar-placeholder {\n width: 100%;\n }\n \n .cl-calendar-input-control {\n position: relative;\n height: 100%;\n width: 100%;\n min-height: 15px;\n }\n \n .cl-calendar-input-control input {\n width: 100%;\n height: 100%;\n }\n \n .calendar-placeholder {\n color: var(--cl-calendar-input-placeholder-color);\n }\n \n .invalid {\n border: 1px solid #ff0000 !important;\n }\n \n .input-tooltip {\n visibility: hidden;\n position: absolute;\n right: -10px;\n top: -10px;\n z-index: 1;\n border-radius: 100%;\n width: 20px;\n height: 20px;\n display: flex;\n justify-content: center;\n align-items: center;\n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Chrome/Safari/Opera */\n -khtml-user-select: none; /* Konqueror */\n -moz-user-select: none; /* Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none;\n }\n \n input:focus ~ .input-ui-override.focus-outline-defined {\n outline: var(--clFocusOutline);\n }\n </style>\n ',"\n ").concat('\n <div class="main-container">\n <div class="label-and-controls-container">\n \n <div cl-element="label"\n cl-inline-edit="content, label"\n class="label">\n </div>\n \n <div class="cl-calendar-input-control">\n <input id="cl-date-input"\n type="date"\n name="date">\n \n <div class="input-ui-override" cl-element="input">\n <span class="selected-date-value"></span>\n <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"\n class="calendar-icon">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M7.625 5H16.375C18.4696 5 20 6.76142 20 8.71429V16.2857C20 18.2371 18.4702 20 16.375 20H7.625C5.52975 20 4 18.2371 4 16.2857V8.71429C4 6.76142 5.53037 5 7.625 5ZM7.625 7H16.375C17.2688 7 18 7.76716 18 8.71429V16.2857C18 17.232 17.2688 18 16.375 18H7.625C6.73125 18 6 17.232 6 16.2857V8.71429C6 7.76716 6.73125 7 7.625 7Z"\n fill="currentColor"/>\n <path d="M8 3H10V5H8V3Z" fill="currentColor"/>\n <path d="M14 3H16V5H14V3Z" fill="currentColor"/>\n <path d="M10.125 10H8.125V12H10.125V10Z" fill="currentColor"/>\n <path d="M13.125 10H11.125V12H13.125V10Z" fill="currentColor"/>\n <path d="M8.125 13H10.125V15H8.125V13Z" fill="currentColor"/>\n <path d="M13.125 13H11.125V15H13.125V13Z" fill="currentColor"/>\n <path d="M14.125 10H16.125V12H14.125V10Z" fill="currentColor"/>\n </svg>\n </div>\n \n <div class="input-tooltip">\n <svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M1.5 13.0604C1.5 19.4116 6.6481 24.5605 13.0075 24.5605C19.353 24.5605 24.5 19.4107 24.5 13.0604C24.5 6.70865 19.3531 1.55909 13.0075 1.55908C6.64806 1.55908 1.5 6.7077 1.5 13.0604ZM12.9775 17.9668C12.7032 17.9668 12.4807 17.7443 12.4807 17.47C12.4807 17.1956 12.7032 16.9732 12.9775 16.9732C13.2519 16.9732 13.4743 17.1956 13.4743 17.47C13.4743 17.7443 13.2519 17.9668 12.9775 17.9668ZM12.9775 13.4764C12.7032 13.4764 12.4807 13.254 12.4807 12.9796L12.4807 8.48924C12.4807 8.21487 12.7032 7.99245 12.9775 7.99245C13.2519 7.99245 13.4743 8.21487 13.4743 8.48924L13.4743 12.9796C13.4743 13.254 13.2519 13.4764 12.9775 13.4764Z" fill="#FF0000" stroke="white" stroke-width="2"></path>\n </svg>\n </div>\n </div>\n </div>\n </div>\n '," \n "),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&&ct(e,t)}(e,et),t=e,o=[{key:"connectedCallback",value:function(){var t=this;st(e,"connectedCallback",this,3)([]);var n=this.getRootElement(),o=this.getProps();this.registerControl(n);var i=this.registeredControl.value||nt();this.isCalendarDisplayed=!1,this.setUpdatedValueOnChange(n),this.setTime(n,i),this.addCalendarRelatedEventListeners(n),this.observeProps((function(e,i){t.applyAutoAdaptiveStyles(i.adaptiveStyles,i.styles);var r=t.getEnvironment();W(i,r,n,".label-and-controls-container"),$(i,r,t.getHostElement(),t.getElement("input"),t.getElement("label")),function(e){let t;const n=e,o=["transparent","initial"];e&&(e.style.borderColor&&!o.includes(e.style.borderColor)&&(parseFloat(e.style.borderWidth)||parseFloat(e.style.borderBottomWidth))&&(t=G(n,e,"borderColor")),!t&&e.style.getPropertyValue("--borderBottomColor")&&!o.includes(e.style.getPropertyValue("--borderBottomColor"))&&parseFloat(e.style.getPropertyValue("--borderBottomWidth"))&&(t=G(n,e,"--borderBottomColor")),t||!e.style.backgroundColor||o.includes(e.style.backgroundColor)||(t=G(n,e,"backgroundColor")),t||!e.style.color||o.includes(e.style.color)||(t=G(n,e,"color")),t||n.classList.remove("focus-outline-defined"))}(t.getElement("input")),o.content.onlyInFuture?t.setMinTimeRange(n):t.clearMinTimeRange(n),t.setPlaceholder(t.getProps(),t.getEnvironment()),t.setCalendarIconStyles()})),this.observeShared((function(){t.setPlaceholder(t.getProps(),t.getEnvironment()),t.setCalendarIconStyles()})),this.observeEnvironment((function(e,o){var i=t.getProps();W(i,o,n,".label-and-controls-container"),$(i,o,t.getHostElement(),t.getElement("input"),t.getElement("label")),t.setPlaceholder(i,o),t.setCalendarIconStyles()}))}},{key:"disconnectedCallback",value:function(){st(e,"disconnectedCallback",this,3)([]),this.removeListeners()}}],o&&it(t.prototype,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,o}();dt(ht,"define",{name:"sys-calendar",model:tt.name,manifest:tt});export{ht as default};window.clComponentClass_SysCalendarComponent=ht;
1
+ const e="validationStatusChanged",t="touchedStatusChanged",n="cl-";function o(e){return n+e}function i(e){return"cl-"+e}class r{static size(e){return{width:this.width(e),height:this.height(e)}}static width(e){return e=e||document,Math.max(e.documentElement.clientWidth,e.defaultView.innerWidth||0)}static height(e){return e=e||document,Math.max(e.documentElement.clientHeight,e.defaultView.innerHeight||0)}static scrollbarWidth(e){return(e=e||document).defaultView.innerWidth-e.documentElement.clientWidth}}var s=[];for(var l in{transparent:"#0000"})s.push(l);var a="\\s*([.\\d%]+)\\s*",c="\\("+[a,a,a]+"(?:,\\s*([.\\d]+)\\s*)?\\)",d="(?:rgb)a?",p="("+s.join("|")+")";function h(e){return!(!e||"string"==typeof e)&&(e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&"String"!==e.constructor.name))}RegExp(d+c,"i"),RegExp([p,"(?:#([a-f0-9]{3,8}))",d+c,"(?:hsl)a?"+c].join("|"),"gi");var u=Array.prototype.concat,m=Array.prototype.slice,g=function(e){for(var t=[],n=0,o=e.length;n<o;n++){var i=e[n];h(i)?t=u.call(t,m.call(i)):t.push(i)}return t};g.wrap=function(e){return function(){return e(g(arguments))}};const b=g;var f={},y=Object.hasOwnProperty,v=Object.create(null);for(var E in f)y.call(f,E)&&(v[f[E]]=E);var O={to:{},get:{}};function C(e,t,n){return Math.min(Math.max(t,e),n)}O.get=function(e){var t,n;return"hsl"===e.substring(0,3).toLowerCase()?(t=O.get.hsl(e),n="hsl"):(t=O.get.rgb(e),n="rgb"),t?{model:n,value:t}:null},O.get.rgb=function(e){if(!e)return null;var t,n,o,i=[0,0,0,1];if(t=e.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(o=t[2],t=t[1],n=0;n<3;n++){var r=2*n;i[n]=parseInt(t.slice(r,r+2),16)}o&&(i[3]=parseInt(o,16)/255)}else if(t=e.match(/^#([a-f0-9]{3,4})$/i)){for(o=(t=t[1])[3],n=0;n<3;n++)i[n]=parseInt(t[n]+t[n],16);o&&(i[3]=parseInt(o+o,16)/255)}else if(t=e.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(t[n+1],0);t[4]&&(t[5]?i[3]=.01*parseFloat(t[4]):i[3]=parseFloat(t[4]))}else{if(!(t=e.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(t=e.match(/^(\w+)$/))?"transparent"===t[1]?[0,0,0,0]:y.call(f,t[1])?((i=f[t[1]])[3]=1,i):null:null;for(n=0;n<3;n++)i[n]=Math.round(2.55*parseFloat(t[n+1]));t[4]&&(t[5]?i[3]=.01*parseFloat(t[4]):i[3]=parseFloat(t[4]))}for(n=0;n<3;n++)i[n]=C(i[n],0,255);return i[3]=C(i[3],0,1),i},O.get.hsl=function(e){if(!e)return null;var t=e.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(t){var n=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,C(parseFloat(t[2]),0,100),C(parseFloat(t[3]),0,100),C(isNaN(n)?1:n,0,1)]}return null},O.to.rgb=function(){var e=b(arguments);return e.length<4||1===e[3]?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},O.to.hsl=function(){var e=b(arguments);return e.length<4||1===e[3]?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};const T=O,S={},R={};for(const e of Object.keys(S))R[S[e]]=e;const A={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"}};Math.pow(6/29,3);for(const e of Object.keys(A)){if(!("channels"in A[e]))throw new Error("missing channels property: "+e);if(!("labels"in A[e]))throw new Error("missing channel labels property: "+e);if(A[e].labels.length!==A[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:n}=A[e];delete A[e].channels,delete A[e].labels,Object.defineProperty(A[e],"channels",{value:t}),Object.defineProperty(A[e],"labels",{value:n})}A.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,o=e[2]/255,i=Math.min(t,n,o),r=Math.max(t,n,o),s=r-i;let l,a;r===i?l=0:t===r?l=(n-o)/s:n===r?l=2+(o-t)/s:o===r&&(l=4+(t-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]},A.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,o=e[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 e=0;e<3;e++)r=t+1/3*-(e-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[e]=255*s;return a};const P=A;function w(e,t){return function(n){return t(e(n))}}function x(e,t){const n=[t[e].parent,e];let o=P[t[e].parent][e],i=t[e].parent;for(;t[i].parent;)n.unshift(t[i].parent),o=w(P[t[i].parent][i],o),i=t[i].parent;return o.conversion=n,o}const L={};Object.keys(P).forEach((e=>{L[e]={},Object.defineProperty(L[e],"channels",{value:P[e].channels}),Object.defineProperty(L[e],"labels",{value:P[e].labels});const t=function(e){const t=function(e){const t=function(){const e={},t=Object.keys(P);for(let n=t.length,o=0;o<n;o++)e[t[o]]={distance:-1,parent:null};return e}(),n=[e];for(t[e].distance=0;n.length;){const e=n.pop(),o=Object.keys(P[e]);for(let i=o.length,r=0;r<i;r++){const i=o[r],s=t[i];-1===s.distance&&(s.distance=t[e].distance+1,s.parent=e,n.unshift(i))}}return t}(e),n={},o=Object.keys(t);for(let e=o.length,i=0;i<e;i++){const e=o[i];null!==t[e].parent&&(n[e]=x(e,t))}return n}(e);Object.keys(t).forEach((n=>{const o=t[n];L[e][n]=function(e){const t=function(...t){const n=t[0];if(null==n)return n;n.length>1&&(t=n);const o=e(t);if("object"==typeof o)for(let e=o.length,t=0;t<e;t++)o[t]=Math.round(o[t]);return o};return"conversion"in e&&(t.conversion=e.conversion),t}(o),L[e][n].raw=function(e){const t=function(...t){const n=t[0];return null==n?n:(n.length>1&&(t=n),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(o)}))}));const N=L,I=["keyword","gray","hex"],k={};for(const e of Object.keys(N))k[[...N[e].labels].sort().join("")]=e;const M={};function D(e,t){if(!(this instanceof D))return new D(e,t);if(t&&t in I&&(t=null),t&&!(t in N))throw new Error("Unknown model: "+t);let n,o;if(null==e)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof D)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if("string"==typeof e){const t=T.get(e);if(null===t)throw new Error("Unable to parse color from string: "+e);this.model=t.model,o=N[this.model].channels,this.color=t.value.slice(0,o),this.valpha="number"==typeof t.value[o]?t.value[o]:1}else if(e.length>0){this.model=t||"rgb",o=N[this.model].channels;const n=Array.prototype.slice.call(e,0,o);this.color=U(n,o),this.valpha="number"==typeof e[o]?e[o]:1}else if("number"==typeof e)this.model="rgb",this.color=[e>>16&255,e>>8&255,255&e],this.valpha=1;else{this.valpha=1;const t=Object.keys(e);"alpha"in e&&(t.splice(t.indexOf("alpha"),1),this.valpha="number"==typeof e.alpha?e.alpha:0);const o=t.sort().join("");if(!(o in k))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=k[o];const{labels:i}=N[this.model],r=[];for(n=0;n<i.length;n++)r.push(e[i[n]]);this.color=U(r)}if(M[this.model])for(o=N[this.model].channels,n=0;n<o;n++){const e=M[this.model][n];e&&(this.color[n]=e(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}D.prototype={toString(){return this.string()},string(e){let t=this.model in T.to?this:this.rgb();t=t.round("number"==typeof e?e:1);const n=1===t.valpha?t.color:[...t.color,this.valpha];return T.to[t.model](n)},round(e){return e=Math.max(e||0,0),new D([...this.color.map(j(e)),this.valpha],this.model)},alpha(e){return void 0!==e?new D([...this.color,Math.max(0,Math.min(1,e))],this.model):this.valpha},lighten(e){const t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){const t=this.hsl();return t.color[2]-=t.color[2]*e,t}};for(const e of Object.keys(N)){if(I.includes(e))continue;const{channels:t}=N[e];D.prototype[e]=function(...t){return this.model===e?new D(this):t.length>0?new D(t,e):new D([..._(N[this.model][e].raw(this.color)),this.valpha],e)},D[e]=function(...n){let o=n[0];return"number"==typeof o&&(o=U(n,t)),new D(o,e)}}function j(e){return function(t){return function(e,t){return Number(e.toFixed(t))}(t,e)}}function _(e){return Array.isArray(e)?e:[e]}function U(e,t){for(let n=0;n<t;n++)"number"!=typeof e[n]&&(e[n]=0);return e}const F=D;function B(e){const{element:t,html:n,appendHtml:o}=e,i=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);o?t.innerHTML+=i:t.innerHTML=i}function H(e,t){Object.keys(t).forEach((n=>{e.style[n]=t[n]}))}function V(e,t){var n,o;let i;return e.styles&&(i=null===(n=e.styles.find((e=>"label"===e.element)))||void 0===n?void 0:n.params),e.adaptiveStyles&&!i&&(i=null===(o=e.adaptiveStyles[t].find((e=>"label"===e.element)))||void 0===o?void 0:o.params),i}function W(e,t,n,o){const i=n.querySelector(o),r=V(e,t);if(!r)return;const s=n.querySelector(".label");B({element:s,html:e.content.label}),"TOP"===r.position?(i.style.flexDirection="column",i.style.alignItems="unset",H(s,{marginRight:0,marginBottom:`${r.margin}px`})):(i.style.flexDirection="row",i.style.alignItems="center",H(s,{marginRight:`${r.margin}px`,marginBottom:0})),r.enabled?s.style.display="":s.style.display="none"}function $(e,t,n,o,i){const r=function(e,t){var n;let o;if(e.styles){const t=null===(n=e.styles.find((e=>"input"===e.element)))||void 0===n?void 0:n.styleAttributes;(null==t?void 0:t.width)&&(o=t)}if(e.adaptiveStyles&&!o){const n=e.adaptiveStyles[t].find((e=>"input"===e.element)).styleAttributes;(null==n?void 0:n.width)&&(o=n)}return o}(e,t);if(!r)return;const s=V(e,t),l=i&&s&&s.enabled&&"TOP"===s.position?i.getBoundingClientRect().height+s.margin:0;r.width&&(r.width.includes("100%")?(o.style.width="100%",n.style.width=r.width):n.style.width="auto"),r.height&&(r.height.includes("100%")?(o.style.height="100%",n.style.height=r.height):n.style.height=`${parseFloat(r.height)+l}px`)}function G(e,t,n){const o=function(e,t){const n=getComputedStyle(e)[t]||e.style.getPropertyValue(t);if(n&&n.includes("rgb")&&(!(n.split("rgb").length>2)||n.includes("#")))return n}(t,n);if(o){const t=F(o).alpha(.5).string();return e.classList.add("focus-outline-defined"),e.style.setProperty("--clFocusOutline",`3px solid ${t}`),t}return null}function Q(e){const{width:t,height:n}=e.getBoundingClientRect(),{marginBottom:o,marginTop:i,marginLeft:r,marginRight:s}=window.getComputedStyle(e);return{width:t+parseInt(r,10)+parseInt(s,10),height:n+parseInt(i,10)+parseInt(o,10)}}function z(e,t,n,o,i){switch(e.position){case"top":return{left:`${q(t,n,o,i)}px`,top:e.availableSpaceAboveTriggerElem-e.contentHeight-e.verticalOffset+"px"};case"bottom":return{left:`${q(t,n,o,i)}px`,bottom:e.availableSpaceBelowTriggerElem-e.contentHeight-e.verticalOffset+"px"};case"left":return{left:e.availableSpaceToTheLeftSideOfTheTrigger-t.width-e.contentWidth-e.horizontalOffset+"px",top:`${K(0,e)}px`};case"right":return{right:e.availableSpaceToTheRightSideOfTheTrigger-e.contentWidth-e.horizontalOffset+"px",top:`${K(0,e)}px`}}}function q(e,t,n,o){let i=n?e.x+e.width/2-t.width/2:e.x;return i<0&&(i=0),i+t.width>r.width(o)&&(i-=i+t.width-r.width(o)),i}function K(e,t){let n=t.availableSpaceAboveTriggerElem;return t.contentHeight>t.availableSpaceBelowTriggerElem&&(n-=t.contentHeight-t.availableSpaceBelowTriggerElem),n}const Z="cl-tooltip-text-styles",J=`\n .cl-tooltip-text {\n z-index: ${Number.MAX_SAFE_INTEGER};\n width: max-content;\n height: fit-content;\n visibility: hidden;\n background-color: white;\n color: #000;\n border: 1px solid rgb(194, 194, 194);\n border-radius: 5px;\n padding: 5px 10px;\n position: fixed;\n max-width: 300px;\n max-height: 100vh;\n box-shadow: 0 1px 5px rgba(0,0,0,.28);\n font-size: 14px;\n }\n\n .cl-tooltip-text[cl-tooltip-position='top']:before {\n content: "";\n position: absolute;\n top: 100%;\n left: calc(50% - 13px);\n border-width: 12px;\n border-style: solid;\n border-color: rgb(194, 194, 194) transparent transparent transparent;\n }\n \n .cl-tooltip-text[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: 12px;\n border-style: solid;\n border-color: white transparent transparent transparent;\n }\n\n .cl-tooltip-text[cl-tooltip-position='bottom']:before {\n content: "";\n position: absolute;\n top: -24px;\n left: calc(50% - 9px);\n border-width: 12px;\n border-style: solid;\n border-color: transparent transparent rgb(194, 194, 194) transparent;\n }\n \n .cl-tooltip-text[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: 12px;\n border-style: solid;\n border-color: transparent transparent white transparent;\n }\n`;function Y(e,t,n,o){let i;o=o||document,e.classList.add("invalid"),t.style.visibility="visible",t.onmouseenter=()=>{(function(e){if((e=e||document).head.querySelector(`#${Z}`))return;const t=document.createElement("style");t.setAttribute("id",Z),B({element:t,html:J}),e.head.appendChild(t)})(o),i=function(e){const t="cl-overlay-tooltip-text",n=document.getElementById(t)||document.createElement("div");return n.classList.add("cl-tooltip-text"),n.textContent!==e&&(n.textContent=e,n.style=null),n.id||(n.id=t),n}(n),o.body.append(i),i.style.visibility="visible",function(e){const{triggerElement:t,tooltipElement:n,offset:o=10,htmlDocumentObject:i}=e,s=function(e,t,n,o,i,s){const l=function(e,t,n,o,i){const s=function(e,t,n,o){const i=r.width(o),{right:s}=e.getBoundingClientRect(),l=i-n-s-r.scrollbarWidth(o);return{horizontalOffset:n,contentWidth:Q(t).width,availableSpaceToTheLeftSideOfTheTrigger:s-n,availableSpaceToTheRightSideOfTheTrigger:l}}(e,t,n,i),l=function(e,t,n,o){const i=r.height(o),{top:s,bottom:l}=e.getBoundingClientRect();return{verticalOffset:n,contentHeight:Q(t).height,availableSpaceAboveTriggerElem:s-n,availableSpaceBelowTriggerElem:i-l-n}}(e,t,n,i);let a="undefined";const c={bottom:l.availableSpaceBelowTriggerElem>=l.contentHeight,top:l.availableSpaceAboveTriggerElem>=l.contentHeight,right:s.availableSpaceToTheRightSideOfTheTrigger>=s.contentWidth,left:s.availableSpaceToTheLeftSideOfTheTrigger>=s.contentWidth};if(c.top?a="top":c.bottom?a="bottom":c.right?a="right":c.left&&(a="left"),c[o]&&(a=o),"undefined"===a){const e=Math.max(l.availableSpaceBelowTriggerElem,l.availableSpaceAboveTriggerElem,s.availableSpaceToTheRightSideOfTheTrigger,s.availableSpaceToTheLeftSideOfTheTrigger);e===l.availableSpaceBelowTriggerElem?a="bottom":e===l.availableSpaceAboveTriggerElem?a="top":e===s.availableSpaceToTheRightSideOfTheTrigger?a="right":e===s.availableSpaceToTheLeftSideOfTheTrigger&&(a="left")}return Object.assign(Object.assign(Object.assign({},l),s),{position:a})}(e,t,n,o,s=s||document);return function(e,t){const{marginBottom:n,marginTop:o}=window.getComputedStyle(t);if("top"===e.position)H(t,{"margin-top":`${parseInt(o,10)+parseInt(n,10)}px`}),H(t,{"margin-bottom":"0px"});else if("bottom"===e.position)H(t,{"margin-bottom":`${parseInt(n,10)+parseInt(o,10)}px`}),H(t,{"margin-top":"0px"});else{const e=(parseInt(n,10)+parseInt(o,10))/2+"px";H(t,{"margin-top":e,"margin-bottom":e})}}(l,t),{coordinates:z(l,e.getBoundingClientRect(),t.getBoundingClientRect(),i,s),position:l.position}}(t,n,o,"top",!0,i);n.setAttribute("cl-tooltip-position",s.position),H(n,s.coordinates)}({triggerElement:t,tooltipElement:i,htmlDocumentObject:o})},t.onmouseleave=()=>{i&&(i.remove(),function(e){const t=(e=e||document).head.querySelector(`#${Z}`);t&&t.remove()}(o))}}function X(e){return[e.getConfig("appearanceLanguage"),e.getConfig("browserLanguage"),"en"].filter((e=>!!e))}function ee(e,t){return t.reduce(((t,n)=>{if(t)return t;const o=function(e,t){if(!e)return null;if(t[e])return{translations:t[e],language:e};const n=te(e);return t[n]?{translations:t[n],language:n}:null}(n,e);return o||null}),null)}function te(e){return e.includes("-")?e.split("-")[0].toLowerCase():e.includes("_")?e.split("_")[0].toLowerCase():e}const ne="VIEW",oe="MODULE",ie="CONTAINER",re="INPUT",se="BUTTON",le="CONSENT",ae="COLUMN",ce="SUBSCRIBE_CONTACT",de="REQUEST",pe="SHOW_WIDGET",he="OPEN_LINK",ue="CLOSE_WIDGET";class me{static sortActions(e){const t={[ue]:-1,[he]:-2,[pe]:1,[ce]:2,[de]: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=me.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(),r=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"))!==r;){let e=t[n].getAttribute(i("type"));if(me.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,o;try{for(var i,r=!0,s=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={},o("next"),o("throw"),o("return"),t[Symbol.asyncIterator]=function(){return this},t);function o(n){t[n]=e[n]&&function(t){return new Promise((function(o,i){!function(e,t,n,o){Promise.resolve(o).then((function(t){e({value:t,done:n})}),t)}(o,i,(t=e[n](t)).done,t.value)}))}}}(this.eventsQueue);!(e=(i=await s.next()).done);){o=i.value,r=!1;try{const{event:e}=o;for(const t of this.actions)if(!await t.execute(this.state.getState(),e))break}finally{r=!0}}}catch(e){t={error:e}}finally{try{r||e||!(n=s.return)||await n.call(s)}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=[])}}me.IGNORING_VIEW_ENTRY_TYPES=[se,le,re];const ge="CLICK",be="COMPONENT_EVENT";class fe{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 ye{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 ge:return new me(e,t);case be:return new fe(e,t);default:throw new Error(`Not supported handler type ${e.type}`)}}}class ve{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 Ee{constructor(){this.listeners=Ee.createDefaultListenersState()}emit(e,t,n=null){const o=this.listeners[e];o&&Object.values(o).forEach((o=>o(t,e,n))),Object.values(this.listeners["*"]).forEach((o=>o(t,e,n)))}on(e,t){const n=ve.generate(),o=this.listeners[e];return o?o[n]=t:this.listeners[e]={[n]:t},{off:()=>{var t,o;(null===(o=null===(t=this.listeners)||void 0===t?void 0:t[e])||void 0===o?void 0:o[n])&&delete this.listeners[e][n]}}}destroy(){this.listeners=Ee.createDefaultListenersState()}}Ee.createDefaultListenersState=()=>({"*":{}});const Oe=(e,t,n,o)=>{const{addEventListenerBase:i,addEventListener:r}=EventTarget.prototype;(i||r).call(e,t,n,o)};class Ce{constructor(e){this.state=e||{}}getState(){return this.state}setState(e){this.state=Object.assign(Object.assign({},this.state),e)}destroy(){}}class Te{static extract(e){const t=e.views.map((e=>{const t=e.children.map((e=>e.type===oe?Object.assign(Object.assign({},e),Te.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})}}Te.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"};class Se extends Ee{constructor(e,t){super(),this.config=t,this.handleMobileBreakpoint(e.getShared().mobileBreakpointWidth),e.on("ENVIRONMENT_UPDATE",(({isMobileEnv:e})=>{this._isMobile=e,this.emit(Se.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(Se.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(e){this._isMobile=e.matches,this.emit(Se.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}Se.changeEventName="CHANGE";class Re{static set(e,t){const n=e[Re.accumulatorPropertyName]||{};e[Re.accumulatorPropertyName]=Object.assign(Object.assign({},n),t.styleAttributes),Object.keys(e[Re.accumulatorPropertyName]).forEach((n=>{n.includes("--")?e.style.setProperty(n,t.styleAttributes[n]||""):e.style[n]=t.styleAttributes[n]?t.styleAttributes[n]:""}))}}Re.accumulatorPropertyName="clStyleAttributes";const Ae="CONTENT_LOCKER";class Pe{static applyHostStyles(e,t,n=null,o){var i,r,s;const l=null===(r=null===(i=null==n?void 0:n.props)||void 0===i?void 0:i.handlers)||void 0===r?void 0:r.find((e=>"CLICK"===e.type));l&&(null===(s=l.actions)||void 0===s?void 0:s.length)&&(t.style.cursor="pointer"),e!==ne&&e!==ie&&e!==ae||(t.style.display=o===Ae&&e===ne?"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 we{static log(e){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(e)):console.error(e)}}class xe{constructor(e,t,n,o,i,r){this.hostElement=t,this.documentModel=e,this.getSharedCb=n,this.getPropsCb=o,this.getEnvCb=i,this.httpClient=r,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 o,i,r,s,l;const a=null===(i=null===(o=t.adaptiveStyles)||void 0===o?void 0:o[e])||void 0===i?void 0:i.find((e=>e.element===n)),c=(null===(r=t.styles)||void 0===r?void 0:r.find((e=>e.element===n)))||{},d=(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),p=this.parseBackground(d);p.url&&this.envUrlMaps[e].set(n,{originalSVGResourceURL:p.url,inlineSvgString:null,positionOptions:p.positionOptions})})),Promise.all([...this.envUrlMaps[e].entries()].map((([t,n])=>this.httpClient.execute(n.originalSVGResourceURL).then((e=>e.text())).then((o=>{this.envUrlMaps[e].set(t,Object.assign(Object.assign({},n),{inlineSvgString:o}))}))))).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),we.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&&(this.hostElement.style.background=this._buildBackgroundUrl(e,t))}_buildBackgroundUrl(e,t){const n=e.inlineSvgString.trim().replace("var(--cl-schema-accent)",t.accent);return`url('data:image/svg+xml,${encodeURIComponent(n)}')${e.positionOptions}`}}const Le=new class{execute(e,t,n=null,o,i){const r={method:t,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(e,r)}};function Ne(e,t){return Object.keys(e).filter((e=>!t.includes(e))).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:e[n]})),{})}class Ie{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 ke{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 Me="COMPONENT_RESOURCES_LOADED",De="FAILED_TO_LOAD_COMPONENT_RESOURCE";class je{constructor(e,t,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=e=>{0===e&&this.systemEventEmitter.emit(Me,this.componentId)},this.onResourceLoadFailure=e=>{this.isStaticEntryModule?this.systemEventEmitter.emit(De,`Failed to load: ${e}`):this.counters.pending.decrement()},this.componentId=e,this.systemEventEmitter=t,this.isStaticEntryModule=n,this.counters={pending:new ke(this.onCounterStateUpdate)}}}const _e=(...e)=>{let t=e.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:[]})),{});return{get:e=>t[e],clear:()=>_e(...e)}},Ue=_e,Fe="props",Be="shared",He="environment";function Ve(e,t,n,o){const i=e=>{let r=e instanceof DocumentFragment||(null==e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?e.host:e;return r&&(o&&"function"==typeof o?o(r.getAttribute(t)):(null===(s=null==r?void 0:r.getAttribute)||void 0===s?void 0:s.call(r,t))===n)?r:r&&r.parentNode&&i(r.parentNode)||null;var s};return i(e)}const We="SUBMIT";function $e(e,t){return t?(e.classes=`${e.classes||""} ${t.classes||""}`.trim(),Object.keys(t).forEach((n=>{"element"!==n&&"classes"!==n&&(t[n]&&"object"==typeof t[n]&&!Array.isArray(t[n])?e[n]=Object.assign(Object.assign({},e[n]||{}),t[n]):e[n]=t[n])})),e):e}const Ge={DESKTOP:"desktop",MOBILE:"mobile"};function Qe(e,t,n){var o;return null===(o=e[t])||void 0===o?void 0:o.find((e=>e.element===n))}function ze(e=[]){return e.map((e=>Object.assign(Object.assign({},e),{styleAttributes:Object.assign({},e.styleAttributes)})))}class qe extends Event{constructor(e,t,n){super(e,n),this.detail={},Object.defineProperty(this,"detail",{value:t})}}class Ke extends HTMLElement{constructor(){var e,t;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 r;o&&(r=o.getAttribute(i("widget-id")));let s=new qe("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(i("path")),id:t,widgetId:r},{bubbles:!0,composed:!0});this.dispatchEvent(s),e=s.detail.props,Object.assign(this,e),this.observers=Ue(Fe,Be,He),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 Ce,this.componentEventEmitter=new Ee,this.componentResourceManager=new je(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 ye(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(Fe).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(Be).forEach((e=>e(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new xe(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),Le),this.colorSchemaListener.apply(this.getEnvironment()).then((()=>{this.subscriptions.push(this.colorSchemaListener.on())}))),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(Se.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const e=this.getEnvironment();this.observers.get(He).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(Fe).push(e),e(null,this.prevProps)},this.observeShared=e=>{this.observers.get(Be).push(e),e(this.getShared())},this.observeEnvironment=e=>{this.observers.get(He).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;e=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 o=!1,i=!1;n.desktop&&n.desktop.forEach((n=>{n.element===t&&($e(n,e),o=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===t&&($e(n,e),i=!0)})),!o&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(e))),!i&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(e)))})),n}(e,t);const o=i("type"),r="element-styles";let s=this.getRootElement().querySelector(`style[${o}="${r}"]`);s||(s=document.createElement("style"),s.setAttribute(o,r),this.getRootElement().appendChild(s)),B({element:s,html:""}),n.forEach((t=>{let n=t.getAttribute(i("element"));const o=this.getEnvironment();let r=Qe(e,o,n);if(r){if(this.resizeListener.isMobile()){const t=Qe(e,"desktop",n);t&&(r=Object.assign(Object.assign({},r),{styleAttributes:Object.assign(Object.assign({},t.styleAttributes),r.styleAttributes)}))}this.applyStylesToElement(t,this.applySharedClassesToElementModel(r),s)}})),this._addLinkColor(s,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,o]of Object.entries(t))e.style[n]=o;return!0},this.applyStylesToElement=(e,t,n)=>{var o,r;const s=[];"host"===(t=Ke._resolveTogglableStylesForElementModel(t)).element&&(Pe.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===(r=this.model.props.backgroundDynamicInlineSVGElements)||void 0===r?void 0:r.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),s.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],Oe(e,"load",(()=>{this.componentResourceManager.getPending().decrement()})),Oe(e,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(e.src),"UPDATING"===this.services.config.getConfig("entryModuleType")&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},t),{styleAttributes:Ne(t.styleAttributes,s)});if(Re.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 r=this.getRootElement().querySelector(`#${i}`);r||(r=document.createElement("style"),r.id=i,e.appendChild(r)),B({element:r,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._fixMarginOverflow=e=>{const t=this.getParentComponent(),n=t&&("flex"===t.style.display||"inline-flex"===t.style.display),o="host",r=e.getAttribute(i("element"))===o;if(!n||!r)return;const s=this.getProps(),l=this.getEnvironment(),{styleAttributes:a}=Qe(s.adaptiveStyles,l,o)||{};if(!a)return;const c=a.marginLeft||a.marginRight,d="100%"===a.width;if(c&&d){const t=(parseFloat(a.marginLeft)||0)+(parseFloat(a.marginRight)||0);t&&setTimeout((()=>{e.style.width=`calc(100% - ${t}px)`}))}},this.applySharedClassesToElementModel=e=>function(e,t){let o=e;return(o.classes||"").split(" ").filter((e=>e.startsWith(n))).forEach((e=>{var n;let i=null===(n=t.textClasses)||void 0===n?void 0:n[e];i&&(i.styleAttributes.fontFamily||(i.isHeader&&t.headerFontFamily&&(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),{fontFamily:t.headerFontFamily})})),!i.isHeader&&t.textFontFamily&&(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),{fontFamily:t.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:t.textFontFamily})})),o}(e,this.documentModel.getShared()),this.getModel=()=>this.model,this._addStylesToStyleElement=(e,t,n,o="",r)=>{const s=Object.keys(n).reduce(((e,t)=>e+` ${Ie.camelCaseToDashCase(t)}: ${n[t]}${r?" !important;":";"}`),"");B({element:e,html:`[${i("element")}="${t}"]${o} { ${s} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(e,t)=>{B({element:e,html:`[cl-type] {font-family:${t.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(e,t)=>{var n,o,i,r;t.linkColor&&B({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)&&B({element:e,html:`a {color: ${null===(o=t.linkParams)||void 0===o?void 0:o.color}}, a:visited {color: ${null===(i=t.linkParams)||void 0===i?void 0:i.color}}`,appendHtml:!0}),(null===(r=t.linkParams)||void 0===r?void 0:r.removeUnderline)&&B({element:e,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(e,t)=>{Array.from(e.classList).filter((e=>e!==o("hovered")&&e!==o("focused"))).forEach((t=>{t.startsWith(n)&&e.classList.remove(t)}));const i=((e.getAttribute("class")||"")+" "+t.classes).trim();e.setAttribute("class",i)},this.getParentComponent=()=>Ve(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:Ve(this.parentNode,i("path"),void 0,(e=>e&&1===e.split(",").length))},this.getWidgetLanguages=()=>X(this.services.config),this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=e=>ee(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;const o=e.control.name;if(["email","first_name","last_name"].includes(o))return o.toUpperCase();if(e.content.label&&(null===(n=null===(t=e.adaptiveStyles.desktop.find((e=>"label"===e.element)))||void 0===t?void 0:t.params)||void 0===n?void 0:n.enabled)){const t=(new DOMParser).parseFromString(e.content.label,"text/html");return this.capitalizeFirstLetter(t.body.textContent||"")}return e.content.placeholder?this.capitalizeFirstLetter(e.content.placeholder):e.control.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=>{switch(e.control.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===We));n?null==n||n.execute(void 0,void 0,!0,t):this.services.actionFactory.get({type:de}).execute(void 0,void 0,!0,t)},this.getHandlers=()=>this.getProps().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===(t=this.constructor.define)||void 0===t?void 0:t.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()}static _resolveTogglableStylesForElementModel(e){const t=Object.assign({},e);return Object.keys(t).forEach((e=>{e.toLowerCase().includes("styleattributes")&&(t[e]=Ke._resolveTogglableStyles(t[e]))})),t}static _resolveTogglableStyles(e){const t=Object.assign({},e),n=(e,n,o)=>{n in t&&(e.forEach((e=>{e in t&&(t[e]=t[n]?t[e]:o)})),delete t[n])};return n(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),n(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),t}}const Ze=Symbol("required");var Je=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(n[o[i]]=e[o[i]])}return n};function Ye(){}const Xe="pending",et="valid",tt="invalid";class nt extends Ke{constructor(){super(...arguments),this._createControl=(e={},...t)=>{var{element:n}=e,o=Je(e,["element"]);const i=this.getProps(),r=this.getModel(),s=Object.assign(Object.assign(Object.assign({},i.control),{componentId:r.id,viewIdx:r.path[0]}),o),l=this.services.form,a=[s,n,...t];return l.hasControl(i.control.name)?l.updateControl(...a):l.registerControl(...a)},this.createControlWithValidation=(e=[],t={})=>{var{element:n=this.getElement("input"),tooltipElement:o=this.getRootElement().querySelector(".input-tooltip"),validCallback:i=Ye,invalidCallback:r=Ye,pendingCallback:s=Ye,elementToListen:l=n,validationMap:a={},listenStatusChange:c=!0}=t,d=Je(t,["element","tooltipElement","validCallback","invalidCallback","pendingCallback","elementToListen","validationMap","listenStatusChange"]);if(o&&(o.style.visibility="hidden"),!e||!Array.isArray(e))throw new Error("Validators should be an array");const p=this.getProps().control.validation,h=a[null==p?void 0:p.validator],u=e.some((e=>e[Ze])),m=!!(null==p?void 0:p.required),g=m||u,b=[...e];m&&!u&&b.unshift(function(e="REQUIRED"){const t=t=>{let n;switch(typeof t){case"string":n=t&&t.length>0;break;case"boolean":n=t;break;case"number":n=!isNaN(t);break;default:n=!!t}return{isValid:n,errorKey:n?null:e}};return t[Ze]=!0,t}()),h&&b.push(h);const f=this._prepareAsyncValidators(b),y=this._createControl({element:n,validation:{validator:"custom",required:g}},void 0,f);return c&&this._handleControlStatusChange(Object.assign({control:y,element:l,tooltipElement:o,configService:this.services.config,i18n:this.manifest.i18n,validCallback:i,invalidCallback:r,pendingCallback:s},d)),y},this._prepareAsyncValidators=(e=[])=>e.reduce(((e,t,n)=>"function"!=typeof t?(console.warn(`Validator ${n} should be a function, so it will be skipped`),e):(e[`custom_${n}`]=async(...e)=>{const n=await Promise.resolve(t(...e));return"object"==typeof n&&"isValid"in n?Object.assign(Object.assign({},n),{errorKey:n.isValid?null:n.errorKey}):{isValid:!1,errorKey:"INVALID_VALIDATOR_RESPONSE"}},e)),{}),this._handleControlStatusChange=n=>{n.control.on(e,(e=>{this._handleValidationStatus(n,e)})),n.control.on(t,(()=>{let e=Xe;switch(!0){case n.control.pending:e=Xe;break;case n.control.valid:e=et;break;default:e=tt}this._handleValidationStatus(n,e)}))},this._handleValidationStatus=(e,t)=>{const{control:n,element:o,tooltipElement:i,validCallback:r,invalidCallback:s,errorMessageMapper:l,pendingCallback:a}=e,c=this.services.config,d=this.manifest.i18n;switch(t){case et:(function(e,t){e.classList.remove("invalid"),t.style.visibility="hidden"})(o,i),r&&r();break;case tt:if(n.touched){const e=n.getErrorKeys();if(!e)break;const t=e[0];let r=function(e,t,n){const o=ee(t,X(e)).translations,i=Object.keys(o).find((e=>e.includes(n)));return i?o[i]:n}(c,d,t);l&&(r=l(t,r)),Y(o,i,r,this.htmlDocumentObject),s&&s()}break;case Xe:n.touched&&(function(e,t){t.style.visibility="hidden",e.classList.contains("invalid")&&e.classList.remove("invalid")}(o,i),a&&a())}}}}const ot={name:"SysCalendarComponent",componentType:"INPUT",version:"1.0.0",mappingTypes:["DATE"],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:"input"},{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:"input"},{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:"input",elementProp:"styleAttributes",params:{width:{options:["fixed","fill"]},height:{options:["fixed","fill"]}}},{type:"CONTROL",name:"TEXT_PARAMS",params:[{element:"input",showPlaceholderControl:!0,isLineSpaceAvailable:!0,isTextTransformAvailable:!0},{element:"label",displayCondition:"return !!sdk.component.getProps().styles.find(element => element.element === 'label').params.enabled",isLineSpaceAvailable:!0,isTextTransformAvailable:!0}]},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=input]","styleAttributes"]},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=input]","styleAttributes"]},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=input]","styleAttributes"]},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=input]","styleAttributes"]},{type:"CONTROL",name:"INPUT_LABEL",propPath:["styles","[element=label]","params"]},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"input",params:{indentationType:"PADDING",horizontalOnly:!0}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"}}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SIZE",element:"input",elementProp:"styleAttributes",params:{width:{options:["fixed","fill"]},height:{options:["fixed","fill"]}}},{type:"CONTROL",name:"TEXT_PARAMS",params:[{element:"input",showPlaceholderControl:!0,isLineSpaceAvailable:!0,isTextTransformAvailable:!0},{element:"label",displayCondition:"return !!sdk.component.getProps().styles.find(element => element.element === 'label').params.enabled",isLineSpaceAvailable:!0,isTextTransformAvailable:!0}]},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=input]","styleAttributes"]},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=input]","styleAttributes"]},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=input]","styleAttributes"]},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=input]","styleAttributes"]},{type:"CONTROL",name:"INPUT_LABEL",propPath:["styles","[element=label]","params"]},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"input",params:{indentationType:"PADDING",horizontalOnly:!0}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"}}]}],general:[{type:"CONTROL",name:"INTEGRATION_FIELD_MAPPING",params:{integrationNamePropPath:["control","integrationName"],groupNamePropPath:["control","groupName"],fieldNamePropPath:["control","fieldName"],fieldTypePropPath:["control","fieldType"],validationPropPath:["control","validation"],placeholderPropPath:["content","placeholder"],labelPropPath:["content","label"],optionsPropPath:["control","options"]}},{type:"CONTROL",name:"INPUT_VALIDATION",params:{validationPropPath:["control","validation"],fieldTypePropPath:["control","fieldType"],required:!0}},{type:"CONTROL",name:"SWITCH",propPath:["content","onlyInFuture"],params:{label:"DOCUMENT_ONLY_IN_FUTURE"}}]},autoContrast:[{slave:{element:"input",elementProp:"styleAttributes",elementSubProp:"color"},master:{element:"input",propPath:["styles","[element=input]","styleAttributes","background"]},enabledPropPath:["content","textContrastEnabled"]},{slave:{element:"input",elementProp:"placeholderStyleAttributes",elementSubProp:"color",dimmed:!0},master:{element:"input",propPath:["styles","[element=input]","styleAttributes","background"]},enabledPropPath:["content","placeholderTextContrastEnabled"]}],focusableElements:["input","label"],events:{dispatch:[],listen:[]},i18nPropPaths:["content,label"],i18n:{en:{"control,validation,validationErrors,REQUIRED":"Required field","content,label":"Title"},ru:{"control,validation,validationErrors,REQUIRED":"Обязательное поле","content,label":"Заголовок"},uk:{"control,validation,validationErrors,REQUIRED":"Обов'язкове поле","content,label":"Заголовок"},es:{"control,validation,validationErrors,REQUIRED":"Campo obligatorio","content,label":"Título"},de:{"control,validation,validationErrors,REQUIRED":"Pflichtfeld","content,label":"Titel"},fr:{"control,validation,validationErrors,REQUIRED":"Champs requis","content,label":"Titre"},it:{"control,validation,validationErrors,REQUIRED":"Campo obbligatorio","content,label":"Titolo"},pt:{"control,validation,validationErrors,REQUIRED":"Campo obrigatório","content,label":"Título"},ro:{"control,validation,validationErrors,REQUIRED":"Câmp obligatoriu","content,label":"Titlu"},bg:{"control,validation,validationErrors,REQUIRED":"Изисквано поле","content,label":"Заглавие"},cs:{"control,validation,validationErrors,REQUIRED":"Vyžadované pole","content,label":"Titul"},el:{"control,validation,validationErrors,REQUIRED":"Απαιτητό πεδίο","content,label":"Τίτλος"},nl:{"control,validation,validationErrors,REQUIRED":"Verplicht veld","content,label":"Titel"},pl:{"control,validation,validationErrors,REQUIRED":"Wymagane pole","content,label":"Tytuł"},sv:{"control,validation,validationErrors,REQUIRED":"Obligatoriskt fält","content,label":"Tytuł"},tr:{"control,validation,validationErrors,REQUIRED":"Gerekli alan","content,label":"Başlık"},ar:{"control,validation,validationErrors,REQUIRED":"الحقل المطلوب","content,label":"عنوان"},zh:{"control,validation,validationErrors,REQUIRED":"必填字段","content,label":"Title"},da:{"control,validation,validationErrors,REQUIRED":"Påkrævet felt","content,label":"Titel"},he:{"control,validation,validationErrors,REQUIRED":"שדה נדרש","content,label":"Title"},fi:{"control,validation,validationErrors,REQUIRED":"Vaadittu kenttä","content,label":"Title"},hi:{"control,validation,validationErrors,REQUIRED":"आवश्यक फील्ड","content,label":"Title"},hr:{"control,validation,validationErrors,REQUIRED":"Obavezno polje","content,label":"Title"},hu:{"control,validation,validationErrors,REQUIRED":"Kötelező mező","content,label":"Title"},id:{"control,validation,validationErrors,REQUIRED":"Bidang yang wajib diisi","content,label":"Title"},ja:{"control,validation,validationErrors,REQUIRED":"必須フィールド","content,label":"Title"},ko:{"control,validation,validationErrors,REQUIRED":"필수 칸","content,label":"Title"},no:{"control,validation,validationErrors,REQUIRED":"Obligatorisk felt","content,label":"Title"},sk:{"control,validation,validationErrors,REQUIRED":"Povinné pole","content,label":"Title"},sl:{"control,validation,validationErrors,REQUIRED":"Obvezno polje","content,label":"Title"},sr:{"control,validation,validationErrors,REQUIRED":"Obavezno polje","content,label":"Title"}},props:{content:{label:"Title",onlyInFuture:!0,textContrastEnabled:!0,placeholderTextContrastEnabled:!0},control:{name:"calendar",integrationName:"calendar",defaultValue:null,validation:{required:!0,validator:"SYS_CALENDAR"}},styles:[{element:"input",styleAttributes:{background:"rgb(255, 255, 255)",borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"1px",borderTopColor:"var(--cl-schema-background-7, rgba(0, 0, 0, 0.1))",borderBottomWidth:"1px",borderBottomColor:"var(--cl-schema-background-7, rgba(0, 0, 0, 0.1))",borderLeftWidth:"1px",borderLeftColor:"var(--cl-schema-background-7, rgba(0, 0, 0, 0.1))",borderRightWidth:"1px",borderRightColor:"var(--cl-schema-background-7, rgba(0, 0, 0, 0.1))",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none"}},{element:"label",params:{enabled:!1,position:"TOP",margin:5}}],adaptiveStyles:(it=[{element:"host",styleAttributes:{marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1},classes:""},{element:"input",styleAttributes:{width:"100%",minWidth:null,height:"35px",minHeight:"35px",color:"var(--cl-schema-text, rgb(0, 0, 0))",textAlign:"start",lineHeight:"120%",fontWeight:"400",fontSize:"16px",textShadow:"none"},placeholderStyleAttributes:{color:"var(--cl-schema-background-4, rgb(81, 81, 81))"},classes:""},{element:"label",styleAttributes:{color:"var(--cl-schema-text, rgb(0, 0, 0))",textAlign:"start",lineHeight:"120%",fontWeight:"400",fontSize:"16px",textShadow:"none"},classes:""}],Object.values(Ge).reduce(((e,t)=>Object.assign(e,{[t]:ze(it)})),{[Ge.DESKTOP]:[],[Ge.MOBILE]:[]}))},metaDescription:{icon:"/SysCalendarComponent/assets/img/calendar-component-icon.svg",label:{en:"Calendar",ru:"Календарь",uk:"Календар",es:"Calendario",de:"Kalender",fr:"Calendrier",it:"Calendario",pt:"Calendário",ro:"Calendar",bg:"Календар",cs:"Kalendář",el:"Ημερολόγιο",nl:"Kalender",pl:"Kalendarz",sv:"Kalender",tr:"Takvim",ar:"التقويم",zh:"日历",da:"Kalender",he:"לוח שנה",fi:"Kalenteri",hi:"कैलेंडर",hr:"Kalendar",hu:"Naptár",id:"Kalender",ja:"カレンダー",ko:"달력",no:"Kalender",sk:"Kalendár",sl:"Koledar",sr:"Kalendar"}}};var it;function rt(e){return(e?new Date(e):new Date).toISOString().slice(0,10)}function st(e){return st="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},st(e)}function lt(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,mt(o.key),o)}}function at(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(at=function(){return!!e})()}function ct(e,t,n,o){var i=dt(pt(1&o?e.prototype:e),t,n);return 2&o&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function dt(){return dt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var o=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=pt(e)););return e}(e,t);if(o){var i=Object.getOwnPropertyDescriptor(o,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},dt.apply(null,arguments)}function pt(e){return pt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},pt(e)}function ht(e,t){return ht=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ht(e,t)}function ut(e,t,n){return(t=mt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mt(e){var t=function(e){if("object"!=st(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=st(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==st(t)?t:t+""}var gt=function(){function e(){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ut(t=function(e,t,n){return t=pt(t),function(e,t){if(t&&("object"==st(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,at()?Reflect.construct(t,n||[],pt(e).constructor):t.apply(e,n))}(this,e),"manifest",ot),ut(t,"registeredControl",void 0),ut(t,"isCalendarDisplayed",!1),ut(t,"DEFAULT_PLACEHOLDER_VALUE",{en:"Choose a date",ru:"Выберите дату",uk:"Оберіть дату",es:"Elige una fecha"}),ut(t,"markCalendarDisplayFalseIfClickedOutsideListenerCb",void 0),ut(t,"markCalendarDisplayFalseListenerCb",void 0),ut(t,"closeCalendarOnEscapeIfItPresentListenerCb",void 0),ut(t,"setPlaceholder",(function(e,n){t.setCalendarPlaceholder(),t.applyPlaceholderColor(e,n)})),ut(t,"applyPlaceholderColor",(function(e,o){var i=function(e,t,o){let i="rgb(0, 0, 0)";const r=e.adaptiveStyles[t].find((e=>"input"===e.element));if(r.placeholderStyleAttributes&&r.placeholderStyleAttributes.color)return r.placeholderStyleAttributes.color;const s=(r.classes||"").split(" ").filter((e=>e.startsWith(n)));if(!s.length)return i;let l=o.textClasses[s[0]];return l&&l.placeholderStyleAttributes&&l.placeholderStyleAttributes.color?l.placeholderStyleAttributes.color:i}(e,o,t.getShared());t.getHostElement().style.setProperty("--cl-calendar-input-placeholder-color",i)})),ut(t,"setCalendarPlaceholder",(function(){var e=t.getRootElement().querySelector(".selected-date-value"),n=t.registeredControl.getValue();if(e&&!n){var o=t.getTranslationsMap(t.DEFAULT_PLACEHOLDER_VALUE).translations;B({element:e,html:'<span class="calendar-placeholder" style="color: var(--cl-calendar-input-placeholder-color)">'.concat(o,"</span>")})}})),ut(t,"registerControl",(function(e){"UPDATING"===t.services.config.getConfig("entryModuleType")&&(e.querySelector("#cl-date-input").style.pointerEvents="none");var n=e.querySelector(".input-ui-override");t.registeredControl=t.createControlWithValidation([],{element:t.getHostElement()},{elementToListen:n})})),ut(t,"formatCurrentLocaleDate",(function(e,t){var n=te(e),o=t?new Date(t+"T00:00:00Z"):new Date;return new Intl.DateTimeFormat(n,{timeZone:"UTC",year:"numeric",month:"numeric",day:"numeric"}).format(o)})),ut(t,"setTime",(function(e,n){var o=e.querySelector("#cl-date-input");o.value=n,o.dispatchEvent(new Event("change")),t.registeredControl.setValue(n)})),ut(t,"setMinTimeRange",(function(e){e.querySelector("#cl-date-input").min=rt()})),ut(t,"clearMinTimeRange",(function(e){e.querySelector("#cl-date-input").removeAttribute("min")})),ut(t,"setUpdatedValueOnChange",(function(e){var n=e.querySelector("#cl-date-input");n.addEventListener("change",(function(){if(t.registeredControl.setValue(n.value||null),n.value){var o=t.getPreferredWidgetLanguage();e.querySelector(".selected-date-value").textContent=t.formatCurrentLocaleDate(o,n.value)}else t.setCalendarPlaceholder()}))})),ut(t,"handleDateFocusOut",(function(){navigator.userAgent.toLowerCase().indexOf("firefox")>-1||t.markCalendarDisplayFalse()})),ut(t,"markCalendarDisplayFalse",(function(){t.isCalendarDisplayed=!1})),ut(t,"addCalendarRelatedEventListeners",(function(e){var n=e.querySelector("#cl-date-input");"UPDATING"===t.services.config.getConfig("entryModuleType")||(t.removeListeners(),n.addEventListener("click",(function(e){return t.showCalendarProgrammatically(e)})),n.addEventListener("change",(function(){return t.closeNativeCalendarProgrammatically()})),n.addEventListener("focusout",(function(){return t.handleDateFocusOut()})),t.markCalendarDisplayFalseIfClickedOutsideListenerCb=function(e){return t.markCalendarDisplayFalseIfClickedOutside(e)},t.markCalendarDisplayFalseListenerCb=function(){return t.markCalendarDisplayFalse()},t.closeCalendarOnEscapeIfItPresentListenerCb=function(e){return t.closeCalendarOnEscapeIfItPresent(e)},window.addEventListener("click",t.markCalendarDisplayFalseIfClickedOutsideListenerCb),window.addEventListener("mousewheel",t.markCalendarDisplayFalseListenerCb),window.addEventListener("keyup",t.closeCalendarOnEscapeIfItPresentListenerCb,!0))})),ut(t,"markCalendarDisplayFalseIfClickedOutside",(function(e){var n=e.composedPath()[0]&&"cl-date-input"===e.composedPath()[0].id;t.isCalendarDisplayed=n})),ut(t,"showCalendarProgrammatically",(function(e){var n;if(null!==(n=e.target)&&void 0!==n&&n.showPicker){try{e.target.showPicker()}catch(e){return}t.isCalendarDisplayed=!0}})),ut(t,"closeCalendarOnEscapeIfItPresent",(function(e){"Escape"===e.key&&t.isCalendarDisplayed&&(e.preventDefault(),e.stopImmediatePropagation(),t.closeNativeCalendarProgrammatically())})),ut(t,"closeNativeCalendarProgrammatically",(function(){var e=t.getRootElement().querySelector("#cl-date-input");e.setAttribute("type","text"),e.setAttribute("type","date"),t.isCalendarDisplayed=!1})),ut(t,"removeListeners",(function(){window.removeEventListener("click",t.markCalendarDisplayFalseIfClickedOutsideListenerCb),window.removeEventListener("mousewheel",t.markCalendarDisplayFalseListenerCb),window.removeEventListener("keyup",t.closeCalendarOnEscapeIfItPresentListenerCb,!0)})),ut(t,"setCalendarIconStyles",(function(){var e=t.getElement("input").style.color;t.getRootElement().querySelector(".calendar-icon").style.color=e})),t.getRootElement().innerHTML="\n ".concat('\n <style>\n .main-container {\n height: 100%;\n }\n \n .label-and-controls-container {\n height: 100%;\n display: flex;\n position: relative;\n }\n \n .input-ui-override {\n height: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n \n .selected-date-value {\n width: 100%;\n }\n \n input[type="date"] {\n position: absolute;\n left: 0;\n top: 0;\n background: transparent;\n text-indent: 999px;\n opacity: 0.01;\n border: none;\n cursor: pointer;\n }\n \n input[type="date"]::-webkit-calendar-picker-indicator {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n opacity: 0;\n cursor: pointer;\n }\n \n .label {\n min-height: 10px;\n }\n\n .label.cl-focused {\n min-height: auto;\n }\n \n .calendar-placeholder {\n width: 100%;\n }\n \n .cl-calendar-input-control {\n position: relative;\n height: 100%;\n width: 100%;\n min-height: 15px;\n }\n \n .cl-calendar-input-control input {\n width: 100%;\n height: 100%;\n }\n \n .calendar-placeholder {\n color: var(--cl-calendar-input-placeholder-color);\n }\n \n .invalid {\n border: 1px solid #ff0000 !important;\n }\n \n .input-tooltip {\n visibility: hidden;\n position: absolute;\n right: -10px;\n top: -10px;\n z-index: 1;\n border-radius: 100%;\n width: 20px;\n height: 20px;\n display: flex;\n justify-content: center;\n align-items: center;\n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Chrome/Safari/Opera */\n -khtml-user-select: none; /* Konqueror */\n -moz-user-select: none; /* Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none;\n }\n \n input:focus ~ .input-ui-override.focus-outline-defined {\n outline: var(--clFocusOutline);\n }\n </style>\n ',"\n ").concat('\n <div class="main-container">\n <div class="label-and-controls-container">\n \n <div cl-element="label"\n cl-inline-edit="content, label"\n class="label">\n </div>\n \n <div class="cl-calendar-input-control">\n <input id="cl-date-input"\n type="date"\n name="date">\n \n <div class="input-ui-override" cl-element="input">\n <span class="selected-date-value"></span>\n <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"\n class="calendar-icon">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M7.625 5H16.375C18.4696 5 20 6.76142 20 8.71429V16.2857C20 18.2371 18.4702 20 16.375 20H7.625C5.52975 20 4 18.2371 4 16.2857V8.71429C4 6.76142 5.53037 5 7.625 5ZM7.625 7H16.375C17.2688 7 18 7.76716 18 8.71429V16.2857C18 17.232 17.2688 18 16.375 18H7.625C6.73125 18 6 17.232 6 16.2857V8.71429C6 7.76716 6.73125 7 7.625 7Z"\n fill="currentColor"/>\n <path d="M8 3H10V5H8V3Z" fill="currentColor"/>\n <path d="M14 3H16V5H14V3Z" fill="currentColor"/>\n <path d="M10.125 10H8.125V12H10.125V10Z" fill="currentColor"/>\n <path d="M13.125 10H11.125V12H13.125V10Z" fill="currentColor"/>\n <path d="M8.125 13H10.125V15H8.125V13Z" fill="currentColor"/>\n <path d="M13.125 13H11.125V15H13.125V13Z" fill="currentColor"/>\n <path d="M14.125 10H16.125V12H14.125V10Z" fill="currentColor"/>\n </svg>\n </div>\n \n <div class="input-tooltip">\n <svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M1.5 13.0604C1.5 19.4116 6.6481 24.5605 13.0075 24.5605C19.353 24.5605 24.5 19.4107 24.5 13.0604C24.5 6.70865 19.3531 1.55909 13.0075 1.55908C6.64806 1.55908 1.5 6.7077 1.5 13.0604ZM12.9775 17.9668C12.7032 17.9668 12.4807 17.7443 12.4807 17.47C12.4807 17.1956 12.7032 16.9732 12.9775 16.9732C13.2519 16.9732 13.4743 17.1956 13.4743 17.47C13.4743 17.7443 13.2519 17.9668 12.9775 17.9668ZM12.9775 13.4764C12.7032 13.4764 12.4807 13.254 12.4807 12.9796L12.4807 8.48924C12.4807 8.21487 12.7032 7.99245 12.9775 7.99245C13.2519 7.99245 13.4743 8.21487 13.4743 8.48924L13.4743 12.9796C13.4743 13.254 13.2519 13.4764 12.9775 13.4764Z" fill="#FF0000" stroke="white" stroke-width="2"></path>\n </svg>\n </div>\n </div>\n </div>\n </div>\n '," \n "),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&&ht(e,t)}(e,nt),t=e,o=[{key:"connectedCallback",value:function(){var t=this;ct(e,"connectedCallback",this,3)([]);var n=this.getRootElement(),o=this.getProps();this.registerControl(n);var i=this.registeredControl.value||rt();this.isCalendarDisplayed=!1,this.setUpdatedValueOnChange(n),this.setTime(n,i),this.addCalendarRelatedEventListeners(n),this.observeProps((function(e,i){t.applyAutoAdaptiveStyles(i.adaptiveStyles,i.styles);var r=t.getEnvironment();W(i,r,n,".label-and-controls-container"),$(i,r,t.getHostElement(),t.getElement("input"),t.getElement("label")),function(e){let t;const n=e,o=["transparent","initial"];e&&(e.style.borderColor&&!o.includes(e.style.borderColor)&&(parseFloat(e.style.borderWidth)||parseFloat(e.style.borderBottomWidth))&&(t=G(n,e,"borderColor")),!t&&e.style.getPropertyValue("--borderBottomColor")&&!o.includes(e.style.getPropertyValue("--borderBottomColor"))&&parseFloat(e.style.getPropertyValue("--borderBottomWidth"))&&(t=G(n,e,"--borderBottomColor")),t||!e.style.backgroundColor||o.includes(e.style.backgroundColor)||(t=G(n,e,"backgroundColor")),t||!e.style.color||o.includes(e.style.color)||(t=G(n,e,"color")),t||n.classList.remove("focus-outline-defined"))}(t.getElement("input")),o.content.onlyInFuture?t.setMinTimeRange(n):t.clearMinTimeRange(n),t.setPlaceholder(t.getProps(),t.getEnvironment()),t.setCalendarIconStyles()})),this.observeShared((function(){t.setPlaceholder(t.getProps(),t.getEnvironment()),t.setCalendarIconStyles()})),this.observeEnvironment((function(e,o){var i=t.getProps();W(i,o,n,".label-and-controls-container"),$(i,o,t.getHostElement(),t.getElement("input"),t.getElement("label")),t.setPlaceholder(i,o),t.setCalendarIconStyles()}))}},{key:"disconnectedCallback",value:function(){ct(e,"disconnectedCallback",this,3)([]),this.removeListeners()}}],o&&lt(t.prototype,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,o}();ut(gt,"define",{name:"sys-calendar",model:ot.name,manifest:ot});export{gt as default};window.clComponentClass_SysCalendarComponent=gt;