"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4301],{34301:function(e,t,s){s.r(t),s.d(t,{default:function(){return LoginUserForm}});var a=s(85893),l=s(29613),r=s(84488),i=s(45009),n=s(60802),o=s(30184),x=s(66644),c=s(16974),d=s(11358),m=s(28319),p=s(54858),u=s(5233),h=s(86501),g=s(88767),b=s(16310);let k=b.Ry().shape({email:b.Z_().email().required(),password:b.Z_().required()});function LoginUserForm(){let{t:e}=(0,u.$G)("common"),{openModal:t,closeModal:s}=(0,i.SO)(),{authorize:b}=(0,r.Z)(),{mutate:f,isLoading:j}=(0,g.useMutation)(m.Z.users.login,{onSuccess:t=>{if(!t.token){h.ZP.error((0,a.jsx)("b",{children:e("text-wrong-user-name-and-pass")}),{className:"-mt-10 xs:mt-0"});return}b(t.token),(0,p.j9)(t.token,t.permissions),s()}});return(0,a.jsxs)("div",{className:"bg-light px-6 pt-10 pb-8 dark:bg-dark-300 sm:px-8 lg:p-12",children:[(0,a.jsx)(l.i,{className:"absolute bottom-0 left-0 text-light dark:text-dark-300 dark:opacity-60"}),(0,a.jsx)("div",{className:"relative z-10 flex items-center",children:(0,a.jsxs)("div",{className:"w-full shrink-0 text-left md:w-[380px]",children:[(0,a.jsxs)("div",{className:"flex flex-col pb-5 text-center xl:pb-6 xl:pt-2",children:[(0,a.jsx)("h2",{className:"text-lg font-medium tracking-[-0.3px] text-dark dark:text-light lg:text-xl",children:e("text-welcome-back")}),(0,a.jsxs)("div",{className:"mt-1.5 text-13px leading-6 tracking-[0.2px] dark:text-light-900 lg:mt-2.5 xl:mt-3",children:[e("text-join-now")," ",(0,a.jsx)("button",{onClick:()=>t("REGISTER"),className:"inline-flex font-semibold text-brand hover:text-dark-400 hover:dark:text-light-500",children:e("text-create-account")})]})]}),(0,a.jsx)(x.l,{onSubmit:e=>{f(e)},validationSchema:k,className:"space-y-4 pt-4 lg:space-y-5",children:s=>{var l,r;let{register:i,formState:{errors:x}}=s;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.Z,{label:"contact-us-email-field",inputClassName:"bg-light dark:bg-dark-300",type:"email",...i("email"),error:null===(l=x.email)||void 0===l?void 0:l.message}),(0,a.jsx)(d.Z,{label:"text-auth-password",inputClassName:"bg-light dark:bg-dark-300",...i("password"),error:null===(r=x.password)||void 0===r?void 0:r.message}),(0,a.jsxs)("div",{className:"flex items-center justify-between space-x-5 rtl:space-x-reverse",children:[(0,a.jsx)(o.Z,{label:"text-remember-me"}),(0,a.jsx)("button",{type:"button",className:"text-13px font-semibold text-brand hover:text-dark-400 hover:dark:text-light-500",onClick:()=>t("FORGOT_PASSWORD_VIEW"),children:e("text-forgot-password")})]}),(0,a.jsx)(n.Z,{type:"submit",className:"!mt-5 w-full text-sm tracking-[0.2px] lg:!mt-7",isLoading:j,disabled:j,children:e("text-get-login")})]})}})]})})]})}},30184:function(e,t,s){var a=s(85893),l=s(67294),r=s(93967),i=s.n(r),n=s(5233),o=s(98388);let x=(0,l.forwardRef)((e,t)=>{let{label:s,className:l,...r}=e,{t:x}=(0,n.$G)("common");return(0,a.jsxs)("label",{className:(0,o.m6)(i()("group flex cursor-pointer items-center justify-between text-13px transition-all",l)),children:[(0,a.jsx)("input",{type:"checkbox",className:"checkbox-component invisible absolute -z-[1] opacity-0",ref:t,...r}),(0,a.jsx)("span",{}),(0,a.jsx)("span",{className:"text-dark/70 ltr:ml-2.5 rtl:mr-2.5 dark:text-light/70",children:x(s)})]})});x.displayName="CheckBox",t.Z=x}}]);