@claspo/components 1.1.14 → 1.1.15-theme.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/SysButtonComponent/SysButtonComponent.js +1 -1
- package/SysCalendarComponent/SysCalendarComponent.js +1 -1
- package/SysCheckboxListComponent/SysCheckboxListComponent.js +1 -1
- package/SysColumnComponent/SysColumnComponent.js +1 -1
- package/SysColumnsComponent/SysColumnsComponent.js +1 -1
- package/SysConsentComponent/SysConsentComponent.js +1 -1
- package/SysContainerComponent/SysContainerComponent.js +1 -1
- package/SysCountdownTimerComponent/SysCountdownTimerComponent.js +1 -1
- package/SysDateComponent/SysDateComponent.js +1 -1
- package/SysDropdownInputComponent/SysDropdownInputComponent.js +1 -1
- package/SysImageComponent/SysImageComponent.js +1 -1
- package/SysInAppColumnsComponent/SysInAppColumnsComponent.js +1 -1
- package/SysInputComponent/SysInputComponent.js +1 -1
- package/SysPhoneInputComponent/SysPhoneInputComponent.js +1 -1
- package/SysPromoCodeComponent/SysPromoCodeComponent.js +1 -1
- package/SysRadioGroupComponent/SysRadioGroupComponent.js +1 -1
- package/SysSlideComponent/SysSlideComponent.js +1 -1
- package/SysSliderComponent/SysSliderComponent.js +1 -1
- package/SysSocialComponent/SysSocialComponent.js +1 -1
- package/SysTextAreaComponent/SysTextAreaComponent.js +1 -1
- package/SysTextComponent/SysTextComponent.js +1 -1
- package/SysVideoComponent/SysVideoComponent.js +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const t={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 s{static size(t){return{width:this.width(t),height:this.height(t)}}static width(t){return t=t||document,Math.max(t.documentElement.clientWidth,t.defaultView.innerWidth||0)}static height(t){return t=t||document,Math.max(t.documentElement.clientHeight,t.defaultView.innerHeight||0)}static scrollbarWidth(t){return(t=t||document).defaultView.innerWidth-t.documentElement.clientWidth}}var l=[];for(var a in{transparent:"#0000"})l.push(a);var c="\\s*([.\\d%]+)\\s*",d="\\("+[c,c,c]+"(?:,\\s*([.\\d]+)\\s*)?\\)",p="(?:rgb)a?",u="("+l.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(p+d,"i"),RegExp([u,"(?:#([a-f0-9]{3,8}))",p+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 b=f;var v={},y=Object.hasOwnProperty,E=Object.create(null);for(var O in v)y.call(v,O)&&(E[v[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(v,e[1])?((i=v[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=b(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=b(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 S=C,R={},T={};for(const t of Object.keys(R))T[R[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),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]},N.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 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],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]=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=S.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 S.to?this:this.rgb();e=e.round("number"==typeof t?t:1);const n=1===e.valpha?e.color:[...e.color,this.valpha];return S.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){const i=n.querySelector(o),r=W(t,e);if(!r)return;const s=n.querySelector(".label");H({element:s,html:t.content.label}),"TOP"===r.position?(i.style.flexDirection="column",i.style.alignItems="unset",V(s,{marginRight:0,marginBottom:`${r.margin}px`})):(i.style.flexDirection="row",i.style.alignItems="center",V(s,{marginRight:`${r.margin}px`,marginBottom:0})),r.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)).styleAttributes;(null==n?void 0:n.width)&&(o=n)}return o}(t,e);if(!r)return;const s=W(t,e),l=i&&s&&s.enabled&&"TOP"===s.position?i.getBoundingClientRect().height+s.margin:0;r.width&&(r.width.includes("100%")?(o.style.width="100%",n.style.width=r.width):n.style.width="auto"),r.height&&(r.height.includes("100%")?(o.style.height="100%",n.style.height=r.height):n.style.height=`${parseFloat(r.height)+l}px`)}function G(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 l=function(t,e,n,o,i){const r=function(t,e,n,o){const i=s.width(o),{right:r}=t.getBoundingClientRect(),l=i-n-r-s.scrollbarWidth(o);return{horizontalOffset:n,contentWidth:K(e).width,availableSpaceToTheLeftSideOfTheTrigger:r-n,availableSpaceToTheRightSideOfTheTrigger:l}}(t,e,n,i),l=function(t,e,n,o){const i=s.height(o),{top:r,bottom:l}=t.getBoundingClientRect();return{verticalOffset:n,contentHeight:K(e).height,availableSpaceAboveTriggerElem:r-n,availableSpaceBelowTriggerElem:i-l-n}}(t,e,n,i);let a="undefined";const c={bottom:l.availableSpaceBelowTriggerElem>=l.contentHeight,top:l.availableSpaceAboveTriggerElem>=l.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"),c[o]&&(a=o),"undefined"===a){const t=Math.max(l.availableSpaceBelowTriggerElem,l.availableSpaceAboveTriggerElem,r.availableSpaceToTheRightSideOfTheTrigger,r.availableSpaceToTheLeftSideOfTheTrigger);t===l.availableSpaceBelowTriggerElem?a="bottom":t===l.availableSpaceAboveTriggerElem?a="top":t===r.availableSpaceToTheRightSideOfTheTrigger?a="right":t===r.availableSpaceToTheLeftSideOfTheTrigger&&(a="left")}return Object.assign(Object.assign(Object.assign({},l),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})}}(l,e),{coordinates:Z(l,t.getBoundingClientRect(),e.getBoundingClientRect(),i,r),position:l.position}}function K(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 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>s.width(o)&&(i-=i+e.width-s.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",st="INPUT",lt="BUTTON",at="CONSENT",ct="COLUMN",dt="SUBSCRIBE_CONTACT",pt="REQUEST",ut="SHOW_WIDGET",ht="OPEN_LINK",mt="CLOSE_WIDGET";class gt{static sortActions(t){const e={[mt]:-1,[ht]:-2,[ut]:1,[dt]:2,[pt]: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,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=[])}}gt.IGNORING_VIEW_ENTRY_TYPES=[lt,at,st];const ft="CLICK",bt="COMPONENT_EVENT";class vt{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 bt:return new vt(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{addEventListenerBase:i,addEventListener:r}=EventTarget.prototype;(i||r).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 St{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===it?Object.assign(Object.assign({},t),St.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})}}St.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"};class Rt 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(Rt.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(Rt.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(Rt.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}Rt.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,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!==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,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),p=this.parseBackground(d);p.url&&this.envUrlMaps[t].set(n,{originalSVGResourceURL:p.url,inlineSvgString:null,positionOptions:p.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&&(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,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===(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 $t="SUBMIT";function zt(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach((n=>{"element"!==n&&"classes"!==n&&(e[n]&&"object"==typeof e[n]&&!Array.isArray(e[n])?t[n]=Object.assign(Object.assign({},t[n]||{}),e[n]):t[n]=e[n])})),t):t}function Gt(t,e,n){var o;return null===(o=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})}}class qt 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 s=new Qt("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(r("path")),id:e,widgetId:i},{bubbles:!0,composed:!0});this.dispatchEvent(s),t=s.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,"STATIC"===this.services.config.getConfig("entryModuleType")),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(Rt.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;t=function(t,e){if(!e)return t||{desktop:[],mobile:[]};const n=JSON.parse(JSON.stringify(t||{desktop:[],mobile:[]}));return e.forEach((t=>{const e=t.element;let o=!1,i=!1;n.desktop&&n.desktop.forEach((n=>{n.element===e&&(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);const o=r("type"),i="element-styles";let s=this.getRootElement().querySelector(`style[${o}="${i}"]`);s||(s=document.createElement("style"),s.setAttribute(o,i),this.getRootElement().appendChild(s)),H({element:s,html:""}),n.forEach((e=>{let n=e.getAttribute(r("element"));const o=this.getEnvironment();let i=Gt(t,o,n);if(i){if(this.resizeListener.isMobile()){const e=Gt(t,"desktop",n);e&&(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},e.styleAttributes),i.styleAttributes)}))}this.applyStylesToElement(e,this.applySharedClassesToElementModel(i),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 s=[];"host"===(e=qt._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()),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],Ct(t,"load",(()=>{this.componentResourceManager.getPending().decrement()})),Ct(t,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(t.src),"UPDATING"===this.services.config.getConfig("entryModuleType")&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},e),{styleAttributes:Lt(e.styleAttributes,s)});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._fixMarginOverflow=t=>{const e=this.getParentComponent(),n=e&&("flex"===e.style.display||"inline-flex"===e.style.display),o="host",i=t.getAttribute(r("element"))===o;if(!n||!i)return;const s=this.getProps(),l=this.getEnvironment(),{styleAttributes:a}=Gt(s.adaptiveStyles,l,o)||{};if(!a)return;const c=a.marginLeft||a.marginRight,d="100%"===a.width;if(c&&d){const e=(parseFloat(a.marginLeft)||0)+(parseFloat(a.marginRight)||0);e&&setTimeout((()=>{t.style.width=`calc(100% - ${e}px)`}))}},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 s=Object.keys(n).reduce(((t,e)=>t+` ${kt.camelCaseToDashCase(e)}: ${n[e]}${i?" !important;":";"}`),"");H({element:t,html:`[${r("element")}="${e}"]${o} { ${s} }`,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;const o=t.control.name;if(["email","first_name","last_name"].includes(o))return o.toUpperCase();if(t.content.label&&(null===(n=null===(e=t.adaptiveStyles.desktop.find((t=>"label"===t.element)))||void 0===e?void 0:e.params)||void 0===n?void 0:n.enabled)){const e=(new DOMParser).parseFromString(t.content.label,"text/html");return this.capitalizeFirstLetter(e.body.textContent||"")}return t.content.placeholder?this.capitalizeFirstLetter(t.content.placeholder):t.control.integrationName?this.capitalizeFirstLetter(t.control.integrationName).replace(new RegExp("_","g")," "):void 0},this.capitalizeFirstLetter=t=>t.charAt(0).toUpperCase()+t.slice(1),this.getContextRecordExampleValue=t=>{switch(t.control.name){case"email":return"myemail@example.com";case"first_name":return"Maria";case"last_name":return"Taylor";default:return this.getContextRecordLabel(t)}},this.completeSubmitAction=t=>{const e=t||{},n=this.services.actionRegister.getRegisteredActions().find((t=>t.category===$t));n?null==n||n.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:pt}).execute(void 0,void 0,!0,e)},this.getHandlers=()=>this.getProps().handlers&&this.getProps().handlers.length?[...this.getProps().handlers]:[],this.assets=(t="")=>`${this.services.config.getConfig("staticResourcesUrl").replace(/\/$/,"")}/${this.manifest.name}/assets${t?`/${t}`:""}`,this.attachShadow({mode:"open"}),this.manifest=this.manifest||(null===(t=this.define)||void 0===t?void 0:t.manifest)||(null===(e=this.constructor.define)||void 0===e?void 0:e.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then((()=>{this.attachHandlers()}))}disconnectedCallback(){var t;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(t=this.mergeTagsProcessor)||void 0===t||t.destroy()}static _resolveTogglableStylesForElementModel(t){const e=Object.assign({},t);return Object.keys(e).forEach((t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=qt._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 Kt=Symbol("required");var Zt=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 Yt(){}const Jt="pending",Xt="valid",te="invalid";class ee extends qt{constructor(){super(...arguments),this._createControl=(t={},...e)=>{var{element:n}=t,o=Zt(t,["element"]);const i=this.getProps(),r=this.getModel(),s=Object.assign(Object.assign(Object.assign({},i.control),{componentId:r.id,viewIdx:r.path[0]}),o),l=this.services.form,a=[s,n,...e];return l.hasControl(i.control.name)?l.updateControl(...a):l.registerControl(...a)},this.createControlWithValidation=(t=[],e={})=>{var{element:n=this.getElement("input"),tooltipElement:o=this.getRootElement().querySelector(".input-tooltip"),validCallback:i=Yt,invalidCallback:r=Yt,pendingCallback:s=Yt,elementToListen:l=n,validationMap:a={},listenStatusChange:c=!0}=e,d=Zt(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 p=this.getProps().control.validation,u=a[null==p?void 0:p.validator],h=t.some((t=>t[Kt])),m=!!(null==p?void 0:p.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[Kt]=!0,e}()),u&&f.push(u);const b=this._prepareAsyncValidators(f),v=this._createControl({element:n,validation:{validator:"custom",required:g}},void 0,b);return c&&this._handleControlStatusChange(Object.assign({control:v,element:l,tooltipElement:o,configService:this.services.config,i18n:this.manifest.i18n,validCallback:i,invalidCallback:r,pendingCallback:s},d)),v},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=Jt;switch(!0){case t.control.pending:e=Jt;break;case t.control.valid:e=Xt;break;default:e=te}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 Xt:(function(t,e){t.classList.remove("invalid"),e.style.visibility="hidden"})(o,i),r&&r();break;case te: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)).translations,i=Object.keys(o).find((t=>t.includes(n)));return i?o[i]:n}(c,d,e);l&&(r=l(e,r)),function(t,e,n,o){let i;o=o||document,t.classList.add("invalid"),e.style.visibility="visible",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),s&&s()}break;case Jt:n.touched&&(function(t,e){e.style.visibility="hidden",t.classList.contains("invalid")&&t.classList.remove("invalid")}(o,i),a&&a())}}}}function ne(t){return ne="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},ne(t)}function oe(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,re(o.key),o)}}function ie(t,e,n){return(e=re(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function re(t){var e=function(t){if("object"!=ne(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ne(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ne(e)?e:e+""}var se=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),ie(this,"getRootElement",null),ie(this,"overlayElement",null),ie(this,"configService",null),ie(this,"stateService",null),ie(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,p=t.htmlDocumentObject||document,u=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()),p.body.append(u),p.body.append(h),m.append(f),o(u,f),(()=>{const t=q(e,f,function(t){return null!=t?t:5}(s),a,c,p);(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 b=t=>{u.remove(),h.remove(),l&&l(),window.removeEventListener("keyup",t,!0)},v=t=>{"Escape"===t.key&&(t.preventDefault(),t.stopImmediatePropagation(),b(v))};u.addEventListener("click",(()=>b(v))),window.addEventListener("keyup",v,!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,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 m(t.currentTarget.value)})),l.appendChild(this.getSearchIcon()),l.appendChild(a),n.appendChild(l)}var c,d,p,u=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=u.height,d=u,Math.min(Math.floor(parseInt(c)/2),parseInt(d["border-top-left-radius"]),parseInt(d["border-top-right-radius"]),parseInt(d["border-bottom-left-radius"]),parseInt(d["border-bottom-right-radius"])));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(...o)=>{clearTimeout(n),n=setTimeout((()=>{t.apply(this,o)}),e)}}((function(t){p&&p.remove();var l=i.filterOptions(t,o);V(p=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()})),p.appendChild(o)})):p.appendChild(i.getNothingFoundComponent()),n.appendChild(p)}),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&&oe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function le(t){return le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},le(t)}function ae(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,ge(o.key),o)}}function ce(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ce=function(){return!!t})()}function de(t,e,n,o){var i=pe(ue(1&o?t.prototype:t),e,n);return 2&o&&"function"==typeof i?function(t){return i.apply(n,t)}:i}function pe(){return pe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var o=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ue(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}},pe.apply(null,arguments)}function ue(t){return ue=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ue(t)}function he(t,e){return he=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},he(t,e)}function me(t,e,n){return(e=ge(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ge(t){var e=function(t){if("object"!=le(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=le(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==le(e)?e:e+""}var fe=function(){function e(){var n;!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 me(n=function(t,e,n){return e=ue(e),function(t,e){if(e&&("object"==le(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ce()?Reflect.construct(e,n||[],ue(t).constructor):e.apply(t,n))}(this,e,[].concat(i)),"manifest",t),me(n,"countryData",null),me(n,"registeredControl",null),me(n,"countryCodeSelectedAtLeastOnce",!1),me(n,"availableOptions",[]),me(n,"getValidators",(function(){return[function(t){return t&&t.replace(/[+()\-_ ]/g,"").match(/^\d+$/)?{isValid:!0}:{isValid:!1,errorKey:"PHONE_INVALID_NUMBER"}}]})),me(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")}})})),me(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]})})),me(n,"requestCountryData",(function(){return fetch("".concat(n.assets("json/country-code-options.json"))).then((function(t){return t.json()}))})),me(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")})})),me(n,"getInputElement",(function(){return n.getRootElement().querySelector(".phone-input")})),me(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(),s=n.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=e||a,n.services.form.hasControl(t.control.name)&&n.services.form.getControl(t.control.name).setValue(e||a,{silent:!0,skipValidation:!0})})),me(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)})),me(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})),me(n,"setArrowIconStyles",(function(){var t=n.getElement("input").style.color;n.getRootElement().querySelector(".dropdown-icon").style.color=t})),me(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"))}}})),me(n,"getCountryOptionByValue",(function(t){var e=t.startsWith("+")?t:"+".concat(t);return n.availableOptions.find((function(t){return e.startsWith(t.prefix)}))})),me(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)})),me(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&&he(t,e)}(e,ee),n=e,o=[{key:"connectedCallback",value:function(){var t=this;de(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",s=i.control.countriesPriority||{includedList:[r],allowToAddOnlyFromIncludedList:!1};t.availableOptions=t.getAvailableOptions(t.countryData.slice(),s),(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 se(t.getRootElement.bind(t),t.getElement.bind(t),t.services.config,t.services.state,t.menuOptionSelected.bind(t),t.htmlDocumentObject);var l=e.find((function(t){return t.countryCode===r}));t.addContextRecord((null==l?void 0:l.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;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&&"UPDATING"!==t.services.config.getConfig("entryModuleType")&&(setTimeout((function(){return t.phoneInputMenu.createOverlay(t.availableOptions)}),50),setTimeout((function(){t.phoneInputMenu.focusSearchInput()}),500))}))}},{key:"disconnectedCallback",value:function(){de(e,"disconnectedCallback",this,3)([]),this.services.context.deleteRecord(this.getModel().id)}}],o&&ae(n.prototype,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o}();me(fe,"define",{name:"sys-phone-input",model:t.name,manifest:t});export{fe as default};window.clComponentClass_SysPhoneInputComponent=fe;
|
|
1
|
+
const t={DESKTOP:"desktop",MOBILE:"mobile"},e="cl-";function n(t){return e+t}function o(t){return"cl-"+t}function i(t,e,n){var o;return null===(o=t[e])||void 0===o?void 0:o.find((t=>t.element===n))}function r(t=[]){return t.map((t=>Object.assign(Object.assign({},t),{styleAttributes:Object.assign({},t.styleAttributes)})))}const s={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:(l=[{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(t).reduce(((t,e)=>Object.assign(t,{[e]:r(l)})),{[t.DESKTOP]:[],[t.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 l;const a="validationStatusChanged",c="touchedStatusChanged";class d{static size(t){return{width:this.width(t),height:this.height(t)}}static width(t){return t=t||document,Math.max(t.documentElement.clientWidth,t.defaultView.innerWidth||0)}static height(t){return t=t||document,Math.max(t.documentElement.clientHeight,t.defaultView.innerHeight||0)}static scrollbarWidth(t){return(t=t||document).defaultView.innerWidth-t.documentElement.clientWidth}}var u=[];for(var p in{transparent:"#0000"})u.push(p);var h="\\s*([.\\d%]+)\\s*",m="\\("+[h,h,h]+"(?:,\\s*([.\\d]+)\\s*)?\\)",g="(?:rgb)a?",f="("+u.join("|")+")";function b(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}RegExp(g+m,"i"),RegExp([f,"(?:#([a-f0-9]{3,8}))",g+m,"(?:hsl)a?"+m].join("|"),"gi");var v=Array.prototype.concat,y=Array.prototype.slice,E=function(t){for(var e=[],n=0,o=t.length;n<o;n++){var i=t[n];b(i)?e=v.call(e,y.call(i)):e.push(i)}return e};E.wrap=function(t){return function(){return t(E(arguments))}};const O=E;var C={},x=Object.hasOwnProperty,S=Object.create(null);for(var R in C)x.call(C,R)&&(S[C[R]]=R);var T={to:{},get:{}};function N(t,e,n){return Math.min(Math.max(e,t),n)}T.get=function(t){var e,n;return"hsl"===t.substring(0,3).toLowerCase()?(e=T.get.hsl(t),n="hsl"):(e=T.get.rgb(t),n="rgb"),e?{model:n,value:e}:null},T.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]:x.call(C,e[1])?((i=C[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]=N(i[n],0,255);return i[3]=N(i[3],0,1),i},T.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,N(parseFloat(e[2]),0,100),N(parseFloat(e[3]),0,100),N(isNaN(n)?1:n,0,1)]}return null},T.to.rgb=function(){var t=O(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]+")"},T.to.hsl=function(){var t=O(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 A=T,w={},I={};for(const t of Object.keys(w))I[w[t]]=t;const P={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"}};Math.pow(6/29,3);for(const t of Object.keys(P)){if(!("channels"in P[t]))throw new Error("missing channels property: "+t);if(!("labels"in P[t]))throw new Error("missing channel labels property: "+t);if(P[t].labels.length!==P[t].channels)throw new Error("channel and label counts mismatch: "+t);const{channels:e,labels:n}=P[t];delete P[t].channels,delete P[t].labels,Object.defineProperty(P[t],"channels",{value:e}),Object.defineProperty(P[t],"labels",{value:n})}P.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]},P.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 L=P;function k(t,e){return function(n){return e(t(n))}}function _(t,e){const n=[e[t].parent,t];let o=L[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)n.unshift(e[i].parent),o=k(L[e[i].parent][i],o),i=e[i].parent;return o.conversion=n,o}const M={};Object.keys(L).forEach((t=>{M[t]={},Object.defineProperty(M[t],"channels",{value:L[t].channels}),Object.defineProperty(M[t],"labels",{value:L[t].labels});const e=function(t){const e=function(t){const e=function(){const t={},e=Object.keys(L);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(L[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];M[t][n]=function(t){const e=function(...e){const n=e[0];if(null==n)return n;n.length>1&&(e=n);const o=t(e);if("object"==typeof o)for(let t=o.length,e=0;e<t;e++)o[e]=Math.round(o[e]);return o};return"conversion"in t&&(e.conversion=t.conversion),e}(o),M[t][n].raw=function(t){const e=function(...e){const n=e[0];return null==n?n:(n.length>1&&(e=n),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(o)}))}));const j=M,D=["keyword","gray","hex"],U={};for(const t of Object.keys(j))U[[...j[t].labels].sort().join("")]=t;const B={};function F(t,e){if(!(this instanceof F))return new F(t,e);if(e&&e in D&&(e=null),e&&!(e in j))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 F)this.model=t.model,this.color=[...t.color],this.valpha=t.valpha;else if("string"==typeof t){const e=A.get(t);if(null===e)throw new Error("Unable to parse color from string: "+t);this.model=e.model,o=j[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=j[this.model].channels;const n=Array.prototype.slice.call(t,0,o);this.color=$(n,o),this.valpha="number"==typeof t[o]?t[o]:1}else if("number"==typeof t)this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;const e=Object.keys(t);"alpha"in t&&(e.splice(e.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);const o=e.sort().join("");if(!(o in U))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=U[o];const{labels:i}=j[this.model],r=[];for(n=0;n<i.length;n++)r.push(t[i[n]]);this.color=$(r)}if(B[this.model])for(o=j[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)}F.prototype={toString(){return this.string()},string(t){let e=this.model in A.to?this:this.rgb();e=e.round("number"==typeof t?t:1);const n=1===e.valpha?e.color:[...e.color,this.valpha];return A.to[e.model](n)},round(t){return t=Math.max(t||0,0),new F([...this.color.map(V(t)),this.valpha],this.model)},alpha(t){return void 0!==t?new F([...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(j)){if(D.includes(t))continue;const{channels:e}=j[t];F.prototype[t]=function(...e){return this.model===t?new F(this):e.length>0?new F(e,t):new F([...H(j[this.model][t].raw(this.color)),this.valpha],t)},F[t]=function(...n){let o=n[0];return"number"==typeof o&&(o=$(n,e)),new F(o,t)}}function V(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 $(t,e){for(let n=0;n<e;n++)"number"!=typeof t[n]&&(t[n]=0);return t}const W=F;function z(t){const{element:e,html:n,appendHtml:o}=t,i=function(t){if(null==t)return"";if("string"!=typeof t)return String(t);if(""===t)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(t))return t;const e=(new DOMParser).parseFromString(t,"text/html");return e.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach((t=>t.remove())),e.querySelectorAll("*").forEach((t=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach((e=>t.removeAttribute(e))),Array.from(t.attributes).forEach((e=>{e.name.startsWith("on")&&t.removeAttribute(e.name)})),"A"===t.tagName||"AREA"===t.tagName){const e=t.getAttribute("href");e&&(e.startsWith("javascript:")||e.startsWith("data:"))&&t.removeAttribute("href")}if("IMG"===t.tagName||"IFRAME"===t.tagName){const e=t.getAttribute("src");e&&(e.startsWith("javascript:")||e.startsWith("data:text/html"))&&t.removeAttribute("src")}if("FORM"===t.tagName){const e=t.getAttribute("action");e&&e.startsWith("javascript:")&&t.removeAttribute("action")}})),e.body.innerHTML}(n);o?e.innerHTML+=i:e.innerHTML=i}function G(t,e){Object.keys(e).forEach((n=>{t.style[n]=e[n]}))}function Q(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){const i=n.querySelector(o),r=Q(t,e);if(!r)return;const s=n.querySelector(".label");z({element:s,html:t.content.label}),"TOP"===r.position?(i.style.flexDirection="column",i.style.alignItems="unset",G(s,{marginRight:0,marginBottom:`${r.margin}px`})):(i.style.flexDirection="row",i.style.alignItems="center",G(s,{marginRight:`${r.margin}px`,marginBottom:0})),r.enabled?s.style.display="":s.style.display="none"}function K(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)).styleAttributes;(null==n?void 0:n.width)&&(o=n)}return o}(t,e);if(!r)return;const s=Q(t,e),l=i&&s&&s.enabled&&"TOP"===s.position?i.getBoundingClientRect().height+s.margin:0;r.width&&(r.width.includes("100%")?(o.style.width="100%",n.style.width=r.width):n.style.width="auto"),r.height&&(r.height.includes("100%")?(o.style.height="100%",n.style.height=r.height):n.style.height=`${parseFloat(r.height)+l}px`)}function Z(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=W(o).alpha(.5).string();return t.classList.add("focus-outline-defined"),t.style.setProperty("--clFocusOutline",`3px solid ${e}`),e}return null}function Y(){return n("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=d.width(o),{right:r}=t.getBoundingClientRect(),s=i-n-r-d.scrollbarWidth(o);return{horizontalOffset:n,contentWidth:X(e).width,availableSpaceToTheLeftSideOfTheTrigger:r-n,availableSpaceToTheRightSideOfTheTrigger:s}}(t,e,n,i),s=function(t,e,n,o){const i=d.height(o),{top:r,bottom:s}=t.getBoundingClientRect();return{verticalOffset:n,contentHeight:X(e).height,availableSpaceAboveTriggerElem:r-n,availableSpaceBelowTriggerElem:i-s-n}}(t,e,n,i);let l="undefined";const a={bottom:s.availableSpaceBelowTriggerElem>=s.contentHeight,top:s.availableSpaceAboveTriggerElem>=s.contentHeight,right:r.availableSpaceToTheRightSideOfTheTrigger>=r.contentWidth,left:r.availableSpaceToTheLeftSideOfTheTrigger>=r.contentWidth};if(a.top?l="top":a.bottom?l="bottom":a.right?l="right":a.left&&(l="left"),a[o]&&(l=o),"undefined"===l){const t=Math.max(s.availableSpaceBelowTriggerElem,s.availableSpaceAboveTriggerElem,r.availableSpaceToTheRightSideOfTheTrigger,r.availableSpaceToTheLeftSideOfTheTrigger);t===s.availableSpaceBelowTriggerElem?l="bottom":t===s.availableSpaceAboveTriggerElem?l="top":t===r.availableSpaceToTheRightSideOfTheTrigger?l="right":t===r.availableSpaceToTheLeftSideOfTheTrigger&&(l="left")}return Object.assign(Object.assign(Object.assign({},s),r),{position:l})}(t,e,n,o,r=r||document);return function(t,e){const{marginBottom:n,marginTop:o}=window.getComputedStyle(e);if("top"===t.position)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:tt(s,t.getBoundingClientRect(),e.getBoundingClientRect(),i,r),position:s.position}}function X(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 tt(t,e,n,o,i){switch(t.position){case"top":return{left:`${et(e,n,o,i)}px`,top:t.availableSpaceAboveTriggerElem-t.contentHeight-t.verticalOffset+"px"};case"bottom":return{left:`${et(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:`${nt(0,t)}px`};case"right":return{right:t.availableSpaceToTheRightSideOfTheTrigger-t.contentWidth-t.horizontalOffset+"px",top:`${nt(0,t)}px`}}}function et(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>d.width(o)&&(i-=i+e.width-d.width(o)),i}function nt(t,e){let n=e.availableSpaceAboveTriggerElem;return e.contentHeight>e.availableSpaceBelowTriggerElem&&(n-=e.contentHeight-e.availableSpaceBelowTriggerElem),n}const ot="cl-tooltip-text-styles",it=`\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 rt(t){return[t.getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter((t=>!!t))}function st(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 lt="VIEW",at="MODULE",ct="CONTAINER",dt="INPUT",ut="BUTTON",pt="CONSENT",ht="COLUMN",mt="SUBSCRIBE_CONTACT",gt="REQUEST",ft="SHOW_WIDGET",bt="OPEN_LINK",vt="CLOSE_WIDGET";class yt{static sortActions(t){const e={[vt]:-1,[bt]:-2,[ft]:1,[mt]:2,[gt]: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=yt.sortActions(e),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(t,e,n){this.state=t;const i=n(),r=i.getAttribute(o("id"));this.listener=t=>{const e=t.composedPath().filter((t=>t instanceof HTMLElement&&t.getAttribute(o("type"))));let n=0;for(;e[n]&&e[n].getAttribute(o("id"))!==r;){let t=e[n].getAttribute(o("type"));if(yt.IGNORING_VIEW_ENTRY_TYPES.includes(t))return;n++}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=[])}}yt.IGNORING_VIEW_ENTRY_TYPES=[ut,pt,dt];const Et="CLICK",Ot="COMPONENT_EVENT";class Ct{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 xt{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 Et:return new yt(t,e);case Ot:return new Ct(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class St{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=St.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 Tt=(t,e,n,o)=>{const{addEventListenerBase:i,addEventListener:r}=EventTarget.prototype;(i||r).call(t,e,n,o)};class Nt{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class At{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===at?Object.assign(Object.assign({},t),At.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})}}At.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"};class wt 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(wt.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(wt.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(wt.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}wt.changeEventName="CHANGE";class It{static set(t,e){const n=t[It.accumulatorPropertyName]||{};t[It.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[It.accumulatorPropertyName]).forEach((n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""}))}}It.accumulatorPropertyName="clStyleAttributes";const Pt="CONTENT_LOCKER";class Lt{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!==lt&&t!==ct&&t!==ht||(e.style.display=o===Pt&&t===lt?"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 kt{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class _t{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),kt.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${t}`)}))}on(){return this.subscription=this.documentModel.on("THEME_UPDATE",(t=>{this._applyHostElementBackground(this.envUrlMaps[this.getEnvCb()].get("host"),t.schema)})),this}_applyHostElementBackground(t,e={}){t&&(this.hostElement.style.background=this._buildBackgroundUrl(t,e))}_buildBackgroundUrl(t,e){const n=t.inlineSvgString.trim().replace("var(--cl-schema-accent)",e.accent);return`url('data:image/svg+xml,${encodeURIComponent(n)}')${t.positionOptions}`}}const Mt=new class{execute(t,e,n=null,o,i){const r={method:e,headers:Object.assign({"Content-Type":"text/plain"},o||{}),credentials:"same-origin",body:null,signal:i};return n&&(r.body="string"==typeof n?n:JSON.stringify(n)),fetch(t,r)}};function jt(t,e){return Object.keys(t).filter((t=>!e.includes(t))).reduce(((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]})),{})}class Dt{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 Ut{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 Bt="COMPONENT_RESOURCES_LOADED",Ft="FAILED_TO_LOAD_COMPONENT_RESOURCE";class Vt{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(Bt,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(Ft,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=n,this.counters={pending:new Ut(this.onCounterStateUpdate)}}}const Ht=(...t)=>{let e=t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:[]})),{});return{get:t=>e[t],clear:()=>Ht(...t)}},$t=Ht,Wt="props",zt="shared",Gt="environment";function Qt(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 qt="SUBMIT";function Kt(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach((n=>{"element"!==n&&"classes"!==n&&(e[n]&&"object"==typeof e[n]&&!Array.isArray(e[n])?t[n]=Object.assign(Object.assign({},t[n]||{}),e[n]):t[n]=e[n])})),t):t}class Zt extends Event{constructor(t,e,n){super(t,n),this.detail={},Object.defineProperty(this,"detail",{value:e})}}class Yt extends HTMLElement{constructor(){var t,r;super(),this.construct=()=>{let t;const e=this.getAttribute(o("id")),n=this.getWidgetContainerNode();if(!n)throw new Error("Widget container not found in construct");const i=n.closest(`[${o("widget-id")}]`);let r;i&&(r=i.getAttribute(o("widget-id")));let s=new Zt("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(o("path")),id:e,widgetId:r},{bubbles:!0,composed:!0});this.dispatchEvent(s),t=s.detail.props,Object.assign(this,t),this.observers=$t(Wt,zt,Gt),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 Nt,this.componentEventEmitter=new Rt,this.componentResourceManager=new Vt(this.model.id,this.services.eventEmitter,"STATIC"===this.services.config.getConfig("entryModuleType")),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new xt(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(Wt).forEach((e=>e(this.prevProps,t))),this.prevProps=t;const e=this.getHostElement(),n=o("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(zt).forEach((t=>t(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new _t(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),Mt),this.colorSchemaListener.apply(this.getEnvironment()).then((()=>{this.subscriptions.push(this.colorSchemaListener.on())}))),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(wt.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(Gt).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(Wt).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(zt).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(Gt).push(t),t(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${o("element")}]`)).filter((t=>!t.hasAttribute(o("component"))))],this.getElement=(t,e)=>this.getElements().find((n=>e?n.getAttribute(o("element"))===t&&n.id===e:n.getAttribute(o("element"))===t)),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const n=this.getElements();if(!n.length)return;t=function(t,e){if(!e)return t||{desktop:[],mobile:[]};const n=JSON.parse(JSON.stringify(t||{desktop:[],mobile:[]}));return e.forEach((t=>{const e=t.element;let o=!1,i=!1;n.desktop&&n.desktop.forEach((n=>{n.element===e&&(Kt(n,t),o=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===e&&(Kt(n,t),i=!0)})),!o&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(t))),!i&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(t)))})),n}(t,e);const r=o("type"),s="element-styles";let l=this.getRootElement().querySelector(`style[${r}="${s}"]`);l||(l=document.createElement("style"),l.setAttribute(r,s),this.getRootElement().appendChild(l)),z({element:l,html:""}),n.forEach((e=>{let n=e.getAttribute(o("element"));const r=this.getEnvironment();let s=i(t,r,n);if(s){if(this.resizeListener.isMobile()){const e=i(t,"desktop",n);e&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},e.styleAttributes),s.styleAttributes)}))}this.applyStylesToElement(e,this.applySharedClassesToElementModel(s),l)}})),this._addLinkColor(l,this.getShared())},this.registerComponentResourceManagement=()=>{this.viewResourceManager.registerComponent(this.model.id,this.componentResourceManager)},this.applyStyles=(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 i,r;const s=[];"host"===(e=Yt._resolveTogglableStylesForElementModel(e)).element&&(Lt.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],Tt(t,"load",(()=>{this.componentResourceManager.getPending().decrement()})),Tt(t,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(t.src),"UPDATING"===this.services.config.getConfig("entryModuleType")&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},e),{styleAttributes:jt(e.styleAttributes,s)});if(It.set(t,c),this._setClassAttributes(t,e),n){if(e.hoverStyleAttributes){let i=Object.assign({},e.hoverStyleAttributes);if("FILL_UP"===e.hoverAnimationType){t.style.boxShadow="inset 0px 0px 0px 0px rgb(0, 0, 0, 0)",t.style.overflow="hidden";const n=t.tagName.toLowerCase(),o=`flip-up-animation-${e.element}`;let r=this.getRootElement().querySelector(`#${o}`);r||(r=document.createElement("style"),r.id=o,t.appendChild(r)),z({element:r,html:`\n ${n}::before {\n content: '';\n background: ${i.background};\n position: absolute;\n left: 0;\n top: ${t.getBoundingClientRect().height}px;\n height: ${t.getBoundingClientRect().height}px;\n width: 100%;\n z-index: -10;\n }\n ${n}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),i=Object.assign(Object.assign({},e.hoverStyleAttributes),{background:"transparent",position:"relative"})}i.borderTopWidth&&"0px"!==i.borderTopWidth||delete i.borderTopColor,i.borderBottomWidth&&"0px"!==i.borderBottomWidth||delete i.borderBottomColor,i.borderLeftWidth&&"0px"!==i.borderLeftWidth||delete i.borderLeftColor,i.borderRightWidth&&"0px"!==i.borderRightWidth||delete i.borderRightColor,this._addStylesToStyleElement(n,e.element,i,`:not(.${o("no-hover")}):hover`,!0)}e.placeholderStyleAttributes&&this._addStylesToStyleElement(n,e.element,e.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(n,this.getShared()),this.stylesAppliedToElement(t,e,n)}},this._fixMarginOverflow=t=>{const e=this.getParentComponent(),n=e&&("flex"===e.style.display||"inline-flex"===e.style.display),r="host",s=t.getAttribute(o("element"))===r;if(!n||!s)return;const l=this.getProps(),a=this.getEnvironment(),{styleAttributes:c}=i(l.adaptiveStyles,a,r)||{};if(!c)return;const d=c.marginLeft||c.marginRight,u="100%"===c.width;if(d&&u){const e=(parseFloat(c.marginLeft)||0)+(parseFloat(c.marginRight)||0);e&&setTimeout((()=>{t.style.width=`calc(100% - ${e}px)`}))}},this.applySharedClassesToElementModel=t=>function(t,n){let o=t;return(o.classes||"").split(" ").filter((t=>t.startsWith(e))).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}(t,this.documentModel.getShared()),this.getModel=()=>this.model,this._addStylesToStyleElement=(t,e,n,i="",r)=>{const s=Object.keys(n).reduce(((t,e)=>t+` ${Dt.camelCaseToDashCase(e)}: ${n[e]}${r?" !important;":";"}`),"");z({element:t,html:`[${o("element")}="${e}"]${i} { ${s} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{z({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,o,i,r;e.linkColor&&z({element:t,html:`a {color: ${e.linkColor}}, a:visited {color: ${e.linkColor}}`,appendHtml:!0}),(null===(n=e.linkParams)||void 0===n?void 0:n.color)&&z({element:t,html:`a {color: ${null===(o=e.linkParams)||void 0===o?void 0:o.color}}, a:visited {color: ${null===(i=e.linkParams)||void 0===i?void 0:i.color}}`,appendHtml:!0}),(null===(r=e.linkParams)||void 0===r?void 0:r.removeUnderline)&&z({element:t,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(t,o)=>{Array.from(t.classList).filter((t=>t!==n("hovered")&&t!==n("focused"))).forEach((n=>{n.startsWith(e)&&t.classList.remove(n)}));const i=((t.getAttribute("class")||"")+" "+o.classes).trim();t.setAttribute("class",i)},this.getParentComponent=()=>Qt(this.parentNode,o("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(o("path"));return t&&1===t.split(",").length?this.parentNode:Qt(this.parentNode,o("path"),void 0,(t=>t&&1===t.split(",").length))},this.getWidgetLanguages=()=>rt(this.services.config),this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=t=>st(t,this.getWidgetLanguages()),this.stylesAppliedToElement=(t,e,n)=>{},this.updateContext=()=>{var t;const e=this.getModel();this.services.context.updateRecord(e.id,{label:this.getContextRecordLabel(e.props),viewIndex:null===(t=e.path)||void 0===t?void 0:t[0]})},this.addContextRecord=()=>{var t;const e=this.getModel();this.services.context.addRecord(e.id,{recordKey:e.id,id:e.props.control.name,label:this.getContextRecordLabel(e.props),value:e.props.control.defaultValue||"",viewIndex:null===(t=e.path)||void 0===t?void 0:t[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(e.props)}})},this.getContextRecordLabel=t=>{var e,n;const o=t.control.name;if(["email","first_name","last_name"].includes(o))return o.toUpperCase();if(t.content.label&&(null===(n=null===(e=t.adaptiveStyles.desktop.find((t=>"label"===t.element)))||void 0===e?void 0:e.params)||void 0===n?void 0:n.enabled)){const e=(new DOMParser).parseFromString(t.content.label,"text/html");return this.capitalizeFirstLetter(e.body.textContent||"")}return t.content.placeholder?this.capitalizeFirstLetter(t.content.placeholder):t.control.integrationName?this.capitalizeFirstLetter(t.control.integrationName).replace(new RegExp("_","g")," "):void 0},this.capitalizeFirstLetter=t=>t.charAt(0).toUpperCase()+t.slice(1),this.getContextRecordExampleValue=t=>{switch(t.control.name){case"email":return"myemail@example.com";case"first_name":return"Maria";case"last_name":return"Taylor";default:return this.getContextRecordLabel(t)}},this.completeSubmitAction=t=>{const e=t||{},n=this.services.actionRegister.getRegisteredActions().find((t=>t.category===qt));n?null==n||n.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:gt}).execute(void 0,void 0,!0,e)},this.getHandlers=()=>this.getProps().handlers&&this.getProps().handlers.length?[...this.getProps().handlers]:[],this.assets=(t="")=>`${this.services.config.getConfig("staticResourcesUrl").replace(/\/$/,"")}/${this.manifest.name}/assets${t?`/${t}`:""}`,this.attachShadow({mode:"open"}),this.manifest=this.manifest||(null===(t=this.define)||void 0===t?void 0:t.manifest)||(null===(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()}static _resolveTogglableStylesForElementModel(t){const e=Object.assign({},t);return Object.keys(e).forEach((t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=Yt._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 Jt=Symbol("required");var Xt=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 te(){}const ee="pending",ne="valid",oe="invalid";class ie extends Yt{constructor(){super(...arguments),this._createControl=(t={},...e)=>{var{element:n}=t,o=Xt(t,["element"]);const i=this.getProps(),r=this.getModel(),s=Object.assign(Object.assign(Object.assign({},i.control),{componentId:r.id,viewIdx:r.path[0]}),o),l=this.services.form,a=[s,n,...e];return l.hasControl(i.control.name)?l.updateControl(...a):l.registerControl(...a)},this.createControlWithValidation=(t=[],e={})=>{var{element:n=this.getElement("input"),tooltipElement:o=this.getRootElement().querySelector(".input-tooltip"),validCallback:i=te,invalidCallback:r=te,pendingCallback:s=te,elementToListen:l=n,validationMap:a={},listenStatusChange:c=!0}=e,d=Xt(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=a[null==u?void 0:u.validator],h=t.some((t=>t[Jt])),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[Jt]=!0,e}()),p&&f.push(p);const b=this._prepareAsyncValidators(f),v=this._createControl({element:n,validation:{validator:"custom",required:g}},void 0,b);return c&&this._handleControlStatusChange(Object.assign({control:v,element:l,tooltipElement:o,configService:this.services.config,i18n:this.manifest.i18n,validCallback:i,invalidCallback:r,pendingCallback:s},d)),v},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(a,(e=>{this._handleValidationStatus(t,e)})),t.control.on(c,(()=>{let e=ee;switch(!0){case t.control.pending:e=ee;break;case t.control.valid:e=ne;break;default:e=oe}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 ne:(function(t,e){t.classList.remove("invalid"),e.style.visibility="hidden"})(o,i),r&&r();break;case oe:if(n.touched){const t=n.getErrorKeys();if(!t)break;const e=t[0];let r=function(t,e,n){const o=st(e,rt(t)).translations,i=Object.keys(o).find((t=>t.includes(n)));return i?o[i]:n}(c,d,e);l&&(r=l(e,r)),function(t,e,n,o){let i;o=o||document,t.classList.add("invalid"),e.style.visibility="visible",e.onmouseenter=()=>{(function(t){if((t=t||document).head.querySelector(`#${ot}`))return;const e=document.createElement("style");e.setAttribute("id",ot),z({element:e,html:it}),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(`#${ot}`);e&&e.remove()}(o))}}(o,i,r,this.htmlDocumentObject),s&&s()}break;case ee:n.touched&&(function(t,e){e.style.visibility="hidden",t.classList.contains("invalid")&&t.classList.remove("invalid")}(o,i),a&&a())}}}}function re(t){return re="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},re(t)}function se(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,ae(o.key),o)}}function le(t,e,n){return(e=ae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ae(t){var e=function(t){if("object"!=re(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=re(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==re(e)?e:e+""}var ce=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),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=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");z({element:g,html:n}),m.append(g);const f=document.createElement("div");f.classList.add(Y()),u.body.append(p),u.body.append(h),m.append(f),o(p,f),(()=>{const t=J(e,f,function(t){return null!=t?t:5}(s),a,c,u);(function(t,e){t.setAttribute("cl-overlay-position",e)})(f,t.position),G(h,t.coordinates)})(),h.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault()}));const b=t=>{p.remove(),h.remove(),l&&l(),window.removeEventListener("keyup",t,!0)},v=t=>{"Escape"===t.key&&(t.preventDefault(),t.stopImmediatePropagation(),b(v))};p.addEventListener("click",(()=>b(v))),window.addEventListener("keyup",v,!0)}({triggerElement:i.querySelector(".phone-input-with-tooltip"),overlayStyles:(e=Y(),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(t)/2),parseInt(e["border-top-left-radius"]),parseInt(e["border-top-right-radius"]),parseInt(e["border-bottom-left-radius"]),parseInt(e["border-bottom-right-radius"]))}(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(...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=st(t.label,rt(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 st(t.label,rt(n.configService)).translations.toLowerCase().includes(o)})):e}},{key:"getSearchIcon",value:function(){var t=document.createElement("div");return z({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&&se(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function de(t){return de="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},de(t)}function ue(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 pe(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(pe=function(){return!!t})()}function he(t,e,n,o){var i=me(ge(1&o?t.prototype:t),e,n);return 2&o&&"function"==typeof i?function(t){return i.apply(n,t)}:i}function me(){return me="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var o=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ge(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}},me.apply(null,arguments)}function ge(t){return ge=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ge(t)}function fe(t,e){return fe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},fe(t,e)}function be(t,e,n){return(e=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"!=de(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=de(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==de(e)?e:e+""}var ye=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 be(e=function(t,e,n){return e=ge(e),function(t,e){if(e&&("object"==de(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,pe()?Reflect.construct(e,n||[],ge(t).constructor):e.apply(t,n))}(this,t,[].concat(o)),"manifest",s),be(e,"countryData",null),be(e,"registeredControl",null),be(e,"countryCodeSelectedAtLeastOnce",!1),be(e,"availableOptions",[]),be(e,"getValidators",(function(){return[function(t){return t&&t.replace(/[+()\-_ ]/g,"").match(/^\d+$/)?{isValid:!0}:{isValid:!1,errorKey:"PHONE_INVALID_NUMBER"}}]})),be(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")}})})),be(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]})})),be(e,"requestCountryData",(function(){return fetch("".concat(e.assets("json/country-code-options.json"))).then((function(t){return t.json()}))})),be(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")})})),be(e,"getInputElement",(function(){return e.getRootElement().querySelector(".phone-input")})),be(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})})),be(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)})),be(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})),be(e,"setArrowIconStyles",(function(){var t=e.getElement("input").style.color;e.getRootElement().querySelector(".dropdown-icon").style.color=t})),be(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"))}}})),be(e,"getCountryOptionByValue",(function(t){var n=t.startsWith("+")?t:"+".concat(t);return e.availableOptions.find((function(t){return n.startsWith(t.prefix)}))})),be(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)})),be(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&&fe(t,e)}(t,ie),e=t,n=[{key:"connectedCallback",value:function(){var e=this;he(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 ce(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"),K(o,i,e.getHostElement(),e.getElement("input"),e.getElement("label")),function(t){let e;const n=t,o=["transparent","initial"];t&&(t.style.borderColor&&!o.includes(t.style.borderColor)&&(parseFloat(t.style.borderWidth)||parseFloat(t.style.borderBottomWidth))&&(e=Z(n,t,"borderColor")),!e&&t.style.getPropertyValue("--borderBottomColor")&&!o.includes(t.style.getPropertyValue("--borderBottomColor"))&&parseFloat(t.style.getPropertyValue("--borderBottomWidth"))&&(e=Z(n,t,"--borderBottomColor")),e||!t.style.backgroundColor||o.includes(t.style.backgroundColor)||(e=Z(n,t,"backgroundColor")),e||!t.style.color||o.includes(t.style.color)||(e=Z(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"),K(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&&"UPDATING"!==e.services.config.getConfig("entryModuleType")&&(setTimeout((function(){return e.phoneInputMenu.createOverlay(e.availableOptions)}),50),setTimeout((function(){e.phoneInputMenu.focusSearchInput()}),500))}))}},{key:"disconnectedCallback",value:function(){he(t,"disconnectedCallback",this,3)([]),this.services.context.deleteRecord(this.getModel().id)}}],n&&ue(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();be(ye,"define",{name:"sys-phone-input",model:s.name,manifest:s});export{ye as default};window.clComponentClass_SysPhoneInputComponent=ye;
|