import{_ as e}from"./CKEYLAf6.js";import{_ as a}from"./BwktB3MS.js";import{_ as l}from"./ZLXiKZFV.js";import{_ as t}from"./C7_vGl81.js";import{c as n,u as s,d as o,l as r}from"./CaT6xTWa.js";import{c as p,a as i}from"./CTE2MjzL.js";import{c as m,B as u,L as c,M as d,$ as h,a2 as v,x as b,P as _,u as g,V as R,Z as y,W as F}from"./CFGNYEIb.js";import"./Dy7DG9Bl.js";import"./CUpT3tfP.js";import"./BZIzRSk9.js";import"./DrR3boGe.js";const S={class:"container py-6 lg:py-10"},f={class:"font-bold text-3xl lg:mb-12 mb-6"},x={class:"grid grid-cols-1 max-w-[600px] mx-auto [&_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,I=m(!1),{t:O}=o(),T=m(p().shape({phone:p().shape({phone_number:i().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:i().required(O("ERRORS.name")),email:i().email(O("ERRORS.invalid_email")).required(O("ERRORS.email")),country:p().required(O("ERRORS.country")),message:i().required(O("ERRORS.message"))})),N=m({}),P=m(!1),A=m(null),B=async(e,a)=>{P.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=>{I.value=!0,N.value={},a.resetForm(),A.value.clearInput()})).catch((e=>{r.error(e.response.data.message)})).finally((()=>{P.value=!1}))};return(n,s)=>{const o=e,r=a,p=l,i=u("VeeForm"),m=t;return c(),d("div",S,[h("h3",f,v(n.$t("NAV.contact")),1),b(i,{"validation-schema":g(T),onSubmit:B,initialValues:g(N)},{default:_((()=>[h("div",x,[h("div",null,[b(o,{name:"name",label:n.$t("LABELS.name"),placeholder:n.$t("INPUTS.name"),type:"text",value:g(N).name,"onUpdate:value":s[0]||(s[0]=e=>g(N).name=e)},null,8,["label","placeholder","value"])]),h("div",null,[b(r,{name:"phone",label:n.$t("LABELS.phone"),placeholder:n.$t("INPUTS.phone"),value:g(N).phone,"onUpdate:value":s[1]||(s[1]=e=>g(N).phone=e),ref_key:"phoneInput",ref:A},null,8,["label","placeholder","value"])]),h("div",null,[b(o,{name:"email",label:n.$t("LABELS.email"),placeholder:n.$t("INPUTS.email"),type:"email",value:g(N).email,"onUpdate:value":s[2]||(s[2]=e=>g(N).email=e)},null,8,["label","placeholder","value"])]),h("div",null,[b(p,{name:"country",label:n.$t("LABELS.country"),placeholder:n.$t("INPUTS.country"),value:g(N).country,"onUpdate:value":s[3]||(s[3]=e=>g(N).country=e),items:g(j).countries},null,8,["label","placeholder","value","items"])]),h("div",E,[b(o,{name:"message",type:"textarea",label:n.$t("LABELS.message"),placeholder:n.$t("INPUTS.message"),value:g(N).message,"onUpdate:value":s[4]||(s[4]=e=>g(N).message=e)},null,8,["label","placeholder","value"])]),h("div",null,[h("button",{loading:g(P),type:"submit",class:"base-btn capitalize !w-full max-w-[100%]"},v(n.$t("TITLES.send_message")),9,$)])])])),_:1},8,["validation-schema","initialValues"]),g(I)?(c(),R(y,{key:0,custom:"",to:"body"},[b(m,{class:"[&_h2]:!font-Montserrat [&_h2]:!not-italic [&_h2]:!font-semibold",onClose:s[5]||(s[5]=e=>I.value=!1),title:"Send message",desc:"The message has been sent successfully."})])):F("",!0)])}}};export{L as default};
