(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7373],{54983:function(e,s,a){"use strict";var t=a(57437),r=a(2265),o=a(35041),l=a.n(o),i=a(57818);function n(e){let{text:s,alertType:a}=e,[o,i]=(0,r.useState)(!0);return((0,r.useEffect)(()=>{let e=setTimeout(()=>{i(!1)},6e4);return()=>clearTimeout(e)},[]),o)?(0,t.jsx)("div",{className:"".concat(l().alert," ").concat(l()[a]),children:s}):null}s.Z=(0,i.default)(()=>Promise.resolve(n),{ssr:!1})},87373:function(e,s,a){"use strict";a.r(s),a.d(s,{default:function(){return G}});var t=a(57437),r=a(2265),o=a(69065),l=a(66124),i=a(18559),n=a(87138),d=a(16463),c=a(58323),m=a(9e3),u=a(27270),h=a(99128),p=a(54983),g=a(39381),x=a(14245),f=a(98380),v=e=>{let{email:s}=e,[a,o]=(0,r.useState)(60),l=(0,c.I0)(),[i,n]=(0,r.useState)(!1),u=(0,d.useRouter)(),{loading:h,error:v,errorInfo:j,successData:b}=(0,c.v9)(e=>e.verifyEmailReducer),{loading:y,successData:N,error:w,errorInfo:P}=(0,c.v9)(e=>e.forgotPasswordReducer);(0,r.useEffect)(()=>{let e;return a>0&&(e=setTimeout(()=>{o(a-1)},1e3)),()=>clearTimeout(e)},[a]),(0,r.useEffect)(()=>{N&&o(300)},[N]);let C=(0,g.TA)({initialValues:{verificationCode:""},validationSchema:x.Ry({verificationCode:x.Z_().matches(/^\d{6}$/,"OTP must be exactly 6 digits and should contain only numbers.").matches(/^[^\s]*$/,"OTP should not contain spaces").required("Required")}),onSubmit:e=>{l((0,m.b7B)({email:s,otp:e.verificationCode}))}});return(0,r.useEffect)(()=>{var e,s;if(null==b?void 0:null===(e=b.data)||void 0===e?void 0:e.token){n(!0),localStorage.setItem("token",b.data.token),localStorage.setItem("userId",b.data.id),localStorage.setItem("role",b.data.role),localStorage.setItem("firstName",b.data.firstName),localStorage.setItem("lastName",b.data.lastName),localStorage.setItem("exp",b.data.exp),document.body.style.overflow="",document.body.style.paddingRight="",document.body.classList.remove("modal-open"),(null===(s=b.data)||void 0===s?void 0:s.logo)&&localStorage.setItem("logo",b.data.logo);let e=document.querySelector(".modal-backdrop.fade.show");e&&e.remove(),"ADMIN"===b.data.role&&u.push("/admin/overview"),"EMPLOYER"===b.data.role&&(localStorage.setItem("employerId",b.data.employerId),localStorage.setItem("companyId",b.data.companyId),localStorage.setItem("companyName",b.data.companyName),u.push("/employers-dashboard/dashboard")),"JOB_SEEKER"===b.data.role&&(localStorage.setItem("candidateId",b.data.id),localStorage.getItem("resumeBuilt")||sessionStorage.getItem("resumeBuilt")?window.location.href="/resume-builder/build-resume":u.push("/candidates-dashboard/dashboard")),l((0,m.QW8)())}},[b]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.Z,{text:"OTP send to your email successfully !",alertType:"success"}),i&&(0,t.jsx)(p.Z,{text:"Email verified successfully!",alertType:"success"}),h&&(0,t.jsx)(p.Z,{text:"Verifying, please wait...",alertType:"success"}),v&&(0,t.jsx)(p.Z,{text:j.data,alertType:"danger"}),y&&(0,t.jsx)(p.Z,{text:"Sending OTP, please wait...",alertType:"success"}),w&&(0,t.jsx)(p.Z,{text:"Oops! something went wrong try again...",alertType:"danger"}),P&&(0,t.jsx)(p.Z,{text:"Oops! something went wrong try again...",alertType:"danger"}),b&&C.values.verificationCode&&(0,t.jsx)(t.Fragment,{}),(0,t.jsx)("form",{onSubmit:C.handleSubmit,children:(0,t.jsxs)("div",{className:"form-group",children:[(0,t.jsx)("input",{type:"text",id:"verificationCode",name:"verificationCode",placeholder:"Verification Code",required:!0,value:C.values.verificationCode,onChange:C.handleChange,onBlur:C.handleBlur,onInput:f.L,maxLength:6}),C.touched.verificationCode&&C.errors.verificationCode?(0,t.jsx)("div",{style:{color:"red"},children:C.errors.verificationCode}):null,a>0?(0,t.jsxs)("p",{children:["Time remaining for verification: ",(()=>{let e=Math.floor(a/60),s=a%60;return"".concat(e,":").concat(s<10?"0":"").concat(s)})()]}):(0,t.jsx)("p",{children:"Verification code has expired. Please request a new code."}),a<=270&&(0,t.jsx)("button",{type:"button",onClick:()=>{l((0,m.yyL)({email:s}))},style:{cursor:"pointer",marginLeft:"-35px"},children:"Resend OTP"}),(0,t.jsx)("button",{className:"theme-btn btn-style-one mt-3",type:"submit",disabled:h||0===a||!C.isValid,children:"Verify Email"})]})})]})},j=a(93999),b=e=>{let{phoneNumber:s}=e,[a,o]=(0,r.useState)(300),l=(0,c.I0)(),[i,n]=(0,r.useState)(!1),{successData:d}=(0,c.v9)(e=>e.forgotPasswordReducer),{error:u,successData:h,errorInfo:b}=(0,c.v9)(e=>e.loginReducer),{loading:y,successData:N,error:w,errorInfo:P}=(0,c.v9)(e=>e.verifyPhoneReducer);(0,r.useEffect)(()=>{u&&(j.Am.error((null==b?void 0:b.message)||(null==b?void 0:b.data)||"Something went wrong"),l((0,m.drQ)()))},[u,b]),(0,r.useEffect)(()=>{w&&(j.Am.error((null==P?void 0:P.message)||(null==P?void 0:P.data)||"Something went wrong"),l((0,m.X3b)()))},[w,P]),(0,r.useEffect)(()=>{N&&(j.Am.success("OTP verified successfully"),l((0,m.X3b)()))},[N]),(0,r.useEffect)(()=>{N&&h&&!h.isEmail&&n(!0)},[N,h]),(0,r.useEffect)(()=>{d&&o(300)},[d]),(0,r.useEffect)(()=>{let e;return a>0&&(e=setTimeout(()=>{o(a-1)},1e3)),()=>clearTimeout(e)},[a]);let C=x.Ry().shape({otp:x.Z_().matches(/^\d{6}$/,"OTP must be exactly 6 digits and should contain only numbers.").required("OTP is required").matches(/^[^\s]*$/,"OTP should not contain spaces")}),_=()=>{o(0),l((0,m.yyL)({phoneNumber:s}))},S=()=>{let e=Math.floor(a/60),s=a%60;return"".concat(e,":").concat(s<10?"0":"").concat(s)};return(0,t.jsxs)(t.Fragment,{children:[h&&(0,t.jsx)(p.Z,{text:h.data.data,alertType:"success"}),i?(0,t.jsx)(v,{email:s}):(0,t.jsx)(g.J9,{initialValues:{otp:""},validationSchema:C,onSubmit:e=>{l((0,m.LWv)({phone:s,otp:e.otp}))},children:e=>{let{errors:s,touched:r}=e;return(0,t.jsx)(g.l0,{children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"form-group",children:[(0,t.jsx)(g.gN,{id:"otp",type:"text",name:"otp",placeholder:"Enter OTP",onInput:f.L,maxLength:6}),(0,t.jsx)("div",{style:{color:"red"},children:(0,t.jsx)(g.Bc,{name:"otp",component:"div"})})]}),a>0?(0,t.jsxs)("p",{children:["Time remaining for verification: ",S()]}):(0,t.jsx)("p",{children:"Verification code has expired. Please request a new code."}),a<=270&&(0,t.jsx)("button",{onClick:_,type:"button",style:{cursor:"pointer"},children:"Resend OTP"}),(0,t.jsx)("div",{className:"form-group",children:(0,t.jsx)("button",{className:"theme-btn btn-style-one mt-3",type:"submit",disabled:y,children:"Verify OTP"})})]})})}})]})},y=a(7476),N=a(27903),w=a.n(N);let P=x.Ry().shape({email:x.Z_().matches(/@/,"Email should contain @").max(250,"Email must be at most 250 characters").required("Email is required"),password:x.Z_().matches(/^\S*$/,"Password should not contain spaces").max(250,"Password must be at most 250 characters").required("Password is required")});var C=a(95001),_=a(60335),S=a(7630),I=a(72895),E=a(21192),k=()=>{let e=(0,d.useRouter)(),s=(0,d.usePathname)(),[a,o]=(0,r.useState)(!1),[l,i]=(0,r.useState)(!1),[p,x]=(0,r.useState)(!1),{loading:f,error:j,successData:N,errorInfo:k}=(0,c.v9)(e=>e.loginReducer),[T,O]=(0,r.useState)(!1),[R,L]=(0,r.useState)(""),B=(0,c.I0)(),[Z,D]=(0,r.useState)(!1),{successData:q}=(0,c.v9)(e=>e.verifyEmailReducer),{successData:A}=(0,c.v9)(e=>e.verifyPhoneReducer),{handleForgotPasswordClicked:F,handleLogiWIthOTPClicked:W,handleRegisteredClicked:M,isEmployerLoginClicked:H,closeModal:V}=(0,r.useContext)(C.E),{handleSubmit:G,handleChange:$,handleBlur:z,values:U,touched:K,errors:Q}=(0,g.TA)({initialValues:{email:"",password:""},validationSchema:P,onSubmit:e=>{let a={endPoint:H?I.F5q:"/admin-login"===s?"login":I.ymf,email:e.email,password:e.password};T&&(localStorage.setItem("email",e.email),localStorage.setItem("password",e.password)),B((0,m.yal)(a))}});(0,r.useEffect)(()=>{let e=localStorage.getItem("email"),s=localStorage.getItem("password");e&&s&&(U.email=e,U.password=s,O(!0))},[]);let[J,Y]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{Y(/Edg\//.test(window.navigator.userAgent))},[]),(0,r.useEffect)(()=>{(async()=>{try{var s,a,t,r,l,n;(null==N?void 0:null===(s=N.data)||void 0===s?void 0:s.token)?(localStorage.setItem("token",N.data.token),localStorage.setItem("userId",N.data.id),localStorage.setItem("role",N.data.role),localStorage.setItem("firstName",N.data.firstName),localStorage.setItem("lastName",N.data.lastName),localStorage.setItem("exp",N.data.exp),(null===(a=N.data)||void 0===a?void 0:a.logo)&&localStorage.setItem("logo",N.data.logo),V(),N.data.role===I.qyw?e.push("/admin/overview"):N.data.role===I.i0w||N.data.role===I.tg4?(localStorage.setItem("employerId",N.data.employerId),localStorage.setItem("companyId",N.data.companyId),localStorage.setItem("companyName",N.data.companyName),B((0,m.drQ)()),e.push("/employers-dashboard/dashboard")):N.data.role===I.$_s&&(localStorage.setItem("candidateId",N.data.id),await (0,E.N9)(N.data.token),B((0,m.drQ)()),localStorage.getItem("resumeBuilt")||sessionStorage.getItem("resumeBuilt")?window.location.href="/resume-builder/build-resume":e.push("/candidates-dashboard/dashboard")),B((0,m.drQ)())):N&&(x(null===(t=N.data)||void 0===t?void 0:t.isUserCreated),o(null===(r=N.data)||void 0===r?void 0:r.isEmail),i(null===(l=N.data)||void 0===l?void 0:l.isphoneNumber),L(null==N?void 0:null===(n=N.data)||void 0===n?void 0:n.phone))}catch(e){console.error("Error handling success data:",e)}})()},[N]),(0,r.useEffect)(()=>{A&&i(!0)},[A]),(0,r.useEffect)(()=>{var e;(null==q?void 0:null===(e=q.data)||void 0===e?void 0:e.isEmail)&&o(!0)},[q]),(0,t.jsxs)("div",{className:"form-inner",children:[(0,t.jsx)("div",{className:w().topRightCorner,children:(0,t.jsx)(_.Z,{edge:"end",color:"inherit",onClick:V,"aria-label":"close",className:w().closeButton,children:(0,t.jsx)(S.Z,{})})}),(0,t.jsx)("div",{className:w().loginHeading,children:(0,t.jsx)("h3",{children:"Login to Upadhi"})}),f&&(0,t.jsx)("div",{style:{width:"100%"},children:(0,t.jsx)(h.Z,{})}),j&&(0,t.jsx)(u.Z,{severity:"error",children:(null==k?void 0:k.data)||"Something went wrong"}),p&&!l?(0,t.jsx)(b,{phoneNumber:R}):p&&!a&&l?(0,t.jsx)(v,{email:U.email}):null,!p&&(0,t.jsxs)("form",{className:"mt-2",onSubmit:G,children:[(0,t.jsxs)("div",{className:"form-group",children:[(0,t.jsx)("input",{id:"email",type:"email",name:"email",placeholder:"Email",value:U.email,onChange:$,onBlur:z}),K.email&&Q.email?(0,t.jsx)("div",{className:w().error,children:Q.email}):null]}),(0,t.jsxs)("div",{className:"form-group",children:[(0,t.jsxs)("div",{className:w().inputWrapper,children:[(0,t.jsx)("input",{id:"password",type:Z?"text":"password",name:"password",placeholder:"Password",value:U.password,onChange:$,onBlur:z}),!J&&(0,t.jsx)("button",{className:w().togglePassword,onClick:()=>D(!Z),onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&D(!Z)},tabIndex:0,"aria-label":"Toggle password visibility",type:"button",children:Z?(0,t.jsx)(y.rzC,{}):(0,t.jsx)(y.rDJ,{})})]}),K.password&&Q.password&&(0,t.jsx)("div",{className:w().error,children:Q.password})]}),(0,t.jsxs)("div",{className:"form-group",children:[(0,t.jsx)("div",{className:"field-outer",children:(0,t.jsxs)("div",{className:"input-group checkboxes square",children:[(0,t.jsx)("input",{type:"checkbox",name:"remember-me",id:"remember",checked:T,onChange:()=>O(!T)})," ",(0,t.jsxs)("label",{htmlFor:"remember",className:"remember",children:[(0,t.jsx)("span",{className:"custom-checkbox"})," Remember me"]})]})}),(0,t.jsx)("div",{className:w().forgotPassword,children:(0,t.jsx)(n.default,{href:"#",className:"call-modal signup",onClick:F,children:"Forgot Password?"})})]}),(0,t.jsx)("div",{className:"form-group",children:(0,t.jsx)("button",{className:"theme-btn btn-style-one",disabled:f,type:"submit",children:f?"Logging In...":"Login"})}),(0,t.jsx)("div",{className:"bottom-box",children:(0,t.jsx)(n.default,{href:"#",className:"call-modal signup",onClick:W,children:"Use OTP to LogIn"})})]}),p&&a&&l&&(0,t.jsxs)("form",{className:"mt-2",children:[(0,t.jsxs)("div",{className:"form-group",children:[(0,t.jsx)("input",{id:"email",type:"email",name:"firstName",placeholder:"Email",required:!0,value:U.email,onChange:$,onBlur:z}),K.email&&Q.email?(0,t.jsx)("div",{className:w().error,children:Q.email}):null]}),(0,t.jsxs)("div",{className:"form-group",children:[(0,t.jsx)("div",{className:w().inputWrapper,children:(0,t.jsx)("input",{id:"password",type:Z?"text":"password",name:"password",placeholder:"Password",required:!0,value:U.password,onChange:$,onBlur:z})}),K.password&&Q.password?(0,t.jsx)("div",{className:w().error,children:Q.password}):null]}),(0,t.jsxs)("div",{className:"form-group",children:[(0,t.jsx)("div",{className:"field-outer",children:(0,t.jsxs)("div",{className:"input-group checkboxes square",children:[(0,t.jsx)("input",{type:"checkbox",name:"remember-me",id:"remember"}),(0,t.jsxs)("label",{htmlFor:"remember",className:"remember",children:[(0,t.jsx)("span",{className:"custom-checkbox"})," Remember me"]})]})}),(0,t.jsx)("div",{className:w().forgotPassword,children:(0,t.jsx)(n.default,{href:"#",className:"call-modal signup","data-bs-toggle":"modal","data-bs-target":"#forgotPasswordModel",children:"Forgot Password?"})})]}),(0,t.jsx)("div",{className:"form-group"}),(0,t.jsx)("div",{className:"bottom-box",children:(0,t.jsx)(n.default,{href:"#",className:"signup",onClick:W,children:"Use OTP to Login"})})]}),(0,t.jsx)("div",{className:"bottom-box",children:(0,t.jsxs)("div",{className:"text",children:["Don't have an account?"," ",(0,t.jsx)(n.default,{href:"#",className:"call-modal signup",style:{color:"#1967d2"},onClick:e=>{e.preventDefault(),"/register"===s?V():M()},children:"Signup"})]})})]})};let T=x.Ry().shape({otp:x.Z_().required("OTP is required.").matches(/^[^\s]*$/,"OTP should not contain spaces").matches(/^\d{6}$/,"OTP must be a 6-digit number without alphabets.").min(6,"OTP must be exactly 6 digits.").max(6,"OTP must be exactly 6 digits."),password:x.Z_().min(8,"Password is too short - should be 8 chars minimum.").max(15,"Password is too long - should be 15 chars maximum.").matches(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,15}$/,"Password must contain: a capital letter, a number, and a special character.").test("no-space","Password cannot contain spaces",e=>e&&!/\s/.test(e)).when("oldPassword",(e,s)=>e?s.notOneOf([x.iH("oldPassword")],"password cannot be the same as old password."):s).required("New password is required"),confirmpassword:x.Z_().min(8,"Password is too short - should be 8 chars minimum.").max(15,"Password is too long - should be 15 chars maximum.").matches(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,15}$/,"Password must contain: a capital letter, a number, and a special character.").oneOf([x.iH("password"),null],"Passwords must match").required("Confirm password is required")});var O=a(61287),R=e=>{let{handleResetModalClose:s}=e,a=(0,c.v9)(e=>e),[o,l]=(0,r.useState)(10),[i,u]=(0,r.useState)(!1),[h,x]=(0,r.useState)(!1),[v,b]=(0,r.useState)(!1),[N,P]=(0,r.useState)(""),{loading:I,error:E,successData:k,errorInfo:R}=(0,c.v9)(e=>e.resetPasswordReducer),{handleButtonClick:L,closeModal:B}=(0,r.useContext)(C.E),[Z,D]=(0,r.useState)(""),q=(0,d.useRouter)(),[A,F]=(0,r.useState)(!1),W=(0,c.I0)(),M=localStorage.getItem("email")||"",{loading:H,error:V,successData:G,errorInfo:$}=(0,c.v9)(e=>e.forgotPasswordReducer);(0,r.useEffect)(()=>{(null==k?void 0:k.data)&&F(!0),E&&(F(!1),D((null==R?void 0:R.data)||"Something went wrong"))},[k,E,a,q]);let{handleSubmit:z,handleChange:U,handleBlur:K,values:Q,touched:J,errors:Y,setFieldValue:X}=(0,g.TA)({initialValues:{otp:"",password:"",confirmpassword:"",email:M},validationSchema:T,onSubmit:e=>{W((0,m.gvj)(e))}});return(0,r.useEffect)(()=>{let e;return Z&&(e=setTimeout(()=>{D("")},4e3)),()=>{clearTimeout(e)}},[Z]),(0,r.useEffect)(()=>{let e;return o>0&&(e=setTimeout(()=>{l(o-1)},1e3)),()=>clearTimeout(e)},[o]),(0,r.useEffect)(()=>{G&&l(300)},[G]),(0,r.useEffect)(()=>{V&&(j.Am.error((null==$?void 0:$.message)||(null==$?void 0:$.data)||"An error occurred "),W((0,m.jGL)()))},[V,$]),(0,r.useEffect)(()=>{var e;(null==G?void 0:null===(e=G.data)||void 0===e?void 0:e.message)&&(P(G.data.message),b(!0),setTimeout(()=>{b(!1)},6e3))},[G]),(0,t.jsxs)("div",{className:"form-inner",children:[(0,t.jsx)("div",{className:w().topRightCorner,children:(0,t.jsx)(_.Z,{edge:"end",color:"inherit",onClick:B,"aria-label":"close",className:w().closeButton,children:(0,t.jsx)(S.Z,{})})}),(0,t.jsx)("div",{className:w().resetPasswordHeading,children:(0,t.jsx)("h3",{children:"Reset Password"})}),v&&(0,t.jsx)("label",{style:{color:"green"},children:N}),k?(0,t.jsx)(p.Z,{text:"Password Change success fully",alertType:"success"}):null,Z&&(0,t.jsx)("p",{className:w().error,children:Z}),!A&&(0,t.jsxs)("form",{children:[(0,t.jsxs)("div",{className:"form-group",children:[(0,t.jsx)("input",{id:"otp",type:"text",name:"otp",placeholder:"Enter OTP",onChange:U,onBlur:K,value:Q.otp,onInput:f.L,maxLength:6}),J.otp&&Y.otp?(0,t.jsx)("div",{className:w().error,children:Y.otp}):null]}),(0,t.jsxs)("div",{className:"form-group",children:[(0,t.jsxs)("div",{className:w().inputWrapper,children:[(0,t.jsx)("input",{id:"password",type:i?"text":"password",name:"password",placeholder:"Enter Password",onChange:U,onBlur:K,value:Q.password}),(0,t.jsx)("button",{type:"button",className:w().togglePassword,onClick:()=>u(!i),onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&u(!i)},children:i?(0,t.jsx)(y.rzC,{}):(0,t.jsx)(y.rDJ,{})})]}),J.password&&Y.password?(0,t.jsx)("div",{className:w().error,children:Y.password}):null]}),(0,t.jsxs)("div",{className:"form-group",children:[(0,t.jsxs)("div",{className:w().inputWrapper,children:[(0,t.jsx)("input",{id:"confirmpassword",type:h?"text":"password",name:"confirmpassword",placeholder:"Enter Password Again",onChange:U,onBlur:K,value:Q.confirmpassword}),(0,t.jsx)("button",{type:"button",className:w().togglePassword,onClick:()=>x(!h),onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&x(!h)},tabIndex:"0",children:h?(0,t.jsx)(y.rzC,{}):(0,t.jsx)(y.rDJ,{})})]}),J.confirmpassword&&Y.confirmpassword?(0,t.jsx)("div",{className:w().error,children:Y.confirmpassword}):null]}),o>0?(0,t.jsxs)("p",{className:w().timeLeftText,children:["Time remaining for verification: ",(()=>{let e=Math.floor(o/60),s=o%60;return"".concat(e,":").concat(s<10?"0":"").concat(s)})()]}):(0,t.jsx)("p",{children:"Verification code has expired. Please request a new code."}),o<=270&&(0,t.jsx)(t.Fragment,{children:H?(0,t.jsx)(O.Z,{size:24}):(0,t.jsx)("button",{type:"button",onClick:()=>{W((0,m.yyL)({email:Q.email})),localStorage.setItem("email",Q.email)},children:"Resend OTP"})}),(0,t.jsx)("div",{className:"form-group",children:(0,t.jsx)("button",{className:"theme-btn btn-style-one",onClick:z,children:I?"Loading...":"Submit"})})]}),A&&(0,t.jsx)("div",{style:{display:"flex",justifyContent:"center"},children:(0,t.jsx)(n.default,{href:"#",className:"call-modal login theme-btn btn-style-one",style:{width:"200px",textAlign:"center"},onClick:()=>{F(!1),X("otp",""),X("password",""),X("confirmpassword",""),l(0),W((0,m.oNE)()),L()},children:"LogIn"})})]})};let L=x.Ry().shape({email:x.Z_().max(250,"Email must be at most 250 characters").email("Invalid email").required("Email is required")});var B=()=>{let e=(0,c.I0)(),{loading:s,error:a,successData:o,errorInfo:l}=(0,c.v9)(e=>e.forgotPasswordReducer),[i,d]=(0,r.useState)(""),[u,h]=(0,r.useState)(""),{handleSubmit:p,handleChange:x,handleBlur:f,values:v,touched:j,errors:b,setFieldValue:y}=(0,g.TA)({initialValues:{email:""},validationSchema:L,onSubmit:s=>{e((0,m.yyL)(s)),localStorage.setItem("email",s.email)}});(0,r.useEffect)(()=>()=>{e((0,m.jGL)())},[]),(0,r.useEffect)(()=>{if(a){d((null==l?void 0:l.data)||"An error occurred. Please try again.");let e=setTimeout(()=>{d("")},5e3);return()=>clearTimeout(e)}if(o){if(o.error){d(o.error);let e=setTimeout(()=>{d("")},5e3);return()=>clearTimeout(e)}h(!0),y("email","")}},[a,l,o]);let{handleButtonClick:N,closeModal:P}=(0,r.useContext)(C.E);return(0,t.jsx)("div",{className:"form-inner",children:u?(0,t.jsx)(R,{handleResetModalClose:()=>{h(!1)}}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:w().topRightCorner,children:(0,t.jsx)(_.Z,{edge:"end",color:"inherit",onClick:P,"aria-label":"close",className:w().closeButton,children:(0,t.jsx)(S.Z,{})})}),(0,t.jsx)("div",{className:w().forgotPasswordHeading,children:"Forgot Password"}),i&&(0,t.jsx)("div",{className:"error-message ".concat(w().errormessage),children:i}),(0,t.jsx)("br",{}),(0,t.jsxs)("form",{method:"post",children:[(0,t.jsxs)("div",{className:"form-group",children:[(0,t.jsx)("label",{htmlFor:"email",children:"Please Enter Username or Email"}),(0,t.jsx)("input",{id:"email",type:"email",name:"email",placeholder:"Email",required:!0,value:v.email,onChange:x,onBlur:f}),j.email&&b.email?(0,t.jsx)("div",{className:"error-message ".concat(w().errormessage),children:b.email}):null]}),(0,t.jsx)("div",{className:"form-group",children:(0,t.jsx)("button",{className:"theme-btn btn-style-one",type:"submit",name:"log-in",onClick:p,children:s?"Loading...":"Get OTP"})}),(0,t.jsx)("div",{className:"bottom-box",children:(0,t.jsx)("div",{className:"text",children:(0,t.jsx)(n.default,{href:"#",className:"call-modal login",style:{color:"#1967D2"},onClick:N,children:"Back to LogIn"})})})]})]})})};let Z=x.Ry().shape({otp:x.Z_().required("OTP is required").matches(/^[^\s]*$/,"OTP should not contain spaces").length(6,"OTP must contains exactly 6 digits long")}),D=x.Ry().shape({phoneNumber:x.Z_().required("Phone number is required").matches(/^[1-9]\d*$/,"Phone number must only contain numbers and cannot start with 0").test("not-all-zeros","Phone number cannot be all zeros",e=>e!=="0".repeat(e.length)).length(10,"Phone number must be exactly 10 digits long")});var q=e=>{let{phoneNumber:s}=e,a=(0,c.I0)(),o=(0,d.useRouter)(),[l,i]=(0,r.useState)(!1),[n,u]=(0,r.useState)(!1),{loading:h,successData:p,errorInfo:x}=(0,c.v9)(e=>e.loginWithOtpReducer),{loading:v,successData:b,error:y,errorInfo:N}=(0,c.v9)(e=>e.verifyEmailReducer),{closeModal:P}=(0,r.useContext)(C.E),{handleSubmit:E,handleChange:k,handleBlur:T,values:O,touched:R,errors:L,setFieldValue:B}=(0,g.TA)({initialValues:{otp:""},validationSchema:Z,onSubmit:e=>{var t,r;if((null==p?void 0:p.data)&&Object.keys(null==p?void 0:p.data).includes("isEmail")&&!(null==p?void 0:null===(t=p.data)||void 0===t?void 0:t.isEmail)){let s={otp:e.otp,email:null==p?void 0:null===(r=p.data)||void 0===r?void 0:r.email};a((0,m.b7B)(s))}else{let t={otp:e.otp,phoneNumber:s};a((0,m.J6d)(t))}}});return(0,r.useEffect)(()=>{var e,s,t,r,l;if((null==p?void 0:null===(e=p.data)||void 0===e?void 0:e.token)||(null==b?void 0:null===(s=b.data)||void 0===s?void 0:s.token)){let e;(null==p?void 0:null===(t=p.data)||void 0===t?void 0:t.token)&&(e=p),(null==b?void 0:null===(r=b.data)||void 0===r?void 0:r.token)&&(e=b),localStorage.setItem("token",e.data.token),localStorage.setItem("role",e.data.role),localStorage.setItem("userId",e.data.id),localStorage.setItem("firstName",e.data.firstName),localStorage.setItem("lastName",e.data.lastName),localStorage.setItem("exp",e.data.exp),(e.data.role===I.i0w||e.data.role===I.tg4)&&(localStorage.setItem("employerId",e.data.employerId),localStorage.setItem("companyId",e.data.companyId),localStorage.setItem("companyName",e.data.companyName),o.push("/employers-dashboard/dashboard")),e.data.role===I.$_s&&(localStorage.setItem("candidateId",e.data.id),localStorage.getItem("resumeBuilt")||sessionStorage.getItem("resumeBuilt")?window.location.href="/resume-builder/build-resume":o.push("/candidates-dashboard/dashboard")),(null===(l=e.data)||void 0===l?void 0:l.logo)&&localStorage.setItem("logo",e.data.logo),e.data.role===I.qyw&&o.push("/admin/overview"),a((0,m.bHV)()),P()}},[p,b]),(0,r.useEffect)(()=>{p&&(i(!0),B("otp",""))},[p]),(0,r.useEffect)(()=>{x&&u(!0),(N||y)&&(j.Am.error((null==N?void 0:N.data)||(null==N?void 0:N.message)||"Something went wrong.Email not verified"),a((0,m.QW8)()))},[x,N,y]),(0,t.jsxs)("form",{children:[(0,t.jsx)("div",{className:w().topRightCorner,children:(0,t.jsx)(_.Z,{edge:"end",color:"inherit",onClick:P,"aria-label":"close",className:w().closeButton,children:(0,t.jsx)(S.Z,{})})}),(0,t.jsx)("h3",{children:"OTP Verification"}),l&&(0,t.jsx)("p",{className:w().sendOtpSuccessDataTextColor,children:null==p?void 0:p.data.message}),n&&(0,t.jsx)("p",{className:w().errormessage,children:(null==x?void 0:x.data)||(null==N?void 0:N.data)}),y&&(0,t.jsx)("p",{className:"text-danger",children:(null==N?void 0:N.data)||(null==N?void 0:N.message)}),(0,t.jsxs)("div",{className:"form-group",children:[(0,t.jsx)("input",{id:"otp",type:"text",name:"otp",placeholder:"Enter OTP",onInput:f.L,onChange:k,onBlur:T,value:O.otp,maxLength:6}),R.otp&&L.otp?(0,t.jsx)("div",{className:"error-message ".concat(w().errormessage),children:L.otp}):null]}),(0,t.jsx)("button",{type:"button",className:"mr-5 ".concat(w().resendOtpButton),onClick:()=>{a((0,m.J6d)({phoneNumber:s}))},children:"Resend OTP"}),(0,t.jsx)("div",{className:"form-group",children:(0,t.jsx)("button",{type:"submit",className:"theme-btn btn-style-one mt-3",disabled:h||v,onClick:E,children:h||v?"Please wait...":"Verify OTP"})})]})},A=()=>{let e=(0,c.I0)(),[s,a]=(0,r.useState)(!1),{handleButtonClick:o,closeModal:l}=(0,r.useContext)(C.E),{loading:i,successData:d,errorInfo:u}=(0,c.v9)(e=>e.loginWithOtpReducer),{handleSubmit:h,handleChange:p,handleBlur:x,values:v,touched:b,errors:y}=(0,g.TA)({initialValues:{phoneNumber:""},validationSchema:D,onSubmit:s=>{let a={phoneNumber:s.phoneNumber};e((0,m.J6d)(a))}});return((0,r.useEffect)(()=>()=>{e((0,m.bHV)())},[]),(0,r.useEffect)(()=>{d&&a(!0)},[d]),(0,r.useEffect)(()=>{u&&j.Am.error((null==u?void 0:u.data)||"Something went wrong")},[u]),s)?(0,t.jsx)(q,{phoneNumber:v.phoneNumber}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:w().topRightCorner,children:(0,t.jsx)(_.Z,{edge:"end",color:"inherit",onClick:l,"aria-label":"close",className:w().closeButtonOfForgotPassword,children:(0,t.jsx)(S.Z,{})})}),(0,t.jsx)("div",{className:w().loginWithOtpHeading,children:(0,t.jsx)("h3",{children:"Login to Upadhi"})})," ",(0,t.jsxs)("form",{method:"post",children:[(0,t.jsxs)("div",{className:"form-group",children:[(0,t.jsx)("label",{htmlFor:"phoneNumber",children:"Login with Mobile Number"}),(0,t.jsx)("input",{id:"phoneNumber",type:"tel",pattern:"[0-9]*",name:"phoneNumber",onInput:f.L,placeholder:"Enter Mobile Number Linked to Upadhi.ai",required:!0,onChange:p,onBlur:x,value:v.phoneNumber,maxLength:10}),b.phoneNumber&&y.phoneNumber?(0,t.jsx)("div",{className:"error ".concat(w().errormessage),children:y.phoneNumber}):null]}),(0,t.jsx)("div",{className:"form-group",children:(0,t.jsx)("button",{className:"theme-btn btn-style-one",disabled:i,name:"log-in",onClick:h,children:i?"Loading...":"Get OTP"})}),(0,t.jsx)("div",{className:"bottom-box",children:(0,t.jsx)("div",{className:"text",children:(0,t.jsx)(n.default,{href:"#",className:"call-modal login",onClick:o,style:{color:"#1967D2"},children:"Back to LogIn"})})})]})]})},F=a(7999),W=a(75519),M=e=>{let{handleButtonClick:s,handleEmployerLoginClicked:a}=e;return(0,t.jsxs)(F.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,height:"50vh"},children:[(0,t.jsx)(W.Z,{variant:"contained",onClick:s,sx:{width:"100%",borderRadius:"8px"},children:"Job Seeker"}),(0,t.jsx)(W.Z,{variant:"outlined",onClick:a,sx:{width:"100%",borderRadius:"8px"},children:"Employer"})]})},H=a(80824),V=a(19337),G=r.memo(()=>{let{isButtonClicked:e,handleButtonClick:s,handleEmployerLoginClicked:a,isEmployerLoginClicked:n,isForgotPasswordClicked:d,handleForgotPasswordClicked:c,isRegisteredButtonClicked:m,handleRegisteredClicked:u,isLoginWithOTPClicked:h,handleLogiWIthOTPClicked:p,closeModal:g,handleMobileLoginClicked:x,isMobileLoginClicked:f}=(0,r.useContext)(C.E);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{id:"loginPopupModal",children:(0,t.jsx)(o.Z,{open:e||n,onClose:e?s:a,fullWidth:!0,PaperProps:{style:{width:"500px",borderRadius:"8px",maxHeight:"900px"}},children:(0,t.jsx)(l.Z,{children:(0,t.jsx)("div",{className:"login-form default-form py-3 ",children:(0,t.jsx)(k,{})})})})}),(0,t.jsx)("div",{id:"mobileLoginModel",children:(0,t.jsxs)(o.Z,{open:f,onClose:x,maxWidth:"sm",fullWidth:!0,PaperProps:{style:{maxWidth:"500px",borderRadius:"8px"}},children:[(0,t.jsx)(H.Z,{sx:{backgroundColor:"#1967d2",color:"#ffffff"},children:(0,t.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,t.jsx)("h4",{className:"mb-0",children:"Login to Upadhi"}),(0,t.jsx)(_.Z,{"aria-label":"close",onClick:x,sx:{color:"#ffffff",padding:0},children:(0,t.jsx)(V.Z,{fontSize:"small"})})]})})," ",(0,t.jsx)(l.Z,{children:(0,t.jsx)("div",{className:"login-form default-form",children:(0,t.jsx)(M,{handleButtonClick:s,handleEmployerLoginClicked:a})})})]})}),(0,t.jsx)("div",{id:"registerModal",children:(0,t.jsxs)(o.Z,{open:m,onClose:u,maxWidth:"sm",fullWidth:!0,PaperProps:{style:{width:"500px",borderRadius:"8px"}},children:[" ",(0,t.jsx)(l.Z,{children:(0,t.jsx)("div",{className:"login-form default-form",children:(0,t.jsx)(i.default,{})})})]})}),(0,t.jsx)("div",{id:"resetPasswordModel",children:(0,t.jsxs)(o.Z,{open:d,onClose:c,maxWidth:"sm",fullWidth:!0,PaperProps:{style:{width:"500px",borderRadius:"8px"}},children:[" ",(0,t.jsx)(l.Z,{children:(0,t.jsx)("div",{className:"login-form default-form",children:(0,t.jsx)(B,{})})})]})}),(0,t.jsx)("div",{id:"otpLoginModel",children:(0,t.jsxs)(o.Z,{open:h,onClose:g,maxWidth:"sm",fullWidth:!0,PaperProps:{style:{width:"500px",borderRadius:"8px"}},children:[" ",(0,t.jsx)(l.Z,{children:(0,t.jsx)("div",{className:"login-form default-form",children:(0,t.jsx)(A,{})})})]})})]})})},95001:function(e,s,a){"use strict";a.d(s,{E:function(){return i},w:function(){return c}});var t=a(57437),r=a(9e3),o=a(2265),l=a(58323);let i=(0,o.createContext)(),n={isButtonClicked:!1,isFormVisible:!1,isForgotPasswordVisible:!1,isForgotPasswordClicked:!1,isRegisteredButtonClicked:!1,isLoginWithOTPClicked:!1,isEmployerLoginClicked:!1,isMobileLoginClicked:!1};function d(e,s){switch(s.type){case"TOGGLE_BUTTON_CLICK":return{...e,isButtonClicked:!e.isButtonClicked,isForgotPasswordClicked:!1,isRegisteredButtonClicked:!1,isLoginWithOTPClicked:!1};case"CLOSE_MODAL":return n;case"TOGGLE_FORGOT_PASSWORD":return{...e,isForgotPasswordClicked:!e.isForgotPasswordClicked,isButtonClicked:!1};case"TOGGLE_LOGIN_WITH_OTP":return{...e,isLoginWithOTPClicked:!e.isLoginWithOTPClicked,isButtonClicked:!1};case"TOGGLE_REGISTERED":return{...e,isRegisteredButtonClicked:!e.isRegisteredButtonClicked,isButtonClicked:!1};case"EMPLOYER_LOGIN":return{...e,isEmployerLoginClicked:!e.isEmployerLoginClicked,isButtonClicked:!1};case"MOBILE_LOGIN":return{...e,isMobileLoginClicked:!e.isMobileLoginClicked,isButtonClicked:!1};default:throw Error()}}let c=e=>{let{children:s}=e,[a,c]=(0,o.useReducer)(d,n),m=(0,l.I0)(),u=(0,o.useMemo)(()=>({...a,handleButtonClick:()=>c({type:"TOGGLE_BUTTON_CLICK"}),closeModal:()=>{c({type:"CLOSE_MODAL"}),m((0,r.drQ)()),m((0,r.QW8)()),m((0,r.X3b)()),m((0,r.jGL)()),m((0,r.bHV)())},handleForgotPasswordClicked:()=>c({type:"TOGGLE_FORGOT_PASSWORD"}),handleRegisteredClicked:()=>c({type:"TOGGLE_REGISTERED"}),handleLogiWIthOTPClicked:()=>c({type:"TOGGLE_LOGIN_WITH_OTP"}),handleEmployerLoginClicked:()=>c({type:"EMPLOYER_LOGIN"}),handleMobileLoginClicked:()=>c({type:"MOBILE_LOGIN"})}),[a,m]);return(0,t.jsx)(i.Provider,{value:u,children:s})}},18559:function(e,s,a){"use strict";a.d(s,{default:function(){return V}});var t=a(57437),r=a(77796),o=a(2265),l=a(58323),i=a(9e3),n=a(54983),d=a(14245);let c=d.Z_().required("Phone number is required").matches(/^[1-9]\d*$/,"Phone number cannot start with 0").test("not-all-zeros","Phone number cannot be all zeros",e=>e!=="0".repeat(e.length)).length(10,"Phone number must be exactly 10 digits long"),m=d.Z_().min(8,"Password is too short - should be 8 chars minimum.").max(15,"Password is too long - should be 15 chars maximum.").matches(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*()_+={}\-;':"|.<>?/]).{8,15}$/,"Password must contain a capital letter, a small letter, a number, and a special character.").matches(/^\S*$/,"Password should not contain spaces").required("New password is required"),u=d.Z_().oneOf([d.iH("password"),null],"Passwords must match").required("Confirm password is required"),h=d.Z_().max(30,"First Name must be at most 30 characters").test("no-whitespace","First Name cannot be only whitespace",e=>e&&e.trim().length>0).required("First Name is required"),p=d.Z_().max(30,"Last Name must be at most 30 characters").test("no-whitespace","Last Name cannot be only whitespace",e=>e&&e.trim().length>0).required("Last Name is required"),g=d.Ry().shape({email:d.Z_().matches(/@/,"Email should contain @").max(250,"Email must be at most 250 characters").email("Invalid email").required("Email is required"),password:m,confirmPassword:u,phoneNumber:c,firstName:h,lastName:p});var x=a(39381),f=a(63629),v=a.n(f),j=a(7476);let b=["gmail.com","yahoo.com","outlook.com","protonmail.com","zoho.com","gmx.com","rediffmail.com","aol.com"],y=d.Ry().shape({email:d.Z_().email("Invalid email").max(250,"Email is too long - should be 250 chars maximum.").required("Email is required").test("third-party-domain","Please use company or corporate email",e=>{if(e){let s=e.split("@")[1];return!b.includes(s)}return!1}),password:m,confirmPassword:u,phoneNumber:c,firstName:h,lastName:p,companyName:d.Z_().max(250,"Company Name must be at most 250 characters").test("no-whitespace","Company Name cannot be only whitespace",e=>e&&e.trim().length>0).required("Company Name is required"),location:d.Z_().max(250,"Location must be at most 250 characters").test("no-whitespace","Location cannot be only whitespace",e=>e&&e.trim().length>0).required("Location is required")});var N=a(98380),w=a(17587),P=a(16463),C=a(93999),_=a(95001),S=a(72895),I=a(69065),E=a(80824),k=a(7999),T=a(60335),O=a(66124),R=a(83719),L=a(66858),B=a(10843),Z=a(75519),D=a(91989),q=a(19337),A=e=>{let{router:s}=e,[a,r]=(0,o.useState)(null),[i,n]=(0,o.useState)(""),d=(0,l.I0)(),{loading:c,successData:m,errorInfo:u}=(0,l.v9)(e=>e.postResumeUploadReducer);(0,o.useEffect)(()=>{m&&(C.Am.success("Resume uploaded successfully"),localStorage.removeItem("uploadResume"),d((0,D.t2)()),s.push("/candidates-dashboard/dashboard"))},[m]),(0,o.useEffect)(()=>{u&&(C.Am.error(u),d((0,D.t2)()))},[u]);let h=e=>{if(!["application/pdf","application/vnd.openxmlformats-officedocument.wordprocessingml.document"].includes(e.type)){C.Am.error("Please upload a PDF or DOCX file.");return}if(e.size>4194304){C.Am.error("The file size should be less than 4MB.");return}let s=new FormData;s.append("resumeName",e.name),s.append("resumeFile",e),d((0,D.oN)(s))};return(0,t.jsxs)(I.Z,{open:open,disableBackdropClick:!0,disableEscapeKeyDown:!0,children:[(0,t.jsx)(E.Z,{style:{backgroundColor:"#1967d2",color:"white"},children:(0,t.jsxs)(k.Z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,t.jsx)("span",{children:"Upload Resume"}),(0,t.jsx)(T.Z,{onClick:()=>{localStorage.removeItem("uploadResume"),s.push("/candidates-dashboard/dashboard")},style:{color:"white"},children:(0,t.jsx)(q.Z,{})})]})}),(0,t.jsxs)(O.Z,{children:[(0,t.jsx)(k.Z,{mt:2,mb:2,children:(0,t.jsx)(R.Z,{variant:"body1",gutterBottom:!0,children:"For better job opportunities, please upload your resume."})}),(0,t.jsx)(L.Z,{type:"file",fullWidth:!0,variant:"outlined",inputProps:{accept:".pdf,.docx"},onChange:e=>{let s=e.target.files[0];if(s){let e=s.size/1024/1024,a=s.type;e>4?(n("File size should be less than 4MB"),r(null)):["application/pdf","application/vnd.openxmlformats-officedocument.wordprocessingml.document"].includes(a)?(n(""),r(s)):(n("Only PDF and DOCX files are allowed"),r(null))}}}),i&&(0,t.jsx)(R.Z,{variant:"body2",color:"error",gutterBottom:!0,children:i}),(0,t.jsx)(R.Z,{variant:"body1",gutterBottom:!0,mt:2,children:"Please upload your resume. Only PDF and DOCX files are allowed, and the file size should be less than 4MB."})]}),(0,t.jsx)(B.Z,{children:(0,t.jsx)(k.Z,{display:"flex",justifyContent:"center",width:"100%",children:(0,t.jsx)(Z.Z,{onClick:()=>{a&&h(a)},color:"primary",variant:"contained",disabled:!a||c,children:c?"Uploading":"Upload"})})})]})},F=a(41942),W=e=>{var s,a;let{userType:r}=e,d=(0,P.useRouter)(),c=(0,P.usePathname)(),[m,u]=(0,o.useState)(null),[h,p]=(0,o.useState)(null),[f,b]=(0,o.useState)(!1),[I,E]=(0,o.useState)(!1),[k,T]=(0,o.useState)(!1),[O,R]=(0,o.useState)(!1),[L,B]=(0,o.useState)(!1),Z=(0,l.I0)(),[D,q]=(0,o.useState)({}),W=(0,o.useRef)(null),[M,H]=(0,o.useState)(!1),[V,G]=(0,o.useState)(!1),[$,z]=(0,o.useState)(""),[U,K]=(0,o.useState)(""),[Q,J]=(0,o.useState)(!1),[Y,X]=(0,o.useState)(!1),[ee,es]=(0,o.useState)(!1),[ea,et]=(0,o.useState)(!1),[er,eo]=(0,o.useState)(!1),el=(0,o.useRef)(null),ei=(0,o.useRef)(null),en=()=>{var e;null===(e=W.current)||void 0===e||e.scrollIntoView({behavior:"smooth"})},{closeModal:ed}=(0,o.useContext)(_.E),ec=()=>{let e={};return/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,15}$/.test(password)||(e.password="Password must contain 1 uppercase, 1 lowercase, 1 number, 1 special character and be 8-15 characters long."),confirmPassword?password!==confirmPassword&&(e.confirmPassword="Passwords do not match."):e.confirmPassword="Confirm password is required.",/^[^\s@]{1,64}@[^\s@]{1,255}\.[^\s@]{2,}$/.test(email)||(e.email="Invalid email format."),/^\d{10}$/.test(phoneNumber)||(e.phoneNumber="Phone number must be 10 digits long."),q(e),0===Object.keys(e).length},{loading:em,error:eu,successData:eh,errorInfo:ep}=(0,l.v9)(e=>e.registerReducer),{successData:eg,loading:ex,error:ef,errorInfo:ev}=(0,l.v9)(e=>e.verifyEmailOtpBeforeRegisterReducer),{successData:ej,loading:eb,error:ey,errorInfo:eN}=(0,l.v9)(e=>e.sendEmailOtpBeforeRegisterReducer),{successData:ew,loading:eP,error:eC,errorInfo:e_}=(0,l.v9)(e=>e.verifyPhoneOtpBeforeRegisterReducer),{successData:eS,loading:eI,error:eE,errorInfo:ek}=(0,l.v9)(e=>e.sendPhoneOtpBeforeRegisterReducer),{handleSubmit:eT,handleChange:eO,handleBlur:eR,values:eL,touched:eB,errors:eZ,setFieldError:eD}=(0,x.TA)({initialValues:{email:"",password:"",confirmPassword:"",phoneNumber:"",firstName:"",lastName:"",companyName:"",location:""},validationSchema:"UPADHI_EMPLOYER"===r?y:g,onSubmit:e=>{let s=ec();if(q(s),Object.keys(s).length>0){en();return}let a={email:e.email,password:e.password,confirmPassword:e.confirmPassword,phoneNumber:e.phoneNumber,firstName:e.firstName,lastName:e.lastName,userType:r};"UPADHI_EMPLOYER"===r&&(a={...a,companyName:e.companyName,location:{city:e.location}}),ee&&ea?(Z((0,i.CfZ)(a)),en()):(C.Am.error("Please Verify Email and Phone number "),b(!0),ee?ea||(ei.current.focus(),ei.current.scrollIntoView({behavior:"smooth"}),eD("phoneNumber","Please verify phone number")):(el.current.focus(),el.current.scrollIntoView({behavior:"smooth"}),eD("email","Please verify email")))}});(0,o.useEffect)(()=>{if(null==eh?void 0:eh.success){let{data:e}=eh;switch(localStorage.setItem("token",e.token),localStorage.setItem("userId",e.id),localStorage.setItem("role",e.role),localStorage.setItem("firstName",e.firstName),localStorage.setItem("lastName",e.lastName),localStorage.setItem("exp",e.exp),e.logo&&localStorage.setItem("logo",e.logo),ed(),e.role){case S.qyw:d.push("/admin/overview");break;case S.i0w:localStorage.setItem("employerId",e.employerId),localStorage.setItem("companyId",e.companyId),localStorage.setItem("companyName",e.companyName),d.push("/employers-dashboard/dashboard");break;case S.$_s:localStorage.setItem("candidateId",e.id),"/register"===c?eo(!0):localStorage.getItem("resumeBuilt")||sessionStorage.getItem("resumeBuilt")?window.location.href="/resume-builder/build-resume":d.push("/candidates-dashboard/dashboard")}Z((0,i.Ov4)())}},[eh,Z,d]);let[eq,eA]=(0,o.useState)(!1);(0,o.useEffect)(()=>{eA(/Edg\//.test(window.navigator.userAgent)),localStorage.getItem("token")&&"/register"===c&&localStorage.getItem("uploadResume")&&eo(!0)},[]),(0,o.useEffect)(()=>{if(ej){var e;R(!0),J(!0),u(300),C.Am.success(null==ej?void 0:null===(e=ej.data)||void 0===e?void 0:e.message),Z((0,w.Kj)())}},[ej]),(0,o.useEffect)(()=>{if(eS){var e;B(!0),X(!0),p(300),C.Am.success(null==eS?void 0:null===(e=eS.data)||void 0===e?void 0:e.message),Z((0,i.PTk)())}},[eS]),(0,o.useEffect)(()=>{ey&&(R(!1),J(!1))},[ey]),(0,o.useEffect)(()=>{eE&&(B(!1),X(!1))},[eE]),(0,o.useEffect)(()=>()=>{Z((0,i.jDI)()),Z((0,i.GwL)())},[]),(0,o.useEffect)(()=>{eg&&(R(!1),C.Am.success("Email verified successfully"),Z((0,i.GwL)()),es(!0),u(null))},[eg]),(0,o.useEffect)(()=>{ew&&(B(!1),C.Am.success("Phone number verified successfully"),Z((0,i.jDI)()),et(!0),p(null))},[ew]);let eF=()=>{Z((0,w.rS)({email:eL.email}))},eW=()=>{Z((0,i.lrq)({email:eL.email,otp:$}))},eM=()=>{Z((0,i.ZPN)({phoneNumber:eL.phoneNumber}))},eH=()=>{Z((0,i.fjB)({phone:eL.phoneNumber,otp:U}))};return((0,o.useEffect)(()=>{let e;return m>0&&(e=setTimeout(()=>{u(m-1)},1e3)),()=>clearTimeout(e)},[m]),(0,o.useEffect)(()=>{let e;return h>0&&(e=setTimeout(()=>{p(h-1)},1e3)),()=>clearTimeout(e)},[h]),er)?(0,t.jsx)(A,{router:d}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{style:{color:"white"},ref:W}),(0,t.jsxs)("div",{children:[Object.entries(D).map(e=>{let[s,a]=e;return(0,t.jsx)(n.Z,{text:a,alertType:"danger"},s)}),em&&(0,t.jsx)(n.Z,{text:"Registering, please wait...",alertType:"success"}),eu&&(0,t.jsx)(n.Z,{text:null==ep?void 0:ep.data,alertType:"danger"}),(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault(),eT()},style:{paddingRight:"16px"},children:[(0,t.jsxs)("div",{className:"form-group",children:[(0,t.jsx)("input",{id:"firstName",type:"text",name:"firstName",placeholder:"First Name",required:!0,value:eL.firstName,onChange:eO,onBlur:eR}),eB.firstName&&eZ.firstName?(0,t.jsx)("div",{className:"text-danger",children:eZ.firstName}):null]}),(0,t.jsxs)("div",{className:"form-group",children:[(0,t.jsx)("input",{id:"lastName",type:"text",name:"lastName",placeholder:"Last Name",required:!0,value:eL.lastName,onChange:eO,onBlur:eR}),eB.lastName&&eZ.lastName?(0,t.jsx)("div",{className:"text-danger",children:eZ.lastName}):null]}),(0,t.jsxs)("div",{className:"form-group",children:[(0,t.jsxs)("div",{className:v().inputContainer,children:[(0,t.jsx)("input",{type:"email",id:"email",name:"email",placeholder:"Email",required:!0,value:eL.email,className:" ".concat(f&&!ee?v().shake:""),onChange:e=>{eO(e),E(e.target.value.length>0),ey&&(Z((0,w.Kj)()),E(!0),J(!1))},onBlur:eR,disabled:Q||eb,ref:el,onKeyDown:e=>{"Enter"===e.key&&eF()}}),O&&(0,t.jsx)("button",{type:"button",className:v().cancelButton,onClick:()=>{R(!1),J(!1),z(""),u(null)},children:(0,t.jsx)(F.fmQ,{})})]}),eB.email&&eZ.email?(0,t.jsx)("div",{className:"text-danger",children:eZ.email}):null,ey&&(0,t.jsx)("p",{style:{color:"red"},children:(null==eN?void 0:eN.data)||"Something went wrong"}),!Q&&I&&(0,t.jsx)("div",{className:"d-flex flex-row justify-content-end mt-2",children:(0,t.jsx)("button",{type:"button",className:"theme-btn btn-style-one small ".concat(f?v().shake:""),style:{width:"auto",padding:"0.5rem 1rem"},disabled:eb,onClick:eF,onKeyDown:e=>{"Enter"===e.key&&eF()},children:eb?"Sending OTP...":"Send OTP"})})]}),!eg&&(0,t.jsxs)(t.Fragment,{children:[m>0&&(0,t.jsxs)("p",{className:v().timeLeftText,children:["Time remaining for verification: ",(()=>{let e=Math.floor(m/60),s=m%60;return"".concat(e,":").concat(s<10?"0":"").concat(s)})()]}),0===m&&(0,t.jsx)("p",{className:v().timeLeftText,children:"OTP expired. Please use resend OTP."}),null!==m&&(m<=270||0===m)&&(0,t.jsx)("div",{className:"d-flex flex-row justify-content-start mt-2 mb-2",children:(0,t.jsx)("button",{type:"button",className:"theme-btn btn-style-four small",style:{width:"auto",padding:"0.5rem 1rem"},onClick:eF,disabled:eb,children:eb?"Sending OTP...":"Resend OTP"})})]}),O&&(0,t.jsxs)("div",{className:"form-group",children:[ej&&(0,t.jsx)(n.Z,{text:null==ej?void 0:null===(s=ej.data)||void 0===s?void 0:s.message,alertType:"danger"}),(0,t.jsx)("input",{type:"text",id:"otp",name:"otp",placeholder:"Enter OTP",value:$,disabled:ex,onChange:e=>z(e.target.value),onInput:N.L,maxLength:6,onKeyDown:e=>{"Enter"===e.key&&eW()}}),ef&&(0,t.jsx)("p",{style:{color:"red"},children:ev.data}),(0,t.jsx)("div",{className:"d-flex flex-row mt-2",children:(0,t.jsx)("button",{type:"button",className:"theme-btn btn-style-one small",style:{width:"auto",padding:"0.5rem 1rem",marginRight:"10px"},disabled:ex||6!==$.length,onClick:eW,onKeyDown:e=>{"Enter"===e.key&&eW()},children:ex?"Verifying OTP...":"Verify OTP"})})]}),(0,t.jsxs)("div",{className:"form-group",children:[(0,t.jsxs)("div",{className:v().inputWrapper,children:[(0,t.jsx)("input",{id:"password",type:M?"text":"password",name:"password",placeholder:"Password",required:!0,value:eL.password,onChange:eO,onBlur:eR}),!eq&&(0,t.jsx)("button",{className:v().togglePassword,onClick:()=>H(!M),onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&H(!M)},tabIndex:0,"aria-label":"Toggle password visibility",type:"button",children:M?(0,t.jsx)(j.rzC,{}):(0,t.jsx)(j.rDJ,{})})]}),eB.password&&eZ.password?(0,t.jsx)("div",{className:"text-danger",children:eZ.password}):null]}),(0,t.jsxs)("div",{className:"form-group",children:[(0,t.jsxs)("div",{className:v().inputWrapper,children:[(0,t.jsx)("input",{id:"confirmPassword",type:V?"text":"password",name:"confirmPassword",placeholder:"Confirm Password",required:!0,value:eL.confirmPassword,onChange:eO,onBlur:eR}),!eq&&(0,t.jsx)("button",{className:v().togglePassword,onClick:()=>G(!V),onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&G(!V)},tabIndex:0,"aria-label":"Toggle password visibility",type:"button",children:V?(0,t.jsx)(j.rzC,{}):(0,t.jsx)(j.rDJ,{})})]}),eB.confirmPassword&&eZ.confirmPassword?(0,t.jsx)("div",{className:"text-danger",children:eZ.confirmPassword}):null]}),"UPADHI_EMPLOYER"===r&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"form-group",children:[(0,t.jsx)("input",{type:"text",id:"companyName",name:"companyName",placeholder:"Company Name",required:!0,value:eL.companyName,onChange:eO,onBlur:eR}),eB.companyName&&eZ.companyName?(0,t.jsx)("div",{className:"text-danger",children:eZ.companyName}):null]}),(0,t.jsxs)("div",{className:"form-group",children:[(0,t.jsx)("input",{type:"text",id:"location",name:"location",placeholder:"Location",required:!0,value:eL.location,onChange:eO,onBlur:eR}),eB.location&&eZ.location?(0,t.jsx)("div",{className:"text-danger",children:eZ.location}):null]})]}),(0,t.jsxs)("div",{className:"form-group",children:[(0,t.jsxs)("div",{className:v().inputContainer,children:[(0,t.jsx)("input",{id:"phoneNumber",ref:ei,className:" ".concat(f&&!ea?v().shake:""),type:"tel",pattern:"[0-9]*",name:"phoneNumber",placeholder:"Phone Number",onInput:N.L,required:!0,value:eL.phoneNumber,onChange:e=>{eO(e),T(e.target.value.length>0),eE&&(Z((0,i.PTk)()),T(!0),X(!1))},onBlur:eR,maxLength:10,disabled:Y||eI,onKeyDown:e=>{"Enter"===e.key&&eM()}}),L&&(0,t.jsx)("button",{type:"button",className:v().cancelButton,onClick:()=>{B(!1),X(!1),K(""),p(null)},children:(0,t.jsx)(F.fmQ,{})})]}),eB.phoneNumber&&eZ.phoneNumber?(0,t.jsx)("div",{className:"text-danger",children:eZ.phoneNumber}):null,eE&&(0,t.jsx)("p",{style:{color:"red"},children:ek.data}),!Y&&k&&(0,t.jsx)("div",{className:"d-flex flex-row justify-content-end mt-2",children:(0,t.jsx)("button",{type:"button",className:"theme-btn btn-style-one small",style:{width:"auto",padding:"0.5rem 1rem"},disabled:eI,onClick:eM,children:eI?"Sending OTP...":"Send OTP"})})]}),h>0&&(0,t.jsxs)("p",{className:v().timeLeftText,children:["Time remaining for verification: ",(e=>{let s=e%60;return"".concat(Math.floor(e/60),":").concat(s<10?"0":"").concat(s)})(h)]}),0===h&&(0,t.jsx)("p",{className:v().timeLeftText,children:"OTP expired. Please use resend OTP."}),null!==h&&(h<=270||0===h)&&(0,t.jsx)("div",{className:"d-flex flex-row justify-content-start mt-2 mb-2",children:(0,t.jsx)("button",{type:"button",className:"theme-btn btn-style-four small",style:{width:"auto",padding:"0.5rem 1rem"},onClick:eM,disabled:eI,children:eI?"Sending OTP...":"Resend OTP"})}),L&&(0,t.jsxs)("div",{className:"form-group",children:[eS&&(0,t.jsx)(n.Z,{text:null==eS?void 0:null===(a=eS.data)||void 0===a?void 0:a.message,alertType:"danger"}),(0,t.jsx)("input",{type:"text",id:"otp",name:"otp",placeholder:"Enter OTP",value:U,onChange:e=>K(e.target.value),maxLength:6,onInput:N.L,disabled:eP,onKeyDown:e=>{"Enter"===e.key&&eH()}}),eC&&(0,t.jsx)("p",{style:{color:"red"},children:e_.data}),(0,t.jsx)("div",{className:"d-flex flex-row mt-2",children:(0,t.jsx)("button",{type:"button",className:"theme-btn btn-style-one small",style:{width:"auto",padding:"0.5rem 1rem",marginRight:"10px"},disabled:eP||6!==U.length,onClick:eH,children:eP?"Verifying OTP...":"Verify OTP"})})]}),(0,t.jsx)("div",{className:"form-group",children:(0,t.jsx)("button",{className:"theme-btn btn-style-one py-3",onClick:eT,type:"button",children:"UPADHI_EMPLOYER"===r?"Register as an Employer":"Register as a Candidate"})})]})]})]})},M=a(87138),H=a(7630),V=()=>{let e=(0,l.I0)(),{handleButtonClick:s,closeModal:a,handleEmployerLoginClicked:n}=(0,o.useContext)(_.E),d=(0,P.usePathname)(),[c,m]=(0,o.useState)(S.$_s);return(0,o.useEffect)(()=>{"/employer"===d&&m(S.i0w)},[d]),(0,t.jsxs)("div",{className:"form-inner",children:["/employer"!==d&&"/job-seeker"!==d&&(0,t.jsxs)(t.Fragment,{children:["/register"!==d&&(0,t.jsx)("div",{className:v().registerTopRightCorner,children:(0,t.jsx)(T.Z,{edge:"end",color:"inherit",onClick:()=>{a(),e((0,i.Ov4)())},"aria-label":"close",className:v().closeButton,children:(0,t.jsx)(H.Z,{})})}),(0,t.jsx)("h3",{className:v().registerHeading,children:"Create a Free Upadhi Account"}),(0,t.jsxs)(r.mQ,{selectedIndex:c===S.$_s?0:1,children:[(0,t.jsx)("div",{className:"form-group register-dual",children:"/register"!==d&&(0,t.jsxs)(r.td,{className:"btn-box row",children:[(0,t.jsx)(r.OK,{className:"col-lg-6 col-md-12",onClick:()=>m(S.$_s),children:(0,t.jsxs)("button",{className:"theme-btn btn-style-four",style:{backgroundColor:c===S.$_s?"#1967d2":"",color:c===S.$_s?"white":"black"},children:[(0,t.jsx)("i",{className:"la la-user"})," Candidate"]})}),(0,t.jsx)(r.OK,{className:"col-lg-6 col-md-12",onClick:()=>m(S.i0w),children:(0,t.jsxs)("button",{className:"theme-btn btn-style-four",style:{backgroundColor:c===S.i0w?"#1967d2":"",color:c===S.i0w?"white":"black"},children:[(0,t.jsx)("i",{className:"la la-briefcase"})," Employer"]})})]})}),(0,t.jsx)(r.x4,{children:(0,t.jsx)(W,{userType:"UPADHI_JOB_SEEKER"})}),(0,t.jsx)(r.x4,{children:(0,t.jsx)(W,{userType:"UPADHI_EMPLOYER"})})]})]}),"/employer"===d&&(0,t.jsx)(r.mQ,{children:(0,t.jsx)(r.x4,{children:(0,t.jsx)(W,{userType:"UPADHI_EMPLOYER"})})}),"/job-seeker"===d&&(0,t.jsx)(r.mQ,{children:(0,t.jsx)(r.x4,{children:(0,t.jsx)(W,{userType:"UPADHI_JOB_SEEKER"})})}),(0,t.jsx)("div",{className:"bottom-box",children:(0,t.jsxs)("div",{className:"text",children:["Already have an account?"," ",(0,t.jsx)(M.default,{href:"#",className:"call-modal login",style:{color:"blue"},onClick:()=>{c===S.i0w?n():s(),e((0,i.Ov4)())},children:"LogIn"})]})})]})}},98380:function(e,s,a){"use strict";a.d(s,{L:function(){return t}});let t=e=>{let s=e.target.value.replace(/\D/g,"");e.target.value=s}},35041:function(e){e.exports={alert:"Alert_alert__hFv2C",success:"Alert_success__zSpuF",danger:"Alert_danger__1mSdL",warning:"Alert_warning__SHlC0"}},27903:function(e){e.exports={modal:"verifymodel_modal__84jia",modalContent:"verifymodel_modalContent__HpbTe",verifyotp:"verifymodel_verifyotp__Vo4Pk",errormessage:"verifymodel_errormessage__ddNhH",error:"verifymodel_error__Gbckl",inputWrapper:"verifymodel_inputWrapper__8PUzi",togglePassword:"verifymodel_togglePassword__ZcQVf",resendOtpButton:"verifymodel_resendOtpButton__8j6X6",registerModelCloseButton:"verifymodel_registerModelCloseButton__VjHfR",forgotPassword:"verifymodel_forgotPassword__BJOoC",timeLeftText:"verifymodel_timeLeftText__2xhUI",signup:"verifymodel_signup__rDjro",verifymodel:"verifymodel_verifymodel__k2rpW",module:"verifymodel_module__NIRNf",scss:"verifymodel_scss__yqecC",loginHeading:"verifymodel_loginHeading__rgS2Y",closeButton:"verifymodel_closeButton__wwHRC",forgotPasswordHeading:"verifymodel_forgotPasswordHeading__xhPdR",loginWithOtpHeading:"verifymodel_loginWithOtpHeading__ecbq_",closeButtonOfForgotPassword:"verifymodel_closeButtonOfForgotPassword__UN0Cd",topRightCorner:"verifymodel_topRightCorner__VggS6",resetPasswordHeading:"verifymodel_resetPasswordHeading__EgB_f",sendOtpSuccessDataTextColor:"verifymodel_sendOtpSuccessDataTextColor__ktelB"}},63629:function(e){e.exports={inputWrapper:"register_inputWrapper__bGNMF",error:"register_error__reZj7",togglePassword:"register_togglePassword__j_Hcz",registerHeading:"register_registerHeading__AbP9x",closeButton:"register_closeButton__Uu_9l",registerTopRightCorner:"register_registerTopRightCorner__KSWQo",cancelButtonForEmail:"register_cancelButtonForEmail__1_4dt",shake:"register_shake___B7VZ",inputContainer:"register_inputContainer__iI3f_",cancelButton:"register_cancelButton__nbCl5"}}}]);