"use strict";exports.id=4525,exports.ids=[4525],exports.modules={64525:(e,t,a)=>{a.a(e,async(e,s)=>{try{a.r(t),a.d(t,{default:()=>RegisterUserForm});var r=a(20997),l=a(75609),i=a(61175),n=a(86201),m=a(66644),x=a(11358),d=a(45009),c=a(16974),o=a(54574),g=a(60802),p=a(29613),u=a(16689),h=a(84488),b=a(11377),k=e([n,m,c,o,h]);[n,m,c,o,h]=k.then?(await k)():k;let f=l.object().shape({name:l.string().max(20).required(),email:l.string().email().required(),password:l.string().min(6).required()});function RegisterUserForm(){let{t:e}=(0,b.useTranslation)("common"),{openModal:t,closeModal:a}=(0,d.SO)(),{authorize:s}=(0,h.Z)(),[l,k]=(0,u.useState)(null),{mutate:j}=(0,i.useMutation)(o.Z.users.register,{onSuccess:t=>{if(!t.token){n.default.error(r.jsx("b",{children:e("text-profile-page-error-toast")}),{className:"-mt-10 xs:mt-0"});return}s(t.token),a()},onError:e=>{k(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:[r.jsx(p.i,{className:"absolute bottom-0 left-0 text-light dark:text-dark-300 dark:opacity-60"}),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:[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")," ",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")})]})]}),r.jsx(m.l,{onSubmit:e=>{j(e)},validationSchema:f,serverError:l,className:"space-y-4 lg:space-y-5",children:({register:t,formState:{errors:a}})=>(0,r.jsxs)(r.Fragment,{children:[r.jsx(c.Z,{label:"contact-us-name-field",inputClassName:"bg-light dark:bg-dark-300",...t("name"),error:a.name?.message}),r.jsx(c.Z,{label:"contact-us-email-field",inputClassName:"bg-light dark:bg-dark-300",type:"email",...t("email"),error:a.email?.message}),r.jsx(x.Z,{label:"text-auth-password",inputClassName:"bg-light dark:bg-dark-300",...t("password"),error:a.password?.message}),r.jsx(g.Z,{type:"submit",className:"!mt-5 w-full text-sm tracking-[0.2px] lg:!mt-7",children:e("text-register")})]})})]})})]})}s()}catch(e){s(e)}})}};