import{w as u,aD as x,an as d,ap as p,aH as m,x as c,k as b,a2 as h,j as e,a1 as g,T as s,N as j,am as f,a3 as r,B as N,F as C}from"./main-TIUJvpaR.js";import{u as F,C as v}from"./use-captcha-fHl8O9vq.js";function y(a){const{trans:t}=u(),o=x();return d({mutationFn:n=>k(n),onSuccess:()=>{m(t(c("Your message has been submitted."))),o("/")},onError:n=>p(n,a)})}function k(a){return b.post("contact-page",a).then(t=>t.data)}function w(){const a=h(),t=y(a),{captchaToken:o,captchaEnabled:n,resetCaptcha:i}=F("contact");return e.jsxs("div",{className:"flex min-h-screen flex-col bg",children:[e.jsx(g,{children:e.jsx(s,{message:"Contact us"})}),e.jsx(j,{color:"bg",className:"sticky top-0 flex-shrink-0",menuPosition:"contact-us-page"}),e.jsx("div",{className:"container mx-auto flex flex-auto items-center justify-center p-24 md:p-40",children:e.jsxs("div",{className:"max-w-620 rounded-panel border bg-elevated p-24 shadow-sm",children:[e.jsx("h1",{className:"text-2xl",children:e.jsx(s,{message:"Contact us"})}),e.jsx("p",{className:"mb-30 mt-4 text-sm",children:e.jsx(s,{message:"Please use the form below to send us a message and we'll get back to you as soon as possible."})}),e.jsxs(f,{form:a,onSubmit:async l=>{if(n&&!o){m.danger(c("Please solve the captcha challenge."));return}t.mutate({...l,captcha_token:o},{onError:()=>i()})},children:[e.jsx(r,{label:e.jsx(s,{message:"Name"}),name:"name",required:!0,className:"mb-20"}),e.jsx(r,{label:e.jsx(s,{message:"Email"}),name:"email",required:!0,type:"email",className:"mb-20"}),e.jsx(r,{label:e.jsx(s,{message:"Message"}),name:"message",required:!0,inputElementType:"textarea",className:"mb-20",rows:8}),n&&e.jsx(v,{className:"mb-20"}),e.jsx(N,{type:"submit",variant:"flat",color:"primary",disabled:t.isPending,children:e.jsx(s,{message:"Send"})})]})]})}),e.jsx(C,{className:"container mx-auto flex-shrink-0 px-24"})]})}export{w as Component};
