1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9742],{27627:function(e,s,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/forgot-password",function(){return r(14273)}])},14273:function(e,s,r){"use strict";r.r(s),r.d(s,{default:function(){return f}});var l=r(85893),n=r(34288),o=r(59417),i=r(99603),a=r(67294),t=r(41664),d=r.n(t),c=r(88446),u=r(86501),v=r(11163),h=r(83868),x=r.n(h),m=r(28355),g=r(9008),j=r.n(g),f=()=>{(0,v.useRouter)();let e=(0,a.useRef)(null),s=(0,a.useRef)(null),[r,t]=(0,a.useState)(""),[h,g]=(0,a.useState)(""),[f,p]=(0,a.useState)(""),[N,w]=(0,a.useState)(""),[P,b]=(0,a.useState)(60),[y,Z]=(0,a.useState)(!1),[E,S]=(0,a.useState)(!1),[k,C]=(0,a.useState)({loading:!1,success:"",error:""}),[_,I]=(0,a.useState)({loading:!1,success:"",error:""}),[L,R]=(0,a.useState)({email:"",phone:""}),[M,F]=(0,a.useState)(!0),[G,T]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e;return E&&!y&&P>0?e=setTimeout(()=>b(P-1),1e3):0===P&&Z(!0),()=>clearTimeout(e)},[P,y,E]);let O=async()=>{try{let e=!1,s={email:"",phone:""};if(M&&(s.email="",0===r.length?(s.email="Required",e=!0):r.length>=60?(s.email="Only allow 60 character",e=!0):x()(r)||(s.email="Enter a valid Email Id",e=!0)),G&&(s.phone="",0===f.length?s.phone="Required":(0,m.ZP)(f)||(s.phone="Enter a valid Mobile No")),R({...L,...s}),e)return!0;return!1}catch(e){console.error(e)}},q=async()=>{try{var s;let l=await O();if(l){C({loading:!1,success:"",error:"Enter a valid Email Id"});return}C({loading:!0,success:"",error:""});let n=null==window?void 0:null===(s=window.location)||void 0===s?void 0:s.href;await c.Z.post("/user/forgotPassword",{email:r.toLowerCase().trim()},{headers:{frontendurl:n||""}}).then(s=>{var r,l;t(""),e.current&&(e.current.value=""),(null==s?void 0:s.status)===404?u.ZP.error(null==s?void 0:null===(r=s.data)||void 0===r?void 0:r.message):(null==s?void 0:s.status)===200?(u.ZP.success(null==s?void 0:null===(l=s.data)||void 0===l?void 0:l.message),S(!0),b(60),Z(!1)):u.ZP.error("Internal Server Error")}).catch(e=>{var s,r,l,n;400===e.response.status?u.ZP.error(null==e?void 0:null===(s=e.response)||void 0===s?void 0:null===(r=s.data)||void 0===r?void 0:r.message):500===e.response.status?u.ZP.error(null==e?void 0:null===(l=e.response)||void 0===l?void 0:null===(n=l.data)||void 0===n?void 0:n.message):u.ZP.error("Internal Server Error")}),C({loading:!1,success:"success",error:""}),S(!0),b(60),Z(!1)}catch(e){console.error(e),C({loading:!1,success:"error",error:""}),S(!0),b(60),Z(!1)}},B=async()=>{try{var e;let r=await O();if(r){I({loading:!1,success:"",error:"Enter a valid Mobile No"});return}I({loading:!0,success:"",error:""});let l=null==window?void 0:null===(e=window.location)||void 0===e?void 0:e.href;await c.Z.post("/user/forgotPasswordMobile",{mobile:f},{headers:{frontendurl:l||""}}).then(e=>{var r,l;p(""),s.current&&(s.current.value=""),(null==e?void 0:e.status)===404?u.ZP.error(null==e?void 0:null===(r=e.data)||void 0===r?void 0:r.message):(null==e?void 0:e.status)===200?(u.ZP.success(null==e?void 0:null===(l=e.data)||void 0===l?void 0:l.message),S(!0),b(60),Z(!1)):u.ZP.error("Internal Server Error")}).catch(e=>{var s,r,l,n;400===e.response.status?u.ZP.error(null==e?void 0:null===(s=e.response)||void 0===s?void 0:null===(r=s.data)||void 0===r?void 0:r.message):500===e.response.status?u.ZP.error(null==e?void 0:null===(l=e.response)||void 0===l?void 0:null===(n=l.data)||void 0===n?void 0:n.message):u.ZP.error("Internal Server Error")}),I({loading:!1,success:"success",error:""}),S(!0),b(60),Z(!1)}catch(e){console.error(e),I({loading:!1,success:"error",error:""}),S(!0),b(60),Z(!1)}},D=async()=>{try{var e;b(60),Z(!1),I({loading:!0,success:"",error:""});let r=null==window?void 0:null===(e=window.location)||void 0===e?void 0:e.href;await c.Z.post("/user/forgotPasswordMobile",{mobile:N},{headers:{frontendurl:r||""}}).then(e=>{var r,l;p(""),s.current&&(s.current.value=""),(null==e?void 0:e.status)===404?u.ZP.error(null==e?void 0:null===(r=e.data)||void 0===r?void 0:r.message):(null==e?void 0:e.status)===200?u.ZP.success(null==e?void 0:null===(l=e.data)||void 0===l?void 0:l.message):u.ZP.error("Internal Server Error")}).catch(e=>{var s,r,l,n;400===e.response.status?u.ZP.error(null==e?void 0:null===(s=e.response)||void 0===s?void 0:null===(r=s.data)||void 0===r?void 0:r.message):500===e.response.status?u.ZP.error(null==e?void 0:null===(l=e.response)||void 0===l?void 0:null===(n=l.data)||void 0===n?void 0:n.message):u.ZP.error("Internal Server Error")}),I({loading:!1,success:"success",error:""})}catch(e){console.error(e),I({loading:!1,success:"error",error:""})}},X=async()=>{try{var e;b(60),Z(!1),I({loading:!0,success:"",error:""});let r=null==window?void 0:null===(e=window.location)||void 0===e?void 0:e.href;await c.Z.post("/user/forgotPassword",{email:h.toLowerCase().trim()},{headers:{frontendurl:r||""}}).then(e=>{var r,l;p(""),s.current&&(s.current.value=""),(null==e?void 0:e.status)===404?u.ZP.error(null==e?void 0:null===(r=e.data)||void 0===r?void 0:r.message):(null==e?void 0:e.status)===200?u.ZP.success(null==e?void 0:null===(l=e.data)||void 0===l?void 0:l.message):u.ZP.error("Internal Server Error")}).catch(e=>{var s,r,l,n;400===e.response.status?u.ZP.error(null==e?void 0:null===(s=e.response)||void 0===s?void 0:null===(r=s.data)||void 0===r?void 0:r.message):500===e.response.status?u.ZP.error(null==e?void 0:null===(l=e.response)||void 0===l?void 0:null===(n=l.data)||void 0===n?void 0:n.message):u.ZP.error("Internal Server Error")}),I({loading:!1,success:"success",error:""})}catch(e){console.error(e),I({loading:!1,success:"error",error:""})}};return(0,l.jsxs)("div",{className:"lg:mx-28",children:[(0,l.jsx)(j(),{children:(0,l.jsx)("title",{children:"Forgot Password"})}),G?(0,l.jsx)("div",{className:"flex justify-center mt-5 ",children:(0,l.jsxs)("button",{onClick:()=>{T(!1),F(!0)},className:" text-red-500",children:[(0,l.jsx)("strong",{children:"*"}),"Click to verify using your Email Id"]})}):(0,l.jsx)("div",{className:"flex justify-center mt-5 ",children:(0,l.jsxs)("button",{onClick:()=>{T(!0),F(!1)},className:" text-red-500",children:[(0,l.jsx)("strong",{children:"*"}),"Click to verify using your Mobile Number"]})}),M&&(0,l.jsx)(l.Fragment,{children:(0,l.jsx)("div",{className:"md:mx-28 flex justify-center items-center",children:(0,l.jsxs)("div",{className:"border text-lg md:w-1/2 ",children:[(0,l.jsx)("div",{className:"border-b-2 p-2",children:(0,l.jsx)("h1",{children:"Forgot Password"})}),(0,l.jsxs)("div",{className:"mt-7 px-3",children:[(null==L?void 0:L.email.length)>0&&(0,l.jsx)("h1",{className:" text-end text-red-500",children:null==L?void 0:L.email}),(0,l.jsxs)("div",{className:"flex ",children:[(0,l.jsx)("div",{className:"border p-3",children:(0,l.jsx)(i.G,{icon:n.FU$})}),(0,l.jsx)("div",{className:"border p-3 w-full",children:(0,l.jsx)("input",{ref:e,onChange:e=>{t(e.target.value),g(e.target.value)},className:"outline-none w-full",type:"text",placeholder:"Email"})})]})]}),(0,l.jsx)("div",{className:"flex justify-center p-2",children:(0,l.jsxs)("button",{disabled:null==k?void 0:k.loading,onClick:q,className:"bg-teal-500 text-white rounded-lg p-2 hover:translate-y-0.5 hover:bg-teal-600",children:[(0,l.jsx)(i.G,{icon:o.mNB})," Send Link",(null==k?void 0:k.loading)&&(0,l.jsx)(i.G,{className:" px-1",icon:o.LM3,spin:!0})]})}),E&&(y?(0,l.jsx)("div",{className:"flex justify-center p-2",children:(0,l.jsx)("h4",{onClick:X,className:"cursor-pointer text-black text-xs",children:"Didn't recieve code ? Resend Link"})}):(0,l.jsx)("div",{className:"flex justify-center p-2",children:(0,l.jsxs)("p",{className:"mt-2 px-2 text-xs",children:["You can request resend OTP in ",(0,l.jsxs)("strong",{className:"text-teal-400",children:["00:",P,"s"]})]})})),(0,l.jsxs)("div",{className:"flex justify-center space-x-5 p-2",children:[(0,l.jsx)(d(),{href:"/login",children:"Login?"}),(0,l.jsx)(d(),{href:"/register",children:"Registration?"})]})]})})}),G&&(0,l.jsx)(l.Fragment,{children:(0,l.jsx)("div",{className:"md:mx-28 flex justify-center items-center",children:(0,l.jsxs)("div",{className:"border text-lg md:w-1/2 ",children:[(0,l.jsx)("div",{className:"border-b-2 p-2",children:(0,l.jsx)("h1",{children:"Forgot Password"})}),(0,l.jsxs)("div",{className:"mt-7 px-3",children:[(null==L?void 0:L.phone.length)>0&&(0,l.jsx)("h1",{className:" text-end text-red-500",children:null==L?void 0:L.phone}),(0,l.jsxs)("div",{className:"flex ",children:[(0,l.jsx)("div",{className:"border p-3",children:(0,l.jsx)(i.G,{icon:o.Z__})}),(0,l.jsx)("div",{className:"border p-3 w-full",children:(0,l.jsx)("input",{ref:s,maxLength:10,onChange:e=>{p(e.target.value),w(e.target.value)},className:"outline-none w-full",type:"tel",placeholder:"Mobile"})})]})]}),(0,l.jsx)("div",{className:"flex justify-center p-2",children:(0,l.jsxs)("button",{disabled:null==k?void 0:k.loading,onClick:B,className:"bg-teal-500 text-white rounded-lg p-2 hover:translate-y-0.5 hover:bg-teal-600",children:[(0,l.jsx)(i.G,{icon:o.mNB})," Send Link",(null==k?void 0:k.loading)&&(0,l.jsx)(i.G,{className:" px-1",icon:o.LM3,spin:!0})]})}),E&&(y?(0,l.jsx)("div",{className:"flex justify-center p-2",children:(0,l.jsx)("h4",{onClick:D,className:"text-black text-xs",children:"Didn't recieve code ? Resend Link"})}):(0,l.jsx)("div",{className:"flex justify-center p-2",children:(0,l.jsxs)("p",{className:"mt-2 px-2 text-xs",children:["You can request resend OTP in ",(0,l.jsxs)("strong",{className:"text-teal-400",children:["00:",P,"s"]})]})})),(0,l.jsxs)("div",{className:"flex justify-center space-x-5 p-2",children:[(0,l.jsx)(d(),{href:"/login",children:"Login?"}),(0,l.jsx)(d(),{href:"/register",children:"Registration?"})]})]})})})]})}}},function(e){e.O(0,[4288,1980,9774,2888,179],function(){return e(e.s=27627)}),_N_E=e.O()}]);
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.