1import{r as a,j as e,L as h,A as p,a as f,I as j,B as y,b as g,s as N}from"./index-D0YNpH9z.js";import{C as w,a as b}from"./card-B_NOpyco.js";import{M as v}from"./mail-check-Dln6WwN7.js";function S(){const[t,m]=a.useState(""),[r,i]=a.useState(!1),[x,o]=a.useState(!1),[c,l]=a.useState(null),u=async n=>{var d;if(n.preventDefault(),l(null),!t.trim()){l("Please enter your email address.");return}i(!0);try{const{error:s}=await N.auth.resetPasswordForEmail(t.trim(),{redirectTo:`${window.location.origin}/reset-password`});if(s)throw s;o(!0)}catch(s){(d=s==null?void 0:s.message)!=null&&d.toLowerCase().includes("rate")?l("Too many attempts. Please wait a moment and try again."):o(!0)}finally{i(!1)}};return e.jsx("div",{className:"min-h-screen bg-background flex flex-col items-center justify-center px-5 py-10",children:e.jsxs("div",{className:"w-full max-w-md",children:[e.jsxs(h,{to:"/auth",className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground mb-6",children:[e.jsx(p,{className:"h-3.5 w-3.5"}),"Back to sign in"]}),e.jsx(w,{children:e.jsx(b,{className:"pt-6 pb-6 px-5 space-y-5",children:x?e.jsxs("div",{className:"text-center space-y-3 py-2",children:[e.jsx("div",{className:"mx-auto w-12 h-12 rounded-full bg-emerald-500/10 flex items-center justify-center",children:e.jsx(v,{className:"h-6 w-6 text-emerald-600"})}),e.jsx("h1",{className:"text-xl font-semibold",style:{fontFamily:"Libre Baskerville, serif"},children:"Check your email"}),e.jsxs("p",{className:"text-sm text-muted-foreground leading-relaxed",children:["If an account exists for ",e.jsx("span",{className:"text-foreground",children:t}),", we've sent a link to reset your password."]}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Don't see it? Check spam, or wait a minute and try again."})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-[0.25em] text-primary font-mono",children:"Account recovery"}),e.jsx("h1",{className:"text-xl font-semibold",style:{fontFamily:"Libre Baskerville, serif"},children:"Forgot your password?"}),e.jsx("p",{className:"text-sm text-muted-foreground leading-snug",children:"Enter the email associated with your account and we'll send you a link to reset it."})]}),e.jsxs("form",{onSubmit:u,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(f,{htmlFor:"email",className:"text-xs font-medium",children:"Email address"}),e.jsx(j,{id:"email",type:"email",autoComplete:"email",placeholder:"[email protected]",value:t,onChange:n=>m(n.target.value),disabled:r,className:"h-11"})]}),c&&e.jsx("div",{className:"p-3 rounded-md bg-destructive/10 border border-destructive/20",children:e.jsx("p",{className:"text-sm text-destructive",children:c})}),e.jsx(y,{type:"submit",className:"w-full h-11",disabled:r,children:r?e.jsxs(e.Fragment,{children:[e.jsx(g,{className:"mr-2 h-4 w-4 animate-spin"}),"Sendingâ¦"]}):"Send reset link"})]})]})})})]})})}export{S 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.