1import{y as v,o as y,z as N,h as a,l as e,w as b,m as P}from"./index-CW929O71.js";import{A as m,L as h,I as p,B as k,a as L}from"./AuthLayout-Daw3e7Gb.js";import{L as n}from"./lock-Cs5Z-165.js";/** 2 * @license lucide-react v0.475.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const S=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],T=v("TriangleAlert",S);function F(){const s=y(),[w]=N(),i=w.get("token"),[r,x]=a.useState(""),[l,f]=a.useState(""),[d,o]=a.useState(""),[c,u]=a.useState(!1),j=async t=>{if(t.preventDefault(),o(""),r!==l){o("Passwords do not match");return}u(!0);try{await P.auth.resetPassword({resetToken:i,newPassword:r}),window.location.href="/login"}catch(g){o(g.message||"Failed to reset password")}finally{u(!1)}};return i?e.jsxs(m,{icon:n,title:s("auth.resetTitle"),subtitle:s("auth.resetSubtitle"),children:[d&&e.jsx("div",{className:"mb-4 p-3 rounded-lg bg-destructive/10 text-destructive text-sm",children:d}),e.jsxs("form",{onSubmit:j,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{htmlFor:"password",children:s("auth.newPassword")}),e.jsxs("div",{className:"relative",children:[e.jsx(n,{className:"absolute start-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground","aria-hidden":"true"}),e.jsx(p,{id:"password",type:"password",autoComplete:"new-password",autoFocus:!0,placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",value:r,onChange:t=>x(t.target.value),className:"ps-10 h-12",required:!0})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{htmlFor:"confirm",children:s("auth.confirmPassword")}),e.jsxs("div",{className:"relative",children:[e.jsx(n,{className:"absolute start-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground","aria-hidden":"true"}),e.jsx(p,{id:"confirm",type:"password",autoComplete:"new-password",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",value:l,onChange:t=>f(t.target.value),className:"ps-10 h-12",required:!0})]})]}),e.jsx(k,{type:"submit",className:"w-full h-12 font-medium",disabled:c,children:c?e.jsxs(e.Fragment,{children:[e.jsx(L,{className:"w-4 h-4 me-2 animate-spin"}),"Resetting..."]}):"Reset password"})]})]}):e.jsx(m,{icon:T,title:s("auth.invalidLinkTitle"),subtitle:s("auth.invalidLinkSubtitle"),footer:e.jsx(b,{to:"/forgot-password",className:"text-primary font-medium hover:underline",children:"Request a new link"}),children:e.jsx("p",{className:"text-sm text-foreground text-center",children:"The link you used appears to be incomplete. Please request a new password reset email."})})}export{F 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.