1import{r,j as e}from"./vendor-query-3G-o6gET.js";import{c as f,B as S}from"./index-BM5qeEvI.js";import"./vendor-react-CRndp1lD.js";import"./vendor-supabase-WCvsMjdu.js";import"./vendor-icons-C_B0g3PB.js";import"./vendor-sonner-BvPQ4xdz.js";import"./vendor-radix-DGzjaZVk.js";import"./vendor-charts-YLBgw7Ed.js";function E(){const[o,c]=r.useState(""),[a,h]=r.useState(""),[l,g]=r.useState(""),[i,n]=r.useState("idle"),[x,s]=r.useState(""),y=r.useMemo(()=>Date.now(),[]),b=async t=>{if(t.preventDefault(),i!=="sending"){n("sending"),s("");try{const u=await fetch(`${S}/functions/v1/support-submit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:o,message:a,website:l,opened_at:y,page:typeof document<"u"&&document.referrer||null})}),m=await u.json().catch(()=>({}));if(!u.ok){s(String(m.error??m.message??"Something went wrong â please try again.")),n("error");return}n("sent")}catch{s("Couldn't reach the server â please try again in a minute."),n("error")}}},p={display:"block",fontSize:13.5,fontWeight:600,margin:"18px 0 6px"},d={width:"100%",boxSizing:"border-box",fontSize:15,padding:"10px 12px",border:"1px solid var(--line, #ddd)",borderRadius:8,fontFamily:"inherit"};return e.jsx(f,{tierC:!0,title:"Support â Bevia",children:e.jsxs("div",{style:{maxWidth:640,margin:"0 auto",padding:"48px 24px 80px",color:"var(--ink)",fontFamily:"var(--sans)"},children:[e.jsx("span",{className:"tag",style:{display:"block",marginBottom:14},children:"Support"}),e.jsx("h1",{style:{fontSize:40,fontWeight:700,letterSpacing:"-0.01em",lineHeight:1.25,margin:"0 0 10px"},children:"Tell us what's wrong â or what you wish existed."}),e.jsx("p",{style:{fontSize:15.5,lineHeight:1.6,color:"var(--soft, #555)",margin:"0 0 8px"},children:"A real person reads every message. Leave the email you want the reply at."}),i==="sent"?e.jsxs("div",{style:{marginTop:28,padding:"18px 20px",border:"1px solid var(--line, #ddd)",borderRadius:10,fontSize:15.5,lineHeight:1.6},children:[e.jsx("b",{children:"Got it â thank you."}),e.jsxs("div",{style:{color:"var(--soft, #555)",marginTop:4},children:["We'll reply to ",e.jsx("b",{children:o}),". If it's urgent, mention that next time and we'll triage accordingly."]})]}):e.jsxs("form",{onSubmit:b,noValidate:!0,children:[e.jsx("label",{style:p,htmlFor:"support-email",children:"Your email"}),e.jsx("input",{id:"support-email",type:"email",required:!0,value:o,style:d,autoComplete:"email",placeholder:"[email protected]",onChange:t=>c(t.target.value)}),e.jsx("label",{style:p,htmlFor:"support-message",children:"What's going on?"}),e.jsx("textarea",{id:"support-message",required:!0,value:a,rows:7,style:{...d,resize:"vertical"},placeholder:"What were you doing, what did you expect, what happened instead? Screenshots can go in a reply.",onChange:t=>h(t.target.value)}),e.jsxs("div",{"aria-hidden":"true",style:{position:"absolute",left:-9999,top:-9999,height:0,overflow:"hidden"},children:[e.jsx("label",{htmlFor:"support-website",children:"Website"}),e.jsx("input",{id:"support-website",type:"text",tabIndex:-1,autoComplete:"off",value:l,onChange:t=>g(t.target.value)})]}),i==="error"&&e.jsx("p",{style:{color:"#b3261e",fontSize:14,margin:"14px 0 0"},children:x}),e.jsx("button",{type:"submit",className:"btn btn-primary",disabled:i==="sending",style:{marginTop:22,fontSize:15,padding:"10px 22px"},children:i==="sending"?"Sendingâ¦":"Send"})]})]})})}export{E 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.