1import{g as b,r as a,c as P,j as e,B as f,v}from"./index-_aijvlUq.js";import{P as C}from"./PageHeader-DCofr6qo.js";import{I as d}from"./Input-ysTyZFq5.js";function N(){const m=b(),[t,l]=a.useState(""),[r,u]=a.useState(""),[o,c]=a.useState(""),[i,n]=a.useState(null),[w,p]=a.useState(!1),g=P(s=>s.showSuccess);async function h(s){if(s.preventDefault(),n(null),r!==o){n("New passwords do not match");return}p(!0);try{await v.post("/auth/change-password",{currentPassword:t,newPassword:r}),g("Password changed successfully"),l(""),u(""),c("")}catch(x){n(x.message)}p(!1)}return e.jsx("div",{className:"px-4 pt-3 md:px-0 md:pt-0",children:e.jsxs("div",{className:"max-w-2xl",children:[!m&&e.jsx(C,{title:"Change Password",breadcrumbs:[{label:"Home",to:"/"},{label:"Account"},{label:"Change Password"}]}),e.jsxs("form",{onSubmit:h,className:"bg-white rounded-xl border border-gray-200 p-6 space-y-4",children:[i&&e.jsx("div",{className:"rounded-md bg-red-50 border border-red-200 px-3 py-2 text-sm text-red-700",children:i}),e.jsx(d,{label:"Current Password",type:"password",value:t,onChange:s=>l(s.target.value),required:!0,autoComplete:"current-password"}),e.jsx(d,{label:"New Password",type:"password",value:r,onChange:s=>u(s.target.value),required:!0,minLength:8,autoComplete:"new-password"}),e.jsx(d,{label:"Confirm New Password",type:"password",value:o,onChange:s=>c(s.target.value),required:!0,minLength:8,autoComplete:"new-password"}),e.jsx("div",{className:"flex gap-2 pt-2",children:e.jsx(f,{type:"submit",isLoading:w,disabled:!t||!r||!o,children:"Save changes"})})]})]})})}export{N as AccountChangePasswordPage};
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.