1import{I as b,r as t,H as l,j as s,an as v,Q as m,S as h,G as j,ai as N,ap as i}from"./index-B0tIimyL.js";function y(){const x=b(),[r,d]=t.useState(!1),[n,p]=t.useState(""),[o,f]=t.useState(""),[c,u]=t.useState(!1);t.useEffect(()=>{const{data:e}=l.auth.onAuthStateChange(a=>{(a==="PASSWORD_RECOVERY"||a==="SIGNED_IN")&&d(!0)});return l.auth.getSession().then(({data:a})=>{a.session&&d(!0)}),()=>e.subscription.unsubscribe()},[]);const w=async e=>{if(e.preventDefault(),n.length<8)return i.error("MÃnimo 8 caracteres");if(n!==o)return i.error("As passwords não coincidem");u(!0);const{error:a}=await l.auth.updateUser({password:n});if(u(!1),a)return i.error(a.message);i.success("Password definida! A entrar..."),x("/")};return s.jsxs("div",{className:"min-h-screen flex items-center justify-center relative overflow-hidden",children:[s.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-[hsl(340,80%,55%)] via-[hsl(330,70%,60%)] to-[hsl(195,80%,50%)]"}),s.jsx("div",{className:"relative z-10 w-full max-w-md mx-4",children:s.jsxs("div",{className:"bg-white/95 backdrop-blur-xl rounded-3xl shadow-2xl p-8 border border-white/20",children:[s.jsxs("div",{className:"text-center mb-6",children:[s.jsx("div",{className:"mx-auto w-14 h-14 bg-gradient-to-br from-[hsl(340,80%,55%)] to-[hsl(330,65%,58%)] rounded-2xl flex items-center justify-center mb-3",children:s.jsx(v,{className:"w-7 h-7 text-white"})}),s.jsx("h1",{className:"text-2xl font-display font-bold",children:"Definir nova password"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:r?"Escolhe uma nova password para a tua conta.":"A validar link..."})]}),s.jsxs("form",{onSubmit:w,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(m,{children:"Nova password"}),s.jsx(h,{type:"password",value:n,onChange:e=>p(e.target.value),disabled:!r,className:"h-11 rounded-xl"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(m,{children:"Confirmar password"}),s.jsx(h,{type:"password",value:o,onChange:e=>f(e.target.value),disabled:!r,className:"h-11 rounded-xl"})]}),s.jsxs(j,{type:"submit",disabled:!r||c,className:"w-full h-11 rounded-xl",children:[c?s.jsx(N,{className:"h-4 w-4 mr-2 animate-spin"}):null,"Guardar password"]})]})]})})]})}export{y 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.