import{_ as e}from"./DI9rh8sY.js";import{_ as a}from"./BFVLDZml.js";import{_ as l}from"./BpqNgLaf.js";import{_ as t}from"./BNO-Xg1R.js";import{u as n,a as s,b as o,l as i}from"./D-zM739Y.js";import{c as p,a as r}from"./CskKXZ8b.js";import{c as m,A as u,L as c,M as d,$ as h,a2 as b,H as v,P as F,u as g,V as _,Z as y,W as R}from"./DOfEu912.js";import"./BThtoQni.js";import"./DV8kAjei.js";import"./DVxWgENy.js";const S={class:"bg-[#F6F7FC] py-6 lg:py-10 px-2 lg:px-14 h-fit"},f={class:"font-bold text-3xl mb-12"},x={class:"grid grid-cols-1 [&_label]:!bg-[#F6F7FC] [&_input]:!bg-[#FFFFFF03] [&_button[aria-haspopup=listbox]]:!bg-[#FFFFFF03] gap-8"},E={class:"[&_textarea]:!h-[160px] [&_textarea]:!bg-[#FFFFFF03] [&_textarea]:!p-6"},$=["loading"],L={__name:"contact-us",setup(L){const j=n(),U=s().$axios,A=m(!1),{t:O}=o(),B=m(p().shape({phone:p().shape({phone_number:r().required(O("ERRORS.phone")).test("phone-length",(function(e){const{phone_limit:a}=this.parent;return!!e&&(e.length===a||this.createError({message:O("ERRORS.phone_limit",{phone_limit:a})}))}))}),name:r().required(O("ERRORS.name")),email:r().email(O("ERRORS.invalid_email")).required(O("ERRORS.email")),country:p().required(O("ERRORS.country")),message:r().required(O("ERRORS.message"))})),I=m({}),N=m(!1),P=async(e,a)=>{N.value=!0;const l=new FormData;l.append("full_name",e.name),l.append("email",e.email),l.append("country_id",e.country.id),l.append("content",e.message),l.append("phone_code",e.phone.phone_code),l.append("phone",e.phone.phone_number),U.post("contact-us",l).then((e=>{A.value=!0,I.value={},a.resetForm()})).catch((e=>{i.error(e.response.data.message)})).finally((()=>{N.value=!1}))};return(n,s)=>{const o=e,i=a,p=l,r=u("VeeForm"),m=t;return c(),d("div",S,[h("h3",f,b(n.$t("NAV.contact")),1),v(r,{"validation-schema":g(B),onSubmit:P,initialValues:g(I)},{default:F((()=>[h("div",x,[h("div",null,[v(o,{name:"name",label:n.$t("LABELS.name"),placeholder:n.$t("INPUTS.name"),type:"text",value:g(I).name,"onUpdate:value":s[0]||(s[0]=e=>g(I).name=e)},null,8,["label","placeholder","value"])]),h("div",null,[v(i,{name:"phone",label:n.$t("LABELS.phone"),placeholder:n.$t("INPUTS.phone"),value:g(I).phone,"onUpdate:value":s[1]||(s[1]=e=>g(I).phone=e)},null,8,["label","placeholder","value"])]),h("div",null,[v(o,{name:"email",label:n.$t("LABELS.email"),placeholder:n.$t("INPUTS.email"),type:"email",value:g(I).email,"onUpdate:value":s[2]||(s[2]=e=>g(I).email=e)},null,8,["label","placeholder","value"])]),h("div",null,[v(p,{name:"country",label:n.$t("LABELS.country"),placeholder:n.$t("INPUTS.country"),value:g(I).country,"onUpdate:value":s[3]||(s[3]=e=>g(I).country=e),items:g(j).countries},null,8,["label","placeholder","value","items"])]),h("div",E,[v(o,{name:"message",type:"textarea",label:n.$t("LABELS.message"),placeholder:n.$t("INPUTS.message"),value:g(I).message,"onUpdate:value":s[4]||(s[4]=e=>g(I).message=e)},null,8,["label","placeholder","value"])]),h("div",null,[h("button",{loading:g(N),type:"submit",class:"base-btn capitalize !w-[480px] max-w-[100%]"}," Send message ",8,$)])])])),_:1},8,["validation-schema","initialValues"]),g(A)?(c(),_(y,{key:0,custom:"",to:"body"},[v(m,{class:"[&_h2]:!font-Montserrat [&_h2]:!not-italic [&_h2]:!font-semibold",onClose:s[5]||(s[5]=e=>A.value=!1),title:"Send message",desc:"The message has been sent successfully."})])):R("",!0)])}}};export{L as default};
