"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4525],{64525:function(e,t,a){a.r(t),a.d(t,{default:function(){return RegisterUserForm}});var r=a(85893),s=a(16310),l=a(88767),i=a(86501),n=a(66644),d=a(11358),m=a(45009),o=a(16974),x=a(28319),c=a(60802),u=a(29613),g=a(67294),p=a(84488),h=a(5233);let k=s.Ry().shape({name:s.Z_().max(20).required(),email:s.Z_().email().required(),password:s.Z_().min(6).required()});function RegisterUserForm(){let{t:e}=(0,h.$G)("common"),{openModal:t,closeModal:a}=(0,m.SO)(),{authorize:s}=(0,p.Z)(),[b,f]=(0,g.useState)(null),{mutate:v}=(0,l.useMutation)(x.Z.users.register,{onSuccess:t=>{if(!t.token){i.ZP.error((0,r.jsx)("b",{children:e("text-profile-page-error-toast")}),{className:"-mt-10 xs:mt-0"});return}s(t.token),a()},onError:e=>{f(e.response.data)}});return(0,r.jsxs)("div",{className:"bg-light px-6 pt-10 pb-8 dark:bg-dark-300 sm:px-8 lg:p-12",children:[(0,r.jsx)(u.i,{className:"absolute bottom-0 left-0 text-light dark:text-dark-300 dark:opacity-60"}),(0,r.jsx)("div",{className:"relative z-10 flex items-center",children:(0,r.jsxs)("div",{className:"w-full shrink-0 text-left md:w-[380px]",children:[(0,r.jsxs)("div",{className:"flex flex-col pb-5 text-center lg:pb-9 xl:pb-10 xl:pt-2",children:[(0,r.jsx)("h2",{className:"text-lg font-medium tracking-[-0.3px] text-dark dark:text-light lg:text-xl",children:e("text-welcome-back")}),(0,r.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-create-an-account")," ",(0,r.jsx)("button",{onClick:()=>t("LOGIN_VIEW"),className:"inline-flex font-semibold text-brand hover:text-dark-400 hover:dark:text-light-500",children:e("text-login")})]})]}),(0,r.jsx)(n.l,{onSubmit:e=>{v(e)},validationSchema:k,serverError:b,className:"space-y-4 lg:space-y-5",children:t=>{var a,s,l;let{register:i,formState:{errors:n}}=t;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.Z,{label:"contact-us-name-field",inputClassName:"bg-light dark:bg-dark-300",...i("name"),error:null===(a=n.name)||void 0===a?void 0:a.message}),(0,r.jsx)(o.Z,{label:"contact-us-email-field",inputClassName:"bg-light dark:bg-dark-300",type:"email",...i("email"),error:null===(s=n.email)||void 0===s?void 0:s.message}),(0,r.jsx)(d.Z,{label:"text-auth-password",inputClassName:"bg-light dark:bg-dark-300",...i("password"),error:null===(l=n.password)||void 0===l?void 0:l.message}),(0,r.jsx)(c.Z,{type:"submit",className:"!mt-5 w-full text-sm tracking-[0.2px] lg:!mt-7",children:e("text-register")})]})}})]})})]})}}}]);