@claspo/components 1.1.16 → 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 t="validationStatusChanged",e="touchedStatusChanged",n="cl-";function o(t){return n+t}function r(t){return"cl-"+t}class i{static size(t){return{width:this.width(t),height:this.height(t)}}static width(t){return t=t||document,Math.max(t.documentElement.clientWidth,t.defaultView.innerWidth||0)}static height(t){return t=t||document,Math.max(t.documentElement.clientHeight,t.defaultView.innerHeight||0)}static scrollbarWidth(t){return(t=t||document).defaultView.innerWidth-t.documentElement.clientWidth}}var l={transparent:"#0000"},a=function(t,e,n,o){return null!=o&&""!==o||(o=1),t=parseFloat(t),e=parseFloat(e),n=parseFloat(n),o=parseFloat(o),t<=255&&t>=0&&e<=255&&e>=0&&n<=255&&n>=0&&o<=1&&o>=0?[Math.round(t),Math.round(e),Math.round(n),o]:null},s=[];for(var c in l)s.push(c);var d="\\s*([.\\d%]+)\\s*",u="\\("+[d,d,d]+"(?:,\\s*([.\\d]+)\\s*)?\\)",p="(?:rgb)a?",h="("+s.join("|")+")",m=RegExp(p+u,"i"),g=function(t,e){if(null==t)return null;t=(t+"").replace(/\s+/,"");var n=l[t];return n?g(n,e):(n=t.match(m))&&(t=n.slice(1))&&(t=a.apply(null,t))?e?t:(1===t[3]&&t.splice(3,1),"rgb"+(4===t.length?"a":"")+"("+t+")"):null};RegExp([h,"(?:#([a-f0-9]{3,8}))",p+u,"(?:hsl)a?"+u].join("|"),"gi");const v=g;class E{ratio(t,e,n){return t=this.getRgbTriplet(t,n),e=this.getRgbTriplet(e,n),this.wcagRgb(t,e)}isNotTransparent(t,e){e=e||{};const n=(t=v(t)).match(/\((.*)\)/)[1].split(",");if(4!=n.length||"0"!=n[3]||e.ignoreAlpha)return t;throw new TypeError("get-contrast cannot contrast transparent colors")}getRgbTriplet(t,e){if("string"!=typeof t)throw new TypeError("get-contrast expects colors as strings");let n=t.toLowerCase();return n=this.isNotTransparent(n,e),n.match(/\((.*)\)/)[1].split(",").slice(0,3)}wcagRgb(t,e){return this.luminance(this.relativeLuminance(t),this.relativeLuminance(e))}luminance(t,e){return(Math.max(t,e)+.05)/(Math.min(t,e)+.05)}relativeLuminance(t){const e=t[0]/255,n=t[1]/255,o=t[2]/255,r=1/12.92;function i(t){return Math.pow((t+.055)/1.055,2.4)}return.2126*(e<=.03928?e*r:i(e))+.7152*(n<=.03928?n*r:i(n))+.0722*(o<=.03928?o*r:i(o))}}function b(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}var y=Array.prototype.concat,f=Array.prototype.slice,R=function(t){for(var e=[],n=0,o=t.length;n<o;n++){var r=t[n];b(r)?e=y.call(e,f.call(r)):e.push(r)}return e};R.wrap=function(t){return function(){return t(R(arguments))}};const T=R;var A={},O=Object.hasOwnProperty,_=Object.create(null);for(var I in A)O.call(A,I)&&(_[A[I]]=I);var D={to:{},get:{}};function S(t,e,n){return Math.min(Math.max(e,t),n)}D.get=function(t){var e,n;return"hsl"===t.substring(0,3).toLowerCase()?(e=D.get.hsl(t),n="hsl"):(e=D.get.rgb(t),n="rgb"),e?{model:n,value:e}:null},D.get.rgb=function(t){if(!t)return null;var e,n,o,r=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(o=e[2],e=e[1],n=0;n<3;n++){var i=2*n;r[n]=parseInt(e.slice(i,i+2),16)}o&&(r[3]=parseInt(o,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(o=(e=e[1])[3],n=0;n<3;n++)r[n]=parseInt(e[n]+e[n],16);o&&(r[3]=parseInt(o+o,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)r[n]=parseInt(e[n+1],0);e[4]&&(e[5]?r[3]=.01*parseFloat(e[4]):r[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:O.call(A,e[1])?((r=A[e[1]])[3]=1,r):null:null;for(n=0;n<3;n++)r[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?r[3]=.01*parseFloat(e[4]):r[3]=parseFloat(e[4]))}for(n=0;n<3;n++)r[n]=S(r[n],0,255);return r[3]=S(r[3],0,1),r},D.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,S(parseFloat(e[2]),0,100),S(parseFloat(e[3]),0,100),S(isNaN(n)?1:n,0,1)]}return null},D.to.rgb=function(){var t=T(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},D.to.hsl=function(){var t=T(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"};const C=D,L={},w={};for(const t of Object.keys(L))w[L[t]]=t;const N={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"}};Math.pow(6/29,3);for(const t of Object.keys(N)){if(!("channels"in N[t]))throw new Error("missing channels property: "+t);if(!("labels"in N[t]))throw new Error("missing channel labels property: "+t);if(N[t].labels.length!==N[t].channels)throw new Error("channel and label counts mismatch: "+t);const{channels:e,labels:n}=N[t];delete N[t].channels,delete N[t].labels,Object.defineProperty(N[t],"channels",{value:e}),Object.defineProperty(N[t],"labels",{value:n})}N.rgb.hsl=function(t){const e=t[0]/255,n=t[1]/255,o=t[2]/255,r=Math.min(e,n,o),i=Math.max(e,n,o),l=i-r;let a,s;i===r?a=0:e===i?a=(n-o)/l:n===i?a=2+(o-e)/l:o===i&&(a=4+(e-n)/l),a=Math.min(60*a,360),a<0&&(a+=360);const c=(r+i)/2;return s=i===r?0:c<=.5?l/(i+r):l/(2-i-r),[a,100*s,100*c]},N.hsl.rgb=function(t){const e=t[0]/360,n=t[1]/100,o=t[2]/100;let r,i,l;if(0===n)return l=255*o,[l,l,l];r=o<.5?o*(1+n):o+n-o*n;const a=2*o-r,s=[0,0,0];for(let t=0;t<3;t++)i=e+1/3*-(t-1),i<0&&i++,i>1&&i--,l=6*i<1?a+6*(r-a)*i:2*i<1?r:3*i<2?a+(r-a)*(2/3-i)*6:a,s[t]=255*l;return s};const x=N;function P(t,e){return function(n){return e(t(n))}}function k(t,e){const n=[e[t].parent,t];let o=x[e[t].parent][t],r=e[t].parent;for(;e[r].parent;)n.unshift(e[r].parent),o=P(x[e[r].parent][r],o),r=e[r].parent;return o.conversion=n,o}const M={};Object.keys(x).forEach((t=>{M[t]={},Object.defineProperty(M[t],"channels",{value:x[t].channels}),Object.defineProperty(M[t],"labels",{value:x[t].labels});const e=function(t){const e=function(t){const e=function(){const t={},e=Object.keys(x);for(let n=e.length,o=0;o<n;o++)t[e[o]]={distance:-1,parent:null};return t}(),n=[t];for(e[t].distance=0;n.length;){const t=n.pop(),o=Object.keys(x[t]);for(let r=o.length,i=0;i<r;i++){const r=o[i],l=e[r];-1===l.distance&&(l.distance=e[t].distance+1,l.parent=t,n.unshift(r))}}return e}(t),n={},o=Object.keys(e);for(let t=o.length,r=0;r<t;r++){const t=o[r];null!==e[t].parent&&(n[t]=k(t,e))}return n}(t);Object.keys(e).forEach((n=>{const o=e[n];M[t][n]=function(t){const e=function(...e){const n=e[0];if(null==n)return n;n.length>1&&(e=n);const o=t(e);if("object"==typeof o)for(let t=o.length,e=0;e<t;e++)o[e]=Math.round(o[e]);return o};return"conversion"in t&&(e.conversion=t.conversion),e}(o),M[t][n].raw=function(t){const e=function(...e){const n=e[0];return null==n?n:(n.length>1&&(e=n),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(o)}))}));const V=M,j=["keyword","gray","hex"],U={};for(const t of Object.keys(V))U[[...V[t].labels].sort().join("")]=t;const X={};function Y(t,e){if(!(this instanceof Y))return new Y(t,e);if(e&&e in j&&(e=null),e&&!(e in V))throw new Error("Unknown model: "+e);let n,o;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof Y)this.model=t.model,this.color=[...t.color],this.valpha=t.valpha;else if("string"==typeof t){const e=C.get(t);if(null===e)throw new Error("Unable to parse color from string: "+t);this.model=e.model,o=V[this.model].channels,this.color=e.value.slice(0,o),this.valpha="number"==typeof e.value[o]?e.value[o]:1}else if(t.length>0){this.model=e||"rgb",o=V[this.model].channels;const n=Array.prototype.slice.call(t,0,o);this.color=W(n,o),this.valpha="number"==typeof t[o]?t[o]:1}else if("number"==typeof t)this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;const e=Object.keys(t);"alpha"in t&&(e.splice(e.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);const o=e.sort().join("");if(!(o in U))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=U[o];const{labels:r}=V[this.model],i=[];for(n=0;n<r.length;n++)i.push(t[r[n]]);this.color=W(i)}if(X[this.model])for(o=V[this.model].channels,n=0;n<o;n++){const t=X[this.model][n];t&&(this.color[n]=t(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}Y.prototype={toString(){return this.string()},string(t){let e=this.model in C.to?this:this.rgb();e=e.round("number"==typeof t?t:1);const n=1===e.valpha?e.color:[...e.color,this.valpha];return C.to[e.model](n)},round(t){return t=Math.max(t||0,0),new Y([...this.color.map(F(t)),this.valpha],this.model)},alpha(t){return void 0!==t?new Y([...this.color,Math.max(0,Math.min(1,t))],this.model):this.valpha},lighten(t){const e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken(t){const e=this.hsl();return e.color[2]-=e.color[2]*t,e}};for(const t of Object.keys(V)){if(j.includes(t))continue;const{channels:e}=V[t];Y.prototype[t]=function(...e){return this.model===t?new Y(this):e.length>0?new Y(e,t):new Y([...B(V[this.model][t].raw(this.color)),this.valpha],t)},Y[t]=function(...n){let o=n[0];return"number"==typeof o&&(o=W(n,e)),new Y(o,t)}}function F(t){return function(e){return function(t,e){return Number(t.toFixed(e))}(e,t)}}function B(t){return Array.isArray(t)?t:[t]}function W(t,e){for(let n=0;n<e;n++)"number"!=typeof t[n]&&(t[n]=0);return t}const H=Y,$="rgb(255, 255, 255)",z="rgb(0, 0, 0)";function q(t,e){return H(t).alpha(e).string()}function G(t,e){try{return H(t).lighten(e).rgb().string()}catch(e){return console.warn("ColorUtils.lighten:",e),t}}function Q(t,e){try{return H(t).darken(e).rgb().string()}catch(e){return console.warn("ColorUtils.darken:",e),t}}function K(t,e){try{return(new E).ratio(t,e)}catch(n){return console.warn(`ColorUtils.getContrastRatio: transparent colors were used ${t}, ${e}`),0}}function Z(t){const{element:e,html:n,appendHtml:o}=t,r=function(t){if(null==t)return"";if("string"!=typeof t)return String(t);if(""===t)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(t))return t;const e=(new DOMParser).parseFromString(t,"text/html");return e.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach((t=>t.remove())),e.querySelectorAll("*").forEach((t=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach((e=>t.removeAttribute(e))),Array.from(t.attributes).forEach((e=>{e.name.startsWith("on")&&t.removeAttribute(e.name)})),"A"===t.tagName||"AREA"===t.tagName){const e=t.getAttribute("href");e&&(e.startsWith("javascript:")||e.startsWith("data:"))&&t.removeAttribute("href")}if("IMG"===t.tagName||"IFRAME"===t.tagName){const e=t.getAttribute("src");e&&(e.startsWith("javascript:")||e.startsWith("data:text/html"))&&t.removeAttribute("src")}if("FORM"===t.tagName){const e=t.getAttribute("action");e&&e.startsWith("javascript:")&&t.removeAttribute("action")}})),e.body.innerHTML}(n);o?e.innerHTML+=r:e.innerHTML=r}function J(t,e){Object.keys(e).forEach((n=>{t.style[n]=e[n]}))}function tt(t,e){const n=window.getComputedStyle(t);return e.reduce(((t,e)=>(t[e]=n.getPropertyValue(e),t)),{})}function et(t,e){var n,o;let r;return t.styles&&(r=null===(n=t.styles.find((t=>"label"===t.element)))||void 0===n?void 0:n.params),t.adaptiveStyles&&!r&&(r=null===(o=t.adaptiveStyles[e].find((t=>"label"===t.element)))||void 0===o?void 0:o.params),r}function nt(t,e,n,o){const r=n.querySelector(o),i=et(t,e);if(!i)return;const l=n.querySelector(".label");Z({element:l,html:t.content.label}),"TOP"===i.position?(r.style.flexDirection="column",r.style.alignItems="unset",J(l,{marginRight:0,marginBottom:`${i.margin}px`})):(r.style.flexDirection="row",r.style.alignItems="center",J(l,{marginRight:`${i.margin}px`,marginBottom:0})),i.enabled?l.style.display="":l.style.display="none"}function ot(t,e,n){const o=function(t,e){const n=getComputedStyle(t)[e]||t.style.getPropertyValue(e);if(n&&n.includes("rgb")&&(!(n.split("rgb").length>2)||n.includes("#")))return n}(e,n);if(o){const e=q(o,.5);return t.classList.add("focus-outline-defined"),t.style.setProperty("--clFocusOutline",`3px solid ${e}`),e}return null}function rt(){return o("overlay-menu-content")}function it(t,e,n,o,r,l){const a=function(t,e,n,o,r){const l=function(t,e,n,o){const r=i.width(o),{right:l}=t.getBoundingClientRect(),a=r-n-l-i.scrollbarWidth(o);return{horizontalOffset:n,contentWidth:lt(e).width,availableSpaceToTheLeftSideOfTheTrigger:l-n,availableSpaceToTheRightSideOfTheTrigger:a}}(t,e,n,r),a=function(t,e,n,o){const r=i.height(o),{top:l,bottom:a}=t.getBoundingClientRect();return{verticalOffset:n,contentHeight:lt(e).height,availableSpaceAboveTriggerElem:l-n,availableSpaceBelowTriggerElem:r-a-n}}(t,e,n,r);let s="undefined";const c={bottom:a.availableSpaceBelowTriggerElem>=a.contentHeight,top:a.availableSpaceAboveTriggerElem>=a.contentHeight,right:l.availableSpaceToTheRightSideOfTheTrigger>=l.contentWidth,left:l.availableSpaceToTheLeftSideOfTheTrigger>=l.contentWidth};if(c.top?s="top":c.bottom?s="bottom":c.right?s="right":c.left&&(s="left"),c[o]&&(s=o),"undefined"===s){const t=Math.max(a.availableSpaceBelowTriggerElem,a.availableSpaceAboveTriggerElem,l.availableSpaceToTheRightSideOfTheTrigger,l.availableSpaceToTheLeftSideOfTheTrigger);t===a.availableSpaceBelowTriggerElem?s="bottom":t===a.availableSpaceAboveTriggerElem?s="top":t===l.availableSpaceToTheRightSideOfTheTrigger?s="right":t===l.availableSpaceToTheLeftSideOfTheTrigger&&(s="left")}return Object.assign(Object.assign(Object.assign({},a),l),{position:s})}(t,e,n,o,l=l||document);return function(t,e){const{marginBottom:n,marginTop:o}=window.getComputedStyle(e);if("top"===t.position)J(e,{"margin-top":`${parseInt(o,10)+parseInt(n,10)}px`}),J(e,{"margin-bottom":"0px"});else if("bottom"===t.position)J(e,{"margin-bottom":`${parseInt(n,10)+parseInt(o,10)}px`}),J(e,{"margin-top":"0px"});else{const t=(parseInt(n,10)+parseInt(o,10))/2+"px";J(e,{"margin-top":t,"margin-bottom":t})}}(a,e),{coordinates:at(a,t.getBoundingClientRect(),e.getBoundingClientRect(),r,l),position:a.position}}function lt(t){const{width:e,height:n}=t.getBoundingClientRect(),{marginBottom:o,marginTop:r,marginLeft:i,marginRight:l}=window.getComputedStyle(t);return{width:e+parseInt(i,10)+parseInt(l,10),height:n+parseInt(r,10)+parseInt(o,10)}}function at(t,e,n,o,r){switch(t.position){case"top":return{left:`${st(e,n,o,r)}px`,top:t.availableSpaceAboveTriggerElem-t.contentHeight-t.verticalOffset+"px"};case"bottom":return{left:`${st(e,n,o,r)}px`,bottom:t.availableSpaceBelowTriggerElem-t.contentHeight-t.verticalOffset+"px"};case"left":return{left:t.availableSpaceToTheLeftSideOfTheTrigger-e.width-t.contentWidth-t.horizontalOffset+"px",top:`${ct(0,t)}px`};case"right":return{right:t.availableSpaceToTheRightSideOfTheTrigger-t.contentWidth-t.horizontalOffset+"px",top:`${ct(0,t)}px`}}}function st(t,e,n,o){let r=n?t.x+t.width/2-e.width/2:t.x;return r<0&&(r=0),r+e.width>i.width(o)&&(r-=r+e.width-i.width(o)),r}function ct(t,e){let n=e.availableSpaceAboveTriggerElem;return e.contentHeight>e.availableSpaceBelowTriggerElem&&(n-=e.contentHeight-e.availableSpaceBelowTriggerElem),n}function dt(t,e){return t.startsWith("transparent")||t.startsWith("none")||!t.startsWith("rgb")||1!==(n=t.slice(0,t.match(/\)/).index+1),H(n).alpha())?K(e,$)>K(e,z)?$:z:t;var n}function ut(t){const e=K(t,$),n=K(t,z);let o,r;if(e>n)for(o=$,r=e;r>5;)o=Q(o,.1),r=K(t,o);else for(o="rgb(10, 10, 10)",r=n;r>5;)o=G(o,.1),r=K(t,o);return q(o,.2)}const pt="cl-tooltip-text-styles",ht=`\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 mt(t,e,n,o){let r;o=o||document,t.classList.add("invalid"),e.style.visibility="visible",e.onmouseenter=()=>{(function(t){if((t=t||document).head.querySelector(`#${pt}`))return;const e=document.createElement("style");e.setAttribute("id",pt),Z({element:e,html:ht}),t.head.appendChild(e)})(o),r=function(t){const e="cl-overlay-tooltip-text",n=document.getElementById(e)||document.createElement("div");return n.classList.add("cl-tooltip-text"),n.textContent!==t&&(n.textContent=t,n.style=null),n.id||(n.id=e),n}(n),o.body.append(r),r.style.visibility="visible",function(t){const{triggerElement:e,tooltipElement:n,offset:o=10,htmlDocumentObject:r}=t,i=it(e,n,o,"top",!0,r);n.setAttribute("cl-tooltip-position",i.position),J(n,i.coordinates)}({triggerElement:e,tooltipElement:r,htmlDocumentObject:o})},e.onmouseleave=()=>{r&&(r.remove(),function(t){const e=(t=t||document).head.querySelector(`#${pt}`);e&&e.remove()}(o))}}function gt(t){return[t.getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter((t=>!!t))}function vt(t,e){return e.reduce(((e,n)=>{if(e)return e;const o=function(t,e){if(!t)return null;if(e[t])return{translations:e[t],language:t};const n=Et(t);return e[n]?{translations:e[n],language:n}:null}(n,t);return o||null}),null)}function Et(t){return t.includes("-")?t.split("-")[0].toLowerCase():t.includes("_")?t.split("_")[0].toLowerCase():t}function bt(t,e,n){const o=vt(e,gt(t)).translations,r=Object.keys(o).find((t=>t.includes(n)));return r?o[r]:n}const yt="VIEW",ft="MODULE",Rt="CONTAINER",Tt="INPUT",At="BUTTON",Ot="CONSENT",_t="COLUMN",It="SUBSCRIBE_CONTACT",Dt="REQUEST",St="SHOW_WIDGET",Ct="OPEN_LINK",Lt="CLOSE_WIDGET";class wt{static sortActions(t){const e={[Lt]:-1,[Ct]:-2,[St]:1,[It]:2,[Dt]:3},n=t=>void 0!==e[t.type]?e[t.type]:0;return[...t].sort(((t,e)=>n(t)>n(e)?-1:n(t)<n(e)?1:0))}constructor(t,e){this.config=t,this.actions=wt.sortActions(e),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(t,e,n){this.state=t;const o=n(),i=o.getAttribute(r("id"));this.listener=t=>{const e=t.composedPath().filter((t=>t instanceof HTMLElement&&t.getAttribute(r("type"))));let n=0;for(;e[n]&&e[n].getAttribute(r("id"))!==i;){let t=e[n].getAttribute(r("type"));if(wt.IGNORING_VIEW_ENTRY_TYPES.includes(t))return;n++}this.eventsQueue.push({event:t}),this.postponed||this.execute()},this.targetElements=this.config.relativeSelector?Array.from((o.shadowRoot||o).querySelectorAll(this.config.relativeSelector)):[o],this.targetElements.forEach((t=>{t.addEventListener("click",this.listener)}))}async execute(){var t,e,n,o;try{for(var r,i=!0,l=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},o("next"),o("throw"),o("return"),e[Symbol.asyncIterator]=function(){return this},e);function o(n){e[n]=t[n]&&function(e){return new Promise((function(o,r){!function(t,e,n,o){Promise.resolve(o).then((function(e){t({value:e,done:n})}),e)}(o,r,(e=t[n](e)).done,e.value)}))}}}(this.eventsQueue);!(t=(r=await l.next()).done);){o=r.value,i=!1;try{const{event:t}=o;for(const e of this.actions)if(!await e.execute(this.state.getState(),t))break}finally{i=!0}}}catch(t){e={error:t}}finally{try{i||t||!(n=l.return)||await n.call(l)}finally{if(e)throw e.error}}this.eventsQueue=[]}postpone(){this.postponed=!0}release(){this.postponed=!1,this.execute()}destroy(){this.listener&&this.targetElements.length&&(this.targetElements.forEach((t=>{t.removeEventListener("click",this.listener)})),this.targetElements=[])}}wt.IGNORING_VIEW_ENTRY_TYPES=[At,Ot,Tt];const Nt="CLICK",xt="COMPONENT_EVENT";class Pt{constructor(t,e){this.config=t,this.actions=e,this.componentEmitterListener=null}activate(t,e,n){this.componentEmitterListener=e.on(this.config.eventName,(()=>{this.actions.forEach((e=>e.execute(t.getState(),this.config.params)))}))}destroy(){this.componentEmitterListener&&this.componentEmitterListener.off()}}class kt{constructor(t,e){this.actionFactory=t,this.actionRegister=e}get(t){const e=t.actions.map((t=>this.actionFactory.get(t)));switch(e.forEach((t=>this.actionRegister.register(t))),t.type){case Nt:return new wt(t,e);case xt:return new Pt(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class Mt{static generate(){let t,e="";for(let n=0;n<32;n++)8!==n&&12!==n&&16!==n&&20!==n||(e+="-"),t=Math.floor(16*Math.random()).toString(16).toUpperCase(),e+=t;return e}}class Vt{constructor(){this.listeners=Vt.createDefaultListenersState()}emit(t,e,n=null){const o=this.listeners[t];o&&Object.values(o).forEach((o=>o(e,t,n))),Object.values(this.listeners["*"]).forEach((o=>o(e,t,n)))}on(t,e){const n=Mt.generate(),o=this.listeners[t];return o?o[n]=e:this.listeners[t]={[n]:e},{off:()=>{var e,o;(null===(o=null===(e=this.listeners)||void 0===e?void 0:e[t])||void 0===o?void 0:o[n])&&delete this.listeners[t][n]}}}destroy(){this.listeners=Vt.createDefaultListenersState()}}Vt.createDefaultListenersState=()=>({"*":{}});const jt=(t,e,n,o)=>{const{addEventListenerBase:r,addEventListener:i}=EventTarget.prototype;(r||i).call(t,e,n,o)};class Ut{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class Xt{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===ft?Object.assign(Object.assign({},t),Xt.moduleToContainerParams):t));return Object.assign(Object.assign({},t),{children:e})}));return Object.assign(Object.assign({},t),{views:e})}static sort(t,e){return t.index>e.index?1:-1}static reIndex(t,e){return Object.assign(Object.assign({},t),{index:e+t.index})}}Xt.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"};class Yt extends Vt{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on("ENVIRONMENT_UPDATE",(({isMobileEnv:t})=>{this._isMobile=t,this.emit(Yt.changeEventName,this._isMobile)}))}handleMobileBreakpoint(t){this.mobileBreakpointWidth=t;const e=Number.isInteger(this.mobileBreakpointWidth)?`${this.mobileBreakpointWidth}px`:this.mobileBreakpointWidth;this.mediaQueryList=window.matchMedia(`(max-width: ${e})`),this.mediaQueryList.addListener(this.listener.bind(this)),this._isMobile=this.mediaQueryList.matches,this.emit(Yt.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(Yt.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}Yt.changeEventName="CHANGE";class Ft{static set(t,e){const n=t[Ft.accumulatorPropertyName]||{};t[Ft.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[Ft.accumulatorPropertyName]).forEach((n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""}))}}Ft.accumulatorPropertyName="clStyleAttributes";const Bt="CONTENT_LOCKER";class Wt{static applyHostStyles(t,e,n=null,o){var r,i,l;const a=null===(i=null===(r=null==n?void 0:n.props)||void 0===r?void 0:r.handlers)||void 0===i?void 0:i.find((t=>"CLICK"===t.type));a&&(null===(l=a.actions)||void 0===l?void 0:l.length)&&(e.style.cursor="pointer"),t!==yt&&t!==Rt&&t!==_t||(e.style.display=o===Bt&&t===yt?"flex":"inline-flex",e.style.position="relative"),e.style.boxSizing="border-box"}constructor(){this.styles="/* common styles */ *, *:before, *:after { box-sizing: border-box; font-family: inherit; }"}setStyles(t=""){this.styles=`${this.styles} ${t}`}getStyles(){return this.styles}}class Ht{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class $t{constructor(t,e,n,o,r,i){this.hostElement=e,this.documentModel=t,this.getSharedCb=n,this.getPropsCb=o,this.getEnvCb=r,this.httpClient=i,this.subscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(t){const e=String(t||"");if(e.includes("url")){const[t,n]=e.split("(")[1].split(")");return{url:t.replace(/['"]+/g,""),positionOptions:n.replace(";","")}}return{url:null,positionOptions:null}}apply(t){const e=this.getPropsCb();return e.backgroundDynamicInlineSVGElements[t].forEach((n=>{var o,r,i,l,a;const s=null===(r=null===(o=e.adaptiveStyles)||void 0===o?void 0:o[t])||void 0===r?void 0:r.find((t=>t.element===n)),c=(null===(i=e.styles)||void 0===i?void 0:i.find((t=>t.element===n)))||{},d=(null===(l=null==c?void 0:c.styleAttributes)||void 0===l?void 0:l.background)||(null===(a=null==s?void 0:s.styleAttributes)||void 0===a?void 0:a.background),u=this.parseBackground(d);u.url&&this.envUrlMaps[t].set(n,{originalSVGResourceURL:u.url,inlineSvgString:null,positionOptions:u.positionOptions})})),Promise.all([...this.envUrlMaps[t].entries()].map((([e,n])=>this.httpClient.execute(n.originalSVGResourceURL).then((t=>t.text())).then((o=>{this.envUrlMaps[t].set(e,Object.assign(Object.assign({},n),{inlineSvgString:o}))}))))).then((()=>{this._applyHostElementBackground(this.envUrlMaps[t].get("host"),this.getSharedCb().cssVars)})).catch((t=>{console.error(t),Ht.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${t}`)}))}on(){return this.subscription=this.documentModel.on("COLOR_SCHEMA_UPDATE",(t=>{this._applyHostElementBackground(this.envUrlMaps[this.getEnvCb()].get("host"),t)})),this}_applyHostElementBackground(t,e){t&&(this.hostElement.style.background=this._buildBackgroundUrl(t,e))}_buildBackgroundUrl(t,e){const n=t.inlineSvgString.trim().replace("var(--cl-schema-accent)",e["cl-schema-accent"]);return`url('data:image/svg+xml,${encodeURIComponent(n)}')${t.positionOptions}`}off(){var t;null===(t=this.subscription)||void 0===t||t.off()}}const zt=new class{execute(t,e,n=null,o,r){const i={method:e,headers:Object.assign({"Content-Type":"text/plain"},o||{}),credentials:"same-origin",body:null,signal:r};return n&&(i.body="string"==typeof n?n:JSON.stringify(n)),fetch(t,i)}};function qt(t,e){return Object.keys(t).filter((t=>!e.includes(t))).reduce(((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]})),{})}class Gt{static camelCaseToDashCase(t){return t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}static camelCaseToUpperSnakeCase(t){return t.replace(/[A-Z]/g,(t=>"_"+t)).toUpperCase()}}class Qt{constructor(t){this._count=0,this.onUpdateCb=t}increment(){this._count++,this.onUpdateCb(this.count())}decrement(){this._count>0&&this._count--,this.onUpdateCb(this.count())}count(){return this._count}}const Kt="COMPONENT_RESOURCES_LOADED",Zt="FAILED_TO_LOAD_COMPONENT_RESOURCE";class Jt{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(Kt,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(Zt,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=n,this.counters={pending:new Qt(this.onCounterStateUpdate)}}}const te=(...t)=>{let e=t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:[]})),{});return{get:t=>e[t],clear:()=>te(...t)}},ee=te,ne="props",oe="shared",re="environment";function ie(t,e,n,o){const r=t=>{let i=t instanceof DocumentFragment||(null==t?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?t.host:t;return i&&(o&&"function"==typeof o?o(i.getAttribute(e)):(null===(l=null==i?void 0:i.getAttribute)||void 0===l?void 0:l.call(i,e))===n)?i:i&&i.parentNode&&r(i.parentNode)||null;var l};return r(t)}const le="SUBMIT";function ae(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach((n=>{"element"!==n&&"classes"!==n&&(e[n]&&"object"==typeof e[n]&&!Array.isArray(e[n])?t[n]=Object.assign(Object.assign({},t[n]||{}),e[n]):t[n]=e[n])})),t):t}function se(t,e,n){var o;return null===(o=t[e])||void 0===o?void 0:o.find((t=>t.element===n))}function ce(t,e,o){let r="rgb(0, 0, 0)";const i=t.adaptiveStyles[e].find((t=>"input"===t.element));if(i.placeholderStyleAttributes&&i.placeholderStyleAttributes.color)return i.placeholderStyleAttributes.color;const l=(i.classes||"").split(" ").filter((t=>t.startsWith(n)));if(!l.length)return r;let a=o.textClasses[l[0]];return a&&a.placeholderStyleAttributes&&a.placeholderStyleAttributes.color?a.placeholderStyleAttributes.color:r}class de extends Event{constructor(t,e,n){super(t,n),this.detail={},Object.defineProperty(this,"detail",{value:e})}}class ue extends HTMLElement{constructor(){var t,e;super(),this.construct=()=>{let t;const e=this.getAttribute(r("id")),n=this.getWidgetContainerNode();if(!n)throw new Error("Widget container not found in construct");const o=n.closest(`[${r("widget-id")}]`);let i;o&&(i=o.getAttribute(r("widget-id")));let l=new de("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(r("path")),id:e,widgetId:i},{bubbles:!0,composed:!0});this.dispatchEvent(l),t=l.detail.props,Object.assign(this,t),this.observers=ee(ne,oe,re),this.subscriptions=new class{constructor(){this.subscriptions=[]}push(t){this.subscriptions.push(t)}off(){this.subscriptions.forEach((t=>null==t?void 0:t.off()))}},this.state=new Ut,this.componentEventEmitter=new Vt,this.componentResourceManager=new Jt(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 kt(this._actionFactory,this.services.actionRegister),this.prevProps=this.model.props,this.prevEnvironment=this.getEnvironment(),this.documentModel.on(`COMPONENT_PROPS_UPDATE_${this.model.id}`,(t=>{this.model.props=t,this.observers.get(ne).forEach((e=>e(this.prevProps,t))),this.prevProps=t;const e=this.getHostElement(),n=r("floating");t.floating&&!e.getAttribute(n)?e.setAttribute(n,"true"):!t.floating&&e.getAttribute(n)&&e.removeAttribute(n)})),this.documentModel.on(`COMPONENT_UPDATE_${this.model.id}`,(t=>{Object.assign(this.model,t)})),this.documentModel.on("SHARED_UPDATE_ALL",(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles),this.observers.get(oe).forEach((t=>t(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new $t(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),zt),this.colorSchemaListener.apply(this.getEnvironment()).then((()=>{this.subscriptions.push(this.colorSchemaListener.on())}))),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(Yt.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(re).forEach((e=>e(this.prevEnvironment,t))),this.prevEnvironment=t})))},this.attachHandlers=()=>{this.getHandlers().map((t=>this._handlerFactory.get(t))).map((t=>()=>t.activate(this.state,this.componentEventEmitter,this.getHostElement.bind(this)))).forEach((t=>t()))},this.postponeHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.postpone()))},this.releaseHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.release()))},this.getProps=()=>{var t;return null===(t=this.getModel())||void 0===t?void 0:t.props},this.getShared=()=>this.documentModel.getShared(),this.getEnvironment=()=>this.resizeListener.isMobile()?"mobile":"desktop",this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(ne).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(oe).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(re).push(t),t(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${r("element")}]`)).filter((t=>!t.hasAttribute(r("component"))))],this.getElement=(t,e)=>this.getElements().find((n=>e?n.getAttribute(r("element"))===t&&n.id===e:n.getAttribute(r("element"))===t)),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const n=this.getElements();if(!n.length)return;t=function(t,e){if(!e)return t||{desktop:[],mobile:[]};const n=JSON.parse(JSON.stringify(t||{desktop:[],mobile:[]}));return e.forEach((t=>{const e=t.element;let o=!1,r=!1;n.desktop&&n.desktop.forEach((n=>{n.element===e&&(ae(n,t),o=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===e&&(ae(n,t),r=!0)})),!o&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(t))),!r&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(t)))})),n}(t,e);const o=r("type"),i="element-styles";let l=this.getRootElement().querySelector(`style[${o}="${i}"]`);l||(l=document.createElement("style"),l.setAttribute(o,i),this.getRootElement().appendChild(l)),Z({element:l,html:""}),n.forEach((e=>{let n=e.getAttribute(r("element"));const o=this.getEnvironment();let i=se(t,o,n);if(i){if(this.resizeListener.isMobile()){const e=se(t,"desktop",n);e&&(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},e.styleAttributes),i.styleAttributes)}))}this.applyStylesToElement(e,this.applySharedClassesToElementModel(i),l)}})),this._addLinkColor(l,this.getShared())},this.registerComponentResourceManagement=()=>{this.viewResourceManager.registerComponent(this.model.id,this.componentResourceManager)},this.applyStyles=(t,e={})=>{if(!t||!t.style)return!1;for(const[n,o]of Object.entries(e))t.style[n]=o;return!0},this.applyStylesToElement=(t,e,n)=>{var o,i;const l=[];"host"===(e=ue._resolveTogglableStylesForElementModel(e)).element&&(Wt.applyHostStyles(this.model.type,t,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(o=this.model.props.backgroundDynamicInlineSVGElements)||void 0===o?void 0:o.desktop)||"mobile"===this.getEnvironment()&&(null===(i=this.model.props.backgroundDynamicInlineSVGElements)||void 0===i?void 0:i.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),l.push("background")));let a=e.styleAttributes.background,s=a&&a.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&s){this.componentResourceManager.getPending().increment();const t=new Image;t.src=s[1],jt(t,"load",(()=>{this.componentResourceManager.getPending().decrement()})),jt(t,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(t.src),"UPDATING"===this.services.config.getConfig("entryModuleType")&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},e),{styleAttributes:qt(e.styleAttributes,l)});if(Ft.set(t,c),this._setClassAttributes(t,e),n){if(e.hoverStyleAttributes){let o=Object.assign({},e.hoverStyleAttributes);if("FILL_UP"===e.hoverAnimationType){t.style.boxShadow="inset 0px 0px 0px 0px rgb(0, 0, 0, 0)",t.style.overflow="hidden";const n=t.tagName.toLowerCase(),r=`flip-up-animation-${e.element}`;let i=this.getRootElement().querySelector(`#${r}`);i||(i=document.createElement("style"),i.id=r,t.appendChild(i)),Z({element:i,html:`\n ${n}::before {\n content: '';\n background: ${o.background};\n position: absolute;\n left: 0;\n top: ${t.getBoundingClientRect().height}px;\n height: ${t.getBoundingClientRect().height}px;\n width: 100%;\n z-index: -10;\n }\n ${n}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),o=Object.assign(Object.assign({},e.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,e.element,o,`:not(.${r("no-hover")}):hover`,!0)}e.placeholderStyleAttributes&&this._addStylesToStyleElement(n,e.element,e.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(n,this.getShared()),this.stylesAppliedToElement(t,e,n)}},this._fixMarginOverflow=t=>{const e=this.getParentComponent(),n=e&&("flex"===e.style.display||"inline-flex"===e.style.display),o="host",i=t.getAttribute(r("element"))===o;if(!n||!i)return;const l=this.getProps(),a=this.getEnvironment(),{styleAttributes:s}=se(l.adaptiveStyles,a,o)||{};if(!s)return;const c=s.marginLeft||s.marginRight,d="100%"===s.width;if(c&&d){const e=(parseFloat(s.marginLeft)||0)+(parseFloat(s.marginRight)||0);e&&setTimeout((()=>{t.style.width=`calc(100% - ${e}px)`}))}},this.applySharedClassesToElementModel=t=>function(t,e){let o=t;return(o.classes||"").split(" ").filter((t=>t.startsWith(n))).forEach((t=>{var n;let r=null===(n=e.textClasses)||void 0===n?void 0:n[t];r&&(r.styleAttributes.fontFamily||(r.isHeader&&e.headerFontFamily&&(r=Object.assign(Object.assign({},r),{styleAttributes:Object.assign(Object.assign({},r.styleAttributes),{fontFamily:e.headerFontFamily})})),!r.isHeader&&e.textFontFamily&&(r=Object.assign(Object.assign({},r),{styleAttributes:Object.assign(Object.assign({},r.styleAttributes),{fontFamily:e.textFontFamily})}))),o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),r.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},o.placeholderStyleAttributes),r.placeholderStyleAttributes)}))})),o.styleAttributes.fontFamily||(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),{fontFamily:e.textFontFamily})})),o}(t,this.documentModel.getShared()),this.getModel=()=>this.model,this._addStylesToStyleElement=(t,e,n,o="",i)=>{const l=Object.keys(n).reduce(((t,e)=>t+` ${Gt.camelCaseToDashCase(e)}: ${n[e]}${i?" !important;":";"}`),"");Z({element:t,html:`[${r("element")}="${e}"]${o} { ${l} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{Z({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,o,r,i;e.linkColor&&Z({element:t,html:`a {color: ${e.linkColor}}, a:visited {color: ${e.linkColor}}`,appendHtml:!0}),(null===(n=e.linkParams)||void 0===n?void 0:n.color)&&Z({element:t,html:`a {color: ${null===(o=e.linkParams)||void 0===o?void 0:o.color}}, a:visited {color: ${null===(r=e.linkParams)||void 0===r?void 0:r.color}}`,appendHtml:!0}),(null===(i=e.linkParams)||void 0===i?void 0:i.removeUnderline)&&Z({element:t,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(t,e)=>{Array.from(t.classList).filter((t=>t!==o("hovered")&&t!==o("focused"))).forEach((e=>{e.startsWith(n)&&t.classList.remove(e)}));const r=((t.getAttribute("class")||"")+" "+e.classes).trim();t.setAttribute("class",r)},this.getParentComponent=()=>ie(this.parentNode,r("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(r("path"));return t&&1===t.split(",").length?this.parentNode:ie(this.parentNode,r("path"),void 0,(t=>t&&1===t.split(",").length))},this.getWidgetLanguages=()=>gt(this.services.config),this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=t=>vt(t,this.getWidgetLanguages()),this.stylesAppliedToElement=(t,e,n)=>{},this.updateContext=()=>{var t;const e=this.getModel();this.services.context.updateRecord(e.id,{label:this.getContextRecordLabel(e.props),viewIndex:null===(t=e.path)||void 0===t?void 0:t[0]})},this.addContextRecord=()=>{var t;const e=this.getModel();this.services.context.addRecord(e.id,{recordKey:e.id,id:e.props.control.name,label:this.getContextRecordLabel(e.props),value:e.props.control.defaultValue||"",viewIndex:null===(t=e.path)||void 0===t?void 0:t[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(e.props)}})},this.getContextRecordLabel=t=>{var e,n;const o=t.control.name;if(["email","first_name","last_name"].includes(o))return o.toUpperCase();if(t.content.label&&(null===(n=null===(e=t.adaptiveStyles.desktop.find((t=>"label"===t.element)))||void 0===e?void 0:e.params)||void 0===n?void 0:n.enabled)){const e=(new DOMParser).parseFromString(t.content.label,"text/html");return this.capitalizeFirstLetter(e.body.textContent||"")}return t.content.placeholder?this.capitalizeFirstLetter(t.content.placeholder):t.control.integrationName?this.capitalizeFirstLetter(t.control.integrationName).replace(new RegExp("_","g")," "):void 0},this.capitalizeFirstLetter=t=>t.charAt(0).toUpperCase()+t.slice(1),this.getContextRecordExampleValue=t=>{switch(t.control.name){case"email":return"myemail@example.com";case"first_name":return"Maria";case"last_name":return"Taylor";default:return this.getContextRecordLabel(t)}},this.completeSubmitAction=t=>{const e=t||{},n=this.services.actionRegister.getRegisteredActions().find((t=>t.category===le));n?null==n||n.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:Dt}).execute(void 0,void 0,!0,e)},this.getHandlers=()=>this.getProps().handlers&&this.getProps().handlers.length?[...this.getProps().handlers]:[],this.assets=(t="")=>`${this.services.config.getConfig("staticResourcesUrl").replace(/\/$/,"")}/${this.manifest.name}/assets${t?`/${t}`:""}`,this.attachShadow({mode:"open"}),this.manifest=this.manifest||(null===(t=this.define)||void 0===t?void 0:t.manifest)||(null===(e=this.constructor.define)||void 0===e?void 0:e.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then((()=>{this.attachHandlers()}))}disconnectedCallback(){var t;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(t=this.mergeTagsProcessor)||void 0===t||t.destroy()}static _resolveTogglableStylesForElementModel(t){const e=Object.assign({},t);return Object.keys(e).forEach((t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=ue._resolveTogglableStyles(e[t]))})),e}static _resolveTogglableStyles(t){const e=Object.assign({},t),n=(t,n,o)=>{n in e&&(t.forEach((t=>{t in e&&(e[t]=e[n]?e[t]:o)})),delete e[n])};return n(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),n(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),e}}const pe=Symbol("required");var he=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]])}return n};function me(){}const ge="pending",ve="valid",Ee="invalid";class be extends ue{constructor(){super(...arguments),this._createControl=(t={},...e)=>{var{element:n}=t,o=he(t,["element"]);const r=this.getProps(),i=this.getModel(),l=Object.assign(Object.assign(Object.assign({},r.control),{componentId:i.id,viewIdx:i.path[0]}),o),a=this.services.form,s=[l,n,...e];return a.hasControl(r.control.name)?a.updateControl(...s):a.registerControl(...s)},this.createControlWithValidation=(t=[],e={})=>{var{element:n=this.getElement("input"),tooltipElement:o=this.getRootElement().querySelector(".input-tooltip"),validCallback:r=me,invalidCallback:i=me,pendingCallback:l=me,elementToListen:a=n,validationMap:s={},listenStatusChange:c=!0}=e,d=he(e,["element","tooltipElement","validCallback","invalidCallback","pendingCallback","elementToListen","validationMap","listenStatusChange"]);if(o&&(o.style.visibility="hidden"),!t||!Array.isArray(t))throw new Error("Validators should be an array");const u=this.getProps().control.validation,p=s[null==u?void 0:u.validator],h=t.some((t=>t[pe])),m=!!(null==u?void 0:u.required),g=m||h,v=[...t];m&&!h&&v.unshift(function(t="REQUIRED"){const e=e=>{let n;switch(typeof e){case"string":n=e&&e.length>0;break;case"boolean":n=e;break;case"number":n=!isNaN(e);break;default:n=!!e}return{isValid:n,errorKey:n?null:t}};return e[pe]=!0,e}()),p&&v.push(p);const E=this._prepareAsyncValidators(v),b=this._createControl({element:n,validation:{validator:"custom",required:g}},void 0,E);return c&&this._handleControlStatusChange(Object.assign({control:b,element:a,tooltipElement:o,configService:this.services.config,i18n:this.manifest.i18n,validCallback:r,invalidCallback:i,pendingCallback:l},d)),b},this._prepareAsyncValidators=(t=[])=>t.reduce(((t,e,n)=>"function"!=typeof e?(console.warn(`Validator ${n} should be a function, so it will be skipped`),t):(t[`custom_${n}`]=async(...t)=>{const n=await Promise.resolve(e(...t));return"object"==typeof n&&"isValid"in n?Object.assign(Object.assign({},n),{errorKey:n.isValid?null:n.errorKey}):{isValid:!1,errorKey:"INVALID_VALIDATOR_RESPONSE"}},t)),{}),this._handleControlStatusChange=n=>{n.control.on(t,(t=>{this._handleValidationStatus(n,t)})),n.control.on(e,(()=>{let t=ge;switch(!0){case n.control.pending:t=ge;break;case n.control.valid:t=ve;break;default:t=Ee}this._handleValidationStatus(n,t)}))},this._handleValidationStatus=(t,e)=>{const{control:n,element:o,tooltipElement:r,validCallback:i,invalidCallback:l,errorMessageMapper:a,pendingCallback:s}=t,c=this.services.config,d=this.manifest.i18n;switch(e){case ve:(function(t,e){t.classList.remove("invalid"),e.style.visibility="hidden"})(o,r),i&&i();break;case Ee:if(n.touched){const t=n.getErrorKeys();if(!t)break;const e=t[0];let i=bt(c,d,e);a&&(i=a(e,i)),mt(o,r,i,this.htmlDocumentObject),l&&l()}break;case ge:n.touched&&(function(t,e){e.style.visibility="hidden",t.classList.contains("invalid")&&t.classList.remove("invalid")}(o,r),s&&s())}}}}const ye={name:"SysDateComponent",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",params:{width:{getValueFromElement:"host"},height:{getValueFromElement:"host"}}},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"input",params:{width:{getValueFromElement:"host"},height:{getValueFromElement:"host"}}},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"}]}],propertyPaneModel:{content:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"SIZE",element:"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:"DATE_FORMAT",propPath:["content","askYear"],displayCondition:"return !sdk.appConfig.useContactFields"},{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}}]},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","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Only integers, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Only integers, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Invalid date","content,label":"Title"},ru:{"control,validation,validationErrors,REQUIRED":"Обязательное поле","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Только целые числа, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Только целые числа, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Недействительная дата","content,label":"Заголовок"},uk:{"control,validation,validationErrors,REQUIRED":"Обов'язкове поле","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Тільки цілі числа, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Тільки цілі числа, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Недійсна дата","content,label":"Заголовок"},es:{"control,validation,validationErrors,REQUIRED":"Campo obligatorio","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Solo enteros, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Solo enteros, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Fecha invalida","content,label":"Título"},de:{"control,validation,validationErrors,REQUIRED":"Pflichtfeld","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Nur ganze Zahlen, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Nur ganze Zahlen, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Ungültiges Datum","content,label":"Titel"},fr:{"control,validation,validationErrors,REQUIRED":"Champs requis","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Seuls les entiers, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Seuls les entiers, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Date invalide","content,label":"Titre"},it:{"control,validation,validationErrors,REQUIRED":"Campo obbligatorio","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Solo numeri interi, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Solo numeri interi, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Data non valida","content,label":"Titolo"},pt:{"control,validation,validationErrors,REQUIRED":"Campo obrigatório","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Apenas integrais, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Apenas integrais, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Data inválida","content,label":"Título"},ro:{"control,validation,validationErrors,REQUIRED":"Câmp obligatoriu","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Numai numere întregi, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Numai numere întregi, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Data nevalidă","content,label":"Titlu"},bg:{"control,validation,validationErrors,REQUIRED":"Изисквано поле","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Само цели числа, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Само цели числа, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Невалидна дата","content,label":"Заглавие"},cs:{"control,validation,validationErrors,REQUIRED":"Vyžadované pole","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Jen celá čísla, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Jen celá čísla, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Neplatné datum","content,label":"Titul"},el:{"control,validation,validationErrors,REQUIRED":"Απαιτητό πεδίο","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Μόνο ακέραιοι αριθμοί, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Μόνο ακέραιοι αριθμοί, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Άκυρη ημερομηνία","content,label":"Τίτλος"},nl:{"control,validation,validationErrors,REQUIRED":"Verplicht veld","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Alleen gehele getallen, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Alleen gehele getallen, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Ongeldige datum","content,label":"Titel"},pl:{"control,validation,validationErrors,REQUIRED":"Wymagane pole","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Tylko liczby całkowite, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Tylko liczby całkowite, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Nieprawidłowa data","content,label":"Tytuł"},sv:{"control,validation,validationErrors,REQUIRED":"Obligatoriskt fält","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Endast heltal, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Endast heltal, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Ogiltigt datum","content,label":"Tytuł"},tr:{"control,validation,validationErrors,REQUIRED":"Gerekli alan","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Yalnızca tam sayılar, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Yalnızca tam sayılar, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Geçersiz tarih","content,label":"Başlık"},ar:{"control,validation,validationErrors,REQUIRED":"الحقل المطلوب","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":'"الأعداد الصحيحة فقط, 1 - 31',"control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":'"الأعداد الصحيحة فقط, 0 - 3000',"control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"تاريخ غير صالح","content,label":"عنوان"},zh:{"control,validation,validationErrors,REQUIRED":"必填字段","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"仅限整数, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"仅限整数, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"无效日期","content,label":"Title"},da:{"control,validation,validationErrors,REQUIRED":"Påkrævet felt","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Kun heltal, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Kun heltal, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Ugyldig dato","content,label":"Titel"},he:{"control,validation,validationErrors,REQUIRED":"שדה נדרש","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"רק מספרים שלמים ,1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"רק מספרים שלמים ,0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"תאריך לא תקין","content,label":"Title"},fi:{"control,validation,validationErrors,REQUIRED":"Vaadittu kenttä","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Vain kokonaisluvut, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Vain kokonaisluvut, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Virheellinen päivämäärä","content,label":"Title"},hi:{"control,validation,validationErrors,REQUIRED":"आवश्यक फील्ड","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"केवल पूर्णांक, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"केवल पूर्णांक, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"अमान्य तारीख़","content,label":"Title"},hr:{"control,validation,validationErrors,REQUIRED":"Obavezno polje","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Samo cijeli brojevi, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Samo cijeli brojevi, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Nevažeći datum","content,label":"Title"},hu:{"control,validation,validationErrors,REQUIRED":"Kötelező mező","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Csak egész számok, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Csak egész számok, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Érvénytelen dátum","content,label":"Title"},id:{"control,validation,validationErrors,REQUIRED":"Bidang yang wajib diisi","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Hanya bilangan bulat, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Hanya bilangan bulat, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Tanggal tidak valid","content,label":"Title"},ja:{"control,validation,validationErrors,REQUIRED":"必須フィールド","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"整数のみ, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"整数のみ, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"日付が無効です","content,label":"Title"},ko:{"control,validation,validationErrors,REQUIRED":"필수 칸","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"정수만, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"정수만, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"유효하지 않은 날짜","content,label":"Title"},no:{"control,validation,validationErrors,REQUIRED":"Obligatorisk felt","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Bare heltall, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Bare heltall, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Ugyldig dato","content,label":"Title"},sk:{"control,validation,validationErrors,REQUIRED":"Povinné pole","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Iba celé čísla, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Iba celé čísla, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Neplatný dátum","content,label":"Title"},sl:{"control,validation,validationErrors,REQUIRED":"Obvezno polje","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Samo cela števila, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Samo cela števila, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Neveljaven datum","content,label":"Title"},sr:{"control,validation,validationErrors,REQUIRED":"Obavezno polje","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Samo celi brojevi, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Samo celi brojevi, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Nevažeći datum","content,label":"Title"}},props:{content:{label:"Title",askYear:!0,textContrastEnabled:!0,placeholderTextContrastEnabled:!0},control:{name:"date",integrationName:"date",defaultValue:null,validation:{required:!0,validator:"SYS_DATE"}},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:"/SysDateComponent/assets/img/date-component-icon.svg",label:{en:"Date",ru:"Дата",uk:"Дата",es:"Fecha",fr:"Date",de:"Datum",it:"Data",pt:"Data",ro:"Data",bg:"Дата",cs:"Datum",el:"Ημερομηνία",nl:"Datum",pl:"Data",sv:"Datum",tr:"Tarih",ar:"التاريخ",zh:"日期",da:"Dato",he:"תאריך",fi:"Päivämäärä",hi:"तारीख़ ",hr:"Datum",hu:"Dátum",id:"Tanggal",ja:"日付",ko:"날짜",no:"Dato",sk:"Dátum",sl:"Datum",sr:"Datum"}}};function fe(t){return fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fe(t)}function Re(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,Oe(o.key),o)}}function Te(t,e,n){return e&&Re(t.prototype,e),n&&Re(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ae(t,e,n){return(e=Oe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Oe(t){var e=function(t){if("object"!=fe(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=fe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==fe(e)?e:e+""}var _e=Te((function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}));function Ie(t){return Ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ie(t)}function De(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,Se(o.key),o)}}function Se(t){var e=function(t){if("object"!=Ie(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ie(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ie(e)?e:e+""}Ae(_e,"validationErrorKeys",{REQUIRED:"REQUIRED",DAY_INVALID_ERROR_TEXT:"DAY_INVALID_ERROR_TEXT",YEAR_INVALID_ERROR_TEXT:"YEAR_INVALID_ERROR_TEXT",DATE_INVALID_ERROR_TEXT:"DATE_INVALID_ERROR_TEXT"}),Ae(_e,"DAY_PLACEHOLDER",{en:"Day",ru:"День",uk:"День",es:"Día",de:"Tag",fr:"Jour",it:"Giorno",pt:"Dia",ro:"Gün",bg:"Ден",cs:"Den",el:"Ημέρα",nl:"Dag",pl:"Dzień",sv:"Dag",tr:"Gün",ar:"اليوم"}),Ae(_e,"MONTH_DROPDOWN_PLACEHOLDER",{en:"Month",ru:"Месяц",uk:"Мicяць",es:"Mes",de:"Monat",fr:"Mois",it:"Mese",pt:"Mês",ro:"Ay",bg:"Месец",cs:"Měsíc",el:"Μήνας",nl:"Maand",pl:"Miesiąc",sv:"Månad",tr:"Ay",ar:"الشهر"}),Ae(_e,"YEAR_PLACEHOLDER",{en:"Year",ru:"Год",uk:"Рiк",es:"Año",de:"Jahr",fr:"Année",it:"Anno",pt:"Ano",ro:"Yıl",bg:"Година",cs:"Rok",el:"Έτος",nl:"Jaar",pl:"Rok",sv:"År",tr:"Yıl",ar:"السنة"});var Ce=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return e=t,n=[{key:"getDatePartsOrder",value:function(t){return new Intl.DateTimeFormat(t).formatToParts().filter((function(t){return["year","month","day"].includes(t.type)})).map((function(t){return t.type}))}},{key:"convertMonthToNumeric",value:function(e,n){return t.getAllMonthsByLanguage("short",n).findIndex((function(t){return t===e}))+1}},{key:"convertNumericToMonth",value:function(e,n){return t.getAllMonthsByLanguage("short",n)[e-1]}},{key:"getAllMonthsByLanguage",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"short",e=Et(arguments.length>1?arguments[1]:void 0);return new Array(12).fill(0).map((function(n,o){return new Date(2e3,o,1).toLocaleDateString(e,{month:t})})).map((function(t){return t.charAt(0).toUpperCase()+t.slice(1)}))}},{key:"convertDashedStringDateIntoDate",value:function(t){var e=+t.split("-")[2],n=+t.split("-")[1],o=+t.split("-")[0];return new Date(new Date(2e3,n-1,e).setFullYear(o))}},{key:"convertToDoubleDigit",value:function(t){return t?+t<10?"0".concat(t):t:"00"}},{key:"normalizeYearInput",value:function(t){return"0"===t?"0000":t?"".concat(+t).padStart(4,"0"):""}}],null&&De(e.prototype,null),n&&De(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function Le(t){return Le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Le(t)}function we(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function Ne(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?we(Object(n),!0).forEach((function(e){Xe(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):we(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function xe(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i,l,a=[],s=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;s=!1}else for(;!(s=(o=i.call(n)).done)&&(a.push(o.value),a.length!==e);s=!0);}catch(t){c=!0,r=t}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(c)throw r}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Pe(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pe(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pe(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}function ke(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,Ye(o.key),o)}}function Me(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Me=function(){return!!t})()}function Ve(){return Ve="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var o=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=je(t)););return t}(t,e);if(o){var r=Object.getOwnPropertyDescriptor(o,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},Ve.apply(null,arguments)}function je(t){return je=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},je(t)}function Ue(t,e){return Ue=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ue(t,e)}function Xe(t,e,n){return(e=Ye(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ye(t){var e=function(t){if("object"!=Le(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Le(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Le(e)?e:e+""}var Fe=function(){function e(){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Xe(n=function(t,e,n){return e=je(e),function(t,e){if(e&&("object"==Le(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Me()?Reflect.construct(e,n||[],je(t).constructor):e.apply(t,n))}(this,e),"manifest",ye),Xe(n,"registeredControl",void 0),Xe(n,"overlayBackdrop",void 0),Xe(n,"DAY_PLACEHOLDER",_e.DAY_PLACEHOLDER),Xe(n,"MONTH_DROPDOWN_PLACEHOLDER",_e.MONTH_DROPDOWN_PLACEHOLDER),Xe(n,"YEAR_PLACEHOLDER",_e.YEAR_PLACEHOLDER),Xe(n,"validationErrorKeys",_e.validationErrorKeys),Xe(n,"dropdownMenuOptionLabelStyles",["color","font-family","font-size","letter-spacing","text-shadow","font-weight","line-height","text-align"]),Xe(n,"overlayContentStyles",["background","border-style","border-top-width","border-top-color","border-bottom-width","border-bottom-color","border-left-width","border-left-color","border-right-width","border-right-color","border-top-left-radius","border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius"]),Xe(n,"setControlsOrder",(function(t){var e=n.getPreferredWidgetLanguage(),o=Ce.getDatePartsOrder(e),r=n.getControlElementNodes(t),i=r.dayInputContainerElement,l=r.monthInputContainerElement,a=r.yearInputContainerElement,s=[];s[o.indexOf("day")]=i,s[o.indexOf("month")]=l,s[o.indexOf("year")]=a;var c=n.getRootElement().querySelector(".controls-container");Z({element:c,html:""}),s.forEach((function(t){return c.appendChild(t)}))})),Xe(n,"setControlValueProxy",(function(t,e){var o=n.getDateValueAsString();if(o||t)return n.getProps().content.askYear||(o="-".concat(o)),n.registeredControl.setValue(t||o,e)})),Xe(n,"dateValidation",(function(){var t=n.getRootElement(),e=Ce.convertDashedStringDateIntoDate(n.getDateValueAsString()),o=n.getDateValueAsString(),r=n.getControlElementNodes(t),i=r.dayInputElement,l=r.yearInputElement,a=i.value,s=+i.value,c=+o.split("-")[1],d=l.value,u=+l.value;return+a<0||isNaN(s)||"0"===a||s&&(s>31||s<1)?{isValid:!1,errorKey:n.validationErrorKeys.DAY_INVALID_ERROR_TEXT}:+d<0||isNaN(u)||u>3e3||u<0?{isValid:!1,errorKey:n.validationErrorKeys.YEAR_INVALID_ERROR_TEXT}:s&&c&&(isNaN(e.getTime())||!n.isCurrentDateExist())?{isValid:!1,errorKey:n.validationErrorKeys.DATE_INVALID_ERROR_TEXT}:!s&&!isNaN(s)||!c||n.getProps().content.askYear&&!d?{isValid:!1,errorKey:n.validationErrorKeys.REQUIRED}:{isValid:!0}})),Xe(n,"isCurrentDateExist",(function(){var t=n.getDateValueAsString(),e=+t.split("-")[2],o=+t.split("-")[1],r=+t.split("-")[0],i=Ce.convertDashedStringDateIntoDate(t);return i.getDate()===e&&i.getMonth()+1===o&&i.getFullYear()===r})),Xe(n,"getDateValueAsString",(function(){var t=n.getRootElement(),e=t.querySelector("#cl-day-input").value,o=t.querySelector("#cl-month-dropdown").innerText,r=t.querySelector("#cl-year-input").value;n.isMonthUnselected(o)&&(o=null),+e<0&&(e=""),+r<0&&(r="");var i=n.getPreferredWidgetLanguage(),l=Ce.convertToDoubleDigit(Ce.convertMonthToNumeric(o,i));return"".concat(Ce.normalizeYearInput(r),"-").concat(l,"-").concat(Ce.convertToDoubleDigit("".concat(+e)))})),Xe(n,"setStringDateValue",(function(t){var e=xe(t.split("-"),3),o=e[0],r=e[1],i=e[2],l=n.getPreferredWidgetLanguage(),a=n.getRootElement();a.querySelector("#cl-day-input").value=i,a.querySelector("#cl-month-dropdown").innerText=Ce.convertNumericToMonth(r,l),a.querySelector("#cl-year-input").value=+o,n.registeredControl.setValue(t)})),Xe(n,"getOptions",(function(){var t={};return Ce.getAllMonthsByLanguage("short",n.getPreferredWidgetLanguage()).forEach((function(e,n){return t["month-".concat(n+1)]={label:e,id:n}})),t})),Xe(n,"createDropdownButtonMenuComponent",(function(t,e,n,o){var r=document.createElement("div");r.classList.add("option-wrapper");var i=document.createElement("span");return i.textContent=t.label,J(i,n),e&&(r.style.backgroundColor=ut(o)),r.appendChild(i),r})),Xe(n,"getCurrentSelectedMonthValue",(function(){var t=n.getRootElement().querySelector("#cl-month-dropdown").innerText;return n.isMonthUnselected(t)?null:Ce.convertMonthToNumeric(t,n.getPreferredWidgetLanguage())})),Xe(n,"isMonthUnselected",(function(t){return t===n.getTranslationsMap(n.MONTH_DROPDOWN_PLACEHOLDER).translations})),Xe(n,"createOverlayContent",(function(t,e){var o=n.services.form.getControl(n.getProps().control.name),r=n.getRootElement().querySelector("#cl-month-dropdown"),i=tt(r,n.dropdownMenuOptionLabelStyles),l=tt(r,n.overlayContentStyles);l.background=dt(l.background,i.color);var a,s,c=(a=tt(r,["height"]).height,s=l,Math.min(Math.floor(parseInt(a)/2),parseInt(s["border-top-left-radius"]),parseInt(s["border-top-right-radius"]),parseInt(s["border-bottom-left-radius"]),parseInt(s["border-bottom-right-radius"])));J(e,Ne(Ne({},l),{},{"border-top-left-radius":"".concat(c,"px"),"border-top-right-radius":"".concat(c,"px"),"border-bottom-left-radius":"".concat(c,"px"),"border-bottom-right-radius":"".concat(c,"px")}));var d=n.getCurrentSelectedMonthValue(),u=n.getOptions(),p=document.createElement("div");Object.entries(u).forEach((function(e){var a=xe(e,1)[0],s=u[a],c="month-".concat(d)===a,h=n.createDropdownButtonMenuComponent(s,c,i,l.background);h.addEventListener("click",(function(){r.textContent=s.label,t.click(),n.setControlValueProxy(),o.emit("RUN_SINGLE_ELEMENT_VALIDATION",r)})),p.appendChild(h)})),e.appendChild(p)})),Xe(n,"createOverlay",(function(){n.overlayBackdrop&&n.overlayBackdrop.click();var t,e,o,r,i,l,a=function(t){const{triggerElement:e,overlayStyles:n,createOverlayContent:o,overlayWidth:r,overlayHeight:i,offset:l,onDestroy:a,positionByDefault:s,isHorizontallyCentered:c,isBackdropDisabledOnUI:d}=t,u=t.htmlDocumentObject||document,p=function(t){const e=document.createElement("div");return e.style.position="fixed",e.style.zIndex=String(Number.MAX_SAFE_INTEGER-1),e.style.top="0",e.style.left="0",e.style.width=t?"0px":"100%",e.style.height=t?"0px":"100%",e}(d),h=document.createElement("div");h.style.position="fixed",h.style.display="block",h.style.zIndex=String(Number.MAX_SAFE_INTEGER),r&&(h.style.width=`${r}px`),i&&(h.style.height=`${i}px`);const m=h.attachShadow({mode:"open"}),g=document.createElement("style");Z({element:g,html:n}),m.append(g);const v=document.createElement("div");v.classList.add(rt()),u.body.append(p),u.body.append(h),m.append(v),o(p,v),(()=>{const t=it(e,v,function(t){return null!=t?t:5}(l),s,c,u);(function(t,e){t.setAttribute("cl-overlay-position",e)})(v,t.position),J(h,t.coordinates)})(),h.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault()}));const E=t=>{p.remove(),h.remove(),a&&a(),window.removeEventListener("keyup",t,!0)},b=t=>{"Escape"===t.key&&(t.preventDefault(),t.stopImmediatePropagation(),E(b))};return p.addEventListener("click",(()=>E(b))),window.addEventListener("keyup",b,!0),{backdrop:p,overlay:h}}({triggerElement:n.getRootElement().querySelector("#cl-month-dropdown"),overlayStyles:(t=n.getRootElement(),e=n.overlayContentStyles,o=n.dropdownMenuOptionLabelStyles,r=rt(),i=t.querySelector("#cl-month-dropdown"),l=dt(tt(i,e).background,tt(i,o).color),"\n .".concat(r," {\n height: 196px;\n width: 199px;\n box-shadow: 0 1px 5px rgba(0, 0, 0, 0.28);\n border-radius: 4px;\n background-color: #fff;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n min-width: fit-content;\n }\n \n .").concat(r," div {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n row-gap: 9px;\n padding: 10px 15px 10px;\n }\n \n .").concat(r," div {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n row-gap: 9px;\n padding: 10px 14px 10px;\n }\n \n .option-wrapper {\n border: 0;\n align-items: center;\n font-size: 16px;\n padding: 10px 20px;\n outline: 0;\n cursor: pointer;\n text-align: left;\n }\n \n .option-wrapper span {\n word-break: keep-all;\n }\n \n .option-wrapper:hover {\n background-color: ").concat(ut(l),";\n }\n ")),createOverlayContent:function(t,e){n.createOverlayContent(t,e)},overlayWidth:n.getRootElement().querySelector("#cl-month-dropdown").getBoundingClientRect().width,onDestroy:function(){n.overlayBackdrop=null},htmlDocumentObject:n.htmlDocumentObject});n.overlayBackdrop=a.backdrop})),Xe(n,"applyControlsDisplayRules",(function(t){var e=n.getRootElement();t.content.askYear?e.querySelector(".year-input-with-tooltip").style.display="block":e.querySelector(".year-input-with-tooltip").style.display="none"})),Xe(n,"getControlElementNodes",(function(t){return{dayInputElement:t.querySelector("#cl-day-input"),dayTooltipElement:t.querySelector(".day-input-with-tooltip .input-tooltip"),dayInputContainerElement:t.querySelector(".day-input-with-tooltip"),monthInputElement:t.querySelector("#cl-month-dropdown"),monthTooltipElement:t.querySelector(".month-dropdown-input .input-tooltip"),monthInputContainerElement:t.querySelector(".month-dropdown-input"),yearInputElement:t.querySelector("#cl-year-input"),yearTooltipElement:t.querySelector(".year-input-with-tooltip .input-tooltip"),yearInputContainerElement:t.querySelector(".year-input-with-tooltip")}})),Xe(n,"setPlaceholders",(function(t,e){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];("UPDATING"===n.services.config.getConfig("entryModuleType")||o)&&(n.setDayPlaceholder(),n.setMonthPlaceholder(),n.setYearPlaceholder(),n.applyPlaceholdersColor(t,e))})),Xe(n,"applyPlaceholdersColor",(function(t,e){var o=ce(t,e,n.getShared());n.getHostElement().style.setProperty("--cl-date-input-placeholder-color",o)})),Xe(n,"setDayPlaceholder",(function(){var t=n.getRootElement().querySelector("#cl-day-input");t&&(t.placeholder=n.getTranslationsMap(n.DAY_PLACEHOLDER).translations)})),Xe(n,"setMonthPlaceholder",(function(){var t=n.getRootElement().querySelector("#cl-month-dropdown");if(t){var e=n.getTranslationsMap(n.MONTH_DROPDOWN_PLACEHOLDER).translations,o=document.createElement("div");o.classList.add("dropdown-placeholder"),o.style.color="var(--cl-date-input-placeholder-color)",o.textContent=e,Z({element:t,html:""}),t.appendChild(o)}})),Xe(n,"setYearPlaceholder",(function(){var t=n.getRootElement().querySelector("#cl-year-input");t&&(t.placeholder=n.getTranslationsMap(n.YEAR_PLACEHOLDER).translations)})),Xe(n,"getTranslatedKey",(function(t){return bt(n.services.config,n.manifest.i18n,t)})),Xe(n,"setInvalidStyleToElement",(function(t,e,o,r){r&&e!==r||mt(e,o,t,n.htmlDocumentObject)})),Xe(n,"registerControl",(function(e){var o=n.getHostElement(),r=n.getControlElementNodes(e),i=r.dayInputElement,l=r.dayTooltipElement,a=r.monthInputElement,s=r.monthTooltipElement,c=r.yearInputElement,d=r.yearTooltipElement,u={SYS_DATE:function(){return n.dateValidation()}};function p(t){return t===i||t===c?!t.value:t===a&&this.isMonthUnselected(a.textContent)}function h(t){var e=this;this.registeredControl.validate().then((function(){var n=e.registeredControl.getErrorKeys();if(n){var o=n[0];o===e.validationErrorKeys.REQUIRED&&p.call(e,t)&&(o=n[1]||n[0]);var r=e.getTranslatedKey(o);b.call(e,r,o,!1,t)}}))}function m(t,e){return e===i?g.call(this):e===a?v.call(this):e===c?E.call(this):void(t&&(g.call(this),v.call(this),E.call(this)))}function g(){i.classList.contains("invalid")&&i.classList.remove("invalid"),l.style.visibility="hidden"}function v(){a.classList.contains("invalid")&&a.classList.remove("invalid"),s.style.visibility="hidden"}function E(){c.classList.contains("invalid")&&c.classList.remove("invalid"),d.style.visibility="hidden"}function b(t,e,n,o){return o?m.call(this,!1,o):m.call(this,!0),e===this.validationErrorKeys.YEAR_INVALID_ERROR_TEXT?this.setInvalidStyleToElement(t,c,d,o):e===this.validationErrorKeys.DAY_INVALID_ERROR_TEXT?this.setInvalidStyleToElement(t,i,l,o):e===this.validationErrorKeys.DATE_INVALID_ERROR_TEXT?this.setInvalidStyleToElement(t,i,l):void(e===this.validationErrorKeys.REQUIRED&&(i.value||o!==i&&!n||this.setInvalidStyleToElement(t,i,l,o),this.isMonthUnselected(a.textContent)&&(o===a||n)&&this.setInvalidStyleToElement(t,a,s,o),c.value||o!==c&&!n||this.setInvalidStyleToElement(t,c,d,o)))}function y(){s.style.visibility="hidden",a.classList.contains("invalid")&&a.classList.remove("invalid")}n.registeredControl=n.createControlWithValidation([],{element:o,listenStatusChange:!1,validationMap:u}),o.addEventListener("input",(function(t){n.registeredControl.emit("RUN_SINGLE_ELEMENT_VALIDATION",t.composedPath()[0]),n.setControlValueProxy()})),n.services.eventEmitter.on("INVALID_CONTACT_DATA_SUBMIT_ATTEMPT",(function(){var t=n.registeredControl.getErrorKeys();if(t){var e=n.getTranslatedKey(t[0]);b.call(n,e,t[0],!0)}})),n.registeredControl.on("RUN_SINGLE_ELEMENT_VALIDATION",(function(t){h.call(n,t)})),n.registeredControl.on(t,(function(t){switch(t){case"valid":m.call(n,!0);break;case"pending":y.call(n)}}))})),Xe(n,"setArrowIconStyles",(function(){n.getRootElement().querySelector(".dropdown-input-select-button").style.color=ce(n.getProps(),n.getEnvironment(),n.getShared())})),Xe(n,"setInputHostSize",(function(t,e){var o=t.adaptiveStyles[e].find((function(t){return"input"===t.element})).styleAttributes,r=n.getHostElement(),i=n.getRootElement().querySelectorAll('[cl-element="input"]'),l=n.getElement("label"),a=et(t,e),s=l&&a.enabled&&"TOP"===a.position?l.getBoundingClientRect().height+a.margin:0,c="".concat(parseFloat(o.height)+s,"px");r.style.width=o.width,r.style.minWidth=o.minWidth,r.style.height=c,r.style.minHeight=c,i.forEach((function(t){t.style.width="",t.style.minWidth="",t.style.height="",t.style.minHeight=""}))})),n.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 }\n \n .controls-container {\n position: relative;\n height: 100%;\n min-height: 15px;\n width: 100%;\n display: flex;\n gap: 5px;\n }\n \n .label {\n min-height: 10px;\n }\n \n .label.cl-focused {\n min-height: auto;\n }\n \n .dropdown-placeholder {\n width: calc(100% - 15px);\n text-overflow: ellipsis;\n overflow: hidden;\n }\n \n .day-input-with-tooltip {\n min-width: 54px;\n height: inherit;\n }\n \n .month-dropdown-input {\n position: relative;\n display: flex;\n height: inherit;\n width: 100%;\n cursor: pointer;\n min-width: 82px;\n }\n \n .year-input-with-tooltip {\n min-width: 56px;\n height: 100%;\n }\n \n .cl-date-input-control {\n position: relative;\n width: 100%;\n }\n \n .cl-date-input-control input {\n width: 100%;\n height: 100%;\n }\n \n .cl-date-input-control input::placeholder {\n color: var(--cl-date-input-placeholder-color);\n opacity: 1;\n }\n \n .cl-date-input-control input::-ms-input-placeholder {\n color: var(--cl-date-input-placeholder-color);\n opacity: 1;\n }\n \n .cl-date-input-control .month-dropdown-input .dropdown-input-select-button {\n bottom: calc(50% - 17px);\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 .dropdown-label {\n display: flex;\n align-items: center;\n position: absolute;\n height: 100%;\n width: 100%;\n padding: 0 35px 0 20px;\n cursor: pointer;\n }\n \n .dropdown-input-select-button {\n background: transparent;\n border: none;\n min-width: max-content;\n width: 24px;\n height: 100%;\n display: flex;\n align-items: center;\n position: absolute;\n right: 0;\n z-index: 2;\n }\n \n .label-and-controls-container.focus-outline-defined input:focus, .dropdown-label:focus {\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="controls-container">\n \n <div class="cl-date-input-control day-input-with-tooltip">\n <input cl-element="input"\n id="cl-day-input"\n type="text"\n name="day">\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 \n <div class="cl-date-input-control month-dropdown-input">\n <div class="dropdown-input-select-button">\n <svg width="11" height="7" viewBox="0 0 11 7" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M10.5248 1.90196L9.57381 2.71322L6.05712 5.71322L5.24395 6.40691L4.4324 5.71132L0.949088 2.72576L0 1.91229L1.62694 0.0141139L2.57603 0.827583L5.24778 3.11756L7.9513 0.811257L8.90228 0L10.5248 1.90196Z"\n fill="currentColor"/>\n </svg>\n </div>\n <button cl-element="input"\n class="dropdown-label"\n id="cl-month-dropdown">\n <div class="dropdown-placeholder">placeholder</div>\n </button>\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 \n <div class="cl-date-input-control year-input-with-tooltip">\n <input cl-element="input"\n id="cl-year-input"\n type="text"\n name="fname">\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 \n </div>\n \n </div>\n </div>\n ',"\n "),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ue(t,e)}(e,be),n=e,o=[{key:"connectedCallback",value:function(){var t,n,o,r,i=this;(n=e,o=this,"function"==typeof(r=Ve(je(1&3?n.prototype:n),"connectedCallback",o))?function(t){return r.apply(o,t)}:r)([]);var l=this.getRootElement(),a=this.getProps();this.registerControl(l);var s=(null===(t=this.registeredControl)||void 0===t?void 0:t.value)||null;this.setControlsOrder(l),s?this.setStringDateValue(s):this.setPlaceholders(a,this.getEnvironment(),!0),this.observeProps((function(t,e){i.applyAutoAdaptiveStyles(e.adaptiveStyles,e.styles);var n=i.getEnvironment();nt(e,n,l,".label-and-controls-container"),i.setInputHostSize(e,n),i.applyControlsDisplayRules(e),i.setPlaceholders(e,n),i.setArrowIconStyles(),function(t,e){let n;const o=e||t,r=["transparent","initial"];t&&(t.style.borderColor&&!r.includes(t.style.borderColor)&&(parseFloat(t.style.borderWidth)||parseFloat(t.style.borderBottomWidth))&&(n=ot(o,t,"borderColor")),!n&&t.style.getPropertyValue("--borderBottomColor")&&!r.includes(t.style.getPropertyValue("--borderBottomColor"))&&parseFloat(t.style.getPropertyValue("--borderBottomWidth"))&&(n=ot(o,t,"--borderBottomColor")),n||!t.style.backgroundColor||r.includes(t.style.backgroundColor)||(n=ot(o,t,"backgroundColor")),n||!t.style.color||r.includes(t.style.color)||(n=ot(o,t,"color")),n||o.classList.remove("focus-outline-defined"))}(i.getElement("input"),l.querySelector(".label-and-controls-container"))})),this.observeShared((function(){var t=i.getProps(),e=i.getEnvironment();i.setPlaceholders(t,e),i.setInputHostSize(t,e),i.setArrowIconStyles()})),this.observeEnvironment((function(t,e){var n=i.getProps();nt(n,e,l,".label-and-controls-container"),i.setInputHostSize(n,e),i.setPlaceholders(n,e),i.setArrowIconStyles()})),l.querySelector(".month-dropdown-input").addEventListener("click",(function(){setTimeout((function(){return i.createOverlay()}),50)}))}}],o&&ke(n.prototype,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o}();Xe(Fe,"define",{name:"sys-date",model:ye.name,manifest:ye});export{Fe as default};window.clComponentClass_SysDateComponent=Fe;
1
+ const t="validationStatusChanged",e="touchedStatusChanged",n="cl-";function o(t){return n+t}function r(t){return"cl-"+t}class i{static size(t){return{width:this.width(t),height:this.height(t)}}static width(t){return t=t||document,Math.max(t.documentElement.clientWidth,t.defaultView.innerWidth||0)}static height(t){return t=t||document,Math.max(t.documentElement.clientHeight,t.defaultView.innerHeight||0)}static scrollbarWidth(t){return(t=t||document).defaultView.innerWidth-t.documentElement.clientWidth}}var l={transparent:"#0000"},a=function(t,e,n,o){return null!=o&&""!==o||(o=1),t=parseFloat(t),e=parseFloat(e),n=parseFloat(n),o=parseFloat(o),t<=255&&t>=0&&e<=255&&e>=0&&n<=255&&n>=0&&o<=1&&o>=0?[Math.round(t),Math.round(e),Math.round(n),o]:null},s=[];for(var c in l)s.push(c);var d="\\s*([.\\d%]+)\\s*",u="\\("+[d,d,d]+"(?:,\\s*([.\\d]+)\\s*)?\\)",p="(?:rgb)a?",h="("+s.join("|")+")",m=RegExp(p+u,"i"),g=function(t,e){if(null==t)return null;t=(t+"").replace(/\s+/,"");var n=l[t];return n?g(n,e):(n=t.match(m))&&(t=n.slice(1))&&(t=a.apply(null,t))?e?t:(1===t[3]&&t.splice(3,1),"rgb"+(4===t.length?"a":"")+"("+t+")"):null};RegExp([h,"(?:#([a-f0-9]{3,8}))",p+u,"(?:hsl)a?"+u].join("|"),"gi");const v=g;class E{ratio(t,e,n){return t=this.getRgbTriplet(t,n),e=this.getRgbTriplet(e,n),this.wcagRgb(t,e)}isNotTransparent(t,e){e=e||{};const n=(t=v(t)).match(/\((.*)\)/)[1].split(",");if(4!=n.length||"0"!=n[3]||e.ignoreAlpha)return t;throw new TypeError("get-contrast cannot contrast transparent colors")}getRgbTriplet(t,e){if("string"!=typeof t)throw new TypeError("get-contrast expects colors as strings");let n=t.toLowerCase();return n=this.isNotTransparent(n,e),n.match(/\((.*)\)/)[1].split(",").slice(0,3)}wcagRgb(t,e){return this.luminance(this.relativeLuminance(t),this.relativeLuminance(e))}luminance(t,e){return(Math.max(t,e)+.05)/(Math.min(t,e)+.05)}relativeLuminance(t){const e=t[0]/255,n=t[1]/255,o=t[2]/255,r=1/12.92;function i(t){return Math.pow((t+.055)/1.055,2.4)}return.2126*(e<=.03928?e*r:i(e))+.7152*(n<=.03928?n*r:i(n))+.0722*(o<=.03928?o*r:i(o))}}function b(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}var y=Array.prototype.concat,f=Array.prototype.slice,R=function(t){for(var e=[],n=0,o=t.length;n<o;n++){var r=t[n];b(r)?e=y.call(e,f.call(r)):e.push(r)}return e};R.wrap=function(t){return function(){return t(R(arguments))}};const T=R;var O={},A=Object.hasOwnProperty,_=Object.create(null);for(var I in O)A.call(O,I)&&(_[O[I]]=I);var D={to:{},get:{}};function S(t,e,n){return Math.min(Math.max(e,t),n)}D.get=function(t){var e,n;return"hsl"===t.substring(0,3).toLowerCase()?(e=D.get.hsl(t),n="hsl"):(e=D.get.rgb(t),n="rgb"),e?{model:n,value:e}:null},D.get.rgb=function(t){if(!t)return null;var e,n,o,r=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(o=e[2],e=e[1],n=0;n<3;n++){var i=2*n;r[n]=parseInt(e.slice(i,i+2),16)}o&&(r[3]=parseInt(o,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(o=(e=e[1])[3],n=0;n<3;n++)r[n]=parseInt(e[n]+e[n],16);o&&(r[3]=parseInt(o+o,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)r[n]=parseInt(e[n+1],0);e[4]&&(e[5]?r[3]=.01*parseFloat(e[4]):r[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:A.call(O,e[1])?((r=O[e[1]])[3]=1,r):null:null;for(n=0;n<3;n++)r[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?r[3]=.01*parseFloat(e[4]):r[3]=parseFloat(e[4]))}for(n=0;n<3;n++)r[n]=S(r[n],0,255);return r[3]=S(r[3],0,1),r},D.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,S(parseFloat(e[2]),0,100),S(parseFloat(e[3]),0,100),S(isNaN(n)?1:n,0,1)]}return null},D.to.rgb=function(){var t=T(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},D.to.hsl=function(){var t=T(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"};const C=D,L={},w={};for(const t of Object.keys(L))w[L[t]]=t;const N={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"}};Math.pow(6/29,3);for(const t of Object.keys(N)){if(!("channels"in N[t]))throw new Error("missing channels property: "+t);if(!("labels"in N[t]))throw new Error("missing channel labels property: "+t);if(N[t].labels.length!==N[t].channels)throw new Error("channel and label counts mismatch: "+t);const{channels:e,labels:n}=N[t];delete N[t].channels,delete N[t].labels,Object.defineProperty(N[t],"channels",{value:e}),Object.defineProperty(N[t],"labels",{value:n})}N.rgb.hsl=function(t){const e=t[0]/255,n=t[1]/255,o=t[2]/255,r=Math.min(e,n,o),i=Math.max(e,n,o),l=i-r;let a,s;i===r?a=0:e===i?a=(n-o)/l:n===i?a=2+(o-e)/l:o===i&&(a=4+(e-n)/l),a=Math.min(60*a,360),a<0&&(a+=360);const c=(r+i)/2;return s=i===r?0:c<=.5?l/(i+r):l/(2-i-r),[a,100*s,100*c]},N.hsl.rgb=function(t){const e=t[0]/360,n=t[1]/100,o=t[2]/100;let r,i,l;if(0===n)return l=255*o,[l,l,l];r=o<.5?o*(1+n):o+n-o*n;const a=2*o-r,s=[0,0,0];for(let t=0;t<3;t++)i=e+1/3*-(t-1),i<0&&i++,i>1&&i--,l=6*i<1?a+6*(r-a)*i:2*i<1?r:3*i<2?a+(r-a)*(2/3-i)*6:a,s[t]=255*l;return s};const x=N;function P(t,e){return function(n){return e(t(n))}}function k(t,e){const n=[e[t].parent,t];let o=x[e[t].parent][t],r=e[t].parent;for(;e[r].parent;)n.unshift(e[r].parent),o=P(x[e[r].parent][r],o),r=e[r].parent;return o.conversion=n,o}const M={};Object.keys(x).forEach((t=>{M[t]={},Object.defineProperty(M[t],"channels",{value:x[t].channels}),Object.defineProperty(M[t],"labels",{value:x[t].labels});const e=function(t){const e=function(t){const e=function(){const t={},e=Object.keys(x);for(let n=e.length,o=0;o<n;o++)t[e[o]]={distance:-1,parent:null};return t}(),n=[t];for(e[t].distance=0;n.length;){const t=n.pop(),o=Object.keys(x[t]);for(let r=o.length,i=0;i<r;i++){const r=o[i],l=e[r];-1===l.distance&&(l.distance=e[t].distance+1,l.parent=t,n.unshift(r))}}return e}(t),n={},o=Object.keys(e);for(let t=o.length,r=0;r<t;r++){const t=o[r];null!==e[t].parent&&(n[t]=k(t,e))}return n}(t);Object.keys(e).forEach((n=>{const o=e[n];M[t][n]=function(t){const e=function(...e){const n=e[0];if(null==n)return n;n.length>1&&(e=n);const o=t(e);if("object"==typeof o)for(let t=o.length,e=0;e<t;e++)o[e]=Math.round(o[e]);return o};return"conversion"in t&&(e.conversion=t.conversion),e}(o),M[t][n].raw=function(t){const e=function(...e){const n=e[0];return null==n?n:(n.length>1&&(e=n),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(o)}))}));const V=M,j=["keyword","gray","hex"],U={};for(const t of Object.keys(V))U[[...V[t].labels].sort().join("")]=t;const X={};function Y(t,e){if(!(this instanceof Y))return new Y(t,e);if(e&&e in j&&(e=null),e&&!(e in V))throw new Error("Unknown model: "+e);let n,o;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof Y)this.model=t.model,this.color=[...t.color],this.valpha=t.valpha;else if("string"==typeof t){const e=C.get(t);if(null===e)throw new Error("Unable to parse color from string: "+t);this.model=e.model,o=V[this.model].channels,this.color=e.value.slice(0,o),this.valpha="number"==typeof e.value[o]?e.value[o]:1}else if(t.length>0){this.model=e||"rgb",o=V[this.model].channels;const n=Array.prototype.slice.call(t,0,o);this.color=W(n,o),this.valpha="number"==typeof t[o]?t[o]:1}else if("number"==typeof t)this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;const e=Object.keys(t);"alpha"in t&&(e.splice(e.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);const o=e.sort().join("");if(!(o in U))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=U[o];const{labels:r}=V[this.model],i=[];for(n=0;n<r.length;n++)i.push(t[r[n]]);this.color=W(i)}if(X[this.model])for(o=V[this.model].channels,n=0;n<o;n++){const t=X[this.model][n];t&&(this.color[n]=t(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}Y.prototype={toString(){return this.string()},string(t){let e=this.model in C.to?this:this.rgb();e=e.round("number"==typeof t?t:1);const n=1===e.valpha?e.color:[...e.color,this.valpha];return C.to[e.model](n)},round(t){return t=Math.max(t||0,0),new Y([...this.color.map(F(t)),this.valpha],this.model)},alpha(t){return void 0!==t?new Y([...this.color,Math.max(0,Math.min(1,t))],this.model):this.valpha},lighten(t){const e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken(t){const e=this.hsl();return e.color[2]-=e.color[2]*t,e}};for(const t of Object.keys(V)){if(j.includes(t))continue;const{channels:e}=V[t];Y.prototype[t]=function(...e){return this.model===t?new Y(this):e.length>0?new Y(e,t):new Y([...B(V[this.model][t].raw(this.color)),this.valpha],t)},Y[t]=function(...n){let o=n[0];return"number"==typeof o&&(o=W(n,e)),new Y(o,t)}}function F(t){return function(e){return function(t,e){return Number(t.toFixed(e))}(e,t)}}function B(t){return Array.isArray(t)?t:[t]}function W(t,e){for(let n=0;n<e;n++)"number"!=typeof t[n]&&(t[n]=0);return t}const H=Y,$="rgb(255, 255, 255)",z="rgb(0, 0, 0)";function q(t,e){return H(t).alpha(e).string()}function G(t,e){try{return H(t).lighten(e).rgb().string()}catch(e){return console.warn("ColorUtils.lighten:",e),t}}function Q(t,e){try{return H(t).darken(e).rgb().string()}catch(e){return console.warn("ColorUtils.darken:",e),t}}function K(t,e){try{return(new E).ratio(t,e)}catch(n){return console.warn(`ColorUtils.getContrastRatio: transparent colors were used ${t}, ${e}`),0}}function Z(t){const{element:e,html:n,appendHtml:o}=t,r=function(t){if(null==t)return"";if("string"!=typeof t)return String(t);if(""===t)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(t))return t;const e=(new DOMParser).parseFromString(t,"text/html");return e.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach((t=>t.remove())),e.querySelectorAll("*").forEach((t=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach((e=>t.removeAttribute(e))),Array.from(t.attributes).forEach((e=>{e.name.startsWith("on")&&t.removeAttribute(e.name)})),"A"===t.tagName||"AREA"===t.tagName){const e=t.getAttribute("href");e&&(e.startsWith("javascript:")||e.startsWith("data:"))&&t.removeAttribute("href")}if("IMG"===t.tagName||"IFRAME"===t.tagName){const e=t.getAttribute("src");e&&(e.startsWith("javascript:")||e.startsWith("data:text/html"))&&t.removeAttribute("src")}if("FORM"===t.tagName){const e=t.getAttribute("action");e&&e.startsWith("javascript:")&&t.removeAttribute("action")}})),e.body.innerHTML}(n);o?e.innerHTML+=r:e.innerHTML=r}function J(t,e){Object.keys(e).forEach((n=>{t.style[n]=e[n]}))}function tt(t,e){const n=window.getComputedStyle(t);return e.reduce(((t,e)=>(t[e]=n.getPropertyValue(e),t)),{})}function et(t,e){var n,o;let r;return t.styles&&(r=null===(n=t.styles.find((t=>"label"===t.element)))||void 0===n?void 0:n.params),t.adaptiveStyles&&!r&&(r=null===(o=t.adaptiveStyles[e].find((t=>"label"===t.element)))||void 0===o?void 0:o.params),r}function nt(t,e,n,o){const r=n.querySelector(o),i=et(t,e);if(!i)return;const l=n.querySelector(".label");Z({element:l,html:t.content.label}),"TOP"===i.position?(r.style.flexDirection="column",r.style.alignItems="unset",J(l,{marginRight:0,marginBottom:`${i.margin}px`})):(r.style.flexDirection="row",r.style.alignItems="center",J(l,{marginRight:`${i.margin}px`,marginBottom:0})),i.enabled?l.style.display="":l.style.display="none"}function ot(t,e,n){const o=function(t,e){const n=getComputedStyle(t)[e]||t.style.getPropertyValue(e);if(n&&n.includes("rgb")&&(!(n.split("rgb").length>2)||n.includes("#")))return n}(e,n);if(o){const e=q(o,.5);return t.classList.add("focus-outline-defined"),t.style.setProperty("--clFocusOutline",`3px solid ${e}`),e}return null}function rt(){return o("overlay-menu-content")}function it(t,e,n,o,r,l){const a=function(t,e,n,o,r){const l=function(t,e,n,o){const r=i.width(o),{right:l}=t.getBoundingClientRect(),a=r-n-l-i.scrollbarWidth(o);return{horizontalOffset:n,contentWidth:lt(e).width,availableSpaceToTheLeftSideOfTheTrigger:l-n,availableSpaceToTheRightSideOfTheTrigger:a}}(t,e,n,r),a=function(t,e,n,o){const r=i.height(o),{top:l,bottom:a}=t.getBoundingClientRect();return{verticalOffset:n,contentHeight:lt(e).height,availableSpaceAboveTriggerElem:l-n,availableSpaceBelowTriggerElem:r-a-n}}(t,e,n,r);let s="undefined";const c={bottom:a.availableSpaceBelowTriggerElem>=a.contentHeight,top:a.availableSpaceAboveTriggerElem>=a.contentHeight,right:l.availableSpaceToTheRightSideOfTheTrigger>=l.contentWidth,left:l.availableSpaceToTheLeftSideOfTheTrigger>=l.contentWidth};if(c.top?s="top":c.bottom?s="bottom":c.right?s="right":c.left&&(s="left"),c[o]&&(s=o),"undefined"===s){const t=Math.max(a.availableSpaceBelowTriggerElem,a.availableSpaceAboveTriggerElem,l.availableSpaceToTheRightSideOfTheTrigger,l.availableSpaceToTheLeftSideOfTheTrigger);t===a.availableSpaceBelowTriggerElem?s="bottom":t===a.availableSpaceAboveTriggerElem?s="top":t===l.availableSpaceToTheRightSideOfTheTrigger?s="right":t===l.availableSpaceToTheLeftSideOfTheTrigger&&(s="left")}return Object.assign(Object.assign(Object.assign({},a),l),{position:s})}(t,e,n,o,l=l||document);return function(t,e){const{marginBottom:n,marginTop:o}=window.getComputedStyle(e);if("top"===t.position)J(e,{"margin-top":`${parseInt(o,10)+parseInt(n,10)}px`}),J(e,{"margin-bottom":"0px"});else if("bottom"===t.position)J(e,{"margin-bottom":`${parseInt(n,10)+parseInt(o,10)}px`}),J(e,{"margin-top":"0px"});else{const t=(parseInt(n,10)+parseInt(o,10))/2+"px";J(e,{"margin-top":t,"margin-bottom":t})}}(a,e),{coordinates:at(a,t.getBoundingClientRect(),e.getBoundingClientRect(),r,l),position:a.position}}function lt(t){const{width:e,height:n}=t.getBoundingClientRect(),{marginBottom:o,marginTop:r,marginLeft:i,marginRight:l}=window.getComputedStyle(t);return{width:e+parseInt(i,10)+parseInt(l,10),height:n+parseInt(r,10)+parseInt(o,10)}}function at(t,e,n,o,r){switch(t.position){case"top":return{left:`${st(e,n,o,r)}px`,top:t.availableSpaceAboveTriggerElem-t.contentHeight-t.verticalOffset+"px"};case"bottom":return{left:`${st(e,n,o,r)}px`,bottom:t.availableSpaceBelowTriggerElem-t.contentHeight-t.verticalOffset+"px"};case"left":return{left:t.availableSpaceToTheLeftSideOfTheTrigger-e.width-t.contentWidth-t.horizontalOffset+"px",top:`${ct(0,t)}px`};case"right":return{right:t.availableSpaceToTheRightSideOfTheTrigger-t.contentWidth-t.horizontalOffset+"px",top:`${ct(0,t)}px`}}}function st(t,e,n,o){let r=n?t.x+t.width/2-e.width/2:t.x;return r<0&&(r=0),r+e.width>i.width(o)&&(r-=r+e.width-i.width(o)),r}function ct(t,e){let n=e.availableSpaceAboveTriggerElem;return e.contentHeight>e.availableSpaceBelowTriggerElem&&(n-=e.contentHeight-e.availableSpaceBelowTriggerElem),n}function dt(t,e){return t.startsWith("transparent")||t.startsWith("none")||!t.startsWith("rgb")||1!==(n=t.slice(0,t.match(/\)/).index+1),H(n).alpha())?K(e,$)>K(e,z)?$:z:t;var n}function ut(t){const e=K(t,$),n=K(t,z);let o,r;if(e>n)for(o=$,r=e;r>5;)o=Q(o,.1),r=K(t,o);else for(o="rgb(10, 10, 10)",r=n;r>5;)o=G(o,.1),r=K(t,o);return q(o,.2)}const pt="cl-tooltip-text-styles",ht=`\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 mt(t,e,n,o){let r;o=o||document,t.classList.add("invalid"),e.style.visibility="visible",e.onmouseenter=()=>{(function(t){if((t=t||document).head.querySelector(`#${pt}`))return;const e=document.createElement("style");e.setAttribute("id",pt),Z({element:e,html:ht}),t.head.appendChild(e)})(o),r=function(t){const e="cl-overlay-tooltip-text",n=document.getElementById(e)||document.createElement("div");return n.classList.add("cl-tooltip-text"),n.textContent!==t&&(n.textContent=t,n.style=null),n.id||(n.id=e),n}(n),o.body.append(r),r.style.visibility="visible",function(t){const{triggerElement:e,tooltipElement:n,offset:o=10,htmlDocumentObject:r}=t,i=it(e,n,o,"top",!0,r);n.setAttribute("cl-tooltip-position",i.position),J(n,i.coordinates)}({triggerElement:e,tooltipElement:r,htmlDocumentObject:o})},e.onmouseleave=()=>{r&&(r.remove(),function(t){const e=(t=t||document).head.querySelector(`#${pt}`);e&&e.remove()}(o))}}function gt(t){return[t.getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter((t=>!!t))}function vt(t,e){return e.reduce(((e,n)=>{if(e)return e;const o=function(t,e){if(!t)return null;if(e[t])return{translations:e[t],language:t};const n=Et(t);return e[n]?{translations:e[n],language:n}:null}(n,t);return o||null}),null)}function Et(t){return t.includes("-")?t.split("-")[0].toLowerCase():t.includes("_")?t.split("_")[0].toLowerCase():t}function bt(t,e,n){const o=vt(e,gt(t)).translations,r=Object.keys(o).find((t=>t.includes(n)));return r?o[r]:n}const yt="VIEW",ft="MODULE",Rt="CONTAINER",Tt="INPUT",Ot="BUTTON",At="CONSENT",_t="COLUMN",It="SUBSCRIBE_CONTACT",Dt="REQUEST",St="SHOW_WIDGET",Ct="OPEN_LINK",Lt="CLOSE_WIDGET";class wt{static sortActions(t){const e={[Lt]:-1,[Ct]:-2,[St]:1,[It]:2,[Dt]:3},n=t=>void 0!==e[t.type]?e[t.type]:0;return[...t].sort(((t,e)=>n(t)>n(e)?-1:n(t)<n(e)?1:0))}constructor(t,e){this.config=t,this.actions=wt.sortActions(e),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(t,e,n){this.state=t;const o=n(),i=o.getAttribute(r("id"));this.listener=t=>{const e=t.composedPath().filter((t=>t instanceof HTMLElement&&t.getAttribute(r("type"))));let n=0;for(;e[n]&&e[n].getAttribute(r("id"))!==i;){let t=e[n].getAttribute(r("type"));if(wt.IGNORING_VIEW_ENTRY_TYPES.includes(t))return;n++}this.eventsQueue.push({event:t}),this.postponed||this.execute()},this.targetElements=this.config.relativeSelector?Array.from((o.shadowRoot||o).querySelectorAll(this.config.relativeSelector)):[o],this.targetElements.forEach((t=>{t.addEventListener("click",this.listener)}))}async execute(){var t,e,n,o;try{for(var r,i=!0,l=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},o("next"),o("throw"),o("return"),e[Symbol.asyncIterator]=function(){return this},e);function o(n){e[n]=t[n]&&function(e){return new Promise((function(o,r){!function(t,e,n,o){Promise.resolve(o).then((function(e){t({value:e,done:n})}),e)}(o,r,(e=t[n](e)).done,e.value)}))}}}(this.eventsQueue);!(t=(r=await l.next()).done);){o=r.value,i=!1;try{const{event:t}=o;for(const e of this.actions)if(!await e.execute(this.state.getState(),t))break}finally{i=!0}}}catch(t){e={error:t}}finally{try{i||t||!(n=l.return)||await n.call(l)}finally{if(e)throw e.error}}this.eventsQueue=[]}postpone(){this.postponed=!0}release(){this.postponed=!1,this.execute()}destroy(){this.listener&&this.targetElements.length&&(this.targetElements.forEach((t=>{t.removeEventListener("click",this.listener)})),this.targetElements=[])}}wt.IGNORING_VIEW_ENTRY_TYPES=[Ot,At,Tt];const Nt="CLICK",xt="COMPONENT_EVENT";class Pt{constructor(t,e){this.config=t,this.actions=e,this.componentEmitterListener=null}activate(t,e,n){this.componentEmitterListener=e.on(this.config.eventName,(()=>{this.actions.forEach((e=>e.execute(t.getState(),this.config.params)))}))}destroy(){this.componentEmitterListener&&this.componentEmitterListener.off()}}class kt{constructor(t,e){this.actionFactory=t,this.actionRegister=e}get(t){const e=t.actions.map((t=>this.actionFactory.get(t)));switch(e.forEach((t=>this.actionRegister.register(t))),t.type){case Nt:return new wt(t,e);case xt:return new Pt(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class Mt{static generate(){let t,e="";for(let n=0;n<32;n++)8!==n&&12!==n&&16!==n&&20!==n||(e+="-"),t=Math.floor(16*Math.random()).toString(16).toUpperCase(),e+=t;return e}}class Vt{constructor(){this.listeners=Vt.createDefaultListenersState()}emit(t,e,n=null){const o=this.listeners[t];o&&Object.values(o).forEach((o=>o(e,t,n))),Object.values(this.listeners["*"]).forEach((o=>o(e,t,n)))}on(t,e){const n=Mt.generate(),o=this.listeners[t];return o?o[n]=e:this.listeners[t]={[n]:e},{off:()=>{var e,o;(null===(o=null===(e=this.listeners)||void 0===e?void 0:e[t])||void 0===o?void 0:o[n])&&delete this.listeners[t][n]}}}destroy(){this.listeners=Vt.createDefaultListenersState()}}Vt.createDefaultListenersState=()=>({"*":{}});const jt=(t,e,n,o)=>{const{addEventListenerBase:r,addEventListener:i}=EventTarget.prototype;(r||i).call(t,e,n,o)};class Ut{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class Xt{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===ft?Object.assign(Object.assign({},t),Xt.moduleToContainerParams):t));return Object.assign(Object.assign({},t),{children:e})}));return Object.assign(Object.assign({},t),{views:e})}static sort(t,e){return t.index>e.index?1:-1}static reIndex(t,e){return Object.assign(Object.assign({},t),{index:e+t.index})}}Xt.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"};class Yt extends Vt{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on("ENVIRONMENT_UPDATE",(({isMobileEnv:t})=>{this._isMobile=t,this.emit(Yt.changeEventName,this._isMobile)}))}handleMobileBreakpoint(t){this.mobileBreakpointWidth=t;const e=Number.isInteger(this.mobileBreakpointWidth)?`${this.mobileBreakpointWidth}px`:this.mobileBreakpointWidth;this.mediaQueryList=window.matchMedia(`(max-width: ${e})`),this.mediaQueryList.addListener(this.listener.bind(this)),this._isMobile=this.mediaQueryList.matches,this.emit(Yt.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(Yt.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}Yt.changeEventName="CHANGE";class Ft{static set(t,e){const n=t[Ft.accumulatorPropertyName]||{};t[Ft.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[Ft.accumulatorPropertyName]).forEach((n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""}))}}Ft.accumulatorPropertyName="clStyleAttributes";const Bt="CONTENT_LOCKER";class Wt{static applyHostStyles(t,e,n=null,o){var r,i,l;const a=null===(i=null===(r=null==n?void 0:n.props)||void 0===r?void 0:r.handlers)||void 0===i?void 0:i.find((t=>"CLICK"===t.type));a&&(null===(l=a.actions)||void 0===l?void 0:l.length)&&(e.style.cursor="pointer"),t!==yt&&t!==Rt&&t!==_t||(e.style.display=o===Bt&&t===yt?"flex":"inline-flex",e.style.position="relative"),e.style.boxSizing="border-box"}constructor(){this.styles="/* common styles */ *, *:before, *:after { box-sizing: border-box; font-family: inherit; }"}setStyles(t=""){this.styles=`${this.styles} ${t}`}getStyles(){return this.styles}}class Ht{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class $t{constructor(t,e,n,o,r,i){this.hostElement=e,this.documentModel=t,this.getSharedCb=n,this.getPropsCb=o,this.getEnvCb=r,this.httpClient=i,this.subscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(t){const e=String(t||"");if(e.includes("url")){const[t,n]=e.split("(")[1].split(")");return{url:t.replace(/['"]+/g,""),positionOptions:n.replace(";","")}}return{url:null,positionOptions:null}}apply(t){const e=this.getPropsCb();return e.backgroundDynamicInlineSVGElements[t].forEach((n=>{var o,r,i,l,a;const s=null===(r=null===(o=e.adaptiveStyles)||void 0===o?void 0:o[t])||void 0===r?void 0:r.find((t=>t.element===n)),c=(null===(i=e.styles)||void 0===i?void 0:i.find((t=>t.element===n)))||{},d=(null===(l=null==c?void 0:c.styleAttributes)||void 0===l?void 0:l.background)||(null===(a=null==s?void 0:s.styleAttributes)||void 0===a?void 0:a.background),u=this.parseBackground(d);u.url&&this.envUrlMaps[t].set(n,{originalSVGResourceURL:u.url,inlineSvgString:null,positionOptions:u.positionOptions})})),Promise.all([...this.envUrlMaps[t].entries()].map((([e,n])=>this.httpClient.execute(n.originalSVGResourceURL).then((t=>t.text())).then((o=>{this.envUrlMaps[t].set(e,Object.assign(Object.assign({},n),{inlineSvgString:o}))}))))).then((()=>{var e;this._applyHostElementBackground(this.envUrlMaps[t].get("host"),null===(e=this.getSharedCb().theme)||void 0===e?void 0:e.schema)})).catch((t=>{console.error(t),Ht.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${t}`)}))}on(){return this.subscription=this.documentModel.on("THEME_UPDATE",(t=>{this._applyHostElementBackground(this.envUrlMaps[this.getEnvCb()].get("host"),t.schema)})),this}_applyHostElementBackground(t,e={}){t&&(this.hostElement.style.background=this._buildBackgroundUrl(t,e))}_buildBackgroundUrl(t,e){const n=t.inlineSvgString.trim().replace("var(--cl-schema-accent)",e.accent);return`url('data:image/svg+xml,${encodeURIComponent(n)}')${t.positionOptions}`}}const zt=new class{execute(t,e,n=null,o,r){const i={method:e,headers:Object.assign({"Content-Type":"text/plain"},o||{}),credentials:"same-origin",body:null,signal:r};return n&&(i.body="string"==typeof n?n:JSON.stringify(n)),fetch(t,i)}};function qt(t,e){return Object.keys(t).filter((t=>!e.includes(t))).reduce(((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]})),{})}class Gt{static camelCaseToDashCase(t){return t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}static camelCaseToUpperSnakeCase(t){return t.replace(/[A-Z]/g,(t=>"_"+t)).toUpperCase()}}class Qt{constructor(t){this._count=0,this.onUpdateCb=t}increment(){this._count++,this.onUpdateCb(this.count())}decrement(){this._count>0&&this._count--,this.onUpdateCb(this.count())}count(){return this._count}}const Kt="COMPONENT_RESOURCES_LOADED",Zt="FAILED_TO_LOAD_COMPONENT_RESOURCE";class Jt{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(Kt,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(Zt,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=n,this.counters={pending:new Qt(this.onCounterStateUpdate)}}}const te=(...t)=>{let e=t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:[]})),{});return{get:t=>e[t],clear:()=>te(...t)}},ee=te,ne="props",oe="shared",re="environment";function ie(t,e,n,o){const r=t=>{let i=t instanceof DocumentFragment||(null==t?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?t.host:t;return i&&(o&&"function"==typeof o?o(i.getAttribute(e)):(null===(l=null==i?void 0:i.getAttribute)||void 0===l?void 0:l.call(i,e))===n)?i:i&&i.parentNode&&r(i.parentNode)||null;var l};return r(t)}const le="SUBMIT";function ae(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach((n=>{"element"!==n&&"classes"!==n&&(e[n]&&"object"==typeof e[n]&&!Array.isArray(e[n])?t[n]=Object.assign(Object.assign({},t[n]||{}),e[n]):t[n]=e[n])})),t):t}const se={DESKTOP:"desktop",MOBILE:"mobile"};function ce(t,e,n){var o;return null===(o=t[e])||void 0===o?void 0:o.find((t=>t.element===n))}function de(t=[]){return t.map((t=>Object.assign(Object.assign({},t),{styleAttributes:Object.assign({},t.styleAttributes)})))}function ue(t,e,o){let r="rgb(0, 0, 0)";const i=t.adaptiveStyles[e].find((t=>"input"===t.element));if(i.placeholderStyleAttributes&&i.placeholderStyleAttributes.color)return i.placeholderStyleAttributes.color;const l=(i.classes||"").split(" ").filter((t=>t.startsWith(n)));if(!l.length)return r;let a=o.textClasses[l[0]];return a&&a.placeholderStyleAttributes&&a.placeholderStyleAttributes.color?a.placeholderStyleAttributes.color:r}class pe extends Event{constructor(t,e,n){super(t,n),this.detail={},Object.defineProperty(this,"detail",{value:e})}}class he extends HTMLElement{constructor(){var t,e;super(),this.construct=()=>{let t;const e=this.getAttribute(r("id")),n=this.getWidgetContainerNode();if(!n)throw new Error("Widget container not found in construct");const o=n.closest(`[${r("widget-id")}]`);let i;o&&(i=o.getAttribute(r("widget-id")));let l=new pe("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(r("path")),id:e,widgetId:i},{bubbles:!0,composed:!0});this.dispatchEvent(l),t=l.detail.props,Object.assign(this,t),this.observers=ee(ne,oe,re),this.subscriptions=new class{constructor(){this.subscriptions=[]}push(t){this.subscriptions.push(t)}off(){this.subscriptions.forEach((t=>null==t?void 0:t.off()))}},this.state=new Ut,this.componentEventEmitter=new Vt,this.componentResourceManager=new Jt(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 kt(this._actionFactory,this.services.actionRegister),this.prevProps=this.model.props,this.prevEnvironment=this.getEnvironment(),this.documentModel.on(`COMPONENT_PROPS_UPDATE_${this.model.id}`,(t=>{this.model.props=t,this.observers.get(ne).forEach((e=>e(this.prevProps,t))),this.prevProps=t;const e=this.getHostElement(),n=r("floating");t.floating&&!e.getAttribute(n)?e.setAttribute(n,"true"):!t.floating&&e.getAttribute(n)&&e.removeAttribute(n)})),this.documentModel.on(`COMPONENT_UPDATE_${this.model.id}`,(t=>{Object.assign(this.model,t)})),this.documentModel.on("SHARED_UPDATE_ALL",(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles),this.observers.get(oe).forEach((t=>t(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new $t(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),zt),this.colorSchemaListener.apply(this.getEnvironment()).then((()=>{this.subscriptions.push(this.colorSchemaListener.on())}))),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(Yt.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(re).forEach((e=>e(this.prevEnvironment,t))),this.prevEnvironment=t})))},this.attachHandlers=()=>{this.getHandlers().map((t=>this._handlerFactory.get(t))).map((t=>()=>t.activate(this.state,this.componentEventEmitter,this.getHostElement.bind(this)))).forEach((t=>t()))},this.postponeHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.postpone()))},this.releaseHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.release()))},this.getProps=()=>{var t;return null===(t=this.getModel())||void 0===t?void 0:t.props},this.getShared=()=>this.documentModel.getShared(),this.getEnvironment=()=>this.resizeListener.isMobile()?"mobile":"desktop",this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(ne).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(oe).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(re).push(t),t(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${r("element")}]`)).filter((t=>!t.hasAttribute(r("component"))))],this.getElement=(t,e)=>this.getElements().find((n=>e?n.getAttribute(r("element"))===t&&n.id===e:n.getAttribute(r("element"))===t)),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const n=this.getElements();if(!n.length)return;t=function(t,e){if(!e)return t||{desktop:[],mobile:[]};const n=JSON.parse(JSON.stringify(t||{desktop:[],mobile:[]}));return e.forEach((t=>{const e=t.element;let o=!1,r=!1;n.desktop&&n.desktop.forEach((n=>{n.element===e&&(ae(n,t),o=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===e&&(ae(n,t),r=!0)})),!o&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(t))),!r&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(t)))})),n}(t,e);const o=r("type"),i="element-styles";let l=this.getRootElement().querySelector(`style[${o}="${i}"]`);l||(l=document.createElement("style"),l.setAttribute(o,i),this.getRootElement().appendChild(l)),Z({element:l,html:""}),n.forEach((e=>{let n=e.getAttribute(r("element"));const o=this.getEnvironment();let i=ce(t,o,n);if(i){if(this.resizeListener.isMobile()){const e=ce(t,"desktop",n);e&&(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},e.styleAttributes),i.styleAttributes)}))}this.applyStylesToElement(e,this.applySharedClassesToElementModel(i),l)}})),this._addLinkColor(l,this.getShared())},this.registerComponentResourceManagement=()=>{this.viewResourceManager.registerComponent(this.model.id,this.componentResourceManager)},this.applyStyles=(t,e={})=>{if(!t||!t.style)return!1;for(const[n,o]of Object.entries(e))t.style[n]=o;return!0},this.applyStylesToElement=(t,e,n)=>{var o,i;const l=[];"host"===(e=he._resolveTogglableStylesForElementModel(e)).element&&(Wt.applyHostStyles(this.model.type,t,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(o=this.model.props.backgroundDynamicInlineSVGElements)||void 0===o?void 0:o.desktop)||"mobile"===this.getEnvironment()&&(null===(i=this.model.props.backgroundDynamicInlineSVGElements)||void 0===i?void 0:i.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),l.push("background")));let a=e.styleAttributes.background,s=a&&a.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&s){this.componentResourceManager.getPending().increment();const t=new Image;t.src=s[1],jt(t,"load",(()=>{this.componentResourceManager.getPending().decrement()})),jt(t,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(t.src),"UPDATING"===this.services.config.getConfig("entryModuleType")&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},e),{styleAttributes:qt(e.styleAttributes,l)});if(Ft.set(t,c),this._setClassAttributes(t,e),n){if(e.hoverStyleAttributes){let o=Object.assign({},e.hoverStyleAttributes);if("FILL_UP"===e.hoverAnimationType){t.style.boxShadow="inset 0px 0px 0px 0px rgb(0, 0, 0, 0)",t.style.overflow="hidden";const n=t.tagName.toLowerCase(),r=`flip-up-animation-${e.element}`;let i=this.getRootElement().querySelector(`#${r}`);i||(i=document.createElement("style"),i.id=r,t.appendChild(i)),Z({element:i,html:`\n ${n}::before {\n content: '';\n background: ${o.background};\n position: absolute;\n left: 0;\n top: ${t.getBoundingClientRect().height}px;\n height: ${t.getBoundingClientRect().height}px;\n width: 100%;\n z-index: -10;\n }\n ${n}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),o=Object.assign(Object.assign({},e.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,e.element,o,`:not(.${r("no-hover")}):hover`,!0)}e.placeholderStyleAttributes&&this._addStylesToStyleElement(n,e.element,e.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(n,this.getShared()),this.stylesAppliedToElement(t,e,n)}},this._fixMarginOverflow=t=>{const e=this.getParentComponent(),n=e&&("flex"===e.style.display||"inline-flex"===e.style.display),o="host",i=t.getAttribute(r("element"))===o;if(!n||!i)return;const l=this.getProps(),a=this.getEnvironment(),{styleAttributes:s}=ce(l.adaptiveStyles,a,o)||{};if(!s)return;const c=s.marginLeft||s.marginRight,d="100%"===s.width;if(c&&d){const e=(parseFloat(s.marginLeft)||0)+(parseFloat(s.marginRight)||0);e&&setTimeout((()=>{t.style.width=`calc(100% - ${e}px)`}))}},this.applySharedClassesToElementModel=t=>function(t,e){let o=t;return(o.classes||"").split(" ").filter((t=>t.startsWith(n))).forEach((t=>{var n;let r=null===(n=e.textClasses)||void 0===n?void 0:n[t];r&&(r.styleAttributes.fontFamily||(r.isHeader&&e.headerFontFamily&&(r=Object.assign(Object.assign({},r),{styleAttributes:Object.assign(Object.assign({},r.styleAttributes),{fontFamily:e.headerFontFamily})})),!r.isHeader&&e.textFontFamily&&(r=Object.assign(Object.assign({},r),{styleAttributes:Object.assign(Object.assign({},r.styleAttributes),{fontFamily:e.textFontFamily})}))),o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),r.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},o.placeholderStyleAttributes),r.placeholderStyleAttributes)}))})),o.styleAttributes.fontFamily||(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),{fontFamily:e.textFontFamily})})),o}(t,this.documentModel.getShared()),this.getModel=()=>this.model,this._addStylesToStyleElement=(t,e,n,o="",i)=>{const l=Object.keys(n).reduce(((t,e)=>t+` ${Gt.camelCaseToDashCase(e)}: ${n[e]}${i?" !important;":";"}`),"");Z({element:t,html:`[${r("element")}="${e}"]${o} { ${l} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{Z({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,o,r,i;e.linkColor&&Z({element:t,html:`a {color: ${e.linkColor}}, a:visited {color: ${e.linkColor}}`,appendHtml:!0}),(null===(n=e.linkParams)||void 0===n?void 0:n.color)&&Z({element:t,html:`a {color: ${null===(o=e.linkParams)||void 0===o?void 0:o.color}}, a:visited {color: ${null===(r=e.linkParams)||void 0===r?void 0:r.color}}`,appendHtml:!0}),(null===(i=e.linkParams)||void 0===i?void 0:i.removeUnderline)&&Z({element:t,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(t,e)=>{Array.from(t.classList).filter((t=>t!==o("hovered")&&t!==o("focused"))).forEach((e=>{e.startsWith(n)&&t.classList.remove(e)}));const r=((t.getAttribute("class")||"")+" "+e.classes).trim();t.setAttribute("class",r)},this.getParentComponent=()=>ie(this.parentNode,r("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(r("path"));return t&&1===t.split(",").length?this.parentNode:ie(this.parentNode,r("path"),void 0,(t=>t&&1===t.split(",").length))},this.getWidgetLanguages=()=>gt(this.services.config),this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=t=>vt(t,this.getWidgetLanguages()),this.stylesAppliedToElement=(t,e,n)=>{},this.updateContext=()=>{var t;const e=this.getModel();this.services.context.updateRecord(e.id,{label:this.getContextRecordLabel(e.props),viewIndex:null===(t=e.path)||void 0===t?void 0:t[0]})},this.addContextRecord=()=>{var t;const e=this.getModel();this.services.context.addRecord(e.id,{recordKey:e.id,id:e.props.control.name,label:this.getContextRecordLabel(e.props),value:e.props.control.defaultValue||"",viewIndex:null===(t=e.path)||void 0===t?void 0:t[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(e.props)}})},this.getContextRecordLabel=t=>{var e,n;const o=t.control.name;if(["email","first_name","last_name"].includes(o))return o.toUpperCase();if(t.content.label&&(null===(n=null===(e=t.adaptiveStyles.desktop.find((t=>"label"===t.element)))||void 0===e?void 0:e.params)||void 0===n?void 0:n.enabled)){const e=(new DOMParser).parseFromString(t.content.label,"text/html");return this.capitalizeFirstLetter(e.body.textContent||"")}return t.content.placeholder?this.capitalizeFirstLetter(t.content.placeholder):t.control.integrationName?this.capitalizeFirstLetter(t.control.integrationName).replace(new RegExp("_","g")," "):void 0},this.capitalizeFirstLetter=t=>t.charAt(0).toUpperCase()+t.slice(1),this.getContextRecordExampleValue=t=>{switch(t.control.name){case"email":return"myemail@example.com";case"first_name":return"Maria";case"last_name":return"Taylor";default:return this.getContextRecordLabel(t)}},this.completeSubmitAction=t=>{const e=t||{},n=this.services.actionRegister.getRegisteredActions().find((t=>t.category===le));n?null==n||n.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:Dt}).execute(void 0,void 0,!0,e)},this.getHandlers=()=>this.getProps().handlers&&this.getProps().handlers.length?[...this.getProps().handlers]:[],this.assets=(t="")=>`${this.services.config.getConfig("staticResourcesUrl").replace(/\/$/,"")}/${this.manifest.name}/assets${t?`/${t}`:""}`,this.attachShadow({mode:"open"}),this.manifest=this.manifest||(null===(t=this.define)||void 0===t?void 0:t.manifest)||(null===(e=this.constructor.define)||void 0===e?void 0:e.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then((()=>{this.attachHandlers()}))}disconnectedCallback(){var t;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(t=this.mergeTagsProcessor)||void 0===t||t.destroy()}static _resolveTogglableStylesForElementModel(t){const e=Object.assign({},t);return Object.keys(e).forEach((t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=he._resolveTogglableStyles(e[t]))})),e}static _resolveTogglableStyles(t){const e=Object.assign({},t),n=(t,n,o)=>{n in e&&(t.forEach((t=>{t in e&&(e[t]=e[n]?e[t]:o)})),delete e[n])};return n(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),n(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),e}}const me=Symbol("required");var ge=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]])}return n};function ve(){}const Ee="pending",be="valid",ye="invalid";class fe extends he{constructor(){super(...arguments),this._createControl=(t={},...e)=>{var{element:n}=t,o=ge(t,["element"]);const r=this.getProps(),i=this.getModel(),l=Object.assign(Object.assign(Object.assign({},r.control),{componentId:i.id,viewIdx:i.path[0]}),o),a=this.services.form,s=[l,n,...e];return a.hasControl(r.control.name)?a.updateControl(...s):a.registerControl(...s)},this.createControlWithValidation=(t=[],e={})=>{var{element:n=this.getElement("input"),tooltipElement:o=this.getRootElement().querySelector(".input-tooltip"),validCallback:r=ve,invalidCallback:i=ve,pendingCallback:l=ve,elementToListen:a=n,validationMap:s={},listenStatusChange:c=!0}=e,d=ge(e,["element","tooltipElement","validCallback","invalidCallback","pendingCallback","elementToListen","validationMap","listenStatusChange"]);if(o&&(o.style.visibility="hidden"),!t||!Array.isArray(t))throw new Error("Validators should be an array");const u=this.getProps().control.validation,p=s[null==u?void 0:u.validator],h=t.some((t=>t[me])),m=!!(null==u?void 0:u.required),g=m||h,v=[...t];m&&!h&&v.unshift(function(t="REQUIRED"){const e=e=>{let n;switch(typeof e){case"string":n=e&&e.length>0;break;case"boolean":n=e;break;case"number":n=!isNaN(e);break;default:n=!!e}return{isValid:n,errorKey:n?null:t}};return e[me]=!0,e}()),p&&v.push(p);const E=this._prepareAsyncValidators(v),b=this._createControl({element:n,validation:{validator:"custom",required:g}},void 0,E);return c&&this._handleControlStatusChange(Object.assign({control:b,element:a,tooltipElement:o,configService:this.services.config,i18n:this.manifest.i18n,validCallback:r,invalidCallback:i,pendingCallback:l},d)),b},this._prepareAsyncValidators=(t=[])=>t.reduce(((t,e,n)=>"function"!=typeof e?(console.warn(`Validator ${n} should be a function, so it will be skipped`),t):(t[`custom_${n}`]=async(...t)=>{const n=await Promise.resolve(e(...t));return"object"==typeof n&&"isValid"in n?Object.assign(Object.assign({},n),{errorKey:n.isValid?null:n.errorKey}):{isValid:!1,errorKey:"INVALID_VALIDATOR_RESPONSE"}},t)),{}),this._handleControlStatusChange=n=>{n.control.on(t,(t=>{this._handleValidationStatus(n,t)})),n.control.on(e,(()=>{let t=Ee;switch(!0){case n.control.pending:t=Ee;break;case n.control.valid:t=be;break;default:t=ye}this._handleValidationStatus(n,t)}))},this._handleValidationStatus=(t,e)=>{const{control:n,element:o,tooltipElement:r,validCallback:i,invalidCallback:l,errorMessageMapper:a,pendingCallback:s}=t,c=this.services.config,d=this.manifest.i18n;switch(e){case be:(function(t,e){t.classList.remove("invalid"),e.style.visibility="hidden"})(o,r),i&&i();break;case ye:if(n.touched){const t=n.getErrorKeys();if(!t)break;const e=t[0];let i=bt(c,d,e);a&&(i=a(e,i)),mt(o,r,i,this.htmlDocumentObject),l&&l()}break;case Ee:n.touched&&(function(t,e){e.style.visibility="hidden",t.classList.contains("invalid")&&t.classList.remove("invalid")}(o,r),s&&s())}}}}const Re={name:"SysDateComponent",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",params:{width:{getValueFromElement:"host"},height:{getValueFromElement:"host"}}},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"input",params:{width:{getValueFromElement:"host"},height:{getValueFromElement:"host"}}},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"}]}],propertyPaneModel:{content:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"SIZE",element:"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:"DATE_FORMAT",propPath:["content","askYear"],displayCondition:"return !sdk.appConfig.useContactFields"},{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}}]},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","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Only integers, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Only integers, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Invalid date","content,label":"Title"},ru:{"control,validation,validationErrors,REQUIRED":"Обязательное поле","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Только целые числа, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Только целые числа, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Недействительная дата","content,label":"Заголовок"},uk:{"control,validation,validationErrors,REQUIRED":"Обов'язкове поле","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Тільки цілі числа, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Тільки цілі числа, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Недійсна дата","content,label":"Заголовок"},es:{"control,validation,validationErrors,REQUIRED":"Campo obligatorio","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Solo enteros, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Solo enteros, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Fecha invalida","content,label":"Título"},de:{"control,validation,validationErrors,REQUIRED":"Pflichtfeld","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Nur ganze Zahlen, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Nur ganze Zahlen, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Ungültiges Datum","content,label":"Titel"},fr:{"control,validation,validationErrors,REQUIRED":"Champs requis","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Seuls les entiers, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Seuls les entiers, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Date invalide","content,label":"Titre"},it:{"control,validation,validationErrors,REQUIRED":"Campo obbligatorio","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Solo numeri interi, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Solo numeri interi, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Data non valida","content,label":"Titolo"},pt:{"control,validation,validationErrors,REQUIRED":"Campo obrigatório","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Apenas integrais, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Apenas integrais, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Data inválida","content,label":"Título"},ro:{"control,validation,validationErrors,REQUIRED":"Câmp obligatoriu","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Numai numere întregi, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Numai numere întregi, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Data nevalidă","content,label":"Titlu"},bg:{"control,validation,validationErrors,REQUIRED":"Изисквано поле","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Само цели числа, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Само цели числа, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Невалидна дата","content,label":"Заглавие"},cs:{"control,validation,validationErrors,REQUIRED":"Vyžadované pole","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Jen celá čísla, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Jen celá čísla, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Neplatné datum","content,label":"Titul"},el:{"control,validation,validationErrors,REQUIRED":"Απαιτητό πεδίο","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Μόνο ακέραιοι αριθμοί, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Μόνο ακέραιοι αριθμοί, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Άκυρη ημερομηνία","content,label":"Τίτλος"},nl:{"control,validation,validationErrors,REQUIRED":"Verplicht veld","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Alleen gehele getallen, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Alleen gehele getallen, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Ongeldige datum","content,label":"Titel"},pl:{"control,validation,validationErrors,REQUIRED":"Wymagane pole","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Tylko liczby całkowite, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Tylko liczby całkowite, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Nieprawidłowa data","content,label":"Tytuł"},sv:{"control,validation,validationErrors,REQUIRED":"Obligatoriskt fält","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Endast heltal, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Endast heltal, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Ogiltigt datum","content,label":"Tytuł"},tr:{"control,validation,validationErrors,REQUIRED":"Gerekli alan","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Yalnızca tam sayılar, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Yalnızca tam sayılar, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Geçersiz tarih","content,label":"Başlık"},ar:{"control,validation,validationErrors,REQUIRED":"الحقل المطلوب","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":'"الأعداد الصحيحة فقط, 1 - 31',"control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":'"الأعداد الصحيحة فقط, 0 - 3000',"control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"تاريخ غير صالح","content,label":"عنوان"},zh:{"control,validation,validationErrors,REQUIRED":"必填字段","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"仅限整数, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"仅限整数, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"无效日期","content,label":"Title"},da:{"control,validation,validationErrors,REQUIRED":"Påkrævet felt","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Kun heltal, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Kun heltal, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Ugyldig dato","content,label":"Titel"},he:{"control,validation,validationErrors,REQUIRED":"שדה נדרש","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"רק מספרים שלמים ,1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"רק מספרים שלמים ,0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"תאריך לא תקין","content,label":"Title"},fi:{"control,validation,validationErrors,REQUIRED":"Vaadittu kenttä","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Vain kokonaisluvut, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Vain kokonaisluvut, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Virheellinen päivämäärä","content,label":"Title"},hi:{"control,validation,validationErrors,REQUIRED":"आवश्यक फील्ड","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"केवल पूर्णांक, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"केवल पूर्णांक, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"अमान्य तारीख़","content,label":"Title"},hr:{"control,validation,validationErrors,REQUIRED":"Obavezno polje","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Samo cijeli brojevi, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Samo cijeli brojevi, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Nevažeći datum","content,label":"Title"},hu:{"control,validation,validationErrors,REQUIRED":"Kötelező mező","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Csak egész számok, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Csak egész számok, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Érvénytelen dátum","content,label":"Title"},id:{"control,validation,validationErrors,REQUIRED":"Bidang yang wajib diisi","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Hanya bilangan bulat, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Hanya bilangan bulat, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Tanggal tidak valid","content,label":"Title"},ja:{"control,validation,validationErrors,REQUIRED":"必須フィールド","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"整数のみ, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"整数のみ, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"日付が無効です","content,label":"Title"},ko:{"control,validation,validationErrors,REQUIRED":"필수 칸","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"정수만, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"정수만, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"유효하지 않은 날짜","content,label":"Title"},no:{"control,validation,validationErrors,REQUIRED":"Obligatorisk felt","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Bare heltall, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Bare heltall, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Ugyldig dato","content,label":"Title"},sk:{"control,validation,validationErrors,REQUIRED":"Povinné pole","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Iba celé čísla, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Iba celé čísla, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Neplatný dátum","content,label":"Title"},sl:{"control,validation,validationErrors,REQUIRED":"Obvezno polje","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Samo cela števila, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Samo cela števila, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Neveljaven datum","content,label":"Title"},sr:{"control,validation,validationErrors,REQUIRED":"Obavezno polje","control,validation,validationErrors,DAY_INVALID_ERROR_TEXT":"Samo celi brojevi, 1 - 31","control,validation,validationErrors,YEAR_INVALID_ERROR_TEXT":"Samo celi brojevi, 0 - 3000","control,validation,validationErrors,DATE_INVALID_ERROR_TEXT":"Nevažeći datum","content,label":"Title"}},props:{content:{label:"Title",askYear:!0,textContrastEnabled:!0,placeholderTextContrastEnabled:!0},control:{name:"date",integrationName:"date",defaultValue:null,validation:{required:!0,validator:"SYS_DATE"}},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:(Te=[{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(se).reduce(((t,e)=>Object.assign(t,{[e]:de(Te)})),{[se.DESKTOP]:[],[se.MOBILE]:[]}))},metaDescription:{icon:"/SysDateComponent/assets/img/date-component-icon.svg",label:{en:"Date",ru:"Дата",uk:"Дата",es:"Fecha",fr:"Date",de:"Datum",it:"Data",pt:"Data",ro:"Data",bg:"Дата",cs:"Datum",el:"Ημερομηνία",nl:"Datum",pl:"Data",sv:"Datum",tr:"Tarih",ar:"التاريخ",zh:"日期",da:"Dato",he:"תאריך",fi:"Päivämäärä",hi:"तारीख़ ",hr:"Datum",hu:"Dátum",id:"Tanggal",ja:"日付",ko:"날짜",no:"Dato",sk:"Dátum",sl:"Datum",sr:"Datum"}}};var Te;function Oe(t){return Oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oe(t)}function Ae(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,De(o.key),o)}}function _e(t,e,n){return e&&Ae(t.prototype,e),n&&Ae(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ie(t,e,n){return(e=De(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function De(t){var e=function(t){if("object"!=Oe(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Oe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Oe(e)?e:e+""}var Se=_e((function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}));function Ce(t){return Ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ce(t)}function Le(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,we(o.key),o)}}function we(t){var e=function(t){if("object"!=Ce(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ce(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ce(e)?e:e+""}Ie(Se,"validationErrorKeys",{REQUIRED:"REQUIRED",DAY_INVALID_ERROR_TEXT:"DAY_INVALID_ERROR_TEXT",YEAR_INVALID_ERROR_TEXT:"YEAR_INVALID_ERROR_TEXT",DATE_INVALID_ERROR_TEXT:"DATE_INVALID_ERROR_TEXT"}),Ie(Se,"DAY_PLACEHOLDER",{en:"Day",ru:"День",uk:"День",es:"Día",de:"Tag",fr:"Jour",it:"Giorno",pt:"Dia",ro:"Gün",bg:"Ден",cs:"Den",el:"Ημέρα",nl:"Dag",pl:"Dzień",sv:"Dag",tr:"Gün",ar:"اليوم"}),Ie(Se,"MONTH_DROPDOWN_PLACEHOLDER",{en:"Month",ru:"Месяц",uk:"Мicяць",es:"Mes",de:"Monat",fr:"Mois",it:"Mese",pt:"Mês",ro:"Ay",bg:"Месец",cs:"Měsíc",el:"Μήνας",nl:"Maand",pl:"Miesiąc",sv:"Månad",tr:"Ay",ar:"الشهر"}),Ie(Se,"YEAR_PLACEHOLDER",{en:"Year",ru:"Год",uk:"Рiк",es:"Año",de:"Jahr",fr:"Année",it:"Anno",pt:"Ano",ro:"Yıl",bg:"Година",cs:"Rok",el:"Έτος",nl:"Jaar",pl:"Rok",sv:"År",tr:"Yıl",ar:"السنة"});var Ne=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return function(t,e,n){return n&&Le(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,0,[{key:"getDatePartsOrder",value:function(t){return new Intl.DateTimeFormat(t).formatToParts().filter((function(t){return["year","month","day"].includes(t.type)})).map((function(t){return t.type}))}},{key:"convertMonthToNumeric",value:function(e,n){return t.getAllMonthsByLanguage("short",n).findIndex((function(t){return t===e}))+1}},{key:"convertNumericToMonth",value:function(e,n){return t.getAllMonthsByLanguage("short",n)[e-1]}},{key:"getAllMonthsByLanguage",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"short",e=Et(arguments.length>1?arguments[1]:void 0);return new Array(12).fill(0).map((function(n,o){return new Date(2e3,o,1).toLocaleDateString(e,{month:t})})).map((function(t){return t.charAt(0).toUpperCase()+t.slice(1)}))}},{key:"convertDashedStringDateIntoDate",value:function(t){var e=+t.split("-")[2],n=+t.split("-")[1],o=+t.split("-")[0];return new Date(new Date(2e3,n-1,e).setFullYear(o))}},{key:"convertToDoubleDigit",value:function(t){return t?+t<10?"0".concat(t):t:"00"}},{key:"normalizeYearInput",value:function(t){return"0"===t?"0000":t?"".concat(+t).padStart(4,"0"):""}}])}();function xe(t){return xe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xe(t)}function Pe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function ke(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Pe(Object(n),!0).forEach((function(e){Be(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Pe(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Me(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i,l,a=[],s=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;s=!1}else for(;!(s=(o=i.call(n)).done)&&(a.push(o.value),a.length!==e);s=!0);}catch(t){c=!0,r=t}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(c)throw r}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Ve(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ve(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ve(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}function je(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,We(o.key),o)}}function Ue(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ue=function(){return!!t})()}function Xe(){return Xe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var o=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Ye(t)););return t}(t,e);if(o){var r=Object.getOwnPropertyDescriptor(o,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},Xe.apply(null,arguments)}function Ye(t){return Ye=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ye(t)}function Fe(t,e){return Fe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Fe(t,e)}function Be(t,e,n){return(e=We(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function We(t){var e=function(t){if("object"!=xe(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=xe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==xe(e)?e:e+""}var He=function(){function e(){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Be(n=function(t,e,n){return e=Ye(e),function(t,e){if(e&&("object"==xe(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Ue()?Reflect.construct(e,n||[],Ye(t).constructor):e.apply(t,n))}(this,e),"manifest",Re),Be(n,"registeredControl",void 0),Be(n,"overlayBackdrop",void 0),Be(n,"DAY_PLACEHOLDER",Se.DAY_PLACEHOLDER),Be(n,"MONTH_DROPDOWN_PLACEHOLDER",Se.MONTH_DROPDOWN_PLACEHOLDER),Be(n,"YEAR_PLACEHOLDER",Se.YEAR_PLACEHOLDER),Be(n,"validationErrorKeys",Se.validationErrorKeys),Be(n,"dropdownMenuOptionLabelStyles",["color","font-family","font-size","letter-spacing","text-shadow","font-weight","line-height","text-align"]),Be(n,"overlayContentStyles",["background","border-style","border-top-width","border-top-color","border-bottom-width","border-bottom-color","border-left-width","border-left-color","border-right-width","border-right-color","border-top-left-radius","border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius"]),Be(n,"setControlsOrder",(function(t){var e=n.getPreferredWidgetLanguage(),o=Ne.getDatePartsOrder(e),r=n.getControlElementNodes(t),i=r.dayInputContainerElement,l=r.monthInputContainerElement,a=r.yearInputContainerElement,s=[];s[o.indexOf("day")]=i,s[o.indexOf("month")]=l,s[o.indexOf("year")]=a;var c=n.getRootElement().querySelector(".controls-container");Z({element:c,html:""}),s.forEach((function(t){return c.appendChild(t)}))})),Be(n,"setControlValueProxy",(function(t,e){var o=n.getDateValueAsString();if(o||t)return n.getProps().content.askYear||(o="-".concat(o)),n.registeredControl.setValue(t||o,e)})),Be(n,"dateValidation",(function(){var t=n.getRootElement(),e=Ne.convertDashedStringDateIntoDate(n.getDateValueAsString()),o=n.getDateValueAsString(),r=n.getControlElementNodes(t),i=r.dayInputElement,l=r.yearInputElement,a=i.value,s=+i.value,c=+o.split("-")[1],d=l.value,u=+l.value;return+a<0||isNaN(s)||"0"===a||s&&(s>31||s<1)?{isValid:!1,errorKey:n.validationErrorKeys.DAY_INVALID_ERROR_TEXT}:+d<0||isNaN(u)||u>3e3||u<0?{isValid:!1,errorKey:n.validationErrorKeys.YEAR_INVALID_ERROR_TEXT}:s&&c&&(isNaN(e.getTime())||!n.isCurrentDateExist())?{isValid:!1,errorKey:n.validationErrorKeys.DATE_INVALID_ERROR_TEXT}:!s&&!isNaN(s)||!c||n.getProps().content.askYear&&!d?{isValid:!1,errorKey:n.validationErrorKeys.REQUIRED}:{isValid:!0}})),Be(n,"isCurrentDateExist",(function(){var t=n.getDateValueAsString(),e=+t.split("-")[2],o=+t.split("-")[1],r=+t.split("-")[0],i=Ne.convertDashedStringDateIntoDate(t);return i.getDate()===e&&i.getMonth()+1===o&&i.getFullYear()===r})),Be(n,"getDateValueAsString",(function(){var t=n.getRootElement(),e=t.querySelector("#cl-day-input").value,o=t.querySelector("#cl-month-dropdown").innerText,r=t.querySelector("#cl-year-input").value;n.isMonthUnselected(o)&&(o=null),+e<0&&(e=""),+r<0&&(r="");var i=n.getPreferredWidgetLanguage(),l=Ne.convertToDoubleDigit(Ne.convertMonthToNumeric(o,i));return"".concat(Ne.normalizeYearInput(r),"-").concat(l,"-").concat(Ne.convertToDoubleDigit("".concat(+e)))})),Be(n,"setStringDateValue",(function(t){var e=Me(t.split("-"),3),o=e[0],r=e[1],i=e[2],l=n.getPreferredWidgetLanguage(),a=n.getRootElement();a.querySelector("#cl-day-input").value=i,a.querySelector("#cl-month-dropdown").innerText=Ne.convertNumericToMonth(r,l),a.querySelector("#cl-year-input").value=+o,n.registeredControl.setValue(t)})),Be(n,"getOptions",(function(){var t={};return Ne.getAllMonthsByLanguage("short",n.getPreferredWidgetLanguage()).forEach((function(e,n){return t["month-".concat(n+1)]={label:e,id:n}})),t})),Be(n,"createDropdownButtonMenuComponent",(function(t,e,n,o){var r=document.createElement("div");r.classList.add("option-wrapper");var i=document.createElement("span");return i.textContent=t.label,J(i,n),e&&(r.style.backgroundColor=ut(o)),r.appendChild(i),r})),Be(n,"getCurrentSelectedMonthValue",(function(){var t=n.getRootElement().querySelector("#cl-month-dropdown").innerText;return n.isMonthUnselected(t)?null:Ne.convertMonthToNumeric(t,n.getPreferredWidgetLanguage())})),Be(n,"isMonthUnselected",(function(t){return t===n.getTranslationsMap(n.MONTH_DROPDOWN_PLACEHOLDER).translations})),Be(n,"createOverlayContent",(function(t,e){var o=n.services.form.getControl(n.getProps().control.name),r=n.getRootElement().querySelector("#cl-month-dropdown"),i=tt(r,n.dropdownMenuOptionLabelStyles),l=tt(r,n.overlayContentStyles);l.background=dt(l.background,i.color);var a=function(t,e){return Math.min(Math.floor(parseInt(t)/2),parseInt(e["border-top-left-radius"]),parseInt(e["border-top-right-radius"]),parseInt(e["border-bottom-left-radius"]),parseInt(e["border-bottom-right-radius"]))}(tt(r,["height"]).height,l);J(e,ke(ke({},l),{},{"border-top-left-radius":"".concat(a,"px"),"border-top-right-radius":"".concat(a,"px"),"border-bottom-left-radius":"".concat(a,"px"),"border-bottom-right-radius":"".concat(a,"px")}));var s=n.getCurrentSelectedMonthValue(),c=n.getOptions(),d=document.createElement("div");Object.entries(c).forEach((function(e){var a=Me(e,1)[0],u=c[a],p="month-".concat(s)===a,h=n.createDropdownButtonMenuComponent(u,p,i,l.background);h.addEventListener("click",(function(){r.textContent=u.label,t.click(),n.setControlValueProxy(),o.emit("RUN_SINGLE_ELEMENT_VALIDATION",r)})),d.appendChild(h)})),e.appendChild(d)})),Be(n,"createOverlay",(function(){n.overlayBackdrop&&n.overlayBackdrop.click();var t,e,o,r,i,l,a=function(t){const{triggerElement:e,overlayStyles:n,createOverlayContent:o,overlayWidth:r,overlayHeight:i,offset:l,onDestroy:a,positionByDefault:s,isHorizontallyCentered:c,isBackdropDisabledOnUI:d}=t,u=t.htmlDocumentObject||document,p=function(t){const e=document.createElement("div");return e.style.position="fixed",e.style.zIndex=String(Number.MAX_SAFE_INTEGER-1),e.style.top="0",e.style.left="0",e.style.width=t?"0px":"100%",e.style.height=t?"0px":"100%",e}(d),h=document.createElement("div");h.style.position="fixed",h.style.display="block",h.style.zIndex=String(Number.MAX_SAFE_INTEGER),r&&(h.style.width=`${r}px`),i&&(h.style.height=`${i}px`);const m=h.attachShadow({mode:"open"}),g=document.createElement("style");Z({element:g,html:n}),m.append(g);const v=document.createElement("div");v.classList.add(rt()),u.body.append(p),u.body.append(h),m.append(v),o(p,v),(()=>{const t=it(e,v,function(t){return null!=t?t:5}(l),s,c,u);(function(t,e){t.setAttribute("cl-overlay-position",e)})(v,t.position),J(h,t.coordinates)})(),h.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault()}));const E=t=>{p.remove(),h.remove(),a&&a(),window.removeEventListener("keyup",t,!0)},b=t=>{"Escape"===t.key&&(t.preventDefault(),t.stopImmediatePropagation(),E(b))};return p.addEventListener("click",(()=>E(b))),window.addEventListener("keyup",b,!0),{backdrop:p,overlay:h}}({triggerElement:n.getRootElement().querySelector("#cl-month-dropdown"),overlayStyles:(t=n.getRootElement(),e=n.overlayContentStyles,o=n.dropdownMenuOptionLabelStyles,r=rt(),i=t.querySelector("#cl-month-dropdown"),l=dt(tt(i,e).background,tt(i,o).color),"\n .".concat(r," {\n height: 196px;\n width: 199px;\n box-shadow: 0 1px 5px rgba(0, 0, 0, 0.28);\n border-radius: 4px;\n background-color: #fff;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n min-width: fit-content;\n }\n \n .").concat(r," div {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n row-gap: 9px;\n padding: 10px 15px 10px;\n }\n \n .").concat(r," div {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n row-gap: 9px;\n padding: 10px 14px 10px;\n }\n \n .option-wrapper {\n border: 0;\n align-items: center;\n font-size: 16px;\n padding: 10px 20px;\n outline: 0;\n cursor: pointer;\n text-align: left;\n }\n \n .option-wrapper span {\n word-break: keep-all;\n }\n \n .option-wrapper:hover {\n background-color: ").concat(ut(l),";\n }\n ")),createOverlayContent:function(t,e){n.createOverlayContent(t,e)},overlayWidth:n.getRootElement().querySelector("#cl-month-dropdown").getBoundingClientRect().width,onDestroy:function(){n.overlayBackdrop=null},htmlDocumentObject:n.htmlDocumentObject});n.overlayBackdrop=a.backdrop})),Be(n,"applyControlsDisplayRules",(function(t){var e=n.getRootElement();t.content.askYear?e.querySelector(".year-input-with-tooltip").style.display="block":e.querySelector(".year-input-with-tooltip").style.display="none"})),Be(n,"getControlElementNodes",(function(t){return{dayInputElement:t.querySelector("#cl-day-input"),dayTooltipElement:t.querySelector(".day-input-with-tooltip .input-tooltip"),dayInputContainerElement:t.querySelector(".day-input-with-tooltip"),monthInputElement:t.querySelector("#cl-month-dropdown"),monthTooltipElement:t.querySelector(".month-dropdown-input .input-tooltip"),monthInputContainerElement:t.querySelector(".month-dropdown-input"),yearInputElement:t.querySelector("#cl-year-input"),yearTooltipElement:t.querySelector(".year-input-with-tooltip .input-tooltip"),yearInputContainerElement:t.querySelector(".year-input-with-tooltip")}})),Be(n,"setPlaceholders",(function(t,e){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];("UPDATING"===n.services.config.getConfig("entryModuleType")||o)&&(n.setDayPlaceholder(),n.setMonthPlaceholder(),n.setYearPlaceholder(),n.applyPlaceholdersColor(t,e))})),Be(n,"applyPlaceholdersColor",(function(t,e){var o=ue(t,e,n.getShared());n.getHostElement().style.setProperty("--cl-date-input-placeholder-color",o)})),Be(n,"setDayPlaceholder",(function(){var t=n.getRootElement().querySelector("#cl-day-input");t&&(t.placeholder=n.getTranslationsMap(n.DAY_PLACEHOLDER).translations)})),Be(n,"setMonthPlaceholder",(function(){var t=n.getRootElement().querySelector("#cl-month-dropdown");if(t){var e=n.getTranslationsMap(n.MONTH_DROPDOWN_PLACEHOLDER).translations,o=document.createElement("div");o.classList.add("dropdown-placeholder"),o.style.color="var(--cl-date-input-placeholder-color)",o.textContent=e,Z({element:t,html:""}),t.appendChild(o)}})),Be(n,"setYearPlaceholder",(function(){var t=n.getRootElement().querySelector("#cl-year-input");t&&(t.placeholder=n.getTranslationsMap(n.YEAR_PLACEHOLDER).translations)})),Be(n,"getTranslatedKey",(function(t){return bt(n.services.config,n.manifest.i18n,t)})),Be(n,"setInvalidStyleToElement",(function(t,e,o,r){r&&e!==r||mt(e,o,t,n.htmlDocumentObject)})),Be(n,"registerControl",(function(e){var o=n.getHostElement(),r=n.getControlElementNodes(e),i=r.dayInputElement,l=r.dayTooltipElement,a=r.monthInputElement,s=r.monthTooltipElement,c=r.yearInputElement,d=r.yearTooltipElement,u={SYS_DATE:function(){return n.dateValidation()}};function p(t){return t===i||t===c?!t.value:t===a&&this.isMonthUnselected(a.textContent)}function h(t){var e=this;this.registeredControl.validate().then((function(){var n=e.registeredControl.getErrorKeys();if(n){var o=n[0];o===e.validationErrorKeys.REQUIRED&&p.call(e,t)&&(o=n[1]||n[0]);var r=e.getTranslatedKey(o);b.call(e,r,o,!1,t)}}))}function m(t,e){return e===i?g.call(this):e===a?v.call(this):e===c?E.call(this):void(t&&(g.call(this),v.call(this),E.call(this)))}function g(){i.classList.contains("invalid")&&i.classList.remove("invalid"),l.style.visibility="hidden"}function v(){a.classList.contains("invalid")&&a.classList.remove("invalid"),s.style.visibility="hidden"}function E(){c.classList.contains("invalid")&&c.classList.remove("invalid"),d.style.visibility="hidden"}function b(t,e,n,o){return o?m.call(this,!1,o):m.call(this,!0),e===this.validationErrorKeys.YEAR_INVALID_ERROR_TEXT?this.setInvalidStyleToElement(t,c,d,o):e===this.validationErrorKeys.DAY_INVALID_ERROR_TEXT?this.setInvalidStyleToElement(t,i,l,o):e===this.validationErrorKeys.DATE_INVALID_ERROR_TEXT?this.setInvalidStyleToElement(t,i,l):void(e===this.validationErrorKeys.REQUIRED&&(i.value||o!==i&&!n||this.setInvalidStyleToElement(t,i,l,o),this.isMonthUnselected(a.textContent)&&(o===a||n)&&this.setInvalidStyleToElement(t,a,s,o),c.value||o!==c&&!n||this.setInvalidStyleToElement(t,c,d,o)))}function y(){s.style.visibility="hidden",a.classList.contains("invalid")&&a.classList.remove("invalid")}n.registeredControl=n.createControlWithValidation([],{element:o,listenStatusChange:!1,validationMap:u}),o.addEventListener("input",(function(t){n.registeredControl.emit("RUN_SINGLE_ELEMENT_VALIDATION",t.composedPath()[0]),n.setControlValueProxy()})),n.services.eventEmitter.on("INVALID_CONTACT_DATA_SUBMIT_ATTEMPT",(function(){var t=n.registeredControl.getErrorKeys();if(t){var e=n.getTranslatedKey(t[0]);b.call(n,e,t[0],!0)}})),n.registeredControl.on("RUN_SINGLE_ELEMENT_VALIDATION",(function(t){h.call(n,t)})),n.registeredControl.on(t,(function(t){switch(t){case"valid":m.call(n,!0);break;case"pending":y.call(n)}}))})),Be(n,"setArrowIconStyles",(function(){n.getRootElement().querySelector(".dropdown-input-select-button").style.color=ue(n.getProps(),n.getEnvironment(),n.getShared())})),Be(n,"setInputHostSize",(function(t,e){var o=t.adaptiveStyles[e].find((function(t){return"input"===t.element})).styleAttributes,r=n.getHostElement(),i=n.getRootElement().querySelectorAll('[cl-element="input"]'),l=n.getElement("label"),a=et(t,e),s=l&&a.enabled&&"TOP"===a.position?l.getBoundingClientRect().height+a.margin:0,c="".concat(parseFloat(o.height)+s,"px");r.style.width=o.width,r.style.minWidth=o.minWidth,r.style.height=c,r.style.minHeight=c,i.forEach((function(t){t.style.width="",t.style.minWidth="",t.style.height="",t.style.minHeight=""}))})),n.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 }\n \n .controls-container {\n position: relative;\n height: 100%;\n min-height: 15px;\n width: 100%;\n display: flex;\n gap: 5px;\n }\n \n .label {\n min-height: 10px;\n }\n \n .label.cl-focused {\n min-height: auto;\n }\n \n .dropdown-placeholder {\n width: calc(100% - 15px);\n text-overflow: ellipsis;\n overflow: hidden;\n }\n \n .day-input-with-tooltip {\n min-width: 54px;\n height: inherit;\n }\n \n .month-dropdown-input {\n position: relative;\n display: flex;\n height: inherit;\n width: 100%;\n cursor: pointer;\n min-width: 82px;\n }\n \n .year-input-with-tooltip {\n min-width: 56px;\n height: 100%;\n }\n \n .cl-date-input-control {\n position: relative;\n width: 100%;\n }\n \n .cl-date-input-control input {\n width: 100%;\n height: 100%;\n }\n \n .cl-date-input-control input::placeholder {\n color: var(--cl-date-input-placeholder-color);\n opacity: 1;\n }\n \n .cl-date-input-control input::-ms-input-placeholder {\n color: var(--cl-date-input-placeholder-color);\n opacity: 1;\n }\n \n .cl-date-input-control .month-dropdown-input .dropdown-input-select-button {\n bottom: calc(50% - 17px);\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 .dropdown-label {\n display: flex;\n align-items: center;\n position: absolute;\n height: 100%;\n width: 100%;\n padding: 0 35px 0 20px;\n cursor: pointer;\n }\n \n .dropdown-input-select-button {\n background: transparent;\n border: none;\n min-width: max-content;\n width: 24px;\n height: 100%;\n display: flex;\n align-items: center;\n position: absolute;\n right: 0;\n z-index: 2;\n }\n \n .label-and-controls-container.focus-outline-defined input:focus, .dropdown-label:focus {\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="controls-container">\n \n <div class="cl-date-input-control day-input-with-tooltip">\n <input cl-element="input"\n id="cl-day-input"\n type="text"\n name="day">\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 \n <div class="cl-date-input-control month-dropdown-input">\n <div class="dropdown-input-select-button">\n <svg width="11" height="7" viewBox="0 0 11 7" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M10.5248 1.90196L9.57381 2.71322L6.05712 5.71322L5.24395 6.40691L4.4324 5.71132L0.949088 2.72576L0 1.91229L1.62694 0.0141139L2.57603 0.827583L5.24778 3.11756L7.9513 0.811257L8.90228 0L10.5248 1.90196Z"\n fill="currentColor"/>\n </svg>\n </div>\n <button cl-element="input"\n class="dropdown-label"\n id="cl-month-dropdown">\n <div class="dropdown-placeholder">placeholder</div>\n </button>\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 \n <div class="cl-date-input-control year-input-with-tooltip">\n <input cl-element="input"\n id="cl-year-input"\n type="text"\n name="fname">\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 \n </div>\n \n </div>\n </div>\n ',"\n "),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Fe(t,e)}(e,fe),n=e,o=[{key:"connectedCallback",value:function(){var t,n=this;!function(t,e,n){var o=Xe(Ye(t.prototype),"connectedCallback",n);return"function"==typeof o?function(t){return o.apply(n,t)}:o}(e,0,this)([]);var o=this.getRootElement(),r=this.getProps();this.registerControl(o);var i=(null===(t=this.registeredControl)||void 0===t?void 0:t.value)||null;this.setControlsOrder(o),i?this.setStringDateValue(i):this.setPlaceholders(r,this.getEnvironment(),!0),this.observeProps((function(t,e){n.applyAutoAdaptiveStyles(e.adaptiveStyles,e.styles);var r=n.getEnvironment();nt(e,r,o,".label-and-controls-container"),n.setInputHostSize(e,r),n.applyControlsDisplayRules(e),n.setPlaceholders(e,r),n.setArrowIconStyles(),function(t,e){let n;const o=e||t,r=["transparent","initial"];t&&(t.style.borderColor&&!r.includes(t.style.borderColor)&&(parseFloat(t.style.borderWidth)||parseFloat(t.style.borderBottomWidth))&&(n=ot(o,t,"borderColor")),!n&&t.style.getPropertyValue("--borderBottomColor")&&!r.includes(t.style.getPropertyValue("--borderBottomColor"))&&parseFloat(t.style.getPropertyValue("--borderBottomWidth"))&&(n=ot(o,t,"--borderBottomColor")),n||!t.style.backgroundColor||r.includes(t.style.backgroundColor)||(n=ot(o,t,"backgroundColor")),n||!t.style.color||r.includes(t.style.color)||(n=ot(o,t,"color")),n||o.classList.remove("focus-outline-defined"))}(n.getElement("input"),o.querySelector(".label-and-controls-container"))})),this.observeShared((function(){var t=n.getProps(),e=n.getEnvironment();n.setPlaceholders(t,e),n.setInputHostSize(t,e),n.setArrowIconStyles()})),this.observeEnvironment((function(t,e){var r=n.getProps();nt(r,e,o,".label-and-controls-container"),n.setInputHostSize(r,e),n.setPlaceholders(r,e),n.setArrowIconStyles()})),o.querySelector(".month-dropdown-input").addEventListener("click",(function(){setTimeout((function(){return n.createOverlay()}),50)}))}}],o&&je(n.prototype,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o}();Be(He,"define",{name:"sys-date",model:Re.name,manifest:Re});export{He as default};window.clComponentClass_SysDateComponent=He;