1import{r,j as e}from"./vendor-react-CUX7D0C7.js";import{S as h,C as p,L as f,I as g,B as j}from"./index-CTC3r4BS.js";import{M as b,A as y}from"./vendor-icons-kZFcvpIB.js";import"./vendor-pdf-CFaLvvvW.js";import"./vendor-ui-DV1JMX9G.js";import"./vendor-charts-Dis8PKHX.js";function C(){const[s,m]=r.useState(""),[l,i]=r.useState(!1),[d,c]=r.useState(!1),[n,o]=r.useState(""),x=async a=>{if(a.preventDefault(),!!s){i(!0),o("");try{const t=await fetch("/api/auth/email/forgot-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:s.trim().toLowerCase()})}),u=await t.json();if(!t.ok)throw new Error(u.error||"Failed to send reset email");c(!0)}catch(t){o(t.message)}finally{i(!1)}}};return e.jsxs("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-blue-50 via-white to-purple-50 px-4 py-12",children:[e.jsx(h,{title:"Forgot Password | The Deep Brief"}),e.jsx(p,{className:"w-full max-w-md p-8 shadow-xl border-0 bg-white/80 backdrop-blur",children:d?e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(b,{className:"w-8 h-8 text-purple-600"})}),e.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Check your email"}),e.jsxs("p",{className:"text-gray-600 mb-6",children:["If an account exists for ",e.jsx("strong",{children:s}),", we've sent a password reset link. It expires in 1 hour."]}),e.jsx("p",{className:"text-sm text-gray-500 mb-6",children:"Don't see it? Check your spam folder."}),e.jsx("a",{href:"/sign-in",className:"text-purple-600 hover:underline text-sm font-medium",children:"â Back to sign in"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-1",children:"Reset your password"}),e.jsx("p",{className:"text-gray-600 text-sm",children:"Enter your email and we'll send you a link to reset your password."})]}),n&&e.jsx("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg mb-4 text-sm",children:n}),e.jsxs("form",{onSubmit:x,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(f,{htmlFor:"email",className:"text-gray-700",children:"Email address"}),e.jsx(g,{id:"email",type:"email",value:s,onChange:a=>m(a.target.value),placeholder:"[email protected]",className:"mt-1",required:!0,autoFocus:!0})]}),e.jsx(j,{type:"submit",className:"w-full bg-purple-600 hover:bg-purple-700 text-white",disabled:l||!s,children:l?"Sending...":"Send reset link"})]}),e.jsx("div",{className:"mt-6 text-center",children:e.jsxs("a",{href:"/sign-in",className:"text-sm text-gray-500 hover:text-gray-700 inline-flex items-center gap-1",children:[e.jsx(y,{className:"w-3 h-3"})," Back to sign in"]})})]})})]})}export{C 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.