const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./vendor-vue-tel-input-po4vDl8i.css","./Phone-uPZXRn64.css"])))=>i.map(i=>d[i]);
import{_ as n}from"./convert-case-to-camel-case.utils-CK5dBN7n.js";import{u as q}from"./appearanceStore-Cp-euDX2.js";import{u as E,v as A,q as D}from"./fieldsStore-CNpVuoPu.js";import{_ as P}from"./ProBadge.vue_vue_type_style_index_0_lang-DqDXUf8-.js";import{_ as p}from"./RequiredHint.vue_vue_type_style_index_0_lang-DGTCbwUk.js";import{u as R}from"./translationsStore-D6vLzgNA.js";import{u as F}from"./settingsStore-8bwiLMEn.js";import{d as B,e as d,$ as c,f as o,i as r,x as m,t as l,k as u,z as I,j as L,v as N}from"./vendor-vue-runtime-core-DwK6Ry68.js";import{t as O,r as w,u as i}from"./vendor-vue-reactivity-CheHbvBM.js";import{t as f,a as U}from"./vendor-vue-shared-DrzsEcag.js";import"./vendor-pinia-BSPefQhS.js";import"./appStore-CFAkQG2b.js";import"./vendor-moment-Cv92BTSA.js";import"./vendor-bootstrap-CCU-90um.js";import"./vendor-jspdf-UFhKzYHA.js";import"./vendor-php-date-formatter-DSpPwBF8.js";import"./callbackStore-BhxBUA6V.js";const $={class:"ccb-field__label"},z={key:0,class:"ccb-required-tooltip"},W={class:"ccb-field__title"},j={key:0,class:"ccb-field-required-mark"},M={key:0,class:"ccb-field__descriptions ccb-before"},G={key:0,class:"ccb-field__description"},H={class:"ccb-field__input-wrapper"},J={key:1,class:"ccb-field__descriptions ccb-after"},K={key:0,class:"ccb-field__description"},pe=B({__name:"ValidatedForm",props:{field:{}},setup(T){const g=T,{field:e}=O(g),s=w(""),v=q(),b=R(),_=E(),h=d(()=>{var a;return((a=F().getWarningTexts)==null?void 0:a.requiredMsg)||""}),x=d(()=>{var a;const t=(a=e.value)==null?void 0:a.fieldType;return t==="name"?c(()=>n(()=>import("./Name-BdsUy3Z4.js"),[],import.meta.url)):t==="email"?c(()=>n(()=>import("./Email-Cwj_9_Vi.js"),[],import.meta.url)):t==="phone"?c(()=>n(()=>import("./Phone-CfNFbiec.js"),__vite__mapDeps([0,1]),import.meta.url)):t==="website_url"?c(()=>n(()=>import("./WebsiteUrl-1ZCfkxty.js"),[],import.meta.url)):""}),C=t=>{var a,k;s.value="",((a=e.value)==null?void 0:a.fieldType)==="email"&&!A(t)&&t.trim()!==""?s.value="invalid_email":((k=e.value)==null?void 0:k.fieldType)==="website_url"&&!D(t)&&t.trim()!==""&&(s.value="invalid_url"),e.value.displayValue=t,_.updateField(e.value.alias,e.value)},S=t=>{e.value.defaultCountry=t,_.updateField(e.value.alias,e.value)},y=d(()=>s.value==="invalid_email"||s.value==="invalid_url"?!0:_.checkFieldRequired(e.value)),V=d(()=>{var t;return((t=e.value)==null?void 0:t.additionalStyles)||""});return(t,a)=>(r(),o("div",{class:U(["ccb-field ccb-field-quantity ccb-field-form-fields",{required:y.value,"ccb-field-disabled":i(e).disabled,[V.value]:!0}])},[m("div",$,[y.value?(r(),o("div",z,[s.value==="invalid_email"?(r(),u(p,{key:0,text:i(b).getTranslations.validEmailAddress},null,8,["text"])):s.value==="invalid_url"?(r(),u(p,{key:1,text:i(b).getTranslations.enterValidUrl},null,8,["text"])):(r(),u(p,{key:2,text:h.value},null,8,["text"]))])):l("",!0),m("div",W,[I(f(i(e).label),1),i(e).required?(r(),o("span",j,"*")):l("",!0),L(P)])]),i(v).getAppearanceDescriptionPosition==="before"?(r(),o("div",M,[i(e).description?(r(),o("div",G,f(i(e).description),1)):l("",!0)])):l("",!0),m("div",H,[(r(),u(N(x.value),{onUpdate:C,field:i(e),onCountryChanged:S},null,40,["field"]))]),i(v).getAppearanceDescriptionPosition==="after"?(r(),o("div",J,[i(e).description?(r(),o("div",K,f(i(e).description),1)):l("",!0)])):l("",!0)],2))}});export{pe as default};
//# sourceMappingURL=index-D4opNSAA.js.map
