1import{r as a,E as b,j as e,P as c,C as g,L as d,I as p,B as v}from"./index-BTqgdxf7.js";function k(){const[t,m]=a.useState(""),[x,n]=a.useState(!1),[f,o]=a.useState(!1),[r,i]=a.useState({}),u=a.useCallback(()=>{const s={};return t.trim()?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)||(s.email="Please enter a valid email address"):s.email="Email is required",i(s),Object.keys(s).length===0},[t]),h=a.useCallback(async s=>{if(s.preventDefault(),!!u()){n(!0),i({});try{await b(t),o(!0)}catch(l){l.status===429?i({general:"Too many requests. Please try again later."}):o(!0)}finally{n(!1)}}},[t,u]);return f?e.jsx(c,{children:e.jsx("div",{className:"max-w-md mx-auto px-4 py-12",children:e.jsxs(g,{className:"text-center",children:[e.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-success-bg",children:e.jsx("svg",{className:"h-6 w-6 text-success-text",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),e.jsx("h2",{className:"text-xl font-bold text-foreground mb-2",children:"Check Your Email"}),e.jsxs("p",{className:"text-muted text-sm",children:["If an account exists with ",e.jsx("span",{className:"text-secondary",children:t}),", we've sent a password reset link."]}),e.jsx("p",{className:"text-subtle text-xs mt-3",children:"The link will expire in 1 hour. Check your spam folder if you don't see it."}),e.jsx(d,{to:"/app/login",className:"mt-6 inline-block text-sm text-primary-text hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background rounded",children:"Back to login"})]})})}):e.jsx(c,{children:e.jsxs("div",{className:"max-w-md mx-auto px-4 py-12",children:[e.jsx("h1",{className:"text-3xl font-bold mb-2 text-foreground",children:"Reset Password"}),e.jsx("p",{className:"text-muted mb-8",children:"Enter your email address and we'll send you a link to reset your password."}),r.general&&e.jsx("div",{className:"mb-6 rounded-lg border border-destructive/30 bg-destructive-bg px-4 py-3 text-sm text-destructive-text",children:r.general}),e.jsxs("form",{onSubmit:h,noValidate:!0,className:"space-y-5",children:[e.jsx(p,{id:"email",type:"email",autoComplete:"email",required:!0,value:t,onChange:s=>{m(s.target.value),r.email&&i(l=>({...l,email:void 0}))},label:"Email",error:r.email,placeholder:"[email protected]",className:"bg-surface"}),e.jsx(v,{type:"submit",loading:x,loadingText:"Sending...",fullWidth:!0,size:"lg",children:"Send Reset Link"})]}),e.jsxs("p",{className:"mt-6 text-center text-sm text-muted",children:["Remember your password?"," ",e.jsx(d,{to:"/app/login",className:"text-primary-text hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background rounded",children:"Log in"})]})]})})}export{k 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.