(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8799],{1964:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/ForgetPassword",function(){return s(6570)}])},5911:function(e,t,s){"use strict";var l=s(5893);let n=e=>{let{type:t,label:s,className:n,onClick:a,icon:i,id:r}=e;return(0,l.jsxs)("button",{className:"bg-theme-main text-white py-2 px-5 rounded-lg min-w-[80px] inline-flex items-center justify-center"+(n?" "+n:""),type:t,onClick:a,id:r,children:[i,s]})};t.Z=n},9821:function(e,t,s){"use strict";var l=s(5893);let n=e=>{let{label:t,type:s,placeholder:n,onChange:a,onClick:i,defaultValue:r,value:c,name:d,id:u,onFocus:o,disabled:m}=e,h={div:"flex flex-col mb-2",label:"mb-2",input:"border border-gray-500 rounded-lg px-3 py-2"},f=e=>{let t=e.target.value;e.target.value=t.replace(/[^-a-zA-Z0-9-آ-ی\s+]+/gi,"").replace(/\s+/gi,"-").toLowerCase()};return(0,l.jsxs)("div",{className:h.div,children:[(0,l.jsx)("label",{className:h.label,htmlFor:d,children:t}),(0,l.jsx)("input",{type:s,placeholder:n,className:h.input,onChange:a,onClick:i,onFocus:o,name:d,id:u,disabled:!!m&&m,readOnly:!!m&&m,autoComplete:"off",onKeyUp:"slug"===s?f:void 0,defaultValue:r||c||void 0})]})};t.Z=n},6570:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return h}});var l=s(5893),n=s(4184),a=s(9821),i=s(1664),r=s.n(i),c=s(5911),d=s(2920),u=s(1163);let o=()=>{let e=(0,u.useRouter)(),t=t=>{t.preventDefault();let s={email:t.target.email.value};fetch("/api/auth/forgetpassword",{body:JSON.stringify(s),method:"POST"}).then(async t=>{200===t.status?(d.Am.success("با موفقیت درخواست شما ارسال شد!"),await e.push("/ResetPassword?email=".concat(s.email))):d.Am.error("اتصال اینترنت خود را بررسی کنید!")})};return(0,l.jsxs)("form",{onSubmit:t,children:[(0,l.jsx)(a.Z,{type:"text",id:"email",name:"email",label:"ایمیل",placeholder:"ایمیل خود را وارد کنید!"}),(0,l.jsxs)("div",{className:"flex items-center mt-5",children:[(0,l.jsx)("div",{className:"w-1/2",children:(0,l.jsx)(r(),{href:"/Login",children:(0,l.jsx)("span",{className:"",children:"بازگشت"})})}),(0,l.jsxs)("div",{className:"w-1/2 text-left",children:[(0,l.jsx)(r(),{href:"/Register",children:(0,l.jsx)("span",{className:"ml-2",children:"ثبت نام"})}),(0,l.jsx)(c.Z,{label:"ارسال",type:"submit"})]})]})]})},m=()=>(0,l.jsx)(n.Z,{title:"بازیابی رمز عبور",description:"ورود به سامانه",children:(0,l.jsx)("div",{className:"flex justify-center items-center h-screen",children:(0,l.jsx)("div",{className:"w-full lg:w-1/3",children:(0,l.jsx)(o,{})})})});var h=m}},function(e){e.O(0,[4617,1057,3874,699,4184,9774,2888,179],function(){return e(e.s=1964)}),_N_E=e.O()}]);