PageSourceSearch

https://codelearn.io/_next/static/chunks/pages/user/information/wallet-7f6d2c52a1a59ee0.js

js codelearn.io collected 2026-10-02 14:51:10 UTC 16,308 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3604],{65230:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/user/information/wallet",function(){return n(24875)}])},61752:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var a=n(85893),o=n(63301),l=n(92132),s=n(9008),i=n.n(s),r=n(11163),c=e=>{var t;let{title:n="DEFAULT_TITLE_SEO",description:s="DEFAULT_DESCRIPTION_SEO",ogImage:c="/images/codelearn-thumbnail-seo.png",course:d=null,share:u=null,children:m=(0,a.jsx)(a.Fragment,{})}=e,{t:g}=(0,l.$G)(),p=(0,r.useRouter)(),h=d?{"@context":"https://schema.org","@type":"Course",name:g(n),description:s,image:null==d?void 0:d.thumbnail,offers:{"@type":"Offer",url:"".concat("https://codelearn.io","/learning/").concat(null==d?void 0:d.permalink),price:null==d?void 0:d.priceAfterDiscount,priceCurrency:null==d?void 0:d.priceCurrency,itemCondition:"https://schema.org/NewCondition",availability:"https://schema.org/InStock",seller:{"@type":"Organization",name:"Codelearn"}},aggregateRating:{"@type":"AggregateRating",ratingValue:null==d?void 0:d.averageRate,bestRating:null==d?void 0:d.bestRating,ratingCount:null==d?void 0:d.ratingCount}}:u?{"@context":"https://schema.org","@type":"BlogPosting",headline:g(n),author:{"@type":"Person",name:null==u?void 0:u.ownerName},datePublished:(0,o.U$)(null==u?void 0:u.publishTime),image:"".concat("https://s3-hfx03.fptcloud.com/codelearnstorage"+(null==u?void 0:u.imageUrl)),publisher:{"@type":"Organization",name:"Codelearn",logo:{"@type":"ImageObject",url:"".concat("https://codelearn.io/images/codelearn.png")}},keywords:null==u?void 0:null===(t=u.tags)||void 0===t?void 0:t.join(", "),description:s,interactionStatistic:[{"@type":"InteractionCounter",interactionType:{"@type":"https://schema.org/CommentAction"},userInteractionCount:null==u?void 0:u.userInteractionCount},{"@type":"InteractionCounter",interactionType:{"@type":"https://schema.org/ShareAction"},userInteractionCount:null==u?void 0:u.shareCount},{"@type":"InteractionCounter",interactionType:{"@type":"https://schema.org/WatchAction"},userInteractionCount:null==u?void 0:u.viewCount}],commentCount:null==u?void 0:u.commentCount,aggregateRating:{"@type":"AggregateRating",ratingValue:null==u?void 0:u.averageRate,reviewCount:null==u?void 0:u.ratingCount}}:null;return(0,a.jsxs)(i(),{children:[(0,a.jsx)("title",{children:n?g(n)+" | CodeLearn":"CodeLearn"}),h&&(0,a.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(h)}}),(0,a.jsx)("link",{rel:"canonical",href:"".concat("https://codelearn.io"+p.asPath)}),(0,a.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1, maximum-scale=1,user-scalable=0"}),(0,a.jsx)("meta",{name:"google-signin-client_id",content:"16523143533-ovv9lj8c7i8sv36sv3lguom0msmdk8ah.apps.googleusercontent.com"}),(0,a.jsx)("meta",{name:"description",content:g(s)}),(0,a.jsx)("meta",{name:"twitter:title",content:g(n)}),(0,a.jsx)("meta",{name:"twitter:card",content:"summary"}),(0,a.jsx)("meta",{name:"twitter:description",content:g(s)}),(0,a.jsx)("meta",{name:"twitter:image",content:c}),(0,a.jsx)("meta",{name:"twitter:description",content:g(s)}),(0,a.jsx)("meta",{name:"twitter:site",content:"@Codelearn.io"}),(0,a.jsx)("meta",{name:"twitter:creator",content:"@Codelearn.io"}),(0,a.jsx)("meta",{property:"og:title",content:g(n)}),(0,a.jsx)("meta",{property:"og:description",content:g(s)}),(0,a.jsx)("meta",{property:"og:image",content:c}),(0,a.jsx)("meta",{property:"og:image:width",content:"1200"}),(0,a.jsx)("meta",{property:"og:image:height",content:"630"}),(0,a.jsx)("meta",{property:"og:image:type",content:"image/jpeg"}),(0,a.jsx)("meta",{property:"fb:app_id",content:"540883753774783"}),m]})}},50317:function(e,t,n){"use strict";var a,o,l,s,i,r,c,d;n.d(t,{$f:function(){return o},PB:function(){return m},Pe:function(){return s},Yi:function(){return l}}),(i=a||(a={}))[i.FPT_PAY=1]="FPT_PAY",i[i.COUPON=0]="COUPON",i[i.VIETQR=2]="VIETQR",i[i.INTERNATIONAL_CARD=5]="INTERNATIONAL_CARD",i[i.DOMESTIC_CARD=4]="DOMESTIC_CARD",i[i.MOBILE_BANKING=6]="MOBILE_BANKING",i[i.SHOPEE=7]="SHOPEE",i[i.MOMO=8]="MOMO",i[i.VIETTEL_MONEY=9]="VIETTEL_MONEY",i[i.ZALO_PAY=10]="ZALO_PAY",i[i.CODELEARN=11]="CODELEARN",(r=o||(o={}))[r.FOR_PURCHASE=1]="FOR_PURCHASE",r[r.FOR_ACTIVE=2]="FOR_ACTIVE",r[r.REDUCE_MONEY=3]="REDUCE_MONEY",(c=l||(l={}))[c.Other=0]="Other",c[c.ANDROID=1]="ANDROID",c[c.IOS=2]="IOS";let u=[{label:"FPT Pay",type:1,icon:"/images/payment/fpt_pay_3.png"},{label:"VietQR",type:2,icon:"/images/payment/vietqr_3.png"},{label:"Coupon",type:0,icon:"/images/payment/coupon.png"},{label:"International card",type:5,icon:"/images/payment/international_card_3.png"},{label:"Domestic card",type:4,icon:"/images/payment/card_3.png"},{label:"Mobile Banking",type:6,icon:"/images/payment/mobilebanking_3.png"},{label:"Shopee Pay",type:7,icon:"/images/payment/sp_pay_3.png"},{label:"Momo",type:8,icon:"/images/payment/momo_3.png"},{label:"Zalopay",type:10,icon:"/images/payment/zalo_pay_3.png"},{label:"CodeLearn Pay",type:11,icon:"/images/codelearn.png"}];function m(e){return u.find(t=>t.type===e)}(d=s||(s={}))[d.ByCode=1]="ByCode",d[d.ByXp=2]="ByXp",d[d.ByGold=3]="ByGold",d[d.ByAdmin=4]="ByAdmin",d[d.ByOrder=5]="ByOrder"},19305:function(e,t,n){"use strict";var a=n(85893),o=n(65716),l=n(63301),s=n(69069),i=n(86010),r=n(92132),c=n(2664),d=n(91511);t.Z=e=>{let{activeIndex:t}=e,{t:n}=(0,r.$G)(),u=(0,c.v9)(s.tM),m=(0,l.rV)(null==u?void 0:u.userName);return(0,a.jsx)("div",{className:"bg-white rounded-md shadow-md p-7 flex flex-col gap-4 max-h-[85vh] sm:sticky sm:top-20",children:[{href:"/user/information/",label:n("Information & Contact")},{href:"/user/information/wallet",label:n("Personal wallet")},{href:"/user/information/changeusername",label:(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[n("Change username")," ",m&&(0,a.jsx)(d.Z,{width:20,"data-tooltip-id":"global-tooltip","data-tooltip-content":n("Your account has been limited in some features due to the lack of an updated account name. Update it now!"),"data-tooltip-place":"top",className:"text-orange-500"})]})},{href:"/user/information/changepassword",label:n("Change password")},{href:"/team",label:n("Team Management")}].map((e,n)=>(0,a.jsx)(o.Z,{className:(0,i.Z)("text-sm hover:font-semibold hover:text-[#2c31cf] hover:opacity-100",{"text-[#2c31cf] font-semibold":n===t}),href:e.href,children:e.label},e.href))})}},24875:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSG:function(){return D},default:function(){return O}});var a=n(85893),o=n(88355),l=n(61752),s=n(37238),i=n(22870),r=n(67841),c=n(80061),d=n(3968),u=n(18397),m=n(65716),g=n(50317),p=n(63301),h=n(81088),v=n(57289),x=n(69069),y=n(10777),f=n(98029),b=n(92132),w=n(67294),j=n(2664),C=n(22581),N=["size","color"];function E(e){var t=e.size,n=void 0===t?24:t,a=e.color,o=(0,C.Kd)(e,N);return w.createElement("svg",(0,C.gY)({xmlns:"http://www.w3.org/2000/svg",className:"icon icon-tabler icon-tabler-wallet",width:n,height:n,viewBox:"0 0 24 24",stroke:void 0===a?"currentColor":a,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},o),w.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),w.createElement("path",{d:"M17 8v-3a1 1 0 0 0 -1 -1h-10a2 2 0 0 0 0 4h12a1 1 0 0 1 1 1v3m0 4v3a1 1 0 0 1 -1 1h-12a2 2 0 0 1 -2 -2v-12"}),w.createElement("path",{d:"M20 12v4h-4a2 2 0 0 1 0 -4h4"}))}var A=n(19305),I=n(31927),_=()=>{var e,t,n;let{t:o}=(0,b.$G)(),l=(0,j.v9)(x.tM),[C,N]=(0,w.useState)({gold:void 0,xp:void 0,code:void 0}),[_,D]=(0,w.useState)({pageIndex:1,pageSize:10}),{data:O,refetch:P}=(0,y.a)({queryKey:["getUserWalletInfo"],queryFn:async()=>{var e;let t=await h.te.getUserWalletInfo({userId:null==l?void 0:l.userId});return null==t?void 0:null===(e=t.data)||void 0===e?void 0:e.data},enabled:!!(null==l?void 0:l.userId)}),{data:L,isLoading:T,refetch:S}=(0,y.a)({queryKey:["getListTrans",_],queryFn:async()=>{let e=await h.te.getUserWalletHistory({..._,userId:null==l?void 0:l.userId});return null==e?void 0:e.data},enabled:!!(null==l?void 0:l.userId)}),R=(0,f.D)({mutationFn:()=>
1v.X.exchangeMoney({userId:null==l?void 0:l.userId,goldAmount:C.gold}),onSuccess:e=>{var t;(null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.success)&&(N({gold:0,xp:0,code:""}),P(),S(),u.gU.success("".concat(o("Exchange")," gold ").concat(o("Success").toLowerCase())))}}),B=(0,f.D)({mutationFn:()=>v.X.exchangeMoney({userId:null==l?void 0:l.userId,xpAmount:C.xp}),onSuccess:e=>{var t;(null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.success)&&(P(),S(),N({gold:0,xp:0,code:""}),u.gU.success("".concat(o("Exchange")," LP ").concat(o("Success").toLowerCase())))}}),M=(0,f.D)({mutationFn:()=>h.te.exchangeMoneyFromCode({code:C.code}),onSuccess:e=>{var t;(null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.success)&&(P(),S(),N({gold:0,xp:0,code:""}),u.gU.success("".concat(o("Exchange")," ").concat(o("Id").toLowerCase()," ").concat(o("Success").toLowerCase())))}}),k=e=>{var t;return(null==e?void 0:null===(t=e.toString())||void 0===t?void 0:t.startsWith("-"))?(0,a.jsx)("strong",{className:"text-red-600",children:p.DL.formatPrice(e)}):(0,a.jsxs)("strong",{className:"text-green-600",children:["+",p.DL.formatPrice(e)]})},F=[{title:o("#"),headClassName:"w-60 text-center",className:"w-60 text-center",isIndex:!0},{title:o("Method"),headClassName:"text-left",className:"text-left",render:e=>{switch(null==e?void 0:e.changeWalletType){case g.Pe.ByCode:return o("Top up with code");case g.Pe.ByXp:return o("Change XP");case g.Pe.ByGold:return o("Change gold");case g.Pe.ByAdmin:return o("Deposit by admin");default:return o("By order")}}},{title:o("Conversion data"),headClassName:"text-right",className:"text-right",render:e=>{var t,n,l,s,i,r;switch(null==e?void 0:e.changeWalletType){case g.Pe.ByCode:return(0,a.jsx)("strong",{children:null==e?void 0:null===(t=e.metaData)||void 0===t?void 0:t.code});case g.Pe.ByXp:return(0,a.jsx)("strong",{children:p.DL.formatNumber(null==e?void 0:null===(n=e.metaData)||void 0===n?void 0:n.xpAmount)+" LP"});case g.Pe.ByGold:return(0,a.jsx)("strong",{children:p.DL.formatNumber(null==e?void 0:null===(l=e.metaData)||void 0===l?void 0:l.goldAmount)+" gold"});case g.Pe.ByOrder:return(0,a.jsx)(m.Z,{href:"/payment/orders/".concat(null==e?void 0:null===(s=e.metaData)||void 0===s?void 0:s.orderId),target:"_blank",className:"text-blue-primary hover:underline font-bold",children:o("Detail")});default:return(0,a.jsx)(I.Q,{"data-tooltip-id":"global-tooltip","data-tooltip-content":null==e?void 0:null===(i=e.metaData)||void 0===i?void 0:i.note,children:null==e?void 0:null===(r=e.metaData)||void 0===r?void 0:r.note})}}},{title:o("Amount varies"),headClassName:"text-right",className:"text-right",render:e=>k(null==e?void 0:e.changeAmount)},{title:o("Created at"),headClassName:"text-center",className:"text-center",render:e=>p.DL.formatDateGMT({dateString:null==e?void 0:e.ts})}];return(0,a.jsxs)(d.W2,{size:"xl",children:[(0,a.jsx)(s.Oo,{data:[{href:"/",title:o("Home")},{title:o("Personal wallet")}]}),(0,a.jsxs)("div",{className:"grid sm:grid-cols-[277px_auto] gap-5 pb-10 ",children:[(0,a.jsx)(A.Z,{activeIndex:1}),(0,a.jsxs)("div",{className:"p-4 bg-white rounded-lg space-y-4",children:[(0,a.jsxs)("div",{className:"flex justify-between gap-4 items-center",children:[(0,a.jsx)("div",{className:"font-bold text-lg uppercase",children:o("Wallet information")}),(0,a.jsxs)("span",{className:"flex gap-1 items-center text-2xl","data-tooltip-id":"global-tooltip","data-tooltip-content":o("Balance"),children:[(0,a.jsx)(E,{color:"red"}),(0,a.jsx)("span",{className:"font-bold text-[red]",children:p.DL.formatPrice(null==O?void 0:O.walletAmount)})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,a.jsxs)("div",{className:"rounded-lg shadow-lg w-full p-4 space-y-4",children:[(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsxs)("span",{className:"flex gap-1 items-center",children:[(0,a.jsx)("strong",{className:"text-yellow-400 text-2xl",children:p.DL.formatNumber(null==O?void 0:O.totalGold)}),(0,a.jsx)(i.E,{src:"/images/event/gift-history-coin.png",alt:"",width:32})]}),(0,a.jsxs)("span",{className:"flex flex-col items-end gap-1",children:[(0,a.jsx)("span",{children:o("Conversion rate")}),(0,a.jsx)("strong",{children:"".concat((null==O?void 0:null===(e=O.walletConfig)||void 0===e?void 0:e.goldRate)||10," gold -> 1.000 đ")})]})]}),(0,a.jsxs)("div",{className:"flex justify-between items-end gap-2",children:[(0,a.jsx)(s.Y2,{label:o("Enter converted {{name}}",{name:"gold"}),placeholder:"".concat(o("Min")," ").concat((null==O?void 0:null===(t=O.walletConfig)||void 0===t?void 0:t.minGold)||10," gold"),className:"w-full",moneyFormat:!0,onKeyDown:e=>{!["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Enter"].includes(e.ke
1y)&&(/[0-9]/.test(e.key)||e.preventDefault())},value:C.gold,onChange:e=>N({...C,gold:e}),min:0,classNames:{label:"font-semibold",input:"!h-9"}}),(0,a.jsx)(r.z,{disabled:!C.gold,loading:R.isPending,onClick:()=>R.mutateAsync(),children:o("Exchange")})]})]}),(0,a.jsxs)("div",{className:"rounded-lg shadow-lg w-full p-4 space-y-2",children:[(0,a.jsx)(i.E,{src:"/images/payment/buy-code.png",alt:"buy-code",classNames:{imageWrapper:"w-full flex justify-center",image:"!w-16"}}),(0,a.jsxs)("div",{className:"flex justify-between items-end gap-2",children:[(0,a.jsx)(c.o,{label:o("Enter converted {{name}}",{name:o("Id").toLowerCase()}),placeholder:o("Enter converted {{name}}",{name:o("Id").toLowerCase()}),className:"w-full",onChange:e=>N({...C,code:e.target.value}),value:C.code,classNames:{label:"font-semibold"}}),(0,a.jsx)(r.z,{disabled:!C.code,loading:M.isPending,onClick:()=>M.mutateAsync(),children:o("Exchange")})]})]}),(0,a.jsxs)("div",{"data-tooltip-id":"global-tooltip","data-tooltip-content":o("T\xednh năng sắp ra mắt!"),className:"rounded-lg shadow-lg w-full p-4 space-y-4 cursor-not-allowed",children:[(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsxs)("span",{className:"flex gap-1 items-center",children:[(0,a.jsx)("strong",{className:"text-green-400 text-2xl",children:p.DL.formatNumber(null==O?void 0:O.totalXp)}),(0,a.jsx)(i.E,{src:"/images/lp.png",alt:"",width:24})]}),(0,a.jsxs)("span",{className:"flex flex-col items-end gap-1",children:[(0,a.jsx)("span",{children:o("Conversion rate")})," ",(0,a.jsx)("strong",{children:"--/--"})]})]}),(0,a.jsxs)("div",{className:"flex justify-between items-end gap-2",children:[(0,a.jsx)(s.Y2,{label:o("Enter converted {{name}}",{name:"LP"}),placeholder:"".concat(o("Min")," ").concat((null==O?void 0:null===(n=O.walletConfig)||void 0===n?void 0:n.minXp)||100," LP"),className:"w-full",onKeyDown:e=>{!["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Enter"].includes(e.key)&&(/[0-9]/.test(e.key)||e.preventDefault())},moneyFormat:!0,disabled:!0,value:C.xp,onChange:e=>N({...C,xp:e}),min:0,classNames:{label:"font-semibold",input:"!h-9"}}),(0,a.jsx)(r.z,{disabled:!C.xp,loading:B.isPending,onClick:()=>B.mutateAsync(),children:o("Exchange")})]})]})]}),(0,a.jsx)("div",{className:"w-full overflow-auto pt-4",children:(0,a.jsx)(s.iA,{className:"table-auto w-full",wrapClassName:"mb-6",data:(null==L?void 0:L.data)||[],metaData:null==L?void 0:L.metaData,rowClassName:"bg-white transition",columns:F,colorHeader:"!bg-blue-600 !text-white !border-b-0",isLoading:T,size:"sm",noData:o("No result found"),onChangePage:e=>D({..._,pageIndex:e})})})]})]})]})},D=!0,O=()=>{let{t:e}=(0,b.$G)();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.Z,{title:e("Personal wallet")}),(0,a.jsx)(o.Z,{bgGray:!0,children:(0,a.jsx)(_,{})})]})}},57289:function(e,t,n){"use strict";n.d(t,{X:function(){return l}});var a=n(64511),o=n(8021);class l{}l.loadExpHistory=async e=>a.be.get(o.As+"/user/load-exp-history",{params:e}),l.userLoadCpHistory=async e=>a.be.get(o.As+"/user/load-cp-history",{params:e}),l.userGetGainingSources=async e=>a.be.get(o.As+"/user/get-gaining-sources",{params:e}),l.userLevelSettingGetSettings=e=>a.be.get(o.As+"/userlevelsetting/get-settings",{params:e}),l.userLevelSettingUpdateSettings=e=>a.be.post(o.As+"/userlevelsetting/update-settings",e),l.exchangeMoney=e=>a.be.post(o.As+"/user/exchange-money",e)}},function(e){e.O(0,[777,2888,9774,179],function(){return e(e.s=65230)}),_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.