import{b as N}from"./vendor-vue-runtime-dom-B2rky8vu.js";import{r as R,v as x,l as D}from"./fieldsStore-CQRN0FvQ.js";import{u as O}from"./translationsStore-D6vLzgNA.js";import{u as W}from"./settingsStore-8bwiLMEn.js";import{_ as k}from"./RequiredHint.vue_vue_type_style_index_0_lang-DGTCbwUk.js";import{d as z,e as p,f as c,i as o,x as s,t as d,k as F,z as y,B as H}from"./vendor-vue-runtime-core-DwK6Ry68.js";import{t as I,r as f,u as a}from"./vendor-vue-reactivity-CheHbvBM.js";import{t as _,a as M}from"./vendor-vue-shared-DrzsEcag.js";import"./vendor-pinia-BSPefQhS.js";import"./appStore-CFAkQG2b.js";import"./convert-case-to-camel-case.utils-CK5dBN7n.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-order-field__wrapper"},L={key:0,class:"ccb-required-tooltip"},P={class:"ccb-order-field__label"},U={key:0,class:"ccb-order-required-mark"},j=["placeholder"],A={key:0,class:"ccb-order-field__wrapper",style:{"padding-top":"10px"}},G={class:"ccb-order-field__label"},J=["placeholder"],K={key:0,class:"ccb-order-field__same-email"},me=z({__name:"OrderEmail",props:{field:{}},setup(T){const q=T,{field:t}=I(q),{checkFieldRequired:E}=R(),u=O(),v=W(),V=p(()=>{var r,e;return((e=(r=v.getWarningTexts)==null?void 0:r.formFields)==null?void 0:e.emailField)||u.getTranslations.requiredField}),S=p(()=>{var r,e;return((e=(r=v.getWarningTexts)==null?void 0:r.formFields)==null?void 0:e.emailFormat)||u.getTranslations.incorrectEmailFormat}),n=f(""),b=f(!0),m=f(""),w=r=>{n.value="";const{updateValue:e}=D(),i=r.target.value;i&&!x(i)&&(n.value="incorrect_email"),e(t.value.id,i),g()},g=()=>{b.value=t.value.value===m.value},B=r=>{const l=r.target.value;l&&!x(l)&&(n.value="incorrect_email")},h=p(()=>n.value==="incorrect_email"?!0:t.value.required?E(t.value):!1);return(r,e)=>{var l,i;return o(),c("div",{class:M(["ccb-order-field ccb-order-email",{[`ccb-col-${a(t).fieldWidth}`]:!0,"ccb-order-field--required":h.value}])},[s("div",$,[h.value?(o(),c("div",L,[n.value==="incorrect_email"?(o(),F(k,{key:0,text:S.value},null,8,["text"])):(o(),F(k,{key:1,text:V.value},null,8,["text"]))])):d("",!0),s("label",P,[y(_(a(t).label)+" ",1),a(t).required?(o(),c("span",U,"*")):d("",!0)]),s("input",{type:"text",onFocusout:B,onInput:w,placeholder:a(t).placeholder},null,40,j)]),(l=a(t).attributes)!=null&&l.confirmation?(o(),c("div",A,[s("label",G,[y(_((i=a(t).attributes)==null?void 0:i.confirmationLabel)+" ",1),e[1]||(e[1]=s("span",{class:"ccb-order-required-mark"},"*",-1))]),H(s("input",{type:"text","onUpdate:modelValue":e[0]||(e[0]=C=>m.value=C),onInput:g,placeholder:a(t).attributes.confirmationPlaceholder},null,40,J),[[N,m.value]]),b.value?d("",!0):(o(),c("span",K,_(a(u).getTranslations.theEmailDoNotMatch),1))])):d("",!0)],2)}}});export{me as default};
//# sourceMappingURL=OrderEmail-BSDax6nC.js.map
