@claspo/components 1.1.17 → 1.2.0-theme.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- const t={name:"SysPhoneInputComponent",componentType:"INPUT",version:"1.0.0",contextMenuModel:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}]}],floatingControlsModel:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"input"},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"input"},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"}]}],propertyPaneModel:{content:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"SIZE",element:"input",elementProp:"styleAttributes",params:{width:{options:["fixed","fill"]},height:{options:["fixed","fill"]}}},{type:"CONTROL",name:"TEXT_PARAMS",params:[{element:"input",hideTextAlign:!0},{element:"label",displayCondition:"return !!sdk.component.getProps().styles.find(element => element.element === 'label').params.enabled"}]},{type:"CONTROL",name:"BACKGROUND",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:"BORDER_RADIUS",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",hideTextAlign:!0},{element:"label",displayCondition:"return !!sdk.component.getProps().styles.find(element => element.element === 'label').params.enabled"}]},{type:"CONTROL",name:"BACKGROUND",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:"BORDER_RADIUS",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:"COUNTRY_PHONE_SELECT",element:"input",propPath:["control"]},{type:"CONTROL",name:"INPUT_VALIDATION",params:{validationPropPath:["control","validation"],fieldTypePropPath:["control","fieldType"],required:!0,options:[{label:"Phone",value:"PHONE"}],validationErrors:{PHONE:[{key:"PHONE_INVALID_NUMBER",value:"Phone number is invalid"}]}}}]},autoContrast:[{slave:{element:"input",elementProp:"styleAttributes",elementSubProp:"color"},master:{element:"input",propPath:["styles","[element=input]","styleAttributes","background"]},enabledPropPath:["content","textContrastEnabled"]}],focusableElements:["input","label"],events:{dispatch:[],listen:[]},i18nPropPaths:["content,label","content,placeholder"],i18n:{en:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Phone number is invalid","control,validation,validationErrors,REQUIRED":"Required field","content,label":"Title"},ru:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Неверно заполнен номер телефона","control,validation,validationErrors,REQUIRED":"Обязательное поле","content,label":"Заголовок"},uk:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Неправильно заповнено номер телефону","control,validation,validationErrors,REQUIRED":"Обов'язкове поле","content,label":"Заголовок"},es:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"El número de teléfono no es válido","control,validation,validationErrors,REQUIRED":"Campo obligatorio","content,label":"Título"},de:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Telefonnummer ist ungültig","control,validation,validationErrors,REQUIRED":"Pflichtfeld","content,label":"Titel"},fr:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Le numéro de téléphone est invalide","control,validation,validationErrors,REQUIRED":"Champs requis","content,label":"Titre"},it:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Il numero di telefono non è valido","control,validation,validationErrors,REQUIRED":"Campo obbligatorio","content,label":"Titolo"},pt:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Número de telefone inválido","control,validation,validationErrors,REQUIRED":"Campo obrigatório","content,label":"Título"},ro:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Numărul de telefon nu este valid","control,validation,validationErrors,REQUIRED":"Câmp obligatoriu","content,label":"Titlu"},bg:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Телефонният номер е невалиден","control,validation,validationErrors,REQUIRED":"Изисквано поле","content,label":"Заглавие"},cs:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Telefonní číslo je neplatné","control,validation,validationErrors,REQUIRED":"Vyžadované pole","content,label":"Titul"},el:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Ο αριθμός τηλεφώνου είναι άκυρος","control,validation,validationErrors,REQUIRED":"Απαιτητό πεδίο","content,label":"Τίτλος"},nl:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Telefoonnummer is ongeldig","control,validation,validationErrors,REQUIRED":"Verplicht veld","content,label":"Titel"},pl:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Numer telefonu jest nieprawidłowy","control,validation,validationErrors,REQUIRED":"Wymagane pole","content,label":"Tytuł"},sv:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Telefonnumret är ogiltigt","control,validation,validationErrors,REQUIRED":"Obligatoriskt fält","content,label":"Tytuł"},tr:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Telefon numarası geçersiz","control,validation,validationErrors,REQUIRED":"Gerekli alan","content,label":"Başlık"},ar:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"رقم الهاتف غير صالح","control,validation,validationErrors,REQUIRED":"الحقل المطلوب","content,label":"عنوان"},zh:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"电话号码无效","control,validation,validationErrors,REQUIRED":"必填字段","content,label":"Title"},da:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Telefonnummer er ugyldigt","control,validation,validationErrors,REQUIRED":"Påkrævet felt","content,label":"Titel"},he:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"מספר טלפון לא תקין","control,validation,validationErrors,REQUIRED":"שדה נדרש","content,label":"Title"},fi:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Puhelinnumero on virheellinen","control,validation,validationErrors,REQUIRED":"Vaadittu kenttä","content,label":"Title"},hi:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"फ़ोन नंबर अमान्य है","control,validation,validationErrors,REQUIRED":"आवश्यक फील्ड","content,label":"Title"},hr:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Telefonski broj nije ispravan","control,validation,validationErrors,REQUIRED":"Obavezno polje","content,label":"Title"},hu:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"A telefonszám érvénytelen","control,validation,validationErrors,REQUIRED":"Kötelező mező","content,label":"Title"},id:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Nomor telepon tidak valid","control,validation,validationErrors,REQUIRED":"Bidang yang wajib diisi","content,label":"Title"},ja:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"電話番号が無効です","control,validation,validationErrors,REQUIRED":"必須フィールド","content,label":"Title"},ko:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"유효하지 않은 전화번호","control,validation,validationErrors,REQUIRED":"필수 칸","content,label":"Title"},no:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Telefonnummeret er ugyldig","control,validation,validationErrors,REQUIRED":"Obligatorisk felt","content,label":"Title"},sk:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Telefónne číslo je neplatné","control,validation,validationErrors,REQUIRED":"Povinné pole","content,label":"Title"},sl:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Telefonska številka je neveljavna","control,validation,validationErrors,REQUIRED":"Obvezno polje","content,label":"Title"},sr:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Broj telefona je nevažeći","control,validation,validationErrors,REQUIRED":"Obavezno polje","content,label":"Title"}},props:{content:{label:"Title",textContrastEnabled:!0},control:{name:"phone",countryCode:"UA",countriesPriority:{includedList:["UA"],allowToAddOnlyFromIncludedList:!1},validation:{required:!0,validator:"PHONE"}},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",paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",_paddingEnabled:!0},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",paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",_paddingEnabled:!0},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:"/SysPhoneInputComponent/assets/img/phone-input-component-icon.svg",label:{en:"Phone",ru:"Телефон",uk:"Телефон",es:"Teléfono",fr:"Téléphone",de:"Telefon",it:"Telefono",pt:"Telefone",ro:"Telefon",bg:"Телефон",cs:"Telefon",el:"Τηλέφωνο",nl:"Telefoon",pl:"Telefon",sv:"Telefon",tr:"Telefon",ar:"الهاتف",zh:"电话",da:"Telefon",he:"טלפון",fi:"Puhelin",hi:"फ़ोन",hr:"Telefon",hu:"Telefon",id:"Telepon",ja:"電話",ko:"휴대폰",no:"Telefon",sk:"Telefón",sl:"Telefon",sr:"Telefon"}}},e="validationStatusChanged",n="touchedStatusChanged",o="cl-";function i(t){return o+t}function r(t){return"cl-"+t}class l{static size(t){return{width:this.width(t),height:this.height(t)}}static width(t){var e;const n=t||document;return Math.max(n.documentElement.clientWidth,(null===(e=n.defaultView)||void 0===e?void 0:e.innerWidth)||0)}static height(t){var e;const n=t||document;return Math.max(n.documentElement.clientHeight,(null===(e=n.defaultView)||void 0===e?void 0:e.innerHeight)||0)}static scrollbarWidth(t){var e;const n=t||document;return((null===(e=n.defaultView)||void 0===e?void 0:e.innerWidth)||0)-n.documentElement.clientWidth}}var s=[];for(var a in{transparent:"#0000"})s.push(a);var c="\\s*([.\\d%]+)\\s*",d="\\("+[c,c,c]+"(?:,\\s*([.\\d]+)\\s*)?\\)",u="(?:rgb)a?",p="("+s.join("|")+")";function h(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}RegExp(u+d,"i"),RegExp([p,"(?:#([a-f0-9]{3,8}))",u+d,"(?:hsl)a?"+d].join("|"),"gi");var m=Array.prototype.concat,g=Array.prototype.slice,f=function(t){for(var e=[],n=0,o=t.length;n<o;n++){var i=t[n];h(i)?e=m.call(e,g.call(i)):e.push(i)}return e};f.wrap=function(t){return function(){return t(f(arguments))}};const v=f;var b={},y=Object.hasOwnProperty,E=Object.create(null);for(var O in b)y.call(b,O)&&(E[b[O]]=O);var C={to:{},get:{}};function x(t,e,n){return Math.min(Math.max(e,t),n)}C.get=function(t){var e,n;return"hsl"===t.substring(0,3).toLowerCase()?(e=C.get.hsl(t),n="hsl"):(e=C.get.rgb(t),n="rgb"),e?{model:n,value:e}:null},C.get.rgb=function(t){if(!t)return null;var e,n,o,i=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(o=e[2],e=e[1],n=0;n<3;n++){var r=2*n;i[n]=parseInt(e.slice(r,r+2),16)}o&&(i[3]=parseInt(o,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(o=(e=e[1])[3],n=0;n<3;n++)i[n]=parseInt(e[n]+e[n],16);o&&(i[3]=parseInt(o+o,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)i[n]=parseInt(e[n+1],0);e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:y.call(b,e[1])?((i=b[e[1]])[3]=1,i):null:null;for(n=0;n<3;n++)i[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}for(n=0;n<3;n++)i[n]=x(i[n],0,255);return i[3]=x(i[3],0,1),i},C.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,x(parseFloat(e[2]),0,100),x(parseFloat(e[3]),0,100),x(isNaN(n)?1:n,0,1)]}return null},C.to.rgb=function(){var t=v(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]+")"},C.to.hsl=function(){var t=v(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 R=C,S={},T={};for(const t of Object.keys(S))T[S[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,i=Math.min(e,n,o),r=Math.max(e,n,o),l=r-i;let s,a;r===i?s=0:e===r?s=(n-o)/l:n===r?s=2+(o-e)/l:o===r&&(s=4+(e-n)/l),s=Math.min(60*s,360),s<0&&(s+=360);const c=(i+r)/2;return a=r===i?0:c<=.5?l/(r+i):l/(2-r-i),[s,100*a,100*c]},N.hsl.rgb=function(t){const e=t[0]/360,n=t[1]/100,o=t[2]/100;let i,r,l;if(0===n)return l=255*o,[l,l,l];i=o<.5?o*(1+n):o+n-o*n;const s=2*o-i,a=[0,0,0];for(let t=0;t<3;t++)r=e+1/3*-(t-1),r<0&&r++,r>1&&r--,l=6*r<1?s+6*(i-s)*r:2*r<1?i:3*r<2?s+(i-s)*(2/3-r)*6:s,a[t]=255*l;return a};const A=N;function w(t,e){return function(n){return e(t(n))}}function I(t,e){const n=[e[t].parent,t];let o=A[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)n.unshift(e[i].parent),o=w(A[e[i].parent][i],o),i=e[i].parent;return o.conversion=n,o}const P={};Object.keys(A).forEach((t=>{P[t]={},Object.defineProperty(P[t],"channels",{value:A[t].channels}),Object.defineProperty(P[t],"labels",{value:A[t].labels});const e=function(t){const e=function(t){const e=function(){const t={},e=Object.keys(A);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(A[t]);for(let i=o.length,r=0;r<i;r++){const i=o[r],l=e[i];-1===l.distance&&(l.distance=e[t].distance+1,l.parent=t,n.unshift(i))}}return e}(t),n={},o=Object.keys(e);for(let t=o.length,i=0;i<t;i++){const t=o[i];null!==e[t].parent&&(n[t]=I(t,e))}return n}(t);Object.keys(e).forEach((n=>{const o=e[n];P[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),P[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 L=P,k=["keyword","gray","hex"],_={};for(const t of Object.keys(L))_[[...L[t].labels].sort().join("")]=t;const M={};function j(t,e){if(!(this instanceof j))return new j(t,e);if(e&&e in k&&(e=null),e&&!(e in L))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 j)this.model=t.model,this.color=[...t.color],this.valpha=t.valpha;else if("string"==typeof t){const e=R.get(t);if(null===e)throw new Error("Unable to parse color from string: "+t);this.model=e.model,o=L[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=L[this.model].channels;const n=Array.prototype.slice.call(t,0,o);this.color=B(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 _))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=_[o];const{labels:i}=L[this.model],r=[];for(n=0;n<i.length;n++)r.push(t[i[n]]);this.color=B(r)}if(M[this.model])for(o=L[this.model].channels,n=0;n<o;n++){const t=M[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)}j.prototype={toString(){return this.string()},string(t){let e=this.model in R.to?this:this.rgb();e=e.round("number"==typeof t?t:1);const n=1===e.valpha?e.color:[...e.color,this.valpha];return R.to[e.model](n)},round(t){return t=Math.max(t||0,0),new j([...this.color.map(D(t)),this.valpha],this.model)},alpha(t){return void 0!==t?new j([...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(L)){if(k.includes(t))continue;const{channels:e}=L[t];j.prototype[t]=function(...e){return this.model===t?new j(this):e.length>0?new j(e,t):new j([...U(L[this.model][t].raw(this.color)),this.valpha],t)},j[t]=function(...n){let o=n[0];return"number"==typeof o&&(o=B(n,e)),new j(o,t)}}function D(t){return function(e){return function(t,e){return Number(t.toFixed(e))}(e,t)}}function U(t){return Array.isArray(t)?t:[t]}function B(t,e){for(let n=0;n<e;n++)"number"!=typeof t[n]&&(t[n]=0);return t}const F=j;function H(t){const{element:e,html:n,appendHtml:o}=t,i=function(t){if(null==t)return"";if("string"!=typeof t)return String(t);if(""===t)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(t))return t;const e=(new DOMParser).parseFromString(t,"text/html");return e.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach((t=>t.remove())),e.querySelectorAll("*").forEach((t=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach((e=>t.removeAttribute(e))),Array.from(t.attributes).forEach((e=>{e.name.startsWith("on")&&t.removeAttribute(e.name)})),"A"===t.tagName||"AREA"===t.tagName){const e=t.getAttribute("href");e&&(e.startsWith("javascript:")||e.startsWith("data:"))&&t.removeAttribute("href")}if("IMG"===t.tagName||"IFRAME"===t.tagName){const e=t.getAttribute("src");e&&(e.startsWith("javascript:")||e.startsWith("data:text/html"))&&t.removeAttribute("src")}if("FORM"===t.tagName){const e=t.getAttribute("action");e&&e.startsWith("javascript:")&&t.removeAttribute("action")}})),e.body.innerHTML}(n);o?e.innerHTML+=i:e.innerHTML=i}function V(t,e){Object.keys(e).forEach((n=>{t.style[n]=e[n]}))}function W(t,e){var n,o;let i;return t.styles&&(i=null===(n=t.styles.find((t=>"label"===t.element)))||void 0===n?void 0:n.params),t.adaptiveStyles&&!i&&(i=null===(o=t.adaptiveStyles[e].find((t=>"label"===t.element)))||void 0===o?void 0:o.params),i}function $(t,e,n,o){var i;const r=n.querySelector(o),l=W(t,e);if(!l)return;const s=n.querySelector(".label");s&&(H({element:s,html:(null===(i=t.content)||void 0===i?void 0:i.label)||""}),"TOP"===l.position?(r.style.flexDirection="column",r.style.alignItems="unset",V(s,{marginRight:"0",marginBottom:`${l.margin}px`})):(r.style.flexDirection="row",r.style.alignItems="center",V(s,{marginRight:`${l.margin}px`,marginBottom:"0"})),l.enabled?s.style.display="":s.style.display="none")}function z(t,e,n,o,i){const r=function(t,e){var n;let o;if(t.styles){const e=null===(n=t.styles.find((t=>"input"===t.element)))||void 0===n?void 0:n.styleAttributes;(null==e?void 0:e.width)&&(o=e)}if(t.adaptiveStyles&&!o){const n=t.adaptiveStyles[e].find((t=>"input"===t.element)),i=null==n?void 0:n.styleAttributes;(null==i?void 0:i.width)&&(o=i)}return o}(t,e);if(!r)return;const l=W(t,e),s=i&&l&&l.enabled&&"TOP"===l.position?i.getBoundingClientRect().height+(l.margin||0):0;r.width&&(r.width.includes("100%")?(o.style.width="100%",n.style.width=r.width):n.style.width="auto"),r.height&&(r.height.includes("100%")?(o.style.height="100%",n.style.height=r.height):n.style.height=`${parseFloat(r.height)+s}px`)}function G(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=F(o).alpha(.5).string();return t.classList.add("focus-outline-defined"),t.style.setProperty("--clFocusOutline",`3px solid ${e}`),e}return null}function Q(){return i("overlay-menu-content")}function q(t,e,n,o,i,r){const s=function(t,e,n,o,i){const r=function(t,e,n,o){const i=l.width(o),{right:r}=t.getBoundingClientRect(),s=i-n-r-l.scrollbarWidth(o);return{horizontalOffset:n,contentWidth:K(e).width,availableSpaceToTheLeftSideOfTheTrigger:r-n,availableSpaceToTheRightSideOfTheTrigger:s}}(t,e,n,i),s=function(t,e,n,o){const i=l.height(o),{top:r,bottom:s}=t.getBoundingClientRect();return{verticalOffset:n,contentHeight:K(e).height,availableSpaceAboveTriggerElem:r-n,availableSpaceBelowTriggerElem:i-s-n}}(t,e,n,i);let a="undefined";const c={bottom:s.availableSpaceBelowTriggerElem>=s.contentHeight,top:s.availableSpaceAboveTriggerElem>=s.contentHeight,right:r.availableSpaceToTheRightSideOfTheTrigger>=r.contentWidth,left:r.availableSpaceToTheLeftSideOfTheTrigger>=r.contentWidth};if(c.top?a="top":c.bottom?a="bottom":c.right?a="right":c.left&&(a="left"),o&&c[o]&&(a=o),"undefined"===a){const t=Math.max(s.availableSpaceBelowTriggerElem,s.availableSpaceAboveTriggerElem,r.availableSpaceToTheRightSideOfTheTrigger,r.availableSpaceToTheLeftSideOfTheTrigger);t===s.availableSpaceBelowTriggerElem?a="bottom":t===s.availableSpaceAboveTriggerElem?a="top":t===r.availableSpaceToTheRightSideOfTheTrigger?a="right":t===r.availableSpaceToTheLeftSideOfTheTrigger&&(a="left")}return Object.assign(Object.assign(Object.assign({},s),r),{position:a})}(t,e,n,o,r=r||document);return function(t,e){const{marginBottom:n,marginTop:o}=window.getComputedStyle(e);if("top"===t.position)V(e,{"margin-top":`${parseInt(o,10)+parseInt(n,10)}px`}),V(e,{"margin-bottom":"0px"});else if("bottom"===t.position)V(e,{"margin-bottom":`${parseInt(n,10)+parseInt(o,10)}px`}),V(e,{"margin-top":"0px"});else{const t=(parseInt(n,10)+parseInt(o,10))/2+"px";V(e,{"margin-top":t,"margin-bottom":t})}}(s,e),{coordinates:Z(s,t.getBoundingClientRect(),e.getBoundingClientRect(),i,r),position:s.position}}function K(t){const{width:e,height:n}=t.getBoundingClientRect(),{marginBottom:o,marginTop:i,marginLeft:r,marginRight:l}=window.getComputedStyle(t);return{width:e+parseInt(r,10)+parseInt(l,10),height:n+parseInt(i,10)+parseInt(o,10)}}function Z(t,e,n,o,i){switch(t.position){case"top":return{left:`${Y(e,n,o,i)}px`,top:t.availableSpaceAboveTriggerElem-t.contentHeight-t.verticalOffset+"px"};case"bottom":return{left:`${Y(e,n,o,i)}px`,bottom:t.availableSpaceBelowTriggerElem-t.contentHeight-t.verticalOffset+"px"};case"left":return{left:t.availableSpaceToTheLeftSideOfTheTrigger-e.width-t.contentWidth-t.horizontalOffset+"px",top:`${J(0,t)}px`};case"right":return{right:t.availableSpaceToTheRightSideOfTheTrigger-t.contentWidth-t.horizontalOffset+"px",top:`${J(0,t)}px`}}}function Y(t,e,n,o){let i=n?t.x+t.width/2-e.width/2:t.x;return i<0&&(i=0),i+e.width>l.width(o)&&(i-=i+e.width-l.width(o)),i}function J(t,e){let n=e.availableSpaceAboveTriggerElem;return e.contentHeight>e.availableSpaceBelowTriggerElem&&(n-=e.contentHeight-e.availableSpaceBelowTriggerElem),n}const X="cl-tooltip-text-styles",tt=`\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 et(t){return[t.getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter((t=>!!t))}function nt(t,e){return e.reduce(((e,n)=>{if(e)return e;const o=function(t,e){if(!t)return null;if(e[t])return{translations:e[t],language:t};const n=function(t){return t.includes("-")?t.split("-")[0].toLowerCase():t.includes("_")?t.split("_")[0].toLowerCase():t}(t);return e[n]?{translations:e[n],language:n}:null}(n,t);return o||null}),null)}const ot="VIEW",it="MODULE",rt="CONTAINER",lt="INPUT",st="BUTTON",at="CONSENT",ct="COLUMN",dt="SUBSCRIBE_CONTACT",ut="REQUEST",pt="SHOW_WIDGET",ht="OPEN_LINK",mt="CLOSE_WIDGET";class gt{static sortActions(t){const e={[mt]:-1,[ht]:-2,[pt]:1,[dt]:2,[ut]: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=gt.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(gt.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 i,r=!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,i){!function(t,e,n,o){Promise.resolve(o).then((function(e){t({value:e,done:n})}),e)}(o,i,(e=t[n](e)).done,e.value)}))}}}(this.eventsQueue);!(t=(i=await l.next()).done);){o=i.value,r=!1;try{const{event:t}=o;for(const e of this.actions)if(!await e.execute(this.state.getState(),t))break}finally{r=!0}}}catch(t){e={error:t}}finally{try{r||t||!(n=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=[])}}gt.IGNORING_VIEW_ENTRY_TYPES=[st,at,lt];const ft="CLICK",vt="COMPONENT_EVENT";class bt{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 yt{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 ft:return new gt(t,e);case vt:return new bt(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class Et{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 Ot{constructor(){this.listeners=Ot.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=Et.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=Ot.createDefaultListenersState()}}Ot.createDefaultListenersState=()=>({"*":{}});const Ct=(t,e,n,o)=>{const i=EventTarget.prototype,{addEventListenerBase:r,addEventListener:l}=i;(r||l).call(t,e,n,o)};class xt{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class Rt{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===it?Object.assign(Object.assign({},t),Rt.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})}}Rt.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"};class St extends Ot{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on("ENVIRONMENT_UPDATE",(({isMobileEnv:t})=>{this._isMobile=t,this.emit(St.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(St.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(St.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}St.changeEventName="CHANGE";class Tt{static set(t,e){const n=t[Tt.accumulatorPropertyName]||{};t[Tt.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[Tt.accumulatorPropertyName]).forEach((n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""}))}}Tt.accumulatorPropertyName="clStyleAttributes";const Nt="CONTENT_LOCKER";class At{static applyHostStyles(t,e,n=null,o){var i,r,l;const s=null===(r=null===(i=null==n?void 0:n.props)||void 0===i?void 0:i.handlers)||void 0===r?void 0:r.find((t=>"CLICK"===t.type));s&&(null===(l=s.actions)||void 0===l?void 0:l.length)&&(e.style.cursor="pointer"),t!==ot&&t!==rt&&t!==ct||(e.style.display=o===Nt&&t===ot?"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 wt{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class It{constructor(t,e,n,o,i,r){this.hostElement=e,this.documentModel=t,this.getSharedCb=n,this.getPropsCb=o,this.getEnvCb=i,this.httpClient=r,this.subscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(t){const e=String(t||"");if(e.includes("url")){const[t,n]=e.split("(")[1].split(")");return{url:t.replace(/['"]+/g,""),positionOptions:n.replace(";","")}}return{url:null,positionOptions:null}}apply(t){const e=this.getPropsCb();return e.backgroundDynamicInlineSVGElements[t].forEach((n=>{var o,i,r,l,s;const a=null===(i=null===(o=e.adaptiveStyles)||void 0===o?void 0:o[t])||void 0===i?void 0:i.find((t=>t.element===n)),c=(null===(r=e.styles)||void 0===r?void 0:r.find((t=>t.element===n)))||{},d=(null===(l=null==c?void 0:c.styleAttributes)||void 0===l?void 0:l.background)||(null===(s=null==a?void 0:a.styleAttributes)||void 0===s?void 0:s.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),wt.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&&e&&(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 Pt=new class{execute(t,e="GET",n=null,o,i){const r={method:e,headers:Object.assign({"Content-Type":"text/plain"},o||{}),credentials:"same-origin",body:null,signal:i};return n&&(r.body="string"==typeof n?n:JSON.stringify(n)),fetch(t,r)}};function Lt(t,e){return Object.keys(t).filter((t=>!e.includes(t))).reduce(((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]})),{})}class kt{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 _t{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 Mt="COMPONENT_RESOURCES_LOADED",jt="FAILED_TO_LOAD_COMPONENT_RESOURCE";class Dt{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(Mt,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(jt,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=n,this.counters={pending:new _t(this.onCounterStateUpdate)}}}const Ut=(...t)=>{let e=t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:[]})),{});return{get:t=>e[t],clear:()=>Ut(...t)}},Bt=Ut,Ft="props",Ht="shared",Vt="environment";function Wt(t,e,n,o){const i=t=>{let r=t instanceof DocumentFragment||(null==t?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?t.host:t;return r&&(o&&"function"==typeof o?o(r.getAttribute(e)):(null===(l=null==r?void 0:r.getAttribute)||void 0===l?void 0:l.call(r,e))===n)?r:r&&r.parentNode&&i(r.parentNode)||null;var l};return i(t)}const $t="SUBMIT";function zt(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach((n=>{if("element"===n||"classes"===n)return;const o=e[n];o&&"object"==typeof o&&!Array.isArray(o)?t[n]=Object.assign(Object.assign({},t[n]||{}),o):t[n]=o})),t):t}function Gt(t,e,n){var o;return null===(o=null==t?void 0:t[e])||void 0===o?void 0:o.find((t=>t.element===n))}class Qt extends Event{constructor(t,e,n){super(t,n),this.detail={},Object.defineProperty(this,"detail",{value:e})}}const qt="STATIC",Kt="UPDATING";class Zt 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 Qt("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=Bt(Ft,Ht,Vt),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 xt({}),this.componentEventEmitter=new Ot,this.componentResourceManager=new Dt(this.model.id,this.services.eventEmitter,this.isStaticRenderMode),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new yt(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(Ft).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(Ht).forEach((t=>t(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new It(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),Pt),this.colorSchemaListener.apply(this.getEnvironment()).then((()=>{this.subscriptions.push(this.colorSchemaListener.on())}))),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(St.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(Vt).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(Ft).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(Ht).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(Vt).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;const o=function(t,e){if(!e)return t||{desktop:[],mobile:[]};const n=JSON.parse(JSON.stringify(t||{desktop:[],mobile:[]}));return e.forEach((t=>{const e=t.element;let o=!1,i=!1;n.desktop&&n.desktop.forEach((n=>{n.element===e&&(zt(n,t),o=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===e&&(zt(n,t),i=!0)})),!o&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(t))),!i&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(t)))})),n}(t,e),i=r("type"),l="element-styles";let s=this.getRootElement().querySelector(`style[${i}="${l}"]`);s||(s=document.createElement("style"),s.setAttribute(i,l),this.getRootElement().appendChild(s)),H({element:s,html:""}),n.forEach((t=>{let e=t.getAttribute(r("element"));const n=this.getEnvironment();let i=Gt(o,n,e);if(i){if(this.resizeListener.isMobile()){const t=Gt(o,"desktop",e);t&&(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},t.styleAttributes),i.styleAttributes)}))}this.applyStylesToElement(t,this.applySharedClassesToElementModel(i),s)}})),this._addLinkColor(s,this.getShared())},this.registerComponentResourceManagement=()=>{this.viewResourceManager.registerComponent(this.model.id,this.componentResourceManager)},this.applyStyles=(t,e={})=>{if(!t||!t.style)return!1;for(const[n,o]of Object.entries(e))t.style[n]=o;return!0},this.applyStylesToElement=(t,e,n)=>{var o,i;const l=[];"host"===(e=Zt._resolveTogglableStylesForElementModel(e)).element&&(At.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 s=e.styleAttributes.background,a=s&&s.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&a){this.componentResourceManager.getPending().increment();const t=new Image;t.src=a[1],Ct(t,"load",(()=>{this.componentResourceManager.getPending().decrement()})),Ct(t,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(t.src),this.isUpdatingRenderMode&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},e),{styleAttributes:Lt(e.styleAttributes,l)});if(Tt.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(),i=`flip-up-animation-${e.element}`;let r=this.getRootElement().querySelector(`#${i}`);r||(r=document.createElement("style"),r.id=i,t.appendChild(r)),H({element:r,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.applySharedClassesToElementModel=t=>function(t,e){let n=t;return(n.classes||"").split(" ").filter((t=>t.startsWith(o))).forEach((t=>{var o;let i=null===(o=e.textClasses)||void 0===o?void 0:o[t];i&&(i.styleAttributes.fontFamily||(i.isHeader&&e.headerFontFamily&&(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),{fontFamily:e.headerFontFamily})})),!i.isHeader&&e.textFontFamily&&(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),{fontFamily:e.textFontFamily})}))),n=Object.assign(Object.assign({},n),{styleAttributes:Object.assign(Object.assign({},n.styleAttributes),i.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},n.placeholderStyleAttributes),i.placeholderStyleAttributes)}))})),n.styleAttributes.fontFamily||(n=Object.assign(Object.assign({},n),{styleAttributes:Object.assign(Object.assign({},n.styleAttributes),{fontFamily:e.textFontFamily})})),n}(t,this.documentModel.getShared()),this.getModel=()=>this.model,this._addStylesToStyleElement=(t,e,n,o="",i)=>{const l=Object.keys(n).reduce(((t,e)=>t+` ${kt.camelCaseToDashCase(e)}: ${n[e]}${i?" !important;":";"}`),"");H({element:t,html:`[${r("element")}="${e}"]${o} { ${l} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{H({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,o,i,r;e.linkColor&&H({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)&&H({element:t,html:`a {color: ${null===(o=e.linkParams)||void 0===o?void 0:o.color}}, a:visited {color: ${null===(i=e.linkParams)||void 0===i?void 0:i.color}}`,appendHtml:!0}),(null===(r=e.linkParams)||void 0===r?void 0:r.removeUnderline)&&H({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!==i("hovered")&&t!==i("focused"))).forEach((e=>{e.startsWith(o)&&t.classList.remove(e)}));const n=((t.getAttribute("class")||"")+" "+e.classes).trim();t.setAttribute("class",n)},this.getParentComponent=()=>Wt(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:Wt(this.parentNode,r("path"),void 0,(t=>t&&1===t.split(",").length))},this.getWidgetLanguages=()=>et(this.services.config),this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=t=>nt(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,o,i,r,l;const s=t.control.name;if(["email","first_name","last_name"].includes(s))return s.toUpperCase();if((null===(e=t.content)||void 0===e?void 0:e.label)&&(null===(i=null===(o=null===(n=t.adaptiveStyles)||void 0===n?void 0:n.desktop.find((t=>"label"===t.element)))||void 0===o?void 0:o.params)||void 0===i?void 0:i.enabled)){const e=(new DOMParser).parseFromString(t.content.label,"text/html");return this.capitalizeFirstLetter(e.body.textContent||"")}return(null===(r=t.content)||void 0===r?void 0:r.placeholder)?this.capitalizeFirstLetter(t.content.placeholder):(null===(l=t.control)||void 0===l?void 0:l.integrationName)?this.capitalizeFirstLetter(t.control.integrationName).replace(new RegExp("_","g")," "):void 0},this.capitalizeFirstLetter=t=>t.charAt(0).toUpperCase()+t.slice(1),this.getContextRecordExampleValue=t=>{var e;switch(null===(e=t.control)||void 0===e?void 0:e.name){case"email":return"myemail@example.com";case"first_name":return"Maria";case"last_name":return"Taylor";default:return this.getContextRecordLabel(t)}},this.completeSubmitAction=t=>{const e=t||{},n=this.services.actionRegister.getRegisteredActions().find((t=>t.category===$t));n?null==n||n.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:ut}).execute(void 0,void 0,!0,e)},this.getHandlers=()=>{var t;return(null===(t=this.getProps())||void 0===t?void 0:t.handlers)&&this.getProps().handlers.length?[...this.getProps().handlers]:[]},this.assets=(t="")=>`${this.services.config.getConfig("staticResourcesUrl").replace(/\/$/,"")}/${this.manifest.name}/assets${t?`/${t}`:""}`,this.attachShadow({mode:"open"}),this.manifest=this.manifest||(null===(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()}get isStaticRenderMode(){return this.services.config.getConfig("renderMode")===qt}get isUpdatingRenderMode(){return this.services.config.getConfig("renderMode")===Kt}static _resolveTogglableStylesForElementModel(t){const e=Object.assign({},t);return Object.keys(e).forEach((t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=Zt._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 Yt=Symbol("required");var Jt=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 i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n};function Xt(){}const te="pending",ee="valid",ne="invalid";class oe extends Zt{constructor(){super(...arguments),this._createControl=(t={},...e)=>{const{element:n}=t,o=Jt(t,["element"]),i=this.getProps(),r=this.getModel(),l=Object.assign(Object.assign(Object.assign({},i.control),{componentId:r.id,viewIdx:r.path[0]}),o),s=this.services.form,a=[l,n,...e];return s.hasControl(i.control.name)?s.updateControl(...a):s.registerControl(...a)},this.createControlWithValidation=(t=[],e={})=>{const{element:n=this.getElement("input"),tooltipElement:o=this.getRootElement().querySelector(".input-tooltip"),validCallback:i=Xt,invalidCallback:r=Xt,pendingCallback:l=Xt,elementToListen:s=n,validationMap:a={},listenStatusChange:c=!0}=e,d=Jt(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=(null==u?void 0:u.validator)?a[u.validator]:void 0,h=t.some((t=>t[Yt])),m=!!(null==u?void 0:u.required),g=m||h,f=[...t];m&&!h&&f.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[Yt]=!0,e}()),p&&f.push(p);const v=this._prepareAsyncValidators(f),b=this._createControl({element:n,validation:{validator:"custom",required:g}},void 0,v);return c&&this._handleControlStatusChange(Object.assign({control:b,element:s,tooltipElement:o,configService:this.services.config,i18n:this.manifest.i18n,validCallback:i,invalidCallback:r,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=t=>{t.control.on(e,(e=>{this._handleValidationStatus(t,e)})),t.control.on(n,(()=>{let e=te;switch(!0){case t.control.pending:e=te;break;case t.control.valid:e=ee;break;default:e=ne}this._handleValidationStatus(t,e)}))},this._handleValidationStatus=(t,e)=>{const{control:n,element:o,tooltipElement:i,validCallback:r,invalidCallback:l,errorMessageMapper:s,pendingCallback:a}=t,c=this.services.config,d=this.manifest.i18n;switch(e){case ee:(function(t,e){t.classList.remove("invalid"),e&&(e.style.visibility="hidden")})(o,i),r&&r();break;case ne:if(n.touched){const t=n.getErrorKeys();if(!t)break;const e=t[0];let r=function(t,e,n){const o=nt(e,et(t));if(!o)return n;const i=o.translations,r=Object.keys(i).find((t=>t.includes(n)));return r?i[r]:n}(c,d,e);s&&(r=s(e,r)),function(t,e,n,o){o=o||document;let i=null;t.classList.add("invalid"),e&&(e.style.visibility="visible"),e&&(e.onmouseenter=()=>{(function(t){if((t=t||document).head.querySelector(`#${X}`))return;const e=document.createElement("style");e.setAttribute("id",X),H({element:e,html:tt}),t.head.appendChild(e)})(o),i=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(i),i.style.visibility="visible",function(t){const{triggerElement:e,tooltipElement:n,offset:o=10,htmlDocumentObject:i}=t,r=q(e,n,o,"top",!0,i);n.setAttribute("cl-tooltip-position",r.position),V(n,r.coordinates)}({triggerElement:e,tooltipElement:i,htmlDocumentObject:o})},e.onmouseleave=()=>{i&&(i.remove(),function(t){const e=(t=t||document).head.querySelector(`#${X}`);e&&e.remove()}(o))})}(o,i,r,this.htmlDocumentObject),l&&l()}break;case te:n.touched&&(function(t,e){e&&(e.style.visibility="hidden"),t.classList.contains("invalid")&&t.classList.remove("invalid")}(o,i),a&&a())}}}}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 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,se(o.key),o)}}function le(t,e,n){return(e=se(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}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+""}var ae=function(){return t=function t(e,n,o,i,r,l){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),le(this,"getRootElement",null),le(this,"overlayElement",null),le(this,"configService",null),le(this,"stateService",null),le(this,"valueChangedCallback",null),this.getRootElement=e,this.getElement=n,this.configService=o,this.stateService=i,this.valueChangedCallback=r,this.htmlDocumentObject=l},e=[{key:"createOverlay",value:function(t){var e,n,o=this,i=this.getRootElement();!function(t){const{triggerElement:e,overlayStyles:n,createOverlayContent:o,overlayWidth:i,overlayHeight:r,offset:l,onDestroy:s,positionByDefault:a,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),i&&(h.style.width=`${i}px`),r&&(h.style.height=`${r}px`);const m=h.attachShadow({mode:"open"}),g=document.createElement("style");H({element:g,html:n}),m.append(g);const f=document.createElement("div");f.classList.add(Q()),u.body.append(p),u.body.append(h),m.append(f),o(p,f),(()=>{const t=q(e,f,function(t){return null!=t?t:5}(l),a,c,u);(function(t,e){t.setAttribute("cl-overlay-position",e)})(f,t.position),V(h,t.coordinates)})(),h.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault()}));const v=t=>{p.remove(),h.remove(),s&&s(),window.removeEventListener("keyup",t,!0)},b=t=>{"Escape"===t.key&&(t.preventDefault(),t.stopImmediatePropagation(),v(b))};p.addEventListener("click",(()=>v(b))),window.addEventListener("keyup",b,!0)}({triggerElement:i.querySelector(".phone-input-with-tooltip"),overlayStyles:(e=Q(),n=this.configService.getConfig("staticResourcesUrl").replace(/\/$/,"")+"/SysPhoneInputComponent/assets/","\n.".concat(e," {\n width: 270px;\n max-height: 380px;\n box-shadow: 0 1px 5px rgba(0, 0, 0, 0.28);\n border-radius: 4px;\n padding: 20px 0;\n overflow: auto;\n position: absolute;\n background-color: #fff;\n}\n\n.").concat(e,"::-webkit-scrollbar {\n width: 6px;\n height: 6px;\n background-color: transparent;\n}\n\n.").concat(e,"::-webkit-scrollbar-thumb {\n border-radius: 6px;\n background-color: #848484;\n}\n\n.search-country-input-container {\n display: flex;\n align-items: center;\n padding: 0 20px 20px;\n}\n\n.option-wrapper {\n background-color: #fff;\n border: 0;\n display: flex;\n align-items: center;\n font-size: 16px;\n padding: 10px 20px;\n outline: 0;\n cursor: pointer;\n text-align: left;\n flex-direction: row;\n}\n.option-wrapper:hover {\n background-color: #fafafa;\n}\n.phone-input-flag-icon {\n background: url(").concat(n,"img/flags.png) no-repeat 0 0;\n background-size: 24px 3876px;\n background-position-x: -1px;\n min-width: 24px;\n height: 16px;\n margin: 0 5px;\n}\n.phone-input-prefix {\n margin-left: 8px;\n color: #999;\n font-size: 14px;\n}\n\n.search-country-input {\n border: 0;\n border-bottom: 1px solid #000;\n border-radius: 0;\n outline: 0;\n margin-left: 10px;\n width: 170px;\n line-height: 1.42857143;\n}\n ")),createOverlayContent:function(e,n){o.createOverlayContent(i,e,n,t),o.overlayElement=n},overlayWidth:270,overlayHeight:380,htmlDocumentObject:this.htmlDocumentObject})}},{key:"createOverlayContent",value:function(t,e,n,o){var i=this,r=this.stateService.getState().currentCountryCode,l=t.querySelector(".phone-input-select-button-flag");if(o.length>8){var s=document.createElement("div");s.classList.add("search-country-input-container");var a=document.createElement("input");a.classList.add("search-country-input"),a.addEventListener("input",(function(t){return m(t.currentTarget.value)})),s.appendChild(this.getSearchIcon()),s.appendChild(a),n.appendChild(s)}var c,d,u,p=function(t){const e=window.getComputedStyle(t);return["height","border-top-left-radius","border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius"].reduce(((t,n)=>(t[n]=e.getPropertyValue(n),t)),{})}(this.getElement("input")),h=(c=p.height,d=p,Math.min(Math.floor(parseInt(String(c))/2),parseInt(d.borderTopLeftRadius),parseInt(d.borderTopRightRadius),parseInt(d.borderBottomLeftRadius),parseInt(d.borderBottomRightRadius)));V(n,{"border-top-left-radius":"".concat(h,"px"),"border-top-right-radius":"".concat(h,"px"),"border-bottom-left-radius":"".concat(h,"px"),"border-bottom-right-radius":"".concat(h,"px")});var m=function(t,e=300){let n;return function(...o){clearTimeout(n),n=setTimeout((()=>{t.apply(this,o)}),e)}}((function(t){u&&u.remove();var s=i.filterOptions(t,o);V(u=document.createElement("div"),{display:"flex",flexDirection:"column"}),s.length?s.forEach((function(t){var n=r===t.countryCode,o=i.createMenuButtonComponent(t,n);o.addEventListener("click",(function(){i.valueChangedCallback(t),l.style.backgroundPositionY="".concat(t.position,"px"),e.click()})),u.appendChild(o)})):u.appendChild(i.getNothingFoundComponent()),n.appendChild(u)}),100);m("")}},{key:"createMenuButtonComponent",value:function(t,e){var n=document.createElement("div");n.classList.add("option-wrapper");var o=document.createElement("span");o.classList.add("phone-input-flag-icon");var i=document.createElement("span");i.classList.add("phone-input-prefix");var r=document.createElement("span");return r.textContent=nt(t.label,et(this.configService)).translations,r.style.color="#000",o.style.backgroundPositionY="".concat(t.position,"px"),i.textContent=t.prefix,e&&(n.style.backgroundColor="#fafafa"),n.appendChild(o),n.appendChild(r),n.appendChild(i),n}},{key:"getNothingFoundComponent",value:function(){var t=document.createElement("p");return t.style.padding="0 20px",t.textContent="Nothing found",t}},{key:"filterOptions",value:function(t,e){var n=this,o=t.trim().toLowerCase();return o?e.filter((function(t){return nt(t.label,et(n.configService)).translations.toLowerCase().includes(o)})):e}},{key:"getSearchIcon",value:function(){var t=document.createElement("div");return H({element:t,html:'\n <svg\n width="25"\n height="24"\n viewBox="0 0 25 24"\n fill="none"\n xmlns="http://www.w3.org/2000/svg">\n <path\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M17.005 14.9871C18.9001 12.2585 18.6317 8.48222 16.1997 6.05025C13.4661 3.31658 9.03392 3.31658 6.30025\n 6.05025C3.56658 8.78392 3.56658 13.2161 6.30025 15.9497C8.73224 18.3817 12.5085 18.6501 15.2372\n 16.7549L19.1369 20.6546L20.9046 18.8868L17.005 14.9871ZM14.7855 7.46447C16.7382 9.41709 16.7382 12.5829\n 14.7855 14.5355C12.8329 16.4882 9.66709 16.4882 7.71447 14.5355C5.76184 12.5829\n 5.76184 9.41709 7.71447 7.46447C9.66709 5.51184 12.8329 5.51184 14.7855 7.46447Z"\n fill="#5F5F5F"/>\n </svg>',isSvg:!0}),t}},{key:"focusSearchInput",value:function(){var t;null===(t=this.overlayElement)||void 0===t||null===(t=t.querySelector(".search-country-input"))||void 0===t||t.focus()}}],e&&re(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();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 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,ve(o.key),o)}}function ue(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ue=function(){return!!t})()}function pe(t,e,n,o){var i=he(me(1&o?t.prototype:t),e,n);return 2&o&&"function"==typeof i?function(t){return i.apply(n,t)}:i}function he(){return he="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var o=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=me(t)););return t}(t,e);if(o){var i=Object.getOwnPropertyDescriptor(o,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},he.apply(null,arguments)}function me(t){return me=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},me(t)}function ge(t,e){return ge=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ge(t,e)}function fe(t,e,n){return(e=ve(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ve(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+""}var be=function(){function e(){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var o=arguments.length,i=new Array(o),r=0;r<o;r++)i[r]=arguments[r];return fe(n=function(t,e,n){return e=me(e),function(t,e){if(e&&("object"==ce(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||[],me(t).constructor):e.apply(t,n))}(this,e,[].concat(i)),"manifest",t),fe(n,"countryData",null),fe(n,"registeredControl",null),fe(n,"countryCodeSelectedAtLeastOnce",!1),fe(n,"availableOptions",[]),fe(n,"getValidators",(function(){return[function(t){return t&&t.replace(/[+()\-_ ]/g,"").match(/^\d+$/)?{isValid:!0}:{isValid:!1,errorKey:"PHONE_INVALID_NUMBER"}}]})),fe(n,"addContextRecord",(function(t){var e,o=n.getModel();n.services.context.addRecord(o.id,{recordKey:o.id,id:o.props.control.name,label:"PHONE",value:o.props.control.defaultValue||"",viewIndex:null===(e=o.path)||void 0===e?void 0:e[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:"".concat(t,"6402577610")}})})),fe(n,"updateContext",(function(){var t,e=n.getModel();n.services.context.updateRecord(e.id,{viewIndex:null===(t=e.path)||void 0===t?void 0:t[0]})})),fe(n,"requestCountryData",(function(){return fetch("".concat(n.assets("json/country-code-options.json"))).then((function(t){return t.json()}))})),fe(n,"applyParams",(function(t,e){var o=n.getRootElement().querySelector(".phone-input-select-button"),i=n.getInputElement(),r=t.adaptiveStyles[e].find((function(t){return"input"===t.element})).styleAttributes.paddingLeft||"10px";V(o,{left:r}),V(i,{paddingLeft:"".concat(parseFloat(r)+51,"px")})})),fe(n,"getInputElement",(function(){return n.getRootElement().querySelector(".phone-input")})),fe(n,"setValue",(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=n.services.state.getState().currentCountryCode||t.control.countryCode||"UA";n.services.state.setState({currentCountryCode:o});var i=n.countryData.find((function(t){return t.countryCode===o})),r=n.getRootElement(),l=n.getInputElement(),s=r.querySelector(".phone-input-select-button-flag"),a=i&&i.prefix||"+380";s.style.backgroundPositionY=i?"".concat(i.position,"px")||0:"-2721px",s.style.opacity="1",l.value=e||a,n.services.form.hasControl(t.control.name)&&n.services.form.getControl(t.control.name).setValue(e||a,{silent:!0,skipValidation:!0})})),fe(n,"getAvailableOptions",(function(t,e){return e.allowToAddOnlyFromIncludedList&&(t=e.includedList.map((function(e){var n=t.find((function(t){return t.countryCode===e}));if(!n)throw new Error("SysPhoneInputComponent: could not found ".concat(e," in options array"));return n}))),n.sortOptionsByPriority(t,e)})),fe(n,"sortOptionsByPriority",(function(t,e){return e.includedList.reverse().forEach((function(e){var n=t.findIndex((function(t){return t.countryCode===e}));if(-1===n)throw new Error("SysPhoneInputComponent: could not found ".concat(e," in options array"));var o=t[n];t.splice(n,1),t.unshift(o)})),t})),fe(n,"setArrowIconStyles",(function(){var t=n.getElement("input").style.color;n.getRootElement().querySelector(".dropdown-icon").style.color=t})),fe(n,"valueChangedCallback",(function(t){if(!n.countryCodeSelectedAtLeastOnce&&n.countryData){var e=n.getCountryOptionByValue(t);if(e){var o=n.services.state.getState().currentCountryCode;e.countryCode!==o&&(n.services.state.setState({currentCountryCode:e.countryCode}),n.getRootElement().querySelector(".phone-input-select-button-flag").style.backgroundPositionY="".concat(e.position,"px"))}}})),fe(n,"getCountryOptionByValue",(function(t){var e=t.startsWith("+")?t:"+".concat(t);return n.availableOptions.find((function(t){return e.startsWith(t.prefix)}))})),fe(n,"createPhoneInputFormControl",(function(){var t=n.getRootElement(),e=n.getInputElement(),o=t.querySelector(".phone-input-asyncLoader");n.phoneInputFormControl=n.createControlWithValidation(n.getValidators(),{validCallback:function(){return o.style.visibility="hidden"},invalidCallback:function(){return o.style.visibility="hidden"},pendingCallback:function(){return o.style.visibility="visible"}}),n.phoneInputFormControl.on("valueChanged",(function(t){n.valueChangedCallback(t)})),e.removeEventListener("input",n.createPhoneInputFormControl)})),fe(n,"menuOptionSelected",(function(t){n.phoneInputFormControl||n.createPhoneInputFormControl(),n.phoneInputFormControl.setValue(t.prefix),n.countryCodeSelectedAtLeastOnce=!0,n.services.state.setState({currentCountryCode:t.countryCode})})),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&&ge(t,e)}(e,oe),n=e,o=[{key:"connectedCallback",value:function(){var t=this;pe(e,"connectedCallback",this,3)([]),this.getRootElement().innerHTML+="\n ".concat("\n<style>\n.main-container {\n height: 100%;\n}\n\n.label-with-input-container {\n height: 100%;\n display: flex;\n}\n\n.label {\n min-height: 10px;\n}\n\n.label.cl-focused {\n min-height: auto;\n}\n\n.phone-input-with-tooltip {\n position: relative;\n display: flex;\n height: 100%;\n width: 100%;\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\ninput {\n height: 100%;\n -moz-appearance:none;\n -webkit-appearance:none;\n -o-appearance:none;\n}\n\n.phone-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 cursor: pointer;\n position: absolute;\n}\n\n.phone-input {\n height: 100%;\n padding-top: 0 !important;\n padding-bottom: 0 !important;\n margin: 0;\n text-align: start !important;\n}\n\n.phone-input-select-button-flag {\n background-repeat: no-repeat;\n background-size: 24px 3876px;\n background-position-x: -1px;\n min-width: 24px;\n width: 24px;\n height: 16px;\n margin: auto 5px auto 0;\n}\n\n.phone-input-asyncLoader {\n height: 18px;\n width: 18px;\n border-radius: 50%;\n background-color: #ffffff;\n position: absolute;\n right: -9px;\n top: -9px;\n visibility: hidden;\n}\n\n.phone-input-asyncLoader .spinner--icon {\n animation: rotates 2s linear infinite;\n z-index: 2;\n position: absolute;\n top: 50%;\n left: 50%;\n margin: -9px 0 0 -9px;\n width: 18px;\n height: 18px;\n}\n\n.phone-input-asyncLoader .spinner--icon .path {\n stroke: #9B9B9B;\n stroke-linecap: round;\n animation: dash 1.5s ease-in-out infinite;\n}\n\n.phone-input-asyncLoader .spinner--icon .path1 {\n stroke: #9B9B9B;\n stroke-linecap: round;\n animation: dash 1.25s ease-in-out infinite;\n}\n\n.phone-input-asyncLoader .spinner--icon @keyframes rotates {\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.phone-input-asyncLoader .spinner--icon @keyframes dash {\n 0% {\n stroke-dasharray: 1, 150;\n stroke-dashoffset: 0;\n }\n 50% {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -35;\n }\n 100% {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -124;\n }\n}\n\ninput {\n width: 100%;\n}\n\ninput.focus-outline-defined:focus {\n outline: var(--clFocusOutline);\n}\n</style>\n ","\n ").concat('\n<div class="main-container">\n <div class="label-with-input-container">\n <div cl-element="label"\n cl-inline-edit="content, label"\n class="label">\n </div>\n\n <div class="phone-input-with-tooltip">\n <div class="phone-input-select-button">\n <div class="phone-input-select-button-flag"></div>\n\n <svg width="11" height="7" viewBox="0 0 11 7" fill="none" xmlns="http://www.w3.org/2000/svg"\n class="dropdown-icon">\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\n <input cl-element="input"\n type="tel"\n name="phone"\n autocomplete="on"\n class="phone-input">\n\n <div class="input-tooltip">\n <svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M1.5 13.0604C1.5 19.4116 6.6481 24.5605 13.0075 24.5605C19.353 24.5605 24.5 19.4107 24.5 13.0604C24.5 6.70865 19.3531 1.55909 13.0075 1.55908C6.64806 1.55908 1.5 6.7077 1.5 13.0604ZM12.9775 17.9668C12.7032 17.9668 12.4807 17.7443 12.4807 17.47C12.4807 17.1956 12.7032 16.9732 12.9775 16.9732C13.2519 16.9732 13.4743 17.1956 13.4743 17.47C13.4743 17.7443 13.2519 17.9668 12.9775 17.9668ZM12.9775 13.4764C12.7032 13.4764 12.4807 13.254 12.4807 12.9796L12.4807 8.48924C12.4807 8.21487 12.7032 7.99245 12.9775 7.99245C13.2519 7.99245 13.4743 8.21487 13.4743 8.48924L13.4743 12.9796C13.4743 13.254 13.2519 13.4764 12.9775 13.4764Z" fill="#FF0000" stroke="white" stroke-width="2"></path>\n </svg>\n </div>\n\n <span class="phone-input-asyncLoader">\n <svg class="spinner--icon" viewBox="0 0 18 18">\n <circle class="path" cx="9" cy="9" r="5" fill="none" stroke-width="2"></circle>\n <circle class="path1" cx="9" cy="9" r="2" fill="none" stroke-width="2"></circle>\n </svg>\n </span>\n </div>\n </div>\n</div>\n ',"\n ");var n=this.getRootElement(),o=this.getInputElement(),i=n.querySelector(".phone-input-select-button-flag");i.style.opacity="0",i.style.backgroundImage="url(".concat(this.assets("img/flags.png"),")"),this.requestCountryData().then((function(e){var n,i=t.getProps();t.countryData=e;var r=t.services.state.getState().currentCountryCode||i.control.countryCode||"UA",l=i.control.countriesPriority||{includedList:[r],allowToAddOnlyFromIncludedList:!1};t.availableOptions=t.getAvailableOptions(t.countryData.slice(),l),(null===(n=t.getProps().control)||void 0===n||null===(n=n.validation)||void 0===n?void 0:n.required)?t.createPhoneInputFormControl():o.addEventListener("input",t.createPhoneInputFormControl),t.setValue(i,i.control.defaultValue||null),t.phoneInputMenu=new ae(t.getRootElement.bind(t),t.getElement.bind(t),t.services.config,t.services.state,t.menuOptionSelected.bind(t),t.htmlDocumentObject);var s=e.find((function(t){return t.countryCode===r}));t.addContextRecord((null==s?void 0:s.prefix)||"+380")})).catch((function(e){console.error("SysPhoneInputComponent: could not load country data",e),t.addContextRecord("+1")})),this.observeProps((function(e,o){var i=t.getEnvironment();t.applyAutoAdaptiveStyles(o.adaptiveStyles,o.styles),$(o,i,n,".label-with-input-container"),z(o,i,t.getHostElement(),t.getElement("input"),t.getElement("label")),function(t){let e=null;const n=t,o=["transparent","initial"];t&&(t.style.borderColor&&!o.includes(t.style.borderColor)&&(parseFloat(t.style.borderWidth)||parseFloat(t.style.borderBottomWidth))&&(e=G(n,t,"borderColor")),!e&&t.style.getPropertyValue("--borderBottomColor")&&!o.includes(t.style.getPropertyValue("--borderBottomColor"))&&parseFloat(t.style.getPropertyValue("--borderBottomWidth"))&&(e=G(n,t,"--borderBottomColor")),e||!t.style.backgroundColor||o.includes(t.style.backgroundColor)||(e=G(n,t,"backgroundColor")),e||!t.style.color||o.includes(t.style.color)||(e=G(n,t,"color")),e||n.classList.remove("focus-outline-defined"))}(t.getElement("input")),t.applyParams(o,i),t.setArrowIconStyles(),t.updateContext()})),this.observeEnvironment((function(e,o){var i=t.getProps();t.applyParams(i,o),$(i,o,n,".label-with-input-container"),z(i,o,t.getHostElement(),t.getElement("input"),t.getElement("label")),t.setArrowIconStyles()})),this.observeShared((function(){t.applyParams(t.getProps(),t.getEnvironment()),t.setArrowIconStyles()})),n.querySelector(".phone-input-select-button").addEventListener("click",(function(){t.countryData&&!t.isUpdatingRenderMode&&(setTimeout((function(){return t.phoneInputMenu.createOverlay(t.availableOptions)}),50),setTimeout((function(){t.phoneInputMenu.focusSearchInput()}),500))}))}},{key:"disconnectedCallback",value:function(){pe(e,"disconnectedCallback",this,3)([]),this.services.context.deleteRecord(this.getModel().id)}}],o&&de(n.prototype,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o}();fe(be,"define",{name:"sys-phone-input",model:t.name,manifest:t});export{be as default};window.clComponentClass_SysPhoneInputComponent=be;
1
+ const t="cl-";function e(e){return t+e}function n(t){return"cl-"+t}function o(t,e,n){var o;return null===(o=null==t?void 0:t[e])||void 0===o?void 0:o.find((t=>t.element===n))}function i(t=[]){return t.map((t=>Object.assign(Object.assign({},t),{styleAttributes:Object.assign({},t.styleAttributes)})))}const r={name:"SysPhoneInputComponent",componentType:"INPUT",version:"1.0.0",contextMenuModel:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}]}],floatingControlsModel:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"input"},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"input"},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"}]}],propertyPaneModel:{content:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"SIZE",element:"input",elementProp:"styleAttributes",params:{width:{options:["fixed","fill"]},height:{options:["fixed","fill"]}}},{type:"CONTROL",name:"TEXT_PARAMS",params:[{element:"input",hideTextAlign:!0},{element:"label",displayCondition:"return !!sdk.component.getProps().styles.find(element => element.element === 'label').params.enabled"}]},{type:"CONTROL",name:"BACKGROUND",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:"BORDER_RADIUS",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",hideTextAlign:!0},{element:"label",displayCondition:"return !!sdk.component.getProps().styles.find(element => element.element === 'label').params.enabled"}]},{type:"CONTROL",name:"BACKGROUND",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:"BORDER_RADIUS",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:"COUNTRY_PHONE_SELECT",element:"input",propPath:["control"]},{type:"CONTROL",name:"INPUT_VALIDATION",params:{validationPropPath:["control","validation"],fieldTypePropPath:["control","fieldType"],required:!0,options:[{label:"Phone",value:"PHONE"}],validationErrors:{PHONE:[{key:"PHONE_INVALID_NUMBER",value:"Phone number is invalid"}]}}}]},autoContrast:[{slave:{element:"input",elementProp:"styleAttributes",elementSubProp:"color"},master:{element:"input",propPath:["styles","[element=input]","styleAttributes","background"]},enabledPropPath:["content","textContrastEnabled"]}],focusableElements:["input","label"],events:{dispatch:[],listen:[]},i18nPropPaths:["content,label","content,placeholder"],i18n:{en:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Phone number is invalid","control,validation,validationErrors,REQUIRED":"Required field","content,label":"Title"},ru:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Неверно заполнен номер телефона","control,validation,validationErrors,REQUIRED":"Обязательное поле","content,label":"Заголовок"},uk:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Неправильно заповнено номер телефону","control,validation,validationErrors,REQUIRED":"Обов'язкове поле","content,label":"Заголовок"},es:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"El número de teléfono no es válido","control,validation,validationErrors,REQUIRED":"Campo obligatorio","content,label":"Título"},de:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Telefonnummer ist ungültig","control,validation,validationErrors,REQUIRED":"Pflichtfeld","content,label":"Titel"},fr:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Le numéro de téléphone est invalide","control,validation,validationErrors,REQUIRED":"Champs requis","content,label":"Titre"},it:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Il numero di telefono non è valido","control,validation,validationErrors,REQUIRED":"Campo obbligatorio","content,label":"Titolo"},pt:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Número de telefone inválido","control,validation,validationErrors,REQUIRED":"Campo obrigatório","content,label":"Título"},ro:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Numărul de telefon nu este valid","control,validation,validationErrors,REQUIRED":"Câmp obligatoriu","content,label":"Titlu"},bg:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Телефонният номер е невалиден","control,validation,validationErrors,REQUIRED":"Изисквано поле","content,label":"Заглавие"},cs:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Telefonní číslo je neplatné","control,validation,validationErrors,REQUIRED":"Vyžadované pole","content,label":"Titul"},el:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Ο αριθμός τηλεφώνου είναι άκυρος","control,validation,validationErrors,REQUIRED":"Απαιτητό πεδίο","content,label":"Τίτλος"},nl:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Telefoonnummer is ongeldig","control,validation,validationErrors,REQUIRED":"Verplicht veld","content,label":"Titel"},pl:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Numer telefonu jest nieprawidłowy","control,validation,validationErrors,REQUIRED":"Wymagane pole","content,label":"Tytuł"},sv:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Telefonnumret är ogiltigt","control,validation,validationErrors,REQUIRED":"Obligatoriskt fält","content,label":"Tytuł"},tr:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Telefon numarası geçersiz","control,validation,validationErrors,REQUIRED":"Gerekli alan","content,label":"Başlık"},ar:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"رقم الهاتف غير صالح","control,validation,validationErrors,REQUIRED":"الحقل المطلوب","content,label":"عنوان"},zh:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"电话号码无效","control,validation,validationErrors,REQUIRED":"必填字段","content,label":"Title"},da:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Telefonnummer er ugyldigt","control,validation,validationErrors,REQUIRED":"Påkrævet felt","content,label":"Titel"},he:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"מספר טלפון לא תקין","control,validation,validationErrors,REQUIRED":"שדה נדרש","content,label":"Title"},fi:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Puhelinnumero on virheellinen","control,validation,validationErrors,REQUIRED":"Vaadittu kenttä","content,label":"Title"},hi:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"फ़ोन नंबर अमान्य है","control,validation,validationErrors,REQUIRED":"आवश्यक फील्ड","content,label":"Title"},hr:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Telefonski broj nije ispravan","control,validation,validationErrors,REQUIRED":"Obavezno polje","content,label":"Title"},hu:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"A telefonszám érvénytelen","control,validation,validationErrors,REQUIRED":"Kötelező mező","content,label":"Title"},id:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Nomor telepon tidak valid","control,validation,validationErrors,REQUIRED":"Bidang yang wajib diisi","content,label":"Title"},ja:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"電話番号が無効です","control,validation,validationErrors,REQUIRED":"必須フィールド","content,label":"Title"},ko:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"유효하지 않은 전화번호","control,validation,validationErrors,REQUIRED":"필수 칸","content,label":"Title"},no:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Telefonnummeret er ugyldig","control,validation,validationErrors,REQUIRED":"Obligatorisk felt","content,label":"Title"},sk:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Telefónne číslo je neplatné","control,validation,validationErrors,REQUIRED":"Povinné pole","content,label":"Title"},sl:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Telefonska številka je neveljavna","control,validation,validationErrors,REQUIRED":"Obvezno polje","content,label":"Title"},sr:{"control,validation,validationErrors,PHONE_INVALID_NUMBER":"Broj telefona je nevažeći","control,validation,validationErrors,REQUIRED":"Obavezno polje","content,label":"Title"}},props:{content:{label:"Title",textContrastEnabled:!0},control:{name:"phone",countryCode:"UA",countriesPriority:{includedList:["UA"],allowToAddOnlyFromIncludedList:!1},validation:{required:!0,validator:"PHONE"}},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:(s=[{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",paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",_paddingEnabled:!0},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({DESKTOP:"desktop",MOBILE:"mobile"}).reduce(((t,e)=>Object.assign(t,{[e]:i(s)})),{desktop:[],mobile:[]}))},metaDescription:{icon:"/SysPhoneInputComponent/assets/img/phone-input-component-icon.svg",label:{en:"Phone",ru:"Телефон",uk:"Телефон",es:"Teléfono",fr:"Téléphone",de:"Telefon",it:"Telefono",pt:"Telefone",ro:"Telefon",bg:"Телефон",cs:"Telefon",el:"Τηλέφωνο",nl:"Telefoon",pl:"Telefon",sv:"Telefon",tr:"Telefon",ar:"الهاتف",zh:"电话",da:"Telefon",he:"טלפון",fi:"Puhelin",hi:"फ़ोन",hr:"Telefon",hu:"Telefon",id:"Telepon",ja:"電話",ko:"휴대폰",no:"Telefon",sk:"Telefón",sl:"Telefon",sr:"Telefon"}}};var s;const l="validationStatusChanged",a="touchedStatusChanged";class c{static size(t){return{width:this.width(t),height:this.height(t)}}static width(t){var e;const n=t||document;return Math.max(n.documentElement.clientWidth,(null===(e=n.defaultView)||void 0===e?void 0:e.innerWidth)||0)}static height(t){var e;const n=t||document;return Math.max(n.documentElement.clientHeight,(null===(e=n.defaultView)||void 0===e?void 0:e.innerHeight)||0)}static scrollbarWidth(t){var e;const n=t||document;return((null===(e=n.defaultView)||void 0===e?void 0:e.innerWidth)||0)-n.documentElement.clientWidth}}var d=[];for(var u in{transparent:"#0000"})d.push(u);var p="\\s*([.\\d%]+)\\s*",h="\\("+[p,p,p]+"(?:,\\s*([.\\d]+)\\s*)?\\)",m="(?:rgb)a?",g="("+d.join("|")+")";function v(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}RegExp(m+h,"i"),RegExp([g,"(?:#([a-f0-9]{3,8}))",m+h,"(?:hsl)a?"+h].join("|"),"gi");var f=Array.prototype.concat,b=Array.prototype.slice,y=function(t){for(var e=[],n=0,o=t.length;n<o;n++){var i=t[n];v(i)?e=f.call(e,b.call(i)):e.push(i)}return e};y.wrap=function(t){return function(){return t(y(arguments))}};const E=y;var O={},C=Object.hasOwnProperty,T=Object.create(null);for(var R in O)C.call(O,R)&&(T[O[R]]=R);var S={to:{},get:{}};function x(t,e,n){return Math.min(Math.max(e,t),n)}S.get=function(t){var e,n;return"hsl"===t.substring(0,3).toLowerCase()?(e=S.get.hsl(t),n="hsl"):(e=S.get.rgb(t),n="rgb"),e?{model:n,value:e}:null},S.get.rgb=function(t){if(!t)return null;var e,n,o,i=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(o=e[2],e=e[1],n=0;n<3;n++){var r=2*n;i[n]=parseInt(e.slice(r,r+2),16)}o&&(i[3]=parseInt(o,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(o=(e=e[1])[3],n=0;n<3;n++)i[n]=parseInt(e[n]+e[n],16);o&&(i[3]=parseInt(o+o,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)i[n]=parseInt(e[n+1],0);e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:C.call(O,e[1])?((i=O[e[1]])[3]=1,i):null:null;for(n=0;n<3;n++)i[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}for(n=0;n<3;n++)i[n]=x(i[n],0,255);return i[3]=x(i[3],0,1),i},S.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,x(parseFloat(e[2]),0,100),x(parseFloat(e[3]),0,100),x(isNaN(n)?1:n,0,1)]}return null},S.to.rgb=function(){var t=E(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]+")"},S.to.hsl=function(){var t=E(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 N=S,I={},A={};for(const t of Object.keys(I))A[I[t]]=t;const w={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"}};Math.pow(6/29,3);for(const t of Object.keys(w)){if(!("channels"in w[t]))throw new Error("missing channels property: "+t);if(!("labels"in w[t]))throw new Error("missing channel labels property: "+t);if(w[t].labels.length!==w[t].channels)throw new Error("channel and label counts mismatch: "+t);const{channels:e,labels:n}=w[t];delete w[t].channels,delete w[t].labels,Object.defineProperty(w[t],"channels",{value:e}),Object.defineProperty(w[t],"labels",{value:n})}w.rgb.hsl=function(t){const e=t[0]/255,n=t[1]/255,o=t[2]/255,i=Math.min(e,n,o),r=Math.max(e,n,o),s=r-i;let l,a;r===i?l=0:e===r?l=(n-o)/s:n===r?l=2+(o-e)/s:o===r&&(l=4+(e-n)/s),l=Math.min(60*l,360),l<0&&(l+=360);const c=(i+r)/2;return a=r===i?0:c<=.5?s/(r+i):s/(2-r-i),[l,100*a,100*c]},w.hsl.rgb=function(t){const e=t[0]/360,n=t[1]/100,o=t[2]/100;let i,r,s;if(0===n)return s=255*o,[s,s,s];i=o<.5?o*(1+n):o+n-o*n;const l=2*o-i,a=[0,0,0];for(let t=0;t<3;t++)r=e+1/3*-(t-1),r<0&&r++,r>1&&r--,s=6*r<1?l+6*(i-l)*r:2*r<1?i:3*r<2?l+(i-l)*(2/3-r)*6:l,a[t]=255*s;return a};const P=w;function L(t,e){return function(n){return e(t(n))}}function _(t,e){const n=[e[t].parent,t];let o=P[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)n.unshift(e[i].parent),o=L(P[e[i].parent][i],o),i=e[i].parent;return o.conversion=n,o}const k={};Object.keys(P).forEach((t=>{k[t]={},Object.defineProperty(k[t],"channels",{value:P[t].channels}),Object.defineProperty(k[t],"labels",{value:P[t].labels});const e=function(t){const e=function(t){const e=function(){const t={},e=Object.keys(P);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(P[t]);for(let i=o.length,r=0;r<i;r++){const i=o[r],s=e[i];-1===s.distance&&(s.distance=e[t].distance+1,s.parent=t,n.unshift(i))}}return e}(t),n={},o=Object.keys(e);for(let t=o.length,i=0;i<t;i++){const t=o[i];null!==e[t].parent&&(n[t]=_(t,e))}return n}(t);Object.keys(e).forEach((n=>{const o=e[n];k[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),k[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 M=k,D=["keyword","gray","hex"],j={};for(const t of Object.keys(M))j[[...M[t].labels].sort().join("")]=t;const B={};function U(t,e){if(!(this instanceof U))return new U(t,e);if(e&&e in D&&(e=null),e&&!(e in M))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 U)this.model=t.model,this.color=[...t.color],this.valpha=t.valpha;else if("string"==typeof t){const e=N.get(t);if(null===e)throw new Error("Unable to parse color from string: "+t);this.model=e.model,o=M[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=M[this.model].channels;const n=Array.prototype.slice.call(t,0,o);this.color=V(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 j))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=j[o];const{labels:i}=M[this.model],r=[];for(n=0;n<i.length;n++)r.push(t[i[n]]);this.color=V(r)}if(B[this.model])for(o=M[this.model].channels,n=0;n<o;n++){const t=B[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)}U.prototype={toString(){return this.string()},string(t){let e=this.model in N.to?this:this.rgb();e=e.round("number"==typeof t?t:1);const n=1===e.valpha?e.color:[...e.color,this.valpha];return N.to[e.model](n)},round(t){return t=Math.max(t||0,0),new U([...this.color.map(F(t)),this.valpha],this.model)},alpha(t){return void 0!==t?new U([...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(M)){if(D.includes(t))continue;const{channels:e}=M[t];U.prototype[t]=function(...e){return this.model===t?new U(this):e.length>0?new U(e,t):new U([...H(M[this.model][t].raw(this.color)),this.valpha],t)},U[t]=function(...n){let o=n[0];return"number"==typeof o&&(o=V(n,e)),new U(o,t)}}function F(t){return function(e){return function(t,e){return Number(t.toFixed(e))}(e,t)}}function H(t){return Array.isArray(t)?t:[t]}function V(t,e){for(let n=0;n<e;n++)"number"!=typeof t[n]&&(t[n]=0);return t}const $=U;function W(t){const{element:e,html:n,appendHtml:o}=t,i=function(t){if(null==t)return"";if("string"!=typeof t)return String(t);if(""===t)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(t))return t;const e=(new DOMParser).parseFromString(t,"text/html");return e.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach((t=>t.remove())),e.querySelectorAll("*").forEach((t=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach((e=>t.removeAttribute(e))),Array.from(t.attributes).forEach((e=>{e.name.startsWith("on")&&t.removeAttribute(e.name)})),"A"===t.tagName||"AREA"===t.tagName){const e=t.getAttribute("href");e&&(e.startsWith("javascript:")||e.startsWith("data:"))&&t.removeAttribute("href")}if("IMG"===t.tagName||"IFRAME"===t.tagName){const e=t.getAttribute("src");e&&(e.startsWith("javascript:")||e.startsWith("data:text/html"))&&t.removeAttribute("src")}if("FORM"===t.tagName){const e=t.getAttribute("action");e&&e.startsWith("javascript:")&&t.removeAttribute("action")}})),e.body.innerHTML}(n);o?e.innerHTML+=i:e.innerHTML=i}function G(t,e){Object.keys(e).forEach((n=>{t.style[n]=e[n]}))}function z(t,e){var n,o;let i;return t.styles&&(i=null===(n=t.styles.find((t=>"label"===t.element)))||void 0===n?void 0:n.params),t.adaptiveStyles&&!i&&(i=null===(o=t.adaptiveStyles[e].find((t=>"label"===t.element)))||void 0===o?void 0:o.params),i}function Q(t,e,n,o){var i;const r=n.querySelector(o),s=z(t,e);if(!s)return;const l=n.querySelector(".label");l&&(W({element:l,html:(null===(i=t.content)||void 0===i?void 0:i.label)||""}),"TOP"===s.position?(r.style.flexDirection="column",r.style.alignItems="unset",G(l,{marginRight:"0",marginBottom:`${s.margin}px`})):(r.style.flexDirection="row",r.style.alignItems="center",G(l,{marginRight:`${s.margin}px`,marginBottom:"0"})),s.enabled?l.style.display="":l.style.display="none")}function q(t,e,n,o,i){const r=function(t,e){var n;let o;if(t.styles){const e=null===(n=t.styles.find((t=>"input"===t.element)))||void 0===n?void 0:n.styleAttributes;(null==e?void 0:e.width)&&(o=e)}if(t.adaptiveStyles&&!o){const n=t.adaptiveStyles[e].find((t=>"input"===t.element)),i=null==n?void 0:n.styleAttributes;(null==i?void 0:i.width)&&(o=i)}return o}(t,e);if(!r)return;const s=z(t,e),l=i&&s&&s.enabled&&"TOP"===s.position?i.getBoundingClientRect().height+(s.margin||0):0;r.width&&(r.width.includes("100%")?(o.style.width="100%",n.style.width=r.width):n.style.width="auto"),r.height&&(r.height.includes("100%")?(o.style.height="100%",n.style.height=r.height):n.style.height=`${parseFloat(r.height)+l}px`)}function K(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=$(o).alpha(.5).string();return t.classList.add("focus-outline-defined"),t.style.setProperty("--clFocusOutline",`3px solid ${e}`),e}return null}function Z(){return e("overlay-menu-content")}function J(t,e,n,o,i,r){const s=function(t,e,n,o,i){const r=function(t,e,n,o){const i=c.width(o),{right:r}=t.getBoundingClientRect(),s=i-n-r-c.scrollbarWidth(o);return{horizontalOffset:n,contentWidth:Y(e).width,availableSpaceToTheLeftSideOfTheTrigger:r-n,availableSpaceToTheRightSideOfTheTrigger:s}}(t,e,n,i),s=function(t,e,n,o){const i=c.height(o),{top:r,bottom:s}=t.getBoundingClientRect();return{verticalOffset:n,contentHeight:Y(e).height,availableSpaceAboveTriggerElem:r-n,availableSpaceBelowTriggerElem:i-s-n}}(t,e,n,i);let l="undefined";const a={bottom:s.availableSpaceBelowTriggerElem>=s.contentHeight,top:s.availableSpaceAboveTriggerElem>=s.contentHeight,right:r.availableSpaceToTheRightSideOfTheTrigger>=r.contentWidth,left:r.availableSpaceToTheLeftSideOfTheTrigger>=r.contentWidth};if(a.top?l="top":a.bottom?l="bottom":a.right?l="right":a.left&&(l="left"),o&&a[o]&&(l=o),"undefined"===l){const t=Math.max(s.availableSpaceBelowTriggerElem,s.availableSpaceAboveTriggerElem,r.availableSpaceToTheRightSideOfTheTrigger,r.availableSpaceToTheLeftSideOfTheTrigger);t===s.availableSpaceBelowTriggerElem?l="bottom":t===s.availableSpaceAboveTriggerElem?l="top":t===r.availableSpaceToTheRightSideOfTheTrigger?l="right":t===r.availableSpaceToTheLeftSideOfTheTrigger&&(l="left")}return Object.assign(Object.assign(Object.assign({},s),r),{position:l})}(t,e,n,o,r=r||document);return function(t,e){const{marginBottom:n,marginTop:o}=window.getComputedStyle(e);if("top"===t.position)G(e,{"margin-top":`${parseInt(o,10)+parseInt(n,10)}px`}),G(e,{"margin-bottom":"0px"});else if("bottom"===t.position)G(e,{"margin-bottom":`${parseInt(n,10)+parseInt(o,10)}px`}),G(e,{"margin-top":"0px"});else{const t=(parseInt(n,10)+parseInt(o,10))/2+"px";G(e,{"margin-top":t,"margin-bottom":t})}}(s,e),{coordinates:X(s,t.getBoundingClientRect(),e.getBoundingClientRect(),i,r),position:s.position}}function Y(t){const{width:e,height:n}=t.getBoundingClientRect(),{marginBottom:o,marginTop:i,marginLeft:r,marginRight:s}=window.getComputedStyle(t);return{width:e+parseInt(r,10)+parseInt(s,10),height:n+parseInt(i,10)+parseInt(o,10)}}function X(t,e,n,o,i){switch(t.position){case"top":return{left:`${tt(e,n,o,i)}px`,top:t.availableSpaceAboveTriggerElem-t.contentHeight-t.verticalOffset+"px"};case"bottom":return{left:`${tt(e,n,o,i)}px`,bottom:t.availableSpaceBelowTriggerElem-t.contentHeight-t.verticalOffset+"px"};case"left":return{left:t.availableSpaceToTheLeftSideOfTheTrigger-e.width-t.contentWidth-t.horizontalOffset+"px",top:`${et(0,t)}px`};case"right":return{right:t.availableSpaceToTheRightSideOfTheTrigger-t.contentWidth-t.horizontalOffset+"px",top:`${et(0,t)}px`}}}function tt(t,e,n,o){let i=n?t.x+t.width/2-e.width/2:t.x;return i<0&&(i=0),i+e.width>c.width(o)&&(i-=i+e.width-c.width(o)),i}function et(t,e){let n=e.availableSpaceAboveTriggerElem;return e.contentHeight>e.availableSpaceBelowTriggerElem&&(n-=e.contentHeight-e.availableSpaceBelowTriggerElem),n}const nt="cl-tooltip-text-styles",ot=`\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 it(t){return[t.getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter((t=>!!t))}function rt(t,e){return e.reduce(((e,n)=>{if(e)return e;const o=function(t,e){if(!t)return null;if(e[t])return{translations:e[t],language:t};const n=function(t){return t.includes("-")?t.split("-")[0].toLowerCase():t.includes("_")?t.split("_")[0].toLowerCase():t}(t);return e[n]?{translations:e[n],language:n}:null}(n,t);return o||null}),null)}const st="VIEW",lt="MODULE",at="CONTAINER",ct="INPUT",dt="BUTTON",ut="CONSENT",pt="COLUMN",ht="SUBSCRIBE_CONTACT",mt="REQUEST",gt="SHOW_WIDGET",vt="OPEN_LINK",ft="CLOSE_WIDGET";class bt{static sortActions(t){const e={[ft]:-1,[vt]:-2,[gt]:1,[ht]:2,[mt]: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=bt.sortActions(e),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(t,e,o){this.state=t;const i=o(),r=i.getAttribute(n("id"));this.listener=t=>{const e=t.composedPath().filter((t=>t instanceof HTMLElement&&t.getAttribute(n("type"))));let o=0;for(;e[o]&&e[o].getAttribute(n("id"))!==r;){let t=e[o].getAttribute(n("type"));if(bt.IGNORING_VIEW_ENTRY_TYPES.includes(t))return;o++}this.eventsQueue.push({event:t}),this.postponed||this.execute()},this.targetElements=this.config.relativeSelector?Array.from((i.shadowRoot||i).querySelectorAll(this.config.relativeSelector)):[i],this.targetElements.forEach((t=>{t.addEventListener("click",this.listener)}))}async execute(){var t,e,n,o;try{for(var i,r=!0,s=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},o("next"),o("throw"),o("return"),e[Symbol.asyncIterator]=function(){return this},e);function o(n){e[n]=t[n]&&function(e){return new Promise((function(o,i){!function(t,e,n,o){Promise.resolve(o).then((function(e){t({value:e,done:n})}),e)}(o,i,(e=t[n](e)).done,e.value)}))}}}(this.eventsQueue);!(t=(i=await s.next()).done);){o=i.value,r=!1;try{const{event:t}=o;for(const e of this.actions)if(!await e.execute(this.state.getState(),t))break}finally{r=!0}}}catch(t){e={error:t}}finally{try{r||t||!(n=s.return)||await n.call(s)}finally{if(e)throw e.error}}this.eventsQueue=[]}postpone(){this.postponed=!0}release(){this.postponed=!1,this.execute()}destroy(){this.listener&&this.targetElements.length&&(this.targetElements.forEach((t=>{t.removeEventListener("click",this.listener)})),this.targetElements=[])}}bt.IGNORING_VIEW_ENTRY_TYPES=[dt,ut,ct];const yt="CLICK",Et="COMPONENT_EVENT";class Ot{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 Ct{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 yt:return new bt(t,e);case Et:return new Ot(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class Tt{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 Rt{constructor(){this.listeners=Rt.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=Tt.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=Rt.createDefaultListenersState()}}Rt.createDefaultListenersState=()=>({"*":{}});const St=(t,e,n,o)=>{const i=EventTarget.prototype,{addEventListenerBase:r,addEventListener:s}=i;(r||s).call(t,e,n,o)};class xt{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class Nt{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===lt?Object.assign(Object.assign({},t),Nt.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})}}Nt.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"};class It extends Rt{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on("ENVIRONMENT_UPDATE",(({isMobileEnv:t})=>{this._isMobile=t,this.emit(It.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(It.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(It.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}It.changeEventName="CHANGE";class At{static set(t,e){const n=t[At.accumulatorPropertyName]||{};t[At.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[At.accumulatorPropertyName]).forEach((n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""}))}}At.accumulatorPropertyName="clStyleAttributes";const wt="CONTENT_LOCKER";class Pt{static applyHostStyles(t,e,n=null,o){var i,r,s;const l=null===(r=null===(i=null==n?void 0:n.props)||void 0===i?void 0:i.handlers)||void 0===r?void 0:r.find((t=>"CLICK"===t.type));l&&(null===(s=l.actions)||void 0===s?void 0:s.length)&&(e.style.cursor="pointer"),t!==st&&t!==at&&t!==pt||(e.style.display=o===wt&&t===st?"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 Lt{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}var _t,kt,Mt,Dt,jt,Bt,Ut;(_t||(_t={})).ACCENT="accent",(Mt=kt||(kt={})).TOP="TOP",Mt.CENTER="CENTER",Mt.BOTTOM="BOTTOM",function(t){t.LEFT="LEFT",t.CENTER="CENTER",t.RIGHT="RIGHT"}(Dt||(Dt={})),function(t){t.SLIDE_TO_TOP="SLIDE_TO_TOP",t.SLIDE_TO_BOTTOM="SLIDE_TO_BOTTOM",t.SLIDE_TO_LEFT="SLIDE_TO_LEFT",t.SLIDE_TO_RIGHT="SLIDE_TO_RIGHT"}(jt||(jt={})),function(t){t.PULSE="PULSE",t.VIBRATE="VIBRATE",t.WOBBLE="WOBBLE",t.SHAKE="SHAKE",t.JELLO="JELLO",t.BOUNCE="BOUNCE",t.BLINK="BLINK",t.FLICKER="FLICKER",t.PING="PING"}(Bt||(Bt={})),function(t){t.LEFT="LEFT",t.RIGHT="RIGHT"}(Ut||(Ut={}));class Ft{constructor(t,e,n,o,i,r){this.hostElement=e,this.documentModel=t,this.getSharedCb=n,this.getPropsCb=o,this.getEnvCb=i,this.httpClient=r,this.subscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(t){const e=String(t||"");if(e.includes("url")){const[t,n]=e.split("(")[1].split(")");return{url:t.replace(/['"]+/g,""),positionOptions:n.replace(";","")}}return{url:null,positionOptions:null}}apply(t){const e=this.getPropsCb();return e.backgroundDynamicInlineSVGElements[t].forEach((n=>{var o,i,r,s,l;const a=null===(i=null===(o=e.adaptiveStyles)||void 0===o?void 0:o[t])||void 0===i?void 0:i.find((t=>t.element===n)),c=(null===(r=e.styles)||void 0===r?void 0:r.find((t=>t.element===n)))||{},d=(null===(s=null==c?void 0:c.styleAttributes)||void 0===s?void 0:s.background)||(null===(l=null==a?void 0:a.styleAttributes)||void 0===l?void 0:l.background),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),Lt.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&&e&&(this.hostElement.style.background=this._buildBackgroundUrl(t,e))}_buildBackgroundUrl(t,e){const n=t.inlineSvgString.trim().replace(`var(--cl-schema-${_t.ACCENT})`,e[_t.ACCENT]);return`url('data:image/svg+xml,${encodeURIComponent(n)}')${t.positionOptions}`}off(){var t;null===(t=this.subscription)||void 0===t||t.off()}}const Ht=new class{execute(t,e="GET",n=null,o,i){const r={method:e,headers:Object.assign({"Content-Type":"text/plain"},o||{}),credentials:"same-origin",body:null,signal:i};return n&&(r.body="string"==typeof n?n:JSON.stringify(n)),fetch(t,r)}};function Vt(t,e){return Object.keys(t).filter((t=>!e.includes(t))).reduce(((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]})),{})}class $t{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 Wt{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 Gt="COMPONENT_RESOURCES_LOADED",zt="FAILED_TO_LOAD_COMPONENT_RESOURCE";class Qt{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(Gt,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 Wt(this.onCounterStateUpdate)}}}const qt=(...t)=>{let e=t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:[]})),{});return{get:t=>e[t],clear:()=>qt(...t)}},Kt=qt,Zt="props",Jt="shared",Yt="environment";function Xt(t,e,n,o){const i=t=>{let r=t instanceof DocumentFragment||(null==t?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?t.host:t;return r&&(o&&"function"==typeof o?o(r.getAttribute(e)):(null===(s=null==r?void 0:r.getAttribute)||void 0===s?void 0:s.call(r,e))===n)?r:r&&r.parentNode&&i(r.parentNode)||null;var s};return i(t)}const te="SUBMIT";function ee(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach((n=>{if("element"===n||"classes"===n)return;const o=e[n];o&&"object"==typeof o&&!Array.isArray(o)?t[n]=Object.assign(Object.assign({},t[n]||{}),o):t[n]=o})),t):t}class ne extends Event{constructor(t,e,n){super(t,n),this.detail={},Object.defineProperty(this,"detail",{value:e})}}const oe="STATIC",ie="UPDATING";class re extends HTMLElement{constructor(){var i,r;super(),this.construct=()=>{let t;const e=this.getAttribute(n("id")),o=this.getWidgetContainerNode();if(!o)throw new Error("Widget container not found in construct");const i=o.closest(`[${n("widget-id")}]`);let r;i&&(r=i.getAttribute(n("widget-id")));let s=new ne("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(n("path")),id:e,widgetId:r},{bubbles:!0,composed:!0});this.dispatchEvent(s),t=s.detail.props,Object.assign(this,t),this.observers=Kt(Zt,Jt,Yt),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 xt({}),this.componentEventEmitter=new Rt,this.componentResourceManager=new Qt(this.model.id,this.services.eventEmitter,this.isStaticRenderMode),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new Ct(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(Zt).forEach((e=>e(this.prevProps,t))),this.prevProps=t;const e=this.getHostElement(),o=n("floating");t.floating&&!e.getAttribute(o)?e.setAttribute(o,"true"):!t.floating&&e.getAttribute(o)&&e.removeAttribute(o)})),this.documentModel.on(`COMPONENT_UPDATE_${this.model.id}`,(t=>{Object.assign(this.model,t)})),this.documentModel.on("SHARED_UPDATE_ALL",(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles),this.observers.get(Jt).forEach((t=>t(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new Ft(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),Ht),this.colorSchemaListener.apply(this.getEnvironment()).then((()=>{this.subscriptions.push(this.colorSchemaListener.on())}))),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(It.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(Yt).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(Zt).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(Jt).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(Yt).push(t),t(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${n("element")}]`)).filter((t=>!t.hasAttribute(n("component"))))],this.getElement=(t,e)=>this.getElements().find((o=>e?o.getAttribute(n("element"))===t&&o.id===e:o.getAttribute(n("element"))===t)),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const i=this.getElements();if(!i.length)return;const r=function(t,e){if(!e)return t||{desktop:[],mobile:[]};const n=JSON.parse(JSON.stringify(t||{desktop:[],mobile:[]}));return e.forEach((t=>{const e=t.element;let o=!1,i=!1;n.desktop&&n.desktop.forEach((n=>{n.element===e&&(ee(n,t),o=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===e&&(ee(n,t),i=!0)})),!o&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(t))),!i&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(t)))})),n}(t,e),s=n("type"),l="element-styles";let a=this.getRootElement().querySelector(`style[${s}="${l}"]`);a||(a=document.createElement("style"),a.setAttribute(s,l),this.getRootElement().appendChild(a)),W({element:a,html:""}),i.forEach((t=>{let e=t.getAttribute(n("element"));const i=this.getEnvironment();let s=o(r,i,e);if(s){if(this.resizeListener.isMobile()){const t=o(r,"desktop",e);t&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},t.styleAttributes),s.styleAttributes)}))}this.applyStylesToElement(t,this.applySharedClassesToElementModel(s),a)}})),this._addLinkColor(a,this.getShared())},this.registerComponentResourceManagement=()=>{this.viewResourceManager.registerComponent(this.model.id,this.componentResourceManager)},this.applyStyles=(t,e={})=>{if(!t||!t.style)return!1;for(const[n,o]of Object.entries(e))t.style[n]=o;return!0},this.applyStylesToElement=(t,e,o)=>{var i,r;const s=[];"host"===(e=re._resolveTogglableStylesForElementModel(e)).element&&(Pt.applyHostStyles(this.model.type,t,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(i=this.model.props.backgroundDynamicInlineSVGElements)||void 0===i?void 0:i.desktop)||"mobile"===this.getEnvironment()&&(null===(r=this.model.props.backgroundDynamicInlineSVGElements)||void 0===r?void 0:r.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),s.push("background")));let l=e.styleAttributes.background,a=l&&l.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&a){this.componentResourceManager.getPending().increment();const t=new Image;t.src=a[1],St(t,"load",(()=>{this.componentResourceManager.getPending().decrement()})),St(t,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(t.src),this.isUpdatingRenderMode&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},e),{styleAttributes:Vt(e.styleAttributes,s)});if(At.set(t,c),this._setClassAttributes(t,e),o){if(e.hoverStyleAttributes){let i=Object.assign({},e.hoverStyleAttributes);if("FILL_UP"===e.hoverAnimationType){t.style.boxShadow="inset 0px 0px 0px 0px rgb(0, 0, 0, 0)",t.style.overflow="hidden";const n=t.tagName.toLowerCase(),o=`flip-up-animation-${e.element}`;let r=this.getRootElement().querySelector(`#${o}`);r||(r=document.createElement("style"),r.id=o,t.appendChild(r)),W({element:r,html:`\n ${n}::before {\n content: '';\n background: ${i.background};\n position: absolute;\n left: 0;\n top: ${t.getBoundingClientRect().height}px;\n height: ${t.getBoundingClientRect().height}px;\n width: 100%;\n z-index: -10;\n }\n ${n}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),i=Object.assign(Object.assign({},e.hoverStyleAttributes),{background:"transparent",position:"relative"})}i.borderTopWidth&&"0px"!==i.borderTopWidth||delete i.borderTopColor,i.borderBottomWidth&&"0px"!==i.borderBottomWidth||delete i.borderBottomColor,i.borderLeftWidth&&"0px"!==i.borderLeftWidth||delete i.borderLeftColor,i.borderRightWidth&&"0px"!==i.borderRightWidth||delete i.borderRightColor,this._addStylesToStyleElement(o,e.element,i,`:not(.${n("no-hover")}):hover`,!0)}e.placeholderStyleAttributes&&this._addStylesToStyleElement(o,e.element,e.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(o,this.getShared()),this.stylesAppliedToElement(t,e,o)}},this.applySharedClassesToElementModel=e=>function(e,n){let o=e;return(o.classes||"").split(" ").filter((e=>e.startsWith(t))).forEach((t=>{var e;let i=null===(e=n.textClasses)||void 0===e?void 0:e[t];i&&(i.styleAttributes.fontFamily||(i.isHeader&&n.headerFontFamily&&(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),{fontFamily:n.headerFontFamily})})),!i.isHeader&&n.textFontFamily&&(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),{fontFamily:n.textFontFamily})}))),o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),i.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},o.placeholderStyleAttributes),i.placeholderStyleAttributes)}))})),o.styleAttributes.fontFamily||(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),{fontFamily:n.textFontFamily})})),o}(e,this.documentModel.getShared()),this.getModel=()=>this.model,this._addStylesToStyleElement=(t,e,o,i="",r)=>{const s=Object.keys(o).reduce(((t,e)=>t+` ${$t.camelCaseToDashCase(e)}: ${o[e]}${r?" !important;":";"}`),"");W({element:t,html:`[${n("element")}="${e}"]${i} { ${s} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{W({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,o,i,r;e.linkColor&&W({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)&&W({element:t,html:`a {color: ${null===(o=e.linkParams)||void 0===o?void 0:o.color}}, a:visited {color: ${null===(i=e.linkParams)||void 0===i?void 0:i.color}}`,appendHtml:!0}),(null===(r=e.linkParams)||void 0===r?void 0:r.removeUnderline)&&W({element:t,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(n,o)=>{Array.from(n.classList).filter((t=>t!==e("hovered")&&t!==e("focused"))).forEach((e=>{e.startsWith(t)&&n.classList.remove(e)}));const i=((n.getAttribute("class")||"")+" "+o.classes).trim();n.setAttribute("class",i)},this.getParentComponent=()=>Xt(this.parentNode,n("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(n("path"));return t&&1===t.split(",").length?this.parentNode:Xt(this.parentNode,n("path"),void 0,(t=>t&&1===t.split(",").length))},this.getWidgetLanguages=()=>it(this.services.config),this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=t=>rt(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,o,i,r,s;const l=t.control.name;if(["email","first_name","last_name"].includes(l))return l.toUpperCase();if((null===(e=t.content)||void 0===e?void 0:e.label)&&(null===(i=null===(o=null===(n=t.adaptiveStyles)||void 0===n?void 0:n.desktop.find((t=>"label"===t.element)))||void 0===o?void 0:o.params)||void 0===i?void 0:i.enabled)){const e=(new DOMParser).parseFromString(t.content.label,"text/html");return this.capitalizeFirstLetter(e.body.textContent||"")}return(null===(r=t.content)||void 0===r?void 0:r.placeholder)?this.capitalizeFirstLetter(t.content.placeholder):(null===(s=t.control)||void 0===s?void 0:s.integrationName)?this.capitalizeFirstLetter(t.control.integrationName).replace(new RegExp("_","g")," "):void 0},this.capitalizeFirstLetter=t=>t.charAt(0).toUpperCase()+t.slice(1),this.getContextRecordExampleValue=t=>{var e;switch(null===(e=t.control)||void 0===e?void 0:e.name){case"email":return"myemail@example.com";case"first_name":return"Maria";case"last_name":return"Taylor";default:return this.getContextRecordLabel(t)}},this.completeSubmitAction=t=>{const e=t||{},n=this.services.actionRegister.getRegisteredActions().find((t=>t.category===te));n?null==n||n.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:mt}).execute(void 0,void 0,!0,e)},this.getHandlers=()=>{var t;return(null===(t=this.getProps())||void 0===t?void 0:t.handlers)&&this.getProps().handlers.length?[...this.getProps().handlers]:[]},this.assets=(t="")=>`${this.services.config.getConfig("staticResourcesUrl").replace(/\/$/,"")}/${this.manifest.name}/assets${t?`/${t}`:""}`,this.attachShadow({mode:"open"}),this.manifest=this.manifest||(null===(i=this.define)||void 0===i?void 0:i.manifest)||(null===(r=this.constructor.define)||void 0===r?void 0:r.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()}get isStaticRenderMode(){return this.services.config.getConfig("renderMode")===oe}get isUpdatingRenderMode(){return this.services.config.getConfig("renderMode")===ie}static _resolveTogglableStylesForElementModel(t){const e=Object.assign({},t);return Object.keys(e).forEach((t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=re._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 se=Symbol("required");var le=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 i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n};function ae(){}const ce="pending",de="valid",ue="invalid";class pe extends re{constructor(){super(...arguments),this._createControl=(t={},...e)=>{const{element:n}=t,o=le(t,["element"]),i=this.getProps(),r=this.getModel(),s=Object.assign(Object.assign(Object.assign({},i.control),{componentId:r.id,viewIdx:r.path[0]}),o),l=this.services.form,a=[s,n,...e];return l.hasControl(i.control.name)?l.updateControl(...a):l.registerControl(...a)},this.createControlWithValidation=(t=[],e={})=>{const{element:n=this.getElement("input"),tooltipElement:o=this.getRootElement().querySelector(".input-tooltip"),validCallback:i=ae,invalidCallback:r=ae,pendingCallback:s=ae,elementToListen:l=n,validationMap:a={},listenStatusChange:c=!0}=e,d=le(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=(null==u?void 0:u.validator)?a[u.validator]:void 0,h=t.some((t=>t[se])),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[se]=!0,e}()),p&&v.push(p);const f=this._prepareAsyncValidators(v),b=this._createControl({element:n,validation:{validator:"custom",required:g}},void 0,f);return c&&this._handleControlStatusChange(Object.assign({control:b,element:l,tooltipElement:o,configService:this.services.config,i18n:this.manifest.i18n,validCallback:i,invalidCallback:r,pendingCallback:s},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=t=>{t.control.on(l,(e=>{this._handleValidationStatus(t,e)})),t.control.on(a,(()=>{let e=ce;switch(!0){case t.control.pending:e=ce;break;case t.control.valid:e=de;break;default:e=ue}this._handleValidationStatus(t,e)}))},this._handleValidationStatus=(t,e)=>{const{control:n,element:o,tooltipElement:i,validCallback:r,invalidCallback:s,errorMessageMapper:l,pendingCallback:a}=t,c=this.services.config,d=this.manifest.i18n;switch(e){case de:(function(t,e){t.classList.remove("invalid"),e&&(e.style.visibility="hidden")})(o,i),r&&r();break;case ue:if(n.touched){const t=n.getErrorKeys();if(!t)break;const e=t[0];let r=function(t,e,n){const o=rt(e,it(t));if(!o)return n;const i=o.translations,r=Object.keys(i).find((t=>t.includes(n)));return r?i[r]:n}(c,d,e);l&&(r=l(e,r)),function(t,e,n,o){o=o||document;let i=null;t.classList.add("invalid"),e&&(e.style.visibility="visible"),e&&(e.onmouseenter=()=>{(function(t){if((t=t||document).head.querySelector(`#${nt}`))return;const e=document.createElement("style");e.setAttribute("id",nt),W({element:e,html:ot}),t.head.appendChild(e)})(o),i=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(i),i.style.visibility="visible",function(t){const{triggerElement:e,tooltipElement:n,offset:o=10,htmlDocumentObject:i}=t,r=J(e,n,o,"top",!0,i);n.setAttribute("cl-tooltip-position",r.position),G(n,r.coordinates)}({triggerElement:e,tooltipElement:i,htmlDocumentObject:o})},e.onmouseleave=()=>{i&&(i.remove(),function(t){const e=(t=t||document).head.querySelector(`#${nt}`);e&&e.remove()}(o))})}(o,i,r,this.htmlDocumentObject),s&&s()}break;case ce:n.touched&&(function(t,e){e&&(e.style.visibility="hidden"),t.classList.contains("invalid")&&t.classList.remove("invalid")}(o,i),a&&a())}}}}function he(t){return he="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},he(t)}function me(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,ve(o.key),o)}}function ge(t,e,n){return(e=ve(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ve(t){var e=function(t){if("object"!=he(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=he(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==he(e)?e:e+""}var fe=function(){return t=function t(e,n,o,i,r,s){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),ge(this,"getRootElement",null),ge(this,"overlayElement",null),ge(this,"configService",null),ge(this,"stateService",null),ge(this,"valueChangedCallback",null),this.getRootElement=e,this.getElement=n,this.configService=o,this.stateService=i,this.valueChangedCallback=r,this.htmlDocumentObject=s},e=[{key:"createOverlay",value:function(t){var e,n,o=this,i=this.getRootElement();!function(t){const{triggerElement:e,overlayStyles:n,createOverlayContent:o,overlayWidth:i,overlayHeight:r,offset:s,onDestroy:l,positionByDefault:a,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),i&&(h.style.width=`${i}px`),r&&(h.style.height=`${r}px`);const m=h.attachShadow({mode:"open"}),g=document.createElement("style");W({element:g,html:n}),m.append(g);const v=document.createElement("div");v.classList.add(Z()),u.body.append(p),u.body.append(h),m.append(v),o(p,v),(()=>{const t=J(e,v,function(t){return null!=t?t:5}(s),a,c,u);(function(t,e){t.setAttribute("cl-overlay-position",e)})(v,t.position),G(h,t.coordinates)})(),h.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault()}));const f=t=>{p.remove(),h.remove(),l&&l(),window.removeEventListener("keyup",t,!0)},b=t=>{"Escape"===t.key&&(t.preventDefault(),t.stopImmediatePropagation(),f(b))};p.addEventListener("click",(()=>f(b))),window.addEventListener("keyup",b,!0)}({triggerElement:i.querySelector(".phone-input-with-tooltip"),overlayStyles:(e=Z(),n=this.configService.getConfig("staticResourcesUrl").replace(/\/$/,"")+"/SysPhoneInputComponent/assets/","\n.".concat(e," {\n width: 270px;\n max-height: 380px;\n box-shadow: 0 1px 5px rgba(0, 0, 0, 0.28);\n border-radius: 4px;\n padding: 20px 0;\n overflow: auto;\n position: absolute;\n background-color: #fff;\n}\n\n.").concat(e,"::-webkit-scrollbar {\n width: 6px;\n height: 6px;\n background-color: transparent;\n}\n\n.").concat(e,"::-webkit-scrollbar-thumb {\n border-radius: 6px;\n background-color: #848484;\n}\n\n.search-country-input-container {\n display: flex;\n align-items: center;\n padding: 0 20px 20px;\n}\n\n.option-wrapper {\n background-color: #fff;\n border: 0;\n display: flex;\n align-items: center;\n font-size: 16px;\n padding: 10px 20px;\n outline: 0;\n cursor: pointer;\n text-align: left;\n flex-direction: row;\n}\n.option-wrapper:hover {\n background-color: #fafafa;\n}\n.phone-input-flag-icon {\n background: url(").concat(n,"img/flags.png) no-repeat 0 0;\n background-size: 24px 3876px;\n background-position-x: -1px;\n min-width: 24px;\n height: 16px;\n margin: 0 5px;\n}\n.phone-input-prefix {\n margin-left: 8px;\n color: #999;\n font-size: 14px;\n}\n\n.search-country-input {\n border: 0;\n border-bottom: 1px solid #000;\n border-radius: 0;\n outline: 0;\n margin-left: 10px;\n width: 170px;\n line-height: 1.42857143;\n}\n ")),createOverlayContent:function(e,n){o.createOverlayContent(i,e,n,t),o.overlayElement=n},overlayWidth:270,overlayHeight:380,htmlDocumentObject:this.htmlDocumentObject})}},{key:"createOverlayContent",value:function(t,e,n,o){var i=this,r=this.stateService.getState().currentCountryCode,s=t.querySelector(".phone-input-select-button-flag");if(o.length>8){var l=document.createElement("div");l.classList.add("search-country-input-container");var a=document.createElement("input");a.classList.add("search-country-input"),a.addEventListener("input",(function(t){return p(t.currentTarget.value)})),l.appendChild(this.getSearchIcon()),l.appendChild(a),n.appendChild(l)}var c,d=function(t){const e=window.getComputedStyle(t);return["height","border-top-left-radius","border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius"].reduce(((t,n)=>(t[n]=e.getPropertyValue(n),t)),{})}(this.getElement("input")),u=function(t,e){return Math.min(Math.floor(parseInt(String(t))/2),parseInt(e.borderTopLeftRadius),parseInt(e.borderTopRightRadius),parseInt(e.borderBottomLeftRadius),parseInt(e.borderBottomRightRadius))}(d.height,d);G(n,{"border-top-left-radius":"".concat(u,"px"),"border-top-right-radius":"".concat(u,"px"),"border-bottom-left-radius":"".concat(u,"px"),"border-bottom-right-radius":"".concat(u,"px")});var p=function(t,e=300){let n;return function(...o){clearTimeout(n),n=setTimeout((()=>{t.apply(this,o)}),e)}}((function(t){c&&c.remove();var l=i.filterOptions(t,o);G(c=document.createElement("div"),{display:"flex",flexDirection:"column"}),l.length?l.forEach((function(t){var n=r===t.countryCode,o=i.createMenuButtonComponent(t,n);o.addEventListener("click",(function(){i.valueChangedCallback(t),s.style.backgroundPositionY="".concat(t.position,"px"),e.click()})),c.appendChild(o)})):c.appendChild(i.getNothingFoundComponent()),n.appendChild(c)}),100);p("")}},{key:"createMenuButtonComponent",value:function(t,e){var n=document.createElement("div");n.classList.add("option-wrapper");var o=document.createElement("span");o.classList.add("phone-input-flag-icon");var i=document.createElement("span");i.classList.add("phone-input-prefix");var r=document.createElement("span");return r.textContent=rt(t.label,it(this.configService)).translations,r.style.color="#000",o.style.backgroundPositionY="".concat(t.position,"px"),i.textContent=t.prefix,e&&(n.style.backgroundColor="#fafafa"),n.appendChild(o),n.appendChild(r),n.appendChild(i),n}},{key:"getNothingFoundComponent",value:function(){var t=document.createElement("p");return t.style.padding="0 20px",t.textContent="Nothing found",t}},{key:"filterOptions",value:function(t,e){var n=this,o=t.trim().toLowerCase();return o?e.filter((function(t){return rt(t.label,it(n.configService)).translations.toLowerCase().includes(o)})):e}},{key:"getSearchIcon",value:function(){var t=document.createElement("div");return W({element:t,html:'\n <svg\n width="25"\n height="24"\n viewBox="0 0 25 24"\n fill="none"\n xmlns="http://www.w3.org/2000/svg">\n <path\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M17.005 14.9871C18.9001 12.2585 18.6317 8.48222 16.1997 6.05025C13.4661 3.31658 9.03392 3.31658 6.30025\n 6.05025C3.56658 8.78392 3.56658 13.2161 6.30025 15.9497C8.73224 18.3817 12.5085 18.6501 15.2372\n 16.7549L19.1369 20.6546L20.9046 18.8868L17.005 14.9871ZM14.7855 7.46447C16.7382 9.41709 16.7382 12.5829\n 14.7855 14.5355C12.8329 16.4882 9.66709 16.4882 7.71447 14.5355C5.76184 12.5829\n 5.76184 9.41709 7.71447 7.46447C9.66709 5.51184 12.8329 5.51184 14.7855 7.46447Z"\n fill="#5F5F5F"/>\n </svg>',isSvg:!0}),t}},{key:"focusSearchInput",value:function(){var t;null===(t=this.overlayElement)||void 0===t||null===(t=t.querySelector(".search-country-input"))||void 0===t||t.focus()}}],e&&me(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function be(t){return be="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},be(t)}function ye(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,xe(o.key),o)}}function Ee(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ee=function(){return!!t})()}function Oe(t,e,n,o){var i=Ce(Te(1&o?t.prototype:t),e,n);return 2&o&&"function"==typeof i?function(t){return i.apply(n,t)}:i}function Ce(){return Ce="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var o=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Te(t)););return t}(t,e);if(o){var i=Object.getOwnPropertyDescriptor(o,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},Ce.apply(null,arguments)}function Te(t){return Te=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Te(t)}function Re(t,e){return Re=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Re(t,e)}function Se(t,e,n){return(e=xe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xe(t){var e=function(t){if("object"!=be(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=be(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==be(e)?e:e+""}var Ne=function(){function t(){var e;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return Se(e=function(t,e,n){return e=Te(e),function(t,e){if(e&&("object"==be(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,Ee()?Reflect.construct(e,n||[],Te(t).constructor):e.apply(t,n))}(this,t,[].concat(o)),"manifest",r),Se(e,"countryData",null),Se(e,"registeredControl",null),Se(e,"countryCodeSelectedAtLeastOnce",!1),Se(e,"availableOptions",[]),Se(e,"getValidators",(function(){return[function(t){return t&&t.replace(/[+()\-_ ]/g,"").match(/^\d+$/)?{isValid:!0}:{isValid:!1,errorKey:"PHONE_INVALID_NUMBER"}}]})),Se(e,"addContextRecord",(function(t){var n,o=e.getModel();e.services.context.addRecord(o.id,{recordKey:o.id,id:o.props.control.name,label:"PHONE",value:o.props.control.defaultValue||"",viewIndex:null===(n=o.path)||void 0===n?void 0:n[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:"".concat(t,"6402577610")}})})),Se(e,"updateContext",(function(){var t,n=e.getModel();e.services.context.updateRecord(n.id,{viewIndex:null===(t=n.path)||void 0===t?void 0:t[0]})})),Se(e,"requestCountryData",(function(){return fetch("".concat(e.assets("json/country-code-options.json"))).then((function(t){return t.json()}))})),Se(e,"applyParams",(function(t,n){var o=e.getRootElement().querySelector(".phone-input-select-button"),i=e.getInputElement(),r=t.adaptiveStyles[n].find((function(t){return"input"===t.element})).styleAttributes.paddingLeft||"10px";G(o,{left:r}),G(i,{paddingLeft:"".concat(parseFloat(r)+51,"px")})})),Se(e,"getInputElement",(function(){return e.getRootElement().querySelector(".phone-input")})),Se(e,"setValue",(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=e.services.state.getState().currentCountryCode||t.control.countryCode||"UA";e.services.state.setState({currentCountryCode:o});var i=e.countryData.find((function(t){return t.countryCode===o})),r=e.getRootElement(),s=e.getInputElement(),l=r.querySelector(".phone-input-select-button-flag"),a=i&&i.prefix||"+380";l.style.backgroundPositionY=i?"".concat(i.position,"px")||0:"-2721px",l.style.opacity="1",s.value=n||a,e.services.form.hasControl(t.control.name)&&e.services.form.getControl(t.control.name).setValue(n||a,{silent:!0,skipValidation:!0})})),Se(e,"getAvailableOptions",(function(t,n){return n.allowToAddOnlyFromIncludedList&&(t=n.includedList.map((function(e){var n=t.find((function(t){return t.countryCode===e}));if(!n)throw new Error("SysPhoneInputComponent: could not found ".concat(e," in options array"));return n}))),e.sortOptionsByPriority(t,n)})),Se(e,"sortOptionsByPriority",(function(t,e){return e.includedList.reverse().forEach((function(e){var n=t.findIndex((function(t){return t.countryCode===e}));if(-1===n)throw new Error("SysPhoneInputComponent: could not found ".concat(e," in options array"));var o=t[n];t.splice(n,1),t.unshift(o)})),t})),Se(e,"setArrowIconStyles",(function(){var t=e.getElement("input").style.color;e.getRootElement().querySelector(".dropdown-icon").style.color=t})),Se(e,"valueChangedCallback",(function(t){if(!e.countryCodeSelectedAtLeastOnce&&e.countryData){var n=e.getCountryOptionByValue(t);if(n){var o=e.services.state.getState().currentCountryCode;n.countryCode!==o&&(e.services.state.setState({currentCountryCode:n.countryCode}),e.getRootElement().querySelector(".phone-input-select-button-flag").style.backgroundPositionY="".concat(n.position,"px"))}}})),Se(e,"getCountryOptionByValue",(function(t){var n=t.startsWith("+")?t:"+".concat(t);return e.availableOptions.find((function(t){return n.startsWith(t.prefix)}))})),Se(e,"createPhoneInputFormControl",(function(){var t=e.getRootElement(),n=e.getInputElement(),o=t.querySelector(".phone-input-asyncLoader");e.phoneInputFormControl=e.createControlWithValidation(e.getValidators(),{validCallback:function(){return o.style.visibility="hidden"},invalidCallback:function(){return o.style.visibility="hidden"},pendingCallback:function(){return o.style.visibility="visible"}}),e.phoneInputFormControl.on("valueChanged",(function(t){e.valueChangedCallback(t)})),n.removeEventListener("input",e.createPhoneInputFormControl)})),Se(e,"menuOptionSelected",(function(t){e.phoneInputFormControl||e.createPhoneInputFormControl(),e.phoneInputFormControl.setValue(t.prefix),e.countryCodeSelectedAtLeastOnce=!0,e.services.state.setState({currentCountryCode:t.countryCode})})),e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Re(t,e)}(t,pe),e=t,n=[{key:"connectedCallback",value:function(){var e=this;Oe(t,"connectedCallback",this,3)([]),this.getRootElement().innerHTML+="\n ".concat("\n<style>\n.main-container {\n height: 100%;\n}\n\n.label-with-input-container {\n height: 100%;\n display: flex;\n}\n\n.label {\n min-height: 10px;\n}\n\n.label.cl-focused {\n min-height: auto;\n}\n\n.phone-input-with-tooltip {\n position: relative;\n display: flex;\n height: 100%;\n width: 100%;\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\ninput {\n height: 100%;\n -moz-appearance:none;\n -webkit-appearance:none;\n -o-appearance:none;\n}\n\n.phone-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 cursor: pointer;\n position: absolute;\n}\n\n.phone-input {\n height: 100%;\n padding-top: 0 !important;\n padding-bottom: 0 !important;\n margin: 0;\n text-align: start !important;\n}\n\n.phone-input-select-button-flag {\n background-repeat: no-repeat;\n background-size: 24px 3876px;\n background-position-x: -1px;\n min-width: 24px;\n width: 24px;\n height: 16px;\n margin: auto 5px auto 0;\n}\n\n.phone-input-asyncLoader {\n height: 18px;\n width: 18px;\n border-radius: 50%;\n background-color: #ffffff;\n position: absolute;\n right: -9px;\n top: -9px;\n visibility: hidden;\n}\n\n.phone-input-asyncLoader .spinner--icon {\n animation: rotates 2s linear infinite;\n z-index: 2;\n position: absolute;\n top: 50%;\n left: 50%;\n margin: -9px 0 0 -9px;\n width: 18px;\n height: 18px;\n}\n\n.phone-input-asyncLoader .spinner--icon .path {\n stroke: #9B9B9B;\n stroke-linecap: round;\n animation: dash 1.5s ease-in-out infinite;\n}\n\n.phone-input-asyncLoader .spinner--icon .path1 {\n stroke: #9B9B9B;\n stroke-linecap: round;\n animation: dash 1.25s ease-in-out infinite;\n}\n\n.phone-input-asyncLoader .spinner--icon @keyframes rotates {\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.phone-input-asyncLoader .spinner--icon @keyframes dash {\n 0% {\n stroke-dasharray: 1, 150;\n stroke-dashoffset: 0;\n }\n 50% {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -35;\n }\n 100% {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -124;\n }\n}\n\ninput {\n width: 100%;\n}\n\ninput.focus-outline-defined:focus {\n outline: var(--clFocusOutline);\n}\n</style>\n ","\n ").concat('\n<div class="main-container">\n <div class="label-with-input-container">\n <div cl-element="label"\n cl-inline-edit="content, label"\n class="label">\n </div>\n\n <div class="phone-input-with-tooltip">\n <div class="phone-input-select-button">\n <div class="phone-input-select-button-flag"></div>\n\n <svg width="11" height="7" viewBox="0 0 11 7" fill="none" xmlns="http://www.w3.org/2000/svg"\n class="dropdown-icon">\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\n <input cl-element="input"\n type="tel"\n name="phone"\n autocomplete="on"\n class="phone-input">\n\n <div class="input-tooltip">\n <svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M1.5 13.0604C1.5 19.4116 6.6481 24.5605 13.0075 24.5605C19.353 24.5605 24.5 19.4107 24.5 13.0604C24.5 6.70865 19.3531 1.55909 13.0075 1.55908C6.64806 1.55908 1.5 6.7077 1.5 13.0604ZM12.9775 17.9668C12.7032 17.9668 12.4807 17.7443 12.4807 17.47C12.4807 17.1956 12.7032 16.9732 12.9775 16.9732C13.2519 16.9732 13.4743 17.1956 13.4743 17.47C13.4743 17.7443 13.2519 17.9668 12.9775 17.9668ZM12.9775 13.4764C12.7032 13.4764 12.4807 13.254 12.4807 12.9796L12.4807 8.48924C12.4807 8.21487 12.7032 7.99245 12.9775 7.99245C13.2519 7.99245 13.4743 8.21487 13.4743 8.48924L13.4743 12.9796C13.4743 13.254 13.2519 13.4764 12.9775 13.4764Z" fill="#FF0000" stroke="white" stroke-width="2"></path>\n </svg>\n </div>\n\n <span class="phone-input-asyncLoader">\n <svg class="spinner--icon" viewBox="0 0 18 18">\n <circle class="path" cx="9" cy="9" r="5" fill="none" stroke-width="2"></circle>\n <circle class="path1" cx="9" cy="9" r="2" fill="none" stroke-width="2"></circle>\n </svg>\n </span>\n </div>\n </div>\n</div>\n ',"\n ");var n=this.getRootElement(),o=this.getInputElement(),i=n.querySelector(".phone-input-select-button-flag");i.style.opacity="0",i.style.backgroundImage="url(".concat(this.assets("img/flags.png"),")"),this.requestCountryData().then((function(t){var n,i=e.getProps();e.countryData=t;var r=e.services.state.getState().currentCountryCode||i.control.countryCode||"UA",s=i.control.countriesPriority||{includedList:[r],allowToAddOnlyFromIncludedList:!1};e.availableOptions=e.getAvailableOptions(e.countryData.slice(),s),(null===(n=e.getProps().control)||void 0===n||null===(n=n.validation)||void 0===n?void 0:n.required)?e.createPhoneInputFormControl():o.addEventListener("input",e.createPhoneInputFormControl),e.setValue(i,i.control.defaultValue||null),e.phoneInputMenu=new fe(e.getRootElement.bind(e),e.getElement.bind(e),e.services.config,e.services.state,e.menuOptionSelected.bind(e),e.htmlDocumentObject);var l=t.find((function(t){return t.countryCode===r}));e.addContextRecord((null==l?void 0:l.prefix)||"+380")})).catch((function(t){console.error("SysPhoneInputComponent: could not load country data",t),e.addContextRecord("+1")})),this.observeProps((function(t,o){var i=e.getEnvironment();e.applyAutoAdaptiveStyles(o.adaptiveStyles,o.styles),Q(o,i,n,".label-with-input-container"),q(o,i,e.getHostElement(),e.getElement("input"),e.getElement("label")),function(t){let e=null;const n=t,o=["transparent","initial"];t&&(t.style.borderColor&&!o.includes(t.style.borderColor)&&(parseFloat(t.style.borderWidth)||parseFloat(t.style.borderBottomWidth))&&(e=K(n,t,"borderColor")),!e&&t.style.getPropertyValue("--borderBottomColor")&&!o.includes(t.style.getPropertyValue("--borderBottomColor"))&&parseFloat(t.style.getPropertyValue("--borderBottomWidth"))&&(e=K(n,t,"--borderBottomColor")),e||!t.style.backgroundColor||o.includes(t.style.backgroundColor)||(e=K(n,t,"backgroundColor")),e||!t.style.color||o.includes(t.style.color)||(e=K(n,t,"color")),e||n.classList.remove("focus-outline-defined"))}(e.getElement("input")),e.applyParams(o,i),e.setArrowIconStyles(),e.updateContext()})),this.observeEnvironment((function(t,o){var i=e.getProps();e.applyParams(i,o),Q(i,o,n,".label-with-input-container"),q(i,o,e.getHostElement(),e.getElement("input"),e.getElement("label")),e.setArrowIconStyles()})),this.observeShared((function(){e.applyParams(e.getProps(),e.getEnvironment()),e.setArrowIconStyles()})),n.querySelector(".phone-input-select-button").addEventListener("click",(function(){e.countryData&&!e.isUpdatingRenderMode&&(setTimeout((function(){return e.phoneInputMenu.createOverlay(e.availableOptions)}),50),setTimeout((function(){e.phoneInputMenu.focusSearchInput()}),500))}))}},{key:"disconnectedCallback",value:function(){Oe(t,"disconnectedCallback",this,3)([]),this.services.context.deleteRecord(this.getModel().id)}}],n&&ye(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();Se(Ne,"define",{name:"sys-phone-input",model:r.name,manifest:r});export{Ne as default};window.clComponentClass_SysPhoneInputComponent=Ne;