1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[91708],{18433:(e,s,l)=>{l.d(s,{a:()=>r});var t=l(95155),n=l(51834);let r=e=>{let{title:s,description:l,isOpen:r,onClose:a,children:i,className:o}=e;return(0,t.jsx)(n.lG,{open:r,onOpenChange:e=>{e||a()},children:(0,t.jsxs)(n.Cf,{className:o,children:[(0,t.jsxs)(n.c7,{children:[(0,t.jsx)(n.L3,{className:s?"":"hidden",children:s}),(0,t.jsx)(n.rr,{className:s?"":"hidden",children:l})]}),(0,t.jsx)("div",{children:i})]})})}},73457:(e,s,l)=>{l.d(s,{S:()=>i});var t=l(95155);l(12115);var n=l(38162),r=l(5917),a=l(64269);function i(e){let{className:s,...l}=e;return(0,t.jsx)(n.bL,{"data-slot":"checkbox",className:(0,a.cn)("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive hover:border-primary hover:ring-primary/40 size-4 shrink-0 cursor-pointer rounded-[4px] border shadow-xs transition-shadow outline-none hover:ring-2 focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",s),...l,children:(0,t.jsx)(n.C1,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:(0,t.jsx)(r.A,{className:"size-3.5"})})})}},80389:(e,s,l)=>{l.d(s,{c:()=>i});var t=l(95155);l(12115);var n=l(55817),r=l(31719),a=l(64269);function i(e){let{className:s,...l}=e;return(0,t.jsx)(n.bL,{children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(n.pd,{className:(0,a.cn)("placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-primary focus-visible:ring-primary/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",s),...l}),(0,t.jsx)(n.lM,{id:l.id+"btn-toggle",className:"absolute top-1/2 right-2 -translate-y-1/2 text-gray-500 hover:text-gray-700",children:(0,t.jsx)(n.In,{visible:(0,t.jsx)(r.N5q,{}),hidden:(0,t.jsx)(r.V$C,{})})})]})})}},91708:(e,s,l)=>{l.d(s,{A:()=>Z});var t=l(95155),n=l(20865),r=l(86948),a=l(41052),i=l(65142),o=l(66942),c=l(12115),d=l(22544),h=l(15653),m=l(3998),x=l(18433),u=l(15239),p=l(73457),j=l(80389),g=l(52619),v=l.n(g),N=l(13744),f=l(60919),b=l(18720),w=l(61362),k=l(52056),y=l(1141),C=l(39180),A=l(95307),B=l(35652),S=l(66654);let z=h.z.object({firstName:S.fV,lastName:S.tM,email:S.rK,phone:S.KA,password:S.$w}),M={invalidPhone:"Sá» Äiá»n thoại kh\xf4ng hợp lá»",phoneExists:"Sá» Äiá»n thoại Ä\xe3 tá»n tại"};function I(e){var s;let{setFormType:l}=e,h=(0,d.mN)({resolver:(0,o.u)(z),values:{email:"",password:"",firstName:"",lastName:"",phone:""}}),{formState:{isSubmitting:x},setError:g}=h,S=(0,C.r)(e=>e.config);async function I(e){try{if(!L)return void P("Vui l\xf2ng x\xe1c nháºn bạn kh\xf4ng phải l\xe0 ngưá»i m\xe1y");let s=(0,A.G2)(),l=(0,n.mD)(),r={...e,...l&&{domainSource:l},...s&&{refClickId:s}};await N.A.postApi("/api/v1/auth/register",r,"",{headers:{"x-merchant-id":null==S?void 0:S.merchantId}});let a=window;a.dataLayer=a.dataLayer||[],a.dataLayer.push({event:"complete_registration",event_category:"auth",event_label:"register_form"}),"function"==typeof a.fbq&&a.fbq("track","CompleteRegistration"),s&&(0,A.p7)(),b.toast.success("ÄÄng k\xfd th\xe0nh c\xf4ng",{duration:5e3,icon:(0,t.jsx)(w.A,{className:"h-4 w-4 text-green-600"})}),await (0,n.Jv)("credentials",{phone:e.phone,password:e.password,merchantId:null==S?void 0:S.merchantId,redirect:!1}),(0,B.E)(),(0,n.IL)()||(window.location.href=(0,n.LN)())}catch(e){if(e instanceof f.pe){var s,l,r;let t=null==(s=e.response)?void 0:s.data;if(null==t?void 0:t.errors)for(let[e,s]of Object.entries(t.errors))g(e,{type:"server",message:null!=(r=null==M?void 0:M[null!=(l=null==s?void 0:s.key)?l:s]
1)?r:s})}else b.toast.error("ÄÄng k\xfd lá»i",{description:"Lá»i kết ná»i Äến m\xe1y chá»§.",duration:5e3,icon:(0,t.jsx)(k.A,{className:"h-4 w-4 text-red-500"})})}}let[L,J]=(0,c.useState)(""),[R,P]=(0,c.useState)("");return(0,t.jsxs)(r.Zp,{className:"mx-auto w-full gap-4 border-none py-0 shadow-none",children:[(0,t.jsxs)(r.aR,{className:"",children:[(0,t.jsx)(r.ZB,{className:"text-center",children:(null==S||null==(s=S.theme)?void 0:s.logo)&&(0,t.jsx)(u.default,{className:"mx-auto",src:S.theme.logo.replace("/api/v1",""),alt:"",width:88,height:88})}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("h3",{className:"text-2xl font-semibold",children:"Tạo t\xe0i khoản má»i"}),(0,t.jsx)("span",{className:"text-lg text-[#B2B2B7]",children:"Vui l\xf2ng nháºp th\xf4ng tin ÄÄng k\xfd"})]})]}),(0,t.jsx)(r.Wu,{children:(0,t.jsx)(a.lV,{...h,children:(0,t.jsxs)("form",{onSubmit:h.handleSubmit(I),className:"space-y-5",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,t.jsx)(a.zB,{control:h.control,name:"firstName",render:e=>{let{field:s}=e;return(0,t.jsxs)(a.eI,{children:[(0,t.jsx)(a.lR,{children:"Há»"}),(0,t.jsx)(a.MJ,{children:(0,t.jsx)(i.p,{autoComplete:"given-name",placeholder:"Nháºp há»",className:"h-10",...s})}),(0,t.jsx)(a.C5,{})]})}}),(0,t.jsx)(a.zB,{control:h.control,name:"lastName",render:e=>{let{field:s}=e;return(0,t.jsxs)(a.eI,{children:[(0,t.jsx)(a.lR,{children:"T\xean"}),(0,t.jsx)(a.MJ,{children:(0,t.jsx)(i.p,{autoComplete:"family-name",placeholder:"Nháºp t\xean",className:"h-10",...s})}),(0,t.jsx)(a.C5,{})]})}})]}),(0,t.jsx)(a.zB,{control:h.control,name:"email",render:e=>{let{field:s}=e;return(0,t.jsxs)(a.eI,{children:[(0,t.jsx)(a.lR,{children:"Email"}),(0,t.jsx)(a.MJ,{children:(0,t.jsx)(i.p,{autoComplete:"email",type:"email",placeholder:"Nháºp email",className:"h-10",...s})}),(0,t.jsx)(a.C5,{})]})}}),(0,t.jsx)(a.zB,{control:h.control,name:"phone",render:e=>{let{field:s}=e;return(0,t.jsxs)(a.eI,{children:[(0,t.jsx)(a.lR,{children:"Sá» Äiá»n thoại"}),(0,t.jsx)(a.MJ,{children:(0,t.jsx)(i.p,{autoComplete:"tel",type:"tel",placeholder:"Nháºp sá» Äiá»n thoại",className:"h-10",...s})}),(0,t.jsx)(a.C5,{})]})}}),(0,t.jsx)(a.zB,{control:h.control,name:"password",render:e=>{let{field:s}=e;return(0,t.jsxs)(a.eI,{children:[(0,t.jsx)(a.lR,{children:"Máºt khẩu"}),(0,t.jsx)(a.MJ,{children:(0,t.jsx)(j.c,{autoComplete:"new-password",className:"h-10",placeholder:"Nháºp máºt khẩu",...s})}),(0,t.jsx)(a.C5,{})]})}})]}),(0,t.jsx)("div",{className:"flex justify-between",children:(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(p.S,{checked:!0,className:"my-auto"}),(0,t.jsxs)("span",{className:"text-neutral-950",children:["T\xf4i chấp nháºn c\xe1c"," ",(0,t.jsx)(v(),{target:"_blank",className:"text-primary",href:"/chinh-sach",children:"Ch\xednh s\xe1ch"})," v\xe0 ",(0,t.jsx)(v(),{target:"_blank",className:"text-primary",href:"/dieu-khoan-su-dung",children:"Äiá»u khoản"})]})]})}),(0,t.jsxs)("div",{className:"",children:[(0,t.jsx)(y.A,{sitekey:"6LcpBJ0pAAAAAP1Tf9GVLbiodi69ko_XQCP6Kqvx",onChange:e=>{e&&(J(e),R&&P(""))},onExpired:()=>J(""),hl:"vi",className:"w-full"}),R&&(0,t.jsx)("span",{className:"text-destructive text-sm",children:R})]}),(0,t.jsx)(m.$,{className:"h-12 w-full",size:"lg",disabled:x,type:"submit",children:"ÄÄng k\xfd"}),(0,t.jsxs)("div",{className:"text-center text-neutral-900",children:["Bạn Ä\xe3 c\xf3 t\xe0i khoản?"," ",(0,t.jsx)(m.$,{onClick:()=>l("login"),type:"button",variant:"link",className:"h-fit cursor-pointer p-0 text-base",children:"ÄÄng nháºp ngay"})]})]})})})]})}let L=h.z.object({hash:h.z.string().nonempty("M\xe3 l\xe0 bắt buá»c"),email:S.rK,password:S.$w}),J={invalidEmail:"Email kh\xf4ng hợp lá»",emailNotExists:"Email kh\xf4ng tá»n tại",invalidHash:"M\xe3 kh\xf4ng tá»n tại"};function R(e){var s;let{setFormType:l}=e,[n,h]=(0,c.useState)(!1),x=(0,d.mN)({resolver:(0,o.u)(L),values:{password:"",hash:"",email:""}}),{formState:{isSubmitting:p},setError:g}=x,v=x.watch("email"),A=(0,C.r)(e=>e.config);async function B(e){try{if(!z)return void R("Vui l\xf2ng x\xe1c nháºn bạn kh\xf4ng phải l\xe0 ngưá»i m\xe1y");await N.A.postApi("/api/v1/auth/reset/password",e,"",{headers:{"x-merchant-id":null==A?void 0:A.merchantId}}),b.toast.success("Äặt lại máºt khẩu th\xe0nh c\xf4ng",{duration:5e3,icon:(0,t.jsx)(w.A,{className:"h-4 w-4 text-green-600"})})}catch(e){if(e instanceof f.pe){var s,l,n;let t=null==(s=e.response)?void 0:s.data;if(null==t?void 0:t.errors)for(let[e,s]of Object.entries(t.errors))g(e,{type:"server",message:null!=(n=null==J?void 0:J[null!=(l=null==s?void 0:s.key)?l:s]
1)?n:s})}else b.toast.error("Äặt lại máºt khẩu lá»i",{description:"Lá»i kết ná»i Äến m\xe1y chá»§.",duration:5e3,icon:(0,t.jsx)(k.A,{className:"h-4 w-4 text-red-500"})})}}async function S(e){try{e.preventDefault(),h(!0),await x.trigger("email")&&(await N.A.postApi("/api/v1/auth/forgot/password",{email:v},"",{headers:{"x-merchant-id":null==A?void 0:A.merchantId}}),b.toast.success("Gá»i m\xe3 th\xe0nh c\xf4ng",{duration:5e3,icon:(0,t.jsx)(w.A,{className:"h-4 w-4 text-green-600"})}))}catch(e){if(e instanceof f.pe){var s,l,n,r;let a=null==(s=e.response)?void 0:s.data;if(null==a?void 0:a.errors)for(let[e,s]of Object.entries(a.errors))g(e,{type:"server",message:null!=(r=null==J?void 0:J[null!=(n=null==s?void 0:s.key)?n:s])?r:s});else b.toast.error("Gá»i m\xe3 lá»i",{description:null!=(l=null==a?void 0:a.message)?l:"Lá»i kết ná»i Äến m\xe1y chá»§.",duration:5e3,icon:(0,t.jsx)(k.A,{className:"h-4 w-4 text-red-500"})})}else b.toast.error("Gá»i m\xe3 lá»i",{description:"Lá»i kết ná»i Äến m\xe1y chá»§.",duration:5e3,icon:(0,t.jsx)(k.A,{className:"h-4 w-4 text-red-500"})})}finally{h(!1)}}let[z,M]=(0,c.useState)(""),[I,R]=(0,c.useState)("");return(0,t.jsxs)(r.Zp,{className:"mx-auto w-full gap-4 border-none py-0 shadow-none",children:[(0,t.jsxs)(r.aR,{className:"gap-8",children:[(0,t.jsx)(r.ZB,{className:"text-center",children:(null==A||null==(s=A.theme)?void 0:s.logo)&&(0,t.jsx)(u.default,{className:"mx-auto",src:A.theme.logo.replace("/api/v1",""),alt:"",width:88,height:88})}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("h3",{className:"text-2xl font-semibold",children:"Äặt lại máºt khẩu"}),(0,t.jsx)("span",{className:"text-lg text-[#B2B2B7]",children:"H\xe3y Äiá»n sá» Äiá»n thoại cá»§a bạn. Ch\xfang t\xf4i sẽ gá»i má»t li\xean kết Äá» Äặt lại máºt khẩu cá»§a bạn"})]})]}),(0,t.jsx)(r.Wu,{children:(0,t.jsx)(a.lV,{...x,children:(0,t.jsxs)("form",{onSubmit:x.handleSubmit(B),className:"space-y-5",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-4",children:[(0,t.jsx)(a.zB,{control:x.control,name:"email",render:e=>{let{field:s}=e;return(0,t.jsxs)(a.eI,{children:[(0,t.jsx)(a.lR,{children:"Email"}),(0,t.jsx)(a.MJ,{children:(0,t.jsx)(i.p,{autoComplete:"email",type:"email",placeholder:"Nháºp email",className:"h-10",...s})}),(0,t.jsx)(a.C5,{})]})}}),(0,t.jsxs)("div",{className:"grid grid-cols-[auto_112px] gap-2",children:[(0,t.jsx)(a.zB,{control:x.control,name:"hash",render:e=>{let{field:s}=e;return(0,t.jsxs)(a.eI,{children:[(0,t.jsx)(a.lR,{children:"M\xe3"}),(0,t.jsx)(a.MJ,{children:(0,t.jsx)(i.p,{autoComplete:"one-time-code",placeholder:"Nháºp m\xe3 nháºn ÄÆ°á»£c từ email",className:"h-10",...s})}),(0,t.jsx)(a.C5,{})]})}}),(0,t.jsx)(m.$,{onClick:S,className:"mt-auto",size:"lg",disabled:n,children:"Gá»i"})]}),(0,t.jsx)(a.zB,{control:x.control,name:"password",render:e=>{let{field:s}=e;return(0,t.jsxs)(a.eI,{children:[(0,t.jsx)(a.lR,{children:"Máºt khẩu"}),(0,t.jsx)(a.MJ,{children:(0,t.jsx)(j.c,{autoComplete:"new-password",className:"h-10",placeholder:"Nháºp máºt khẩu",...s})}),(0,t.jsx)(a.C5,{})]})}})]}),(0,t.jsxs)("div",{className:"",children:[(0,t.jsx)(y.A,{sitekey:"6LcpBJ0pAAAAAP1Tf9GVLbiodi69ko_XQCP6Kqvx",onChange:e=>{e&&(M(e),I&&R(""))},onExpired:()=>M(""),hl:"vi",className:"w-full"}),I&&(0,t.jsx)("span",{className:"text-destructive text-sm",children:I})]}),(0,t.jsx)(m.$,{className:"h-12 w-full",size:"lg",disabled:p,type:"submit",children:"X\xe1c nháºn"}),(0,t.jsxs)("div",{className:"text-center text-neutral-900",children:["Bạn Ä\xe3 t\xecm lại ÄÆ°á»£c máºt khẩu?"," ",(0,t.jsx)(m.$,{onClick:()=>l("login"),type:"button",variant:"link",className:"h-fit cursor-pointer p-0 text-base",children:"ÄÄng nháºp ngay"})]})]})})})]})}var P=l(96199),E=l(76444),V=l(75746);let $=h.z.object({password:h.z.string().optional(),firstName:h.z.string().min(2,"Há» tá»i thiá»u 2 k\xed tá»±").optional(),lastName:h.z.string().min(2,"T\xean tá»i thiá»u 2 k\xed tá»±").optional(),email:h.z.string().optional(),oldPassword:h.z.string().optional()}
1),_={invalidPhone:"Sá» Äiá»n thoại kh\xf4ng hợp lá»",phoneNotExists:"Sá» Äiá»n thoại kh\xf4ng tá»n tại",incorrectOldPassword:"Máºt khẩu cÅ© kh\xf4ng ch\xednh x\xe1c"};function T(e){var s,l,c,h;let{onCallBack:x=()=>{}}=e,{data:p}=(0,P.wV)(),{user:g,setUser:v}=(0,V.k)(),y={firstName:null!=(c=null==g?void 0:g.firstName)?c:"",lastName:null!=(h=null==g?void 0:g.lastName)?h:"",email:null==g?void 0:g.email,password:"",oldPassword:""},A=(0,d.mN)({resolver:(0,o.u)($),values:y}),{formState:{isSubmitting:B},setError:S}=A,z=(0,C.r)(e=>e.config);async function M(e){try{let s={...e};(null==e?void 0:e.password)||delete e.password,(null==e?void 0:e.oldPassword)||delete e.oldPassword;let l=await N.A.patchApi("/api/v1/auth/me",e,null==p?void 0:p.accessToken).then(e=>e.data);s.password?(0,n.CI)({callbackUrl:new URL("/",window.location.href).href,redirect:!0}):v(l),b.toast.success("Cáºp nháºt th\xf4ng tin th\xe0nh c\xf4ng",{duration:5e3,icon:(0,t.jsx)(w.A,{className:"h-4 w-4 text-green-600"})}),x()}catch(e){if(e instanceof f.pe){var s,l,r;let t=null==(s=e.response)?void 0:s.data;if(null==t?void 0:t.errors)for(let[e,s]of Object.entries(t.errors))S(e,{type:"server",message:null!=(r=null==_?void 0:_[null!=(l=null==s?void 0:s.key)?l:s])?r:s})}else b.toast.error("Cáºp nháºt th\xf4ng tin lá»i",{description:"Lá»i kết ná»i Äến m\xe1y chá»§.",duration:5e3,icon:(0,t.jsx)(k.A,{className:"h-4 w-4 text-red-500"})})}}return(0,t.jsxs)(r.Zp,{className:"mx-auto w-full gap-4 border-none shadow-none",children:[(0,t.jsxs)(r.aR,{className:"gap-8",children:[(0,t.jsx)(r.ZB,{className:"text-center",children:(null==z||null==(s=z.theme)?void 0:s.logo)&&(0,t.jsx)(u.default,{className:"mx-auto",src:z.theme.logo.replace("/api/v1",""),alt:"",width:88,height:88})}),(0,t.jsx)("div",{className:"text-center",children:(0,t.jsx)("h3",{className:"text-2xl font-semibold",children:"Cáºp nháºt th\xf4ng tin"})})]}),(0,t.jsx)(r.Wu,{children:(0,t.jsx)(a.lV,{...A,children:(0,t.jsxs)("form",{onSubmit:A.handleSubmit(M),className:"space-y-5",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,t.jsx)(a.zB,{control:A.control,name:"firstName",render:e=>{let{field:s}=e;return(0,t.jsxs)(a.eI,{children:[(0,t.jsx)(a.lR,{children:"Há»"}),(0,t.jsx)(a.MJ,{children:(0,t.jsx)(i.p,{autoComplete:"given-name",placeholder:"Nháºp há»",className:"h-10",...s})}),(0,t.jsx)(a.C5,{})]})}}),(0,t.jsx)(a.zB,{control:A.control,name:"lastName",render:e=>{let{field:s}=e;return(0,t.jsxs)(a.eI,{children:[(0,t.jsx)(a.lR,{children:"T\xean"}),(0,t.jsx)(a.MJ,{children:(0,t.jsx)(i.p,{autoComplete:"family-name",placeholder:"Nháºp t\xean",className:"h-10",...s})}),(0,t.jsx)(a.C5,{})]})}})]}),(0,t.jsxs)("div",{className:"grid gap-2",children:[(0,t.jsx)(E.J,{children:"Sá» Äiá»n thoại"}),(0,t.jsx)(i.p,{disabled:!0,className:"h-10",value:null==p||null==(l=p.user)?void 0:l.phone})]}),(0,t.jsx)(a.zB,{control:A.control,name:"email",render:e=>{let{field:s}=e;return(0,t.jsxs)(a.eI,{children:[(0,t.jsx)(a.lR,{children:"Email"}),(0,t.jsx)(a.MJ,{children:(0,t.jsx)(i.p,{autoComplete:"email",type:"email",placeholder:"Nháºp email",className:"h-10",...s})}),(0,t.jsx)(a.C5,{})]})}}),(0,t.jsx)(a.zB,{control:A.control,name:"oldPassword",render:e=>{let{field:s}=e;return(0,t.jsxs)(a.eI,{children:[(0,t.jsx)(a.lR,{children:"Máºt khẩu cÅ©"}),(0,t.jsx)(a.MJ,{children:(0,t.jsx)(j.c,{className:"h-10",placeholder:"Nháºp máºt khẩu",autoComplete:"current-password",...s})}),(0,t.jsx)(a.C5,{})]})}}),(0,t.jsx)(a.zB,{control:A.control,name:"password",render:e=>{let{field:s}=e;return(0,t.jsxs)(a.eI,{children:[(0,t.jsx)(a.lR,{children:"Máºt khẩu"}),(0,t.jsx)(a.MJ,{children:(0,t.jsx)(j.c,{className:"h-10",placeholder:"Nháºp máºt khẩu",autoComplete:"new-password",...s})}),(0,t.jsx)(a.C5,{})]})}})]}),(0,t.jsx)(m.$,{className:"h-12 w-full",size:"lg",disabled:B,type:"submit",children:"X\xe1c nháºn"})]})})})]})}let G=h.z.object({phone:S.KA,password:S.$w}),O={incorrectPassword:"Máºt khẩu kh\xf4ng ch\xednh x\xe1c",notFound:"Sá» Äiá»n thoại kh\xf4ng tá»n tại",invali
1dPhone:"Sá» Äiá»n thoại kh\xf4ng hợp lá»"};function Z(e){var s,l,h;let{initFormType:g="login",onCallBack:v=()=>{}}=e,N=(0,d.mN)({resolver:(0,o.u)(G),values:{phone:"",password:""}}),{formState:{isSubmitting:f},setError:w}=N,y=(0,C.r)(e=>e.config),A=(0,V.k)(e=>e.user),[B,S]=(0,c.useState)(!0);async function z(e){try{let t=await (0,n.Jv)("credentials",{...e,merchantId:null==y?void 0:y.merchantId,redirect:!1});if(t.code||t.error){let e=JSON.parse(t.code);if(null==e?void 0:e.errors)for(let[t,n]of Object.entries(e.errors)){var s,l;w(t,{type:"server",message:null!=(l=null==O?void 0:O[null!=(s=null==n?void 0:n.key)?s:n])?l:n})}}else(0,n.IL)()?v():window.location.href=(0,n.LN)()}catch(e){b.toast.error("ÄÄng Nháºp lá»i",{description:"Lá»i kết ná»i Äến m\xe1y chá»§.",duration:5e3,icon:(0,t.jsx)(k.A,{className:"h-4 w-4 text-red-500"})})}}let[M,L]=(0,c.useState)(!0);(0,c.useEffect)(()=>{(null==A?void 0:A.id)&&L(!1)},[null==A?void 0:A.id]);let[J,P]=(0,c.useState)(g);return(0,c.useLayoutEffect)(()=>()=>{L(!0)},[]),(0,t.jsxs)(x.a,{title:"",description:"",isOpen:M,onClose:()=>{L(!1),v()},className:"gap-0 py-5",children:["login"==J&&(0,t.jsxs)(r.Zp,{className:"mx-auto w-full gap-8 border-none shadow-none",children:[(0,t.jsxs)(r.aR,{className:"gap-8",children:[(0,t.jsx)(r.ZB,{className:"text-center",children:(null==y||null==(s=y.theme)?void 0:s.logo)&&(0,t.jsx)(u.default,{className:"mx-auto",src:y.theme.logo.replace("/api/v1",""),alt:"",width:88,height:88})}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsxs)("h3",{className:"text-2xl font-semibold",children:["Ch\xe0o mừng Äến vá»i ",null!=(h=null==y||null==(l=y.theme)?void 0:l.merchantName)?h:""]}),(0,t.jsx)("span",{className:"text-lg text-[#B2B2B7]",children:"Vui l\xf2ng Äiá»n th\xf4ng tin ÄÄng nháºp"})]})]}),(0,t.jsx)(r.Wu,{children:(0,t.jsx)(a.lV,{...N,children:(0,t.jsxs)("form",{onSubmit:N.handleSubmit(z),className:"space-y-5",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-5",children:[(0,t.jsx)(a.zB,{control:N.control,name:"phone",render:e=>{let{field:s}=e;return(0,t.jsxs)(a.eI,{children:[(0,t.jsx)(a.lR,{className:":hover:border-primary",children:"Sá» Äiá»n thoại"}),(0,t.jsx)(a.MJ,{children:(0,t.jsx)(i.p,{autoComplete:"username",type:"tel",placeholder:"Nháºp sá» Äiá»n thoại",className:"focus:border-primary focus-visible:ring-primary h-10",...s})}),(0,t.jsx)(a.C5,{})]})}}),(0,t.jsx)(a.zB,{control:N.control,name:"password",render:e=>{let{field:s}=e;return(0,t.jsxs)(a.eI,{children:[(0,t.jsx)(a.lR,{children:"Máºt khẩu"}),(0,t.jsx)(a.MJ,{children:(0,t.jsx)(j.c,{autoComplete:"current-password",className:"focus:border-primary focus-visible:ring-primary h-10",placeholder:"Nháºp máºt khẩu",...s})}),(0,t.jsx)(a.C5,{})]})}})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(p.S,{checked:B,onCheckedChange:()=>S(!B),className:"my-auto"}),(0,t.jsx)("span",{className:"text-neutral-950",children:"Ghi nhá» ÄÄng nháºp"})]}),(0,t.jsx)(m.$,{onClick:()=>P("forgotPassword"),type:"button",variant:"link",className:"h-fit cursor-pointer p-0 text-base",children:"Qu\xean máºt khẩu"})]}),(0,t.jsx)(m.$,{className:"h-12 w-full",size:"lg",disabled:f,type:"submit",children:"ÄÄng nháºp"}),(0,t.jsxs)("div",{className:"text-center text-neutral-900",children:["Bạn chưa c\xf3 t\xe0i khoản?"," ",(0,t.jsx)(m.$,{onClick:()=>P("register"),type:"button",variant:"link",className:"h-fit cursor-pointer p-0 text-base",children:"ÄÄng k\xfd ngay"})]})]})})})]}),"register"==J&&(0,t.jsx)(I,{setFormType:P}),"forgotPassword"==J&&(0,t.jsx)(R,{setFormType:P}),"updateProfile"==J&&(0,t.jsx)(T,{onCallBack:v})]})}}}]);
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.