1import{r,j as e,P as h,a as b,w as j,L as o,A as c,y as m}from"./index-D-ZsJRgs.js";import{M as g}from"./mail-VD44J7oa.js";function N(){const[s,x]=r.useState(""),[n,i]=r.useState(!1),[u,p]=r.useState(!1),[d,a]=r.useState("");async function f(l){if(l.preventDefault(),!s){a("Please enter your email address.");return}a(""),i(!0);const{error:t}=await m.auth.resetPasswordForEmail(s,{redirectTo:`${window.location.origin}/reset-password`});if(t){a(t.message);try{await m.from("admin_error_log").insert({error_type:"PASSWORD_RESET_EMAIL_FAILED",error_message:t.message,metadata:{status:t.status??null,timestamp:new Date().toISOString()},request_url:"/forgot-password"})}catch{}}else p(!0);i(!1)}return e.jsxs("div",{className:"min-h-screen bg-dark-950 flex flex-col items-center justify-center px-4 py-16",children:[e.jsx(h,{title:"Reset Password â REI Vault Pro",description:"Reset your REI Vault Pro account password.",canonical:"/forgot-password"}),e.jsxs("div",{className:"w-full max-w-md",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 rounded-full border border-gold-400/30 bg-white/5 mb-6",children:[e.jsx(b,{size:14,className:"text-gold-400"}),e.jsx("span",{className:"text-gold-300 text-sm font-semibold",children:"REI Vault Pro"})]}),e.jsx("h1",{className:"font-display text-3xl font-bold text-white mb-2",children:"Reset Password"}),e.jsx("p",{className:"text-dark-400 text-sm",children:"Enter your email and we'll send you a link to reset your password."})]}),e.jsx("div",{className:"bg-white rounded-2xl p-8 shadow-2xl",children:u?e.jsxs("div",{className:"text-center py-4",children:[e.jsx("div",{className:"w-14 h-14 rounded-full bg-success-50 border-2 border-success-200 flex items-center justify-center mx-auto mb-4",children:e.jsx(j,{size:26,className:"text-success-500"})}),e.jsx("h2",{className:"font-display text-xl font-bold text-dark-900 mb-2",children:"Check your email"}),e.jsxs("p",{className:"text-dark-500 text-sm mb-6",children:["We sent a password reset link to ",e.jsx("span",{className:"font-semibold text-dark-900",children:s}),". Check your inbox and follow the link to set a new password."]}),e.jsxs(o,{to:"/login",className:"btn-gold w-full py-3 flex items-center justify-center gap-2 font-bold text-sm",children:["Back to Sign In ",e.jsx(c,{size:15})]})]}):e.jsxs("form",{onSubmit:f,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-dark-700 mb-1.5",children:"Email Address"}),e.jsxs("div",{className:"relative",children:[e.jsx(g,{size:16,className:"absolute left-3 top-1/2 -trandark-y-1/2 text-dark-400"}),e.jsx("input",{type:"email",value:s,onChange:l=>x(l.target.value),placeholder:"[email protected]",className:"input-field w-full pl-10",required:!0,autoFocus:!0})]})]}),d&&e.jsxs("div",{className:"flex items-start gap-2.5 text-sm px-3 py-2.5 rounded-lg bg-error-50 text-error-700 border border-error-200",children:[e.jsx("span",{className:"mt-0.5 flex-shrink-0 w-4 h-4 rounded-full bg-error-200 flex items-center justify-center text-[10px] font-black",children:"!"}),d]}),e.jsx("button",{type:"submit",disabled:n,className:"btn-gold w-full py-3 flex items-center justify-center gap-2 font-bold text-sm disabled:opacity-70 disabled:cursor-not-allowed",children:n?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"w-4 h-4 rounded-full border-2 border-dark-950/30 border-t-dark-950 animate-spin"}),"Sendingâ¦"]}):e.jsxs(e.Fragment,{children:["Send Reset Link ",e.jsx(c,{size:16})]})}),e.jsxs("p",{className:"text-xs text-dark-400 text-center mt-2",children:["Remembered your password?"," ",e.jsx(o,{to:"/login",className:"text-gold-600 font-semibold hover:underline",children:"Sign in"})]})]})}),e.jsx("div",{className:"text-center mt-6",children:e.jsx(o,{to:"/",className:"text-dark-400 text-xs hover:text-dark-200 transition-colors",children:"Back to REIVaultPro.com"})})]})]})}export{N 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.