PageSourceSearch

https://j2proxy.vn/_next/static/chunks/34112-44297653768858b0.js

js j2proxy.vn collected 2026-10-02 02:13:53 UTC 33,519 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[34112],{34112:(e,t,s)=>{s.d(t,{A:()=>es});var r=s(95155),l=s(20865),a=s(39180),n=s(86525),o=s(80655),i=s(59915),c=s(85528),d=s(66942),x=s(52056),h=s(12115),p=s(22544),u=s(18720),m=s(15653);let f=(0,s(25959).v)()(e=>({user:null,setUser:t=>e({user:t}),updateCoin:t=>e(e=>({user:e.user?{...e.user,coin:Number(e.user.coin)+t}:null})),clearUser:()=>e({user:null})}));var g=s(13744),v=s(60919),j=s(61362),b=s(1141),w=s(64269),N=s(43303);let y="text-[20px] leading-[30px] font-semibold text-[#171717]",k="h-auto flex-1 rounded-none border-0 bg-transparent p-0 text-[14px] leading-5 font-medium text-black shadow-none placeholder:font-medium placeholder:text-[#A3A3A3] focus-visible:ring-0 focus-visible:ring-offset-0",C="".concat(k," pr-6"),_="cursor-pointer text-[14px] leading-5 font-semibold text-[rgb(from_var(--primary)_calc(r-23)_calc(g-9)_b)] hover:brightness-90",I="text-[14px] leading-5 font-normal text-[#A3A3A3]",z={background:"linear-gradient(180deg, rgb(from var(--primary) r calc(g + 39) calc(b + 47)) -2
10%, #FFFFFF 100%)"},A={background:"linear-gradient(90deg, rgb(from var(--primary) r calc(g + 10) calc(b + 47)) 0%, rgb(from var(--primary) calc(r - 5) calc(g + 37) calc(b + 49)) 51%, rgb(from var(--primary) r calc(g + 47) b) 100%)"},S="rgb(from var(--primary) r calc(g - 9) b)";function M(){let e=(0,h.useId)(),t=(0,h.useId)(),s=(0,h.useId)(),l=(0,h.useId)();return(0,r.jsxs)("div",{className:"relative flex w-full shrink-0 flex-col items-center",children:[(0,r.jsxs)("svg",{viewBox:"0 0 358 39",fill:"none",className:"h-auto w-full","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M179 38.5H244.465L271.934 0.5H314.967H358",stroke:"url(#".concat(e,")")}),(0,r.jsx)("path",{d:"M179 38.5H113.535L86.0665 0.5H43.0332H0",stroke:"url(#".concat(t,")")}),(0,r.jsxs)("defs",{children:[(0,r.jsxs)("linearGradient",{id:e,x1:"179",y1:"19.5",x2:"385.5",y2:"19.5",gradientUnits:"userSpaceOnUse",children:[(0,r.jsx)("stop",{stopColor:S}),(0,r.jsx)("stop",{offset:"1",stopColor:S,stopOpacity:"0"})]}),(0,r.jsxs)("linearGradient",{id:t,x1:"179",y1:"19.5",x2:"-26",y2:"19.5",gradientUnits:"userSpaceOnUse",children:[(0,r.jsx)("stop",{stopColor:S}),(0,r.jsx)("stop",{offset:"1",stopColor:S,stopOpacity:"0"})]})]})]}),(0,r.jsx)("div",{className:"relative z-10 -my-[32px] flex h-[70px] w-[70px] shrink-0 items-center justify-center rounded-full bg-white",style:{boxShadow:"0px 14px 30.5455px -16.5455px var(--primary)"},children:(0,r.jsx)("div",{className:"flex h-[62px] w-[62px] items-center justify-center rounded-full bg-white/[0.19]",children:(0,r.jsx)("div",{className:"flex h-[42px] w-[42px] items-center justify-center rounded-full",style:A,children:(0,r.jsx)(N.F.UserIcon,{className:"!h-5 !w-5"})})})}),(0,r.jsxs)("svg",{viewBox:"0 0 358 39",fill:"none",className:"h-auto w-full","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M179 0.5H244.465L271.933 38.5H314.967H358",stroke:"url(#".concat(s,")"),strokeDasharray:"2 2"}),(0,r.jsx)("path",{d:"M179 0.5H113.535L86.0666 38.5H43.0334H0.000183105",stroke:"url(#".concat(l,")"),strokeDasharray:"2 2"}),(0,r.jsxs)("defs",{children:[(0,r.jsxs)("linearGradient",{id:s,x1:"179",y1:"19.5",x2:"358",y2:"19.5",gradientUnits:"userSpaceOnUse",children:[(0,r.jsx)("stop",{stopColor:S}),(0,r.jsx)("stop",{offset:"1",stopColor:S,stopOpacity:"0"})]}),(0,r.jsxs)("linearGradient",{id:l,x1:"179",y1:"19.5",x2:"0.000183105",y2:"19.5",gradientUnits:"userSpaceOnUse",children:[(0,r.jsx)("stop",{stopColor:S}),(0,r.jsx)("stop",{offset:"1",stopColor:S,stopOpacity:"0"})]})]})]})]})}function E(e){let{label:t,children:s}=e;return(0,r.jsxs)("div",{className:"flex w-full flex-col items-start gap-1",children:[(0,r.jsx)("span",{className:"w-full text-[12px] leading-[18px] font-medium text-[#737373]",children:t}),(0,r.jsx)("div",{className:"flex h-[38px] w-full items-center rounded border border-[#D4D4D4] bg-white px-4",children:s})]})}function F(e){let{children:t,fill:s=!1}=e;return(0,r.jsxs)("div",{className:(0,w.cn)("flex w-full flex-col items-center overflow-hidden rounded-2xl bg-white",s?"absolute inset-0":"relative max-h-[85vh]"),children:[(0,r.jsx)("div",{className:"flex w-full shrink-0 flex-col items-center pt-6",style:z,children:(0,r.jsx)(M,{})}),(0,r.jsx)("div",{className:"no-scrollbar flex w-full flex-1 flex-col items-center justify-start gap-3 overflow-y-auto px-6 pt-1 pb-6",children:t})]})}var B=s(64812),J=s(66654);let L=m.z.object({hash:m.z.string().nonempty("M\xe3 l\xe0 bắt buộc"),email:J.rK,password:J.$w,confirmPassword:J.$w}),P={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 O(e){let{setFormType:t,onClose:s}=e,[l,c]=(0,h.useState)(!1),[m,f]=(0,h.useState)(""),[w,N]=(0,h.useState)(""),z=(0,p.mN)({resolver:(0,d.u)(L),values:{password:"",confirmPassword:"",hash:"",email:""},mode:"onChange"}),{formState:{isSubmitting:A,isValid:S},setError:M}=z,J=z.watch("email"),O=(0,a.r)(e=>e.config);async function D(e){try{if(!m)return void N("Vui l\xf2ng x\xe1c nhận bạn kh\xf4ng phải l\xe0 người m\xe1y");await g.A.postApi("/api/v1/auth/reset/password",e,"",{headers:{"x-merchant-id":null==O?void 0:O.merchantId}}),u.toast.success("Đặt lại mật khẩu th\xe0nh c\xf4ng",{duration:5e3,icon:(0,r.jsx)(j.A,{className:"text-success h-4 w-4"})})}catch(e){if(e instanceof v.pe){var t,s,l;let r=null==(t=e.response)?void 0:t.data;if(null==r?void 0:r.errors)for(let[e,t]of Object.entries(r.errors))M(e,{type:"server",message:null!=(l=null==P?void 0:P[null!=(s=null==t?void 0:t.key)?s:t])?l:t})}else u.toast.error("Đặt lại mật khẩu lỗi",{description:"Lỗi kết nối đến m\xe1y chá»
1§.",duration:5e3,icon:(0,r.jsx)(x.A,{className:"text-error h-4 w-4"})})}}async function H(e){try{e.preventDefault(),c(!0),await z.trigger("email")&&(await g.A.postApi("/api/v1/auth/forgot/password",{email:J},"",{headers:{"x-merchant-id":null==O?void 0:O.merchantId}}),u.toast.success("Gá»­i m\xe3 th\xe0nh c\xf4ng",{duration:5e3,icon:(0,r.jsx)(j.A,{className:"text-success h-4 w-4"})}))}catch(e){if(e instanceof v.pe){var t,s,l,a;let n=null==(t=e.response)?void 0:t.data;if(null==n?void 0:n.errors)for(let[e,t]of Object.entries(n.errors))M(e,{type:"server",message:null!=(a=null==P?void 0:P[null!=(l=null==t?void 0:t.key)?l:t])?a:t});else u.toast.error("Gá»­i m\xe3 lỗi",{description:null!=(s=null==n?void 0:n.message)?s:"Lỗi kết nối đến m\xe1y chá»§.",duration:5e3,icon:(0,r.jsx)(x.A,{className:"text-error h-4 w-4"})})}else u.toast.error("Gá»­i m\xe3 lỗi",{description:"Lỗi kết nối đến m\xe1y chá»§.",duration:5e3,icon:(0,r.jsx)(x.A,{className:"text-error h-4 w-4"})})}finally{c(!1)}}return(0,r.jsxs)(F,{children:[(0,r.jsx)("h1",{className:y,children:"Qu\xean mật khẩu"}),(0,r.jsx)(o.lV,{...z,children:(0,r.jsxs)("form",{onSubmit:z.handleSubmit(D),className:"flex w-full flex-col items-start gap-3",children:[(0,r.jsx)(o.zB,{control:z.control,name:"email",render:e=>{let{field:t}=e;return(0,r.jsxs)(o.eI,{className:"w-full",children:[(0,r.jsx)(E,{label:"Email",children:(0,r.jsx)(o.MJ,{children:(0,r.jsx)(i.p,{autoComplete:"email",type:"email",placeholder:"Nhập Email cá»§a bạn",className:k,...t})})}),(0,r.jsx)(o.C5,{className:"text-[11px]"})]})}}),(0,r.jsx)(o.zB,{control:z.control,name:"hash",render:e=>{let{field:t}=e;return(0,r.jsxs)(o.eI,{className:"w-full",children:[(0,r.jsxs)(E,{label:"M\xe3 OTP",children:[(0,r.jsx)(o.MJ,{children:(0,r.jsx)(i.p,{autoComplete:"one-time-code",type:"text",placeholder:"Nhập m\xe3 OTP",className:k,...t})}),(0,r.jsx)(n.$,{onClick:H,className:"bg-primary h-7 shrink-0 cursor-pointer rounded px-3 text-[12px] leading-[14px] font-semibold text-white hover:brightness-110",disabled:l||!J||""===J,type:"button",children:"Gá»­i"})]}),(0,r.jsx)(o.C5,{className:"text-[11px]"})]})}}),(0,r.jsx)(o.zB,{control:z.control,name:"password",render:e=>{let{field:t}=e;return(0,r.jsxs)(o.eI,{className:"w-full",children:[(0,r.jsx)(E,{label:"Mật khẩu mới",children:(0,r.jsx)(o.MJ,{children:(0,r.jsx)(B.c,{autoComplete:"new-password",type:"password",hideKeyIcon:!0,placeholder:"Nhập mật khẩu mới",className:C,...t})})}),(0,r.jsx)(o.C5,{className:"text-[11px]"})]})}}),(0,r.jsx)(o.zB,{control:z.control,name:"confirmPassword",render:e=>{let{field:t}=e;return(0,r.jsxs)(o.eI,{className:"w-full",children:[(0,r.jsx)(E,{label:"X\xe1c nhận mật khẩu",children:(0,r.jsx)(o.MJ,{children:(0,r.jsx)(B.c,{autoComplete:"new-password",type:"password",hideKeyIcon:!0,placeholder:"Nhập lại mật khẩu mới",className:C,...t})})}),(0,r.jsx)(o.C5,{className:"text-[11px]"})]})}}),(0,r.jsxs)("div",{className:"flex w-full flex-row flex-wrap items-center justify-center gap-1",children:[(0,r.jsx)("span",{className:I,children:"Đ\xe3 nhớ mật khẩu?"}),(0,r.jsx)("span",{onClick:()=>t("login"),className:_,children:"Đăng nhập"})]}),(0,r.jsxs)("div",{className:"flex w-full flex-col items-center gap-1",children:[(0,r.jsx)("div",{className:"h-[50px] w-[200px] overflow-hidden",children:(0,r.jsx)("div",{className:"origin-top-left scale-[0.65]",children:(0,r.jsx)(b.A,{sitekey:"6LcpBJ0pAAAAAP1Tf9GVLbiodi69ko_XQCP6Kqvx",onChange:e=>{e&&(f(e),w&&N(""))},onExpired:()=>f("")})})}),w&&(0,r.jsx)("span",{className:"text-[11px] leading-[13px] font-normal text-red-500",children:w})]}),(0,r.jsx)(n.$,{className:"bg-primary flex h-9 w-full cursor-pointer flex-row items-center justify-center gap-2 rounded text-[14px] leading-5 font-semibold text-white shadow-[0px_1px_2px_rgba(0,0,0,0.05)] hover:brightness-110",disabled:A||!S,type:"submit",children:"Đặt lại mật khẩu"})]})})]})}var D=s(95307),H=s(35652);let U=m.z.object({firstName:J.fV,lastName:J.tM,email:J.rK,phone:J.KA,password:J.$w}),G={invalidPhone:"Số điện thoại kh\xf4ng hợp lệ",phoneExists:"Số điện thoại đ\xe3 tồn tại"};function R(e){let{setFormType:t}=e,s=(0,p.mN)({resolver:(0,d.u)(U),values:{email:"",password:"",firstName:"",lastName:"",phone:""},mode:"onChange"}),{formState:{isSubmitting:c,isValid:m},setError:f}=s,w=(0,a.r)(e=>e.config),[N,z]=(0,h.useState)(""),[A,S]=(0,h.useState)("");async function M(e){try{if(!N)return void S("Vui l\xf2ng x\xe1c nhận bạn kh\xf4ng phải l\xe0 người m\xe1y");let t=(0,D.G2)(),s=(0,l.mD)(),a={...e,...s&&{domainSource:s},...t&&{refClickId:t}};await g.A.postApi("/api/v1/auth/register",a,"",{headers:{"x-merchant-id":null==w?void 0:w.merchantId}}),t&&(0,D.p7)(),u.toast.success("Đăng k\xfd th\xe0nh c\xf4ng",{duration:5e3,icon:(0,r.jsx)(j.A,{className:"text-success h-4 w-4"})}),await (0,l.Jv)("credentials",{phone:e.phone,password:e.password,merchantId:null==w?void 0:w.merchantId,redirect:!1}),(0,H.E)(),(0,l.IL)()||(window.location.href=(0,l.LN)())}catch(e){if(e instanceof v.pe){var t,s,a;let r=null==(t=e.response)?void 0:t.data;if(null==r?void 0:r.errors)for(let[e,t]of Object.entries(r.errors))f(e,{type:"server",message:null!=(a=null==G?void 0:G[null!=(s=null==t?void 0:t.key)?s:t])?a:t})}else u.toast.error("Đăng k\xfd lỗi",{description:"Lỗi kết nối đến m\xe1y chá»
1§.",duration:5e3,icon:(0,r.jsx)(x.A,{className:"text-error h-4 w-4"})})}}return(0,r.jsxs)(F,{children:[(0,r.jsx)("h1",{className:y,children:"Đăng k\xed"}),(0,r.jsx)(o.lV,{...s,children:(0,r.jsxs)("form",{onSubmit:s.handleSubmit(M),className:"flex w-full flex-col items-start gap-3",children:[(0,r.jsx)(o.zB,{control:s.control,name:"firstName",render:e=>{let{field:t}=e;return(0,r.jsxs)(o.eI,{className:"w-full",children:[(0,r.jsx)(E,{label:"Họ",children:(0,r.jsx)(o.MJ,{children:(0,r.jsx)(i.p,{autoComplete:"given-name",type:"text",placeholder:"Nhập họ",className:k,...t})})}),(0,r.jsx)(o.C5,{className:"text-[11px]"})]})}}),(0,r.jsx)(o.zB,{control:s.control,name:"lastName",render:e=>{let{field:t}=e;return(0,r.jsxs)(o.eI,{className:"w-full",children:[(0,r.jsx)(E,{label:"T\xean",children:(0,r.jsx)(o.MJ,{children:(0,r.jsx)(i.p,{autoComplete:"family-name",type:"text",placeholder:"Nhập t\xean",className:k,...t})})}),(0,r.jsx)(o.C5,{className:"text-[11px]"})]})}}),(0,r.jsx)(o.zB,{control:s.control,name:"email",render:e=>{let{field:t}=e;return(0,r.jsxs)(o.eI,{className:"w-full",children:[(0,r.jsx)(E,{label:"Email",children:(0,r.jsx)(o.MJ,{children:(0,r.jsx)(i.p,{autoComplete:"email",type:"email",placeholder:"Nhập Email cá»§a bạn",className:k,...t})})}),(0,r.jsx)(o.C5,{className:"text-[11px]"})]})}}),(0,r.jsx)(o.zB,{control:s.control,name:"phone",render:e=>{let{field:t}=e;return(0,r.jsxs)(o.eI,{className:"w-full",children:[(0,r.jsx)(E,{label:"Số điện thoại",children:(0,r.jsx)(o.MJ,{children:(0,r.jsx)(i.p,{autoComplete:"tel",type:"tel",placeholder:"Nhập số điện thoại",className:k,...t})})}),(0,r.jsx)(o.C5,{className:"text-[11px]"})]})}}),(0,r.jsx)(o.zB,{control:s.control,name:"password",render:e=>{let{field:t}=e;return(0,r.jsxs)(o.eI,{className:"w-full",children:[(0,r.jsx)(E,{label:"Mật khẩu",children:(0,r.jsx)(o.MJ,{children:(0,r.jsx)(B.c,{autoComplete:"new-password",type:"password",hideKeyIcon:!0,placeholder:"Nhập mật khẩu",className:C,...t})})}),(0,r.jsx)(o.C5,{className:"text-[11px]"})]})}}),(0,r.jsxs)("div",{className:"flex w-full flex-col items-center gap-1",children:[(0,r.jsx)("div",{className:"h-[50px] w-[200px] overflow-hidden",children:(0,r.jsx)("div",{className:"origin-top-left scale-[0.65]",children:(0,r.jsx)(b.A,{sitekey:"6LcpBJ0pAAAAAP1Tf9GVLbiodi69ko_XQCP6Kqvx",onChange:e=>{e&&(z(e),A&&S(""))}})})}),A&&(0,r.jsx)("span",{className:"text-[11px] leading-[13px] font-normal text-red-500",children:A})]}),(0,r.jsxs)("div",{className:"flex w-full flex-col items-start gap-3 pt-2",children:[(0,r.jsx)(n.$,{className:"bg-primary flex h-9 w-full cursor-pointer flex-row items-center justify-center gap-2 rounded text-[14px] leading-5 font-semibold text-white shadow-[0px_1px_2px_rgba(0,0,0,0.05)] hover:brightness-110",disabled:c||!m,type:"submit",children:"Tạo t\xe0i khoản"}),(0,r.jsxs)("div",{className:"flex w-full flex-row flex-wrap items-center justify-center gap-1",children:[(0,r.jsx)("span",{className:I,children:"Bạn đ\xe3 c\xf3 t\xe0i khoản?"}),(0,r.jsx)("span",{onClick:()=>t("login"),className:_,children:"Đăng nhập"})]})]})]})})]})}var T=s(86948),V=s(41052),K=s(65142),$=s(80389),X=s(76444),Q=s(96199),W=s(15239);let Z=m.z.object({password:m.z.string().optional(),firstName:m.z.string().min(2,"Họ tối thiểu 2 k\xed tá»±").optional(),lastName:m.z.string().min(2,"T\xean tối thiểu 2 k\xed tá»±").optional(),email:m.z.string().optional(),oldPassword:m.z.string().optional()}),q={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 Y(e){var t,s,o,i;let{onCallBack:c=()=>{}}=e,{data:h}=(0,Q.wV)(),{user:m,setUser:b}=f(),w={firstName:null!=(o=null==m?void 0:m.firstName)?o:"",lastName:null!=(i=null==m?void 0:m.lastName)?i:"",email:null==m?void 0:m.email,password:"",oldPassword:""},N=(0,p.mN)({resolver:(0,d.u)(Z),values:w}),{formState:{isSubmitting:y},setError:k}=N,C=(0,a.r)(e=>e.config);async function _(e){try{let t={...e};(null==e?void 0:e.password)||delete e.password,(null==e?void 0:e.oldPassword)||delete e.oldPassword;let s=await g.A.patchApi("/api/v1/auth/me",e,null==h?void 0:h.accessToken).then(e=>e.data);t.password?(0,l.CI)({callbackUrl:new URL("/",window.location.href).href,redirect:!0}):b(s),u.toast.success("Cập nhật th\xf4ng tin th\xe0nh c\xf4ng",{duration:5e3,icon:(0,r.jsx)(j.A,{className:"h-4 w-4 text-green-600"})}),c()}catch(e){if(e instanceof v.pe){var t,s,a;let r=null==(t=e.response)?void 0:t.data;if(null==r?void 0:r.errors)for(let[e,t]of Object.entries(r.errors))k(e,{type:"server",message:null!=(a=null==q?void 0:q[null!=(s=null==t?void 0:t.key)?s:t])?a:t})}else u.toast.error("Cập nhật th\xf4ng tin lỗi",{description:"Lỗi kết nối đến m\xe1y chá»
1§.",duration:5e3,icon:(0,r.jsx)(x.A,{className:"h-4 w-4 text-red-500"})})}}return(0,r.jsxs)(T.Zp,{className:"mx-auto w-full gap-4 border-none shadow-none",children:[(0,r.jsxs)(T.aR,{className:"gap-8",children:[(0,r.jsx)(T.ZB,{className:"text-center",children:(null==C||null==(t=C.theme)?void 0:t.logo)&&(0,r.jsx)(W.default,{className:"mx-auto",src:C.theme.logo.replace("/api/v1",""),alt:"",width:88,height:88})}),(0,r.jsx)("div",{className:"text-center",children:(0,r.jsx)("h3",{className:"text-2xl font-semibold",children:"Cập nhật th\xf4ng tin"})})]}),(0,r.jsx)(T.Wu,{children:(0,r.jsx)(V.lV,{...N,children:(0,r.jsxs)("form",{onSubmit:N.handleSubmit(_),className:"space-y-5",children:[(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-4",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,r.jsx)(V.zB,{control:N.control,name:"firstName",render:e=>{let{field:t}=e;return(0,r.jsxs)(V.eI,{children:[(0,r.jsx)(V.lR,{children:"Họ"}),(0,r.jsx)(V.MJ,{children:(0,r.jsx)(K.p,{autoComplete:"given-name",placeholder:"Nhập họ",className:"h-10",...t})}),(0,r.jsx)(V.C5,{})]})}}),(0,r.jsx)(V.zB,{control:N.control,name:"lastName",render:e=>{let{field:t}=e;return(0,r.jsxs)(V.eI,{children:[(0,r.jsx)(V.lR,{children:"T\xean"}),(0,r.jsx)(V.MJ,{children:(0,r.jsx)(K.p,{autoComplete:"family-name",placeholder:"Nhập t\xean",className:"h-10",...t})}),(0,r.jsx)(V.C5,{})]})}})]}),(0,r.jsxs)("div",{className:"grid gap-2",children:[(0,r.jsx)(X.J,{children:"Số điện thoại"}),(0,r.jsx)(K.p,{disabled:!0,className:"h-10",value:null==h||null==(s=h.user)?void 0:s.phone})]}),(0,r.jsx)(V.zB,{control:N.control,name:"email",render:e=>{let{field:t}=e;return(0,r.jsxs)(V.eI,{children:[(0,r.jsx)(V.lR,{children:"Email"}),(0,r.jsx)(V.MJ,{children:(0,r.jsx)(K.p,{autoComplete:"email",type:"email",placeholder:"Nhập email",className:"h-10",...t})}),(0,r.jsx)(V.C5,{})]})}}),(0,r.jsx)(V.zB,{control:N.control,name:"oldPassword",render:e=>{let{field:t}=e;return(0,r.jsxs)(V.eI,{children:[(0,r.jsx)(V.lR,{children:"Mật khẩu cÅ©"}),(0,r.jsx)(V.MJ,{children:(0,r.jsx)($.c,{className:"h-10",placeholder:"Nhập mật khẩu",autoComplete:"current-password",...t})}),(0,r.jsx)(V.C5,{})]})}}),(0,r.jsx)(V.zB,{control:N.control,name:"password",render:e=>{let{field:t}=e;return(0,r.jsxs)(V.eI,{children:[(0,r.jsx)(V.lR,{children:"Mật khẩu"}),(0,r.jsx)(V.MJ,{children:(0,r.jsx)($.c,{className:"h-10",placeholder:"Nhập mật khẩu",autoComplete:"new-password",...t})}),(0,r.jsx)(V.C5,{})]})}})]}),(0,r.jsx)(n.$,{className:"h-12 w-full",size:"lg",disabled:y,type:"submit",children:"X\xe1c nhận"})]})})})]})}let ee=m.z.object({phone:J.KA,password:J.$w}),et={incorrectPassword:"Mật khẩu kh\xf4ng ch\xednh x\xe1c",notFound:"Số điện thoại kh\xf4ng tồn tại",invalidPhone:"Số điện thoại kh\xf4ng hợp lệ"};function es(e){let{initFormType:t="login",onCallBack:s=()=>{}}=e,m=(0,p.mN)({resolver:(0,d.u)(ee),values:{phone:"",password:""},mode:"onChange"}),{formState:{isSubmitting:g,isValid:v},setError:j}=m,b=(0,a.r)(e=>e.config),w=f(e=>e.user);async function N(e){try{let r=await (0,l.Jv)("credentials",{...e,merchantId:null==b?void 0:b.merchantId,redirect:!1});if(r.code||r.error){let e=JSON.parse(r.code);if(null==e?void 0:e.errors)for(let[s,r]of Object.entries(e.errors)){var t,a;j(s,{type:"server",message:null!=(a=null==et?void 0:et[null!=(t=null==r?void 0:r.key)?t:r])?a:r})}}else(0,l.IL)()?s():window.location.href=(0,l.LN)()}catch(e){u.toast.error("Đăng Nhập lỗi",{description:"Lỗi kết nối đến m\xe1y chá»§.",duration:5e3,icon:(0,r.jsx)(x.A,{className:"text-error h-4 w-4"})})}}let[z,A]=(0,h.useState)(!0);(0,h.useEffect)(()=>{(null==w?void 0:w.id)&&A(!1)},[null==w?void 0:w.id]);let[S,M]=(0,h.useState)(t);return(0,h.useLayoutEffect)(()=>()=>{A(!0)},[]),(0,r.jsxs)(c.a,{title:"",titleClassName:"hidden",description:"",isOpen:z,onClose:()=>{A(!1),s()},closeClassName:"text-black",headerClassName:"!hidden",className:"login"===S?"!h-[466px] !w-[calc(100%-2rem)] !max-w-[406px] !overflow-visible !rounded-2xl !border !border-white/10 !p-0":"!h-fit !w-[calc(100%-2rem)] !max-w-[420px] !overflow-visible !rou
1nded-2xl !border !border-white/10 !p-0",children:["login"==S&&(0,r.jsxs)(F,{fill:!0,children:[(0,r.jsx)("h1",{className:y,children:"Đăng nhập"}),(0,r.jsx)(o.lV,{...m,children:(0,r.jsxs)("form",{onSubmit:m.handleSubmit(N),className:"flex w-full flex-col items-start gap-3",children:[(0,r.jsx)(o.zB,{control:m.control,name:"phone",render:e=>{let{field:t}=e;return(0,r.jsxs)(o.eI,{className:"w-full",children:[(0,r.jsx)(E,{label:"Số điện thoại",children:(0,r.jsx)(o.MJ,{children:(0,r.jsx)(i.p,{autoComplete:"username",type:"tel",placeholder:"Nhập số điện thoại của bạn",className:k,...t})})}),(0,r.jsx)(o.C5,{className:"text-[11px]"})]})}}),(0,r.jsx)(o.zB,{control:m.control,name:"password",render:e=>{let{field:t}=e;return(0,r.jsxs)(o.eI,{className:"w-full",children:[(0,r.jsx)(E,{label:"Mật khẩu",children:(0,r.jsx)(o.MJ,{children:(0,r.jsx)(B.c,{autoComplete:"current-password",type:"password",hideKeyIcon:!0,placeholder:"Nhập mật khẩu",className:C,...t})})}),(0,r.jsx)(o.C5,{className:"text-[11px]"})]})}}),(0,r.jsxs)("div",{className:"flex w-full flex-col items-start gap-3 pt-2",children:[(0,r.jsx)(n.$,{className:"bg-primary flex h-9 w-full cursor-pointer flex-row items-center justify-center gap-2 rounded text-[14px] leading-5 font-semibold text-white shadow-[0px_1px_2px_rgba(0,0,0,0.05)] hover:brightness-110",disabled:g||!v,type:"submit",children:"Đăng nhập"}),(0,r.jsx)("span",{onClick:()=>M("forgotPassword"),className:_,children:"Qu\xean mật khẩu?"}),(0,r.jsxs)("p",{className:"w-full text-center",children:[(0,r.jsxs)("span",{className:I,children:["Bạn chưa c\xf3 t\xe0i khoản?"," "]}),(0,r.jsx)("span",{className:_,onClick:()=>M("register"),children:"Đăng k\xfd"})]})]})]})})]}),"register"==S&&(0,r.jsx)(R,{setFormType:M}),"forgotPassword"==S&&(0,r.jsx)(O,{setFormType:M,onClose:()=>{A(!1),s()}}),"updateProfile"==S&&(0,r.jsx)(Y,{onCallBack:s})]})}},39045:(e,t,s)=>{s.d(t,{Cf:()=>d,lG:()=>o});var r=s(95155),l=s(89511);s(12115);var a=s(64269),n=s(43303);function o(e){let{...t}=e;return(0,r.jsx)(l.bL,{"data-slot":"dialog",...t})}function i(e){let{...t}=e;return(0,r.jsx)(l.ZL,{"data-slot":"dialog-portal",...t})}function c(e){let{className:t,...s}=e;return(0,r.jsx)(l.hJ,{"data-slot":"dialog-overlay",className:(0,a.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...s})}function d(e){let{className:t,children:s,showCloseButton:o=!0,title:d,titleClassName:p="",headerClassName:u="",closeClassName:m="",...f}=e;return(0,r.jsxs)(i,{"data-slot":"dialog-portal",children:[(0,r.jsx)(c,{}),(0,r.jsxs)(l.UC,{"data-slot":"dialog-content",className:(0,a.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 flex w-auto max-w-[583px] translate-x-[-50%] translate-y-[-50%] flex-col rounded-[24px] border-none shadow-[0_2px_4px_0_var(--shadow-modal)] duration-200 sm:max-w-[886px]",t),...f,children:[(0,r.jsxs)(x,{className:u,children:[(0,r.jsx)(h,{className:d?"text-text-normal-template-3 h-full align-middle text-[20px] leading-[22px] font-semibold ".concat(p," "):"hidden",children:d}),o&&(0,r.jsxs)(l.bm,{"data-slot":"dialog-close",className:(0,a.cn)("sticky-0 focus:ring-primary-hover data-[state=open]:bg-accent data-[state=open]:text-muted-foreground right-0 z-[60] rounded-full bg-black/50 transition-opacity hover:cursor-pointer hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",m),children:[(0,r.jsx)(n.F.CloseIcon,{className:"!h-6 !w-6 !text-white"}),(0,r.jsx)("span",{className:"sr-only",children:"Close"})]})]}),s]})]})}function x(e){let{className:t,...s}=e;return(0,r.jsx)("div",{"data-slot":"dialog-header",className:(0,a.cn)("sticky top-0 z-50 flex h-14 w-auto flex-row items-center justify-between gap-24 rounded-t-2xl bg-[#F3EAE2] px-8 py-4 text-center sm:text-left",t),...s})}function h(e){let{className:t,...s}=e;return(0,r.jsx)(l.hE,{"data-slot":"dialog-title",className:(0,a.cn)("text-normal text-base leading-none font-semibold",t),...s})}},59915:(e,t,s)=>{s.d(t,{p:()=>o});var r=s(95155);s(12115);var l=s(64269),a=s(12108),n=s(24033);function o(e){let{className:t,type:s,useCustomStepper:o=!1,disabled:i=!1,...c}=e,d="number"===s;return d&&o?(0,r.jsxs)("div",{className:"group relative w-full",children:[(0,r.jsx)("input",{type:s,"data-slot":"input",disabled:i,className:(0,l.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 text-normal flex h-10 w-full min-w-0 bg-transparent shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","placeholder:text-icon placeholder:text-sm placeholder:font-normal","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive","border-border-input gap-2 rounded-lg border px-3 py-2.5 shadow-none","hover:border-[rgb(from_var(--primary)_calc(r-23)_calc(g-9)_b)] focus-visible:border-[rgb(from_var(--primary)_calc(r-23)_calc(g-9)_b)]","[&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",d&&"w-full",t),...c}),d&&!1===i&&(0,r.jsxs)("div",{className:(0,l.cn)("pointer-events-none absolute top-1/2 right-1.5 flex -translate-y-1/2 flex-col items-center justify-center gap-2 opacity-0 transition-opacity duration-150","group-hover:pointer-events-auto group-hover:opacity-100"),children:[(0,r.jsx)("button",{type:"button",className:"hover:text-icon/110 h-4 w-4 translate-y-1 cursor-pointer text-[#616766] transition-colors",onClick:e=>{var t;let s=null==(t=e.currentTarget.parentElement)?void 0:t.previousElementSibling;s.stepUp(),s.dispatchEvent(new Event("change",{bubbles:!0}))},children:(0,r.jsx)(a.A,{className:"h-4 w-4",strokeWidth:3})}),(0,r.jsx)("button",{type:"button",className:"hover:text-icon/110 h-4 w-4 -translate-y-1 cursor-pointer text-[#616766] transition-colors",onClick:e=>{var t;let s=null==(t=e.currentTarget.parentElement)?void 0:t.previousElementSibling;s.stepDown(),s.dispatchEvent(new Event("change",{bubbles:!0}))},children:(0,r.jsx)(n.A,{className:"h-4 w-4",strokeWidth:3})})]})]}):(0,r.jsx)("input",{type:s,"data-slot":"input",disabled:i,className:(0,l.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 text-normal flex h-10 w-full min-w-0 bg-transparent shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed md:text-sm","placeholder:text-icon placeholder:text-sm placeholder:font-normal","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive","border-border-template-5 gap-2 rounded-lg border px-3 py-2.5 shadow-none","hover:border-[rgb(from_var(--primary)_calc(r-23)_calc(g-9)_b)] focus-visible:border-[rgb(from_var(--primary)_calc(r-23)_calc(g-9)_b)]","truncate overflow-hidden text-ellipsis whitespace-nowrap",t),...c})}},64812:(e,t,s)=>{s.d(t,{c:()=>o});var r=s(95155);s(12115);var l=s(55817),a=s(64269),n=s(43303);function o(e){let{className:t,hideKeyIcon:s=!1,hasValue:o=!1,...i}=e;return(0,r.jsx)(l.bL,{children:(0,r.jsxs)("div",{className:"relative w-full",children:[!s&&(0,r.jsx)("div",{className:"text-white'} absolute top-1/2 left-4 !h-5 !w-5 -translate-y-1/2 transition-colors",children:(0,r.jsx)(n.F.KeyIcon,{className:"pointer-events-none !h-5 !w-5 text-white"})}),(0,r.jsx)(l.pd,{className:(0,a.cn)("placeholder:text-icon selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 gap-2 border bg-transparent px-3 py-2.5 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","hover:border-[rgb(from_var(--primary)_calc(r-23)_calc(g-9)_b)] focus-visible:border-[rgb(from_var(--primary)_calc(r-23)_calc(g-9)_b)]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive","pr-[40px] [&::-ms-clear]:hidden [&::-ms-reveal]:hidden [&::-webkit-contacts-auto-fill-button]:hidden [&::-webkit-credentials-auto-fill-button]:hidden",!s&&"pl-[48px]","truncate overflow-hidden text-ellipsis whitespace-nowrap",t),...i}),(0,r.jsx)(l.lM,{id:i.id+"btn-toggle",className:"absolute top-1/2 right-4 -translate-y-1/2 text-gray-500 hover:cursor-pointer hover:text-gray-700",children:(0,r.jsx)(l.In,{visible:(0,r.jsx)(n.F.EyeOpenIcon,{className:"!h-5 !w-5 text-[#D1D4D4]"}),hidden:(0,r.jsx)(n.F.EyeCloseIcon,{className:"!h-5 !w-5 text-[#D1D4D4]"})})})]})})}},80655:(e,t,s)=>{s.d(t,{C5:()=>g,MJ:()=>f,eI:()=>u,lR:()=>m,lV:()=>c,zB:()=>x});var r=s(95155),l=s(12115),a=s(32467),n=s(22544),o=s(64269),i=s(76444);let c=n.Op,d=l.createContext({}),x=e=>{let{...t}=e;return(0,r.jsx)(d.Provider,{value:{name:t.name},children:(0,r.jsx)(n.xI,{...t})})},h=()=>{let e=l.useContext(d),t=l.useContext(p),{getFieldState:s,formState:r}=(0,n.xW)(),a=s(e.name,r);
1if(!e)throw Error("useFormField should be used within <FormField>");let{id:o}=t;return{id:o,name:e.name,formItemId:"".concat(o,"-form-item"),formDescriptionId:"".concat(o,"-form-item-description"),formMessageId:"".concat(o,"-form-item-message"),...a}},p=l.createContext({}),u=l.forwardRef((e,t)=>{let{className:s,...a}=e,n=l.useId();return(0,r.jsx)(p.Provider,{value:{id:n},children:(0,r.jsx)("div",{ref:t,className:(0,o.cn)("flex w-full flex-col gap-2",s),...a})})});u.displayName="FormItem";let m=l.forwardRef((e,t)=>{let{className:s,...l}=e,{error:a,formItemId:n}=h();return(0,r.jsx)(i.J,{ref:t,className:(0,o.cn)(a&&"text-text-normal","h-[17px]",s),htmlFor:n,...l})});m.displayName="FormLabel";let f=l.forwardRef((e,t)=>{let{...s}=e,{error:l,formItemId:n,formDescriptionId:o,formMessageId:i}=h();return(0,r.jsx)(a.DX,{ref:t,id:n,"aria-describedby":l?"".concat(o," ").concat(i):"".concat(o),"aria-invalid":!!l,...s})});f.displayName="FormControl",l.forwardRef((e,t)=>{let{className:s,...l}=e,{formDescriptionId:a}=h();return(0,r.jsx)("p",{ref:t,id:a,className:(0,o.cn)("text-muted-foreground text-[0.8rem]",s),...l})}).displayName="FormDescription";let g=l.forwardRef((e,t)=>{var s;let{className:l,children:a,...n}=e,{error:i,formMessageId:c}=h(),d=i?String(null!=(s=null==i?void 0:i.message)?s:""):a;return d?(0,r.jsx)("p",{ref:t,id:c,className:(0,o.cn)("text-error text-sm font-medium",l),...n,children:d}):null});g.displayName="FormMessage"},85528:(e,t,s)=>{s.d(t,{a:()=>n});var r=s(95155),l=s(43303),a=s(39045);let n=e=>{let{title:t,description:s,isOpen:n,onClose:o,children:i,className:c,titleClassName:d,headerClassName:x,closeClassName:h,style:p}=e;return(0,r.jsx)(a.lG,{open:n,onOpenChange:e=>{e||o()},children:(0,r.jsxs)(a.Cf,{className:c,style:p,title:t,titleClassName:null!=d?d:"",headerClassName:null!=x?x:"",onOpenAutoFocus:e=>{e.preventDefault()},showCloseButton:!1,children:[(0,r.jsx)("button",{type:"button",onClick:o,className:"absolute top-2 right-3 z-99 flex cursor-pointer items-center justify-center rounded-full transition-all hover:cursor-pointer focus:outline-none",children:(0,r.jsx)(l.F.CloseIcon,{className:"!h-6 !w-6 ".concat(h)})}),(0,r.jsx)("div",{children:i})]})})}},86525:(e,t,s)=>{s.d(t,{$:()=>i});var r=s(95155);s(12115);var l=s(32467),a=s(83101),n=s(64269);let o=(0,a.F)("inline-flex items-center hover:cursor-pointer justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium transition-all disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[1px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border border-primary bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 text-primary data-[active=true]:text-primary data-[active=true]:border-primary data-[active=true]:bg-primary/10",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-primary-hover hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-lg gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-lg px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function i(e){let{className:t,variant:s,size:a,asChild:i=!1,...c}=e,d=i?l.DX:"button";return(0,r.jsx)(d,{"data-slot":"button",className:(0,n.cn)(o({variant:s,size:a,className:t})),...c})}}}]);

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.