1import{k as t,u as a,c as P,d as J,e as n,T as Q,D as U,f as V,K as Y,O as j,S as H}from"./main-BYrdz30h.js";const X="_1WpBv",Z="_3JI26",q="_8fmom",z="BTeGm",ee="Nc86B",ae="pF9o6",se="gik7f",te="-h3Qi",re="_60sZ4",ne="aKrOK",oe="GvQQ3",ce="kuByU",le="_0b58m",ie="OE4IT",me="tG5KO",pe="xb8h8",de="bT0UX",e={article:X,title:Z,msg:q,fullwrapper:z,formWrapper:ee,hideform:ae,successWrapper:se,successVisible:te,nameForm:re,fieldwrapper:ne,emailfieldwrapper:oe,textfieldwrapper:ce,error:le,input:ie,emailArea:me,textArea:pe,submitButton:de},he=()=>{const[c,v]=t(""),[C,l]=t(""),[i,$]=t(""),[y,m]=t(""),[p,T]=t(""),[x,d]=t(""),[h,O]=t(""),[S,u]=t(""),[W,f]=t(!1),[g,k]=t(!1),[A,F]=t(""),B=s=>{v(s.target.value),l("")},I=s=>{$(s.target.value),m("")},L=s=>{T(s.target.value),d("")},R=s=>{O(s.target.value),u("")},D=async()=>{f(!0);try{const s=c,K=i,M=p,_=window.location.hostname==="localhost"?"http://localhost:9000":"",o=await fetch(`${_}/api/contact`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:s,firstname:K,lastname:M,message:h})});if(o.status===400){const G=await o.json();let N=!1,w=!1,E=!1,b=!1;throw G.errors.forEach(r=>{r.path==="firstname"&&!N&&(N=!0,m(r.msg),console.log(r.msg)),r.path==="lastname"&&!w&&(w=!0,d(r.msg)),r.path==="email"&&!E&&(E=!0,l(r.msg)),r.path==="message"&&!b&&(b=!0,u(r.msg))}),new Error("")}if(!o.ok)throw new Error("Something went wrong. Please try again!");k(!0)}catch(s){F(s.message)}finally{f(!1)}};return a("div",{className:e.fullwrapper,children:[a("div",{className:g?`${e.formWrapper} ${e.hideform}`:`${e.formWrapper}`,children:[a("div",{className:e.nameForm,children:[a("div",{className:e.fieldwrapper,children:[a("input",{id:"firstname",placeholder:"John",type:"text",value:i,className:`${e.input}`,onChange:I}),a("p",{className:e.error,children:y})]}),a("div",{className:e.fieldwrapper,children:[a("input",{id:"lastname",placeholder:"Doe",type:"text",value:p,className:`${e.input}`,onChange:L}),a("p",{className:e.error,children:x})]})]}),a("div",{className:e.emailfieldwrapper,children:[a("input",{id:"contactemail",className:`${e.input} ${e.emailArea}`,type:"email",placeholder:"[email protected]",value:c,onChange:B}),a("p",{className:e.error,children:C})]}),a("div",{className:e.textfieldwrapper,children:[a("textarea",{id:"message",value:h,className:`${e.textArea} ${e.input}`,onChange:R,rows:6,placeholder:"A message"}),a("p",{className:e.error,children:S})]}),a("button",{className:e.submitButton,onClick:D,disabled:W,children:"Submit"}),a("p",{className:e.error,children:A})]}),a("div",{className:g?`${e.successWrapper} ${e.successVisible}`:`${e.successWrapper}`,children:[a("h3",{children:"Thank You"}),a("p",{children:"Your message has been sent!"})]})]})},ue=()=>(P(`${Q} | Contact`),J({rel:"canonical",href:`${U}contact`}),n({name:"description",content:V}),n({name:"keywords",content:Y}),n({name:"robots",content:"index,follow"}),n({property:"og:title",content:j}),null),ge=()=>a(H,{children:[a(ue,{}),a("article",{className:e.article,children:[a("h2",{className:e.title,children:"Contact"}),a("p",{className:e.msg,children:"Send us a message"}),a(he,{})]})]});export{ge as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.