1import{u as f,r as t,j as e,C as l,d as o,a as j,b as g,c as y,L as b,I as v,B as N,s as r,e as u}from"./index-CKuJyNNt.js";const S=()=>{const m=f(),[n,p]=t.useState(""),[d,i]=t.useState(!1),[w,h]=t.useState(!1);t.useEffect(()=>{const s=window.location.hash;s&&s.includes("type=recovery")&&h(!0)},[]);const x=async s=>{s.preventDefault(),i(!0);const{error:c}=await r.auth.updateUser({password:n});if(c)u.error(c.message);else{u.success("Password updated successfully!");const{data:{user:a}}=await r.auth.getUser();a!=null&&a.email&&await r.from("invitations").update({accepted_at:new Date().toISOString()}).eq("email",a.email).is("accepted_at",null),m("/")}i(!1)};return w?e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-8",children:e.jsxs(l,{className:"w-full max-w-md",children:[e.jsxs(j,{children:[e.jsx(g,{children:"Set New Password"}),e.jsx(y,{children:"Enter your new password below."})]}),e.jsx(o,{children:e.jsxs("form",{onSubmit:x,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"password",children:"New Password"}),e.jsx(v,{id:"password",type:"password",value:n,onChange:s=>p(s.target.value),placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",required:!0,minLength:6})]}),e.jsx(N,{type:"submit",className:"w-full",disabled:d,children:d?"Updating...":"Update Password"})]})})]})}):e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-8",children:e.jsx(l,{className:"w-full max-w-md",children:e.jsx(o,{className:"pt-6 text-center text-muted-foreground",children:"Invalid or expired reset link. Please request a new password reset."})})})};export{S 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.