1import{r as s,j as e,L as x}from"./vendor-ByXk4kz0.js";import{C as h,d as p,B as f,s as j,c as g}from"./index-BOWIUa5W.js";import{I as b}from"./input-2ZAfIJ_8.js";import{L as N}from"./label-Dqu46QPK.js";import{A as v,a as w}from"./alert-CaD7KTuz.js";import{s as y}from"./selyt-logo-white-CRrkbZ2T.js";import{c as C,L,a7 as S,A as E}from"./icons-vendor-2uA-iZSn.js";import"./capacitor-vendor-8XoStP7I.js";import"./supabase-vendor-BZjl9asz.js";function A(){return`${g.publicUrl}/reset-password`}function q(){const[a,o]=s.useState(""),[r,m]=s.useState(!1),[i,l]=s.useState(!1),[c,n]=s.useState(""),d=async t=>{t.preventDefault(),l(!0),n("");const{error:u}=await j.auth.resetPasswordForEmail(a.trim(),{redirectTo:A()});if(l(!1),u){n("No pudimos procesar la solicitud. Intenta nuevamente.");return}m(!0)};return e.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center p-4",children:e.jsxs("div",{className:"w-full max-w-md",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("img",{src:y,alt:"Selyt",className:"h-16 w-auto mx-auto mb-6"}),e.jsx("h1",{className:"text-2xl font-bold text-white mb-2",children:"Recuperar Contraseña"}),e.jsx("p",{className:"text-gray-400 text-sm",children:r?"Revisa tu correo":"Ingresa tu email y te enviaremos un enlace"})]}),e.jsx(h,{className:"border-gray-200 bg-white shadow-2xl",children:e.jsx(p,{className:"pt-6",children:r?e.jsxs("div",{className:"text-center space-y-4",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx(S,{className:"h-16 w-16 text-green-600"})}),e.jsxs("p",{className:"text-gray-700",children:["Si existe una cuenta con"," ",e.jsx("span",{className:"font-medium",children:a}),", te enviamos un correo con un enlace para restablecer tu contraseña. Revisa también la carpeta de spam."]})]}):e.jsxs("form",{onSubmit:d,className:"space-y-4",children:[c&&e.jsxs(v,{variant:"destructive",className:"bg-red-50 border-red-200",children:[e.jsx(C,{className:"h-4 w-4"}),e.jsx(w,{children:c})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"email",className:"text-gray-900",children:"Email"}),e.jsx(b,{id:"email",type:"email",value:a,onChange:t=>o(t.target.value),required:!0,className:"bg-white border-gray-300 text-gray-900",placeholder:"[email protected]","data-testid":"input-forgot-password-email"})]}),e.jsxs(f,{type:"submit",className:"w-full bg-black text-white hover:bg-gray-800",disabled:i,"data-testid":"button-submit-email",children:[i&&e.jsx(L,{className:"mr-2 h-4 w-4 animate-spin"}),"Enviar enlace de recuperación"]})]})})}),e.jsx("div",{className:"mt-6 text-center",children:e.jsxs(x,{href:"/auth",className:"text-gray-400 hover:text-white text-sm inline-flex items-center gap-2",children:[e.jsx(E,{className:"h-4 w-4"}),"Volver al login"]})})]})})}export{q as ForgotPasswordPage,q 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.