1import{c as F,r as P,T as l,Q as n,p as c,o as R,j as s,V as k,O as L,L as _,P as q,A as m,I as p,a as u}from"./index-CSsSX63M.js";import{c as C,a as x,b as A}from"./array-B3IpfnYJ.js";import"./yup-phone-lite.umd-BMK6MQUK.js";import{F as S,u as T}from"./formik.esm-Ds4G5QVy.js";import{F as h}from"./index-CFybYxvh.js";/* empty css */import"./_baseIsEqual-BX7DFWO2.js";import"./isSymbol-B0mMddTw.js";import"./VisibilityOffOutlined-DLoDJ1q5.js";import"./CheckCircle-pApJjfBY.js";import"./OverlayTrigger-DxqfTLm5.js";import"./useTimeout-DMefeYIR.js";import"./mergeOptionsWithPopperConfig-Kl50-gi5.js";import"./useIsomorphicEffect-DOgrT-SO.js";import"./HelpOutlined-CNQRJ5wk.js";import"./InputGroup-zGKUiPgd.js";import"./InputGroupContext-Dv2-VhGw.js";const D=()=>{const d=F(),[g,j]=P.useState({}),r=new URLSearchParams(location.search).get("unique_registration_id"),{data:i,isFetching:f,isFetched:v}=l.useRegistrationIdStatus({unique_registration_id:r}),o=l.useCreateAdminUserPassword({onSuccess:e=>{n(!0,"",e.message),d(`${c.accountLogin.linkToRoute}`),g.resetForm()},onError:e=>{n(!1,"",e)}}),{t:a}=R(),w=C({password:x().required(a("Required*")),confirmPassword:x().required(a("Required*")).oneOf([A("password"),null],"Passwords do not match")}),b=async(e,t)=>{j(t);const N={password:e.password,confirm_password:e.confirmPassword,unique_registration_id:r};r?o.mutate(N):n(!1,"","User not found")},y=()=>{const{handleSubmit:e}=T();return s.jsx(s.Fragment,{children:i!=null&&i.is_valid_link?s.jsxs(L.Body,{className:"mh-100 px-sm-5 m-auto",children:[s.jsx("div",{className:"text-center mb-5 pb-5",children:s.jsx(_,{to:"/",className:"logo-dark",children:s.jsx("span",{children:s.jsx("img",{src:q,alt:"",height:"40"})})})}),!!r&&s.jsx(m,{variant:"success",className:"my-2 m-auto tag-bg-success mb-4",style:{maxWidth:"600px"},children:s.jsxs("div",{className:"d-flex flex-gap-1/2",children:[s.jsx("div",{children:s.jsx("i",{className:"mdi mdi-check"})}),s.jsx("p",{style:{color:"#217337"},children:"Your email has been verified. Complete account registration by creating a password."})]})}),s.jsxs("div",{style:{maxWidth:"500px"},className:"m-auto",children:[s.jsx(h,{as:p,sm:"4",controlId:"validationPassword",label:"Password",type:"password",name:"password",placeholder:a("Type your desired password"),className:"pb-sm-3 pb-2"}),s.jsx(h,{as:p,sm:"4",controlId:"validationPasswordConfirm",label:"Confirm Password",type:"password",name:"confirmPassword",placeholder:a("Type your desired password"),className:"pb-sm-3 pb-2",hidePasswordMeter:!0}),s.jsx("div",{className:"d-grid mb-0 text-center h-50 mt-2",children:s.jsx(u,{variant:"primary",type:"submit",onClick:e,loading:o.isLoading,loadingLabel:a("Registering..."),children:a("Register")})})]})]}):s.jsx(s.Fragment,{children:v?s.jsxs("div",{className:"m-auto",children:[s.jsx(m,{variant:"danger",className:"my-2 m-auto mb-4",style:{backgroundColor:"#FFE9E9"},children:s.jsxs("div",{className:"d-flex flex-gap-1/2",children:[s.jsx("div",{children:s.jsx("i",{className:"mdi mdi-cancel"})}),s.jsx("p",{style:{color:"#B92A2A"},children:"The verification link has already expired. Please request for a new one."})]})}),s.jsx("div",{className:"mt-2 text-center",children:s.jsx(u,{variant:"primary",type:"submit",onClick:()=>d(`${c.accountLogin.linkToRoute}`),loading:o.isLoading,loadingLabel:a("Registering..."),className:"px-5",children:a("Back to Login")})})]}):null})})};return s.jsx(s.Fragment,{children:s.jsxs("div",{className:"auth-fluid",children:[s.jsx("div",{className:"auth-fluid-left bg-image-register",children:s.jsx("div",{className:"auth-user-testimonial lead-wrapper",children:s.jsx("div",{className:"px-xxl-2 px-lg-2",children:s.jsx("h1",{className:"qoute-header register-qoute-header",children:a("The easiest and fastest way to create your online store for FREE!")})})})}),s.jsx("div",{className:"auth-fluid-form-box-register account__form--mobile overflow-x-hidden overflow-y-auto d-flex align-items-center",children:f?s.jsx("div",{className:"m-auto",children:s.jsx(k,{})}):s.jsx(s.Fragment,{children:s.jsx(S,{validationSchema:w,onSubmit:(e,t)=>
1b(e,t),initialValues:{password:"",confirmPassword:""},children:s.jsx(y,{})})})})]})})};export{D 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.