1import{r as s,j as e,v as u,L as f,b as h}from"./index-Dsd8GAzx.js";import{A as c,a as y}from"./AuthInput-vtaISNkD.js";import{C as b}from"./circle-check-BmsR8PtY.js";import"./eye-off-Ce5pi8FB.js";function w(){const[t,d]=s.useState(""),[i,n]=s.useState(!1),[l,o]=s.useState(""),[p,m]=s.useState(!1),x=async r=>{r.preventDefault(),o(""),n(!0);try{await h.auth.resetPasswordRequest(t.trim().toLowerCase()),m(!0)}catch(a){(a==null?void 0:a.status)===429?o("Trop de tentatives. Réessaie dans quelques minutes."):m(!0)}finally{n(!1)}};return p?e.jsx(c,{title:"Vérifie ta boîte mail",subtitle:`Si un compte existe pour ${t}, tu recevras un lien de réinitialisation.`,footer:e.jsx(u,{to:"/signin",className:"text-primary hover:text-primary/80 font-medium",children:"Retour à la connexion"}),children:e.jsxs("div",{className:"flex flex-col items-center gap-4 py-4",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-primary/20 flex items-center justify-center",children:e.jsx(b,{className:"w-8 h-8 text-primary"})}),e.jsx("p",{className:"text-white/70 text-sm text-center",children:"Clique sur le lien dans l'email pour choisir un nouveau mot de passe. Le lien expire rapidement, pense à vérifier tes spams."})]})}):e.jsx(c,{title:"Mot de passe oublié",subtitle:"Entre ton email, on t'envoie un lien pour le réinitialiser",footer:e.jsxs(e.Fragment,{children:["Tu t'en souviens ?"," ",e.jsx(u,{to:"/signin",className:"text-primary hover:text-primary/80 font-medium",children:"Se connecter"})]}),children:e.jsxs("form",{onSubmit:x,className:"space-y-4",children:[e.jsx(y,{label:"Email",type:"email",value:t,onChange:r=>d(r.target.value),placeholder:"[email protected]",autoComplete:"email",required:!0,disabled:i}),l&&e.jsx("p",{className:"text-sm text-red-400",children:l}),e.jsxs("button",{type:"submit",disabled:i||!t,className:"w-full py-3 bg-primary hover:bg-primary/90 text-primary-foreground font-bold rounded-xl transition disabled:opacity-50 flex items-center justify-center gap-2",children:[i&&e.jsx(f,{className:"w-4 h-4 animate-spin"}),"Envoyer le lien"]})]})})}export{w 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.