PageSourceSearch

https://fastlance.vn/_next/static/chunks/pages/affiliate-program/dashboard-db546c26b1a10a52.js

js fastlance.vn collected 2026-09-24 13:07:26 UTC 7,431 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4055],{11186:(e,n,t)=>{"use strict";t.d(n,{I:()=>o,J3:()=>c,Mb:()=>l,X$:()=>d});var r=t(67684),i=t(42252),s=t(15526),a=t(66002),u=t(84367),l=function(e,n){return(0,i.I)((0,r._)({queryKey:[a.FP,a.zW,e],queryFn:function(){return u.v.getNonSellerInfo()},enabled:!!e},n))},c=function(e,n,t){var s={limit:t.limit,page:t.page};return(0,i.I)((0,r._)({queryKey:[a.FP,a.El,e,s],queryFn:function(){return u.v.getStats(n,s)}},t))},o=function(){return(0,s.n)(function(e){var n=e.product_slug;return u.v.generateAffiliateLink({product_slug:n})})},d=function(e,n){return(0,i.I)((0,r._)({queryKey:[a.FP,a.$P,e],queryFn:function(){return u.v.getStatsByProduct(e)}},n))}},25209:(e,n,t)=>{"use strict";t.r(n),t.d(n,{__N_SSP:()=>P,default:()=>k,defaultStatsParams:()=>q});var r=t(67684),i=t(62701),s=t(37876),a=t(18847),u=t.n(a),l=t(89099),c=t(14232),o=t(10997),d=t(93996),f=t(20294),_=t(14678),p=t(57647),g=t(88202),v=t(80481),m=t(50075),h=t(11186),x=t(71260);let j=function(e){var n=e.disclosure,t=function(){if(null==P?void 0:P.data){var e=null==P?void 0:P.data,n=e.user,t=e.snapshot;return"".concat((0,g.$)().HOSTNAME,"/user/").concat(null==n?void 0:n.username,"/").concat(null==t?void 0:t.slug)}return""},r=function(){if(t())return"".concat(t(),"?rid=").concat(null==w?void 0:w.username)},i=function(){c(),o.push(y.split("?")[0])},a=(0,f._)((0,m.Bd)(v.ZX),1)[0],u=n.isOpen,c=n.onClose,o=(0,l.useRouter)(),j=o.query,y=o.asPath,b=null==j?void 0:j["generate-affiliate-link"],w=(0,d.u)().user,N=(0,h.I)(),P=(0,x.qf)(b,{enabled:!!(u&&b)}),q=(0,h.X$)(b,{enabled:!!(u&&b)});return(0,s.jsxs)(p.A,{isShown:u,onClickToClose:i,children:[(0,s.jsx)("div",{className:"header _pdbt-16px _mg-4px",children:(0,s.jsx)("h2",{className:"_fw-600 _fs-400",children:"สร้างลิงก์ Affiliate"})}),(0,s.jsx)("hr",{}),N.isError?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"_tal-ct _pdv-48px _dp-f _fdrt-cl _gg-16px",children:[(0,s.jsx)("i",{className:"fa-solid fa-circle-xmark fa-3x _cl-negative-200"}),(0,s.jsx)("h2",{className:"_fw-600 _fs-400 _mgt-8px",children:"ไม่สามารถสร้างลิงก์ Affiliate ได้"}),(0,s.jsx)("span",{className:"_fs-300 _cl-text-default-200 _wsp-pl",children:"เนื่องจากจำนวนลิงก์เกินจากที่ระบบกำหนดไว้ (สร้างได้สูงสุด 100 ลิงก์)"})]}),(0,s.jsx)("hr",{}),(0,s.jsx)("div",{className:"_dp-f _jtfct-fe",children:(0,s.jsx)(_.$n,{className:"_mgt-12px _pdh-40px",variant:"negative",onClick:i,children:"ปิด"})})]}):(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("div",{className:"_tal-ct _pdv-40px _dp-f _fdrt-cl _gg-24px",children:[((null==q?void 0:q.isError)||N.isSuccess)&&(0,s.jsxs)("div",{className:"_dp-f _fdrt-cl _gg-8px",children:[(0,s.jsx)("span",{className:"_fw-600 _fs-300 _tal-l",children:"ลิงก์ที่ต้องการสร้าง"}),(0,s.jsxs)("div",{className:"_dp-f _gg-8px",children:[(0,s.jsx)(_.pd,{value:t(),className:"_f-1",isFluid:!0,disabled:!0}),(0,s.jsx)(_.$n,{className:"_wsp-nw _w-128px",onClick:function(){N.mutate({product_slug:null==j?void 0:j["generate-affiliate-link"]},{onSuccess:function(){q.refetch()}})},disabled:P.isLoading||N.isSuccess,children:"สร้าง"})]})]}),(null==q?void 0:q.isSuccess)&&(0,s.jsxs)("div",{className:"_dp-f _fdrt-cl _gg-8px",children:[(0,s.jsx)("span",{className:"_fw-600 _fs-300 _tal-l",children:"ลิงก์ Affiliate"}),(0,s.jsxs)("div",{className:"_dp-f _gg-8px",children:[(0,s.jsx)(_.pd,{value:r(),className:"_f-1",isFluid:!0,disabled:!0}),(0,s.jsx)(_.$n,{className:"_wsp-nw _w-128px",onClick:function(){navigator.clipboard.writeText(r()),_.y8.success({text:a("share-modal.copy-toast.complete")})},disabled:P.isLoading,children:"คัดลอก"})]})]}),(null==q?void 0:q.isLoading)&&(0,s.jsx)("div",{children:(0,s.jsx)(_.aH,{variant:"dot"})})]})})]})};var y=t(82573),b=t(84367),w=u()(function(){return Promise.all([t.e(4954),t.e(6077),t.e(2683),t.e(6018),t.e(401),t.e(1604),t.e(3614)]).then(t.bind(t,63614))},{loadableGenerated:{webpack:function(){return[63614]}}}),N=u()(function(){return Promise.all([t.e(4954),t.e(6077),t.e(2683),t.e(6018),t.e(401),t.e(1604),t.e(953)]).then(t.bind(t,30953))},{loadableGenerated:{webpack:function(){return[30953]}}}),P=!0,q={limit:10,page:1};let k=function(e){var n=e.isMobile,t=function(){f["generate-affiliate-link"]&&_.onOpen()},a=(0,l.useRouter)(),u=a.isReady,f=a.query,_=(0,y.j)(),p=(0,d.u)(),v=p.user,m=p.isLoggedIn,x=p.accessToken,P=(0,h.J3)(null==v?void 0:v.id,x,{enabled:m,limit:q.limit,page:Number(null==f?void 0:f.page)||q.page}),k=P.data,S=P.isLoading;(0,c.useEffect)(function(){m&&(null==k?void 0:k.user_affiliate_status)==="APPROVED"&&b.Pw.getInstance().trackAffiliateDashboardView(v.id,k.user_t
1ype)},[]),(0,c.useEffect)(function(){u&&t()},[u]);var F=(0,c.useMemo)(function(){var e;return(null==k||null==(e=k.stats)?void 0:e.map(function(e){var n=(0,r._)({},e,e.product);return e.is_common?(0,i._)((0,r._)({},n),{show:!0,title:"หน้าแรกของ ".concat((0,g.$)().APP_NAME),cover_image_thumbnail:"/static-v4/images/affiliate/cover-homepage.png"}):n}))||[]},[k]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.W8,{}),n&&(0,s.jsx)(w,{stats:k,isLoading:S,products:F}),!n&&(0,s.jsx)(N,{stats:k,isLoading:S,products:F}),(0,s.jsx)(j,{disclosure:_})]})}},42452:(e,n,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/affiliate-program/dashboard",function(){return t(25209)}])},71260:(e,n,t)=>{"use strict";t.d(n,{DS:()=>g,Rq:()=>v,SJ:()=>x,_3:()=>m,pU:()=>p,qf:()=>h});var r=t(16927),i=t(67684),s=t(62701),a=t(65699),u=t(4902),l=t(42252),c=t(79819),o=t(15526),d=t(66002),f=t(84367),_=t(93661),p=function(){var e=(0,o.n)(function(e){return(0,r._)(function(){return(0,u.YH)(this,function(n){switch(n.label){case 0:return[4,f.jU.createProductActionLog(e)];case 1:return[2,n.sent().createProductActionLog]}})})()});return(0,i._)({referenceUserId:(0,_.Tv)()},e)},g=function(e){var n=[d.g1,e],t=(0,l.I)({queryKey:n,queryFn:function(){return(0,r._)(function(){var n,t;return(0,u.YH)(this,function(r){switch(r.label){case 0:return[4,f.jU.getRelatedProduct(e)];case 1:return[2,(null==(t=r.sent())||null==(n=t.getRelatedProducts)?void 0:n.related_products)||[]]}})})()},cacheTime:1/0,staleTime:1/0,enabled:!!e});return(0,i._)({queryKey:n},t)},v=function(e){var n={id:e,page:1,limit:5};return(0,c.q)({queryKey:[d.QV,e],queryFn:function(e){var t=e.pageParam,i=void 0===t?n:t;return(0,r._)(function(){return(0,u.YH)(this,function(e){switch(e.label){case 0:return[4,f.jU.getSellerReviews(i)];case 1:return[2,e.sent().getSellerReviews]}})})()},getNextPageParam:function(e){if((null==e?void 0:e.page)!==(null==e?void 0:e.total_pages))return(0,s._)((0,i._)({},n),{page:(null==e?void 0:e.page)+1})}})},m=function(){return(0,o.n)(function(e){return f.jU.setFavoriteById(e)})},h=function(e,n){var t=n.isMobile,c=(0,a._)(n,["isMobile"]),o=[d.sj,e],_=(0,l.I)((0,i._)({queryKey:o,queryFn:function(){return(0,r._)(function(){return(0,u.YH)(this,function(n){switch(n.label){case 0:return[4,f.jU.getProductDetailV2("".concat(e),{isMobile:t})];case 1:return[2,n.sent()]}})})()}},c));return(0,s._)((0,i._)({},_),{queryKey:o})},x=function(e){return(0,l.I)((0,i._)({queryKey:[d._],queryFn:f.jU.getMyServices},e))}}},e=>{e.O(0,[636,6593,8792],()=>e(e.s=42452)),_N_E=e.O()}]);

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.