1import{u as B,M as a,f as x,j as s,C as k,R as E,b as f,B as g,I as n,F as i,c}from"./index-DjJ_lb9G.js";import{u as I,r as p,c as R}from"./vendor-react-B9qmQAuU.js";import{L as T,a as F,b as G,B as V,G as A,U as q,F as U,c as K,e as $}from"./loginStyle-l2qpC7qr.js";import{A as H,L as M,G as D,K as j,a as b}from"./key-slash-DheCbz15.js";import{c as O,a as y,b as W}from"./index.esm-Bt65Fdhj.js";import{u as X,a as z}from"./vendor-redux-CkURKOpn.js";import{a as J,b as Q}from"./resetPassword-slice-D5HqpIjc.js";import{I as d}from"./InputGroup-DergHx2e.js";import"./vendor-styled-CVQBg5K8.js";const cs=()=>{const h=I(),L=X(),[l,C]=p.useState(!1),[m,_]=p.useState(!1),r=z(e=>e==null?void 0:e.resetPassword),w=R(),S=new URLSearchParams(w.search).get("token");p.useEffect(()=>{var e,t,u;r!=null&&r.data&&(((e=r==null?void 0:r.data)==null?void 0:e.status)===200||((t=r==null?void 0:r.data)==null?void 0:t.status)===201||((u=r==null?void 0:r.data)==null?void 0:u.status)===202)&&(J.resetPasswordSliceReset(),h("/signin"))},[r]);const N=()=>{C(!l)},P=()=>{_(!m)},v=async e=>{const t={...e,token:S};await L(Q(t))},o=B({initialValues:{confirm_password:"",password:""},validationSchema:O({password:y().trim().required(a.requiredErrors(a.passwordLabel)).matches(x.passwordValidate,a.passwordValidation),confirm_password:y().trim().required(a.requiredErrors(a.confirmPasswordLabel)).oneOf([W("password")],a.passwordInvalidErrors(a.confirmPasswordLabel)).matches(x.passwordValidate,a.passwordInvalidErrors(a.confirmPasswordLabel))}),onSubmit:(e,{resetForm:t})=>{v(e),t({})}});return s.jsx(T,{...c({cy:"reset-password",cyScope:"reset-password"}),children:s.jsx(k,{fluid:!0,children:s.jsxs(E,{children:[s.jsx(F,{as:f,sm:12,md:6,lg:6,children:s.jsx(H,{userType:"AuthUser"})}),s.jsxs(G,{as:f,md:6,sm:12,lg:6,children:[s.jsx(V,{children:s.jsxs(g,{className:"back-btn",children:[s.jsx(n,{src:M,alt:"Back Arrow",width:"5px",height:"12px"}),s.jsx("span",{onClick:()=>h("/"),style:{cursor:"pointer"},children:a.backToWebsite})]})}),s.jsx(A,{children:s.jsx(n,{src:D,alt:"Brand Logo",width:"324px",height:"24px"})}),w.pathname==="/reset"&&s.jsxs(s.Fragment,{children:[s.jsx(q,{className:"user-password-reset-title",children:s.jsx(U,{className:"pass-reset-password",children:a.passwordResetFormTitle})}),s.jsx(K,{className:"password-reset-wrapper",children:s.jsxs(i,{className:"login-form",onSubmit:o.handleSubmit,children:[s.jsxs(i.Group,{controlId:"formBasicPassword",className:"form-group",children:[s.jsxs(d,{children:[s.jsx(i.Control,{type:l?"text":"password",placeholder:"New password",id:"password",maxLength:30,name:"password",value:o.values.password,onChange:o.handleChange,...c({cy:"password-input"})}),s.jsx(d.Text,{onClick:N,style:{cursor:"pointer"},children:s.jsx(n,{src:l?j:b,alt:"Toggle Password Visibility",width:"24px",height:"24px"})})]}),o.touched.password&&o.errors.password&&s.jsx("div",{className:"error",children:s.jsx("p",{children:o.errors.password})})]}),s.jsxs(i.Group,{controlId:"formBasicPassword",className:"form-group",children:[s.jsxs(d,{children:[s.jsx(i.Control,{type:m?"text":"password",placeholder:"Confirm password",id:"confirm_password",maxLength:30,name:"confirm_password",value:o.values.confirm_password,onChange:o.handleChange,...c({cy:"confirm-password-input"})}),s.jsx(d.Text,{onClick:P,style:{cursor:"pointer"},children:s.jsx(n,{src:m?j:b,alt:"Toggle Password Visibility",width:"24px",height:"24px"})})]}),o.touched.confirm_password&&o.errors.confirm_password&&s.jsx("div",{className:"error",children:s.jsx("p",{children:o.errors.confirm_password})})]}),s.jsx($,{children:s.jsxs(g,{variant:"primary",type:"submit",className:"btn-primary",...c({cy:"reset-submit"}),children:[" ",a.submitBtn,(r==null?void 0:r.isLoading)&&s.jsx("span",{className:"btnloader"})]})})]})})]})]})]})})})};export{cs 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.