1import{f as w,k as f,r as o,m as x,z as g,j as s,X as l,B as P,A as j,n as N}from"./index-wnr683Hh.js";function y(){const r=w(a=>a.auth),d=f(),[i,c]=o.useState(""),[m,u]=o.useState(""),{t:e}=x(),{register:t,formState:{errors:n},handleSubmit:h}=g();o.useEffect(()=>{const a=document.getElementById("root").style;a.height=""},[]);const p=async()=>{const a={email:r.user.email,current_password:i,new_password:m};(await j.changePassword(a)).code===200&&(N.toastMessage(`${e("info.3006")}`,"success"),d("/user-profile"))};return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"header-detail",children:s.jsx("label",{className:"font-bold header-text",children:e("profile.changePasswordComponent.changePassword")})}),s.jsxs("div",{className:"change-password-inner-container",children:[s.jsx("div",{className:"profile-detail-container",children:s.jsxs("label",{className:"font-bold ",style:{paddingBottom:"10px"},children:[e("profile.emailAddress"),s.jsx("span",{className:"email-address-text",children:r.user.email})]})}),s.jsx("div",{className:"row",children:s.jsxs("form",{onSubmit:h(p),autoComplete:"off",children:[s.jsxs("div",{className:"row",children:[s.jsx("div",{className:"col-md-6 col-sm-12 col-xs-12",children:s.jsx("div",{className:"profile-detail-container",children:s.jsx(l,{label:e("profile.changePasswordComponent.currentPassword"),placeHolder:e("profile.changePasswordComponent.currentPasswordPlaceholder"),registerName:"currentpassword",variant:"default",setPassword:c,register:t,errors:n})})}),s.jsx("div",{className:"col-md-6 col-sm-12 col-xs-12",children:s.jsx("div",{className:"profile-detail-container",children:s.jsx(l,{label:e("profile.changePasswordComponent.newPassword"),placeHolder:e("profile.changePasswordComponent.newPasswordPlaceholder"),registerName:"newpassword",variant:"default",setPassword:u,register:t,errors:n})})})]}),s.jsx("div",{className:"row",style:{justifyContent:"center",margin:"auto"},children:r.isAuth&&s.jsx(P,{style:{height:"60px",marginTop:"20px"},className:"btn-main medium font-bold",type:"submit",children:e("profile.changePassword")})})]})})]})]})}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.