1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[27853],{20865:(e,t,r)=>{r.d(t,{CI:()=>c,IL:()=>s,Jv:()=>u,LN:()=>l,mD:()=>a});var n=r(96199),i=r(75746),o=r(69715);function a(){return window.location.host}function l(){let e="true"===sessionStorage.getItem("preview_mode")?new URLSearchParams(window.location.search).get("previewTemplate"):null;return e?"/?previewTemplate=".concat(e):"/"}function s(){return"true"===sessionStorage.getItem("preview_mode")}function u(e,t){return s()?(i.k.getState().setUser(o._o),Promise.resolve({code:null,error:null})):(0,n.Jv)(e,t)}function c(e){return s()?(i.k.getState().clearUser(),Promise.resolve(void 0)):(0,n.CI)(e)}},34510:(e,t,r)=>{r.d(t,{U:()=>h});var n=r(95155),i=r(95307),o=r(39180),a=r(75746),l=r(13744),s=r(60919),u=r(52056),c=r(61362),d=r(96199),m=r(20063),f=r(18720);let p={notEnoughCoin:"T\xe0i khoản kh\xf4ng Äá»§ tiá»n",notFound:"Sá» Äiá»n thoại kh\xf4ng tá»n tại",notEnoughProxy:"Kh\xf4ng Äá»§ proxy"};function h(e){let{payload:t,redirect:r="/proxies",formParent:h,onClose:g,onOpenTaxcodeModal:v,onNotEnoughCoin:x}=e,{data:k}=(0,d.wV)(),w=(0,m.useRouter)(),A=(0,a.k)(e=>e.user),y=(0,a.k)(e=>e.setUser),I=(0,o.r)(e=>e.config),b=(0,i.Yk)(),_=b?{clickId:b.clickId,affiliateId:b.affiliateId,programId:b.programId,referralCode:b.referralCode}:void 0;return{submit:async e=>{var i,o,a,d,m,b,C,S,N,E,j,T,z,M,F,R;let J=null==k||null==(i=k.user)?void 0:i.accessToken,L=null!=(a=null==k||null==(o=k.user)?void 0:o.merchantId)?a:null==I?void 0:I.merchantId;try{try{await l.A.postApi("/api/v1/activity-logs",{},J,{headers:{"x-merchant-id":L}})}catch(e){}if(e.withTaxCode){null==v||v(),null==g||g();return}let i="/api/v1/orders";(null==A||null==(d=A.role)?void 0:d.id)=="2"&&(i+="/merchant"),await l.A.postApi(i,{...t,...e,..._&&{refData:_}},J);let o=!1;try{for(let e=0;e<5;e++){await l.A.sleep(300);let e=await l.A.fetchApi("/api/v1/orders?limit=1&page=1&sort=".concat(encodeURIComponent('[{"orderBy":"createdAt","order":"desc"}]')),J,{headers:{"x-merchant-id":L}}),t=null==e||null==(m=e.data)?void 0:m[0];if(t){(null==(b=t.status)?void 0:b.id)===7&&"ipAddressNotEnough"===t.description&&(o=!0);break}}}catch(e){}if(o)return void f.toast.warning("Kh\xf4ng Äá»§ proxy",{description:"Proxy hiá»n kh\xf4ng Äá»§ Äá» cung cấp. ÄÆ¡n h\xe0ng Ä\xe3 bá» huá»·, sá» dư v\xed cá»§a bạn kh\xf4ng bá» trừ.",duration:8e3,icon:(0,n.jsx)(u.A,{className:"h-4 w-4 text-yellow-500"})});if("WALLET"===e.paymentMethod){let e=Number(null!=(C=null==A?void 0:A.coin)?C:0);try{for(let t=0;t<8;t++){let t=await l.A.fetchApi("/api/v1/auth/me",J,{headers:{"x-merchant-id":L}});if(t&&(y(t),Number(null!=(S=t.coin)?S:0)!==e))break;await l.A.sleep(250)}}catch(e){}}f.toast.success("Mua h\xe0ng th\xe0nh c\xf4ng",{duration:5e3,icon:(0,n.jsx)(c.A,{className:"h-4 w-4 text-green-600"})}),w.push(r)}catch(e){if(e instanceof s.pe){let t=null==(N=e.response)?void 0:N.data;if(null==t?void 0:t.message){if("notEnoughCoin"===t.message&&x)return void x();f.toast.error("Xá» l\xfd ÄÆ¡n h\xe0ng lá»i",{description:null!=(E=null==p?void 0:p[t.message])?E:t.message,duration:5e3,icon:(0,n.jsx)(u.A,{className:"h-4 w-4 text-red-500"})})}else(null==t?void 0:t.errors)&&((null==(j=t.errors)?void 0:j.user)?f.toast.error("Xá» l\xfd ÄÆ¡n h\xe0ng lá»i",{description:null!=(T=null==p?void 0:p[t.errors.user])?T:t.errors.user,duration:5e3,icon:(0,n.jsx)(u.A,{className:"h-4 w-4 text-red-500"})}):h?(l.A.handleFormErrorFromResponse(h,null==(z=t.errors)?void 0:z.products[0],p),null==g||g()):f.toast.error("Xá» l\xfd ÄÆ¡n h\xe0ng lá»i",{description:null!=(R=null==(F=t.errors)||null==(M=F.products)?void 0:M[0])?R:"Lá»i kh\xf4ng x\xe1c Äá»nh",duration:5e3,icon:(0,n.jsx)(u.A,{className:"h-4 w-4 text-red-500"})}))}else f.toast.error("Xá» l\xfd ÄÆ¡n h\xe0ng lá»i",{description:"Lá»i kết ná»i Äến m\xe1y chá»§.",duration:5e3,icon:(0,n.jsx)(u.A,{className:"h-4 w-4 text-red-500"})})}},refData:_}}},35652:(e,t,r)=>{r.d(t,{E:()=>m,default:()=>d});var n=r(12115),i=r(20063),o=r(72378),a=r(13744),l=r(96199),s=r(20865);let u="__hp_utm",c=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"];function d(){let e=(0,i.useSearchParams)(),{status:t}=(0,l.wV)();return(0,n.useEffect)(()=>
1{if("authenticated"===t)return;let r=e.get("utm_source"),n=e.get("utm_type"),i=o.A.get(u);if(r&&"mkt"===n&&!i){let t={};for(let r of c){let n=e.get(r);n&&(t[r]=n)}if(!t.utm_source)return;let r=window.location.pathname,n=r&&"/"!==r?"".concat(window.location.host).concat(r):window.location.host,i=(0,s.mD)();a.A.postApi("/api/v1/utms/utm-visit",{utmSource:t.utm_source,utmMedium:t.utm_medium,utmCampaign:t.utm_campaign,utmContent:t.utm_content,utmTerm:t.utm_term,domain:n,...i&&{domainSource:i}}).then(e=>{(null==e?void 0:e.valid)&&o.A.set(u,JSON.stringify(t),{expires:30,path:"/",sameSite:"lax"})}).catch(()=>{})}},[e,t]),null}function m(){o.A.remove(u,{path:"/"})}},41052:(e,t,r)=>{r.d(t,{C5:()=>x,MJ:()=>g,Rr:()=>v,eI:()=>p,lR:()=>h,lV:()=>u,zB:()=>d});var n=r(95155),i=r(12115),o=r(32467),a=r(22544),l=r(64269),s=r(76444);let u=a.Op,c=i.createContext({}),d=e=>{let{...t}=e;return(0,n.jsx)(c.Provider,{value:{name:t.name},children:(0,n.jsx)(a.xI,{...t})})},m=()=>{let e=i.useContext(c),t=i.useContext(f),{getFieldState:r}=(0,a.xW)(),n=(0,a.lN)({name:e.name}),o=r(e.name,n);if(!e)throw Error("useFormField should be used within <FormField>");let{id:l}=t;return{id:l,name:e.name,formItemId:"".concat(l,"-form-item"),formDescriptionId:"".concat(l,"-form-item-description"),formMessageId:"".concat(l,"-form-item-message"),...o}},f=i.createContext({});function p(e){let{className:t,...r}=e,o=i.useId();return(0,n.jsx)(f.Provider,{value:{id:o},children:(0,n.jsx)("div",{"data-slot":"form-item",className:(0,l.cn)("grid gap-2",t),...r})})}function h(e){let{className:t,...r}=e,{error:i,formItemId:o}=m();return(0,n.jsx)(s.J,{"data-slot":"form-label","data-error":!!i,className:(0,l.cn)("data-[error=true]:text-destructive",t),htmlFor:o,...r})}function g(e){let{...t}=e,{error:r,formItemId:i,formDescriptionId:a,formMessageId:l}=m();return(0,n.jsx)(o.DX,{"data-slot":"form-control",id:i,"aria-describedby":r?"".concat(a," ").concat(l):"".concat(a),"aria-invalid":!!r,...t})}function v(e){let{className:t,...r}=e,{formDescriptionId:i}=m();return(0,n.jsx)("p",{"data-slot":"form-description",id:i,className:(0,l.cn)("text-muted-foreground text-sm",t),...r})}function x(e){var t;let{className:r,...i}=e,{error:o,formMessageId:a}=m(),s=o?String(null!=(t=null==o?void 0:o.message)?t:""):i.children;return s?(0,n.jsx)("p",{"data-slot":"form-message",id:a,className:(0,l.cn)("text-destructive text-sm",r),...i,children:s}):null}},66654:(e,t,r)=>{r.d(t,{$w:()=>a,KA:()=>o,fV:()=>s,rK:()=>l,tM:()=>u});var n=r(15653);let i=/^0[1-9]\d{8}$/,o=n.z.preprocess(e=>"string"==typeof e?e.trim().replace(/[^\d+]/g,"").replace(/^(\+?84)/,"0"):e,n.z.string().nonempty("Sá» Äiá»n thoại l\xe0 bắt buá»c").refine(e=>i.test(e),{message:"Sá» Äiá»n thoại kh\xf4ng hợp lá»"})),a=n.z.string().nonempty("Máºt khẩu l\xe0 bắt buá»c").regex(/^[a-zA-Z0-9@#$%^&*()_+!\-=.?]*$/,"Máºt khẩu chứa k\xfd tá»± kh\xf4ng hợp lá»").min(6,"Máºt khẩu tá»i thiá»u 6 k\xed tá»±");n.z.preprocess(e=>{if("string"!=typeof e)return e;let t=e.trim();return""===t?void 0:t},n.z.string().email("Email kh\xf4ng hợp lá»").optional().transform(e=>"string"==typeof e?e.toLowerCase():e));let l=n.z.preprocess(e=>"string"==typeof e?e.trim():e,n.z.string().nonempty("Email l\xe0 bắt buá»c").email("Email kh\xf4ng hợp lá»").transform(e=>e.toLowerCase())),s=n.z.string().min(1,"Há» l\xe0 bắt buá»c").max(50,"Tá»i Äa 50 k\xfd tá»±"),u=n.z.string().min(1,"T\xean l\xe0 bắt buá»c").max(50,"Tá»i Äa 50 k\xfd tá»±")},75746:(e,t,r)=>{r.d(t,{k:()=>n});let n=(0,r(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})}))},76444:(e,t,r)=>{r.d(t,{J:()=>a});var n=r(95155);r(12115);var i=r(10489),o=r(64269);function a(e){let{className:t,...r}=e;return(0,n.jsx)(i.b,{"data-slot":"label",className:(0,o.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...r})}},95307:(e,t,r)=>{r.d(t,{p7:()=>g,default:()=>f,G2:()=>h,Yk:()=>p});var n=r(12115),i=r(20063),o=r(72378),a=r(1474);let l=null,s=null;var u=r(39180),c=r(13744);let d="ref_data",m="ref_click_id";function f(){let e=(0,i.useSearchParams)(),{fingerprint:t,getFingerprint:r}
1=function(){let[e,t]=(0,n.useState)(l),[r,i]=(0,n.useState)(!l),[o,u]=(0,n.useState)(null),c=(0,n.useCallback)(async()=>{if(l)return l;try{s||(s=a.Ay.load());let e=await s,r=await e.get(),n={visitorId:r.visitorId,confidence:r.confidence.score};return l=n,t(n),n}catch(t){let e=t instanceof Error?t:Error("Failed to get fingerprint");return u(e),console.error("Fingerprint error:",e),null}},[]);return(0,n.useEffect)(()=>{l||(i(!0),c().finally(()=>i(!1)))},[c]),{fingerprint:e,isLoading:r,error:o,getFingerprint:c}}(),f=(0,u.r)(e=>e.config),p=null==f?void 0:f.merchantId,h=(0,n.useRef)(!1);return(0,n.useEffect)(()=>{(async()=>{let n=e.get("ref");if(!n||!p||h.current)return;let i=e.get("cid");if(!i){let e=o.A.get(d);if(e)try{if(JSON.parse(e).referralCode===n)return}catch(e){}}h.current=!0;let a=t;a||(a=await r());let l={referralCode:n,landingUrl:window.location.href,referer:document.referrer||void 0,utmSource:e.get("utm_source")||void 0,utmMedium:e.get("utm_medium")||void 0,utmCampaign:e.get("utm_campaign")||void 0};i&&(l.cid=i),a&&(l.fingerprint=a.visitorId,l.fingerprintConfidence=a.confidence);try{let e=await c.A.postApi("/api/v1/clicks/track",l,"",{headers:{"x-merchant-id":p}});if(null==e?void 0:e.valid){let t=e.cookieMaxAge||2592e3,r=new Date(Date.now()+1e3*t),n={referralCode:e.referralCode,affiliateId:e.affiliateId,programId:e.programId,clickId:e.clickId,trackedAt:new Date().toISOString()};o.A.set(d,JSON.stringify(n),{expires:r,path:"/",sameSite:"lax"}),e.clickId&&o.A.set(m,e.clickId,{expires:r,path:"/",sameSite:"lax"}),console.log("[ReferralTracker] Tracked successfully:",e)}else console.warn("[ReferralTracker] Invalid referral:",null==e?void 0:e.error)}catch(e){console.error("[ReferralTracker] Track error:",e),h.current=!1}})()},[e,t,r,p]),null}function p(){let e=o.A.get(d);if(!e)return null;try{return JSON.parse(e)}catch(e){return null}}function h(){return o.A.get(m)}function g(){o.A.remove(d,{path:"/"}),o.A.remove(m,{path:"/"})}}}]);
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.