1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"btse@2f4cc265"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="592bd579-95f8-41d2-a04e-5fcd94abe173",e._sentryDebugIdIdentifier="sentry-dbid-592bd579-95f8-41d2-a04e-5fcd94abe173")}catch(a){}}();import{bJ as e,aX as t,bi as a,aL as l,ar as s,ak as i,a9 as n,a8 as r,ac as o,aW as u,bE as c,ab as d,ad as p,aa as y,af as h,ae as v,aK as m,am as g,aN as f,aT as T,b6 as w,aZ as D,al as A,aq as b,ah as _,a5 as S,aM as C,ag as L,ai as E,aY as I,aV as k,a6 as R,B as N,aU as x,as as P,r as O,an as $,u as W,bt as F,t as B,a7 as U,aS as M,ap as V,aI as H,a$ as G,aE as Y,aF as q,aj as z,i as K,aO as j,h as X,A as Q,bK as Z,aC as J,cd as ee,a0 as te,cn as ae,bI as le,bk as se,bH as ie,ao as ne,bL as re,bS as oe,l as ue,co as ce,a3 as de,a2 as pe,be as ye,a_ as he,g as ve,b7 as me,b1 as ge,bN as fe,bd as Te}from"./B-0vxubZ.js";import{f as we,b as De,m as Ae,n as be,o as _e,M as Se,p as Ce,q as Le,N as Ee,T as Ie,r as ke,s as Re,W as Ne,g as xe,t as Pe,P as Oe,v as $e,H as We,w as Fe,C as Be}from"./B4GGByMv.js";import{j$ as Ue,k0 as Me,bP as Ve,x as He,p as Ge,mR as Ye,mS as qe,fJ as ze,R as Ke,mT as je,t as Xe,da as Qe,mU as Ze,mV as Je,f4 as et,mW as tt,dd as at,fM as lt,mX as st,mY as it,mZ as nt,e9 as rt,e8 as ot,m_ as ut,e7 as ct,m$ as dt,e6 as pt,cv as yt,az as ht,s as vt,V as mt,o as gt,bL as ft,j as Tt,l as wt,n0 as Dt,ej as At,fH as bt,fm as _t,cq as St,n1 as Ct,n2 as Lt,el as Et,W as It,fA as kt,fB as Rt,fI as Nt,bp as xt,h as Pt,eE as Ot,eG as $t,iX as Wt,fC as Ft,D as Bt,u as Ut,C as Mt,n3 as Vt,fK as Ht,ho as Gt,fi as Yt,n4 as qt,n5 as zt,n6 as Kt,n7 as jt,af as Xt,n8 as Qt,N as Zt,n9 as Jt,na as ea,nb as ta,nc as aa,fL as la,eH as sa,nd as ia,ne as na,nf as ra,kN as oa,ay as ua,aq as ca,aw as da,av as pa,H as ya,hM as ha,km as va,dY as ma,aH as ga,dx as fa,li as Ta,kF as wa,ng as Da,lm as Aa,nh as ba,ni as _a,nj as Sa,ln as Ca,nk as La,nl as Ea,gE as Ia,aI as ka,cy as Ra,cl as Na,mt as xa,U as Pa,ar as Oa,dL as $a,fz as Wa,al as Fa,a9 as Ba,ba as Ua,gy as Ma,fF as Va,fG as Ha,ep as Ga,cL as Ya,cV as qa,nm as za,e as Ka,A as ja,r as Xa,a as Qa,aA as Za,i as Ja,F as el,G as tl,g as al,aU as ll,bE as sl,bi as il,bD as nl,nn as rl,bO as ol,bN as ul,S as cl,no as dl,eS as pl,eT as yl,fl as hl,fk as vl,np as ml,Q as gl,gG as fl,d0 as Tl,a$ as wl,nq as Dl,nr as Al,ns as bl,nt as _l,f$ as Sl,bR as Cl,bb as Ll,q as El,mJ as Il,c as kl,X as Rl,ab as Nl,ac as xl,ad as Pl,nu as Ol,aW as $l,aX as Wl,nv as Fl,nw as Bl,jf as Ul,ai as Ml,Z as Vl,Y as Hl,dR as Gl,T as Yl,kv as ql,bd as zl,k7 as Kl,nx as jl,w as Xl,iZ as Ql,iY as Zl,ir as Jl,cJ as es,cA as ts,ny as as,cO as ls,nz as ss,nA as is,nB as ns,$ as rs,cm as os,nC as us,nD as cs,nE as ds,gv as ps,nF as ys,nG as hs,nH as vs,dK as ms,as as gs,nI as fs,b8 as Ts,nJ as ws,dH as Ds,P as As,bg as bs,jl as _s,jk as Ss,cF as Cs,nK as Ls,ch as Es,lp as Is,ly as ks,ca as Rs,gO as Ns,J as xs,ap as Ps,nL as Os,nM as $s,nN as Ws,nO as Fs,nP as Bs,aC as Us,K as Ms,dI as Vs,nQ as Hs,iO as Gs,M as Ys,B as qs,nR as zs,eC as Ks,nS as js,nT as Xs,nU as Qs,nV as Zs,nW as Js,nX as ei,nY as ti,eF as ai,cu as li,nZ as si,n_ as ii,n$ as ni,iN as ri,o0 as oi,o1 as ui,o2 as ci,o3 as di,o4 as pi,o5 as yi,cn as hi,o6 as vi,o7 as mi,i_ as gi,o8 as fi,o9 as Ti,lg as wi,cf as Di,c8 as Ai,cb as bi,ct as _i,c5 as Si,b$ as Ci,oa as Li,fE as Ei,mw as Ii,dQ as ki,f6 as Ri,ob as Ni,f8 as xi,oc as Pi,od as Oi,cK as $i,oe as Wi,of as Fi,dJ as Bi,jq as Ui,n as Mi,k as Vi,a0 as Hi,og as Gi,oh as Yi,oi as qi,aO as zi,dn as Ki,iL as ji,oj as Xi,E as Qi,a2 as Zi,ok as Ji,ol as en,om as tn,cI as an,on as ln,oo as sn,op as nn,at as rn,oq as on,au as un,iT as cn,or as dn,os as pn,ot as yn,ou as hn,ov as vn,ow as mn,ox as gn,oy as fn,oz as Tn,oA as wn,oB as Dn,oC as An,ax as bn,oD as _n,dz as Sn,oE as Cn,L as Ln,ed as En,aN as In,oF as kn,oG as Rn,aj as Nn,oH as xn,d1 as Pn,bj as On,oI as $n,a7 as Wn,oJ as Fn,oK as Bn,oL as Un,oM as Mn,oN as Vn,oO as Hn,f as Gn,a1 as Yn,bz as qn,bx as zn,by as Kn,oP as jn,oQ as Xn,mi as Qn,iI as Zn,aD as Jn,fT as er,iC as tr,oR as ar,e0 as lr,oS as sr,oT as ir,aL as nr,I as rr,oU as or,oV as ur,oW as cr,oX as dr,oY as pr,o
1Z as yr,dB as hr}from"./fTPyrBIP.js";import{_ as vr}from"./SJUTAzMa.js";import{aV as mr,aW as gr,aX as fr,aY as Tr,aZ as wr,a_ as Dr,F as Ar,a$ as br,b0 as _r,b1 as Sr,b2 as Cr,b3 as Lr,r as Er,b4 as Ir,b5 as kr,b6 as Rr,b7 as Nr,b8 as xr,b9 as Pr,ba as Or,aT as $r,C as Wr,bb as Fr,bc as Br}from"../../app.DI3xhnWo.js";import{I as Ur,u as Mr}from"./DjxVUbdV.js";import{u as Vr}from"./HYjqCwQk.js";import{m as Hr,n as Gr,o as Yr,p as qr,q as zr}from"./BOOzV_OZ.js";import{W as Kr}from"./DfrJsDA_.js";import{D as jr}from"./DiwcCmib.js";import{D as Xr,C as Qr,h as Zr,F as Jr,W as eo,a as to,T as ao,b as lo,A as so,H as io,d as no}from"./DP00sckV.js";import{d as ro,A as oo,g as uo,h as co}from"./BphGmIDb.js";import{u as po,A as yo,g as ho,_ as vo,h as mo}from"./GaR0Evd4.js";import go from"./SmGL2nNO.js";import{u as fo}from"./GMPRS0yC.js";import{l as To}from"./chunk-lottie.tqfMQl6Y.js";const{enableWalletOverview:wo,enableTransactionHistory:Do,enableWalletFutures:Ao,enableWalletSpot:bo,enableWalletEarn:_o,enableAccountStatement:So,defaultUserSelectBaseCurrency:Co}=Ge,Lo=[Ke.WALLET_LEAD_TRADING,Ke.WALLET_LEAD_TRADING_HISTORY,Ke.WALLET_LEAD_TRADING_PNL_ANALYSIS],Eo=[Ke.WALLET_COPY_TRADING,Ke.WALLET_COPY_TRADING_HISTORY,Ke.WALLET_COPY_TRADING_PNL_ANALYSIS],Io=[Ke.WALLET_AI_LEAD_TRADING,Ke.WALLET_AI_LEAD_TRADING_HISTORY,Ke.WALLET_AI_LEAD_TRADING_PNL_ANALYSIS],ko=[Ke.WALLET_AI_COPY_TRADING,Ke.WALLET_AI_COPY_TRADING_HISTORY,Ke.WALLET_AI_COPY_TRADING_PNL_ANALYSIS];const Ro=vr({name:"WalletNav",components:{Navbar:Me,RouteTabSwitcher:Ue},props:{switcherStickyEffect:{type:Boolean,default:!0}},computed:{...l(["lang","hideWalletPriceValue","defaultBaseCurrencyShortName","walletValueType"]),...a(ze,["displayCurrency"]),...a(pt,["isEnableAutoTraderWallet"]),...a(dt,["isEnableLeadTradingWallet"]),...a(ct,["isEnableCopyTradingWallet"]),...a(ut,["isEnableAiLeadTradingWallet"]),...a(ot,["isEnableAiCopyTradingWallet"]),...a(rt,["isEnableFuturesBotsWallet"]),...a(nt,{earnTotalBalance:"totalBalanceInAccountCurrency"}),...t({getAccountValue:"getAccountValue",getFuturesBalance:"futuresBalance",accountCurrency:"accountCurrency"}),spotAvailable(){return this.getAccountValue(this.walletValueType,!0)},futuresAvailable(){return this.getFuturesBalance(this.walletValueType)},copyTradingRouteList(){const e={name:this.$t("nav.leadTrading"),route:{name:Ke.WALLET_LEAD_TRADING,params:{lang:this.lang}},active:Lo.includes(this.$route.name)};let t=Eo;this.isMdSize||(t=Lo.concat(Eo));const a=[];return this.isEnableLeadTradingWallet&&this.isMdSize&&a.push({...e,id:Ke.WALLET_LEAD_TRADING,elementId:Xe("nav_lead_trading")}),a.push({id:Ke.WALLET_COPY_TRADING,elementId:Xe("nav_copy_trading"),name:this.$t("trading.copyTrading"),icon:it,route:{name:Ke.WALLET_COPY_TRADING,params:{lang:this.lang}},subRoutes:this.isEnableLeadTradingWallet?[e,{name:this.$t("trading.copyTrading"),route:{name:Ke.WALLET_COPY_TRADING,params:{lang:this.lang}},active:Eo.includes(this.$route.name)}].filter((e=>e)):[],active:t.includes(this.$route.name)}),a},aiCopyTradingRouteList(){const e={name:this.$t("nav.aiLeadTrading"),route:{name:Ke.WALLET_AI_LEAD_TRADING,params:{lang:this.lang}},active:Io.includes(this.$route.name)};let t=ko;this.isMdSize||(t=Io.concat(ko));const a=[];return this.isEnableAiLeadTradingWallet&&this.isMdSize&&a.push({...e,id:Ke.WALLET_AI_LEAD_TRADING,elementId:Xe("nav_ai_lead_trading")}),a.push({id:Ke.WALLET_AI_COPY_TRADING,elementId:Xe("nav_ai_copy_trading"),name:this.$t("nav.aiCopyTrading"),icon:st,route:{name:Ke.WALLET_AI_COPY_TRADING,params:{lang:this.lang}},subRoutes:this.isEnableAiLeadTradingWallet?[e,{name:this.$t("nav.aiCopyTrading"),route:{name:Ke.WALLET_AI_COPY_TRADING,params:{lang:this.lang}},active:ko.includes(this.$route.name)}].filter((e=>e)):[],active:t.includes(this.$route.name)}),a},list(){return[{id:Ke.WALLET_OVERVIEW,elementId:Xe("nav_overview"),name:this.$t("router.walletOverview"),icon:je,notes:"",route:{name:Ke.WALLET_OVERVIEW,params:{lang:this.lang}},active:this.$route.name===Ke.WALLET_OVERVIEW},{id:Ke.WALLET_SPOT,elementId:Xe("nav_spot"),name:this.$t("router.walletSpot"),icon:Qe,notes:wo?"":this.formatPrice(this.spotAvailable,Ye.SPOT),route:{name:"walletSpot",params:{lang:this.lang}},active:["walletSpot",Ke.WALLET_SPOT_HISTORY,Ke.WALLET_SPOT_PNL_ANALYSIS,Ke.VESTING].includes(this.$route.name)},{id:Ke.WALLET_FUTURES,elementId:Xe("nav_futures"),name:this.$t("wallets.futures"),icon:Ze,notes:wo?"":this.formatPrice(this.futuresAvailable,Ye.FUTURES),route:{name:"walletFutures",params:{lang:this.lang}},active:["walletFutures",Ke.FUTURES_WALLET_DETAIL,Ke.WALLET_FUTURES_PNL_ANALYSIS].includes(this.$route.name)},{id:Ke.WALLET_AUTO_TRADER,elementId:Xe("nav_auto_trader"),name:this.$t("nav.autoTrader"),icon:Je,route:{name:Ke.WALLET_AUTO_TRADER,params:{lang:this.lang}},active:[Ke.WALLET_AUTO_TRADER,Ke.WALLET_AUTO_TRADER_HISTORY,Ke.WALLET_AUTO_TRADER_PNL_ANALYSIS].includes(this.$route.name)},...this.copyTradingRouteList,...this.aiCopyTradingRouteList,{id:Ke.WALLET_FUTURES_BOTS,elementId:Xe("nav_futures_bots"),name:this.$t("nav.futuresBots"),icon:et,route:{name:Ke.WALLET_FUTURES_BOTS,params:{lang:this.lang}},active:[Ke.WALLET_FUTURES_BOTS,Ke.WALLET_FUTURES_BOTS_HISTORY,Ke.WALLET_FUTURES_BOTS_PNL_ANALYSIS].includes(this.$route.name)},{id:Ke.WALLET_EARN,elementId:Xe("nav_earn"),name:this.$t("wallets.earn"),icon:tt,notes:wo?"":this.formatPrice(this.earnTotalBalance,Ye.EARN),route:{name:"walletEarn",params:{lang:this.lang}},active:["walletEarn","historyEarn",Ke.WALLET_EARN_REWARD_ANALYSIS].includes(this.$route.name)},{id:Ke.WALLET_TRANSACTION_HISTORY,elementId:Xe("nav_transaction_history"),name:this.$t("wallets.transaction.history"),icon:at,route:{name:Ke.WALLET_TRANSACTION_HISTORY,params:{lang:this.lang,category:"deposit-and-withdraw"}},active:this.$route.name===Ke.WALLET_TRANSACTION_HISTORY},{id:Ke.ACCOUNT_STATEMENT,elementId:Xe("nav_account_statement"),name:this.$t("nav.accountStatement"),icon:lt,route:{name:Ke.ACCOUNT_STATEMENT,params:{lang:this.lang}},active:this.$route.name===Ke.ACCOUNT_STATEMENT}].filter((e=>{switch(e.id){case Ke.WALLET_OVERVIEW:return wo;case Ke.WALLET_SPOT:return bo;case Ke.WALLET_FUTURES:return Ao;case Ke.WALLET_AUTO_TRADER:return this.isEnableAutoTraderWallet;case Ke.WALLET_COPY_TRADING:return this.isEnableCopyTradingWallet;case Ke.WALLET_AI_COPY_TRADING:return this.isEnableAiCopyTradingWallet;case Ke.WALLET_FUTURES_BOTS:return this.isEnableFuturesBotsWallet;case Ke.WALLET_EARN:return _o;case Ke.WALLET_TRANSACTION_HISTORY:return Do;case Ke.ACCOUNT_STATEMENT:return So;default:return!0}}))},currency(){return this.defaultBaseCurrencyShortName}},created(){this.getWalletQuoteRate()},methods:{...e(ze,["setDisplayCurrency","updateInversePriceMap"]),formatPrice(e,t){let a="";switch(t){case Ye.FUTURES:a=yt;break;case Ye.SPOT:a=this.displayCurrency;break;case Ye.EARN:a=this.accountCurrency;break;default:a=this.defaultBaseCurrencyShortName}if(this.hideWalletPriceValue)return`${qe} ${a}`;const l=1e6;let s="";return e>=l&&(e/=l,s="M"),`${e=this.$filters.formatNumber(e,{formatKey:"max2",defaultValue:"--"})}${s} ${a}`},async getWalletQuoteRate(){this.updateInversePriceMap("USD");const e=localStorage.getItem(Ve.USER_SELECT_BASE_CURRENCY)||"";if("USD"===e)return;if(e)return void this.updateInversePriceMap(e);const t=await He.informationFromIp(),{currency:a,currencySupported:l}=t.data;if(l&&a){const e=Co||a;this.setDisplayCurrency(e)}else this.updateInversePriceMap(this.displayCurrency)}}},[["render",function(e,t,a,l,r,o){const u=s("RouteTabSwitcher"),c=s("Navbar");return e.isNotDesktop?(n(),i(u,{key:0,class:"tab-switcher",routeList:o.list,stickyEffect:a.switcherStickyEffect},null,8,["routeList","stickyEffect"])):(n(),i(c,{key:1,class:"navbar",btnList:o.list},null,8,["btnList"]))}],["__scopeId","data-v-3f136560"]]),No={class:"common-card"};const xo=vr({},[["render",function(e,t){return n(),r("div",No,[o(e.$slots,"default",{},void 0,!0)])}],["__scopeId","data-v-20818156"]]),Po="/static/img/D8_E8J-S.png",{enableUpgradeUnifiedWalletForceUpdatePhase1:Oo}=Ge,$o={name:"UnifiedWalletUpgradeBanner",components:{IconChevronRight:ht},data:()=>({ImageUnifiedWallet:we,ImageWalletUpgradeInProgress:mr,ImageWalletUpgradeCompleted:Po}),computed:{...l(["lang","accountInfo"]),walletUpgradeStatus(){var e;return(null==(e=this.accountInfo)?void 0:e.walletUpgradeStatus)||"SUPPORTED"},isUpgrading(){return this.walletUpgradeStatus===ft.IN_PROGRESS},isCompleted(){return this.walletUpgradeStatus===ft.UPGRADED},bannerImage(){return this.isUpgrading?mr:this.isCompleted?Po:we},bannerContent(){return this.isUpgrading?{title:this.$t("wallet.upgradeUnifiedWalletBanner.upgrading.title"),description:this.$t("wallet.upgradeUnifiedWalletBanner.upgrading.description")}:this.isCompleted?{title:this.$t("wallet.upgradeUnifiedWalletBanner.completed.title"),description:this.$t("wallet.upgradeUnifiedWalletBanner.completed.description")}:{title:this.$t("wallet.upgradeUnifiedWalletBanner.title"),description:Oo?this.$t("wallet.upgradeUnifiedWalletDialog.automatically.description"):this.$t("wallet.upgradeUnifiedWalletBanner.description")}},unifiedWalletUserGuideLink(){return gt(this.lang,"UNIFIED_WALLET_USER_GUIDE")}},methods:{...c(["setShowUnifiedWalletUpgradeDialog"]),...u(["updateIsUnifiedWalletUpgradeBannerViewed"]),openUpgradeUnifiedWalletPopup(){this.setShowUnifiedWalletUpgradeDialog(!0)},openUnifiedWalletUserGuide(){window.open(this.unifiedWalletUserGuideLink,"_blank","noopener")},markBannerViewed(){vt(mt.WALLET_UPGRADE_BANNER),this.updateIsUnifiedWalletUpgradeBannerViewed()}}},Wo={class:"unified-wallet-upgrade-banner"},Fo={class:"row-wrap"},Bo=["src"],Uo={class:"banner-title"},Mo={class:"banner-description"},Vo=["href"],Ho=["src"],Go={class:"banner-content-block"},Yo={class:"banner-title"},qo={class:"banner-description"},zo=["href"];const Ko=vr($o,[["render",function(e,t,a,l,o,u){const c=s("IconChevronRight"),f=s("BaseButton");return n(),r("div",Wo,[e.isMobile?(n(),r(p,{key:0},[y("div",Fo,[y("img",{class:"unified-wallet-image",src:u.bannerImage}
1,null,8,Bo),y("div",Uo,h(u.bannerContent.title),1)]),y("div",Mo,h(u.bannerContent.description),1),!u.unifiedWalletUserGuideLink||u.isUpgrading||u.isCompleted?d("",!0):(n(),r("a",{key:0,target:"_blank",href:u.unifiedWalletUserGuideLink,class:"more-information-link"},[v(h(e.$t("t.moreInformation"))+" ",1),m(c,{class:"chevron-right-icon",width:"16",height:"16"})],8,Vo))],64)):(n(),r(p,{key:1},[y("img",{class:"unified-wallet-image",src:u.bannerImage},null,8,Ho),y("div",Go,[y("div",Yo,h(u.bannerContent.title),1),y("div",qo,h(u.bannerContent.description),1),!u.unifiedWalletUserGuideLink||u.isUpgrading||u.isCompleted?d("",!0):(n(),r("a",{key:0,target:"_blank",href:u.unifiedWalletUserGuideLink,class:"more-information-link"},[v(h(e.$t("t.moreInformation"))+" ",1),m(c,{class:"chevron-right-icon",width:"16",height:"16"})],8,zo))])],64)),u.isUpgrading||u.isCompleted?(n(),i(f,{key:2,class:"outline-primary action-button",size:"large",onClick:u.openUnifiedWalletUserGuide},{default:g((()=>[v(h(e.$t("wallet.upgradeUnifiedWalletBanner.viewUserGuide")),1)])),_:1},8,["onClick"])):(n(),i(f,{key:3,class:"primary action-button",size:"large",onClick:u.openUpgradeUnifiedWalletPopup},{default:g((()=>[v(h(e.$t("t.upgradeNow")),1)])),_:1},8,["onClick"])),u.isCompleted?(n(),r("div",{key:4,class:"close-text-button",onClick:t[0]||(t[0]=(...e)=>u.markBannerViewed&&u.markBannerViewed(...e))},h(e.$t("t.close")),1)):d("",!0)])}],["__scopeId","data-v-be16194d"]]);const jo=vr({name:"IconStake",components:{Icon:Tt}},[["render",function(e,t,a,l,r,o){const u=s("Icon");return n(),i(u,{"aria-label":"account",width:"26",height:"26"},{default:g((()=>t[0]||(t[0]=[y("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.6128 1.14648C17.9289 1.14648 21.4452 4.39969 21.5929 8.46578L21.5977 8.73209L21.5972 9.95548L22.8856 9.95558C23.2735 9.95558 23.5947 10.2272 23.6499 10.5812L23.6583 10.6897V23.8702C23.6583 24.2388 23.3724 24.5439 22.9998 24.5963L22.8856 24.6043H4.34011C3.95214 24.6043 3.63095 24.3327 3.57576 23.9787L3.56738 23.8702V10.6897C3.56738 10.3211 3.8533 10.016 4.22592 9.96354L4.34011 9.95558L5.62783 9.95548L5.62799 8.73209C5.62799 4.63181 9.05242 1.29136 13.3325 1.15107L13.6128 1.14648ZM22.1131 11.4235H5.11288V23.1353H22.1131V11.4235ZM13.6121 2.61454C10.1425 2.61454 7.31377 5.22143 7.17784 8.48592L7.17273 8.73196L7.17237 9.95442H20.0505L20.0515 8.73196C20.0515 5.52032 17.4463 2.88673 14.134 2.63434L13.8711 2.61939L13.6121 2.61454Z"},null,-1),y("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.4778 12.8223C13.1105 12.8223 12.8128 13.12 12.8127 13.4872L12.81 14.0793H12.5539C12.0356 14.0793 11.5385 14.2852 11.172 14.6517C10.8055 15.0182 10.5996 15.5153 10.5996 16.0336C10.5996 16.5519 10.8055 17.049 11.172 17.4155C11.5385 17.782 12.0356 17.9879 12.5539 17.9879H14.3956C14.5612 17.9879 14.7199 18.0536 14.837 18.1707C14.954 18.2877 15.0198 18.4465 15.0198 18.612C15.0198 18.7775 14.954 18.9363 14.837 19.0533C14.7199 19.1703 14.5612 19.2361 14.3956 19.2361H11.2647C10.8974 19.2361 10.5996 19.5339 10.5996 19.9012C10.5996 20.2685 10.8974 20.5663 11.2647 20.5663H12.8097V21.1731C12.8097 21.5405 13.1075 21.8382 13.4748 21.8382C13.8421 21.8382 14.1399 21.5405 14.1399 21.1731V20.5663H14.3956C14.914 20.5663 15.4111 20.3604 15.7776 19.9939C16.1441 19.6274 16.35 19.1303 16.35 18.612C16.35 18.0937 16.1441 17.5966 15.7776 17.2301C15.4111 16.8636 14.914 16.6577 14.3956 16.6577H12.5539C12.3884 16.6577 12.2297 16.5919 12.1126 16.4749C11.9956 16.3578 11.9298 16.1991 11.9298 16.0336C11.9298 15.8681 11.9956 15.7093 12.1126 15.5923C12.2297 15.4752 12.3884 15.4095 12.5539 15.4095H13.4718L13.4749 15.4095L13.478 15.4095L15.3165 15.4095C15.6838 15.4095 15.9816 15.1117 15.9816 14.7444C15.9816 14.377 15.6838 14.0793 15.3165 14.0793H14.1402L14.1429 13.4874C14.1429 13.12 13.8451 12.8223 13.4778 12.8223Z"},null,-1)]))),_:1,__:[0]})}]]),Xo={name:"AskAccountVerificationPopup",components:{BrandDialog:wt},props:{show:{type:Boolean,default:!1},closeDialog:{type:Function,required:!0}},computed:{...gr.computed},methods:{...gr.methods,handleConfirm(){this.goVerify(),this.closeDialog()}}},Qo={class:"title"},Zo={class:"body-wrap"},Jo={class:"action-wrap"};const eu=vr(Xo,[["render",function(e,t,a,l,r,o){const u=s("Brand
1Button"),c=s("BrandDialog");return n(),i(c,{visible:a.show,width:"500px",idPrefix:"ask_account_verification_dialog",onClosed:a.closeDialog},{header:g((()=>[y("span",Qo,h(e.$t("wallets.fiat.verifyRequired")),1)])),body:g((()=>[y("div",Zo,[y("span",null,h(e.$t("wallets.askAccountVerification.content")),1)])])),footer:g((()=>[y("div",Jo,[m(u,{class:"action-btn",type:"confirm",onClick:o.handleConfirm},{default:g((()=>[v(h(e.$t("steps.email.linkText")),1)])),_:1},8,["onClick"])])])),_:1},8,["visible","onClosed"])}],["__scopeId","data-v-afaa58c0"]]),{enableTokenPage:tu,spotTradeDefaultQuoteCurrency:au}=Ge,lu={name:"WalletMoreActions",components:{IconGift:Et,IconConvertTo:Lt,IconEarn2:Ct,IconDeposit:St,IconSentTo:_t,IconWithdrawal:bt,IconTransfer:Ur,IconAirdropCoin:wr,IconHistory:at,IconStake:jo,WhichWalletActionView:Tr,BrandDialog:wt,SendToFlow:fr,ConvertDialog:De,IconTrend:At,AskAccountVerificationPopup:eu},props:{actionsVisible:{type:Boolean,default:!1},itemList:{type:Array,required:!0},currency:{type:String,default:""},wallet:{type:Object,default:()=>({})},asset:{type:Object,default:()=>({})},isVerifyFirst:{type:Boolean,default:!1},adjustPosition:{type:Object,default:()=>({top:0,left:0})},walletDisplayType:{type:String,required:!0}},emits:["update:actionsVisible","action"],setup(){const{getIsUserFeatureAllow:e}=Nt();return{getIsUserFeatureAllow:e}},data:()=>({enableTokenPage:tu,actionType:null,visible:!1,openDialog:!1,actionComponent:null,sendToRecorder:null,showSendToDialog:!1,actionPosition:{},scrollParent:null,isAccountVerifyPopupShown:!1}),computed:{...gr.computed,...l(["currencyMap","lang","accountInfo"]),...t(["isArabic"]),currencyInfo(){return this.currencyMap[this.currency]||{}},showDepositView(){return this.actionType===It.DEPOSIT},showWithdrawView(){return this.actionType===It.WITHDRAWAL},showConvertDialog(){return this.actionType===It.CONVERT},displayActionMap(){return this.getDisplayActionMap(this.walletDisplayType,this.asset)}},watch:{openDialog(e){!1===e&&(this.actionType=null,this.actionComponent=null)},actionsVisible(e){e?this.bindActionsEvent():this.unBindActionsEvent()}},created(){this.WALLET_ACTIONS=It},beforeUnmount(){this.unBindActionsEvent()},methods:{...gr.methods,...u(["updateAccountInfo"]),...e(Mr,["toggleTransferPopup"]),init(e){this.isLoading=!1,this.updateAccountInfo().then((()=>{this.isLoading=!0,e&&e()}))},handleVerify(e=""){if(!this.isVerifyFirst)return!0;const t=kt(e);return!!Rt(t)||(this.showAccountVerifyPopup(),!1)},onAction(e){switch(e){case It.DEPOSIT:case It.WITHDRAWAL:case It.CONVERT:this.handleCommonAction(e);break;case It.SEND_TO:this.handleSentTo();break;case It.TRANSFER:this.handleTransfer();break;case It.GO_VESTING_PAGE:this.handleGoVestingPage();break;case It.GO_HISTORY_PAGE:this.handleGoHistoryPage();break;case It.STAKE:this.handleStake();break;case It.GO_TRADING_PAGE:this.handleGoTradingPage();break;case It.GO_EARN_PAGE:this.handleGoEarnPage();break;case It.GO_ALL_REWARDS_PAGE:this.handleGoAllRewardsPage()}this.$emit("action",e)},handleCommonAction(e){this.handleVerify(e)&&(this.actionType=e,this.openDialog=!0,this.closeActions())},close(e=!1){e?this.init((()=>{this.onAction(It.WITHDRAWAL)})):(this.openDialog=!1,this.init())},updateDialogTitle(e){this.actionComponent.title=e},handleSentTo(){this.handleVerify()&&(this.sendToRecorder=Dr({currency:this.currency}),this.showSendToDialog=!0,this.closeActions())},handleTransfer(){if(!this.handleVerify())return;const e=this.currencyInfo.transferableBalance>0?"from":"to";this.toggleTransferPopup({[e]:this.currencyInfo.activeWalletName}),this.closeActions()},handleStake(){this.$router.push({name:Ke.TOKEN_STAKING_BENEFITS,params:{lang:this.lang}})},handleGoTradingPage(){const e=this.getMarketBaseCurrency(this.asset.shortName),t=this.spotTradeDefaultQuoteCurrencyQuoteMarkets.includes(this.asset.shortName)?`${au}-${e}`:`${e}-${au}`;this.$router.push({name:"tradingId",params:{lang:this.lang,id:t}})},handleGoEarnPage(){this.handleVerify()&&this.$router.push({name:"earn",params:{lang:this.lang},query:{currency:this.asset.shortName}})},handleGoAllRewardsPage(){this.$router.push({name:Ke.TASKS_AND_REWARDS_ALL_REWARDS,params:{lang:this.lang}})},handleGoHistoryPage(){this.$router.push({name:Ke.WALLET_SPOT_HISTORY,params:{lang:this.lang}
1,query:{currency:this.currencyInfo.shortName}})},handleGoVestingPage(){this.$router.push({name:Ke.VESTING,params:{lang:this.lang}})},closeActions(){this.$emit("update:actionsVisible",!1)},verify(){this.$router.push(`/${this.lang}/account/verification`)},onClickOutside(e){this.actionsVisible&&this.$parent.$el&&!this.$parent.$el.contains(e.target)&&this.$emit("update:actionsVisible",!1)},getActionPosition:Dt((function(){this.$nextTick((()=>{const e=this.$parent.$el,t=this.$refs.actionWrapper;if(!t)return;const a=t.clientWidth,l=e.clientHeight,{right:s,top:i}=e.getBoundingClientRect(),n=this.isArabic?"right":"left";this.actionPosition={top:`${i+l+this.adjustPosition.top}px`,[n]:`${s-a+this.adjustPosition.left}px`}}))})),getScrollParent(e){return null==e?null:e.scrollHeight>e.clientHeight?e:this.getScrollParent(e.parentNode)},bindActionsEvent(){this.scrollParent=this.getScrollParent(this.$refs.actionWrapper),this.getActionPosition(),document.addEventListener("click",this.onClickOutside,!0),window.addEventListener("resize",this.getActionPosition),window.addEventListener("scroll",this.getActionPosition),this.scrollParent&&this.scrollParent.addEventListener("scroll",this.getActionPosition)},unBindActionsEvent(){document.removeEventListener("click",this.onClickOutside,!0),window.removeEventListener("resize",this.getActionPosition),window.removeEventListener("scroll",this.getActionPosition),this.scrollParent&&this.scrollParent.removeEventListener("scroll",this.getActionPosition),this.scrollParent=null},handleCloseDialog(){this.actionType=null},showAccountVerifyPopup(){this.isAccountVerifyPopupShown=!0,this.closeActions()},closeAccountVerifyPopup(){this.isAccountVerifyPopupShown=!1}}},su={class:"name"},iu={class:"name"},nu={class:"name"},ru={class:"name"},ou={class:"name"},uu={class:"name"},cu={class:"name"},du={class:"name"},pu={class:"name"},yu={class:"name"},hu={class:"name"};const vu=vr(lu,[["render",function(e,t,a,l,o,u){const c=s("IconDeposit"),p=s("IconWithdrawal"),S=s("IconConvertTo"),C=s("IconSentTo"),L=s("IconTransfer"),E=s("IconAirdropCoin"),I=s("IconHistory"),k=s("IconStake"),R=s("IconTrend"),N=s("IconEarn2"),x=s("IconGift"),P=s("BrandDialog"),O=s("WhichWalletActionView"),$=s("ConvertDialog"),W=s("SendToFlow"),F=s("AskAccountVerificationPopup");return f((n(),r("div",{ref:"actionWrapper",class:"actions",style:_(o.actionPosition)},[u.displayActionMap[e.WALLET_ACTIONS.DEPOSIT]&&!e.isBonusCurrency(a.asset)&&a.itemList.includes(e.WALLET_ACTIONS.DEPOSIT)?(n(),r("div",{key:0,class:"action",onClick:t[0]||(t[0]=w((t=>u.onAction(e.WALLET_ACTIONS.DEPOSIT)),["stop"]))},[m(c,{class:"icon"}),y("span",su,h(e.$t("t.deposit"))+" "+h(a.currency),1)])):d("",!0),u.displayActionMap[e.WALLET_ACTIONS.WITHDRAWAL]&&!e.isBonusCurrency(a.asset)&&a.itemList.includes(e.WALLET_ACTIONS.WITHDRAWAL)?(n(),r("div",{key:1,class:"action",onClick:t[1]||(t[1]=w((t=>u.onAction(e.WALLET_ACTIONS.WITHDRAWAL)),["stop"]))},[m(p,{class:"icon"}),y("span",iu,h(e.$t("t.withdraw"))+" "+h(a.currency),1)])):d("",!0),u.displayActionMap[e.WALLET_ACTIONS.CONVERT]&&a.itemList.includes(e.WALLET_ACTIONS.CONVERT)?(n(),r("div",{key:2,class:"action",onClick:t[2]||(t[2]=w((t=>u.onAction(e.WALLET_ACTIONS.CONVERT)),["stop"]))},[m(S,{class:"icon"}),y("span",nu,h(e.$t("wallets.convert.buttonConvert")),1)])):d("",!0),u.displayActionMap[e.WALLET_ACTIONS.SEND_TO]&&a.itemList.includes(e.WALLET_ACTIONS.SEND_TO)?(n(),r("div",{key:3,class:"action",onClick:t[3]||(t[3]=w((t=>u.onAction(e.WALLET_ACTIONS.SEND_TO)),["stop"]))},[m(C,{class:"icon"}),y("span",ru,h(e.$t("wallets.sendTo")),1)])):d("",!0),u.displayActionMap[e.WALLET_ACTIONS.TRANSFER]&&a.itemList.includes(e.WALLET_ACTIONS.TRANSFER)?(n(),r("div",{key:4,class:"action",onClick:t[4]||(t[4]=w((t=>u.onAction(e.WALLET_ACTIONS.TRANSFER)),["stop"]))},[m(L,{class:"icon"}),y("span",ou,h(e.$t("wallets.transfer")),1)])):d("",!0),u.displayActionMap[e.WALLET_ACTIONS.GO_VESTING_PAGE]?(n(),r("div",{key:5,class:"action",onClick:t[5]||(t[5]=w((t=>u.onAction(e.WALLET_ACTIONS.GO_VESTING_PAGE)),["stop"]))},[m(E,{class:"icon"}),y("span",uu,h(e.$t("t.vesting")),1)])):d("",!0),u.displayActionMap[e.WALLET_ACTIONS.GO_HISTORY_PAGE]&&a.itemList.includes(e.WALLET_ACTIONS.GO_HISTORY_PAGE)?(n(),r("div",{key:6,class:"action",onClick:t[6]||(t[6]=w((t=>u.onAction(e.WALLET_ACTIONS.GO_HISTORY_PAGE)),["stop"]))},[m(I,{class:"icon"}),y("span",cu,h(e.$t("t.history")),1)])):d("",!0),u.displayActionMap[e.WALLET_ACTIONS.STAKE]&&a.itemList.includes(e.WALLET_ACTIONS.STAKE)?(n(),r("div",{key:7,class:"action",onClick:t[7]||(t[7]=w((t=>u.onAction(e.WALLET_ACTIONS.STAKE)),["stop"]))},[m(k,{class:"icon"}),y("span",du,h(e.$t("t.stake")),1)])):d("",!0),u.displayActionMap[e.WALLET_ACTIONS.GO_TRADING_PAGE]&&a.itemList.includes(e.WALLET_ACTIONS.GO_TRADING_PAGE)?(n(),r("div",{key:8,class:"action",onClick:t[8]||(t[8]=w((t=>u.onAction(e.WALLET_ACTIONS.GO_TRADING_PAGE)),["stop"]))},[m(R,{class:"icon"}),y("span",pu,h(e.$t("wallets.trade")),1)])):d("",!0),u.displayActionMap[e.WALLET_ACTIONS.GO_EARN_PAGE]&&a.itemList.includes(e.WALLET_ACTIONS.GO_EARN_PAGE)?(n(),r("div",{key:9,class:"action",onClick:t[9]||(t[9]=w((t=>u.onAction(e.WALLET_ACTIONS.GO_EARN_PAGE)),["stop"]))},[m(N,{class:"icon"}),y("span",yu,h(e.$t("wallets.earn")),1)])):d("",!0),u.displayActionMap[e.WALLET_ACTIONS.GO_ALL_REWARDS_PAGE]?(n(),r("div",{key:10,class:"action",onClick:t[10
1]||(t[10]=w((t=>u.onAction(e.WALLET_ACTIONS.GO_ALL_REWARDS_PAGE)),["stop"]))},[m(x,{class:"icon"}),y("span",hu,h(e.$t("t.rewards")),1)])):d("",!0),o.actionComponent?(n(),i(P,{key:11,visible:o.openDialog,"onUpdate:visible":t[12]||(t[12]=e=>o.openDialog=e),width:e.$isLargeSize(e.$mq)?"530px":"90%",idPrefix:"wallet_more_actions_dialog"},D({body:g((()=>[(n(),i(A(o.actionComponent.component),b(o.actionComponent&&o.actionComponent.payload,{"dialog-visible":o.openDialog,"onUpdate:dialogVisible":t[11]||(t[11]=e=>o.openDialog=e),currency:a.currency,onOnCancel:u.handleCloseDialog}),null,16,["dialog-visible","currency","onOnCancel"]))])),_:2},[o.actionComponent.title?{name:"header",fn:g((()=>[v(h(o.actionComponent.title),1)])),key:"0"}:void 0]),1032,["visible","width"])):d("",!0),u.showDepositView||u.showWithdrawView?(n(),i(O,{key:12,actionType:o.actionType,defaultCurrency:u.currencyInfo.shortName,onClosed:u.handleCloseDialog},null,8,["actionType","defaultCurrency","onClosed"])):d("",!0),u.showConvertDialog?(n(),i($,{key:13,closeDialog:u.handleCloseDialog,fromCurrency:u.currencyInfo.shortName},null,8,["closeDialog","fromCurrency"])):d("",!0),o.showSendToDialog?(n(),i(W,{key:14,record:o.sendToRecorder,"onUpdate:record":t[13]||(t[13]=e=>o.sendToRecorder=e),show:o.showSendToDialog,"onUpdate:show":t[14]||(t[14]=e=>o.showSendToDialog=e)},null,8,["record","show"])):d("",!0),m(F,{show:o.isAccountVerifyPopupShown,closeDialog:u.closeAccountVerifyPopup},null,8,["show","closeDialog"])],4)),[[T,a.actionsVisible]])}],["__scopeId","data-v-d67bfc26"]]),mu={DEPOSIT:It.DEPOSIT,WITHDRAW:It.WITHDRAWAL},{enableTokenPage:gu,enableKycV1PlusFlow:fu,enableRegisterForMobileSignUpFlowV2:Tu,isShowAllRewardsIconInWalletActions:wu,baseCurrency:Du}=Ge,{visible:Au}=Bt,bu={overview:Ft.OVERVIEW,[Ye.SPOT]:Ft.SPOT_GENERAL},_u={name:"WalletActions",components:{IconGift:Et,IconConvertTo:Lt,IconDeposit:St,IconSentTo:_t,IconTransfer:Ur,IconWithdrawal:bt,IconHistory:at,IconMore:xt,IconStake:jo,IconAirdropCoin:wr,WalletMoreActions:vu},props:{type:{type:String,default:Ye.SPOT}},emits:["update:actionType"],setup(){const e=Ut(),{isDefiUser:t}=S(e),{hasFeature:a,getIsUserFeatureAllow:l}=Nt(),{showIdVerificationRequiredDialog:s}=Vr();return{isDefiUser:t,hasFeature:a,getIsUserFeatureAllow:l,showIdVerificationRequiredDialog:s}},data:()=>({enableTokenPage:gu,isShowAllRewardsIconInWalletActions:wu,VIEWED_LIST:mt,actionsVisible:!1,dividerVisible:Au.actionDivider}),computed:{...gr.computed,...l(["lang","currencyMap"]),...t(["isEmailNotVerified","isSubAccount","isAccountInfoExist","isPhoneNumberVerified"]),walletDisplayType(){return bu[this.type]},displayActionMap(){return this.getDisplayActionMap(this.walletDisplayType)},moreActionsList(){let e=[It.SEND_TO,It.TRANSFER,It.GO_HISTORY_PAGE,It.STAKE,It.SWAP];return this.isSubAccount&&(e=[It.TRANSFER,It.GO_HISTORY_PAGE]),e.filter((e=>this.hasFeature(e)))},currencyInfo(){return this.currencyMap[Du]||{}}},created(){this.WALLET_ACTIONS=It,this.WALLET_TYPE=Ye},methods:{...gr.methods,e2eID:Xe,async handleAction(e){if(!this.isSubAccount)if(Tu){if(!this.isPhoneNumberVerified&&this.isEmailNotVerified)return void this.$router.push({name:Pt.VERIFICATION,params:{lang:this.lang}})}else if(this.isEmailNotVerified&&fu)return void this.$router.push({name:Pt.VERIFICATION,params:{lang:this.lang}});switch(this.$sendEvent(Ot.EVENT_WEB_WALLET_ACTION_ICON_TRIGGERED,{actionType:e,route:this.$route}),e){case It.SEND_TO:if(this.showIdVerificationRequiredDialog(Wt.SEND_TO.SEND_TO))return;break;case It.STAKE:return void this.$router.push({name:Ke.TOKEN_STAKING_BENEFITS,params:{lang:this.lang}});case It.GO_HISTORY_PAGE:return void this.$router.push({name:Ke.WALLET_SPOT_HISTORY,params:{lang:this.lang}});case It.GO_VESTING_PAGE:return void this.$router.push({name:Ke.VESTING,params:{lang:this.lang}});case It.SWAP:return void this.$router.push({name:Ke.SWAP,params:{lang:this.lang}});case It.GO_ALL_REWARDS_PAGE:return void this.$router.push({name:Ke.TASKS_AND_REWARDS_ALL_REWARDS,params:{lang:this.lang}});case It.DEPOSIT:this.$sendEvent(Ot.EVENT_WEB_GOTO_DEPOSIT_PAGE,{route:this.$route,fromWhere:$t.WALLET_ACTIONS_COMPONENT,currency:null});break;case It.WITHDRAWAL:this.$sendEvent(Ot.EVENT_WEB_GOTO_WITHDRAW_PAGE,{route:this.$route,fromWhere:$t.WALLET_ACTIONS_COMPONENT,currency:null})}this.$emit("update:actionType",e);
1this.isDefiUser&&Object.values(mu).includes(e)&&(await this.$nextTick(),this.$emit("update:actionType",""))},toggleActions(){this.actionsVisible=!this.actionsVisible}}},Su={class:"wallet-actions"},Cu=["id"],Lu={class:"name"},Eu=["id"],Iu={class:"name"},ku=["id"],Ru={class:"name"},Nu=["id"],xu={class:"name"},Pu=["id"],Ou={class:"name"},$u={class:"name"},Wu=["id"],Fu={class:"name"},Bu=["id"],Uu={class:"name"},Mu={class:"name"},Vu={class:"name"},Hu={class:"name"};const Gu=vr(_u,[["render",function(e,t,a,l,i,o){const u=s("IconDeposit"),c=s("IconWithdrawal"),v=s("IconConvertTo"),g=s("IconSentTo"),T=s("IconMore"),w=s("WalletMoreActions"),D=s("IconTransfer"),A=s("IconAirdropCoin"),b=s("IconHistory"),_=s("IconStake"),S=s("IconGift"),L=C("loading");return f((n(),r("div",Su,[[e.WALLET_TYPE.SPOT,"overview"].includes(a.type)?(n(),r(p,{key:0},[o.displayActionMap[e.WALLET_ACTIONS.DEPOSIT]?(n(),r("div",{key:0,id:o.e2eID("btn_deposit"),class:"item",onClick:t[0]||(t[0]=t=>o.handleAction(e.WALLET_ACTIONS.DEPOSIT))},[m(u,{class:"icon"}),y("span",Lu,h(e.$t("t.deposit")),1)],8,Cu)):d("",!0),o.displayActionMap[e.WALLET_ACTIONS.WITHDRAWAL]?(n(),r("div",{key:1,id:o.e2eID("btn_withdrawal"),class:"item",onClick:t[1]||(t[1]=t=>o.handleAction(e.WALLET_ACTIONS.WITHDRAWAL))},[m(c,{class:"icon"}),y("span",Iu,h(e.$t("t.withdraw")),1)],8,Eu)):d("",!0),o.displayActionMap[e.WALLET_ACTIONS.CONVERT]?(n(),r("div",{key:2,id:o.e2eID("btn_convert"),class:"item",onClick:t[2]||(t[2]=t=>o.handleAction(e.WALLET_ACTIONS.CONVERT))},[m(v,{class:"icon"}),y("span",Ru,h(e.$t("wallets.convert")),1)],8,ku)):d("",!0),o.displayActionMap[e.WALLET_ACTIONS.SWAP]?(n(),r("div",{key:3,id:o.e2eID("btn_swap"),class:"item",onClick:t[3]||(t[3]=t=>o.handleAction(e.WALLET_ACTIONS.SWAP))},[m(v,{class:"icon"}),y("span",xu,h(e.$t("wallets.swap")),1)],8,Nu)):d("",!0),!e.isMobile&&o.displayActionMap[e.WALLET_ACTIONS.SEND_TO]?(n(),r("div",{key:4,id:o.e2eID("btn_send_to"),class:"item",onClick:t[4]||(t[4]=t=>o.handleAction(e.WALLET_ACTIONS.SEND_TO))},[m(g,{class:"icon icon-send-to"}),y("span",Ou,h(e.$t("wallets.spotList.sendTo")),1)],8,Pu)):d("",!0),e.isMobile?(n(),r("div",{key:5,class:"item",onClick:t[6]||(t[6]=(...e)=>o.toggleActions&&o.toggleActions(...e))},[m(T,{class:"icon"}),y("span",$u,h(e.$t("msg.more")),1),m(w,{actionsVisible:i.actionsVisible,"onUpdate:actionsVisible":t[5]||(t[5]=e=>i.actionsVisible=e),class:"more-actions",itemList:o.moreActionsList,adjustPosition:{top:13,left:0},walletDisplayType:o.walletDisplayType},null,8,["actionsVisible","itemList","walletDisplayType"])])):d("",!0)],64)):d("",!0),!e.isMobile&&o.displayActionMap[e.WALLET_ACTIONS.TRANSFER]?(n(),r("div",{key:1,id:o.e2eID("btn_transfer"),class:"item",onClick:t[7]||(t[7]=t=>o.handleAction(e.WALLET_ACTIONS.TRANSFER))},[m(D,{class:"icon"}),y("span",Fu,h(e.$t("wallets.transfer")),1)],8,Wu)):d("",!0),!e.isMobile&&(o.displayActionMap[e.WALLET_ACTIONS.STAKE]||o.displayActionMap[e.WALLET_ACTIONS.GO_HISTORY_PAGE]||o.displayActionMap[e.WALLET_ACTIONS.GO_VESTING_PAGE]||o.displayActionMap[e.WALLET_ACTIONS.GO_ALL_REWARDS_PAGE]&&i.isShowAllRewardsIconInWalletActions)?(n(),r(p,{key:2},[t[12]||(t[12]=y("div",{class:"split-line"},null,-1)),o.displayActionMap[e.WALLET_ACTIONS.GO_VESTING_PAGE]?(n(),r("div",{key:0,id:o.e2eID("btn_vesting"),class:"item",onClick:t[8]||(t[8]=t=>o.handleAction(e.WALLET_ACTIONS.GO_VESTING_PAGE))},[m(A,{class:"icon"}),y("span",Uu,h(e.$t("t.vesting")),1)],8,Bu)):d("",!0),o.displayActionMap[e.WALLET_ACTIONS.GO_HISTORY_PAGE]?(n(),r("div",{key:1,class:"item",onClick:t[9]||(t[9]=t=>o.handleAction(e.WALLET_ACTIONS.GO_HISTORY_PAGE))},[m(b,{class:"icon"}),y("span",Mu,h(e.$t("t.history")),1)])):d("",!0),o.displayActionMap[e.WALLET_ACTIONS.STAKE]?(n(),r("div",{key:2,class:"item",onClick:t[10]||(t[10]=t=>o.handleAction(e.WALLET_ACTIONS.STAKE))},[m(_,{class:"icon icon-stake"}),y("span",Vu,h(e.$t("t.stake")),1)])):d("",!0),o.displayActionMap[e.WALLET_ACTIONS.GO_ALL_REWARDS_PAGE]&&i.isShowAllRewardsIconInWalletActions?(n(),r("div",{key:3,class:"item",onClick:t[11]||(t[11]=t=>o.handleAction(e.WALLET_ACTIONS.GO_ALL_REWARDS_PAGE))},[m(S,{class:"icon icon-gift"}),y("span",Hu,h(e.$t("t.rewards")),1)])):d("",!0)],64)):d("",!0)])),[[L,!e.isAccountInfoExist]])}],["__scopeId","data-v-84b72d86"]]),{walletBalanceValueAssetFilterList:Yu}=Ge,qu={name:"WalletBalanceValue",components:{CurrencyDropDown:Mt},props:{type:{type:String,default:Ye.SPOT},customizeBalance:{type:[Number,String],default:void 0}},setup(){const{isChristmasEventActive:e,isLunarNewYearEventActive:t}=S(Yt());return{isChristmasEventActive:e,isLunarNewYearEventActive:t}},data:()=>
1({TOOLTIP_PLACEMENT:Gt,walletBalanceValueAssetFilterList:Yu,selectedCurrency:""}),computed:{...l(["hideWalletPriceValue","walletValueType"]),...a(ze,["displayCurrency","walletCurrencyList"]),...a(pt,{autoTraderTotalBalanceInDisplayCurrency:"totalBalanceInDisplayCurrency"}),...a(dt,{leadTradingBalanceInDisplayCurrency:"balanceInDisplayCurrency"}),...a(ct,{copyTradingTotalBalanceInDisplayCurrency:"totalBalanceInDisplayCurrency"}),...a(ut,{aiLeadTradingBalanceInDisplayCurrency:"balanceInDisplayCurrency"}),...a(ot,{aiCopyTradingTotalBalanceInDisplayCurrency:"totalBalanceInDisplayCurrency"}),...a(rt,{futuresBotsTotalBalanceInDisplayCurrency:"totalBalanceInDisplayCurrency"}),...a(nt,{earnTotalBalanceInDisplayCurrency:"totalBalanceInDisplayCurrency"}),...a(Ht,["totalBalance","totalBalanceInDisplayCurrency"]),...t(["accountCurrency","getAccountValue","futuresBalance"]),isShowCurrency(){return["spotPnl"].includes(this.type)},balanceCurrency(){return this.$slots.currency?this.$slots.currency:"spotPnl"===this.type?Vt:this.selectedCurrency},displayBalance(){if(this.hideWalletPriceValue)return this.isChristmasEventActive?"ðððððððð":this.isLunarNewYearEventActive?"ð§§ð§§ð§§ð§§ð§§ð§§ð§§ð§§":qe;const e=this.isMobile&&this.balance>=1e7?{formatKey:"max3",compact:!0,currency:this.balanceCurrency}:{formatKey:2,currency:this.balanceCurrency};return this.$filters.formatNumber(this.balance,e)},balance(){if(void 0!==this.customizeBalance)return this.customizeBalance;switch(this.type){case Ye.SPOT:return this.getAccountValue(this.walletValueType,!0);case"spotPnl":{const e="total"===this.walletValueType?"totalInUsd":"availableInUsd";return this.getAccountValue(e)}case Ye.FUTURES:{const e="total"===this.walletValueType?"totalInDisplayCurrency":"availableInDisplayCurrency";return this.futuresBalance(e)}case Ye.AUTO_TRADER:return this.autoTraderTotalBalanceInDisplayCurrency;case Ye.LEAD_TRADING:return this.leadTradingBalanceInDisplayCurrency;case Ye.COPY_TRADING:return this.copyTradingTotalBalanceInDisplayCurrency;case Ye.AI_LEAD_TRADING:return this.aiLeadTradingBalanceInDisplayCurrency;case Ye.AI_COPY_TRADING:return this.aiCopyTradingTotalBalanceInDisplayCurrency;case Ye.FUTURES_BOTS:return this.futuresBotsTotalBalanceInDisplayCurrency;case Ye.EARN:return this.earnTotalBalanceInDisplayCurrency;case"overview":return this.totalBalanceInDisplayCurrency;default:return 0}}},watch:{selectedCurrency(e){this.setDisplayCurrency(e)}},mounted(){this.selectedCurrency=this.displayCurrency},methods:{...e(ze,["setDisplayCurrency"])}},zu={class:"value"},Ku={key:0,class:"currency"};const ju=vr(qu,[["render",function(e,t,a,l,u,c){const v=s("Tooltip"),f=s("CurrencyDropDown");return n(),r("div",{class:L(["balance",{"align-center":e.hideWalletPriceValue}])},[m(v,{placement:u.TOOLTIP_PLACEMENT.top,class:"tool-tip"},{content:g((()=>[y("span",zu,h(c.displayBalance),1)])),tooltip:g((()=>[y("span",null,h(e.$t("wallet.balance.tooltip")),1)])),_:1},8,["placement"]),o(e.$slots,"currency",{},void 0,!0),e.$slots.currency?d("",!0):(n(),r(p,{key:0},[c.isShowCurrency?(n(),r("span",Ku,h(c.balanceCurrency),1)):(n(),i(f,{key:1,selectedCurrency:u.selectedCurrency,"onUpdate:selectedCurrency":t[0]||(t[0]=e=>u.selectedCurrency=e),class:"currency-drop-down",appliedCurrencyList:e.walletCurrencyList,appliedFilterList:u.walletBalanceValueAssetFilterList,idPrefix:"wallet_balance_value"},null,8,["selectedCurrency","appliedCurrencyList","appliedFilterList"]))],64))],2)}],["__scopeId","data-v-54c42a64"]]),{visible:Xu}=Bt,Qu={AVAILABLE:"available",TOTAL:"total"},Zu={name:"WalletBalanceInfo",components:{WalletBalanceValue:ju,WalletToggleHidePriceValue:qt},props:{type:{type:String,default:Ye.SPOT}},data:()=>({available:0,VALUE_TYPES:Qu}),computed:{...l(["walletValueType"]),isToggleHidePriceVisible:()=>Xu.toggleHidePrice,isWalletValueTypeVisible:()=>Xu.valueType,showEquityBalance(){return[Ye.FUTURES,Ye.LEAD_TRADING,Ye.AI_LEAD_TRADING].includes(this.type)},isShowAvailableBalance(){return[Ye.SPOT].includes(this.type)},totalText(){return this.type===Ye.EARN?this.$t("account.dashboard.totalSubscribed"):this.$t("wallets.totalBalance")}},methods:{...c(["setWalletValueType"])}},Ju={class:"balance-wrapper"},ec={class:"top-wrapper"},tc={key:0},ac={key:2,class:"split"},lc={key:1,class:"value-type"},sc={class:"value-wrapper"};const ic=vr(Zu,[["render",function(e,t,a,l,u,c){const p=s("Tooltip"),v=s("WalletToggleHidePriceValue"),f=s("WalletBalanceValue");return n(),r("div",Ju,[y("div",ec,[o(e.$slots,"valueType",{},(()=>
1[c.isWalletValueTypeVisible?(n(),r("div",tc,[c.showEquityBalance?(n(),i(p,{key:0,placement:"bottom-start"},{content:g((()=>[y("span",{class:L(["value-type",{active:e.walletValueType===u.VALUE_TYPES.AVAILABLE}]),onClick:t[0]||(t[0]=t=>e.setWalletValueType(u.VALUE_TYPES.AVAILABLE))},h(e.$t("t.equityBalance")),3)])),tooltip:g((()=>[y("span",null,h(e.$t("wallets.balanceInfo.equityBalance.tooltip")),1)])),_:1})):c.isShowAvailableBalance?(n(),r("span",{key:1,class:L(["value-type",{active:e.walletValueType===u.VALUE_TYPES.AVAILABLE}]),onClick:t[1]||(t[1]=t=>e.setWalletValueType(u.VALUE_TYPES.AVAILABLE))},h(e.$t("t.availableBalance")),3)):d("",!0),c.showEquityBalance||c.isShowAvailableBalance?(n(),r("span",ac)):d("",!0),y("span",{class:L(["value-type",{active:e.walletValueType===u.VALUE_TYPES.TOTAL}]),onClick:t[2]||(t[2]=t=>e.setWalletValueType(u.VALUE_TYPES.TOTAL))},h(c.totalText),3)])):(n(),r("span",lc,h(e.walletValueType===u.VALUE_TYPES.AVAILABLE?e.$t("t.available"):e.$t("t.total")),1))]),!0),c.isToggleHidePriceVisible?(n(),i(v,{key:0,class:"hide-value-icon"})):d("",!0)]),y("div",sc,[m(f,{type:a.type},null,8,["type"])])])}],["__scopeId","data-v-abb958bb"]]),nc={class:"item-name"},rc={class:"left"},oc={class:"name"},uc={class:"go-to-icon-container"},cc={class:"item-value"},dc={class:"percentage"},pc={class:"balance"},yc={class:"unit"},hc=vr(E({__name:"WalletList",emits:["hoverLeave","hoverEnter"],setup(e,{emit:t}){const{enableWalletSpot:a,enableWalletFutures:l,enableWalletEarn:o}=Ge,u=t,{t:c}=I(),d=Ut(),{hideWalletPriceValue:f}=S(d),T=pt(),{isEnableAutoTraderWallet:w,totalBalanceInDisplayCurrency:D}=S(T),A=ct(),{isEnableCopyTradingWallet:b}=S(A),C=ot(),{isEnableAiCopyTradingWallet:L}=S(C),E=rt(),{isEnableFuturesBotsWallet:O,totalBalanceInDisplayCurrency:$}=S(E),W=nt(),{totalBalanceInDisplayCurrency:F}=S(W),B=Ht(),{copyTradingTotalBalanceInDisplayCurrency:U,aiCopyTradingTotalBalanceInDisplayCurrency:M}=S(B),V=ze(),{displayCurrency:H}=S(V),G=k("priceInfoByWhichWallet"),Y=R((()=>{const e=[];for(const t of zt){const{value:a,routeName:l,enabled:s}=K(t);s&&e.push({name:c(jt[t]),color:Kt[t],value:a,balance:X(a),route:{name:l}})}return e})),q=R((()=>Y.value.reduce(((e,{value:t})=>e.plus(t)),N(0)).toFixed())),z=R((()=>Y.value.map((e=>N(e.value).div(N(q.value).isZero()?1:q.value).times(100).dp(0)))));function K(e){switch(e){case Ye.SPOT:return{value:G.info.spotTotalBalanceInDisplayCurrency,routeName:"walletSpot",enabled:a};case Ye.FUTURES:return{value:G.info.futuresTotalBalanceInDisplayCurrency,routeName:"walletFutures",enabled:l};case Ye.AUTO_TRADER:return{value:D.value,routeName:Ke.WALLET_AUTO_TRADER,enabled:w.value};case Ye.COPY_TRADING:return{value:U.value,routeName:Ke.WALLET_COPY_TRADING,enabled:b.value};case Ye.AI_COPY_TRADING:return{value:M.value,routeName:Ke.WALLET_AI_COPY_TRADING,enabled:L.value};case Ye.FUTURES_BOTS:return{value:$.value,routeName:Ke.WALLET_FUTURES_BOTS,enabled:O.value};case Ye.EARN:return{value:F.value,routeName:"walletEarn",enabled:o}}}function j(e,t=0){e?u("hoverEnter",t):u("hoverLeave")}function X(e){if(f.value)return qe;const t=Number(e)>=1e7;return Xt(e,{defaultValue:"--",formatKey:t?"max4":null,compact:t,currency:H.value??void 0})}return(e,t)=>{const a=s("RouterLink");return n(),r("div",null,[(n(!0),r(p,null,x(Y.value,((e,l)=>(n(),i(a,{key:e.name,class:"wallet-item",to:e.route,onMouseenter:e=>j(!0,l),onMouseleave:t[0]||(t[0]=e=>j(!1))},{default:g((()=>[y("div",nc,[y("div",rc,[y("div",{class:"dot",style:_({backgroundColor:e.color})},null,4),y("div",oc,h(e.name),1)]),y("div",uc,[m(ht,{class:"go-to-icon"})])]),y("div",cc,[y("div",dc,h(z.value[l])+"%",1),y("div",pc,[(n(),i(Ar,{key:e.balance,fontSize:18,minFontSize:12,class:"balance-text"},{default:g((()=>[v(h(e.balance),1)])),_:2},1024)),y("span",yc,h(P(H)),1)])])])),_:2},1032,["to","onMouseenter"])))),128))])}}}),[["__scopeId","data-v-fb620103"]]),{enableWalletSpot:vc,enableWalletFutures:mc,enableWalletEarn:gc}=Ge,fc={wallets:0,coins:1},Tc={name:"MyAssetsContent",components:{TabMenu:aa,DonutChartV2:ta,WalletList:hc,EmptyCircle:ea,WalletCoinsChartLegend:Jt,NoDataAvailable:Zt},inject:["priceInfoByWhichWallet"],setup(){const{getIsUserFeatureAllow:e}=Nt(),{getCurrencyRate:t}=na(),{displayCurrency:a}=S(ze());return{getIsUserFeatureAllow:e,getCurrencyRate:t,displayCurrency:a}},data:()=>
1({ASSETS_TAB:fc,isEarnDataLoading:!1,tabShow:fc.wallets,coinsColorList:ia,donutHoverIndex:null,computedCoinsData:[],serverEarnOrderData:null}),computed:{...Qt.computed,...l(["currencyMap","fiatCurrencyList","cryptoCurrencyList","hideWalletPriceValue","lang","isInitialWalletInfoLoading"]),...a(sa,{futuresWallet:"wallet"}),...a(Ut,["isExpressBuyEntryAllowed"]),...a(pt,{isEnableAutoTraderWallet:"isEnableAutoTraderWallet",autoTraderWallet:"wallet",autoTraderTotalBalanceInDisplayCurrency:"totalBalanceInDisplayCurrency"}),...a(ct,{isEnableCopyTradingWallet:"isEnableCopyTradingWallet",copyTradingWallet:"wallet"}),...a(ot,{isEnableAiCopyTradingWallet:"isEnableAiCopyTradingWallet",aiCopyTradingWallet:"wallet"}),...a(rt,{isEnableFuturesBotsWallet:"isEnableFuturesBotsWallet",futuresBotsWallet:"wallet",futuresBotsTotalBalanceInDisplayCurrency:"totalBalanceInDisplayCurrency"}),...a(nt,{earnTotalBalanceInDisplayCurrency:"totalBalanceInDisplayCurrency"}),...a(Ht,{copyTradingTotalBalanceInDisplayCurrency:"copyTradingTotalBalanceInDisplayCurrency",aiCopyTradingTotalBalanceInDisplayCurrency:"aiCopyTradingTotalBalanceInDisplayCurrency"}),...t(["isUnifiedWallet"]),isLoading(){return this.isInitialWalletInfoLoading||this.isEarnDataLoading},tabList(){return[{title:this.$t("wallets.wallets")},{title:this.$t("wallets.overview.tabs.coins")}]},walletsChartData(){return[{id:Ye.SPOT,name:this.$t("router.walletSpot"),value:this.priceInfoByWhichWallet.info.spotTotalBalanceInDisplayCurrency,enabled:vc},{id:Ye.FUTURES,name:this.$t("wallets.futures"),value:this.priceInfoByWhichWallet.info.futuresTotalBalanceInDisplayCurrency,enabled:mc},{id:Ye.AUTO_TRADER,name:this.$t("nav.autoTrader"),value:this.autoTraderTotalBalanceInDisplayCurrency,enabled:this.isEnableAutoTraderWallet},{id:Ye.COPY_TRADING,name:this.$t("trading.copyTrading"),value:this.copyTradingTotalBalanceInDisplayCurrency,enabled:this.isEnableCopyTradingWallet},{id:Ye.AI_COPY_TRADING,name:this.$t("nav.aiCopyTrading"),value:this.aiCopyTradingTotalBalanceInDisplayCurrency,enabled:this.isEnableAiCopyTradingWallet},{id:Ye.FUTURES_BOTS,name:this.$t("nav.futuresBots"),value:this.futuresBotsTotalBalanceInDisplayCurrency,enabled:this.isEnableFuturesBotsWallet},{id:Ye.EARN,name:this.$t("wallets.earn"),value:this.earnTotalBalanceInDisplayCurrency,enabled:gc}].filter((e=>e.enabled))},walletsColorList(){return this.walletsChartData.map((({id:e})=>Kt[e]))},isWalletsEmpty(){return this.walletsChartData.every((e=>N(e.value).eq(0)))},spotCurrencyMap(){if(!vc)return{};const e=e=>{const{total:t,displayName:a}=this.currencyMap[e],l=this.getCurrencyRate(e,this.displayCurrency);return{name:a,value:N(t).times(l).toNumber()}},t=this.fiatCurrencyList.map(e),a=this.cryptoCurrencyList.map(e);return t.concat(a).reduce(((e,t)=>(t.value>0&&(e[t.name]=t.value),e)),{})},futuresCurrencyMap(){if(!mc)return{};const e={};for(let{currency:t,balance:a}of Object.values(this.futuresCurrencyData)){const l=this.getCurrencyRate(t,this.displayCurrency),s=N(a).times(l).toNumber();s>0&&(e[t]=s)}return e},earnCurrencyMap(){return this.serverEarnOrderData&&gc?this.serverEarnOrderData.reduce(((e,{currency:t,investAmt:a})=>{const l=this.getCurrencyRate(t,this.displayCurrency),s=N(a).times(l).toNumber();return s>0&&(e[t]=N(e[t]||0).plus(s).toNumber()),e}),{}):{}},allTypeCurrencyList(){const e={},t=Object.entries(this.spotCurrencyMap),a=Object.entries(this.earnCurrencyMap);let l=t.concat(a);this.isUnifiedWallet||(l=l.concat(Object.entries(this.futuresCurrencyMap)));for(let[i,n]of l)e[i]=N(e[i]||0).plus(n).toNumber();let s=this.autoTraderWallet.assets.concat(this.copyTradingWallet.assets).concat(this.aiCopyTradingWallet.assets).concat(this.futuresBotsWallet.assets);return this.isUnifiedWallet&&(s=s.concat(this.futuresWallet.assets||[])),s.forEach((({shortName:t,totalValueInUSD:a,totalValue:l})=>{let s=a;if(this.displayCurrency!==la){const e=this.getCurrencyRate(t,this.displayCurrency);s=N(l).times(e).toNumber()}e[t]=N(e[t]||0).plus(s).toNumber()})),Object.entries(e).map((([e,t])=>{var a;return{name:(null==(a=this.currencyMap[e])?void 0:a.displayName)||e,value:t}})).sort(((e,t)=>t.value-e.value))},assetMax6Length(){if(this.allTypeCurrencyList.length<=6)return this.allTypeCurrencyList;const e=this.allTypeCurrencyList.slice(0,5),t=this.allTypeCurrencyList.slice(5).reduce(((e,t)=>e+t.value),0);return e.concat([{name:"Others",value:t}])}},created(){this.getEarnedData()},methods:{async getEarnedData(){if(gc){this.isEarnDataLoading=!0;try{const e=await br();this.serverEarnOrderData=e.order||null}catch(e){return Promise.reject(e)}finally{this.isEarnDataLoading=!1}}},tabClick(e){this.tabShow=e},shortFormatNumber(e){if(this.hideWalletPriceValue)return qe;const t=e>=1e7;return this.$filters.formatNumber(e,{formatKey:t?"max4":null,compact:t,currency:this.displayCurrency})},updateComputedCoinsData(e){this.computedCoinsData=e},onBuy(){this.$router.push({name:Ke.EXPRESS_BUY,params:{lang:this.lang}})},onDeposit(){this.$sendEvent(Ot.EVENT_WEB_GOTO_DEPOSIT_PAGE,{route:this.$route,fromWhere:$t.WALLET_MY_ASSETS_CONTENT,currency:null}),this.$router.push({name:Ke.DEPOSIT,params:{lang:this.lang}})}}},wc={class:"assets-wrapper"},Dc={class:"empty-button-group"},Ac={key:0,class:"empty-note"},bc={class:"tab-content wallets-wrapper"},_c={class:"asset-chart"},Sc={class:"tooltip-center"},Cc={class:"tooltip-header"},Lc={class:"name"},Ec={class:"percentage"},Ic={class:"value"},kc={class:"account-currency"},Rc={class:"tab-content coins-wrapper"},Nc={class:"coins-legend"},xc={class:"coins-chart"},Pc={class:"tooltip-center"},Oc={class:"tooltip-header"},$c={class:"name"},Wc={class:"percentage"},Fc={class:"value"},Bc={class:"account-currency"};const Uc=vr(Tc,[["render",function(e,t,a,l,o,u){const c=s("NoDataAvailable"),w=s("BaseButton"),D=s("TabMenu"),A=s("WalletList"),b=s("DonutChartV2"),_=s("WalletCoinsCh
1artLegend"),S=s("EmptyCircle"),E=C("loading");return f((n(),r("div",wc,[u.isWalletsEmpty?(n(),r("div",{key:0,class:L(["empty-wrapper",{"is-loading":u.isLoading}])},[m(c,{class:"empty-icon",emptyText:e.$t("wallets.overview.empty.text")},null,8,["emptyText"]),y("div",Dc,[e.isExpressBuyEntryAllowed?(n(),i(w,{key:0,class:"outline-primary",size:e.isMobile?"medium":"large",onClick:u.onBuy},{default:g((()=>[v(h(e.$t("t.buy")),1)])),_:1},8,["size","onClick"])):d("",!0),m(w,{class:"primary",size:e.isMobile?"medium":"large",onClick:u.onDeposit},{default:g((()=>[v(h(e.$t("t.deposit")),1)])),_:1},8,["size","onClick"])]),e.isExpressBuyEntryAllowed?(n(),r("div",Ac,h(e.$t("wallets.overview.empty.note")),1)):d("",!0)],2)):(n(),r(p,{key:1},[m(D,{class:"assets-tabs",list:u.tabList,onClick:u.tabClick},null,8,["list","onClick"]),f(y("div",bc,[m(A,{class:"asset-list",onHoverEnter:t[0]||(t[0]=e=>o.donutHoverIndex=e),onHoverLeave:t[1]||(t[1]=e=>o.donutHoverIndex=null)}),y("div",_c,[m(b,{data:u.walletsChartData,scaleColors:u.walletsColorList,isShowLegend:!1,width:260,percentageRound:0,hasSort:!1,hoverTrigger:o.donutHoverIndex,tooltipType:"center"},{tooltipCenter:g((({info:e})=>
1[y("div",Sc,[y("div",Cc,[y("div",Lc,h(e.name),1),y("div",Ec,h(e.displayPercentage)+"%",1)]),y("div",Ic,h(u.shortFormatNumber(e.value)),1),y("div",kc,h(l.displayCurrency),1)])])),_:1},8,["data","scaleColors","hoverTrigger"])])],512),[[T,o.tabShow===o.ASSETS_TAB.wallets]]),f(y("div",Rc,[y("div",Nc,[m(_,{dataList:o.computedCoinsData,colorList:o.coinsColorList,currency:l.displayCurrency},null,8,["dataList","colorList","currency"])]),y("div",xc,[0===u.assetMax6Length.length?(n(),i(S,{key:0,width:220,height:220})):(n(),i(b,{key:1,data:u.assetMax6Length,scaleColors:o.coinsColorList,isShowLegend:!1,width:260,percentageRound:0,tooltipType:"center",onUpdateComputedData:u.updateComputedCoinsData},{tooltipCenter:g((({info:e})=>[y("div",Pc,[y("div",Oc,[y("div",$c,h(e.name),1),y("div",Wc,h(e.displayPercentage)+"%",1)]),y("div",Fc,h(u.shortFormatNumber(e.value)),1),y("div",Bc,h(l.displayCurrency),1)])])),_:1},8,["data","scaleColors","onUpdateComputedData"]))])],512),[[T,o.tabShow===o.ASSETS_TAB.coins]])],64))])),[[E,u.isLoading]])}],["__scopeId","data-v-9f48e775"]]),Mc={class:"overview-pnl-content"},Vc={class:"header"},Hc={class:"header-title"},Gc={class:"header-info"},Yc={class:"currency"},qc={class:"wallets"},zc={class:"left"},Kc={class:"pattern"},jc={class:"name"},Xc={class:"right"},Qc={class:"balance-wrap"},Zc={class:"currency"},Jc=vr(E({__name:"PnlAnalysisContent",setup(e){const{enableWalletSpot:t,enableWalletFutures:a,enableWalletEarn:l}=Ge,{t:o}=I(),u=Ut(),{lang:c,hideWalletPriceValue:d,accountInfo:v,accountCurrency:T}=S(u),w=Yt(),{isChristmasEventActive:D,isLunarNewYearEventActive:b}=S(w),_=ze(),{displayCurrency:E}=S(_),k=ra(),{pnlData:W}=S(k),{fetchPnlTrendData:F}=k,B=pt(),{isEnableAutoTraderWallet:U}=S(B),M=ct(),{isEnableCopyTradingWallet:V}=S(M),H=ot(),{isEnableAiCopyTradingWallet:G}=S(H),Y=rt(),{isEnableFuturesBotsWallet:q}=S(Y),z=O(!0),K=O(7),j=R((()=>[{title:o("wallets.overview.tabs.days7"),days:7},{title:o("wallets.overview.tabs.days30"),days:30}]));function X(e){return{name:e,params:{lang:c.value}}}const Q=R((()=>{const e=[];return t&&e.push({icon:Qe,name:o("t.spot"),price:ee(Ye.SPOT),route:X(Ke.WALLET_SPOT_PNL_ANALYSIS)}),a&&e.push({icon:Ze,name:o("t.futures"),price:ee(Ye.FUTURES),route:X(Ke.WALLET_FUTURES_PNL_ANALYSIS)}),U.value&&e.push({icon:Je,name:o("nav.autoTrader"),price:ee(Ye.AUTO_TRADER),route:X(Ke.WALLET_AUTO_TRADER_PNL_ANALYSIS)}),V.value&&e.push({icon:it,name:o("trading.copyTrading"),price:ee(Ye.COPY_TRADING),route:X(Ke.WALLET_COPY_TRADING_PNL_ANALYSIS)}),G.value&&e.push({icon:st,name:o("nav.aiCopyTrading"),price:ee(Ye.AI_COPY_TRADING),route:X(Ke.WALLET_AI_COPY_TRADING_PNL_ANALYSIS)}),q.value&&e.push({icon:et,name:o("nav.futuresBots"),price:ee(Ye.FUTURES_BOTS),route:X(Ke.WALLET_FUTURES_BOTS_PNL_ANALYSIS)}),l&&e.push({icon:tt,name:o("wallets.overview.pnlAnalysis.earn"),price:ee(Ye.EARN),route:X(Ke.WALLET_EARN_REWARD_ANALYSIS)}),e})),Z=R((()=>N.sum(...Q.value.map((e=>e.price))).toNumber()));function J(e){const[t,a]=ua({rangeSize:e,nowDateOffset:-1});return[t.getTime(),a.getTime()]}function ee(e){const[t,a]=J(K.value),{map:l,timestampList:s}=W.value[e],i=s.findIndex((e=>t<=e)),n=oa(s,(e=>e<=a))+1;return-1===i||0===n?0:s.slice(i,n).reduce(((e,t)=>N(e).plus(l[t].value).toNumber()),0)}function te(e){K.value=j.value[e].days}function ae(e,t=!1){if(d.value)return t?D.value?"ðððððððð":b.value?"ð§§ð§§ð§§ð§§ð§§ð§§ð§§ð§§":qe:qe;const a=e||0,l=a<0?"- ":a>0?"+ ":" ";return function(e,t){if(e>=1e7)return Xt(e,{formatKey:"max4",compact:!0,prefix:t});return Xt(e,{prefix:t,currency:T.value})}(Math.abs(a),l)}return $([E,()=>{var e;return null==(e=v.value)?void 0:e.uid},K],(([e])=>{e&&async function(){try{z.value=!0;const[e,t]=J(K.value);await F({type:"overview",fromTimestamp:e,toTimestamp:t})}catch(e){}finally{z.value=!1}}()}),{immediate:!0}),(e,t)=>{const a=s("RouterLink"),l=C("loading");return n(),r("div",Mc,[m(P(aa),{class:"days-tabs",list:j.value,onClick:te},null,8,["list"]),f((n(),r("div",Vc,[y("div",Hc,h(e.$t("router.walletOverview")),1),y("div",Gc,[y("div",{class:L(["num",{"positive-dark":!P(d)&&Z.value>0,negative:!P(d)&&Z.value<0}])},h(ae(Z.value,!0)),3),y("div",Yc,h(P(E)),1)])])),[[l,z.value]]),f((n(),r("div",qc,[(n(!0),r(p,null,x(Q.value,(e=>(n(),i(a,{key:e.name,class:"wallets-item",to:e.route},{default:g((()=>[y("div",zc,[y("div",Kc,[(n(),i(A(e.icon),{class:"icon"}))]),y("div",jc,h(e.name),1)]),y("div",Xc,[y("div",Qc,[y("div",{class:L(["num",{positive:!P(d)&&e.price>0,negative:!P(d)&&e.price<0}])},h(ae(e.price)),3),y("div",Zc,h(P(E)),1)]),m(ht,{class:"go-to-icon"})])])),_:2},1032,["to"])))),128))])),[[l,z.value]])])}}}),[["__scopeId","data-v-2b311819"]]),ed={class:"pnl-filter"},td={class:"dates"};const ad=vr({name:"WalletPnLDateRange",components:{BrandButton:ha,DateRangePickerV2:ya,DateRangePickerDialog:pa,IconCalendar:da,IconChevronDown:ca},props:{dateRange:{type:Object,default:()=>({start:new Date,end:new Date})}},emits:["update:dateRange"],data:()=>({minDurationToNow:{days:179},maxDurationToNow:{days:1},rangeLimitDuration:{days:31},range7:ua({rangeSize:7,nowDateOffset:-1}),range30:ua({rangeSize:30,nowDateOffset:-1}),showDatePickerDialog:!1}),computed:{dateRangeRef:{get(){return this.dateRange},set(e){this.$emit("update:dateRange",e)}},rangeNum(){const{start:e,end:t}=this.dateRangeRef;return va([e,t],this.range7)?7:va([e,t],this.range30)?30:0}},methods:{setRangeDate(e=7){const[t,a]=ua({rangeSize:e,nowDateOffset:-1});this.dateRangeRef={start:t,end:a}},openDatePickerDialog(){this.showDatePickerDialog=!0}}}
1,[["render",function(e,t,a,l,o,u){const c=s("BrandButton"),p=s("DateRangePickerV2"),f=s("IconCalendar"),T=s("IconChevronDown"),w=s("DateRangePickerDialog");return n(),r("div",ed,[m(c,{type:"detail",class:L(["darker-text",{actived:7===u.rangeNum}]),onClick:t[0]||(t[0]=e=>u.setRangeDate(7))},{default:g((()=>[v(h(e.$t("wallets.spot.pnl.lastDays",{days:"7"})),1)])),_:1},8,["class"]),m(c,{type:"detail",class:L(["darker-text",{actived:30===u.rangeNum}]),onClick:t[1]||(t[1]=e=>u.setRangeDate(30))},{default:g((()=>[v(h(e.$t("wallets.spot.pnl.lastDays",{days:"30"})),1)])),_:1},8,["class"]),e.isMobile?(n(),r("div",{key:1,class:"date-range-wrapper",onClick:t[5]||(t[5]=(...e)=>u.openDatePickerDialog&&u.openDatePickerDialog(...e))},[m(f,{class:"icon-calendar"}),y("div",td,[y("span",null,h(e.$filters.formatDate(u.dateRangeRef.start,"yyyy-MM-dd")),1),t[6]||(t[6]=y("span",null,"-",-1)),y("span",null,h(e.$filters.formatDate(u.dateRangeRef.end,"yyyy-MM-dd")),1)]),m(T,{class:"arrow"}),o.showDatePickerDialog?(n(),i(w,{key:0,showDatePickerDialog:o.showDatePickerDialog,"onUpdate:showDatePickerDialog":t[3]||(t[3]=e=>o.showDatePickerDialog=e),dateRange:u.dateRangeRef,"onUpdate:dateRange":t[4]||(t[4]=e=>u.dateRangeRef=e),minDurationToNow:o.minDurationToNow,maxDurationToNow:o.maxDurationToNow,rangeLimitDuration:o.rangeLimitDuration,hideDaysPanel:""},null,8,["showDatePickerDialog","dateRange","minDurationToNow","maxDurationToNow","rangeLimitDuration"])):d("",!0)])):(n(),i(p,{key:0,dateRange:u.dateRangeRef,"onUpdate:dateRange":t[2]||(t[2]=e=>u.dateRangeRef=e),minDurationToNow:o.minDurationToNow,maxDurationToNow:o.maxDurationToNow,rangeLimitDuration:o.rangeLimitDuration,hideDaysPanel:"",class:"date-picker"},null,8,["dateRange","minDurationToNow","maxDurationToNow","rangeLimitDuration"]))])}],["__scopeId","data-v-576182d0"]]);function ld({max:e=0,min:t=0,interval:a=8,isAbsInterval:l=!1}){if("number"!=typeof e||"number"!=typeof t)return Array(a).fill().map(((e,t)=>t));if("number"!=typeof a||a<2)return Array(a).fill().map(((e,t)=>t));let s=N(e).minus(t);s.eq(0)&&(l=!0,s=0===e?s.plus(100):s.plus(N(e).abs().div(10)));const i=function(e,t=6){const a=N(10).pow(t),l=N(e).times(a).toFixed(0,N.ROUND_UP).split("").map((e=>Number(e)));for(let s=l.length-1;s>0;s--)l[s]>0&&l[s-1]++,l[s]=0;return l[0]=function(e){if("number"!=typeof e||e<0||e>10)return 0;return e<=2?Math.ceil(e):e<=5?5:10}(l[0]),N(l.join("")).div(a).toNumber()}(s.div(a-1).toNumber()),n=function(e,t){if("number"!=typeof t||t<=0)return 0;return Math.floor(e/t)*t}(t,i);let r=Array(a).fill().map(((e,t)=>N(n).plus(N(i).times(t)).toNumber()));if(!l){const t=r[r.length-1];if(t<e)r.push(N(t).plus(i).toNumber());else{const t=e+i;r=r.filter((e=>e<=t))}}return r}const sd=(e=[])=>{const t=e.map((e=>Ia(e,"500 12px sans-serif")));return Math.max(...t,0)},id={name:"TrendChartTwoLine",components:{IconLoadingPulse:fa},props:{isLoading:{type:Boolean,default:!1},height:{type:Number,default:400},marginTop:{type:Number,default:20},marginRight:{type:Number,default:10},marginBottom:{type:Number,default:40},marginLeft:{type:Number,default:10},dataList:{type:Array,default:()=>[]},y1Map:{type:Function,default:e=>e.value1},y1AxisTickFormat:{type:Function,default:e=>e},y2Map:{type:Function,default:e=>e.value2},y2AxisTickFormat:{type:Function,default:e=>e},xMap:{type:Function,default:e=>e.label},xAxisTickFormat:{type:Function,default:e=>e},xLeftOffset:{type:Number,default:0},xRightOffset:{type:Number,default:0},xAxisTickPadding:{type:Number,default:8},xAxisTickInterval:{type:Number,default:5},xPadding:{type:Number,default:.1},line1Color:{type:String,default:ga["--app--color--accent-teal-dark"]},line2Color:{type:String,default:ga["--app--color--primary-light"]}},emits:["tooltipInfoUpdate"],data(){const e=_a("svg");return{width:640,svg:e,xAxis:e.append("g"),y1Axis:e.append("g"),y2Axis:e.append("g"),tooltipInfo:{},y1AxisTickWidth:0,y2AxisTickWidth:0}},computed:{y1List(){return this.dataList.map(this.y1Map)},y1Max(){return Ea(this.y1List)},y1Min(){return La(this.y1List)},y1TickValues(){return ld({max:this.y1Max,min:this.y1Min,interval:10})},y1Scale(){return Ca().domain([this.y1TickValues[0],this.y1TickValues[this.y1TickValues.length-1]]).range([this.height-this.marginBottom,this.marginTop])},y2List(){return this.dataList.map(this.y2Map)},y2Max(){return Ea(this.y2List)},y2Min(){return La(this.y2List)},y2TickValues(){return ld({max:this.y2Max,min:this.y2Min,interval:this.y1TickValues.length,isAbsInterval:!0})},y2Scale(){return Ca().domain([this.y2TickValues[0],this.y2TickValues[this.y2TickValues.length-1]]).range([this.height-this.marginBottom,this.marginTop])},xList(){return this.dataList.map(this.xMap)},xScale(){const e=this.marginLeft+this.y1AxisTickWidth+this.xLeftOffset,t=this.width-this.marginRight-this.y2AxisTickWidth-this.xRightOffset;return Sa().domain(Ta(this.dataList.length)).range([e,t]).padding(this.xPadding)}},watch:{dataList:{deep:!0,handler(){this.reset(),this.drawLineChart()}},tooltipInfo(e){this.$emit("tooltipInfoUpdate",e)}},mounted(){this.drawLineChart(),window.addEventListener("resize",this.resizeHandler)},beforeUnmount(){window.removeEventListener("resize",this.resizeHandler)},methods:{drawLineChart(){this.width=this.$refs.container.offsetWidth,this.$refs.chart.appendChild(this.svg.node()),this.svg.attr("width",this.width).attr("height",this.height).attr("viewBox",[0,0,this.width,this.height]).attr("style","width: 100%; height: auto;"),this.setYScale(),this.drawAxis1Y(),this.drawAxis2Y(),this.drawAxisX(),this.drawLine({yMap:e=>this.y1Scale(this.y1List[e]),color:this.line1Color}),this.drawLine({yMap:e=>this.y2Scale(this.y2List[e]),color:this.line2Color}),this.drawHoverMask()},reset(){this.$refs.chart.innerHTML="";const e=_a("svg");this.svg=e,this.y1Axis=e.append("g"),this.y2Axis=e.append("g"),this.xAxis=e.append("g")},resizeHandler:ma((function(){const{chart:e,container:t,tooltip:a}=this.$refs;e&&t&&a&&(this.reset(),this.drawLineChart())}),200),setYScale(){this.y1Axis.call(Gr(this.y1Scale).tickValues(this.y1TickValues).tickFormat(this.y1AxisTickFormat));const e=[];this.y1Axis.selectAll(".tick text").each((function(){const t=wa(this);e.push(t.node().textContent)})),this.y1AxisTickWidth=sd(e),this.y2Axis.call(Yr(this.y2Scale).tickValues(this.y2TickValues).tickFormat(this.y2AxisTickFormat));const t=[];this.y2Axis.selectAll(".tick text").each((function(){const e=wa(this);t.push(e.node().textContent)})),this.y2AxisTickWidth=sd(t)},drawAxis1Y(){const e=this.marginLeft+this.y1AxisTickWidth;this.y1Axis.attr("transform",`translate(${e},0)`),this.y1Axis.selectAll(".domain").remove(),this.y1Axis.selectAll(".tick text").attr("class","y-axis-text").attr("style",`color: ${this.line1Color}`);const t=this.width-e-this.y2AxisTickWidth-this.marginRight;this.y1Axis.selectAll(".tick line").attr("x2",t).attr("class","y-axis-tick")},drawAxis2Y(){const e=this.width-this.y2AxisTickWidth-this.marginRight;this.y2Axis.attr("transform",`translate(${e},0)`),this.y2Axis.selectAll(".domain").remove(),this.y2Axis.selectAll(".tick line").remove(),this.y2Axis.selectAll(".tick text").attr("class","y-axis-text").attr("style",`color: ${this.line2Color}`)},drawAxisX(){this.xAxis.call(Hr(this.xScale).tickValues(this.generateInterval(this.dataList.length,this.xAxisTickInterval)).tick
1Format((e=>this.xAxisTickFormat(this.xList[e]))).tickPadding([this.xAxisTickPadding])),this.xAxis.attr("transform",`translate(0,${this.height-this.marginBottom})`),this.xAxis.selectAll(".domain").remove(),this.xAxis.selectAll(".tick line").remove(),this.xAxis.selectAll(".tick text").attr("class","x-axis-text")},drawLine({yMap:e,color:t}){const a=Aa().curve(ba).x((e=>this.xScale(e))).y(e);this.svg.append("path").attr("fill","none").attr("stroke",t).attr("stroke-width",3).attr("stroke-linecap","round").attr("stroke-linejoin","round").attr("stroke-opacity",.6).attr("d",a(Ta(this.dataList.length)))},drawHoverMask(){const e=this.dataList.length,[t,a]=this.xScale.range(),[l,s]=this.y1Scale.range(),i=(a-t)/e,n=l-s+10,r=this.svg.append("g").selectAll().data(Ta(e)).join("g").style("opacity",0);r.append("line").attr("stroke",ga["--app--color--primary"]).attr("stroke-width",2).attr("stroke-dasharray","6, 5").attr("stroke-opacity",.5).attr("x1",((e,t)=>this.xScale(t))).attr("y1",this.marginTop-10).attr("x2",((e,t)=>this.xScale(t))).attr("y2",this.marginTop+n),r.append("rect").attr("x",((e,t)=>this.xScale(t)-i/2)).attr("y",this.marginTop-10).attr("height",n).attr("width",i).attr("fill","transparent");const o=this,u=this.$refs.tooltip;r.on("mouseover mousemove",(function(e){const t=wa(this),a=t.datum();o.tooltipInfo=o.dataList[a],t.style("opacity",1);const[[l,s]]=Da(e),{offsetWidth:i,offsetHeight:n}=o.$refs.container,r=i/o.width;u.style.visibility="visible",u.style.left=l*r-120+"px",u.style.bottom=`${s*r*-1+n+30}px`})).on("mouseout",(function(){wa(this).style("opacity",0),u.style.visibility="hidden"}))},generateInterval(e,t=7){const a=[];if(0===e)return a;
1if(t===1/0)return 1===e?[0]:[0,e-1];const l=Math.floor(e/t);for(let s=0;s<e;s++)0!==s&&0!==l&&s%l!==0||a.push(s);return a}}},nd={ref:"container",class:"container"},rd={ref:"chart",class:"trend-chart"},od={ref:"tooltip",class:"trend-tooltip"},ud={key:0,class:"loading-cover"},cd={class:"loading-icon-container"};const dd=vr(id,[["render",function(e,t,a,l,i,u){const c=s("IconLoadingPulse");return n(),r("div",nd,[y("div",rd,null,512),y("div",od,[o(e.$slots,"tooltip",{info:i.tooltipInfo},void 0,!0)],512),a.isLoading?(n(),r("div",ud,[y("div",cd,[m(c)])])):d("",!0)],512)}],["__scopeId","data-v-603d653c"]]),pd={class:"overview-net-pnl-content"},yd={key:0,class:"tooltip-wrap fixed-top"},hd={class:"tooltip-body"},vd={class:"info-div"},md={class:"info-content"},gd={class:"name"},fd={class:"currency value-pair"},Td={class:"unit"},wd={key:0,class:"tooltip-wrap hover"},Dd={class:"info-date"},Ad={class:"name"},bd={class:"currency value-pair"},_d={class:"unit"},Sd={class:"chart-legend"},Cd={class:"legend-item"},Ld={class:"legend-name"},Ed={class:"legend-item"},Id={class:"legend-name"},kd=vr(E({__name:"NetAndPnlContent",setup(e){const{enableWalletSpot:t,enableWalletFutures:a,enableWalletEarn:l}=Ge,{t:s}=I(),{isMobile:i,isLargeSize:o}=ka(),u=Ut(),{hideWalletPriceValue:c,accountInfo:v,getCurrencySymbol:w}=S(u),D=ra(),{pnlData:A}=S(D),{fetchPnlTrendData:b,fetchAssetNetWorth:_}=D,C=pt(),{isEnableAutoTraderWallet:E}=S(C),k=ct(),{isEnableCopyTradingWallet:W}=S(k),F=ot(),{isEnableAiCopyTradingWallet:B}=S(F),U=rt(),{isEnableFuturesBotsWallet:M}=S(U),V=ze(),{displayCurrency:H}=S(V),G=O(null),[Y,q]=ua({rangeSize:7,nowDateOffset:-1}),z=O({start:Y,end:q}),K=new Date("2022-12-13"),j=O(!0),X=O({}),Q=R((()=>{const e=z.value.start.getTime(),t=z.value.end.getTime(),{timestampList:a}=A.value.assetNetWorth.spot,l=a.findIndex((t=>e<=t)),s=oa(a,(e=>e<=t))+1;if(-1===l||0===s)return[];const i=A.value.assetNetWorth.spot.map,n=A.value.assetNetWorth.futuresAll.map,r=A.value.spot.map,o=A.value.futures.map,u=A.value.autoTrader.map,c=A.value.copyTrading.map,d=A.value.aiCopyTrading.map,p=A.value.futuresBots.map,y=A.value.earn.map,h={[Ye.SPOT]:0,[Ye.FUTURES]:0,[Ye.AUTO_TRADER]:0,[Ye.COPY_TRADING]:0,[Ye.AI_COPY_TRADING]:0,[Ye.FUTURES_BOTS]:0,[Ye.EARN]:0};return a.slice(l,s).map((e=>{var t,a,l,s,v,m,g,f,T;h[Ye.SPOT]=N(h[Ye.SPOT]).plus((null==(t=r[e])?void 0:t.value)||0).toNumber(),h[Ye.FUTURES]=N(h[Ye.FUTURES]).plus((null==(a=o[e])?void 0:a.value)||0).toNumber(),E.value&&(h[Ye.AUTO_TRADER]=N(h[Ye.AUTO_TRADER]).plus((null==(l=u[e])?void 0:l.value)||0).toNumber()),W.value&&(h[Ye.COPY_TRADING]=N(h[Ye.COPY_TRADING]).plus((null==(s=c[e])?void 0:s.value)||0).toNumber()),B.value&&(h[Ye.AI_COPY_TRADING]=N(h[Ye.AI_COPY_TRADING]).plus((null==(v=d[e])?void 0:v.value)||0).toNumber()),M.value&&(h[Ye.FUTURES_BOTS]=N(h[Ye.FUTURES_BOTS]).plus((null==(m=p[e])?void 0:m.value)||0).toNumber()),h[Ye.EARN]=N(h[Ye.EARN]).plus((null==(g=y[e])?void 0:g.value)||0).toNumber();const w=N((null==(f=i[e])?void 0:f.value)||0).plus((null==(T=n[e])?void 0:T.value)||0).toNumber();return{net:w,...h,label:e,value1:w,value2:N.sum(...Object.values(h)).toNumber()}}))})),Z=R((()=>Math.max(...Q.value.map((e=>Math.abs(e.value1)))))),J=R((()=>Math.max(...Q.value.map((e=>Math.abs(e.value2)))))),ee=R((()=>[{name:s("wallets.overview.assetTrend.title"),key:"value1"},{name:s("wallets.overview.totalProfit"),key:"value2"},{name:s("t.spot"),key:Ye.SPOT,isChild:!0,disabled:!t},{name:s("t.futures"),key:Ye.FUTURES,isChild:!0,disabled:!a},{name:s("nav.autoTrader"),key:Ye.AUTO_TRADER,isChild:!0,disabled:!E.value},{name:s("trading.copyTrading"),key:Ye.COPY_TRADING,isChild:!0,disabled:!W.value},{name:s("nav.aiCopyTrading"),key:Ye.AI_COPY_TRADING,isChild:!0,disabled:!B.value},{name:s("nav.futuresBots"),key:Ye.FUTURES_BOTS,isChild:!0,disabled:!M.value},{name:s("wallets.earn"),key:Ye.EARN,isChild:!0,disabled:!l}].filter((e=>!e.disabled)))),te=R((()=>w.value(H.value)));async function ae(){try{await Promise.all([_({type:Ye.SPOT,fromTimestamp:z.value.start.getTime(),toTimestamp:z.value.end.getTime()}),_({type:"futuresAll",fromTimestamp:z.value.start.getTime(),toTimestamp:z.value.end.getTime()})])}catch(e){return Promise.reject(e)}}async function le(){try{await b({type:"overview",fromTimestamp:z.value.start.getTime(),toTimestamp:z.value.end.getTime()})}catch(e){return Promise.reject(e)}}function se(e){return Ra(e,"MM-dd")}function ie(e){return t=>{if(c.value)return qe;let a;return a=i.value&&e>=1e7?{formatKey:"max3",compact:!0,currency:H.value??void 0}:{formatKey:2,currency:H.value??void 0},Xt(t,a)}}function ne(e){if(c.value)return qe;const t=e||0,a=t<0?`-${te.value} `:t>0?`+${te.value} `:`${te.value} `;return Xt(Math.abs(t),{prefix:a,currency:H.value??void 0})}function re(e){X.value=e}return $([H,()=>{var e;return null==(e=v.value)?void 0:e.uid},z],(([e])=>{e&&async function(){try{j.value=!0,await Promise.all([le(),ae()])}catch(e){}finally{j.value=!1,X.value={}}}()}),{immediate:!0}),$(c,(()=>{var e,t;null==(e=G.value)||e.reset(),null==(t=G.value)||t.drawLineChart()})),(e,t)=>(n(),r("div",pd,[m(ad,{dateRange:z.value,"onUpdate:dateRange":t[0]||(t[0]=e=>z.value=e),class:"date-range",startLogDate:P(K)},null,8,["dateRange","startLogDate"]),P(i)?(n(),r("div",yd,[t[1]||(t[1]=y("hr",{class:"horizontal-line"},null,-1)),y("div",hd,[f(y("div",{class:"info-date"},h(se(X.value.label)),513),[[T,X.value.label]]),f(y("div",vd,null,512),[[T,X.value.label]]),y("div",md,[(n(!0),r(p,null,x(ee.value,(e=>(n(),r("div",{key:e.name,class:L(["info-item",{child:e.isChild}])},[y("div",gd,h(e.name),1),y("div",fd,[y("span",{class:L(["value",{positive:!P(c)&&(X.value[e.key]??0)>0,negative:!P(c)&&(X.value[e.key]??0)<0}])}
1,h(ne(X.value[e.key])),3),y("span",Td,h(P(H)),1)])],2)))),128))])])])):d("",!0),m(dd,{ref_key:"trendChart",ref:G,isLoading:j.value,dataList:Q.value,height:420,marginTop:40,xPadding:.3,xAxisTickInterval:P(o)?5:1/0,xAxisTickFormat:se,xAxisTickPadding:20,y1AxisTickFormat:ie(Z.value),y2AxisTickFormat:ie(J.value),onTooltipInfoUpdate:re},{tooltip:g((({info:e})=>[P(o)?(n(),r("div",wd,[y("div",Dd,h(se(e.label)),1),t[2]||(t[2]=y("hr",{class:"horizontal-line"},null,-1)),(n(!0),r(p,null,x(ee.value,(t=>(n(),r("div",{key:t.name,class:L(["info-item",{child:t.isChild}])},[y("div",Ad,h(t.name),1),y("div",bd,[y("span",{class:L(["value",{positive:!P(c)&&e[t.key]>0,negative:!P(c)&&e[t.key]<0}])},h(ne(e[t.key])),3),y("span",_d,h(P(H)),1)])],2)))),128))])):d("",!0)])),_:1},8,["isLoading","dataList","xAxisTickInterval","y1AxisTickFormat","y2AxisTickFormat"]),y("div",Sd,[y("div",Cd,[t[3]||(t[3]=y("div",{class:"dot green"},null,-1)),y("div",Ld,h(e.$t("wallets.overview.assetTrend.title")),1)]),y("div",Ed,[t[4]||(t[4]=y("div",{class:"dot blue"},null,-1)),y("div",Id,h(e.$t("wallets.overview.totalProfit")),1)])])]))}}),[["__scopeId","data-v-fcc50c20"]]),Rd={name:"WalletOverviewRecentTransactionList",components:{NoDataAvailable:Zt,CoinIcon:Pa,IconHourGlass:xa,IconError:Na},emits:["onHistoryLoaded"],data:()=>({MASK_PLACEHOLDER_8:qe,ROUTE_NAME:Ke,transactions:{isLoading:!0,data:[]}}),computed:{...l(["lang","currencyMap","accountInfo","hideWalletPriceValue"]),...t(["isArabic"]),isEmpty(){return 0===this.transactions.data.length}},watch:{accountInfo(e,t){e.uid&&e.uid!==t.uid&&this.getRecentTransactions()}},beforeMount(){this.getRecentTransactions()},methods:{async getRecentTransactions(){try{this.transactions.isLoading=!0;const e=Date.now(),t=await Oa.getTransactionHistory({historyTypes:"DEPOSIT,WITHDRAW,TRANSFER,VESTING",asset:"ALL",fromTimestamp:F(B(new Date(e)),{days:7}).getTime(),toTimestamp:W(new Date(e)).getTime(),pageSize:5,currentPage:1});this.transactions.data=t.data.map((({id:e,asset:t,historyType:a,date:l,netAmount:s,status:i})=>{const{isFiat:n=!1,stableCoin:r=!1,displayName:o}=this.currencyMap[t]||{};return{id:e,asset:t,historyType:a,date:l,netAmount:s,status:i,isFiat:n,isStableCoin:r,displayName:o}})),this.$emit("onHistoryLoaded",this.transactions.data.length>0)}catch(e){}this.transactions.isLoading=!1},statusDisplay(e){switch(e){case"PENDING":case"PROCESSING":return"loading";case"DECLINED":return"error";default:return null}},valueFormatter(e){const{netAmount:t,isFiat:a,asset:l}=e;if(null===t)return"";const s=Number(t)||0;return a?s>1e8?this.$filters.formatNumber(s,{formatKey:"default",currency:l}):this.$filters.formatNumber(s,{formatKey:"fc",currency:l}):this.$filters.formatNumber(s,{isDynamicDecimal:!0,currency:l})}}},Nd={class:"recent-transactions"},xd={class:"center"},Pd={class:"type"},Od={class:"coin"},$d={class:"date"},Wd={class:"right"},Fd={class:"price"},Bd={class:"status"};const Ud=vr(Rd,[["render",function(e,t,a,l,o,u){const c=s("NoDataAvailable"),T=s("RouterLink"),w=s("CoinIcon"),D=s("IconHourGlass"),A=s("IconError"),b=C("loading");return f((n(),r("div",Nd,[u.isEmpty?(n(),r("div",{key:0,class:L(["empty-container",{"is-loading":o.transactions.isLoading}])},[m(c,{class:"empty-icon",emptyText:e.$t("wallets.overview.recentTransactions.emptyTransaction")},null,8,["emptyText"]),m(T,{to:{name:o.ROUTE_NAME.WALLET_TRANSACTION_HISTORY,params:{lang:e.lang}},class:"history-link"},{default:g((()=>[v(h(e.$t("wallet.viewFullTransactionHistory")),1)])),_:1},8,["to"])],2)):(n(!0),r(p,{key:1},x(o.transactions.data,(t=>(n(),r("div",{key:t.id,class:"transaction"},[m(w,{showName:!1,size:"32",name:t.asset,type:t.isFiat?"fiat":"icon"},null,8,["name","type"]),y("div",xd,[y("div",Pd,h(t.historyType.toLowerCase()),1),y("div",Od,h(t.displayName||""),1),y("div",$d,[e.isArabic?(n(),r(p,{key:0},[v(h(e.$filters.formatDate(t.date,"yyyy-MM-dd")),1)],64)):(n(),r(p,{key:1},[v(h(e.$filters.formatDate(t.date)),1)],64))])]),y("div",Wd,[y("div",Fd,h(e.hideWalletPriceValue?o.MASK_PLACEHOLDER_8:u.valueFormatter(t)),1),y("div",Bd,[v(h(t.status.toLowerCase())+" ",1),"loading"===u.statusDisplay(t.status)?(n(),i(D,{key:0,class:"loading-icon icon"})):"error"===u.statusDisplay(t.status)?(n(),i(A,{key:1,class:"error-icon icon"})):d("",!0)])])])))),128))])),[[b,o.transactions.isLoading]])}],["__scopeId","data-v-72b455ee"]]),Md={data:()=>({actionResultType_mixin:"0",actionResultCode_mixin:"0"}),methods:{clearQueryParameter(){this.$router.replace(this.$route.path)},withdrawEmailConfirmCheck(){const e=this.$route.query.alerttype,t=this.$route.query.alertcode;return!(void 0===e||!t)&&(this.actionResultType_mixin=e,this.actionResultCode_mixin=t,this.clearQueryParameter(),!0)},sendToEmailConfirmCheck(){const{balance_audit_id:e,coin_id:t,type:a}=this.$route.query;e&&"confirm"===a&&(this.clearQueryParameter(),$a.getSpotWalletHistory({coinId:t,pageSize:20,pageNum:1}).then((({data:t})=>{const a=t.find((t=>t.auditId===e));a&&a.transactionType!==Wa.COMPLETED&&(this.sendToRecorder=_r({currency:a.currency,amount:a.amount,userName:a.bankRef,email:a.emailRef,id:a.auditId,status:a.status}),this.isShowSendToDialog=!0)})))}}},{captureEvent:Vd}=Ga(),{visible:Hd}=Bt,Gd={name:"MobileWalletOverview",components:{FullKycNotification:Ba,Card:xo,UnifiedWalletUpgradeBanner:Ko,WalletActions:Gu,WalletBalanceInfo:ic,MyAssetsContent:Uc,PnlAnalysisContent:Jc,NetAndPnlContent:kd,IconInfo2:Fa,IconChevronRight:ht,RecentTransactionList:Ud,WhichWalletActionView:Tr,ConvertDialog:De,WalletEmailConfirmResultDialog:Sr,SendToFlow:fr},data:()=>({...Md.data(),ROUTE_NAME:Ke,OVERVIEW_CURRENCY:la,RECENT_HISTORY_DAYS:7,actionType:null,currencyInfo:null,isShowSendToDialog:!1,sendToRecorder:null,isShowActionResultDialog:!1,isS
1howTransactionHistoryLink:!1}),computed:{...l(["hideWalletPriceValue","walletAction","lang","isInitialWalletInfoLoading"]),...t(["showWalletUpgradeBanner","isAccountInfoExist"]),...a(Ya,["isSupportedFiat"]),isToggleHidePriceVisible:()=>Hd.toggleHidePrice,isDeposit(){return this.actionType===It.DEPOSIT},isWithdraw(){return this.actionType===It.WITHDRAWAL},isShowConvertDialog(){return this.actionType===It.CONVERT}},watch:{isAccountInfoExist(e){e&&this.checkQueryString()},isInitialWalletInfoLoading(e){!e&&this.forceUpdate()},walletAction({action:e}){this.actionType=e},actionType(){switch(this.actionType){case It.TRANSFER:this.toggleTransferPopup(),this.handleCloseDialog();break;case It.SEND_TO:this.handleSendTo();break;case It.DEPOSIT:Va({entryChannel:Ha.walletOverview}),Vd("deposit_entrance",{entry_channel:"wallet_overview"})}}},created(){this.updateAllWallets(!0)},mounted(){this.refreshUserInfo(),this.withdrawEmailConfirmCheck()&&(this.isShowActionResultDialog=!0),this.sendToEmailConfirmCheck()},beforeUnmount(){this.removeAllTimer()},methods:{...Md.methods,...u(["getKycStatus","setWalletAction"]),...e(Mr,["toggleTransferPopup"]),...e(Ma,["forceUpdate"]),...e(Ht,["updateAllWallets","removeAllTimer"]),checkQueryString(){this.$route.query.actionType===It.DEPOSIT&&(this.actionType=this.$route.query.actionType)},refreshUserInfo(e){this.getKycStatus().then((()=>{e&&e()}))},handleCloseDialog(){this.actionType=null,this.clearStoreWalletAction()},clearStoreWalletAction(){this.setWalletAction({action:"",currencyType:this.isSupportedFiat?Ua.FIAT:Ua.CRYPTO,paymentWay:""})},handleSendTo(){this.sendToRecorder=Dr(),this.isShowSendToDialog=!0,this.handleCloseDialog()},closeActionResultDialog(){this.isShowActionResultDialog=!1},onHistoryLoaded(e){this.isShowTransactionHistoryLink=e}}},Yd={class:"mobile-wallet-overview"},qd={class:"card-title my-assets-title"},zd={class:"value-type"},Kd={class:"card-title"},jd={class:"card-title"},Xd={class:"recent-transaction-head"},Qd={class:"left"},Zd={class:"card-title recent-transactions-title"},Jd={key:0,class:"right"},ep={class:"pnl-note"};const tp=vr(Gd,[["render",function(e,t,a,l,o,u){const c=s("FullKycNotification"),f=s("UnifiedWalletUpgradeBanner"),T=s("WalletActions"),w=s("WalletBalanceInfo"),D=s("MyAssetsContent"),A=s("Card"),b=s("IconInfo2"),_=s("Tooltip"),S=s("PnlAnalysisContent"),C=s("NetAndPnlContent"),L=s("IconChevronRight"),E=s("RouterLink"),I=s("RecentTransactionList"),k=s("WhichWalletActionView"),R=s("ConvertDialog"),N=s("SendToFlow"),x=s("WalletEmailConfirmResultDialog");return n(),r(p,null,[m(c),y("div",Yd,[e.showWalletUpgradeBanner?(n(),i(f,{key:0})):d("",!0),m(A,{class:"card-item"},{default:g((()=>[m(T,{actionType:o.actionType,"onUpdate:actionType":t[0]||(t[0]=e=>o.actionType=e),type:"overview",class:"balance-actions"},null,8,["actionType"]),y("div",qd,h(e.$t("wallets.overview.myAssets.title")),1),m(w,{class:"balance-info",type:"overview"},{valueType:g((()=>[y("div",zd,h(e.$t("t.total")),1)])),_:1}),m(D)])),_:1}),m(A,{class:"card-item"},{default:g((()=>[y("div",Kd,[v(h(e.$t("wallets.overview.pnlAnalysis.title"))+" ",1),m(_,{placement:"right"},{content:g((()=>[m(b,{class:"info-icon"})])),tooltip:g((()=>[v(h(e.$t("wallets.overview.pnlAnalysis.tip")),1)])),_:1})]),m(S)])),_:1}),m(A,{class:"card-item"},{default:g((()=>[y("div",jd,[v(h(e.$t("wallets.overview.netAndPnl.title"))+" ",1),m(_,{placement:"right"},{content:g((()=>[m(b,{class:"info-icon"})])),tooltip:g((()=>[v(h(e.$t("wallets.overview.pnl.tip")),1)])),_:1})]),m(C)])),_:1}),m(A,{class:"card-item"},{default:g((()=>[y("div",Xd,[y("div",Qd,[y("div",Zd,[v(h(e.$t("wallets.overview.recentTransactions.title"))+" ",1),t[3]||(t[3]=y("br",null,null,-1)),v(" ("+h(e.$t("t.last.days",{day:o.RECENT_HISTORY_DAYS}))+") ",1)])]),o.isShowTransactionHistoryLink?(n(),r("div",Jd,[m(E,{to:{name:o.ROUTE_NAME.WALLET_TRANSACTION_HISTORY,params:{lang:e.lang}},class:"history-link day-mode"},{default:g((()=>[v(h(e.$t("wallets.overview.recentTransactions.historyLink"))+" ",1),m(L,{class:"history-link-icon"})])),_:1},8,["to"])])):d("",!0)]),m(I,{class:"transaction-list-container",onOnHistoryLoaded:u.onHistoryLoaded},null,8,["onOnHistoryLoaded"])])),_:1}),y("div",ep,[y("p",null,h(e.$t("wallets.overview.note1")),1),y("p",null,h(e.$t("wallets.overview.note2")),1),y("p",null,h(e.$t("wallets.overview.note3")),1)]),u.isDeposit||u.isWithdraw?(n(),i(k,{key:1,actionType:o.actionType,onClosed:u.handleCloseDialog},null,8,["actionType","onClosed"])):d("",!0),u.isShowConvertDialog?(n(),i(R,{key:2,closeDialog:u.handleCloseDialog},null,8,["closeDialog"])):d("",!0),o.isShowSendToDialog?(n(),i(N,{key:3,show:o.isShowSendToDialog,"onUpdate:show":t[1]||(t[1]=e=>o.isShowSendToDialog=e),record:o.sendToRecorder,"onUpdate:record":t[2]||(t[2]=e=>o.sendToRecorder=e)},null,8,["show","record"])):d("",!0),m(x,{show:o.isShowActionResultDialog,closeDialog:u.closeActionResultDialog,resultType:e.actionResultType_mixin,resultCode:e.actionResultCode_mixin},null,8,["show","closeDialog","resultType","resultCode"])])],64)}],["__scopeId","data-v-66191bde"]]),ap={class:"pnl-wrapper"},lp={class:"top-wrapper"},sp={class:"suffix"},ip={class:"pnl-value-wrap"},np={key:0,class:"symbol"},rp={key:1,class:"symbol"},op={class:"num"},up={class:"currency"},cp=vr({__name:"WalletPnlAnalysisSummary",props:{type:{type:String,required:!0},displayCurrency:{type:String,default:""},enableToPnlAnalysisButton:{type:Boolean,default:!1}},setup(e){function t(e){const[t,a]=ua({rangeSize:e,nowDateOffset:-1});return{fromTimestamp:t.getTime(),toTimestamp:a.getTime()}}const a=e,l=U(),s=Ut(),o=ze(),u=nt(),c=ra(),v=M(),m=V(),g=ka(),f=O(7),T=R((()=>a.type===Ye.EARN)),w=R((()=>-1===f.value)),D=R((()=>l.state.hideWalletPriceValue)),A=R((()=>s.accountCurrency)),b=R((()=>a.displayCurrency||A.value)),_=R((()=>T.value?qa("t.last.days"):qa("t.last.nDaysPnl"))),S=R((()=>
1{if(D.value)return 0;if(T.value&&w.value)return u.totalInterestInAccountCurrency;const{fromTimestamp:e,toTimestamp:l}=t(f.value),{map:s,timestampList:i}=c.pnlData[a.type],n=i.findIndex((t=>e<=t)),r=oa(i,(e=>e<=l))+1,o=i.slice(n,r);return 0===o.length?0:o.reduce(((e,t)=>N(e).plus(s[t].value).toFixed()),0)})),C=R((()=>N(S.value).gt(0))),E=R((()=>N(S.value).lt(0))),I=R((()=>{if(D.value)return qe;const e=o.getInversePrice(a.displayCurrency,A.value)||0,t=a.displayCurrency!==A.value&&e?N(S.value).div(e).toNumber():S.value,l=g.isMobile&&N(t).gte(1e7);return Xt(N(t).abs().toFixed(),{formatKey:l?"max3":null,compact:l,currency:b.value})}));function k(e){f.value=e}function x(){a.enableToPnlAnalysisButton&&v.push({name:za[a.type],params:{lang:l.state.lang},query:{...m.query}})}return $([()=>l.state.accountInfo.uid,f],(()=>c.fetchPnlTrendData({type:a.type,...t(f.value)})),{immediate:!0}),(t,a)=>(n(),r("div",ap,[y("div",lp,[y("span",{class:L(["value-type",{active:7===f.value}]),onClick:a[0]||(a[0]=e=>k(7))},h(t.$t(_.value,{day:7})),3),a[4]||(a[4]=y("span",{class:"split"},null,-1)),y("span",{class:L(["value-type",{active:30===f.value}]),onClick:a[1]||(a[1]=e=>k(30))},h(t.$t(_.value,{day:30})),3),T.value?(n(),r(p,{key:0},[a[3]||(a[3]=y("span",{class:"split"},null,-1)),y("span",{class:L(["value-type",{active:w.value}]),onClick:a[2]||(a[2]=e=>k(-1))},h(t.$t("t.total")),3),y("span",sp,h(t.$t("wallets.earn.interestEarned")),1)],64)):d("",!0)]),y("div",{class:L(["currency-wrapper",{"hover-white-bg":e.enableToPnlAnalysisButton}]),onClick:x},[y("div",ip,[y("span",{class:L(["pnl-value",{positive:C.value,negative:E.value}])},[D.value?d("",!0):(n(),r(p,{key:0},[C.value?(n(),r("span",np,"+")):E.value?(n(),r("span",rp,"-")):d("",!0)],64)),y("span",op,h(I.value),1)],2),y("span",up,h(b.value),1)]),e.enableToPnlAnalysisButton?(n(),i(ca,{key:0,class:"bar-arrow"})):d("",!0)],2)]))}},[["__scopeId","data-v-48054a8d"]]),dp={class:"balance"},pp={class:"currency"},yp=vr({__name:"WalletBalance",props:{type:{type:String,default:Ye.SPOT},availableSize:{type:String,default:"default"},assignAvailable:{type:[Number,String],default:null}},setup(e){const t=e,a=U(),l=Ut(),{isChristmasEventActive:s,isLunarNewYearEventActive:i}=S(Yt()),o=nt(),u=R((()=>a.state.hideWalletPriceValue)),c=R((()=>a.getters.getAccountValue)),d=R((()=>a.getters.futuresBalance)),p=R((()=>l.accountCurrency)),v=R((()=>o.totalBalanceInAccountCurrency)),m=R((()=>o.totalInterestInAccountCurrency)),g=R((()=>{switch(t.type){case Ye.SPOT:return c.value("availableInAccountCurrency");case Ye.FUTURES:return d.value("availableInAccountCurrency");case"earnTotalSubscribed":return v.value;case"earnTotalInterestEarned":return m.value;case Ye.AUTO_TRADER:case Ye.LEAD_TRADING:case Ye.COPY_TRADING:case Ye.AI_LEAD_TRADING:case Ye.AI_COPY_TRADING:case Ye.FUTURES_BOTS:case Ye.EARN:case"earnInterestEarned":return t.assignAvailable;default:return 0}})),f=R((()=>u.value?s.value?"ðððððððð":i.value?"ð§§ð§§ð§§ð§§ð§§ð§§ð§§ð§§":qe:void 0===g.value||null===g.value||Number.isNaN(g.value)?"-":"-"===g.value?g.value:Xt(g.value,{currency:p.value}))),T=R((()=>"small"===t.availableSize?"small-available":"available"));return(e,t)=>(n(),r("div",dp,[y("span",{class:L(T.value)},h(f.value),3),y("span",pp,h(p.value),1)]))}},[["__scopeId","data-v-8a203adf"]]),hp={name:"WalletDropDownList",props:{isShowList:{type:Boolean,default:!1},list:{type:Array,default:()=>[]},itemOnclickCallback:{type:Function,required:!0}},emits:["update:available"],mounted(){this.bindEvent()},unmounted(){this.removeEvent()},methods:{itemOnclicked(e){e&&this.updateDisplay(e),this.headerOnclicked()},updateDisplay(e){e.available&&this.$emit("update:available",e.available)},onClickOutside(e){this.isShowList&&this.$parent.$el&&!this.$parent.$el.contains(e.target)&&this.itemOnclickCallback()},bindEvent(){document.addEventListener("click",this.onClickOutside,!0)},removeEvent(){document.removeEventListener("click",this.onClickOutside)}}},vp={key:0,class:"list-wrap"},mp=["onClick"];const gp={key:0,class:"drop-down-wrap"};const fp=vr({name:"WalletDropDown",components:{IconChevronDown:Ka,WalletDropDownList:vr(hp,[["render",function(e,t,a,l,s,i){return a.isShowList?(n(),r("div",vp,[(n(!0),r(p,null,x(a.list,(e=>(n(),r("button",{key:e.name,class:"list-item",onClick:t=>a.itemOnclickCallback(e)}
1,h(e.name),9,mp)))),128))])):d("",!0)}],["__scopeId","data-v-28ef0c56"]])},props:{list:{type:Array,default:()=>[]},available:{type:Number,default:0}},emits:["update:available"],data:()=>({headerTitle:"",isShowList:!1}),watch:{list:{immediate:!0,handler(e){e&&e.length&&this.updateDisplay(e[0])}}},methods:{headerOnclicked(){this.isShowList=!this.isShowList},itemOnclicked(e){e&&this.updateDisplay(e),this.headerOnclicked()},updateDisplay(e){this.headerTitle=e.name,this.$emit("update:available",e.available)}}},[["render",function(e,t,a,l,i,u){const c=s("IconChevronDown"),p=s("WalletDropDownList");return a.list.length?(n(),r("div",gp,[y("button",{class:"header-button-wrap",onClick:t[0]||(t[0]=(...e)=>u.headerOnclicked&&u.headerOnclicked(...e))},[y("span",null,h(i.headerTitle),1),o(e.$slots,"prefix",{},void 0,!0),m(c,{class:L(["bar-arrow",i.isShowList?"bar-arrow-rotate":"bar-arrow-reset-rotate"])},null,8,["class"])]),m(p,{isShowList:i.isShowList,list:a.list,itemOnclickCallback:u.itemOnclicked},null,8,["isShowList","list","itemOnclickCallback"])])):d("",!0)}],["__scopeId","data-v-1ae44982"]]),Tp={class:"balance-wrapper"},wp={class:"top-wrapper"},Dp={class:"title"},Ap={class:"value-wrapper"},bp=vr({__name:"WalletBalanceWrapper",props:{type:{type:String,default:Ye.SPOT},title:{type:String,default:""},isShowHide:{type:Boolean,default:!0},assignAvailable:{type:[Number,String],default:null},availableSize:{type:String,default:""},dropdownList:{type:Array,default:()=>[]}},setup(e){const t=O(0);return(a,l)=>{const o=s("ToolTip");return n(),r("div",Tp,[y("div",wp,[m(fp,{available:t.value,"onUpdate:available":l[0]||(l[0]=e=>t.value=e),list:e.dropdownList},null,8,["available","list"]),m(o,{disable:e.type!==P(Ye).FUTURES},{content:g((()=>[y("span",Dp,h(e.title||a.$t("wallets.spotList.available")),1)])),tooltip:g((()=>[y("span",null,h(a.$t("wallets.futures.tooltip.availableBalance")),1)])),_:1},8,["disable"]),e.isShowHide?(n(),i(qt,{key:0})):d("",!0)]),y("div",Ap,[m(yp,{type:e.type,availableSize:e.availableSize,assignAvailable:0===e.dropdownList.length?e.assignAvailable:t.value},null,8,["type","availableSize","assignAvailable"])])])}}},[["__scopeId","data-v-56437d7e"]]);const _p=vr({name:"IconBulb",components:{Icon:Tt},props:{width:{type:[Number,String],default:20},height:{type:[Number,String],default:21}}},[["render",function(e,t,a,l,r,o){const u=s("Icon");return n(),i(u,{"aria-label":"Bulb Icon",width:a.width,height:a.height},{default:g((()=>t[0]||(t[0]=[y("path",{d:"M6.61734 15.75C6.36984 14.6891 5.25318 13.8216 4.79484 13.25C4.01 12.2694 3.51813 11.087 3.3759 9.83912C3.23366 8.5912 3.44684 7.32849 3.99089 6.19643C4.53493 5.06438 5.38771 4.10904 6.45097 3.44047C7.51424 2.77189 8.74475 2.41728 10.0007 2.41748C11.2567 2.41768 12.4871 2.77269 13.5502 3.4416C14.6132 4.11052 15.4657 5.06613 16.0094 6.19836C16.5531 7.33059 16.7659 8.59337 16.6232 9.84124C16.4806 11.0891 15.9883 12.2713 15.2032 13.2516C14.7448 13.8225 13.6298 14.69 13.3823 15.75H6.61651H6.61734ZM13.3332 17.4166V18.25C13.3332 18.692 13.1576 19.1159 12.845 19.4285C12.5325 19.7411 12.1085 19.9166 11.6665 19.9166H8.33318C7.89115 19.9166 7.46723 19.7411 7.15467 19.4285C6.84211 19.1159 6.66651 18.692 6.66651 18.25V17.4166H13.3332ZM10.8332 9.08748V5.74998L7.08318 10.7541H9.16651V14.0875L12.9165 9.08748H10.8332Z"},null,-1)]))),_:1,__:[0]},8,["width","height"])}]]),Sp="/static/img/CZRV8lp0.png",Cp="/static/img/EW5Boj3a.png",Lp={getAutoEarnAssetList:()=>ja.get("invest/auto-earn/products").then(Xa).catch(Qa),updateUserAutoEarnStatus:e=>ja.patch("invest/auto-earn",e),updateAutoEarnAllProductsStatus:e=>ja.patch("invest/auto-earn/products",e),updateAutoEarnProductSettings:e=>ja.patch("invest/auto-earn/product",e)},Ep={name:"AutoEarnEnableDialog",components:{BrandDialog:wt,BrandMessage:Ja,IconNotificationCheck:Za},emits:["handleOnClose"],data:()=>({ACCOUNT_ROUTER_NAME:Pt,Genre:tl,isLoading:!1,isAgreeTerms:!1}),computed:{...l(["isDefaultBrand","lang","accountInfo"]),isAutoEarnDisabled(){var e,t;return void 0!==(null==(e=this.accountInfo)?void 0:e.kycNotice)&&(null==(t=this.accountInfo)?void 0:t.kycNotice)!==el.displayNone},iconSrc(){return this.isDefaultBrand?Sp:Cp},moreInformationHref(){return gt(this.lang,"AUTO_EARN_FAQ")}},methods:{...u(["updateAccountInfo"]),onTermsAndConditions(){const e=this.$router.resolve({name:Ke.LEGAL_EARN_PRODUCTS,params:{lang:this.lang}});window.open(e.href,"_blank")},async onEnableAutoEarn(){this.isLoading=!0;try{await Lp.updateUserAutoEarnStatus({autoEarn:!0}),await this.updateAccountInfo(),this.$emit("handleOnClose",{isOpenSettingDialog:!0})}catch{}this.isLoading=!1},onClosed(){this.$emit("handleOnClose")}}},Ip={class:"notice-content"},kp={class:"content"},Rp=["src"],Np={class:"title"},xp={class:"description"},Pp=["href"],Op={class:"info-block"},$p={class:"info-block-item"},Wp={class:"info-block-item"},Fp={class:"note"};const Bp=vr(Ep,[["render",function(e,t,a,l,o,u){const c=s("RouterLink"),p=s("BrandMessage"),f=s("IconNotificationCheck"),T=s("i18n-t"),D=s("Checkbox"),A=s("BaseButton"),b=s("BrandDialog");return n(),i(b,{class:"auto-earn-enable-dialog",width:"560px",fullStyle:e.isMobile,isBrandNewStyle:"",onClosed:u.onClosed},{header:g((()=>[v(h(e.$t("earn.autoEarn")),1)])),body:g((()=>[u.isAutoEarnDisabled?(n(),i(p,{key:0,genre:o.Genre.INFO},{default:g((()=>[y("div",Ip,[v(h(e.$t("fullKyc.verifyToUseFunction.notice"))+" ",1),m(c,{class:"kyc-verify-link",to:{name:o.ACCOUNT_ROUTER_NAME.VERIFICATION,params:{lang:e.lang}}},{default:g((()=>[v(h(e.$t("t.verify")),1)])),_:1},8,["to"])])])),_:1},8,["genre"])):d("",!0),y("div",kp,[y("img",{class:"icon",src:u.iconSrc},null,8,Rp),y("div",Np,h(e.$t("earn.autoEarn.enableDialog.title")),1),y("div",xp,h(e.$t("earn.autoEarn.enableDialog.description")),1),u.moreInformationHref?(n(),r("a",{key:0,class:"view-more-information",href:u.moreInformationHref,target:"_blank",rel:"noreferrer noopener"},h(e.$t("t.viewMoreInformation")),9,Pp)):d("",!0),y("div",Op,[y("div",null,h(e.$t("earn.autoEarn.enableDialog.info.title")),1),y("div",$p,[m(f,{class:"check-icon"}),y("span",null,h(e.$t("earn.autoEarn.enableDialog.info.list.1")),1)]),y("div",Wp,[m(f,{class:"check-icon"}),y("span",null,h(e.$t("earn.autoEarn.enableDialog.info.list.2")),1)])]),m(D,{value:o.isAgreeTerms,"onUpdate:value":t[1]||(t[1]=e=>o.isAgreeTerms=e),class:"agree-checkbox",isBrandNewStyle:""},{default:g((()=>[m(T,{class:"agree-terms-text",keypath:"wallets.deposit.iAgreeTo2",tag:"p"},{termsAndConditions:g((()=>[y("span",{class:"terms-and-conditions-link",onClick:t[0]||(t[0]=w(((...e)=>u.onTermsAndConditions&&u.onTermsAndConditions(...e)),["stop","prevent"]))},h(e.$t("earn.autoEarn.enableDialog.agreeTerms",{brandName:e.$t("brand.name")}
1)),1)])),_:1})])),_:1},8,["value"]),m(A,{class:"primary enable-button",size:"large",isLoading:o.isLoading,disabled:u.isAutoEarnDisabled||!o.isAgreeTerms,onClick:u.onEnableAutoEarn},{default:g((()=>[v(h(e.$t("earn.autoEarn.enableDialog.enableAutoEarn")),1)])),_:1},8,["isLoading","disabled","onClick"]),y("div",Fp,h(e.$t("earn.autoEarn.enableDialog.nextManageAssets")),1)])])),_:1},8,["fullStyle","onClosed"])}],["__scopeId","data-v-673dcfdc"]]),Up={name:"AutoEarnSettingsDialog",components:{BrandDialog:wt,Tutorial:qr,CurrencyIcon:Pa,IconEdit2:nl,IconInfo2:Fa,IconCross:il,IconCheck3:sl,IconChevronDown2:ca,SwitchButton:ll,BrandInput:al},emits:["handleOnClose"],data:()=>({InputTextAlign:rl,isLoading:!0,isEnableAll:!1,enableForAllAssetsStatus:Cr.NONE,autoEarnAssetList:[]}),computed:{...l(["lang","currencyMap"]),tableHeader(){let e=[{key:"ASSET",text:this.$t("t.asset"),textAlign:"left"},{key:"YESTERDAYS_APY",text:this.$t("earn.autoEarn.settingsDialog.yesterdaysAPY")}];return e=this.isMobile?[...e,{key:"ENABLE",text:this.$t("t.enable"),textAlign:"center"},{key:"EXPAND"}]:[...e,{key:"QUANTITY_THRESHOLD",text:this.$t("earn.autoEarn.settingsDialog.quantityThreshold"),tooltip:this.$t("earn.autoEarn.settingsDialog.quantityThreshold.tooltip"),tutorial:{storageKey:mt.AUTO_EARN_QUANTITY_THRESHOLD_HINT,title:this.$t("earn.autoEarn.settingsDialog.quantityThreshold"),content:this.$t("earn.autoEarn.settingsDialog.quantityThreshold.tooltip")}},{key:"ENABLE",text:this.$t("t.enable"),textAlign:"center"}],e},moreInformationHref(){return gt(this.lang,"AUTO_EARN_FAQ")}},created(){this.init()},methods:{...u(["updateAccountInfo"]),async init(){this.isLoading=!0,await this.getAutoEarnAssetList(),this.isLoading=!1},async getAutoEarnAssetList(){try{const e=await Lp.getAutoEarnAssetList();this.autoEarnAssetList=e.map((e=>{var t;return{...e,currencyType:(null==(t=this.currencyMap[e.currency])?void 0:t.isFiat)?"fiat":"icon",isEdit:!1,isExpanded:!1,tmpQuantityThreshold:e.quantityThreshold}}))}catch{}this.checkEnableForAllAssetsStatus()},checkEnableForAllAssetsStatus(){let e=0;this.autoEarnAssetList.forEach((t=>{t.enabled&&e++})),e===this.autoEarnAssetList.length?(this.isEnableAll=!0,this.enableForAllAssetsStatus=Cr.CHECKED):e>0?(this.isEnableAll=!1,this.enableForAllAssetsStatus=Cr.PARTIAL):(this.isEnableAll=!1,this.enableForAllAssetsStatus=Cr.NONE)},async onEnableAllAssets(){this.isLoading=!0,[Cr.CHECKED,Cr.PARTIAL].includes(this.enableForAllAssetsStatus)?(this.enableForAllAssetsStatus=Cr.NONE,this.isEnableAll=!1):(this.enableForAllAssetsStatus=Cr.CHECKED,this.isEnableAll=!0);try{await Lp.updateAutoEarnAllProductsStatus({autoEarn:this.isEnableAll}),this.autoEarnAssetList.forEach((e=>{e.enabled=this.isEnableAll}))}catch{}this.isLoading=!1},async onEnableAssetAuto(e){try{const t=!e.enabled;await Lp.updateAutoEarnProductSettings({productId:e.id,quantityThreshold:null,isEnabled:t}),e.enabled=t}catch{}this.checkEnableForAllAssetsStatus()},onExpand(e){e.isExpanded=!e.isExpanded},onCancelEditQuantityThreshold(e){["","."].includes(e.tmpQuantityThreshold)&&(e.tmpQuantityThreshold=0),e.isEdit=!1},async onConfirmEditQuantityThreshold(e){["","."].includes(e.tmpQuantityThreshold)&&(e.tmpQuantityThreshold=0);try{await Lp.updateAutoEarnProductSettings({productId:e.id,quantityThreshold:e.tmpQuantityThreshold,isEnabled:null}),e.quantityThreshold=e.tmpQuantityThreshold,e.isEdit=!1}catch{}},onClosed(){this.updateAccountInfo(),this.$emit("handleOnClose")}}},Mp={class:"content"},Vp={class:"quantity-threshold-input-wrapper"},Hp={class:"quantity-threshold-input-text"},Gp={class:"quantity-threshold-input-suffix"},Yp=["onClick"],qp=["onClick"],zp={class:"apy"},Kp={class:"quantity-threshold"},jp=["onClick"],Xp={class:"enable-switch-button"},Qp={key:0,class:"m-quantity-threshold-edit-wrapper"},Zp={class:"quantity-threshold-input-suffix"},Jp=["onClick"],ey=["onClick"],ty={key:1,class:"m-quantity-threshold-wrapper"},ay={class:"m-quantity-threshold-title-wrap"},ly={class:"m-quantity-threshold-title"},sy={class:"quantity-threshold"},iy=["onClick"],ny={class:"note"},ry=["href"];
1const oy=vr(Up,[["render",function(e,t,a,l,o,u){const c=s("Checkbox"),T=s("IconInfo2"),w=s("Tooltip"),D=s("Tutorial"),A=s("Cell"),b=s("HeaderRow"),_=s("CurrencyIcon"),S=s("BrandInput"),E=s("IconCross"),I=s("IconCheck3"),k=s("IconEdit2"),R=s("SwitchButton"),N=s("IconChevronDown2"),P=s("Row"),O=s("DataTable"),$=s("BrandDialog"),W=C("loading");return n(),i($,{class:"auto-earn-enable-dialog",width:"800px",height:e.isMobile?"100%":"auto",fullStyle:e.isMobile,isBrandNewStyle:"",onClosed:u.onClosed},{header:g((()=>[v(h(e.$t("earn.autoEarn.settingsDialog.title")),1)])),body:g((()=>[f((n(),r("div",Mp,[m(c,{value:o.isEnableAll,class:"enable-all-checkbox",isBrandNewStyle:"",status:o.enableForAllAssetsStatus,onInput:u.onEnableAllAssets},{default:g((()=>[v(h(e.$t("earn.autoEarn.settingsDialog.enableAll")),1)])),_:1},8,["value","status","onInput"]),m(O,{class:"asset-list"},{header:g((()=>[m(b,null,{default:g((()=>[(n(!0),r(p,null,x(u.tableHeader,(t=>(n(),i(A,{key:t.key,class:"table-header-cell",textAlign:t.textAlign},{default:g((()=>[y("span",null,h(t.text),1),t.tooltip?(n(),i(w,{key:0,placement:"top"},{content:g((()=>[m(T,{class:"tooltip-icon"})])),tooltip:g((()=>[v(h(t.tooltip),1)])),_:2},1024)):d("",!0),e.isDesktop&&t.tutorial?(n(),i(D,{key:1,storageKey:t.tutorial.storageKey,placement:"bottom-end",title:t.tutorial.title,tooltip:t.tutorial.content,offsetLeft:40,arrowOffsetX:-100},{icon:g((()=>[m(T,{class:"icon-info"})])),_:2},1032,["storageKey","title","tooltip"])):d("",!0)])),_:2},1032,["textAlign"])))),128))])),_:1})])),body:g((()=>[(n(!0),r(p,null,x(o.autoEarnAssetList,((t,a)=>(n(),r(p,{key:t.currency},[m(P,{class:"table-row",index:a,disableCssHoverEffect:"",disableBackground:""},{default:g((()=>[m(A,{textAlign:"left"},{default:g((()=>[m(_,{class:"currency-wrapper",name:t.currency,type:t.currencyType,displayName:t.currency,size:"16"},null,8,["name","type","displayName"])])),_:2},1024),!e.isMobile&&t.isEdit?(n(),i(A,{key:0,colspan:"3"},{default:g((()=>[y("div",Vp,[y("span",Hp,h(e.$t("earn.autoEarn.settingsDialog.quantityThreshold.setQuantityThreshold"))+": ",1),m(S,{value:t.tmpQuantityThreshold,"onUpdate:value":e=>t.tmpQuantityThreshold=e,class:"quantity-threshold-input",textAlign:o.InputTextAlign.right,placeholder:"0",decimalLimit:"8",isPrice:"",isBrandNewStyle:"",hasFocusStyle:"",setFocus:""},{suffix:g((()=>[y("span",Gp,h(t.currency),1)])),_:2},1032,["value","onUpdate:value","textAlign"]),y("div",{class:"quantity-threshold-input-cancel",onClick:e=>u.onCancelEditQuantityThreshold(t)},[m(E)],8,Yp),y("div",{class:"quantity-threshold-input-confirm",onClick:e=>u.onConfirmEditQuantityThreshold(t)},[m(I)],8,qp)])])),_:2},1024)):(n(),r(p,{key:1},[m(A,null,{default:g((()=>[y("span",zp,h(t.rate)+"%",1)])),_:2},1024),e.isMobile?d("",!0):(n(),i(A,{key:0},{default:g((()=>[y("div",Kp,[v(h(t.quantityThreshold)+" "+h(t.currency)+" ",1),y("div",{class:"edit-icon-wrapper",onClick:e=>t.isEdit=!0},[m(k)],8,jp)])])),_:2},1024)),m(A,{textAlign:"center"},{default:g((()=>[y("div",Xp,[m(R,{modelValue:t.enabled,"onUpdate:modelValue":e=>u.onEnableAssetAuto(t)},null,8,["modelValue","onUpdate:modelValue"])])])),_:2},1024),e.isMobile?(n(),i(A,{key:1,textAlign:"center"},{default:g((()=>[m(N,{class:L(["expand-icon",{"is-expanded":t.isExpanded}]),onClick:e=>u.onExpand(t)},null,8,["class","onClick"])])),_:2},1024)):d("",!0)],64))])),_:2},1032,["index"]),e.isMobile&&t.isExpanded?(n(),i(P,{key:`${t.currency}_quantity_threshold`,class:"m-quantity-threshold-row",index:a,disableCssHoverEffect:"",disableBackground:""},{default:g((()=>[m(A,{colspan:"4"},{default:g((()=>[t.isEdit?(n(),r("div",Qp,[m(S,{value:t.tmpQuantityThreshold,"onUpdate:value":e=>t.tmpQuantityThreshold=e,class:"quantity-threshold-input",textAlign:o.InputTextAlign.right,placeholder:"0",decimalLimit:"8",isPrice:"",isBrandNewStyle:"",hasFocusStyle:"",setFocus:""},{suffix:g((()=>[y("span",Zp,h(t.currency),1)])),_:2},1032,["value","onUpdate:value","textAlign"]),y("div",{class:"quantity-threshold-input-cancel",onClick:e=>u.onCancelEditQuantityThreshold(t)},[m(E)],8,Jp),y("div",{class:"quantity-threshold-input-confirm",onClick:e=>u.onConfirmEditQuantityThreshold(t)},[m(I)],8,ey)])):(n(),r("div",ty,[y("div",ay,[y("span",ly,h(e.$t("earn.autoEarn.settingsDialog.quantityThreshold")),1),m(w,{placement:"top"},{content:g((()=>[m(T,{class:"tooltip-icon"})])),tooltip:g((()=>[v(h(e.$t("earn.autoEarn.settingsDialog.quantityThreshold.tooltip")),1)])),_:1})]),y("div",sy,[v(h(t.quantityThreshold)+" "+h(t.currency)+" ",1),y("div",{class:"edit-icon-wrapper",onClick:e=>t.isEdit=!0},[m(k)],8,iy)])]))])),_:2},1024)])),_:2},1032,["index"])):d("",!0)],64)))),128))])),_:1}),y("div",ny,h(e.$t("earn.autoEarn.settingsDialog.note")),1),u.moreInformationHref?(n(),r("a",{key:0,class:"view-more-information-link",href:u.moreInformationHref,target:"_blank",rel:"noreferrer noopener"},h(e.$t("t.viewMoreInformation")),9,ry)):d("",!0)])),[[W,o.isLoading]])])),_:1},8,["height","fullStyle","onClosed"])}],["__scopeId","data-v-0c86c8db"]]),uy={class:"wallet-features"},cy={class:"label"},dy=vr({__name:"WalletFeatures",props:{list:{type:Array,required:!0},useAccountVerifyPopup:{type:Boolean,default:!1}},setup(e){const{enableKycV1PlusFlow:t,enableRegisterForMobileSignUpFlowV2:a}=Ge,l=U(),s=Mr(),o=M(),{t:u}=I(),c=ka(),{hasFeature:f,isUserEarnAllow:T}=Nt(),w=e,D=O(!1),b=O(!1),_=O(!1),S=R((()=>
1{if(!l.getters.isSubAccount&&l.getters.isEmailNotVerified)if(a){if(!l.getters.isPhoneNumberVerified)return W}else{if(w.useAccountVerifyPopup)return()=>{D.value=!0};if(t)return W}return null})),C=R((()=>{const e=[];return w.list.forEach((t=>{if(!f(t)&&(c.isMobile||t!==It._SPLITTER_))return;const a=function(e){switch(e){case It.DEPOSIT:return{icon:St,label:u("t.deposit"),route:k(Ke.DEPOSIT)};case It.WITHDRAWAL:return{icon:bt,label:u("t.withdraw"),route:k(Ke.WITHDRAW)};case It.TRANSFER:return{icon:Ur,label:u("wallets.transfer"),verifyRequired:!0,action:()=>s.toggleTransferPopup()};case It.GO_FUTURES_HISTORY_PAGE:return{icon:at,label:u("t.history"),route:N(Ke.FUTURES_WALLET_DETAIL,{name:l.getters.isUnifiedWallet?ol:ul})};case It.GO_COPY_WISE_TRADE_HISTORY_PAGE:return{icon:At,label:u("t.tradeHistory"),route:N(Ke.COPY_WISE_MY_PORTFOLIO,{tab:"history"})};case It.GO_AUTO_TRADER_WALLET_HISTORY_PAGE:return $(Ke.WALLET_AUTO_TRADER_HISTORY,u("t.walletHistory"));case It.GO_LEAD_TRADING_WALLET_HISTORY_PAGE:return $(Ke.WALLET_LEAD_TRADING_HISTORY);case It.GO_COPY_TRADING_WALLET_HISTORY_PAGE:return $(Ke.WALLET_COPY_TRADING_HISTORY);case It.GO_AI_LEAD_TRADING_WALLET_HISTORY_PAGE:return $(Ke.WALLET_AI_LEAD_TRADING_HISTORY);case It.GO_AI_COPY_TRADING_WALLET_HISTORY_PAGE:return $(Ke.WALLET_AI_COPY_TRADING_HISTORY);case It.GO_FUTURES_BOTS_WALLET_HISTORY_PAGE:return $(Ke.WALLET_FUTURES_BOTS_HISTORY);case It.SHOW_AUTO_EARN_ENABLE_DIALOG:return{icon:Ct,label:u("earn.autoEarn"),showCheckIcon:l.getters.isEnableAutoEarnAndHasSetData,action:F,disabled:!T.value,tutorial:{storageKey:mt.AUTO_EARN_ACTION_HINT,title:u("earn.autoEarn.action.tutorial.title"),tooltip:u("earn.autoEarn.action.tutorial.description")}};case It.GO_EARN_HISTORY_PAGE:return $("historyEarn");case It.GO_ALL_REWARDS_PAGE:return{icon:Et,label:u("t.rewards"),route:k(Ke.TASKS_AND_REWARDS_ALL_REWARDS)}}}(t);a&&(a.verifyRequired&&S.value?(a.action=S.value,delete a.route):a.disabled&&delete a.route),e.push(a)})),e.length>0&&(void 0===e[0]&&e.shift(),void 0===e[e.length-1]&&e.pop()),e}));function E(){D.value=!1}function k(e,t={},a={}){return t.lang=l.state.lang,{name:e,params:t,query:a}}function N(e,t){return k(e,void 0,t)}function $(e,t=u("t.history")){return{icon:at,label:t,route:k(e)}}function W(){o.push(k(Pt.VERIFICATION))}function F(){l.getters.isEnabledAutoEarn?b.value=!0:_.value=!0}function B(e){const{isOpenSettingDialog:t=!1}=e||{};_.value=!1,t&&H((()=>{b.value=!0}))}return(e,t)=>(n(),r("div",uy,[(n(!0),r(p,null,x(C.value,((t,a)=>(n(),r(p,null,[t?(n(),i(A(t.route?"RouterLink":"div"),{key:a,to:t.route,class:L(["feature no-select",{disabled:t.disabled}]),onClick:e=>{var a;return!t.disabled&&(null==(a=t.action)?void 0:a.call(t))}},{default:g((()=>[(n(),i(A(t.icon),{class:"icon"})),y("span",cy,[t.showCheckIcon?(n(),i(P(Za),{key:0,class:"notification-check-icon"})):d("",!0),v(" "+h(t.label),1)]),t.tutorial&&e.isDesktop?(n(),i(P(qr),{key:0,storageKey:t.tutorial.storageKey,placement:"bottom-end",title:t.tutorial.title,tooltip:t.tutorial.tooltip,offsetLeft:-30,arrowOffsetX:30},{icon:g((()=>[m(P(_p),{class:"icon-bulb"})])),_:2},1032,["storageKey","title","tooltip"])):d("",!0)])),_:2},1032,["to","class","onClick"])):(n(),r("div",{key:`${P(It)._SPLITTER_}-${a}`,class:L(P(It)._SPLITTER_)},null,2))],64)))),256)),D.value?(n(),i(P(eu),{key:0,show:D.value,closeDialog:E},null,8,["show"])):d("",!0),b.value?(n(),i(oy,{key:1,onHandleOnClose:t[0]||(t[0]=e=>b.value=!1)})):_.value?(n(),i(Bp,{key:2,onHandleOnClose:B})):d("",!0)]))}},[["__scopeId","data-v-b5866aff"]]),py={class:"link"},yy=vr({__name:"AutoEarnButton",setup(e){const t=O(!1),{isUserEarnAllow:a}=Nt();function l(){a.value&&(t.value=!0)}return(e,o)=>{const u=s("i18n-t");return n(),r("div",{class:L(["auto-earn-button",{disabled:!P(a)}]),onClick:l},[m(sl),m(u,{keypath:"earn.youHaveEnabled"},{autoEarn:g((()=>[y("span",py,h(e.$t("earn.autoEarn")),1)])),_:1}),t.value?(n(),i(oy,{key:0,onHandleOnClose:o[0]||(o[0]=e=>t.value=!1)})):d("",!0)],2)}}},[["__scopeId","data-v-626a3c6a"]]),hy=["id","onClick"],vy=vr(E({__name:"TabNavigator",props:{tabList:{},selectedIndex:{}},emits:["selected"],setup(e,{emit:t}){const a=e,l=t,s=O(0),o=O(0),u=G("container"),c=G("tabElements"),m=R((()=>({"--indicator-position-x":`${s.value}px`,"--indicator-width":`${o.value}px`})));function g(e){var t;const a=null==(t=c.value)?void 0:t[e];u.value&&a&&(s.value=a.offsetLeft-u.value.scrollLeft,o.value=a.offsetWidth)}$([()=>a.selectedIndex,()=>a.tabList],(([e])=>g(e)),{flush:"post"});let f=null;return Y((()=>{H((()=>
1g(a.selectedIndex))),u.value&&(f=new ResizeObserver((()=>g(a.selectedIndex))),f.observe(u.value))})),q((()=>{f&&u.value&&f.unobserve(u.value),f=null})),(e,t)=>(n(),r("div",{ref_key:"container",ref:u,class:"no-select tab-navigator",style:_(m.value)},[(n(!0),r(p,null,x(e.tabList,((t,a)=>(n(),r("div",{id:t.id,key:a,ref_for:!0,ref_key:"tabElements",ref:c,class:L(["tab",{active:a===e.selectedIndex}]),onClick:e=>l("selected",a)},[t.icon?(n(),i(A(t.icon),{key:0,class:L(t.iconClass)},null,8,["class"])):d("",!0),v(" "+h(t.label),1)],10,hy)))),128)),t[0]||(t[0]=y("div",{class:"indicator"},null,-1))],4))}}),[["__scopeId","data-v-7eaede10"]]),my={class:"wallet-container"},gy={key:0,class:"header-container"},fy={class:"info-block"},Ty={class:"title-wrap"},wy={class:"title"},Dy={class:"top-wrapper"},Ay={class:"info-block"},by={key:2,class:"tab-navigator-container"},_y={key:6,class:"note"},Sy=vr(E({__name:"WalletContainer",props:{type:{},title:{},featuresList:{default:()=>[]},useWalletBalanceInfo:{type:Boolean,default:!1},useAccountVerifyPopup:{type:Boolean,default:!1},balanceTitle:{default:""},totalBalance:{default:""},tabList:{default:()=>[]},selectedTabIndex:{default:0},displayCurrency:{default:""},showPnlAnalysis:{type:Boolean,default:!0},showAutoEarnButton:{type:Boolean,default:!1}},emits:["tabSelected"],setup(e,{emit:t}){const a=z(),l=t,u=R((()=>!!a["data-note"]));return(e,t)=>{const a=s("Tooltip");return n(),r("div",my,[e.isMobile?(n(),r("div",gy,[o(e.$slots,"header-link",{},void 0,!0),e.featuresList.length?(n(),i(dy,{key:0,list:e.featuresList},null,8,["list"])):o(e.$slots,"wallet-actions",{key:1},void 0,!0),y("div",fy,[e.useWalletBalanceInfo?(n(),i(ic,{key:0,type:e.type},null,8,["type"])):(n(),i(bp,{key:1,type:e.type,title:e.balanceTitle||e.$t("wallets.totalBalance"),assignAvailable:e.totalBalance},null,8,["type","title","assignAvailable"])),e.showPnlAnalysis?(n(),i(cp,{key:2,type:e.type,displayCurrency:e.displayCurrency,enableToPnlAnalysisButton:""},null,8,["type","displayCurrency"])):d("",!0)])])):(n(),r(p,{key:1},[y("div",Ty,[y("h2",wy,[v(h(e.title)+" ",1),e.$slots["title-tooltip"]?(n(),i(a,{key:0,class:"title-tooltip",placement:"right",hasCursorQuestion:!1},{content:g((()=>[m(Fa,{class:"title-tooltip-icon"})])),tooltip:g((()=>[o(e.$slots,"title-tooltip",{},void 0,!0)])),_:3})):d("",!0)]),o(e.$slots,"header-link",{},void 0,!0)]),y("div",Dy,[y("div",Ay,[e.useWalletBalanceInfo?(n(),i(ic,{key:0,type:e.type},null,8,["type"])):(n(),i(bp,{key:1,type:e.type,title:e.balanceTitle||e.$t("wallets.totalBalance"),assignAvailable:e.totalBalance},null,8,["type","title","assignAvailable"])),e.showPnlAnalysis?(n(),i(cp,{key:2,type:e.type,displayCurrency:e.displayCurrency,enableToPnlAnalysisButton:""},null,8,["type","displayCurrency"])):d("",!0)]),e.featuresList.length?(n(),i(dy,{key:0,list:e.featuresList,useAccountVerifyPopup:e.useAccountVerifyPopup},null,8,["list","useAccountVerifyPopup"])):o(e.$slots,"wallet-actions",{key:1},void 0,!0)])],64)),e.tabList.length?(n(),r("div",by,[m(vy,{tabList:e.tabList,selectedIndex:e.selectedTabIndex,onSelected:t[0]||(t[0]=e=>l("tabSelected",e))},null,8,["tabList","selectedIndex"])])):d("",!0),e.showAutoEarnButton?(n(),i(yy,{key:3,class:"auto-earn-button"})):d("",!0),e.isMobile?o(e.$slots,"mobile",{key:4},void 0,!0):(n(),r("div",{key:5,class:L(["data-container",{"no-margin-bottom":u.value}])},[o(e.$slots,"desktop",{},void 0,!0)],2)),u.value?(n(),r("div",_y,[o(e.$slots,"data-note",{},void 0,!0)])):d("",!0)])}}}),[["__scopeId","data-v-ba8950fa"]]),Cy="baseCurrency",Ly={formatSortKey:e=>`${Cy}${e.charAt(0).toUpperCase()}${e.slice(1)}`,getTargetSortAttribute(e){const t=e.split(Cy)[1];return t.charAt(0).toLowerCase()+t.slice(1)}};const Ey=vr({name:"SpotAssetsListHeader",components:{SortableHeaderCell:cl,IconInfo2:Fa},props:{headerTitles:{type:Array,default:function(){return[]}},sortKey:{type:[Boolean,String],default:void 0}},methods:{...Ly,getClass(e){const t=[];return e.textAlign&&t.push(`align-${e.textAlign}`),t}}},[["render",function(e,t,a,l,o,u){const c=s("IconInfo2"),d=s("ToolTip"),v=s("SortableHeaderCell"),f=s("HeaderRow");return n(),i(f,{class:"row"},{default:g((()=>[(n(!0),r(p,null,x(a.headerTitles,(t=>(n(),i(v,b({ref_for:!0},e.$attrs,{id:e.formatSortKey(t.id),key:t.id,currentSortKey:a.sortKey,class:u.getClass(t),title:t,iconType:"triangle"}),D({content:g((()=>[y("span",null,h(e.$t(t.lang||""))+" "+h(t.more),1)])),_:2},[t.tooltip?{name:"tooltip",fn:g((()=>[m(d,{placement:"top"},{content:g((()=>[m(c,{class:"info-icon"})])),tooltip:g((()=>[y("span",null,h(t.tooltip),1)])),_:2},1024)])),key:"0"}:void 0]),1040,["id","currentSortKey","class","title"])))),128))])),_:1})}],["__scopeId","data-v-761d68fb"]]);const Iy=vr({name:"WalletMainRow",props:{isOpenDetail:{type:Boolean,default:!1},index:{type:Number,required:!0}}},[["render",function(e,t,a,l,r,u){const c=s("Row");return n(),i(c,{class:L(["main-row",{isOpenDetail:a.isOpenDetail}
1]),index:a.index,disableBackground:!0,disableCssHoverEffect:!0},{default:g((()=>[o(e.$slots,"default",{},void 0,!0)])),_:3},8,["class","index"])}],["__scopeId","data-v-6790d1ac"]]),ky={name:"WalletDecimalPlace",props:{value:{type:String,default:""},isSameParentStyle:{type:Boolean,default:!1}},computed:{...l(["lang"])}},Ry={class:"decimal-place"},Ny={key:0};const xy=vr(ky,[["render",function(e,t,a,l,s,i){return n(),r("div",Ry,[a.value?(n(),r("span",Ny,".")):d("",!0),y("span",{class:L(["value",a.isSameParentStyle?"":"custom-value"])},h(a.value),3)])}],["__scopeId","data-v-a1632548"]]),Py={class:"currency-name"},Oy={class:"value-wrap"},$y={key:0,class:"base-value-wrap"},Wy={class:"base-value"},Fy={class:"currency-name"},By=vr({__name:"WalletPriceField",props:{priceValue:{type:[Number,String,Object,N],required:!0},currencyName:{type:String,default:""},isFiat:{type:Boolean,default:!0},size:{type:String,default:""},hideConvertToBaseCurrencyValue:{type:Boolean,default:!0},forceShowWvc:{type:Boolean,default:!1},isSameParentStyle:{type:Boolean,default:!1},dynamicCurrencyWidth:{type:Boolean,default:!1}},setup(e){const t=e,{hideWalletPriceValue:a,currencyMap:l}=S(Ut()),s=ze(),{displayCurrency:i}=S(s),{getInversePrice:o}=s,u=O(null),c=O("");Y((()=>{u.value&&(c.value=getComputedStyle(u.value).font)}));const v=R((()=>{if(!t.dynamicCurrencyWidth)return{};return{"--currency-name-width":`${Ia(t.currencyName,c.value||void 0)}px`}})),g=R((()=>T(t.priceValue,t.isFiat,t.currencyName).split("."))),f=R((()=>{var e;const a=o(t.currencyName)||null;if(!a)return"--";return"â"+T(N(t.priceValue).times(a),null==(e=l.value[i.value])?void 0:e.isFiat,i.value)}));function T(e,a,l){let s=null;return e=Number(e)||0,a&&(s=e>1e8&&!t.forceShowWvc?"default":"fc"),Xt(e,{formatKey:s,isDynamicDecimal:!a,currency:l})}return(t,l)=>(n(),r("div",{class:L(["wallet-price-field",{[e.size]:""!==e.size}]),style:_(v.value)},[P(a)?(n(),r(p,{key:0},[l[0]||(l[0]=y("span",{class:"hide-value"},"*****",-1)),y("span",Py,h(e.currencyName),1)],64)):(n(),r(p,{key:1},[y("div",Oy,[y("span",null,h(g.value[0]),1),m(xy,{value:g.value[1],isSameParentStyle:e.isSameParentStyle},null,8,["value","isSameParentStyle"]),y("span",{ref_key:"currencyNameRef",ref:u,class:"currency-name"},h(e.currencyName),513)]),e.hideConvertToBaseCurrencyValue?d("",!0):(n(),r("div",$y,[y("span",Wy,h(f.value),1),y("span",Fy,h(P(i)),1)]))],64))],6))}},[["__scopeId","data-v-694f4ffc"]]),Uy=vr({__name:"DisclaimerTooltip",props:{currency:{type:String,default:""}},setup(e){const{enableDisclaimerUsd:t}=Ge,a=e,l=R((()=>t&&"USD"===a.currency));return(e,t)=>{const a=s("ToolTip");return l.value?(n(),i(a,{key:0},{content:g((()=>[m(Fa,{class:"icon-info"})])),tooltip:g((()=>[y("span",null,h(e.$t("wallets.disclaimer.usd")),1)])),_:1})):d("",!0)}}},[["__scopeId","data-v-7da8861a"]]);const My=vr({name:"SpotAssetsListRowAsset",components:{Row:Iy,BrandIcon:Pa,WalletPriceField:By,IconChevronDown:Ka,DisclaimerTooltip:Uy},props:{asset:{type:Object,default:()=>({})},index:{type:Number,required:!0},toggleDetail:{type:Function,required:!0}},computed:{...l(["hideConvertToBaseCurrencyValue"]),assetName(){const e=this.$filters;return this.asset.isFiat?e.fiatCurrency(this.asset.shortName):e.digitalCurrency(this.asset.shortName)}}},[["render",function(e,t,a,l,r,o){const u=s("IconChevronDown"),c=s("Cell"),d=s("BrandIcon"),p=s("DisclaimerTooltip"),y=s("WalletPriceField"),h=s("Row");return n(),i(h,{class:"assets-row",index:a.index,isOpenDetail:a.asset.isOpenDetail,onClick:t[0]||(t[0]=e=>a.toggleDetail(a.asset))},{default:g((()=>[m(c,{class:"toggle"},{default:g((()=>[m(u,{class:"icon-chevron-down","aria-label":"icon chevron down","stroke-width":"2"})])),_:1}),m(c,{class:"asset-name flex-box items-center",textAlign:"left"},{default:g((()=>[m(d,{displayName:a.asset.displayName,shortName:"",showName:"",type:a.asset.isFiat?"fiat":"icon",name:a.asset.shortName,size:"20"},null,8,["displayName","type","name"]),m(p,{currency:a.asset.shortName},null,8,["currency"])])),_:1}),m(c,{class:"available"},{default:g((()=>[m(y,{priceValue:a.asset.available,currencyName:a.asset.displayName,isFiat:a.asset.isFiat,hideConvertToBaseCurrencyValue:e.hideConvertToBaseCurrencyValue,isSameParentStyle:""},null,8,["priceValue","currencyName","isFiat","hideConvertToBaseCurrencyValue"])])),_:1})])),_:1},8,["index","isOpenDetail"])}],["__scopeId","data-v-96b89e68"]]),Vy={class:"cards-wrapper"},Hy={class:"card-content"},Gy={class:"card-title"},Yy={class:"card-subtitle"},qy={class:"card-content"},zy={class:"card-title"},Ky={class:"card-subtitle"},jy=vr({__name:"DepositExpressBuyDialog",props:{fiatCurrency:{type:String,default:""}},emits:["close","toDeposit","toExpressBuy"],setup(e,{emit:t}){const{t:a}=I(),l=ka(),s=e,r=t,o="Deposit",u="ExpressBuy";function c(e){switch(e){case o:return r("close"),void r("toDeposit");case u:return r("close"),void r("toExpressBuy");default:return}}return(e,t)=>(n(),i(P(wt),{isBrandNewStyle:"",width:"540px",fullStyle:P(l).isMobile,showClose:"",onClosed:t[2]||(t[2]=e=>r("close"))},{header:g((()=>[v(h(`${P(a)("t.deposit")} ${s.fiatCurrency}`),1)])),body:g((()=>[y("div",Vy,[y("div",{class:"payment-card",onClick:t[0]||(t[0]=e=>c(o))},[m(St,{class:"icon-deposit",width:"36"}),y("div",Hy,[y("div",Gy,h(`${P(a)("t.deposit")} ${s.fiatCurrency}`),1),y("div",Yy,h(P(a)("wallets.deposit.paymentMethods")),1)]),m(P(ht))]),y("div",{class:"payment-card",onClick:t[1]||(t[1]=e=>c(u))},[m(dl),y("div",qy,[y("div",zy,h(P(a)("display.expressBuy")),1),y("div",Ky,h(P(a)("wallets.payment.expressbuy.subtitle")),1)]),m(P(ht))])])])),_:1},8,["fullStyle"]))}},[["__scopeId","data-v-d76a5e40"]]),{captureEvent:Xy}=Ga(),{enableConvert:Qy,enableSwap:Zy}=Ge,Jy={name:"WalletDetailActionsV2",components:{IconDeposit:St,IconWithdrawal:bt,IconConvertTo2:Lt,IconMore:xt,WalletMoreActions:vu,AskAccountVerificationPopup:eu,DepositExpressBuyDialog:jy},props:{type:{type:String,default:Ye.SPOT},asset:{type:Object,default:()=>({})}},emits:["update:actionType"],setup(){const e=Ut(),{isDefiUser:t,isExpressBuyEntryAllowed:a}=S(e);return{isDefiUser:t,isExpressBuyEntryAllowed:a}},data:()=>({enableConvert:Qy,enableSwap:Zy,WalletDisplayType:Ft,WALLET_ACTIONS:It,actionsVisible:!1,isAccountVerifyPopupShown:!1,isShowDepositExpressBuyDialog:!1}),computed:{...gr.computed,...a(Lr,["expressBuyCoinPairs"]),...t(["isAccountInfoExist","isSubAccount"]),walletDisplayType(){return this.type===Ye.SPOT?Ft.SPOT_SPECIFIC:Ft.FUTURES_SPECIFIC},displayActionMap(){return this.getDisplayActionMap(this.walletDisplayType,this.asset)}},methods:{...gr.methods,showAccountVerifyPopup(){this.isAccountVerifyPopupShown=!0},closeAccountVerifyPopup(){this.isAccountVerifyPopupShown=!1},handleDepositExpressBuy(e){this.isExpressBuyEntryAllowed&&this.expressBuyCoinPairs[this.asset.shortName]?this.isShowDepositExpressBuyDialog=!0:this.handleAction(e)}
1,async handleAction(e){if(this.type===Ye.SPOT&&!this.isVerified(e,this.asset))return void this.showAccountVerifyPopup();switch(e){case It.SWAP:return void this.$router.push({name:Ke.SWAP,params:{lang:this.lang},query:{fromCoin:this.asset.shortName}});case It.DEPOSIT:Va({entryChannel:this.asset.isFiat?Ha.spotWalletIndividualTokenFiat:Ha.spotWalletIndividualTokenCrypto,currency:this.asset.shortName}),Xy("deposit_entrance",{entry_channel:this.asset.isFiat?"spot_wallet_individual_token_fiat":"spot_wallet_individual_token_crypto",currency:this.asset.shortName})}this.$emit("update:actionType",e);this.isDefiUser&&Object.values(mu).includes(e)&&(await this.$nextTick(),this.$emit("update:actionType",""))},toggleActions(){this.actionsVisible=!this.actionsVisible},gotoExpressBuy(){Xy("express_buy_entrance",{entry_channel:"spot_fiat"}),this.$router.push({name:Ke.EXPRESS_BUY,params:{lang:this.lang},query:{spendCurrency:this.asset.shortName}})},onWalletMoreAction(e){if(e===It.GO_TRADING_PAGE)pl({entryChannel:yl.walletSpot})}}},eh={class:"detail-actions"};const th=vr(Jy,[["render",function(e,t,a,l,o,u){const c=s("IconDeposit"),p=s("IconWithdrawal"),h=s("IconConvertTo2"),v=s("IconMore"),g=s("WalletMoreActions"),T=s("AskAccountVerificationPopup"),w=s("DepositExpressBuyDialog"),D=C("loading");return f((n(),r("div",eh,[y("div",{class:L(["item",{disable:!u.displayActionMap[o.WALLET_ACTIONS.DEPOSIT]}]),onClick:t[0]||(t[0]=e=>u.handleDepositExpressBuy(o.WALLET_ACTIONS.DEPOSIT))},[m(c,{class:"icon"})],2),y("div",{class:L(["item",{disable:!u.displayActionMap[o.WALLET_ACTIONS.WITHDRAWAL]}]),onClick:t[1]||(t[1]=e=>u.handleAction(o.WALLET_ACTIONS.WITHDRAWAL))},[m(p,{class:"icon"})],2),o.enableConvert?(n(),r("div",{key:0,class:L(["item",{disable:!u.displayActionMap[o.WALLET_ACTIONS.CONVERT]}]),onClick:t[2]||(t[2]=e=>u.handleAction(o.WALLET_ACTIONS.CONVERT))},[m(h,{class:"icon"})],2)):d("",!0),o.enableSwap?(n(),r("div",{key:1,class:L(["item",{disable:!u.displayActionMap[o.WALLET_ACTIONS.SWAP]}]),onClick:t[3]||(t[3]=e=>u.handleAction(o.WALLET_ACTIONS.SWAP))},[m(h,{class:"icon"})],2)):d("",!0),y("div",{class:"item",onClick:t[5]||(t[5]=(...e)=>u.toggleActions&&u.toggleActions(...e))},[m(v,{class:"icon"}),m(g,{actionsVisible:o.actionsVisible,"onUpdate:actionsVisible":t[4]||(t[4]=e=>o.actionsVisible=e),itemList:[o.WALLET_ACTIONS.SEND_TO,o.WALLET_ACTIONS.GO_TRADING_PAGE,o.WALLET_ACTIONS.GO_EARN_PAGE,o.WALLET_ACTIONS.GO_HISTORY_PAGE],currency:a.asset.shortName,asset:a.asset,isVerifyFirst:!0,adjustPosition:{top:-20,left:-32},walletDisplayType:u.walletDisplayType,onAction:u.onWalletMoreAction},null,8,["actionsVisible","itemList","currency","asset","walletDisplayType","onAction"])]),m(T,{show:o.isAccountVerifyPopupShown,closeDialog:u.closeAccountVerifyPopup},null,8,["show","closeDialog"]),o.isShowDepositExpressBuyDialog?(n(),i(w,{key:2,fiatCurrency:a.asset.shortName,onToDeposit:t[6]||(t[6]=e=>u.handleAction(o.WALLET_ACTIONS.DEPOSIT)),onToExpressBuy:t[7]||(t[7]=e=>u.gotoExpressBuy()),onClose:t[8]||(t[8]=e=>o.isShowDepositExpressBuyDialog=!1)},null,8,["fiatCurrency"])):d("",!0)])),[[D,!e.isAccountInfoExist]])}],["__scopeId","data-v-7b78a9bf"]]),ah={key:0,class:"loading"},lh={key:1,class:"bonus-details-content"},sh={class:"amount-title"},ih={class:"amount"},nh={class:"info-list"},rh={class:"info-item-text"},oh={class:"info-item-amount"},uh=vr({__name:"BonusDetailsDialog",props:{currency:{type:String,required:!0},walletType:{type:String,default:Ye.SPOT}},emits:["dialog:closed"],setup(e,{emit:t}){const a=t,l=e,o=U(),u=O(!0),c=K({}),T=R((()=>o.state.currencyMap[l.currency])),w=R((()=>{var e;return(null==(e=T.value)?void 0:e.isFiat)?hl:vl})),D=R((()=>l.walletType===Ye.FUTURES)),A=R((()=>E(D.value?c.value.remainingAmount??0:c.value.amount??0,!1))),b=R((()=>{var e;const t=(null==(e=c.value)?void 0:e.details)||[];return D.value?t.filter((({remainingAmount:e})=>e>0)).map((({expiryTime:e,remainingAmount:t})=>({expiredTime:e,amount:t}))):t.map((({rewardExpiredTime:e,amount:t})=>({expiredTime:e,amount:t})))})),_=R((()=>!D.value&&null!==c.value.remainingDays&&c.value.remainingDays>=0)),S=R((()=>ml[l.currency]||l.currency)),L=R((()=>({name:Ke.WALLET_SPOT_HISTORY,params:{lang:o.state.lang},query:{currency:ml[l.currency]||l.currency,type:gl.REWARD_EXPIRED,days:60}})));function E(e,t){return o.getters.getCurrencyScaledAmount({amount:N(e).toFixed(w.value),
1currency:l.currency,isFormat:!0,isDecimalPadZero:t})}return j((()=>{!async function(){u.value=!0;try{D.value?c.value=await Oa.getTrialFundDetail(l.currency):c.value=await fl.getBonusDetail({currency:l.currency})}catch{}finally{u.value=!1}}()})),(e,t)=>{const l=s("ToolTip"),o=s("RouterLink"),w=C("loading");return n(),i(wt,{class:"bonus-details-dialog",width:e.isMobile?"100%":"560px",isBrandNewStyle:"",onClosed:t[0]||(t[0]=e=>a("dialog:closed"))},{header:g((()=>[v(h(D.value?e.$t("t.details"):e.$t("t.bonusDetails")),1)])),body:g((()=>[u.value?f((n(),r("div",ah,null,512)),[[w,u.value]]):(n(),r("div",lh,[m(Pa,{class:"currency",displayName:T.value.displayName,type:T.value.isFiat?"fiat":"icon",name:T.value.shortName,size:"20",shortName:""},null,8,["displayName","type","name"]),y("span",sh,h(e.$t("t.bonusAvailable")),1),y("span",ih,h(A.value),1),t[2]||(t[2]=y("div",{class:"divider"},null,-1)),y("div",nh,[(n(!0),r(p,null,x(b.value,(a=>(n(),r("div",{key:a.expiredTime,class:"info-item"},[y("span",rh,[v(h(a.expiredTime?e.$t("t.expireOn",{date:e.$filters.formatDate(a.expiredTime,"yyyy-MM-dd")}):e.$t("t.noExpirationDate"))+" ",1),!a.expiredTime&&_.value?(n(),i(l,{key:0,placement:"top"},{content:g((()=>[m(Fa,{class:"info-icon"})])),tooltip:g((()=>[v(h(e.$t("bonus.expirationHint",{dayText:e.$t("bonus.remainingTime",c.value.remainingDays,{named:{day:c.value.remainingDays}})}))+" ",1),c.value.lastClosedTime?(n(),r(p,{key:0},[t[1]||(t[1]=y("br",null,null,-1)),v(" ("+h(e.$t("bonus.strategy.lastClosed",{date:e.$filters.formatDate(c.value.lastClosedTime,"yyyy-MM-dd")}))+") ",1)],64)):d("",!0)])),_:1})):d("",!0)]),y("span",oh,h(E(a.amount,!0)),1)])))),128)),m(o,{class:"wallet-history-link",to:L.value},{default:g((()=>[v(h(D.value?e.$t("wallets.viewRecentExpiredCurrency",{currency:S.value}):e.$t("wallets.viewRecentExpiredBonus")),1)])),_:1},8,["to"])])]))])),_:1},8,["width"])}}},[["__scopeId","data-v-1cb6d413"]]),ch={key:0,class:"loading"},dh={key:1,class:"asset-in-use-content"},ph={class:"amount"},yh={class:"info-list"},hh={class:"info-item-text"},vh={class:"info-item-amount"},mh=vr({__name:"InUseDetailsDialog",props:{currency:{type:String,required:!0}},emits:["dialog:closed"],setup(e,{emit:t}){const{enableSpotTrade:a,enableEarnStaking:l,enableVesting:s,enableOneClickFutures:o,enableUpOrDown:u,enableCopyWise:c}=Ge,{t:d}=I(),T=U(),w=t,D=e,A=O(!0),b=K({}),_=R((()=>[a&&b.value.openOrders>0&&{label:d("history.order.openOrders"),value:b.value.openOrders},b.value.withdrawalProcessing>0&&{label:d("t.withdrawalProcessing"),value:b.value.withdrawalProcessing},l&&b.value.staking>0&&{label:d("earn.stakingTerm"),value:b.value.staking},s&&b.value.vesting>0&&{label:d("t.vesting"),value:b.value.vesting},o&&b.value.oneClickFutures>0&&{label:d("trading.ocf.title"),value:b.value.oneClickFutures},u&&b.value.upOrDown>0&&{label:d("nav.upOrDown"),value:b.value.upOrDown},c&&b.value.autoTrader>0&&{label:d("nav.autoTrader"),value:b.value.autoTrader}].filter(Boolean))),S=R((()=>T.state.currencyMap[D.currency]));function L(e,t){const a=S.value.isFiat?hl:vl;return T.getters.getCurrencyScaledAmount({amount:Number(e).toFixed(a),currency:D.currency,isFormat:!0,isDecimalPadZero:t})}return j((async()=>{A.value=!0;try{b.value=await Oa.getWalletBalanceHold(D.currency)}finally{A.value=!1}})),(e,t)=>{const a=C("loading");return n(),i(P(wt),{class:"asset-in-use-dialog",width:e.isMobile?"100%":"560px",isBrandNewStyle:"",onClosed:t[0]||(t[0]=e=>w("dialog:closed"))},{header:g((()=>[v(h(e.$t("t.inUse")),1)])),body:g((()=>[A.value?f((n(),r("div",ch,null,512)),[[a,A.value]]):(n(),r("div",dh,[m(P(Pa),{class:"currency",displayName:S.value.displayName,type:S.value.isFiat?"fiat":"icon",name:S.value.shortName,size:"20",shortName:""},null,8,["displayName","type","name"]),y("span",ph,h(L(S.value.frozen,!1)),1),t[1]||(t[1]=y("div",{class:"divider"},null,-1)),y("div",yh,[(n(!0),r(p,null,x(_.value,(e=>(n(),r("div",{key:e.label,class:"info-item"},[y("span",hh,h(e.label),1),y("span",vh,h(L(e.value,!0)),1)])))),128))])]))])),_:1},8,["width"])}}},[["__scopeId","data-v-dca425a3"]]),gh={class:"title"},fh={key:0,class:"bonus-detail"},Th={class:"title"},wh={key:1,class:"bonus-detail"},Dh={class:"title"},Ah={key:2,class:"bonus-detail"},bh={class:"title"};const _h=vr({name:"SpotAssetsListRow",components:{SpotAssetsListRowAsset:My,SpotAssetsListRowDetail:vr({__name:"SpotAssetsListRowDetail",props:{asset:{type:Object,default:()=>({})},index:{type:Number,required:!0},hasInUseAsset:{type:Boolean,default:!1}},setup(e){const{enableWalletCombineSpotWithAutoTrader:t,enableWalletBonusAsset:a}=Ge,l=e,o=U(),u=Ya(),{$openDialog:c}=Tl(),p=O(null),f=R((()=>o.state.hideConvertToBaseCurrencyValue)),T=R((()=>u.isDisplayBonusColumn)),w=R((()=>o.state.redeemedBonusCurrencies[l.asset.shortName]||!1)),D=R((()=>p.value===It.DEPOSIT)),A=R((()=>p.value===It.WITHDRAWAL)),b=R((()=>p.value===It.CONVERT));function _(){p.value=null}function S(){c(uh,{currency:l.asset.shortName})}function C(){c(mh,{currency:l.asset.shortName})}return(l,o)=>{const u=s("Cell"),c=s("ToolTip"),L=s("Row");return n(),i(L,{class:"assets-row",index:e.index,disableBackgroun
1d:!0,disableCssHoverEffect:!0},{default:g((()=>[m(u),m(u,{class:"assets-info"},{default:g((()=>[y("div",gh,[v(h(l.$t("wallets.spotList.total"))+" ",1),P(a)?(n(),i(c,{key:0,placement:"top"},{content:g((()=>[m(Fa,{class:"info-icon"})])),tooltip:g((()=>[y("span",null,h(l.$t("wallets.spotList.total.bonus.tooltip")),1)])),_:1})):d("",!0)]),m(By,{class:"price-value",size:"small",priceValue:e.asset.total,currencyName:e.asset.displayName,isFiat:e.asset.isFiat,hideConvertToBaseCurrencyValue:f.value,isSameParentStyle:""},null,8,["priceValue","currencyName","isFiat","hideConvertToBaseCurrencyValue"]),P(t)?(n(),r("div",fh,[y("div",Th,h(l.$t("t.investment")),1),m(By,{class:"price-value",size:"small",priceValue:e.asset.investment??0,currencyName:e.asset.displayName,isFiat:e.asset.isFiat,hideConvertToBaseCurrencyValue:f.value,isSameParentStyle:""},null,8,["priceValue","currencyName","isFiat","hideConvertToBaseCurrencyValue"])])):d("",!0),P(a)&&T.value&&w.value?(n(),r("div",wh,[y("div",Dh,[v(h(l.$t("t.bonus"))+" ",1),m(c,{placement:"top"},{content:g((()=>[m(Fa,{class:"info-icon"})])),tooltip:g((()=>[y("span",null,h(l.$t("wallets.spotList.bonus.tooltip")),1)])),_:1})]),m(By,{class:"price-value bonus",size:"small",priceValue:e.asset.virtual??0,currencyName:e.asset.displayName,isFiat:e.asset.isFiat,hideConvertToBaseCurrencyValue:f.value,isSameParentStyle:"",dynamicCurrencyWidth:"",onClick:S},null,8,["priceValue","currencyName","isFiat","hideConvertToBaseCurrencyValue"])])):d("",!0),e.hasInUseAsset?(n(),r("div",Ah,[y("div",bh,h(l.$t("t.inUse")),1),m(By,{class:"price-value bonus",size:"small",priceValue:e.asset.frozen??0,currencyName:e.asset.displayName,isFiat:e.asset.isFiat,hideConvertToBaseCurrencyValue:f.value,isSameParentStyle:"",dynamicCurrencyWidth:"",onClick:C},null,8,["priceValue","currencyName","isFiat","hideConvertToBaseCurrencyValue"])])):d("",!0)])),_:1}),m(u,null,{default:g((()=>[m(th,{actionType:p.value,"onUpdate:actionType":o[0]||(o[0]=e=>p.value=e),asset:e.asset},null,8,["actionType","asset"])])),_:1}),D.value||A.value?(n(),i(Tr,{key:0,actionType:p.value,defaultCurrency:e.asset.shortName,onClosed:_},null,8,["actionType","defaultCurrency"])):d("",!0),b.value?(n(),i(De,{key:1,closeDialog:_,fromCurrency:e.asset.shortName},null,8,["fromCurrency"])):d("",!0)])),_:1},8,["index"])}}},[["__scopeId","data-v-a9caee34"]])},props:{asset:{type:Object,default:()=>({})},index:{type:Number,required:!0},hasInUseAsset:{type:Boolean,default:!1},toggleDetail:{type:Function,required:!0}},computed:{isAsset(){return"rowMain"===this.asset.type},isAssetDetail(){return"rowDetail"===this.asset.type}}},[["render",function(e,t,a,l,r,o){const u=s("SpotAssetsListRowAsset"),c=s("SpotAssetsListRowDetail");return o.isAsset?(n(),i(u,{key:0,asset:a.asset,index:a.index,toggleDetail:a.toggleDetail},null,8,["asset","index","toggleDetail"])):o.isAssetDetail?(n(),i(c,{key:1,asset:a.asset,index:a.index,hasInUseAsset:a.hasInUseAsset},null,8,["asset","index","hasInUseAsset"])):d("",!0)}]]),Sh={name:"WalletSeeMoreRow",components:{IconChevronDown:Ka},props:{showAllList:{type:Boolean,required:!0}},emits:["update:showAllList"],methods:{toggleSeeMore(){this.$emit("update:showAllList",!this.showAllList)}}},Ch={class:"action-btn"};const Lh=vr(Sh,[["render",function(e,t,a,l,i,o){const u=s("IconChevronDown");return n(),r("div",{class:"see-more",onClick:t[0]||(t[0]=(...e)=>o.toggleSeeMore&&o.toggleSeeMore(...e))},[y("div",Ch,[m(u,{class:L(["icon-chevron-down",{active:a.showAllList}]),"aria-label":"chevron right"},null,8,["class"])])])}],["__scopeId","data-v-2e75c453"]]),Eh={formatRowList(e){return e.map((e=>({...e,type:"rowMain",isOpenDetail:this.targetRow&&e[this.checkPropertyForMixin]===this.targetRow[this.checkPropertyForMixin]})))},formatRowDetailList(e){const t=wl(e);if(!this.targetRow||t.length<=0)return t;const a=t.findIndex((e=>e[this.checkPropertyForMixin]===this.targetRow[this.checkPropertyForMixin]));if(-1===a)return t;const l={...t[a],id:`${t[a].id}-detail`,type:"rowDetail"};return t.splice(a+1,0,l),t}},Ih={resetTargetRow(){this.isToggleDetail=!1,this.targetRow=null},formatToggleFirstRowList(e){return this.isToggleDetail?e:e.map(((e,t)=>0===t?(this.targetRow=e,{...e,isOpenDetail:!0}):e))},toggleDetail(e){this.isToggleDetail=!0,this.targetRow&&e[this.checkPropertyForMixin]===this.targetRow[this.checkPropertyForMixin]?this.targetRow=null:this.targetRow=e}},{enableWalletCombineSpotWithAutoTrader:kh,enableSpotWalletShowInUse:Rh,enableWalletBonusAsset:Nh,spotTradeDefaultQuoteCurrency:xh}=Ge,Ph={name:"SpotAssetsList",components:{SpotAssetsListHeader:Ey,SpotAssetsListRow:_h,WalletSeeMoreRow:Lh},props:{searchKey:{type:String,default:""},filterKey:{type:String,required:!0},hideSmall:{type:Boolean,default:!1}},setup(){const{hasFeature:e}=Nt();return{hasFeature:e}},data:()=>
1({sortKey:null,sortOrder:null,targetRow:null,isToggleDetail:!1,checkPropertyForMixin:"shortName",showAllList:!1,hideSeeMoreRow:!1}),computed:{...Dl.computed,...bl.computed,...Al.computed,...l(["currencyMap","fiatCurrencyList","cryptoCurrencyList","hideWalletSmallBalanceSpot"]),...a(Cl,{spotMarketList:"marketList",spotMarketMap:"marketMap"}),...a(pt,{autoTraderWallet:"wallet"}),headerTitlesData(){return[{id:"toggle",textAlign:"center"},{id:"shortName",lang:"wallets.spotList.asset",textAlign:"left",sortable:!0},{id:"available",lang:"wallets.spotList.available",tooltip:Nh?this.$t("wallets.spotList.available.bonus.tooltip.v2"):"",sortable:!0}]},availableSpotMarketSet(){const e=new Set;return this.spotMarketList.forEach((t=>{var a,l;const s=t.split("-")[0];s===xh?null==(a=this.spotMarketMap[t])||a.availableQuotes.forEach((t=>{e.add(t.shortName)})):e.add(s),(null==(l=this.spotMarketMap[s])?void 0:l.baseCurrency)&&e.add(this.spotMarketMap[s].baseCurrency)})),e},investmentAssetList(){return this.autoTraderWallet.assets||[]},assetsData(){const e=Sl(this.formatRowList,this.formatAssetI18nName,this.filterList,this.searchList,this.sortList,this.getHideSmallList,this.formatToggleFirstRowList,this.formatRowDetailList);let t=this.defaultCurrencyList;return(this.showAllList||""!==this.searchKey)&&(t=[...this.defaultCurrencyList,...this.otherCurrencyList]),t=t.filter(this.filterNonOperableZeroBalanceAssets),this.sortKey&&(t=this.convertToBaseCurrencyValue(t,this.sortKey)),kh?e(t).map((e=>{var t;const a=(null==(t=this.investmentAssetList.find((t=>t.shortName===e.shortName)))?void 0:t.totalValue)||0,l=N(e.total).plus(a);return{...e,total:l,investment:a}})):e(t)},hasInUseAsset(){return Rh&&this.assetsData.some((({frozen:e})=>e))}},watch:{searchKey(){this.resetTargetRow(),this.checkShowSeeMoreRow()},filterKey(){this.resetTargetRow()},sortKey(){this.resetTargetRow()}},created(){this.getExpressBuyCoinList()},methods:{...Dl.methods,...Eh,...Ih,...e(Lr,["getExpressBuyCoinList"]),setSortData({key:e,order:t}){this.sortKey=e,this.sortOrder=t},filterNonOperableZeroBalanceAssets({shortName:e,isCrypto:t,total:a,investment:l,virtual:s,allowConvert:i,allowDeposit:n,allowWithdraw:r,allowSwap:o,allowEarn:u}){return!(!t&&0===Number(a??0)&&0===Number(l??0)&&0===Number(s??0))||(!(!this.hasFeature(It.DEPOSIT)||!n)||(!(!this.hasFeature(It.WITHDRAWAL)||!r)||(!(!this.hasFeature(It.CONVERT)||!i)||(!(!this.hasFeature(It.SWAP)||!o)||(!(!this.hasFeature(It.GO_EARN_PAGE)||!u)||!(!this.hasFeature(It.GO_TRADING_PAGE)||!this.availableSpotMarketSet.has(e)))))))},getHideSmallList(e){return this.hideSmall&&!this.searchKey?e.filter((e=>{const t=N(e.total).times(e.usdRate).toNumber(),a=N(e.available).times(e.usdRate).toNumber();return t>=_l||a>=_l})):e},checkShowSeeMoreRow(){this.hideSeeMoreRow=""!==this.searchKey}}},Oh={class:"wrapper"},$h={ref:"table",class:"table-wrapper"};const Wh=vr(Ph,[["render",function(e,t,a,l,o,u){const c=s("SpotAssetsListHeader"),h=s("SpotAssetsListRow"),v=s("DataTable"),f=s("WalletSeeMoreRow");return n(),r("div",Oh,[y("div",$h,[m(v,{fixHeader:""},{header:g((()=>[m(c,{headerTitles:u.headerTitlesData,sortKey:o.sortKey,onSort:u.setSortData},null,8,["headerTitles","sortKey","onSort"])])),body:g((()=>[(n(!0),r(p,null,x(u.assetsData,((t,a)=>(n(),i(h,{key:t.id,index:a,asset:t,hasInUseAsset:u.hasInUseAsset,toggleDetail:e.toggleDetail},null,8,["index","asset","hasInUseAsset","toggleDetail"])))),128))])),_:1})],512),a.hideSmall||o.hideSeeMoreRow?d("",!0):(n(),i(f,{key:0,showAllList:o.showAllList,"onUpdate:showAllList":t[0]||(t[0]=e=>o.showAllList=e)},null,8,["showAllList"]))])}],["__scopeId","data-v-8afd936b"]]),{disabledCurrencyTypes:Fh}=Ge,Bh=[El.ALL_ASSETS,El.FIAT,El.STABLE_COINS,El.CRYPTO_CURRENCY],Uh={class:"icon-filter"},Mh=["onClick"];const Vh=vr({name:"WalletFilter",components:{IconFilter:Ll},emits:["update:filterKey"],data:()=>({show:!1}),computed:{nameMaping(){return{[El.ALL_ASSETS]:this.$t("wallets.allAssets"),[El.FIAT]:this.$t("wallets.fiat"),[El.STABLE_COINS]:this.$t("wallets.stablecoins"),[El.CRYPTO_CURRENCY]:this.$t("wallets.crypto")}},filterGroupList:()=>Fh.length>0?Bh.filter((e=>!Fh.includes(e))):Bh}
1,methods:{toggle(){this.show=!this.show},hide(){this.show=!1},select(e){this.$emit("update:filterKey",e),this.hide()}}},[["render",function(e,t,a,l,i,o){const u=s("IconFilter");return n(),r("div",Uh,[m(u,{class:"icon",onClick:o.toggle},null,8,["onClick"]),y("div",{class:L(["filters",{show:i.show}])},[(n(!0),r(p,null,x(o.filterGroupList,(e=>(n(),r("div",{key:e,class:"item",onClick:t=>o.select(e)},[y("span",null,h(o.nameMaping[e]),1)],8,Mh)))),128))],2)])}],["__scopeId","data-v-23bb96bc"]]),{style:Hh}=Bt,Gh={name:"WalletHideSmallBalance",components:{SwitchButton:ll,IconInfo2:Fa},props:{type:{type:String,required:!0},state:{type:Boolean,required:!0},isDisable:{type:Boolean,default:!1}},data(){return{hideSmall:this.state}},computed:{text(){return this.isMobile?this.$t("wallets.hideSmall"):this.$t("wallets.hideSmallBalances")},isCheckbox:()=>Hh.hideSmallBalance.checkbox},watch:{hideSmall(e){this.setWalletHideSmallBalance({type:this.type,value:e})}},methods:{...c(["setWalletHideSmallBalance"])}},Yh={key:1,class:"switch-wrapper"};const qh=vr(Gh,[["render",function(e,t,a,l,o,u){const c=s("Checkbox"),d=s("SwitchButton"),p=s("IconInfo2"),v=s("Tooltip");return n(),r("div",{class:L(["hide-small",{disabled:a.isDisable}])},[u.isCheckbox?(n(),i(c,{key:0,value:o.hideSmall,"onUpdate:value":t[0]||(t[0]=e=>o.hideSmall=e),disabled:a.isDisable},{default:g((()=>[y("span",null,h(u.text),1)])),_:1},8,["value","disabled"])):(n(),r("div",Yh,[m(d,{modelValue:o.hideSmall,"onUpdate:modelValue":t[1]||(t[1]=e=>o.hideSmall=e)},null,8,["modelValue"]),y("span",null,h(u.text),1)])),m(v,{class:"hide-small-tooltip",tooltipStyle:{width:"203px"},placement:"top-end"},{content:g((()=>[m(p,{class:"info-icon"})])),tooltip:g((()=>[y("span",null,h(e.$t("wallets.hideSmallBalances.tooltip")),1)])),_:1})],2)}],["__scopeId","data-v-73debe0c"]]);const zh=vr({name:"WalletIsConvertToBase",props:{state:{type:Boolean,required:!0},isDisable:{type:Boolean,default:!1}},data(){return{isConvert:this.state}},computed:{...a(ze,["displayCurrency"]),text(){return this.$t("wallets.hideBaseValueConvert",{currency:this.displayCurrency})}},watch:{isConvert(e){this.setWalletIsConvertToBase(e)}},methods:{...c(["setWalletIsConvertToBase"])}},[["render",function(e,t,a,l,i,o){const u=s("Checkbox");return n(),r("div",{class:L(["convert-check-wrapper",{disabled:a.isDisable}])},[m(u,{value:i.isConvert,"onUpdate:value":t[0]||(t[0]=e=>i.isConvert=e),disabled:a.isDisable},{default:g((()=>[y("span",null,h(o.text),1)])),_:1},8,["value","disabled"])],2)}],["__scopeId","data-v-79c91ea4"]]),{visible:Kh}=Bt,jh={name:"SpotAssets",components:{WalletSearchInput:Kr,WalletHideSmallBalance:qh,WalletFilter:Vh,SpotAssetsList:Wh,WalletIsConvertToBase:zh},props:{isShowAction:{type:Boolean,default:!0}},data:()=>({INPUT_TYPES:Il,searchKey:"",filterKey:El.ALL_ASSETS}),computed:{...l(["hideWalletSmallBalanceSpot","hideConvertToBaseCurrencyValue"]),isSearchVisible:()=>Kh.search,isHideValueVisible:()=>Kh.hideValue,isWalletFilterVisible:()=>Kh.filter}},Xh={class:"spot-assets"},Qh={key:0,class:"action-wrapper"};const Zh=vr(jh,[["render",function(e,t,a,l,o,u){const c=s("WalletSearchInput"),p=s("WalletFilter"),h=s("WalletIsConvertToBase"),v=s("WalletHideSmallBalance"),g=s("SpotAssetsList");return n(),r("div",Xh,[a.isShowAction?(n(),r("div",Qh,[y("div",{class:L(["action-top",{"row-reverse":!u.isSearchVisible}])},[u.isSearchVisible?(n(),i(c,{key:0,value:o.searchKey,"onUpdate:value":t[0]||(t[0]=e=>o.searchKey=e),class:"search-input",height:"32px",type:o.INPUT_TYPES.BOX},null,8,["value","type"])):d("",!0),u.isWalletFilterVisible?(n(),i(p,{key:1,filterKey:o.filterKey,"onUpdate:filterKey":t[1]||(t[1]=e=>o.filterKey=e),class:"wallet-filter"},null,8,["filterKey"])):d("",!0)],2),u.isHideValueVisible?(n(),i(h,{key:0,class:"wallet-is-convert-base",state:e.hideConvertToBaseCurrencyValue},null,8,["state"])):d("",!0),m(v,{class:"wallet-hide-small",type:"spot",state:e.hideWalletSmallBalanceSpot,isDisable:!!o.searchKey},null,8,["state","isDisable"])])):d("",!0),m(g,{searchKey:o.searchKey,filterKey:o.filterKey,hideSmall:e.hideWalletSmallBalanceSpot},null,8,["searchKey","filterKey","hideSmall"])])}],["__scopeId","data-v-7a07b504"]]),Jh={name:"SpotAssetsListHeader",components:{SortableHeaderCell:cl,IconInfo2:Fa},props:{headerTitles:{type:Array,default:function(){return[]}},sortKey:{type:[Boolean,String],default:void 0}},methods:{...Ly,getClass(e){const t=[];return e.textAlign&&t.push(`align-${e.textAlign}`),t}}},ev={class:"tooltip-highlight"},tv={class:"tooltip-highlight"},av={class:"tooltip-highlight"},lv={class:"tooltip-highlight"},sv={class:"tooltip-highlight"};const iv=vr(Jh,[["render",function(e,t,a,l,o,u){const c=s("IconInfo2"),d=s("i18n-t"),v=s("ToolTip"),f=s("SortableHeaderCell"),T=s("HeaderRow");return n(),i(T,{class:"row"},{default:g((()=>[(n(!0),r(p,null,x(a.headerTitles,(t=>(n(),i(f,b({ref_for:!0},e.$attrs,{id:e.formatSortKey(t.id),key:t.id,currentSortKey:a.sortKey,class:u.getClass(t),title:t,iconType:"triangle"}),D({content:g((()=>[y("span",null,h(e.$t(t.lang))+" "+h(t.more),1)])),_:2},[t.tooltip?{name:"tooltip",fn:g((()=>[m(v,{placement:"top"},{content:g((()=>[m(c,{class:"info-icon"})])),tooltip:g((()=>[m(d,{keypath:t.tooltip,tag:"span"},{openOrders:g((()=>[y("span",ev,h(e.$t("history.order.openOrders")),1)])),withdrawalProcessing:g((()=>[y("span",tv,h(e.$t("t.withdrawalProcessing")),1)])),oneClickFutures:g((()=>[y("span",av,h(e.$t("trading.ocf.title")),1)])),autoTrader:g((()=>[y("span",lv,h(e.$t("nav.autoTrader")),1)])),upOrDown:g((()=>[y("span",sv,h(e.$t("nav.upOrDown")),1)])),_:2},1032,["keypath"])])),_:2},1024)])),key:"0"}:void 0]),1040,["id","currentSortKey","class","title"])))),128))])),_:1})}],["__scopeId","data-v-d20217d5"]]),nv={class:"full-name"},rv=vr({__name:"SpotAssetsListRow",props:{asset:{type:Object,default:()=>({})},index:{type:Number,required:!0},hasInUseAsset:{type:Boolean,default:!1}},setup(e){const{enableWalletCombineSpotWithAutoTrader:t,enableWalletBonusAsset:a}=Ge,l=e,r=U(),o=Ya(),{$openDialog:u}=Tl(),c=R((()=>r.state.hideConvertToBaseCurrencyValue)),p=R((()=>l.asset.isFiat?Er.fiatCurrency(l.asset.shortName):Er.digitalCurrency(l.asset.shortName))),v=R((()=>o.isDisplayBonusColumn)),f=R((()=>r.state.redeemedBonusCurrencies[l.asset.shortName]||!1));function T(){u(uh,{currency:l.asset.shortName})}function w(){u(mh,{currency:l.asset.shortName})}return(l,r)=>{const o=s("Cell"),u=s("Row");return n(),i(u,{class:"assets-row",index:e.index,disableBackgroun
1d:!0,disableCssHoverEffect:!0},{default:g((()=>[m(o,{class:"asset-name",textAlign:"left"},{default:g((()=>[m(Pa,{displayName:e.asset.displayName,"short-name":!0,type:e.asset.isFiat?"fiat":"icon",name:e.asset.shortName,size:"20"},null,8,["displayName","type","name"]),y("span",nv,h(p.value),1),m(Uy,{currency:e.asset.shortName},null,8,["currency"])])),_:1}),m(o,null,{default:g((()=>[m(By,{priceValue:e.asset.total,currencyName:e.asset.displayName,isFiat:e.asset.isFiat,hideConvertToBaseCurrencyValue:c.value},null,8,["priceValue","currencyName","isFiat","hideConvertToBaseCurrencyValue"])])),_:1}),m(o,null,{default:g((()=>[m(By,{priceValue:e.asset.available,currencyName:e.asset.displayName,isFiat:e.asset.isFiat,hideConvertToBaseCurrencyValue:c.value},null,8,["priceValue","currencyName","isFiat","hideConvertToBaseCurrencyValue"])])),_:1}),P(t)?(n(),i(o,{key:0},{default:g((()=>[m(By,{priceValue:e.asset.investment,currencyName:e.asset.displayName,isFiat:e.asset.isFiat,hideConvertToBaseCurrencyValue:c.value},null,8,["priceValue","currencyName","isFiat","hideConvertToBaseCurrencyValue"])])),_:1})):d("",!0),P(a)&&v.value?(n(),i(o,{key:1},{default:g((()=>[f.value?(n(),i(By,{key:0,class:"clickable-text",priceValue:e.asset.virtual??0,currencyName:e.asset.displayName,isFiat:e.asset.isFiat,hideConvertToBaseCurrencyValue:c.value,dynamicCurrencyWidth:"",onClick:T},null,8,["priceValue","currencyName","isFiat","hideConvertToBaseCurrencyValue"])):d("",!0)])),_:1})):d("",!0),e.hasInUseAsset?(n(),i(o,{key:2},{default:g((()=>[e.asset.frozen>0?(n(),i(By,{key:0,class:"clickable-text",priceValue:e.asset.frozen??0,currencyName:e.asset.displayName,isFiat:e.asset.isFiat,hideConvertToBaseCurrencyValue:c.value,dynamicCurrencyWidth:"",onClick:w},null,8,["priceValue","currencyName","isFiat","hideConvertToBaseCurrencyValue"])):d("",!0)])),_:1})):d("",!0)])),_:1},8,["index"])}}},[["__scopeId","data-v-7f6b2146"]]),ov=["id"],uv=vr({__name:"WalletSpotActionCell",props:{walletAction:{type:String,required:!0,validator:e=>Object.values(It).includes(e)},currency:{type:String,default:""},isDisplayAction:{type:Boolean,default:!1}},emits:["onClick"],setup(e,{emit:t}){const a=e,l=t,u=R((()=>{switch(a.walletAction){case It.DEPOSIT:return St;case It.WITHDRAWAL:return bt;case It.CONVERT:case It.SWAP:return Lt;case It.GO_TRADING_PAGE:return At;case It.GO_EARN_PAGE:return Ct;case It.GO_HISTORY_PAGE:return at;default:return null}})),c=R((()=>{let e="";switch(a.walletAction){case It.DEPOSIT:e="deposit";break;case It.WITHDRAWAL:e="withdrawal";break;case It.CONVERT:e="convert";break;case It.SWAP:e="swap";break;case It.GO_TRADING_PAGE:e="trade";break;case It.GO_EARN_PAGE:e="earn";break;case It.GO_HISTORY_PAGE:e="spot_history"}return Xe(`btn_${a.currency.toLowerCase()}_${e}`)}));return(t,a)=>{const p=s("Cell");return n(),i(p,{class:"wallet-spot-action-cell"},{default:g((()=>[e.isDisplayAction?(n(),r("div",{key:0,id:c.value,class:"flex-center-center icon-wrap",onClick:a[0]||(a[0]=w((e=>l("onClick")),["stop"]))},[o(t.$slots,"icon",{},void 0,!0),!t.$slots.icon&&u.value?(n(),i(A(u.value),{key:0,class:"icon"})):d("",!0)],8,ov)):d("",!0)])),_:3})}}},[["__scopeId","data-v-0dc69876"]]),{enableKycV1PlusFlow:cv,spotTradeDefaultQuoteCurrency:dv}=Ge,{captureEvent:pv}=Ga(),yv=[It.DEPOSIT,It.WITHDRAWAL,It.CONVERT,It.SWAP,It.GO_TRADING_PAGE,It.GO_EARN_PAGE,It.GO_HISTORY_PAGE];const hv=vr({name:"WalletSpotActions",components:{WalletSpotActionCell:uv,WhichWalletActionView:Tr,ConvertDialog:De,DepositExpressBuyDialog:jy},props:{index:{type:Number,required:!0},currency:{type:String,default:""},asset:{type:Object,default:()=>({})},adjustPosition:{type:Object,default:()=>({top:0,left:0})}},emits:["update:actionsVisible"],setup(){const e=Ut(),{isDefiUser:t,isExpressBuyEntryAllowed:a}=S(e),{hasFeature:l,getIsUserFeatureAllow:s}=Nt();return{isDefiUser:t,isExpressBuyEntryAllowed:a,hasFeature:l,getIsUserFeatureAllow:s}},data:()=>({WALLET_ACTIONS:It,ACTION_LIST:yv,actionType:null,visible:!1,openDialog:!1,sendToRecorder:null,actionPosition:{},scrollParent:null,isShowDepositExpressBuyDialog:!1}),computed:{...gr.computed,...l(["currencyMap","lang","accountInfo"]),...a(Lr,["expressBuyCoinPairs"]),...t(["isAccountInfoExist","isSubAccount"]),currencyInfo(){return this.currencyMap[this.currency]||{}},showDepositView(){return this.actionType===It.DEPOSIT},showWithdrawView(){return this.actionType===It.WITHDRAWAL},showConvertDialog(){return this.actionType===It.CONVERT},isBrandNewStyle(){return[It.DEPOSIT].includes(this.actionType)},displayActionMap(){return this.getDisplayActionMap(Ft.SPOT_SPECIFIC,this.asset)},verificationI18nKey:()=>cv?"t.unlock":"t.verify"},watch:{openDialog(e){!1===e&&(this.actionType=null)}},created(){this.WALLET_ACTIONS=It},methods:{...gr.methods,...u(["getKycStatus"]),e2eID:Xe,init(e){this.getKycStatus().then((()=>{e&&e()}))},async onAction(e){switch(this.$sendEvent(Ot.EVENT_WEB_WALLET_SPOT_ACTION_TRIGGERED,{route:this.$route,currency:this.currency}),e){case It.DEPOSIT:this.$sendEvent(Ot.EVENT_WEB_GOTO_DEPOSIT_PAGE,{route:this.$route,fromWhere:$t.WALLET_SPOT_ACTIONS,currency:this.currency}),this.handleExpressBuy();break;case It.WITHDRAWAL:this.$sendEvent(Ot.EVENT_WEB_GOTO_WITHDRAW_PAGE,{route:this.$route,fromWhere:$t.WALLET_SPOT_ACTIONS,currency:this.currency}),this.handleWithdrawal();break;case It.CONVERT:this.handleConvert();break;case It.SWAP:this.handleSwap();break;case It.GO_TRADING_PAGE:this.handleGoTradingPage(),pl({entryChannel:yl.w
1alletSpot});break;case It.GO_EARN_PAGE:this.handleGoEarnPage();break;case It.GO_HISTORY_PAGE:this.handleGoHistoryPage()}this.isDefiUser&&Object.values(mu).includes(e)&&(await this.$nextTick(),this.actionType="")},handleExpressBuy(){this.isExpressBuyEntryAllowed&&this.expressBuyCoinPairs[this.currency]?this.isShowDepositExpressBuyDialog=!0:this.handleDeposit()},handleDeposit(){Va({entryChannel:this.currencyInfo.isFiat?Ha.spotWalletIndividualTokenFiat:Ha.spotWalletIndividualTokenCrypto,currency:this.currency}),pv("deposit_entrance",{entry_channel:this.currencyInfo.isFiat?"spot_wallet_individual_token_fiat":"spot_wallet_individual_token_crypto",currency:this.currency}),this.actionType=It.DEPOSIT,this.openDialog=!0,this.closeActions()},close(e=!1){e?this.init((()=>{this.handleWithdrawal(this.currency)})):(this.openDialog=!1,this.init())},handleWithdrawal(){this.actionType=It.WITHDRAWAL,this.openDialog=!0,this.closeActions()},handleConvert(){this.actionType=It.CONVERT,this.openDialog=!0,this.closeActions()},handleSwap(){this.$router.push({name:Ke.SWAP,params:{lang:this.lang},query:{fromCoin:this.currency}})},handleGoTradingPage(){const e=this.getMarketBaseCurrency(this.asset.shortName),t=this.spotTradeDefaultQuoteCurrencyQuoteMarkets.includes(this.asset.shortName)?`${dv}-${e}`:`${e}-${dv}`;this.$router.push({name:"tradingId",params:{lang:this.lang,id:t}})},handleGoHistoryPage(){this.$router.push({name:Ke.WALLET_SPOT_HISTORY,params:{lang:this.lang},query:{currency:this.currencyInfo.shortName}})},handleGoEarnPage(){this.$router.push({name:"earn",params:{lang:this.lang},query:{currency:this.currencyInfo.shortName}})},closeActions(){this.$emit("update:actionsVisible",!1)},handleCloseDialog(){this.actionType=null,this.openDialog=!1},gotoExpressBuy(){pv("express_buy_entrance",{entry_channel:"spot_fiat"}),this.$router.push({name:Ke.EXPRESS_BUY,params:{lang:this.lang},query:{spendCurrency:this.currency}})}}},[["render",function(e,t,a,l,o,u){const c=s("WalletSpotActionCell"),y=s("WhichWalletActionView"),h=s("ConvertDialog"),v=s("DepositExpressBuyDialog"),m=s("Row"),T=C("loading");return f((n(),i(m,{ref:"actions",class:"wallet-spot-actions",index:a.index,disableBackground:!0,disableCssHoverEffect:!0},{default:g((()=>[(n(!0),r(p,null,x(o.ACTION_LIST,(e=>(n(),r(p,{key:e},[l.hasFeature(e)?(n(),i(c,{key:0,walletAction:e,currency:a.currency,isDisplayAction:u.displayActionMap[e],onOnClick:t=>u.onAction(e)},null,8,["walletAction","currency","isDisplayAction","onOnClick"])):d("",!0)],64)))),128)),u.showDepositView||u.showWithdrawView?(n(),i(y,{key:0,actionType:o.actionType,defaultCurrency:u.currencyInfo.shortName,onClosed:u.handleCloseDialog},null,8,["actionType","defaultCurrency","onClosed"])):u.showConvertDialog?(n(),i(h,{key:1,closeDialog:u.handleCloseDialog,fromCurrency:u.currencyInfo.shortName},null,8,["closeDialog","fromCurrency"])):d("",!0),o.isShowDepositExpressBuyDialog?(n(),i(v,{key:2,fiatCurrency:a.currency,onToDeposit:t[0]||(t[0]=e=>u.handleDeposit()),onToExpressBuy:t[1]||(t[1]=e=>u.gotoExpressBuy()),onClose:t[2]||(t[2]=e=>o.isShowDepositExpressBuyDialog=!1)},null,8,["fiatCurrency"])):d("",!0)])),_:1},8,["index"])),[[T,!e.isAccountInfoExist]])}],["__scopeId","data-v-2964ce46"]]),vv=vr({__name:"SpotActionsTable",props:{assetsData:{type:Array,default:()=>[]}},setup(e){const t=[{id:It.DEPOSIT,lang:"wallets.fiatDeposit"},{id:It.WITHDRAWAL,lang:"wallets.digiccyWithdraw"},{id:It.CONVERT,lang:"wallets.convert"},{id:It.SWAP,lang:"wallets.swap"},{id:It.GO_TRADING_PAGE,lang:"wallets.trade"},{id:It.GO_EARN_PAGE,lang:"wallets.earn"},{id:It.GO_HISTORY_PAGE,lang:"wallets.spotList.history"}],{hasFeature:a}=Nt(),l=R((()=>t.filter((e=>a(e.id)))));return(t,a)=>{const o=s("HeaderRow"),u=s("DataTable");return n(),i(u,{class:"actions-wrapper",fixHeader:""},{header:g((()=>[m(o,{class:"header-row"},{default:g((()=>[(n(!0),r(p,null,x(l.value,(e=>(n(),r("th",b({ref_for:!0},t.$attrs,{key:e.id}),[y("span",null,h(t.$t(e.lang)),1)],16)))),128))])),_:1})])),body:g((()=>[(n(!0),r(p,null,x(e.assetsData,((e,t)=>(n(),i(P(hv),{key:e.id,class:"action-row",index:t,asset:e,currency:e.shortName},null,8,["index","asset","currency"])))),128))])),_:1})}}},[["__scopeId","data-v-b32231ae"]]),{enableWalletCombineSpotWithAutoTrader:mv,enableSpotWalletShowInUse:gv,enableWalletBonusAsset:fv,spotTradeDefaultQuoteCurrency:Tv}=Ge,wv={name:"SpotAssetsList",components:{SpotAssetsListHeader:iv,SpotAssetsListRow:rv,WalletSeeMoreRow:Lh,SpotActionsTable:vv},props:{searchKey:{type:String,default:""},filterKey:{type:String,required:!0},hideSmall:{type:Boolean,default:!1}},setup(){const{hasFeature:e}=Nt();return{hasFeature:e}},data:()=>
1({sortKey:null,sortOrder:null,showAllList:!1,hideSeeMoreRow:!1}),computed:{...Dl.computed,...bl.computed,...Al.computed,...l(["currencyMap","fiatCurrencyList","cryptoCurrencyList","hideWalletSmallBalanceSpot"]),...a(Cl,{spotMarketList:"marketList",spotMarketMap:"marketMap"}),...a(pt,{autoTraderWallet:"wallet"}),...t(["userBaseCurrency"]),...a(Ya,["isDisplayBonusColumn"]),headerTitlesData(){const e=[{id:"shortName",lang:"wallets.spotList.asset",textAlign:"left",sortable:!0},{id:"total",lang:"wallets.spotList.total",tooltip:fv?this.$t("wallets.spotList.total.bonus.tooltip"):"",textAlign:"right",sortable:!0},{id:"available",lang:"wallets.spotList.available",tooltip:fv?this.$t("wallets.spotList.available.bonus.tooltip.v2"):"",sortable:!0}];return mv&&e.push({id:"investment",lang:"t.investment",sortable:!0}),fv&&this.isDisplayBonusColumn&&e.push({id:"virtual",lang:"t.bonus",tooltip:this.$t("wallets.spotList.bonus.tooltip.v2"),textAlign:"right"}),this.hasInUseAsset&&e.push({id:"frozen",lang:"t.inUse",tooltip:Rl("wallets.spotList.inUse.tooltip")?"wallets.spotList.inUse.tooltip":"",textAlign:"right"}),e},availableSpotMarketSet(){const e=new Set;return this.spotMarketList.forEach((t=>{var a,l;const s=t.split("-")[0];s===Tv?null==(a=this.spotMarketMap[t])||a.availableQuotes.forEac
1h((t=>{e.add(t.shortName)})):e.add(s),(null==(l=this.spotMarketMap[s])?void 0:l.baseCurrency)&&e.add(this.spotMarketMap[s].baseCurrency)})),e},investmentAssetList(){return this.autoTraderWallet.assets||[]},assetsData(){const e=Sl(this.formatAssetI18nName,this.filterList,this.searchList,this.sortList,this.getHideSmallList);let t=this.defaultCurrencyList;return(this.showAllList||""!==this.searchKey)&&(t=[...this.defaultCurrencyList,...this.otherCurrencyList]),t=t.filter(this.filterNonOperableZeroBalanceAssets),this.sortKey&&(t=this.convertToBaseCurrencyValue(t,this.sortKey)),mv?e(t).map((e=>{var t;const a=(null==(t=this.investmentAssetList.find((t=>t.shortName===e.shortName)))?void 0:t.totalValue)||0,l=N(e.total).plus(a);return{...e,total:l,investment:a}})):e(t)},hasInUseAsset(){return gv&&this.assetsData.some((({frozen:e})=>e))}},watch:{searchKey(){this.checkShowSeeMoreRow()}},mounted(){this.getExpressBuyCoinList(),this.$nextTick((()=>{this.checkActiveStickyEffect()})),window.addEventListener("resize",this.checkActiveStickyEffect)},beforeUnmount(){window.removeEventListener("resize",this.checkActiveStickyEffect)},methods:{...e(Lr,["getExpressBuyCoinList"]),...Dl.methods,setSortData({key:e,order:t}){this.sortKey=e,this.sortOrder=t},filterNonOperableZeroBalanceAssets({shortName:e,isCrypto:t,total:a,investment:l,virtual:s,allowConvert:i,allowDeposit:n,allowWithdraw:r,allowSwap:o,allowEarn:u}){return!(!t&&0===Number(a??0)&&0===Number(l??0)&&0===Number(s??0))||(!(!this.hasFeature(It.DEPOSIT)||!n)||(!(!this.hasFeature(It.WITHDRAWAL)||!r)||(!(!this.hasFeature(It.CONVERT)||!i)||(!(!this.hasFeature(It.SWAP)||!o)||(!(!this.hasFeature(It.GO_EARN_PAGE)||!u)||!(!this.hasFeature(It.GO_TRADING_PAGE)||!this.availableSpotMarketSet.has(e)))))))},getHideSmallList(e){return this.hideSmall&&!this.searchKey?e.filter((e=>{const t=N(e.total).times(e.usdRate).toNumber(),a=N(e.available).times(e.usdRate).toNumber();return t>=_l||a>=_l})):e},checkShowSeeMoreRow(){""!==this.searchKey?this.hideSeeMoreRow=!0:this.hideSeeMoreRow=!1},checkActiveStickyEffect:kl((function(){if(!this.$refs.actionsTable)return;const e=this.$refs.tableWrapper,t=this.$refs.actionsTable.$el;e.scrollWidth>e.clientWidth?t.classList.add("sticky-effect"):t.classList.remove("sticky-effect")}),200)}},Dv={class:"wrapper"},Av={ref:"tableWrapper",class:"table-wrapper"};const bv=vr(wv,[["render",function(e,t,a,l,o,u){const c=s("SpotAssetsListHeader"),h=s("SpotAssetsListRow"),v=s("DataTable"),f=s("SpotActionsTable"),T=s("WalletSeeMoreRow");return n(),r("div",Dv,[y("div",Av,[m(v,{ref:"assetTable",class:"asset-table",fixHeader:""},{header:g((()=>[m(c,{class:"assets-list-header",headerTitles:u.headerTitlesData,sortKey:o.sortKey,onSort:u.setSortData},null,8,["headerTitles","sortKey","onSort"])])),body:g((()=>[(n(!0),r(p,null,x(u.assetsData,((e,t)=>(n(),i(h,{key:e.id,index:t,asset:e,hasInUseAsset:u.hasInUseAsset},null,8,["index","asset","hasInUseAsset"])))),128))])),_:1},512),m(f,{ref:"actionsTable",class:"actions-table",assetsData:u.assetsData},null,8,["assetsData"])],512),a.hideSmall||o.hideSeeMoreRow?d("",!0):(n(),i(T,{key:0,showAllList:o.showAllList,"onUpdate:showAllList":t[0]||(t[0]=e=>o.showAllList=e)},null,8,["showAllList"]))])}],["__scopeId","data-v-f3295257"]]),{disabledCurrencyTypes:_v}=Ge,Sv=[El.ALL_ASSETS,El.FIAT,El.CRYPTO_CURRENCY,El.STABLE_COINS],Cv={class:"filters",name:"filters"},Lv={class:"button-group"},Ev=["label","onClick"];const Iv=vr({name:"WalletFilter",props:{filterKey:{type:String,required:!0},filterRadio:{type:Array,default:function(){return Sv}}},emits:["update:filterKey"],data:()=>({filter:Sv[0]}),computed:{nameMaping(){return{[El.ALL_ASSETS]:this.$t("wallets.allAssets"),[El.FIAT]:this.$t("wallets.fiat"),[El.STABLE_COINS]:this.$t("wallets.stablecoins"),[El.CRYPTO_CURRENCY]:this.$t("wallets.crypto")}},filterRadioGroup(){return _v.length>0?this.filterRadio.filter((e=>!_v.includes(e))):this.filterRadio}},watch:{filter(e){this.$emit("update:filterKey",e)}}},[["render",function(e,t,a,l,s,i){return n(),r("div",Cv,[y("div",Lv,[(n(!0),r(p,null,x(i.filterRadioGroup,(e=>(n(),r("button",{key:e,class:L(["filter-button",{"is-checked":e===s.filter}
1]),type:"button",label:e,onClick:t=>s.filter=e},h(i.nameMaping[e]),11,Ev)))),128))])])}],["__scopeId","data-v-e6a60e9f"]]),{visible:kv}=Bt,Rv={name:"SpotAssets",components:{SpotAssetsList:bv,WalletSearchInput:Kr,WalletFilter:Iv,WalletHideSmallBalance:qh,WalletIsConvertToBase:zh},props:{isShowAction:{type:Boolean,default:!0}},data:()=>({searchKey:"",filterKey:El.ALL_ASSETS}),computed:{...l(["hideWalletSmallBalanceSpot","hideConvertToBaseCurrencyValue"]),isSearchVisible:()=>kv.search,isHideValueVisible:()=>kv.hideValue,isWalletFilterVisible:()=>kv.filter,wrapperClass:()=>kv.search||kv.filter?kv.search&&kv.filter?{"three-item":!0}:{"two-item":!0}:{"one-item":!0}},methods:{e2eID:Xe}},Nv={class:"spot-assets"},xv={class:"wallet-check-actions"};const Pv=vr(Rv,[["render",function(e,t,a,l,o,u){const c=s("WalletSearchInput"),p=s("WalletFilter"),h=s("WalletIsConvertToBase"),v=s("WalletHideSmallBalance"),g=s("SpotAssetsList");return n(),r("div",Nv,[a.isShowAction?(n(),r("div",{key:0,class:L(["action-wrapper",u.wrapperClass])},[u.isSearchVisible?(n(),i(c,{key:0,id:u.e2eID("input_search"),value:o.searchKey,"onUpdate:value":t[0]||(t[0]=e=>o.searchKey=e),width:"200px",height:"36px"},null,8,["id","value"])):d("",!0),u.isWalletFilterVisible?(n(),i(p,{key:1,filterKey:o.filterKey,"onUpdate:filterKey":t[1]||(t[1]=e=>o.filterKey=e),class:"wallet-filter"},null,8,["filterKey"])):d("",!0),y("div",xv,[u.isHideValueVisible?(n(),i(h,{key:0,class:"wallet-is-convert-base",state:e.hideConvertToBaseCurrencyValue},null,8,["state"])):d("",!0),m(v,{class:"wallet-hide-small",type:"spot",state:e.hideWalletSmallBalanceSpot,isDisable:!!o.searchKey},null,8,["state","isDisable"])])],2)):d("",!0),m(g,{searchKey:o.searchKey,filterKey:o.filterKey,hideSmall:e.hideWalletSmallBalanceSpot},null,8,["searchKey","filterKey","hideSmall"])])}],["__scopeId","data-v-79c347ac"]]),Ov={class:"tooltip-highlight"},$v={class:"tooltip-highlight"},Wv={class:"tooltip-highlight"},Fv={class:"tooltip-highlight"},Bv=vr({__name:"WalletSpot",setup(e){const{captureEvent:t}=Ga(),{enableWalletSpotPnL:a,enableWalletCombineSpotWithAutoTrader:l}=Ge,o=R((()=>Rl("wallets.spot.title.tooltip"))),u=U(),c=ze(),d=pt(),{loading:v}=Ir({isInitialize:l}),T=O(null),w=O(!0),A=R((()=>u.getters.isEnableAutoEarnAndHasSetData)),b=R((()=>c.displayCurrency)),_=R((()=>!!l&&(v.value||w.value)));return $(T,(e=>{if(e===It.DEPOSIT)Va({entryChannel:Ha.spotWallet}),t("deposit_entrance",{entry_channel:"spot_wallet"})})),j((()=>l&&d.update(!0).then((()=>{w.value=!1})))),q((()=>l&&d.removeTimer())),(e,t)=>{const u=s("i18n-t"),c=C("loading");return n(),r(p,null,[f((n(),i(Sy,{type:"spot",title:e.$t("router.walletSpot"),useWalletBalanceInfo:"",showPnlAnalysis:P(a),showAutoEarnButton:A.value,displayCurrency:b.value},D({"wallet-actions":g((()=>[m(Gu,{actionType:T.value,"onUpdate:actionType":t[0]||(t[0]=e=>T.value=e)},null,8,["actionType"])])),mobile:g((()=>[m(Zh,{isShowAction:!P(l)},null,8,["isShowAction"])])),desktop:g((()=>[m(Pv,{isShowAction:!P(l)},null,8,["isShowAction"])])),_:2},[o.value?{name:"title-tooltip",fn:g((()=>[m(u,{keypath:"wallets.spot.title.tooltip",tag:"span"},{spotTrading:g((()=>[y("span",Ov,h(e.$t("t.spotTrading")),1)])),oneClickFutures:g((()=>[y("span",$v,h(e.$t("trading.ocf.title")),1)])),autoTrader:g((()=>[y("span",Wv,h(e.$t("nav.autoTrader")),1)])),upOrDown:g((()=>[y("span",Fv,h(e.$t("nav.upOrDown")),1)])),_:1})])),key:"0"}:void 0]),1032,["title","showPnlAnalysis","showAutoEarnButton","displayCurrency"])),[[c,_.value]]),m(kr,{actionType:T.value,"onUpdate:actionType":t[1]||(t[1]=e=>T.value=e),shouldHandleDepositQuery:"",shouldHandleWithdrawQuery:""},null,8,["actionType"])],64)}}},[["__scopeId","data-v-eec188e6"]]),Uv={class:"history-main"},Mv={class:"header-wrapper"},Vv={class:"history-header"},Hv={key:0,class:"switcher-wrapper"},Gv=vr(E({__name:"WalletHistoryContainer",props:{enableSwitcher:{type:Boolean,default:!1},switcherList:{default:()=>[]},selected:{default:""},onSwitcherSelect:{type:Function,default:()=>{}}},setup(e){const t=e,a=V(),l=M(),s=O({}),i=R((()=>t.switcherList.map((({title:e})=>e)))),u=R((()=>t.switcherList.findIndex((({id:e})=>e===t.selected))));function c(e){t.onSwitcherSelect(t.switcherList[e].id)}return $([()=>t.selected,()=>a.query],(([e],[t])=>
1{if(e!==t){if(Object.keys(a.query).length>0&&(s.value[t||e]=a.query),t){const t=s.value[e]?{...s.value[e]}:{};l.replace({query:t})}}else s.value[e]=a.query}),{immediate:!0}),(e,t)=>(n(),r("div",Uv,[y("div",Mv,[y("div",Vv,[o(e.$slots,"header",{},void 0,!0)])]),e.enableSwitcher?(n(),r("div",Hv,[m(Pl,{class:"switcher",barHeight:4,type:P(xl).BOTTOM_BAR_NARROW,theme:P(Nl).compact,itemList:i.value,selected:u.value,onSelect:c},null,8,["type","theme","itemList","selected"])])):d("",!0),o(e.$slots,"content",{},void 0,!0)]))}}),[["__scopeId","data-v-022ab222"]]),Yv={name:"WalletSpotHistoryDropdown",components:{Dropdown:Wl,DropdownItem:$l,CurrencySearchInput:Ol},props:{list:{type:Array,default:()=>[]},handleUpdate:{type:Function,default:()=>{}},height:{type:String,default:"48px"},borderRadius:{type:String,default:"4px"},defaultValue:{type:String,default:""},placeholder:{type:String,default:""},hasSearch:{type:Boolean,default:!1},fixedOption:{type:Object,default:()=>({})}},emits:["handleFixedOption"],data(){var e;return{isSelectedFixedOption:!1,selectValue:this.defaultValue||(null==(e=this.list[0])?void 0:e.value),searchText:""}},computed:{hasFixedOption(){return!Fl(this.fixedOption)},selectItemName(){if(this.isSelectedFixedOption)return this.fixedOption.name;const e=this.list.find((e=>e.value===this.selectValue));return null==e?void 0:e.name},filterList(){return this.searchText?this.list.filter((e=>e.name.toUpperCase().includes(this.searchText.toUpperCase()))):this.list}},watch:{list(){this.setSelectValue()}},created(){this.hasFixedOption&&(this.isSelectedFixedOption=this.fixedOption.value===this.selectValue)},mounted(){this.$nextTick((()=>{const{walletDropdown:e}=this.$refs;(null==e?void 0:e.$el)&&(e.$el.style.setProperty("--input-height",`${this.height}`),e.$el.style.setProperty("--border-radius",`${this.borderRadius}`))}))},methods:{setSelectValue(){var e;this.defaultValue?this.selectValue=this.defaultValue:this.selectValue=null==(e=this.list[0])?void 0:e.value},handleSelect(e,t=!0){this.isSelectedFixedOption="ALL_PRODUCTS"===e,this.selectValue=e,t&&this.handleUpdate(e)},handleSearch(e){this.searchText=e},handleFixedOption(){this.isSelectedFixedOption=!0,this.selectValue=this.fixedOption.value,this.$emit("handleFixedOption",this.fixedOption.value),this.$refs.walletDropdown.hideDropdownList()},reset(e){var t;const{isCallbackHandler:a=!0}=e||{},l=this.defaultValue||(null==(t=this.list[0])?void 0:t.value);this.handleSelect(l,a)}}},qv={class:"wallet-dropdown-value"},zv={class:"top-wrap"};const Kv=vr(Yv,[["render",function(e,t,a,l,o,u){const c=s("CurrencySearchInput"),m=s("DropdownItem"),f=s("Dropdown");return n(),i(f,{ref:"walletDropdown",class:"wallet-dropdown",value:o.selectValue,onInput:u.handleSelect},D({placeholder:g((()=>[v(h(a.placeholder),1)])),value:g((()=>[y("span",qv,h(u.selectItemName),1)])),default:g((()=>[(n(!0),r(p,null,x(u.filterList,(e=>(n(),i(m,{key:e.name,value:e.value,isNotSelected:o.isSelectedFixedOption},{default:g((()=>[v(h(e.name),1)])),_:2},1032,["value","isNotSelected"])))),128))])),_:2},[a.hasSearch||u.hasFixedOption?{name:"listTopWrap",fn:g((()=>[y("div",zv,[a.hasSearch?(n(),i(c,{key:0,class:"search",width:"auto",height:"32px",placeholder:e.$t("msg.search"),isBrandNewStyle:"",onInput:u.handleSearch},null,8,["placeholder","onInput"])):d("",!0),u.hasFixedOption?(n(),r("div",{key:1,class:"fixed-option",onClick:t[0]||(t[0]=(...e)=>u.handleFixedOption&&u.handleFixedOption(...e))},h(a.fixedOption.name),1)):d("",!0)])])),key:"0"}:void 0]),1032,["value","onInput"])}],["__scopeId","data-v-99e26268"]]),jv={name:"WalletSpotInfoBlock",props:{data:{type:Array,default:()=>[]},selectedCurrency:{type:String,default:""}},computed:{...l(["currencyMap","lang"]),isSelectedAllCurrency(){return!this.selectedCurrency}},methods:{getCurrencyDisplayName(e){var t;return(null==(t=this.currencyMap[e])?void 0:t.displayName)||e},formatNumber(e,t){var a;const l=null==(a=this.currencyMap[t])?void 0:a.isFiat;return this.$filters.formatNumber(e,{formatKey:l?"fc":"",isDynamicDecimal:!l,currency:t})}}},Xv={class:"info-block-wrap"},Qv={class:"title-wrapper"},Zv={class:"sub-title"},Jv={class:"content-wrap"},em={class:"amount-info-wrapper"},tm={class:"value-wrap"},am={key:0,class:"around-symbol"},lm={class:"value"},sm={class:"currency"},im={key:0,class:"around-wrapper"},nm={class:"value"},rm={class:"currency"};const om=vr(jv,[["render",function(e,t,a,l,s,i){return n(),r("div",Xv,[(n(!0),r(p,null,x(a.data,(e=>(n(),r("div",{key:e.name,class:"info-block"},[y("div",Qv,[y("span",{class:L(["title",e.titleStyle])},h(e.title),3),y("span",Zv,h(e.subTitle),1)]),y("div",Jv,[(n(!0),r(p,null,x(e.data,(e=>(n(),r("div",{key:e.subTitle,class:"info"}
1,[y("div",em,[y("div",tm,[i.isSelectedAllCurrency?(n(),r("span",am,"â")):d("",!0),y("span",lm,h(i.formatNumber(e.value,e.currency)),1),y("span",sm,h(i.getCurrencyDisplayName(e.currency)),1)]),i.isSelectedAllCurrency?d("",!0):(n(),r("div",im,[y("span",nm," â "+h(i.formatNumber(e.aroundValue,e.aroundCurrency)),1),y("span",rm,h(e.aroundCurrency),1)]))])])))),128))])])))),128))])}],["__scopeId","data-v-66e58a2b"]]);const um=vr({name:"WalletSpotListHeader",components:{DataHeader:Xr,SortableHeaderCell:cl},props:{headerTitles:{type:Array,default:function(){return[]}}},computed:{...t(["isArabic"])},methods:{oppositeDirection:e=>"right"===e.textAlign?"left":"right",textAlignBasedOnI18n(e){return e.textAlign?this.isArabic?this.oppositeDirection(e):e.textAlign:"inherit"}}},[["render",function(e,t,a,l,o,u){const c=s("SortableHeaderCell"),d=s("DataHeader");return n(),i(d,{class:"row"},{default:g((()=>[(n(!0),r(p,null,x(a.headerTitles,(t=>(n(),i(c,b({ref_for:!0},e.$attrs,{key:t.id,style:{textAlign:u.textAlignBasedOnI18n(t)},title:t}),{content:g((()=>[y("span",null,h(e.$t(t.lang||""))+" "+h(t.more),1)])),_:2},1040,["style","title"])))),128))])),_:1})}]]),{enableGstAndTds:cm}=Ge,dm={name:"WalletSpotListRow",components:{DataRow:Ul,CellValue:Qr,IconChevronDown2:ca,IconColorAlert:Ae,CellText:Bl,CurrencyIcon:Pa},props:{data:{type:Object,default:()=>({})},index:{type:Number,required:!0}},emits:["click"],data:()=>({enableGstAndTds:cm}),computed:{...l(["currencyMap"]),isFiat(){return(this.currencyMap[this.data.currency]||{}).isFiat},currencyType(){return this.isFiat?"fiat":"icon"},historyTypeText(){switch(this.data.historyType){case"EXPRESS_BUY":return this.$t("display.expressBuy");case"EXPRESS_SELL":return this.$t("display.expressSell");default:return this.$t(`t.${this.data.historyType.toLowerCase()}`)}}},methods:{statusStyle(e){switch(e){case"PENDING":return"main";case"FAILURE":case"CANCELED":return"red";default:return"normal"}},formatDate:(e,t="yyyy-MM-dd HH:mm:ss")=>X(new Date(e),t)}},pm={class:"date-time-wrapper"},ym={class:"date"},hm={class:"time"};const vm=vr(dm,[["render",function(e,t,a,l,o,u){const c=s("Cell"),v=s("CurrencyIcon"),w=s("CellText"),D=s("CellValue"),A=s("IconColorAlert"),b=s("IconChevronDown2"),_=s("DataRow");return n(),i(_,{class:L(["spot-wallet-row",{"has-detail":a.data.hasDetail}]),index:a.index,disableBackground:!0,disableCssHoverEffect:!1,onClick:t[0]||(t[0]=t=>e.$emit("click",t))},{default:g((()=>[m(c,{textAlign:"left"},{default:g((()=>[y("div",pm,[y("span",ym,h(u.formatDate(a.data.date,"yyyy-MM-dd"))+"Â ",1),y("span",hm,h(u.formatDate(a.data.date,"HH:mm:ss")),1)])])),_:1}),m(c,{textAlign:"left"},{default:g((()=>[m(v,{class:"currency-wrapper",type:u.currencyType,name:a.data.currency,displayName:a.data.displayName,size:"16",shortName:""},null,8,["type","name","displayName"])])),_:1}),m(c,{textAlign:"left"},{default:g((()=>[m(w,{text:u.historyTypeText},null,8,["text"])])),_:1}),m(c,{textAlign:"left"},{default:g((()=>[m(w,{text:a.data.transactionRef},null,8,["text"])])),_:1}),o.enableGstAndTds?(n(),r(p,{key:0},[m(c,null,{default:g((()=>[m(D,{class:"amount-wrapper",value:a.data.fee,decimalFormat:u.isFiat?"fc":"",currency:a.data.displayName,isEmpty:null===a.data.fee,isFiat:u.isFiat,direction:"column"},null,8,["value","decimalFormat","currency","isEmpty","isFiat"])])),_:1}),m(c,null,{default:g((()=>[m(D,{class:"amount-wrapper",value:a.data.gstAmount,decimalFormat:u.isFiat?"fc":"",currency:a.data.displayName,isEmpty:null===a.data.gstAmount,isFiat:u.isFiat,direction:"column"},null,8,["value","decimalFormat","currency","isEmpty","isFiat"])])),_:1}),m(c,null,{default:g((()=>[m(D,{class:"amount-wrapper",value:a.data.tdsAmount,decimalFormat:u.isFiat?"fc":"",currency:a.data.displayName,isEmpty:null===a.data.tdsAmount,isFiat:u.isFiat,direction:"column"},null,8,["value","decimalFormat","currency","isEmpty","isFiat"])])),_:1})],64)):d("",!0),m(c,null,{default:g((()=>[m(D,{class:"amount-wrapper",value:a.data.netAmount,decimalFormat:u.isFiat?"fc":"",currency:a.data.displayName,isEmpty:null===a.data.netAmount,isFiat:u.isFiat,direction:"column"},null,8,["value","decimalFormat","currency","isEmpty","isFiat"])])),_:1}),m(c,{textAlign:"left"},{default:g((()=>[m(w,{class:L(["status",u.statusStyle(a.data.status)]),text:e.$t(`t.${a.data.status.toLowerCase()}`)},null,8,["class","text"]),a.data.sdkRequired?(n(),i(A,{key:0,class:"status-icon"})):d("",!0)])),_:1}),m(c,{class:"detail"},{default:g((()=>[f(m(b,{class:"detail-icon"},null,512),[[T,a.data.hasDetail]])])),_:1})])),_:1},8,["class","index"])}],["__scopeId","data-v-a446773c"]]),mm={name:"ValueRow",components:{CellValue:Qr,IconChevronDown2:ca},props:{text:{type:String,default:""},value:{type:[String,Number],default:""},decimalFormat:{type:String,default:"24"},currency:{type:String,default:""},isFiat:{type:Boolean,default:!1},type:{type:String,default:"title"},orderType:{type:String,default:""},isEmpty:{type:Boolean,default:!1},status:{type:String,default:""},showRightArrow:{type:Boolean,default:!1},onArrowClick:{type:Function,default:()=>{}}},computed:{date(){return"date"!==this.type?"":this.value.split(" ")[0]},time(){return"date"!==this.type?"":this.value.split(" ")[1]}},methods:{statusStyle(e){switch(e){case"PENDING":return"main";
1case"FAILURE":case"CANCELED":return"red";default:return"normal"}}}},gm={class:"title"},fm={key:1,class:"date"},Tm={class:"time"};const wm=vr(mm,[["render",function(e,t,a,l,u,c){const p=s("IconChevronDown2"),g=s("CellValue");return n(),r("div",{class:L(["value-row",[a.type,a.orderType]])},[y("span",gm,h(a.text),1),e.$slots.default?o(e.$slots,"default",{key:0},void 0,!0):"date"===a.type?(n(),r("p",fm,[y("span",null,h(c.date),1),y("span",Tm,h(c.time),1)])):"status"===a.type?(n(),r("span",{key:2,class:L(["status",c.statusStyle(a.status)])},[v(h(a.value)+" ",1),o(e.$slots,"statusExtra",{},void 0,!0)],2)):"details"===a.type?(n(),r("div",{key:3,class:"details-tail-wrapper",onClick:t[0]||(t[0]=(...e)=>a.onArrowClick&&a.onArrowClick(...e))},[v(h(e.$t("t.details"))+" ",1),m(p,{class:"detail-arrow-right-icon"})])):(n(),i(g,{key:4,class:"value",value:a.value,decimalFormat:a.decimalFormat,currency:a.currency,isFiat:a.isFiat,isEmpty:a.isEmpty},null,8,["value","decimalFormat","currency","isFiat","isEmpty"])),a.showRightArrow?(n(),i(p,{key:5,class:"arrow-right-icon",onClick:a.onArrowClick},null,8,["onClick"])):d("",!0)],2)}],["__scopeId","data-v-4a43a6d9"]]),{enableGstAndTds:Dm}=Ge,Am={name:"WalletSpotHistoryList",components:{ValueRow:wm,NoDataAvailable:Zt,IconColorAlert:Ae,CurrencyIcon:Pa},props:{listData:{type:Array,default:()=>[]}},emits:["showDetail"],data:()=>({enableGstAndTds:Dm}),computed:{...l(["currencyMap"])},methods:{getHistoryTypeText(e){switch(e){case"EXPRESS_BUY":return this.$t("display.expressBuy");case"EXPRESS_SELL":return this.$t("display.expressSell");default:return this.$t(`t.${e.toLowerCase()}`)}},formatDate(e){return this.$filters.formatDate(e,"yyyy-MM-dd HH:mm:ss")},getCurrencyType(e){return(this.currencyMap[e]||{}).isFiat?"fiat":"icon"},goToDetail(e){this.$emit("showDetail",e)}}},bm={class:"history-list"};const _m=vr(Am,[["render",function(e,t,a,l,o,u){const c=s("NoDataAvailable"),y=s("ValueRow"),h=s("CurrencyIcon"),v=s("IconColorAlert");return n(),r("div",bm,[f(m(c,{class:"empty-data",emptyText:e.$t("t.noDataFound")},null,8,["emptyText"]),[[T,0===a.listData.length]]),(n(!0),r(p,null,x(a.listData,(t=>(n(),r("div",{key:t.id,ref_for:!0,ref:"dataBlocks",class:"history-wrap data-block"},[m(y,{type:"date",text:u.getHistoryTypeText(t.historyType),value:u.formatDate(t.date)},null,8,["text","value"]),m(y,{type:"currency",text:e.$t("t.currency")},{default:g((()=>[m(h,{class:"currency-wrapper",type:u.getCurrencyType(t.currency),name:t.currency,displayName:t.displayName,size:"16",shortName:""},null,8,["type","name","displayName"])])),_:2},1032,["text"]),o.enableGstAndTds?(n(),r(p,{key:0},[m(y,{type:"sub-info",text:e.$t("t.fees"),value:t.fee,decimalFormat:t.isFiat?"fc":"24",currency:t.displayName,isFiat:t.isFiat,isEmpty:null===t.fee},null,8,["text","value","decimalFormat","currency","isFiat","isEmpty"]),m(y,{type:"sub-info",text:e.$t("t.gstOnFees"),value:t.gstAmount,decimalFormat:t.isFiat?"fc":"24",currency:t.displayName,isFiat:t.isFiat,isEmpty:null===t.gstAmount},null,8,["text","value","decimalFormat","currency","isFiat","isEmpty"]),m(y,{type:"sub-info",text:e.$t("t.tdsTax"),value:t.tdsAmount,decimalFormat:t.isFiat?"fc":"24",currency:t.displayName,isFiat:t.isFiat,isEmpty:null===t.tdsAmount},null,8,["text","value","decimalFormat","currency","isFiat","isEmpty"])],64)):d("",!0),m(y,{type:"sub-info",text:e.$t("t.netAmount"),value:t.netAmount,decimalFormat:t.isFiat?"fc":"24",currency:t.displayName,isFiat:t.isFiat,isEmpty:null===t.netAmount},null,8,["text","value","decimalFormat","currency","isFiat","isEmpty"]),m(y,{type:"status",status:t.status,text:e.$t("t.status"),value:e.$t(`t.${t.status.toLowerCase()}`)},{statusExtra:g((()=>[t.sdkRequired?(n(),i(v,{key:0,class:"status-icon"})):d("",!0)])),_:2},1032,["status","text","value"]),t.hasDetail?(n(),i(y,{key:1,type:"details",status:t.status,value:e.$t("t.details"),onArrowClick:()=>u.goToDetail(t)},null,8,["status","value","onArrowClick"])):d("",!0)])))),128))])}],["__scopeId","data-v-67786308"]]),Sm={class:"main-wrapper"};const Cm=vr({name:"DetailLoadingDialog",components:{Dialog:Ml}},[["render",function(e,t,a,l,r,o){const u=s("Dialog"),c=C("loading");return n(),i(u,{class:"detail-loading-dialog",width:e.$isLargeSize(e.$mq)?"560px":"9
10%",isBrandNewStyle:"",showClose:!1,fullStyle:e.isMobile},{header:g((()=>[v(h(e.$t("t.details")),1)])),body:g((()=>[f(y("div",Sm,null,512),[[c,!0]])])),_:1},8,["width","fullStyle"])}],["__scopeId","data-v-b1e7ffa3"]]),Lm={class:"top-info-wrapper"},Em={class:"top-title"},Im={class:"top-currency-amount"},km={class:"top-net-amount"},Rm={class:"top-tag"},Nm=vr(E({__name:"HistoryDetailTopInfo",props:{title:{type:String,required:!0},currency:{type:String,required:!0},amountText:{type:String,required:!0},status:{type:String,required:!0},statusText:{type:String,default:""}},setup(e){const{t:t}=I(),a=e,l=Ut(),{currencyMap:s}=S(l),i=R((()=>s.value[a.currency]||{})),u=R((()=>{switch(a.status){case be.PROCESSING:return Vl.YELLOW;case be.COMPLETED:return Vl.GREEN;case be.FAILURE:return Vl.RED;default:return}})),c=R((()=>{if(a.statusText)return a.statusText;const e=`t.${a.status.toLowerCase()}`;return Rl(e)?t(e):Hl(a.status.toLowerCase())}));return(t,a)=>(n(),r("div",Lm,[y("div",Em,h(e.title),1),y("div",Im,[m(Pa,{type:i.value.isFiat?P(Gl).FIAT:P(Gl).COIN,name:i.value.displayName,showName:!1,size:"24"},null,8,["type","name"]),y("span",km,h(e.amountText),1)]),y("div",Rm,[m(Yl,{type:u.value,text:c.value},null,8,["type","text"]),o(t.$slots,"statusSuffix",{},void 0,!0)]),o(t.$slots,"statusBottom",{},void 0,!0)]))}}),[["__scopeId","data-v-db42ca59"]]),xm={class:"info-label"},Pm={class:"info-value"},Om=["href"],$m={key:1},Wm=vr(E({__name:"HistoryDetailInfoCard",props:{infoList:{},theme:{default:"outline"}},setup(e){const t=e;return(e,a)=>(n(),r("div",{class:L(["detail-info-card",{"theme-filled":"filled"===t.theme}])},[(n(!0),r(p,null,x(e.infoList,((e,t)=>(n(),r("div",{key:t,class:"info-row"},[y("span",xm,h(e.label),1),y("span",Pm,[e.link?(n(),r("a",{key:0,href:e.link,target:"_blank",class:"value-link"},h(e.value||"-"),9,Om)):(n(),r("span",$m,h(e.value||"-"),1)),e.isCopy&&e.value?(n(),i(ql,{key:2,value:e.value},null,8,["value"])):d("",!0)])])))),128))],2))}}),[["__scopeId","data-v-92d2f4ad"]]),Fm={name:"DetailFileUploadName",components:{IconNotificationCheck:Za,IconDelete:Kl,IconNotificatoin:zl},props:{isUploadError:{type:Boolean,default:!1},file:{type:Object,default:()=>({})},onDeleteClick:{type:Function,default:()=>{}}},computed:{icon(){return this.isUploadError?"IconNotificatoin":"IconNotificationCheck"}}},Bm={class:"file-name"},Um={class:"file-name-wrapper"};const Mm={class:"detail-file-upload"},Vm={class:"image-upload-container"},Hm={class:"upload-wrap"},Gm=["id"],Ym={class:"upload-tip"},qm={key:0,class:"upload-files"};const zm=vr({name:"DetailFileUpload",components:{DetailFileUploadName:vr(Fm,[["render",function(e,t,a,l,o,u){const c=s("IconDelete");return n(),r("li",Bm,[y("div",Um,[(n(),i(A(u.icon),{class:L(a.isUploadError?"icon-error":"icon-check")},null,8,["class"])),v(" "+h(a.file.filename),1)]),m(c,{class:"icon-delete",onClick:t[0]||(t[0]=e=>a.onDeleteClick(a.file))})])}],["__scopeId","data-v-5dcadb2f"]]),IconArrowUpMoat:jl},props:{uploadBtnId:{type:String,default:""},auditId:{type:String,default:""}},emits:["onChange"],data:()=>({fileList:[],files:[],isDrag:!1,isLoading:!1}),computed:{id(){return this.$route.query.id||this.auditId}},created(){this.fetchFile()},methods:{onChange(e){this.fileList=e.currentTarget.files,this.uploadFile()},dragover(e){e.preventDefault(),this.isDrag=!0},dragleave(e){e.preventDefault(),this.isDrag=!1},drop(e){e.preventDefault(),this.isDrag=!1,this.fileList=e.dataTransfer.files,this.uploadFile()},checkFileType:e=>e.includes("image/png")||e.includes("image/jpeg")||e.includes("application/pdf"),uploadFile(){this.isLoading=!0,this.fileList&&(this.fileList.forEach((e=>{const{type:t,size:a}=e;a<=5242880&&this.checkFileType(t)&&Xl.uploadDepositImage({id:this.id,file:e}).then((()=>{this.fetchFile()})).catch((e=>{}))})),this.isLoading=!1)},onDeleteClick(e){Xl.deleteDepositImage({auditId:this.id,uploadId:e.id}).then((()=>{this.fetchFile()}))},fetchFile(){this.isLoading=!0,Xl.getDepositImage(this.id).then((e=>{this.files=e,this.$emit("onChange",this.files)})).finally((()=>this.isLoading=!1))},onUpload(){this.$refs.inputFile.click()}}},[["render",function(e,t,a,l,o,u){const c=s("IconArrowUpMoat"),v=s("DetailFileUploadName"),g=C("loading");return n(),r("div",Mm,[f((n(),r("div",Vm,[y("div",{class:L(["image-upload-section",{"drag-hover":o.isDrag}]),onDragover:t[2]||(t[2]=(...e)=>u.dragover&&u.dragover(...e)),onDragleave:t[3]||(t[3]=(...e)=>u.dragleave&&u.dragleave(...e)),onDrop:t[4]||(t[4]=(...e)=>u.drop&&u.drop(...e))},[y("div",Hm,[y("div",{id:a.uploadBtnId,class:"des-wrap",onClick:t[0]||(t[0]=(...e)=>u.onUpload&&u.onUpload(...e))},[m(c,{class:"upload__icon"}),y("p",Ym,h(e.$t("history.spot.detail.deposit.add-files.desc3")),1)],8,Gm),o.files.length>0?(n(),r("ul",qm,[(n(!0),r(p,null,x(o.files,(e=>(n(),i(v,{key:e.id,file:e,onDeleteClick:u.onDeleteClick},null,8,["file","onDeleteClick"])))),128))])):d("",!0),y("input",{ref:"inputFile",type:"file",accept:"application/pdf,image/*",multiple:"",onChange:t[1]||(t[1]=(...e)=>u.onChange&&u.onChange(...e))},null,544)])],34)])),[[g,o.isLoading]])])}],["__scopeId","data-v-0f5e1d85"]]),Km={class:"fiat-deposit-details"},jm={class:"deposit-from-wrapper"},Xm={class:"section-title"},Qm={class:"deposit-from-info"},Zm={class:"payment-way"},Jm={key:0,class:"bank-name"},eg={key:1},tg={class:"deposit-amount-wrapper"},ag={class:"amount-title"},lg={class:"amount-number-wrap"},sg={class:"amount-number"},ig={class:"currency"},ng={class:"deposit-to-wrapper"},rg={class:"section-title"},og={class:"brand"},ug={class:"deposit-to-content"},cg={class:"content-title"},dg={class:"content-value-wrap"},pg=["innerHTML"],yg={class:"upload-title-wrap"},hg={class:"section-title"},vg={class:"required"},mg={key:1,class:"slip-desc"},gg={class:"btn-block"},fg=vr(E({__name:"DepositBankDetail",props:{detailData:{}},emits:["submitted"],setup(e,{emit:t}){const{t:a}=I(),{enableDepositReferenceNumber:l}=Ge,o=t,u=e,c=O(0),f=R((()=>u.detailData.amount)),T=R((()=>u.detailData.amountCurrency)),w=R((()=>u.detailData.method||"")),D=R((()=>{var e;return(null==(e=u.detailData)?void 0:e.bank)||{}})),A=R((()=>u.detailData.bankAccount||"")),b=R((()=>u.detailData.bankName||"")),_=R((()=>{const{provider:e,method:t}=u.detailData||{};return t?e&&e!==Ql.SELF?`${e}_${t}`:t:""})),S=R((()=>{const e=_.value;if(!e)return"";const t=`wallets.paymentWay.${e}`;return Rl(t)?a(t):e})),C=R((()=>{var e,t;return null==(t=null==(e=u.detailData)?void 0:e.bank)?void 0:t.accountAddress})),E=R((()=>{var e;return(null==(e=u.detailData)?void 0:e.transactionRef)||""})),k=R((()=>0===c.value)),N=R((()=>{const{accountName:e,accountNumber:t,accountNumberLabel:s,bankName:i,swiftCode:n,bankCodeLabel:r,bankAddress:o}=D.value;return[{title:a("account.payment.bankAccount.beneficiaryName"),value:e,enabled:Boolean(e)},{title:s,value:t,enabled:Boolean(t)},{title:a("account.payment.bankAccount.beneficiaryAddress"),value:C.value,enabled:Boolean(C.value)},{title:a("account.payment.bankAccount.bankName"),value:i,enabled:Boolean(i)},{title:r,value:n,enabled:Boolean(n)&&w.value!==Zl.SEPA},{title:a("account.payment.bankAccount.bankAddress"),value:o,enabled:Boolean(o)},{title:a("wallets.exchange.details.referenceNumber"),value:E.value,enableCopy:!0,highlight:!0,tipText:a("wallets.depositDetails.referenceNumber.tip.2"),enabled:l}].filter((e=>e.enabled))}));function $(e){c.value=e.length}function W(){o("submitted")}return(e,t)=>{const o=s("i18n-t"),u=s("BaseButton");return n(),r("div",Km,[y("div",jm,[y("div",Xm,h(P(a)("wallets.deposit.depositFrom")),1),y("div",Qm,[y("div",Zm,h(S.value),1),b.value?(n(),r("div",Jm,h(b.value),1)):d("",!0),A.value?(n(),r("div",eg,"("+h(A.value)+")",1)):d("",!0)]),y("div",tg,[y("div",ag,h(P(a)("wallets.depositDetails.amount")),1),y("div",lg,[y("span",sg,h(e.$filters.formatNumber(f.value,"max")),1),y("span",ig,h(T.value),1)])])]),t[2]||(t[2]=y("div",{class:"divider"},null,-1)),Object.keys(D.value).length?(n(),r(p,{key:0},[y("div",ng,[y("div",rg,h(P(a)("wallets.deposit.depositTo")),1),y("span",og,h(P(a)("brand.name")),1)]),y("div",ug,[(n(!0),r(p,null,x(N.value,(e=>(n(),r("div",{key:e.title,class:"content-row"}
1,[y("span",cg,h(e.title),1),y("div",dg,[e.enableCopy?(n(),i(_e,{key:0,class:"info-copy",copyText:e.value,copyValue:e.value,highlight:e.highlight},null,8,["copyText","copyValue","highlight"])):(n(),r("span",{key:1,class:L(["value",{highlight:e.highlight}])},h(e.value),3)),e.tipText?(n(),r("div",{key:2,class:"tip",innerHTML:e.tipText},null,8,pg)):d("",!0)])])))),128))]),t[1]||(t[1]=y("div",{class:"divider"},null,-1)),m(Jl,{class:"upload-des-wrapper",isFullWidth:!0},{title:g((()=>[y("div",yg,[t[0]||(t[0]=y("div",{class:"required-symbol"},"*",-1)),y("div",hg,h(P(a)("wallets.depositDetails.upload.title")),1),y("div",vg,"("+h(P(a)("rules.required"))+")",1)])])),default:g((()=>[P(l)?(n(),i(o,{key:0,class:"slip-desc",keypath:"payment.deposit.uploadBankSlip.desc",tag:"div"},{referenceNumber:g((()=>[y("b",null,h(P(a)("payment.deposit.uploadBankSlip.referenceNumber")),1)])),_:1})):(n(),r("div",mg,h(P(a)("payment.deposit.uploadBankSlip.descWithoutRef")),1)),m(zm,{auditId:e.detailData.id,onOnChange:$},null,8,["auditId"])])),_:1})],64)):d("",!0),y("div",gg,[m(u,{size:"large",class:"primary action-btn",disabled:k.value,onClick:W},{default:g((()=>[v(h(P(a)("t.submit")),1)])),_:1},8,["disabled"])])])}}}),[["__scopeId","data-v-31b7255b"]]),Tg={class:"submit-success-wrap"},wg={class:"title"},Dg=vr(E({__name:"DepositSlipSubmittedDialog",emits:["dialog:closed"],setup:e=>(e,t)=>{const a=s("BaseButton");return n(),i(wt,{width:"560px",isBrandNewStyle:"",fullStyle:e.isMobile,onClosed:t[1]||(t[1]=t=>e.$emit("dialog:closed"))},{header:g((()=>[v(h(e.$t("kyc.submitted.title")),1)])),body:g((()=>[y("div",Tg,[m(es),y("span",wg,h(e.$t("t.processing")),1),y("p",null,h(e.$t("wallets.deposit.bankTransferUS.processing.text1")),1),y("p",null,h(e.$t("wallets.deposit.bankTransferUS.processing.text2")),1),m(a,{size:"large",class:"primary action-btn",onClick:t[0]||(t[0]=t=>e.$emit("dialog:closed"))},{default:g((()=>[v(h(e.$t("t.ok")),1)])),_:1})])])),_:1},8,["fullStyle"])}}),[["__scopeId","data-v-252b4ae3"]]),Ag={class:"deposit-cancel-wrap"},bg={class:"title"},_g={class:"des"},Sg=vr(E({__name:"DepositBankCancelDialog",props:{id:{}},emits:["dialog:closed"],setup(e,{emit:t}){const{t:a}=I(),l=t,r=e,o=O(!1);async function u(){o.value=!0;try{await Xl.cancelFiatDepositRequest(r.id),l("dialog:closed",{isCanceled:!0})}catch(e){3011===e&&l("dialog:closed",{isCanceled:!0})}finally{o.value=!1}}return(e,t)=>{const r=s("BaseButton");return n(),i(wt,{width:"360px",isBrandNewStyle:"",showHeaderBottomDivider:!1,onClosed:t[1]||(t[1]=e=>l("dialog:closed"))},{body:g((()=>[y("div",Ag,[m(ts,{class:"alert-icon"}),y("span",bg,h(P(a)("wallet.history.cancelDeposit.title")),1),y("p",_g,h(P(a)("wallet.history.cancelDeposit.des")),1),m(r,{size:"large",class:"primary action-btn",isLoading:o.value,onClick:u},{default:g((()=>[v(h(P(a)("wallet.history.cancelDeposit.btnText")),1)])),_:1},8,["isLoading"]),y("span",{class:"back-btn",onClick:t[0]||(t[0]=e=>l("dialog:closed"))},h(P(a)("t.notNow")),1)])])),_:1})}}}),[["__scopeId","data-v-01ee0728"]]),Cg={key:1,class:"dialog-content"},Lg={key:0,class:"info-text"},Eg=["href"],Ig={key:0,class:"memo-section"},kg={class:"section-title"},Rg={class:"memo-content"},Ng={key:1,class:"account-section"},xg={class:"section-title"},Pg={class:"button-wrapper"},Og=vr(E({__name:"HistoryDepositBankDialog",props:{detailData:{type:Object,default:()=>({})},renewDetailData:{type:Function,default:()=>{}}},emits:["dialog:closed"],setup(e,{emit:t}){const{enableDepositReferenceNumber:a}=Ge,{t:l}=I(),o=t,u=e,c=Ut(),{currencyMap:p,lang:f}=S(c),{$openDialog:T}=Tl(),w=O(!1),A=O(!1),b=R((()=>u.detailData.method||"")),_=R((()=>{var e;return[Ql.ANSPACEPAY,Ql.HTPAY].includes(null==(e=u.detailData)?void 0:e.provider)})),C=R((()=>b.value===Zl.DEBIT_CARD)),L=R((()=>!C.value&&u.detailData.memo)),E=R((()=>{var e,t;const a=[Ql.XENDIT,Ql.DUITKU].includes(null==(e=u.detailData)?void 0:e.provider);return!(null==(t=u.detailData)?void 0:t.isManual)&&!_.value&&!a})),k=R((()=>{const{provider:e,cancelable:t}=u.detailData;return e?e===Ql.SELF&&t:t})),x=R((()=>{var e;return(null==(e=u.detailData)?void 0:e.transactionRef)||""})),$=R((()=>{var e;return(null==(e=u.detailData)?void 0:e.transactionNumber)||""})),W=R((()=>{const{fee:e=0,bankCharge:t=0}=u.detailData;return N(u.detailData.amount).minus(e||0).minus(t||0)})),F=R((()=>c.getCurrencyScaledAmount({currency:u.detailData.amountCurrency,amount:W.value,isFormat:!0}))),B=R((()=>u.detailData.status||"")),U=R((()=>B.value===be.PROCESSING)),M=R((()=>B.value===be.FAILURE)),V=R((()=>gt(f.value,"NEW_TICKET"))),H=R((()=>{var e,t;return null==(t=null==(e=p.value)?void 0:e[u.detailData.amountCurrency])?void 0:t.isFiat}));function G(e){if(null==e)return"-";const t=H.value?"max2":"max8";return`${Xt(e,t)} ${u.detailData.amountCurrency}`}const q=R((()=>u.detailData.createDateTime?X(u.detailData.createDateTime,"yyyy-MM-dd HH:mm:ss"):"-")),z=R((()=>C.value?`${l("t.deposit")} - ${l("t.terminateRefund")}`:l("t.deposit"))),K=R((()=>{var e;const t=(null==(e=u.detailData)?void 0:e.method)||"-";switch(t){case Zl.NET_BANKING:return l("wallets.payment.netBanking");case Zl.PIX:return l("wallets.payment.pix");case Zl.LOCAL_PAYMENTS:return l("wallets.paymentWay.LOCAL_PAYMENTS");default:return t}})),j=R((()=>{const{provider:e,method:t}=u.detailData||{};return t?e&&e!==Ql.SELF?`${e}_${t}`:t:""})),Q=R((()=>{var e,t;if(C.value)return l("debitCard.brandCard",{brandName:l("brand.name")}
1);if(_.value)return K.value;if((null==(e=u.detailData)?void 0:e.provider)===Ql.OPENPAYD&&(null==(t=u.detailData)?void 0:t.method)===Zl.SEPA)return l("wallets.payment.OPENPAYD_SEPA");const a=j.value,s=`wallets.paymentWay.${a}`;return Rl(s)?l(s):a})),Z=R((()=>_.value?l("t.fee"):l("payment.history.depositBankDetail.brandFee",{brandName:l("brand.name")}))),J=R((()=>{const{fee:e,bankCharge:t,isManual:a}=u.detailData;return[{label:l("t.type"),value:z.value},{label:l("t.paymentMethod"),value:Q.value,disable:a},{label:Z.value,value:G(e),disable:a},{label:l("history.spot.detail.bank.fee"),value:G(t),disable:a||_.value},{label:l("payment.withdraw.crypto.submissionTime"),value:q.value},{label:l("t.transactionNumber"),value:$.value,isCopy:!!$.value}].filter((e=>!e.disable))})),ee=R((()=>{var e,t;return null==(t=null==(e=u.detailData)?void 0:e.bank)?void 0:t.accountAddress})),te=R((()=>[{label:l("debitCard.brandCard",{brandName:l("brand.name")}),value:u.detailData.memo},{label:l("wallets.exchange.details.referenceNumber"),value:x.value,disable:!a}].filter((e=>!e.disable)))),ae=R((()=>{var e;const t=(null==(e=u.detailData)?void 0:e.bank)||{},{accountName:s,accountNumber:i,accountNumberLabel:n,bankName:r,swiftCode:o,bankCodeLabel:c,bankAddress:d}=t,p=j.value;return[{label:l("account.payment.bankAccount.beneficiaryName"),value:s,disable:!s},{label:n,value:i,disable:!i},{label:l("account.payment.bankAccount.beneficiaryAddress"),value:ee.value,disable:!ee.value||p===as.OPENPAYD_SEPA||p===as.OPENPAYD_FPS||p===as.EQUALS_SWIFT||p===as.EQUALS_FPS},{label:l("account.payment.bankAccount.bankName"),value:r,disable:!r},{label:c,value:o,disable:!o||b.value===Zl.SEPA},{label:l("account.payment.bankAccount.bankAddress"),value:d,disable:!d},{label:l("wallets.exchange.details.referenceNumber"),value:x.value,disable:!a||!x.value||p===as.OPENPAYD_SEPA||p===as.OPENPAYD_FPS,isCopy:!!x.value}].filter((e=>!e.disable))})),le=R((()=>C.value?te.value:ae.value)),se=R((()=>A.value?l("wallets.depositDetails.upload.title.2"):l("wallets.depositDetails.upload.title")));async function ie(){await T(Dg),o("dialog:closed")}async function ne(){const e=await T(Sg,{id:u.detailData.id});(null==e?void 0:e.isCanceled)&&(o("dialog:closed"),ls({title:l("wallet.history.cancelDeposit.res")}),u.renewDetailData())}return Y((()=>{Xl.getDepositImage(u.detailData.id).then((e=>{A.value=Array.isArray(e)&&e.length>0}))})),(t,a)=>{const u=s("i18n-t"),c=s("BaseButton");return n(),i(wt,{width:"560px",isBrandNewStyle:"",fullStyle:t.isMobile,showBack:w.value,onClosed:a[1]||(a[1]=e=>o("dialog:closed")),onBack:a[2]||(a[2]=e=>w.value=!1)},D({header:g((()=>[v(h(P(l)("payment.history.depositBankDetail.title")),1)])),body:g((()=>[w.value?(n(),i(fg,{key:0,detailData:e.detailData,onSubmitted:ie},null,8,["detailData"])):(n(),r("div",Cg,[m(Nm,{title:P(l)("payment.withdraw.crypto.amountToReceiveAfterFees"),currency:e.detailData.amountCurrency,amountText:`${F.value} ${e.detailData.amountCurrency}`,status:e.detailData.status},{statusBottom:g((()=>[U.value?(n(),r("p",Lg,h(P(l)("history.detail.prompts.bank.deposit")),1)):M.value?(n(),i(u,{key:1,keypath:"wallet.history.depositBank.declined.msg",tag:"p",class:"info-text"},{contactUs:g((()=>[y("a",{class:"link",href:V.value,target:"_blank"},h(P(l)("t.contactUs")),9,Eg)])),_:1})):d("",!0)])),_:1},8,["title","currency","amountText","status"]),m(Wm,{class:"info-card",infoList:J.value},null,8,["infoList"]),L.value?(n(),r("div",Ig,[y("span",kg,h(P(l)("t.memo")),1),y("div",Rg,h(e.detailData.memo),1)])):d("",!0),E.value?(n(),r("div",Ng,[y("span",xg,h(P(l)("wallet.history.depositBank.destinationAccount",{brandName:P(l)("brand.name")})),1),m(Wm,{class:"account-info-card",infoList:le.value,theme:"filled"},null,8,["infoList"])])):d("",!0)]))])),_:2},[!w.value&&k.value?{name:"footer",fn:g((()=>[y("div",Pg,[m(c,{class:"upload-button primary",size:"large",onClick:a[0]||(a[0]=e=>w.value=!0)},{default:g((()=>[v(h(se.value),1)])),_:1}),y("span",{class:"cancel-button",onClick:ne},h(P(l)("history.spot.detail.deposit.cancel-deposit")),1)])])),key:"0"}:void 0]),1032,["fullStyle","showBack"])}}}),[["__scopeId","data-v-3b1bc054"]]),$g="sumsub-websdk-container",Wg=E({__name:"SumsubTravelRule",props:{token:{default:""},auditId:{default:""},refreshToken:{type:Function,default:()=>async()=>({})}},emits:["dialog:closed"],setup(e,{emit:t}){const a=e,l=t,s=Ut(),r=ka();let o=null;const u=O(a.auditId),c=R((()=>s.lang));
1function d(){o=ss.init(a.token,(()=>async function(){try{const{sdkRequired:e,auditId:t,token:l}=await a.refreshToken()||{};return u.value=t||u.value,e&&l?l:""}catch{return""}}())).withConf({lang:is[c.value]||c.value,theme:"light"}).withOptions({addViewportTag:!0}).on("idCheck.onError",(e=>{})).on("idCheck.onApplicantActionCompleted",(e=>{const{answer:t}=e||{};t===ns.GREEN&&l("dialog:closed",{isTravelRuleConfirmed:!0,activeAuditId:u.value})})).build(),o.launch(`#${$g}`)}function p(){l("dialog:closed",{isTravelRuleConfirmed:!1,activeAuditId:u.value})}return Y((()=>{d()})),q((()=>{if(o){o=null;const e=document.getElementById($g);e&&(e.innerHTML="")}})),(e,t)=>(n(),i(wt,{width:"894px",fullStyle:P(r).isMobile,isBrandNewStyle:"",onClosed:p},{body:g((()=>[y("div",{id:$g})])),_:1},8,["fullStyle"]))}}),Fg={class:"dialog-content"},Bg=vr(E({__name:"HistoryDepositCryptoDialog",props:{detailData:{type:Object,default:()=>({})},refreshHistoryList:{type:Function,default:()=>{}}},emits:["dialog:closed"],setup(e,{emit:t}){const{t:a}=I(),{$openDialog:l}=Tl(),{getDepositCryptoSumsubTravelRule:r}=Rr(),o=t,u=e,c=Ut(),p=R((()=>{const{fee:e=0}=u.detailData;return N(u.detailData.amount).minus(e||0)})),f=R((()=>c.getCurrencyScaledAmount({currency:u.detailData.amountCurrency,amount:p.value,isFormat:!0}))),T=R((()=>u.detailData.createDateTime?X(u.detailData.createDateTime,"yyyy-MM-dd HH:mm:ss"):"-")),w=R((()=>u.detailData.status===be.COMPLETED)),D=R((()=>u.detailData.status===be.PROCESSING)),A=R((()=>u.detailData.status===be.PENDING)),b=R((()=>w.value?u.detailData.transactionId||"-":A.value||D.value?a("payment.withdraw.crypto.pendingNetworkSubmission"):"-")),_=R((()=>u.detailData.currencyNetwork===rs.ZKSYNC)),S=R((()=>{const e=`t.${u.detailData.status.toLowerCase()}`,t=Rl(e)?a(e):Hl(u.detailData.status.toLowerCase());if(!D.value||_.value)return t;const l=(u.detailData.coinStatus||"").match(/^\((\d+\/\d+)\)$/);return`${t}${l?` ${l[1]}`:""}`})),C=R((()=>{const e=u.detailData;return[{label:a("t.network"),value:e.networkDisplayName,disable:e.isManual},{label:a("t.depositAddress"),value:e.toAddress,isCopy:!!e.toAddress,disable:e.isManual},{label:a("payment.withdraw.crypto.transactionHash"),value:b.value,isCopy:w.value&&!!e.transactionId,link:w.value&&e.transactionId?e.explorerUrl:void 0,disable:e.isManual},{label:a("payment.withdraw.crypto.submissionTime"),value:T.value},{label:a("t.transactionNumber"),value:e.transactionNumber,isCopy:!!e.transactionNumber},{label:a("t.memo"),value:e.memo,disable:!e.memo}].filter((e=>!e.disable))}));async function L(){const e=u.detailData.id,{token:t}=await r(e);if(!t)return;const{isTravelRuleConfirmed:a}=await l(Wg,{token:t,auditId:e,refreshToken:()=>r(e)})||{};a&&(u.refreshHistoryList(),o("dialog:closed"))}return(t,l)=>{const r=s("i18n-t");return n(),i(wt,{width:"560px",isBrandNewStyle:"",fullStyle:t.isMobile,onClosed:l[0]||(l[0]=e=>o("dialog:closed"))},{header:g((()=>[v(h(P(a)("t.depositDetails")),1)])),body:g((()=>[y("div",Fg,[m(Nm,{title:P(a)("payment.withdraw.crypto.amountToReceiveAfterFees"),currency:e.detailData.amountCurrency,amountText:`${f.value} ${e.detailData.amountCurrency}`,status:e.detailData.status,statusText:S.value},{statusSuffix:g((()=>[D.value?(n(),i(os,{key:0,class:"status-tooltip",placement:"top"},{content:g((()=>[m(Fa,{class:"icon-info ml-4"})])),tooltip:g((()=>[v(h(P(a)("payment.withdraw.crypto.awaitingBlockchainConfirmation")),1)])),_:1})):d("",!0)])),_:1},8,["title","currency","amountText","status","statusText"]),u.detailData.sdkRequired?(n(),i(Ja,{key:0,genre:P(tl).INFO,class:"travel-rule-message"},{default:g((()=>[m(r,{keypath:"payment.deposit.travelRule.notice"},{travelRuleVerification:g((()=>[y("span",{class:"message-link",onClick:L},h(P(a)("payment.travelRuleVerification")),1)])),_:1})])),_:1},8,["genre"])):d("",!0),m(Wm,{class:"info-card",infoList:C.value},null,8,["infoList"])])])),_:1},8,["fullStyle"])}}}),[["__scopeId","data-v-698ea39f"]]),Ug={class:"dialog-content"},Mg=["href"],Vg=vr(E({__name:"HistoryDepositCreditCardDialog",props:{detailData:{type:Object,default:()=>({})}},emits:["dialog:closed"],setup(e,{emit:t}){const{t:a}=I(),l=t,r=e,o=Ut(),{currencyMap:u,lang:c}=S(o),p=R((()=>{const{fee:e=0}=r.detailData;return N(r.detailData.amount).minus(e||0)})),f=R((()=>o.getCurrencyScaledAmount({currency:r.detailData.amountCurrency,amount:p.value,isFormat:!0}))),T=R((()=>r.detailData.status===be.FAILURE)),w=R((()=>gt(c.value,"NEW_TICKET"))),D=R((()=>{var e,t;return null==(t=null==(e=u.value)?void 0:e[r.detailData.amountCurrency])?void 0:t.isFiat}));function A(e){if(null==e)return"-";const t=D.value?"max2":"max8";return`${Xt(e,t)} ${r.detailData.amountCurrency}`}const b=R((()=>r.detailData.createDateTime?X(r.detailData.createDateTime,"yyyy-MM-dd HH:mm:ss"):"-")),_=R((()=>{var e,t;return`${null==(e=r.detailData)?void 0:e.provider}_${null==(t=r.detailData)?void 0:t.method}`})),C=R((()=>{const e=us[_.value];return e?a(e):"-"})),L=R((()=>{var e,t;return(null==(t=null==(e=r.detailData)?void 0:e.creditCard)?void 0:t.credit
1CardNumber)||"-"})),E=R((()=>{var e;const t=(null==(e=r.detailData)?void 0:e.creditCard)||{},{kycFirstName:a,kycLastName:l}=t,s=a||"",i=l||"";return""===s&&""===i?"-":`${s} ${i}`})),k=R((()=>{var e;return(null==(e=r.detailData)?void 0:e.transactionNumber)||""})),x=R((()=>{const{fee:e}=r.detailData,t=void 0!==e;return[{label:a("t.type"),value:a("t.deposit")},{label:a("t.paymentMethod"),value:C.value},{label:a("t.fee"),value:t?A(e):"-"},{label:a("history.spot.detail.deposit.credit-card.number"),value:L.value},{label:a("history.spot.detail.deposit.credit-card.name"),value:E.value},{label:a("payment.withdraw.crypto.submissionTime"),value:b.value},{label:a("t.transactionNumber"),value:k.value,isCopy:!!k.value}]}));return(t,r)=>{const o=s("i18n-t");return n(),i(wt,{width:"560px",isBrandNewStyle:"",fullStyle:t.isMobile,onClosed:r[0]||(r[0]=e=>l("dialog:closed"))},{header:g((()=>[v(h(P(a)("t.details")),1)])),body:g((()=>[y("div",Ug,[m(Nm,{title:P(a)("payment.withdraw.crypto.amountToReceiveAfterFees"),currency:e.detailData.amountCurrency,amountText:`${f.value} ${e.detailData.amountCurrency}`,status:e.detailData.status},{statusBottom:g((()=>[T.value?(n(),i(o,{key:0,keypath:"wallet.history.depositCreditCard.declined.msg",tag:"p",class:"info-text"},{contactUs:g((()=>[y("a",{class:"link",href:w.value,target:"_blank"},h(P(a)("t.contactUs")),9,Mg)])),_:1})):d("",!0)])),_:1},8,["title","currency","amountText","status"]),m(Wm,{class:"info-card",infoList:x.value},null,8,["infoList"])])])),_:1},8,["fullStyle"])}}}),[["__scopeId","data-v-b1cbb386"]]),Hg={class:"deposit-cancel-wrap"},Gg={class:"title"},Yg={class:"des"},qg=vr(E({__name:"HistoryWithdrawBankCancelDialog",props:{id:{},currency:{}},emits:["dialog:closed"],setup(e,{emit:t}){const{t:a}=I(),l=t,r=e,o=Ut(),{currencyMap:u}=S(o),c=R((()=>{var e;return null==(e=u.value[r.currency])?void 0:e.isFiat})),d=O(!1);async function p(){d.value=!0;const e=c.value?Xl.cancelFiatWithdraw:Oa.cancelCryptoWithdraw;try{await e(r.id),l("dialog:closed",{isCanceled:!0})}catch(t){Promise.reject(t)}finally{d.value=!1}}return(e,t)=>{const r=s("BaseButton");return n(),i(wt,{width:"360px",isBrandNewStyle:"",showHeaderBottomDivider:!1,onClosed:t[1]||(t[1]=e=>l("dialog:closed"))},{body:g((()=>[y("div",Hg,[m(ts,{class:"alert-icon"}),y("span",Gg,h(P(a)("wallet.history.cancelWithdraw.title")),1),y("p",Yg,h(P(a)("wallet.history.cancelDeposit.des")),1),m(r,{size:"large",class:"primary action-btn",isLoading:d.value,onClick:p},{default:g((()=>[v(h(P(a)("wallet.history.cancelWithdraw.btnText")),1)])),_:1},8,["isLoading"]),y("span",{class:"back-btn",onClick:t[0]||(t[0]=e=>l("dialog:closed"))},h(P(a)("t.notNow")),1)])])),_:1})}}}),[["__scopeId","data-v-3a26743e"]]),zg={class:"dialog-content"},Kg=["href"],jg={key:0,class:"account-section"},Xg={class:"section-title"},Qg={class:"button-wrapper"},Zg=vr(E({__name:"HistoryWithdrawBankDialog",props:{detailData:{type:Object,default:()=>({})},renewDetailData:{type:Function,default:()=>{}}},emits:["dialog:closed"],setup(e,{emit:t}){const{t:a}=I(),l=t,{$openDialog:o}=Tl(),u=e,c=Ut(),{currencyMap:p,countryMap:f,lang:T}=S(c),w=R((()=>{const{fee:e=0,bankCharge:t=0}=u.detailData;return N(u.detailData.amount).minus(e||0).minus(t||0)})),A=R((()=>c.getCurrencyScaledAmount({currency:u.detailData.amountCurrency,amount:w.value,isFormat:!0}))),b=R((()=>u.detailData.status===be.FAILURE)),_=R((()=>u.detailData.status===be.PROCESSING)),C=R((()=>gt(T.value,"NEW_TICKET")));function L(e){var t,a;if(null==e)return"-";const l=null==(a=null==(t=p.value)?void 0:t[u.detailData.amountCurrency])?void 0:a.isFiat;return`${Xt(e,l?"max2":"max8")} ${u.detailData.amountCurrency}`}const E=R((()=>u.detailData.createDateTime?X(u.detailData.createDateTime,"yyyy-MM-dd HH:mm:ss"):"-")),k=R((()=>[Ql.ANSPACEPAY].includes(u.detailData.provider))),x=R((()=>u.detailData.method===Se.DEBIT_CARD)),O=R((()=>x.value?u.detailData.transactionRef:u.detailData.transactionNumber)),$=R((()=>{const{provider:e,method:t}=u.detailData||{};return t?e&&e!==Ql.SELF?`${e}_${t}`:t:""})),W=R((()=>{var e,t;if(x.value)return a("debitCard.brandCard",{brandName:a("brand.name")}
1);if((null==(e=u.detailData)?void 0:e.provider)===Ql.OPENPAYD&&(null==(t=u.detailData)?void 0:t.method)===Zl.SEPA)return a("wallets.payment.OPENPAYD_SEPA");if(k.value&&u.detailData.method===Zl.PIX)return a("wallets.payment.pix");const l=$.value,s=`wallets.paymentWay.${l}`;return Rl(s)?a(s):l})),F=R((()=>cs($.value))),B=R((()=>{const{fee:e}=u.detailData,t=void 0!==e;return[{label:a("t.type"),value:a("t.withdraw")},{label:a("t.paymentMethod"),value:W.value},{label:a("wallets.fee"),value:t?L(e):"-"},{label:a("payment.withdraw.crypto.submissionTime"),value:E.value},{label:a("t.transactionNumber"),value:O.value,isCopy:!!O.value}]})),U=R((()=>{var e,t,l;const s=(null==(e=u.detailData)?void 0:e.bank)||{},i=$.value,{firstName:n,lastName:r,countryCode:o,accountName:c,accountNumber:d,accountNumberLabel:p,accountAddress:y,bankName:h,swiftCode:v,bankCodeLabel:m,ifscCode:g,bankAddress:T}=s;return x.value?[{label:a("debitCard.brandCard",{brandName:a("brand.name")}),value:null==(t=u.detailData)?void 0:t.dataId}]:u.detailData.provider===Ql.EQUALS?[{label:a("account.payment.bankAccount.beneficiaryName"),value:c},{label:p,value:d},{label:a("account.payment.bankAccount.bankName"),value:h},{label:m,value:v},{label:a("account.payment.bankAccount.bankAddress"),value:T}]:u.detailData.method===Zl.FPS?[{label:a("t.firstName"),value:n},{label:a("t.lastName"),value:r},{label:a("account.payment.bankAccount.accountHolderName"),value:c},{label:p||a(ds(i)),value:d},{label:a("account.payment.bankAccount.bankAccountCountry"),value:(null==(l=f.value[o])?void 0:l.eninfo)||"-"},{label:m||a(F.value),value:v}]:[{label:a("account.payment.bankAccount.beneficiaryName"),value:c},{label:p||a(ds(i)),value:d},{label:a("account.payment.bankAccount.beneficiaryAddress"),value:y,disable:!y},{label:a("account.payment.bankAccount.bankName"),value:h},{label:a("account.payment.bankAccount.ifscCode"),value:g,disable:!g},{label:m||a(F.value),value:v,disable:g||!v||u.detailData.method===Zl.SEPA},{label:a("account.payment.bankAccount.bankAddress"),value:T}].filter((e=>!e.disable))}));async function M(){const e=await o(qg,{id:u.detailData.id,currency:u.detailData.amountCurrency});(null==e?void 0:e.isCanceled)&&(l("dialog:closed"),ls({title:a("wallet.history.cancelWithdraw.res")}),u.renewDetailData())}return(t,o)=>{const u=s("i18n-t");return n(),i(wt,{width:"560px",isBrandNewStyle:"",fullStyle:t.isMobile,onClosed:o[0]||(o[0]=e=>l("dialog:closed"))},D({header:g((()=>[v(h(P(a)("t.details")),1)])),body:g((()=>[y("div",zg,[m(Nm,{title:P(a)("payment.withdraw.crypto.amountToReceiveAfterFees"),currency:e.detailData.amountCurrency,amountText:`${A.value} ${e.detailData.amountCurrency}`,status:e.detailData.status},{statusSuffix:g((()=>[_.value?(n(),i(os,{key:0,class:"status-tooltip",placement:"top"},{content:g((()=>[m(Fa,{class:"icon-info ml-4"})])),tooltip:g((()=>[v(h(P(a)("payment.withdraw.bank.processingTooltip")),1)])),_:1})):d("",!0)])),statusBottom:g((()=>[b.value?(n(),i(u,{key:0,keypath:"wallet.history.depositBank.declined.msg",tag:"p",class:"info-text"},{contactUs:g((()=>[y("a",{class:"link",href:C.value,target:"_blank"},h(P(a)("t.contactUs")),9,Kg)])),_:1})):d("",!0)])),_:1},8,["title","currency","amountText","status"]),m(Wm,{class:"info-card",infoList:B.value},null,8,["infoList"]),k.value?d("",!0):(n(),r("div",jg,[y("span",Xg,h(P(a)("wallet.history.depositBank.destinationAccount.2")),1),m(Wm,{class:"account-info-card",infoList:U.value,theme:"filled"},null,8,["infoList"])]))])])),_:2},[e.detailData.cancelable?{name:"footer",fn:g((()=>[y("div",Qg,[y("span",{class:"cancel-button",onClick:M},h(P(a)("history.spot.detail.withdraw.button.cancelSending")),1)])])),key:"0"}:void 0]),1032,["fullStyle"])}}}),[["__scopeId","data-v-035d4404"]]),Jg={class:"dialog-content"},ef=vr(E({__name:"HistoryWithdrawCryptoDialog",props:{detailData:{type:Object,default:()=>({})}},emits:["dialog:closed"],setup(e,{emit:t}){const{t:a}=I(),l=t,s=e,r=Ut(),o=R((()=>{const{amount:e=0,fee:t=0}=s.detailData;return N(e).minus(t||0)})),u=R((()=>r.getCurrencyScaledAmount({currency:s.detailData.amountCurrency,amount:o.value,isFormat:!0}))),c=R((()=>r.getCurrencyScaledAmount({currency:s.detailData.amountCurrency,amount:s.detailData.amount,isFormat:!0}))),p=R((()=>r.getCurrencyScaledAmount({currency:s.detailData.amountCurrency,amount:s.detailData.fee,is
1Format:!0}))),f=R((()=>s.detailData.createDateTime?X(s.detailData.createDateTime,"yyyy-MM-dd HH:mm:ss"):"-")),T=R((()=>{const e=s.detailData;return[{label:a("t.network"),value:e.networkDisplayName},{label:a("payment.withdraw.crypto.destinationAddress"),value:e.toAddress,isCopy:!!e.toAddress},{label:a("payment.withdraw.crypto.transactionHash"),value:b.value,isCopy:w.value&&!!e.transactionId,link:w.value&&e.transactionId?e.explorerUrl:void 0},{label:a("payment.withdraw.crypto.withdrawalAmount"),value:`${c.value} ${e.amountCurrency}`},{label:a("wallet.expressSell.resultConfirm.networkFee"),value:p.value?`${p.value} ${e.amountCurrency}`:""},{label:a("payment.withdraw.crypto.submissionTime"),value:f.value},{label:a("t.transactionNumber"),value:e.transactionNumber,isCopy:!!e.transactionNumber},{label:a("t.memo"),value:e.memo,disable:!e.memo}].filter((e=>!e.disable))})),w=R((()=>s.detailData.status===be.COMPLETED)),D=R((()=>s.detailData.status===be.PENDING)),A=R((()=>s.detailData.status===be.PROCESSING)),b=R((()=>w.value?s.detailData.transactionId||"-":D.value||A.value?a("payment.withdraw.crypto.pendingNetworkSubmission"):"-")),_=R((()=>{const e=`t.${s.detailData.status.toLowerCase()}`;return Rl(e)?a(e):Hl(s.detailData.status.toLowerCase())}));return(t,s)=>(n(),i(wt,{width:"560px",isBrandNewStyle:"",fullStyle:t.isMobile,onClosed:s[0]||(s[0]=e=>l("dialog:closed"))},{header:g((()=>[v(h(P(a)("t.withdrawalDetails")),1)])),body:g((()=>[y("div",Jg,[m(Nm,{title:P(a)("payment.withdraw.crypto.amountToReceiveAfterFees"),currency:e.detailData.amountCurrency,amountText:`${u.value} ${e.detailData.amountCurrency}`,status:e.detailData.status,statusText:_.value},{statusSuffix:g((()=>[A.value?(n(),i(os,{key:0,class:"status-tooltip",placement:"top"},{content:g((()=>[m(Fa,{class:"icon-info ml-4"})])),tooltip:g((()=>[v(h(P(a)("payment.withdraw.crypto.awaitingBlockchainConfirmation")),1)])),_:1})):d("",!0)])),_:1},8,["title","currency","amountText","status","statusText"]),m(Wm,{class:"info-card",infoList:T.value},null,8,["infoList"])])])),_:1},8,["fullStyle"]))}}),[["__scopeId","data-v-7034dd28"]]),tf={name:"AccountInfoWrapper",props:{accountInfo:{type:Array,default:()=>[]},showBrandTitle:{type:Boolean,default:!0},customTitle:{type:String,default:""}},computed:{title(){return this.customTitle?this.customTitle:this.showBrandTitle?this.$t("wallet.history.depositBank.destinationAccount",{brandName:this.$t("brand.name")}):this.$t("wallet.history.depositBank.destinationAccount.2")}},methods:{filterSectionList:e=>e.filter((e=>!e.disable))}},af={class:"account-info-wrapper"},lf={class:"main-title"},sf={class:"account-info"},nf={class:"title"},rf={class:"value"};const of=vr(tf,[["render",function(e,t,a,l,s,i){return n(),r("div",af,[y("span",lf,h(i.title),1),y("div",sf,[(n(!0),r(p,null,x(a.accountInfo,((e,t)=>(n(),r("div",{key:`section_${t}`,class:"section"},[(n(!0),r(p,null,x(i.filterSectionList(e),(e=>(n(),r("div",{key:e.title,class:"info-item"},[y("span",nf,h(e.title),1),y("span",rf,h(e.value||"-"),1)])))),128))])))),128))])])}],["__scopeId","data-v-8f48cda3"]]),{enableUsername:uf}=Ge,cf={name:"HistorySendAndReceiveDialog",components:{Dialog:Ml,TopInfoWrapper:Ie,NetAmountWrapper:Ee,InfoWrapper:Le,AccountInfoWrapper:of},props:{isShow:{type:Boolean,required:!0},detailData:{type:Object,required:!0}},emits:["update:isShow"],computed:{...l(["currencyMap"]),showAccountInfo(){var e;return(null==(e=this.detailData)?void 0:e.detailType)===ke.COPYTRADING_REBATE},infoList(){const{detailType:e,username:t,userEmail:a,userPhone:l,receiverUid:s,senderUid:i,visibleFields:n,hash:r}=this.detailData,o=[ke.SEND_TO,ke.C2C_TRANSFER_OUT].includes(e),u=this.getHistoryTypeText(e),c=this.getInfoLabelText(e),d=o?this.detailData.c2cReceiver:this.detailData.c2cSender,p=o?this.$t("wallet.history.sendTo.receiverEmail"):this.$t("wallet.history.sendTo.senderEmail");if(this.isC2cTransactionType(e))return[{title:this.$t("t.type"),value:u},{title:c,value:d}];if(this.isRoyaltyType(e)||this.isRebateType(e))return this.getRoyaltyAndRebateTypeContent();if(this.isVestingType(e))return this.getVestingTypeContent();if(this.isCopyTradingRebateType(e))return this.getCopyTradingRebateTypeContent();if(this.isAssetOnHoldOrAssetRelease(e))return this.getAssetOnHoldOrAssetReleaseContent();if(this.isBinaryOptionType(e)||this.isUpOrDownType(e))return this.getTypeContent();{const e=[{title:this.$t("t.type"),value:u}];return uf&&(null==n?void 0:n.includes("username"))&&e.push({title:c,value:t}
1),null==n||n.forEach((t=>{switch(t){case"receiverUid":e.push({title:this.$t("wallet.history.sendTo.receiverUid"),value:s});break;case"senderUid":e.push({title:this.$t("wallet.history.sendTo.senderUid"),value:i})}})),(null==n?void 0:n.includes("userEmail"))&&e.push({title:p,value:a}),(null==n?void 0:n.includes("userPhone"))&&e.push({title:this.$t("t.phoneNumber"),value:l}),r&&e.push({title:this.$t("history.spot.detail.hash"),value:r,enableCopy:!0}),e}},historyInfo(){const{detailType:e,fromWalletName:t,toWalletName:a}=this.detailData,l=[];if(e===ke.COPYTRADING_REBATE)l.push({title:this.$t("t.from"),value:ps(t)},{title:this.$t("t.to"),value:ps(a)});return[l]}},methods:{...Ce.methods,closed(){this.$emit("update:isShow",!1)},getHistoryTypeText(e){switch(e){case ke.SEND_TO:return this.$t("t.send");case ke.RECEIVE:return this.$t("t.receive");case ke.C2C_TRANSFER_OUT:return this.$t("t.c2c_transfer_out");case ke.C2C_TRANSFER_IN:return this.$t("t.c2c_transfer_in");case ke.ROYALTY:return this.$t("t.royalty");case ke.REBATE:return this.$t("t.rebate");case ke.COPYTRADING_REBATE:return this.$t("t.copytrading_rebate");case ke.COPYTRADING_REBATE_SENT:return this.$t("t.copytrading_rebate_sent");case ke.COPYTRADING_REBATE_RECEIVE:return this.$t("t.copytrading_rebate_received");case ke.ASSET_ON_HOLD:return this.$t("t.asset_on_hold");case ke.ASSET_RELEASE:return this.$t("t.asset_release");case ke.PREDICTION_PROFIT:return this.$t("t.prediction_profit");case ke.PREDICTION_LOSS:return this.$t("t.prediction_loss");case ke.BINARY_OPTION_PROFIT:return this.$t("t.binary_option_profit");case ke.BINARY_OPTION_LOSS:return this.$t("t.binary_option_loss");case ke.UP_OR_DOWN_PROFIT:return this.$t("t.up_or_down_profit");case ke.UP_OR_DOWN_LOSS:return this.$t("t.up_or_down_loss");case ke.API_BROKER_REBATE:return this.$t("t.api_broker_fee_rebate");default:return""}},getInfoLabelText(e){switch(e){case ke.SEND_TO:return this.$t("wallet.history.sendTo.receiverName");case ke.RECEIVE:return this.$t("wallet.history.sendTo.senderName");case ke.C2C_TRANSFER_OUT:return this.$t("wallet.history.c2c.receiverName");case ke.C2C_TRANSFER_IN:return this.$t("wallet.history.c2c.senderName");default:return""}},getRoyaltyAndRebateTypeContent(){const{detailType:e,username:t,receiverUid:a,senderUid:l}=this.detailData;return e===ke.ROYALTY?[{title:this.$t("t.type"),value:this.$t("t.royalty")},{title:this.$t("wallet.history.sendTo.receiverName"),value:t},{title:this.$t("wallet.history.sendTo.receiverUid"),value:a}]:e===ke.REBATE?[{title:this.$t("t.type"),value:this.$t("t.rebate")},{title:this.$t("wallet.history.sendTo.senderName"),value:t},{title:this.$t("wallet.history.sendTo.senderUid"),value:l}]:void 0},getVestingTypeContent(){const{vestingProjectName:e}=this.detailData;return[{title:this.$t("t.type"),value:this.$t("t.vesting")},{title:this.$t("t.projectName"),value:e}]},getCopyTradingRebateTypeContent(){const{detailType:e,senderNickname:t,receiverNickname:a}=this.detailData,l=[{title:this.$t("t.type"),value:this.getHistoryTypeText(e)}];switch(e){case ke.COPYTRADING_REBATE_RECEIVE:l.push({title:this.$t("t.copier"),value:t});break;case ke.COPYTRADING_REBATE_SENT:l.push({title:this.$t("t.leader"),value:a})}return l},getTypeContent(){return[{title:this.$t("t.type"),value:this.getHistoryTypeText(this.detailData.detailType)}]},getAssetOnHoldOrAssetReleaseContent(){const{detailType:e}=this.detailData;return e===ke.ASSET_ON_HOLD?[{title:this.$t("t.type"),value:this.$t("t.asset_on_hold")},{title:this.$t("t.releaseTime"),value:Ra(this.detailData.unlockDate,"yyyy-MM-dd HH:mm:ss")},{title:this.$t("t.detail"),value:this.$t("assetOnHold.detail")}]:[{title:this.$t("t.type"),value:this.$t("t.asset_release")},{title:this.$t("t.holdTime"),value:Ra(this.detailData.holdDate,"yyyy-MM-dd HH:mm:ss")},{title:this.$t("t.detail"),value:this.$t("assetRelease.detail")}]}}},df={class:"flex-box flex-column"};const pf=vr(cf,[["render",function(e,t,a,l,r,o){const u=s("TopInfoWrapper"),c=s("NetAmountWrapper"),p=s("InfoWrapper"),f=s("AccountInfoWrapper"),T=s("Dialog");return n(),i(T,{class:"history-send-and-receive-dialog",width:e.$isLargeSize(e.$mq)?"560px":"9
10%",bodyWithPadding:!1,fullStyle:e.isMobile,isBrandNewStyle:"",isHiddenOnBrowserAction:"",onClosed:o.closed},{header:g((()=>[v(h(e.$t("t.details")),1)])),body:g((()=>[y("div",df,[m(u,{id:a.detailData.transactionNumber,dateTime:a.detailData.createDateTime},null,8,["id","dateTime"]),m(c,{detailData:a.detailData},null,8,["detailData"]),m(p,{infoList:o.infoList,data:a.detailData},null,8,["infoList","data"]),o.showAccountInfo?(n(),i(f,{key:0,accountInfo:o.historyInfo,customTitle:e.$t("wallets.spot.pnl.transferInfo")},null,8,["accountInfo","customTitle"])):d("",!0)])])),_:1},8,["width","fullStyle","onClosed"])}],["__scopeId","data-v-db52b1c0"]]),yf={class:"dialog-content"},hf={class:"account-section"},vf={class:"section-title"},mf=vr(E({__name:"HistoryApplyCardDialog",props:{detailData:{type:Object,default:()=>({})}},emits:["dialog:closed"],setup(e,{emit:t}){const{t:a}=I(),l=t,s=e,r=Ut(),o=R((()=>{const{fee:e=0}=s.detailData;return N(s.detailData.amount).minus(e||0)})),u=R((()=>r.getCurrencyScaledAmount({currency:s.detailData.amountCurrency,amount:o.value,isFormat:!0}))),c=R((()=>s.detailData.createDateTime?X(s.detailData.createDateTime,"yyyy-MM-dd HH:mm:ss"):"-")),d=R((()=>[{label:a("t.type"),value:a("t.pay_for_service")},{label:a("t.paymentMethod"),value:a("debitCard.brandCard",{brandName:a("brand.name")})},{label:a("payment.withdraw.crypto.submissionTime"),value:c.value},{label:a("t.transactionNumber"),value:s.detailData.transactionRef,isCopy:!!s.detailData.transactionRef}])),p=R((()=>{const{subscriptionId:e}=s.detailData||{};return[{label:a("debitCard.brandCard",{brandName:a("brand.name")}),value:e}]}));return(t,s)=>(n(),i(wt,{width:"560px",isBrandNewStyle:"",fullStyle:t.isMobile,onClosed:s[0]||(s[0]=e=>l("dialog:closed"))},{header:g((()=>[v(h(P(a)("t.details")),1)])),body:g((()=>[y("div",yf,[m(Nm,{title:P(a)("t.netAmount"),currency:e.detailData.amountCurrency,amountText:`${u.value} ${e.detailData.amountCurrency}`,status:e.detailData.status},null,8,["title","currency","amountText","status"]),m(Wm,{class:"info-card",infoList:d.value},null,8,["infoList"]),y("div",hf,[y("span",vf,h(P(a)("wallet.history.depositBank.destinationAccount",{brandName:P(a)("brand.name")})),1),m(Wm,{class:"account-info-card",infoList:p.value,theme:"filled"},null,8,["infoList"])])])])),_:1},8,["fullStyle"]))}}),[["__scopeId","data-v-30473822"]]),gf={name:"DetailTypeDialog",components:{Dialog:Ml,TopInfoWrapper:Ie,NetAmountWrapper:Ee,InfoWrapper:Le,AccountInfoWrapper:of},props:{isShow:{type:Boolean,required:!0},detailData:{type:Object,required:!0},type:{type:String,required:!0}},emits:["update:isShow"],computed:{...l(["accountInfo"]),...t(["isUnifiedWallet"]),hideAccountInfo(){return this.type===gl.CONVERT},infoList(){let e,t;switch(this.type){case gl.TRANSFERIN:e="t.transfer_in";break;case gl.TRANSFEROUT:e="t.transfer_out";break;case gl.CONVERT:e="t.convert",t={from:{currency:this.detailData.amountCurrency,amount:this.detailData.amount},to:{currency:this.detailData.settlementCurrency,amount:this.detailData.settlementAmount}};break;case gl.INVEST:e="t.invest";break;case gl.REDEEM:e="t.redeem"}return[{title:this.$t("t.type"),value:this.$t(e),convertData:t}]},historyInfo(){const{fromWalletName:e,toWalletName:t,productName:a,investmentType:l}=this.detailData,s=0,i=1;let n=[{title:this.$t("t.from")},{title:this.$t("t.to")}];switch(this.type){case gl.REDEEM:n[s].value=l,n[i].value=t,n.push({title:this.$t("history.spot.detail.product"),value:a});break;case gl.INVEST:n[s].value=e,n[i].value=l,n.push({title:this.$t("history.spot.detail.product"),value:a});break;case gl.TRANSFERIN:case gl.TRANSFEROUT:n[s].value=this.getWalletName(e,this.detailData.createDateTime),n[i].value=this.getWalletName(t,this.detailData.createDateTime);break;default:n[s].value=e,n[i].value=t}return[n]}},methods:{closed(){this.$emit("update:isShow",!1)},getWalletName(e,t){if(this.isUnifiedWallet&&e===ul){if(null===this.accountInfo.walletUpgradeTime)return ps(ol);e=Q(new Date(t),new Date(this.accountInfo.walletUpgradeTime))?ul:ol}return ps(e)||e}}},ff={class:"flex-box flex-column"};const Tf=vr(gf,[["render",function(e,t,a,l,r,o){const u=s("TopInfoWrapper"),c=s("NetAmountWrapper"),d=s("InfoWrapper"),p=s("AccountInfoWrapper"),w=s("Dialog");return n(),i(w,{class:"detail-type-dialog",width:e.isLargeSize?"560px":"9
10%",bodyWithPadding:!1,fullStyle:e.isMobile,isBrandNewStyle:"",onClosed:o.closed},{header:g((()=>[v(h(e.$t("t.details")),1)])),body:g((()=>[y("div",ff,[m(u,{id:a.detailData.transactionNumber,dateTime:a.detailData.createDateTime},null,8,["id","dateTime"]),m(c,{detailData:a.detailData},null,8,["detailData"]),m(d,{infoList:o.infoList},null,8,["infoList"]),f(m(p,{accountInfo:o.historyInfo,customTitle:e.$t("wallets.spot.pnl.transferInfo")},null,8,["accountInfo","customTitle"]),[[T,!o.hideAccountInfo]])])])),_:1},8,["width","fullStyle","onClosed"])}]]),wf={name:"HistoryReferralAndBonusDialog",components:{Dialog:Ml,TopInfoWrapper:Ie,NetAmountWrapper:Ee,InfoWrapper:Le},props:{isShow:{type:Boolean,required:!0},detailData:{type:Object,required:!0}},emits:["update:isShow"],computed:{infoList(){return[{title:this.$t("t.type"),value:this.historyType},{title:this.$t("t.detail"),value:this.details}]},historyType(){const{historyType:e,detailType:t}=this.detailData;if(e)return this.$t(`t.${e.toLowerCase()}`);switch(t){case ke.REWARD_IN:return this.$t("t.reward_in");case ke.REWARD_OUT:return this.$t("t.reward_out");case ke.REWARD_EXPIRED:return this.$t("t.reward_expired");default:return""}},details(){switch(this.detailData.details){case ys.referral:return this.$t("t.referralRecommendProfit");case ys.referralSelfRebate:return this.$t("t.referralSelfRebate");case ys.tokenVoucherIn:case ys.tokenVoucherOut:return this.$t("t.tokenVoucher");case ys.spotTradingFeeRebate:case ys.futuresTradingFeeRebate:case ys.generalTradingFeeRebate:case ys.autoTraderTradingFeeRebate:return this.$t("t.tradingFeeRebate");case ys.trialFund:case ys.trialFundExpired:return this.$t("t.trialfund");case ys.generalBonusCredit:case ys.generalBonusExpired:return this.$t("t.bonus");default:return""}}},methods:{closed(){this.$emit("update:isShow",!1)}}},Df={class:"flex-box flex-column"};const Af=vr(wf,[["render",function(e,t,a,l,r,o){const u=s("TopInfoWrapper"),c=s("NetAmountWrapper"),d=s("InfoWrapper"),p=s("Dialog");return n(),i(p,{class:"history-referral-and-bonus-dialog",width:e.isLargeSize?"560px":"90%",bodyWithPadding:!1,fullStyle:e.isMobile,isBrandNewStyle:"",isHiddenOnBrowserAction:"",onClosed:o.closed},{header:g((()=>[v(h(e.$t("t.details")),1)])),body:g((()=>[y("div",Df,[m(u,{id:a.detailData.transactionNumber,dateTime:a.detailData.createDateTime||a.detailData.date},null,8,["id","dateTime"]),m(c,{detailData:a.detailData},null,8,["detailData"]),m(d,{infoList:o.infoList},null,8,["infoList"])])])),_:1},8,["width","fullStyle","onClosed"])}]]),bf={name:"HistorySwapDialog",components:{Dialog:Ml,TopInfoWrapper:Ie,NetAmountWrapper:Ee,InfoWrapper:Le},props:{isShow:{type:Boolean,required:!0},detailData:{type:Object,required:!0},type:{type:String,required:!0}},emits:["update:isShow"],computed:{infoList(){let e;switch(this.type){case gl.SWAP_IN:e=this.$t("t.swap_in");break;case gl.SWAP_OUT:e=this.$t("t.swap_out")}return[{title:this.$t("t.type"),value:e,convertData:{from:{amount:this.detailData.amount,currency:this.detailData.amountCurrency},to:{amount:this.detailData.settlementAmount,currency:this.detailData.settlementCurrency}}}]}},methods:{closed(){this.$emit("update:isShow",!1)}}},_f={class:"flex-box flex-column"};const Sf=vr(bf,[["render",function(e,t,a,l,r,o){const u=s("TopInfoWrapper"),c=s("NetAmountWrapper"),d=s("InfoWrapper"),p=s("Dialog");return n(),i(p,{class:"swap-type-dialog",width:e.isLargeSize?"560px":"90%",bodyWithPadding:!1,fullStyle:e.isMobile,isBrandNewStyle:"",onClosed:o.closed},{header:g((()=>[v(h(e.$t("t.details")),1)])),body:g((()=>[y("div",_f,[m(u,{id:a.detailData.transactionNumber,dateTime:a.detailData.createDateTime},null,8,["id","dateTime"]),m(c,{detailData:a.detailData},null,8,["detailData"]),m(d,{infoList:o.infoList},null,8,["infoList"])])])),_:1},8,["width","fullStyle","onClosed"])}]]),Cf={name:"HistoryExpressDialog",components:{Dialog:Ml,TopInfoWrapper:Ie,NetAmountWrapper:Ee,InfoWrapper:Le,AccountInfoWrapper:of},props:{isShow:{type:Boolean,required:!0},detailData:{type:Object,required:!0}},emits:["update:isShow"],data:()=>({V1PaymentMethod:Zl}),computed:{...l(["currencyMap"]),visible:{get(){return this.isShow},set(e){this.$emit("update:isShow",e)}},isCashTeller(){var e;return(null==(e=this.detailData)?void 0:e.provider)===Ql.CASHTELLER},providerMethodKey(){var e,t;return`${null==(e=this.detailData)?void 0:e.provider}_${null==(t=this.detailData)?void 0:t.method}`},paymentMethod(){const e=us[this.providerMethodKey];return e?this.$t(e):"-"},type(){switch(this.detailData.detailType){case ke.EXPRESS_BUY:return this.$t("display.expressBuy");case ke.EXPRESS_SELL:return this.$t("display.expressSell");default:return""}},infoList(){const{srcAmount:e,srcCurrency:t,vendor:a}=this.detailData,l=this.formatNumber(e,t),s={[ke.EXPRESS_BUY]:this.$t("t.spent"),[ke.EXPRESS_SELL]:this.$t("t.receive")};return[{title:this.$t("t.type"),value:this.type,enable:!0},{title:this.$t("t.paymentMethod"),value:this.paymentMethod,enable:!0},{title:s[this.detailData.detailType],value:`${l} ${t}`,enable:e},{title:this.$t("wallets.payment.onramp"),value:a,enable:this.providerMethodKey===hs.ONRAMPER_ONRAMPER}].filter((e=>e.enable))},accountInfo(){var e;const t=(null==(e=this.detailData)?void 0:e.bank)||{},{accountName:a,accountNumber:l,accountNumberLabel:s,accountAddress:i,paymentWay:n,bankName:r,swiftCode:o,bankCodeLabel:u,bankAddress:c}=t;return[[{title:this.$t("account.payment.bankAccount.beneficiaryName"),value:a},{title:s||this.$t(ds(n)),value:l},{title:this.$t("account.payment.bankAccount.beneficiaryAddress"),value:i}],[{title:this.$t("account.payment.bankAccount.bankName"),value:r},{title:u||this.$t(cs(n)),value:o},{title:this.$t("account.payment.bankAccount.bankAddress"),value:c}]]}},methods:{...Ce.methods,closed(){this.$emit("update:isShow",!1)}}},Lf={class:"flex-box flex-column"};const Ef=vr(Cf,[["render",function(e,t,a,l,r,o){const u=s("TopInfoWrapper"),c=s("NetAmountWrapper"),p=s("InfoWrapper"),f=s("AccountInfoWrapper"),T=s("Dialog");return n(),i(T,{visible:o.visible,"onUpdate:visible":t[0]||(t[0]=e=>o.visible=e),class:"history-express-dialog",width:e.isLargeSize?"560px":"9
10%",bodyWithPadding:!1,fullStyle:e.isMobile,isBrandNewStyle:"",isHiddenOnBrowserAction:""},{header:g((()=>[v(h(e.$t("t.details")),1)])),body:g((()=>[y("div",Lf,[m(u,{id:a.detailData.transactionNumber,dateTime:a.detailData.createDateTime},null,8,["id","dateTime"]),m(c,{detailData:a.detailData},D({_:2},[o.isCashTeller?{name:"extra",fn:g((()=>[v(h(e.$t("payment.expressBuy.cashTeller.note")),1)])),key:"0"}:void 0]),1032,["detailData"]),m(p,{infoList:o.infoList},null,8,["infoList"]),a.detailData.method===r.V1PaymentMethod.NET_BANKING?(n(),i(f,{key:0,accountInfo:o.accountInfo,showBrandTitle:!1},null,8,["accountInfo"])):d("",!0)])])),_:1},8,["visible","width","fullStyle"])}]]),If={class:"dialog-content"},kf={class:"account-section"},Rf={class:"section-title"},Nf=vr(E({__name:"HistoryWithdrawFiatHtpayDialog",props:{detailData:{type:Object,default:()=>({})}},emits:["dialog:closed"],setup(e,{emit:t}){const{t:a}=I(),l=t,s=e,r=Ut(),o=R((()=>{const{fee:e=0}=s.detailData;return N(s.detailData.amount).minus(e||0)})),u=R((()=>r.getCurrencyScaledAmount({currency:s.detailData.amountCurrency,amount:o.value,isFormat:!0})));function c(e){if(null==e)return"-";return`${Xt(e,"max2")} ${s.detailData.amountCurrency}`}const d=R((()=>s.detailData.createDateTime?X(s.detailData.createDateTime,"yyyy-MM-dd HH:mm:ss"):"-")),p=R((()=>{const{provider:e,method:t}=s.detailData||{};return t?e&&e!==Ql.SELF?`${e}_${t}`:t:""})),f=R((()=>{const e=p.value,t=`wallets.paymentWay.${e}`;return Rl(t)?a(t):e})),T=R((()=>{const{fee:e}=s.detailData,t=void 0!==e;return[{label:a("t.type"),value:a("t.withdraw")},{label:a("t.paymentMethod"),value:f.value},{label:a("wallets.fee"),value:t?c(e):"-"},{label:a("payment.withdraw.crypto.submissionTime"),value:d.value},{label:a("t.transactionNumber"),value:s.detailData.transactionNumber,isCopy:!!s.detailData.transactionNumber}]})),w=R((()=>{var e;const t=(null==(e=s.detailData)?void 0:e.bank)||{},{accountName:l,accountNumber:i}=t;return[{label:a("t.accountHolderName"),value:l||"-"},{label:a("t.accountNumber"),value:i||"-"}]}));return(t,s)=>(n(),i(wt,{width:"560px",isBrandNewStyle:"",fullStyle:t.isMobile,onClosed:s[0]||(s[0]=e=>l("dialog:closed"))},{header:g((()=>[v(h(P(a)("t.details")),1)])),body:g((()=>[y("div",If,[m(Nm,{title:P(a)("payment.withdraw.crypto.amountToReceiveAfterFees"),currency:e.detailData.amountCurrency,amountText:`${u.value} ${e.detailData.amountCurrency}`,status:e.detailData.status},null,8,["title","currency","amountText","status"]),m(Wm,{class:"info-card",infoList:T.value},null,8,["infoList"]),y("div",kf,[y("span",Rf,h(P(a)("wallet.history.depositBank.destinationAccount.2")),1),m(Wm,{class:"account-info-card",infoList:w.value,theme:"filled"},null,8,["infoList"])])])])),_:1},8,["fullStyle"]))}}),[["__scopeId","data-v-9fb164f6"]]);const xf=vr({name:"HistoryDetailDialogs",components:{DetailLoadingDialog:Cm,HistorySendAndReceiveDialog:pf,DetailTypeDialog:Tf,HistoryReferralAndBonusDialog:Af,HistorySwapDialog:Sf,HistoryExpressDialog:Ef},props:{refreshHistoryList:{type:Function,default:()=>{}}},data:()=>({detailData:{},reqData:{},isShowDetailLoading:!1,isShowSendAndReceiveDialog:!1,isShowNewGeneralDialog:!1,isShowReferralAndBonusDialog:!1,isShowSwapDialog:!1,isShowExpressDialog:!1}),methods:{renewDetailData(){const{id:e,historyType:t}=this.reqData;this.getDetailData(e,t)},getDetailData(e,t){this.isShowDetailLoading=!0,this.reqData={id:e,historyType:t};let a=$a;Re.includes(t)&&(a=Xl),a.getSpotWalletDetail(e,t).then((t=>{this.detailData={...t,id:e,dataId:null==t?void 0:t.id},this.handleShowDetailDialog(this.detailData)})).finally((()=>{this.isShowDetailLoading=!1}))},handleShowDetailDialog(e){const{detailType:t}=e;switch(t){case ke.DEPOSIT_FIAT:this.$openDialog(Og,{detailData:e,renewDetailData:this.renewDetailData});break;case ke.DEPOSIT_CREDIT_CARD:this.$openDialog(Vg,{detailData:e});break;case ke.DEPOSIT_CRYPTO:this.$openDialog(Bg,{detailData:e,refreshHistoryList:this.refreshHistoryList});break;case ke.WITHDRAW_FIAT:this.$openDialog(Zg,{detailData:e,renewDetailData:this.renewDetailData});break;case ke.WITHDRAW_CRYPTO:this.$openDialog(ef,{detailData:e});break;case ke.SEND_TO:case ke.RECEIVE:case ke.C2C_TRANSFER_IN:case ke.C2C_TRANSFER_OUT:case ke.ROYALTY:case ke.REBATE:case ke.VESTING:case ke.COPYTRADING_REBATE:case ke.COPYTRADING_REBATE_SENT:case ke.COPYTRADING_REBATE_RECEIVE:case ke.ASSET_ON_HOLD:case ke.ASSET_RELEASE:case ke.PREDICTION_PROFIT:case ke.PREDICTION_LOSS:case ke.BINARY_OPTION_PROFIT:case ke.BINARY_OPTION_LOSS:case ke.UP_OR_DOWN_PROFIT:case ke.UP_OR_DOWN_LOSS:this.isShowSendAndReceiveDialog=!0;break;case ke.TRANSFER_IN:case ke.TRANSFER_OUT:case ke.CONVERT:case ke.REDEEM:case ke.INVESTMENT:this.isShowNewGeneralDialog=!0;break;case ke.PAY_FOR_SERVICE:this.$openDialog(mf,{detailData:e});break;case ke.REWARD_IN:case ke.REWARD_OUT:case ke.REWARD_EXPIRED:this.isShowReferralAndB
1onusDialog=!0;break;case ke.SWAP_IN:case ke.SWAP_OUT:this.isShowSwapDialog=!0;break;case ke.EXPRESS_BUY:case ke.EXPRESS_SELL:this.isShowExpressDialog=!0;break;case ke.WITHDRAW_FIAT_ALIPAY:case ke.WITHDRAW_FIAT_GCASH:this.$openDialog(Nf,{detailData:e})}}}},[["render",function(e,t,a,l,r,o){const u=s("DetailLoadingDialog"),c=s("HistorySendAndReceiveDialog"),p=s("DetailTypeDialog"),y=s("HistorySwapDialog"),h=s("HistoryReferralAndBonusDialog"),v=s("HistoryExpressDialog");return r.isShowDetailLoading?(n(),i(u,{key:0,isShow:r.isShowDetailLoading,"onUpdate:isShow":t[0]||(t[0]=e=>r.isShowDetailLoading=e)},null,8,["isShow"])):r.isShowSendAndReceiveDialog?(n(),i(c,{key:1,isShow:r.isShowSendAndReceiveDialog,"onUpdate:isShow":t[1]||(t[1]=e=>r.isShowSendAndReceiveDialog=e),detailData:r.detailData},null,8,["isShow","detailData"])):r.isShowNewGeneralDialog?(n(),i(p,{key:2,isShow:r.isShowNewGeneralDialog,"onUpdate:isShow":t[2]||(t[2]=e=>r.isShowNewGeneralDialog=e),detailData:r.detailData,type:r.reqData.historyType},null,8,["isShow","detailData","type"])):r.isShowSwapDialog?(n(),i(y,{key:3,isShow:r.isShowSwapDialog,"onUpdate:isShow":t[3]||(t[3]=e=>r.isShowSwapDialog=e),detailData:r.detailData,type:r.reqData.historyType},null,8,["isShow","detailData","type"])):r.isShowReferralAndBonusDialog?(n(),i(h,{key:4,isShow:r.isShowReferralAndBonusDialog,"onUpdate:isShow":t[4]||(t[4]=e=>r.isShowReferralAndBonusDialog=e),detailData:r.detailData},null,8,["isShow","detailData"])):r.isShowExpressDialog?(n(),i(v,{key:5,isShow:r.isShowExpressDialog,"onUpdate:isShow":t[5]||(t[5]=e=>r.isShowExpressDialog=e),detailData:r.detailData},null,8,["isShow","detailData"])):d("",!0)}]]),Pf={key:0,class:"mobile-filter-container"},Of={class:"m-filter"},$f={class:"m-chips"},Wf={class:"chip-item"},Ff={class:"text"},Bf={class:"chip-item"},Uf={class:"text"},Mf={class:"chip-item"},Vf={class:"text"},Hf={class:"button-text-wrap"},Gf={class:"top-wrap"},Yf={key:0,class:"action-wrap"},qf={class:"action__tools"},zf={class:"action__button-wrap"},Kf={class:"info-wrap"},jf={key:0,class:"loading-wrap"},Xf={key:1,class:"content-wrap"},Qf=vr(E({__name:"WalletHistory",setup(e){const t={};for(const[s,i]of Object.entries(ml))t[i.toUpperCase()]=s;const{walletHistoryBaseCurrency:a,enableWalletHistoryDynamicBaseCurrency:l,enableGstAndTds:o}=Ge,{action:u,spotWalletHistoryDownloadName:c}=Zr,w={years:1},D={years:1},A=[{id:"date",lang:"t.date",textAlign:"left"},{id:"currency",lang:"t.currency",textAlign:"left"},{id:"type",lang:"t.type",textAlign:"left"},{id:"transactionNumber",lang:"t.transactionNumber",textAlign:"left"},...o?[{id:"Fees",lang:"t.fees"},{id:"gstOnFees",lang:"t.gstOnFees"},{id:"tdsTax",lang:"t.tdsTax"}]:[],{id:"netAmount",lang:"t.netAmount"},{id:"status",lang:"t.status",textAlign:"left"},{id:"detailAction"}],{t:b}=I(),_=V(),E=M(),k=Ut(),W=ze(),F=ka(),B=_.query.type,U=B===gl.REWARD_EXPIRED,[H,G]=ua({rangeSize:U?60:30}),Y={start:H,end:G},{currencyMap:q,accountInfo:z}=S(k),X=U?B:"",Q=O(null),Z=O(null),J=O(null),ee=O(!1),te=O(!1),ae=O(!1),le=O({...Y}),se=O(U?B:_s),ie=O(Ss),ne=K({type:[],status:[]}),re=R((()=>l?W.displayCurrency??"":a)),oe=K({}),ue=K([]),ce=O(1),de=O(fs),pe=K({total:0,totalPages:0}),ye=R({get(){const e=(_.query.currency||"").toUpperCase();return t[e]??e},set(e){const t={..._.query};e?t.currency=e:delete t.currency,E.replace({query:t})}}),he=R((()=>`${ye.value}-${c}`)),ve=R((()=>(u.walletTypes.limitList.length?u.walletTypes.limitList:ne.value.type).map(Le))),me=R((()=>ne.value.status.map(Le))),ge=R((()=>{switch(se.value){case"EXPRESS_BUY":return b("display.expressBuy");case"EXPRESS_SELL":return b("display.expressSell");default:return b(`t.${se.value.toLowerCase()}`)}})),fe=R((()=>Boolean(ye.value||"ALL_HISTORY_TYPES"!==se.value||"ALL_STATUS"!==ie.value))),Te=R((()=>{const{start:e,end:t}=le.value,[a,l]=vs(e,t);return{start:a,end:l}})),we=R((()=>{const{start:e,end:t}=Te.value;return e&&t?`${e}${t}`:null})),De=R((()=>{const e={fromTimestamp:Te.value.start,toTimestamp:Te.value.end,historyStatus:ie.value,historyType:se.value};return ye.value&&(e.currency=ye.value.toUpperCase()),e})),Ae=R((()=>ms({historyStatus:De.value.historyStatus,historyType:De.value.historyType,...De.value.currency&&{currency:De.value.currency},zoneOffset:gs()}))),be=R((()=>ro($a.downloadSpotHistory,"/report/histories/spotWallet",Ae.value))),_e=R((()=>ue.value.map((e=>{var t;const a=(null==(t=null==e?void 0:e.currency)?void 0:t.toUpperCase())||"",l=q.value[a]||{};return{...e,currency:a,displayName:l.displayName,isFiat:l.isFiat}}))??[])),Se=R((()=>0===_e.value.length)),Ce=R((()=>{var e,t,a,l,s;return[{name:"deposit",title:b("t.deposit"),titleStyle:"normal",subTitle:b("t.netAmount"),data:[{value:null==(e=oe.value)?void 0:e.netDeposit,currency:null==(t=oe.value)?void 0:t.currency,aroundValue:null==(a=oe.value)?void 0:a.baseCurrencyNetDeposit,aroundCurrency:re.value}]},{name:"withdraw",title:b("t.withdraw"),titleStyle:"normal",subTitle:b("t.netAmount"),data:[{value:null==(l=oe.value)?void 0:l.netWithdrawal,currency:null==(s=oe.value)?void 0:s.currency,aroundValue:oe.value.baseCurrencyNetWithdrawal,aroundCurrency:re.value}]}]}));function Le(e){let t=b(`t.${e.toLowerCase()}`);switch(e){case"EXPRESS_BUY":t=b("display.expressBuy");break;case"EXPRESS_SELL":t=b("display.expressSell")}return{name:t,value:e}}function Ee(e){se.value=e}function Ie(e){ie.value=e}function ke(e){ce.value=e}function Re(){pe.value.total<de.value||(de.value+=fs)}function Ne({startDate:e,endDate:t,searchCurrency:a,historyType:l,historyStatus:s}){se.value=l||se.value,ie.value=s||ie.value,le.value={start:new Date(e),end:new Date(t)},ye.value=a}function xe(){var e,t;const[a,l]=ua({rangeSize:30});le.value={start:a,end:l},ye.value="",null==(e=Q.value)||e.reset(),null==(t=Z.value)||t.reset()}function Pe(e){var t;const{id:a,historyType:l,hasDetail:s}=e;s&&(null==(t=J.value)||t.getDetailData(a,l))}function Oe(e,t){var a,l;const s=N(e).times((null==(a=q.value[t])?void 0:a.usdRate)||0);return"USD"===re.value?s.toFixed():s.div((null==(l=q.value[re.value])?void 0:l.usdRate)||0).toFixed()}const $e=kl((async function({resetPage:e=!1}={}){F.isMobile||(ee.value=!0),e&&(ce.value=1,de.value=fs);try{const e=await $a.spotWallet({...De.value,currentPage:ce.value,pageSize:de.value});ue.value=e.data,de.value=e.pageSize,pe.value={total:e.totalRows,totalPages:e.totalPages}}finally{ee.value=!1}}),100);return $([ce,de],(()=>$e())),$((()=>z.value.uid),((e,t)=>{e&&t&&e!==t&&(xe(),$e())})),$([we,ye,se,ie],(([e])=>{null!==e&&(!async function(){const e=await $a.spotSummary(De.value)||[];if(0===e.length)return;if(ye.value){const t=e[0]||{},{currency:a,netDeposit:l,netWithdrawal:s}=t;return void(oe.value={...t,baseCurrencyNetDeposit:Oe(l,a),baseCurrencyNetWithdrawal:Oe(s,a)})}let t=N(0),a=N(0);e.forEach((({currency:e,netDeposit:l,netWithdrawal:s})=>{t=t.plus(Oe(l,e)),a=a.plus(Oe(s,e))})),oe.value={currency:re.value,netDeposit:t.toFixed(),netWithdrawal:a.toFixed()}}(),$e({resetPage:!0}))}),{immediate:!0}),j((()=>
1{if(U){const e={..._.query};if(delete e.type,e.days){const[t,a]=ua({rangeSize:Number(e.days)});le.value={start:t,end:a},delete e.days}E.replace({query:e})}!F.isMobile&&async function(){const{historyTypes:e,historyStatus:t}=await $a.spotInit();ne.value={type:e||[],status:t||[]}}()})),(e,t)=>{const a=s("DataTable"),l=C("loading");return n(),r(p,null,[e.isMobile?(n(),r("div",Pf,[y("div",Of,[m(jr,{class:"flex-1",dateRangeData:le.value,isShowArrow:"",onToggle:t[0]||(t[0]=e=>te.value=!0)},null,8,["dateRangeData"]),m(Jr,{isFiltered:fe.value,onClick:t[1]||(t[1]=e=>ae.value=!ae.value)},null,8,["isFiltered"])]),f(y("div",$f,[f(y("div",Wf,[y("span",Ff,h(ye.value),1),m(Ts,{class:"icon-close",onClick:t[2]||(t[2]=e=>ye.value="")})],512),[[T,ye.value]]),f(y("div",Bf,[y("span",Uf,h(ge.value),1),m(Ts,{class:"icon-close",onClick:t[3]||(t[3]=e=>se.value="ALL_HISTORY_TYPES")})],512),[[T,"ALL_HISTORY_TYPES"!==se.value]]),f(y("div",Mf,[y("span",Vf,h(e.$t(`t.${ie.value.toLowerCase()}`)),1),m(Ts,{class:"icon-close",onClick:t[4]||(t[4]=e=>ie.value="ALL_STATUS")})],512),[[T,"ALL_STATUS"!==ie.value]])],512),[[T,fe.value]]),m(Ds,{class:"m-file-download",fileName:he.value,requestDownload:be.value,defaultRangeDate:le.value,hasPdf:""},{default:g((()=>[y("div",Hf,[m(ws),v(" "+h(e.$t("t.downloadHistory")),1)])])),_:1},8,["fileName","requestDownload","defaultRangeDate"])])):d("",!0),m(xo,{class:"history-body"},{default:g((()=>[y("div",Gf,[e.isLargeSize?(n(),r("div",Yf,[y("div",qf,[m(ya,{dateRange:le.value,"onUpdate:dateRange":t[5]||(t[5]=e=>le.value=e),minDurationToNow:w,rangeLimitDuration:D},null,8,["dateRange"]),m(eo,{selectedCurrencyKey:ye.value,"onUpdate:selectedCurrencyKey":t[6]||(t[6]=e=>ye.value=e)},null,8,["selectedCurrencyKey"]),m(Kv,{ref_key:"historyTypeDropdown",ref:Q,class:"dropdown",list:ve.value,defaultValue:P(X),handleUpdate:Ee,height:"32px"},null,8,["list","defaultValue"]),m(Kv,{ref_key:"historyStatusDropdown",ref:Z,class:"dropdown",list:me.value,handleUpdate:Ie,height:"32px"},null,8,["list"]),y("div",zf,[y("span",{class:"reset-btn",onClick:xe},h(e.$t("t.resetFilters")),1)])]),m(Ds,{fileName:he.value,requestDownload:be.value,defaultRangeDate:le.value,hasPdf:""},null,8,["fileName","requestDownload","defaultRangeDate"])])):d("",!0)]),f((n(),r("div",Kf,[m(om,{data:Ce.value,selectedCurrency:ye.value},null,8,["data","selectedCurrency"])])),[[l,ee.value]]),ee.value?f((n(),r("div",jf,null,512)),[[l,!0]]):e.isLargeSize?(n(),r("div",Xf,[m(a,{class:L(["content-table",{empty:Se.value}]),fixHeader:!0,fixFirstColumn:!0},{header:g((()=>[m(um,{class:"content-list-header",headerTitles:A})])),body:g((()=>[(n(!0),r(p,null,x(_e.value,((e,t)=>(n(),i(vm,{key:e.id,index:t,data:e,onClick:t=>Pe(e)},null,8,["index","data","onClick"])))),128))])),_:1},8,["class"]),Se.value?(n(),i(Zt,{key:0,class:"no-data",emptyText:e.$t("t.noDataFound")},null,8,["emptyText"])):d("",!0),m(As,{class:"pagination",layout:"prev, pager, next, jumper",background:!1,pagerCount:5,currentPage:ce.value,pageSize:de.value,total:pe.value.total,totalPages:pe.value.totalPages,onHandleCurrentChangeP:ke},null,8,["currentPage","pageSize","total","totalPages"])])):(n(),r(p,{key:2},[m(_m,{listData:_e.value,onShowDetail:Pe},null,8,["listData"]),m(bs,{onLoadMore:Re})],64))])),_:1}),e.isMobile?(n(),r(p,{key:1},[f(m(to,{isOpenFilterDialog:ae.value,"onUpdate:isOpenFilterDialog":t[7]||(t[7]=e=>ae.value=e),searchAction:Ne,activeItem:["date","currency","historyType","historyStatus"],dateRangeData:le.value,defaultDateRange:Y,selectedCurrency:ye.value,onReset:xe,originHistoryType:se.value,originHistoryStatus:ie.value},null,8,["isOpenFilterDialog","dateRangeData","selectedCurrency","originHistoryType","originHistoryStatus"]),[[T,ae.value]]),te.value?(n(),i(pa,{key:0,showDatePickerDialog:te.value,"onUpdate:showDatePickerDialog":t[8]||(t[8]=e=>te.value=e),dateRange:le.value,"onUpdate:dateRange":t[9]||(t[9]=e=>le.value=e),minDurationToNow:w,rangeLimitDuration:D},null,8,["showDatePickerDialog","dateRange"])):d("",!0)],64)):d("",!0),m(xf,{ref_key:"detailDialog",ref:J,refreshHistoryList:P($e)},null,8,["refreshHistoryList"])],64)}}}),[["__scopeId","data-v-9a4dcc5d"]]),Zf=vr(E({__name:"TradeHistory",setup(e){const[t,a]=ua({rangeSize:7}),l=O({...{start:t,end:a}});return(e,t)=>e.isMobile?(n(),i(ao,{key:0})):(n(),i(lo,{key:1,dateRangeProp:l.value,"onUpdate:dateRangeProp":t[0]||(t[0]=e=>l.value=e)},null,8,["dateRangeProp"]))}}),[["__scopeId","data-v-8e68cd9a"]]),Jf={class:"header-title"},eT=vr(E({__name:"WalletSpotHistory",setup(e){const{enableOrderHistorySpotOrder:t}=Ge,a="walletHistory",l="tradeHistory",{t:r}=I(),o=Ut(),{lang:u}=S(o),c=O(a),p=R((()=>[{id:a,title:r("t.walletHistory")},{id:l,title:r("t.tradeHistory")}]));function v(e){c.value=e}return(e,r)=>{const o=s("RouterLink");return n(),i(Gv,{enableSwitcher:P(t),switcherList:p.value,selected:c.value,onSwitcherSelect:v},{header:g((()=>[m(o,{class:"header-back-wrapper",to:{name:"walletSpot",params:{lang:P(u)}}},{default:g((()=>[m(ht,{class:"icon-back"}),y("span",null,h(e.$t("wallet.backToSpot")),1)])),_:1},8,["to"]),y("h1",Jf,h(e.$t("router.spotHistory")),1)])),content:g((()=>[(n(),i(Z,null,[c.value===a?(n(),i(Qf,{key:0})):c.value===l?(n(),i(Zf,{key:1})):d("",!0)],1024))])),_:1},8,["enableSwitcher","switcherList","selected"])}}}),[["__scopeId","data-v-67f57be0"]]);const tT=vr({name:"FuturesAssetsListHeader",components:{SortableHeaderCell:cl},props:{headerTitles:{type:Array,default:function(){return[]}},sortKey:{type:[Boolean,String],default:void 0}},methods:{...Ly,getClass(e){const t=[];return e.textAlign&&t.push(`align-${e.textAlign}
1`),"assetsInUse"===e.id&&t.push("assets-in-use"),"shortName"===e.id&&t.push("short-name"),"balance"===e.id&&t.push("balance"),t}}},[["render",function(e,t,a,l,o,u){const c=s("SortableHeaderCell"),d=s("HeaderRow");return n(),i(d,{class:"row"},{default:g((()=>[(n(!0),r(p,null,x(a.headerTitles,(t=>(n(),i(c,b({ref_for:!0},e.$attrs,{id:e.formatSortKey(t.id),key:t.id,currentSortKey:a.sortKey,class:u.getClass(t),title:t}),{content:g((()=>[y("span",null,h(e.$t(t.lang||""))+" "+h(t.more),1)])),_:2},1040,["id","currentSortKey","class","title"])))),128))])),_:1})}],["__scopeId","data-v-5647859d"]]),aT={class:"name-wrapper"},lT={class:"short-name"},sT={class:"name"},iT=vr({__name:"FuturesAssetsListRowAsset",props:{asset:{type:Object,default:()=>({})},index:{type:Number,required:!0},toggleDetail:{type:Function,required:!0}},setup(e){const t=e,a=U(),{$openDialog:l}=Tl(),r=R((()=>a.state.hideConvertToBaseCurrencyValue)),o=R((()=>t.asset.isFiat?Er.fiatCurrency(t.asset.shortName):Er.digitalCurrency(t.asset.shortName))),u=R((()=>t.asset.shortName===Ge.futuresWalletGeneralBonusCurrency)),c=R((()=>Ge.enableWalletBonusAsset&&u.value));return(a,u)=>{const d=s("Cell"),p=s("Row");return n(),i(p,{class:L(["assets-row",{isOpenDetail:e.asset.isOpenDetail}]),index:e.index,disableBackground:!0,disableCssHoverEffect:!0,onClick:u[1]||(u[1]=t=>e.toggleDetail(e.asset))},{default:g((()=>[m(d,{class:"toggle"},{default:g((()=>[m(Ka,{class:"icon-chevron-down","aria-label":"icon chevron down","stroke-width":"2"})])),_:1}),m(d,{class:"asset-name flex-box items-center",textAlign:"left"},{default:g((()=>[m(Pa,{displayName:e.asset.displayName,shortName:!0,showName:!1,type:e.asset.isFiat?"fiat":"icon",name:e.asset.shortName,size:"20"},{default:g((()=>[y("div",aT,[y("span",lT,h(e.asset.displayName),1),m(Uy,{currency:e.asset.shortName},null,8,["currency"]),u[2]||(u[2]=y("br",null,null,-1)),y("span",sT,h(o.value),1)])])),_:1},8,["displayName","type","name"])])),_:1}),m(d,{class:"last"},{default:g((()=>[m(By,{class:L({"clickable-text":c.value}),priceValue:e.asset.balance,currencyName:e.asset.displayName,isFiat:e.asset.isFiat,hideConvertToBaseCurrencyValue:r.value,dynamicCurrencyWidth:c.value,onClick:u[0]||(u[0]=w((e=>c.value&&void l(uh,{currency:t.asset.shortName,walletType:Ye.FUTURES})),["stop"]))},null,8,["class","priceValue","currencyName","isFiat","hideConvertToBaseCurrencyValue","dynamicCurrencyWidth"])])),_:1})])),_:1},8,["class","index"])}}},[["__scopeId","data-v-1e39abc6"]]),nT={class:"content-wrap"},rT={class:"title"},oT={class:"title"},uT={class:"content-wrap"},cT={class:"title"},dT=vr({__name:"FuturesAssetsListRowDetail",props:{asset:{type:Object,default:()=>({})},index:{type:Number,required:!0}},setup(e){const t=Ke.TRADING_RULES,a=U(),{lang:l}=S(Ut()),o=R((()=>a.state.hideConvertToBaseCurrencyValue)),u=R((()=>a.getters.isUnifiedWallet));return(a,c)=>{const f=s("RouterLink"),T=s("ToolTip"),w=s("Cell"),D=s("Row");return n(),r(p,null,[u.value?(n(),i(D,{key:0,class:"assets-row border-top padding-top",index:e.index,disableBackground:!0,disableCssHoverEffect:!0},{default:g((()=>[m(w,{colspan:2,textAlign:"left"},{default:g((()=>[y("div",nT,[y("span",rT,h(a.$t("wallets.futures.totalAvailableAssets")),1),m(T,{placement:"top",popover:!0},{content:g((()=>[m(Fa,{class:"info-icon"})])),tooltip:g((()=>[y("span",null,h(a.$t("wallets.futures.tooltip.totalAvailableAssetsTip")),1),c[0]||(c[0]=y("br",null,null,-1)),m(f,{class:"info-link",to:{name:P(t),params:{lang:P(l),marketType:"collateral"}},target:"_blank"},{default:g((()=>[v(h(a.$t("wallets.futures.tooltip.totalAvailableAssetsTipLink")),1)])),_:1},8,["to"])])),_:1})])])),_:1}),m(w,{class:"bold"},{default:g((()=>[m(By,{class:"price-value",priceValue:e.asset.availableBalance,currencyName:e.asset.displayName,isFiat:e.asset.isFiat,size:"small",dynamicCurrencyWidth:"",hideConvertToBaseCurrencyValue:o.value},null,8,["priceValue","currencyName","isFiat","hideConvertToBaseCurrencyValue"])])),_:1})])),_:1},8,["index"])):d("",!0),m(D,{class:L(["assets-row",{"border-top":!u.value,"padding-top":!u.value,"padding-bottom":!u.value}
1]),index:e.index,disableBackground:!0,disableCssHoverEffect:!0},{default:g((()=>[m(w,{colspan:2,textAlign:"left"},{default:g((()=>[y("span",oT,h(a.$t("t.availableForTransfer")),1)])),_:1}),m(w,{class:"bold"},{default:g((()=>[m(By,{class:"price-value",priceValue:e.asset.availableForTransfer,currencyName:e.asset.displayName,isFiat:e.asset.isFiat,size:"small",dynamicCurrencyWidth:"",hideConvertToBaseCurrencyValue:o.value},null,8,["priceValue","currencyName","isFiat","hideConvertToBaseCurrencyValue"])])),_:1})])),_:1},8,["class","index"]),u.value?(n(),i(D,{key:1,class:"assets-row padding-bottom",index:e.index,disableBackground:!0,disableCssHoverEffect:!0},{default:g((()=>[m(w,{colspan:2,textAlign:"left"},{default:g((()=>[y("div",uT,[y("span",cT,h(a.$t("wallets.futures.assetContribution")),1),m(T,{placement:"top"},{content:g((()=>[m(Fa,{class:"info-icon"})])),tooltip:g((()=>[y("span",null,h(a.$t("wallets.futures.tooltip.assetContributionTip")),1)])),_:1})])])),_:1}),m(w,{class:"bold"},{default:g((()=>[m(By,{class:"price-value",priceValue:e.asset.valueInUsdtByCollateralRatio,currencyName:P(Cs),isFiat:!1,dynamicCurrencyWidth:"",size:"small"},null,8,["priceValue","currencyName"])])),_:1})])),_:1},8,["index"])):d("",!0)],64)}}},[["__scopeId","data-v-ab6a27e4"]]),pT=[{id:"toggle",textAlign:"center"},{id:"shortName",lang:"wallets.spotList.asset",textAlign:"left"},{id:"balance",lang:"wallets.spotList.total",textAlign:"right",sortable:!0}],yT={name:"FuturesAssetsList",components:{FuturesAssetsListHeader:tT,FuturesAssetsListRow:{__name:"FuturesAssetsListRow",props:{asset:{type:Object,default:()=>({})},index:{type:Number,required:!0},toggleDetail:{type:Function,required:!0}},setup(e){const t=e,a=R((()=>"rowMain"===t.asset.type)),l=R((()=>"rowDetail"===t.asset.type));return(t,s)=>a.value?(n(),i(iT,{key:0,asset:e.asset,index:e.index,toggleDetail:e.toggleDetail},null,8,["asset","index","toggleDetail"])):l.value?(n(),i(dT,{key:1,asset:e.asset,index:e.index},null,8,["asset","index"])):d("",!0)}}},props:{searchKey:{type:String,default:""},filterKey:{type:String,required:!0},hideSmall:{type:Boolean,default:!1}},data:()=>({sortKey:null,sortOrder:null,headerTitlesData:pT,targetRow:null,isToggleDetail:!1,checkPropertyForMixin:"shortName"}),computed:{...Dl.computed,...Qt.computed,...bl.computed,...Ls.computed,assetsData(){const e=Sl(this.formatRowList,this.formatAssetI18nName,this.filterList,this.searchList,this.sortList,this.getHideSmallList,this.formatToggleFirstRowList,this.formatRowDetailList);let t=this.futuresCurrencyOrderList;return this.sortKey&&(t=this.convertToBaseCurrencyValue(t,this.sortKey)),e(t)}},watch:{searchKey(){this.resetTargetRow()},filterKey(){this.resetTargetRow()}},methods:{...Dl.methods,...Ls.methods,...Eh,...Ih,setSortData({key:e,order:t}){this.sortKey=e,this.sortOrder=t},getHideSmallList(e){return this.hideSmall&&!this.searchKey?e.filter((e=>{var t;const a=null==(t=this.currencyMap[e.displayName])?void 0:t.usdRate,l=N(e.balance).times(a).toNumber(),s=N(e.assetsInUse).times(a).toNumber();return l>=_l||s>=_l})):e}}},hT={class:"wrapper"};const vT={name:"FuturesAssets",components:{FuturesAssetsList:vr(yT,[["render",function(e,t,a,l,o,u){const c=s("FuturesAssetsListHeader"),d=s("FuturesAssetsListRow"),h=s("DataTable");return n(),r("div",hT,[y("div",{ref:"table",class:L(["table-wrapper",{"fix-height":e.$isPad(e.$mq)}])},[m(h,{fixHeader:""},{header:g((()=>[m(c,{headerTitles:o.headerTitlesData,sortKey:o.sortKey,onSort:u.setSortData},null,8,["headerTitles","sortKey","onSort"])])),body:g((()=>[(n(!0),r(p,null,x(u.assetsData,((t,a)=>(n(),i(d,{key:t.id,index:a,asset:t,toggleDetail:e.toggleDetail},null,8,["index","asset","toggleDetail"])))),128))])),_:1})],2)])}],["__scopeId","data-v-d3182d1c"]]),WalletSearchInput:Kr,WalletFilter:Vh,WalletHideSmallBalance:qh,WalletIsConvertToBase:zh},data:()=>({INPUT_TYPES:Il,hideSmall:!1,searchKey:"",filterKey:El.ALL_ASSETS}),computed:{...l(["hideWalletSmallBalanceFutures","hideConvertToBaseCurrencyValue"]),searchInputWidth(){return this.isMobile?"180px":"252px"}}},mT={class:"futures-assets"},gT={class:"action-wrapper"},fT={class:"action-top"};const TT=vr(vT,[["render",function(e,t,a,l,i,o){const u=s("WalletSearchInput"),c=s("WalletFilter"),d=s("WalletIsConvertToBase"),p=s("WalletHideSmallBalance"),h=s("FuturesAssetsList");return n(),r("div",mT,[y("div",gT,[y("div",fT,[m(u,{value:i.searchKey,"onUpdate:value":t[0]||(t[0]=e=>i.searchKey=e),class:"search-input",width:o.searchInputWidth,height:"40px",type:i.INPUT_TYPES.BOX},null,8,["value","width","type"]),m(c,{filterKey:i.filterKey,"onUpdate:filterKey":t[1]||(t[1]=e=>i.filterKey=e),class:"wallet-filter"},null,8,["filterKey"])]),m(d,{class:"wallet-is-convert-base",state:e.hideConvertToBaseCurrencyValue},null,8,["state"]),m(p,{class:"wallet-hide-small",type:"futures",state:e.hideWalletSmallBalanceFutures,isDisable:!!i.searchKey},null,8,["state","isDisable"])]),m(h,{searchKey:i.searchKey,filterKey:i.filterKey,hideSmall:e.hideWalletSmallBalanceFutures},null,8,["searchKey","filterKey","hideSmall"])])}],["__scopeId","data-v-859179e8"]]);function wT(){const{t:e}=I(),t=U(),a=Es();function l(e){return e===Is.BUY}function s(e){return t.state.futures.marketMap[e].baseCurrency}function i(t){switch(t){case Is.BUY:return e("t.long");case Is.SELL:return e("t.short");default:return""}}function n(e){switch(e){case Is.BUY:return"buy";case Is.SELL:return"sell";default:return""}}function r(t){switch(t){case ks.ISOLATED:return e("t.isolated");case ks.CROSS:return e("futuresMain.trade.cross");default:return""}}function o(e){return`${Rs(e.isolatedLeverage,t.getters["futures/initialMarginPercentage"](e.symbol),2)}x`}function u(e){return a.isContractSizeType?e.totalContracts:Ns(e.totalContracts,e.symbol)}function c(t){return a.isContractSizeType?e("futuresMain.contracts"):s(t.symbol)}function d(e){const a=t.state.futures.marketMap[e.symbol].priceFilter;return Xt(e.entryPrice,{formatKey:a+1,roundMode:l(e.orderModeName)?N.ROUND_UP:N.ROUND_DOWN})}function p(e){const a=t.state.futures.futuresMarkPriceMap[e.symbol],l=t.state.futures.marketMap[e.symbol].priceFilter;return a?Xt(a,l):"-"}function y(e){const a=t.state.futures.marketMap[e.symbol].priceFilter;return Xt(e.liquidationPrice,{formatKey:a,roundMode:l(e.orderModeName)?N.ROUND_DOWN:N.ROUND_HALF_UP})}function h(e){const{unrealizedPnlInSettleAsset:t,unrealizedPnlFilter:a,settleWithNonUSDAsset:l}=e;return t&&l?Xt(t,{prefix:t>0?"+":"",formatKey:a}):"-"}function v(e){const{positionRoe:t}=e;return t?Xt(t,{prefix:t>0?"+":"",postfix:"%"}):"-"}return{positions:R((()=>{const{openPositionList:e,openPositionMap:a}=t.state.futures;return[...new Set(e)].reduce(((e,l)=>{const m=a[l].filter((e=>e.totalContracts>0)).map((e=>({...e,baseCurrency:s(l),orderMode:i(e.orderModeName),orderModeClass:n(e.orderModeName),marginType:r(e.marginTypeName),leverage:o(e),size:u(e),sizeUnit:c(e),entryPriceDisplay:d(e),markPrice:t.state.futures.futuresMarkPriceMap[e.symbol],markPriceDisplay:p(e),liqPriceDisplay:y(e),unrealizedPnLDisplay:h(e),roeDisplay:v(e)})));return e.push(...m),e}),[])})),settleInCurrency:R((()=>t.state.futures.fixedCurrency))}}const DT={class:"futures-positions"},AT=["onClick"],bT={class:"symbol"},_T={class:"margin-leverage"},ST={class:"margin-type"},CT=["onClick"],LT={class:"currency"},ET={class:"currency"},IT={class:"currency"},kT={class:"currency"},RT={class:"currency"},NT=vr({__name:"FuturesPositions",setup(e){const{t:t}=I(),a=U(),l=M(),{positions:i,settleInCurrency:o}=wT(),u="symbol",c="positionRoe",d=J({sortBy:null,sortOrder:null}
1),p=O({}),f=R((()=>[{id:u},{id:c,isSortable:!0,textAlign:"right"}])),T=R((()=>xs(i.value,d.sortBy,d.sortOrder)));function w(e){return e<0?"brand-color-negative":"brand-color-positive"}function D({key:e,order:t}){e&&(d.sortBy=e),d.sortOrder=t,p.value={}}function A(e){p.value[e]?p.value[e]=!1:(p.value={},p.value[e]=!0)}return(e,i)=>{const b=s("Cell"),_=s("Row"),S=s("BaseButton");return n(),r("div",DT,[m(P(Ps),{class:"positions-table",columns:f.value,rows:T.value,total:T.value.length,currentSortKey:d.sortBy,expandDetailStatus:p.value,fixHeader:"",onSort:D},{[`cell(${u})`]:g((({info:e,rowIndex:t})=>[y("div",{class:"symbol-cell",onClick:e=>A(t)},[y("div",null,[m(P(ht),{class:L(["icon-arrow",{open:p.value[t]}])},null,8,["class"])]),y("div",null,[m(P(Pa),{name:e.baseCurrency,showName:!1,size:"16"},null,8,["name"])]),y("div",null,[y("div",null,[y("span",bT,h(e.symbol),1),y("span",{class:L(["side-label",e.orderModeClass])},h(e.orderMode),3)]),y("div",_T,[y("span",ST,h(e.marginType),1),y("span",null,h(e.leverage),1)])])],8,AT)])),[`cell(${c})`]:g((({info:e,rowIndex:t})=>[y("div",{onClick:e=>A(t)},[y("span",{class:L(["pnl",w(e.unrealizedPnlInSettleAsset)])},h(e.unrealizedPnLDisplay),3),y("span",LT,h(e.settleWithNonUSDAsset),1)],8,CT),y("span",{class:L(w(e.unrealizedPnlInSettleAsset))}," ("+h(e.roeDisplay)+") ",3)])),detail:g((({info:e,rowIndex:s})=>[m(_,{class:"detail-row first-detail-row",index:s},{default:g((()=>[m(b,{class:"detail-title",textAlign:"left"},{default:g((()=>[v(h(P(t)("t.positionSize")),1)])),_:1}),m(b,{class:"detail-value"},{default:g((()=>[y("span",null,h(e.size),1),y("span",ET,h(e.sizeUnit),1)])),_:2},1024)])),_:2},1032,["index"]),m(_,{class:"detail-row",index:s},{default:g((()=>[m(b,{class:"detail-title",textAlign:"left"},{default:g((()=>[v(h(P(t)("futuresMain.openPosition.entryPrice")),1)])),_:1}),m(b,{class:"detail-value"},{default:g((()=>[y("span",null,h(e.entryPriceDisplay),1),y("span",IT,h(P(o)),1)])),_:2},1024)])),_:2},1032,["index"]),m(_,{class:"detail-row",index:s},{default:g((()=>[m(b,{class:"detail-title",textAlign:"left"},{default:g((()=>[v(h(P(t)("futuresMain.openPosition.markPrice")),1)])),_:1}),m(b,{class:"detail-value"},{default:g((()=>[y("span",null,h(e.markPriceDisplay),1),y("span",kT,h(P(o)),1)])),_:2},1024)])),_:2},1032,["index"]),m(_,{class:"detail-row",index:s},{default:g((()=>[m(b,{class:"detail-title",textAlign:"left"},{default:g((()=>[v(h(P(t)("futuresMain.openPosition.liqPrice")),1)])),_:1}),m(b,{class:"detail-value"},{default:g((()=>[y("span",null,h(e.liqPriceDisplay),1),y("span",RT,h(P(o)),1)])),_:2},1024)])),_:2},1032,["index"]),m(_,{class:"detail-row",index:s},{default:g((()=>[m(b,{class:"detail-title",textAlign:"center",colspan:"2"},{default:g((()=>[m(S,{class:"block outline-primary",onClick:t=>function(e){const t=l.resolve({name:"futuresId",params:{lang:a.state.lang,id:e}});window.open(t.href,"_blank")}(e.symbol)},{default:g((()=>[v(h(P(t)("t.trade")),1)])),_:2},1032,["onClick"])])),_:2},1024)])),_:2},1032,["index"])])),_:2},1032,["columns","rows","total","currentSortKey","expandDetailStatus"])])}}},[["__scopeId","data-v-190a5142"]]),xT={name:"FuturesWalletsListHeader",components:{SortableHeaderCell:cl},props:{headerTitles:{type:Array,default:function(){return[]}},sortKey:{type:[Boolean,String],default:""}},methods:{getClass(e){const t=[];return e.textAlign&&t.push(`align-${e.textAlign}
1`),"name"===e.id&&t.push("name"),"walletTotalValue"===e.id&&t.push("total-value"),t}}},PT={class:"title"};const OT=vr(xT,[["render",function(e,t,a,l,o,u){const c=s("ToolTip"),d=s("SortableHeaderCell"),v=s("HeaderRow");return n(),i(v,{class:"row"},{default:g((()=>[(n(!0),r(p,null,x(a.headerTitles,(t=>(n(),i(d,b({ref_for:!0},e.$attrs,{key:t.id,currentSortKey:a.sortKey,class:u.getClass(t),title:t}),{content:g((()=>[y("span",null,[m(c,{disable:!t.tip},{content:g((()=>[y("span",PT,h(t.lang)+" "+h(t.more),1)])),tooltip:g((()=>[y("span",null,h(t.tip),1)])),_:2},1032,["disable"])])])),_:2},1040,["currentSortKey","class","title"])))),128))])),_:1})}],["__scopeId","data-v-f6d7a306"]]);const $T=vr({name:"FuturesWalletsListRowWallet",components:{Row:Iy,IconChevronDown:Ka,WalletPriceField:By},props:{wallet:{type:Object,default:()=>({})},index:{type:Number,required:!0},toggleDetail:{type:Function,required:!0}},data:()=>({WALLET_ACTIONS:It,actionsVisible:!1}),computed:{isCrossWallet(){return this.wallet.isCrossWallet},totalAssetData(){var e,t;const a={totalBalance:N(0)};return null==(t=null==(e=this.wallet)?void 0:e.assets)||t.forEach((e=>{a.totalBalance=a.totalBalance.plus(e.balanceInUsd)})),a},totalBalance(){return this.totalAssetData.totalBalance.toNumber()||0}},methods:{hasBalance:({walletTotalValue:e})=>e>0,toggleActions(){this.actionsVisible=!this.actionsVisible}}},[["render",function(e,t,a,l,r,o){const u=s("IconChevronDown"),c=s("Cell"),d=s("WalletPriceField"),p=s("Row");return n(),i(p,{class:L(["assets-row",{isCrossWallet:o.isCrossWallet}]),index:a.index,isOpenDetail:a.wallet.isOpenDetail,onClick:t[0]||(t[0]=e=>o.hasBalance(a.wallet)&&a.toggleDetail(a.wallet))},{default:g((()=>[m(c,{class:"toggle"},{default:g((()=>[m(u,{class:L(["icon-chevron-down",{show:o.hasBalance(a.wallet)}]),"aria-label":"icon chevron down","stroke-width":"2"},null,8,["class"])])),_:1}),m(c,{class:"name",textAlign:"left"},{default:g((()=>[v(h(a.wallet.name),1)])),_:1}),m(c,{class:"bold"},{default:g((()=>[m(d,{priceValue:o.totalBalance,currencyName:"USD",isFiat:!0},null,8,["priceValue"])])),_:1})])),_:1},8,["class","index","isOpenDetail"])}],["__scopeId","data-v-7d5a27fd"]]),WT={class:"name-wrapper"},FT={class:"short-name"},BT={class:"flex-box justify-between"},UT={class:"title"},MT={class:"flex-box justify-between"},VT={class:"title"},HT={class:"flex-box justify-between"},GT={class:"title"};const YT=vr({name:"FuturesWalletsListRowCurrency",components:{Row:Iy,BrandIcon:Pa,WalletPriceField:By},props:{asset:{type:Object,default:()=>({})},index:{type:Number,required:!0}}},[["render",function(e,t,a,l,r,o){const u=s("Cell"),c=s("BrandIcon"),d=s("WalletPriceField"),p=s("Row");return n(),i(p,{class:"assets-row",index:a.index},{default:g((()=>[m(u),m(u,{class:"asset-name",textAlign:"left",colspan:"2"},{default:g((()=>[y("div",WT,[m(c,{displayName:a.asset.info.displayName,shortName:!1,showName:!1,type:a.asset.info.isFiat?"fiat":"icon",name:a.asset.info.shortName,size:"20"},null,8,["displayName","type","name"]),y("span",FT,h(a.asset.info.displayName),1)]),y("div",BT,[y("div",UT,h(e.$t("wallets.totalValue")),1),m(d,{priceValue:a.asset.balance,currencyName:a.asset.info.displayName,isFiat:a.asset.info.isFiat,forceShowWvc:!0,size:"small"},null,8,["priceValue","currencyName","isFiat"])]),y("div",MT,[y("div",VT,h(e.$t("wallets.futures.totalAvailableAssets")),1),m(d,{priceValue:a.asset.availableBalance,currencyName:a.asset.info.displayName,isFiat:a.asset.info.isFiat,forceShowWvc:!0,size:"small"},null,8,["priceValue","currencyName","isFiat"])]),y("div",HT,[y("div",GT,h(e.$t("t.availableForTransfer")),1),m(d,{priceValue:a.asset.availableForTransfer,currencyName:a.asset.info.displayName,isFiat:a.asset.info.isFiat,forceShowWvc:!0,size:"small"},null,8,["priceValue","currencyName","isFiat"])])])),_:1})])),_:1},8,["index"])}],["__scopeId","data-v-a27f3f26"]]),qT={class:"title"};const zT=vr({name:"FuturesWalletsListRowWalletDetail",components:{WalletPriceField:By},props:{wallet:{type:Object,default:()=>({})},index:{type:Number,required:!0}}},[["render",function(e,t,a,l,r,o){const u=s("Cell"),c=s("WalletPriceField"),d=s("Row");return n(),i(d,{class:"assets-row",disableCssHoverEffect:!0,index:a.index,disableBackgroun
1d:!0},{default:g((()=>[m(u,{class:"toggle"}),m(u,{textAlign:"left"},{default:g((()=>[y("span",qT,h(e.$t("t.availableForTransfer")),1)])),_:1}),m(u,null,{default:g((()=>[m(c,{class:"price-value",priceValue:a.wallet.walletTotalAssetInUsed,currencyName:"USD",isFiat:!0,size:"small"},null,8,["priceValue"])])),_:1})])),_:1},8,["index"])}],["__scopeId","data-v-9922b04d"]]),KT={name:"WalletDetailActions",components:{IconHistory:at,IconTransfer:Ur,AskAccountVerificationPopup:eu},props:{type:{type:String,default:Ye.SPOT},asset:{type:Object,default:()=>({})}},emits:["update:actionType"],setup(){const e=Ut(),{isDefiUser:t}=S(e);return{isDefiUser:t}},data:()=>({WalletDisplayType:Ft,WALLET_ACTIONS:It,WALLET_TYPE:Ye,actionsVisible:!1,isAccountVerifyPopupShown:!1}),computed:{...gr.computed,walletDisplayType(){return this.type===Ye.SPOT?Ft.SPOT_SPECIFIC:Ft.FUTURES_SPECIFIC},displayActionMap(){return this.getDisplayActionMap(this.walletDisplayType,this.asset)}},methods:{...gr.methods,showAccountVerifyPopup(){this.isAccountVerifyPopupShown=!0},closeAccountVerifyPopup(){this.isAccountVerifyPopupShown=!1},async handleAction(e){if(this.type===Ye.SPOT&&!this.isVerified(e,this.asset))return void this.showAccountVerifyPopup();this.$emit("update:actionType",e);
1this.isDefiUser&&Object.values(mu).includes(e)&&(await this.$nextTick(),this.$emit("update:actionType",""))}}},jT={class:"detail-actions"};const XT={name:"FuturesWalletsListRowDetailActions",components:{IconInfo2:Fa,WalletDetailActions:vr(KT,[["render",function(e,t,a,l,i,o){const u=s("IconTransfer"),c=s("IconHistory"),h=s("AskAccountVerificationPopup");return n(),r("div",jT,[a.type===i.WALLET_TYPE.FUTURES?(n(),r(p,{key:0},[y("div",{class:L(["item round",{disable:!o.displayActionMap[i.WALLET_ACTIONS.TRANSFER]}]),onClick:t[0]||(t[0]=e=>o.handleAction(i.WALLET_ACTIONS.TRANSFER))},[m(u,{class:"icon"})],2),y("div",{class:L(["item round",{disable:!o.displayActionMap[i.WALLET_ACTIONS.GO_HISTORY_PAGE]}]),onClick:t[1]||(t[1]=e=>o.handleAction(i.WALLET_ACTIONS.GO_HISTORY_PAGE))},[m(c,{class:"icon"})],2)],64)):d("",!0),m(h,{show:i.isAccountVerifyPopupShown,closeDialog:o.closeAccountVerifyPopup},null,8,["show","closeDialog"])])}],["__scopeId","data-v-b879deab"]]),WalletPriceField:By},props:{wallet:{type:Object,default:()=>({})},index:{type:Number,required:!0}},data:()=>({WALLET_ACTIONS:It,TRADING_RULES_ROUTE_NAME:Ke.TRADING_RULES,actionType:null}),computed:{...l(["lang"]),...a(Mr,{showFuturesTransferPopup:"showTransferPopup"}),totalAssetData(){var e,t;const a={totalAvailableAssets:N(0),totalAssetContribution:N(0)};return null==(t=null==(e=this.wallet)?void 0:e.assets)||t.forEach((e=>{a.totalAvailableAssets=a.totalAvailableAssets.plus(e.availableBalanceInUsd),a.totalAssetContribution=a.totalAssetContribution.plus(e.valueInUsdtByCollateralRatio)})),a},totalAvailableAssets(){return this.totalAssetData.totalAvailableAssets.toNumber()||0},totalAssetContribution(){return this.totalAssetData.totalAssetContribution.toNumber()||0}},watch:{actionType(){this.actionType===It.GO_HISTORY_PAGE&&this.handleGoHistoryPage(),this.actionType===It.TRANSFER&&this.handleTransfer()},showFuturesTransferPopup(){this.showFuturesTransferPopup||(this.actionType=null)}},methods:{...e(Mr,["toggleTransferPopup"]),handleGoHistoryPage(){this.wallet&&this.wallet.activeWalletName&&this.$router.push({name:Ke.FUTURES_WALLET_DETAIL,params:{lang:this.lang},query:{name:this.wallet.activeWalletName}})},handleTransfer(){const e=this.wallet.transferableBalance>0?"from":"to";this.toggleTransferPopup({[e]:this.wallet.activeWalletName})}}},QT={class:"title"},ZT={class:"title"},JT={class:"title"};const ew={name:"FuturesWalletsList",components:{FuturesWalletsListHeader:OT,FuturesWalletsListRow:vr({name:"FuturesWalletsListRow",components:{FuturesWalletsListRowWallet:$T,FuturesWalletsListRowCurrency:YT,FuturesWalletsListRowWalletDetail:zT,FuturesWalletsListRowDetailActions:vr(XT,[["render",function(e,t,a,l,i,o){const u=s("Cell"),c=s("IconInfo2"),d=s("RouterLink"),f=s("ToolTip"),T=s("WalletPriceField"),w=s("WalletDetailActions"),D=s("Row");return n(),r(p,null,[m(D,{class:"assets-row padding-top",disableCssHoverEffect:"",index:a.index,disableBackground:""},{default:g((()=>[m(u),m(u,{textAlign:"left"},{default:g((()=>[y("div",QT,[v(h(e.$t("wallets.futures.totalAvailableAssets"))+" ",1),m(f,{placement:"top"},{content:g((()=>[m(c,{class:"info-icon"})])),tooltip:g((()=>[y("span",null,h(e.$t("wallets.futures.tooltip.totalAvailableAssetsTip")),1),t[1]||(t[1]=y("br",null,null,-1)),m(d,{class:"info-link",to:{name:i.TRADING_RULES_ROUTE_NAME,params:{lang:e.lang,marketType:"collateral"}},target:"_blank"},{default:g((()=>[v(h(e.$t("wallets.futures.tooltip.totalAvailableAssetsTipLink")),1)])),_:1},8,["to"])])),_:1})]),m(T,{class:"price-value",priceValue:o.totalAvailableAssets,currencyName:"USD",isFiat:"",size:"small"},null,8,["priceValue"])])),_:1}),m(u,null,{default:g((()=>[m(w,{actionType:i.actionType,"onUpdate:actionType":t[0]||(t[0]=e=>i.actionType=e),type:"futures"},null,8,["actionType"])])),_:1})])),_:1},8,["index"]),m(D,{class:"assets-row",disableCssHoverEffect:"",index:a.index,disableBackground:""},{default:g((()=>[m(u),m(u,{textAlign:"left"},{default:g((()=>[y("div",ZT,h(e.$t("t.availableForTransfer")),1),m(T,{class:"price-value",priceValue:a.wallet.availableForTransfer??0,currencyName:"USDT",isFiat:"",size:"small"},null,8,["priceValue"])])),_:1}),m(u)])),_:1},8,["index"]),m(D,{class:"assets-row padding-bottom",disableCssHoverEffect:"",index:a.index,disableBackgroun
1d:""},{default:g((()=>[m(u),m(u,{textAlign:"left"},{default:g((()=>[y("div",JT,[v(h(e.$t("wallets.futures.assetContribution"))+" ",1),m(f,{placement:"top"},{content:g((()=>[m(c,{class:"info-icon"})])),tooltip:g((()=>[y("span",null,h(e.$t("wallets.futures.tooltip.assetContributionTip")),1)])),_:1})]),m(T,{class:"price-value",priceValue:o.totalAssetContribution,currencyName:"USDT",isFiat:"",size:"small"},null,8,["priceValue"])])),_:1}),m(u)])),_:1},8,["index"])],64)}],["__scopeId","data-v-cbce6184"]])},props:{wallet:{type:Object,default:()=>({})},index:{type:Number,required:!0},toggleDetail:{type:Function,required:!0}},computed:{isWallet(){return"wallet"===this.wallet.type},isCurrencyHeader(){return"walletDetail"===this.wallet.type},isWalleDetailActions(){return"walletDetailActions"===this.wallet.type}}},[["render",function(e,t,a,l,r,o){const u=s("FuturesWalletsListRowWallet"),c=s("FuturesWalletsListRowWalletDetail"),d=s("FuturesWalletsListRowDetailActions"),p=s("FuturesWalletsListRowCurrency");return o.isWallet?(n(),i(u,{key:0,wallet:a.wallet,index:a.index,toggleDetail:a.toggleDetail},null,8,["wallet","index","toggleDetail"])):o.isCurrencyHeader?(n(),i(c,{key:1,wallet:a.wallet,index:a.index},null,8,["wallet","index"])):o.isWalleDetailActions?(n(),i(d,{key:2,wallet:a.wallet,index:a.index},null,8,["wallet","index"])):(n(),i(p,{key:3,asset:a.wallet,index:a.index},null,8,["asset","index"]))}]])},props:{searchKey:{type:String,default:""},hideSmall:{type:Boolean,default:!1}},data:()=>({FUTURES_BASE_CURRENCY:Cs,targetWallet:null}),computed:{...l({currencyMap:"currencyMap",assetExchangeRateMap:e=>e.futures.assetExchangeRateMap,assetCollateralRatioMap:e=>e.futures.assetCollateralRatioMap,futuresWalletList:e=>e.futures.walletList,futuresWalletMap:e=>e.futures.walletMap,futuresWalletDisplayMap:e=>e.futures.walletDisplayMap}),headerTitlesData(){return[{id:"toggle",textAlign:"center"},{id:"name",lang:this.$t("wallets.wallets"),textAlign:"left"},{id:"walletTotalValue",lang:this.$t("wallets.totalBalance"),tip:this.$t("wallets.futures.tooltip.totalValue"),textAlign:"right"}]},walletList(){return Sl(this.formatWalletList,this.filterList,this.getHideSmallList,this.formatAssetList)(this.tableData)},tableData(){return this.futuresWalletList.map((e=>this.futuresWalletDisplayMap[e]||this.futuresWalletMap[e]))},walletAssetMaping:()=>1},watch:{searchKey(e){""!==e&&(this.targetWallet=null)}},methods:{toggleDetail(e){this.targetWallet&&e.activeWalletName===this.targetWallet.activeWalletName?this.targetWallet=null:this.targetWallet=e},formatWalletList(e){return e.map((e=>{let t=N(0);return(e=wl(e)).name=this.$filters.walletName(e.activeWalletName),e.type="wallet",e.isOpenDetail=this.targetWallet&&e.activeWalletName===this.targetWallet.activeWalletName,e.availableForTransfer=N(e.availableBalance).minus(Math.max(e.unrealisedProfitLoss??0,0)).toNumber(),e.assets=e.assets.map((a=>{var l,s,i;const n=e.assetsInUse.find((({currency:e})=>e===a.currency)),r=n?n.balance:0;a.name=a.currency,a.type="currency",a.info=this.currencyMap[a.currency],a.assetsInUse=r;const o=(null==(l=this.assetExchangeRateMap[a.currency])?void 0:l.bid)||[],u=this.assetCollateralRatioMap[a.currency]||[],c=Cs===a.currency?a.balance:Os(a.balance,o),d=$s(c,u);return a.balanceInUsd=N(c).div(Ws((null==(s=this.assetExchangeRateMap.USD)?void 0:s.bid)||[])).toNumber(),a.availableBalance=Fs(a.balance,c,u,o),a.availableForTransfer=N(a.balance).minus(r).toNumber(),a.availableBalanceInUsd=N(a.availableBalance).times(Ws(o)).div(Ws((null==(i=this.assetExchangeRateMap.USD)?void 0:i.bid)||[])).toNumber(),a.valueInUsdt=c,a.valueInUsdtByCollateralRatio=d,t=t.plus(d),a})),e.walletTotalUsdtValue=t.toNumber(),e}))},filterList(e){return e.filter((e=>e.name.toLowerCase().includes(this.searchKey.toLowerCase())))},getHideSmallList(e){return this.hideSmall?e.filter((e=>{const t=e.walletTotalValue||0,a=e.assetInUsedInUSD||0;return Number(t)>=_l||Number(a)>=_l})):e},formatAssetList(e){const t=wl(e);if(!this.targetWallet||t.length<=0)return t;const a=t.findIndex((e=>e.activeWalletName===this.targetWallet.activeWalletName)),l={...this.targetWallet,walletTotalAssetInUsed:this.targetWallet.assetInUsedInUSD,type:"walletDetailActions"},s=this.targetWallet.assets.filter((e=>{if(!e.info)return!1;if(this.hideSmall){const t=e.balance||0,a=e.assetsInUse||0;return Number(t)>=1||Number(a)>=0}return!0})).sort(((e,t)=>t.assetsInUse-e.assetsInUse)).sort(((e,t)=>0!==e.assetsInUse?0:t.balance-e.balance));return t.splice(a+1,0,l,...s),t}}
1},tw={class:"wrapper"},aw={ref:"table",class:"table-wrapper"};const lw={name:"FuturesWallets",components:{FuturesWalletsList:vr(ew,[["render",function(e,t,a,l,o,u){const c=s("FuturesWalletsListHeader"),d=s("FuturesWalletsListRow"),h=s("DataTable");return n(),r("div",tw,[y("div",aw,[m(h,{fixHeader:""},{header:g((()=>[m(c,{headerTitles:u.headerTitlesData},null,8,["headerTitles"])])),body:g((()=>[(n(!0),r(p,null,x(u.walletList,((e,t)=>(n(),i(d,{key:`${e.activeWalletName||e.currency}-${e.type}`,index:t,wallet:e,toggleDetail:u.toggleDetail},null,8,["index","wallet","toggleDetail"])))),128))])),_:1})],512)])}],["__scopeId","data-v-b495f659"]]),WalletSearchInput:Kr,WalletHideSmallBalance:qh},data:()=>({INPUT_TYPES:Il,hideSmall:!1,searchKey:"",filterKey:El.ALL_ASSETS}),computed:{...l(["hideWalletSmallBalanceFutures"])}},sw={class:"futures-wallets"},iw={class:"action-wrapper"};const nw=vr(lw,[["render",function(e,t,a,l,i,o){const u=s("WalletSearchInput"),c=s("WalletHideSmallBalance"),d=s("FuturesWalletsList");return n(),r("div",sw,[y("div",iw,[m(u,{value:i.searchKey,"onUpdate:value":t[0]||(t[0]=e=>i.searchKey=e),class:"search-input",width:"100%",height:"40px",type:i.INPUT_TYPES.BOX},null,8,["value","type"]),m(c,{class:"wallet-hide-small",type:"futures",state:e.hideWalletSmallBalanceFutures},null,8,["state"])]),m(d,{searchKey:i.searchKey,filterKey:i.filterKey,hideSmall:e.hideWalletSmallBalanceFutures},null,8,["searchKey","filterKey","hideSmall"])])}],["__scopeId","data-v-c1b5ec85"]]),rw={name:"FuturesAssetsListHeader",components:{SortableHeaderCell:cl,IconInfo2:Fa},props:{headerTitles:{type:Array,default:()=>[]},sortKey:{type:[Boolean,String],default:void 0}},methods:{...Ly,getClass(e){const t=[];return e.textAlign&&t.push(`align-${e.textAlign}`),t}}},ow={class:"title"};const uw={class:"flex-box items-center"},cw={class:"full-name"},dw={name:"FuturesAssetsList",components:{FuturesAssetsListHeader:vr(rw,[["render",function(e,t,a,l,o,u){const c=s("IconInfo2"),f=s("RouterLink"),T=s("ToolTip"),w=s("SortableHeaderCell"),A=s("HeaderRow");return n(),i(A,{class:"futures-wallets-list-header"},{default:g((()=>[(n(!0),r(p,null,x(a.headerTitles,(l=>(n(),i(w,b({ref_for:!0},e.$attrs,{id:e.formatSortKey(l.id),key:l.id,currentSortKey:a.sortKey,class:u.getClass(l),title:l}),D({content:g((()=>[y("span",ow,h(e.$t(l.lang))+" "+h(l.more),1)])),_:2},[l.tip?{name:"tooltip",fn:g((()=>[m(T,{placement:"top",popover:!!l.tipLinkRoute},{content:g((()=>[m(c,{class:"info-icon"})])),tooltip:g((()=>[y("span",null,h(e.$t(l.tip)),1),l.tipLinkRoute?(n(),r(p,{key:0},[t[0]||(t[0]=y("br",null,null,-1)),l.tipLinkRoute?(n(),i(f,{key:0,class:"info-link",to:l.tipLinkRoute,target:"_blank"},{default:g((()=>[v(h(e.$t(l.tipLinkText)),1)])),_:2},1032,["to"])):d("",!0)],64)):d("",!0)])),_:2},1032,["popover"])])),key:"0"}:void 0]),1040,["id","currentSortKey","class","title"])))),128))])),_:1})}],["__scopeId","data-v-63b6f2e5"]]),FuturesAssetsListRow:vr({__name:"FuturesAssetsListRow",props:{asset:{type:Object,default:()=>({})},index:{type:Number,required:!0}},setup(e){const t=e,a=U(),{$openDialog:l}=Tl(),r=R((()=>a.state.hideConvertToBaseCurrencyValue)),o=R((()=>a.getters.isUnifiedWallet)),u=R((()=>t.asset.isFiat?Er.fiatCurrency(t.asset.shortName):Er.digitalCurrency(t.asset.shortName))),c=R((()=>t.asset.shortName===Ge.futuresWalletGeneralBonusCurrency)),p=R((()=>Ge.enableWalletBonusAsset&&c.value));return(a,c)=>{const v=s("Cell"),f=s("Row");return n(),i(f,{class:"assets-row",index:e.index,disableBackground:!0,disableCssHoverEffect:!0},{default:g((()=>[m(v,{class:"asset-name",textAlign:"left"},{default:g((()=>[y("div",uw,[m(Pa,{displayName:e.asset.displayName,"short-name":!0,type:e.asset.isFiat?"fiat":"icon",name:e.asset.shortName,size:"16"},null,8,["displayName","type","name"]),y("span",cw,h(u.value),1),m(Uy,{currency:e.asset.shortName},null,8,["currency"])])])),_:1}),m(v,{textAlign:o.value?"right":"left"},{default:g((()=>[m(By,{class:L({"clickable-text":p.value}),priceValue:e.asset.balance,currencyName:e.asset.displayName,isFiat:e.asset.isFiat,hideConvertToBaseCurrencyValue:r.value,dynamicCurrencyWidth:p.value,onClick:c[0]||(c[0]=e=>p.value&&void l(uh,{currency:t.asset.shortName,walletType:Ye.FUTURES}))},null,8,["class","priceValue","currencyName","isFiat","hideConvertToBaseCurrencyValue","dynamicCurrencyWidth"])])),_:1},8,["textAlign"]),o.value?(n(),i(v,{key:0,textAlign:"right"},{default:g((()=>[m(By,{priceValue:e.asset.availableBalance,currencyName:e.asset.displayName,isFiat:e.asset.isFiat,hideConvertToBaseCurrencyValue:r.value},null,8,["priceValue","currencyName","isFiat","hideConvertToBaseCurrencyValue"])])),_:1})):d("",!0),m(v,{textAlign:o.value?"right":"left"},{default:g((()=>[m(By,{priceValue:e.asset.availableForTransfer,currencyName:e.asset.displayName,isFiat:e.asset.isFiat,hideConvertToBaseCurrencyValue:r.value},null,8,["priceValue","currencyName","isFiat","hideConvertToBaseCurrencyValue"])])),_:1},8,["textAlign"]),o.value?(n(),i(v,{key:1,textAlign:"right"},{default:g((()=>[m(By,{priceValue:e.asset.valueInUsdtByCollateralRatio,currencyName:P(Cs),isFiat:!1}
1,null,8,["priceValue","currencyName"])])),_:1})):d("",!0)])),_:1},8,["index"])}}},[["__scopeId","data-v-4e30cce7"]])},props:{searchKey:{type:String,default:""},filterKey:{type:String,required:!0},hideSmall:{type:Boolean,default:!1}},data:()=>({sortKey:null,sortOrder:null}),computed:{...Qt.computed,...bl.computed,...Ls.computed,...l(["lang"]),...t(["isUnifiedWallet"]),...Dl.computed,headerTitlesData(){return[{id:"shortName",lang:"wallets.spotList.asset",textAlign:"left",sortable:!0},{id:"balance",lang:"wallets.spotList.total",textAlign:this.isUnifiedWallet?"right":"left",sortable:!0},this.isUnifiedWallet&&{id:"availableBalance",lang:"wallets.futures.totalAvailableAssets",tip:"wallets.futures.tooltip.totalAvailableAssetsTip",tipLinkText:"wallets.futures.tooltip.totalAvailableAssetsTipLink",tipLinkRoute:{name:Ke.TRADING_RULES,params:{lang:this.lang,marketType:"collateral"}},textAlign:"right",sortable:!0},{id:"availableForTransfer",lang:"t.availableForTransfer",textAlign:this.isUnifiedWallet?"right":"left",sortable:!0},this.isUnifiedWallet&&{id:"valueInUsdtByCollateralRatio",lang:"wallets.futures.assetContribution",tip:"wallets.futures.tooltip.assetContributionTip",textAlign:"right",sortable:!0}].filter((e=>e))},assetsData(){const e=Sl(this.formatAssetI18nName,this.filterList,this.searchList,this.sortList,this.getHideSmallList);let t=this.futuresCurrencyOrderList;return this.sortKey&&(t=this.convertToBaseCurrencyValue(t,this.sortKey)),e(t)}},methods:{...Dl.methods,...Ls.methods,setSortData({key:e,order:t}){this.sortKey=e,this.sortOrder=t},getHideSmallList(e){return this.hideSmall&&!this.searchKey?e.filter((e=>{var t;const a=null==(t=this.currencyMap[e.shortName])?void 0:t.usdRate,l=N(e.balance).times(a).toNumber(),s=N(e.assetsInUse).times(a).toNumber();return l>=_l||s>=_l})):e}}},pw={class:"wrapper"},yw={ref:"table",class:"table-wrapper"};const hw={name:"FuturesAssets",components:{FuturesAssetsList:vr(dw,[["render",function(e,t,a,l,o,u){const c=s("FuturesAssetsListHeader"),d=s("FuturesAssetsListRow"),h=s("DataTable");return n(),r("div",pw,[y("div",yw,[m(h,{fixHeader:""},{header:g((()=>[m(c,{headerTitles:u.headerTitlesData,sortKey:o.sortKey,onSort:u.setSortData},null,8,["headerTitles","sortKey","onSort"])])),body:g((()=>[(n(!0),r(p,null,x(u.assetsData,((e,t)=>(n(),i(d,{key:e.id,index:t,asset:e},null,8,["index","asset"])))),128))])),_:1})],512)])}],["__scopeId","data-v-77ff906c"]]),WalletSearchInput:Kr,WalletFilter:Iv,WalletHideSmallBalance:qh,WalletIsConvertToBase:zh},data:()=>({hideSmall:!1,searchKey:"",filterKey:El.ALL_ASSETS}),computed:{...l(["hideWalletSmallBalanceFutures","hideConvertToBaseCurrencyValue"])},methods:{e2eID:Xe}},vw={class:"futures-assets"},mw={class:"action-wrapper"},gw={class:"wallet-actions"};const fw=vr(hw,[["render",function(e,t,a,l,i,o){const u=s("WalletSearchInput"),c=s("WalletFilter"),d=s("WalletIsConvertToBase"),p=s("WalletHideSmallBalance"),h=s("FuturesAssetsList");return n(),r("div",vw,[y("div",mw,[m(u,{id:o.e2eID("input_search"),value:i.searchKey,"onUpdate:value":t[0]||(t[0]=e=>i.searchKey=e),width:"252px",height:"32px"},null,8,["id","value"]),m(c,{filterKey:i.filterKey,"onUpdate:filterKey":t[1]||(t[1]=e=>i.filterKey=e),class:"wallet-filter"},null,8,["filterKey"]),y("div",gw,[m(d,{state:e.hideConvertToBaseCurrencyValue},null,8,["state"]),m(p,{class:"wallet-hide-small",type:"futures",state:e.hideWalletSmallBalanceFutures,isDisable:!!i.searchKey},null,8,["state","isDisable"])])]),m(h,{searchKey:i.searchKey,filterKey:i.filterKey,hideSmall:e.hideWalletSmallBalanceFutures},null,8,["searchKey","filterKey","hideSmall"])])}],["__scopeId","data-v-d2e4fb37"]]),Tw={class:"futures-positions"},ww={class:"symbol-cell"},Dw={class:"symbol"},Aw={class:"margin-leverage"},bw={class:"margin-type"},_w={class:"currency"},Sw={class:"currency"},Cw={class:"currency"},Lw={class:"currency"},Ew={class:"currency"},Iw=vr({__name:"FuturesPositions",setup(e){const{t:t}=I(),a=U(),{positions:l,settleInCurrency:i}=wT(),o="symbol",u="size",c="entryPriceDisplay",d="markPriceDisplay",p="liqPriceDisplay",v="roeDisplay",f="action",T="symbol",w="size",D="entryPrice",A="markPrice",b="liquidationPrice",_="positionRoe",S=J({sortBy:o,sortOrder:"asc"}),C=R((()=>[{id:o,sortId:T,label:t("futuresMain.symbol"),isSortable:!0},{id:u,sortId:w,label:t("t.positionSize"),isSortable:!0,textAlign:"right"},{id:c,sortId:D,label:t("futuresMain.openPosition.entryPrice"),isSortable:!0,textAlign:"right"},{id:d,sortId:A,label:t("futuresMain.openPosition.markPrice"),isSortable:!0,textAlign:"right"},{id:p,sortId:b,label:t("futuresMain.openPosition.liqPrice"),isSortable:!0,textAlign:"right"},{id:v,sortId:_,label:t("futuresMain.openPosition.unrealizedPNL"),isSortable:!0,textAlign:"right"},{id:f,label:t("t.trade"),textAlign:"center"}])),E=R((()=>xs(l.value,S.sortBy,S.sortOrder)));function k(e){return e<0?"brand-color-negative":"brand-color-positive"}function N({key:e,order:t}){e&&(S.sortBy=e),S.sortOrder=t}return(e,t)=>{const l=s("RouterLink");
1return n(),r("div",Tw,[m(P(Ps),{class:"positions-table",columns:C.value,rows:E.value,total:E.value.length,currentSortKey:S.sortBy,fixHeader:"",onSort:N},{[`cell(${o})`]:g((({info:e})=>[y("div",ww,[y("div",null,[m(P(Pa),{name:e.baseCurrency,showName:!1,size:"16"},null,8,["name"])]),y("div",null,[y("div",null,[y("span",Dw,h(e.symbol),1),y("span",{class:L(["side-label",e.orderModeClass])},h(e.orderMode),3)]),y("div",Aw,[y("span",bw,h(e.marginType),1),y("span",null,h(e.leverage),1)])])])])),[`cell(${u})`]:g((({value:e,info:t})=>[y("span",null,h(e),1),y("span",_w,h(t.sizeUnit),1)])),[`cell(${c})`]:g((({value:e})=>[y("span",null,h(e),1),y("span",Sw,h(P(i)),1)])),[`cell(${d})`]:g((({value:e})=>[y("span",null,h(e),1),y("span",Cw,h(P(i)),1)])),[`cell(${p})`]:g((({value:e})=>[y("span",null,h(e),1),y("span",Lw,h(P(i)),1)])),[`cell(${v})`]:g((({value:e,info:t})=>[y("span",{class:L(k(t.unrealizedPnlInSettleAsset))},h(t.unrealizedPnLDisplay),3),y("span",Ew,h(t.settleWithNonUSDAsset),1),y("span",{class:L(k(t.unrealizedPnlInSettleAsset))}," ("+h(e)+") ",3)])),[`cell(${f})`]:g((({info:e})=>[m(l,{class:"action-link",to:{name:"futuresId",params:{lang:P(a).state.lang,id:e.symbol}},target:"_blank"},{default:g((()=>[m(P(At))])),_:2},1032,["to"])])),_:2},1032,["columns","rows","total","currentSortKey"])])}}},[["__scopeId","data-v-ee1fc36b"]]),kw={name:"FuturesWalletsListHeader",components:{SortableHeaderCell:cl,IconInfo2:Fa},props:{headerTitles:{type:Array,default:function(){return[]}},sortKey:{type:[Boolean,String],default:void 0}},methods:{getClass(e){const t=[];return e.textAlign&&t.push(`align-${e.textAlign}
1`),"name"===e.id&&t.push("name"),"transfer"!==e.id&&"history"!==e.id||t.push("action"),t}}},Rw={class:"title"};const Nw=vr(kw,[["render",function(e,t,a,l,o,u){const c=s("IconInfo2"),f=s("RouterLink"),T=s("ToolTip"),w=s("SortableHeaderCell"),A=s("HeaderRow");return n(),i(A,{class:"futures-wallets-list-header"},{default:g((()=>[(n(!0),r(p,null,x(a.headerTitles,(l=>(n(),i(w,b({ref_for:!0},e.$attrs,{key:l.id,currentSortKey:a.sortKey,class:u.getClass(l),title:l}),D({content:g((()=>[y("span",Rw,h(l.lang)+" "+h(l.more),1)])),_:2},[l.tip?{name:"tooltip",fn:g((()=>[m(T,{placement:"top",popover:!!l.tipLinkRoute},{content:g((()=>[m(c,{class:"info-icon"})])),tooltip:g((()=>[y("span",null,h(l.tip),1),l.tipLinkRoute?(n(),r(p,{key:0},[t[0]||(t[0]=y("br",null,null,-1)),l.tipLinkRoute?(n(),i(f,{key:0,class:"info-link",to:l.tipLinkRoute,target:"_blank"},{default:g((()=>[v(h(l.tipLinkText),1)])),_:2},1032,["to"])):d("",!0)],64)):d("",!0)])),_:2},1032,["popover"])])),key:"0"}:void 0]),1040,["currentSortKey","class","title"])))),128))])),_:1})}],["__scopeId","data-v-8839d068"]]),xw={name:"FuturesWalletsListRowWallet",components:{IconChevronDown:Ka,IconTransfer:Ur,IconHistory:at,WalletPriceField:By},props:{wallet:{type:Object,default:()=>({})},index:{type:Number,required:!0},toggleDetail:{type:Function,required:!0}},setup(){const{getIsUserFeatureAllow:e}=Nt();return{getIsUserFeatureAllow:e}},data:()=>({WALLET_ACTIONS:It,FUTURES_BASE_CURRENCY:Cs}),computed:{...gr.computed,...l(["lang"]),displayActionMap(){return this.getDisplayActionMap(Ft.FUTURES_SPECIFIC)},isCrossWallet(){return this.wallet.isCrossWallet},totalAssetData(){var e,t;const a={totalAvailableAssets:N(0),totalAssetContribution:N(0),totalBalance:N(0)};return null==(t=null==(e=this.wallet)?void 0:e.assets)||t.forEach((e=>{a.totalBalance=a.totalBalance.plus(e.balanceInUsd),a.totalAvailableAssets=a.totalAvailableAssets.plus(e.availableBalanceInUsd),a.totalAssetContribution=a.totalAssetContribution.plus(e.valueInUsdtByCollateralRatio)})),a},totalBalance(){return this.totalAssetData.totalBalance.toNumber()||0},totalAvailableAssets(){return this.totalAssetData.totalAvailableAssets.toNumber()||0},totalAssetContribution(){return this.totalAssetData.totalAssetContribution.toNumber()||0}},methods:{...gr.methods,e2eID:Xe,...e(Mr,["toggleTransferPopup"]),hasBalance:({walletTotalValue:e})=>e>0,onAction(e){switch(e){case It.TRANSFER:this.handleTransfer();break;case It.GO_HISTORY_PAGE:this.handleGoHistoryPage()}},handleTransfer(){const e=this.wallet.transferableBalance>0?"from":"to";this.toggleTransferPopup({[e]:this.wallet.activeWalletName})},handleGoHistoryPage(){this.wallet&&this.wallet.activeWalletName&&this.$router.push({name:Ke.FUTURES_WALLET_DETAIL,params:{lang:this.lang},query:{name:this.wallet.activeWalletName}})}}},Pw={class:"icon-wrap"},Ow={class:"icon-wrap"};const $w={class:"currency--short-name"},Ww={class:"currency--name"};const Fw={name:"FuturesWalletsList",components:{FuturesWalletsListHeader:Nw,FuturesWalletsListRow:vr({name:"FuturesWalletsListRow",components:{FuturesWalletsListRowWallet:vr(xw,[["render",function(e,t,a,l,r,o){const u=s("IconChevronDown"),c=s("Cell"),p=s("WalletPriceField"),f=s("IconTransfer"),T=s("IconHistory"),D=s("Row");return n(),i(D,{class:L(["assets-row",{"is-open-detail":a.wallet.isOpenDetail,"is-cross-wallet":o.isCrossWallet}]),disableCssHoverEffect:!0,index:a.index,disableBackground:!0,onClick:t[2]||(t[2]=e=>o.hasBalance(a.wallet)&&a.toggleDetail(a.wallet))},{default:g((()=>[m(c,{class:"toggle",textAlign:"center"},{default:g((()=>[m(u,{class:L(["icon-chevron-down",{show:o.hasBalance(a.wallet)}]),"aria-label":"icon chevron down","stroke-width":"1.5"},null,8,["class"])])),_:1}),m(c,{class:"name",textAlign:"left"},{default:g((()=>[v(h(a.wallet.name),1)])),_:1}),m(c,{class:"bold",textAlign:"right"},{default:g((()=>[m(p,{priceValue:o.totalBalance,currencyName:"USD",isFiat:!0},null,8,["priceValue"])])),_:1}),m(c,{class:"bold",textAlign:"right"},{default:g((()=>[m(p,{priceValue:o.totalAvailableAssets,currencyName:"USD",isFiat:!0},null,8,["priceValue"])])),_:1}),m(c,{class:"available bold",textAlign:"right"},{default:g((()=>[m(p,{priceValue:a.wallet.availableForTransfer??0,currencyName:"USDT",isFiat:!0},null,8,["priceValue"])])),_:1}),m(c,{class:"bold",textAlign:"right"},{default:g((()=>[m(p,{priceValue:o.totalAssetContribution,currencyName:r.FUTURES_BASE_CURRENCY,isFiat:!1}
1,null,8,["priceValue","currencyName"])])),_:1}),m(c,{class:"action",textAlign:"center"},{default:g((()=>[y("div",Pw,[o.displayActionMap[r.WALLET_ACTIONS.TRANSFER]?(n(),i(f,{key:0,id:o.e2eID(`btn_${a.wallet.activeWalletName.toLowerCase()}_transfer`),class:"icon",onClick:t[0]||(t[0]=w((e=>o.onAction(r.WALLET_ACTIONS.TRANSFER)),["stop"]))},null,8,["id"])):d("",!0)])])),_:1}),m(c,{class:"action",textAlign:"center"},{default:g((()=>[y("div",Ow,[o.displayActionMap[r.WALLET_ACTIONS.GO_HISTORY_PAGE]?(n(),i(T,{key:0,id:o.e2eID(`btn_${a.wallet.activeWalletName.toLowerCase()}_history`),class:"icon",onClick:t[1]||(t[1]=w((e=>o.onAction(r.WALLET_ACTIONS.GO_HISTORY_PAGE)),["stop"]))},null,8,["id"])):d("",!0)])])),_:1})])),_:1},8,["class","index"])}],["__scopeId","data-v-e847be62"]]),FuturesWalletsListRowCurrency:vr({name:"FuturesWalletsListRowCurrency",components:{BrandIcon:Pa,WalletPriceField:By},props:{asset:{type:Object,default:()=>({})},index:{type:Number,required:!0}},data:()=>({FUTURES_BASE_CURRENCY:Cs}),computed:{assetName(){const e=this.$filters;return this.asset.info.isFiat?e.fiatCurrency(this.asset.info.shortName):e.digitalCurrency(this.asset.info.shortName)}}},[["render",function(e,t,a,l,r,o){const u=s("Cell"),c=s("BrandIcon"),d=s("WalletPriceField"),p=s("Row");return n(),i(p,{class:"assets-row",disableCssHoverEffect:!0,index:a.index,disableBackground:!0},{default:g((()=>[m(u,{class:"toggle"}),m(u,{class:"currency",textAlign:"left"},{default:g((()=>[m(c,{class:"icon",displayName:a.asset.info.shortName,showName:!1,type:1===a.asset.info.type?"fiat":"icon",name:a.asset.info.shortName,size:"16"},null,8,["displayName","type","name"]),y("span",$w,h(a.asset.info.displayName),1),y("span",Ww,h(o.assetName),1)])),_:1}),m(u,{class:"bold",textAlign:"right"},{default:g((()=>[m(d,{priceValue:a.asset.balance,currencyName:a.asset.info.displayName,isFiat:a.asset.info.isFiat,forceShowWvc:!0},null,8,["priceValue","currencyName","isFiat"])])),_:1}),m(u,{class:"bold balance",textAlign:"right"},{default:g((()=>[m(d,{priceValue:a.asset.availableBalance,currencyName:a.asset.info.displayName,isFiat:a.asset.info.isFiat,forceShowWvc:!0},null,8,["priceValue","currencyName","isFiat"])])),_:1}),m(u,{class:"available bold",textAlign:"right"},{default:g((()=>[m(d,{priceValue:a.asset.availableForTransfer,currencyName:a.asset.info.displayName,isFiat:a.asset.info.isFiat,forceShowWvc:!0},null,8,["priceValue","currencyName","isFiat"])])),_:1}),m(u,{class:"bold balance",textAlign:"right"},{default:g((()=>[m(d,{priceValue:a.asset.valueInUsdtByCollateralRatio,currencyName:r.FUTURES_BASE_CURRENCY,isFiat:!1,forceShowWvc:!0},null,8,["priceValue","currencyName"])])),_:1}),m(u,{class:"more-action",textAlign:"center"}),m(u,{class:"more-action",textAlign:"center"})])),_:1},8,["index"])}],["__scopeId","data-v-3985637d"]]),FuturesWalletsListRowCurrencyHeader:vr({name:"FuturesWalletsListRowCurrencyHeader",props:{asset:{type:Object,default:()=>({})},index:{type:Number,required:!0}},data:()=>({TRADING_RULES_ROUTE_NAME:Ke.TRADING_RULES}),computed:{...l(["lang"])}},[["render",function(e,t,a,l,r,o){const u=s("Cell"),c=s("ToolTip"),d=s("RouterLink"),p=s("Row");return n(),i(p,{class:"assets-row",disableCssHoverEffect:!0,index:a.index,disableBackground:!0},{default:g((()=>[m(u,{class:"toggle"}),m(u,{class:"currency",textAlign:"left"},{default:g((()=>[y("span",null,h(e.$t("statusPage.asset")),1)])),_:1}),m(u,{class:"bold balance",textAlign:"right"},{default:g((()=>[m(c,{content:e.$t("wallets.totalValue"),tooltip:e.$t("wallets.futures.tooltip.balance")},null,8,["content","tooltip"])])),_:1}),m(u,{class:"bold balance",textAlign:"right"},{default:g((()=>[m(c,{content:e.$t("wallets.futures.totalAvailableAssets"),popover:!0},{tooltip:g((()=>[y("span",null,h(e.$t("wallets.futures.tooltip.totalAvailableAssetsTip")),1),t[0]||(t[0]=y("br",null,null,-1)),m(d,{class:"info-link",to:{name:r.TRADING_RULES_ROUTE_NAME,params:{lang:e.lang,marketType:"collateral"}},target:"_blank"},{default:g((()=>[v(h(e.$t("wallets.futures.tooltip.totalAvailableAssetsTipLink")),1)])),_:1},8,["to"])])),_:1},8,["content"])])),_:1}),m(u,{class:"bold balance",textAlign:"right"},{default:g((()=>[v(h(e.$t("t.availableForTransfer")),1)])),_:1}),m(u,{class:"bold balance",textAlign:"right"},{default:g((()=>[m(c,{content:e.$t("wallets.futures.assetContribution"),tooltip:e.$t("wallets.futures.tooltip.assetContributionTip")},null,8,["content","tooltip"])])),_:1}),m(u,{class:"more-action",textAlign:"center"}),m(u,{class:"more-action",textAlign:"center"}
1)])),_:1},8,["index"])}],["__scopeId","data-v-9f86b72b"]])},props:{wallet:{type:Object,default:()=>({})},index:{type:Number,required:!0},toggleDetail:{type:Function,required:!0}},computed:{isWallet(){return"wallet"===this.wallet.type},isCurrencyHeader(){return"currencyHeader"===this.wallet.type}}},[["render",function(e,t,a,l,r,o){const u=s("FuturesWalletsListRowWallet"),c=s("FuturesWalletsListRowCurrencyHeader"),d=s("FuturesWalletsListRowCurrency");return o.isWallet?(n(),i(u,{key:0,wallet:a.wallet,index:a.index,toggleDetail:a.toggleDetail},null,8,["wallet","index","toggleDetail"])):o.isCurrencyHeader?(n(),i(c,{key:1,asset:a.wallet,index:a.index},null,8,["asset","index"])):(n(),i(d,{key:2,asset:a.wallet,index:a.index},null,8,["asset","index"]))}]])},props:{searchKey:{type:String,default:""},hideSmall:{type:Boolean,default:!1}},data:()=>({sortKey:null,sortOrder:null,targetWallet:null}),computed:{...l({lang:"lang",currencyMap:"currencyMap",assetExchangeRateMap:e=>e.futures.assetExchangeRateMap,assetCollateralRatioMap:e=>e.futures.assetCollateralRatioMap,futuresWalletList:e=>e.futures.walletList,futuresWalletMap:e=>e.futures.walletMap,futuresWalletDisplayMap:e=>e.futures.walletDisplayMap}),headerTitlesData(){return[{id:"toggle",lang:"",textAlign:"center"},{id:"name",lang:this.$t("wallets.wallets"),textAlign:"left",sortable:!0},{id:"walletTotalValue",lang:this.$t("wallets.totalBalance"),textAlign:"right",sortable:!0},{id:"availableBalance",lang:this.$t("wallets.futures.totalAvailableAssets"),tip:this.$t("wallets.futures.tooltip.totalAvailableAssetsTip"),tipLinkText:this.$t("wallets.futures.tooltip.totalAvailableAssetsTipLink"),tipLinkRoute:{name:Ke.TRADING_RULES,params:{lang:this.lang,marketType:"collateral"}},textAlign:"right",sortable:!0},{id:"availableForTransfer",lang:this.$t("t.availableForTransfer"),textAlign:"right",sortable:!0},{id:"walletTotalUsdtValue",lang:this.$t("wallets.futures.assetContribution"),tip:this.$t("wallets.futures.tooltip.assetContributionTip"),textAlign:"right",sortable:!0},{id:"transfer",lang:this.$t("wallets.transfer"),textAlign:"center"},{id:"history",lang:this.$t("wallets.spotList.history"),textAlign:"center"}].filter((e=>e))},walletList(){return Sl(this.formatWalletList,this.filterList,this.sortList,this.getHideSmallList,this.formatAssetList)(this.tableData)},tableData(){return this.futuresWalletList.map((e=>this.futuresWalletDisplayMap[e]||this.futuresWalletMap[e]))},walletAssetMaping:()=>1},watch:{searchKey(e){""!==e&&(this.targetWallet=null)}},methods:{setSortData({key:e,order:t}){this.sortKey=e,this.sortOrder=t},toggleDetail(e){this.targetWallet&&e.activeWalletName===this.targetWallet.activeWalletName?this.targetWallet=null:this.targetWallet=e},formatWalletList(e){return e.map((e=>{let t=N(0);return(e=wl(e)).name=this.$filters.walletName(e.activeWalletName),e.type="wallet",e.isOpenDetail=this.targetWallet&&e.activeWalletName===this.targetWallet.activeWalletName,e.availableForTransfer=N(e.availableBalance).minus(Math.max(e.unrealisedProfitLoss??0,0)).toNumber(),e.assets=e.assets.map((a=>{var l,s,i;const n=e.assetsInUse.find((({currency:e})=>e===a.currency)),r=n?n.balance:0;a.name=a.currency,a.type="currency",a.info=this.currencyMap[a.currency],a.assetsInUse=r;const o=(null==(l=this.assetExchangeRateMap[a.currency])?void 0:l.bid)||[],u=this.assetCollateralRatioMap[a.currency]||[],c=Cs===a.currency?a.balance:Os(a.balance,o),d=$s(c,u);return a.balanceInUsd=N(c).div(Ws((null==(s=this.assetExchangeRateMap.USD)?void 0:s.bid)||[])).toNumber(),a.availableBalance=Fs(a.balance,c,u,o),a.availableForTransfer=N(a.balance).minus(r).toNumber(),a.availableBalanceInUsd=N(a.availableBalance).times(Ws(o)).div(Ws((null==(i=this.assetExchangeRateMap.USD)?void 0:i.bid)||[])).toNumber(),a.valueInUsdt=c,a.valueInUsdtByCollateralRatio=d,t=t.plus(d),a})),e.walletTotalUsdtValue=t.toNumber(),e}))},filterList(e){return e.filter((e=>e.name.toLowerCase().includes(this.searchKey.toLowerCase())))},sortList(e){return this.sortKey?xs(e,this.sortKey,this.sortOrder):e},getHideSmallList(e){return this.hideSmall?e.filter((e=>{const t=e.walletTotalValue||0,a=e.assetInUsedInUSD||0;return Number(t)>=_l||Number(a)>=_l})):e},formatAssetList(e){const t=wl(e);if(!this.targetWallet||t.length<=0)return t;const a=t.findIndex((e=>e.activeWalletName===this.targetWallet.activeWalletName)),l=this.targetWallet.assets.filter((e=>{if(!e.info)return!1;if(this.hideSmall){const t=e.balance||0,a=e.assetsInUse||0;return Number(t)>=1||Number(a)>=0}return!0})).sort(((e,t)=>t.assetsInUse-e.assetsInUse)).sort(((e,t)=>0!==e.assetsInUse?0:t.balance-e.balance));return t.splice(a+1,0,{type:"currencyHeader"},...l),t}}},Bw={class:"wrapper"},Uw={ref:"table",class:"table-wrapper"};const Mw={name:"FuturesWallets",components:{FuturesWalletsList:vr(Fw,[["render",function(e,t,a,l,o,u){const c=s("FuturesWalletsListHeader"),d=s("FuturesWalletsListRow"),h=s("DataTable");return n(),r("div",Bw,[y("div",Uw,[m(h,{fixHeader:""},{header:g((()=>[m(c,{headerTitles:u.headerTitlesData,sortKey:o.sortKey,onSort:u.setSortData},null,8,["headerTitles","sortKey","onSort"])])),body:g((()=>[(n(!0),r(p,null,x(u.walletList,((e,t)=>
1(n(),i(d,{key:e.activeWalletName,index:t,wallet:e,toggleDetail:u.toggleDetail},null,8,["index","wallet","toggleDetail"])))),128))])),_:1})],512)])}],["__scopeId","data-v-18181d01"]]),WalletSearchInput:Kr,WalletHideSmallBalance:qh},data:()=>({hideSmall:!1,searchKey:"",filterKey:El.ALL_ASSETS}),computed:{...l(["hideWalletSmallBalanceFutures"])},methods:{e2eID:Xe}},Vw={class:"futures-wallets"},Hw={class:"action-wrapper"};const Gw=vr(Mw,[["render",function(e,t,a,l,i,o){const u=s("WalletSearchInput"),c=s("WalletHideSmallBalance"),d=s("FuturesWalletsList");return n(),r("div",Vw,[y("div",Hw,[m(u,{id:o.e2eID("input_search"),value:i.searchKey,"onUpdate:value":t[0]||(t[0]=e=>i.searchKey=e),width:"252px",height:"32px"},null,8,["id","value"]),m(c,{type:"futures",state:e.hideWalletSmallBalanceFutures},null,8,["state"])]),m(d,{searchKey:i.searchKey,filterKey:i.filterKey,hideSmall:e.hideWalletSmallBalanceFutures},null,8,["searchKey","filterKey","hideSmall"])])}],["__scopeId","data-v-fbdb819a"]]),Yw=["href"],qw={key:0},zw={__name:"WalletFutures",setup(e){const t={ASSETS:"assets",WALLETS:"wallets",POSITIONS:"positions"},a=U(),{t:l}=I(),s=ze(),o=O(0),u=R((()=>a.state.lang)),c=R((()=>s.displayCurrency)),y=R((()=>a.getters.isUnifiedWallet)),f=R((()=>a.getters.showWalletUpgradeBanner)),T=R((()=>gt(u.value,"UNIFIED_WALLET_USER_GUIDE"))),w=R((()=>T.value&&!f.value&&y.value)),D=R((()=>[{key:t.ASSETS,label:l("wallets.assets")},{key:t.WALLETS,label:l("wallets.wallets"),isHide:y.value},{key:t.POSITIONS,label:l("order.positions")}].filter((e=>!e.isHide)))),A=R((()=>D.value[o.value].key));function b(e){o.value=e}return $((()=>D.value.length),(()=>{o.value=0}),{immediate:!0}),(e,a)=>(n(),r(p,null,[f.value?(n(),i(Ko,{key:0})):d("",!0),m(Sy,{type:"futures",title:e.$t("wallets.futuresWallet"),featuresList:P(Bs),tabList:D.value,selectedTabIndex:o.value,displayCurrency:c.value,useWalletBalanceInfo:"",useAccountVerifyPopup:"",onTabSelected:b},{"header-link":g((()=>[w.value?(n(),r("a",{key:0,target:"_blank",href:T.value,class:"title-section-link"},[v(h(e.$t("wallet.upgradeUnifiedWalletDialog.userGuide"))+" ",1),m(P(ht),{width:"16",height:"16"})],8,Yw)):d("",!0)])),mobile:g((()=>[A.value===t.ASSETS?(n(),i(TT,{key:0})):A.value===t.POSITIONS?(n(),i(NT,{key:1})):A.value===t.WALLETS?(n(),i(nw,{key:2})):d("",!0)])),desktop:g((()=>[A.value===t.ASSETS?(n(),i(fw,{key:0})):A.value===t.POSITIONS?(n(),i(Iw,{key:1})):A.value===t.WALLETS?(n(),i(Gw,{key:2})):d("",!0)])),"data-note":g((()=>[A.value===t.WALLETS?(n(),r("p",qw," * "+h(e.$t("wallets.futures.wallets.pnlNote")),1)):d("",!0)])),_:1},8,["title","featuresList","tabList","selectedTabIndex","displayCurrency"])],64))}},Kw={class:"wallet-dropdown-value"};const jw=vr({name:"WalletHistoryDropdown",components:{Dropdown:Wl,DropdownItem:$l},props:{list:{type:Array,default:()=>[]},handleUpdate:{type:Function,default:()=>{}},height:{type:String,default:"48px"},borderRadius:{type:String,default:"4px"},selectValue:{type:[String,Number],required:!0},placeholder:{type:String,default:""}},computed:{selectItemName(){const e=this.list.find((e=>e.value===this.selectValue));return null==e?void 0:e.name}},mounted(){this.$nextTick((()=>{const{walletDropdown:e}=this.$refs;(null==e?void 0:e.$el)&&(e.$el.style.setProperty("--input-height",`${this.height}`),e.$el.style.setProperty("--border-radius",`${this.borderRadius}`))}))},methods:{handleSelect(e){this.handleUpdate(e)}}},[["render",function(e,t,a,l,o,u){const c=s("DropdownItem"),d=s("Dropdown");return n(),i(d,{ref:"walletDropdown",class:"wallet-dropdown",value:a.selectValue,onInput:u.handleSelect},{placeholder:g((()=>[v(h(a.placeholder),1)])),value:g((()=>[y("span",Kw,h(u.selectItemName),1)])),default:g((()=>[(n(!0),r(p,null,x(a.list,(e=>(n(),i(c,{key:e.name,value:e.value},{default:g((()=>[v(h(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value","onInput"])}],["__scopeId","data-v-5f29aa36"]]),Xw={name:"FuturesWalletFilterDialog",components:{WalletHistoryDropdown:jw,WalletCurrencyDropdown:eo,HistoryDropdown:io,IconCalendar:da,IconChevronDown:ca,IconPlus:Us,DateRangePickerDialog:pa,ActionButton:so},props:{idPrefix:{type:String,default:null},isOpenFilterDialog:{type:Boolean,required:!0},dateRangeData:{type:Object,required:!0},defaultDateRangeData:{type:Object,required:!0},walletList:{type:Array,required:!0},typeList:{type:Array,required:!0},selectedWalletName:{type:String,required:!0},selectedCurrency:{type:String,default:""},selectedHistoryType:{type:String,default:""},updateFilterData:{type:Function,default:()=>{}}},emits:["update:isOpenFilterDialog"],data(){return{rangeLimitDuration:{years:1},filterDateRangeData:this.dateRangeData,filterWalletName:this.selectedWalletName,filterCurrency:this.selectedCurrency,filterHistoryType:this.selectedHistoryType,showDatePickerDialog:!1}},computed:{...t(["isUnifiedWallet","isNewUserOfUnifiedWallet"]),dateRangeText(){return{start:Ms(this.filterDateRangeData.start,"yyyy-MM-dd"),end:Ms(this.filterDateRangeData.end,"yyyy-MM-dd")}}},methods:{onResetClick(){this.filterDateRangeData={...this.defaultDateRangeData},this.filterWalletName=this.walletList[0].value,this.filterCurrency="",this.$refs.historyTypeDropdown.reset()},onApplyClick(){this.updateFilterData({dateRangeData:this.filterDateRangeData,walletName:this.filterWalletName,currency:this.filterCurrency,historyType:this.filterHistoryType}),this.close()},close(){this.$emit("update:isOpenFilterDialog",!1)},openDatePickerDialog(){this.showDatePickerDialog=!0},handleChangeWallet(e){this.filterWalletName=e},updateHistoryType(e){this.filterHistoryType=e},handleSelectAllCurrency(){this.filterCurrency=""}}},Qw={class:"filter-dialog"},Zw={class:"content-wrap"},Jw={class:"title"},eD={class:"filters-wrap"},tD={class:"filter"},aD={class:"sub-title"},lD={class:"dates"},sD={key:0,class:"filter"},iD={class:"sub-title"},nD={class:"filter"},rD={class:"sub-title"},oD={class:"filter"},uD={class:"sub-title"},cD={class:"action-wrap"};const dD=vr(Xw,[["render",function(e,t,a,l,o,u){const c=s("IconPlus"),p=s("IconCalendar"),f=s("IconChevronDown"),T=s("WalletHistoryDropdown"),w=s("WalletCurrencyDropdown"),D=s("HistoryDropdown"),A=s("ActionButton"),b=s("DateRangePickerDialog");return n(),r("div",Qw,[y("div",Zw,[m(c,{class:"close-icon",onClick:u.close},null,8,["onClick"]),y("div",Jw,h(e.$t("t.filters")),1),y("div",eD,[y("div",tD,[y("span",aD,h(e.$t("t.timePeriod")),1),y("div",{class:"date-range-wrapper",onClick:t[0]||(t[0]=(...e)=>u.openDatePickerDialog&&u.openDatePickerDialog(...e))},[m(p,{class:"icon-calendar"}),y("div",lD,[y("span",null,h(u.dateRangeText.start),1),t[4]||(t[4]=y("span",null,"-",-1)),y("span",null,h(u.dateRangeText.end),1)]),m(f,{class:"arrow"})])]),e.isNewUserOfUnifiedWallet?d("",!0):(n(),r("div",sD,[y("span",iD,h(e.$t("futuresMain.tradeHistory.walletName")),1),m(T,{class:"wallet-list-dropdown",list:a.walletList,selectValue:o.filterWalletName,handleUpdate:u.handleChangeWallet},null,8,["list","selectValue","handleUpdate"])])),y("div",nD,[y("span",rD,h(e.$t("t.currency")),1),m(w,{selectedCurrency:o.filterCurrency,"onUpdate:selectedCurrency":t[1]||(t[1]=e=>o.filterCurrency=e),handleSelectGroup:u.handleSelectAllCurrency},null,8,["selectedCurrency","handleSelectGroup"])]),y("div",oD,[y("div",uD,h(e.$t("t.type")),1),m(D,{ref:"historyTypeDropdown",class:"dropdown",defaultValue:a.selectedHistoryType,list:a.typeList,handleUpdate:u.updateHistoryType,size:"large"},null,8,["defaultValue","list","handleUpdate"])])]),y("div",cD,[m(A,{actionType:"reset",action:u.onResetClick},{default:g((()=>[v(h(e.$t("t.reset")),1)])),_:1},8,["action"]),m(A,{actionType:"search",action:u.onApplyClick},{default:g((()=>[v(h(e.$t("t.apply")),1)])),_:1},8,["action"])]),o.showDatePickerDialog?(n(),i(b,{key:0,showDatePickerDialog:o.showDatePickerDialog,"onUpdate:showDatePickerDialog":t[2]||(t[2]=e=>o.showDatePickerDialog=e),dateRange:o.filterDateRangeData,"onUpdate:dateRange":t[3]||(t[3]=e=>o.filterDateRangeData=e),rangeLimitDuration:o.rangeLimitDuration},null,8,["showDatePickerDialog","dateRange","rangeLimitDuration"])):d("",!0)])])}],["__scopeId","data-v-39b4a8e7"]]),pD=vr({__name:"FuturesHistoryListHeader",setup(e){const t=U(),a=R((()=>t.getters.isNewUserOfUnifiedWallet));return(e,t)=>{const l=s("Cell"),r=s("HeaderRow");return n(),i(r,{class:"futures-history-list-header"},{default:g((()=>[m(l,{textAlign:"left"},{default:g((()=>[v(h(e.$t("futuresMain.walletHistory.dateTime")),1)])),_:1}),a.value?d("",!0):(n(),i(l,{key:0,textAlign:"left"},{default:g((()=>[v(h(e.$t("futuresMain.walletHistory.wallet")),1)])),_:1})),m(l,{textAlign:"center"},{default:g((()=>[v(h(e.$t("futuresMain.walletHistory.currency")),1)])),_:1}),m(l,{textAlign:"left"},{default:g((()=>[v(h(e.$t("t.type")),1)])),_:1}),m(l,{textAlign:"right"},{default:g((()=>[v(h(e.$t("t.amount")),1)])),_:1}),m(l,{textAlign:"left"},{default:g((()=>[v(h(e.$t("futuresMain.walletHistory.description")),1)])),_:1})])),_:1})}}},[["__scopeId","data-v-874743fb"]]),yD={...l(["accountInfo"]),...t(["isUnifiedWallet"])},hD={getWalletNameFromWalletKey:ps,formatedAmount(e){const t=e.netAmount||"";return this.$filters.formatNumber(t,{formatKey:e.fiat?"24":"",isDynamicDecimal:!e.fiat})},typeI18N(e){const t=this.$t(`futuresMain.walletHistory.typeMap.${e.type}`);return e.type?t:""},transformWalletKey(e,t){return this.isUnifiedWallet&&e===ul?null===this.accountInfo.walletUpgradeTime?ol:Q(new Date(t),new Date(this.accountInfo.walletUpgradeTime))?ul:ol:e||""},description(e){const t=e.description,a=this.transformWalletKey(e.wallet,e.dateTime);switch(e.type){case 105:return`${ps(e.walletSrc)} -> ${ps(e.walletDest)}`;case 106:return t.replace("LIQUIDATED",this.typeI18N(e));case 108:return this.$t("futuresMain.walletHistory.description_RealizedPnl",{n:ps(a)});case 110:return this.$t("futuresMain.walletHistory.description_Funding",{n:ps(a)});default:return t}}},vD={name:"HistoryFuturesWalletRow",components:{CurrencyIcon:Pa},props:{data:{type:Object,default:()=>({})},index:{type:Number,required:!0}},computed:{...yD,...l(["currencyMap"]),...t(["isNewUserOfUnifiedWallet"]),displayName(){var e;return(null==(e=this.currencyMap[this.data.currency])?void 0:e.displayName)||this.data.currency}},methods:{...hD}},mD={class:"token-icon-wrap"};const gD={class:"futures-history-list"},fD={key:0,class:"no-data-wrapper"},TD={colspan:"7"},wD={class:"pagination-wrapper"};const DD=vr({name:"FuturesHistoryList",components:{NoDataAvailable:Zt,Pagination:As,FuturesHistoryListHeader:pD,FuturesHistoryListRow:vr(vD,[["render",function(e,t,a,l,o,u){const c=s("
1Cell"),f=s("CurrencyIcon"),T=s("Row");return n(),i(T,{class:"futures-history-list-row",index:a.index},{default:g((()=>[m(c,{textAlign:"left"},{default:g((()=>[v(h(e.$filters.formatDate(a.data.dateTime)),1)])),_:1}),e.isNewUserOfUnifiedWallet?d("",!0):(n(),i(c,{key:0,textAlign:"left"},{default:g((()=>[v(h(e.getWalletNameFromWalletKey(e.transformWalletKey(a.data.wallet,a.data.dateTime))),1)])),_:1})),m(c,{textAlign:"center"},{default:g((()=>[y("div",mD,[a.data.currency?(n(),i(f,{key:0,type:a.data.fiat?"fiat":"icon",name:a.data.currency,displayName:u.displayName,shortName:""},null,8,["type","name","displayName"])):(n(),r(p,{key:1},[v("-")],64))])])),_:1}),m(c,{textAlign:"left"},{default:g((()=>[v(h(e.typeI18N(a.data)),1)])),_:1}),m(c,{textAlign:"right"},{default:g((()=>[v(h(e.formatedAmount(a.data)),1)])),_:1}),m(c,{class:"break-space",textAlign:"left"},{default:g((()=>[v(h(e.description(a.data)),1)])),_:1})])),_:1},8,["index"])}],["__scopeId","data-v-f34a2130"]])},props:{list:{type:Array,default:()=>[]},pagination:{type:Object,default:()=>({current:1,pageSize:10,total:0,totalPages:0})}},emits:["pageChange"],methods:{handleCurrentChange(e){this.$emit("pageChange",e)}}},[["render",function(e,t,a,l,o,u){const c=s("FuturesHistoryListHeader"),h=s("FuturesHistoryListRow"),v=s("NoDataAvailable"),f=s("Table"),T=s("Pagination");return n(),r("div",gD,[m(f,null,{header:g((()=>[m(c)])),body:g((()=>[(n(!0),r(p,null,x(a.list,((e,t)=>(n(),i(h,{key:t,index:t,data:e},null,8,["index","data"])))),128)),0===a.list.length?(n(),r("tr",fD,[y("td",TD,[m(v,{emptyText:e.$t("t.noDataFound")},null,8,["emptyText"])])])):d("",!0)])),_:1}),y("div",wD,[m(T,{layout:"prev, pager, next, jumper",background:!1,currentPage:a.pagination.current,pageSize:a.pagination.pageSize,total:a.pagination.total,totalPages:a.pagination.totalPages,onHandleCurrentChangeP:u.handleCurrentChange},null,8,["currentPage","pageSize","total","totalPages","onHandleCurrentChangeP"])])])}],["__scopeId","data-v-810ebf45"]]),AD={name:"FuturesHistoryListItem",components:{IconChevronDown:Ka},props:{data:{type:Object,default:()=>({})}},data:()=>({toggle:!1}),computed:{...yD,...l(["currencyMap"]),...t(["isNewUserOfUnifiedWallet"]),displayName(){var e;return this.data.currency?(null==(e=this.currencyMap[this.data.currency])?void 0:e.displayName)||this.data.currency:"-"}},methods:{...hD}},bD={class:"item-wrapper"},_D={class:"item-row"},SD={class:"date"},CD={class:"status"},LD={key:0,class:"item-row"},ED={class:"title"},ID={class:"value"},kD={class:"item-row"},RD={class:"title"},ND={class:"value"},xD={class:"item-row"},PD={class:"title"},OD={key:1,class:"item-row"},$D={class:"value"};const WD={class:"list-wrapper"};const FD="CONTRACT",BD={name:"FuturesWalletDetailHistory",components:{WalletDateRangePicker:Ne,WalletHistoryDropdown:jw,WalletSpotHistoryDropdown:Kv,WalletCurrencyDropdown:eo,FuturesWalletFilterDialog:dD,IconDownload2:ws,FileDownload:Ds,FilterAction:Jr,PcFuturesHistoryList:DD,MobileFuturesHistoryList:vr({name:"FuturesHistoryList",components:{FuturesHistoryListItem:vr(AD,[["render",function(e,t,a,l,i,o){const u=s("IconChevronDown");return n(),r("div",bD,[y("div",_D,[y("div",SD,h(e.$filters.formatDate(a.data.dateTime)),1),y("div",CD,[v(h(e.typeI18N(a.data))+" ",1),m(u,{class:L(["chevron-icon",{reverse:i.toggle}]),width:"20",height:"20",onClick:t[0]||(t[0]=e=>i.toggle=!i.toggle)},null,8,["class"])])]),e.isNewUserOfUnifiedWallet?d("",!0):(n(),r("div",LD,[y("div",ED,h(e.$t("t.wallet")),1),y("div",ID,h(e.getWalletNameFromWalletKey(e.transformWalletKey(a.data.wallet,a.data.dateTime))),1)])),y("div",kD,[y("div",RD,h(e.$t("t.currency")),1),y("div",ND,h(o.displayName),1)]),y("div",xD,[y("div",PD,h(e.$t("t.amount")),1),v(" "+h(e.formatedAmount(a.data)),1)]),i.toggle?(n(),r("div",OD,[t[1]||(t[1]=y("div",null,null,-1)),y("div",$D,h(e.description(a.data)),1)])):d("",!0)])}],["__scopeId","data-v-c1ddaf3b"]])},props:{list:{type:Array,default:()=>[]}}},[["render",function(e,t,a,l,o,u){const c=s("FuturesHistoryListItem");return n(),r("div",WD,[(n(!0),r(p,null,x(a.list,((e,t)=>(n(),i(c,{key:t,data:e},null,8,["data"])))),128))])}],["__scopeId","data-v-6fab9612"]]),DateRangeTextBlock:jr,DateRangePickerDialog:pa,LoadMoreObserver:bs,FilterChip:Vs},data(){const[e,t]=xe(30);return{BUTTON_SIZE:qs,minDurationToNow:{years:1},rangeLimitDuration:{years:1},dataNotReady:!0,loadingList:!1,amountType:FD,dateRangeData:{start:e,end:t},defaultRange:{start:e,end:t},selectedCurrency:"",historyType:Hs.ALL_TYPES,filterDropdownData:{types:[],wallets:[]},list:[],pagination:{current:1,pageSize:10,total:0,totalPages:0},showDatePickerDialog:!1,isOpenFilterDialog:!1}},computed:{...l(["lang","isAccountInfoLoaded"]),...t(["isUnifiedWallet","isNewUserOfUnifiedWallet"]),isFiltered(){return Boolean(this.filterChips.length)},walletName(){return this.$route.query.name||ol},historyTypeList(){return this.filterDropdownData.types.map((e=>e===Hs.ALL_TYPES?{name:this.$t("t.all_history_types"),value:e}:{name:this.$t(`futuresMain.walletHistory.typeMap.${e}`),value:e}))},filteredWalletName(){return ps(this.walletName)},filterChips(){return[{property:"walletName",text:this.filteredWalletName,default:"",enable:this.walletName!==(this.isUnifiedWallet?ol:ul)},{property:"selectedCurrency",text:this.selectedCurrency,default:"",enable:""!==this.selectedCurrency},{property:"historyType",text:this.$t(`futuresMain.walletHistory.typeMap.${this.historyType}`),default:Hs.ALL_TYPES,enable:Hs.ALL_TYPES!==this.historyType}].filter((e=>e.enable))},fromTimestamp(){return Ys(this.dateRangeData.start).setHours(0,0,0,0)},toTimestamp(){return Ys(this.dateRangeData.end).setHours(23,59,59,0)},downloadPathname:()=>"report/histories/futuresWallet",downloadQueryString(){const e={zoneOffset:gs(),historyTypes:this.historyType===Hs.ALL_TYPES?"":this.historyType,currency:this.selectedCurrency};return this.walletName&&(e.walletName=this.walletName),ms(e)},futuresWalletFileDownloadRequest(){return ro($a.downloadFuturesHistory,this.downloadPathname,this.downloadQueryString)}},watch:{dateRangeData(e,t){ee(e.end,t.end)&&ee(e.start,t.start)||this.init(!0)},"pagination.current"(){this.getWallet()},walletName(){this.init(!0)},isAccountInfoLoaded:{handler(e){e&&this.initialConfig()},immediate:!0}},methods:{async initialConfig(){this.$route.query.name||this.$router.replace({name:this.$route.name,params:{...this.$route.params},query:{...this.$route.query,name:this.isUnifiedWallet?ol:ul}}),this.getFilterWalletOptions(),this.getFilterDropdownOptions(),this.dataNotReady=!1,this.init()},init:kl((function(e){this.getWallet(e)}),100),async getFilterWalletOptions(){await Oa.getWalletOptions().then((e=>{const t=[];e.sort(((e,t)=>
1e===ol?-1:t===ol?1:e===ul?-1:t===ul?1:Gs(e,t))).forEach((e=>{t.push({name:ps(e),value:e})})),this.filterDropdownData.wallets=t}))},async getFilterDropdownOptions(){this.filterDropdownData.types=Object.values(Hs)},resetFilters(){this.dateRangeData={...this.defaultRange},this.selectedCurrency="",this.$refs.historyTypeDropdown.reset(),this.handleChangeWallet(),this.init(!0)},formatDropdownData(e){return{name:this.$t(`t.${e.toLowerCase()}`),value:e}},getWallet(e=!1){e&&1!==this.pagination.current?this.pagination.current=1:(this.loadingList=!0,$a.futuresWalletHistory({from:this.fromTimestamp,to:this.toTimestamp,walletName:this.walletName,historyTypes:this.historyType===Hs.ALL_TYPES?"":this.historyType,currency:this.selectedCurrency.toUpperCase(),pageNumber:this.pagination.current,pageSize:this.pagination.pageSize}).then((({pageItems:t=[],total:a,pagesAvailable:l})=>{this.isMobile&&!e?this.list=this.list.concat(t):this.list=t,this.pagination.total=a||0,this.pagination.totalPages=l||0})).finally((()=>{this.loadingList=!1})))},handleCurrentChange(e){this.pagination.current=e},handleUpdateCurrency(e){this.selectedCurrency=e,this.init(!0)},handleUpdateHistoryType(e){this.historyType=e,this.init(!0)},handleChangeWallet(e=(this.isUnifiedWallet?ol:ul)){e!==this.walletName&&this.$router.push({name:Ke.FUTURES_WALLET_DETAIL,params:{lang:this.lang},query:{name:e}})},onClickDatePicker(){this.showDatePickerDialog=!0},handleLoadMore(){this.pagination.total<this.pagination.pageSize||(this.pagination.current+=1)},updateFilterData({dateRangeData:e,currency:t,walletName:a,historyType:l}){this.dateRangeData={...e},this.selectedCurrency=t,this.handleChangeWallet(a),this.handleUpdateHistoryType(l),this.init(!0)},handleClearFilter(e){"walletName"===e.property?this.handleChangeWallet():"historyType"===e.property?this.historyType=e.default:this[e.property]=e.default,this.init(!0)}}},UD={class:"futures-wallet-detail-history-wrapper"},MD={class:"content-wrapper"},VD={key:0,class:"tools-wrapper"},HD={class:"date-block-wrapper"},GD={key:0,class:"filter-chips"},YD={class:"button-text-wrap"},qD={key:1,class:"filter-wrapper"},zD={class:"left"},KD={class:"right"};const jD=vr(BD,[["render",function(e,t,a,l,o,u){const c=s("DateRangeTextBlock"),T=s("FilterAction"),w=s("FilterChip"),D=s("IconDownload2"),A=s("FileDownload"),b=s("WalletDateRangePicker"),_=s("WalletCurrencyDropdown"),S=s("WalletSpotHistoryDropdown"),L=s("WalletHistoryDropdown"),E=s("PcFuturesHistoryList"),I=s("MobileFuturesHistoryList"),k=s("LoadMoreObserver"),R=s("FuturesWalletFilterDialog"),N=s("DateRangePickerDialog"),P=C("loading");return n(),r("div",UD,[f((n(),r("div",MD,[e.isMobile?(n(),r("div",VD,[y("div",HD,[m(c,{dateRangeData:o.dateRangeData,isShowArrow:"",onToggle:u.onClickDatePicker},null,8,["dateRangeData","onToggle"]),m(T,{isFiltered:u.isFiltered,onClick:t[0]||(t[0]=e=>o.isOpenFilterDialog=!o.isOpenFilterDialog)},null,8,["isFiltered"])]),u.isFiltered?(n(),r("div",GD,[(n(!0),r(p,null,x(u.filterChips,(e=>(n(),i(w,{key:e.filterChips,chipData:e,handleClearFilter:u.handleClearFilter},null,8,["chipData","handleClearFilter"])))),128))])):d("",!0),m(A,{class:"m-file-download",fileName:"walletHistory",requestDownload:u.futuresWalletFileDownloadRequest,defaultRangeDate:o.dateRangeData,hasPdf:""},{default:g((()=>[y("div",YD,[m(D,{class:"svg-icon"}),v(" "+h(e.$t("t.downloadHistory")),1)])])),_:1},8,["requestDownload","defaultRangeDate"])])):(n(),r("div",qD,[y("div",zD,[m(b,{ref:"walletDatePicker",dateRange:o.dateRangeData,"onUpdate:dateRange":t[1]||(t[1]=e=>o.dateRangeData=e),defaultRange:o.defaultRange,minDurationToNow:o.minDurationToNow,rangeLimitDuration:o.rangeLimitDuration},null,8,["dateRange","defaultRange","minDurationToNow","rangeLimitDuration"]),m(_,{selectedCurrencyKey:o.selectedCurrency,"onUpdate:selectedCurrencyKey":u.handleUpdateCurrency},null,8,["selectedCurrencyKey","onUpdate:selectedCurrencyKey"]),u.historyTypeList.length?(n(),i(S,{key:0,ref:"historyTypeDropdown",class:"dropdown",list:u.historyTypeList,handleUpdate:u.handleUpdateHistoryType,height:"32px"},null,8,["list","handleUpdate"])):d("",!0),e.isNewUserOfUnifiedWallet?d("",!0):(n(),i(L,{key:1,ref:"walletListDropdown",class:"dropdown",list:o.filterDropdownData.wallets,selectValue:u.walletName,handleUpdate:u.handleChangeWallet,height:"32px"},null,8,["list","selectValue","handleUpdate"])),y("div",{class:"filter-reset",onClick:t[2]||(t[2]=(...e)=>u.resetFilters&&u.resetFilters(...e))},h(e.$t("t.resetFilters")),1)]),y("div",KD,[m(A,{fileName:"walletHistory",requestDownload:u.futuresWalletFileDownloadRequest,defaultRangeDate:o.dateRangeData,hasPdf:""},null,8,["requestDownload","defaultRangeDate"])])])),e.isLargeSize?f((n(),i(E,{key:2,list:o.list,pagination:o.pagination,onPageChange:u.handleCurrentChange},null,8,["list","pagination","onPageChange"])),[[P,o.loadingList]]):(n(),r(p,{key:3},[m(I,{list:o.list},null,8,["list"]),m(k,{onLoadMore:u.handleLoadMore},null,8,["onLoadMore"])],64))])),[[P,o.dataNotReady]]),o.isOpenFilterDialog?(n(),i(R,{key:0,isOpenFilterDialog:o.isOpenFilterDialog,"onUpdate:isOpenFilterDialog":t[3]||(t[3]=e=>o.isOpenFilterDialog=e),dateRangeData:o.dateRangeData,defaultDateRangeData:o.defaultRange,walletList:o.filterDropdownData.wallets,typeList:u.historyTypeList,selectedWalletName:u.walletName,selectedCurrency:o.selectedCurrency,selectedHistoryType:o.historyType,updateFilterData:u.updateFilterData},null,8,["isOpenFilterDialog","dateRangeData","defaultDateRangeData","walletList","typeList","selectedWalletName","selectedCurrency","selectedHistoryType","updateFilterData"])):d("",!0),o.showDatePickerDialog?(n(),i(N,{key:1,dateRange:o.dateRangeData,"onUpdate:dateRange":t[4]||(t[4]=e=>o.dateRangeData=e),showDatePickerDialog:o.showDatePickerDialog,"onUpdate:showDatePickerDialog":t[5]||(t[5]=e=>o.showDatePickerDialog=e),minDurationToNow:o.minDurationToNow,rangeLimitDuration:o.rangeLimitDuration},null,8,["dateRange","showDatePickerDialog","minDurationToNow","rangeLimitDuration"])):d("",!0)])}],["__scopeId","data-v-654b8829"]]),XD={class:"filter-wrapper"},QD=vr(E({__name:"TradeHistory",setup(e){const t=U(),a=po(),[l,r]=ua({rangeSize:7}),o=O({...{start:l,end:r}}),u=R((()=>{const e=t.state.futures.marketMap,a=Object.keys(e||{});return[yo,...a]}));return $(u,(e=>{a.setFuturesSymbolList(e)}),{immediate:!0}),(e,t)=>{const a=s("temaplate");return e.isMobile?(n(),i(a,{key:0},{default:g((()=>[y("div",XD,[m(ho)]),m(vo)])),_:1})):(n(),i(mo,{key:1,dateRangeProp:o.value,"onUpdate:dateRangeProp":t[0]||(t[0]=e=>o.value=e),categorySymbols:u.value},null,8,["dateRangeProp","categorySymbols"]))}}}),[["__scopeId","data-v-b7830db0"]]),ZD={class:"header-title"},JD=vr(E({__name:"WalletFuturesHistory",setup(e){const{enableOrderHistoryFuturesOrder:t}=Ge,a="walletHistory",l="tradeHistory",{t:r}=I(),o=Ut(),{lang:u}=S(o),c=O(a),p=R((()=>[{id:a,title:r("t.walletHistory")},{id:l,title:r("t.tradeHistory")}]));function v(e){c.value=e}return(e,r)=>{const o=s("RouterLink");return n(),i(Gv,{enableSwitcher:P(t),switcherList:p.value,selected:c.value,onSwitcherSelect:v},{header:g((()=>[m(o,{class:"header-back-wrapper",to:{name:"walletFutures",params:{lang:P(u)}}},{default:g((()=>[m(ht,{class:"icon-back"}),y("span",null,h(e.$t("wallet.backToFuturesWallet")),1)])),_:1},8,["to"]),y("h1",ZD,h(e.$t("wallet.futuresWalletHistory")),1)])),content:g((()=>[(n(),i(Z,null,[c.value===a?(n(),i(jD,{key:0})):c.value===l?(n(),i(QD,{key:1})):d("",!0)],1024))])),_:1},8,["enableSwitcher","switcherList","selected"])}}}),[["__scopeId","data-v-2501db48"]]),eA={class:"currency"},tA={key:1},aA={__name:"PnlOrRoiCell",props:{isPnl:{type:Boolean,required:!0},strategy:{type:Object,required:!0},hideValue:{type:Boolean,default:!1},valuePlaceholder:{type:String,default:"*****"}},setup(e){const t=e,a=zs(),l=Ks(),o=R((()=>{const{walletName:e,investment:s,currency:i="USDT",strategyStartTime:n}=t.strategy,r=a.currentUserPnlWalletMap[e];return r?js(r,s,i,l.fiatRateMap[i]||1,n):void 0})),u=R((()=>void 0===o.value)),c=R((()=>u.value?"---":Xs(o.value,"wvc"))),d=R((()=>u.value?"---":Xs(N(o.value).div(t.strategy.investment||1).times(100).toFixed())));return(t,a)=>{const l=s("Cell");return e.isPnl?(n(),i(l,{key:0},{default:g((()=>[y("span",{class:L(["number-value",{"brand-color-positive":!e.hideValue&&!u.value&&P(N)(o.value).gte(0),"brand-color-negative":!e.hideValue&&!u.value&&P(N)(o.value).lt(0)}])},h(e.hideValue?e.valuePlaceholder:c.value),3),y("span",eA,h(e.strategy.currency||P(Cs)),1)])),_:1})):(n(),r("div",tA,[y("span",{class:L(["number-value",{"brand-color-positive":!e.hideValue&&!u.value&&P(N)(d.value).gte(0),"brand-color-negative":!e.hideValue&&!u.value&&P(N)(d.value).lt(0)}])},h(e.hideValue?e.valuePlaceholder:d.value)+"% ",3)]))}}};function lA(e=3e3){const t=U(),a=Ks(),l=O(null);async function s(){try{const e=await Xl.getFiatRate();a.setFiatRateMap(e||{})}catch(e){}}function i(){clearInterval(l.value),l.value=null}$((()=>t.getters.isEnableAutoTraderFiat),(e=>{e||i()}),{immediate:!0}),q((()=>{i()})),Y((()=>{s(),l.value=setInterval(s,e)}))}const sA={class:"strategy-info"},iA={class:"strategy-info-label"},nA={class:"strategy-name"},rA={class:"strategy-id"},oA={class:"strategy-detail"},uA={class:"row-wrap"},cA={class:"data-label"},dA={class:"row-wrap"},pA={class:"data-label"},yA={class:"number-value"},hA={class:"currency"},vA={class:"row-wrap"},mA={class:"data-label"},gA={class:"detail-button"},fA="*****",TA=vr({__name:"InvestmentList",setup(e){const t=[{id:"myStrategy",lang:"wallets.myStrategy",textAlign:"left"},{id:"pnl",lang:"t.totalP&L",textAlign:"right",sortable:!0}];lA(1e4);const a=U(),l=O(!0),o=O(!1),u=O("DESC"),c=O({currentPage:1,totalRows:0,totalPages:0}),f=O(-1),T=O([]),w=R((()=>a.state.lang)),D=R((()=>a.state.now)),A=R((()=>a.state.hideWalletPriceValue)),b=R((()=>{const e=[Qs.FUTURES_GRID];return a.getters.isEnableCopyWiseSignalBot&&e.push(Qs.SIGNAL_FUTURES_BOLLINGER),a.getters.isEnableAutoTraderTrendChallenge&&e.push(Qs.FUTURES_TREND),e}));function _({key:e,order:t}){l.value||(o.value=e,u.value=t,c.value.currentPage=1,E(!0))}function S(e){return a.state.currencyMap[e]||{}}function C(e,t){const a={strategyId:t};return e===Qs.FUTURES_TREND&&(a.subTab="trend-challenge"),a}
1async function E(e=!1){l.value=!0;try{const{data:{strategies:t=[],totalPages:a=0,totalRows:l=0}}=await ai.getStrategies({types:b.value.join(","),sorting:`${o.value||"createdAt"}:${u.value.toUpperCase()}`,page:c.value.currentPage,pageSize:10},!0);c.value.totalRows=l,c.value.totalPages=a,T.value=e?t:T.value.concat(t)}catch(t){}l.value=!1}function I(){l.value||c.value.totalPages<=c.value.currentPage||(c.value.currentPage=c.value.currentPage+1,E())}return $((()=>a.state.accountInfo.uid),((e,t)=>{e&&t&&e!==t&&E()})),j((()=>E())),(e,a)=>{const l=s("HeaderRow"),u=s("Cell"),c=s("Row"),b=s("RouterLink"),E=s("DataTable");return n(),r(p,null,[m(E,{class:"investment-list-table",fixHeader:""},{header:g((()=>[m(l,{class:"row"},{default:g((()=>[(n(),r(p,null,x(t,(t=>m(P(cl),{key:t.id,class:L({[`align-${t.textAlign}`]:t.textAlign}),currentSortKey:o.value,defaultSortOrder:"desc",title:t,iconType:"triangle",onSort:_},{content:g((()=>[v(h(t.lang?e.$t(t.lang):""),1)])),_:2},1032,["class","currentSortKey","title"]))),64))])),_:1})])),body:g((()=>[0===T.value.length?(n(),i(c,{key:0,class:"no-data-section",index:-1,disableCssHoverEffect:"",disableBackground:""},{default:g((()=>[m(u,{textAlign:"center",colspan:t.length.toString()},{default:g((()=>[m(Zt,{class:"no-data-available",emptyText:e.$t("t.noDataFound")},null,8,["emptyText"])])),_:1},8,["colspan"])])),_:1})):d("",!0),(n(!0),r(p,null,x(T.value,((a,l)=>(n(),r(p,{key:a.strategyId},[m(c,{class:"strategy-row",index:l,disableBackground:"",disableCssHoverEffect:"",onClick:e=>function(e){f.value=f.value===e?-1:e}(l)},{default:g((()=>[m(u,null,{default:g((()=>[y("div",sA,[m(P(ca),{class:L({active:f.value===l}),width:"12"},null,8,["class"]),m(P(Pa),{name:a.coin,type:S(a.coin).isFiat?"fiat":"icon",showName:!1,size:"18"},null,8,["name","type"]),y("div",iA,[y("div",nA,[v(h(S(a.coin).displayName||a.coin)+" ",1),a.strategyType===P(Qs).FUTURES_TREND?(n(),r(p,{key:0},[v(h(a.aggression&&e.$t(P(Zs)[a.aggression]))+" "+h(a.config.leverage)+"x ",1)],64)):(n(),r(p,{key:1},[P(Js)[a.risk]?(n(),r(p,{key:0},[v(h(e.$t(P(Js)[a.risk]))+": ",1)],64)):d("",!0),P(ei)[a.term]?(n(),r(p,{key:1},[v(h(e.$t(P(ei)[a.term])),1)],64)):d("",!0)],64))]),y("div",rA,"#"+h(a.numericId),1)])])])),_:2},1024),m(aA,{isPnl:"",strategy:a,hideValue:A.value,valuePlaceholder:fA},null,8,["strategy","hideValue"])])),_:2},1032,["index","onClick"]),f.value===l?(n(),i(c,{key:0,class:"strategy-detail-row",index:l,disableBackground:"",disableCssHoverEffect:""},{default:g((()=>[m(u,{colspan:t.length.toString()},{default:g((()=>[y("div",oA,[y("div",uA,[y("div",cA,h(e.$t("trading.leaderboard.roi")),1),m(aA,{isPnl:!1,strategy:a,hideValue:A.value,valuePlaceholder:fA},null,8,["strategy","hideValue"])]),y("div",dA,[y("div",pA,h(e.$t("trading.bot.investment")),1),y("div",null,[y("span",yA,h(A.value?fA:P(Xt)(a.investment,"wvc")),1),y("span",hA,h(a.currency||P(Cs)),1)])]),y("div",vA,[y("div",mA,h(e.$t("t.duration")),1),y("div",null,h(P(ti)(a.createdAt,D.value)),1)]),m(b,{to:{name:P(Ke).COPY_WISE_MY_PORTFOLIO,params:{lang:w.value},query:C(a.strategyType,a.strategyId)},target:"_blank"},{default:g((()=>[y("div",gA,h(e.$t("t.detail")),1)])),_:2},1032,["to"])])])),_:2},1032,["colspan"])])),_:2},1032,["index"])):d("",!0)],64)))),128))])),_:1}),m(P(bs),{onLoadMore:I})],64)}}},[["__scopeId","data-v-e232dfc8"]]),wA={class:"currency"},DA={__name:"PnlAndRoiCell",props:{strategy:{type:Object,required:!0},hideValue:{type:Boolean,default:!1},valuePlaceholder:{type:String,default:"*****"}},setup(e){const t=e,a=zs(),l=Ks(),i=R((()=>{const{walletName:e,investment:s,currency:i="USDT",strategyStartTime:n}=t.strategy,r=a.currentUserPnlWalletMap[e];return r?js(r,s,i,l.fiatRateMap[i]||1,n):void 0})),o=R((()=>void 0===i.value)),u=R((()=>o.value?"---":Xs(i.value,"wvc"))),c=R((()=>o.value?"---":Xs(N(i.value).div(t.strategy.investment||1).times(100).toFixed())));return(t,a)=>{const l=s("Cell");return n(),r(p,null,[m(l,null,{default:g((()=>[y("span",{class:L(["number-value",{"brand-color-positive":!e.hideValue&&!o.value&&P(N)(i.value).gte(0),"brand-color-negative":!e.hideValue&&!o.value&&P(N)(i.value).lt(0)}])},h(e.hideValue?e.valuePlaceholder:u.value),3),y("span",wA,h(e.strategy.currency||P(Cs)),1)])),_:1}),m(l,null,{default:g((()=>[y("span",{class:L(["number-value",{"brand-color-positive":!e.hideValue&&!o.value&&P(N)(c.value).gte(0),"brand-color-negative":!e.hideValue&&!o.value&&P(N)(c.value).lt(0)}])},h(e.hideValue?e.valuePlaceholder:c.value)+"% ",3)])),_:1})],64)}}},AA={class:"investment-list"},bA={class:"strategy-info"},_A={class:"strategy-label"},SA={class:"strategy-id"},CA={class:"number-value"},LA={class:"currency"},EA="*****",IA=vr({__name:"InvestmentList",setup(e){const t=[{id:"myStrategy",lang:"wallets.myStrategy",textAlign:"left"},{id:"pnl",lang:"t.totalP&L",textAlign:"right",sortable:!0},{id:"roi",lang:"trading.leaderboard.roi",textAlign:"right",sortable:!0},{id:"investment",lang:"trading.bot.investment",textAlign:"right",sortable:!0},{id:"createdAt",lang:"t.duration",textAlign:"left",sortable:!0},{id:"detail",textAlign:"center",isActionBtn:!0}];let a=null;lA(1e4);const l=U(),o=O(!0),u=O(!1),c=O("DESC"),T=O({currentPage:1,totalRows:0,totalPages:0}),w=O([]),D=R((()=>l.state.lang)),A=R((()=>l.state.now)),b=R((()=>l.state.hideWalletPriceValue)),_=R((()=>{const e=[Qs.FUTURES_GRID];return l.getters.isEnableCopyWiseSignalBot&&e.push(Qs.SIGNAL_FUTURES_BOLLINGER),l.getters.isEnableAutoTraderTrendChallenge&&e.push(Qs.FUTURES_TREND),e}));function S({key:e,order:t}){o.value||(u.value=e,c.value=t,T.value.currentPage=1,k())}function E(e){return l.state.currencyMap[e]||{}}function I(e,t){const a={strategyId:t};return e===Qs.FUTURES_TREND&&(a.subTab="trend-challenge"),a}async function k(e=!1){clearTimeout(a),e||(o.value=!0);try{const{data:{strategies:e=[],totalPages:t=0,totalRows:a=0}}=await ai.getStrategies({types:_.value.join(","),sorting:`${u.value||"createdAt"}:${c.value.toUpperCase()}`,page:T.value.currentPage,pageSize:10},!0);T.value.totalRows=a,T.value.totalPages=t,w.value=e}catch(t){}o.value=!1,a=setTimeout((()=>k(!0)),1e4)}function N(e){o.value||(T.value.currentPage=e,k())}return $((()=>l.state.accountInfo.uid),((e,t)=>{e&&t&&e!==t&&k()})),j((()=>k())),q((()=>clearTimeout(a))),(e,a)=>{const l=s("HeaderRow"),c=s("RouterLink"),_=s("Cell"),k=s("Row"),R=s("DataTable"),O=C("loading");return n(),r("div",AA,[f((n(),i(R,{class:"investment-list-table",f
1ixHeader:""},{header:g((()=>[m(l,{class:"header-row"},{default:g((()=>[(n(),r(p,null,x(t,(t=>m(P(cl),{key:t.id,currentSortKey:u.value,defaultSortOrder:"desc",class:L({[`align-${t.textAlign}`]:t.textAlign,"action-btn":t.isActionBtn}),title:t,iconType:"triangle",onSort:S},{content:g((()=>[v(h(t.lang?e.$t(t.lang):""),1)])),_:2},1032,["currentSortKey","class","title"]))),64))])),_:1})])),body:g((()=>[0===w.value.length?(n(),i(k,{key:0,class:"no-data-section",index:-1,disableCssHoverEffect:"",disableBackground:""},{default:g((()=>[m(_,{textAlign:"center",colspan:t.length.toString()},{default:g((()=>[m(P(Zt),{class:"no-data-available"},{"empty-text":g((()=>[v(h(e.$t("t.noDataFound")),1)])),"extra-behavior":g((()=>[m(c,{class:"route-link",to:{name:P(Ke).COPY_WISE,params:{lang:D.value}}},{default:g((()=>[v(h(e.$t("t.goToSomewhere",{page:e.$t("nav.autoTrader")}))+" ",1),m(P(ht),{class:"icon-chevron-right",width:"16",height:"16"})])),_:1},8,["to"])])),_:1})])),_:1},8,["colspan"])])),_:1})):d("",!0),(n(!0),r(p,null,x(w.value,((t,a)=>(n(),i(k,{key:t.strategyId,class:"strategy-row",index:a,disableBackground:!0,disableCssHoverEffect:!0},{default:g((()=>[m(_,null,{default:g((()=>[y("div",bA,[y("div",_A,[m(P(Pa),{name:t.coin,type:E(t.coin).isFiat?"fiat":"icon",showName:!1,size:"16"},null,8,["name","type"]),v(" "+h(E(t.coin).displayName||t.coin)+" ",1),t.strategyType===P(Qs).FUTURES_TREND?(n(),r(p,{key:0},[v(h(t.aggression&&e.$t(P(Zs)[t.aggression]))+" "+h(t.config.leverage)+"x ",1)],64)):(n(),r(p,{key:1},[P(Js)[t.risk]?(n(),r(p,{key:0},[v(h(e.$t(P(Js)[t.risk]))+": ",1)],64)):d("",!0),P(ei)[t.term]?(n(),r(p,{key:1},[v(h(e.$t(P(ei)[t.term])),1)],64)):d("",!0)],64))]),y("div",SA,"#"+h(t.numericId
1),1)])])),_:2},1024),m(DA,{strategy:t,hideValue:b.value,valuePlaceholder:EA},null,8,["strategy","hideValue"]),m(_,null,{default:g((()=>[y("span",CA,h(b.value?EA:P(Xt)(t.investment,"wvc")),1),y("span",LA,h(t.currency||P(Cs)),1)])),_:2},1024),m(_,{textAlign:"left"},{default:g((()=>[v(h(P(ti)(t.createdAt,A.value)),1)])),_:2},1024),m(_,{class:"action-button-cell",textAlign:"center"},{default:g((()=>[m(c,{class:"detail-link",to:{name:P(Ke).COPY_WISE_MY_PORTFOLIO,params:{lang:D.value},query:I(t.strategyType,t.strategyId)},target:"_blank"},{default:g((()=>[v(h(e.$t("t.detail")),1)])),_:2},1032,["to"])])),_:2},1024)])),_:2},1032,["index"])))),128))])),_:1})),[[O,o.value]]),m(P(As),{class:"pagination",layout:"prev, pager, next, jumper",total:T.value.totalRows,pageSize:10,totalPages:T.value.totalPages,currentPage:T.value.currentPage,pagerCount:5,background:!1,onHandleCurrentChangeP:N},null,8,["total","totalPages","currentPage"])])}}},[["__scopeId","data-v-d6a0be9b"]]),kA={class:"asset-list"},RA={class:"asset-label"},NA={class:"asset-text-wrap"},xA={class:"asset-name"},PA={class:"number-value"},OA={class:"currency"},$A={__name:"WalletAssetList",props:{type:{type:String,default:Ye.AUTO_TRADER},assetList:{type:Array,default:()=>[]},isLoading:{type:Boolean,default:!1}},setup(e){const t=[{id:"asset",lang:"t.asset",textAlign:"left"},{id:"balance",lang:"t.balance",textAlign:"right"}],a=e,l=U(),{t:o}=I(),u=ka(),c=R((()=>l.state.hideWalletPriceValue)),T=R((()=>{const e=l.state.lang,t={[Ye.AUTO_TRADER]:{name:Ke.COPY_WISE,params:{lang:e}},[Ye.FUTURES_BOTS]:{name:"futuresId",params:{lang:e,id:"BTC-PERP"},state:{tradeType:li.GRID}}},s={[Ye.AUTO_TRADER]:o("t.goToSomewhere",{page:o("nav.autoTrader")}),[Ye.FUTURES_BOTS]:o("t.goToSomewhere",{page:o("wallets.futuresBotsTrading")})};return{to:t[a.type],text:s[a.type]}}));return(a,o)=>{const w=s("HeaderRow"),D=s("RouterLink"),A=s("Cell"),b=s("Row"),_=s("DataTable"),S=C("loading");return f((n(),r("div",kA,[m(_,{class:"asset-list-table",fixHeader:""},{header:g((()=>[m(w,{class:"header-row"},{default:g((()=>[(n(),r(p,null,x(t,(e=>m(P(cl),{key:e.id,class:L({[`align-${e.textAlign}`]:e.textAlign}),title:e},{content:g((()=>[v(h(e.lang?a.$t(e.lang):""),1)])),_:2},1032,["class","title"]))),64))])),_:1})])),body:g((()=>[e.isLoading||0===e.assetList.length?(n(),i(b,{key:0,class:"no-data-section",index:-1,disableCssHoverEffect:"",disableBackground:""},{default:g((()=>[m(A,{textAlign:"center",colspan:t.length.toString()},{default:g((()=>[0===e.assetList.length?(n(),i(P(Zt),{key:0,class:"no-data-available"},{"empty-text":g((()=>[v(h(a.$t("t.noDataFound")),1)])),"extra-behavior":g((()=>[P(u).isMobile?d("",!0):(n(),i(D,{key:0,class:"route-link",to:T.value.to},{default:g((()=>[v(h(T.value.text)+" ",1),m(P(ht),{class:"icon-chevron-right",width:"16",height:"16"})])),_:1},8,["to"]))])),_:1})):d("",!0)])),_:1},8,["colspan"])])),_:1})):d("",!0),(n(!0),r(p,null,x(e.assetList,((e,t)=>(n(),i(b,{key:e.shortName,class:"asset-row",index:t,disableBackground:!0,disableCssHoverEffect:!0},{default:g((()=>[m(A,null,{default:g((()=>{return[y("div",RA,[m(P(Pa),{name:e.shortName,type:(t=e.shortName,(null==(a=l.state.currencyMap[t])?void 0:a.isFiat)?"fiat":"icon"),showName:!1,size:"16"},null,8,["name","type"]),y("div",NA,[y("span",null,h(e.shortName),1),y("span",xA,h(e.fullName),1)])])];var t,a})),_:2},1024),m(A,null,{default:g((()=>[y("span",PA,h(c.value?"*****":P(Xt)(e.totalValue,"wvc")),1),y("span",OA,h(e.shortName),1)])),_:2},1024)])),_:2},1032,["index"])))),128))])),_:1})])),[[S,e.isLoading]])}}},WA={__name:"WalletAutoTrader",setup(e){const t="investment",a="assets",l=U(),{t:r}=I(),o=ze(),u=pt(),c=O(!0),p=O(0),y=R((()=>l.state.lang)),f=R((()=>o.displayCurrency)),T=R((()=>[{key:t,label:r("trading.bot.investment")},{key:a,label:r("wallets.assets")}])),w=R((()=>T.value[p.value].key)),D=R((()=>u.totalBalanceInDisplayCurrency)),A=R((()=>u.wallet.assets||[]));function b(e){p.value=e}return j((()=>u.update(!0).then((()=>{c.value=!1})))),q((()=>u.removeTimer())),(e,l)=>{const r=s("RouterLink");return n(),i(Sy,{type:"autoTrader",title:e.$t("wallets.autoTraderWallet"),featuresList:P(si),totalBalance:D.value,tabList:T.value,selectedTabIndex:p.value,displayCurrency:f.value,useWalletBalanceInfo:"",onTabSelected:b},{"header-link":g((()=>[m(r,{class:"title-section-link",to:{name:P(Ke).COPY_WISE,params:{lang:y.value}}},{default:g((()=>[v(h(e.$t("t.goToSomewhere",{page:e.$t("nav.autoTrader")}))+" ",1),m(P(ht),{width:"16",height:"16"})])),_:1},8,["to"])])),mobile:g((()=>[(n(),i(Z,null,[w.value===t?(n(),i(P(TA),{key:0})):w.value===a?(n(),i($A,{key:1,type:"autoTrader",isLoading:c.value,assetList:A.value},null,8,["isLoading","assetList"])):d("",!0)],1024))])),desktop:g((()=>[(n(),i(Z,null,[w.value===t?(n(),i(IA,{key:0})):w.value===a?(n(),i($A,{key:1,type:"autoTrader",isLoading:c.value,assetList:A.value},null,8,["isLoading","assetList"])):d("",!0)],1024))])),_:1},8,["title","featuresList","totalBalance","tabList","selectedTabIndex","displayCurrency"])}}},FA={class:"analysis-header"},BA={class:"header-title"},UA=vr({__name:"WalletHeaderBackLink",props:{backRouteName:{type:String,required:!0},linkText:{type:String,default:""},headerTitle:{type:String,required:!0}},setup(e){const t=U(),a=R((()=>t.state.lang));return(t,l)=>{const i=s("RouterLink");return n(),r("div",FA,[m(i,{class:"back-link",to:{name:e.backRouteName,params:{lang:a.value},query:{...t.$route.query}}},{default:g((()=>[m(P(ht),{class:"icon-back"}),v(" "+h(e.linkText||t.$t("t.back")),1)])),_:1},8,["to"]),y("h1",BA,h(e.headerTitle),1)])}}},[["__scopeId","data-v-533f94f1"]]),MA={name:"CommonHistoryFilterDialog",components:{WalletHistoryDropdown:jw,WalletCurrencyDropdown:eo,IconCalendar:da,IconChevronDown:ca,IconPlus:Us,DateRangePickerDialog:pa,ActionButton:so},props:{idPrefix:{type:String,default:null},isOpenFilterDialog:{type:Boolean,required:!0},dateRangeData:{type:Object,required:!0},defaultDateRangeData:{type:Object,required:!0},defaultCurrency:{type:String,required:!0},historyTypeList:{type:Array,required:!0},defaultHistoryType:{type:[String,Number],required:!0},updateFilterData:{type:Function,default:()=>{}}},emits:["update:isOpenFilterDialog"],data(){return{rangeLimitDuration:{years:1},filterDateRangeData:this.dateRangeData,selectedCurrency:this.defaultCurrency,historyType:this.defaultHistoryType,showDatePickerDialog:!1}},computed:{dateRangeText(){return{start:Ms(this.filterDateRangeData.start,"yyyy-MM-dd"),end:Ms(this.filterDateRangeData.end,"yyyy-MM-dd")}}},methods:{onResetClick(){this.filterDateRangeData={...this.defaultDateRangeData},this.selectedCurrency="",this.historyType=this.historyTypeList[0].value},onApplyClick(){this.updateFilterData({dateRangeData:this.filterDateRangeData,currency:this.selectedCurrency,historyType:this.historyType}),this.close()},close(){this.$emit("update:isOpenFilterDialog",!1)},openDatePickerDialog(){this.showDatePickerDialog=!0},handleChangeHistoryType(e){this.historyType=e}}},VA={class:"filter-dialog"},HA={class:"content-wrap"},GA={class:"title"},YA={class:"filters-wrap"},qA={class:"filter"},zA={class:"sub-title"},KA={class:"dates"},jA={class:"filter"},XA={class:"sub-title"},QA={key:0,class:"filter"},ZA={class:"sub-title"},JA={class:"action-wrap"};const eb=vr(MA,[["render",function(e,t,a,l,o,u){const c=s("IconPlus"),p=s("IconCalendar"),f=s("IconChevronDown"),T=s("WalletCurrencyDropdown"),w=s("WalletHistoryDropdown"),D=s("ActionButton"),A=s("DateRangePickerDialog");return n(),r("div",VA,[y("div",HA,[m(c,{class:"close-icon",onClick:u.close},null,8,["onClick"]),y("div",GA,h(e.$t("t.filters")),1),y("div",YA,[y("div",qA,[y("span",zA,h(e.$t("t.timePeriod")),1),y("div",{class:"date-range-wrapper",onClick:t[0]||(t[0]=(...e)=>u.openDatePickerDialog&&u.openDatePickerDialog(...e))},[m(p,{class:"icon-calendar"}),y("div",KA,[y("span",null,h(u.dateRangeText.start),1),t[4]||(t[4]=y("span",null,"-",-1)),y("span",null,h(u.dateRangeText.end),1)]),m(f,{class:"arrow"})])]),y("div",jA,[y("span",XA,h(e.$t("t.currency")),1),m(T,{selectedCurrencyKey:o.selectedCurrency,"onUpdate:selectedCurrencyKey":t[1]||(t[1]=e=>o.selectedCurrency=e)},null,8,["selectedCurrencyKey"])]),a.historyTypeList.length>1?(n(),r("div",QA,[y("span",ZA,h(e.$t("t.type")),1),m(w,{list:a.historyTypeList,selectValue:o.historyType,handleUpdate:u.handleChangeHistoryType},null,8,["list","selectValue","handleUpdate"])])):d("",!0)]),y("div",JA,[m(D,{actionType:"reset",action:u.onResetClick},{default:g((()=>[v(h(e.$t("t.reset")),1)])),_:1},8,["action"]),m(D,{actionType:"search",action:u.onApplyClick},{default:g((()=>[v(h(e.$t("t.apply")),1)])),_:1},8,["action"])]),o.showDatePickerDialog?(n(),i(A,{key:0,showDatePickerDialog:o.showDatePickerDialog,"onUpdate:showDatePickerDialog":t[2]||(t[2]=e=>o.showDatePickerDialog=e),dateRange:o.filterDateRangeData,"onUpdate:dateRange":t[3]||(t[3]=e=>o.filterDateRangeData=e),rangeLimitDuration:o.rangeLimitDuration},null,8,["showDatePickerDialog","dateRange","rangeLimitDuration"])):d("",!0)])])}],["__scopeId","data-v-bf61c22c"]]),tb={class:"common-wallet-history"},ab={class:"history-container"},lb={key:0,class:"tools-wrapper"},sb={class:"date-block-wrapper"},ib={key:0,class:"filter-chips"},nb={class:"button-text-wrap"},rb={key:1,class:"filter-wrapper"},ob={class:"row-wrap"},ub="ALL",cb={__name:"CommonWalletHistoryContainer",props:{headerBackLinkConfig:{type:Object,required:!0},historyDownloadApiPath:{type:String,required:!0},historyApiFunction:{type:Function,required:!0},historyTypeFilterList:{type:Array,default:()=>[]}},setup(e){const t={years:1},a={years:1},l=Date.now(),{t:s}=I(),u=e,c=U(),T=O(!0),w=O(!1),D=O([]),A=O({start:te(B(l),29),end:W(l)}
1),b=O({...A.value}),_=O(ub),S=O({pageSize:10,currentPage:1,totalRows:0,totalPages:0}),L=O(!1),E=O(!1),k=O(""),N=R((()=>{const{start:e,end:t}=b.value;return{from:B(e).getTime(),to:W(t).getTime()}})),P=R((()=>[{name:s("t.all_types"),value:ub}].concat(u.historyTypeFilterList))),F=R((()=>{const e=[];""!==k.value&&e.push({type:"currency",text:k.value});const t=P.value.find((({value:e})=>_.value===e));return t&&t.value!==ub&&e.push({type:"historyType",text:t.name}),e})),M=R((()=>{const e={zoneOffset:gs()};k.value&&(e.currency=k.value),_.value!==ub&&(e.historyTypes=_.value);return`?${new URLSearchParams(e).toString()}`})),V=R((()=>ro($a.downloadFuturesHistory,u.historyDownloadApiPath,M.value))),H=R((()=>""!==k.value||_.value!==ub));function G({start:e,end:t}){const{from:a,to:l}=N.value;e.getTime()===a&&t.getTime()===l||(b.value={start:e,end:t})}function Y(e){_.value=e}function q({dateRangeData:e,currency:t,historyType:a}){G(e),k.value=t,_.value=a}function z({type:e}){switch(e){case"currency":k.value="";break;case"historyType":_.value=ub}}function K(){G(A.value),k.value="",_.value=ub}function j(e){T.value||(S.value.currentPage=e)}function X(){T.value||S.value.totalPages<=S.value.currentPage||(w.value=!0,S.value.currentPage=S.value.currentPage+1)}return $((()=>c.state.accountInfo.uid),(()=>K()),{flush:"sync"}),$([()=>S.value.currentPage,()=>c.state.accountInfo.uid,b,k,_],(([e,t],[a])=>{t&&(1===e||e!==a?async function(){T.value=!0;try{const e={...N.value,pageNumber:S.value.currentPage,pageSize:10};k.value&&(e.currency=k.value),_.value!==ub&&(e.historyTypes=_.value);const{pageItems:t=[],pagesAvailable:a=0,total:l=0}=await u.historyApiFunction(e);S.value.totalRows=l,S.value.totalPages=a,w.value?D.value=D.value.concat(t):D.value=t}catch(e){}w.value=!1,T.value=!1}():S.value.currentPage=1)}),{immediate:!0}),(l,s)=>{const u=C("loading");return n(),r("div",tb,[m(UA,{backRouteName:e.headerBackLinkConfig.backRouteName,linkText:e.headerBackLinkConfig.linkText,headerTitle:e.headerBackLinkConfig.headerTitle},null,8,["backRouteName","linkText","headerTitle"]),f((n(),r("div",ab,[l.isMobile?(n(),r("div",lb,[y("div",sb,[m(jr,{dateRangeData:b.value,isShowArrow:"",onToggle:s[0]||(s[0]=e=>L.value=!0)},null,8,["dateRangeData"]),m(Jr,{isFiltered:H.value,onClick:s[1]||(s[1]=e=>E.value=!E.value)},null,8,["isFiltered"])]),H.value?(n(),r("div",ib,[(n(!0),r(p,null,x(F.value,(e=>(n(),i(Vs,{key:e.filterChips,chipData:e,handleClearFilter:z},null,8,["chipData"])))),128))])):d("",!0),m(Ds,{class:"download-history-button",fileName:"walletHistory",requestDownload:V.value,defaultRangeDate:b.value,hasPdf:""},{default:g((()=>[y("div",nb,[m(ws,{class:"svg-icon"}),v(" "+h(l.$t("t.downloadHistory")),1)])])),_:1},8,["requestDownload","defaultRangeDate"])])):(n(),r("div",rb,[y("div",ob,[m(Ne,{ref:"walletDatePicker",dateRange:b.value,"onUpdate:dateRange":s[2]||(s[2]=e=>b.value=e),defaultRange:A.value,minDurationToNow:t,rangeLimitDuration:a},null,8,["dateRange","defaultRange"]),m(eo,{selectedCurrencyKey:k.value,"onUpdate:selectedCurrencyKey":s[3]||(s[3]=e=>k.value=e)},null,8,["selectedCurrencyKey"]),e.historyTypeFilterList.length>1?(n(),i(jw,{key:0,class:"dropdown",list:P.value,selectValue:_.value,handleUpdate:Y,height:"32px"},null,8,["list","selectValue"])):d("",!0),y("div",{class:"filter-reset",onClick:K},h(l.$t("t.resetFilters")),1)]),m(Ds,{class:"file-download",fileName:"walletHistory",requestDownload:V.value,defaultRangeDate:b.value,hasPdf:""},null,8,["requestDownload","defaultRangeDate"])])),l.isMobile?(n(),r(p,{key:2},[(n(!0),r(p,null,x(D.value,((e,t)=>o(l.$slots,"mobileBlock",{key:t,history:e},void 0,!0))),128)),0===D.value.length?(n(),i(Zt,{key:0})):d("",!0),m(bs,{onLoadMore:X})],64)):o(l.$slots,"desktopList",{key:3,list:D.value,pagination:S.value,handlePageChange:j},void 0,!0)])),[[u,T.value]]),L.value?(n(),i(pa,{key:0,dateRange:b.value,"onUpdate:dateRange":s[4]||(s[4]=e=>b.value=e),showDatePickerDialog:L.value,"onUpdate:showDatePickerDialog":s[5]||(s[5]=e=>L.value=e),minDurationToNow:t,rangeLimitDuration:a},null,8,["dateRange","showDatePickerDialog"])):d("",!0),E.value?(n(),i(eb,{key:1,isOpenFilterDialog:E.value,"onUpdate:isOpenFilterDialog":s[6]||(s[6]=e=>E.value=e),dateRangeData:b.value,defaultDateRangeData:A.value,defaultCurrency:k.value,historyTypeList:P.value,defaultHistoryType:_.value,updateFilterData:q},null,8,["isOpenFilterDialog","dateRangeData","defaultDateRangeData","defaultCurrency","historyTypeList","defaultHistoryType"])):d("",!0)])}}},db=vr(cb,[["__scopeId","data-v-935c803b"]]),pb={class:"auto-trader-history"},yb={class:"time-label"},hb={class:"operation-wrap"},vb={class:"row-wrap"},mb={class:"data-label"},gb={class:"row-wrap"},fb={class:"data-label"},Tb={class:"description"},wb={key:0},Db={class:"startegy-id"},Ab={__name:"AutoTraderHistoryBlock",props:{history:{type:Object,default:()=>({})}},setup(e){const{t:t}=I(),a=e,l=O(!1),s=R((()=>ii(a.history.type)));function i(e){return e===ni.AUTO_TRADER?t("nav.autoTrader"):"FUTURES_WALLET"===e?t("wallets.futuresWallet"):"SPOT_WALLET"===e?t("t.spotWallet"):void 0}function o(){l.value=!l.value}return(a,u)=>{return n(),r("div",pb,[y("div",{class:"row-wrap pointer",onClick:o},[y("div",yb,h(P(Ra)(e.history.dateTime)),1),y("div",hb,[v(h(s.value)+" ",1),m(P(ca),{class:L(["icon-chevron",{active:l.value}])},null,8,["class"])])]),l.value?(n(),r(p,{key:0},[y("div",vb,[y("span",mb,h(a.$t("t.currency")),1),v(" "+h(e.history.currency),1)]),y("div",gb,[y("span",fb,h(a.$t("t.amount")),1),v(" "+h(P(Xt)(e.history.netAmount,e.history.fiat?"max2":"wvc")),1)]),y("div",Tb,[40004===e.history.type?(n(),r(p,{key:0},[["OPEN","CLOSE"].includes(e.history.operation)?(n(),r("div",wb,[v(h((c=e.history.operation,"OPEN"===c?t("t.copy"):"CLOSE"===c?t("t.stop"):void 0))+" "+h(e.history.fullName)+" ",1),e.history.strategyType===P(Qs).FUTURES_TREND?(n(),r(p,{key:0},[v(h(e.history.aggression&&a.$t(P(Zs)[e.history.aggression]))+" ",1),e.history.leverage?(n(),r(p,{key:0},[v(h(e.history.leverage)+"x ",1)],64)):d("",!0)],64)):(n(),r(p,{key:1},[P(Js)[e.history.riskType]?(n(),r(p,{key:0},[v(h(P(t)(P(Js)[e.history.riskType]))+": ",1)],64)):d("",!0),P(ei)[e.history.termType]?(n(),r(p,{key:1},[v(h(P(t)(P(ei)[e.history.termType])),1)],64)):d("",!0)],64)),y("span",Db,"#"+h(e.history.strategyId),1)])):d("",!0),y("div",null,h(i(e.history.walletSrc))+" -> "+h(i(e.history.walletDest)),1)],64)):106===e.history.type?(n(),r(p,{key:1},[v(h(e.history.description.replace("LIQUIDATED",s.value)),1)],64)):108===e.history.type?(n(),r(p,{key:2},[v(h(a.$t("futuresMain.walletHistory.description_RealizedPnl",{n:e.history.contractName})),1)],64)):110===e.history.type?(n(),r(p,{key:3},[v(h(a.$t("futuresMain.walletHistory.description_Funding",{n:e.history.contractName})),1)],64)):d("",!0)])],64)):d("",!0)]);var c}}},bb=vr(Ab,[["__scopeId","data-v-4a9b4c76"]]),_b={class:"common-history-container"},Sb={key:0,class:"no-data-wrapper"},Cb=["colspan"],Lb={class:"pagination-wrapper"},Eb={__name:"CommonHistoryContainer",props:{dataColumns:{type:Number,required:!0},isEmpty:{type:Boolean,default:!0},pagination:{type:Object,default:()=>({currentPage:1,pageSize:10,totalRows:0,totalPages:0})},onPageChange:{type:Function,default:()=>{}}},setup:e=>(t,a)=>{const l=s("Cell"),i=s("HeaderRow"),u=s("Table");return n(),r("div",_b,[m(u,null,{header:g((()=>[o(t.$slots,"header",{},(()=>[m(i,{class:"history-header"},{default:g((()=>[m(l,{textAlign:"left"},{default:g((()=>[v(h(t.$t("t.date")),1)])),_:1}),m(l,{textAlign:"left"},{default:g((()=>[v(h(t.$t("t.currency")),1)])),_:1}),m(l,{textAlign:"left"},{default:g((()=>[v(h(t.$t("t.type")),1)])),_:1}),m(l,{textAlign:"right"},{default:g((()=>[v(h(t.$t("t.amount")),1)])),_:1}),m(l,{textAlign:"left"},{default:g((()=>[v(h(t.$t("t.description")),1)])),_:1})])),_:1})]),!0)])),body:g((()=>[o(t.$slots,"body",{},void 0,!0),e.isEmpty?(n(),r("tr",Sb,[y("td",{colspan:e.dataColumns},[m(P(Zt),{class:"no-data-available",emptyText:t.$t("t.noDataFound")},null,8,["emptyText"])],8,Cb)])):d("",!0)])),_:3}),y("div",Lb,[m(P(As),{layout:"prev, pager, next, jumper",background:!1,currentPage:e.pagination.currentPage,pageSize:e.pagination.pageSize,total:e.pagination.totalRows,totalPages:e.pagination.totalPages,onHandleCurrentChangeP:e.onPageChange},null,8,["currentPage","pageSize","total","totalPages","onHandleCurrentChangeP"])])])}},Ib=vr(Eb,[["__scopeId","data-v-4205c68a"]]),kb={key:1},Rb={key:0},Nb={key:0,class:"row-wrap"},xb={class:"startegy-id"},Pb={__name:"AutoTraderHistoryRow",props:{index:{type:Number,required:!0},data:{type:Object,default:()=>({})}},setup(e){const{t:t}=I(),a=e,l=R((()=>ii(a.data.type)));function o(e){return e===ni.AUTO_TRADER?t("nav.autoTrader"):"FUTURES_WALLET"===e?t("wallets.futuresWallet"):"SPOT_WALLET"===e?t("t.spotWallet"):void 0}return(a,u)=>
1{const c=s("Cell"),f=s("Row");return n(),i(f,{class:"auto-trader-history-row",index:e.index,disableBackground:""},{default:g((()=>[m(c,{textAlign:"left"},{default:g((()=>[v(h(P(Ra)(e.data.dateTime)),1)])),_:1}),m(c,{textAlign:"left"},{default:g((()=>[e.data.currency?(n(),i(P(Pa),{key:0,type:e.data.fiat?"fiat":"icon",name:e.data.currency,size:"16",shortName:""},null,8,["type","name"])):(n(),r("div",kb,"-"))])),_:1}),m(c,{textAlign:"left"},{default:g((()=>[v(h(l.value),1)])),_:1}),m(c,{textAlign:"right"},{default:g((()=>[v(h(P(Xt)(e.data.netAmount,e.data.fiat?"max2":"wvc")),1)])),_:1}),m(c,{textAlign:"left"},{default:g((()=>{return[40004===e.data.type?(n(),r("div",Rb,[["OPEN","CLOSE"].includes(e.data.operation)?(n(),r("div",Nb,[v(h((s=e.data.operation,"OPEN"===s?t("t.copy"):"CLOSE"===s?t("t.stop"):void 0))+" "+h(e.data.fullName)+" ",1),e.data.strategyType===P(Qs).FUTURES_TREND?(n(),r(p,{key:0},[v(h(e.data.aggression&&a.$t(P(Zs)[e.data.aggression]))+" ",1),e.data.leverage?(n(),r(p,{key:0},[v(h(e.data.leverage)+"x",1)],64)):d("",!0)],64)):(n(),r(p,{key:1},[P(Js)[e.data.riskType]?(n(),r(p,{key:0},[v(h(P(t)(P(Js)[e.data.riskType]))+": ",1)],64)):d("",!0),P(ei)[e.data.termType]?(n(),r(p,{key:1},[v(h(P(t)(P(ei)[e.data.termType])),1)],64)):d("",!0)],64)),y("span",xb,"#"+h(e.data.strategyId),1)])):d("",!0),y("div",null,h(o(e.data.walletSrc))+" -> "+h(o(e.data.walletDest)),1)])):106===e.data.type?(n(),r(p,{key:1},[v(h(e.data.description.replace("LIQUIDATED",l.value)),1)],64)):108===e.data.type?(n(),r(p,{key:2},[v(h(a.$t("futuresMain.walletHistory.description_RealizedPnl",{n:e.data.contractName})),1)],64)):110===e.data.type?(n(),r(p,{key:3},[v(h(a.$t("futuresMain.walletHistory.description_Funding",{n:e.data.contractName})),1)],64)):d("",!0)];var s})),_:1})])),_:1},8,["index"])}}},Ob=vr(Pb,[["__scopeId","data-v-92c648cf"]]),$b={__name:"AutoTraderHistory",props:{list:{type:Array,default:()=>[]},pagination:{type:Object,default:()=>({currentPage:1,pageSize:10,totalRows:0,totalPages:0})}},emits:["pageChange"],setup(e,{emit:t}){const a=t;function l(e){a("pageChange",e)}return(t,a)=>(n(),i(P(Ib),{dataColumns:7,isEmpty:0===e.list.length,pagination:e.pagination,onPageChange:l},{body:g((()=>[(n(!0),r(p,null,x(e.list,((e,t)=>(n(),i(P(Ob),{key:t,index:t,data:e},null,8,["index","data"])))),128))])),_:1},8,["isEmpty","pagination"]))}},Wb={__name:"WalletAutoTraderHistory",setup(e){const{t:t}=I(),a=R((()=>({backRouteName:Ke.WALLET_AUTO_TRADER,linkText:t("wallet.backToAutoTraderWallet"),headerTitle:t("router.autoTraderWalletHistory")})));return(e,t)=>(n(),i(db,{headerBackLinkConfig:a.value,historyDownloadApiPath:"report/histories/copywiseWallet",historyApiFunction:P($a).getAutoTraderWalletHistory},{mobileBlock:g((({history:e})=>[m(bb,{history:e},null,8,["history"])])),desktopList:g((({list:e,pagination:t,handlePageChange:a})=>[m($b,{list:e,pagination:t,onPageChange:a},null,8,["list","pagination","onPageChange"])])),_:1},8,["headerBackLinkConfig","historyApiFunction"]))}},Fb={class:"trader-info"},Bb={class:"trader-name"},Ub={class:"number-value"},Mb={class:"currency"},Vb={class:"trader-detail"},Hb={class:"row-wrap"},Gb={class:"data-label"},Yb={class:"row-wrap"},qb={class:"data-label"},zb={class:"currency"},Kb={class:"row-wrap"},jb={class:"data-label"},Xb={class:"number-value"},Qb={class:"currency"},Zb={class:"row-wrap"},Jb={class:"data-label"},e_={class:"number-value"},t_={class:"currency"},a_={class:"detail-button"},l_="*****",s_=vr(E({__name:"TraderList",setup(e){const{t:t}=I(),a=R((()=>[{id:"traderName",title:t("wallets.myLeaders"),textAlign:"left"},{id:"investment",title:t("t.marginBalance"),tip:t("wallets.copyTrading.tooltip.assetBalance"),textAlign:"right",sortable:!0}])),l=U(),o=ct(),u=O("investment"),c=O("desc"),f=R((()=>l.state.lang)),T=R((()=>l.state.now)),w=R((()=>{var e;return null==(e=l.state.accountInfo)?void 0:e.uid})),A=R((()=>l.state.hideWalletPriceValue)),b=O(-1),_=R((()=>u.value?o.wallet.wallets.slice().sort(((e,t)=>ri(+e[u.value],+t[u.value],"asc"===c.value))):o.wallet.wallets));function S({key:e,order:t}){u.value=e,c.value=t}return(e,t)=>
1{const l=s("ToolTip"),o=s("HeaderRow"),c=s("RouterLink"),C=s("Cell"),E=s("Row"),I=s("DataTable");return n(),i(I,{class:"trader-list-table",fixHeader:""},{header:g((()=>[m(o,{class:"row"},{default:g((()=>[(n(!0),r(p,null,x(a.value,(e=>(n(),i(cl,{key:e.id,class:L({[`align-${e.textAlign}`]:e.textAlign}),currentSortKey:u.value,defaultSortOrder:"desc",title:e,iconType:P(oi).triangle,onSort:S},D({_:2},[e.title?{name:"content",fn:g((()=>[v(h(e.title),1)])),key:"0"}:void 0,e.tip?{name:"tooltip",fn:g((()=>[m(l,{placement:"top"},{content:g((()=>[m(Fa,{class:"info-icon"})])),tooltip:g((()=>[y("span",null,h(e.tip),1)])),_:2},1024)])),key:"1"}:void 0]),1032,["class","currentSortKey","title","iconType"])))),128))])),_:1})])),body:g((()=>[0===_.value.length?(n(),i(E,{key:0,class:"no-data-section",index:-1,disableCssHoverEffect:"",disableBackground:""},{default:g((()=>[m(C,{textAlign:"center",colspan:a.value.length.toString()},{default:g((()=>[m(Zt,{class:"no-data-available"},{"empty-text":g((()=>[v(h(e.$t("t.noDataFound"))+" ",1),m(c,{class:"route-link",to:{name:P(Ke).COPY_LEADER_TRADING,params:{lang:f.value}}},{default:g((()=>[v(h(e.$t("t.startSomething",{action:e.$t("trading.copyTrading")}))+" ",1),m(ht,{class:"icon-chevron-right",width:"16",height:"16"})])),_:1},8,["to"])])),_:1})])),_:1},8,["colspan"])])),_:1})):d("",!0),(n(!0),r(p,null,x(_.value,((t,l)=>(n(),r(p,{key:l},[m(E,{class:"trader-row",index:l,disableBackground:"",disableCssHoverEffect:"",onClick:e=>function(e){b.value=b.value===e?-1:e}(l)},{default:g((()=>[m(C,null,{default:g((()=>[y("div",Fb,[m(ca,{class:L({active:b.value===l}),width:"12"},null,8,["class"]),y("div",Bb,h(t.traderName),1)])])),_:2},1024),m(C,null,{default:g((()=>[y("span",Ub,h(A.value?l_:P(Xt)(t.totalValue||t.investment,"wvc")),1),y("span",Mb,h(P(Cs)),1)])),_:2},1024)])),_:2},1032,["index","onClick"]),b.value===l?(n(),i(E,{key:0,class:"trader-detail-row",index:l,disableBackground:"",disableCssHoverEffect:""},{default:g((()=>[m(C,{colspan:a.value.length.toString()},{default:g((()=>[y("div",Vb,[y("div",Hb,[y("div",Gb,h(e.$t("t.duration")),1),y("div",null,h(P(ti)(P(ae)(Date.now()-t.duration),T.value)),1)]),y("div",Yb,[y("div",qb,h(e.$t("wallets.realizedPnl")),1),y("div",null,[y("span",{class:L(["number-value",{"brand-color-positive":!A.value&&P(N)(t.realisedProfitLoss).gte(0),"brand-color-negative":!A.value&&P(N)(t.realisedProfitLoss).lt(0)}])},h(A.value?l_:P(Xs)(t.realisedProfitLoss,"wvc")),3),y("span",zb,h(P(Cs)),1)])]),y("div",Kb,[y("div",jb,h(e.$t("wallets.profitShared")),1),y("div",null,[y("span",Xb,h(A.value?l_:P(Xt)(t.sharedProfit,"wvc")),1),y("span",Qb,h(P(Cs)),1)])]),y("div",Zb,[y("div",Jb,h(e.$t("t.netProfit")),1),y("div",null,[y("span",e_,h(A.value?l_:P(Xt)(t.netProfit,"wvc")),1),y("span",t_,h(P(Cs)),1)])]),w.value?(n(),i(c,{key:0,to:{name:P(Ke).COPY_LEADER_TRADER_INFO,params:{lang:f.value,id:w.value},query:{category:"COPY",tab:1}},target:"_blank"},{default:g((()=>[y("div",a_,h(e.$t("t.detail")),1)])),_:1},8,["to"])):d("",!0)])])),_:2},1032,["colspan"])])),_:2},1032,["index"])):d("",!0)],64)))),128))])),_:1})}}}),[["__scopeId","data-v-a9e54058"]]),i_={class:"trader-list"},n_={class:"number-value"},r_={class:"currency"},o_={class:"currency"},u_={class:"number-value"},c_={class:"currency"},d_={class:"number-value"},p_={class:"currency"},y_="*****",h_=vr(E({__name:"TraderList",setup(e){const{t:t}=I(),a=R((()=>[{id:"traderName",title:t("wallets.myLeaders"),textAlign:"left"},{id:"duration",title:t("t.duration"),textAlign:"left",sortable:!0},{id:"investment",title:t("t.marginBalance"),tip:t("wallets.copyTrading.tooltip.assetBalance"),textAlign:"right",sortable:!0},{id:"realisedProfitLoss",title:t("wallets.realizedPnl"),textAlign:"right",sortable:!0},{id:"sharedProfit",title:t("wallets.profitShared"),textAlign:"right",sortable:!0},{id:"netProfit",title:t("t.netProfit"),textAlign:"right",sortable:!0},{id:"detail",textAlign:"center",isActionBtn:!0}])),l=U(),o=ct(),u=O("investment"),c=O("desc"),f=R((()=>l.state.lang)),T=R((()=>l.state.now)),w=R((()=>{var e;return null==(e=l.state.accountInfo)?void 0:e.uid})),A=R((()=>l.state.hideWalletPriceValue)),b=R((()=>u.value?o.wallet.wallets.slice().sort(((e,t)=>ri(+e[u.value],+t[u.value],"asc"===c.value))):o.wallet.wallets));function _({key:e,order:t}){u.value=e,c.value=t}return(e,t)=>{const l=s("ToolTip"),o=s("HeaderRow"),c=s("RouterLink"),S=s("Cell"),C=s("Row"),E=s("DataTable");
1return n(),r("div",i_,[m(E,{class:"trader-list-table",fixHeader:""},{header:g((()=>[m(o,{class:"header-row"},{default:g((()=>[(n(!0),r(p,null,x(a.value,(e=>(n(),i(cl,{key:e.id,currentSortKey:u.value,defaultSortOrder:"desc",class:L({[`align-${e.textAlign}`]:e.textAlign,"action-btn":e.isActionBtn}),title:e,iconType:P(oi).triangle,onSort:_},D({_:2},[e.title?{name:"content",fn:g((()=>[v(h(e.title),1)])),key:"0"}:void 0,e.tip?{name:"tooltip",fn:g((()=>[m(l,{placement:"top"},{content:g((()=>[m(Fa,{class:"info-icon"})])),tooltip:g((()=>[y("span",null,h(e.tip),1)])),_:2},1024)])),key:"1"}:void 0]),1032,["currentSortKey","class","title","iconType"])))),128))])),_:1})])),body:g((()=>[0===b.value.length?(n(),i(C,{key:0,class:"no-data-section",index:-1,disableCssHoverEffect:"",disableBackground:""},{default:g((()=>[m(S,{textAlign:"center",colspan:a.value.length.toString()},{default:g((()=>[m(Zt,{class:"no-data-available"},{"empty-text":g((()=>[v(h(e.$t("t.noDataFound"))+" ",1),m(c,{class:"route-link",to:{name:P(Ke).COPY_LEADER_TRADING,params:{lang:f.value}}},{default:g((()=>[v(h(e.$t("t.startSomething",{action:e.$t("trading.copyTrading")}))+" ",1),m(ht,{class:"icon-chevron-right",width:"16",height:"16"})])),_:1},8,["to"])])),_:1})])),_:1},8,["colspan"])])),_:1})):d("",!0),(n(!0),r(p,null,x(b.value,((t,a)=>(n(),i(C,{key:a,class:"trader-row",index:a,disableBackground:"",disableCssHoverEffect:""},{default:g((()=>[m(S,{textAlign:"left"},{default:g((()=>[v(h(t.traderName),1)])),_:2},1024),m(S,{textAlign:"left"},{default:g((()=>[v(h(P(ti)(P(ae)(Date.now()-t.duration),T.value)),1)])),_:2},1024),m(S,null,{default:g((()=>[y("span",n_,h(A.value?y_:P(Xt)(t.totalValue||t.investment,"wvc")),1),y("span",r_,h(P(Cs)),1)])),_:2},1024),m(S,null,{default:g((()=>[y("span",{class:L(["number-value",{"brand-color-positive":!A.value&&P(N)(t.realisedProfitLoss).gte(0),"brand-color-negative":!A.value&&P(N)(t.realisedProfitLoss).lt(0)}])},h(A.value?y_:P(Xs)(t.realisedProfitLoss,"wvc")),3),y("span",o_,h(P(Cs)),1)])),_:2},1024),m(S,null,{default:g((()=>[y("span",u_,h(A.value?y_:P(Xt)(t.sharedProfit,"wvc")),1),y("span",c_,h(P(Cs)),1)])),_:2},1024),m(S,null,{default:g((()=>[y("span",d_,h(A.value?y_:P(Xt)(t.netProfit,"wvc")),1),y("span",p_,h(P(Cs)),1)])),_:2},1024),m(S,{class:"action-button-cell",textAlign:"center"},{default:g((()=>[w.value?(n(),i(c,{key:0,class:"detail-link",to:{name:P(Ke).COPY_LEADER_TRADER_INFO,params:{lang:f.value,id:w.value},query:{category:"COPY",tab:1}},target:"_blank"},{default:g((()=>[v(h(e.$t("t.detail")),1)])),_:1},8,["to"])):d("",!0)])),_:1})])),_:2},1032,["index"])))),128))])),_:1})])}}}),[["__scopeId","data-v-cc3ccc59"]]),v_={class:"asset-list"},m_={class:"action-wrapper"},g_={class:"action-top"},f_={class:"asset-info"},T_={class:"asset-info-label"},w_={class:"asset-symbol"},D_={class:"asset-name"},A_={class:"asset-detail"},b_={class:"row-wrap"},__={class:"data-label"},S_={class:"row-wrap"},C_={class:"data-label"},L_={class:"row-wrap"},E_={class:"data-label"},I_={class:"detail-button"},k_=vr(E({__name:"AssetList",setup(e){const{t:t}=I(),a=[{id:"asset",title:t("t.asset"),textAlign:"left"},{id:"totalValue",title:t("t.balance"),textAlign:"right",sortable:!0}],l=U(),o=dt(),u=O(""),c=O(El.ALL_ASSETS),f=O("contributionValueInUSDT"),T=O("desc"),w=R((()=>l.state.lang)),A=R((()=>{var e;return null==(e=l.state.accountInfo)?void 0:e.uid})),b=R((()=>l.state.hideConvertToBaseCurrencyValue)),_=R((()=>l.state.hideWalletSmallBalanceCopyTrading)),S=O(-1),C={[El.FIAT]:"isFiat",[El.STABLE_COINS]:"stableCoin",[El.CRYPTO_CURRENCY]:"isCrypto"},E=R((()=>{let e=o.wallet.assets??[];if(c.value!==El.ALL_ASSETS){const t=C[c.value];e=e.filter((e=>!0===k(e.shortName)[t]))}if(u.value){const t=u.value.toLowerCase().trim();e=e.filter((e=>{var a,l;const s=(null==(a=e.shortName)?void 0:a.toLowerCase())||"",i=(null==(l=e.fullName)?void 0:l.toLowerCase())||"";return s.includes(t)||i.includes(t)}))}return _.value&&!u.value&&(e=e.filter((e=>{const t=k(e.shortName).usdRate??0;return N(e.totalValue??0).times(t).toNumber()>=_l}))),f.value&&(e=e.slice().sort(((e,t)=>ri(Number(e[f.value]),Number(t[f.value]),"asc"===T.value)))),e}));function k(e){return l.state.currencyMap[e]||{}}function $({key:e,order:t}){f.value=e,T.value=t}return(e,t)=>{const l=s("HeaderRow"),o=s("RouterLink"),T=s("Cell"),C=s("Row"),I=s("Tooltip"),R=s("DataTable");return n(),r("div",v_,[y("div",m_,[y("div",g_,[m(Kr,{value:u.value,"onUpdate:value":t[0]||(t[0]=e=>u.value=e),class:"search-input",width:"180px",height:"40px",type:P(Il).BOX},null,8,["value","type"]),m(Vh,{filterKey:c.value,"onUpdate:filterKey":t[1]||(t[1]=e=>c.value=e),class:"wallet-filter"},null,8,["filterKey"])]),m(zh,{class:"wallet-is-convert-base",state:b.value},null,8,["state"]),m(qh,{class:"wallet-hide-small",type:"copyTrading",state:_.value,isDisable:!!u.value},null,8,["state","isDisable"])]),m(R,{class:"asset-list-table",f
1ixHeader:""},{header:g((()=>[m(l,{class:"row"},{default:g((()=>[(n(),r(p,null,x(a,(e=>m(cl,{key:e.id,class:L({[`align-${e.textAlign}`]:e.textAlign}),currentSortKey:f.value,defaultSortOrder:"desc",title:e,iconType:P(oi).triangle,onSort:$},D({_:2},[e.title?{name:"content",fn:g((()=>[v(h(e.title),1)])),key:"0"}:void 0]),1032,["class","currentSortKey","title","iconType"]))),64))])),_:1})])),body:g((()=>[0===E.value.length?(n(),i(C,{key:0,class:"no-data-section",index:-1,disableCssHoverEffect:"",disableBackground:""},{default:g((()=>[m(T,{textAlign:"center",colspan:a.length.toString()},{default:g((()=>[m(Zt,{class:"no-data-available"},{"empty-text":g((()=>[v(h(e.$t("t.noDataFound"))+" ",1),m(o,{class:"route-link",to:{name:P(Ke).COPY_LEADER_TRADER_INFO,params:{lang:w.value,id:A.value},query:{category:"LEAD",tab:0}}},{default:g((()=>[v(h(e.$t("t.startSomething",{action:e.$t("nav.leadTrading")}))+" ",1),m(ht,{class:"icon-chevron-right",width:"16",height:"16"})])),_:1},8,["to"])])),_:1})])),_:1},8,["colspan"])])),_:1})):d("",!0),(n(!0),r(p,null,x(E.value,((l,s)=>(n(),r(p,{key:s},[m(C,{class:"asset-row",index:s,disableBackground:"",disableCssHoverEffect:"",onClick:e=>function(e){S.value=S.value===e?-1:e}(s)},{default:g((()=>[m(T,null,{default:g((()=>[y("div",f_,[m(ca,{class:L({active:S.value===s}),width:"12"},null,8,["class"]),m(Pa,{name:l.shortName,type:k(l.shortName).isFiat?"fiat":"icon",showName:!1,size:"18"},null,8,["name","type"]),y("div",T_,[y("div",w_,h(l.shortName),1),y("div",D_,h(l.fullName),1)])])])),_:2},1024),m(T,null,{default:g((()=>[m(By,{priceValue:l.totalValue,currencyName:l.shortName,isFiat:k(l.shortName).isFiat,hideConvertToBaseCurrencyValue:b.value},null,8,["priceValue","currencyName","isFiat","hideConvertToBaseCurrencyValue"])])),_:2},1024)])),_:2},1032,["index","onClick"]),S.value===s?(n(),i(C,{key:0,class:"asset-detail-row",index:s,disableBackground:"",disableCssHoverEffect:""},{default:g((()=>[m(T,{colspan:a.length.toString()},{default:g((()=>[y("div",A_,[y("div",b_,[y("div",__,[v(h(e.$t("t.availableAssets"))+" ",1),m(I,{placement:"top",popover:!0},{content:g((()=>[m(Fa,{class:"info-icon"})])),tooltip:g((()=>[y("span",null,h(e.$t("wallets.futures.tooltip.totalAvailableAssetsTip")),1),t[2]||(t[2]=y("br",null,null,-1)),m(o,{class:"info-link",to:{name:P(Ke).TRADING_RULES,params:{lang:w.value,marketType:"collateral"}},target:"_blank"},{default:g((()=>[v(h(e.$t("wallets.futures.tooltip.totalAvailableAssetsTipLink")),1)])),_:1},8,["to"])])),_:1})]),y("div",null,[m(By,{priceValue:l.totalAvailableAssets,currencyName:l.shortName,isFiat:k(l.shortName).isFiat},null,8,["priceValue","currencyName","isFiat"])])]),y("div",S_,[y("div",C_,h(e.$t("t.availableForTransfer")),1),y("div",null,[m(By,{priceValue:l.availableForTransfer,currencyName:l.shortName,isFiat:k(l.shortName).isFiat},null,8,["priceValue","currencyName","isFiat"])])]),y("div",L_,[y("div",E_,[v(h(e.$t("wallets.futures.assetContribution"))+" ",1),m(I,{placement:"top"},{content:g((()=>[m(Fa,{class:"info-icon"})])),tooltip:g((()=>[v(h(e.$t("wallets.futures.tooltip.assetContributionTip")),1)])),_:1})]),y("div",null,[m(By,{priceValue:l.contributionValueInUSDT,currencyName:P(Cs),isFiat:k(P(Cs)).isFiat},null,8,["priceValue","currencyName","isFiat"])])]),A.value?(n(),i(o,{key:0,to:{name:P(Ke).COPY_LEADER_TRADER_INFO,params:{lang:w.value,id:A.value},query:{category:"LEAD",tab:0}},target:"_blank"},{default:g((()=>[y("div",I_,h(e.$t("t.detail")),1)])),_:1},8,["to"])):d("",!0)])])),_:2},1032,["colspan"])])),_:2},1032,["index"])):d("",!0)],64)))),128))])),_:1})])}}}),[["__scopeId","data-v-4b2922e1"]]),R_={class:"asset-list"},N_={class:"action-wrapper"},x_={class:"wallet-actions"},P_={class:"flex-box items-center"},O_={class:"asset-symbol"},$_={class:"asset-name"},W_=vr(E({__name:"AssetList",setup(e){const{t:t}=I(),a=U(),l=dt(),o=O(""),u=O(El.ALL_ASSETS),c=O("investment"),f=O("desc"),T=R((()=>a.state.lang)),w=R((()=>{var e;return null==(e=a.state.accountInfo)?void 0:e.uid})),A=R((()=>a.state.hideConvertToBaseCurrencyValue)),b=R((()=>a.state.hideWalletSmallBalanceCopyTrading)),_=R((()=>[{id:"asset",title:t("t.asset"),textAlign:"left"},{id:"totalValue",title:t("t.balance"),textAlign:"right",sortable:!0},{id:"totalAvailableAssets",title:t("t.availableAssets"),tip:t("wallets.futures.tooltip.totalAvailableAssetsTip"),tipLink:{text:t("wallets.futures.tooltip.totalAvailableAssetsTipLink"),route:{name:Ke.TRADING_RULES,params:{lang:T.value,marketType:"collateral"}}},textAlign:"right",sortable:!0},{id:"availableForTransfer",title:t("t.availableForTransfer"),textAlign:"right",sortable:!0},{id:"contributionValueInUSDT",title:t("wallets.futures.assetContribution"),tip:t("wallets.futures.tooltip.assetContributionTip"),textAlign:"right",sortable:!0},{id:"detail",textAlign:"center",isActionBtn:!0}])),S={[El.FIAT]:"isFiat",[El.STABLE_COINS]:"stableCoin",[El.CRYPTO_CURRENCY]:"isCrypto"},C=R((()=>{let e=l.wallet.assets??[];if(u.value!==El.ALL_ASSETS){const t=S[u.value];e=e.filter((e=>!0===E(e.shortName)[t]))}if(o.value){const t=o.value.toLowerCase().trim();e=e.filter((e=>{var a,l;const s=(null==(a=e.shortName)?void 0:a.toLowerCase())||"",i=(null==(l=e.fullName)?void 0:l.toLowerCase())||"";return s.includes(t)||i.includes(t)}))}return b.value&&!o.value&&(e=e.filter((e=>{const t=E(e.shortName).usdRate??0;return N(e.totalValue??0).times(t).toNumber()>=_l}))),c.value&&(e=e.slice().sort(((e,t)=>ri(Number(e[c.value]),Number(t[c.value]),"asc"===f.value)))),e}));function E(e){return a.state.currencyMap[e]||{}}function k({key:e,order:t}){c.value=e,f.value=t}return(e,t)=>{const a=s("RouterLink"),l=s("ToolTip"),f=s("HeaderRow"),S=s("Cell"),I=s("Row"),R=s("DataTable");return n(),r("div",R_,[y("div",N_,[m(Kr,{id:P(Xe)("input_search"),value:o.value,"onUpdate:value":t[0]||(t[0]=e=>o.value=e),width:"252px",height:"32px"},null,8,["id","value"]),m(Iv,{filterKey:u.value,"onUpdate:filterKey":t[1]||(t[1]=e=>u.value=e),class:"wallet-filter"},null,8,["filterKey"]),y("div",x_,[m(zh,{state:A.value},null,8,["state"]),m(qh,{class:"wallet-hide-small",type:"copyTrading",state:b.value,isDisable:!!o.value},null,8,["state","isDisable"])])]),m(R,{class:"asset-list-table",f
1ixHeader:""},{header:g((()=>[m(f,{class:"header-row"},{default:g((()=>[(n(!0),r(p,null,x(_.value,(e=>(n(),i(cl,{key:e.id,currentSortKey:c.value,defaultSortOrder:"desc",class:L({[`align-${e.textAlign}`]:e.textAlign,"action-btn":e.isActionBtn}),title:e,iconType:P(oi).triangle,onSort:k},D({_:2},[e.title?{name:"content",fn:g((()=>[v(h(e.title),1)])),key:"0"}:void 0,e.tip?{name:"tooltip",fn:g((()=>[m(l,{placement:"top",popover:!!e.tipLink},{content:g((()=>[m(Fa,{class:"info-icon"})])),tooltip:g((()=>[y("span",null,h(e.tip),1),e.tipLink?(n(),r(p,{key:0},[t[2]||(t[2]=y("br",null,null,-1)),e.tipLink?(n(),i(a,{key:0,class:"info-link",to:e.tipLink.route,target:"_blank"},{default:g((()=>[v(h(e.tipLink.text),1)])),_:2},1032,["to"])):d("",!0)],64)):d("",!0)])),_:2},1032,["popover"])])),key:"1"}:void 0]),1032,["currentSortKey","class","title","iconType"])))),128))])),_:1})])),body:g((()=>[0===C.value.length?(n(),i(I,{key:0,class:"no-data-section",index:-1,disableCssHoverEffect:"",disableBackground:""},{default:g((()=>[m(S,{textAlign:"center",colspan:_.value.length.toString()},{default:g((()=>[C.value.length?d("",!0):(n(),i(Zt,{key:0,class:"no-data-available"},{"empty-text":g((()=>[v(h(e.$t("t.noDataFound"))+" ",1),m(a,{class:"route-link",to:{name:P(Ke).COPY_LEADER_TRADER_INFO,params:{lang:T.value,id:w.value},query:{category:"LEAD",tab:0}}},{default:g((()=>[v(h(e.$t("t.startSomething",{action:e.$t("nav.leadTrading")}))+" ",1),m(ht,{class:"icon-chevron-right",width:"16",height:"16"})])),_:1},8,["to"])])),_:1}))])),_:1},8,["colspan"])])),_:1})):d("",!0),(n(!0),r(p,null,x(C.value,((t,l)=>(n(),i(I,{key:l,class:"asset-row",index:l,disableBackground:"",disableCssHoverEffect:""},{default:g((()=>[m(S,{textAlign:"left"},{default:g((()=>[y("div",P_,[m(Pa,{name:t.shortName,type:E(t.shortName).isFiat?"fiat":"icon",showName:!1,size:"16"},null,8,["name","type"]),y("span",O_,h(t.shortName),1),y("span",$_,h(t.fullName),1)])])),_:2},1024),m(S,null,{default:g((()=>[m(By,{priceValue:t.totalValue,currencyName:t.shortName,isFiat:E(t.shortName).isFiat,hideConvertToBaseCurrencyValue:A.value},null,8,["priceValue","currencyName","isFiat","hideConvertToBaseCurrencyValue"])])),_:2},1024),m(S,null,{default:g((()=>[m(By,{priceValue:t.totalAvailableAssets,currencyName:t.shortName,isFiat:E(t.shortName).isFiat},null,8,["priceValue","currencyName","isFiat"])])),_:2},1024),m(S,null,{default:g((()=>[m(By,{priceValue:t.availableForTransfer,currencyName:t.shortName,isFiat:E(t.shortName).isFiat},null,8,["priceValue","currencyName","isFiat"])])),_:2},1024),m(S,null,{default:g((()=>[m(By,{priceValue:t.contributionValueInUSDT,currencyName:P(Cs),isFiat:E(P(Cs)).isFiat},null,8,["priceValue","currencyName","isFiat"])])),_:2},1024),m(S,{class:"action-button-cell",textAlign:"center"},{default:g((()=>[w.value?(n(),i(a,{key:0,class:"detail-link",to:{name:P(Ke).COPY_LEADER_TRADER_INFO,params:{lang:T.value,id:w.value},query:{category:"LEAD",tab:0}},target:"_blank"},{default:g((()=>[v(h(e.$t("t.detail")),1)])),_:1},8,["to"])):d("",!0)])),_:1})])),_:2},1032,["index"])))),128))])),_:1})])}}}),[["__scopeId","data-v-42f9b566"]]),F_={key:0,class:"switcher-wrapper"},B_={class:"list-wrap"},U_=vr(E({__name:"WalletCopyTrading",setup(e){const t=U(),a=M(),l=V(),o=ct(),u=dt(),c=ze(),{t:T}=I(),w=ka(),D={LEAD_TRADING:Ye.LEAD_TRADING,COPY_TRADING:Ye.COPY_TRADING},A={[Ke.WALLET_LEAD_TRADING]:D.LEAD_TRADING,[Ke.WALLET_COPY_TRADING]:D.COPY_TRADING,[D.LEAD_TRADING]:Ke.WALLET_LEAD_TRADING,[D.COPY_TRADING]:Ke.WALLET_COPY_TRADING},b=O(!0),_=O(D.COPY_TRADING),S=R((()=>t.state.lang)),L=R((()=>c.displayCurrency??void 0)),E=R((()=>[{id:D.LEAD_TRADING,title:T("nav.leadTrading")},{id:D.COPY_TRADING,title:T("trading.copyTrading")}])),k=R((()=>E.value.map((({title:e})=>e)))),N=R((()=>E.value.findIndex((({id:e})=>e===_.value)))),x=R((()=>u.isEnableLeadTradingWallet&&w.isMobile)),W=R((()=>l.name===Ke.WALLET_COPY_TRADING)),F=R((()=>W.value?T("wallets.copyTradingWallet"):T("wallets.leadTradingWallet"))),B=R((()=>W.value?ui:ci));function H(e){a.push({name:A[E.value[e].id],params:{lang:S.value}})}return $((()=>l.name),((e,t,a)=>{A[_.value]&&A[_.value]!==e&&(_.value=A[e]),b.value=!0;(e===Ke.WALLET_COPY_TRADING?o:u).update(!0).then((()=>{b.value=!1})),a((()=>{o.removeTimer(),u.removeTimer()}))}),{immediate:!0}),(e,t)=>{const a=s("RouterLink"),l=C("loading");return n(),r(p,null,[x.value?(n(),r("div",F_,[m(Pl,{barHeight:4,type:P(xl).BOTTOM_BAR_NARROW,theme:P(Nl).compact,itemList:k.value,selected:N.value,onSelect:H},null,8,["type","theme","itemList","selected"])])):d("",!0),m(Sy,{type:_.value,title:F.value,featuresList:B.value,useWalletBalanceInfo:"",displayCurrency:L.value},{"header-link":g((()=>[m(a,{class:"title-section-link",to:{name:P(Ke).COPY_LEADER_TRADING,params:{lang:S.value}}},{default:g((()=>[v(h(e.$t("t.goToSomewhere",{page:e.$t("trading.copyTrading")}))+" ",1),m(ht,{class:"icon-chevron-right",width:"16",height:"16"})])),_:1},8,["to"])])),mobile:g((()=>[y("div",B_,[W.value?f((n(),i(s_,{key:0},null,512)),[[l,b.value]]):f((n(),i(k_,{key:1},null,512)),[[l,b.value]])])])),desktop:g((()=>[W.value?f((n(),i(h_,{key:0},null,512)),[[l,b.value]]):f((n(),i(W_,{key:1},null,512)),[[l,b.value]])])),_:1},8,["type","title","featuresList","displayCurrency"])],64)}}}),[["__scopeId","data-v-9d88cc04"]]),M_={class:"copy-trading-history"},V_={class:"time-label"},H_={class:"operation-wrap"},G_={class:"row-wrap"},Y_={class:"data-label"},q_={class:"row-wrap"},z_={class:"data-label"},K_={class:"description"},j_={key:0},X_=vr({__name:"CopyTradingHistoryBlock",props:{history:{type:Object,default:()=>({})}},setup(e){const t=new Set([40006,40007,40018,40020,40022,40027]),{t:a}=I(),l=e,s=O(!1),i=R((()=>{var e;return ii(null==(e=l.history)?void 0:e.type)})),o=R((()=>{const{wallet:e,traderName:t}=l.history;return e.includes(ni.AI_COPY_TRADING)?`${a("nav.aiCopyTrading")} (${t})`:e.includes(ni.COPY_TRADING)?`${a("trading.copyTrading")} (${t})`:e.includes(ni.AI_LEAD_TRADING)?a("nav.aiLeadTrading"):a("nav.leadTrading")}));function u(){s.value=!s.value}return(a,l)=>(n(),r("div",M_,[y("div",{class:"row-wrap pointer",onClick:u},[y("div",V_,h(P(Ra)(e.history.dateTime)),1),y("div",H_,[v(h(i.value)+" ",1),m(P(ca),{class:L(["icon-chevron",{active:s.value}])},null,8,["class"])])]),s.value?(n(),r(p,{key:0},[y("div",G_,[y("span",Y_,h(a.$t("t.currency")),1),v(" "+h(e.history.currency),1)]),y("div",q_,[y("span",z_,h(a.$t("t.amount")),1),v(" "+h(P(Xt)(e.history.netAmount,e.history.fiat?"24":"wvc")),1)]),y("div",K_,[P(t).has(e.history.type)?(n(),r("div",j_,h(P(di)(e.history)),1)):108===e.history.type?(n(),r(p,{key:1},[v(h(a.$t("futuresMain.walletHistory.description_RealizedPnl",{n:o.value})),1)],64)):110===e.history.type?(n(),r(p,{key:2},[v(h(a.$t("futuresMain.walletHistory.description_Funding",{n:o.value})),1)],64)):e.history.description?(n(),r(p,{key:3},[v(h(e.history.description),1)],64)):d("",!0)])],64)):d("",!0)]))}},[["__scopeId","data-v-f293e444"]]),Q_={key:1},Z_={key:0},J_=vr({__name:"CopyTradingHistory",props:{list:{type:Array,default:()=>[]},pagination:{type:Object,default:()=>({currentPage:1,pageSize:10,totalRows:0,totalPages:0})}},emits:["pageChange"],setup(e,{emit:t}){const a=new Set([40006,40007,40018,40020,40022,40027]),{t:l}=I(),o=t;function u(e){o("pageChange",e)}function c(e,t){return e.includes(ni.AI_COPY_TRADING)?`${l("nav.aiCopyTrading")} (${t})`:e.includes(ni.COPY_TRADING)?`${l("trading.copyTrading")} (${t})`:e.includes(ni.AI_LEAD_TRADING)?l("nav.aiLeadTrading"):l("nav.leadTrading")}return(t,l)=>{const o=s("Cell"),y=s("Row");return n(),i(P(Ib),{dataColumns:7,isEmpty:0===e.list.length,pagination:e.pagination,onPageChange:u},{body:g((()=>[(n(!0),r(p,null,x(e.list,((e,l)=>(n(),i(y,{key:l,index:l,class:"copy-trading-history-row",disableBackgroun
1d:""},{default:g((()=>[m(o,{textAlign:"left"},{default:g((()=>[v(h(P(Ra)(e.dateTime)),1)])),_:2},1024),m(o,{textAlign:"left"},{default:g((()=>[e.currency?(n(),i(P(Pa),{key:0,type:e.fiat?"fiat":"icon",name:e.currency,size:"16",shortName:""},null,8,["type","name"])):(n(),r("div",Q_,"-"))])),_:2},1024),m(o,{textAlign:"left"},{default:g((()=>[v(h(P(ii)(e.type)),1)])),_:2},1024),m(o,{textAlign:"right"},{default:g((()=>[v(h(P(Xt)(e.netAmount,e.fiat?"24":"wvc")),1)])),_:2},1024),m(o,{textAlign:"left"},{default:g((()=>[P(a).has(e.type)?(n(),r("div",Z_,h(P(di)(e)),1)):108===e.type?(n(),r(p,{key:1},[v(h(t.$t("futuresMain.walletHistory.description_RealizedPnl",{n:c(e.wallet,e.traderName)})),1)],64)):110===e.type?(n(),r(p,{key:2},[v(h(t.$t("futuresMain.walletHistory.description_Funding",{n:c(e.wallet,e.traderName)})),1)],64)):e.description?(n(),r(p,{key:3},[v(h(e.description),1)],64)):d("",!0)])),_:2},1024)])),_:2},1032,["index"])))),128))])),_:1},8,["isEmpty","pagination"])}}},[["__scopeId","data-v-e57cb86e"]]),eS=E({__name:"CopyTradingWalletHistory",setup(e){const t=V(),{t:a}=I(),l=R((()=>{switch(t.name){case Ke.WALLET_LEAD_TRADING_HISTORY:return{historyDownloadApiPath:"report/histories/copytradingWallet/leader",historyApiFunction:$a.getLeadTradingWalletHistory,backRouteName:Ke.WALLET_LEAD_TRADING,backLinkText:a("wallet.backToLeadTradingWallet"),headerTitle:a("router.leadTradingWalletHistory"),filterCodes:[108,110,121,40006]};case Ke.WALLET_AI_LEAD_TRADING_HISTORY:return{historyDownloadApiPath:"report/histories/aicopytradingWallet/leader",historyApiFunction:$a.getAiLeadTradingWalletHistory,backRouteName:Ke.WALLET_AI_LEAD_TRADING,backLinkText:a("wallet.backToAiLeadTradingWallet"),headerTitle:a("nav.walletAiLeadTradingHistory"),filterCodes:[108,110,121,40020]};case Ke.WALLET_AI_COPY_TRADING_HISTORY:return{historyDownloadApiPath:"report/histories/aicopytradingWallet/copier",historyApiFunction:$a.getAiCopyTradingWalletHistory,backRouteName:Ke.WALLET_AI_COPY_TRADING,backLinkText:a("wallet.backToAiCopyTradingWallet"),headerTitle:a("nav.walletAiCopyTradingHistory"),filterCodes:[108,110,121,40018,40022]};case Ke.WALLET_COPY_TRADING_HISTORY:default:return{historyDownloadApiPath:"report/histories/copytradingWallet/copier",historyApiFunction:$a.getCopyTradingWalletHistory,backRouteName:Ke.WALLET_COPY_TRADING,backLinkText:a("wallet.backToCopyTradingWallet"),headerTitle:a("router.copyTradingWalletHistory"),filterCodes:[108,110,121,40007,40027]}}})),s=R((()=>({backRouteName:l.value.backRouteName,linkText:l.value.backLinkText,headerTitle:l.value.headerTitle}))),r=R((()=>l.value.filterCodes.map((e=>({name:ii(e),value:e})))));return(e,t)=>(n(),i(db,{headerBackLinkConfig:s.value,historyDownloadApiPath:l.value.historyDownloadApiPath,historyApiFunction:l.value.historyApiFunction,historyTypeFilterList:r.value},{mobileBlock:g((({history:e})=>[m(X_,{history:e},null,8,["history"])])),desktopList:g((({list:e,pagination:t,handlePageChange:a})=>[m(J_,{list:e,pagination:t,onPageChange:a},null,8,["list","pagination","onPageChange"])])),_:1},8,["headerBackLinkConfig","historyDownloadApiPath","historyApiFunction","historyTypeFilterList"]))}}),tS={class:"trader-info"},aS={class:"trader-name-wrap"},lS={class:"trader-name"},sS={class:"powered-by-ai"},iS={class:"number-value"},nS={class:"currency"},rS={class:"trader-detail"},oS={class:"row-wrap"},uS={class:"data-label"},cS={class:"row-wrap"},dS={class:"data-label"},pS={class:"currency"},yS={class:"detail-button"},hS="*****",vS=vr(E({__name:"TraderList",setup(e){const{t:t}=I(),a=R((()=>[{id:"traderName",title:t("wallets.myLeaders"),textAlign:"left"},{id:"investment",title:t("t.marginBalance"),tip:t("wallets.copyTrading.tooltip.assetBalance"),textAlign:"right",sortable:!0}])),l=U(),o=ot(),u=O("investment"),c=O("desc"),f=R((()=>l.state.lang)),T=R((()=>l.state.now)),w=R((()=>l.state.hideWalletPriceValue)),A=O(-1),b=R((()=>u.value?o.wallet.wallets.slice().sort(((e,t)=>ri(+e[u.value],+t[u.value],"asc"===c.value))):o.wallet.wallets));function _({key:e,order:t}){u.value=e,c.value=t}return(e,t)=>{const l=s("ToolTip"),o=s("HeaderRow"),c=s("RouterLink"),S=s("Cell"),C=s("Row"),E=s("DataTable");
1return n(),i(E,{class:"trader-list-table",fixHeader:""},{header:g((()=>[m(o,{class:"row"},{default:g((()=>[(n(!0),r(p,null,x(a.value,(e=>(n(),i(cl,{key:e.id,class:L({[`align-${e.textAlign}`]:e.textAlign}),currentSortKey:u.value,defaultSortOrder:"desc",title:e,iconType:P(oi).triangle,onSort:_},D({_:2},[e.title?{name:"content",fn:g((()=>[v(h(e.title),1)])),key:"0"}:void 0,e.tip?{name:"tooltip",fn:g((()=>[m(l,{placement:"top"},{content:g((()=>[m(Fa,{class:"info-icon"})])),tooltip:g((()=>[y("span",null,h(e.tip),1)])),_:2},1024)])),key:"1"}:void 0]),1032,["class","currentSortKey","title","iconType"])))),128))])),_:1})])),body:g((()=>[0===b.value.length?(n(),i(C,{key:0,class:"no-data-section",index:-1,disableCssHoverEffect:"",disableBackground:""},{default:g((()=>[m(S,{textAlign:"center",colspan:a.value.length.toString()},{default:g((()=>[m(Zt,{class:"no-data-available"},{"empty-text":g((()=>[v(h(e.$t("t.noDataFound"))+" ",1),m(c,{class:"route-link",to:{name:P(Ke).AI_COPY_TRADING,params:{lang:f.value}}},{default:g((()=>[v(h(e.$t("t.startSomething",{action:e.$t("nav.aiCopyTrading")}))+" ",1),m(ht,{class:"icon-chevron-right",width:"16",height:"16"})])),_:1},8,["to"])])),_:1})])),_:1},8,["colspan"])])),_:1})):d("",!0),(n(!0),r(p,null,x(b.value,((t,l)=>(n(),r(p,{key:l},[m(C,{class:"trader-row",index:l,disableBackground:"",disableCssHoverEffect:"",onClick:e=>function(e){A.value=A.value===e?-1:e}(l)},{default:g((()=>[m(S,null,{default:g((()=>[y("div",tS,[m(ca,{class:L({active:A.value===l}),width:"12"},null,8,["class"]),y("div",aS,[y("div",lS,h(t.traderName),1),y("div",sS,h(e.$t("wallets.poweredByModel",{modelName:t.modelName})),1)])])])),_:2},1024),m(S,null,{default:g((()=>[y("span",iS,h(w.value?hS:P(Xt)(t.totalValue||t.investment,"wvc")),1),y("span",nS,h(P(Cs)),1)])),_:2},1024)])),_:2},1032,["index","onClick"]),A.value===l?(n(),i(C,{key:0,class:"trader-detail-row",index:l,disableBackground:"",disableCssHoverEffect:""},{default:g((()=>[m(S,{colspan:a.value.length.toString()},{default:g((()=>[y("div",rS,[y("div",oS,[y("div",uS,h(e.$t("t.duration")),1),y("div",null,h(P(ti)(P(ae)(Date.now()-t.duration),T.value)),1)]),y("div",cS,[y("div",dS,h(e.$t("wallets.realizedPnl")),1),y("div",null,[y("span",{class:L(["number-value",{"brand-color-positive":!w.value&&P(N)(t.realisedProfitLoss).gte(0),"brand-color-negative":!w.value&&P(N)(t.realisedProfitLoss).lt(0)}])},h(w.value?hS:P(Xs)(t.realisedProfitLoss,"wvc")),3),y("span",pS,h(P(Cs)),1)])]),m(c,{to:{name:P(Ke).AI_COPY_TRADING_PORTFOLIO,params:{lang:f.value}},target:"_blank"},{default:g((()=>[y("div",yS,h(e.$t("t.detail")),1)])),_:1},8,["to"])])])),_:2},1032,["colspan"])])),_:2},1032,["index"])):d("",!0)],64)))),128))])),_:1})}}}),[["__scopeId","data-v-bde19ddc"]]),mS={class:"trader-list"},gS={class:"model-name-cell"},fS={class:"model-name"},TS={class:"powered-by-ai"},wS={class:"number-value"},DS={class:"currency"},AS={class:"currency"},bS="*****",_S=vr(E({__name:"TraderList",setup(e){const{t:t}=I(),a=R((()=>[{id:"traderName",title:t("wallets.myLeaders"),textAlign:"left"},{id:"duration",title:t("t.duration"),textAlign:"left",sortable:!0},{id:"investment",title:t("t.marginBalance"),tip:t("wallets.copyTrading.tooltip.assetBalance"),textAlign:"right",sortable:!0},{id:"realisedProfitLoss",title:t("wallets.realizedPnl"),textAlign:"right",sortable:!0},{id:"detail",textAlign:"center",isActionBtn:!0}])),l=U(),o=ot(),u=O("investment"),c=O("desc"),f=R((()=>l.state.lang)),T=R((()=>l.state.now)),w=R((()=>l.state.hideWalletPriceValue)),A=R((()=>u.value?o.wallet.wallets.slice().sort(((e,t)=>ri(+e[u.value],+t[u.value],"asc"===c.value))):o.wallet.wallets));function b({key:e,order:t}){u.value=e,c.value=t}return(e,t)=>{const l=s("ToolTip"),o=s("HeaderRow"),c=s("RouterLink"),_=s("Cell"),S=s("Row"),C=s("DataTable");return n(),r("div",mS,[m(C,{class:"trader-list-table",fixHeader:""},{header:g((()=>[m(o,{class:"header-row"},{default:g((()=>[(n(!0),r(p,null,x(a.value,(e=>(n(),i(cl,{key:e.id,currentSortKey:u.value,defaultSortOrder:"desc",class:L({[`align-${e.textAlign}`]:e.textAlign,"action-btn":e.isActionBtn}),title:e,iconType:P(oi).triangle,onSort:b},D({_:2},[e.title?{name:"content",fn:g((()=>
1[v(h(e.title),1)])),key:"0"}:void 0,e.tip?{name:"tooltip",fn:g((()=>[m(l,{placement:"top"},{content:g((()=>[m(Fa,{class:"info-icon"})])),tooltip:g((()=>[y("span",null,h(e.tip),1)])),_:2},1024)])),key:"1"}:void 0]),1032,["currentSortKey","class","title","iconType"])))),128))])),_:1})])),body:g((()=>[0===A.value.length?(n(),i(S,{key:0,class:"no-data-section",index:-1,disableCssHoverEffect:"",disableBackground:""},{default:g((()=>[m(_,{textAlign:"center",colspan:a.value.length.toString()},{default:g((()=>[m(Zt,{class:"no-data-available"},{"empty-text":g((()=>[v(h(e.$t("t.noDataFound"))+" ",1),m(c,{class:"route-link",to:{name:P(Ke).AI_COPY_TRADING,params:{lang:f.value}}},{default:g((()=>[v(h(e.$t("t.startSomething",{action:e.$t("nav.aiCopyTrading")}))+" ",1),m(ht,{class:"icon-chevron-right",width:"16",height:"16"})])),_:1},8,["to"])])),_:1})])),_:1},8,["colspan"])])),_:1})):d("",!0),(n(!0),r(p,null,x(A.value,((t,a)=>(n(),i(S,{key:a,class:"trader-row",index:a,disableBackground:"",disableCssHoverEffect:""},{default:g((()=>[m(_,{textAlign:"left"},{default:g((()=>[y("div",gS,[y("div",fS,h(t.traderName),1),y("div",TS,h(e.$t("wallets.poweredByModel",{modelName:t.modelName})),1)])])),_:2},1024),m(_,{textAlign:"left"},{default:g((()=>[v(h(P(ti)(P(ae)(Date.now()-t.duration),T.value)),1)])),_:2},1024),m(_,null,{default:g((()=>[y("span",wS,h(w.value?bS:P(Xt)(t.totalValue||t.investment,"wvc")),1),y("span",DS,h(P(Cs)),1)])),_:2},1024),m(_,null,{default:g((()=>[y("span",{class:L(["number-value",{"brand-color-positive":!w.value&&P(N)(t.realisedProfitLoss).gte(0),"brand-color-negative":!w.value&&P(N)(t.realisedProfitLoss).lt(0)}])},h(w.value?bS:P(Xs)(t.realisedProfitLoss,"wvc")),3),y("span",AS,h(P(Cs)),1)])),_:2},1024),m(_,{class:"action-button-cell",textAlign:"center"},{default:g((()=>[m(c,{class:"detail-link",to:{name:P(Ke).AI_COPY_TRADING_PORTFOLIO,params:{lang:f.value}},target:"_blank"},{default:g((()=>[v(h(e.$t("t.detail")),1)])),_:1},8,["to"])])),_:1})])),_:2},1032,["index"])))),128))])),_:1})])}}}),[["__scopeId","data-v-f4e06138"]]),SS={class:"asset-list"},CS={class:"action-wrapper"},LS={class:"action-top"},ES={class:"asset-info"},IS={class:"asset-info-label"},kS={class:"asset-symbol"},RS={class:"asset-name"},NS={class:"asset-detail"},xS={class:"row-wrap"},PS={class:"data-label"},OS={class:"row-wrap"},$S={class:"data-label"},WS={class:"row-wrap"},FS={class:"data-label"},BS=vr(E({__name:"AssetList",setup(e){const{t:t}=I(),a=[{id:"asset",title:t("t.asset"),textAlign:"left"},{id:"totalValue",title:t("t.balance"),textAlign:"right",sortable:!0}],l=U(),o=ut(),u=O(""),c=O(El.ALL_ASSETS),f=O("contributionValueInUSDT"),T=O("desc"),w=R((()=>l.state.lang)),A=R((()=>l.state.hideConvertToBaseCurrencyValue)),b=R((()=>l.state.hideWalletSmallBalanceAiCopyTrading)),_=O(-1),S={[El.FIAT]:"isFiat",[El.STABLE_COINS]:"stableCoin",[El.CRYPTO_CURRENCY]:"isCrypto"},C=R((()=>{let e=o.wallet.assets??[];if(c.value!==El.ALL_ASSETS){const t=S[c.value];e=e.filter((e=>!0===E(e.shortName)[t]))}if(u.value){const t=u.value.toLowerCase().trim();e=e.filter((e=>{var a,l;const s=(null==(a=e.shortName)?void 0:a.toLowerCase())||"",i=(null==(l=e.fullName)?void 0:l.toLowerCase())||"";return s.includes(t)||i.includes(t)}))}return b.value&&!u.value&&(e=e.filter((e=>{const t=E(e.shortName).usdRate??0;return N(e.totalValue??0).times(t).toNumber()>=_l}))),f.value&&(e=e.slice().sort(((e,t)=>ri(Number(e[f.value]),Number(t[f.value]),"asc"===T.value)))),e}));function E(e){return l.state.currencyMap[e]||{}}function k({key:e,order:t}){f.value=e,T.value=t}return(e,t)=>{const l=s("HeaderRow"),o=s("Cell"),T=s("Row"),S=s("RouterLink"),I=s("Tooltip"),R=s("DataTable");return n(),r("div",SS,[y("div",CS,[y("div",LS,[m(Kr,{value:u.value,"onUpdate:value":t[0]||(t[0]=e=>u.value=e),class:"search-input",width:"180px",height:"40px",type:P(Il).BOX},null,8,["value","type"]),m(Vh,{filterKey:c.value,"onUpdate:filterKey":t[1]||(t[1]=e=>c.value=e),class:"wallet-filter"},null,8,["filterKey"])]),m(zh,{class:"wallet-is-convert-base",state:A.value},null,8,["state"]),m(qh,{class:"wallet-hide-small",type:"aiCopyTrading",state:b.value,isDisable:!!u.value},null,8,["state","isDisable"])]),m(R,{class:"asset-list-table",f
1ixHeader:""},{header:g((()=>[m(l,{class:"row"},{default:g((()=>[(n(),r(p,null,x(a,(e=>m(cl,{key:e.id,class:L({[`align-${e.textAlign}`]:e.textAlign}),currentSortKey:f.value,defaultSortOrder:"desc",title:e,iconType:P(oi).triangle,onSort:k},D({_:2},[e.title?{name:"content",fn:g((()=>[v(h(e.title),1)])),key:"0"}:void 0]),1032,["class","currentSortKey","title","iconType"]))),64))])),_:1})])),body:g((()=>[0===C.value.length?(n(),i(T,{key:0,class:"no-data-section",index:-1,disableCssHoverEffect:"",disableBackground:""},{default:g((()=>[m(o,{textAlign:"center",colspan:a.length.toString()},{default:g((()=>[m(Zt,{class:"no-data-available"},{"empty-text":g((()=>[v(h(e.$t("t.noDataFound")),1)])),_:1})])),_:1},8,["colspan"])])),_:1})):d("",!0),(n(!0),r(p,null,x(C.value,((l,s)=>(n(),r(p,{key:s},[m(T,{class:"asset-row",index:s,disableBackground:"",disableCssHoverEffect:"",onClick:e=>function(e){_.value=_.value===e?-1:e}(s)},{default:g((()=>[m(o,null,{default:g((()=>[y("div",ES,[m(ca,{class:L({active:_.value===s}),width:"12"},null,8,["class"]),m(Pa,{name:l.shortName,type:E(l.shortName).isFiat?"fiat":"icon",showName:!1,size:"18"},null,8,["name","type"]),y("div",IS,[y("div",kS,h(l.shortName),1),y("div",RS,h(l.fullName),1)])])])),_:2},1024),m(o,null,{default:g((()=>[m(By,{priceValue:l.totalValue,currencyName:l.shortName,isFiat:E(l.shortName).isFiat,hideConvertToBaseCurrencyValue:A.value},null,8,["priceValue","currencyName","isFiat","hideConvertToBaseCurrencyValue"])])),_:2},1024)])),_:2},1032,["index","onClick"]),_.value===s?(n(),i(T,{key:0,class:"asset-detail-row",index:s,disableBackground:"",disableCssHoverEffect:""},{default:g((()=>[m(o,{colspan:a.length.toString()},{default:g((()=>[y("div",NS,[y("div",xS,[y("div",PS,[v(h(e.$t("t.availableAssets"))+" ",1),m(I,{placement:"top",popover:!0},{content:g((()=>[m(Fa,{class:"info-icon"})])),tooltip:g((()=>[y("span",null,h(e.$t("wallets.futures.tooltip.totalAvailableAssetsTip")),1),t[2]||(t[2]=y("br",null,null,-1)),m(S,{class:"info-link",to:{name:P(Ke).TRADING_RULES,params:{lang:w.value,marketType:"collateral"}},target:"_blank"},{default:g((()=>[v(h(e.$t("wallets.futures.tooltip.totalAvailableAssetsTipLink")),1)])),_:1},8,["to"])])),_:1})]),y("div",null,[m(By,{priceValue:l.totalAvailableAssets,currencyName:l.shortName,isFiat:E(l.shortName).isFiat},null,8,["priceValue","currencyName","isFiat"])])]),y("div",OS,[y("div",$S,h(e.$t("t.availableForTransfer")),1),y("div",null,[m(By,{priceValue:l.availableForTransfer,currencyName:l.shortName,isFiat:E(l.shortName).isFiat},null,8,["priceValue","currencyName","isFiat"])])]),y("div",WS,[y("div",FS,[v(h(e.$t("wallets.futures.assetContribution"))+" ",1),m(I,{placement:"top"},{content:g((()=>[m(Fa,{class:"info-icon"})])),tooltip:g((()=>[v(h(e.$t("wallets.futures.tooltip.assetContributionTip")),1)])),_:1})]),y("div",null,[m(By,{priceValue:l.contributionValueInUSDT,currencyName:P(Cs),isFiat:E(P(Cs)).isFiat},null,8,["priceValue","currencyName","isFiat"])])])])])),_:2},1032,["colspan"])])),_:2},1032,["index"])):d("",!0)],64)))),128))])),_:1})])}}}),[["__scopeId","data-v-84261daa"]]),US={class:"asset-list"},MS={class:"action-wrapper"},VS={class:"wallet-actions"},HS={class:"flex-box items-center"},GS={class:"asset-symbol"},YS={class:"asset-name"},qS=vr(E({__name:"AssetList",setup(e){const{t:t}=I(),a=U(),l=ut(),o=O(""),u=O(El.ALL_ASSETS),c=O("investment"),f=O("desc"),T=R((()=>a.state.lang)),w=R((()=>a.state.hideConvertToBaseCurrencyValue)),A=R((()=>a.state.hideWalletSmallBalanceAiCopyTrading)),b=R((()=>[{id:"asset",title:t("t.asset"),textAlign:"left"},{id:"totalValue",title:t("t.balance"),textAlign:"right",sortable:!0},{id:"totalAvailableAssets",title:t("t.availableAssets"),tip:t("wallets.futures.tooltip.totalAvailableAssetsTip"),tipLink:{text:t("wallets.futures.tooltip.totalAvailableAssetsTipLink"),route:{name:Ke.TRADING_RULES,params:{lang:T.value,marketType:"collateral"}}},textAlign:"right",sortable:!0},{id:"availableForTransfer",title:t("t.availableForTransfer"),textAlign:"right",sortable:!0},{id:"contributionValueInUSDT",title:t("wallets.futures.assetContribution"),tip:t("wallets.futures.tooltip.assetContributionTip"),textAlign:"right",sortable:!0}])),_={[El.FIAT]:"isFiat",[El.STABLE_COINS]:"stableCoin",[El.CRYPTO_CURRENCY]:"isCrypto"},S=R((()=>{let e=l.wallet.assets??[];if(u.value!==El.ALL_ASSETS){const t=_[u.value];e=e.filter((e=>!0===C(e.shortName)[t]))}if(o.value){const t=o.value.toLowerCase().trim();e=e.filter((e=>{var a,l;const s=(null==(a=e.shortName)?void 0:a.toLowerCase())||"",i=(null==(l=e.fullName)?void 0:l.toLowerCase())||"";return s.includes(t)||i.includes(t)}))}return A.value&&!o.value&&(e=e.filter((e=>{const t=C(e.shortName).usdRate??0;return N(e.totalValue??0).times(t).toNumber()>=_l}))),c.value&&(e=e.slice().sort(((e,t)=>ri(Number(e[c.value]),Number(t[c.value]),"asc"===f.value)))),e}));function C(e){return a.state.currencyMap[e]||{}}function E({key:e,order:t}){c.value=e,f.value=t}return(e,t)=>{const a=s("RouterLink"),l=s("ToolTip"),f=s("HeaderRow"),T=s("Cell"),_=s("Row"),I=s("DataTable");return n(),r("div",US,[y("div",MS,[m(Kr,{id:P(Xe)("input_search"),value:o.value,"onUpdate:value":t[0]||(t[0]=e=>o.value=e),width:"252px",height:"32px"},null,8,["id","value"]),m(Iv,{filterKey:u.value,"onUpdate:filterKey":t[1]||(t[1]=e=>u.value=e),class:"wallet-filter"},null,8,["filterKey"]),y("div",VS,[m(zh,{state:w.value},null,8,["state"]),m(qh,{class:"wallet-hide-small",type:"aiCopyTrading",state:A.value,isDisable:!!o.value},null,8,["state","isDisable"])])]),m(I,{class:"asset-list-table",f
1ixHeader:""},{header:g((()=>[m(f,{class:"header-row"},{default:g((()=>[(n(!0),r(p,null,x(b.value,(e=>(n(),i(cl,{key:e.id,currentSortKey:c.value,defaultSortOrder:"desc",class:L({[`align-${e.textAlign}`]:e.textAlign,"action-btn":e.isActionBtn}),title:e,iconType:P(oi).triangle,onSort:E},D({_:2},[e.title?{name:"content",fn:g((()=>[v(h(e.title),1)])),key:"0"}:void 0,e.tip?{name:"tooltip",fn:g((()=>[m(l,{placement:"top",popover:!!e.tipLink},{content:g((()=>[m(Fa,{class:"info-icon"})])),tooltip:g((()=>[y("span",null,h(e.tip),1),e.tipLink?(n(),r(p,{key:0},[t[2]||(t[2]=y("br",null,null,-1)),e.tipLink?(n(),i(a,{key:0,class:"info-link",to:e.tipLink.route,target:"_blank"},{default:g((()=>[v(h(e.tipLink.text),1)])),_:2},1032,["to"])):d("",!0)],64)):d("",!0)])),_:2},1032,["popover"])])),key:"1"}:void 0]),1032,["currentSortKey","class","title","iconType"])))),128))])),_:1})])),body:g((()=>[0===S.value.length?(n(),i(_,{key:0,class:"no-data-section",index:-1,disableCssHoverEffect:"",disableBackground:""},{default:g((()=>[m(T,{textAlign:"center",colspan:b.value.length.toString()},{default:g((()=>[S.value.length?d("",!0):(n(),i(Zt,{key:0,class:"no-data-available"},{"empty-text":g((()=>[v(h(e.$t("t.noDataFound")),1)])),_:1}))])),_:1},8,["colspan"])])),_:1})):d("",!0),(n(!0),r(p,null,x(S.value,((e,t)=>(n(),i(_,{key:t,class:"asset-row",index:t,disableBackground:"",disableCssHoverEffect:""},{default:g((()=>[m(T,{textAlign:"left"},{default:g((()=>[y("div",HS,[m(Pa,{name:e.shortName,type:C(e.shortName).isFiat?"fiat":"icon",showName:!1,size:"16"},null,8,["name","type"]),y("span",GS,h(e.shortName),1),y("span",YS,h(e.fullName),1)])])),_:2},1024),m(T,null,{default:g((()=>[m(By,{priceValue:e.totalValue,currencyName:e.shortName,isFiat:C(e.shortName).isFiat,hideConvertToBaseCurrencyValue:w.value},null,8,["priceValue","currencyName","isFiat","hideConvertToBaseCurrencyValue"])])),_:2},1024),m(T,null,{default:g((()=>[m(By,{priceValue:e.totalAvailableAssets,currencyName:e.shortName,isFiat:C(e.shortName).isFiat},null,8,["priceValue","currencyName","isFiat"])])),_:2},1024),m(T,null,{default:g((()=>[m(By,{priceValue:e.availableForTransfer,currencyName:e.shortName,isFiat:C(e.shortName).isFiat},null,8,["priceValue","currencyName","isFiat"])])),_:2},1024),m(T,null,{default:g((()=>[m(By,{priceValue:e.contributionValueInUSDT,currencyName:P(Cs),isFiat:C(P(Cs)).isFiat},null,8,["priceValue","currencyName","isFiat"])])),_:2},1024)])),_:2},1032,["index"])))),128))])),_:1})])}}}),[["__scopeId","data-v-10467f40"]]),zS={key:0,class:"switcher-wrapper"},KS={class:"list-wrap"},jS=vr(E({__name:"WalletAiCopyTrading",setup(e){const t=U(),a=M(),l=V(),o=ot(),u=ut(),c=ze(),{t:T}=I(),w=ka(),D={LEAD_TRADING:Ye.AI_LEAD_TRADING,COPY_TRADING:Ye.AI_COPY_TRADING},A={[Ke.WALLET_AI_LEAD_TRADING]:D.LEAD_TRADING,[Ke.WALLET_AI_COPY_TRADING]:D.COPY_TRADING,[D.LEAD_TRADING]:Ke.WALLET_AI_LEAD_TRADING,[D.COPY_TRADING]:Ke.WALLET_AI_COPY_TRADING},b=O(!0),_=O(D.COPY_TRADING),S=R((()=>t.state.lang)),L=R((()=>c.displayCurrency??void 0)),E=R((()=>[{id:D.LEAD_TRADING,title:T("nav.aiLeadTrading")},{id:D.COPY_TRADING,title:T("nav.aiCopyTrading")}])),k=R((()=>E.value.map((({title:e})=>e)))),N=R((()=>E.value.findIndex((({id:e})=>e===_.value)))),x=R((()=>u.isEnableAiLeadTradingWallet&&w.isMobile)),W=R((()=>l.name===Ke.WALLET_AI_COPY_TRADING)),F=R((()=>W.value?T("wallets.aiCopyTradingWallet"):T("wallets.aiLeadTradingWallet"))),B=R((()=>W.value?pi:yi));function H(e){a.push({name:A[E.value[e].id],params:{lang:S.value}})}return $((()=>l.name),((e,t,a)=>{A[_.value]&&A[_.value]!==e&&(_.value=A[e]),b.value=!0;(e===Ke.WALLET_AI_COPY_TRADING?o:u).update(!0).then((()=>{b.value=!1})),a((()=>{o.removeTimer(),u.removeTimer()}))}),{immediate:!0}),(e,t)=>{const a=s("RouterLink"),l=C("loading");return n(),r(p,null,[x.value?(n(),r("div",zS,[m(Pl,{barHeight:4,type:P(xl).BOTTOM_BAR_NARROW,theme:P(Nl).compact,itemList:k.value,selected:N.value,onSelect:H},null,8,["type","theme","itemList","selected"])])):d("",!0),m(Sy,{type:_.value,title:F.value,featuresList:B.value,useWalletBalanceInfo:"",displayCurrency:L.value},{"header-link":g((()=>[W.value?(n(),i(a,{key:0,class:"title-section-link",to:{name:P(Ke).AI_COPY_TRADING,params:{lang:S.value}}},{default:g((()=>[v(h(e.$t("t.goToSomewhere",{page:e.$t("nav.aiCopyTrading")}))+" ",1),m(ht,{class:"icon-chevron-right",width:"16",height:"16"})])),_:1},8,["to"])):d("",!0)])),mobile:g((()=>[y("div",KS,[W.value?f((n(),i(vS,{key:0},null,512)),[[l,b.value]]):f((n(),i(BS,{key:1},null,512)),[[l,b.value]])])])),desktop:g((()=>[W.value?f((n(),i(_S,{key:0},null,512)),[[l,b.value]]):f((n(),i(qS,{key:1},null,512)),[[l,b.value]])])),_:1},8,["type","title","featuresList","displayCurrency"])],64)}}}),[["__scopeId","data-v-9ee58e47"]]),XS={class:"bot-info"},QS={class:"bot-info-label"},ZS={class:"bot-label-wrap"},JS={class:"label-group-wrap"},eC={class:"leverage-label"},tC={class:"bot-id"},aC={class:"currency"},lC={class:"bot-detail"},sC={class:"row-wrap"},iC={class:"data-label"},nC={class:"number-value"},rC={class:"currency"},oC={class:"row-wrap"},uC={class:"data-label"},cC={class:"number-value"},dC={class:"currency"},pC={class:"row-wrap"},yC={class:"data-label"},hC={class:"row-wrap"},vC={class:"data-label"},mC={class:"number-value"},gC={class:"currency"},fC={class:"row-wrap"},TC={class:"data-label"},wC={class:"detail-button"},DC="*****",AC=vr({__name:"BotList",setup(e){const t=[{id:"activeBots",lang:"wallets.activeBots",textAlign:"left"},{id:"totalProfit",lang:"t.totalP&L",textAlign:"right",sortable:!0}],a=U(),{t:l}=I(),o=O(!0),u=O(null),c=O("DESC"),f=O({currentPage:1,totalRows:0,totalPages:0}),T=O(-1),w=O([]),D=R((()=>a.state.lang)),A=R((()=>a.state.now)),b=R((()=>a.state.futures.walletMap)),_=R((()=>a.state.hideWalletPriceValue)),S=R((()=>w.value.map((e=>{const t=b.value,{walleKeyPrefix:a,walleKeyPostfix:l}=e,s=`${a}-USDT#${l}`,i=t[`${a}-USD#${l}
1`]||t[s],n=(null==i?void 0:i.assets[0])||{};return{...e,asset:n.balance||0,assetSymbol:n.currency||""}}))));function C({key:e,order:t}){o.value||(u.value=e,c.value=t,f.value.currentPage=1,E(!0))}async function E(e=!1){o.value=!0;try{const{data:{tradingBots:t=[],totalPages:a=0,totalRows:l=0}}=await hi.getTradingBotsCustomParams({marketType:"FUTURES",sorting:`${u.value||"createdAt"}:${c.value.toUpperCase()}`,page:f.value.currentPage,pageSize:10});f.value.totalRows=l,f.value.totalPages=a;const s=t.map((e=>{var t,a;const l=e.detail.walletName.split("-");return e.virtualWalletKey=e.detail.walletName,e.walleKeyPrefix=l.slice(0,-1).join("-"),e.walleKeyPostfix=(null==(a=null==(t=l.slice(-1)[0])?void 0:t.split("#"))?void 0:a.slice(-1))||"",e.asset=0,e.assetSymbol="",e.botMargin=e.detail.botMargin,e.initialMargin=e.detail.initialMargin,e.initialLeverage=e.detail.initialLeverage,e}));w.value=e?s:w.value.concat(s)}catch(t){}o.value=!1}function k(){o.value||f.value.totalPages<=f.value.currentPage||(f.value.currentPage=f.value.currentPage+1,E())}return $((()=>a.state.accountInfo.uid),((e,t)=>{e&&t&&e!==t&&E()})),j((()=>E())),(e,o)=>{const c=s("HeaderRow"),f=s("Cell"),w=s("Row"),b=s("RouterLink"),E=s("DataTable");return n(),r(p,null,[m(E,{class:"investment-list-table",fixHeader:""},{header:g((()=>[m(c,{class:"row"},{default:g((()=>[(n(),r(p,null,x(t,(t=>m(P(cl),{key:t.id,class:L({[`align-${t.textAlign}`]:t.textAlign}),currentSortKey:u.value,defaultSortOrder:"desc",title:t,iconType:"triangle",onSort:C},{content:g((()=>[v(h(t.lang?e.$t(t.lang):""),1)])),_:2},1032,["class","currentSortKey","title"]))),64))])),_:1})])),body:g((()=>[0===S.value.length?(n(),i(w,{key:0,class:"no-data-section",index:-1,disableCssHoverEffect:"",disableBackground:""},{default:g((()=>[m(f,{textAlign:"center",colspan:t.length.toString()},{default:g((()=>[m(P(Zt),{class:"no-data-available",emptyText:e.$t("t.noDataFound")},null,8,["emptyText"])])),_:1},8,["colspan"])])),_:1})):d("",!0),(n(!0),r(p,null,x(S.value,((s,o)=>(n(),r(p,{key:o},[m(w,{class:"bot-row",index:o,disableBackground:"",disableCssHoverEffect:"",onClick:e=>function(e){T.value=T.value===e?-1:e}(o)},{default:g((()=>[m(f,null,{default:g((()=>{return[y("div",XS,[m(P(ca),{class:L({active:T.value===o}),width:"12"},null,8,["class"]),m(P(Pa),{name:s.baseCurrency,type:(i=s.baseCurrency,a.state.currencyMap[i]||{}).isFiat?"fiat":"icon",showName:!1,size:"18"},null,8,["name","type"]),y("div",QS,[y("div",ZS,[v(h(s.symbol)+" ",1),y("div",JS,[y("span",{class:L(["direction-label",{long:"LONG"===s.direction,short:"SHORT"===s.direction}])},h((t=s.direction,l("LONG"===t?"t.long":"SHORT"===t?"t.short":"t.neutral"))),3),y("span",eC,h(P(N)(s.initialLeverage).toFixed(2,P(N).ROUND_DOWN))+"x ",1)])]),y("div",tC,h(e.$t("t.futuresGrid")),1)])])];var t,i})),_:2},1024),m(f,null,{default:g((()=>[y("span",{class:L(["number-value",{"brand-color-positive":!_.value&&P(N)(s.totalProfitInUsdt).gte(0),"brand-color-negative":!_.value&&P(N)(s.totalProfitInUsdt).lt(0)}])},h(_.value?DC:P(Xs)(s.totalProfitInUsdt,"wvc")),3),y("span",aC,h(P(Cs)),1)])),_:2},1024)])),_:2},1032,["index","onClick"]),T.value===o?(n(),i(w,{key:0,class:"bot-detail-row",index:o,disableBackground:"",disableCssHoverEffect:""},{default:g((()=>[m(f,{colspan:t.length.toString()},{default:g((()=>[y("div",lC,[y("div",sC,[y("div",iC,h(e.$t("t.asset")),1),y("div",null,[s.assetSymbol?(n(),r(p,{key:0},[y("span",nC,h(_.value?DC:P(Xt)(s.asset,"wvc")),1),y("span",rC,h(s.assetSymbol),1)],64)):(n(),r(p,{key:1},[v("-")],64))])]),y("div",oC,[y("div",uC,h(e.$t("trading.botMargin")),1),y("div",null,[y("span",cC,h(_.value?DC:P(Xt)(s.botMargin,"wvc")),1),y("span",dC,h(P(Cs)),1)])]),y("div",pC,[y("div",yC,h(e.$t("trading.leaderboard.roi")),1),y("div",null,[y("span",{class:L(["number-value",{"brand-color-positive":!_.value&&P(N)(s.totalRoi).gte(0),"brand-color-negative":!_.value&&P(N)(s.totalRoi).lt(0)}])},h(_.value?DC:P(Xs)(s.totalRoi))+"% ",3)])]),y("div",hC,[y("div",vC,h(e.$t("t.initialMargin")),1),y("div",null,[y("span",mC,h(_.value?DC:P(Xt)(s.initialMargin,"wvc")),1),y("span",gC,h(P(Cs)),1)])]),y("div",fC,[y("div",TC,h(e.$t("t.duration")),1),y("div",null,h(P(ti)(s.createdAt,A.value)),1)]),m(b,{to:{name:"futuresId",params:{lang:D.value,id:s.symbol},state:{tabType:P(zr).BOT}},target:"_blank"},{default:g((()=>[y("div",wC,h(e.$t("t.detail")),1)])),_:2},1032,["to"])])])),_:2},1032,["colspan"])])),_:2},1032,["index"])):d("",!0)],64)))),128))])),_:1}),m(P(bs),{onLoadMore:k})],64)}}},[["__scopeId","data-v-c22914b8"]]),bC={class:"investment-list"},_C={class:"bot-info"},SC={class:"bot-label"},CC={class:"leverage-label"},LC={class:"bot-id"},EC={class:"number-value"},IC={class:"currency"},kC={class:"number-value"},RC={class:"currency"},NC={class:"currency"},xC={class:"number-value"},PC={class:"currency"},OC="*****",$C=vr({__name:"BotList",setup(e){const t=[{id:"activeBots",lang:"wallets.activeBots",textAlign:"left"},{id:"asset",lang:"t.asset",textAlign:"right"},{id:"botMargin",lang:"trading.botMargin",textAlign:"right"},{id:"totalProfit",lang:"t.totalP&L",textAlign:"right",sortable:!0},{id:"botRoi",lang:"trading.leaderboard.roi",textAlign:"right",sortable:!0},{id:"initialMargin",lang:"t.initialMargin",textAlign:"right",sortable:!0},{id:"createdAt",lang:"t.duration",textAlign:"left",sortable:!0},{id:"detail",textAlign:"center",isActionBtn:!0}],a=U(),{t:l}=I(),o=O(!1),u=O(null),c=O("DESC"),T=O({currentPage:1,totalRows:0,totalPages:0}),w=O([]),A=R((()=>a.state.lang)),b=R((()=>a.state.now)),_=R((()=>a.state.futures.walletMap)),S=R((()=>a.state.hideWalletPriceValue)),E=R((()=>`${l("trading.bot.grid.matchedProfits")} + ${l("trading.bot.grid.unmatchedP&L")}`)),k=R((()=>w.value.map((e=>{const t=_.value,{walleKeyPrefix:a,walleKeyPostfix:l}=e,s=`${a}-USDT#${l}`,i=t[`${a}-USD#${l}
1`]||t[s],n=(null==i?void 0:i.assets[0])||{};return{...e,asset:n.balance||0,assetSymbol:n.currency||""}}))));function W({key:e,order:t}){o.value||(u.value=e,c.value=t,T.value.currentPage=1,F())}async function F(){o.value=!0;try{const{data:{tradingBots:e=[],totalPages:t=0,totalRows:a=0}}=await hi.getTradingBotsCustomParams({marketType:"FUTURES",sorting:`${u.value||"createdAt"}:${c.value.toUpperCase()}`,page:T.value.currentPage,pageSize:10});T.value.totalRows=a,T.value.totalPages=t,w.value=e.map((e=>{var t,a;const l=e.detail.walletName.split("-");return e.virtualWalletKey=e.detail.walletName,e.walleKeyPrefix=l.slice(0,-1).join("-"),e.walleKeyPostfix=(null==(a=null==(t=l.slice(-1)[0])?void 0:t.split("#"))?void 0:a.slice(-1))||"",e.asset=0,e.assetSymbol="",e.botMargin=e.detail.botMargin,e.initialMargin=e.detail.initialMargin,e.initialLeverage=e.detail.initialLeverage,e}))}catch(e){}o.value=!1}function B(e){o.value||(T.value.currentPage=e,F())}return $((()=>a.state.accountInfo.uid),((e,t)=>{e&&t&&e!==t&&F()})),j((()=>F())),(e,c)=>{const w=s("ToolTip"),_=s("HeaderRow"),I=s("RouterLink"),R=s("Cell"),O=s("Row"),$=s("DataTable"),F=C("loading");return n(),r("div",bC,[f((n(),i($,{class:"investment-list-table",fixHeader:""},{header:g((()=>[m(_,{class:"header-row"},{default:g((()=>[(n(),r(p,null,x(t,(t=>m(P(cl),{key:t.id,currentSortKey:u.value,defaultSortOrder:"desc",class:L({[`align-${t.textAlign}`]:t.textAlign,"action-btn":t.isActionBtn}),title:t,iconType:"triangle",onSort:W},D({content:g((()=>[v(h(t.lang?e.$t(t.lang):""),1)])),_:2},["totalProfit"===t.id?{name:"tooltip",fn:g((()=>[m(w,{placement:"top"},{content:g((()=>[m(P(Fa),{class:"info-icon"})])),tooltip:g((()=>[y("span",null,h(E.value),1)])),_:1})])),key:"0"}:void 0]),1032,["currentSortKey","class","title"]))),64))])),_:1})])),body:g((()=>[o.value||0===k.value.length?(n(),i(O,{key:0,class:"no-data-section",index:-1,disableCssHoverEffect:"",disableBackground:""},{default:g((()=>[m(R,{textAlign:"center",colspan:t.length.toString()},{default:g((()=>[0===k.value.length?(n(),i(Zt,{key:0,class:"no-data-available"},{"empty-text":g((()=>[v(h(e.$t("t.noDataFound")),1)])),"extra-behavior":g((()=>[m(I,{class:"route-link",to:{name:"futuresId",params:{lang:A.value,id:"BTC-PERP"},state:{tradeType:P(li).GRID}}},{default:g((()=>[v(h(e.$t("t.goToSomewhere",{page:e.$t("wallets.futuresBotsTrading")}))+" ",1),m(P(ht),{class:"icon-chevron-right",width:"16",height:"16"})])),_:1},8,["to"])])),_:1})):d("",!0)])),_:1},8,["colspan"])])),_:1})):d("",!0),(n(!0),r(p,null,x(k.value,((t,s)=>(n(),i(O,{key:s,class:"bot-row",index:s,disableBackground:!0,disableCssHoverEffect:!0},{default:g((()=>[m(R,null,{default:g((()=>{return[y("div",_C,[y("div",SC,[m(P(Pa),{name:t.baseCurrency,type:(i=t.baseCurrency,a.state.currencyMap[i]||{}).isFiat?"fiat":"icon",showName:!1,size:"16"},null,8,["name","type"]),v(" "+h(t.symbol)+" ",1),y("span",{class:L(["direction-label",{long:"LONG"===t.direction,short:"SHORT"===t.direction}])},h((s=t.direction,l("LONG"===s?"t.long":"SHORT"===s?"t.short":"t.neutral"))),3),y("span",CC,h(P(N)(t.initialLeverage).toFixed(2,P(N).ROUND_DOWN))+"x ",1)]),y("div",LC,h(e.$t("t.futuresGrid")),1)])];var s,i})),_:2},1024),m(R,null,{default:g((()=>[t.assetSymbol?(n(),r(p,{key:0},[y("span",EC,h(S.value?OC:P(Xt)(t.asset,"wvc")),1),y("span",IC,h(t.assetSymbol),1)],64)):(n(),r(p,{key:1},[v("-")],64))])),_:2},1024),m(R,null,{default:g((()=>[y("span",kC,h(S.value?OC:P(Xt)(t.botMargin,"wvc")),1),y("span",RC,h(P(Cs)),1)])),_:2},1024),m(R,null,{default:g((()=>[y("span",{class:L(["number-value",{"brand-color-positive":!S.value&&P(N)(t.totalProfitInUsdt).gte(0),"brand-color-negative":!S.value&&P(N)(t.totalProfitInUsdt).lt(0)}])},h(S.value?OC:P(Xs)(t.totalProfitInUsdt,"wvc")),3),y("span",NC,h(P(Cs)),1)])),_:2},1024),m(R,null,{default:g((()=>[y("span",{class:L(["number-value",{"brand-color-positive":!S.value&&P(N)(t.totalRoi).gte(0),"brand-color-negative":!S.value&&P(N)(t.totalRoi).lt(0)}])},h(S.value?OC:P(Xs)(t.totalRoi))+"% ",3)])),_:2},1024),m(R,null,{default:g((()=>[y("span",xC,h(S.value?OC:P(Xt)(t.initialMargin,"wvc")),1),y("span",PC,h(P(Cs)),1)])),_:2},1024),m(R,{textAlign:"left"},{default:g((()=>[v(h(P(ti)(t.createdAt,b.value)),1)])),_:2},1024),m(R,{class:"action-button-cell",textAlign:"center"},{default:g((()=>[m(I,{class:"detail-link",to:{name:"futuresId",params:{lang:A.value,id:t.symbol},state:{tabType:P(zr).BOT}}},{default:g((()=>[v(h(e.$t("t.detail")),1)])),_:2},1032,["to"])])),_:2},1024)])),_:2},1032,["index"])))),128))])),_:1})),[[F,o.value]]),m(P(As),{class:"pagination",layout:"prev, pager, next, jumper",total:T.value.totalRows,pageSize:10,totalPages:T.value.totalPages,currentPage:T.value.currentPage,pagerCount:5,background:!1,onHandleCurrentChangeP:B},null,8,["total","totalPages","currentPage"])])}}},[["__scopeId","data-v-60559f40"]]),WC={__name:"WalletFuturesBots",setup(e){const t="activeBots",a="assets",l=rt(),s=ze(),{t:r}=I(),o=O(!0),u=O(0),c=R((()=>s.displayCurrency)),p=R((()=>[{key:t,label:r("wallets.activeBots")},{key:a,label:r("wallets.assets")}])),y=R((()=>p.value[u.value].key)),h=R((()=>l.totalBalanceInDisplayCurrency)),v=R((()=>l.wallet.assets||[]));function m(e){u.value=e}return j((()=>l.update(!0).then((()=>{o.value=!1})))),q((()=>l.removeTimer())),(e,l)=>(n(),i(Sy,{type:"futuresBots",title:e.$t("wallets.futuresBotsWallet"),featuresList:P(vi),totalBalance:h.value,tabList:p.value,selectedTabIndex:u.value,displayCurrency:c.value,useWalletBalanceInfo:"",onTabSelected:m},{mobile:g((()=>[(n(),i(Z,null,[y.value===t?(n(),i(AC,{key:0})):y.value===a?(n(),i($A,{key:1,type:"futuresBots",isLoading:o.value,assetList:v.value},null,8,["isLoading","assetList"])):d("",!0)],1024))])),desktop:g((()=>[(n(),i(Z,null,[y.value===t?(n(),i($C,{key:0})):y.value===a?(n(),i($A,{key:1,type:"futuresBots",isLoading:o.value,assetList:v.value},null,8,["isLoading","assetList"])):d("",!0)],1024))])),_:1},8,["title","featuresList","totalBalance","tabList","selectedTabIndex","displayCurrency"]))}},FC=vr({__name:"FuturesBotsInfoText",props:{history:{type:Object,default:()=>({})}},setup(e){const{t:t}=I();return(a,l)=>{const i=s("ToolTip");return n(),r("div",null,[v(h((u=e.history.operation,"OPEN"===u?t("msg.create"):"CLOSE"===u?t("t.stop"):void 0))+" "+h(e.history.contractName)+" "+h(a.$t("t.futuresGrid"))+" "+h((o=e.history.direction,t("LONG"===o?"t.long":"SHORT"===o?"t.short":"t.neutral")))+" "+h(P(N)(e.history.leverage).toFixed(2,P(N).ROUND_DOWN))+"x ",1),m(i,{placement:"top"},{content:g((()=>[m(P(Fa),{class:"info-icon",width:"12"})])),tooltip:g((()=>[y("span",null,h(e.history.orderId),1)])),_:1})]);var o,u}}},[["__scopeId","data-v-e1992bf1"]]),BC={class:"futures-bots-history"},UC={class:"time-label"},MC={class:"operation-wrap"},VC={class:"row-wrap"},HC={class:"data-label"},GC={class:"row-wrap"},YC={class:"data-label"},qC={class:"description"},zC=vr({__name:"FuturesBotsHistoryBlock",props:{history:{type:Object,default:()=>({})}},setup(e){const t=e,a=O(!1),l=R((()=>ii(t.history.type))),s=R((()=>di(t.history)));function o(){a.value=!a.value}return(t,u)=>(n(),r("div",BC,[y("div",{class:"row-wrap pointer",onClick:o},[y("div",UC,h(P(Ra)(e.history.dateTime)),1),y("div",MC,[v(h(l.value)+" ",1),m(ca,{class:L(["icon-chevron",{active:a.value}])},null,8,["class"])])]),a.value?(n(),r(p,{key:0},[y("div",VC,[y("span",HC,h(t.$t("t.currency")),1),v(" "+h(e.history.currency),1)]),y("div",GC,[y("span",YC,h(t.$t("t.amount")),1),v(" "+h(P(Xt)(e.history.netAmount,e.history.fiat?"24":"wvc")),1)]),y("div",qC,[40005===e.history.type?(n(),r(p,{key:0},[["OPEN","CLOSE"].includes(e.history.operation)?(n(),i(FC,{key:0,class:"row-wrap",history:e.history},null,8,["history"])):d("",!0),y("div",null,h(s.value),1)],64)):888===e.history.type?(n(),i(FC,{key:1,class:"row-wrap",history:e.history},null,8,["history"])):106===e.history.type?(n(),r(p,{key:2},[v(h(e.history.description.replace("LIQUIDATED",l.value)),1)],64)):108===e.history.type?(n(),r(p,{key:3},[v(h(t.$t("futuresMain.walletHistory.description_RealizedPnl",{n:e.history.contractName})),1)],64)):110===e.history.type?(n(),r(p,{key:4},[v(h(t.$t("futuresMain.walletHistory.description_Funding",{n:e.history.contractName})),1)],64)):d("",!0)])],64)):d("",!0)]))}},[["__scopeId","data-v-10e2bc1e"]]),KC={key:1}
1,jC={key:0},XC=vr({__name:"FuturesBotsHistoryRow",props:{index:{type:Number,required:!0},data:{type:Object,default:()=>({})}},setup(e){const t=e,a=R((()=>ii(t.data.type))),l=R((()=>di(t.data)));return(t,o)=>{const u=s("Cell"),c=s("Row");return n(),i(c,{class:"futures-bots-history-row",index:e.index,disableBackground:""},{default:g((()=>[m(u,{textAlign:"left"},{default:g((()=>[v(h(P(Ra)(e.data.dateTime)),1)])),_:1}),m(u,{textAlign:"left"},{default:g((()=>[e.data.currency?(n(),i(Pa,{key:0,type:e.data.fiat?"fiat":"icon",name:e.data.currency,size:"16",shortName:""},null,8,["type","name"])):(n(),r("div",KC,"-"))])),_:1}),m(u,{textAlign:"left"},{default:g((()=>[v(h(a.value),1)])),_:1}),m(u,{textAlign:"right"},{default:g((()=>[v(h(P(Xt)(e.data.netAmount,e.data.fiat?"24":"wvc")),1)])),_:1}),m(u,{textAlign:"left"},{default:g((()=>[40005===e.data.type?(n(),r("div",jC,[["OPEN","CLOSE"].includes(e.data.operation)?(n(),i(FC,{key:0,class:"row-wrap",history:e.data},null,8,["history"])):d("",!0),y("div",null,h(l.value),1)])):888===e.data.type?(n(),i(FC,{key:1,class:"row-wrap",history:e.data},null,8,["history"])):106===e.data.type?(n(),r(p,{key:2},[v(h(e.data.description.replace("LIQUIDATED",a.value)),1)],64)):108===e.data.type?(n(),r(p,{key:3},[v(h(t.$t("futuresMain.walletHistory.description_RealizedPnl",{n:e.data.contractName})),1)],64)):110===e.data.type?(n(),r(p,{key:4},[v(h(t.$t("futuresMain.walletHistory.description_Funding",{n:e.data.contractName})),1)],64)):d("",!0)])),_:1})])),_:1},8,["index"])}}},[["__scopeId","data-v-23072185"]]),QC={__name:"FuturesBotsHistory",props:{list:{type:Array,default:()=>[]},pagination:{type:Object,default:()=>({currentPage:1,pageSize:10,totalRows:0,totalPages:0})}},emits:["pageChange"],setup(e,{emit:t}){const a=t;function l(e){a("pageChange",e)}return(t,a)=>(n(),i(P(Ib),{dataColumns:7,isEmpty:0===e.list.length,pagination:e.pagination,onPageChange:l},{body:g((()=>[(n(!0),r(p,null,x(e.list,((e,t)=>(n(),i(P(XC),{key:t,index:t,data:e},null,8,["index","data"])))),128))])),_:1},8,["isEmpty","pagination"]))}},ZC={__name:"WalletFuturesBotsHistory",setup(e){const{t:t}=I(),a=R((()=>({backRouteName:Ke.WALLET_FUTURES_BOTS,linkText:t("wallet.backToFuturesBotsWallet"),headerTitle:t("router.futuresBotsWalletHistory")}))),l=R((()=>{const e=[];return Object.values(mi).forEach((a=>{switch(a){case mi.ALL_TYPES:return;case mi.REALIZED_PNL:e.push({name:t("t.trade"),value:a});break;default:e.push({name:t(`futuresMain.walletHistory.typeMap.${a}`),value:a})}})),e}));function s(e){return e.historyTypes&&(e.types=e.historyTypes,delete e.historyTypes),$a.getFuturesBotsWalletHistory(e)}return(e,t)=>(n(),i(db,{headerBackLinkConfig:a.value,historyDownloadApiPath:"report/histories/tradingbotWallet",historyApiFunction:s,historyTypeFilterList:l.value},{mobileBlock:g((({history:e})=>[m(zC,{history:e},null,8,["history"])])),desktopList:g((({list:e,pagination:t,handlePageChange:a})=>[m(QC,{list:e,pagination:t,onPageChange:a},null,8,["list","pagination","onPageChange"])])),_:1},8,["headerBackLinkConfig","historyTypeFilterList"]))}},JC={class:"pnl-summary-block"},eL={class:"balance-block"},tL={class:"balance-label"},aL={class:"balance-value-wrap"},lL={class:"balance-value"},sL={class:"currency"},iL={class:"pnl-label"},nL={class:"pnl-value-wrap"},rL={class:"currency"},oL=vr({__name:"WalletPnlSummaryBlock",props:{type:{type:String,default:Ye.AUTO_TRADER}},setup(e){const t=U(),a=pt(),l=dt(),o=ct(),u=ut(),c=ot(),f=rt(),T=nt(),w=ra(),D=ze(),{t:A}=I();function b(e){const[t,a]=ua({rangeSize:e,nowDateOffset:-1});return{fromTimestamp:t.getTime(),toTimestamp:a.getTime()}}const _=e,S=R((()=>t.state.hideWalletPriceValue)),C=R((()=>D.displayCurrency)),E=R((()=>_.type===Ye.EARN)),k=R((()=>{switch(_.type){case Ye.SPOT:return t.getters.getAccountValue("totalInDisplayCurrency");case Ye.FUTURES:return t.getters.futuresBalance("totalInDisplayCurrency");case Ye.AUTO_TRADER:return a.totalBalanceInDisplayCurrency;case Ye.LEAD_TRADING:return l.totalBalanceInDisplayCurrency;case Ye.COPY_TRADING:return o.totalBalanceInDisplayCurrency;case Ye.AI_LEAD_TRADING:return u.totalBalanceInDisplayCurrency;case Ye.AI_COPY_TRADING:return c.totalBalanceInDisplayCurrency;case Ye.FUTURES_BOTS:return f.totalBalanceInDisplayCurrency;case Ye.EARN:return T.totalBalanceInDisplayCurrency;default:return"-"}})),O=R((()=>_.type===Ye.EARN?[{label:A("wallets.earn.yesterdayInterestEarned"),value:$(b(1))},{label:A("t.dayInterestEarned",{day:7}),value:$(b(7))},{label:A("t.dayInterestEarned",{day:30}),value:$(b(30))},{label:A("t.allInterestEarned"),value:T.totalInterestInDisplayCurrency}]:[{label:A("t.yesterdayPnl"),value:$(b(1))},{label:`${A("t.dayPnl",{day:7})}`,value:$(b(7))},{label:`${A("t.dayPnl",{day:30})}`,value:$(b(30))}]));function $({fromTimestamp:e,toTimestamp:t}){const a=w.pnlData,{map:l,timestampList:s}=E.value?a[_.type]:a.cumulativePnl[_.type],i=s.findIndex((t=>e<=t)),n=oa(s,(e=>e<=t))+1,r=s.slice(i,n);return 0===r.length?0:r.reduce(((e,t)=>N(e).plus(l[t].value).toFixed()),0)}function W(e,t=!1){if(S.value)return qe;const a=N(e).gte(1e7);let l="";return t&&N(e).gt(0)&&(l="+"),t&&N(e).lt(0)&&(l="-"),`${l}${Xt(N(e).abs().toFixed(),{formatKey:a?"max3":2,compact:a,currency:C.value})}`}return(e,t)=>{const a=s("Tooltip");return n(),r("div",JC,[y("div",eL,[y("div",tL,[v(h(E.value?e.$t("wallets.earn.totalSubscribed"):e.$t("wallets.totalBalance"))+" ",1),m(P(qt))]),y("div",aL,[y("div",lL,h(W(k.value)),1),y("span",sL,h(C.value),1)])]),(n(!0),r(p,null,x(O.value,(e=>(n(),r("div",{key:e.label,class:"pnl-block"},[y("div",iL,[v(h(e.label)+" ",1),e.tooltip?(n(),i(a,{key:0,placement:"top"},{content:g((()=>[m(P(Fa),{class:"icon-info"})])),tooltip:g((()=>[v(h(e.tooltip),1)])),_:2},1024)):d("",!0)]),y("div",nL,[y("div",{class:L(["pnl-value",{positive:!S.value&&P(N)(e.value).gt(0),negative:!S.value&&P(N)(e.value).lt(0)}])},h(W(e.value,!0)),3),y("span",rL,h(C.value),1)])])))),128))])}}},[["__scopeId","data-v-ee720b8a"]]),uL={name:"BarChartV2",components:{IconLoadingPulse:fa},props:{isLoading:{type:Boolean,default:!1},dataList:{type:Array,default:()=>[]},x:{type:Function,default:e=>e.label},y:{type:Function,default:e=>e.value},marginTop:{type:Number,default:20},marginRight:{type:Number,default:10},marginBottom:{type:Number,default:40},marginLeft:{type:Number,default:10},height:{type:Number,default:400},xLeftOffset:{type:Number,default:0},xRightOffset:{type:Number,default:0},xPadding:{type:Number,default:.1},xAxisTickFormat:{type:Function,default:e=>e},xAxisTickPadding:{type:Number,default:8},xAxisTickInterval:{type:Number,default:5},yAxisTickFormat:{type:Function,default:e=>e},yAxisTickMaxValue:{type:Number,default:void 0},yAxisTickMinValue:{type:Number,default:void 0},yDomainOffsetPercentage:{type:Number,default:.2},showTooltip:{type:Boolean,default:!0}},emits:["tooltipInfoUpdate"],data(){const e=_a("svg");return{width:640,svg:e,xAxis:e.append("g"),yAxis:e.append("g"),barGroup:e.append("g"),barMask:e.append("g"),tooltipInfo:{},yAxisTickWidth:0}},computed:{xList(){return this.dataList.map(this.x)},yList(){return this.dataList.map(this.y)},xScale(){return fi().domain(Ta(this.dataList.length)).range([this.marginLeft+this.yAxisTickWidth+this.xLeftOffset,this.width-this.marginRight-this.xRightOffset]).padding(this.xPadding)},yMax(){return Ea(this.yList)},yMin(){return La(this.yList)},yOffset(){return Ea([this.yMax,Math.abs(this.yMin)])*this.yDomainOffsetPercentage},yDomainMax(){return"number"==typeof this.yAxisTickMaxValue?this.yAxisTickMaxValue:this.yMax+this.yOffset},yDomainMin(){return"number"==typeof this.yAxisTickMinValue?this.yAxisTickMinValue:this.yMin-this.yOffset},yScale(){return Ca().domain([this.yDomainMin<=0?this.yDomainMin:0,this.yDomainMax>=0?this.yDomainMax:0]).range([this.height-this.marginBottom,this.marginTop])}},watch:{dataList:{deep:!0,handler(){this.reset(),this.initChart()}},tooltipInfo(e){this.$emit("tooltipInfoUpdate",e)}},mounted(){this.initChart(),window.addEventListener("resize",this.resizeHandler)},beforeUnmount(){window.removeEventListener("resize",this.resizeHandler)},methods:{initChart(){this.width=this.$refs.container.offsetWidth,this.$refs.chart.appendChild(this.svg.node()),this.svg.attr("width",this.width).attr("height",this.height).attr("viewBox",[0,0,this.width,this.height]).attr("style","width: 100%; height: auto;"),this.drawAxisY(),this.drawAxisX(),this.drawBarGroup(),this.drawBarMask()},reset(){this.$refs.chart.innerHTML="";const e=_a("svg");this.svg=e,this.xAxis=e.append("g"),this.yAxis=e.append("g"),this.barGroup=e.append("g"),this.barMask=e.append("g")},drawAxisX(){this.xAxis.call(Hr(this.xScale).tickValues(this.generateInterval(this.dataList.length,this.xAxisTickInterval)).tick
1Format((e=>this.xAxisTickFormat(this.xList[e]))).tickPadding([this.xAxisTickPadding])).attr("transform",`translate(0,${this.height-this.marginBottom})`).call((e=>{e.selectAll(".domain").remove(),e.selectAll(".tick line").remove(),e.selectAll(".tick text").attr("class","x-axis-text")}))},drawAxisY(){this.yAxis.call(Gr(this.yScale).tickFormat(this.yAxisTickFormat).ticks(8));const e=[];this.yAxis.selectAll(".tick text").attr("class","y-axis-text").each((function(){const t=wa(this).node().getBoundingClientRect().width;e.push(t)})),this.yAxisTickWidth=Math.max(...e),this.yAxis.attr("transform",`translate(${this.marginLeft+this.yAxisTickWidth},0)`),this.yAxis.selectAll(".domain").remove();const t=this.width-this.marginLeft-this.yAxisTickWidth-this.marginRight;this.yAxis.selectAll(".tick line").attr("x2",t).attr("class","y-axis-tick")},drawBarGroup(){this.barGroup.selectAll().data(Ta(this.dataList.length)).join("rect").attr("x",(e=>this.xScale(e)+this.xScale.bandwidth()/4)).attr("y",(e=>{const t=this.yList[e];return t<0?this.yScale(0):this.yScale(t)})).attr("height",(e=>{const t=this.yList[e];return t<0?this.yScale(t)-this.yScale(0):this.yScale(0)-this.yScale(t)})).attr("width",this.xScale.bandwidth()/2).attr("fill",(e=>this.yList[e]<0?ga["--app--color--accent-red"]:ga["--app--color--accent-green"]))},drawBarMask(){const e=this,[t,a]=this.yScale.range(),l=t-a,s=this.$refs.tooltip;this.barMask.attr("transform",`translate(0,${this.marginTop})`).selectAll().data(Ta(this.dataList.length)).join("rect").attr("x",(e=>this.xScale(e))).attr("y",0).attr("height",l).attr("width",this.xScale.bandwidth()).attr("fill",gi(ga["--app--color--blue-grey"]).copy({opacity:.4})).style("opacity",0).on("mouseover mousemove",(function(t){const a=wa(this);a.style("opacity",1);const l=a.datum();if(e.tooltipInfo=e.dataList[l],!e.showTooltip)return;const[[i,n]]=Da(t),{offsetWidth:r,offsetHeight:o}=e.$refs.container,u=r/e.width;s.style.visibility="visible",s.style.left=i*u-80+"px",s.style.bottom=`${n*u*-1+o}px`})).on("mouseout",(function(){wa(this).style("opacity",0),e.showTooltip&&(s.style.visibility="")}))},generateInterval(e,t=7){const a=[];if(0===e)return a;
1if(t===1/0)return 1===e?[0]:[0,e-1];const l=Math.floor(e/t);for(let s=0;s<e;s++)0!==s&&0!==l&&s%l!==0||a.push(s);return a},resizeHandler:ma((function(){const{chart:e,container:t}=this.$refs;e&&t&&(this.reset(),this.initChart())}),200)}},cL={ref:"container",class:"container"},dL={ref:"chart",class:"bar-chart"},pL={key:0,ref:"tooltip",class:"bar-tooltip"},yL={key:1,class:"loading-cover"},hL={class:"loading-icon-container"};const vL=vr(uL,[["render",function(e,t,a,l,i,u){const c=s("IconLoadingPulse");return n(),r("div",cL,[y("div",dL,null,512),a.showTooltip?(n(),r("div",pL,[o(e.$slots,"tooltip",{info:i.tooltipInfo},(()=>[v(h(i.tooltipInfo),1)]),!0)],512)):d("",!0),a.isLoading?(n(),r("div",yL,[y("div",hL,[m(c)])])):d("",!0)],512)}],["__scopeId","data-v-e6f6823d"]]),mL={class:"label"},gL={class:"value"},fL={class:"currency"},TL=vr({__name:"BarChartTooltip",props:{label:{type:String,default:""},value:{type:Number,default:0}},setup(e){const t=U(),a=Ut(),l=ze(),s=R((()=>t.state.hideWalletPriceValue)),i=R((()=>l.displayCurrency)),o=R((()=>a.getCurrencySymbol(i.value)));function u(e){const t=e||0,a=t<0?`-${o.value}`:t>0?`+${o.value}`:o.value;return Xt(Math.abs(t),{prefix:a,currency:i.value})}return(t,a)=>(n(),r("div",null,[y("div",mL,h(e.label),1),y("div",gL,[y("span",{class:L({"brand-color-positive":e.value>0,"brand-color-negative":e.value<0})},h(s.value?P(qe):u(e.value)),3),y("span",fL,h(i.value),1)])]))}},[["__scopeId","data-v-4888f0e1"]]),wL={class:"daily-area"},DL={class:"header"},AL={class:"title"},bL={key:0,class:"info-wrapper"},_L={class:"chart"},SL={key:0,class:"trend-tooltip hover-wrapper"},CL={class:"date"},LL={class:"currency"},EL={key:1,class:"barchart-tooltip"},IL=vr({__name:"DailyPnlBarChart",props:{isLoading:{type:Boolean,required:!0},isEarnType:{type:Boolean,required:!0},isFuturesType:{type:Boolean,required:!0},pnlList:{type:Array,required:!0},futuresTypeDataFilter:{type:String,default:"all"},yAxisTickFormatter:{type:Function,required:!0}},setup(e){const{t:t}=I(),a=U(),l=Ut(),o=ka(),u=ze(),c=e,f=K({label:"-",value:0,realized:0,asset:0}),T=R((()=>c.isEarnType?t("earn.dailyRewards"):t("wallets.spot.pnl.dailyPnL"))),w=R((()=>u.displayCurrency)),A=R((()=>l.getCurrencySymbol(w.value))),b=R((()=>a.state.hideWalletPriceValue));function _(e){f.value=e}function S(e){if(b.value)return qe;const t=e||0,a=t<0?`-${A.value}`:t>0?`+${A.value}`:A.value;return Xt(Math.abs(t),{prefix:a,currency:w.value})}return $([()=>o.isMobile,()=>c.pnlList],(([e,t])=>{if(e&&t.length>0&&"-"===f.value.label){const{label:e,value:a,realized:l,asset:s}=t[t.length-1];_({label:e,value:a,realized:l,asset:s})}}),{immediate:!0}),(t,a)=>{const l=s("Tooltip");return n(),r("div",wL,[y("div",DL,[y("div",AL,[v(h(T.value)+" ",1),e.isEarnType?d("",!0):(n(),i(l,{key:0,useNightTheme:"",isNonTradePageStyle:"",placement:"top"},{content:g((()=>[m(P(Fa),{class:"info-icon"})])),tooltip:g((()=>[y("span",null,h(t.$t("wallets.dailyPnlFormula")),1)])),_:1}))])]),t.isMobile?(n(),r("div",bL,[m(P(TL),{class:"date-row",label:f.value.label,value:f.value.value},null,8,["label","value"]),e.isEarnType?d("",!0):(n(),r(p,{key:0},[m(P(TL),{class:"info-row",label:t.$t("wallets.realizedPnl"),value:f.value.realized},null,8,["label","value"]),m(P(TL),{class:"info-row",label:t.$t("wallets.assetPnl"),value:f.value.asset},null,8,["label","value"])],64))])):d("",!0),y("div",_L,[m(P(vL),{isLoading:e.isLoading,dataList:e.pnlList,yAxisTickFormat:e.yAxisTickFormatter,showTooltip:t.isLargeSize,onTooltipInfoUpdate:_},D({_:2},[t.isLargeSize?{name:"tooltip",fn:g((({info:l})=>[e.isEarnType?(n(),r("div",SL,[y("div",CL,h(l.label),1),a[0]||(a[0]=y("div",{class:"separator"},"|",-1)),y("div",{class:L(["value",{positive:l.value>0,negative:l.value<0}])},h(S(l.value)),3),y("div",LL,h(w.value),1)])):(n(),r("div",EL,[m(P(TL),{class:L(["barchart-tooltip-header",{"no-divider":"all"!==e.futuresTypeDataFilter}]),label:l.label,value:l.value},null,8,["class","label","value"]),e.isFuturesType&&"all"!==e.futuresTypeDataFilter?d("",!0):(n(),i(P(TL),{key:0,class:"barchart-tooltip-row",label:t.$t("wallets.realizedPnl"),value:l.realized},null,8,["label","value"])),e.isFuturesType&&"all"!==e.futuresTypeDataFilter?d("",!0):(n(),i(P(TL),{key:1,class:"barchart-tooltip-row",label:t.$t("wallets.assetPnl"),value:l.asset},null,8,["label","value"]))]))])),key:"0"}:void 0]),1032,["isLoading","dataList","yAxisTickFormat","showTooltip"])])])}}},[["__scopeId","data-v-8c0e4ca6"]]),kL={class:"legend-wrapper"},RL={class:"info"},NL={class:"currency"},xL={class:"percent"},PL={class:"num"},OL={key:0,class:"legend-item width-full"},$L={class:"info"},WL={class:"currency"},FL=vr({__name:"WalletPnlChartLegend",props:{type:{type:String,default:Ye.FUTURES},dataList:{type:Array,required:!0},colorList:{type:Array,default:()=>ia},hideValue:{type:Boolean,default:!1}},setup(e){const t=e,{t:a}=I(),l=ze(),s=R((()=>
1l.displayCurrency)),i=R((()=>{let e=a("t.wallet");switch(t.type){case Ye.FUTURES:e=a("wallets.futuresWallet");break;case Ye.AUTO_TRADER:e=a("wallets.autoTraderWallet");break;case Ye.LEAD_TRADING:e=a("wallets.leadTradingWallet");break;case Ye.COPY_TRADING:e=a("wallets.copyTradingWallet");break;case Ye.AI_LEAD_TRADING:e=a("wallets.aiLeadTradingWallet");break;case Ye.AI_COPY_TRADING:e=a("wallets.aiCopyTradingWallet");break;case Ye.FUTURES_BOTS:e=a("wallets.futuresBotsWallet");break;case Ye.EARN:e=a("earn.earnWallet")}return a("wallets.noAssets",{wallet:e.toLowerCase()})}));return(t,a)=>(n(),r("div",kL,[(n(!0),r(p,null,x(e.dataList,((a,l)=>(n(),r("div",{key:l,class:"legend-item"},[y("div",RL,[y("div",{class:"dot",style:_({backgroundColor:e.colorList[l]})},null,4),y("div",NL,h(a.name),1),y("div",xL,h(a.displayPercentage)+"%",1)]),y("div",PL,h(e.hideValue?P(qe):t.$filters.formatNumber(a.value,{currency:s.value}))+" "+h(s.value),1)])))),128)),0===e.dataList.length?(n(),r("div",OL,[y("div",$L,[a[0]||(a[0]=y("div",{class:"dot grey-dark"},null,-1)),y("div",WL,h(i.value),1)])])):d("",!0)]))}},[["__scopeId","data-v-20392f35"]]),BL={class:"asset-area"},UL={class:"header"},ML={class:"title"},VL={class:"header-right"},HL={class:"chart"},GL={class:"chart-wrapper"},YL={class:"tooltip-center"},qL={class:"tooltip-header"},zL={class:"name"},KL={class:"percentage"},jL={class:"value"},XL={class:"currency"},QL={class:"donut-tooltip"},ZL={class:"tooltip-header"},JL={class:"name"},eE={class:"percentage"},tE={class:"value"},aE=vr({__name:"AssetAllocationDonutChart",props:{type:{type:String,required:!0},assetList:{type:Array,default:()=>[]}},setup(e){const t=U(),a=Ut(),{getCurrencyRate:l}=na(),s=ze(),o=e,u=K([]),c=R((()=>t.state.hideWalletPriceValue)),d=R((()=>s.displayCurrency)),p=R((()=>"USD"===d.value)),v=R((()=>{const e=[];if(o.assetList.forEach((({shortName:t,totalValue:s,totalValueInUSD:i})=>{var n;const r=function({shortName:e,totalValue:t,totalValueInUSD:a}){if(p.value&&void 0!==a)return Number(a);const s=l(e,d.value);return N(t).times(s).toNumber()}({shortName:t,totalValue:s,totalValueInUSD:i});r>0&&e.push({name:(null==(n=a.currencyMap[t])?void 0:n.displayName)||t,value:r})})),e.sort(((e,t)=>t.value-e.value)),e.length<=6)return e;const t=e.slice(0,5);return t.push({name:"Others",value:e.slice(5).reduce(((e,{value:t})=>N(e).plus(t).toNumber()),0)}),t}));function f(e){u.value=e}return(t,a)=>(n(),r("div",BL,[y("div",UL,[y("div",ML,h(t.$t("wallets.spot.pnl.assetAllocation")),1),y("div",VL,h(t.$t("t.current")),1)]),y("div",HL,[y("div",GL,[v.value.length>0?(n(),i(P(ta),{key:0,data:v.value,scaleColors:P(ia),isShowLegend:!1,width:260,tooltipType:"center",percentageRound:0,onUpdateComputedData:f},{tooltipCenter:g((({info:e})=>{return[y("div",YL,[y("div",qL,[y("div",zL,h(e.name),1),y("div",KL,h(e.displayPercentage)+"%",1)]),y("div",jL,h(c.value?P(Ti):(t=e.value,Xt(t,t>=1e7?{formatKey:"max3",compact:!0,currency:d.value}:{currency:d.value}))),1),y("div",XL,h(d.value),1)])];var t})),tooltip:g((({info:e})=>[y("div",QL,[y("div",ZL,[y("div",JL,h(e.name),1),y("div",eE,h(e.displayPercentage)+"%",1)]),y("div",tE,h(c.value?P(Ti):P(Xt)(e.value))+" "+h(d.value),1)])])),_:1},8,["data","scaleColors"])):(n(),i(P(ea),{key:1,width:220,height:220}))]),m(P(FL),{type:e.type,dataList:u.value,colorList:P(ia),hideValue:c.value},null,8,["type","dataList","colorList","hideValue"])])]))}},[["__scopeId","data-v-4c8d541c"]]),lE="redraw",sE={name:"TrendChart",components:{IconLoadingPulse:fa},props:{isLoading:{type:Boolean,default:!1},isResponsive:{type:Boolean,default:!1},width:{type:Number,default:640},height:{type:Number,default:400},marginTop:{type:Number,default:0},data:{type:Object,default:()=>({xAxis:[],lists:[]})},isShowLegend:{type:Boolean,default:!0},isShowXAxisTick:{type:Boolean,default:!0},isShowHoverTickLine:{type:Boolean,default:!1},xAxisGridInterval:{type:Number,default:null},xAxisTickFormat:{type:Function,default:e=>e},xAxisTickPadding:{type:Number,default:0},isShowYAxis:{type:Boolean,default:!1},isShowYAxisTick:{type:Boolean,default:!1},yAxisGridInterval:{type:Number,default:5},yAxisTickFormat:{type:Function,default:e=>e},yAxisTickLineDasharray:{type:Boolean,default:!0},yAxisTickLineOverLength:{type:Number,default:0},scaleColors:{type:Array,default:()=>[]},xAxisHoverLineColor:{type:[String,Object],default:"#015FE5"},lineWidth:{type:Number,default:2},lineStrokeLinecap:{type:String,default:"round"},lineStrokeLinejoin:{type:String,default:"round"},lineStrokeOpacity:{type:Number,default:1},lineCurveFunctionByD3:{type:Function,default:ba},yDomainOffsetPercentage:{type:Number,default:.2},throttleDelay:{type:Number,default:2e3},adjustTooltipOffsetY:{type:Number,default:0},isChartTooltipContainer:{type:Boolean,default:!1}},emits:["tooltipInfoUpdate"],data(){return{isDrawing:!0,innerWidth:this.width,innerHeight:this.height,xPadding:30,legendSpace:50,xAxisOffset:this.isShowYAxis?20:0,svg:null,xAxisScale:null,xAxis:null,xAxisHeight:20,yAxisScale:null,yAxis:null,legendArea:null,pointOuterRadius:14,pointInnerRadius:5,tooltipInfo:{}}},computed:{computedLegendSpace(){return this.isShowLegend?this.legendSpace:0},trendWidth(){const e=this.innerWidth-2*this.xPadding-this.xAxisOffset;return e<0?0:e},trendHeight(){return this.innerHeight-this.xAxisHeight-this.computedLegendSpace},xAxisList(){return this.data.xAxis},showXAxisList(){if(!this.xAxisGridInterval)return this.xAxisList;const e=this.xAxisList.length,t=e-1,a=Math.floor(e/this.xAxisGridInterval);return 0===e?[]:this.xAxisGridInterval===1/0?1===e?[this.xAxisList[0]]:[this.xAxisList[0],this.xAxisList[t]]:this.xAxisList.reduce(((e,t,l)=>(0!==l&&0!==a&&l%a!==0||e.push(t),e)),[])},yAxisLists(){return this.data.lists}},watch:{innerWidth(){this.initializeDebounce()},data:{deep:!0,handler(){this.isDrawing=!0,this.initializeThrottle()}},tooltipInfo(e){this.$emit("tooltipInfoUpdate",e)}},created(){this.initializeDebounce=kl(this.initialize,300),this.initializeThrottle=ma(this.initialize,this.throttleDelay,!0)},mounted(){this.isResponsive&&(this.setInnerSize(this.$refs.container.offsetWidth),this.startResponsiveObserver()),this.initialize()},beforeUnmount(){this.isResponsive&&this.stopResponsiveObserver()},methods:{setInnerSize(e){this.innerWidth=e,this.innerHeight=this.height},startResponsiveObserver(){this.resizeObserver=new ResizeObserver((e=>{for(let t of e){const e=Array.isArray(t.contentBoxSize)?t.contentBoxSize[0]:t.contentBoxSize;this.setInnerSize(e.inlineSize)}})),this.resizeObserver.observe(this.$refs.container)},stopResponsiveObserver(){this.resizeObserver.unobserve(this.$refs.container)},reset(){this.$refs.chart.innerHTML="",this.svg=_a("svg")},async initialize(){if(this.$refs.chart){this.isDrawing=!0,this.reset(),this.svg.attr("width",this.innerWidth).attr("height",this.innerHeight),this.calculateAxis();try{this.$refs.chart.appendChild(this.svg.node()),await this.drawAxisX(),await this.drawAxisY(),await this.drawLegend(),this.adjustPlacement(),await this.drawLines(),this.isDrawing=!1}catch(e){e.message===lE?(this.isDrawing=!0,this.initializeDebounce()):this.isDrawing=!1}}},calculateAxis(){this.xAxisScale=Sa().domain(this.xAxisList).range([0,this.trendWidth]);const e=this.yAxisLists.reduce(((e,t)=>(e.push(...t.values),e)),[]),t=Ea(e),a=La(e),l=Ea([t,Math.abs(a)])*this.yDomainOffsetPercentage;this.yAxisScale=Ca().domain([a-l,t+l]).range([this.trendHeight,this.marginTop])},async drawAxisX(){this.xAxis=this.svg.append("g").call(Hr(this.xAxisScale).tickPadding([this.xAxisTickPadding]).tickValues(this.showXAxisList).tickFormat(this.xAxisTickFormat)).call((e=>{e.selectAll(".domain").remove(),e.selectAll(".tick text").attr("class","x-a
1xis-text").each((function(){const e=wa(this),t=e.text().split(" ");e.html(""),e.selectAll("tspan").data(t).join("tspan").attr("x",e.attr("x")||0).attr("y",((t,a)=>Number(e.attr("y"))+30*a)).text((e=>e))}))})),await this.$nextTick();const e=this.xAxis.node().getBoundingClientRect();if(e.height>this.xAxisHeight)throw this.xAxisHeight=e.height,new Error(lE);this.xAxis.call((e=>{this.isShowXAxisTick?e.selectAll(".tick line").attr("stroke-dasharray","10, 5").attr("y1",-this.trendHeight).attr("y2",0).attr("stroke-opacity",1).attr("class","x-axis-tick"):e.selectAll(".tick line").attr("stroke-opacity",0)}))},async drawAxisY(){this.yAxis=this.svg.append("g"),this.isShowYAxis&&this.yAxis.call(Gr(this.yAxisScale).tickPadding([4]).tickFormat(this.yAxisTickFormat).ticks(this.yAxisGridInterval)).call((e=>{e.selectAll(".domain").remove(),e.selectAll(".tick text").attr("class","y-axis-text").each((function(){const e=wa(this),t=e.text().split(" ");e.html(""),e.selectAll("tspan").data(t).join("tspan").attr("x",e.attr("x")||0).attr("y",((t,a)=>Number(e.attr("y"))+30*a)).text((e=>e))}))})),await this.$nextTick();const e=this.yAxis.node().getBoundingClientRect();if(e.width>this.xPadding)throw this.xPadding=e.width,new Error(lE);this.yAxis.call((e=>{this.isShowYAxisTick?(e.selectAll(".tick line").attr("x1",this.trendWidth+this.xAxisOffset+this.yAxisTickLineOverLength).attr("x2",0).attr("stroke-opacity",1).attr("class","y-axis-tick"),this.yAxisTickLineDasharray&&e.selectAll(".tick line").attr("stroke-dasharray","10 5")):e.selectAll(".tick line").remove()}))},async drawLegend(){if(!this.isShowLegend)return;const e=this;this.legendArea=this.svg.append("foreignObject").attr("width",this.trendWidth).attr("height","100%");const t=this.legendArea.append("xhtml:div").attr("class","legend-container"),a=this.yAxisLists.map((e=>e.name));t.selectAll("div").data(a).join("div").attr("class","legend-item").each((function(t,a){const l=wa(this);l.append("div").attr("class","legend-detail legend-color").style("background-color",e.scaleColors[a]),l.append("div").attr("class","legend-detail legend-name").text(t)})),await this.$nextTick(),this.legendArea.call((e=>{const a=t.node().getBoundingClientRect();e.attr("height",a.height)}))},async drawLines(){let e=this.yAxisLists;const t=this.xAxisList,a=t.length,l=this.trendWidth/a,s=this;0===e.length&&(e=[{name:"",values:t.map((()=>0))}]),e.forEach((({values:e,otherInfos:i=[]},n)=>{const r=Aa().defined((a=>t[a]&&!isNaN(e[a]))).curve(this.lineCurveFunctionByD3).x((e=>this.xAxisScale(t[e]))).y((t=>this.yAxisScale(e[t]))),o=this.svg.append("g").attr("transform",`translate(${this.xPadding+this.xAxisOffset}, ${this.computedLegendSpace})`);o.append("path").attr("fill","none").attr("stroke",this.scaleColors[n]||"currentColor").attr("stroke-width",this.lineWidth).attr("stroke-linecap",this.lineStrokeLinecap).attr("stroke-linejoin",this.lineStrokeLinejoin).attr("stroke-opacity",this.lineStrokeOpacity).attr("d",r(Ta(a)));const u=o.selectAll("g.point").data(e).join("g").attr("class","point-container").call((e=>{e.append("circle").attr("cx",((e,a)=>this.xAxisScale(t[a]))).attr("cy",(e=>this.yAxisScale(e))).attr("r",this.pointOuterRadius).attr("fill","currentColor").attr("class","chart-point"),e.append("circle").attr("cx",((e,a)=>this.xAxisScale(t[a]))).attr("cy",(e=>this.yAxisScale(e))).attr("r",this.pointInnerRadius).attr("fill","white"),e.append("rect").attr("x",((e,a)=>this.xAxisScale(t[a])-l/2)).attr("y",0).attr("height",this.trendHeight).attr("width",l).attr("fill","transparent"),this.isShowHoverTickLine&&e.append("line").attr("stroke",this.xAxisHoverLineColor).attr("stroke-width",2).attr("stroke-dasharray","6, 5").attr("stroke-opacity",.5).attr("x1",((e,a)=>this.xAxisScale(t[a]))).attr("y1",this.trendHeight).attr("x2",((e,a)=>this.xAxisScale(t[a]))).attr("y2",0)})),c=s.$refs.tooltip,d=wa("body").node(),p=wa(s.$refs.chart).node();u.each((function(e,a){const l=wa(this),n=t[a],r=s.showXAxisList.indexOf(n),o=r>-1&&s.isShowXAxisTick,u=s.xAxis.select(`.tick:nth-of-type(${r+1}) .x-axis-tick`),y=i[a]||{};l.on("mouseover mousemove",(async t=>
1{const[[l,i]]=Da(t,d),[r,h]=wi(t,p),v=s.isChartTooltipContainer?r:l,m=s.isChartTooltipContainer?h:i;s.tooltipInfo={...y,x:n,y:e,index:a},s.$nextTick((()=>{const e=c.offsetWidth/2+l>window.innerWidth,t=l-c.offsetWidth/2<0,a=c.offsetWidth>=window.innerWidth,i=-c.offsetWidth/2,n=s.isMobile?-50:-20;let r,d;switch(!0){case e&&!a:r=window.innerWidth-c.offsetWidth;break;case t&&!a:r=0;break;case(e||t)&&a:r=0,c.classList.add("full-width");break;default:r=v+i}d=s.isChartTooltipContainer?m-c.offsetHeight+n+s.adjustTooltipOffsetY:m-window.scrollY-c.offsetHeight+n+s.adjustTooltipOffsetY,c.style.transform=`translate(${r}px, ${d}px)`,this.classList.add("visible"),c.classList.remove("hide"),o&&u&&u.classed("highlight",!0)}))})).on("mouseout",(()=>{c.classList.add("hide"),c.classList.remove("full-width"),this.classList.remove("visible"),o&&u&&u.classed("highlight",!1)}))}))})),await this.$nextTick()},adjustPlacement(){this.xAxis.attr("transform",`translate(${this.xPadding+this.xAxisOffset}, ${this.trendHeight+this.computedLegendSpace})`),this.yAxis.attr("transform",`translate(${this.xPadding+this.xAxisOffset-20}, ${this.computedLegendSpace})`)}}},iE={ref:"chart",class:"trend-chart"},nE={ref:"tooltip",class:"trend-tooltip-container hide"},rE={key:0,class:"loading-cover"},oE={class:"loading-icon-container"};const uE=vr(sE,[["render",function(e,t,a,l,i,u){const c=s("IconLoadingPulse");return n(),r("div",{ref:"container",class:L(["container",{responsive:a.isResponsive}])},[y("div",iE,null,512),y("div",nE,[o(e.$slots,"tooltip",{info:i.tooltipInfo},(()=>[v(h(i.tooltipInfo),1)]),!0)],512),a.isLoading||i.isDrawing?(n(),r("div",rE,[y("div",oE,[m(c)])])):d("",!0)],2)}],["__scopeId","data-v-5ac9c72a"]]),cE={class:"profit-area"},dE={class:"header"},pE={class:"title"},yE={key:0,class:"info-wrapper"},hE={class:"date-row"},vE={key:0,class:"label"},mE={key:1,class:"label"},gE={class:"value"},fE={class:"currency"},TE={class:"chart"},wE={class:"trend-tooltip"},DE={class:"date"},AE={key:0,class:"currency"},bE=vr({__name:"CumulativeTrendChart",props:{isLoading:{type:Boolean,required:!0},blockTitle:{type:String,required:!0},blockTitleTooltip:{type:String,default:""},pnlList:{type:Array,required:!0},yAxisTickFormatter:{type:Function,required:!0},isPercentage:{type:Boolean,default:!1}},setup(e){const t=[gi(ga["--app--color--primary-light"]).copy({opacity:.4})],a=U(),l=Ut(),o=ka(),u=ze(),c=R((()=>u.displayCurrency)),p=e,w=K({x:"-",y:0}),D=R((()=>l.getCurrencySymbol(c.value))),A=R((()=>a.state.hideWalletPriceValue)),b=R((()=>{const e=[],t=[];return p.pnlList.forEach((({date:a,cumulative:l,cumulativePercentage:s})=>{e.push(a),t.push(p.isPercentage?s:l)})),{xAxis:e,lists:[{name:c.value,values:t}]}}));function _(e){w.value=e}function S(e){if(A.value)return qe;const t=e||0;if(p.isPercentage){const e=t<0?"-":t>0?"+":"",a=N(t).abs().dp(2).gt(0)?2:5;return`${e}${N(t).abs().toFixed(a)}%`}const a=t<0?`-${D.value}`:t>0?`+${D.value}`:D.value;return Xt(Math.abs(t),{prefix:a,currency:c.value})}function C(e){return Ra(e,"MM-dd")}return $([()=>o.isMobile,()=>p.pnlList],(([e,t])=>{if(e&&t.length>0&&"-"===w.value.x){const{xAxis:e,lists:t}=b.value,a=e.length-1;_({x:e[a],y:t[0].values[a]})}}),{immediate:!0}),(a,l)=>{const o=s("Tooltip");return n(),r("div",cE,[y("div",dE,[y("div",pE,[v(h(e.blockTitle)+" ",1),e.blockTitleTooltip?(n(),i(o,{key:0,useNightTheme:"",isNonTradePageStyle:"",placement:"top"},{content:g((()=>[m(P(Fa),{class:"info-icon"})])),tooltip:g((()=>[y("span",null,h(e.blockTitleTooltip),1)])),_:1})):d("",!0)])]),a.isMobile?(n(),r("div",yE,[y("div",hE,["-"===w.value.x?(n(),r("div",vE,h(w.value.x),1)):(n(),r("div",mE,h(P(Ra)(w.value.x,"MM-dd")),1)),y("div",gE,[y("span",{class:L({positive:w.value.y>=0,negative:w.value.y<0})},h(S(w.value.y)),3),y("span",fE,h(c.value),1)])])])):d("",!0),y("div",TE,[m(P(uE),{isResponsive:"",isShowYAxis:"",isShowYAxisTick:"",isShowHoverTickLine:"",isShowXAxisTick:!1,isShowLegend:!1,isLoading:e.isLoading,height:360,marginTop:20,data:b.value,scaleColors:t,xAxisTickFormat:C,xAxisTickPadding:20,xAxisGridInterval:a.isLargeSize?5:1/0,yAxisGridInterval:6,yAxisTickFormat:e.yAxisTickFormatter,yAxisTickLineDasharray:!1,yAxisTickLineOverLength:30,valueMaxOffset:100,valueMinOffset:50,onTooltipInfoUpdate:_},{tooltip:g((({info:t})=>[f(y("div",wE,[y("div",DE,h(P(Ra)(t.x,"MM-dd")),1),l[0]||(l[0]=y("div",{class:"separator"},"|",-1)),y("div",{class:L(["value",{positive:t.y>0,negative:t.y<0}])},h(S(t.y)),3),e.isPercentage?d("",!0):(n(),r("div",AE,h(c.value),1))],512),[[T,a.isLargeSize]])])),_:1},8,["isLoading","data","xAxisGridInterval","yAxisTickFormat"])])])}}},[["__scopeId","data-v-d2b821c8"]]),_E={name:"WalletPnlList",components:{Card:xo,Pagination:As,NoDataAvailable:Zt,LoadMoreObserver:bs,FileDownload:Ds},props:{type:{type:String,default:Ye.FUTURES},analysisList:{type:Array,required:!0},dateTitle:{type:String,default:"dateTitle"},numberFormatter:{type:Function,default:e=>e},percentageFormatter:{type:Function,default:e=>e},isLoading:{type:Boolean,default:!1},downloadPathname:{type:String,required:!0},downloadQueryString:{type:String,required:!0},dateRange:{type:Object,required:!0}},data:()=>({colgroup:{gridSize:12,gridSpacing:16,colWidthUnit:[4,3,5]},pagination:{current:1,pageSize:10,total:0,totalPages:0}}),computed:{isSpotType(){return this.type===Ye.SPOT},isEarnType(){return this.type===Ye.EARN},showRealizedValue(){return!this.isSpotType&&!this.isEarnType},fileName(){switch(this.type){case Ye.SPOT:return this.$t("wallets.spot.pnl.titleFull");case Ye.FUTURES:return this.$t("wallets.futures.pnl.titleFull");case Ye.AUTO_TRADER:return this.$t("wallets.autoTrader.pnl.titleFull");case Ye.LEAD_TRADING:return this.$t("wallets.leadTrading.pnl.titleFull");case Ye.COPY_TRADING:return this.$t("wallets.copyTrading.pnl.titleFull");case Ye.AI_LEAD_TRADING:return this.$t("wallets.aiLeadTrading.pnl.titleFull");case Ye.AI_COPY_TRADING:return this.$t("wallets.aiCopyTrading.pnl.titleFull");case Ye.FUTURES_BOTS:return this.$t("wallets.futuresBots.pnl.titleFull");case Ye.EARN:return this.$t("earn.rewardTitle");default:return this.$t("wallets.futures.pnl.titleFull")}}
1,labelList(){return this.isEarnType?[{text:this.$t("t.date"),align:"left"},{text:this.$t("earn.tableHeader.dailyRewards"),align:"right"},{text:this.$t("earn.tableHeader.cumulativeRewards"),align:"right"}]:[{text:this.$t("t.date"),align:"left"},{text:this.$t("futuresMain.tradeHistory.realizedPNL"),align:"right"},!this.isSpotType&&{text:this.$t("wallets.assetPnl"),align:"right"},{text:this.$t("wallets.cumulativePnl"),align:"right"},{text:`${this.$t("wallets.cumulativePnl")} %`,align:"right"}].filter((e=>e))},filteredList(){const e=this.pagination.current*this.pagination.pageSize,t=e-this.pagination.pageSize;return this.analysisList.slice(t,e)},mobileFilteredList(){const e=this.pagination.current*this.pagination.pageSize;return this.analysisList.slice(0,e)},pnlRequestDownload(){return ro($a.downloadSpotHistory,this.downloadPathname,this.downloadQueryString)}},watch:{analysisList:{immediate:!0,handler(e){this.pagination.current=1,this.pagination.total=e.length,this.pagination.totalPages=Math.ceil(e.length/this.pagination.pageSize)}}},methods:{handleCurrentChange(e){this.pagination.current=e},loadMore(){this.pagination.current!==this.pagination.totalPages&&(this.pagination.current+=1)}}},SE={class:"pnl-list"},CE={class:"analysis-header"},LE={class:"title-wrap"},EE={class:"title"},IE={class:"last-days"},kE={key:0,class:"loading-wrap"},RE={class:"table-content"},NE={class:"pagination-container"},xE={key:1,class:"list-wrapper"},PE={class:"date"},OE={class:"item-content"},$E={key:0,class:"data-row"},WE={class:"title"},FE={class:"value"},BE={class:"data-row"},UE={class:"title"},ME={class:"value"},VE={class:"data-row"},HE={class:"title"},GE={class:"value"},YE={key:1,class:"data-row"},qE={class:"title"},zE={class:"value"};const KE=vr(_E,[["render",function(e,t,a,l,o,u){const c=s("FileDownload"),T=s("NoDataAvailable"),w=s("Cell"),D=s("HeaderRow"),A=s("Row"),b=s("Table"),_=s("Pagination"),S=s("LoadMoreObserver"),L=s("Card"),E=C("loading");return n(),i(L,{class:"card-wrapper"},{default:g((()=>[y("div",SE,[y("div",CE,[y("div",LE,[y("div",EE,h(u.isEarnType?e.$t("earn.rewardAnalysis"):e.$t("t.pnlDetails")),1),y("div",IE,h(a.dateTitle),1)]),t[0]||(t[0]=y("div",{class:"flex-1"},null,-1)),m(c,{class:"file-download",fileName:u.fileName,hasPdf:"",requestDownload:u.pnlRequestDownload,defaultRangeDate:a.dateRange},null,8,["fileName","requestDownload","defaultRangeDate"])]),a.isLoading?f((n(),r("div",kE,null,512)),[[E,!0]]):0===u.filteredList.length?(n(),i(T,{key:1,class:"no-data",emptyText:e.$t("t.noDataFound")},null,8,["emptyText"])):(n(),r(p,{key:2},[e.isMobile?(n(),r("div",xE,[(n(!0),r(p,null,x(u.mobileFilteredList,((t,l)=>(n(),r("div",{key:l,class:"list-item"},[y("div",PE,h(e.$filters.formatDate(t.date,"yyyy-MM-dd")),1),y("div",OE,[u.showRealizedValue?(n(),r("div",$E,[y("div",WE,h(e.$t("wallets.realizedPnl")),1),y("div",FE,h(a.numberFormatter(t.realized)),1)])):d("",!0),y("div",BE,[y("div",UE,[u.isSpotType?(n(),r(p,{key:0},[v(h(e.$t("wallets.realizedPnl")),1)],64)):u.isEarnType?(n(),r(p,{key:1},[v(h(e.$t("earn.tableHeader.dailyRewards")),1)],64)):(n(),r(p,{key:2},[v(h(e.$t("wallets.assetPnlFull")),1)],64))]),y("div",ME,h(a.numberFormatter(t.asset)),1)]),y("div",VE,[y("div",HE,h(u.isEarnType?e.$t("earn.tableHeader.cumulativeRewards"):e.$t("wallets.cumulativePnlFull")),1),y("div",GE,h(a.numberFormatter(t.cumulative)),1)]),void 0!==t.cumulativePercentage?(n(),r("div",YE,[y("div",qE,h(`${e.$t("wallets.cumulativePnl")} %`),1),y("div",zE,h(a.percentageFormatter(t.cumulativePercentage)),1)])):d("",!0)])])))),128)),m(S,{onLoadMore:u.loadMore},null,8,["onLoadMore"])])):(n(),r(p,{key:0},[y("div",RE,[m(b,{colgroup:o.colgroup},{header:g((()=>[m(D,null,{default:g((()=>[(n(!0),r(p,null,x(u.labelList,(e=>(n(),i(w,{key:e.text,tag:"th",textAlign:e.align},{default:g((()=>[v(h(e.text),1)])),_:2},1032,["textAlign"])))),128))])),_:1})])),body:g((()=>[(n(!0),r(p,null,x(u.filteredList,((t,l)=>(n(),i(A,{key:l,class:"row",disableBackground:"",index:l},{default:g((()=>[m(w,{textAlign:"left"},{default:g((()=>[v(h(e.$filters.formatDate(t.date,"yyyy-MM-dd")),1)])),_:2},1024),u.showRealizedValue?(n(),i(w,{key:0,textAlign:"right"},{default:g((()=>[v(h(a.numberFormatter(t.realized)),1)])),_:2},1024)):d("",!0),m(w,{textAlign:"right"},{default:g((()=>[v(h(a.numberFormatter(t.asset)),1)])),_:2},1024),m(w,{textAlign:"right"},{default:g((()=>[v(h(a.numberFormatter(t.cumulative)),1)])),_:2},1024),void 0!==t.cumulativePercentage?(n(),i(w,{key:1,textAlign:"right"},{default:g((()=>[v(h(a.percentageFormatter(t.cumulativePercentage)),1)])),_:2},1024)):d("",!0)])),_:2},1032,["index"])))),128))])),_:1},8,["colgroup"])]),y("div",NE,[m(_,{layout:"prev, pager, next, jumper",background:!1,currentPage:o.pagination.current,pageSize:o.pagination.pageSize,total:o.pagination.total,totalPages:o.pagination.totalPages,onHandleCurrentChangeP:u.handleCurrentChange},null,8,["currentPage","pageSize","total","totalPages","onHandleCurrentChangeP"])])],64))],64))])])),_:1})}],["__scopeId","data-v-240f82ca"]]),jE={class:"share-dialog-body"},XE={class:"pnl-duration-block"},QE={class:"title"},ZE={class:"duration"},JE={class:"pnl-cumulative-block"},eI={class:"title"},tI={key:0,class:"share-qr-block"},aI={class:"qr-wrapper"},lI={class:"referral-wrapper"},sI={class:"title"},iI={class:"ref-code"},nI={class:"share-btn-wrapper"},rI=vr({__name:"SharePnlDialog",props:{type:{type:String,default:Ye.FUTURES},downloadFilename:{type:String,default:"myPnl.png"},fromDate:{type:String,required:!0},toDate:{type:String,required:!0},pnlValue:{type:Number,required:!0}},emits:["closed"],setup(e,{emit:t}){const{sharePnlDialogLogoTheme:a}=Bt,l=e,o=t,u=Ut(),{lang:c,isApp:p}=S(u),f=Di(),{userReferral:T,isEnableCommonReferralInfo:w}=S(f),{debouncePromiseGetUserReferralInfo:D}=f,b=ze();let C=null,E=null;const{t:k}=I(),N=O(null),x=O(!0),$=R((()=>b.displayCurrency)),W=R((()=>T.value.referralCode)),F=R((()=>{let e=k("t.futures");switch(l.type){case Ye.SPOT:e=k("router.walletSpot");break;case Ye.LEAD_TRADING:e=k("nav.leadTrading");break;case Ye.COPY_TRADING:e=k("trading.copyTrading");break;case Ye.AI_LEAD_TRADING:e=k("nav.aiLeadTrading");break;case Ye.AI_COPY_TRADING:e=k("nav.aiCopyTrading");break;case Ye.AUTO_TRADER:e=k("nav.autoTrader");break;case Ye.FUTURES_BOTS:e=k("nav.futuresBots");break;case Ye.EARN:e=k("wallets.earn")}return k("wallets.pnl.myPnl",{walletName:e,brandName:k("brand.name")}
1)})),B=R((()=>Ai(c.value,W.value))),U=R((()=>({"background-image":`url(${bi("sharePnlBg/share-pnl-bg.png")})`}))),M=R((()=>{if(null===a)return le(Nr);switch(a){case"LIGHT":case"DARK":return le(go);default:return null}}));function V(){if(p.value){const e=new FileReader;return e.addEventListener("load",(()=>{_i({event:"OPEN_SHARE_PROMPT",imgBase64:e.result})}),!1),void e.readAsDataURL(E)}Si({imageBlob:E},l.downloadFilename)}return Y((async()=>{await D(),C=setTimeout((()=>{ie(N.value,{scale:2}).then((e=>{E=e})).finally((()=>{x.value=!1}))}),500)})),q((()=>clearTimeout(C))),(t,a)=>{const l=s("BaseButton");return n(),i(P(Ml),{class:"share-dialog-wrapper",width:t.isLargeSize?"560px":"90%",height:t.isLargeSize?"auto":"100%",bodyWithPadding:!1,fullStyle:t.isMobile,isBrandNewStyle:"",onClosed:a[0]||(a[0]=e=>o("closed"))},{header:g((()=>[v(h(t.$t("wallets.shareMyPnl")),1)])),body:g((()=>[y("div",jE,[y("div",{ref_key:"sharedContent",ref:N,class:"share-image-wrapper",style:_(U.value)},[(n(),i(A(M.value),{class:"share-dialog-logo"})),y("div",XE,[y("div",QE,h(F.value),1),y("div",ZE,h(t.$t("t.periodRange",{fromDate:e.fromDate,toDate:e.toDate})),1)]),y("div",JE,[y("div",eI,h(t.$t("wallets.cumulativePnl")),1),y("div",{class:L(["value",{negative:e.pnlValue<0}])},h(t.$filters.formatNumber(e.pnlValue,{currency:$.value}))+" "+h($.value),3)]),P(w)&&W.value?(n(),r("div",tI,[y("div",aI,[m(se,{size:t.isMobile?56:78,value:B.value},null,8,["size","value"])]),y("div",lI,[y("div",sI,h(t.$t("register.referral-code")),1),y("div",iI,h(W.value),1)])])):d("",!0)],4),y("div",nI,[m(l,{class:"primary block",isLoading:x.value,onClick:V},{default:g((()=>[v(h(t.$t("wallets.shareImageText")),1)])),_:1},8,["isLoading"])])])])),_:1},8,["width","height","fullStyle"])}}},[["__scopeId","data-v-e761e034"]]),oI={class:"share-wrapper"},uI=vr({__name:"SharePnlButton",props:{type:{type:String,default:Ye.FUTURES},fromDate:{type:String,required:!0},toDate:{type:String,required:!0},pnlValue:{type:Number,required:!0}},setup(e){const t=O(!1);return(a,l)=>(n(),r("div",oI,[y("div",{class:"share-button",onClick:l[0]||(l[0]=e=>t.value=!0)},[m(P(Ci),{width:"16",height:"16"}),y("span",null,h(a.$t("wallets.shareMyPnl")),1)]),t.value?(n(),i(P(rI),{key:0,type:e.type,fromDate:e.fromDate,toDate:e.toDate,pnlValue:e.pnlValue,onClosed:l[1]||(l[1]=e=>t.value=!1)},null,8,["type","fromDate","toDate","pnlValue"])):d("",!0)]))}},[["__scopeId","data-v-67ce6f5b"]]),cI={class:"content-wrapper"},dI={class:"filter-wrapper"},pI={key:1,class:"flex-fill"},yI={class:"charts-container"},hI={class:"charts-container"},vI={key:0,class:"profit-area"},mI={class:"pnl-note"},gI=vr({__name:"WalletPnlAnalysis",props:{type:{type:String,required:!0},assetList:{type:Array,default:()=>[]}},setup(e){const[t,a]=ua({rangeSize:7,nowDateOffset:-1}),l=U(),s=Ut(),o=ra(),{t:u}=I(),c=ze(),p=e,v=O(!0),f=O({start:t,end:a}),T=O("all"),w=K({}),D=R((()=>c.displayCurrency)),A=R((()=>s.getCurrencySymbol(D.value))),b=R((()=>p.type===Ye.SPOT)),_=R((()=>p.type===Ye.EARN)),S=R((()=>!b.value&&!_.value)),C=R((()=>![Ye.SPOT,Ye.EARN].includes(p.type))),L=R((()=>l.state.hideWalletPriceValue)),E=R((()=>[{name:u("t.realizedAndAssetPnl"),value:"all"},{name:u("wallets.realizedPnl"),value:"realized"},{name:u("wallets.assetPnl"),value:"assetPnl"}])),k=R((()=>{const{start:e,end:t}=f.value;return{fromTimestamp:e.getTime(),toTimestamp:t.getTime()}})),x=R((()=>{const[e,t]=ua({rangeSize:30,nowDateOffset:-1});return{fromTimestamp:e.getTime(),toTimestamp:t.getTime()}})),W=R((()=>{const{start:e,end:t}=f.value,a=ua({rangeSize:7,nowDateOffset:-1});if(va([e,t],a))return u("t.last.daysInCurrency",{day:7,currency:D.value});const l=ua({rangeSize:30,nowDateOffset:-1});if(va([e,t],l))return u("t.last.daysInCurrency",{day:30,currency:D.value});return`${Ra(e,"yyyy-MM-dd")} ~ ${Ra(t,"yyyy-MM-dd")}`})),F=R((()=>new URLSearchParams({currency:D.value,code:Li[p.type],zoneOffset:gs()}).toString())),B=R((()=>_.value?o.pnlData[p.type]:j(k.value,x.value)?o.pnlData.cumulativePnl[p.type]:w.value)),M=R((()=>{const{fromTimestamp:e,toTimestamp:t}=k.value,{map:a={},timestampList:l=[]}
1=B.value,s=l.findIndex((t=>e<=t)),i=oa(l,(e=>e<=t))+1;let n=0;return l.slice(s,i).map((e=>{let{asset:t=0,realized:l=0,value:s=0,cumulative:i=0,cumulativePercentage:r}=a[e];_.value?n=N(n).plus(s).toNumber():S.value&&"all"!==T.value&&(s="realized"===T.value?l:t);const o={label:Ra(e,"MM-dd"),date:e,asset:t,realized:l,value:s,cumulative:_.value?n:i,isAllZero:N(t||l||i).eq(0)};return _.value||(o.cumulativePercentage=r,o.isAllZero=o.isAllZero&&N(o.cumulativePercentage).eq(0)),o}))})),V=R((()=>{const e=M.value.slice();return e.every((({isAllZero:e})=>e))?[]:e.reverse()})),H=R((()=>Math.max(...M.value.map((({value:e})=>Math.abs(e))))));function G(e){T.value=e}function Y(e){if(L.value)return qe;const t=e||0,a=t<0?`-${A.value}`:t>0?`+${A.value}`:A.value;return Xt(Math.abs(t),{prefix:a,currency:D.value})}function q(e){if(L.value)return qe;const t=H.value>=1e7?{formatKey:"max3",compact:!0,currency:D.value}:{formatKey:2,currency:D.value};return Xt(e,t)}function z(e){if(L.value)return qe;const t=N(e).abs(),a=t.eq(0)?0:t.dp(2).gt(0)?2:5;return`${N(e).toFixed(a)}%`}function j(e,t){return e.fromTimestamp===t.fromTimestamp&&e.toTimestamp===t.toTimestamp}async function X(e=k.value){v.value=!0;try{if(_.value)await o.fetchPnlTrendData({type:p.type,...e});else{const t=j(e,x.value),a=await o.fetchCumulativePnlData({type:p.type,...e,isFetchOnly:!t});t||(w.value=a)}}catch(t){}v.value=!1}return $([()=>l.state.accountInfo.uid,k],(([e])=>e&&X()),{immediate:!0}),$((()=>l.state.accountInfo.uid),(e=>{e&&X(x.value)}),{immediate:!0}),(t,a)=>(n(),r("div",cI,[m(P(xo),null,{default:g((()=>[y("div",dI,[m(P(ad),{dateRange:f.value,"onUpdate:dateRange":a[0]||(a[0]=e=>f.value=e)},null,8,["dateRange"]),S.value?(n(),i(P(jw),{key:0,class:"data-filter-dropdown",list:E.value,selectValue:T.value,handleUpdate:G,height:"32px"},null,8,["list","selectValue"])):d("",!0),t.isFullSize?(n(),r("div",pI)):d("",!0),C.value?(n(),i(P(uI),{key:2,type:e.type,fromDate:P(Ra)(f.value.start,"yyyy-MM-dd"),toDate:P(Ra)(f.value.end,"yyyy-MM-dd"),pnlValue:V.value[0]?V.value[0].cumulative:0},null,8,["type","fromDate","toDate","pnlValue"])):d("",!0)]),a[1]||(a[1]=y("hr",{class:"split"},null,-1)),y("div",yI,[m(P(IL),{isLoading:v.value,isEarnType:_.value,isFuturesType:S.value,pnlList:M.value,futuresTypeDataFilter:T.value,yAxisTickFormatter:q},null,8,["isLoading","isEarnType","isFuturesType","pnlList","futuresTypeDataFilter"]),t.isFullSize?(n(),i(P(aE),{key:0,type:e.type,assetList:e.assetList},null,8,["type","assetList"])):d("",!0)]),y("div",hI,[m(P(bE),{isLoading:v.value,blockTitle:_.value?t.$t("earn.cumulativeRewards"):t.$t("wallets.cumulativePnl"),blockTitleTooltip:t.$t("wallets.futures.cumulativePnlFormula"),pnlList:M.value,yAxisTickFormatter:q},null,8,["isLoading","blockTitle","blockTitleTooltip","pnlList"]),_.value?(n(),r("div",vI)):(n(),i(P(bE),{key:1,isLoading:v.value,blockTitle:`${t.$t("wallets.cumulativePnl")} %`,blockTitleTooltip:t.$t("wallets.futures.cumulativePnlPercentageFormula"),pnlList:M.value,yAxisTickFormatter:z,isPercentage:""},null,8,["isLoading","blockTitle","blockTitleTooltip","pnlList"])),t.isFullSize?d("",!0):(n(),i(P(aE),{key:2,type:e.type,assetList:e.assetList},null,8,["type","assetList"]))])])),_:1,__:[1]}),m(P(KE),{type:e.type,dateTitle:W.value,isLoading:v.value,analysisList:V.value,numberFormatter:Y,percentageFormatter:z,downloadPathname:"report/histories/pnlTrend",downloadQueryString:F.value,dateRange:f.value},null,8,["type","dateTitle","isLoading","analysisList","downloadQueryString","dateRange"]),y("div",mI,[y("p",null,"* "+h(t.$t("wallets.pnl.note1")),1),y("p",null,"* "+h(t.$t("wallets.pnl.note2")),1),y("p",null,"* "+h(t.$t("wallets.pnl.note3")),1)])]))}},[["__scopeId","data-v-5be75dcc"]]),fI={class:"pnl-analysis"},TI={class:"header-container"},wI=vr({__name:"WalletPnlAnalysisView",setup(e){const t=U(),a=sa(),l=pt(),s=dt(),i=ct(),o=ut(),u=ot(),c=rt(),d=V(),{t:p}=I(),h=K({7:0,30:0}),v=K({}),g=R((()=>{switch(d.name){case Ke.WALLET_SPOT_PNL_ANALYSIS:return Ye.SPOT;case Ke.WALLET_FUTURES_PNL_ANALYSIS:return Ye.FUTURES;case Ke.WALLET_AUTO_TRADER_PNL_ANALYSIS:return Ye.AUTO_TRADER;case Ke.WALLET_LEAD_TRADING_PNL_ANALYSIS:return Ye.LEAD_TRADING;case Ke.WALLET_COPY_TRADING_PNL_ANALYSIS:return Ye.COPY_TRADING;case Ke.WALLET_AI_LEAD_TRADING_PNL_ANALYSIS:return Ye.AI_LEAD_TRADING;case Ke.WALLET_AI_COPY_TRADING_PNL_ANALYSIS:return Ye.AI_COPY_TRADING;case Ke.WALLET_FUTURES_BOTS_PNL_ANALYSIS:return Ye.FUTURES_BOTS;case Ke.WALLET_EARN_REWARD_ANALYSIS:return Ye.EARN;default:return Ye.SPOT}})),f=R((()=>{switch(g.value){case Ye.SPOT:return{routeName:"walletSpot",text:p("wallet.backToSpotWallet"),title:p("wallets.spot.pnl.titleFull")};case Ye.FUTURES:return{routeName:"walletFutures",text:p("wallet.backToFuturesWallet"),title:p("wallets.futures.pnl.titleFull")};case Ye.AUTO_TRADER:return{routeName:Ke.WALLET_AUTO_TRADER,text:p("wallet.backToAutoTraderWallet"),title:p("wallets.autoTrader.pnl.titleFull")};case Ye.LEAD_TRADING:return{routeName:Ke.WALLET_LEAD_TRADING,text:p("wallet.backToLeadTradingWallet"),title:p("wallets.leadTrading.pnl.titleFull")};case Ye.COPY_TRADING:return{routeName:Ke.WALLET_COPY_TRADING,text:p("wallet.backToCopyTradingWallet"),title:p("wallets.copyTrading.pnl.titleFull")};case Ye.AI_LEAD_TRADING:return{routeName:Ke.WALLET_AI_LEAD_TRADING,text:p("wallet.backToAiLeadTradingWallet"),title:p("wallets.aiLeadTrading.pnl.titleFull")};case Ye.AI_COPY_TRADING:return{routeName:Ke.WALLET_AI_COPY_TRADING,text:p("wallet.backToAiCopyTradingWallet"),title:p("wallets.aiCopyTrading.pnl.titleFull")};case Ye.FUTURES_BOTS:return{routeName:Ke.WALLET_FUTURES_BOTS,text:p("wallet.backToFuturesBotsWallet"),title:p("wallets.futuresBots.pnl.titleFull")};case Ye.EARN:return{routeName:"walletEarn",text:p("wallet.backToEarnWallet"),title:p("earn.rewardTitle")};default:return{}}})),T=R((()=>
1{if(g.value!==Ye.SPOT)return[];const{currencyMap:e,fiatCurrencyList:a,cryptoCurrencyList:l}=t.state,s=[];return a.concat(l).forEach((t=>{const{total:a=0,displayName:l}=e[t]||{};N(a).gt(0)&&s.push({shortName:l,totalValue:a})})),s})),w=R((()=>{if(g.value!==Ye.FUTURES)return[];if(!t.getters.isUnifiedWallet){const{walletList:e,walletMap:a,walletDisplayMap:l}=t.state.futures,s={};return e.forEach((e=>{const{assets:t=[]}=l[e]||a[e]||{};t.forEach((({currency:e,balance:t})=>{Ei(e)&&(s[e]=N(t).plus(s[e]||0).toNumber())}))})),Object.keys(s).map((e=>({shortName:e,totalValue:s[e]})))}const{assets:e=[]}=a.wallet||{};return e})),D=R((()=>{switch(g.value){case Ye.SPOT:return T.value;case Ye.FUTURES:return w.value;case Ye.AUTO_TRADER:return l.wallet.assets;case Ye.LEAD_TRADING:return s.wallet.assets;case Ye.COPY_TRADING:return i.wallet.assets;case Ye.AI_LEAD_TRADING:return o.wallet.assets;case Ye.AI_COPY_TRADING:return u.wallet.assets;case Ye.FUTURES_BOTS:return c.wallet.assets;case Ye.EARN:return Object.keys(v.value).map((e=>({shortName:e,totalValue:v.value[e]})));default:return{}}}));function A(e){switch(g.value){case Ye.AUTO_TRADER:return l.update(null==e?void 0:e.auto);case Ye.LEAD_TRADING:return s.update(null==e?void 0:e.auto);case Ye.COPY_TRADING:return i.update(null==e?void 0:e.auto);case Ye.AI_LEAD_TRADING:return o.update(null==e?void 0:e.auto);case Ye.AI_COPY_TRADING:return u.update(null==e?void 0:e.auto);case Ye.FUTURES_BOTS:return c.update(null==e?void 0:e.auto);case Ye.EARN:return br().then((({earned:e=[],order:t=[]})=>{h.value=e.reduce(((e,{day:t,totalEarned:a})=>(e[t]=a,e)),{});const a={};t.forEach((({currency:e,investAmt:t})=>{a[e]=N(t).plus(a[e]||0).toNumber()})),v.value=a}));default:return Promise.resolve()}}return $((()=>t.state.accountInfo.uid),((e,t)=>{e&&t&&e!==t&&A()})),j((()=>A({auto:!0}))),q((()=>function(){switch(g.value){case Ye.AUTO_TRADER:return l.removeTimer();case Ye.LEAD_TRADING:return s.removeTimer();case Ye.COPY_TRADING:return i.removeTimer();case Ye.AI_LEAD_TRADING:return o.removeTimer();case Ye.AI_COPY_TRADING:return u.removeTimer();case Ye.FUTURES_BOTS:return c.removeTimer();default:return Promise.resolve()}}())),(e,t)=>(n(),r("div",fI,[y("div",TI,[m(P(UA),{backRouteName:f.value.routeName,linkText:f.value.text,headerTitle:f.value.title},null,8,["backRouteName","linkText","headerTitle"])]),m(P(oL),{type:g.value},null,8,["type"]),m(P(gI),{type:g.value,assetList:D.value},null,8,["type","assetList"])]))}},[["__scopeId","data-v-d3c2851a"]]),DI={EARN:0},AI={name:"WalletNoData",components:{NoDataAvailable:Zt,IconChevronRight:ht},props:{type:{type:Number,required:!0},earnCategoryType:{type:Number,default:Ii.STAKING}},data:()=>({NODATA_TYPE:DI}),computed:{...l(["lang"]),btnText(){return this.type===DI.EARN?this.$t("wallets.earn.earnNow"):""}},methods:{onClicked(){if(this.type===DI.EARN)this.$router.push({name:"earn",params:{lang:this.lang},state:{categoryType:this.earnCategoryType}})}}},bI={class:"no-data-wrap"},_I={class:"no-data-text"},SI={class:"text"};const CI=vr(AI,[["render",function(e,t,a,l,o,u){const c=s("NoDataAvailable"),f=s("BrandButton"),T=s("IconChevronRight");return n(),r("div",bI,[m(c,{emptyText:""}),!a.type===o.NODATA_TYPE.EARN?(n(),r(p,{key:0},[y("p",_I,h(e.$t("msg.noData")),1),u.btnText?(n(),i(f,{key:0,class:"no-data-button",type:"primary",size:"bigger",onClick:u.onClicked},{default:g((()=>[v(h(u.btnText),1)])),_:1},8,["onClick"])):d("",!0)],64)):d("",!0),y("div",{class:"action-wrap",onClick:t[0]||(t[0]=(...e)=>u.onClicked&&u.onClicked(...e))},[y("span",SI,h(e.$t("wallets.earn.earnNow")),1),m(T,{class:"action-icon"})])])}],["__scopeId","data-v-84d3f04c"]]),LI={name:"AutoEarnBanner",components:{IconCross:il,IconChevronRight:ht,AutoEarnEnableDialog:Bp,AutoEarnSettingsDialog:oy},props:{isShowClose:{type:Boolean,default:!0}},setup(){const{isUserEarnAllow:e}=Nt();return{isUserEarnAllow:e}},data:()=>({isShowEnableDialog:!1,isShowSettingsDialog:!1}),computed:{...l(["isDefaultBrand","loginState","lang"]),...t(["isEnabledAutoEarn"]),iconSrc(){return this.isDefaultBrand?Sp:Cp},moreInformationHref(){return gt(this.lang,"AUTO_EARN_FAQ")}},methods:{...c(["updateAutoEarnBannerStatus"]),handleOnCloseEnableAutoEarnDialog(e){const{isOpenSettingDialog:t=!1}=e||{};this.isShowEnableDialog=!1,t&&this.$nextTick((()=>{this.onSettings()}))},onClose(){vt(mt.AUTO_EARN_BANNER),this.updateAutoEarnBannerStatus()},onAutoEarnNow(){this.loginState?this.isShowEnableDialog=!0:this.$router.push({name:"login",params:{lang:this.lang},query:{redirect:this.$route.fullPath}})},onSettings(){this.isShowSettingsDialog=!0}}},EI={class:"auto-earn-banner"},II=["src"],kI={class:"banner-messages"},RI={class:"banner-title"},NI=["src"],xI={class:"banner-description"},PI=["href"],OI={class:"banner-tail"};const $I=vr(LI,[["render",function(e,t,a,l,o,u){const c=s("IconCross"),p=s("IconChevronRight"),f=s("BaseButton"),T=s("AutoEarnEnableDialog"),w=s("AutoEarnSettingsDialog");return n(),r("div",EI,[a.isShowClose&&e.isMobile?(n(),i(c,{key:0,class:"m-close-icon",onClick:u.onClose},null,8,["onClick"])):d("",!0),e.isMobile?d("",!0):(n(),r("img",{key:1,class:"banner-icon",src:u.iconSrc},null,8,II)),y("div",kI,[y("div",RI,[e.isMobile?(n(),r("img",{key:0,class:"banner-icon",src:u.iconSrc},null,8,NI)):d("",!0),y("span",null,h(e.$t("earn.autoEarn.banner.title")),1)]),y("div",xI,h(e.$t("earn.autoEarn.banner.description")),1),u.moreInformationHref?(n(),r("a",{key:0,class:"banner-link",href:u.moreInformationHref,target:"_blank",rel:"noreferrer noopener"},[y("span",null,h(e.$t("t.moreInformation")),1),m(p,{class:"link-icon"})],8,PI)):d("",!0)]),y("div",OI,[e.isEnabledAutoEarn?(n(),i(f,{key:0,class:"primary banner-button",size:"large",disabled:!l.isUserEarnAllow,onClick:u.onSettings},{default:g((()=>[v(h(e.$t("t.settings")),1)])),_:1},8,["disabled","onClick"])):(n(),i(f,{key:1,class:"primary banner-button",size:"large",disabled:!l.isUserEarnAllow,onClick:u.onAutoEarnNow},{default:g((()=>[v(h(e.$t("earn.autoEarn.autoEarnNow")),1)])),_:1},8,["disabled","onClick"])),a.isShowClose&&!e.isMobile?(n(),r("div",{key:2,class:"banner-close",onClick:t[0]||(t[0]=(...e)=>u.onClose&&u.onClose(...e))},[y("span",null,h(e.$t("t.close")),1),m(c,{class:"close-icon"})])):d("",!0)]),o.isShowEnableDialog?(n(),i(T,{key:2,onHandleOnClose:u.handleOnCloseEnableAutoEarnDialog},null,8,["onHandleOnClose"])):d("",!0),o.isShowSettingsDialog?(n(),i(w,{key:3,onHandleOnClose:t[1]||(t[1]=e=>o.isShowSettingsDialog=!1)})):d("",!0)])}],["__scopeId","data-v-e864f8e7"]]);const WI=vr({name:"IconRedeem2",components:{Icon:Tt}},[["render",function(e,t,a,l,r,o){const u=s("Icon");return n(),i(u,{width:"17",height:"17",viewBox:"0 0 17 17","aria-label":"Redeem Icon"},{default:g((()=>t[0]||(t[0]=[y("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.34375 5.23501C3.34375 4.90364 3.61238 4.63501 3.94375 4.63501H13.7992C14.1306 4.63501 14.3992 4.90364 14.3992 5.23501C14.3992 5.56638 14.1306 5.83501 13.7992 5.83501H3.94375C3.61238 5.83501 3.34375 5.56638 3.34375 5.23501Z"},null,-1),y("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.85449 4.63501H13.8892V14.1821C13.8892 15.0657 13.1728 15.7821 12.2892 15.7821H5.45449C4.57084 15.7821 3.85449 15.0657 3.85449 14.1821V4.63501ZM5.05449 5.83501V14.1821C5.05449 14.403 5.23358 14.5821 5.45449 14.5821H12.2892C12.5101 14.5821 12.6892 14.403 12.6892 14.1821V5.83501H5.05449Z"},null,-1),y("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9.21765 9.82651V8.51837C9.51702 8.59212 9.80345 8.70714 10.0677 8.86077C10.1223 8.8713 10.1795 8.8713 10.2341 8.86077C10.4891 8.86517 10.7007 8.6729 10.7053 8.43059C10.7034 8.34631 10.6711 8.26552 10.6129 8.20231C10.2295 7.86959 9.73605 7.67378 9.21769 7.64921V7.18389C9.21306 7.01796 9.06892 6.8854 8.89428 6.8854H8.88411C8.70579 6.88014 8.55701 7.01446 8.55238 7.18389V7.6404C7.65058 7.61493 6.89288 8.27692 6.84299 9.13291C6.84299 10.1425 7.72079 10.4235 8.55238 10.6254V12.1004C8.1643 12.0485 7.79749 11.9002 7.48981 11.6702C7.4131 11.614 7.31885 11.5833 7.22184 11.5824C6.97422 11.5921 6.77832 11.7852 6.77832 12.0214C6.77832 12.1083 6.81158 12.1926 6.8707 12.2584C7.32622 12.6667 7.92591 12.8984 8.55238 12.9081V13.3471V13.3568C8.56347 13.5262 8.71593 13.6553 8.89424 13.6456C9.06887 13.6456 9.21302 13.5131 9.21765 13.3471V12.9082C10.4188 12.8028 10.927 12.1268 10.964 11.3718C10.964 10.3445 10.0492 10.0372 9.21765 9.82651ZM8.55345 9.63352C8.12843 9.5194 7.82351 9.41404 7.82351 9.07165C7.82351 8.72925 8.10993 8.49221 8.55345 8.4483V9.63352ZM9.21788 10.8012V12.1005C9.76304 12.0215 9.97557 11.723 9.97553 11.4333C9.97553 11.1436 9.65216 10.9153 9.21788 10.7924V10.8012Z"},null,-1),y("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.87988 1.79565C2.05146 1.79565 1.37988 2.46723 1.37988 3.29565V6.69879C1.37988 7.52721 2.05146 8.19879 2.87988 8.19879H4.4541V7.19879H2.87988C2.60374 7.19879 2.37988 6.97493 2.37988 6.69879V3.29565C2.37988 3.01951 2.60374 2.79565 2.87988 2.79565H14.8631C15.1392 2.79565 15.3631 3.01951 15.3631 3.29565V6.69879C15.3631 6.97493 15.1392 7.19879
114.8631 7.19879H13.2888V8.19879H14.8631C15.6915 8.19879 16.3631 7.52722 16.3631 6.69879V3.29565C16.3631 2.46723 15.6915 1.79565 14.8631 1.79565H2.87988Z"},null,-1)]))),_:1,__:[0]})}]]),FI=["src"],BI={name:"SubIcon",props:{category:{type:String,default:"funds"},type:{type:String,required:!0},styleObject:{type:Object,required:!0}}};function UI(e){return Xt(e,N(e).dp(2,N.ROUND_DOWN).eq(0)?"max":2)}function MI(e){return ki(`img/funds/${e}/logo.svg`)}function VI(e){switch(e){case Ni.ALL:return Xe("earn_tab_all_products");case Ni.HOT:return Xe("earn_tab_hot");case Ri.FIXED:return Xe("earn_tab_fixed");case Ri.FLEXIBLE:return Xe("earn_tab_flexible");case Ri.STAKING:return Xe("earn_tab_staking");case Ri.LENDING:return Xe("earn_tab_lending");case Ri.FUNDS:return Xe("earn_tab_funds");default:return}}function HI(e,t,a=!1){switch(t){case Ni.ALL:return e(a?"t.allProducts":"earn.allTerm");case Ni.HOT:return e("earn.trendingProducts");case Ri.FIXED:return e(a?"earn.fixedSavings":"wallets.earn.fixed.fixed");case Ri.FLEXIBLE:return e(a?"earn.flexibleSavings":"wallets.earn.flexible.flexible");case Ri.STAKING:return e("earn.stakingTerm");case Ri.LENDING:return e("earn.lendingTerm");case Ri.FUNDS:return e("earn.fundsTerm");default:return""}}function GI(e,t,a){const l=Number(e)||0;return N(l).times(t).div(100).div(Oi).times(a).toNumber()}function YI(e){return e.type===xi.FLEXIBLE?e.investAmt:e.originalInvestAmt}function qI(e){const{duration:t,type:a,endTime:l,startTime:s,interestPayoutFrequency:i}=e;return a===xi.STAKING?t:a===xi.FIXED?Pi(i):Pi(l-s)}function zI(e){const{type:t,rate:a,originalInvestAmt:l,investAmt:s,interestPayoutFrequency:i}=e;switch(t){case xi.FIXED:return GI(l,a,Pi(i));case xi.FLEXIBLE:return GI(s,a,1);case xi.STAKING:case xi.LENDING:return GI(l,a,1);default:return 0}}function KI(e,t){return e.reduce(((e,a)=>e.plus(t(a)||0)),N(0)).toNumber()}function jI(e,t){const a=t.map((e=>e.rate)),l=t.map((e=>e.nextInterestPayoutTime)).filter((e=>e>0)),s=Math.min(...a),i=Math.max(...a),n=s===i?`${UI(s)}%`:`${UI(s)}% - ${UI(i)}%`;return{currency:e,productCount:t.length,totalPrincipal:KI(t,YI),totalInterestEarned:KI(t,(e=>e.interestEarned)),apr:n,nextInterestPayout:KI(t,zI),earliestNextPayoutTime:l.length?Math.min(...l):0}}function XI(e,t,a){return e.slice().sort(((e,l)=>{const s=a(e),i=a(l);return!!s!=!!i?s?-1:1:s&&i&&s.endTime!==i.endTime?s.endTime-i.endTime:t(l)-t(e)}))}const QI={name:"ProductName",components:{BrandIcon:Pa,IconInfo:$i,SubIcon:vr(Object.assign(BI,{setup:e=>(t,a)=>(n(),r("img",{src:P(ki)(`img/${e.category}/${e.type}/main.svg`),class:"sub-icon",style:_(e.styleObject)},null,12,FI))}),[["__scopeId","data-v-7831eab1"]])},props:{product:{type:Object,required:!0},showDurationText:{type:Boolean,default:!1},showSubIcon:{type:Boolean,default:!1},subText:{type:String,default:""},iconSize:{type:Number,default:void 0}},computed:{...l(["currencyMap"]),currency(){return this.currencyMap[this.product.currency]||{}},durationText(){return`${qI(this.product)} ${this.$t("earn.calculator.days")}`},freezeHour(){const{redemptionLockTime:e}=this.product;return e/1e3/3600}}},ZI={class:"product-name"},JI={class:"content-icon-wrap"},ek={class:"name"},tk={key:0,class:"sub-text"},ak={key:1,class:"redeemed-wrap"},lk={class:"text"},sk={key:2,class:"duration"};const ik=vr(QI,[["render",function(e,t,a,l,o,u){const c=s("BrandIcon"),p=s("SubIcon"),v=s("IconInfo"),f=s("ToolTip");return n(),r("div",ZI,[y("div",JI,[m(c,{displayName:u.currency.displayName,shortName:!0,showName:!1,type:u.currency.isFiat?"fiat":"icon",name:u.currency.shortName,size:a.iconSize?a.iconSize:e.isMobile?"24":"16"},null,8,["displayName","type","name","size"]),a.showSubIcon&&a.product.iconName?(n(),i(p,{key:0,type:a.product.iconName,styleObject:{width:"10px",height:"10px",right:"-2px",bottom:"-2px"}},null,8,["type"])):d("",!0)]),y("span",ek,h(a.product.displayCurrency),1),a.subText?(n(),r("span",tk,h(a.subText),1)):d("",!0),a.product.redemptionProcessing?(n(),r("div",ak,[y("span",lk,h(e.$t("earn.redeemed")),1),m(f,{placement:"top",tooltip:e.$t("earn.hrFreeze",{hour:u.freezeHour})},{content:g((()=>[m(v,{class:"icon-info"})])),_:1},8,["tooltip"])])):a.showDurationText?(n(),r("span",sk,h(u.durationText),1)):d("",!0)])}],["__scopeId","data-v-09263d5e"]]),nk={name:"CurrencyValueBlock",props:{value:{type:Number,required:!0},currency:{type:String,required:!0},showDash:{type:Boolean,default:!1}},computed:{...l(["currencyMap","hideWalletPriceValue"]),valueText(){return this.showDash&&0===this.value?"-":this.hideWalletPriceValue?"*****":this.formatValue(this.value)}},methods:{formatValue(e){var t;const a=null==(t=this.currencyMap[this.currency])?void 0:t.isFiat;let l;return e=Number(e)||0,l=a?"fc":e>1e8?"default":"wvc",this.$filters.formatNumber(e,l)}}},rk={class:"currency-value-block"},ok={class:"value"},uk={key:0,class:"currency"};const ck=vr(nk,[["render",function(e,t,a,l,s,i){return n(),r("div",rk,[y("span",ok,h(i.valueText),1),0!==a.value?(n(),r("span",uk,h(a.currency),1)):d("",!0)])}],["__scopeId","data-v-4cf36189"]]),dk={class:"cell-value-block"},pk={class:"postfix"};
1const yk=vr({name:"CellValueBlock",props:{value:{type:[Number,String],required:!0},postfix:{type:String,default:""},textStyle:{type:String,default:""}}},[["render",function(e,t,a,l,s,i){return n(),r("div",dk,[y("span",{class:L(["value",a.textStyle])},h(a.value),3),y("span",pk,h(a.postfix),1),o(e.$slots,"icon",{},void 0,!0)])}],["__scopeId","data-v-16c9c11d"]]),hk={class:"tip-block"},vk={class:"next-interest"};const mk={class:"cell-value-block"},gk={class:"value"},fk={class:"interset"};const Tk=vr({name:"CellPayoutDate",components:{CellPayoutDateTootipBlock:vr({name:"CellPayoutDateTootipBlock",components:{CurrencyValueBlock:ck},props:{product:{type:Object,required:!0}},computed:{calculatorAPR(){const e=Number(this.product.investAmt)||0,{type:t,rate:a,duration:l}=this.product;let s=0;return t===Ii.FLEXIBLE&&(s=Pi(l)),t===Ii.LENDING&&(s=1),N(e).times(a).div(100).div(Wi).times(s).toNumber()}}},[["render",function(e,t,a,l,i,o){const u=s("CurrencyValueBlock");return n(),r("div",hk,[y("span",vk,h(e.$t("earn.nextInterestPayout")),1),m(u,{currency:a.product.currency,value:o.calculatorAPR},null,8,["currency","value"])])}],["__scopeId","data-v-7289763c"]])},props:{product:{type:Object,required:!0}},methods:{formatDate:(e=0)=>0===e?"--":X(e,"yyyy-MM-dd HH:mm")}},[["render",function(e,t,a,l,i,o){const u=s("CellPayoutDateTootipBlock"),c=s("ToolTip");return n(),r("div",mk,[y("span",gk,h(o.formatDate(a.product.nextInterestPayoutTime)),1),m(c,{class:"tooltip-wrap",placement:"top-start",visibleArrow:"",walletEarnStyle:""},{content:g((()=>[y("span",fk,h(e.$t("earn.viewInterestPayout")),1)])),tooltip:g((()=>[m(u,{product:a.product},null,8,["product"])])),_:1})])}],["__scopeId","data-v-287b8d59"]]);function wk(e){const{t:t}=I(),a=Ut(),{now:l}=S(a),{isUserEarnAllow:s}=Nt(),i=R((()=>ne(e).type===xi.STAKING)),n=R((()=>{const t=ne(e).type;return t!==xi.FLEXIBLE&&t!==xi.LENDING})),r=R((()=>!ne(e).autoRenewSupported||!s.value||ne(e).endTime-ne(e).payoutLockTime<=l.value.getTime())),o=R((()=>!ne(e).redemptionProcessing&&ne(e).redeemable)),u=R((()=>{const{type:t}=ne(e);return t===xi.STAKING||t===xi.FIXED})),c=R((()=>HI(t,ne(e).type))),d=R((()=>{const a=ne(e),l=qI(a);if(l<=0)return"";const s=a.type===xi.LENDING?"t.nDayRenewing":"t.nDayTerm";return t(s,{day:l})})),p=R((()=>d.value?`${c.value}ã»${d.value}`:c.value)),y=R((()=>{const t=ne(e);return!!t.redepositNextProductId&&t.autoRenew})),h=R((()=>YI(ne(e)))),v=R((()=>w(ne(e).endTime))),m=R((()=>zI(ne(e)))),g=R((()=>w(ne(e).nextInterestPayoutTime))),f=R((()=>{const t=ne(e);return(t.type===xi.FIXED||t.type===xi.STAKING)&&N(t.interestEarned??0).lte(0)})),T=R((()=>{const{investAmt:t,rate:a,interestEarned:l,interestPayoutFrequency:s}=ne(e),i=N(t).minus(l);return i.eq(0)?0:i.plus(GI(i.toNumber(),a,Pi(s))).toNumber()}));function w(e){return 0===e?"--":X(e,"yyyy-MM-dd HH:mm")}return{isStakingType:i,isDurationLabelShown:n,isAutoRenewDisabled:r,isRedeemAvailable:o,productTypeLabel:c,productTypeAndDurationLabel:p,durationLabel:d,isAutoConvert:y,principalValue:h,endTime:v,nextInterestPayout:m,nextInterestPayoutTime:g,isPaysAtMaturity:f,expectedTotalAmount:T,hasTimeline:u,formatTime:w}}const Dk={key:0,class:"product-name-wrap"},Ak={key:0,class:"provider"},bk={key:1,class:"type"},_k={key:2,class:"price-field-wrapper"},Sk={key:4,class:"price-field-wrapper"},Ck={key:7,class:"price-field-wrapper"},Lk=vr(E({__name:"EarnProductOrderRow",props:{index:{},headerTitles:{},productOrder:{},productCategoryFilter:{}},emits:["autoRenewChanged","showTimeline","redeemRequested"],setup(e,{emit:t}){const a=e,l=t,o=Ut(),{lang:u}=S(o),c=U(),{isStakingType:y,isDurationLabelShown:v,isAutoRenewDisabled:f,isRedeemAvailable:T,productTypeLabel:A,principalValue:b,endTime:_,nextInterestPayout:C,nextInterestPayoutTime:E,expectedTotalAmount:I}=wk(re(a,"productOrder")),k=R((()=>a.productCategoryFilter===Ri.FLEXIBLE)),N=R((()=>a.productCategoryFilter===Ri.STAKING)),O=R((()=>c.state.hideConvertToBaseCurrencyValue)),$=e=>c.state.currencyMap[e]||{};return(e,t)=>{const a=s("RouterLink"),o=s("Cell"),c=s("Row");return n(),i(c,{class:"earn-product-order-row",index:e.index,disableBackgroun
1d:"",disableCssHoverEffect:""},{default:g((()=>[(n(!0),r(p,null,x(e.headerTitles,(s=>(n(),i(o,{key:s.id,textAlign:s.textAlign},{default:g((()=>["currency"===s.id?(n(),r("div",Dk,[m(ik,{product:e.productOrder,showDurationText:P(v)},null,8,["product","showDurationText"]),e.productOrder.category===P(Ri).FUNDS?(n(),r("span",Ak,h(e.$t("t.managedBy"))+" "+h(P(Hl)(e.productOrder.iconName)),1)):d("",!0)])):"type"===s.id?(n(),r("div",bk,h(P(A)),1)):"principal"===s.id?(n(),r("div",_k,[m(By,{priceValue:P(b),currencyName:e.productOrder.currency,isFiat:$(e.productOrder.currency).isFiat,hideConvertToBaseCurrencyValue:O.value},null,8,["priceValue","currencyName","isFiat","hideConvertToBaseCurrencyValue"])])):"rate"===s.id?(n(),i(yk,{key:3,value:e.productOrder.rate,postfix:"%"},null,8,["value"])):"totalInterestsEarned"===s.id?(n(),r("div",Sk,[m(By,{priceValue:e.productOrder.interestEarned,currencyName:e.productOrder.currency,isFiat:$(e.productOrder.currency).isFiat,hideConvertToBaseCurrencyValue:O.value},null,8,["priceValue","currencyName","isFiat","hideConvertToBaseCurrencyValue"])])):"expectedTotalAmount"===s.id?(n(),i(ck,{key:5,currency:e.productOrder.currency,value:P(I)},null,8,["currency","value"])):"endTime"===s.id?(n(),i(yk,{key:6,class:L({"investment-end-data-wrapper":e.productOrder.endTime}),value:P(_),textStyle:"medium"},D({_:2},[N.value?void 0:{name:"icon",fn:g((()=>[P(y)?(n(),r("div",{key:0,class:"action-wrap icon-calendar",onClick:t[0]||(t[0]=t=>l("showTimeline",e.productOrder.id))},[m(da,{class:"icon"})])):d("",!0)])),key:"0"}]),1032,["class","value"])):"nextInterestPayout"===s.id?(n(),r("div",Ck,[m(By,{priceValue:P(C),currencyName:e.productOrder.currency,isFiat:$(e.productOrder.currency).isFiat,hideConvertToBaseCurrencyValue:O.value},null,8,["priceValue","currencyName","isFiat","hideConvertToBaseCurrencyValue"])])):"nextInterestPayoutDate"===s.id?(n(),r(p,{key:8},[k.value?(n(),i(Tk,{key:0,product:e.productOrder},null,8,["product"])):(n(),i(yk,{key:1,value:P(E),textStyle:"medium"},null,8,["value"]))],64)):"autoRenewal"===s.id&&e.productOrder.autoRenewSupported?(n(),i(ll,{key:9,class:"auto-renew-btn",size:"small",modelValue:e.productOrder.autoRenew,disabled:P(f),onClick:t[1]||(t[1]=w((t=>l("autoRenewChanged",e.productOrder.id)),["prevent"]))},null,8,["modelValue","disabled"])):"timeline"===s.id?(n(),r("div",{key:10,class:"action-wrap",onClick:t[2]||(t[2]=t=>l("showTimeline",e.productOrder.id))},[m(da,{class:"icon"})])):"history"===s.id?(n(),i(a,{key:11,class:"action-wrap",to:{name:"historyEarn",params:{lang:P(u)}}},{default:g((()=>[m(at,{class:"icon"})])),_:1},8,["to"])):d("",!0),"redeem"===s.id&&P(T)?(n(),r("div",{key:12,class:"action-wrap",onClick:t[3]||(t[3]=t=>l("redeemRequested",e.productOrder.id))},[m(WI,{class:"icon"})])):d("",!0)])),_:2},1032,["textAlign"])))),128))])),_:1},8,["index"])}}}),[["__scopeId","data-v-e429241c"]]),Ek={class:"scrollable-container"},Ik={class:"inline-flex items-center"},kk={key:0,class:"quote"},Rk={key:0,class:"no-data-row"},Nk={colspan:"100%"},xk=vr(E({__name:"EarnProductOrderList",props:{isLoading:{type:Boolean},productOrderList:{},productCategoryFilter:{}},emits:["autoRenewChanged","showTimeline","redeemRequested"],setup(e,{emit:t}){const a=e,l=t,{t:o}=I(),u=O("currency"),c=O("asc"),v=R((()=>a.productCategoryFilter===Ri.FLEXIBLE)),T=R((()=>a.productCategoryFilter===Ri.FIXED)),w=R((()=>a.productCategoryFilter===Ri.STAKING)),D=R((()=>a.productCategoryFilter===Ri.LENDING)),A=R((()=>a.productCategoryFilter===Ni.ALL||a.productCategoryFilter===Ri.FUNDS)),b=R((()=>[{id:"currency",label:o("earn.product"),textAlign:"left",sortable:!0},{id:"type",label:o("earn.type"),textAlign:"left",sortable:!0,disabled:!A.value},{id:"principal",label:o("earn.principal")},{id:"rate",label:o("earn.interestRate"),sortable:!0},{id:"totalInterestsEarned",label:o("wallets.earn.totalInterestEarned"),tooltip:A.value||w.value?o("earn.tooltip.totalInterestsEarned"):"",disabled:T.value||D.value},{id:"expectedTotalAmount",label:o("earn.expectedTotalAmount"),disabled:!T.value},{id:"endTime",label:o("earn.investmentEndDate"),sortable:!0,disabled:v.value||D.value},{id:"nextInterestPayout",label:D.value?o("earn.interestsPayout"):o("earn.nextInterestPayout"),quote:D.value?"":"(est.)",tooltip:A.value||v.value?o("earn.tooltip.nextInterestPayout"):"",disabled:v.value||T.value||w.value},{id:"nextInterestPayoutDate",label:o("earn.nextInterestPayoutDate"),disabled:T.value||w.value},{id:"autoRenewal",label:o("earn.autoRenewal"),textAlign:"center",shrinkFit:!0,disabled:v.value},{id:"timeline",label:o("earn.timeline"),textAlign:"center",shrinkFit:!0,disabled:!w.value},{id:"history",label:o("earn.history"),shrinkFit:!0,textAlign:"center"},{id:"redeem",label:o("earn.redeem"),shrinkFit:!0,textAlign:"center"}].filter((({disabled:e})=>!e)))),_=R((()=>a.productOrderList.slice().sort(((e,t)=>{const a="asc"===c.value;switch(u.value){case"type":case"rate":case"endTime":return ri(e[u.value],t[u.value],a);default:return Gs(e.currency,t.currency,a)}}))));function S({key:e,order:t}){u.value=e,c.value=t}return(e,t)=>{const a=s("Tooltip"),o=s("HeaderRow"),c=s("DataTable"),v=C("loading");return n(),r("div",Ek,[m(c,{class:"earn-product-order-list fix-first-column",fixHeader:""},{header:g((()=>[m(o,null,{default:g((()=>[(n(!0),r(p,null,x(b.value,(e=>(n(),i(cl,{id:e.id,key:e.id,class:L({"shrink-fit":e.shrinkFit}),currentSortKey:u.value,textAlign:e.textAlign,title:e,onSort:S},{content:g((()=>[y("div",Ik,[y("div",null,h(e.label),1),e.quote?(n(),r("span",kk,h(e.quote),1)):d("",!0),e.tooltip?(n(),i(a,{key:1,tooltip:e.tooltip},{content:g((()=>[m($i,{class:"icon-info"})])),_:2},1032,["tooltip"])):d("",!0)])])),_:2},1032,["id","class","currentSortKey","textAlign","title"])))),128))])),_:1})])),body:g((()=>[(n(!0),r(p,null,x(_.value,((a,s)=>
1(n(),i(Lk,{key:a.id,index:s,headerTitles:b.value,productOrder:a,productCategoryFilter:e.productCategoryFilter,onAutoRenewChanged:t[0]||(t[0]=e=>l("autoRenewChanged",e)),onShowTimeline:t[1]||(t[1]=e=>l("showTimeline",e)),onRedeemRequested:t[2]||(t[2]=e=>l("redeemRequested",e))},null,8,["index","headerTitles","productOrder","productCategoryFilter"])))),128)),0===e.productOrderList.length?f((n(),r("tr",Rk,[y("td",Nk,[m(CI,{type:P(DI).EARN},null,8,["type"])])])),[[v,e.isLoading]]):d("",!0)])),_:1})])}}}),[["__scopeId","data-v-6b819086"]]),Pk=vr(E({__name:"EarnProductCampaignTag",props:{campaignLabel:{}},setup(e){const t=e,a=R((()=>t.campaignLabel===Fi.VIP_EXCLUSIVE?"vip-exclusive":"standard"));return(e,t)=>e.campaignLabel?(n(),r("div",{key:0,class:L(["earn-product-campaign-tag",a.value])},h(e.$t(`earn.campaignLabel.${e.campaignLabel}`)),3)):d("",!0)}}),[["__scopeId","data-v-972b93a9"]]),Ok={key:0,class:"product-name-wrap"},$k={key:0,class:"provider"},Wk={class:"product-line"},Fk={class:"duration is-auto-convert"},Bk={key:1,class:"duration"},Uk={key:2,class:"price-field-wrapper"},Mk={key:4,class:"price-field-wrapper"},Vk={key:0,class:"pays-at-maturity"},Hk={key:5,class:"price-field-wrapper"},Gk=vr(E({__name:"EarnProductOrderGroupedRow",props:{index:{},headerTitles:{},productOrder:{},isMultiTypeFilter:{type:Boolean}},emits:["autoRenewChanged","showTimeline","redeemRequested"],setup(e,{emit:t}){const a=e,l=t,o=Ut(),{lang:u}=S(o),c=U(),{isAutoRenewDisabled:v,isRedeemAvailable:f,productTypeLabel:T,durationLabel:D,isAutoConvert:A,principalValue:b,nextInterestPayout:_,nextInterestPayoutTime:C,isPaysAtMaturity:E,hasTimeline:I}=wk(re(a,"productOrder")),k=R((()=>c.state.hideConvertToBaseCurrencyValue)),N=e=>c.state.currencyMap[e]||{};return(e,t)=>{const a=s("Tooltip"),o=s("RouterLink"),c=s("Cell"),S=s("Row");return n(),i(S,{class:L(["earn-product-order-grouped-row",{"is-show-background":e.isMultiTypeFilter}]),index:e.index,disableBackground:"",disableCssHoverEffect:""},{default:g((()=>[(n(!0),r(p,null,x(e.headerTitles,(s=>(n(),i(c,{key:s.id,textAlign:s.textAlign},{default:g((()=>{var c;return["currency"===s.id?(n(),r("div",Ok,[m(ik,{product:e.productOrder},null,8,["product"]),e.productOrder.category===P(Ri).FUNDS?(n(),r("span",$k,h(e.$t("t.managedBy"))+" "+h(P(Hl)(e.productOrder.iconName)),1)):d("",!0)])):d("",!0),"product"===s.id||"type"===s.id?(n(),r("div",{key:1,class:L(["product-and-duration-wrapper",{"is-type":"type"===s.id}])}
1,[m(Pk,{campaignLabel:null==(c=e.productOrder.campaignInfo)?void 0:c.campaignLabel},null,8,["campaignLabel"]),y("div",Wk,[y("span",null,h(P(T)),1),P(D)?(n(),r(p,{key:0},[t[3]||(t[3]=y("span",{class:"separator"},"ã»",-1)),P(A)?(n(),i(a,{key:0,tooltip:e.$t("earn.autoConvert.tooltip")},{content:g((()=>[y("span",Fk,h(P(D)),1)])),_:1},8,["tooltip"])):(n(),r("span",Bk,h(P(D)),1))],64)):d("",!0)])],2)):"principal"===s.id?(n(),r("div",Uk,[m(By,{class:"price-field",priceValue:P(b),currencyName:e.productOrder.currency,isFiat:N(e.productOrder.currency).isFiat,hideConvertToBaseCurrencyValue:k.value},null,8,["priceValue","currencyName","isFiat","hideConvertToBaseCurrencyValue"])])):"rate"===s.id?(n(),i(yk,{key:3,value:e.productOrder.rate,postfix:"%"},null,8,["value"])):"totalInterestsEarned"===s.id?(n(),r("div",Mk,[P(E)?(n(),r("div",Vk,h(e.$t("t.paysAtMaturity")),1)):(n(),i(By,{key:1,class:"price-field",priceValue:e.productOrder.interestEarned,currencyName:e.productOrder.currency,isFiat:N(e.productOrder.currency).isFiat,hideConvertToBaseCurrencyValue:k.value},null,8,["priceValue","currencyName","isFiat","hideConvertToBaseCurrencyValue"]))])):"nextInterestPayout"===s.id?(n(),r("div",Hk,[m(By,{class:"price-field",priceValue:P(_),currencyName:e.productOrder.currency,isFiat:N(e.productOrder.currency).isFiat,hideConvertToBaseCurrencyValue:k.value},null,8,["priceValue","currencyName","isFiat","hideConvertToBaseCurrencyValue"]),y("div",{class:L(["date",{"has-timeline":P(I)}]),onClick:t[0]||(t[0]=t=>P(I)&&l("showTimeline",e.productOrder.id))},h(P(C)),3)])):"autoRenewal"===s.id&&e.productOrder.autoRenewSupported?(n(),i(ll,{key:6,class:"auto-renew-btn",size:"small",modelValue:e.productOrder.autoRenew,disabled:P(v),onClick:t[1]||(t[1]=w((t=>l("autoRenewChanged",e.productOrder.id)),["prevent"]))},null,8,["modelValue","disabled"])):"history"===s.id?(n(),i(o,{key:7,class:"action-wrap",to:{name:"historyEarn",params:{lang:P(u)}}},{default:g((()=>[m(at,{class:"icon"})])),_:1},8,["to"])):d("",!0),"redeem"===s.id&&P(f)?(n(),r("div",{key:8,class:"action-wrap",onClick:t[2]||(t[2]=t=>l("redeemRequested",e.productOrder.id))},[m(WI,{class:"icon"})])):d("",!0)]})),_:2},1032,["textAlign"])))),128))])),_:1},8,["class","index"])}}}),[["__scopeId","data-v-5a750d75"]]),Yk={key:0,class:"summary-currency"},qk={class:"currency-text"},zk={class:"ticker"},Kk={class:"product-count"},jk={key:1,class:"price-field-wrapper"},Xk={key:2,class:"price-field-wrapper"},Qk={key:3,class:"apr"},Zk={key:4,class:"price-field-wrapper"},Jk={class:"date"},eR=vr(E({__name:"EarnProductOrderSummaryRow",props:{index:{},headerTitles:{},currency:{},summary:{},isExpanded:{type:Boolean}},emits:["toggleExpand"],setup(e,{emit:t}){const a=e,l=t,o=U(),u=R((()=>{var e;return(null==(e=o.state.currencyMap[a.currency])?void 0:e.isFiat)??!1})),c=R((()=>o.state.hideConvertToBaseCurrencyValue)),v=R((()=>a.summary.earliestNextPayoutTime?X(a.summary.earliestNextPayoutTime,"yyyy-MM-dd HH:mm"):"--"));return(e,t)=>{const a=s("Cell"),o=s("Row");return n(),i(o,{class:L(["earn-product-order-summary-row",{"is-expanded":e.isExpanded}]),index:e.index,disableBackground:"",disableCssHoverEffect:"",onClick:t[0]||(t[0]=e=>l("toggleExpand"))},{default:g((()=>[(n(!0),r(p,null,x(e.headerTitles,(t=>(n(),i(a,{key:t.id,textAlign:t.textAlign},{default:g((()=>["product"===t.id?(n(),r("div",Yk,[m(Ka,{class:L(["expand-icon",{expanded:e.isExpanded}])},null,8,["class"]),m(Pa,{name:e.currency,size:"24",showName:!1},null,8,["name"]),y("div",qk,[y("span",zk,h(e.currency),1),y("span",Kk,h(e.$t("t.nProducts",{count:e.summary.productCount})),1)])])):"principal"===t.id?(n(),r("div",jk,[m(By,{class:"price-field",priceValue:e.summary.totalPrincipal,currencyName:e.currency,isFiat:u.value,hideConvertToBaseCurrencyValue:c.value},null,8,["priceValue","currencyName","isFiat","hideConvertToBaseCurrencyValue"])])):"totalInterestsEarned"===t.id?(n(),r("div",Xk,[m(By,{class:"price-field",priceValue:e.summary.totalInterestEarned,currencyName:e.currency,isFiat:u.value,hideConvertToBaseCurrencyValue:c.value},null,8,["priceValue","currencyName","isFiat","hideConvertToBaseCurrencyValue"])])):"rate"===t.id?(n(),r("div",Qk,h(e.summary.apr),1)):"nextInterestPayout"===t.id?(n(),r("div",Zk,[m(By,{class:"price-field",priceValue:e.summary.nextInterestPayout,currencyName:e.currency,isFiat:u.value,hideConvertToBaseCurrencyValue:c.value},null,8,["priceValue","currencyName","isFiat","hideConvertToBaseCurrencyValue"]),y("div",Jk,h(v.value),1)])):d("",!0)])),_:2},1032,["textAlign"])))),128))])),_:1},8,["class","index"])}}}),[["__scopeId","data-v-ea440b0d"]]),tR={CURRENCY:"currency",PRINCIPAL:"principal",INTEREST:"interest",APR:"apr",NEXT_PAYOUT:"nextPayout",TYPE:"type"};function aR(e){const t=U(),a=e=>{var a;return(null==(a=t.state.currencyMap[e])?void 0:a.usdRate)??0},l=e=>N(YI(e)).times(a(e.currency)).toNumber(),s=e=>e.campaignInfo?{endTime:e.activityEndTime??1/0}:null,i=O(null),n=O("asc");function r(e,t){switch(t){case tR.CURRENCY:return e.currency;case tR.PRINCIPAL:return c(e.orders,YI);case tR.INTEREST:return c(e.orders,(e=>e.interestEarned));case tR.APR:return Math.min(...e.orders.map((e=>e.rate)));case tR.NEXT_PAYOUT:return e.summary.earliestNextPayoutTime||1/0;case tR.TYPE:return Math.min(...e.orders.map(qI));default:return 0}}function o(e,t){switch(t){case tR.CURRENCY:return e.currency;case tR.PRINCIPAL:return l(e);case tR.INTEREST:return N(e.interestEarned||0).times(a(e.currency)).toNumber();case tR.APR:return e.rate;case tR.NEXT_PAYOUT:return e.nextInterestPayoutTime||1/0;case tR.TYPE:return qI(e);default:return 0}}function u(e,t,a){return"string"==typeof e||"string"==typeof t?a*String(e).localeCompare(String(t)):a*(e-t)}function c(e,t){return e.reduce(((e,l)=>e.plus(N(t(l)||0).times(a(l.currency)))),N(0)).toNumber()}const d=R((()=>{const t=function(e,{getUsdValue:t,getCampaign:a}){const l=a??(()=>null);return e.map((e=>({group:{...e,orders:XI(e.orders,t,l)},subtotal:KI(e.orders,t)}))).sort(((e,t)=>t.subtotal-e.subtotal)).map((({group:e})=>e))}(function(e){const t=new Map;return e.forEach((e=>{const a=t.get(e.currency);a?a.push(e):t.set(e.currency,[e])})),Array.from(t,(([e,t])=>({currency:e,orders:t,summary:jI(e,t)})))}(ne(e)),{getUsdValue:l,getCampaign:s});if(!i.value)return t;const a=i.value,c="asc"===n.value?1:-1;return t.map((e=>({group:{...e,orders:e.orders.slice().sort(((e,t)=>u(o(e,a),o(t,a),c)))},value:r(e,a)}))).sort(((e,t)=>u(e.value,t.value,c))).map((({group:e})=>e))})),p=O(new Set);return{groupedList:d,sortKey:i,sortOrder:n,setSortData:function({key:e,order:t}){i.value=e,n.value=t},isExpanded:e=>p.value.has(e),toggleExpand:e=>{const t=new Set(p.value);t.has(e)?t.delete(e):t.add(e),p.value=t}
1,expandedCurrencies:p}}const lR={class:"scrollable-container"},sR={class:"inline-flex items-center"},iR={key:0,class:"no-data-row"},nR={colspan:"100%"},rR=vr(E({__name:"EarnProductOrderGroupedList",props:{isLoading:{type:Boolean},productOrderList:{},productCategoryFilter:{}},emits:["autoRenewChanged","showTimeline","redeemRequested"],setup(e,{emit:t}){const a=e,l=t,{t:o}=I(),{groupedList:u,sortKey:c,setSortData:v,isExpanded:T,toggleExpand:w}=aR((()=>a.productOrderList)),D=R((()=>a.productCategoryFilter===Ni.ALL||a.productCategoryFilter===Ri.FUNDS)),A=R((()=>[{id:"product",label:o("earn.product"),textAlign:Bi.left,sortable:!0,sortKey:tR.CURRENCY,disabled:!D.value},{id:"currency",label:o("earn.product"),textAlign:Bi.left,sortable:!0,sortKey:tR.CURRENCY,disabled:D.value},{id:"type",label:o("earn.type"),textAlign:Bi.left,sortable:!0,sortKey:tR.TYPE,disabled:D.value},{id:"principal",label:o("earn.principal"),textAlign:Bi.right,sortable:!0,sortKey:tR.PRINCIPAL},{id:"totalInterestsEarned",label:o("earn.accumulatedInterestEarned"),textAlign:Bi.right,sortable:!0,tooltip:o("earn.wallet.accumulatedInterestEarned.tooltip"),sortKey:tR.INTEREST},{id:"rate",label:o("earn.apr"),textAlign:Bi.right,sortable:!0,sortKey:tR.APR,tooltip:o("earn.wallet.apr.tooltip")},{id:"nextInterestPayout",label:o("earn.nextInterestPayout"),textAlign:Bi.right,sortable:!0,tooltip:o("earn.wallet.nextInterestPayout.tooltip"),sortKey:tR.NEXT_PAYOUT},{id:"autoRenewal",label:o("earn.autoRenew"),textAlign:Bi.center,shrinkFit:!0,tooltip:o("earn.wallet.autoRenew.tooltip")},{id:"history",label:o("earn.history"),textAlign:Bi.center,shrinkFit:!0},{id:"redeem",label:o("earn.redeem"),textAlign:Bi.center,shrinkFit:!0}].filter((e=>!e.disabled))));function b({key:e,order:t}){v({key:e||null,order:"desc"===t?"desc":"asc"})}return(e,t)=>{const a=s("Tooltip"),o=s("HeaderRow"),v=s("DataTable"),_=C("loading");return n(),r("div",lR,[m(v,{class:"earn-product-order-grouped-list",fixHeader:""},{header:g((()=>[m(o,null,{default:g((()=>[(n(!0),r(p,null,x(A.value,(e=>(n(),i(cl,{id:e.sortKey??e.id,key:e.id,class:L({"shrink-fit":e.shrinkFit}),currentSortKey:P(c)??"",textAlign:e.textAlign,title:e,onSort:b},{content:g((()=>[y("div",sR,[y("div",null,h(e.label),1),e.tooltip?(n(),i(a,{key:0,tooltip:e.tooltip},{content:g((()=>[m($i,{class:"icon-info"})])),_:2},1032,["tooltip"])):d("",!0)])])),_:2},1032,["id","class","currentSortKey","textAlign","title"])))),128))])),_:1})])),body:g((()=>[(n(!0),r(p,null,x(P(u),((e,a)=>(n(),r(p,{key:e.currency},[D.value?(n(),i(eR,{key:0,index:a,headerTitles:A.value,currency:e.currency,summary:e.summary,isExpanded:P(T)(e.currency),onToggleExpand:t=>P(w)(e.currency)},null,8,["index","headerTitles","currency","summary","isExpanded","onToggleExpand"])):d("",!0),P(T)(e.currency)||!D.value?(n(!0),r(p,{key:1},x(e.orders,((e,a)=>(n(),i(Gk,{key:e.id,index:a,isMultiTypeFilter:D.value,headerTitles:A.value,productOrder:e,onAutoRenewChanged:t[0]||(t[0]=e=>l("autoRenewChanged",e)),onShowTimeline:t[1]||(t[1]=e=>l("showTimeline",e)),onRedeemRequested:t[2]||(t[2]=e=>l("redeemRequested",e))},null,8,["index","isMultiTypeFilter","headerTitles","productOrder"])))),128)):d("",!0)],64)))),128)),0===P(u).length?f((n(),r("tr",iR,[y("td",nR,[m(CI,{type:P(DI).EARN},null,8,["type"])])])),[[_,e.isLoading]]):d("",!0)])),_:1})])}}}),[["__scopeId","data-v-22c57bee"]]),oR={class:"data-row flex-box justify-between"},uR={class:"title-wrap"},cR={key:0,class:"value-wrapper flex-box"},dR={key:1,class:"value-wrapper flex-box"},pR={class:"value"},yR={class:"postfix"},hR={class:"currency"},vR=vr(E({__name:"DataRow",props:{isPriceField:{type:Boolean,default:!1},title:{default:""},value:{default:""},postfix:{default:""},currency:{default:""},tooltipText:{default:""}},setup(e){const t=U(),a=R((()=>t.state.hideConvertToBaseCurrencyValue));return(e,l)=>{return n(),r("div",oR,[y("div",uR,[y("span",null,h(e.title),1),e.tooltipText?(n(),i(os,{key:0,tooltip:e.tooltipText},{content:g((()=>[m($i,{class:"icon-info"})])),_:1},8,["tooltip"])):d("",!0)]),e.isPriceField?(n(),r("div",cR,[m(By,{class:"price-field",priceValue:e.value,currencyName:e.currency,isFiat:(s=e.currency,t.state.currencyMap[s]||{}).isFiat,hideConvertToBaseCurrencyValue:a.value},null,8,["priceValue","currencyName","isFiat","hideConvertToBaseCurrencyValue"])])):(n(),r("div",dR,[y("div",pR,h(e.value),1),y("div",yR,h(e.postfix),1),y("div",hR,h(e.currency),1)]))]);var s}}}),[["__scopeId","data-v-2fd2a019"]]),mR={class:"product-header"},gR={class:"product-line-wrap"},fR={class:"product-line"},TR={class:"duration is-auto-convert"},wR={key:1,class:"duration"},DR={key:0,class:"provider"},AR={class:"grouped-row row-border-top next-payout-row"},bR={class:"next-payout-title"},_R={class:"next-payout-value"},SR={class:"bottom-wrapper row-border-top"},CR={key:0,class:"auto-renew"},LR={class:"auto-renew-label"},ER={class:"actions"},IR=vr(E({__name:"EarnProductOrderGroupedBlock",props:{productOrder:{},isMultiTypeFilter:{type:Boolean}},emits:["autoRenewChanged","showTimeline","redeemRequested"],setup(e,{emit:t}){const a=e,l=t,o=Ut(),{lang:u}=S(o),c=U(),{isAutoRenewDisabled:f,isRedeemAvailable:T,productTypeLabel:D,durationLabel:A,isAutoConvert:b,principalValue:_,nextInterestPayout:C,nextInterestPayoutTime:E,isPaysAtMaturity:I,hasTimeline:k}=wk(re(a,"productOrder")),N=R((()=>c.state.hideConvertToBaseCurrencyValue));return(e,t)=>{var a;const o=s("Tooltip"),S=s("BaseButton");return n(),r("div",{class:L(["earn-product-order-grouped-block",{"is-show-background":e.isMultiTypeFilter}])},[y("div",mR,[y("div",gR,[y("div",fR,[e.isMultiTypeFilter?d("",!0):(n(),i(ik,{key:0,class:"product-name",product:e.productOrder,iconSize:16},null,8,["product"])),y("span",null,h(P(D)),1),P(A)?(n(),r(p,{key:1},[t[3]||(t[3]=y("span",{class:"separator"},"ã»",-1)),P(b)?(n(),i(o,{key:0,tooltip:e.$t("earn.autoConvert.tooltip")},{content:g((()=>[y("span",TR,h(P(A)),1)])),_:1},8,["tooltip"])):(n(),r("span",wR,h(P(A)),1))],64)):d("",!0)]),e.productOrder.category===P(Ri).FUNDS?(n(),r("div",DR,h(e.$t("t.managedBy"))+" "+h(P(Hl)(e.productOrder.iconName)),1)):d("",!0)]),m(Pk,{campaignLabel:null==(a=e.productOrder.campaignInfo)?void 0:a.campaignLabel},null,8,["campaignLabel"])]),m(vR,{class:"principal-row",title:e.$t("earn.principal"),value:P(_),currency:e.productOrder.currency,isPriceField:""},null,8,["title","value","currency"]),P(I)?(n(),i(vR,{key:0,class:"grouped-row row-border-top",title:e.$t("earn.accumulatedInterestEarned"),value:e.$t("t.paysAtMaturity")},null,8,["title","value"])):(n(),i(vR,{key:1,class:"grouped-row row-border-top",title:e.$t("earn.accumulatedInterestEarned"),value:e.productOrder.interestEarned,currency:e.productOrder.currency,isPriceField:""},null,8,["title","value","currency"])),m(vR,{class:"grouped-row row-border-top",title:e.$t("earn.apr"),value:e.productOrder.rate,postfix:"%"},null,8,["title","value"]),y("div",AR,[y("span",bR,h(e.$t("earn.nextInterestPayout")),1),y("div",_R,[m(By,{priceValue:P(C),currencyName:e.productOrder.currency,isFiat:(R=e.productOrder.currency,c.state.currencyMap[R]||{}).isFiat,hideConvertToBaseCurrencyValue:N.value},null,8,["priceValue","currencyName","isFiat","hideConvertToBaseCurrencyValue"]),y("div",{class:L(["next-payout-date",{"has-timeline":P(k)}]),onClick:t[0]||(t[0]=t=>P(k)&&l("showTimeline",e.productOrder.id))},h(P(E)),3)])]),y("div",SR,[e.productOrder.autoRenewSupported?(n(),r("div",CR,[y("div",LR,h(e.$t("earn.autoRenew")),1),m(ll,{class:"auto-renew-btn",modelValue:e.productOrder.autoRenew,disabled:P(f),size:"small",onClick:t[1]||(t[1]=w((t=>l("autoRenewChanged",e.productOrder.id)),["prevent"]))},null,8,["modelValue","disabled"])])):d("",!0),y("div",ER,[m(S,{class:"action-btn outline-primary",as:P(oe),to:{name:"historyEarn",params:{lang:P(u)}},size:P(qs).S},{default:g((()=>[v(h(e.$t("router.history")),1)])),_:1},8,["as","to","size"]),m(S,{class:"action-btn outline-primary",size:P(qs).S,disabled:!P(T),onClick:t[2]||(t[2]=t=>l("redeemRequested",e.productOrder.id))},{default:g((()=>[v(h(e.$t("earn.redeem")),1)])),_:1},8,["size","disabled"])])])],2);var R}}}),[["__scopeId","data-v-c34d2a5b"]]),kR={class:"earn-product-order-grouped-block-list"},RR=["onClick"],NR={class:"summary-left"},xR={class:"currency-text"},PR={class:"ticker"},OR={class:"product-count"},$R={class:"summary-right"},WR={class:"apr"},FR={class:"next-payout"},BR={key:0,class:"no-data-wrap"},UR=vr(E({__name:"EarnProductOrderGroupedBlockList",props:{isLoading:{type:Boolean},productOrderList:{},productCategoryFilter:{}},emits:["autoRenewChanged","showTimeline","redeemRequested"],setup(e,{emit:t}){const a=e,l=t,{groupedList:s,isExpanded:o,toggleExpand:u}=aR((()=>a.productOrderList)),c=R((()=>a.productCategoryFilter===Ni.ALL||a.productCategoryFilter===Ri.FUNDS));return(e,t)=>{const a=C("loading");return n(),r("div",kR,[(n(!0),r(p,null,x(P(s),(a=>{return n(),r("div",{key:a.currency,class:"currency-band"},[c.value?(n(),r("div",{key:0,class:"summary-card",onClick:e=>P(u)(a.currency)},[y("div",NR,[m(Ka,{class:L(["expand-icon",{expanded:P(o)(a.currency)}])},null,8,["class"]),m(Pa,{name:a.currency,size:"24",showName:!1},null,8,["name"]),y("div",xR,[y("span",PR,h(a.currency),1),y("span",OR,h(e.$t("t.nProducts",{count:a.summary.productC
1ount})),1)])]),y("div",$R,[y("span",WR,h(a.summary.apr),1),y("span",FR,h(e.$t("t.nextDate",{date:(s=a.summary.earliestNextPayoutTime,s?X(s,"yyyy-MM-dd"):"--")})),1)])],8,RR)):d("",!0),P(o)(a.currency)||!c.value?(n(!0),r(p,{key:1},x(a.orders,(e=>(n(),i(IR,{key:e.id,productOrder:e,isMultiTypeFilter:c.value,onAutoRenewChanged:t[0]||(t[0]=e=>l("autoRenewChanged",e)),onShowTimeline:t[1]||(t[1]=e=>l("showTimeline",e)),onRedeemRequested:t[2]||(t[2]=e=>l("redeemRequested",e))},null,8,["productOrder","isMultiTypeFilter"])))),128)):d("",!0)]);var s})),128)),0===P(s).length?f((n(),r("div",BR,[m(CI,{type:P(DI).EARN},null,8,["type"])])),[[a,e.isLoading]]):d("",!0)])}}}),[["__scopeId","data-v-76e02553"]]),MR={class:"row-title"},VR=vr(E({__name:"RowDataBlock",props:{title:{default:""},postfix:{default:""},value:{},isColumn:{type:Boolean,default:!1},currency:{}},setup(e){const t=U(),a=R((()=>t.state.hideConvertToBaseCurrencyValue));return(e,l)=>{return n(),r("div",{class:L(["row-data-block",{"is-column":e.isColumn}])},[y("span",MR,h(e.title),1),y("div",{class:L(["value-block",{"is-column":e.isColumn}])},[m(By,{class:"price-field",priceValue:e.value,currencyName:e.currency,isFiat:(s=e.currency,t.state.currencyMap[s]||{}).isFiat,hideConvertToBaseCurrencyValue:a.value},null,8,["priceValue","currencyName","isFiat","hideConvertToBaseCurrencyValue"])],2)],2);var s}}}),[["__scopeId","data-v-d52473d9"]]),HR={class:"earn-product-order-block"},GR={class:"product-name-wrap"},YR={key:0,class:"provider"},qR={key:0,class:"renew-wrap"},zR={class:"text"},KR={class:"show-more-text"},jR={key:3,class:"more-info-wrapper"},XR={class:"next-payout-date flex-box justify-between"},QR={class:"next-payout-date-quote-wrap"},ZR={class:"text"},JR={class:"text"},eN={class:"text"},tN=vr(E({__name:"EarnProductOrderBlock",props:{productOrder:{},productCategoryFilter:{},isActive:{type:Boolean}},emits:["toggleDetail","autoRenewChanged","showTimeline","redeemRequested"],setup(e,{emit:t}){const a=e,l=t,o=Ut(),{lang:u}=S(o),{isStakingType:c,isDurationLabelShown:f,isAutoRenewDisabled:T,isRedeemAvailable:D,productTypeLabel:A,principalValue:b,endTime:_,nextInterestPayout:C,nextInterestPayoutTime:E,expectedTotalAmount:I}=wk(re(a,"productOrder")),k=R((()=>a.productOrder.type===xi.FLEXIBLE)),N=R((()=>a.productOrder.type===xi.FIXED));return(e,t)=>{const a=s("Tooltip"),o=s("RouterLink");return n(),r("div",HR,[y("div",GR,[m(ik,{product:e.productOrder,subText:P(A),showDurationText:P(f)},null,8,["product","subText","showDurationText"]),e.productOrder.category===P(Ri).FUNDS?(n(),r("div",YR,h(e.$t("t.managedBy"))+" "+h(P(Hl)(e.productOrder.iconName)),1)):d("",!0)]),m(VR,{title:e.$t("earn.principal"),value:P(b),postfix:e.productOrder.currency,productOrder:e.productOrder,currency:e.productOrder.currency,isColumn:""},null,8,["title","value","postfix","productOrder","currency"]),m(vR,{title:e.$t("earn.interestRate"),value:e.productOrder.rate,postfix:"%"},null,8,["title","value"]),N.value?(n(),i(VR,{key:0,title:e.$t("earn.expectedTotalAmount"),value:P(Xt)(P(I),"max8"),postfix:e.productOrder.currency,currency:e.productOrder.currency,productOrder:e.productOrder},null,8,["title","value","postfix","currency","productOrder"])):d("",!0),k.value||P(c)?(n(),i(vR,{key:1,title:e.$t("earn.totalInterestsEarned"),value:e.productOrder.interestEarned,currency:e.productOrder.currency,tooltipText:e.$t("earn.tooltip.totalInterestsEarned"),isPriceField:""},null,8,["title","value","currency","tooltipText"])):d("",!0),N.value||P(c)?(n(),i(vR,{key:2,title:e.$t("earn.investmentEndDate"),value:P(_)},null,8,["title","value"])):d("",!0),y("div",{class:L(["auto-renew",[e.productOrder.autoRenewSupported?"justify-between":"justify-end"]])},[e.productOrder.autoRenewSupported?(n(),r("div",qR,[m(ll,{class:"auto-renew-btn",modelValue:e.productOrder.autoRenew,disabled:P(T),onClick:t[0]||(t[0]=w((t=>l("autoRenewChanged",e.productOrder.id)),["prevent"]))},null,8,["modelValue","disabled"]),y("span",zR,h(e.$t("earn.transferDialog.autoRenewal")),1)])):d("",!0),y("div",{class:"icon-wrapper",onClick:t[1]||(t[1]=t=>l("toggleDetail",e.productOrder.id))},[y("span",KR,h(e.isActive?e.$t("t.less"):e.$t("t.more")),1),m(ht,{class:L(["open-detail-icon",{active:e.isActive}])},null,8,["class"])])],2),e.isActive?(n(),r("div",jR,[N.value?d("",!0):(n(),r(p,{key:0},[m(vR,{title:e.$t("earn.nextInterestPayout"),value:P(Xt)(P(C),"max8"),currency:e.productOrder.currency,isPriceField:""},null,8,["title","value","currency"]),y("div",XR,[y("div",QR,[t[4]||(t[4]=y("span",{class:"next-payout-date-quote"},"(est.)",-1)),k.value||P(c)?(n(),i(a,{key:0,tooltip:e.$t("earn.tooltip.nextInterestPayout")}
1,{content:g((()=>[m($i,{class:"icon-info"})])),_:1},8,["tooltip"])):d("",!0)]),v(" "+h(P(E)),1)])],64)),y("div",{class:L(["actions-wrap",{"is-redeeming":e.productOrder.redemptionProcessing}])},[P(c)?(n(),r("div",{key:0,class:"action-btn button-calendar",onClick:t[2]||(t[2]=t=>l("showTimeline",e.productOrder.id))},[m(da,{class:"icon"}),y("span",ZR,h(e.$t("earn.timeline")),1)])):d("",!0),m(o,{class:"action-btn button-history",to:{name:"historyEarn",params:{lang:P(u)}}},{default:g((()=>[m(at,{class:"icon"}),y("span",JR,h(e.$t("router.history")),1)])),_:1},8,["to"]),P(D)?(n(),r("div",{key:1,class:"action-btn button-redeem",onClick:t[3]||(t[3]=t=>l("redeemRequested",e.productOrder.id))},[m(WI,{class:"icon"}),y("span",eN,h(e.$t("earn.redeem")),1)])):d("",!0)],2)])):d("",!0)])}}}),[["__scopeId","data-v-58beb8fd"]]),aN={name:"AmountWrap",components:{IconConvertTo:Pe},inject:{openConvertDialog:{type:Function,default:()=>{}}},props:{amount:{type:[String,Number],default:""},type:{type:Number,default:-1},availAmount:{type:Number,default:0},minInvestAmt:{type:Number,default:0},maxInvestAmt:{type:Number,default:0},currency:{type:String,default:""},closeDialog:{type:Function,default:()=>({})},showConvert:{type:Boolean,default:!0},isSelectEventDay:{type:Boolean,default:!1},eventData:{type:Object,default:()=>({})},inputDisabled:{type:Boolean,default:!1},isRedeem:{type:Boolean,default:!1}},emits:["update:amount","update:amountError"],data(){return{amountModel:String(this.amount),isError:!1,errMsg:null}},computed:{...l(["currencyMap"]),amountTypeText(){return this.isRedeem?this.$t("earn.transferDialog.redemptionAmount"):this.$t("earn.transferDialog.amount")},amountUnitText(){return this.isRedeem?this.$t("earn.transferDialog.total"):this.isMobile?this.$t("earn.transferDialog.bal"):this.$t("t.availableBalance")},userAmount(){var e;return(null==(e=this.currencyMap[this.currency])?void 0:e.isFiat)?this.formatValue(this.availAmount,"fc"):Math.floor(this.availAmount)>1e9?this.formatValue(this.availAmount,"default"):this.formatValue(this.availAmount,"max8")},disabled(){return this.isSelectEventDay&&this.eventData.isSoldOut},getPlaceholder(){if(this.isSelectEventDay){if(this.eventData.isSoldOut)return"";return`${this.formatValue(this.eventData.minSize,"max")}~${this.formatValue(this.eventData.dailyLimit,"max")}`}const e=this.minInvestAmt>0,t=this.maxInvestAmt>0,a=this.formatValue(this.minInvestAmt,"max"),l=this.formatValue(this.maxInvestAmt,"max");return t?`${a}~${l}`:e?`Min ${a}`:""}},watch:{availAmount(){this.checkErrorMsg()},isSelectEventDay(){this.amountModel&&this.checkErrorMsg()},amountModel:{immediate:!0,handler(e,t){this.isError=!1,this.errMsg=null,""!==e?(this.checkErrorMsg(),isNaN(Number(e))&&this.$nextTick((()=>{this.amountModel=t})),this.$emit("update:amount",e)):this.$emit("update:amount","")}},isError:{immediate:!0,handler(e){this.$emit("update:amountError",e)}}},created(){(this.maxInvestAmt&&this.amount>this.maxInvestAmt||this.minInvestAmt&&this.amount<this.minInvestAmt)&&this.$nextTick((()=>{this.amountModel=""}))},mounted(){this.init(),this.$nextTick((()=>{const e=this.isSelectEventDay?this.eventData.minSize:this.minInvestAmt,t=this.isSelectEventDay?this.eventData.dailyLimit:this.maxInvestAmt;(t&&this.amount>t||e&&this.amount<e||this.isSelectEventDay&&this.eventData.isSoldOut)&&(this.amountModel="")}))},methods:{init(){this.amountModel=String(this.amount)},formatValue(e,t="max"){return this.$filters.formatNumber(e,t)},maxClicked(){if(this.inputDisabled)return;const e=this.isSelectEventDay?this.eventData.dailyLimit:this.maxInvestAmt;this.amountModel=N(0!==e?Math.min(Ui(this.formatValue(this.availAmount)),e):Ui(this.formatValue(this.availAmount))).toString()},checkErrorMsg(){if(this.isError=!1,this.errMsg=null,this.disabled)return;if(0===Number(this.amountModel)||!/^\d+(\.\d{0,8})?$/.test(this.amountModel))return void(this.isError=!0);const e=this.isSelectEventDay?this.eventData.minSize:this.minInvestAmt,t=this.isSelectEventDay?this.eventData.dailyLimit:this.maxInvestAmt,a=Number(this.amountModel);if(e>0&&a<e){const t=this.formatValue(e,"max");return this.isError=!0,void(this.errMsg=this.$t("t.lessThanMinimumAmount",{number:t}))}if(t>0&&a>t){const e=this.formatValue(t,"max");return this.isError=!0,void(this.errMsg=this.$t("t.exceedsMaximumAmount",{number:e}))}return a>Ui(this.availAmount)?(this.isError=!0,void(this.errMsg=this.$t("earn.invalidInvestmentAmount"))):void 0},convertClicked(e){this.openConvertDialog(e.slice(1),e),this.closeDialog()}}},lN={class:"amount-wrap"},sN={class:"user-amount-wrapper"},iN={class:"amount-text"},nN={class:"amount-avail-wrap"},rN={class:"user-amount"},oN={class:"amount-input-currency"},uN={key:0,class:"error-msg"},cN={key:1,class:"amount-convert-button-wrap"},dN={class:"amount-convert-text"};const pN=vr(aN,[["render",function(e,t,a,l,i,o){const u=s("Brand
1Button"),c=s("BrandInput"),p=s("IconConvertTo");return n(),r("div",lN,[y("div",sN,[y("p",iN,h(o.amountTypeText),1),y("div",nN,[y("span",null,h(o.amountUnitText),1),y("span",rN,h(o.userAmount),1),y("span",null,h(a.currency),1)])]),m(c,{value:i.amountModel,"onUpdate:value":t[0]||(t[0]=e=>i.amountModel=e),class:L(["amount-input",{"input-disabled":a.inputDisabled}]),textAlign:"right",isBrandNewStyle:"",placeholder:o.getPlaceholder,isError:i.isError,disabled:a.inputDisabled},{suffix:g((()=>[m(u,{class:"max-btn",type:"text",size:"fit",onClick:o.maxClicked},{default:g((()=>[v(h(e.$t("t.max.uppercase")),1)])),_:1},8,["onClick"]),y("p",oN,h(a.currency),1)])),_:1},8,["value","class","placeholder","isError","disabled"]),i.errMsg?(n(),r("span",uN,h(i.errMsg),1)):d("",!0),a.showConvert?(n(),r("div",cN,[y("button",{class:"amount-convert-button",onClick:t[1]||(t[1]=e=>o.convertClicked(a.currency))},[y("p",dN,h(e.$t("earn.transferDialog.convertNow")),1),m(p,{class:"amount-convert-icon"})])])):d("",!0)])}],["__scopeId","data-v-d35f303c"]]),yN={name:"RedeemDialog",components:{BrandDialog:wt,BrandIcon:Pa,AmountWrap:pN,IconError:Na},inject:{getInvestData:{type:Function,default:()=>{}},context:{type:Object,default:()=>({})}},props:{type:{type:Number,required:!0},show:{type:Boolean,default:!1},product:{type:Object,default:()=>({})}},emits:["update:show"],data:()=>({amount:"",btnLoading:!1,isAmountError:!1,currentTime:Date.now()}),computed:{...l(["currencyMap"]),currencyData(){return this.currencyMap[this.product.currency]},isShowInputAmount(){return this.isFlexibleType},isRedeemButtonDisabled(){if(!this.isFlexibleType)return!1;const e=N(this.amount||0);return e.dp()>8||e.lte(0)||e.gt(this.product.investAmt)},principalValue(){return this.product.originalInvestAmt},redemptionAmount(){const{originalInvestAmt:e,investAmt:t}=this.product||{};return this.isPartialPayoutEarlyRedeem?N(e).plus(this.partialPayoutInterest).toNumber():this.isNotPassPayoutTime?e:t},executedInterestTenor(){return Math.floor((this.currentTime-this.product.interestStartDate)/864e5)},partialPayoutInterest(){const{originalInvestAmt:e,rate:t,discountedRateForEarlyRedemption:a}=this.product;return N(e).times(t).div(100).times(a).times(this.executedInterestTenor).div(365)},buttonText(){if(this.btnLoading)return this.$t("t.processing");switch(this.type){case xi.FIXED:case xi.STAKING:return this.$t("earn.redeemDialog.redeemAnyway");default:return this.$t("msg.redeem")}},interestEarnedText(){return this.isStakingType||this.isFixedType?this.$t("earn.unearnedInterest"):this.$t("earn.redeemDialog.interestEarned")},interestEarn(){if(this.isFixedType){const e=this.getTotalAmount(this.product);let t=N(e).minus(this.product.investAmt);return this.isPartialPayoutEarlyRedeem&&(t=t.minus(this.partialPayoutInterest)),t.toNumber()}return this.product.interestEarned},isStakingType(){return this.type===xi.STAKING},isFixedType(){return this.type===xi.FIXED},isFlexibleType(){return this.type===xi.FLEXIBLE},freezeHour(){const{redemptionLockTime:e}=this.product;return e/1e3/3600},isNotPassPayoutTime(){const{nextInterestPayoutTime:e,endTime:t}=this.product||{};return this.isStakingType||this.isFixedType?this.currentTime<t:this.currentTime<e},minInterestPayoutDays(){const{minInterestPayoutTenor:e}=this.product;return void 0===e?e:0!==e?Pi(e):0},isPartialPayoutEarlyRedeem(){return this.type===xi.FIXED&&void 0!==this.minInterestPayoutDays&&(0!==this.minInterestPayoutDays&&this.executedInterestTenor>=this.minInterestPayoutDays)},earlyRedemptionInterestPercentage(){const{rate:e,discountedRateForEarlyRedemption:t}=this.product;return UI(N(e).times(t).toNumber())}},methods:{e2eID:Xe,...e(nt,{fetchEarnWallet:"update"}),isEarlyRedeem:e=>[xi.FIXED,xi.STAKING].includes(e),redeemOnclick(){this.btnLoading=!0,this.currentTime=Date.now();const e=this.isFlexibleType?this.amount:this.redemptionAmount;Oa.postInvestRedeem(this.product.id,Number(e)||0).then((t=>
1{this.context.successData={success:!0,type:this.type,amount:e,currencyName:this.product.currency,redemptionLockTime:this.product.redemptionLockTime/1e3/3600,redemptionEndTime:t.redemptionEndTime},this.context.isShowSuccess=!0,this.getInvestData(),this.fetchEarnWallet(),this.$nextTick((()=>{this.closeDialog()}))}),(e=>{this.context.successData={success:!1,type:this.type,errorCode:e},this.context.isShowSuccess=!0})).finally((()=>{this.btnLoading=!1}))},getTotalAmount(e){const t=e.investAmt-e.interestEarned;if(!t)return 0;const a=Pi(e.endTime-e.startTime),l=GI(t,e.rate,a);return N(t).plus(l).toNumber()},formatValue(e){var t;const a=null==(t=this.currencyData)?void 0:t.isFiat;let l;return e=Number(e)||0,l=a?"fc":e>1e8?"default":"wvc",this.$filters.formatNumber(e,l)},closeDialog(){this.reset(),this.$emit("update:show",!1)},reset(){this.amount=0}}},hN={class:"dialog-title"},vN={class:"dialog-body"},mN={class:"content-icon-wrap"},gN={class:"amount-container"},fN={key:1,class:"des-row"},TN={class:"des-title"},wN={class:"des-value-wrap"},DN={class:"value"},AN={class:"currency"},bN={class:"description-wrap"},_N={class:"des-row"},SN={class:"des-title"},CN={class:"des-value-wrap"},LN={class:"value"},EN={class:"currency"},IN={key:0,class:"des-row"},kN={class:"des-title"},RN={class:"des-value-wrap"},NN={class:"value"},xN={class:"currency"},PN={class:"des-row"},ON={class:"des-title"},$N={class:"des-value-wrap"},WN={class:"value"},FN={class:"currency"},BN={class:"info-block"},UN={class:"title"},MN={class:"hour"},VN={key:0,class:"content"},HN={key:0,class:"tip-block"},GN={key:0},YN={key:1},qN={key:2},zN={class:"dialog-button-wrapper"};const KN=vr(yN,[["render",function(e,t,a,l,o,u){const c=s("BrandIcon"),f=s("AmountWrap"),T=s("i18n-t"),w=s("IconError"),D=s("Brand
1Button"),A=s("BrandDialog");return n(),i(A,{class:"dialog-wrap",width:e.$isLargeSize(e.$mq)?"560px":"90%",idPrefix:"redeem_dialog",isBrandNewStyle:"",onClosed:u.closeDialog},{header:g((()=>[y("p",hN,h(e.$t("msg.redeem")),1)])),body:g((()=>[y("div",vN,[y("div",mN,[m(c,{class:"currency-icon",displayName:u.currencyData.name,shortName:!1,type:u.currencyData.isFiat?"fiat":"icon",name:a.product.currency,size:"24"},null,8,["displayName","type","name"])]),y("div",gN,[u.isShowInputAmount?(n(),i(f,{key:0,amount:o.amount,"onUpdate:amount":t[0]||(t[0]=e=>o.amount=e),amountError:o.isAmountError,"onUpdate:amountError":t[1]||(t[1]=e=>o.isAmountError=e),class:L(["amount-wrap",{"amount-error":o.isAmountError}]),type:a.type,availAmount:a.product.investAmt,currency:a.product.currency,maxInvestAmt:a.product.dailyLimit,showConvert:!1,isRedeem:""},null,8,["amount","amountError","class","type","availAmount","currency","maxInvestAmt"])):(n(),r("div",fN,[y("span",TN,h(e.$t("earn.transferDialog.redemptionAmount")),1),y("div",wN,[y("span",DN,h(u.formatValue(u.redemptionAmount)),1),y("span",AN,h(a.product.currency),1)])]))]),y("div",bN,[y("div",_N,[y("span",SN,h(e.$t("earn.initialPrincipal")),1),y("div",CN,[y("span",LN,h(u.formatValue(u.principalValue)),1),y("span",EN,h(a.product.currency),1)])]),u.isPartialPayoutEarlyRedeem?(n(),r("div",IN,[y("span",kN,h(e.$t("earn.redeemDialog.interestEarned")),1),y("div",RN,[y("span",NN,h(u.formatValue(u.partialPayoutInterest)),1),y("span",xN,h(a.product.currency),1)])])):d("",!0),y("div",PN,[y("span",ON,h(u.interestEarnedText),1),y("div",$N,[y("span",WN,h(u.formatValue(u.interestEarn)),1),y("span",FN,h(a.product.currency),1)])])]),y("div",BN,[y("span",UN,[u.isStakingType?(n(),i(T,{key:0,keypath:"earn.redeem.info",tag:!1},{hours:g((()=>[y("span",MN,h(`${u.freezeHour}${e.$t("earn.hours")}`),1)])),_:1})):(n(),r(p,{key:1},[v(h(e.$t("earn.redemptionDate")),1)],64))]),u.isStakingType?d("",!0):(n(),r("span",VN,h(e.$t("earn.immediate")),1))]),u.isStakingType||u.isFixedType?(n(),r("div",HN,[m(w,{class:"tip-icon"}),u.isStakingType?(n(),r("span",GN,h(e.$t("earn.redeem.staking.tip")),1)):u.isPartialPayoutEarlyRedeem?(n(),r("span",YN,h(e.$t("earn.earlyRedemption.partialPayout.tip",{minDuration:u.minInterestPayoutDays,duration:u.executedInterestTenor,interestRate:u.earlyRedemptionInterestPercentage})),1)):(n(),r("span",qN,h(e.$t("earn.earlyRedemption.tip")),1))])):d("",!0),y("div",zN,[m(D,{id:u.e2eID("btn_redeem"),loading:o.btnLoading,class:L(["dialog-button",u.isEarlyRedeem(a.type)&&"dialog-button--red"]),type:"confirm",disabled:u.isRedeemButtonDisabled,onClick:u.redeemOnclick},{default:g((()=>[v(h(u.buttonText),1)])),_:1},8,["id","loading","class","disabled","onClick"])])])])),_:1},8,["width","onClosed"])}],["__scopeId","data-v-43552aa4"]]),jN={name:"RedeemSuccessDialog",components:{BrandDialog:wt,IconSuccess:Vi,IconFlashFail:Mi},props:{isShow:{type:Boolean,default:!1},successData:{type:Object,default:()=>({})},closeCallback:{type:Function,default:()=>{}}},emits:["update:isShow"],computed:{...l(["lang"]),titleText(){return this.successData.success?this.$t("msg.success"):this.$t("t.unsuccessful")},desText(){return this.successData.success?this.successData.type===Ii.STAKING?this.$t("earn.redeemSuccessDes",{hour:this.successData.redemptionLockTime}):this.$t("earn.redeemSuccessDes2"):this.$t("msg.fail")},errorText(){return`${this.$t("t.errorCode")} ${this.successData.errorCode}`},supportUrl(){return gt(this.lang,"NEW_TICKET")}},methods:{close(){this.closeCallback(),this.$emit("update:isShow",!1)},onESC(){this.close()},formatDate:(e=0)=>X(0===e?(new Date).getTime():e,"yyyy-MM-dd HH:mm"),tryAgain(){this.close();const e=document.querySelector('.earn-term-card[data-keep-investment="true"]');if(!e)return;const t=e.querySelector("button");t&&t.click()}}},XN={class:"success-dialog-body"},QN={class:"title-text"},ZN={key:2,class:"error-text"},JN={class:"des-text"},ex={key:3,class:"action-text"},tx=["href"],ax={key:0,class:"dialog-info-wrapper"},lx={class:"row"},sx={class:"info-title"},ix={class:"value-wrap"},nx={class:"value"},rx={class:"currency"},ox={class:"row"},ux={class:"info-title"};const cx=vr(jN,[["render",function(e,t,a,l,o,u){const c=s("IconSuccess"),p=s("IconFlashFail"),f=s("RouterLink"),T=s("i18n-t"),w=s("Brand
1Button"),D=s("BrandDialog");return n(),i(D,{visible:a.isShow,class:"success-dialog-wrap",width:e.$isLargeSize(e.$mq)?"560px":"90%",idPrefix:"redeem_success_dialog",isBrandNewStyle:"",onClosed:u.close},{header:g((()=>[y("div",null,h(e.$t("t.redeem")),1)])),body:g((()=>[y("div",XN,[a.successData.success?(n(),i(c,{key:0,class:"dialog-success-icon"})):(n(),i(p,{key:1,class:"dialog-failed-icon"})),y("p",QN,h(u.titleText),1),a.successData.success?d("",!0):(n(),r("span",ZN,h(u.errorText),1)),y("p",JN,h(u.desText),1),a.successData.redemptionLockTime?d("",!0):(n(),r("p",ex,[a.successData.success?(n(),i(T,{key:0,keypath:"earn.viewEarnWallet",tag:"span"},{earnWallet:g((()=>[m(f,{class:"link",to:{name:"walletSpot"}},{default:g((()=>[y("span",null,h(e.$t("t.wallet")),1)])),_:1})])),_:1})):(n(),i(T,{key:1,keypath:"earn.investmentErrorDes",tag:"span"},{tryAgain:g((()=>[y("span",{class:"link",onClick:t[0]||(t[0]=(...e)=>u.tryAgain&&u.tryAgain(...e))},h(e.$t("t.try_again").toLowerCase()),1)])),contactUs:g((()=>[y("a",{class:"link",href:u.supportUrl,target:"_blank",rel:"noopener nofollow"},h(e.$t("t.contactUs").toLowerCase()),9,tx)])),_:1}))]))]),a.successData.success?(n(),r("div",ax,[y("div",lx,[y("span",sx,h(e.$t("earn.transferDialog.redemptionAmount")),1),y("div",ix,[y("span",nx,h(e.$filters.formatNumber(a.successData.amount,"max")),1),y("span",rx,h(a.successData.currencyName),1)])]),y("div",ox,[y("span",ux,h(e.$t("earn.redemptionDate")),1),y("span",{class:L(["info-value",{highlight:a.successData.redemptionLockTime}])},h(u.formatDate(a.successData.redemptionEndTime)),3)])])):d("",!0),m(w,{class:"dialog-btn",type:"primary",size:"biggest",onClick:u.close},{default:g((()=>[v(h(e.$t("msg.ok")),1)])),_:1},8,["onClick"])])),_:1},8,["visible","width","onClosed"])}],["__scopeId","data-v-f01e7f09"]]),dx={class:"icon-dot-animation"};const px=vr({},[["render",function(e,t){return n(),r("div",dx)}],["__scopeId","data-v-3faff68b"]]);function yx(e,t,a){const l=Number(e)||0;return N(l).times(t).div(100).div(Wi).times(a).toNumber()}function hx(e,t,a,l){return l?function(e,t,a){const l=Number(e)||0;return l*(1+t/Wi/100)**a-l}(e,t,a):yx(e,t,a)}const vx={name:"FirstInterestPayout",props:{productData:{type:Object,required:!0},type:{type:Number,required:!0}},computed:{...l(["currencyMap"]),firstInterestPayout(){const{amount:e,rate:t}=this.productData,a=function(e,t,a=1){return yx(e,t,a)}(e,t,1),{isFiat:l,stableCoin:s}=this.currencyMap[this.productData.currency];return l||s?this.formatValue(a,"fc"):Math.floor(a)>1e9?this.formatValue(a,"default"):this.formatValue(a,"max8")}},methods:{formatValue(e,t="max"){return this.$filters.formatNumber(e,t)}}},mx={class:"first-interest-payout"},gx={class:"value"},fx={class:"currency"};const Tx=vr(vx,[["render",function(e,t,a,l,s,i){return n(),r("div",mx,[y("span",gx,h(i.firstInterestPayout),1),y("span",fx,h(a.productData.currency),1)])}],["__scopeId","data-v-47227273"]]),wx="default",Dx="walletEarn",Ax="walletEarnV2",bx={name:"TimelinePreviewDialog",components:{BrandDialog:wt,IconArrowRight:Hi,BrandIcon:Pa,IconDotAnimation:px,ProgressBarV2:Oe},props:{productData:{type:Object,required:!0},previewType:{type:String,default:wx},type:{type:Number,required:!0}},emits:["update:show"],computed:{...l(["currencyMap"]),isDefault(){return this.previewType===wx},isWalletEarn(){return this.previewType===Dx},isWalletEarnV2(){return this.previewType===Ax},isStakingProduct(){return this.type===Ii.STAKING},currencyData(){return this.currencyMap[this.productData.currency]},frozenTime(){const{lockedDurationBefore:e}=this.productData,t=e/1e3/3600;return this.$t("earn.frozenPeriod",{hour:t})},hasFrozenTime(){const{lockedDurationBefore:e}=this.productData;return 0!==e},redeemFrozenTiem(){const{redemptionLockTime:e}=this.productData,t=e/1e3/3600;return this.$t("earn.frozenPeriod",{hour:t})},previewData(){return this.isDefault?this.timelineData:this.wallerEarnTimelineData},timelineProductData(){const{startDate:e,startTime:t,interestStartDate:a,lockedDurationBefore:l,lockedDurationAfter:s,interestPayoutFrequency:i,nextInterestPayoutTime:n,day:r,endTime:o,redemptionLockTime:u}=this.productData,c=e||t,d=ce(c,l),p=de(a,i),y=this.type===Ii.FIXED?de(a,i):de(pe(a,r),s),h=n?ce(n,i):0,v=u?ce(o,u):0;return{...this.productData,investmentStartDate:c,depositDate:d,firstInterestPayoutDate:p,investmentEndDate:y,previousInterestPayoutDate:h,earlyRedemptionDate:v}},timelineTitle(){return this.$t("earn.stakingTimeline")},nextPayoutAmountText(){const e=zI(this.productData);return Xt(e,"max8")},totalLockedDays(){return qI(this.productData)},elapsedLockedDays(){const e=this.totalLockedDays;
1if(e<=0)return 0;const{investmentStartDate:t}=this.timelineProductData;return Math.min(Math.max(ue(new Date,t),0),e)},lockedProgressPercent(){return this.totalLockedDays>0?this.elapsedLockedDays/this.totalLockedDays:0},paidText(){return this.type===Ii.STAKING?this.$t("earn.paidDaily"):""},timelineData(){const e=new Date,{interestStartDate:t,nextInterestPayoutTime:a,investmentStartDate:l,depositDate:s,firstInterestPayoutDate:i,investmentEndDate:n,previousInterestPayoutDate:r,redemptionProcessing:o,earlyRedemptionDate:u,endTime:c}=this.timelineProductData;return[{id:"depositDate",title:`${this.productData.currency} ${this.$t("earn.depositDate")}`,date:s,des:this.formatDate(s),subContent:this.hasFrozenTime?this.frozenTime:null,subContentType:"text",show:!0},{id:"investmentStartDate",title:this.$t("earn.investmentStartDate"),date:l,des:this.formatDate(l),show:!this.isWalletEarnV2||this.isStakingProduct},{title:this.$t("earn.interestStartDate"),date:t,des:this.formatDate(t),show:!this.isWalletEarnV2||this.isStakingProduct},{id:"previousInterestPayout",title:this.$t("earn.previousInterestPayout"),date:r,des:this.formatDate(r),show:this.isWalletEarn&&e>i&&!o},{id:"nextInterestPayout",title:this.$t("earn.nextInterestPayout"),date:a,des:this.formatDate(a),titleHighlight:!0,info:this.paidText,subContent:Tx,show:this.isWalletEarn&&e>i&&!o},{id:"nextInterestPayout",title:this.$t("earn.nextInterestPayout"),date:a,des:this.formatDate(a),titleHighlight:e>i,info:this.paidText,show:this.isWalletEarnV2},{id:"firstInterestPayout",title:this.$t("earn.firstInterestPayout"),date:i,des:this.formatDate(i),titleHighlight:!0,info:this.paidText,subContent:Tx,show:this.isDefault||this.isWalletEarn&&e<i&&!o},{id:"earn.earlyRedemption",title:this.$t("earn.earlyRedemption"),date:u,des:this.formatDate(u),info:this.$t("earn.interestCancelled"),subContent:this.redeemFrozenTiem,subContentType:"text",show:o,redemptionProcessing:o},{id:"depositReceived",title:this.$t("earn.depositReceived"),date:c,des:this.formatDate(c),show:o,redemptionProcessing:o},{id:"investmentEndDate",title:this.$t("earn.investmentEndDate"),date:n,des:this.formatDate(n),show:this.isWalletEarnV2?this.isStakingProduct:!o}].filter((e=>e.show))},wallerEarnTimelineData(){const e=new Date,{nextInterestPayoutTime:t,firstInterestPayoutDate:a,investmentEndDate:l}=this.timelineProductData,s=this.timelineData.reduce(((t,a)=>a.date<=e?a.id:t),""),i=this.timelineData.findIndex((e=>e.id===s))+1;return this.timelineData.map(((n,r)=>{if(this.isWalletEarnV2)return n.id===s?{...n,titleHighlight:!0,lineBallStyle:"line-ball-highlight"}:n.date<e?{...n,titleHighlight:!1,lineStyle:"default"}:{...n,titleHighlight:!1};if(e>a&&t&&new Date(t)<l&&!n.redemptionProcessing){const e=this.timelineData.findIndex((e=>"previousInterestPayout"===e.id));return"previousInterestPayout"===n.id?{...n,lineStyle:"highlight"}:"nextInterestPayout"===n.id?{...n,lineStyle:"dashed",lineBallStyle:"line-ball-highlight"}:r>e?{...n,lineStyle:"dashed"}:{...n,lineStyle:"default"}}return this.timelineProductData.redemptionProcessing&&!n.redemptionProcessing?{...n,lineStyle:"default"}:n.id===s?{...n,lineStyle:"highlight"}:r===i?{...n,lineStyle:"dashed",lineBallStyle:"line-ball-highlight"}:n.date<e?{...n,lineStyle:"default"}:{...n,lineStyle:"dashed"}}))}},methods:{hideTimelinePreview(){this.$emit("update:show",!1)},closeDialog(){this.$emit("update:show",!1)},formatDate:(e=0)=>0===e?"--":X(e,"yyyy-MM-dd HH:mm")}},_x={class:"timeline-preview-header"},Sx={key:1},Cx={key:2},Lx={class:"dialog-body"},Ex={key:0,class:"next-payout-summary"},Ix={class:"next-payout-summary-title-wrapper"},kx={class:"next-payout-summary-amount-wrapper"},Rx={class:"next-payout-summary-currency"},Nx={class:"next-payout-summary-arrives"},xx={class:"progress-bottom-wrapper"},Px={class:"of-day"},Ox={class:"progress-bottom-end"},$x={key:0,class:"content-icon-wrap"},Wx={class:"left-content"},Fx={class:"main-content"},Bx={key:0,class:"info"},Ux={key:0,class:"sub-content"},Mx={key:0},Vx={class:"sub-content-text"},Hx={class:"right-content"},Gx={key:1,class:"tip"};const Yx=vr(bx,[["render",function(e,t,a,l,o,u){const c=s("IconArrowRight"),f=s("IconDotAnimation"),T=s("i18n-t"),w=s("ProgressBarV2"),D=s("BrandIcon"),b=s("BrandDialog");return n(),i(b,{ref:"timelinePreviewDialog",class:"timeline-preview-dialog",width:e.$isLargeSize(e.$mq)?"530p
1x":"90%",showClose:!0,idPrefix:"timeline_preview_dialog",isBrandNewStyle:"",onClosed:u.closeDialog},{header:g((()=>[y("div",_x,[u.isDefault?(n(),r(p,{key:0},[m(c,{class:"icon-arrow",onClick:u.hideTimelinePreview},null,8,["onClick"]),y("span",null,h(e.$t("earn.timelinePreview")),1)],64)):u.isWalletEarnV2?(n(),r("span",Sx,h(e.$t("earn.investmentTimeline")),1)):(n(),r("span",Cx,h(u.timelineTitle),1))])])),body:g((()=>[y("div",Lx,[u.isWalletEarnV2?(n(),r("div",Ex,[y("div",Ix,[m(f,{class:"dot-icon"}),v(" "+h(e.$t("earn.nextPayout")),1)]),y("div",kx,[v(h(u.nextPayoutAmountText)+" ",1),y("span",Rx,h(a.productData.currency),1)]),y("div",Nx,h(e.$t("earn.nextPayoutArrives",{date:u.formatDate(a.productData.nextInterestPayoutTime)})),1),m(w,{decimalPercent:u.lockedProgressPercent,isShowTopInfo:!1},{bottom:g((()=>[y("div",xx,[m(T,{class:"progress-bottom-front",keypath:"earn.dayOfDay",tag:"div"},{nowDays:g((()=>[v(h(u.elapsedLockedDays),1)])),ofDay:g((()=>[y("span",Px,h(e.$t("earn.ofDay",{days:u.totalLockedDays})),1)])),_:1}),y("div",Ox,h(e.$t("earn.daysRemaining",{days:u.totalLockedDays-u.elapsedLockedDays})),1)])])),_:1},8,["decimalPercent"])])):d("",!0),y("div",{class:L(["timeline",{"is-v2":u.isWalletEarnV2}])},[(n(!0),r(p,null,x(u.previewData,((e,t)=>(n(),r("div",{key:e.title,class:L(["content",[e.lineStyle,e.lineBallStyle]])},[!u.isWalletEarnV2&&("highlight"===e.lineStyle&&!u.isDefault||u.isDefault&&0===t)?(n(),r("div",$x,[m(D,{showName:!1,type:u.currencyData.isFiat?"fiat":"icon",name:u.currencyData.shortName,size:"24"},null,8,["type","name"])])):d("",!0),y("div",Wx,[y("div",Fx,[y("span",{class:L({highlight:e.titleHighlight})},h(e.title),3),e.info?(n(),r("div",Bx,h(e.info),1)):d("",!0)]),e.subContent?(n(),r("div",Ux,["text"===e.subContentType?(n(),r("span",Mx,[y("span",Vx,h(e.subContent),1)])):(n(),i(A(e.subContent),{key:1,productData:a.productData,type:a.type},null,8,["productData","type"]))])):d("",!0)]),y("div",Hx,h(e.des),1)],2)))),128))],2),u.isDefault?(n(),r("div",Gx," *"+h(e.$t("earn.timelinePreview.tip")),1)):d("",!0)])])),_:1},8,["width","onClosed"])}
1],["__scopeId","data-v-0e6c8699"]]),qx={class:"action-wrapper-mobile"},zx={class:"action-top"},Kx={key:0,class:"no-data-wrap"},jx={class:"action-wrapper-desktop"},Xx={class:"wallet-actions"},Qx=vr(E({__name:"WalletEarn",setup(e){const{enableWalletOverview:t,enableAutoEarn:a,enableEarnStaking:l,enableEarnFunds:s,enableEarnLending:o,earnProductCategoryList:u,enableNewEarnWallet:c}=Ge,h=M(),v=V(),T=U(),w=nt(),D=ze(),{t:A}=I(),b=O(!0),_=O([]),S=O(),L=O(""),E=O(El.ALL_ASSETS),k=R((()=>D.displayCurrency??void 0)),W=R((()=>T.state.hideConvertToBaseCurrencyValue)),F=R((()=>T.state.hideWalletSmallBalanceEarn)),B={[El.FIAT]:"isFiat",[El.STABLE_COINS]:"stableCoin",[El.CRYPTO_CURRENCY]:"isCrypto"},H=K(),G=J({}),Y=K(),z=R((()=>Gi[v.query.type]||Ni.ALL)),X=R((()=>a&&T.state.isShowAutoEarnBanner)),Q=R((()=>{const e=[{key:Ni.ALL,label:A("earn.allTerm")}];return u.forEach((t=>{switch(t){case Ri.STAKING:if(!l)return;break;case Ri.LENDING:if(!o)return;break;case Ri.FUNDS:if(!s)return}e.push({key:t,label:HI(A,t)})})),e})),Z=R((()=>Q.value.findIndex((({key:e})=>e===z.value)))),ee=R((()=>{var e;return(null==(e=w.wallet.total)?void 0:e.amount)??"-"})),te=R((()=>{let e=_.value;if(z.value!==Ni.ALL&&(e=e.filter((({category:e})=>e===z.value))),E.value!==El.ALL_ASSETS){const t=B[E.value];e=e.filter((({currency:e})=>!0===(T.state.currencyMap[e]||{})[t]))}if(L.value){const t=L.value.toLowerCase().trim();e=e.filter((({currency:e})=>null==e?void 0:e.toLowerCase().includes(t)))}return F.value&&!L.value&&(e=e.filter((({originalInvestAmt:e,currency:t})=>{var a;const l=(null==(a=T.state.currencyMap[t])?void 0:a.usdRate)??0;return N(e??0).times(l).toNumber()>=_l}))),e})),ae=R((()=>te.value.slice().sort(((e,t)=>Gs(e.currency,t.currency))))),le=R((()=>c?Ax:Dx));function se(e){pe(Q.value[e].key)}function ie(e){S.value=S.value===e?void 0:e}function ne(e){return _.value.find((t=>t.id===e))}function re(e){const t=ne(e);if(!t)return;const a=!t.autoRenew;t.autoRenew=a,de(e,a)}function oe(e){const t=ne(e);t&&(Y.value={...t,lockedDurationAfter:t.redemptionLockTime,day:t.duration,amount:t.originalInvestAmt})}function ue(e){H.value=ne(e)}async function ce(){const{order:e}=await br();_.value=e}const de=kl((async function(e,t){try{await xr(e,t)}catch(a){const l=ne(e);l&&(l.autoRenew=!t)}}),300);function pe(e){h.replace({query:{type:qi[e]}})}async function he(){const e=[ce()];!t&&e.push(w.update(!0)),await Promise.allSettled(e)}return ye("getInvestData",he),ye("context",G),$((()=>v.query.type),(e=>{e&&Gi[e]||pe(Ni.ALL)}),{immediate:!0}),$((()=>T.state.accountInfo.uid),(e=>{e&&he()})),j((()=>he().finally((()=>{b.value=!1})))),q((()=>!t&&w.removeTimer())),(e,t)=>{const a=C("loading");return n(),r(p,null,[X.value?(n(),i($I,{key:0})):d("",!0),m(Sy,{type:"earn",title:e.$t("wallets.earn"),featuresList:P(Yi),balanceTitle:e.$t("wallets.earn.totalSubscribed"),totalBalance:ee.value,tabList:Q.value,selectedTabIndex:Z.value,displayCurrency:k.value,useWalletBalanceInfo:"",onTabSelected:se},{mobile:g((()=>[y("div",qx,[y("div",zx,[m(Kr,{value:L.value,"onUpdate:value":t[0]||(t[0]=e=>L.value=e),class:"search-input",width:"180px",height:"40px",type:P(Il).BOX},null,8,["value","type"]),m(Vh,{filterKey:E.value,"onUpdate:filterKey":t[1]||(t[1]=e=>E.value=e),class:"wallet-filter"},null,8,["filterKey"])]),m(zh,{class:"wallet-is-convert-base",state:W.value},null,8,["state"]),m(qh,{class:"wallet-hide-small",type:"earn",state:F.value,isDisable:!!L.value},null,8,["state","isDisable"])]),P(c)?(n(),i(UR,{key:0,isLoading:b.value,productOrderList:te.value,productCategoryFilter:z.value,onAutoRenewChanged:re,onShowTimeline:oe,onRedeemRequested:ue},null,8,["isLoading","productOrderList","productCategoryFilter"])):(n(),r(p,{key:1},[(n(!0),r(p,null,x(ae.value,(e=>(n(),i(tN,{key:e.id,productOrder:e,productCategoryFilter:z.value,isActive:S.value===e.id,onToggleDetail:ie,onAutoRenewChanged:re,onShowTimeline:oe,onRedeemRequested:ue},null,8,["productOrder","productCategoryFilter","isActive"])))),128)),0===ae.value.length?f((n(),r("div",Kx,[m(CI,{type:P(DI).EARN},null,8,["type"])])),[[a,b.value]]):d("",!0)],64))])),desktop:g((()=>[y("div",jx,[m(Kr,{id:P(Xe)("input_search"),value:L.value,"onUpdate:value":t[2]||(t[2]=e=>L.value=e),width:"252px",height:"32px"},null,8,["id","value"]),m(Iv,{filterKey:E.value,"onUpdate:filterKey":t[3]||(t[3]=e=>E.value=e),class:"wallet-filter"},null,8,["filterKey"]),y("div",Xx,[m(zh,{state:W.value},null,8,["state"]),m(qh,{class:"wallet-hide-small",type:"earn",state:F.value,isDisable:!!L.value},null,8,["state","isDisable"])])]),P(c)?(n(),i(rR,{key:0,isLoading:b.value,productOrderList:te.value,productCategoryFilter:z.value,onAutoRenewChanged:re,onShowTimeline:oe,onRedeemRequested:ue},null,8,["isLoading","productOrderList","productCategoryFilter"])):(n(),i(xk,{key:1,isLoading:b.value,productOrderList:te.value,productCategoryFilter:z.value,onAutoRenewChanged:re,onShowTimeline:oe,onRedeemRequested:ue},null,8,["isLoading","productOrderList","productCategoryFilter"]))])),_:1},8,["title","featuresList","balanceTitle","totalBalance","tabList","selectedTabIndex","displayCurrency"]),Y.value?(n(),i(Yx,{key:1,show:"",productData:Y.value,previewType:le.value,type:Y.value.type,"onUpdate:show":t[4]||(t[4]=e=>Y.value=void 0)},null,8,["productData","previewType","type"])):H.value?(n(),i(KN,{key:2,show:"",type:H.value.type,product:H.value,"onUpdate:show":t[5]||
1(t[5]=e=>H.value=void 0)},null,8,["type","product"])):G.successData?(n(),i(cx,{key:3,isShow:"",successData:G.successData,"onUpdate:isShow":t[6]||(t[6]=e=>G.successData=void 0)},null,8,["successData"])):d("",!0)],64)}}}),[["__scopeId","data-v-b48c884c"]]),Zx={class:"container"},Jx={class:"flex-box justify-between items-center"},eP={class:"product"},tP={class:"name"},aP={key:0,class:"duration"},lP={class:"flex-box justify-between flex-column"},sP={class:"earn-row"},iP={class:"title"},nP={class:"content"},rP={class:"lighter"},oP={class:"earn-row"},uP={class:"title"},cP={class:"content"},dP={class:"earn-row"},pP={class:"title"},yP={class:"content"},hP={class:"earn-row"},vP={class:"title"},mP={class:"content"},gP={class:"amount"},fP={class:"currency"},TP={class:"earn-row"},wP={class:"title"},DP={class:"content"},AP={class:"amount"},bP={class:"earn-row"},_P={class:"title"},SP={class:"content"},CP={class:"amount"},LP={class:"currency"};const EP=vr({name:"DataEarnCard",props:{data:{type:Object,required:!0},columnName:{type:Object,required:!0}},methods:{formatNumberAmount:function(e){let t;return e=Number(e)||0,t=this.data.isFiat||this.data.isStableCoin?"fc":e>1e8?"default":24,this.$filters.formatNumber(e,t)}}},[["render",function(e,t,a,l,s,i){return n(),r("div",Zx,[y("div",Jx,[y("p",eP,[y("span",tP,h(a.data.name),1),a.data.duration?(n(),r("span",aP,h(a.data.duration)+" "+h(e.$t("wallets.earn.days")),1)):d("",!0)])]),y("div",lP,[y("div",sP,[y("div",iP,h(e.$t(a.columnName.date)),1),y("div",nP,[y("span",null,h(a.data.updateTime.split(" ")[0])+"Â ",1),y("span",rP,h(a.data.updateTime.split(" ")[1]),1)])]),y("div",oP,[y("div",uP,h(e.$t(a.columnName.type)),1),y("div",cP,h(e.$t(a.data.type)),1)]),y("div",dP,[y("div",pP,h(e.$t(a.columnName.transactionType)),1),y("div",yP,h(e.$t(a.data.txnName)),1)]),y("div",hP,[y("div",vP,h(e.$t(a.columnName.amount)),1),y("div",mP,[y("span",gP,h(i.formatNumberAmount(a.data.amount))+"Â ",1),y("span",fP,h(a.data.currency),1)])]),y("div",TP,[y("div",wP,h(e.$t(a.columnName.apy)),1),y("div",DP,[a.data.rate?(n(),r(p,{key:0},[y("span",AP,h(e.$filters.formatNumber(a.data.rate,{formatKey:2})),1),t[0]||(t[0]=y("span",null,"Â %",-1))],64)):d("",!0)])]),y("div",bP,[y("div",_P,h(e.$t(a.columnName.totalAmount)),1),y("div",SP,[y("span",CP,h(i.formatNumberAmount(a.data.totalAmount))+"Â ",1),y("span",LP,h(a.data.currency),1)])])])])}],["__scopeId","data-v-e66096c0"]]),IP={class:"filter-chip-wrapper"};const kP=vr({},[["render",function(e,t){return n(),r("div",IP,[o(e.$slots,"default",{},void 0,!0)])}],["__scopeId","data-v-f9ebc743"]]),RP={class:"dialog-body"},NP={class:"action-wrapper"},xP=vr({__name:"EarnHistoryFilterDialog",props:{dateRangeData:{type:Object,required:!0},selectedProduct:{type:String,required:!0},productList:{type:Array,default:()=>[]},selectedTransactionType:{type:[String,Number],required:!0},transactionTypeList:{type:Array,default:()=>[]},minDurationToNow:{type:Object,default:null},rangeLimitDuration:{type:Object,default:null}},emits:["handleApply","dialog:closed"],setup(e,{emit:t}){const a=e,l=t,s=O(!1),r=O(a.dateRangeData),o=O(null),u=O(null),c=O({selectedProduct:a.selectedProduct,selectedTransactionType:a.selectedTransactionType}),p=e=>{c.value.selectedProduct=e},f=e=>{c.value.selectedTransactionType=e},T=()=>{s.value=!0},w=()=>{o.value.handleSelect(Pr.ALL_PRODUCTS),u.value.handleSelect(Pr.ALL_TRANSACTION_TYPES)},D=()=>{const[e,t]=no.methods.getFormatDateRange(r.value);l("dialog:closed",{isApply:!0,payload:{startDate:e,endDate:t,selectedProduct:c.value.selectedProduct,selectedTransactionType:c.value.selectedTransactionType}})},A=()=>{l("dialog:closed")};return(e,t)=>(n(),i(P(wt),{class:"earn-history-filter-dialog",idPrefix:"earn_history_filter_dialog",isBrandNewStyle:"",hideScrollbar:"",fullStyle:"",showClose:"",onClosed:A},{header:g((()=>[v(h(e.$t("t.filters")),1)])),body:g((()=>[y("div",RP,[m(P(zi),{class:"field"},{title:g((()=>[v(h(e.$t("t.date")),1)])),default:g((()=>[m(P(jr),{class:"date-block",dateRangeData:r.value,isShowArrow:"",onToggle:T},null,8,["dateRangeData"])])),_:1}),m(P(zi),{class:"field"},{title:g((()=>[v(h(e.$t("earn.product")),1)])),default:g((()=>[m(P(Kv),{ref_key:"productDropdownRef",ref:o,class:"dropdown",fixedOption:{name:e.$t("t.allProducts"),value:P(Pr).ALL_PRODUCTS},hasSearch:"",defaultValue:a.selectedProduct,list:a.productList,handleUpdate:p,height:"48px"},null,8,["fixedOption","defaultValue","list"])])),_:1}),m(P(zi),{class:"field"},{title:g((()=>[v(h(e.$t("t.transactionType")),1)])),default:g((()=>[m(P(Kv),{ref_key:"transactionTypeDropdownRef",ref:u,class:"dropdown",defaultValue:a.selectedTransactionType,list:a.transactionTypeList,handleUpdate:f,height:"48px"},null,8,["defaultValue","list"])])),_:1})]),s.value?(n(),i(P(pa),{key:0,showDatePickerDialog:s.value,"onUpdate:showDatePickerDialog":t[0]||(t[0]=e=>s.value=e),dateRange:r.value,"onUpdate:dateRange":t[1]||(t[1]=e=>r.value=e),minDurationToNow:a.minDurationToNow,rangeLimitDuration:a.rangeLimitDuration},null,8,["showDatePickerDialog","dateRange","minDurationToNow","rangeLimitDuration"])):d("",!0)])),footer:g((()=>[y("div",NP,[m(P(so),{actionType:"reset",onClick:w},{default:g((()=>[v(h(e.$t("t.reset")),1)])),_:1}),m(P(so),{actionType:"search",onClick:D},{default:g((()=>[v(h(e.$t("earn.filter.apply")),1)])),_:1})])])),_:1}))}},[["__scopeId","data-v-91e1af3e"]]),PP={class:"content-wrapper"},OP={class:"tools-wrapper"},$P={class:"action__button-wrap"},WP={class:"tools-top-wrapper"},FP={class:"button-text-wrap"},BP={class:"brand-card"},UP=["src"],MP={class:"break-word date"},VP={class:"break-word time"},HP={class:"cell-product"},GP={class:"break-word"},YP={key:0,class:"duration"},qP={class:"amount-wrapper"}
1,zP={class:"currency-digit bolder"},KP={class:"currency-unit"},jP={key:0,class:"bolder"},XP={class:"currency-digit bolder"},QP={class:"currency-unit"},ZP={key:1},JP={class:"olay-table"},eO={class:"pagi-wrapper"},tO={name:"EarnHistory",components:{DataEarn:vr({__name:"DataEarn",setup(e){const t={gridSize:13,gridSpacing:15,colWidthUnit:[2,3,1,2,2,1,2]},a={date:"history.transactionHistory.dateTime",type:"history.earn.type",amount:"earn.transferDialog.amount",transactionType:"history.earn.transactiontype",totalAmount:"wallets.earn.flexible.totalAmount",apy:"history.earn.InterestRate"},l={years:1},o={years:1},u=Date.now(),{t:c}=I(),w=U(),D=ka(),{$openDialog:A}=Tl(),b=R((()=>w.state.lang)),_=R((()=>w.state.currencyMap)),S=R((()=>D.isMobile)),L=R((()=>D.isLargeSize)),E=O(!0),k=O(!1),N=O(!0),F=O({start:te(B(u),29),end:W(u)}),M=O({...F.value}),V=O(!1),H=O(Pr.ALL_PRODUCTS),G=O(Pr.ALL_TRANSACTION_TYPES),q=K([]),z=K([]),j=O({pageNumber:1,totalRows:0,totalPages:0}),Q=O([]),Z=O(null),J=O(null),ee=R((()=>{const{start:e,end:t}=M.value;return{fromTimestamp:B(e).getTime(),toTimestamp:W(t).getTime()}})),ae=R((()=>[c("history.transactionHistory.dateTime"),c("wallets.earn.product"),c("history.earn.type"),c("history.earn.transactiontype"),c("earn.transferDialog.amount"),c("history.earn.InterestRate"),c("wallets.earn.flexible.totalAmount")])),le=R((()=>({name:c("t.allProducts"),value:Pr.ALL_PRODUCTS}))),se=R((()=>ie.value.length>0)),ie=R((()=>{const e=[];if(H.value!==Pr.ALL_PRODUCTS){const t=q.value.find((({id:e})=>e===H.value));e.push({type:"productId",text:t.name})}return G.value!==Pr.ALL_TRANSACTION_TYPES&&e.push({type:"transactionType",text:Or[G.value]?c(Or[G.value]):""}),e})),ne=R((()=>{const e={zoneOffset:gs()};return H.value!==Pr.ALL_PRODUCTS&&(e.product=H.value),G.value!==Pr.ALL_TRANSACTION_TYPES&&(e.transactionType=G.value),`?${new URLSearchParams(e).toString()}`})),re=R((()=>ro($a.downloadSpotHistory,"/report/histories/invest",ne.value)));function oe({start:e,end:t}){const{fromTimestamp:a,toTimestamp:l}=ee.value;e.getTime()===a&&t.getTime()===l||(M.value={start:e,end:t})}function ue(e,t,a){let l=24;return t||a?l="fc":e>1e8&&(l="default"),Xt(Number(e)||0,l)}function ce(e){H.value=e}function de(e){G.value=e}function pe({type:e}){switch(e){case"productId":H.value=Pr.ALL_PRODUCTS;break;case"transactionType":G.value=Pr.ALL_TRANSACTION_TYPES}}async function ye(){const e=await A(xP,{selectedProduct:H.value,productList:q.value,selectedTransactionType:G.value,transactionTypeList:z.value,dateRangeData:M.value,minDurationToNow:l,rangeLimitDuration:o});(null==e?void 0:e.isApply)&&function({startDate:e,endDate:t,selectedProduct:a,selectedTransactionType:l}){H.value=a,G.value=l,oe({start:e,end:t})}(e.payload)}function he(){N.value||E.value||j.value.totalPages<=j.value.pageNumber||(k.value=!0,j.value.pageNumber=j.value.pageNumber+1)}async function ve(){E.value=!0;try{const e={...ee.value,pageNum:j.value.pageNumber,pageSize:10};H.value!==Pr.ALL_PRODUCTS&&(e.product=H.value),G.value!==Pr.ALL_TRANSACTION_TYPES&&(e.transactionType=G.value);const t=await $a.getEarnHistory(e),a=t.history;a.forEach((e=>{var t;e.updateTime=X(new Date(e.updateTime),"yyyy-MM-dd HH:mm:ss"),e.type=HI(c,e.type,!0),e.txnName=Or[e.txnType],e.isFiat=(t=e.currency,(_.value[t]||{}).isFiat||!1),e.isStableCoin=function(e){return(_.value[e]||{}).stableCoin||!1}(e.currency)})),j.value={totalRows:t.totalRows,pageNumber:t.pageNumber,totalPages:Math.ceil(t.totalRows/t.pageSize)},k.value?Q.value=Q.value.concat(a):Q.value=a}catch(e){}k.value=!1,E.value=!1}function me(){var e,t;null==(e=Z.value)||e.reset(),null==(t=J.value)||t.reset(),oe(F.value)}function ge(e){E.value||(j.value.pageNumber=e)}return $((()=>w.state.accountInfo.uid),(()=>me()),{flush:"sync"}),$([()=>j.value.pageNumber,()=>w.state.accountInfo.uid,N,M,H,G],(([e,t,a],[l])=>{t&&!a&&(1===e||e!==l?ve():j.value.pageNumber=1)}),{immediate:!0}),Y((()=>async function(){N.value=!0;try{const[e,t]=await Promise.all([$a.spotInit(),$r()]);z.value=[{name:c("t.allTransactionTypes"),value:Pr.ALL_TRANSACTION_TYPES}].concat(e.earnHistoryTypes.map((e=>({name:Or[e]?c(Or[e]):"",value:e})))||[]),q.value=t.reduce(((e,t)=>
1(e.some((e=>e.name===t.name))||e.push({name:t.name,value:t.id}),e)),[])}catch{H.value=[],G.value=[]}finally{N.value=!1}}())),(e,u)=>{const c=s("HeaderRow"),w=s("BrandButton"),D=s("Cell"),A=s("Row"),_=s("Table"),I=C("loading");return f((n(),r("div",PP,[y("div",OP,[L.value?(n(),r(p,{key:0},[f((n(),r("div",$P,[m(P(Ne),{ref:"datePicker",dateRange:M.value,"onUpdate:dateRange":u[0]||(u[0]=e=>M.value=e),defaultRange:F.value,minDurationToNow:l,rangeLimitDuration:o},null,8,["dateRange","defaultRange"]),q.value.length?(n(),i(P(Kv),{key:0,ref_key:"productFilterDropdown",ref:Z,class:"dropdown",fixedOption:le.value,hasSearch:"",defaultValue:P(Pr).ALL_PRODUCTS,list:q.value,handleUpdate:ce,height:"32px"},null,8,["fixedOption","defaultValue","list"])):d("",!0),z.value.length?(n(),i(P(Kv),{key:1,ref_key:"transactionTypeDropdown",ref:J,class:"dropdown",defaultValue:z.value[0].value,list:z.value,handleUpdate:de,height:"32px"},null,8,["defaultValue","list"])):d("",!0),y("span",{class:"reset-btn",onClick:me},h(e.$t("t.resetFilters")),1)])),[[I,N.value,"streamingLight"]]),m(P(Ds),{fileName:"Earn History",requestDownload:re.value,defaultRangeDate:M.value,hasPdf:""},null,8,["requestDownload","defaultRangeDate"])],64)):(n(),r(p,{key:1},[y("div",WP,[m(P(jr),{dateRangeData:M.value,onToggle:u[1]||(u[1]=e=>V.value=!0)},null,8,["dateRangeData"]),m(P(Jr),{isFiltered:se.value,onClick:ye},null,8,["isFiltered"])]),se.value?(n(),i(P(kP),{key:0,class:"filter-chip-wrapper"},{default:g((()=>[(n(!0),r(p,null,x(ie.value,(e=>(n(),i(P(Vs),{key:e.filterChips,chipData:e,handleClearFilter:pe},null,8,["chipData"])))),128))])),_:1})):d("",!0),m(P(Ds),{class:"m-file-download",fileName:"Earn History",requestDownload:re.value,defaultRangeDate:M.value,hasPdf:""},{default:g((()=>[y("div",FP,[m(P(ws),{class:"svg-icon"}),v(" "+h(e.$t("t.downloadHistory")),1)])])),_:1},8,["requestDownload","defaultRangeDate"])],64))]),y("div",BP,[S.value?(n(),r("div",ZP,[y("div",JP,[f(m(Zt,{emptyText:e.$t("t.noDataFound"),class:"empty-data"},null,8,["emptyText"]),[[T,0===Q.value.length]]),(n(!0),r(p,null,x(Q.value,((e,t)=>(n(),i(EP,{key:t,data:e,columnName:a},null,8,["data"])))),128)),m(P(bs),{onLoadMore:he})])])):(n(),i(_,{key:0,colgroup:t},{header:g((()=>[m(c,{textAlign:"left"},{default:g((()=>[(n(!0),r(p,null,x(ae.value,(e=>(n(),r("th",{key:e},h(e),1)))),128))])),_:1})])),body:g((()=>[0==Q.value.length?(n(),i(A,{key:0,index:-1,class:"no-data-section"},{default:g((()=>[m(D,{textAlign:"center",colspan:"7"},{default:g((()=>[m(Zt,{emptyText:e.$t("msg.noData")},{"no-data-icon":g((()=>[y("img",{src:P("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='76'%20height='76'%20viewBox='0%200%2076%2076'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cg%20fill-rule='nonzero'%3e%3cg%3e%3cpath%20fill='%23D9E8FD'%20d='M37.817%203.958L53.3%2019.441v16.366c-.861-.12-1.74-.182-2.633-.182-.552%200-1.098.024-1.637.07V22.46H34.798V8.228H10.603v54.794h23.022c.77%201.555%201.745%202.99%202.892%204.27H6.333V3.958h31.484zM31.96%2051.281c-.193%201.086-.294%202.203-.294%203.344%200%20.31.007.618.022.925H15.584v-4.27zm5.157-9.963c-1.242%201.264-2.31%202.7-3.161%204.27H15.584v-4.27zm6.971-9.963v4.27H15.625v-4.27h28.464zm-5.022-20.108v6.944h6.944l-6.944-6.944z'%20transform='translate(-777%20-307)%20translate(777%20307)'/%3e%3cpath%20fill='%2384B2F5'%20d='M49.875%2040.117c7.576%200%2013.717%206.14%2013.717%2013.716%200%202.64-.746%205.106-2.038%207.198l7.015%205.538-1.962%202.485-7.017-5.538c-2.483%202.492-5.92%204.034-9.715%204.034-7.576%200-13.717-6.141-13.717-13.717%200-7.575%206.141-13.716%2013.717-13.716zm0%203.026c-5.904%200-10.69%204.786-10.69%2010.69%200%205.905%204.786%2010.69%2010.69%2010.69s10.69-4.785%2010.69-10.69c0-5.904-4.786-10.69-10.69-10.69zM44.252%2053.78c1.371%203.802%203.05%205.307%207.455%205.375l.421.003.009%201.9c-5.444.024-7.866-1.898-9.528-6.244l-.144-.39%201.787-.644z'%20transform='translate(-777%20-307)%20translate(777%20307)'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e")},null,8,UP)])),_:1},8,["emptyText"]),m(w,{class:"to-earn-button",type:"confirm",href:`/${b.value}/earn`,targetAttribute:"_self"},{default:g((()=>[y("span",null,h(e.$t("wallets.earn.earnNow")),1)])),_:1},8,["href"])])),_:1})])),_:1})):(n(!0),r(p,{key:1},x(Q.value,((t,a)=>(n(),i(A,{key:a,class:"table-tbody-row",data:t,index:a},{default:g((()=>[m(D,{class:"history-time",textAlign:"left"},{default:g((()=>[y("span",MP,h(t.updateTime.split(" ")[0])+"Â ",1),y("span",VP,h(t.updateTime.split(" ")[1]),1)])),_:2},1024),m(D,{textAlign:"left"},{default:g((()=>[y("div",HP,[y("div",GP,h(t.name),1),t.duration?(n(),r("div",YP,h(t.duration)+" "+h(e.$t("wallets.earn.days")),1)):d("",!0)])])),_:2},1024),m(D,{textAlign:"left"},{default:g((()=>[v(h(e.$t(t.type)),1)])),_:2},1024),m(D,{textAlign:"left"},{default:g((()=>[v(h(e.$t(t.txnName)),1)])),_:2},1024),m(D,{textAlign:"left"},{default:g((()=>[y("div",qP,[y("div",zP,h(ue(t.amount,t.isFiat,t.isStableCoin)),1),y("div",KP,h(t.currency),1)])])),_:2},1024),m(D,{textAlign:"left"},{default:g((()=>[t.rate>0?(n(),r("span",jP,h(`${t.rate.toFixed(2)}%`),1)):d("",!0)])),_:2},1024),m(D,{class:"total-amount",textAlign:"left"},{default:g((()=>[y("span",XP,h(ue(t.totalAmount,t.isFiat,t.isStableCoin)),1),y("span",QP,h(t.currency),1)])),_:2},1024)])),_:2},1032,["data","index"])))),128))])),_:1}))]),y("div",eO,[S.value?d("",!0):(n(),i(P(As),{key:0,background:!1,layout:"prev, pager, next, jumper",total:j.value.totalRows,pageSize:j.value.pageSize,currentPage:j.value.pageNumber,totalPages:j.value.totalPages,onHandleCurrentChangeP:ge},null,8,["total","pageSize","currentPage","totalPages"]))]),V.value?(n(),i(P(pa),{key:0,showDatePickerDialog:V.value,"onUpdate:showDatePickerDialog":u[2]||(u[2]=e=>V.value=e),dateRange:M.value,"onUpdate:dateRange":u[3]||(u[3]=e=>M.value=e),minDurationToNow:l,rangeLimitDuration:o},null,8,["showDatePickerDialog","dateRange"])):d("",!0)])),[[I,E.value]])}}},[["__scopeId","data-v-50cb7572"]]),IconChevronRight:ht},computed:{...l(["lang"])},methods:{onBackToEarnWallet(){this.$router.push({name:"walletEarn",params:{lang:this.lang}})}}},aO={class:"earn-history history-color-scheme"},lO={class:"header-wrapper"},sO={class:"back-text"},iO={class:"history-earn-title"};const nO={class:"earn"};const rO=vr({name:"EarnHistory",components:{EarnHistoryMain:vr(tO,[["render",function(e,t,a,l,i,o){const u=s("IconChevronRight"),c=s("DataEarn");return n(),r("div",aO,[y("div",lO,[y("div",{class:"header-back-wrap",onClick:t[0]||(t[0]=(...e)=>o.onBackToEarnWallet&&o.onBackToEarnWallet(...e))},[m(u,{class:"chevron-icon"}),y("span",sO,h(e.$t("earn.backToEarn")),1)]),y("div",iO,[y("span",null,h(e.$t("earn.history.title")),1)])]),m(c,b(e.$attrs,{class:"content"}),null,16)])}],["__scopeId","data-v-258bc1a9"]])}},[["render",function(e,t,a,l,i,o){const u=s("EarnHistoryMain");return n(),r("div",nO,[m(u,{class:"content"})])}],["__scopeId","data-v-fe8c7bb2"]]);function oO({isLoading:e,guard:t}
1){const a=O(!0),l=O(!1),s=O({pageSize:10,currentPage:1}),i=R((()=>s.value.currentPage===s.value.totalPages)),n=R((()=>!a.value&&!i.value));let r;function o(e){s.value.currentPage=e,l.value=!0}function u(){r=new IntersectionObserver((t=>{t[0].isIntersecting&&function(){if(a.value||i.value||e.value)return;o(s.value.currentPage+1)}()}),{root:null,rootMargin:"400px",threshold:0}),(null==t?void 0:t.value)&&r.observe(t.value)}return $(n,(e=>{e?H(u):r&&r.disconnect()}),{immediate:!1}),q((()=>{r&&r.disconnect()})),{isFirstLoad:a,loadMore:l,pagination:s,setPaginationData:function(e){const{totalRows:t,pageSize:a,currentPage:l,totalPages:i,totalPage:n}=e;s.value={totalRows:t,pageSize:a,currentPage:l,totalPages:i||n||0}},handlePageChange:o}}const uO={class:"bar-currency-name"},cO={key:1,class:"currency-placeholder"},dO={class:"simplify-currency-list"},pO={key:0,class:"search-wrap"},yO=["placeholder"],hO=["onClick"],vO={class:"currency-info"},mO={class:"currency-short-name"},gO={key:0,class:"currency-full-name"},fO={key:0,class:"currency-balance"},TO=vr(E({__name:"SimplifyCurrencyDropDown",props:{appliedCurrencyList:{},selectedCurrency:{},isListDisabled:{type:Boolean,default:!1},placeholder:{default:""},isShowFullName:{type:Boolean,default:!0},isShowBalance:{type:Boolean,default:!0},currencyIconSize:{default:"24"}},emits:["onChange"],setup(e,{emit:t}){const a=e,l=t,s=U(),{t:u}=I(),c=O(""),v=R((()=>{var e;return c.value.length>0||(null==(e=a.appliedCurrencyList)?void 0:e.length)>8})),T=R((()=>s.state.currencyMap)),D=R((()=>s.state.loginState));function A(e){const t=T.value[e]||{},a=t.shortName||e,l=t.displayName||e,s=t.isFiat||!1;return{uniqueKey:e,shortName:a,displayName:l,isFiat:s,available:t.available||0,filterKey:Xi(t),i18nAssetName:s?Er.fiatCurrency(e):Er.digitalCurrency(e)}}const b=R((()=>a.appliedCurrencyList?a.appliedCurrencyList.map(A):[])),S=R((()=>a.selectedCurrency?A(a.selectedCurrency):null)),C=R((()=>{const e=c.value.toLowerCase().trim();return e?b.value.filter((t=>t.uniqueKey.toLowerCase().includes(e)||t.shortName.toLowerCase().includes(e)||t.displayName.toLowerCase().includes(e)||t.i18nAssetName.toLowerCase().includes(e))):b.value})),E=O(null),k=O(0),N=O(0),W=R((()=>N.value||38)),F=R((()=>C.value.length*W.value)),B=R((()=>Math.max(0,Math.floor(k.value/W.value)-5))),M=R((()=>{const e=Math.ceil(280/W.value)+10;return Math.min(C.value.length,B.value+e)}));function V(){var e;const t=null==(e=E.value)?void 0:e.querySelector(".currency-item");t&&(N.value=t.offsetHeight)}$((()=>C.value.length),(e=>{e>0&&!N.value&&H(V)}));const G=R((()=>C.value.slice(B.value,M.value))),Y=R((()=>B.value*W.value));function q(){E.value&&(k.value=E.value.scrollTop)}function z(e){const t=1e6,a=e.isFiat?"max2":"wvc";let l="",s=e.available;return s>=t&&(s/=t,l="M"),`${Xt(s,a)}${l}`}return(e,t)=>(n(),i(Ki,{class:"simplify-currency-dropdown"},{toggleContent:g((()=>[y("div",{class:L(["bar-currency-wrap",{selected:!!S.value}])},[S.value?(n(),r(p,{key:0},[m(Pa,{displayName:S.value.displayName,type:S.value.isFiat?"fiat":"icon",name:S.value.shortName,showName:!1,size:e.currencyIconSize},null,8,["displayName","type","name","size"]),y("span",uO,h(S.value.displayName),1)],64)):(n(),r("span",cO,h(e.placeholder||P(u)("t.searchCrypto")),1))],2)])),default:g((({onSelect:s})=>[y("div",dO,[v.value?(n(),r("div",pO,[m(ji,{class:"search-icon"}),f(y("input",{ref:"searchInputRef","onUpdate:modelValue":t[0]||(t[0]=e=>c.value=e),class:"search-input",type:"text",placeholder:P(u)("msg.search"),onClick:t[1]||(t[1]=w((()=>{}),["stop"]))},null,8,yO),[[he,c.value]]),c.value?(n(),i(Ts,{key:0,class:"close-icon",onClick:t[2]||(t[2]=w((e=>c.value=""),["stop"]))})):d("",!0)])):d("",!0),o(e.$slots,"prepend",{onSelect:s},void 0,!0),y("div",{ref_key:"scrollContainerRef",ref:E,class:L(["currency-list-scroll",{"is-list-disabled":e.isListDisabled}]),onScroll:q},[y("div",{style:_({height:`${F.value}px`,position:"relative"})},[y("div",{style:_({position:"absolute",top:`${Y.value}px`,left:0,right:0})},[(n(!0),r(p,null,x(G.value,(t=>(n(),r("div",{key:t.uniqueKey,class:L(["currency-item",{selected:t.uniqueKey===e.selectedCurrency}]),onClick:e=>function(e,t){const s=Boolean(c.value.trim());c.value="",t(),e.uniqueKey!==a.selectedCurrency&&l("onChange",e,s)}(t,s)},[m(Pa,{displayName:t.displayName,type:t.isFiat?"fiat":"icon",name:t.shortName,showName:!1,size:"20"},null,8,["displayName","type","name"]),y("div",vO,[y("span",mO,h(t.displayName),1),e.isShowFullName&&!e.isMobile?(n(),r("span",gO,h(t.i18nAssetName),1)):d("",!0)]),e.isShowBalance&&D.value&&null!=t.available?(n(),r("span",fO,h(z(t)),1)):d("",!0)],10,hO)))),128))],4)],4),0===C.value.length?(n(),i(Zt,{key:0,class:"no-data-wrap",emptyText:P(u)("t.noDataFound")},null,8,["emptyText"])):d("",!0)],34)])])),_:3}))}}),[["__scopeId","data-v-8c9d3aad"]]),wO={class:"history-currency-dropdown"},DO=["onClick"],AO=vr(E({__name:"HistoryCurrencyDropdown",props:{selectedCurrency:{},placeholder:{default:""}},emits:["update:selectedCurrency"],setup(e,{emit:t}){const a=e,l=t,{t:s}=I(),i=Ut(),o=R((()=>{const e=i.cryptoCurrencyList||[],t=i.fiatCurrencyList||[],a=i.currencyMap||{};return[...t,...e].map((e=>{const t=a[e]||{};return{currency:e,id:t.id??0,filterKey:Xi(t)}}
1)).sort(Qi.FILTER_KEY_THAN_ID).map((e=>e.currency))})),u=R((()=>a.placeholder?a.placeholder:s("t.allAssets.uppercase")));function c(e){l("update:selectedCurrency",e.uniqueKey)}return(e,t)=>(n(),r("div",wO,[m(TO,{appliedCurrencyList:o.value,selectedCurrency:e.selectedCurrency,placeholder:u.value,isShowFullName:!1,isShowBalance:!1,currencyIconSize:"20",onOnChange:c},{prepend:g((({onSelect:e})=>[y("div",{class:"currency-item all-assets-item",onClick:t=>function(e){e(),l("update:selectedCurrency","")}(e)},h(P(s)("t.allAssets.uppercase")),9,DO)])),_:1},8,["appliedCurrencyList","selectedCurrency","placeholder"])]))}}),[["__scopeId","data-v-e82fb798"]]),bO={class:"time"},_O={class:"history-status"},SO={class:"status-text"},CO=vr(E({__name:"TransactionHistoryRow",props:{data:{default:()=>({})},index:{}},setup(e){const t=e,{t:a}=I(),l=R((()=>$e(t.data.date))),r=R((()=>a(`t.${t.data.historyType.toLowerCase()}`))),o=R((()=>{const e=`t.${t.data.status.toLowerCase()}`;return Rl(e)?a(e):Hl(t.data.status.toLowerCase())})),u=R((()=>t.data.sdkRequired||"FAILURE"===t.data.status?Ae:"PENDING"===t.data.status||"PROCESSING"===t.data.status?Zi:null)),c=R((()=>{const{amount:e,currencyData:a,status:l}=t.data;if(l!==be.COMPLETED)return"-";if(!e)return"-";const{isFiat:s,currency:i}=a;let n=null;const r=Number(e)||0;return s&&(n=r>1e8?"default":"fc"),Xt(r,{formatKey:n,isDynamicDecimal:!s,currency:i})}));return(e,t)=>{const a=s("Cell"),p=s("Row");return n(),i(p,{class:"transaction-history-row",index:e.index,disableBackground:!0,disableCssHoverEffect:!1},{default:g((()=>[m(a,{textAlign:"left"},{default:g((()=>[y("span",null,h(l.value.date),1),y("span",bO,h(l.value.time),1)])),_:1}),m(a,{textAlign:"left"},{default:g((()=>[m(Pa,{displayName:e.data.currencyData.displayName,"short-name":!0,type:e.data.currencyData.isFiat?"fiat":"icon",name:e.data.currencyData.shortName,size:"20"},null,8,["displayName","type","name"])])),_:1}),m(a,{textAlign:"left"},{default:g((()=>[y("span",null,h(r.value),1)])),_:1}),m(a,{textAlign:"left"},{default:g((()=>[y("span",null,h(c.value),1)])),_:1}),m(a,{textAlign:"left"},{default:g((()=>[y("div",_O,[y("span",SO,h(o.value),1),u.value?(n(),i(A(u.value),{key:0,class:"status-icon"})):d("",!0)])])),_:1}),m(a,{class:"detail"},{default:g((()=>[m(ca,{class:"detail-icon"})])),_:1})])),_:1},8,["index"])}}}),[["__scopeId","data-v-901b323b"]]),LO={class:"top-wrap"},EO={class:"time-wrap"},IO={class:"time"},kO={class:"history-status"},RO={class:"status-text"},NO={class:"transaction-currency-wrap"},xO={class:"amount"},PO={class:"note-wrap"},OO=vr(E({__name:"TransactionHistoryData",props:{data:{}},emits:["click"],setup(e){const t=e,{t:a}=I(),l=R((()=>$e(t.data.date))),s=R((()=>a(`t.${t.data.historyType.toLowerCase()}`))),o=R((()=>{const e=`t.${t.data.status.toLowerCase()}`;return Rl(e)?a(e):Hl(t.data.status.toLowerCase())})),u=R((()=>t.data.sdkRequired||t.data.status===be.FAILURE?Ae:t.data.status===be.PENDING||t.data.status===be.PROCESSING?Zi:null)),c=R((()=>{const{amount:e,currencyData:a,status:l}=t.data;if(l!==be.COMPLETED)return"-";if(!e)return"-";const{isFiat:s,currency:i}=a;let n=null;const r=Number(e)||0;return s&&(n=r>1e8?"default":"fc"),Xt(r,{formatKey:n,isDynamicDecimal:!s,currency:i})}));return(e,t)=>(n(),r("div",{class:"transaction-history-data",onClick:t[0]||(t[0]=t=>e.$emit("click",t))},[y("div",LO,[y("div",EO,[y("span",null,h(l.value.date),1),y("span",IO,h(l.value.time),1)]),y("div",kO,[y("span",RO,h(o.value),1),u.value?(n(),i(A(u.value),{key:0,class:"status-icon"})):d("",!0)])]),y("div",NO,[m(Pa,{class:"currency",displayName:e.data.currencyData.displayName,"short-name":!0,type:e.data.currencyData.isFiat?"fiat":"icon",name:e.data.currencyData.shortName,size:"20"},null,8,["displayName","type","name"]),y("span",xO,h(c.value),1)]),y("div",PO,[y("span",null,h(s.value),1)])]))}}),[["__scopeId","data-v-bd7676fb"]]),$O={class:"deposit-and-withdraw-wrap"},WO={key:0,class:"filters-wrap"},FO={class:"filter-left"},BO={class:"filter-right"},UO={key:1,class:"transaction-history-list"},MO={key:2,class:"loading-wrap"},VO=vr({__name:"DepositAndWithdraw",props:{dateRangeData:{type:Object,default:()=>({start:null,end:null})},setDateRangeData:{type:Function,default:null},defaultRange:{type:Object,default:()=>({start:null,end:null})},category:{type:String,required:!0},selectedCurrency:{type:String,default:""},type:{type:[String,null],default:null},status:{type:[String,null],default:null}},setup(e){const t=V(),{$openDialog:a}=Tl(),{t:l}=I(),s=Ut(),o=ka(),u=R((()=>o.isMobile)),c=e,v=O(!1),g=O(!1),T=R((()=>
1v.value||g.value)),w=O(null),{isFirstLoad:D,loadMore:A,pagination:b,setPaginationData:_,handlePageChange:S}=oO({isLoading:v,guard:R((()=>u.value?w.value:null))}),E=R((()=>!T.value&&0===z.value.length)),k=O(c.dateRangeData),N=O(c.type),W=O(c.status),F=O(c.selectedCurrency),B=K({}),U=nn,M=sn;$((()=>c.type),(e=>{void 0!==e&&(N.value=e)})),$((()=>c.status),(e=>{void 0!==e&&(W.value=e)})),$((()=>c.selectedCurrency),(e=>{void 0!==e&&(F.value=e)})),$((()=>c.dateRangeData),(e=>{k.value=e}),{deep:!0});const H=O([]);let G=null;const Y=R((()=>s.currencyMap)),z=R((()=>(H.value||[]).map((e=>({...e,currencyData:Y.value[e.currency]||{}})))));function X(e,t){return"ALL_TYPES"!==t&&t?t:e.slice(1).join(",")}const Q=R((()=>{const{start:e,end:t}=k.value||c.dateRangeData;return Ji({from:e&&e.getTime(),to:t&&t.getTime(),currencyType:"",transactionType:X(en.DEPOSIT_WITHDRAW,N.value),historyStatus:"All_STATUS"===W.value?"":W.value,asset:F.value,pageSize:b.value.pageSize,currentPage:b.value.currentPage},[null,void 0,""])}));async function Z(){null==G||G.abort();const e=new AbortController;G=e,o.isMobile?(v.value=D.value,D.value=!1):v.value=!0;try{const t=await Xl.getHistoriesTransaction(Q.value,{signal:e.signal});o.isMobile&&A.value?H.value=H.value.concat(t.data):H.value=t.data,_(t)}catch(t){if(e.signal.aborted)return}finally{G===e&&(v.value=!1,A.value=!1)}}async function J(e,t){try{g.value=!0;const l=await Xl.getSpotWalletDetail(e,t);B.value={...l,id:e,historyType:t,dataId:null==l?void 0:l.id},function(e){const{detailType:t}=e;switch(t){case ke.DEPOSIT_FIAT:a(Og,{detailData:B.value,renewDetailData:ue});break;case ke.DEPOSIT_CREDIT_CARD:a(Vg,{detailData:B.value});break;case ke.DEPOSIT_CRYPTO:a(Bg,{detailData:B.value,refreshHistoryList:Z});break;case ke.WITHDRAW_FIAT:a(Zg,{detailData:B.value,renewDetailData:ue});break;case ke.WITHDRAW_FIAT_ALIPAY:case ke.WITHDRAW_FIAT_GCASH:a(Nf,{detailData:B.value});break;case ke.WITHDRAW_CRYPTO:a(ef,{detailData:B.value});break;case ke.PAY_FOR_SERVICE:a(mf,{detailData:B.value})}}(B.value)}catch(l){}finally{g.value=!1}}$(Q,((e,t)=>{if(!un(e,t)){if(1!==e.currentPage&&e.currentPage===t.currentPage)return void(b.value.currentPage=1);Z()}})),j((()=>{Z()})),q((()=>{null==G||G.abort(),G=null}));const ee=R((()=>{const e={zoneOffset:gs(),historyTypes:X(en.DEPOSIT_WITHDRAW,N.value),historyStatus:(t=W.value,"All_STATUS"!==t&&t?t:"ALL"),asset:F.value||"ALL",tabName:tn[an.DEPOSIT_WITHDRAW]};var t;const a=new URLSearchParams(e).toString().replaceAll(/%2C/g,",");return ro($a.downloadSpotHistory,"report/histories/transaction",`?${a}`)})),te=R((()=>[{id:"date",lang:l("t.time"),textAlign:"left",sortable:!0},{id:"asset",lang:l("t.asset"),textAlign:"left",sortable:!0},{id:"type",lang:l("t.type"),textAlign:"left"},{id:"netAmount",lang:l("t.netAmount"),textAlign:"left"},{id:"status",lang:l("t.status"),textAlign:"left"},{id:"detail"}])),ae=R((()=>en.DEPOSIT_WITHDRAW.map((e=>se(e))))),le=R((()=>ln.DEPOSIT_WITHDRAW.map((e=>se(e)))));function se(e){return{name:l(`t.${e.toLowerCase()}`),value:e}}const ie=O(null),ne=O(null);function re(){!function(){var e;const[t,a]=xe(on);null==(e=c.setDateRangeData)||e.call(c,{start:t,end:a})}(),F.value="",ie.value.reset(ae.value[0].value),ne.value.reset(le.value[0].value)}function oe(e){const{id:t,historyType:a}=e;J(t,a)}function ue(){const{id:e,historyType:t}=B.value;J(e,t),Z()}return(a,s)=>{const o=C("loading");return f((n(),r("div",$O,[u.value?d("",!0):(n(),r("div",WO,[y("div",FO,[m(Ne,{ref:"walletDatePicker",dateRange:k.value,"onUpdate:dateRange":s[0]||(s[0]=e=>k.value=e),defaultRange:e.defaultRange,minDurationToNow:P(U),rangeLimitDuration:P(M)},null,8,["dateRange","defaultRange","minDurationToNow","rangeLimitDuration"]),m(AO,{selectedCurrency:F.value,"onUpdate:selectedCurrency":s[1]||(s[1]=e=>F.value=e),class:"currency-dropdown"},null,8,["selectedCurrency"]),m(rn,{ref_key:"typeDropdown",ref:ie,class:L(["dropdown",{selected:!!N.value}]),list:ae.value,handleUpdate:e=>N.value=e,defaultValue:P(t).query.type,placeholder:P(l)("t.type")},null,8,["class","list","handleUpdate","defaultValue","placeholder"]),m(rn,{ref_key:"statusDropdown",ref:ne,class:L(["dropdown",{selected:!!W.value}]),list:le.value,handleUpdate:e=>W.value=e,defaultValue:P(t).query.status,placeholder:P(l)("t.status")},null,8,["class","list","handleUpdate","defaultValue","placeholder"]),y("span",{class:"reset",onClick:re},h(P(l)("t.resetFilters")),1)]),y("div",BO,[m(Ds,{class:"file-download",fileName:c.category,requestDownload:ee.value,defaultRangeDate:k.value,hasPdf:""},null,8,["fileName","requestDownload","defaultRangeDate"])])])),u.value?d("",!0):(n(),r(p,{key:1},[m(We,{rowComponent:CO,headerTitlesData:te.value,listData:z.value,handleRowClick:oe},null,8,["headerTitlesData","listData"]),m(As,{class:"pagination",layout:"prev, pager, next, jumper",total:P(b).totalRows,pageSize:P(b).pageSize,totalPages:P(b).totalPages,currentPage:P(b).currentPage,pagerCount:5,background:!1,onHandleCurrentChangeP:P(S)},null,8,["total","pageSize","totalPages","currentPage","onHandleCurrentChangeP"])],64)),u.value?(n(),r(p,{key:2},[E.value?(n(),i(Zt,{key:0,class:"no-data-wrap",emptyText:P(l)("t.noDataFound")},null,8,["emptyText"])):(n(),r("div",UO,[(n(!0),r(p,null,x(z.value,(e=>(n(),i(OO,{key:e.id,data:e,onClick:t=>oe(e)},null,8,["data","onClick"])))),128))])),P(A)?f((n(),r("div",MO,null,512)),[[o,!0]]):d("",!0),y("div",{ref_key:"guard",ref:w,class:"load-more-guard"},null,512)],64)):d("",!0)])),[[o,T.value]])}}},[["__scopeId","data-v-ccae5e48"]]);var HO={};!function e(t,a,l,s){var i=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),n="function"==typeof Path2D&&"function"==typeof DOMMatrix;function r(){}function o(e){var l=a.exports.Promise,s=void 0!==l?l:t.Promise;return"function"==typeof s?new s(e):(e(r,r),null)}
1var u,c,d,p,y,h,v=function(e,t){return{transform:function(a){if(e)return a;if(t.has(a))return t.get(a);var l=new OffscreenCanvas(a.width,a.height);return l.getContext("2d").drawImage(a,0,0),t.set(a,l),l},clear:function(){t.clear()}}}(function(){if(!t.OffscreenCanvas)return!1;try{var e=new OffscreenCanvas(1,1),a=e.getContext("2d");a.fillRect(0,0,1,1);var l=e.transferToImageBitmap();a.createPattern(l,"no-repeat")}catch(s){return!1}return!0}(),new Map),m=(d=Math.floor(1e3/60),p={},y=0,"function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame?(u=function(e){var t=Math.random();return p[t]=requestAnimationFrame((function a(l){y===l||y+d-1<l?(y=l,delete p[t],e()):p[t]=requestAnimationFrame(a)})),t},c=function(e){p[e]&&cancelAnimationFrame(p[e])}):(u=function(e){return setTimeout(e,d)},c=function(e){return clearTimeout(e)}),{frame:u,cancel:c}),g=function(){var t,a,s={};return function(){if(t)return t;if(!l&&i){var n=["var CONFETTI, SIZE = {}, module = {};","("+e.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI && CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join("\n");try{t=new Worker(URL.createObjectURL(new Blob([n])))}catch(r){return"undefined"!=typeof console&&console.warn,null}!function(e){function t(t,a){e.postMessage({options:t||{},callback:a})}e.init=function(t){var a=t.transferControlToOffscreen();e.postMessage({canvas:a},[a])},e.fire=function(l,i,n){if(a)return t(l,null),a;var r=Math.random().toString(36).slice(2);return a=o((function(i){function o(t){t.data.callback===r&&(delete s[r],e.removeEventListener("message",o),a=null,v.clear(),n(),i())}e.addEventListener("message",o),t(l,r),s[r]=o.bind(null,{data:{callback:r}})}))},e.reset=function(){for(var t in e.postMessage({reset:!0}),s)s[t](),delete s[t]}}(t)}return t}}(),f={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function T(e,t,a){return function(e,t){return t?t(e):e}(e&&null!=e[t]?e[t]:f[t],a)}function w(e){return e<0?0:Math.floor(e)}function D(e){return parseInt(e,16)}function A(e){return e.map(b)}function b(e){var t=String(e).replace(/[^0-9a-f]/gi,"");return t.length<6&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),{r:D(t.substring(0,2)),g:D(t.substring(2,4)),b:D(t.substring(4,6))}}function _(e){e.width=document.documentElement.clientWidth,e.height=document.documentElement.clientHeight}function S(e){var t=e.getBoundingClientRect();e.width=t.width,e.height=t.height}function C(e,t){t.x+=Math.cos(t.angle2D)*t.velocity+t.drift,t.y+=Math.sin(t.angle2D)*t.velocity+t.gravity,t.velocity*=t.decay,t.flat?(t.wobble=0,t.wobbleX=t.x+10*t.scalar,t.wobbleY=t.y+10*t.scalar,t.tiltSin=0,t.tiltCos=0,t.random=1):(t.wobble+=t.wobbleSpeed,t.wobbleX=t.x+10*t.scalar*Math.cos(t.wobble),t.wobbleY=t.y+10*t.scalar*Math.sin(t.wobble),t.tiltAngle+=.1,t.tiltSin=Math.sin(t.tiltAngle),t.tiltCos=Math.cos(t.tiltAngle),t.random=Math.random()+2);var a=t.tick++/t.totalTicks,l=t.x+t.random*t.tiltCos,s=t.y+t.random*t.tiltSin,i=t.wobbleX+t.random*t.tiltCos,r=t.wobbleY+t.random*t.tiltSin;if(e.fillStyle="rgba("+t.color.r+", "+t.color.g+", "+t.color.b+", "+(1-a)+")",e.beginPath(),n&&"path"===t.shape.type&&"string"==typeof t.shape.path&&Array.isArray(t.shape.matrix))e.fill(function(e,t,a,l,s,i,n){var r=new Path2D(e),o=new Path2D;o.addPath(r,new DOMMatrix(t));var u=new Path2D;return u.addPath(o,new DOMMatrix([Math.cos(n)*s,Math.sin(n)*s,-Math.sin(n)*i,Math.cos(n)*i,a,l])),u}(t.shape.path,t.shape.matrix,t.x,t.y,.1*Math.abs(i-l),.1*Math.abs(r-s),Math.PI/10*t.wobble));else if("bitmap"===t.shape.type){var o=Math.PI/10*t.wobble,u=.1*Math.abs(i-l),c=.1*Math.abs(r-s),d=t.shape.bitmap.width*t.scalar,p=t.shape.bitmap.height*t.scalar,y=new DOMMatrix([Math.cos(o)*u,Math.sin(o)*u,-Math.sin(o)*c,Math.cos(o)*c,t.x,t.y]);y.multiplySelf(new DOMMatrix(t.shape.matrix));var h=e.createPattern(v.transform(t.shape.bitmap),"no-repeat");h.setTransform(y),e.globalAlpha=1-a,e.fillStyle=h,e.fillRect(t.x-d/2,t.y-p/2,d,p),e.globalAlpha=1}else if("circle"===t.shape)e.ellipse?e.ellipse(t.x,t.y,Math.abs(i-l)*t.ovalScalar,Math.abs(r-s)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI):function(e,t,a,l,s,i,n,r,o){e.save(),e.translate(t,a),e.rotate(i),e.scale(l,s),e.arc(0,0,1,n,r,o),e.restore(
1)}(e,t.x,t.y,Math.abs(i-l)*t.ovalScalar,Math.abs(r-s)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI);else if("star"===t.shape)for(var m=Math.PI/2*3,g=4*t.scalar,f=8*t.scalar,T=t.x,w=t.y,D=5,A=Math.PI/D;D--;)T=t.x+Math.cos(m)*f,w=t.y+Math.sin(m)*f,e.lineTo(T,w),m+=A,T=t.x+Math.cos(m)*g,w=t.y+Math.sin(m)*g,e.lineTo(T,w),m+=A;else e.moveTo(Math.floor(t.x),Math.floor(t.y)),e.lineTo(Math.floor(t.wobbleX),Math.floor(s)),e.lineTo(Math.floor(i),Math.floor(r)),e.lineTo(Math.floor(l),Math.floor(t.wobbleY));return e.closePath(),e.fill(),t.tick<t.totalTicks}function L(e,a){var n,r=!e,u=!!T(a||{},"resize"),c=!1,d=T(a,"disableForReducedMotion",Boolean),p=i&&!!T(a||{},"useWorker")?g():null,y=r?_:S,h=!(!e||!p)&&!!e.__confetti_initialized,f="function"==typeof matchMedia&&matchMedia("(prefers-reduced-motion)").matches;function D(t,a,i){for(var r,u,c,d,p,h=T(t,"particleCount",w),g=T(t,"angle",Number),f=T(t,"spread",Number),D=T(t,"startVelocity",Number),b=T(t,"decay",Number),_=T(t,"gravity",Number),S=T(t,"drift",Number),L=T(t,"colors",A),E=T(t,"ticks",Number),I=T(t,"shapes"),k=T(t,"scalar"),R=!!T(t,"flat"),N=function(e){var t=T(e,"origin",Object);return t.x=T(t,"x",Number),t.y=T(t,"y",Number),t}(t),x=h,P=[],O=e.width*N.x,$=e.height*N.y;x--;)P.push((r={x:O,y:$,angle:g,spread:f,startVelocity:D,color:L[x%L.length],shape:I[(d=0,p=I.length,Math.floor(Math.random()*(p-d))+d)],ticks:E,decay:b,gravity:_,drift:S,scalar:k,flat:R},u=void 0,c=void 0,u=r.angle*(Math.PI/180),c=r.spread*(Math.PI/180),{x:r.x,y:r.y,wobble:10*Math.random(),wobbleSpeed:Math.min(.11,.1*Math.random()+.05),velocity:.5*r.startVelocity+Math.random()*r.startVelocity,angle2D:-u+(.5*c-Math.random()*c),tiltAngle:(.5*Math.random()+.25)
1*Math.PI,color:r.color,shape:r.shape,tick:0,totalTicks:r.ticks,decay:r.decay,drift:r.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:3*r.gravity,ovalScalar:.6,scalar:r.scalar,flat:r.flat}));return n?n.addFettis(P):(n=function(e,t,a,i,n){var r,u,c=t.slice(),d=e.getContext("2d"),p=o((function(t){function o(){r=u=null,d.clearRect(0,0,i.width,i.height),v.clear(),n(),t()}r=m.frame((function t(){!l||i.width===s.width&&i.height===s.height||(i.width=e.width=s.width,i.height=e.height=s.height),i.width||i.height||(a(e),i.width=e.width,i.height=e.height),d.clearRect(0,0,i.width,i.height),(c=c.filter((function(e){return C(d,e)}))).length?r=m.frame(t):o()})),u=o}));return{addFettis:function(e){return c=c.concat(e),p},canvas:e,promise:p,reset:function(){r&&m.cancel(r),u&&u()}}}(e,P,y,a,i),n.promise)}function b(a){var l=d||T(a,"disableForReducedMotion",Boolean),s=T(a,"zIndex",Number);if(l&&f)return o((function(e){e()}));r&&n?e=n.canvas:r&&!e&&(e=function(e){var t=document.createElement("canvas");return t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.pointerEvents="none",t.style.zIndex=e,t}(s),document.body.appendChild(e)),u&&!h&&y(e);var i={width:e.width,height:e.height};function v(){if(p){var t={getBoundingClientRect:function(){if(!r)return e.getBoundingClientRect()}};return y(t),void p.postMessage({resize:{width:t.width,height:t.height}})}i.width=i.height=null}function m(){n=null,u&&(c=!1,t.removeEventListener("resize",v)),r&&e&&(document.body.contains(e)&&document.body.removeChild(e),e=null,h=!1)}return p&&!h&&p.init(e),h=!0,p&&(e.__confetti_initialized=!0),u&&!c&&(c=!0,t.addEventListener("resize",v,!1)),p?p.fire(a,i,m):D(a,i,m)}return b.reset=function(){p&&p.reset(),n&&n.reset()},b}function E(){return h||(h=L(null,{useWorker:!0,resize:!0})),h}a.exports=function(){return E().apply(this,arguments)},a.exports.reset=function(){E().reset()},a.exports.create=L,a.exports.shapeFromPath=function(e){if(!n)throw new Error("path confetti are not supported in this browser");var t,a;"string"==typeof e?t=e:(t=e.path,a=e.matrix);var l=new Path2D(t),s=document.createElement("canvas").getContext("2d");if(!a){for(var i,r,o=1e3,u=o,c=o,d=0,p=0,y=0;y<o;y+=2)for(var h=0;h<o;h+=2)s.isPointInPath(l,y,h,"nonzero")&&(u=Math.min(u,y),c=Math.min(c,h),d=Math.max(d,y),p=Math.max(p,h));i=d-u,r=p-c;var v=Math.min(10/i,10/r);a=[v,0,0,v,-Math.round(i/2+u)*v,-Math.round(r/2+c)*v]}return{type:"path",path:t,matrix:a}},a.exports.shapeFromText=function(e){var t,a=1,l="#000000",s='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';"string"==typeof e?t=e:(t=e.text,a="scalar"in e?e.scalar:a,s="fontFamily"in e?e.fontFamily:s,l="color"in e?e.color:l);var i=10*a,n=i+"px "+s,r=new OffscreenCanvas(i,i),o=r.getContext("2d");o.font=n;var u=o.measureText(t),c=Math.ceil(u.actualBoundingBoxRight+u.actualBoundingBoxLeft),d=Math.ceil(u.actualBoundingBoxAscent+u.actualBoundingBoxDescent),p=u.actualBoundingBoxLeft+2,y=u.actualBoundingBoxAscent+2;c+=4,d+=4,(o=(r=new OffscreenCanvas(c,d)).getContext("2d")).font=n,o.fillStyle=l,o.fillText(t,p,y);var h=1/a;return{type:"bitmap",bitmap:r.transferToImageBitmap(),matrix:[h,0,0,h,-c*h/2,-d*h/2]}}}(function(){return"undefined"!=typeof window?window:"undefined"!=typeof self?self:this||{}}(),HO,!1);const GO=HO.exports;HO.exports.create;const YO={class:"popup-container"},qO={class:"send-to-event-popup"},zO={class:"title"},KO={key:0,class:"subtitle"},jO=vr(E({__name:"SendToEventPopup",setup(e){const t=Yt(),{sendToEventPayload:a}=S(t),l=O(!1);function i(){l.value&&t.enableSkipSendToAnimation(),t.setSendToReceivedPayload()}function o(e,t){GO({origin:{y:.7},particleCount:Math.floor(200*e),zIndex:151,...t})}return Y((()=>{o(.25,{spread:26,startVelocity:55}),o(.2,{spread:60}),o(.35,{spread:100,decay:.91,scalar:.8}),o(.1,{spread:120,startVelocity:25,decay:.92,scalar:1.2}),o(.1,{spread:120,startVelocity:45})})),(e,t)=>{const o=s("BaseButton");return n(),r("div",YO,[y("div",qO,[t[1]||(t[1]=y("img",{class:"mascot-image",src:"/static/img/B9xXKvTC.png"},null,-1)),y("div",zO,h(e.$t("lunarNewYear.event.title"))+" ð",1),P(a)?(n(),r("div",KO,h(e.$t("lunarNewYear.event.content",P(a))),1)):d("",!0),m(o,{class:"action-btn red",size:P(qs).L,onClick:i},{default:g((()=>[v(h(e.$t("lunarNewYear.event.gotIt")),1)])),_:1},8,["size"]),m(cn,{value:l.value,"onUpdate:value":t[0]||(t[0]=e=>l.value=e),isBrandNewStyle:""},{default:g((()=>[v(h(e.$t("lunarNewYear.event.skipNextTime")),1)])),_:1},8,["value"])])])}}}),[["__scopeId","data-v-90103a2d"]]),XO={formatNumber(e,t){const{isFiat:a,currency:l}=t;let s=null;return e=Number(e)||0,a&&(s=e>1e8?"default":"fc"),this.$filters.formatNumber(e,{formatKey:s,isDynamicDecimal:!a,currency:l})}},QO={name:"TransactionHistoryData",components:{WalletHistoryStatus:Fe,BrandIcon:Pa},props:{data:{type:Object,required:!0}},emits:["click"],computed:{dateObj(){return $e(this.data.date)},netAmount(){const{netAmount:e,amount:t,currencyData:a,status:l,historyType:s}=this.data;return en.DEPOSIT_WITHDRAW.includes(s)&&l!==be.COMPLETED?"-":en.BUY_SELL_CRYPTO.includes(s)?this.formatNumber(t,a):e?this.formatNumber(e,a):"-"},noteText(){const{transferType:e,historyType:t}=this.data,a=(e||"").replace(ni.AUTO_TRADER,"AUTOTRADER");if(this.isTransfer)return this.$t(`t.${a.toLowerCase()}`);switch(t){case"EXPRESS_BUY":return this.$t("display.expressBuy");case"EXPRESS_SELL":return this.$t("display.expressSell");default:return this.$t(`t.${t.toLowerCase()}`)}},isDepositAndWithdraw(){return["DEPOSIT","WITHDRAW"].includes(this.data.historyType)},isTransfer(){return["TRANSFER"].includes(this.data.historyType)}},methods:{...XO}},ZO={class:"top-wrap"},JO={class:"time-wrap"},e$={class:"time"},t$={class:"transaction-currency-wrap"},a$={class:"amount"},l$={class:"note-wrap"};const s$={name:"TransactionHistoryList",components:{TransactionHistoryData:vr(QO,[["render",function(e,t,a,l,o,u){const c=s("WalletHistoryStatus"),p=s("BrandIcon");return n(),r("div",{class:"transaction-history-data",onClick:t[0]||(t[0]=t=>e.$emit("click",t))},[y("div",ZO,[y("div",JO,[y("span",null,h(u.dateObj.date),1),y("span",e$,h(u.dateObj.time),1)]),u.isDepositAndWithdraw?(n(),i(c,{key:0,status:a.data.status},null,8,["status"])):d("",!0)]),y("div",t$,[m(p,{class:"currency",displayName:a.data.currencyData.displayName,"short-name":!0,type:a.data.currencyData.isFiat?"fiat":"icon",name:a.data.currencyData.short
1Name,size:"20"},null,8,["displayName","type","name"]),y("span",a$,h(u.netAmount),1)]),y("div",l$,[y("span",null,h(u.noteText),1)])])}],["__scopeId","data-v-d6c4efde"]]),NoDataAvailable:Zt},props:{listData:{type:Array,required:!0},isLoading:{type:Boolean,default:!1},handleRowClick:{type:Function,default:()=>{}}},computed:{isEmpty(){return!this.isLoading&&0===this.listData.length},tableColSpan(){return this.headerTitlesData.length.toString()}}},i$={key:0,class:"loading-wrap"},n$={key:2,class:"transaction-history-list"};const r$=vr(s$,[["render",function(e,t,a,l,o,u){const c=s("NoDataAvailable"),y=s("TransactionHistoryData"),h=C("loading");return n(),r(p,null,[a.isLoading?f((n(),r("div",i$,null,512)),[[h,!0]]):d("",!0),u.isEmpty?(n(),i(c,{key:1,class:"no-data-wrap",emptyText:e.$t("t.noDataFound")},null,8,["emptyText"])):(n(),r("div",n$,[(n(!0),r(p,null,x(a.listData,(e=>(n(),i(y,{key:e.id,data:e,onClick:t=>a.handleRowClick(e)},null,8,["data","onClick"])))),128))]))],64)}],["__scopeId","data-v-7b027160"]]),o$=ve("transactionHistoryInit",(()=>{const e=O(void 0),t=R((()=>{var t,a;return Boolean(null==(a=null==(t=e.value)?void 0:t.sendReceive)?void 0:a.includes(dn.API_BROKER_REBATE))}));return{historyCategories:e,fetchInit:async()=>{try{const t=await $a.spotInit();e.value=null==t?void 0:t.historyCategories}catch(t){e.value=void 0}},isEnableApiBrokerFee:t}}));function u$({isLoading:e,isFirstLoad:t,loadMore:a,dateRangeData:l,selectedDateRangeData:s,category:i,type:n,status:r,selectedCurrency:o,pagination:u,setPaginationData:c,isShowDetailLoading:d=O(!1),detailData:p=K({}),handleShowDetailDialog:y=()=>{}}){const h=U(),v=Ut(),m=pt(),g=ct(),f=o$(),T=ka(),w=O([]);let D=null;const A=R((()=>v.currencyMap)),b=R((()=>m.isEnableAutoTraderWallet)),_=R((()=>h.getters.isEnableBinaryOptions)),S=R((()=>h.getters.isEnableUpOrDown)),C=R((()=>f.isEnableApiBrokerFee)),L=R((()=>(w.value||[]).map((e=>{const t=e.asset||e.currency,a=A.value[t]||{};return{...e,currencyData:{currency:t,isFiat:a.isFiat,isStableCoin:a.stableCoin,displayName:a.displayName||t,shortName:a.shortName||t}}}))));function E(e,t){return"ALL_TYPES"!==t&&t?t:e.slice(1).join(",")}function I(e,t){return"All_STATUS"!==t&&t?t:"ALL"}const k=R((()=>{const{start:e,end:t}=(null==s?void 0:s.value)||l.value;let a="",c="",d="";switch(i.value){case an.DEPOSIT_WITHDRAW:a=E(en.DEPOSIT_WITHDRAW,n.value),c=I(ln.DEPOSIT_WITHDRAW,r.value);break;case an.SEND_RECEIVE:{let e=en.SEND_RECEIVE.slice();g.isEnableCopyTradingWallet&&(e=e.concat(pn)),b.value&&(e=e.concat(yn)),_.value&&(e=e.concat(hn)),S.value&&(e=e.concat(vn)),C.value&&(e=e.concat(mn)),a=E(e,n.value);break}case an.TRANSFER:a="TRANSFER",en.TRANSFER,d="ALL_TYPES"!==(p=n.value)&&p?p:"";break;case an.INTEREST:a=en.INTEREST.join(",");break;case an.REFERRAL_BONUS:a=E(en.REFERRAL_BONUS,n.value);break;case an.BUY_SELL_CRYPTO:a=E(en.BUY_SELL_CRYPTO,n.value),c=I(ln.DEPOSIT_WITHDRAW,r.value);break;case an.EXPRESS_BUY_SELL:a=E(en.EXPRESS_BUY_SELL,n.value),c=I(ln.EXPRESS_BUY_SELL,r.value)}var p;return{fromTimestamp:e&&e.getTime(),toTimestamp:t&&t.getTime(),historyTypes:a,historyStatus:c,transferType:d,asset:o.value||"ALL",pageSize:u.value.pageSize,currentPage:u.value.currentPage}}));function N(e){const t=Object.keys(k.value).filter((t=>e.includes(t))).reduce(((e,t)=>({...e,[t]:k.value[t]})),{zoneOffset:gs()});tn[i.value]&&(t.tabName=tn[i.value]);return`?${new URLSearchParams(t).toString().replaceAll(/%2C/g,",")}`}const x=R((()=>N(["historyTypes","historyStatus","transferType","asset"]))),P=R((()=>N(["historyTypes"])));async function W(){D&&D.abort();const l=new AbortController;D=l;const s=l.signal;T.isMobile?(e.value=t.value,t.value=!1):e.value=!0;try{let e=null;if([an.BUY_SELL_CRYPTO,an.EXPRESS_BUY_SELL].includes(i.value)){const{asset:t,historyTypes:a,historyStatus:l,fromTimestamp:n,toTimestamp:r,currentPage:o,pageSize:u}=k.value,c={asset:"ALL"===t?null:t,historyType:a.split(",").length>1?"":a,historyStatus:"ALL"===l?null:l,from:n,to:r,pageSize:u,currentPage:o};e=i.value===an.EXPRESS_BUY_SELL?await Xl.getProviderTransactionHistory(c,{signal:s}):await Xl.getTransactionHistory(c,{signal:s})}else e=await Oa.getTransactionHistory(k.value,{signal:s});if(l.signal.aborted)return;T.isMobile&&a.value?w.value=w.value.concat(e.data):w.value=e.data,c&&c(e)}catch(n){if(l.signal.aborted)return}finally{D===l&&(e.value=!1,a.value=!1)}}return $((()=>k.value),((e,t)=>{if(!un(e,t)){if(1!==e.currentPage&&e.currentPage===t.currentPage)return void(u.value.currentPage=1);W()}})),j((async()=>{await W()})),q((()=>{null==D||D.abort(),D=null})),{listData:L,downloadPathname:"report/histories/transaction",downloadQueryString:x,onramperDownloadQueryString:P,getTransactionHistoryData:W,getDetailData:async function(e,t,a){try{d.value=!0;let l=$a.getSpotWalletDetail;Re.includes(t)&&(l=a===an.EXPRESS_BUY_SELL?Xl.getProviderTransactionHistoryDetail:Xl.getSpotWalletDetail);const s=await l(e,t);p.value={...s,id:e,historyType:t,dataId:null==s?void 0:s.id},y(p.value)}catch(l){}finally{d.value=!1}}}}const c$={class:"send-and-receive-wrap"},d$=vr({__name:"SendAndReceive",props:{dateRangeData:{type:Object,default:()=>
1({startDate:null,endDate:null})},selectedCurrency:{type:String,default:""},category:{type:String,required:!0},status:{type:String,default:null},type:{type:String,default:null}},setup(e){const t=e,a=Yt(),l=O(!1),s=O(null),{isFirstLoad:o,loadMore:u,pagination:c,setPaginationData:p}=oO({isLoading:l,guard:s}),h=O(!1),v=O(!1),g=K({});const{listData:f,getDetailData:T}=u$({isLoading:l,isFirstLoad:o,dateRangeData:R((()=>t.dateRangeData)),category:R((()=>t.category)),type:R((()=>t.type)),status:R((()=>t.status)),selectedCurrency:R((()=>t.selectedCurrency)),pagination:c,setPaginationData:p,loadMore:u,isShowDetailLoading:h,detailData:g,handleShowDetailDialog:function(){v.value=!0}});function w(e){const{id:t,historyType:a}=e;T(t,a)}return(e,t)=>(n(),r("div",c$,[m(r$,{listData:P(f),isLoading:l.value,handleRowClick:w},null,8,["listData","isLoading"]),y("div",{ref_key:"guard",ref:s,class:"load-more-guard"},null,512),v.value?(n(),i(pf,{key:0,isShow:v.value,"onUpdate:isShow":t[0]||(t[0]=e=>v.value=e),detailData:g.value},null,8,["isShow","detailData"])):d("",!0),h.value?(n(),i(Cm,{key:1,isShow:h.value,"onUpdate:isShow":t[1]||(t[1]=e=>h.value=e)},null,8,["isShow"])):d("",!0),P(a).sendToEventPayload?(n(),i(jO,{key:2})):d("",!0)]))}},[["__scopeId","data-v-a1424799"]]),p$={name:"HistoryTransferDialog",components:{Dialog:Ml,TopInfoWrapper:Ie,NetAmountWrapper:Ee,InfoWrapper:Le},props:{isShow:{type:Boolean,required:!0},detailData:{type:Object,required:!0}},emits:["update:isShow"],computed:{...l(["accountInfo"]),...t(["isUnifiedWallet"]),showOldWalletName(){return!this.isUnifiedWallet||null!==this.accountInfo.walletUpgradeTime&&this.detailData.date<this.accountInfo.walletUpgradeTime},infoList(){const{fromWalletName:e="",toWalletName:t=""}=this.detailData;return[{title:this.$t("t.type"),value:this.$t("t.transfer")},{title:this.$t("t.from"),value:this.getWalletName(e),note:this.showOldWalletName&&e===ul?this.$t("msg.walletName.CROSS"):""},{title:this.$t("t.to"),value:this.getWalletName(t),note:this.showOldWalletName&&t===ul?this.$t("msg.walletName.CROSS"):""}]}},methods:{closed(){this.$emit("update:isShow",!1)},getWalletName(e){return e.includes("SPOT@")?this.$t("t.spot"):e.includes(ni.AUTO_TRADER)?this.$t("nav.autoTrader"):e.includes(ni.FUTURES_BOTS)?this.$t("nav.futuresBots"):e.includes(ul)?this.$t("t.futures"):ps(e)}}},y$={class:"flex-box flex-column"};const h$=vr(p$,[["render",function(e,t,a,l,r,o){const u=s("TopInfoWrapper"),c=s("NetAmountWrapper"),d=s("InfoWrapper"),p=s("Dialog");return n(),i(p,{class:"history-transfer-dialog",width:e.$isLargeSize(e.$mq)?"560px":"90%",bodyWithPadding:!1,fullStyle:e.isMobile,isBrandNewStyle:"",isHiddenOnBrowserAction:"",onClosed:o.closed},{header:g((()=>[v(h(e.$t("t.details")),1)])),body:g((()=>[y("div",y$,[m(u,{id:a.detailData.transactionNumber,dateTime:a.detailData.createDateTime},null,8,["id","dateTime"]),m(c,{detailData:a.detailData},null,8,["detailData"]),m(d,{infoList:o.infoList},null,8,["infoList"])])])),_:1},8,["width","fullStyle","onClosed"])}]]),v$={class:"transfer-wrap"},m$=vr({__name:"Transfer",props:{dateRangeData:{type:Object,default:()=>({startDate:null,endDate:null})},selectedCurrency:{type:String,default:""},category:{type:String,required:!0},status:{type:String,default:null},type:{type:String,default:null}},setup(e){const t=e,a=O(!1),l=O(null),{isFirstLoad:s,loadMore:o,pagination:u,setPaginationData:c}=oO({isLoading:a,guard:l}),p=O(!1),h=O(!1),v=K({});const{listData:g,getDetailData:f}=u$({isLoading:a,isFirstLoad:s,dateRangeData:R((()=>t.dateRangeData)),category:R((()=>t.category)),type:R((()=>t.type)),status:R((()=>t.status)),selectedCurrency:R((()=>t.selectedCurrency)),pagination:u,setPaginationData:c,loadMore:o,isShowDetailLoading:p,detailData:v,handleShowDetailDialog:function(){h.value=!0}});function T(e){const{id:t,historyType:a}=e;f(t,a)}return(e,t)=>(n(),r("div",v$,[m(r$,{listData:P(g),isLoading:a.value,handleRowClick:T},null,8,["listData","isLoading"]),y("div",{ref_key:"guard",ref:l,class:"load-more-guard"},null,512),p.value?(n(),i(Cm,{key:0,isShow:p.value,"onUpdate:isShow":t[0]||(t[0]=e=>p.value=e)},null,8,["isShow"])):d("",!0),h.value?(n(),i(h$,{key:1,isShow:h.value,"onUpdate:isShow":t[1]||(t[1]=e=>h.value=e),detailData:v.value},null,8,["isShow","detailData"])):d("",!0)]))}}
1,[["__scopeId","data-v-119f8fa8"]]),g$={name:"HistoryInterestAndReferralDialog",components:{Dialog:Ml,TopInfoWrapper:Ie,NetAmountWrapper:Ee,InfoWrapper:Le},props:{isShow:{type:Boolean,required:!0},detailData:{type:Object,required:!0}},emits:["update:isShow"],computed:{infoList(){return[{title:this.$t("t.type"),value:this.historyType},{title:this.$t("t.detail"),value:this.details}]},historyType(){const{historyType:e}=this.detailData;return this.$t(`t.${e.toLowerCase()}`)},details(){const{historyType:e,info:t={}}=this.detailData;if("REFERRAL"===e)return this.$t("t.referral_bonus");const{earnType:a,currency:l}=t,s=Object.keys(Ii).reduce(((e,t)=>Ii[t]===Number(a)?t:e),"");return`${l} ${this.$t(`earn.${s.toLowerCase()}Term`)}`}},methods:{closed(){this.$emit("update:isShow",!1)}}},f$={class:"flex-box flex-column"};const T$=vr(g$,[["render",function(e,t,a,l,r,o){const u=s("TopInfoWrapper"),c=s("NetAmountWrapper"),d=s("InfoWrapper"),p=s("Dialog");return n(),i(p,{class:"history-interest-and-referral-dialog",width:e.$isLargeSize(e.$mq)?"560px":"90%",bodyWithPadding:!1,fullStyle:e.isMobile,isBrandNewStyle:"",isHiddenOnBrowserAction:"",onClosed:o.closed},{header:g((()=>[v(h(e.$t("t.details")),1)])),body:g((()=>[y("div",f$,[m(u,{id:a.detailData.transactionNumber,dateTime:a.detailData.date},null,8,["id","dateTime"]),m(c,{detailData:a.detailData},null,8,["detailData"]),m(d,{infoList:o.infoList},null,8,["infoList"])])])),_:1},8,["width","fullStyle","onClosed"])}]]),w$={class:"interest-wrap"},D$=vr({__name:"Interest",props:{dateRangeData:{type:Object,default:()=>({startDate:null,endDate:null})},selectedCurrency:{type:String,default:""},category:{type:String,required:!0},status:{type:String,default:null},type:{type:String,default:null}},setup(e){const t=e,a=O(!1),l=O(null),{isFirstLoad:s,loadMore:o,pagination:u,setPaginationData:c}=oO({isLoading:a,guard:l}),p=O(!1),h=O(!1),v=K({});function g(){h.value=!0}const{listData:f}=u$({isLoading:a,isFirstLoad:s,dateRangeData:R((()=>t.dateRangeData)),category:R((()=>t.category)),type:R((()=>t.type)),status:R((()=>t.status)),selectedCurrency:R((()=>t.selectedCurrency)),pagination:u,setPaginationData:c,loadMore:o,isShowDetailLoading:p,detailData:v,handleShowDetailDialog:g});function T(e){v.value={...e,amount:e.netAmount,amountCurrency:e.asset,status:be.COMPLETED},g()}return(e,t)=>(n(),r("div",w$,[m(r$,{listData:P(f),isLoading:a.value,handleRowClick:T},null,8,["listData","isLoading"]),y("div",{ref_key:"guard",ref:l,class:"load-more-guard"},null,512),p.value?(n(),i(Cm,{key:0,isShow:p.value,"onUpdate:isShow":t[0]||(t[0]=e=>p.value=e)},null,8,["isShow"])):d("",!0),h.value?(n(),i(P(T$),{key:1,isShow:h.value,"onUpdate:isShow":t[1]||(t[1]=e=>h.value=e),detailData:v.value},null,8,["isShow","detailData"])):d("",!0)]))}},[["__scopeId","data-v-6f106ec3"]]),A$={class:"referral-and-bonus-wrap"},b$=vr({__name:"ReferralAndBonus",props:{dateRangeData:{type:Object,default:()=>({startDate:null,endDate:null})},selectedCurrency:{type:String,default:""},category:{type:String,required:!0},status:{type:String,default:null},type:{type:String,default:null}},setup(e){const t=e,a=O(!1),l=O(null),{isFirstLoad:s,loadMore:o,pagination:u,setPaginationData:c}=oO({isLoading:a,guard:l}),p=O(!1),h=O(!1),v=K({});function g(){h.value=!0}const{listData:f}=u$({isLoading:a,isFirstLoad:s,dateRangeData:R((()=>t.dateRangeData)),category:R((()=>t.category)),type:R((()=>t.type)),status:R((()=>t.status)),selectedCurrency:R((()=>t.selectedCurrency)),pagination:u,setPaginationData:c,loadMore:o,isShowDetailLoading:p,detailData:v,handleShowDetailDialog:g});function T(e){v.value={...e,amount:e.netAmount,amountCurrency:e.asset,status:be.COMPLETED},g()}return(e,t)=>(n(),r("div",A$,[m(r$,{listData:P(f),isLoading:a.value,handleRowClick:T},null,8,["listData","isLoading"]),y("div",{ref_key:"guard",ref:l,class:"load-more-guard"},null,512),p.value?(n(),i(Cm,{key:0,isShow:p.value,"onUpdate:isShow":t[0]||(t[0]=e=>p.value=e)},null,8,["isShow"])):d("",!0),h.value?(n(),i(P(Af),{key:1,isShow:h.value,"onUpdate:isShow":t[1]||(t[1]=e=>h.value=e),detailData:v.value},null,8,["isShow","detailData"])):d("",!0)]))}},[["__scopeId","data-v-afb61f01"]]),_$={class:"buy-crypto-wrap"},S$=vr({__name:"BuySellCrypto",props:{dateRangeData:{type:Object,default:()=>
1({startDate:null,endDate:null})},selectedCurrency:{type:String,default:""},category:{type:String,required:!0},status:{type:String,default:null},type:{type:String,default:null}},setup(e){const t=e,a=O(!1),l=O(null),{isFirstLoad:s,loadMore:o,pagination:u,setPaginationData:c}=oO({isLoading:a,guard:l}),p=O(!1),h=O(!1),v=K({});const{listData:g,getDetailData:f}=u$({isLoading:a,isFirstLoad:s,dateRangeData:R((()=>t.dateRangeData)),category:R((()=>t.category)),type:R((()=>t.type)),status:R((()=>t.status)),selectedCurrency:R((()=>t.selectedCurrency)),pagination:u,setPaginationData:c,loadMore:o,isShowDetailLoading:p,detailData:v,handleShowDetailDialog:function(){h.value=!0}});function T(e){const{id:t,historyType:a}=e;f(t,a)}return(e,t)=>(n(),r("div",_$,[m(r$,{listData:P(g),isLoading:a.value,handleRowClick:T},null,8,["listData","isLoading"]),y("div",{ref_key:"guard",ref:l,class:"load-more-guard"},null,512),m(Ef,{isShow:h.value,"onUpdate:isShow":t[0]||(t[0]=e=>h.value=e),detailData:v.value},null,8,["isShow","detailData"]),p.value?(n(),i(Cm,{key:0,isShow:p.value,"onUpdate:isShow":t[1]||(t[1]=e=>p.value=e)},null,8,["isShow"])):d("",!0)]))}},[["__scopeId","data-v-018a286a"]]),C$={class:"buy-crypto-wrap"},L$=vr({__name:"ExpressBuy",props:{dateRangeData:{type:Object,default:()=>({startDate:null,endDate:null})},selectedCurrency:{type:String,default:""},category:{type:String,required:!0},status:{type:String,default:null},type:{type:String,default:null}},setup(e){const t=e,a=O(!1),l=O(null),{isFirstLoad:s,loadMore:o,pagination:u,setPaginationData:c}=oO({isLoading:a,guard:l}),p=O(!1),h=O(!1),v=K({});const{listData:g,getDetailData:f}=u$({isLoading:a,isFirstLoad:s,dateRangeData:R((()=>t.dateRangeData)),category:R((()=>t.category)),type:R((()=>t.type)),status:R((()=>t.status)),selectedCurrency:R((()=>t.selectedCurrency)),pagination:u,setPaginationData:c,loadMore:o,isShowDetailLoading:p,detailData:v,handleShowDetailDialog:function(){h.value=!0}});function T(e){const{id:a,historyType:l}=e;f(a,l,t.category)}return(e,t)=>(n(),r("div",C$,[m(r$,{listData:P(g),isLoading:a.value,handleRowClick:T},null,8,["listData","isLoading"]),y("div",{ref_key:"guard",ref:l,class:"load-more-guard"},null,512),m(Ef,{isShow:h.value,"onUpdate:isShow":t[0]||(t[0]=e=>h.value=e),detailData:v.value},null,8,["isShow","detailData"]),p.value?(n(),i(Cm,{key:0,isShow:p.value,"onUpdate:isShow":t[1]||(t[1]=e=>p.value=e)},null,8,["isShow"])):d("",!0)]))}},[["__scopeId","data-v-d25fb468"]]),{referralVersion:E$,enableExpressBuyTab:I$,enableExpressSell:k$,enableProviderHistory:R$,enableEarn:N$,enableTasksAndRewards:x$,enableWalletSpot:P$,enableWalletFutures:O$,enableSendTo:$$}=Ge;function W$(){const{t:e}=I(),t=U(),a=R((()=>t.getters.isSubAccount));return{switcherList:R((()=>[{name:an.DEPOSIT_WITHDRAW,title:`${e("t.deposit")} & ${e("t.withdraw")}`,isEnabled:!0},{name:an.SEND_RECEIVE,title:e("wallets.transaction.history.sendAndReceive"),isEnabled:$$},{name:an.TRANSFER,title:e("t.transfer"),isEnabled:P$&&O$},{name:an.INTEREST,title:e("t.interest"),isEnabled:N$},{name:an.REFERRAL_BONUS,title:`${e("t.referral")} & ${e("t.bonus")}`,isEnabled:Boolean(E$)||x$},{name:an.BUY_SELL_CRYPTO,title:e(k$?"t.buySellCrypto":"t.buyCrypto"),isEnabled:I$&&!a.value},{name:an.EXPRESS_BUY_SELL,title:e("display.expressBuySell"),isEnabled:R$}].filter((e=>e.isEnabled))))}}const F$={name:"FilterDialog",components:{BrandDialog:wt,HistoryCurrencyDropdown:AO,WalletDropdown:rn,IconCalendar:da,IconChevronDown:ca,DateRangePickerDialog:pa},props:{showFilterDialog:{type:Boolean,required:!0},dateRangeData:{type:Object,required:!0},selectedType:{type:Number,required:!0},updateFilterData:{type:Function,required:!0},selectedCurrency:{type:String,default:""},category:{type:String,default:""},status:{type:String,default:null},type:{type:String,default:null}},emits:["update:showFilterDialog"],data(){return{minDurationToNow:{years:1},rangeLimitDuration:{years:1},filterDateRangeData:this.dateRangeData,filterCurrency:this.selectedCurrency,filterType:this.type,filterStatus:this.status,showDatePickerDialog:!1}},computed:{...a(pt,["isEnableAutoTraderWallet"]),...a(dt,["isEnableLeadTradingWallet"]),...a(ut,["isEnableAiLeadTradingWallet"]),...a(ct,["isEnableCopyTradingWallet"]),...a(ot,["isEnableAiCopyTradingWallet"]),...a(rt,["isEnableFuturesBotsWallet"]),...a(o$,["isEnableApiBrokerFee"]),...t(["isEnableAutoTraderPrediction","isEnableBinaryOptions","isEnableUpOrDown"]),historyType(){return Object.entries(an).reduce(((e,t)=>t[1]===this.category?t[0]:e),"")},typeList(){let e=en[this.historyType]||[];return"SEND_RECEIVE"===this.historyType?(this.isEnableCopyTradingWallet&&(e=e.concat(pn)),this.isEnableAutoTraderWallet&&this.isEnableAutoTraderPrediction&&(e=e.concat(yn)),this.isEnableBinaryOptions&&(e=e.concat(hn)),this.isEnableUpOrDown&&(e=e.concat(vn)),this.isEnableApiBrokerFee&&(e=e.concat(mn))):"TRANSFER"===this.historyType&&(this.isEnableAutoTraderWallet&&(e=e.concat(gn)),this.isEnableLeadTradingWallet&&(e=e.concat(fn)),this.isEnableAiLeadTradingWallet&&(e=e.concat(Tn)),this.isEnableCopyTradingWallet&&(e=e.concat(wn)),this.isEnableAiCopyTradingWallet&&(e=e.concat(Dn)),this.isEnableFuturesBotsWallet&&(e=e.concat(An))),e.map((e=>this.formatDropdownData(e)))},statusList(){return(ln[this.historyType]||[]).map((e=>this.formatDropdownData(e)))},typeTitleText(){return this.isTransfer?this.$t("t.from_to_to"):this.$t("t.type")},isTransfer(){return this.selectedType===an.TRANSFER},dateRangeText(){return{start:Ms(this.filterDateRangeData.start,"yyyy-MM-dd"),end:Ms(this.filterDateRangeData.end,"yyyy-MM-dd")}}},methods:{updateType(e){this.filterType=e},updateStatus(e){this.filterStatus=e},formatDropdownData(e){let t=this.$t(`t.${e.toLowerCase()}`);switch(e.includes(ni.AUTO_TRADER)&&(t=this.$t(`t.${e.replace(ni.AUTO_TRADER,"AUTOTRADER").toLowerCase()}`)),e){case"EXPRESS_BUY":t=this.$t("display.expressBuy");break;case"EXPRESS_SELL":t=this.$t("display.expressSell")}return{name:t,value:e}},onResetClick(){const{typeDropdown:e,statusDropdown:t}=this.$refs;this.resetDate(),this.filterCurrency="",e&&e.reset(this.typeList[0].value),t&&t.reset(this.statusList[0].value)},onApplyClick(){this.updateFilterData({dateRangeData:this.filterDateRangeData,selectedCurrency:this.filterCurrency,status:this.filterStatus,type:this.filterType}),this.close()},close(){this.$emit("update:showFilterDialog",!1)},resetDate(){const[e,t]=xe(on);this.filterDateRangeData={start:e,end:t}},openDatePickerDialog(){this.showDatePickerDialog=!0}}},B$={class:"filters-wrap"},U$={class:"filter"},M$={class:"sub-title"},V$={class:"dates"},H$={class:"filter"},G$={class:"sub-title"},Y$={key:0,class:"filter"},q$={class:"sub-title"},z$={key:1,class:"filter"},K$={class:"sub-title"},j$={class:"flex-box footer-wrapper items-end"};const X$=vr(F$,[["render",function(e,t,a,l,o,u){const c=s("IconCalendar"),p=s("IconChevronDown"),f=s("HistoryCurrencyDropdown"),T=s("WalletDropdown"),w=s("DateRangePickerDialog"),D=s("Brand
1Button"),A=s("BrandDialog");return n(),i(A,{class:"filter-dialog",idPrefix:"transaction_history_filter_dialog",isBrandNewStyle:"",hideScrollbar:"",fullStyle:"",showClose:"",onClosed:u.close},{header:g((()=>[v(h(e.$t("t.filters")),1)])),body:g((()=>[y("div",B$,[y("div",U$,[y("span",M$,h(e.$t("t.timePeriod")),1),y("div",{class:"date-range-wrapper",onClick:t[0]||(t[0]=(...e)=>u.openDatePickerDialog&&u.openDatePickerDialog(...e))},[m(c,{class:"icon-calendar"}),y("div",V$,[y("span",null,h(u.dateRangeText.start),1),t[4]||(t[4]=y("span",null,"-",-1)),y("span",null,h(u.dateRangeText.end),1)]),m(p,{class:"arrow"})])]),y("div",H$,[y("span",G$,h(e.$t("t.asset")),1),m(f,{selectedCurrency:o.filterCurrency,"onUpdate:selectedCurrency":t[1]||(t[1]=e=>o.filterCurrency=e),class:"currency-dropdown"},null,8,["selectedCurrency"])]),u.typeList.length>1?(n(),r("div",Y$,[y("span",q$,h(u.typeTitleText),1),m(T,{ref:"typeDropdown",class:L(["dropdown",{selected:!!o.filterType}]),height:"45px",list:u.typeList,handleUpdate:u.updateType,placeholder:e.$t("t.all_types"),defaultValue:a.type},null,8,["class","list","handleUpdate","placeholder","defaultValue"])])):d("",!0),u.statusList.length?(n(),r("div",z$,[y("span",K$,h(e.$t("t.status")),1),m(T,{ref:"statusDropdown",class:L(["dropdown",{selected:!!o.filterStatus}]),height:"45px",list:u.statusList,handleUpdate:u.updateStatus,placeholder:e.$t("t.all_status"),defaultValue:a.status},null,8,["class","list","handleUpdate","placeholder","defaultValue"])])):d("",!0)]),o.showDatePickerDialog?(n(),i(w,{key:0,showDatePickerDialog:o.showDatePickerDialog,"onUpdate:showDatePickerDialog":t[2]||(t[2]=e=>o.showDatePickerDialog=e),dateRange:o.filterDateRangeData,"onUpdate:dateRange":t[3]||(t[3]=e=>o.filterDateRangeData=e),minDurationToNow:o.minDurationToNow,rangeLimitDuration:o.rangeLimitDuration},null,8,["showDatePickerDialog","dateRange","minDurationToNow","rangeLimitDuration"])):d("",!0)])),footer:g((()=>[y("div",j$,[m(D,{class:"action-btn",type:"cancel",size:"biggest",onClick:u.onResetClick},{default:g((()=>[v(h(e.$t("t.reset")),1)])),_:1},8,["onClick"]),m(D,{class:"action-btn",size:"biggest",onClick:u.onApplyClick},{default:g((()=>[v(h(e.$t("earn.filter.apply")),1)])),_:1},8,["onClick"])])])),_:1},8,["onClosed"])}],["__scopeId","data-v-5639b558"]]),Q$={class:"wallet-transaction-history"},Z$={class:"top-wrapper"},J$={class:"tools-wrapper"},eW={class:"dates"},tW={key:0,class:"filter-chips"},aW={class:"main-content"},lW=vr({__name:"WalletTransactionHistory",setup(e){const t=U(),a=V(),l=M(),{t:o}=I(),{switcherList:u}=W$(),c=o$(),w=O(!1),D=O(!0),b=O(!1),_=nn,S=sn,C=O(Nl.compact),E=O(0),k=R((()=>{var e;return(null==(e=a.params)?void 0:e.category)||an.DEPOSIT_WITHDRAW})),[N,W]=xe(on),F=O({start:N,end:W}),B=O(!0),G=O(!1),z=O(""),K=O(null),X=O(null),Q=O(!1),Z=O({pageSize:10,currentPage:1}),{downloadPathname:J,downloadQueryString:ee,onramperDownloadQueryString:te}=u$({isLoading:w,isFirstLoad:D,selectedDateRangeData:F,category:k,type:K,status:X,selectedCurrency:z,pagination:Z,loadMore:b}),ae=R((()=>ro($a.downloadSpotHistory,J,te.value))),le=R((()=>t.state.lang)),se=R((()=>t.getters.isArabic)),ie=R((()=>{switch(k.value){case an.DEPOSIT_WITHDRAW:return VO;case an.SEND_RECEIVE:return d$;case an.TRANSFER:return m$;case an.INTEREST:return D$;case an.REFERRAL_BONUS:return b$;case an.BUY_SELL_CRYPTO:return S$;case an.EXPRESS_BUY_SELL:return L$;default:return VO}})),ne=R((()=>{const e=K.value&&"ALL_TYPES"!==K.value,t=X.value&&"All_STATUS"!==X.value;return Boolean(!!z.value||e||t)})),re=R((()=>[{property:"selectedCurrency",text:z.value,default:"",enable:""!==z.value,ref:z},{property:"type",text:K.value?oe(K.value):"",default:null,enable:K.value&&"ALL_TYPES"!==K.value,ref:K},{property:"status",text:X.value?o(`t.${X.value.toLowerCase()}`):"",default:null,enable:X.value&&"All_STATUS"!==X.value,ref:X}].filter((e=>e.enable))));function oe(e){switch(e){case"EXPRESS_BUY":return o("display.expressBuy");case"EXPRESS_SELL":return o("display.expressSell");default:return o(`t.${e.toLowerCase()}`)}}const ue=R((()=>({start:Ms(F.value.start,"yyyy-MM-dd"),end:Ms(F.value.end,"yyyy-MM-dd")})));$(E,(()=>{K.value="",X.value=""})),j((()=>
1{c.fetchInit();const e=u.value.findIndex((e=>e.name===k.value));-1===e?l.replace({params:{lang:le.value,category:an.DEPOSIT_WITHDRAW}}):E.value=e})),Y((()=>{document.body.addEventListener("wheel",de)})),q((()=>{document.body.removeEventListener("wheel",de)}));const ce=e=>{E.value!==e&&(E.value=e,l.replace({params:{lang:le.value,category:u.value[e].name}}),H((()=>{ge()})))},de=ma((e=>{!e.deltaY||Math.abs(e.deltaY)<10||(e.deltaY<0?B.value=!0:B.value=!1)}),100),pe=()=>{G.value=!0},ye=e=>{var t;t=e.dateRangeData,F.value=t,z.value=e.selectedCurrency,X.value=e.status,K.value=e.type},he=e=>{e.ref.value=e.default},ve=O(null),ge=()=>{const e=ve.value,t=e.getElementsByTagName("li")[E.value];if(!t)return;const a=t.getBoundingClientRect(),l=e.clientWidth/2,s=t.offsetLeft-l+a.width/2;se.value?e.scrollLeft=Math.min(s,0):e.scrollLeft=Math.max(s,0)},fe=()=>{Q.value=!0},Te=R((()=>ro($a.downloadSpotHistory,"/report/histories/transaction/providers/ONRAMPER",ee.value.replaceAll("ALL",""))));return(e,t)=>{const a=s("BaseButton");return n(),r("div",Q$,[y("div",Z$,[y("div",{ref_key:"typeSwitcher",ref:ve,class:"type-switcher"},[m(P(Pl),{class:"switcher",barHeight:4,type:P(xl).BOTTOM_BAR_NARROW,theme:C.value,itemList:P(u).map((e=>e.title)),selected:E.value,onSelect:ce},null,8,["type","theme","itemList","selected"])],512),m(me,{name:"filter-fade"},{default:g((()=>[f(y("div",{class:L(["filter-wrapper",{isFiltered:ne.value}])},[y("div",J$,[y("div",{class:"date-range-wrapper",onClick:fe},[m(P(da),{class:"icon-calendar"}),y("div",eW,[y("span",null,h(ue.value.start),1),t[5]||(t[5]=y("span",null,"-",-1)),y("span",null,h(ue.value.end),1)])]),m(bn,{class:"filter-btn",isFiltered:ne.value,onClick:pe},null,8,["isFiltered"])]),ne.value?(n(),r("div",tW,[(n(!0),r(p,null,x(re.value,(e=>(n(),i(Vs,{key:e.filterChips,chipData:e,handleClearFilter:he},null,8,["chipData"])))),128))])):d("",!0),k.value===P(an).EXPRESS_BUY_SELL?(n(),i(Ds,{key:1,requestDownload:Te.value,defaultRangeDate:F.value},{default:g((()=>[m(a,{class:"outline-primary w-100",size:P(qs).S},{default:g((()=>[v(h(P(o)("t.downloadHistory")),1)])),_:1},8,["size"])])),_:1},8,["requestDownload","defaultRangeDate"])):(n(),i(Ds,{key:2,fileName:k.value,requestDownload:ae.value,defaultRangeDate:F.value,hasPdf:""},{default:g((()=>[m(a,{class:"outline-primary w-100",size:P(qs).S},{default:g((()=>[v(h(P(o)("t.downloadHistory")),1)])),_:1},8,["size"])])),_:1},8,["fileName","requestDownload","defaultRangeDate"]))],2),[[T,B.value]])])),_:1})]),y("div",aW,[(n(),i(A(ie.value),{dateRangeData:F.value,"onUpdate:dateRangeData":t[0]||(t[0]=e=>F.value=e),class:"content-wrap",selectedCurrency:z.value,type:K.value,status:X.value,category:k.value},null,40,["dateRangeData","selectedCurrency","type","status","category"]))]),G.value?(n(),i(X$,{key:0,show
1FilterDialog:G.value,"onUpdate:showFilterDialog":t[1]||(t[1]=e=>G.value=e),dateRangeData:F.value,"onUpdate:dateRangeData":t[2]||(t[2]=e=>F.value=e),selectedType:E.value,updateFilterData:ye,selectedCurrency:z.value,category:k.value,type:K.value,status:X.value},null,8,["showFilterDialog","dateRangeData","selectedType","selectedCurrency","category","type","status"])):d("",!0),Q.value?(n(),i(pa,{key:1,showDatePickerDialog:Q.value,"onUpdate:showDatePickerDialog":t[3]||(t[3]=e=>Q.value=e),dateRange:F.value,"onUpdate:dateRange":t[4]||(t[4]=e=>F.value=e),minDurationToNow:P(_),rangeLimitDuration:P(S)},null,8,["showDatePickerDialog","dateRange","minDurationToNow","rangeLimitDuration"])):d("",!0)])}}},[["__scopeId","data-v-5a4c14e9"]]),{enableSubAccount:sW}=En,iW={name:"FilterDialog",components:{BrandDialog:wt,IconCalendar:da,IconChevronDown:Ka,WalletDropdown:rn,DateSinglePickerDialog:Cn,BaseButton:Sn},props:{initDate:{type:Date,default:new Date},accountList:{type:Array,default:()=>[]},walletOptions:{type:Array,default:()=>[]},estimatedCurrencyOptions:{type:Array,default:()=>[]},filter:{type:Object,default:()=>({})},minDurationToNow:{type:Object,default:null},maxDurationToNow:{type:Object,default:()=>({days:0})},defaultEstimatedCurrency:{type:String,default:""}},emits:["update:showFilterDialog","handleApply"],data(){return{enableSubAccount:sW,..._n.data(),isShowDatePickerDialog:!1,filterForm:{date:this.filter.date,account:this.filter.account,walletTypes:this.filter.walletTypes,estimatedCurrency:this.filter.estimatedCurrency}}},computed:{...t(["isSubAccount"]),..._n.computed},methods:{close(){this.$emit("update:showFilterDialog",!1)},handleAccountUpdate(e){this.filterForm.account=e},handleWalletUpdate(e){this.filterForm.walletTypes=e},handleEstimatedCurrencyUpdate(e){this.filterForm.estimatedCurrency=e},onShowDatePickerDialog(){this.isShowDatePickerDialog=!0},onResetClick(){this.filterForm.date=Ln.days(Date.now(),1),this.$refs.accountDropdown.reset(this.accountList[0].value),this.$refs.walletDropdown.reset([this.walletOptions[0].value]),this.$refs.estimatedCurrencyDropdown.reset(this.defaultEstimatedCurrency||this.estimatedCurrencyOptions[0].value)},onApplyClick(){this.$emit("handleApply",{...this.filterForm}),this.close()}}},nW={class:"filters-wrapper"},rW={class:"filter"},oW={class:"sub-title"},uW={class:"dates"},cW={key:0,class:"filter"},dW={class:"sub-title"},pW={class:"filter"},yW={class:"sub-title"},hW={class:"filter"},vW={class:"sub-title"},mW={class:"footer-wrapper"},gW={class:"button-group"};const fW=vr(iW,[["render",function(e,t,a,l,o,u){const c=s("IconCalendar"),p=s("IconChevronDown"),f=s("WalletDropdown"),T=s("DateSinglePickerDialog"),w=s("BaseButton"),D=s("BrandDialog");return n(),i(D,{class:"filter-dialog",isBrandNewStyle:"",hideScrollbar:"",fullStyle:"",showClose:"",onClosed:u.close},{header:g((()=>[v(h(e.$t("t.filters")),1)])),body:g((()=>[y("div",nW,[y("div",rW,[y("span",oW,h(e.$t("t.date")),1),y("div",{class:"date-range-wrapper",onClick:t[0]||(t[0]=(...e)=>u.onShowDatePickerDialog&&u.onShowDatePickerDialog(...e))},[m(c,{class:"icon-calendar"}),y("div",uW,h(e.$filters.formatDate(o.filterForm.date,"yyyy-MM-dd")),1),m(p,{class:"arrow"})])]),o.enableSubAccount?(n(),r("div",cW,[y("span",dW,h(e.$t("t.account")),1),m(f,{ref:"accountDropdown",class:"dropdown",list:a.accountList,defaultValue:a.filter.account,isDisabled:e.isSubAccount,handleUpdate:u.handleAccountUpdate},null,8,["list","defaultValue","isDisabled","handleUpdate"])])):d("",!0),y("div",pW,[y("span",yW,h(e.$t("t.wallet")),1),m(f,{ref:"walletDropdown",class:"dropdown wallet-dropdown",list:a.walletOptions,defaultValue:a.filter.walletTypes,isMultiple:"",isMultipleCounter:!1,isMultipleShowButton:!1,isMultipleShowMobileDialog:!1,handleUpdate:u.handleWalletUpdate},null,8,["list","defaultValue","handleUpdate"])]),y("div",hW,[y("span",vW,h(e.$t("accountStatement.estimatedValue")),1),m(f,{ref:"estimatedCurrencyDropdown",class:"dropdown",list:a.estimatedCurrencyOptions,defaultValue:a.filter.estimatedCurrency,handleUpdate:u.handleEstimatedCurrencyUpdate,isUseDefaultValue:""},null,8,["list","defaultValue","handleUpdate"])])]),o.isShowDatePickerDialog?(n(),i(T,{key:0,showDatePickerDialog:o.isShowDatePickerDialog,"onUpdate:showDatePickerDialog":t[1]||(t[1]=e=>o.isShowDatePickerDialog=e),date:o.filterForm.date,"onUpdate:date":t[2]||(t[2]=e=>o.filterForm.date=e),minDurationToNow:a.minDurationToNow,maxDurationToNow:a.maxDurationToNow},null,8,["showDatePickerDialog","date","minDurationToNow","maxDurationToNow"])):d("",!0)])),footer:g((()=>[y("div",mW,[y("div",gW,[m(w,{class:"outline-primary",size:"large",onClick:u.onResetClick},{default:g((()=>[v(h(e.$t("t.reset")),1)])),_:1},8,["onClick"]),m(w,{class:"primary",size:"large",onClick:u.onApplyClick},{default:g((()=>[v(h(e.$t("earn.filter.apply")),1)])),_:1},8,["onClick"])])])])),_:1},8,["onClosed"])}],["__scopeId","data-v-b1087207"]]),TW="SELECT_METHOD",wW="SEND_VIA_EMAIL",DW="SEND_VIA_EMAIL_SUCCESSFUL",AW="SEND_VIA_EMAIL_FAIL",bW="SEND_EMAIL",_W="DOW
1NLOAD_PDF";Pn("pdfPassword",(e=>/^\d+$/.test(e)&&10===e.length||On.t("accountStatement.downloadPdf.inputPasswordErrorMessage.v2")));const SW={name:"DownloadPdfContent",components:{Checkbox:Wr,FormField:zi,FormFieldInput:In,BrandMessage:Ja},inheritAttrs:!1,props:{filters:{type:Object,required:!0},isMasterAccount:{type:Boolean,required:!0}},emits:["close","update:pageName","handleUpdateData"],setup(){const{handleErrorEvent:e}=xn();return{handleErrorEvent:e}},data:()=>({isLoading:!1,isAgreeIncludeUserInfo:!0,isShowDownloadLimitReachedTryLater:!1,password:"",MESSAGE_GENRE:tl}),computed:{...t(["isIdVerified"])},methods:{async onDownload(){var e;this.isLoading=!0;try{await Oa.getAccountStatementPdf({time:this.filters.date.getTime(),zoneOffset:gs(),alias:this.isMasterAccount?"":this.filters.account,withUserInfo:this.isAgreeIncludeUserInfo,password:this.password?btoa(this.password):"",sendType:_W,estimatedCurrency:this.filters.estimatedCurrency,walletTypes:null==(e=this.filters.walletTypes)?void 0:e.filter((e=>e!==kn.ALL)).join(",")}),this.$openDialog(Rn),this.$emit("close")}catch(t){t===Nn.EXCEED_USER_REPORT_REQUEST_RATE_LIMIT?this.isShowDownloadLimitReachedTryLater=!0:this.handleErrorEvent(t)}this.isLoading=!1},onGoSendEmail(){this.$emit("update:pageName",wW),this.$emit("handleUpdateData",{isAgreeIncludeUserInfo:this.isAgreeIncludeUserInfo,password:this.password})}}},CW={class:"id-info"},LW={class:"button-group"};const EW=vr(SW,[["render",function(e,t,a,l,o,u){const c=s("BrandMessage"),f=s("Checkbox"),T=s("FormFieldInput"),w=s("FormField"),D=s("BaseButton"),A=s("ValidationForm");return n(),r(p,null,[o.isShowDownloadLimitReachedTryLater?(n(),i(c,{key:0,genre:o.MESSAGE_GENRE.WARNING,class:"mb-24"},{default:g((()=>[v(h(e.$t("downloadFile.downloadLimitReachedTryLater")),1)])),_:1},8,["genre"])):d("",!0),m(A,{class:"download-pdf-content",as:"div"},{default:g((({meta:a})=>[e.isIdVerified?(n(),r(p,{key:0},[m(f,{value:o.isAgreeIncludeUserInfo,"onUpdate:value":t[0]||(t[0]=e=>o.isAgreeIncludeUserInfo=e),class:"check-box",disabled:o.isShowDownloadLimitReachedTryLater,isBrandNewStyle:""},{default:g((()=>[v(h(e.$t("accountStatement.downloadPdf.checkboxText")),1)])),_:1},8,["value","disabled"]),y("ul",CW,[y("li",null,h(e.$t("t.userName")),1),y("li",null,h(e.$t("t.fullName")),1),y("li",null,h(e.$t("t.address")),1),y("li",null,h(e.$t("accountStatement.downloadPdf.idType")),1),y("li",null,h(e.$t("t.emailAddress")),1)])],64)):d("",!0),y("div",{class:L(["note",{"is-id-unverified":!e.isIdVerified}])},h(e.$t("accountStatement.downloadPdf.note")),3),m(w,{class:"password-input-field",title:e.$t("t.newPassword")},{default:g((()=>[m(T,{value:o.password,"onUpdate:value":t[1]||(t[1]=e=>o.password=e),name:"password",class:"password-input",autocomplete:"new-password",placeholder:e.$t("accountStatement.downloadPdf.inputPasswordPlaceholder.v2"),rules:"pdfPassword",disabled:o.isShowDownloadLimitReachedTryLater,hidable:""},null,8,["value","placeholder","disabled"])])),_:1},8,["title"]),y("div",LW,[m(D,{class:"download-button send-email",size:"large",isLoading:o.isLoading,disabled:!a.valid||o.isShowDownloadLimitReachedTryLater,onClick:u.onGoSendEmail},{default:g((()=>[v(h(e.$t("t.sendViaEmail")),1)])),_:2},1032,["isLoading","disabled","onClick"]),m(D,{class:"download-button primary",size:"large",isLoading:o.isLoading,disabled:!a.valid||o.isShowDownloadLimitReachedTryLater,onClick:u.onDownload},{default:g((()=>[v(h(e.$t("t.downloadPDF")),1)])),_:2},1032,["isLoading","disabled","onClick"])])])),_:1})],64)}],["__scopeId","data-v-4d4b408f"]]),IW={name:"SendViaEmailContent",components:{Checkbox:Wr,FormField:zi,FormFieldInput:In,BrandMessage:Ja},inheritAttrs:!1,props:{filters:{type:Object,required:!0},isMasterAccount:{type:Boolean,required:!0},form:{type:Object,required:!0}},emits:["update:pageName","close","handleUpdateData"],data:()=>({MESSAGE_GENRE:tl,isLoading:!1,isShowDownloadLimitReachedTryLater:!1,recipientEmails:["","",""],isSaveRecipient:!0}),created(){this.getSaveRecipientEmailInfo()},methods:{async getSaveRecipientEmailInfo(){try{const e=await Oa.getAccountStatementSaveRecipientEmailInfo();e&&(this.isSaveRecipient=(null==e?void 0:e.rememberMe)||!1,this.recipientEmails=(null==e?void 0:e.emailSet)||["","",""])}catch{}},async onSend(){var e;this.isLoading=!0;try{await Oa.getAccountStatementPdf({time:this.filters.date.getTime(),zoneOffset:gs(),alias:this.isMasterAccount?"":this.filters.account,withUserInfo:this.form.isAgreeIncludeUserInfo,password:this.form.password?btoa(this.form.password):"",sendType:bW,rememberMe:this.isSaveRecipient,emailList:this.recipientEmails.filter((e=>e)).join(","),estimatedCurrency:this.filters.estimatedCurrency,walletTypes:null==(e=this.filters.walletTypes)?void 0:e.filter((e=>e!==kn.ALL)).join(",")}),this.$emit("update:pageName",DW)}catch(t){t===Nn.EXCEED_USER_REPORT_REQUEST_RATE_LIMIT?this.isShowDownloadLimitReachedTryLater=!0:this.$emit("update:pageName",AW)}this.isLoading=!1}}},kW={class:"note"};const RW=vr(IW,[["render",function(e,t,a,l,o,u){const c=s("BrandMessage"),f=s("FormFieldInput"),T=s("FormField"),w=s("Checkbox"),D=s("BaseButton"),A=s("ValidationForm");
1return n(),r(p,null,[o.isShowDownloadLimitReachedTryLater?(n(),i(c,{key:0,genre:o.MESSAGE_GENRE.WARNING,class:"mb-24"},{default:g((()=>[v(h(e.$t("downloadFile.downloadLimitReachedTryLater")),1)])),_:1},8,["genre"])):d("",!0),m(A,{class:"send-via-email-content",as:"div"},{default:g((({meta:a})=>[y("div",kW,h(e.$t("accountStatement.downloadPdf.sendEmail.note")),1),(n(),r(p,null,x(3,(t=>m(T,{key:t,class:"email-input-field",title:e.$t("accountStatement.downloadPdf.sendEmail.recipientNumber",{number:t})},{default:g((()=>[m(f,{value:o.recipientEmails[t-1],"onUpdate:value":e=>o.recipientEmails[t-1]=e,name:"recipientEmails",class:"password-input",placeholder:e.$t("t.enterEmailAddress"),rules:"email",disabled:o.isShowDownloadLimitReachedTryLater},null,8,["value","onUpdate:value","placeholder","disabled"])])),_:2},1032,["title"]))),64)),m(w,{value:o.isSaveRecipient,"onUpdate:value":t[0]||(t[0]=e=>o.isSaveRecipient=e),class:"check-box",isBrandNewStyle:"",disabled:o.isShowDownloadLimitReachedTryLater},{default:g((()=>[v(h(e.$t("accountStatement.downloadPdf.sendEmail.saveRecipient")),1)])),_:1},8,["value","disabled"]),m(D,{class:"send-button primary",size:"large",isLoading:o.isLoading,disabled:!a.valid||o.isShowDownloadLimitReachedTryLater,onClick:u.onSend},{default:g((()=>[v(h(e.$t("t.send")),1)])),_:2},1032,["isLoading","disabled","onClick"])])),_:1})],64)}],["__scopeId","data-v-209417f2"]]),NW={class:"send-via-email-successful"},xW={class:"text"};const PW=vr({name:"SendViaEmailSuccessful",components:{IconSuccess:Vi},emits:["close"],methods:{onOk(){this.$emit("close")}}},[["render",function(e,t,a,l,i,o){const u=s("IconSuccess"),c=s("BaseButton");return n(),r("div",NW,[m(u),y("div",xW,h(e.$t("t.sent"))+"!",1),m(c,{class:"button primary",size:"large",onClick:o.onOk},{default:g((()=>[v(h(e.$t("t.ok")),1)])),_:1},8,["onClick"])])}],["__scopeId","data-v-7375e4f1"]]),OW={class:"send-via-email-fail"},$W={class:"text"};const WW=vr({name:"SendViaEmailFail",components:{IconFlashFail:Mi},emits:["close"],methods:{onOk(){this.$emit("close")}}},[["render",function(e,t,a,l,i,o){const u=s("IconFlashFail"),c=s("BaseButton");return n(),r("div",OW,[m(u),y("div",$W,h(e.$t("trade.marginCall.errorText")),1),m(c,{class:"button primary",size:"large",onClick:o.onOk},{default:g((()=>[v(h(e.$t("t.ok")),1)])),_:1},8,["onClick"])])}],["__scopeId","data-v-d3eb295b"]]);const FW=vr({name:"DownloadPdfDialog",components:{BrandDialog:wt},props:{filters:{type:Object,required:!0},isMasterAccount:{type:Boolean,required:!0}},emits:["dialog:closed"],data:()=>({pageName:TW,form:{isAgreeIncludeUserInfo:!1,password:""}}),computed:{headerText(){switch(this.pageName){case TW:return this.$t("t.exportPDF");case wW:case DW:case AW:return this.$t("t.sendViaEmail");default:return this.$t("t.exportPDF")}},component(){switch(this.pageName){case TW:return EW;case wW:return RW;case DW:return PW;case AW:return WW;default:return EW}}},methods:{handleUpdateData(e){this.form={...this.form,...e}},close(){this.$emit("dialog:closed")}}},[["render",function(e,t,a,l,r,o){const u=s("BrandDialog");return n(),i(u,{class:"download-pdf-dialog",isBrandNewStyle:"",width:"560px",fullStyle:e.isMobile,onClosed:o.close},{header:g((()=>[v(h(o.headerText),1)])),body:g((()=>[(n(),i(A(o.component),{pageName:r.pageName,"onUpdate:pageName":t[0]||(t[0]=e=>r.pageName=e),filters:a.filters,isMasterAccount:a.isMasterAccount,form:r.form,onHandleUpdateData:o.handleUpdateData,onClose:o.close},null,40,["pageName","filters","isMasterAccount","form","onHandleUpdateData","onClose"]))])),_:1},8,["fullStyle","onClosed"])}]]),{enableSpotTrade:BW,enableFuturesTrade:UW,enableEarn:MW}=Ge;function VW(){const{isEnableAutoTraderWallet:e}=S(pt()),{isEnableCopyTradingWallet:t}=S(ct()),{isEnableAiCopyTradingWallet:a}=S(ot()),{isEnableFuturesBotsWallet:l}=S(rt());return{accountStatementWalletEnabledMap:R((()=>({[kn.SPOT]:BW,[kn.FUTURES]:UW,[kn.AUTO_TRADER]:e.value,[kn.COPY_TRADING]:t.value,[kn.AI_COPY_TRADING]:a.value,[kn.FUTURES_BOTS]:l.value,[kn.EARN]:MW})))}}const{enableAccountStatementDownloadReport:HW,accountStatementDefaultCurrency:GW}=Ge,{enableSubAccount:YW}=En,qW={name:"AccountStatementFilters",components:{DateSinglePicker:$n,WalletDropdown:rn,FilterButton:bn,IconCalendar:da,IconChevronDown:ca,IconDownload2:ws,DateSinglePickerDialog:Cn,FilterDialog:fW,FileDownload:Ds},emits:["handleUpdateFilter"],setup(){const{accountStatementWalletEnabledMap:e}=VW();return{DownloadPdfDialog:FW,accountStatementWalletEnabledMap:e}},data(){const e=B(F(Date.now(),{days:1}));
1return{isShowDatePickerDialog:!1,isShowFiltersDialog:!1,enableAccountStatementDownloadReport:HW,enableSubAccount:YW,minDurationToNow:{years:1},maxDurationToNow:{days:1},subAccountList:[],filterForm:{date:e,account:"",walletTypes:[],estimatedCurrency:""}}},computed:{...l(["accountInfo","isAccountInfoLoaded"]),...a(Ut,["accountCurrency"]),...t(["isSubAccount"]),accountList(){return 0===this.subAccountList.length?[]:this.isSubAccount?[{value:this.accountInfo.subAccountAlias,name:this.accountInfo.subAccountAlias,subText:`(UID: ${this.accountInfo.uid})`}]:this.subAccountList.map((({username:e,alias:t,isSub:a})=>({value:t||e,name:t||e,subText:a?"":`(UID: ${this.accountInfo.uid})`})))},walletOptions(){const e=[{value:kn.ALL,name:this.$t("t.all")}];for(const t of Fn)this.accountStatementWalletEnabledMap[t]&&e.push({value:t,name:this.$t(Bn[t].labelKey)});return e},estimatedCurrencyOptions(){return Array.from(new Set(["USDT",this.accountCurrency])).map((e=>({value:e,name:e})))},defaultEstimatedCurrency(){var e;return(null==(e=this.estimatedCurrencyOptions.find((e=>e.value===GW)))?void 0:e.value)||this.estimatedCurrencyOptions[0].value},isMasterAccount(){const e=this.subAccountList.find((({isSub:e})=>!e))||{};return this.isSubAccount||this.filterForm.account===e.username}},watch:{isAccountInfoLoaded:{immediate:!0,handler(e){e&&this.init()}},filterForm:{immediate:!0,deep:!0,handler(e){this.$emit("handleUpdateFilter",{...e,isSelectMasterAccount:this.isMasterAccount})}},accountInfo:{deep:!0,handler(){var e;this.filterForm.account=null==(e=this.accountList[0])?void 0:e.value}}},methods:{...u("subAccount",["getFilterSubAccountAliasList"]),async init(){try{this.enableSubAccount&&(this.subAccountList=await Wn.getAccountAlias({reqType:Wn.accountAliasReqType.walletTransferList}),this.filterForm.account=this.accountList[0].value),this.filterForm.walletTypes=[this.walletOptions[0].value],this.filterForm.estimatedCurrency=this.defaultEstimatedCurrency}catch{}},handleAccountUpdate(e){this.filterForm.account=e},handleWalletUpdate(e){this.filterForm.walletTypes=e},handleEstimatedCurrencyUpdate(e){this.filterForm.estimatedCurrency=e},handleApply(e){this.filterForm=e},onReset(){var e;this.filterForm.date=B(F(Date.now(),{days:1})),null==(e=this.$refs.accountDropdown)||e.reset(this.accountList[0].value),this.$refs.walletDropdown.reset([this.walletOptions[0].value]),this.$refs.estimatedCurrencyDropdown.reset(this.defaultEstimatedCurrency)},onShowDatePickerDialog(){this.isShowDatePickerDialog=!0},onShowFilterDialog(){this.isShowFiltersDialog=!0}}},zW={class:"filters"},KW={key:0,class:"filters-mobile-wrapper"},jW={class:"filters-top-wrapper"},XW={class:"dates"},QW={class:"m-button-text-wrap"},ZW={key:1,class:"filters-wrapper"},JW={class:"filter-list"},eF={class:"item"},tF={class:"item-title"},aF={key:0,class:"item"},lF={class:"item-title"},sF={class:"item"},iF={class:"item-title"},nF={class:"item"},rF={class:"item-title"};const oF=vr(qW,[["render",function(e,t,a,l,o,u){const c=s("IconCalendar"),p=s("IconChevronDown"),v=s("FilterButton"),f=s("IconDownload2"),T=s("FileDownload"),w=s("DateSinglePickerDialog"),D=s("FilterDialog"),A=s("DateSinglePicker"),b=s("WalletDropdown");return n(),r("div",zW,[e.isMobile?(n(),r("div",KW,[y("div",jW,[y("div",{class:"date-wrapper",onClick:t[0]||(t[0]=(...e)=>u.onShowDatePickerDialog&&u.onShowDatePickerDialog(...e))},[m(c,{class:"icon-calendar"}),y("div",XW,h(e.$filters.formatDate(o.filterForm.date,"yyyy-MM-dd")),1),m(p,{class:"arrow"})]),m(v,{onClick:u.onShowFilterDialog},null,8,["onClick"])]),o.enableAccountStatementDownloadReport?(n(),i(T,{key:0,class:"download-pdf-button",fileDownloadDialogComponent:l.DownloadPdfDialog,fileDownloadDialogProps:{filters:o.filterForm,isMasterAccount:u.isMasterAccount}},{default:g((()=>[y("div",QW,[m(f,{class:"icon-download"}),y("span",null,h(e.$t("t.downloadPDF")),1)])])),_:1},8,["fileDownloadDialogComponent","fileDownloadDialogProps"])):d("",!0),o.isShowDatePickerDialog?(n(),i(w,{key:1,showDatePickerDialog:o.isShowDatePickerDialog,"onUpdate:showDatePickerDialog":t[1]||(t[1]=e=>o.isShowDatePickerDialog=e),date:o.filterForm.date,"onUpdate:date":t[2]||(t[2]=e=>o.filterForm.date=e),minDurationToNow:o.minDurationToNow,maxDurationToNow:o.maxDurationToNow},null,8,["showDatePickerDialog","date","minDurationToNow","maxDurationToNow"])):d("",!0),o.isShowFiltersDialog?(n(),i(D,{key:2,showFilterDialog:o.isShowFiltersDialog,"onUpdate:showFilterDialog":t[3]||(t[3]=e=>o.isShowFiltersDialog=e),initDate:o.filterForm.date,minDurationToNow:o.minDurationToNow,maxDurationToNow:o.maxDurationToNow,accountList:u.accountList,walletOptions:u.w
1alletOptions,estimatedCurrencyOptions:u.estimatedCurrencyOptions,defaultEstimatedCurrency:u.defaultEstimatedCurrency,filter:o.filterForm,onHandleApply:u.handleApply},null,8,["showFilterDialog","initDate","minDurationToNow","maxDurationToNow","accountList","walletOptions","estimatedCurrencyOptions","defaultEstimatedCurrency","filter","onHandleApply"])):d("",!0)])):(n(),r("div",ZW,[y("div",JW,[y("div",eF,[y("span",tF,h(e.$t("t.date")),1),m(A,{date:o.filterForm.date,"onUpdate:date":t[4]||(t[4]=e=>o.filterForm.date=e),minDurationToNow:o.minDurationToNow,maxDurationToNow:o.maxDurationToNow},null,8,["date","minDurationToNow","maxDurationToNow"])]),o.enableSubAccount?(n(),r("div",aF,[y("span",lF,h(e.$t("t.account")),1),m(b,{ref:"accountDropdown",class:"account-dropdown dropdown",list:u.accountList,isDisabled:e.isSubAccount,handleUpdate:u.handleAccountUpdate},null,8,["list","isDisabled","handleUpdate"])])):d("",!0),y("div",sF,[y("span",iF,h(e.$t("t.wallet")),1),m(b,{ref:"walletDropdown",class:"dropdown wallet-dropdown",list:u.walletOptions,isMultiple:"",isMultipleCounter:!1,isMultipleShowButton:!1,handleUpdate:u.handleWalletUpdate},null,8,["list","handleUpdate"])]),y("div",nF,[y("span",rF,h(e.$t("accountStatement.estimatedValue")),1),m(b,{ref:"estimatedCurrencyDropdown",class:"dropdown",list:u.estimatedCurrencyOptions,defaultValue:u.defaultEstimatedCurrency,handleUpdate:u.handleEstimatedCurrencyUpdate,isUseDefaultValue:""},null,8,["list","defaultValue","handleUpdate"])]),y("div",{class:"reset-filters",onClick:t[5]||(t[5]=(...e)=>u.onReset&&u.onReset(...e))},h(e.$t("t.resetFilters")),1)]),o.enableAccountStatementDownloadReport?(n(),i(T,{key:0,class:"icon-download",fileDownloadDialogComponent:l.DownloadPdfDialog,fileDownloadDialogProps:{filters:o.filterForm,isMasterAccount:u.isMasterAccount}},null,8,["fileDownloadDialogComponent","fileDownloadDialogProps"])):d("",!0)]))])}],["__scopeId","data-v-576bf7f0"]]),uF={name:"Overview",components:{FormField:zi},props:{accountStatementData:{type:Object,default:()=>({})},isWalletVisibleMap:{type:Object,required:!0},filters:{type:Object,required:!0}},data:()=>({ACCOUNT_STATEMENT_WALLET_INFO_MAP:Bn}),computed:{...l(["currencyMap"]),...l("subAccount",["subAccountAliasList"]),...t(["isSubAccount"]),refreshedDate(){const{refreshedTime:e}=this.accountStatementData;return e?`${this.formatDate(e,"yyyy-MM-dd HH:mm:ss")}${fo()}`:"--"},date(){const{time:e}=this.accountStatementData;return e?Vn(this.accountStatementData.time,"yyyy-MM-dd HH:mm:ss"):"--"},uid(){return this.accountStatementData.uid||"--"}
1,isNoSubAccount(){return 1===this.subAccountAliasList.length},accountType(){var e;return{[Mn.NORMAL_ACCOUNT]:this.$t("accountStatement.overview.accountType.normal"),[Mn.MASTER_ACCOUNT]:this.$t("accountStatement.overview.accountType.master"),[Mn.SUB_ACCOUNT]:this.$t("accountStatement.overview.accountType.sub")}[null==(e=this.accountStatementData)?void 0:e.accountType]||"--"},walletTypes(){var e,t,a;if(!(null==(t=null==(e=this.filters)?void 0:e.walletTypes)?void 0:t.length))return"--";return(null==(a=this.filters.walletTypes)?void 0:a.includes("ALL"))||!1?this.$t("t.all"):this.filters.walletTypes.map((e=>this.$t(Bn[e].labelKey))).join(", ")},totalValue(){var e,t,a,l,s;return(null==(t=null==(e=this.filters)?void 0:e.walletTypes)?void 0:t.length)?this.displayWalletAmount(null==(s=this.accountStatementData)?void 0:s.totalAmount):`-- ${(null==(l=null==(a=this.accountStatementData)?void 0:a.totalAmount)?void 0:l.currency)||""}`},visibleWallets(){var e,t;const a=[];for(const l of Fn)this.isWalletVisibleMap[l]&&a.push({type:l,amount:this.displayWalletAmount(null==(t=null==(e=this.accountStatementData)?void 0:e[Bn[l].dataKey])?void 0:t.totalAmount)});return a}},methods:{formatDate(e,t){return this.$filters.formatDate(e,t)},displayWalletAmount(e={}){var t;const{amount:a=0,currency:l=""}=e;if(!Number(a))return`-- ${l}`;const s=(null==(t=this.currencyMap[l])?void 0:t.isFiat)?"fiat":"icon";return`${Un(a,s)} ${l}`}}},cF={class:"overview"},dF={class:"title-wrap"},pF={class:"title"},yF={class:"refreshed-date"},hF={class:"user-info-wrap"},vF={class:"field-content"},mF={class:"field-content"},gF={class:"field-content"},fF={class:"field-content"},TF={class:"total-value-field-content"},wF={class:"wallet-info-wrap"},DF={class:"field-content"};const AF=vr(uF,[["render",function(e,t,a,l,o,u){const c=s("FormField");return n(),r("div",cF,[y("div",dF,[y("div",pF,h(e.$t("t.overview")),1),y("div",yF,h(e.$t("accountStatement.overview.subText",{date:u.refreshedDate})),1)]),y("div",hF,[m(c,{class:"field",title:e.$t("t.date")},{default:g((()=>[y("span",vF,h(e.$t("t.dateUtc",{date:u.date})),1)])),_:1},8,["title"]),m(c,{class:"field",title:e.$t("t.userId")},{default:g((()=>[y("span",mF,h(u.uid),1)])),_:1},8,["title"]),m(c,{class:"field",title:e.$t("accountStatement.accountType")},{default:g((()=>[y("span",gF,h(u.accountType),1)])),_:1},8,["title"]),m(c,{class:"field",title:e.$t("t.wallet")},{default:g((()=>[y("span",fF,h(u.walletTypes),1)])),_:1},8,["title"])]),m(c,{class:"total-value-field",title:e.$t("t.totalValue")},{default:g((()=>[y("span",TF,h(u.totalValue),1)])),_:1},8,["title"]),y("div",wF,[(n(!0),r(p,null,x(u.visibleWallets,(t=>(n(),i(c,{key:t.type,class:"field",title:e.$t(o.ACCOUNT_STATEMENT_WALLET_INFO_MAP[t.type].labelKey)},{default:g((()=>[y("span",DF,h(t.amount),1)])),_:2},1032,["title"])))),128))])])}],["__scopeId","data-v-eb16cc1f"]]),bF={class:"wallet-block"},_F={class:"title"},SF={class:"total-wrap"},CF={class:"total-title-wrap"},LF={class:"total-title"},EF={class:"total-value"},IF=vr({__name:"WalletBlock",props:{title:{type:String,default:""},totalTitle:{type:String,default:""},totalAmount:{type:Number,default:0},baseCurrency:{type:String,default:""}},setup(e){const t=e,a=Ut(),l=R((()=>{const e=a.getCurrencyScaledAmount({currency:t.baseCurrency,amount:t.totalAmount||0,isFormat:!0});return t.totalAmount?`${e} ${t.baseCurrency}`:`-- ${t.baseCurrency}`}));return(t,a)=>{const u=s("Cell"),c=s("Row"),d=s("DataTable");return n(),r("div",bF,[y("div",_F,h(e.title),1),y("div",SF,[y("div",CF,[y("div",LF,h(e.totalTitle),1),o(t.$slots,"totalTitleTail",{},void 0,!0)]),y("div",EF,h(l.value),1)]),m(d,{class:"currency-list"},{header:g((()=>[o(t.$slots,"tableHeader",{},void 0,!0)])),body:g((()=>[t.$slots.tableBody?o(t.$slots,"tableBody",{key:1},void 0,!0):(n(),i(c,{key:0,class:"no-records-row",index:0,disableBackground:"",disableCssHoverEffect:""},{default:g((()=>[m(u,{colspan:"99"},{default:g((()=>[m(Zt,{class:"no-records-wrap",emptyText:t.$t("t.noRecordsFound")},null,8,["emptyText"])])),_:1})])),_:1}))])),_:3})])}}},[["__scopeId","data-v-e6ceb50e"]]),kF={name:"AssetTableRow",components:{CurrencyIcon:Pa},props:{baseCurrency:{type:String,required:!0},currencyInfo:{type:Object,required:!0},index:{type:Number,default:0}},computed:{...l(["currencyMap"]),currency(){return this.currencyInfo.currency},currencyData(){return this.currencyMap[this.currency]||{}},currencyType(){return this.getCurrencyType(this.currency)},currencyFullName(){return"fiat"===this.currencyType?this.$filters.fiatCurrency(this.currency):this.$filters.digitalCurrency(this.currency)},totalBalance(){return`${Un(this.currencyInfo.amount||0,Hn(this.currencyData))} ${this.currencyData.displayName||this.currency}`},approximatelyEqualByBaseCurrency(){const{estimatedAmount:e,estimatedCurrency:t}=this.currencyInfo;return` â ${Un(e,this.getCurrencyType(t))} ${t}`}},methods:{getCurrencyType(e){return Hn(this.currencyMap[e])}}},RF={class:"currency-icon-wrap"},NF={class:"label-wrap"},xF={class:"currency-short-name"},PF={class:"currency-full-name"},OF={class:"total-balance"},$F={class:"approximately-equal"};const WF=vr(kF,[["render",function(e,t,a,l,r,o){const u=s("CurrencyIcon"),c=s("Cell"),d=s("Row");return n(),i(d,{class:"asset-table-row",index:a.index,disableBackgroun
1d:"",disableCssHoverEffect:""},{default:g((()=>[m(c,{textAlign:"left"},{default:g((()=>[y("div",RF,[m(u,{class:"currency-icon",type:o.currencyType,name:o.currencyData.shortName,size:"16",showName:!1},null,8,["type","name"]),y("div",NF,[y("div",xF,h(o.currencyData.displayName),1),y("div",PF,h(o.currencyFullName),1)])])])),_:1}),m(c,{textAlign:"right"},{default:g((()=>[y("div",null,[y("div",OF,h(o.totalBalance),1),y("div",$F,h(o.approximatelyEqualByBaseCurrency),1)])])),_:1})])),_:1},8,["index"])}],["__scopeId","data-v-fdcb25e8"]]),FF=vr({__name:"CommonWalletBlock",props:{title:{type:String,default:""},data:{type:Object,default:()=>({})}},setup(e){const{t:t}=I(),a=e,l=R((()=>{var e,t;return(null==(t=null==(e=a.data)?void 0:e.totalAmount)?void 0:t.currency)||""})),o=R((()=>{var e,t;return Number((null==(t=null==(e=a.data)?void 0:e.totalAmount)?void 0:t.amount)||0)})),u=R((()=>a.data.details||[])),c=R((()=>[{key:"asset",text:t("t.asset"),align:"left"},{key:"total_balance",text:t("wallets.totalBalance"),align:"right"}]));return(t,a)=>{const d=s("Cell"),y=s("HeaderRow");return n(),i(IF,{class:"common-wallet-block",title:e.title,totalTitle:t.$t("wallets.totalBalance"),totalAmount:o.value,baseCurrency:l.value},D({tableHeader:g((()=>[m(y,null,{default:g((()=>[(n(!0),r(p,null,x(c.value,(e=>(n(),i(d,{key:e.key,textAlign:e.align},{default:g((()=>[v(h(e.text),1)])),_:2},1032,["textAlign"])))),128))])),_:1})])),_:2},[u.value.length>0?{name:"tableBody",fn:g((()=>[(n(!0),r(p,null,x(u.value,((e,t)=>(n(),i(WF,{key:e.currency,class:"table-row",index:t,baseCurrency:l.value,currencyInfo:e},null,8,["index","baseCurrency","currencyInfo"])))),128))])),key:"0"}:void 0]),1032,["title","totalTitle","totalAmount","baseCurrency"])}}},[["__scopeId","data-v-cb6b9766"]]),BF=vr({__name:"SpotBlock",props:{data:{type:Object,default:()=>({})}},setup(e){const t=e,{t:a}=I(),l=R((()=>{var e,a;return(null==(a=null==(e=t.data)?void 0:e.totalAmount)?void 0:a.currency)||""})),o=R((()=>{var e,a;return Number((null==(a=null==(e=t.data)?void 0:e.totalAmount)?void 0:a.amount)||0)})),u=R((()=>[{key:"asset",text:a("t.asset"),align:"left"},{key:"total_balance",text:a("wallets.totalBalance"),align:"right"}])),c=R((()=>t.data.details||[]));return(e,t)=>{const d=s("Tooltip"),f=s("Cell"),T=s("HeaderRow");return n(),i(IF,{class:"spot-block",title:P(a)("t.spot"),totalTitle:P(a)("wallets.totalBalance"),totalAmount:o.value,baseCurrency:l.value},D({totalTitleTail:g((()=>[m(d,{placement:"top"},{content:g((()=>[m(P(Fa),{class:"info-icon"})])),tooltip:g((()=>[y("span",null,h(P(a)("accountStatement.spot.totalBalance.tooltip")),1)])),_:1})])),tableHeader:g((()=>[m(T,null,{default:g((()=>[(n(!0),r(p,null,x(u.value,(e=>(n(),i(f,{key:e.key,textAlign:e.align},{default:g((()=>[v(h(e.text),1)])),_:2},1032,["textAlign"])))),128))])),_:1})])),_:2},[c.value.length>0?{name:"tableBody",fn:g((()=>[(n(!0),r(p,null,x(c.value,((e,t)=>(n(),i(WF,{key:e.currency,class:"table-row",index:t,baseCurrency:l.value,currencyInfo:e},null,8,["index","baseCurrency","currencyInfo"])))),128))])),key:"0"}:void 0]),1032,["title","totalTitle","totalAmount","baseCurrency"])}}},[["__scopeId","data-v-b70e4ef0"]]),UF={name:"EarnTableRow",components:{CurrencyIcon:Pa},props:{baseCurrency:{type:String,required:!0},currencyInfo:{type:Object,required:!0},index:{type:Number,default:0},isOnlyTotalInterest:{type:Boolean,default:!1}},computed:{...l(["currencyMap"]),currency(){return this.currencyInfo.product},currencyData(){return this.currencyMap[this.currency]||{}},currencyType(){return this.getCurrencyType(this.currency)},currencyFullName(){return"fiat"===this.currencyType?this.$filters.fiatCurrency(this.currency):this.$filters.digitalCurrency(this.currency)},principal(){var e;const{amount:t=0,currency:a}=(null==(e=this.currencyInfo)?void 0:e.principal)||{};return`${Un(t,this.getCurrencyType(a))} ${a}`},principalApproximatelyEqualByBaseCurrency(){var e;const{estimatedAmount:t,estimatedCurrency:a}=(null==(e=this.currencyInfo)?void 0:e.principal)||{};return` â ${Un(t,this.getCurrencyType(a))} ${a}`},totalInterestEarned(){var e;const{amount:t=0,currency:a}=(null==(e=this.currencyInfo)?void 0:e.earned)||{};return`${Un(t,this.getCurrencyType(a))} ${a}`},totalInterestApproximatelyEqualByBaseCurrency(){var e;const{estimatedAmount:t,estimatedCurrency:a}=(null==(e=this.currencyInfo)?void 0:e.earned)||{};return` â ${Un(t,this.getCurrencyType(a))} ${a}`}},methods:{getCurrencyType(e){return Hn(this.currencyMap[e])}}},MF={class:"total-interest-earned"}
1,VF={class:"approximately-equal"},HF={class:"currency-short-name"},GF={class:"currency-full-name"},YF={class:"principal"},qF={class:"approximately-equal"},zF={class:"total-interest-earned"},KF={class:"approximately-equal"};const jF=vr({name:"EarnBlock",components:{WalletBlock:IF,EarnTableRow:vr(UF,[["render",function(e,t,a,l,r,o){const u=s("Cell"),c=s("Row"),p=s("CurrencyIcon");return a.isOnlyTotalInterest?(n(),i(c,{key:0,class:"earn-table-row",index:a.index,disableBackground:"",disableCssHoverEffect:""},{default:g((()=>[m(u,{textAlign:"left",class:"total-interest-title"},{default:g((()=>[v(h(e.$t("wallets.earn.totalInterestEarned")),1)])),_:1}),m(u,{textAlign:"right"},{default:g((()=>[y("div",null,[y("div",MF,h(o.totalInterestEarned),1),y("div",VF,h(o.totalInterestApproximatelyEqualByBaseCurrency),1)])])),_:1})])),_:1},8,["index"])):(n(),i(c,{key:1,class:"earn-table-row",index:a.index,disableBackground:"",disableCssHoverEffect:""},{default:g((()=>[m(u,{textAlign:"left"},{default:g((()=>[m(p,{class:"currency-icon-wrap",type:o.currencyType,name:o.currencyData.shortName,size:"16"},{default:g((()=>[y("span",HF,h(o.currencyData.shortName),1),y("span",GF,h(o.currencyFullName),1)])),_:1},8,["type","name"])])),_:1}),m(u,{textAlign:"right"},{default:g((()=>[y("div",null,[y("div",YF,h(o.principal),1),y("div",qF,h(o.principalApproximatelyEqualByBaseCurrency),1)])])),_:1}),e.isMobile?d("",!0):(n(),i(u,{key:0,textAlign:"right"},{default:g((()=>[y("div",null,[y("div",zF,h(o.totalInterestEarned),1),y("div",KF,h(o.totalInterestApproximatelyEqualByBaseCurrency),1)])])),_:1}))])),_:1},8,["index"]))}],["__scopeId","data-v-7f47d592"]])},props:{data:{type:Object,default:()=>({})}},computed:{...l(["currencyMap"]),baseCurrency(){var e,t;return(null==(t=null==(e=this.data)?void 0:e.totalAmount)?void 0:t.currency)||""},totalAmountValue(){var e,t;return Number((null==(t=null==(e=this.data)?void 0:e.totalAmount)?void 0:t.amount)||0)},headerList(){const e=[{key:"product",text:this.$t("earn.product"),align:"left"},{key:"principal",text:this.$t("earn.principal"),align:"right"}];return this.isMobile||e.push({key:"total_Interest_earned",text:this.$t("wallets.earn.totalInterestEarned"),align:"right"}),e},currencyList(){return this.data.details||[]}}},[["render",function(e,t,a,l,o,u){const c=s("Cell"),y=s("HeaderRow"),f=s("EarnTableRow"),T=s("WalletBlock");return n(),i(T,{class:"earn-block",title:e.$t("wallets.earn"),totalTitle:e.$t("wallets.earn.totalSubscribed"),totalAmount:u.totalAmountValue,baseCurrency:u.baseCurrency},D({tableHeader:g((()=>[m(y,null,{default:g((()=>[(n(!0),r(p,null,x(u.headerList,(e=>(n(),i(c,{key:e.key,textAlign:e.align},{default:g((()=>[v(h(e.text),1)])),_:2},1032,["textAlign"])))),128))])),_:1})])),_:2},[u.currencyList.length>0?{name:"tableBody",fn:g((()=>[(n(!0),r(p,null,x(u.currencyList,((t,a)=>(n(),r(p,{key:t.currency},[m(f,{class:"table-row",index:a,baseCurrency:u.baseCurrency,currencyInfo:t},null,8,["index","baseCurrency","currencyInfo"]),e.isMobile?(n(),i(f,{key:t.currency,index:a,baseCurrency:u.baseCurrency,currencyInfo:t,isOnlyTotalInterest:""},null,8,["index","baseCurrency","currencyInfo"])):d("",!0)],64)))),128))])),key:"0"}:void 0]),1032,["title","totalTitle","totalAmount","baseCurrency"])}],["__scopeId","data-v-0ed3129d"]]),XF={name:"LedgerReportDialog",components:{BrandDialog:wt,DateRangePicker:ya,DateRangeTextBlock:jr,DateRangePickerDialog:pa,WalletDropdown:rn,CurrencyDropDown:Mt},emits:["update:isShow","handleSuccessfully","handleFail"],setup(){const{accountStatementWalletEnabledMap:e}=VW();return{accountStatementWalletEnabledMap:e}},data(){const[e,t]=this.getDefaultDateRange();return{rangeLimitDuration:{years:6},isShowDatePickerDialog:!1,isSelectAllCurrencies:!1,subAccountList:[],BarTextSize:Gn,filterForm:{dateRange:{start:e,end:t},account:"",walletTypes:[],currencyList:[]}}},computed:{...l(["accountInfo"]),...t(["isSubAccount"]),isMasterAccount(){const e=this.subAccountList.find((({isSub:e})=>!e));return this.isSubAccount||this.filterForm.account===e.username},isSendDisabled(){return 0===this.filterForm.currencyList.length&&!this.isSelectAllCurrencies},accountList(){return 0===this.subAccountList.length?[]:this.isSubAccount?[{value:this.accountInfo.subAccountAlias,name:this.accountInfo.subAccountAlias,subText:`(UID: ${this.accountInfo.uid})`}]:this.subAccountList.map((({alias:e,username:t,isSub:a})=>({value:e||t,name:e||t,subText:a?"":`(UID: ${this.accountInfo.uid})`})))},walletOptions(){const e={...this.accountStatementWalletEnabledMap,[kn.SPOT]:!0,[kn.FUTURES]:!0,[kn.EARN]:!0},t=[{value:kn.ALL,name:this.$t("t.all")}];
1for(const a of Fn)e[a]&&t.push({value:a,name:this.$t(Bn[a].labelKey)});return t}},created(){this.init()},methods:{async init(){try{this.subAccountList=await Wn.getAccountAlias({reqType:Wn.accountAliasReqType.walletTransferList}),this.filterForm.account=this.accountList[0].name}catch{}},getDefaultDateRange(){const e=Date.now(),t=Ms(Ln.days(e,365),"yyyy-MM-dd 00:00:00"),a=Ms(e,"yyyy-MM-dd 23:59:59");return[Ys(t),Ys(a)]},handleAccountUpdate(e){this.filterForm.account=e},handleWalletUpdate(e){this.filterForm.walletTypes=e},handleSelectAllCurrenciesInput(e){this.isSelectAllCurrencies=e},async onSendRequest(){try{const e={fromDate:Ms(this.filterForm.dateRange.start,"yyyy-MM-dd"),toDate:Ms(this.filterForm.dateRange.end,"yyyy-MM-dd"),alias:this.isMasterAccount?"":this.filterForm.account,wallets:this.filterForm.walletTypes.filter((e=>e!==kn.ALL)),currencies:this.isSelectAllCurrencies?["ALL"]:this.filterForm.currencyList};await Oa.sendLedgerReport(e),this.$emit("handleSuccessfully")}catch{this.$emit("handleFail")}},onClosed(){this.$emit("update:isShow",!1)}}},QF={class:"content"},ZF={class:"description"},JF={class:"item"},eB={class:"item-title"},tB={class:"item"},aB={class:"item-title"},lB={class:"item"},sB={class:"item-title"},iB={class:"item"},nB={class:"currency-title-wrap"},rB={class:"item-title"};const oB=vr(XF,[["render",function(e,t,a,l,r,o){const u=s("DateRangeTextBlock"),c=s("DateRangePicker"),p=s("WalletDropdown"),f=s("CheckBox"),T=s("CurrencyDropDown"),w=s("BaseButton"),D=s("DateRangePickerDialog"),A=s("BrandDialog");return n(),i(A,{class:"ledger-Report-dialog",isBrandNewStyle:"",width:"560px",fullStyle:e.isMobile,onClosed:o.onClosed},{header:g((()=>[v(h(e.$t("accountStatement.ledgerReportDialog.title")),1)])),body:g((()=>[y("div",QF,[y("div",ZF,h(e.$t("accountStatement.ledgerReportDialog.description")),1),y("div",JF,[y("span",eB,h(e.$t("t.timePeriod")),1),e.isMobile?(n(),i(u,{key:0,class:"date-picker-mobile",dateRangeData:r.filterForm.dateRange,onToggle:t[0]||(t[0]=e=>r.isShowDatePickerDialog=!0)},null,8,["dateRangeData"])):(n(),i(c,{key:1,dateRange:r.filterForm.dateRange,"onUpdate:dateRange":t[1]||(t[1]=e=>r.filterForm.dateRange=e),class:"date-picker",rangeLimitDuration:r.rangeLimitDuration,daysPanelOptions:[30,60,180,365,730]},null,8,["dateRange","rangeLimitDuration"]))]),y("div",tB,[y("span",aB,h(e.$t("t.account")),1),m(p,{class:"dropdown",list:o.accountList,isDisabled:e.isSubAccount,handleUpdate:o.handleAccountUpdate},null,8,["list","isDisabled","handleUpdate"])]),y("div",lB,[y("span",sB,h(e.$t("t.wallet")),1),m(p,{class:"dropdown",list:o.walletOptions,defaultValue:[o.walletOptions[1].value],isMultiple:"",isMultipleCounter:!1,isMultipleShowButton:!1,isMultipleShowMobileDialog:!1,handleUpdate:o.handleWalletUpdate},null,8,["list","defaultValue","handleUpdate"])]),y("div",iB,[y("div",nB,[y("span",rB,h(e.$t("t.currency")),1),m(f,{value:r.isSelectAllCurrencies,class:"check-box",isBrandNewStyle:"",onInput:o.handleSelectAllCurrenciesInput},{default:g((()=>[v(h(e.$t("accountStatement.ledgerReportDialog.allCurrenciesSelected")),1)])),_:1},8,["value","onInput"])]),m(T,{selectedCurrency:r.filterForm.currencyList,"onUpdate:selectedCurrency":t[2]||(t[2]=e=>r.filterForm.currencyList=e),class:"dropdown",disabled:r.isSelectAllCurrencies,isMultiple:"",barTextSize:r.BarTextSize.BIG},null,8,["selectedCurrency","disabled","barTextSize"])]),m(w,{size:"large",class:"primary",disabled:o.isSendDisabled,onClick:o.onSendRequest},{default:g((()=>[v(h(e.$t("t.sendRequest")),1)])),_:1},8,["disabled","onClick"])]),r.isShowDatePickerDialog?(n(),i(D,{key:0,showDatePickerDialog:r.isShowDatePickerDialog,"onUpdate:showDatePickerDialog":t[3]||(t[3]=e=>r.isShowDatePickerDialog=e),dateRange:r.filterForm.dateRange,"onUpdate:dateRange":t[4]||(t[4]=e=>r.filterForm.dateRange=e),rangeLimitDuration:r.rangeLimitDuration,daysPanelOptions:[30,60,180,365,730]},null,8,["showDatePickerDialog","dateRange","rangeLimitDuration"])):d("",!0)])),_:1},8,["fullStyle","onClosed"])}],["__scopeId","data-v-a4312ef5"]]),uB={name:"SendSuccessfullyDialog",components:{BrandDialog:wt,IconProcessing2:es},emits:["update:isShow"],computed:{...l(["lang"]),contactUrl(){return gt(this.lang,"NEW_TICKET")}},methods:{onOk(){this.onClosed()},onClosed(){this.$emit("update:isShow",!1)}}},cB={class:"content"},dB={class:"title"},pB=["href"];const yB={class:"content"},hB={class:"title"},vB={class:"description"};const mB=vr({name:"LedgerReport",components:{LedgerReportDialog:oB,SendSuccessfullyDialog:vr(uB,[["render",function(e,t,a,l,r,o){const u=s("IconProcessing2"),c=s("i18n-t"),d=s("BaseButton"),p=s("BrandDialog");return n(),i(p,{class:"send-successfully-dialog",width:e.isMobile?"90%":"560px",isBrandNewStyle:"",onClosed:o.onClosed},{header:g((()=>[v(h(e.$t("accountStatement.ledgerReportDialog.title")),1)])),body:g((()=>[y("div",cB,[m(u),y("div",dB,h(e.$t("t.requestSent")),1),m(c,{class:"description",tag:"p",keypath:"accountStatement.ledgerReportDialog.successfully.description"},{contactSupport:g((()=>[y("a",{class:"contact-support",href:o.contactUrl,rel:"noopener nofollow",target:"_blank"},h(e.$t("t.contactSupport")),9,pB)])),_:1}),m(d,{size:"large",class:"primary ok-button",onClick:o.onOk},{default:g((()=>[v(h(e.$t("t.ok")),1)])),_:1},8,["onClick"])])])),_:1},8,["width","onClosed"])}],["__scopeId","data-v-6775ab8e"]]),SendFailDialog:vr({name:"SendFailDialog",components:{BrandDialog:wt,IconFlashFail:Mi}
1,emits:["update:isShow"],methods:{onOk(){this.onClosed()},onClosed(){this.$emit("update:isShow",!1)}}},[["render",function(e,t,a,l,r,o){const u=s("IconFlashFail"),c=s("BaseButton"),d=s("BrandDialog");return n(),i(d,{class:"send-fail-dialog",width:e.isMobile?"90%":"560px",isBrandNewStyle:"",onClosed:o.onClosed},{header:g((()=>[v(h(e.$t("accountStatement.ledgerReportDialog.title")),1)])),body:g((()=>[y("div",yB,[m(u),y("div",hB,h(e.$t("t.unsuccessful")),1),y("div",vB,h(e.$t("accountStatement.ledgerReportDialog.fail.description")),1),m(c,{size:"large",class:"primary ok-button",onClick:o.onOk},{default:g((()=>[v(h(e.$t("t.ok")),1)])),_:1},8,["onClick"])])])),_:1},8,["width","onClosed"])}],["__scopeId","data-v-d888de19"]])},data:()=>({isShowLedgerReportDialog:!1,isShowSuccessfullyDialog:!1,isShowFailDialog:!1}),methods:{handleSendSuccessfully(){this.isShowSuccessfullyDialog=!0,this.$nextTick((()=>{this.isShowLedgerReportDialog=!1}))},handleSendFail(){this.isShowFailDialog=!0,this.$nextTick((()=>{this.isShowLedgerReportDialog=!1}))},onLedgerReport(){this.isShowLedgerReportDialog=!0}}},[["render",function(e,t,a,l,o,u){const c=s("LedgerReportDialog"),p=s("SendSuccessfullyDialog"),v=s("SendFailDialog");return n(),r("div",null,[y("a",{class:"ledger-report",onClick:t[0]||(t[0]=(...e)=>u.onLedgerReport&&u.onLedgerReport(...e))},h(e.$t("accountStatement.needLedgerReports")),1),o.isShowLedgerReportDialog?(n(),i(c,{key:0,isShow:o.isShowLedgerReportDialog,"onUpdate:isShow":t[1]||(t[1]=e=>o.isShowLedgerReportDialog=e),onHandleSuccessfully:u.handleSendSuccessfully,onHandleFail:u.handleSendFail},null,8,["isShow","onHandleSuccessfully","onHandleFail"])):d("",!0),o.isShowSuccessfullyDialog?(n(),i(p,{key:1,isShow:o.isShowSuccessfullyDialog,"onUpdate:isShow":t[2]||(t[2]=e=>o.isShowSuccessfullyDialog=e)},null,8,["isShow"])):d("",!0),o.isShowFailDialog?(n(),i(v,{key:2,isShow:o.isShowFailDialog,"onUpdate:isShow":t[3]||(t[3]=e=>o.isShowFailDialog=e)},null,8,["isShow"])):d("",!0)])}],["__scopeId","data-v-c3464d65"]]),{enableAccountStatementLedgerReport:gB}=Ge,fB=Fn.filter((e=>e!==kn.SPOT&&e!==kn.EARN)),TB={name:"AccountStatement",components:{Filters:oF,Overview:AF,CommonWalletBlock:FF,SpotBlock:BF,EarnBlock:jF,LedgerReport:mB},setup(){const{accountStatementWalletEnabledMap:e}=VW();return{accountStatementWalletEnabledMap:e}},data:()=>({API_ACCOUNT_STATEMENT_WALLET_TYPE:kn,enableAccountStatementLedgerReport:gB,isLoading:!1,filters:{},accountStatementData:{}}),computed:{spotData(){var e;return(null==(e=this.accountStatementData)?void 0:e.spot)||{}},earnData(){var e;return(null==(e=this.accountStatementData)?void 0:e.earn)||{}},isWalletVisibleMap(){const e={};for(const t of Fn)e[t]=Boolean(this.accountStatementWalletEnabledMap[t]&&this.isWalletTypeMatch([kn.ALL,t]));return e},commonWalletBlocks(){var e;const t=[];for(const a of fB)this.isWalletVisibleMap[a]&&t.push({type:a,title:this.$t(Bn[a].labelKey),data:(null==(e=this.accountStatementData)?void 0:e[Bn[a].dataKey])||{}});return t}},methods:{isWalletTypeMatch(e){var t;return null==(t=this.filters.walletTypes)?void 0:t.some((t=>e.includes(t)))},async getAccountStatement(e){var t;const a={time:e.date.getTime(),zoneOffset:gs(),estimatedCurrency:e.estimatedCurrency,walletTypes:null==(t=e.walletTypes)?void 0:t.filter((e=>e!==kn.ALL)).join(",")};a.walletTypes||delete a.walletTypes,e.isSelectMasterAccount||(a.alias=e.account),this.isLoading=!0;try{const e=await Oa.getAccountStatementsData(a);this.accountStatementData=e}catch{this.accountStatementData={}}finally{this.isLoading=!1}},debounceGetAccountStatement:kl((function(e){this.getAccountStatement(e)}),300),handleUpdateFilter(e){this.filters=e,this.debounceGetAccountStatement(e)}}},wB={class:"account-statement"},DB={class:"header"},AB={key:0,class:"title"},bB={class:"content"};const _B=vr(TB,[["render",function(e,t,a,l,o,u){const c=s("LedgerReport"),v=s("Filters"),g=s("Overview"),T=s("SpotBlock"),w=s("CommonWalletBlock"),D=s("EarnBlock"),A=C("loading");return n(),r("div",wB,[y("div",DB,[e.isMobile?d("",!0):(n(),r("h2",AB,h(e.$t("nav.accountStatement")),1)),o.enableAccountStatementLedgerReport?(n(),i(c,{key:1,class:"ledger-report"})):d("",!0)]),f((n(),r("div",bB,[m(v,{onHandleUpdateFilter:u.handleUpdateFilter},null,8,["onHandleUpdateFilter"]),m(g,{accountStatementData:o.accountStatementData,isWalletVisibleMap:u.isWalletVisibleMap,filters:o.filters},null,8,["accountStatementData","isWalletVisibleMap","filters"]),u.isWalletVisibleMap[o.API_ACCOUNT_STATEMENT_WALLET_TYPE.SPOT]?(n(),i(T,{key:0,data:u.spotData},null,8,["data"])):d("",!0),(n(!0),r(p,null,x(u.commonWalletBlocks,(e=>(n(),i(w,{key:e.type,title:e.title,data:e.data},null,8,["title","data"])))),128)),u.isWalletVisibleMap[o.API_ACCOUNT_STATEMENT_WALLET_TYPE.EARN]?(n(),i(D,{key:1,data:u.earnData},null,8,["data"])):d("",!0)])),[[A,o.isLoading]])])}],["__scopeId","data-v-436901a0"]]),SB={VESTING:"VESTING",DISTRIBUTION:"DISTRIBUTION"},CB={ALL:"ALL",ONGOING:"ONGOING",COMPLETED:"COMPLETED",EARLY_COMPLETED:"EARLY_COMPLETED",CANCELED:"CANCELED",INSUFFICIENT_VESTING:"INSUFFICIENT_VESTING"},LB={ALL:"ALL",PENDING:"PENDING",UNLOCKED:"UNLOCKED",CANCELED:"CANCELED"},EB={__name:"VestingStatusIcon",props:{status:{type:String,required:!0}},setup(e){const{t:t}=I(),a=e,l=R((()=>{switch(a.status){case CB.ONGOING:case CB.INSUFFICIENT_VESTING:return"ongoing";case CB.COMPLETED:case CB.EARLY_COMPLETED:return"completed";case CB.CANCELED:return"canceled"}return""})),s=R((()=>{switch(a.status){case CB.ONGOING:case CB.INSUFFICIENT_VESTING:return t("t.ongoing");case CB.COMPLETED:case CB.EARLY_COMPLETED:return t("t.completed");case CB.CANCELED:return t("t.canceled")}return""}));return(e,t)=>(n(),r("div",{class:L(["vesting-status-icon",[l.value]])},h(s.value),3))}},IB={class:"vesting-progress"},kB={class:"info-wrapper"},RB={class:"amount-wrapper"}
1,NB={class:"unlock-amount"},xB={class:"currency"},PB={__name:"VestingProgress",props:{type:{type:String,required:!0},status:{type:String,required:!0},currency:{type:String,required:!0},unlockAmount:{type:String,required:!0},totalAmount:{type:String,required:!0}},setup(e){const t=U(),a=e,l=R((()=>N(a.unlockAmount).div(a.totalAmount).times(100).toNumber())),s=R((()=>Hn(t.state.currencyMap[a.currency]))),o=R((()=>Xt(a.unlockAmount,{formatKey:"28",default:"-"}))),u=R((()=>Xt(a.totalAmount,{formatKey:"28",default:"-"})));return(e,t)=>(n(),r("div",IB,[y("div",kB,[m(P(Pa),{class:"currency-icon",type:s.value,name:a.currency,size:"16",showName:!1},null,8,["type","name"]),y("p",RB,[y("span",NB,h(o.value),1),a.type!==P(SB).DISTRIBUTION?(n(),r(p,{key:0},[t[0]||(t[0]=v(" / ")),y("span",null,h(u.value),1)],64)):d("",!0),y("span",xB,h(a.currency),1)])]),a.type!==P(SB).DISTRIBUTION?(n(),i(Yn,{key:0,class:"progress-bar",percent:l.value},null,8,["percent"])):d("",!0)]))}},OB={class:"vesting-info"},$B={class:"info-item-content"},WB={key:0,class:"info-item-currency"},FB={__name:"VestingInfo",props:{isDetail:{type:Boolean,default:!1},cardInfo:{type:Object,default:()=>({})}},setup(e){const{t:t}=I(),a=e,l=R((()=>{switch(a.cardInfo.status){case CB.ONGOING:case CB.INSUFFICIENT_VESTING:return s.value;case CB.COMPLETED:case CB.EARLY_COMPLETED:return i.value;case CB.CANCELED:return o.value;default:return[]}})),s=R((()=>a.isDetail?a.cardInfo.type===SB.DISTRIBUTION?[{id:"expectedUnlockDate",title:t("t.expectedUnlockDate"),content:Ra(a.cardInfo.unlockFinalDate,"yyyy-MM-dd")}]:[{id:"unlockStartDate",title:t("t.startDate"),content:Ra(a.cardInfo.unlockStartDate,"yyyy-MM-dd")},{id:"finalDate",title:t("t.finalDate"),content:Ra(a.cardInfo.unlockFinalDate,"yyyy-MM-dd")},{id:"poundOfVestingsUnlocked",title:t("vesting.poundOfVestingsUnlocked"),content:a.cardInfo.unlockedCount},{id:"poundOfVestingsPending",title:t("vesting.poundOfVestingsPending"),content:a.cardInfo.pendingCount},{id:"poundOfVestingsCanceled",title:t("vesting.poundOfVestingsCanceled"),content:a.cardInfo.canceledCount}]:[{id:"nextUnlockDate",title:t("t.nextUnlockDate"),content:Ra(a.cardInfo.nextUnlockDate,"yyyy-MM-dd")},{id:"nextUnlockAmount",title:t("t.nextUnlockAmount"),content:u.value,asset:a.cardInfo.asset}])),i=R((()=>a.isDetail?a.cardInfo.type===SB.DISTRIBUTION?[{id:"completionDate",title:t("t.completionDate"),content:Ra(a.cardInfo.completionDate,"yyyy-MM-dd")}]:[{id:"unlockStartDate",title:t("t.startDate"),content:Ra(a.cardInfo.unlockStartDate,"yyyy-MM-dd")},{id:"completionDate",title:t("t.completionDate"),content:Ra(a.cardInfo.completionDate,"yyyy-MM-dd")},{id:"poundOfVestingsUnlocked",title:t("vesting.poundOfVestingsUnlocked"),content:a.cardInfo.unlockedCount},{id:"poundOfVestingsPending",title:t("vesting.poundOfVestingsPending"),content:a.cardInfo.pendingCount},{id:"poundOfVestingsCanceled",title:t("vesting.poundOfVestingsCanceled"),content:a.cardInfo.canceledCount}]:[{id:"completionDate",title:t("t.completionDate"),content:Ra(a.cardInfo.completionDate,"yyyy-MM-dd")}])),o=R((()=>a.isDetail?a.cardInfo.type===SB.DISTRIBUTION?[{id:"cancelDate",title:t("t.cancelDate"),content:Ra(a.cardInfo.cancelDate,"yyyy-MM-dd")}]:[{id:"unlockStartDate",title:t("t.startDate"),content:Ra(a.cardInfo.unlockStartDate,"yyyy-MM-dd")},{id:"cancelDate",title:t("t.cancelDate"),content:Ra(a.cardInfo.cancelDate,"yyyy-MM-dd")},{id:"poundOfVestingsUnlocked",title:t("vesting.poundOfVestingsUnlocked"),content:a.cardInfo.unlockedCount},{id:"poundOfVestingsPending",title:t("vesting.poundOfVestingsPending"),content:a.cardInfo.pendingCount},{id:"poundOfVestingsCanceled",title:t("vesting.poundOfVestingsCanceled"),content:a.cardInfo.canceledCount}]:[{id:"cancelDate",title:t("t.cancelDate"),content:Ra(a.cardInfo.cancelDate,"yyyy-MM-dd")}])),u=R((()=>Xt(a.cardInfo.nextUnlockAmount,{formatKey:"28",default:"-"})));return(e,t)=>(n(),r("div",OB,[(n(!0),r(p,null,x(l.value,(e=>(n(),r("div",{key:e.id,class:L(["info-item",{"is-detail":a.isDetail}])},[y("div",null,h(e.title),1),y("div",$B,[v(h(e.content)+" ",1),e.asset?(n(),r("span",WB,h(e.asset),1)):d("",!0)])],2)))
1),128))]))}},BB={class:"header-wrapper"},UB={class:"title"},MB={class:"date"},VB={key:0,class:"divider"},HB=vr({__name:"VestingCard",props:{cardInfo:{type:Object,required:!0}},emits:["onOpenDetail"],setup(e,{emit:t}){const a=e,l=t,s=R((()=>a.cardInfo.type===SB.DISTRIBUTION?Ra(a.cardInfo.unlockStartDate,"yyyy-MM-dd"):`${Ra(a.cardInfo.unlockStartDate,"yyyy-MM-dd")} ~ ${Ra(a.cardInfo.unlockFinalDate,"yyyy-MM-dd")}`)),o=()=>{l("onOpenDetail")};return(e,t)=>(n(),r("div",{class:"vesting-card",onClick:o},[y("div",BB,[y("div",null,[y("p",UB,h(a.cardInfo.projectName),1),y("p",MB,h(s.value),1)]),m(EB,{status:a.cardInfo.status},null,8,["status"])]),m(PB,{class:"progress-wrapper",type:a.cardInfo.type,status:a.cardInfo.status,currency:a.cardInfo.asset,unlockAmount:a.cardInfo.unlockedAmount,totalAmount:a.cardInfo.totalAmount},null,8,["type","status","currency","unlockAmount","totalAmount"]),a.cardInfo.type===P(SB).DISTRIBUTION&&a.cardInfo.status!==P(CB).ONGOING?(n(),r("div",VB)):d("",!0),a.cardInfo.type!==P(SB).DISTRIBUTION||a.cardInfo.status!==P(CB).ONGOING?(n(),i(FB,{key:1,class:"info-wrapper",cardInfo:a.cardInfo},null,8,["cardInfo"])):d("",!0)]))}},[["__scopeId","data-v-479aaa00"]]),GB={class:"vesting-detail-info"},YB={class:"header-wrap"},qB={class:"project-name"},zB={key:0,class:"divider"},KB=vr({__name:"VestingDetailInfo",props:{detailData:{type:Object,default:()=>({})}},setup(e){const t=e;return(e,a)=>(n(),r("div",GB,[y("div",YB,[y("span",qB,h(t.detailData.projectName),1),m(EB,{status:t.detailData.status},null,8,["status"])]),m(PB,{class:"vesting-progress",type:t.detailData.type,status:t.detailData.status,currency:t.detailData.asset,unlockAmount:t.detailData.unlockedAmount,totalAmount:t.detailData.totalAmount},null,8,["type","status","currency","unlockAmount","totalAmount"]),t.detailData.type===P(SB).DISTRIBUTION?(n(),r("div",zB)):d("",!0),m(FB,{class:"vesting-info",cardInfo:t.detailData,isDetail:""},null,8,["cardInfo"])]))}},[["__scopeId","data-v-3ba4085b"]]),jB={class:"vesting-timeline-item"},XB={class:"date"},QB={class:"amount"},ZB={class:"currency"},JB={class:"status-update-date"},eU={class:"status"},tU=vr({__name:"VestingTimelineItem",props:{data:{type:Object,required:!0},currencyType:{type:String,required:!0}},setup(e){const{t:t}=I(),a=e,l=R((()=>Ra(a.data.scheduledTime,"yyyy-MM-dd"))),s=R((()=>Xt(a.data.amount,{formatKey:"28",default:"-"}))),i=R((()=>{switch(a.data.status){case LB.UNLOCKED:return t("vesting.unlockedOn",{date:Ra(a.data.completedTime,"yyyy-MM-dd")});case LB.CANCELED:return t("vesting.canceledOn",{date:Ra(a.data.cancelTime,"yyyy-MM-dd")});default:return""}}));return(e,t)=>(n(),r("div",jB,[y("div",XB,h(l.value),1),y("div",QB,[v(h(s.value)+" ",1),y("span",ZB,h(a.data.asset),1)]),y("div",JB,h(i.value),1),y("div",eU,[a.data.status===P(LB).PENDING?(n(),r(p,{key:0},[m(xa,{class:"pending-icon"}),y("span",null,h(e.$t("t.pending")),1)],64)):a.data.status===P(LB).UNLOCKED?(n(),r(p,{key:1},[m(Za,{class:"unlocked-icon"}),y("span",null,h(e.$t("t.unlocked")),1)],64)):a.data.status===P(LB).CANCELED?(n(),r(p,{key:2},[m(qn,{class:"canceled-icon"}),y("span",null,h(e.$t("t.canceled")),1)],64)):d("",!0)])]))}}
1,[["__scopeId","data-v-62babe49"]]),aU={key:0,class:"vesting-timeline-list"},lU=vr({__name:"VestingTimelineList",props:{list:{type:Array,required:!0},currencyType:{type:String,required:!0}},setup(e){const t=e;return(a,l)=>e.list.length>0?(n(),r("div",aU,[(n(!0),r(p,null,x(e.list,(e=>(n(),i(tU,{key:e.id,data:e,currencyType:t.currencyType},null,8,["data","currencyType"])))),128))])):(n(),i(Zt,{key:1,class:"no-data-available",emptyText:a.$t("t.noDataFound")},null,8,["emptyText"]))}},[["__scopeId","data-v-c6433324"]]),sU={class:"vesting-timeline"},iU=vr({__name:"VestingTimeline",props:{list:{type:Array,default:()=>[]},currencyType:{type:String,required:!0}},setup(e){const{t:t}=I(),a=e,l=O(0),s=R((()=>[{title:t("t.all"),value:LB.ALL},{title:t("t.pending"),value:LB.PENDING},{title:t("t.unlocked"),value:LB.UNLOCKED},{title:t("t.canceled"),value:LB.CANCELED}])),i=R((()=>s.value[l.value])),o=R((()=>i.value.value===LB.ALL?a.list:a.list.filter((e=>e.status===i.value.value)))),u=e=>{l.value=e};return(e,t)=>(n(),r("div",sU,[m(aa,{class:"tab-menu",selected:l.value,list:s.value,onClick:u},null,8,["selected","list"]),m(lU,{list:o.value,currencyType:a.currencyType},null,8,["list","currencyType"])]))}},[["__scopeId","data-v-5e30ce85"]]),nU={key:0,class:"loading-wrapper"},rU=vr({__name:"VestingDetailDialog",props:{id:{type:String,required:!0}},emits:["update:isShow"],setup(e,{emit:t}){const a=U(),l=t,s=e,o=O(!0),u=O({}),c=O([]),d=R((()=>{var e;return Hn(a.state.currencyMap[null==(e=u.value)?void 0:e.asset])}));j((()=>T()));const y=e=>{let t=0,a=0,l=0;return e.forEach((e=>{switch(e.status){case LB.UNLOCKED:t++;break;case LB.PENDING:a++;break;case LB.CANCELED:l++}})),{unlockedCount:t,pendingCount:a,canceledCount:l}},T=async()=>{o.value=!0;try{const e=await Oa.getVestingProjectDetail({id:s.id})||{},{transactions:t,...a}=e;u.value={...a,...y(t)},c.value=t||[],o.value=!1}catch(e){}},w=()=>{l("update:isShow",!1)};return(e,t)=>{const a=C("loading");return n(),i(Ml,{class:"vesting-detail-dialog",width:"800px",fullStyle:e.isMobile,isBrandNewStyle:"",onClosed:w},{header:g((()=>[v(h(u.value.projectName),1)])),body:g((()=>[o.value?f((n(),r("div",nU,null,512)),[[a,!0]]):(n(),r(p,{key:1},[m(KB,{detailData:u.value},null,8,["detailData"]),m(iU,{list:c.value,currencyType:d.value},null,8,["list","currencyType"])],64))])),_:1},8,["fullStyle"])}}},[["__scopeId","data-v-824dc099"]]),oU={class:"vesting-list"},uU=vr({__name:"VestingList",props:{list:{type:Array,default:()=>[]}},setup(e){const t=e,a=O(!1),l=O("");return(e,s)=>(n(),r("div",oU,[(n(!0),r(p,null,x(t.list,(e=>(n(),i(HB,{key:e.id,cardInfo:e,onClick:t=>(e=>{l.value=e.id,a.value=!0})(e)},null,8,["cardInfo","onClick"])))),128)),a.value?(n(),i(rU,{key:0,id:l.value,isShow:a.value,"onUpdate:isShow":s[0]||(s[0]=e=>a.value=e)},null,8,["id","isShow"])):d("",!0)]))}},[["__scopeId","data-v-e864d3f6"]]),cU={class:"vesting"},dU={class:"history-header"},pU={class:"flex-box justify-between items-center mt-16"},yU={class:"header-title"},hU=["href"],vU={key:0,class:"loading-wrapper"},mU=vr({__name:"Vesting",setup(e){const t=U(),{t:a}=I(),l=M(),o=O(!0),u=O({value:CB.ALL,name:a("t.all_status")}),c=O([]),d=R((()=>t.state.lang)),p=R((()=>[{value:CB.ALL,name:a("t.all_status")},{value:CB.ONGOING,name:a("t.ongoing")},{value:CB.COMPLETED,name:a("t.completed")},{value:CB.CANCELED,name:a("t.canceled")}])),T=R((()=>gt(d.value,"VESTING"))),w=R((()=>u.value.value===CB.ALL?c.value:c.value.filter((e=>u.value.value===e.status))));$((()=>t.state.accountInfo.uid),((e,t)=>{e&&t&&e!==t&&D()})),j((()=>{D()}));const D=async()=>{o.value=!0;try{const e=await Oa.getVestingList();if(c.value=e.projects||[],0===c.value.length)return void b();o.value=!1}catch(e){c.value=[]}},A=e=>{u.value=e,D()},b=()=>{l.replace({name:"walletSpot",params:{lang:d.value}})};return(e,t)=>{const a=s("RouterLink"),l=C("loading");return n(),r("div",cU,[y("div",dU,[m(a,{class:"header-back-wrapper",to:{name:"walletSpot",params:{lang:d.value}}},{default:g((()=>[m(ht,{class:"icon-back"}),y("span",null,h(e.$t("wallet.backToSpot")),1)])),_:1},8,["to"]),y("div",pU,[y("h1",yU,h(e.$t("t.vesting")),1),y("a",{class:"vesting-faq",href:T.value,target:"_blank",rel:"noopener nofollow"},[v(h(e.isMobile?e.$t("t.seeFaq"):e.$t("t.seeVestingFaq"))+" ",1),m(ht)],8,hU)])]),m(Ki,{class:"status-dropdown",value:u.value,list:p.value,onInput:A},null,8,["value","list"]),o.value?f((n(),r("div",vU,null,512)),[[l,!0]]):(n(),i(uU,{key:1,class:"vesting-list",list:w.value},null,8,["list"]))])}}},[["__scopeId","data-v-ecb107b7"]]),gU=vr({__name:"WalletMain",setup(e){const t=pt(),a=dt(),l=ct(),s=ut(),o=ot(),u=rt(),c=V(),d=R((()=>"walletFutures"===c.name)),p=R((()=>function(e){switch(e){case Ke.WALLET_AUTO_TRADER:case Ke.WALLET_AUTO_TRADER_PNL_ANALYSIS:case Ke.WALLET_AUTO_TRADER_HISTORY:return!t.isEnableAutoTraderWallet;case Ke.WALLET_LEAD_TRADING:case Ke.WALLET_LEAD_TRADING_PNL_ANALYSIS:case Ke.WALLET_LEAD_TRADING_HISTORY:return!a.isEnableLeadTradingWallet;case Ke.WALLET_COPY_TRADING:case Ke.WALLET_COPY_TRADING_PNL_ANALYSIS:case Ke.WALLET_COPY_TRADING_HISTORY:return!l.isEnableCopyTradingWallet;case Ke.WALLET_AI_LEAD_TRADING:case Ke.WALLET_AI_LEAD_TRADING_PNL_ANALYSIS:case Ke.WALLET_AI_LEAD_TRADING_HISTORY:return!s.isEnableAiLeadTradingWallet;case Ke.WALLET_AI_COPY_TRADING:case Ke.WALLET_AI_COPY_TRADING_PNL_ANALYSIS:case Ke.WALLET_AI_COPY_TRADING_HISTORY:return!o.isEnableAiCopyTradingWallet;case Ke.WALLET_FUTURES_BOTS:case Ke.WALLET_FUTURES_BOTS_PNL_ANALYSIS:case Ke.WALLET_FUTURES_BOTS_HISTORY:return!u.isEnableFuturesBotsWallet;default:return!1}}(c.name)?null:function(e){switch(e){case Ke.WALLET_OVERVIEW:return tp;case"walletSpot":return Bv;case Ke.WALLET_SPOT_HISTORY:return eT;case"walletFutures":return zw;case Ke.FUTURES_WALLET_DETAIL:return JD;case Ke.WALLET_AUTO_TRADER:return WA;case Ke.WALLET_AUTO_TRADER_HISTORY:return Wb;case Ke.WALLET_LEAD_TRADING:case Ke.WALLET_COPY_TRADING:return U_;
1case Ke.WALLET_LEAD_TRADING_HISTORY:case Ke.WALLET_COPY_TRADING_HISTORY:case Ke.WALLET_AI_LEAD_TRADING_HISTORY:case Ke.WALLET_AI_COPY_TRADING_HISTORY:return eS;case Ke.WALLET_AI_LEAD_TRADING:case Ke.WALLET_AI_COPY_TRADING:return jS;case Ke.WALLET_FUTURES_BOTS:return WC;case Ke.WALLET_FUTURES_BOTS_HISTORY:return ZC;case Ke.WALLET_SPOT_PNL_ANALYSIS:case Ke.WALLET_FUTURES_PNL_ANALYSIS:case Ke.WALLET_AUTO_TRADER_PNL_ANALYSIS:case Ke.WALLET_LEAD_TRADING_PNL_ANALYSIS:case Ke.WALLET_COPY_TRADING_PNL_ANALYSIS:case Ke.WALLET_AI_LEAD_TRADING_PNL_ANALYSIS:case Ke.WALLET_AI_COPY_TRADING_PNL_ANALYSIS:case Ke.WALLET_FUTURES_BOTS_PNL_ANALYSIS:case Ke.WALLET_EARN_REWARD_ANALYSIS:return wI;case"walletEarn":return Qx;case"historyEarn":return rO;case Ke.WALLET_TRANSACTION_HISTORY:return lW;case Ke.ACCOUNT_STATEMENT:return _B;case Ke.VESTING:return mU;default:return null}}(c.name)));return(e,t)=>(n(),r("div",{class:L(["main",{"default-justify-content":d.value}])},[(n(),i(A(p.value)))],2))}},[["__scopeId","data-v-248d379d"]]),{visible:{nav:fU}}=Bt,TU={class:"wallet"};const wU=vr({name:"Wallet",components:{WalletNav:Ro,WalletMain:gU},computed:{isNavVisible:()=>fU}},[["render",function(e,t,a,l,o,u){const c=s("WalletNav"),p=s("WalletMain");return n(),r("div",TU,[u.isNavVisible?(n(),i(c,{key:0,switcherStickyEffect:""})):d("",!0),m(p)])}],["__scopeId","data-v-1b5ae48d"]]),{captureEvent:DU}=Ga(),AU={name:"WalletOverview",components:{UnifiedWalletUpgradeBanner:Ko,WalletBalanceInfo:ic,WalletActions:Gu,MyAssetsContent:Uc,PnlAnalysisContent:Jc,NetAndPnlContent:kd,Card:xo,IconInfo2:Fa,IconChevronRight:ht,RecentTransactionList:Ud,WhichWalletActionView:Tr,ConvertDialog:De,WalletEmailConfirmResultDialog:Sr,SendToFlow:fr},data:()=>({...Md.data(),ROUTE_NAME:Ke,RECENT_HISTORY_DAYS:7,actionType:null,currencyInfo:null,isShowSendToDialog:!1,sendToRecorder:null,isShowActionResultDialog:!1,isShowTransactionHistoryLink:!1}),computed:{...l(["hideWalletPriceValue","walletAction","lang","isInitialWalletInfoLoading"]),...t(["showWalletUpgradeBanner","isAccountInfoExist"]),...a(Ya,["isSupportedFiat"]),...a(Ut,["accountCurrency"]),isDeposit(){return this.actionType===It.DEPOSIT},isWithdraw(){return this.actionType===It.WITHDRAWAL},isShowConvertDialog(){return this.actionType===It.CONVERT}},watch:{isAccountInfoExist(e){e&&this.checkQueryString()},isInitialWalletInfoLoading(e){!e&&this.forceUpdate()},walletAction({action:e}){this.actionType=e},actionType(){switch(this.actionType){case It.TRANSFER:this.toggleTransferPopup(),this.handleCloseDialog();break;case It.SEND_TO:this.handleSendTo();break;case It.DEPOSIT:Va({entryChannel:Ha.walletOverview}),DU("deposit_entrance",{entry_channel:"wallet_overview"})}},accountCurrency:{handler(e){e&&e!==la&&this.fetchIndexMap(e)},immediate:!0}},created(){this.updateAllWallets(!0)},mounted(){this.refreshUserInfo(),this.withdrawEmailConfirmCheck()&&(this.isShowActionResultDialog=!0),this.sendToEmailConfirmCheck()},beforeUnmount(){this.removeAllTimer()},methods:{...Md.methods,...u(["getKycStatus","setWalletAction","fetchIndexMap"]),...e(Mr,["toggleTransferPopup"]),...e(Ma,["forceUpdate"]),...e(Ht,["updateAllWallets","removeAllTimer"]),checkQueryString(){this.$route.query.actionType===It.DEPOSIT&&(this.actionType=this.$route.query.actionType)},refreshUserInfo(e){this.getKycStatus().then((()=>{e&&e()}))},handleCloseDialog(){this.actionType=null,this.clearStoreWalletAction()},clearStoreWalletAction(){this.setWalletAction({action:"",currencyType:this.isSupportedFiat?Ua.FIAT:Ua.CRYPTO,paymentWay:""})},handleSendTo(){this.sendToRecorder=Dr(),this.isShowSendToDialog=!0,this.handleCloseDialog()},closeActionResultDialog(){this.isShowActionResultDialog=!1},onHistoryLoaded(e){this.isShowTransactionHistoryLink=e}}},bU={class:"overview"},_U={class:"title"},SU={class:"top-wrapper"},CU={class:"value-type"},LU={class:"overview-content"},EU={class:"card-title my-assets-title"},IU={class:"right"},kU={class:"card-title"},RU={class:"card-title"},NU={class:"right"},xU={class:"recent-transaction-head"},PU={class:"left"},OU={class:"card-title"},$U={class:"pnl-note"};const WU=vr(AU,[["render",function(e,t,a,l,o,u){const c=s("UnifiedWalletUpgradeBanner"),p=s("WalletBalanceInfo"),f=s("WalletActions"),T=s("MyAssetsContent"),w=s("Card"),D=s("IconInfo2"),A=s("Tooltip"),b=s("PnlAnalysisContent"),_=s("NetAndPnlContent"),S=s("IconChevronRight"),C=s("RouterLink"),L=s("RecentTransactionList"),E=s("WhichWalletActionView"),I=s("ConvertDialog"),k=s("SendToFlow"),R=s("WalletEmailConfirmResultDialog");return n(),r("div",bU,[e.showWalletUpgradeBanner?(n(),i(c,{key:0})):d("",!0),y("h2",_U,h(e.$t("router.walletOverview")),1),y("div",SU,[m(p,{class:"balance-info",type:"overview"},{valueType:g((()=>[y("div",CU,h(e.$t("wallets.totalAssets")),1)])),_:1}),m(f,{actionType:o.actionType,"onUpdate:actionType":t[0]||(t[0]=e=>o.actionType=e),type:"overview",class:"balance-actions"},null,8,["actionType"])]),y("div",LU,[m(w,{class:"my-assets left"},{default:g((()=>[y("div",EU,h(e.$t("wallets.overview.myAssets.title")),1),m(T)])),_:1}),y("div",IU,[m(w,{class:"border-box h-100"},{default:g((()=>[y("div",kU,[v(h(e.$t("wallets.overview.pnlAnalysis.title"))+" ",1),m(A,{placement:"right"},{content:g((()=>[m(D,{class:"info-icon"})])),tooltip:g((()=>[v(h(e.$t("wallets.overview.pnlAnalysis.tip")),1)])),_:1})]),m(b)])),_:1})]),m(w,{class:"asset-trend left"},{default:g((()=>[y("div",RU,[v(h(e.$t("wallets.overview.netAndPnl.title"))+" ",1),m(A,{placement:"right"},{content:g((()=>[m(D,{class:"info-icon"})])),tooltip:g((()=>[v(h(e.$t("wallets.overview.pnl.tip")),1)])),_:1})]),m(_)])),_:1}),y("div",NU,[m(w,{class:"recent-transaction"},{default:g((()=>[y("div",xU,[y("div",PU,[y("div",OU,[v(h(e.$t("wallets.overview.recentTransactions.title"))+" ",1),t[3]||(t[3]=y("br",null,null,-1)),v(" ("+h(e.$t("t.last.days",{day:o.RECENT_HISTORY_DAYS}))+") ",1)])]),o.isShowTransactionHistoryLink?(n(),i(C,{key:0,to:{name:o.ROUTE_NAME.WALLET_TRANSACTION_HISTORY,params:{lang:e.lang}},class:"history-link day-mode"},{default:g((()=>[v(h(e.$t("wallets.overview.recentTransactions.historyLink"))+" ",1),m(S,{class:"history-link-icon"})])),_:1},8,["to"])):d("",!0)]),m(L,{class:"transaction-list-container",onOnHistoryLoaded:u.onHistoryLoaded},null,8,["onOnHistoryLoaded"])])),_:1})])]),y("div",$U,[y("p",null,h(e.$t("wallets.overview.note1")),1),y("p",null,h(e.$t("wallets.overview.note2")),1),y("p",null,h(e.$t("wallets.overview.note3")),1)]),u.isDeposit||u.isWithdraw?(n(),i(E,{key:1,actionType:o.actionType,onClosed:u.handleCloseDialog},null,8,["actionType","onClosed"])):d("",!0),u.isShowConvertDialog?(n(),i(I,{key:2,closeDialog:u.handleCloseDialog},null,8,["closeDialog"])):d("",!0),o.isShowSendToDialog?(n(),i(k,{key:3,record:o.sendToRecorder,"onUpdate:record":t[1]||(t[1]=e=>o.sendToRecorder=e),show:o.isShowSendToDialog,"onUpdate:show":t[2]||(t[2]=e=>o.isShowSendToDialog=e)},null,8,["record","show"])):d("",!0),m(R,{show:o.isShowActionResultDialog,closeDialog:u.closeActionResultDialog,resultType:e.actionResultType_mixin,resultCode:e.actionResultCode_mixin},null,8,["show","closeDialog","resultType","resultCode"])])}],["__scopeId","data-v-e548e0d7"]]),FU={name:"TransactionHistoryRow",components:{BrandIcon:Pa,IconChevronDown2:ca,IconInfo2:Fa},props:{data:{type:Object,default:()=>({})},index:{type:Number,required:!0}},computed:{dateObj(){const e=X(new Date(this.data.date),"yyyy-MM-dd HH:mm:ss").split(" ");return{date:e[0],time:e[1]}},netAmount(){return this.formatNumber(this.data.netAmount,this.data.currencyData)}},methods:{...XO,formatHash:e=>e?`${e.substring(0,12)}...`:""}},BU={class:"time"},UU={class:"hash-wrap"};const MU=vr(FU,[["render",function(e,t,a,l,r,o){const u=s("Cell"),c=s("BrandIcon"),p=s("IconInfo2"),f=s("Tooltip"),T=s("IconChevronDown2"),w=s("Row");return n(),i(w,{class:"transaction-history-row",index:a.index,disableBackgroun
1d:!0,disableCssHoverEffect:!1},{default:g((()=>[m(u,{textAlign:"left"},{default:g((()=>[y("span",null,h(o.dateObj.date),1),y("span",BU,h(o.dateObj.time),1)])),_:1}),m(u,{textAlign:"left"},{default:g((()=>[m(c,{displayName:a.data.currencyData.displayName,"short-name":!0,type:a.data.currencyData.isFiat?"fiat":"icon",name:a.data.currencyData.shortName,size:"20"},null,8,["displayName","type","name"])])),_:1}),m(u,{textAlign:"left"},{default:g((()=>[y("span",null,h(e.$t(`t.${a.data.historyType.toLowerCase()}`)),1)])),_:1}),m(u,{textAlign:"left"},{default:g((()=>[y("span",null,h(o.netAmount),1)])),_:1}),m(u,{textAlign:"left"},{default:g((()=>[y("div",UU,[v(h(o.formatHash(a.data.hash))+" ",1),a.data.hash?(n(),i(f,{key:0,placement:"top"},{content:g((()=>[m(p,{class:"info-icon"})])),tooltip:g((()=>[v(h(a.data.hash),1)])),_:1})):d("",!0)])])),_:1}),m(u,{class:"detail"},{default:g((()=>[m(T,{class:"detail-icon"})])),_:1})])),_:1},8,["index"])}],["__scopeId","data-v-ee20a486"]]),VU={class:"send-and-receive-wrap"},HU={class:"filters-wrap"},GU={class:"filter-left"},YU={class:"filter-right"},qU=vr({__name:"SendAndReceive",props:{dateRangeData:{type:Object,default:()=>({start:null,end:null})},setDateRangeData:{type:Function,required:!0},defaultRange:{type:Object,default:()=>({start:null,end:null})},category:{type:String,required:!0}},setup(e){const t=U(),a=pt(),l=ct(),s=V(),{t:o}=I(),u=e,c=Yt(),{isEnableApiBrokerFee:p}=S(o$()),v=O(!1),{isFirstLoad:g,loadMore:f,pagination:T,setPaginationData:w,handlePageChange:D}=oO({isLoading:v}),A=O(u.dateRangeData),b=O(null),_=O(null),C=O(""),E=K({}),k=nn,N=sn,x=O(!1),W=O(!1);const{listData:F,downloadPathname:B,downloadQueryString:M,getDetailData:H}=u$({isLoading:v,isFirstLoad:g,loadMore:f,dateRangeData:R((()=>u.dateRangeData)),selectedDateRangeData:A,category:R((()=>u.category)),type:b,status:_,selectedCurrency:C,pagination:T,setPaginationData:w,isShowDetailLoading:x,detailData:E,handleShowDetailDialog:function(){W.value=!0}}),G=R((()=>ro($a.downloadSpotHistory,B,M.value))),Y=R((()=>[{id:"date",lang:o("t.time"),textAlign:"left",sortable:!0},{id:"asset",lang:o("t.asset"),textAlign:"left",sortable:!0},{id:"type",lang:o("t.type"),textAlign:"left"},{id:"netAmount",lang:o("t.netAmount"),textAlign:"left"},{id:"hash",lang:o("history.spot.detail.hash"),textAlign:"left"},{id:"detail"}])),q=R((()=>a.isEnableAutoTraderWallet)),z=R((()=>t.getters.isEnableAutoTraderPrediction)),j=R((()=>t.getters.isEnableBinaryOptions)),X=R((()=>t.getters.isEnableUpOrDown)),Q=R((()=>{let e=en.SEND_RECEIVE.slice();return l.isEnableCopyTradingWallet&&(e=e.concat(pn)),q.value&&z.value&&(e=e.concat(yn)),j.value&&(e=e.concat(hn)),X.value&&(e=e.concat(vn)),p.value&&(e=e.concat(mn)),e.map((e=>{return{name:o(`t.${(t=e).toLowerCase()}`),value:t};var t}))}));function Z(e){b.value=e}$((()=>u.dateRangeData),(e=>{A.value=e}),{deep:!0});const J=O(null);function ee(){!function(){const[e,t]=xe(on);u.setDateRangeData({start:e,end:t})}(),C.value="",J.value.reset(Q.value[0].value)}function te(e){const{id:t,historyType:a}=e;H(t,a)}return(t,a)=>(n(),r("div",VU,[y("div",HU,[y("div",GU,[m(Ne,{ref:"walletDatePicker",dateRange:A.value,"onUpdate:dateRange":a[0]||(a[0]=e=>A.value=e),defaultRange:e.defaultRange,minDurationToNow:P(k),rangeLimitDuration:P(N)},null,8,["dateRange","defaultRange","minDurationToNow","rangeLimitDuration"]),m(AO,{selectedCurrency:C.value,"onUpdate:selectedCurrency":a[1]||(a[1]=e=>C.value=e),class:"currency-dropdown"},null,8,["selectedCurrency"]),m(rn,{ref_key:"typeDropdown",ref:J,class:L(["dropdown",{selected:!!b.value}]),list:Q.value,handleUpdate:Z,defaultValue:P(s).query.type,placeholder:P(o)("t.type")},null,8,["class","list","defaultValue","placeholder"]),y("span",{class:"reset",onClick:ee},h(P(o)("t.resetFilters")),1)]),y("div",YU,[m(Ds,{class:"file-download",fileName:"send-and-receive",requestDownload:G.value,defaultRangeDate:A.value,hasPdf:""},null,8,["requestDownload","defaultRangeDate"])])]),m(We,{rowComponent:MU,headerTitlesData:Y.value,listData:P(F),isLoading:v.value,handleRowClick:te},null,8,["headerTitlesData","listData","isLoading"]),v.value?d("",!0):(n(),i(P(As),{key:0,class:"pagination",layout:"prev, pager, next, jumper",total:P(T).totalRows,pageSize:P(T).pageSize,totalPages:P(T).totalPages,currentPage:P(T).
1currentPage,pagerCount:5,background:!1,onHandleCurrentChangeP:P(D)},null,8,["total","pageSize","totalPages","currentPage","onHandleCurrentChangeP"])),W.value?(n(),i(pf,{key:1,isShow:W.value,"onUpdate:isShow":a[2]||(a[2]=e=>W.value=e),detailData:E.value},null,8,["isShow","detailData"])):d("",!0),x.value?(n(),i(Cm,{key:2,isShow:x.value,"onUpdate:isShow":a[3]||(a[3]=e=>x.value=e)},null,8,["isShow"])):d("",!0),P(c).sendToEventPayload?(n(),i(jO,{key:3})):d("",!0)]))}},[["__scopeId","data-v-fa826c3e"]]),zU={name:"TransactionHistoryRow",components:{IconChevronDown2:ca,BrandIcon:Pa},props:{data:{type:Object,default:()=>({})},index:{type:Number,required:!0}},data:()=>({CROSS_WALLET_NAME:ul}),computed:{...l(["accountInfo"]),...t(["isUnifiedWallet"]),dateObj(){const e=X(new Date(this.data.date),"yyyy-MM-dd HH:mm:ss").split(" ");return{date:e[0],time:e[1]}},showOldWalletName(){return!this.isUnifiedWallet||null!==this.accountInfo.walletUpgradeTime&&this.data.date<this.accountInfo.walletUpgradeTime},netAmount(){return this.formatNumber(this.data.netAmount,this.data.currencyData)}},methods:{...XO,getWalletName(e){return e.includes("SPOT@")?this.$t("t.spot"):e.includes(ni.AUTO_TRADER)?this.$t("nav.autoTrader"):e.includes(ni.FUTURES_BOTS)?this.$t("nav.futuresBots"):e.includes(ul)?this.$t("t.futures"):ps(e)}}},KU={class:"time"},jU={class:"wallet-name"},XU={key:0,class:"note"},QU={class:"wallet-name"},ZU={key:0,class:"note"};const JU=vr(zU,[["render",function(e,t,a,l,o,u){const c=s("Cell"),p=s("BrandIcon"),v=(s("IconChevronDown2"),s("Row"));return n(),i(v,{class:L(["transaction-history-row",{"has-detail":a.data.hasDetail}]),index:a.index,disableBackground:!0,disableCssHoverEffect:!1},{default:g((()=>[m(c,{textAlign:"left"},{default:g((()=>[y("span",null,h(u.dateObj.date),1),y("span",KU,h(u.dateObj.time),1)])),_:1}),m(c,{textAlign:"left"},{default:g((()=>[m(p,{displayName:a.data.currencyData.displayName,"short-name":!0,type:a.data.currencyData.isFiat?"fiat":"icon",name:a.data.currencyData.shortName,size:"20"},null,8,["displayName","type","name"])])),_:1}),m(c,{textAlign:"left"},{default:g((()=>[y("span",null,h(u.netAmount),1)])),_:1}),m(c,{textAlign:"left"},{default:g((()=>[y("div",jU,[y("span",null,h(u.getWalletName(a.data.fromWalletName)),1),u.showOldWalletName&&a.data.fromWalletName===o.CROSS_WALLET_NAME?(n(),r("span",XU,h(e.$t("msg.walletName.CROSS")),1)):d("",!0)])])),_:1}),m(c,{textAlign:"left"},{default:g((()=>[y("div",QU,[y("span",null,h(u.getWalletName(a.data.toWalletName)),1),u.showOldWalletName&&a.data.toWalletName===o.CROSS_WALLET_NAME?(n(),r("span",ZU,h(e.$t("msg.walletName.CROSS")),1)):d("",!0)])])),_:1}),m(c,{textAlign:"left"},{default:g((()=>[y("span",null,h(a.data.transactionRef),1)])),_:1}),d("",!0)])),_:1},8,["class","index"])}],["__scopeId","data-v-92a9782e"]]),eM={class:"transfer-wrap"},tM={class:"filters-wrap"},aM={class:"filter-left"},lM={class:"filter-right"},sM=vr({__name:"Transfer",props:{dateRangeData:{type:Object,default:()=>({start:null,end:null})},setDateRangeData:{type:Function,required:!0},defaultRange:{type:Object,default:()=>({start:null,end:null})},category:{type:String,required:!0}},setup(e){const t=pt(),a=dt(),l=ut(),s=ct(),o=ot(),u=rt(),c=V(),{t:p}=I(),v=e,g=O(!1),{isFirstLoad:f,loadMore:T,pagination:w,setPaginationData:D,handlePageChange:A}=oO({isLoading:g}),b=O(v.dateRangeData),_=O(null),S=O(""),C=nn,E=sn,{listData:k,downloadPathname:N,downloadQueryString:x}=u$({isLoading:g,isFirstLoad:f,loadMore:T,dateRangeData:R((()=>v.dateRangeData)),selectedDateRangeData:b,category:R((()=>v.category)),type:_,selectedCurrency:S,pagination:w,setPaginationData:D}),W=R((()=>ro($a.downloadSpotHistory,N,x.value))),F=R((()=>t.isEnableAutoTraderWallet)),B=R((()=>s.isEnableCopyTradingWallet)),U=R((()=>a.isEnableLeadTradingWallet)),M=R((()=>l.isEnableAiLeadTradingWallet)),H=R((()=>o.isEnableAiCopyTradingWallet)),G=R((()=>u.isEnableFuturesBotsWallet)),Y=R((()=>[{id:"date",lang:p("t.time"),textAlign:"left",sortable:!0},{id:"asset",lang:p("t.asset"),textAlign:"left",sortable:!0},{id:"netAmount",lang:p("t.netAmount"),textAlign:"left"},{id:"from",lang:p("t.from"),textAlign:"left"},{id:"to",lang:p("t.to"),textAlign:"left"},{id:"transactionNumber",lang:p("t.transactionNumber"),textAlign:"left"}])),q=R((()=>{let e=en.TRANSFER;return F.value&&(e=e.concat(gn)),U.value&&(e=e.concat(fn)),M.value&&(e=e.concat(Tn)),B.value&&(e=e.concat(wn)),H.value&&(e=e.concat(Dn)),G.value&&(e=e.concat(An)),e.map((e=>function(e){let t=p(`t.${e.toLowerCase()}`);e.includes(ni.AUTO_TRADER)&&(t=p(`t.${e.replace(ni.AUTO_TRADER,"AUTOTRADER").toLowerCase()}`));return{name:t,value:e}}(e)))}));function z(e){_.value=e}$((()=>v.dateRangeData),(e=>{b.value=e}),{deep:!0});const K=O(null);function j(){!function(){const[e,t]=xe(on);v.setDateRangeData({start:e,end:t})}(),S.value="",K.value.reset(q.value[0].value)}return(t,a)=>(n(),r("div",eM,[y("div",tM,[y("div",aM,[m(Ne,{ref:"walletDatePicker",dateRange:b.value,"onUpdate:dateRange":a[0]||(a[0]=e=>b.value=e),defaultRange:e.defaultRange,minDurationToNow:P(C),rangeLimitDuration:P(E)},null,8,["dateRange","defaultRange","minDurationToNow","rangeLimitDuration"]),m(AO,{selectedCurrency:S.value,"onUpdate:selectedCurrency":a[1]||(a[1]=e=>S.value=e),class:"currency-dropdown"},null,8,["selectedCurrency"]),m(rn,{ref_key:"typeDropdown",ref:K,class:L(["dropdown",{selected:!!_.value}]),list:q.value,handleUpdate:z,defaultValue:P(c).query.type,placeholder:P(p)("t.from_to_to")},null,8,["class","list","defaultValue","placeholder"]),y("span",{class:"reset",onClick:j},h(P(p)("t.resetFilters")),1)]),y("div",lM,[m(Ds,{class:"file-download",fileName:"transfer",requestDownload:W.value,defaultRangeDate:b.value,hasPdf:""},null,8,["requestDownload","defaultRangeDate"])])]),m(We,{rowComponent:JU,headerTitlesData:Y.value,listData:P(k),isLoading:g.value},null,8,["headerTitlesData","listData","isLoading"]),g.value?d("",!0):(n(),i(P(As),{key:0,class:"pagination",layout:"prev, pager, next, jumper",total:P(w).totalRows,pageSize:P(w).pageSize,totalPages:P(w).totalPages,currentPage:P(w).currentPage,pagerCount:5,background:!1,onHandleCurrentChangeP:P(A)},null,8,["total","pageSize","totalPages","currentPage","onHandleCurrentChangeP"]))]))}},[["__scopeId","data-v-c73a2601"]]),iM={name:"TransactionHistoryRow",components:{IconChevronDown2:ca,BrandIcon:Pa},props:{data:{type:Object,default:()=>({})},index:{type:Number,required:!0}},computed:{dateObj(){const e=X(new Date(this.data.date),"yyyy-MM-dd HH:mm:ss").split(" ");return{date:e[0],time:e[1]}},details(){const{historyType:e,info:t={}}=this.data;if("REFERRAL"===e)return this.$t("t.referral_bonus");const{earnType:a,currency:l}=t,s=Object.keys(Ii).reduce(((e,t)=>Ii[t]===Number(a)?t:e),"");return`${l} ${this.$t(`earn.${s.toLowerCase()}Term`)}`},historyType(){const{historyType:e}=this.data;return this.$t(`t.${e.toLowerCase()}`)},netAmount(){return this.formatNumber(this.data.netAmount,this.data.currencyData)}},methods:{...XO}},nM={class:"time"},rM={class:"details"};const oM=vr(iM,[["render",function(e,t,a,l,r,o){const u=s("Cell"),c=s("BrandIcon"),p=(s("IconChevronDown2"),s("Row"));return n(),i(p,{class:L(["transaction-history-row",{"has-detail":a.data.hasDetail}
1]),index:a.index,disableBackground:!0,disableCssHoverEffect:!1},{default:g((()=>[m(u,{textAlign:"left"},{default:g((()=>[y("span",null,h(o.dateObj.date),1),y("span",nM,h(o.dateObj.time),1)])),_:1}),m(u,{textAlign:"left"},{default:g((()=>[m(c,{displayName:a.data.currencyData.displayName,"short-name":!0,type:a.data.currencyData.isFiat?"fiat":"icon",name:a.data.currencyData.shortName,size:"20"},null,8,["displayName","type","name"])])),_:1}),m(u,{textAlign:"left"},{default:g((()=>[y("span",null,h(o.netAmount),1)])),_:1}),m(u,{textAlign:"left"},{default:g((()=>[y("span",null,h(o.historyType),1)])),_:1}),m(u,{textAlign:"left"},{default:g((()=>[y("span",rM,h(o.details),1)])),_:1}),d("",!0)])),_:1},8,["class","index"])}],["__scopeId","data-v-58798b23"]]),uM={class:"send-and-receive-wrap"},cM={class:"filters-wrap"},dM={class:"filter-left"},pM={class:"filter-right"},yM=vr({__name:"Interest",props:{dateRangeData:{type:Object,default:()=>({start:null,end:null})},setDateRangeData:{type:Function,required:!0},defaultRange:{type:Object,default:()=>({start:null,end:null})},category:{type:String,required:!0}},setup(e){const t=V(),{t:a}=I(),l=e,s=O(!1),{isFirstLoad:o,loadMore:u,pagination:c,setPaginationData:p,handlePageChange:v}=oO({isLoading:s}),g=O(l.dateRangeData),f=O(null),T=O(""),w=nn,D=sn,{listData:A,downloadPathname:b,downloadQueryString:_}=u$({isLoading:s,isFirstLoad:o,loadMore:u,dateRangeData:R((()=>l.dateRangeData)),selectedDateRangeData:g,category:R((()=>l.category)),type:f,selectedCurrency:T,pagination:c,setPaginationData:p}),S=R((()=>ro($a.downloadSpotHistory,b,_.value))),C=R((()=>[{id:"date",lang:a("t.time"),textAlign:"left",sortable:!0},{id:"asset",lang:a("t.asset"),textAlign:"left",sortable:!0},{id:"netAmount",lang:a("t.netAmount"),textAlign:"left"},{id:"type",lang:a("t.type"),textAlign:"left"},{id:"details",lang:a("t.details"),textAlign:"left"}])),E=R((()=>en.INTEREST.map((e=>{return{name:a(`t.${(t=e).toLowerCase()}`),value:t};var t}))));function k(e){f.value=e}$((()=>l.dateRangeData),(e=>{g.value=e}),{deep:!0});const N=O(null);function x(){!function(){const[e,t]=xe(on);l.setDateRangeData({start:e,end:t})}(),T.value="",N.value&&N.value.reset(E.value[0].value)}return(l,o)=>(n(),r("div",uM,[y("div",cM,[y("div",dM,[m(Ne,{ref:"walletDatePicker",dateRange:g.value,"onUpdate:dateRange":o[0]||(o[0]=e=>g.value=e),defaultRange:e.defaultRange,minDurationToNow:P(w),rangeLimitDuration:P(D)},null,8,["dateRange","defaultRange","minDurationToNow","rangeLimitDuration"]),m(AO,{selectedCurrency:T.value,"onUpdate:selectedCurrency":o[1]||(o[1]=e=>T.value=e),class:"currency-dropdown"},null,8,["selectedCurrency"]),E.value.length>1?(n(),i(rn,{key:0,ref_key:"typeDropdown",ref:N,class:L(["dropdown",{selected:!!f.value}]),list:E.value,handleUpdate:k,defaultValue:P(t).query.type,placeholder:P(a)("t.type")},null,8,["class","list","defaultValue","placeholder"])):d("",!0),y("span",{class:"reset",onClick:x},h(P(a)("t.resetFilters")),1)]),y("div",pM,[m(Ds,{class:"file-download",fileName:e.category,requestDownload:S.value,defaultRangeDate:g.value,hasPdf:""},null,8,["fileName","requestDownload","defaultRangeDate"])])]),m(We,{rowComponent:oM,headerTitlesData:C.value,listData:P(A),isLoading:s.value},null,8,["headerTitlesData","listData","isLoading"]),s.value?d("",!0):(n(),i(P(As),{key:0,class:"pagination",layout:"prev, pager, next, jumper",total:P(c).totalRows,pageSize:P(c).pageSize,totalPages:P(c).totalPages,currentPage:P(c).currentPage,pagerCount:5,background:!1,onHandleCurrentChangeP:P(v)},null,8,["total","pageSize","totalPages","currentPage","onHandleCurrentChangeP"]))]))}},[["__scopeId","data-v-25109d34"]]),hM={name:"TransactionHistoryRow",components:{BrandIcon:Pa},props:{data:{type:Object,default:()=>({})},index:{type:Number,required:!0}},computed:{dateObj(){const e=X(new Date(this.data.date),"yyyy-MM-dd HH:mm:ss").split(" ");return{date:e[0],time:e[1]}},details(){switch(this.data.details){case ys.referral:return this.$t("t.referralBonus");case ys.referralSelfRebate:return this.$t("t.referralSelfRebate");case ys.tokenVoucherIn:case ys.tokenVoucherOut:return this.$t("t.tokenVoucher");case ys.spotTradingFeeRebate:case ys.futuresTradingFeeRebate:case ys.generalTradingFeeRebate:case ys.autoTraderTradingFeeRebate:return this.$t("t.tradingFeeRebate");case ys.trialFund:case ys.trialFundExpired:return this.$t("t.trialfund")}switch(this.data.historyType){case ys.assetOnHold:return this.$t("assetOnHold.detail");case ys.assetRelease:return this.$t("assetRelease.detail")}return""},historyType(){const{historyType:e}=this.data;return this.$t(`t.${e.toLowerCase()}`)},netAmount(){return this.formatNumber(this.data.netAmount,this.data.currencyData)}},methods:{...XO}},vM={class:"time"},mM={class:"details"};const gM=vr(hM,[["render",function(e,t,a,l,r,o){const u=s("Cell"),c=s("BrandIcon"),d=s("Row");return n(),i(d,{class:L(["transaction-history-row",{"has-detail":a.data.hasDetail}
1]),index:a.index,disableBackground:!0,disableCssHoverEffect:!1},{default:g((()=>[m(u,{textAlign:"left"},{default:g((()=>[y("span",null,h(o.dateObj.date),1),y("span",vM,h(o.dateObj.time),1)])),_:1}),m(u,{textAlign:"left"},{default:g((()=>[m(c,{displayName:a.data.currencyData.displayName,"short-name":!0,type:a.data.currencyData.isFiat?"fiat":"icon",name:a.data.currencyData.shortName,size:"20"},null,8,["displayName","type","name"])])),_:1}),m(u,{textAlign:"left"},{default:g((()=>[y("span",null,h(o.netAmount),1)])),_:1}),m(u,{textAlign:"left"},{default:g((()=>[y("span",null,h(o.historyType),1)])),_:1}),m(u,{textAlign:"left"},{default:g((()=>[y("span",mM,h(o.details),1)])),_:1})])),_:1},8,["class","index"])}],["__scopeId","data-v-a3b44fdd"]]),fM={class:"send-and-receive-wrap"},TM={class:"filters-wrap"},wM={class:"filter-left"},DM={class:"filter-right"},AM=vr({__name:"ReferralAndBonus",props:{dateRangeData:{type:Object,default:()=>({start:null,end:null})},setDateRangeData:{type:Function,required:!0},defaultRange:{type:Object,default:()=>({start:null,end:null})},category:{type:String,required:!0}},setup(e){const t=V(),{t:a}=I(),l=e,s=O(!1),{isFirstLoad:o,loadMore:u,pagination:c,setPaginationData:p,handlePageChange:v}=oO({isLoading:s}),g=O(l.dateRangeData),f=O(null),T=O(""),w=nn,D=sn,A=R((()=>[{id:"date",lang:a("t.time"),textAlign:"left",sortable:!0},{id:"asset",lang:a("t.asset"),textAlign:"left",sortable:!0},{id:"netAmount",lang:a("t.netAmount"),textAlign:"left"},{id:"type",lang:a("t.type"),textAlign:"left"},{id:"details",lang:a("t.details"),textAlign:"left"}])),{listData:b,downloadPathname:_,downloadQueryString:S}=u$({isLoading:s,isFirstLoad:o,loadMore:u,dateRangeData:R((()=>l.dateRangeData)),selectedDateRangeData:g,category:R((()=>l.category)),type:f,selectedCurrency:T,pagination:c,setPaginationData:p}),C=R((()=>ro($a.downloadSpotHistory,_,S.value))),E=R((()=>en.REFERRAL_BONUS.map((e=>{return{name:a(`t.${(t=e).toLowerCase()}`),value:t};var t}))));function k(e){f.value=e}$((()=>l.dateRangeData),(e=>{g.value=e}),{deep:!0});const N=O(null);function x(){!function(){const[e,t]=xe(on);l.setDateRangeData({start:e,end:t})}(),T.value="",N.value&&N.value.reset(E.value[0].value)}return(l,o)=>(n(),r("div",fM,[y("div",TM,[y("div",wM,[m(Ne,{ref:"walletDatePicker",dateRange:g.value,"onUpdate:dateRange":o[0]||(o[0]=e=>g.value=e),defaultRange:e.defaultRange,minDurationToNow:P(w),rangeLimitDuration:P(D)},null,8,["dateRange","defaultRange","minDurationToNow","rangeLimitDuration"]),m(AO,{selectedCurrency:T.value,"onUpdate:selectedCurrency":o[1]||(o[1]=e=>T.value=e),class:"currency-dropdown"},null,8,["selectedCurrency"]),E.value.length>1?(n(),i(rn,{key:0,ref_key:"typeDropdown",ref:N,class:L(["dropdown",{selected:!!f.value}]),list:E.value,handleUpdate:k,defaultValue:P(t).query.type,placeholder:P(a)("t.type")},null,8,["class","list","defaultValue","placeholder"])):d("",!0),y("span",{class:"reset",onClick:x},h(P(a)("t.resetFilters")),1)]),y("div",DM,[m(Ds,{class:"file-download",fileName:e.category,requestDownload:C.value,defaultRangeDate:g.value,hasPdf:""},null,8,["fileName","requestDownload","defaultRangeDate"])])]),m(We,{rowComponent:gM,headerTitlesData:A.value,listData:P(b),isLoading:s.value},null,8,["headerTitlesData","listData","isLoading"]),s.value?d("",!0):(n(),i(P(As),{key:0,class:"pagination",layout:"prev, pager, next, jumper",total:P(c).totalRows,pageSize:P(c).pageSize,totalPages:P(c).totalPages,currentPage:P(c).currentPage,pagerCount:5,background:!1,onHandleCurrentChangeP:P(v)},null,8,["total","pageSize","totalPages","currentPage","onHandleCurrentChangeP"]))]))}},[["__scopeId","data-v-d529faa6"]]),bM={name:"BuySellCryptoTransactionHistoryRow",components:{IconChevronDown2:ca,BrandIcon:Pa,WalletHistoryStatus:Fe},props:{data:{type:Object,default:()=>({})},index:{type:Number,required:!0}},computed:{displayName(){return this.data.currencyData.displayName||this.data.currencyData.currency},shortName(){return this.data.currencyData.shortName||this.data.currencyData.currency},dateObj(){return $e(this.data.date)},computedHistoryText(){switch(this.data.historyType){case"EXPRESS_BUY":return this.$t("display.expressBuy");case"EXPRESS_SELL":return this.$t("display.expressSell");default:return this.$t(`t.${this.data.historyType.toLowerCase()}`)}},netAmount(){const{amount:e,currencyData:t,status:a}=this.data;return a!==be.COMPLETED?"-":this.formatNumber(e,t)}},methods:{...XO}},_M={class:"time"};const SM=vr(bM,[["render",function(e,t,a,l,r,o){const u=s("Cell"),c=s("BrandIcon"),d=s("WalletHistoryStatus"),p=s("IconChevronDown2"),v=s("Row");return n(),i(v,{class:"transaction-history-row",index:a.index,disableBackgroun
1d:!0,disableCssHoverEffect:!1},{default:g((()=>[m(u,{textAlign:"left"},{default:g((()=>[y("span",null,h(o.dateObj.date),1),y("span",_M,h(o.dateObj.time),1)])),_:1}),m(u,{textAlign:"left"},{default:g((()=>[m(c,{displayName:o.displayName,"short-name":!0,type:a.data.currencyData.isFiat?"fiat":"icon",name:o.shortName,size:"20"},null,8,["displayName","type","name"])])),_:1}),m(u,{textAlign:"left"},{default:g((()=>[y("span",null,h(o.computedHistoryText),1)])),_:1}),m(u,{textAlign:"left"},{default:g((()=>[y("span",null,h(o.netAmount),1)])),_:1}),m(u,{textAlign:"left"},{default:g((()=>[m(d,{status:a.data.status},null,8,["status"])])),_:1}),m(u,{class:"detail"},{default:g((()=>[m(p,{class:"detail-icon"})])),_:1})])),_:1},8,["index"])}],["__scopeId","data-v-6c057ad0"]]),CM={class:"deposit-and-withdraw-wrap"},LM={class:"filters-wrap"},EM={class:"filter-left"},IM={class:"filter-right"},kM=vr({__name:"BuySellCrypto",props:{dateRangeData:{type:Object,default:()=>({start:null,end:null})},setDateRangeData:{type:Function,required:!0},defaultRange:{type:Object,default:()=>({start:null,end:null})},category:{type:String,required:!0}},setup(e){const t=V(),{t:a}=I(),l=e,s=O(!1),{isFirstLoad:o,loadMore:u,pagination:c,setPaginationData:p,handlePageChange:v}=oO({isLoading:s}),g=O(l.dateRangeData),f=O(null),T=O(null),w=O(""),D=K({}),A=nn,b=sn,_=O(!1),S=O(!1);const{listData:C,downloadPathname:E,downloadQueryString:k,getDetailData:N}=u$({isLoading:s,isFirstLoad:o,loadMore:u,dateRangeData:R((()=>l.dateRangeData)),selectedDateRangeData:g,category:R((()=>l.category)),type:f,status:T,selectedCurrency:w,pagination:c,setPaginationData:p,isShowDetailLoading:_,detailData:D,handleShowDetailDialog:function(){S.value=!0}}),x=R((()=>ro($a.downloadSpotHistory,E,k.value))),W=R((()=>[{id:"date",lang:a("t.time"),textAlign:"left",sortable:!0},{id:"asset",lang:a("t.asset"),textAlign:"left",sortable:!0},{id:"type",lang:a("t.type"),textAlign:"left"},{id:"netAmount",lang:a("t.netAmount"),textAlign:"left"},{id:"status",lang:a("t.status"),textAlign:"left"},{id:"detail"}])),F=R((()=>en.BUY_SELL_CRYPTO.map((e=>H(e))))),B=R((()=>ln.BUY_SELL_CRYPTO.map((e=>H(e)))));function U(e){f.value=e}function M(e){T.value=e}function H(e){const t=e;let l=a(`t.${e.toLowerCase()}`);switch(e){case"EXPRESS_BUY":l=a("display.expressBuy");break;case"EXPRESS_SELL":l=a("display.expressSell")}return{name:l,value:t}}$((()=>l.dateRangeData),(e=>{g.value=e}),{deep:!0});const G=O(null),Y=O(null);function q(){!function(){const[e,t]=xe(on);l.setDateRangeData({start:e,end:t})}(),w.value="",G.value.reset(F.value[0].value),Y.value.reset(B.value[0].value)}function z(e){const{id:t,historyType:a}=e;N(t,a)}return(l,o)=>(n(),r("div",CM,[y("div",LM,[y("div",EM,[m(Ne,{ref:"walletDatePicker",dateRange:g.value,"onUpdate:dateRange":o[0]||(o[0]=e=>g.value=e),defaultRange:e.defaultRange,minDurationToNow:P(A),rangeLimitDuration:P(b)},null,8,["dateRange","defaultRange","minDurationToNow","rangeLimitDuration"]),m(AO,{selectedCurrency:w.value,"onUpdate:selectedCurrency":o[1]||(o[1]=e=>w.value=e)},null,8,["selectedCurrency"]),m(rn,{ref_key:"typeDropdown",ref:G,class:L(["dropdown",{selected:!!f.value}]),list:F.value,handleUpdate:U,defaultValue:P(t).query.type,placeholder:P(a)("t.type")},null,8,["class","list","defaultValue","placeholder"]),m(rn,{ref_key:"statusDropdown",ref:Y,class:L(["dropdown",{selected:!!T.value}]),list:B.value,handleUpdate:M,defaultValue:P(t).query.status,placeholder:P(a)("t.status")},null,8,["class","list","defaultValue","placeholder"]),y("span",{class:"reset",onClick:q},h(P(a)("t.resetFilters")),1)]),y("div",IM,[m(Ds,{class:"file-download",fileName:"buy-crypto",requestDownload:x.value,defaultRangeDate:g.value,hasPdf:""},null,8,["requestDownload","defaultRangeDate"])])]),m(We,{rowComponent:SM,headerTitlesData:W.value,listData:P(C),isLoading:s.value,handleRowClick:z},null,8,["headerTitlesData","listData","isLoading"]),s.value?d("",!0):(n(),i(P(As),{key:0,class:"pagination",layout:"prev, pager, next, jumper",total:P(c).totalRows,pageSize:P(c).pageSize,totalPages:P(c).totalPages,currentPage:P(c).currentPage,pagerCount:5,background:!1,onHandleCurrentChangeP:P(v)},null,8,["total","pageSize","totalPages","currentPage","onHandleCurrentChangeP"])),_.value?(n(),i(Cm,{key:1,isShow:_.value,"onUpdate:isShow":o[2]||(o[2]=e=>_.value=e)},null,8,["isShow"])):d("",!0),m(Ef,{isShow:S.value,"onUpdate:isShow":o[3]||(o[3]=e=>S.value=e),detailData:D.value},null,8,["isShow","detailData"])]))}},[["__scopeId","data-v-73098afe"]]),RM={name:"ExpressBuyTransactionHistoryRow",components:{IconChevronDown2:ca,BrandIcon:Pa,WalletHistoryStatus:Fe},props:{data:{type:Object,default:()=>({})},index:{type:Number,required:!0}},computed:{displayName(){return this.data.currencyData.displayName||this.data.currencyData.currency}
1,shortName(){return this.data.currencyData.shortName||this.data.currencyData.currency},dateObj(){return $e(this.data.date)},computedHistoryText(){switch(this.data.historyType){case"EXPRESS_BUY":return this.$t("display.expressBuy");case"EXPRESS_SELL":return this.$t("display.expressSell");default:return this.$t(`t.${this.data.historyType.toLowerCase()}`)}},netAmount(){const{amount:e,currencyData:t,status:a}=this.data;return a!==be.COMPLETED?"-":this.formatNumber(e,t)}},methods:{...XO}},NM={class:"time"};const xM=vr(RM,[["render",function(e,t,a,l,r,o){const u=s("Cell"),c=s("BrandIcon"),d=s("WalletHistoryStatus"),p=s("IconChevronDown2"),v=s("Row");return n(),i(v,{class:"transaction-history-row",index:a.index,disableBackground:!0,disableCssHoverEffect:!1},{default:g((()=>[m(u,{textAlign:"left"},{default:g((()=>[y("span",null,h(o.dateObj.date),1),y("span",NM,h(o.dateObj.time),1)])),_:1}),m(u,{textAlign:"left"},{default:g((()=>[m(c,{displayName:o.displayName,shortName:!0,type:a.data.currencyData.isFiat?"fiat":"icon",name:o.shortName,size:"20"},null,8,["displayName","type","name"])])),_:1}),m(u,{textAlign:"left"},{default:g((()=>[y("span",null,h(o.computedHistoryText),1)])),_:1}),m(u,{textAlign:"left"},{default:g((()=>[y("span",null,h(o.netAmount),1)])),_:1}),m(u,{textAlign:"left"},{default:g((()=>[m(d,{status:a.data.status},null,8,["status"])])),_:1}),m(u,{class:"detail"},{default:g((()=>[m(p,{class:"detail-icon"})])),_:1})])),_:1},8,["index"])}],["__scopeId","data-v-3c0e6c05"]]),PM={class:"deposit-and-withdraw-wrap"},OM={class:"filters-wrap"},$M={class:"filter-left"},WM=vr({__name:"ExpressBuy",props:{dateRangeData:{type:Object,default:()=>({start:null,end:null})},setDateRangeData:{type:Function,required:!0},defaultRange:{type:Object,default:()=>({start:null,end:null})},category:{type:String,required:!0}},setup(e){const t=V(),{t:a}=I(),l=e,s=O(!1),{isFirstLoad:o,loadMore:u,pagination:c,setPaginationData:p,handlePageChange:v}=oO({isLoading:s}),g=O(l.dateRangeData),f=O(null),T=O(null),w=O(""),D=K({}),A=nn,b=sn,_=O(!1),S=O(!1);const{listData:C,onramperDownloadQueryString:E,getDetailData:k}=u$({isLoading:s,isFirstLoad:o,loadMore:u,dateRangeData:R((()=>l.dateRangeData)),selectedDateRangeData:g,category:R((()=>l.category)),type:f,status:T,selectedCurrency:w,pagination:c,setPaginationData:p,isShowDetailLoading:_,detailData:D,handleShowDetailDialog:function(){S.value=!0}}),N=R((()=>[{id:"date",lang:a("t.time"),textAlign:"left",sortable:!0},{id:"asset",lang:a("t.asset"),textAlign:"left",sortable:!0},{id:"type",lang:a("t.type"),textAlign:"left"},{id:"netAmount",lang:a("t.netAmount"),textAlign:"left"},{id:"status",lang:a("t.status"),textAlign:"left"},{id:"detail"}])),x=R((()=>en.EXPRESS_BUY_SELL.map((e=>U(e))))),W=R((()=>ln.EXPRESS_BUY_SELL.map((e=>U(e)))));function F(e){f.value=e}function B(e){T.value=e}function U(e){let t=a(`t.${e.toLowerCase()}`);switch(e){case"EXPRESS_BUY":t=a("display.expressBuy");break;case"EXPRESS_SELL":t=a("display.expressSell")}return{name:t,value:e}}$((()=>l.dateRangeData),(e=>{g.value=e}),{deep:!0});const M=O(null),H=O(null);function G(){!function(){const[e,t]=xe(on);l.setDateRangeData({start:e,end:t})}(),w.value="",M.value.reset(x.value[0].value),H.value.reset(W.value[0].value)}function Y(e){const{id:t,historyType:a}=e;k(t,a,l.category)}const q=R((()=>ro($a.downloadSpotHistory,"/report/histories/transaction/providers/ONRAMPER",E.value.replaceAll("ALL",""))));return(l,o)=>(n(),r("div",PM,[y("div",OM,[y("div",$M,[m(Ne,{ref:"walletDatePicker",dateRange:g.value,"onUpdate:dateRange":o[0]||(o[0]=e=>g.value=e),defaultRange:e.defaultRange,minDurationToNow:P(A),rangeLimitDuration:P(b)},null,8,["dateRange","defaultRange","minDurationToNow","rangeLimitDuration"]),m(AO,{selectedCurrency:w.value,"onUpdate:selectedCurrency":o[1]||(o[1]=e=>w.value=e),class:"currency-dropdown"},null,8,["selectedCurrency"]),m(rn,{ref_key:"typeDropdown",ref:M,class:L(["dropdown",{selected:!!f.value}]),list:x.value,handleUpdate:F,defaultValue:P(t).query.type,placeholder:P(a)("t.type")},null,8,["class","list","defaultValue","placeholder"]),m(rn,{ref_key:"statusDropdown",ref:H,class:L(["dropdown",{selected:!!T.value}]),list:W.value,handleUpdate:B,defaultValue:P(t).query.status,placeholder:P(a)("t.status")},null,8,["class","list","defaultValue","placeholder"]),y("span",{class:"reset",onClick:G},h(P(a)("t.resetFilters")),1)]),m(Ds,{class:"filter-right",requestDownload:q.value,defaultRangeDate:g.value},null,8,["requestDownload","defaultRangeDate"])]),m(We,{rowComponent:xM,headerTitlesData:N.value,listData:P(C),isLoading:s.value,handleRowClick:Y},null,8,["headerTitlesData","listData","isLoading"]),s.value?d("",!0):(n(),i(P(As),{key:0,class:"pagination",layout:"prev, pager, next, jumper",total:P(c).totalRows,pageSize:P(c).pageSize,totalPages:P(c).totalPages,currentPage:P(c).currentPage,pagerCount:5,background:!1,onHandleCurrentChangeP:P(v)},null,8,["total","pageSize","totalPages","currentPage","onHandleCurrentChangeP"])),_.value?(n(),i(Cm,{key:1,isShow:_.value,"onUpdate:isShow":o[2]||(o[2]=e=>_.value=e)},null,8,["isShow"])):d("",!0),m(Ef,{isShow:S.value,"onUpdate:isShow":o[3]||(o[3]=e=>S.value=e),detailData:D.value},null,8,["isShow","detailData"])]))}},[["__scopeId","data-v-2f7c8f6f"]]),FM={class:"wallet-transaction-history"},BM={class:"title"},UM={class:"type-switcher"},MM={class:"main-content"},VM=vr({__name:"WalletTransactionHistory",setup(e){const t=U(),a=V(),l=M(),s=o$(),{switcherList:o}=W$(),u=O(Nl.compact),c=O(0),d=R((()=>{var e;return(null==(e=a.params)?void 0:e.category)||an.DEPOSIT_WITHDRAW})),[p,v]=xe(on),g={start:p,end:v},T=O({...g}),w=O(!0),D=R((()=>t.state.lang)),b=R((()=>
1{if(w.value)return null;switch(d.value){case an.DEPOSIT_WITHDRAW:return VO;case an.SEND_RECEIVE:return qU;case an.TRANSFER:return sM;case an.INTEREST:return yM;case an.REFERRAL_BONUS:return AM;case an.BUY_SELL_CRYPTO:return kM;case an.EXPRESS_BUY_SELL:return WM;default:return VO}}));function _(e){T.value=e||g}function S(e){c.value!==e&&(c.value=e,l.replace({params:{lang:D.value,category:o.value[e].name}}))}return j((async()=>{!async function(){w.value=!0,await s.fetchInit(),w.value=!1}()})),$(o,(()=>{!function(){const e=o.value.findIndex((e=>e.name===d.value));-1===e?(c.value=0,l.replace({params:{lang:D.value,category:an.DEPOSIT_WITHDRAW}})):c.value=e}()}),{immediate:!0}),(e,t)=>{const a=C("loading");return n(),r("div",FM,[y("h2",BM,h(e.$t("wallets.transaction.history")),1),y("div",UM,[m(P(Pl),{ref:"typeSwitcher",class:"switcher",barHeight:4,type:P(xl).BOTTOM_BAR_NARROW,theme:u.value,itemList:P(o).map((e=>e.title)),selected:c.value,onSelect:S},null,8,["type","theme","itemList","selected"])]),f((n(),r("div",MM,[(n(),i(A(b.value),{dateRangeData:T.value,"onUpdate:dateRangeData":t[0]||(t[0]=e=>T.value=e),class:"content-wrap",category:d.value,defaultRange:g,setDateRangeData:_},null,40,["dateRangeData","category"]))])),[[a,w.value]])])}}},[["__scopeId","data-v-5b20f1d5"]]),HM={class:"container"},GM=vr({__name:"WalletMain",setup(e){const t=pt(),a=dt(),l=ct(),s=ut(),o=ot(),u=rt(),c=V(),p=R((()=>"walletFutures"===c.name)),h=R((()=>c.name===Ke.WALLET_OVERVIEW)),v=R((()=>function(e){switch(e){case Ke.WALLET_AUTO_TRADER:case Ke.WALLET_AUTO_TRADER_PNL_ANALYSIS:case Ke.WALLET_AUTO_TRADER_HISTORY:return!t.isEnableAutoTraderWallet;case Ke.WALLET_LEAD_TRADING:case Ke.WALLET_LEAD_TRADING_PNL_ANALYSIS:case Ke.WALLET_LEAD_TRADING_HISTORY:return!a.isEnableLeadTradingWallet;case Ke.WALLET_COPY_TRADING:case Ke.WALLET_COPY_TRADING_PNL_ANALYSIS:case Ke.WALLET_COPY_TRADING_HISTORY:return!l.isEnableCopyTradingWallet;case Ke.WALLET_AI_LEAD_TRADING:case Ke.WALLET_AI_LEAD_TRADING_PNL_ANALYSIS:case Ke.WALLET_AI_LEAD_TRADING_HISTORY:return!s.isEnableAiLeadTradingWallet;case Ke.WALLET_AI_COPY_TRADING:case Ke.WALLET_AI_COPY_TRADING_PNL_ANALYSIS:case Ke.WALLET_AI_COPY_TRADING_HISTORY:return!o.isEnableAiCopyTradingWallet;case Ke.WALLET_FUTURES_BOTS:case Ke.WALLET_FUTURES_BOTS_PNL_ANALYSIS:case Ke.WALLET_FUTURES_BOTS_HISTORY:return!u.isEnableFuturesBotsWallet;default:return!1}}(c.name)?null:function(e){switch(e){case Ke.WALLET_OVERVIEW:return WU;case"walletSpot":return Bv;case Ke.WALLET_SPOT_HISTORY:return eT;case"walletFutures":return zw;case Ke.FUTURES_WALLET_DETAIL:return JD;case Ke.WALLET_AUTO_TRADER:return WA;case Ke.WALLET_AUTO_TRADER_HISTORY:return Wb;case Ke.WALLET_LEAD_TRADING:case Ke.WALLET_COPY_TRADING:return U_;case Ke.WALLET_LEAD_TRADING_HISTORY:case Ke.WALLET_COPY_TRADING_HISTORY:case Ke.WALLET_AI_LEAD_TRADING_HISTORY:case Ke.WALLET_AI_COPY_TRADING_HISTORY:return eS;case Ke.WALLET_AI_LEAD_TRADING:case Ke.WALLET_AI_COPY_TRADING:return jS;case Ke.WALLET_FUTURES_BOTS:return WC;case Ke.WALLET_FUTURES_BOTS_HISTORY:return ZC;case Ke.WALLET_SPOT_PNL_ANALYSIS:case Ke.WALLET_FUTURES_PNL_ANALYSIS:case Ke.WALLET_AUTO_TRADER_PNL_ANALYSIS:case Ke.WALLET_LEAD_TRADING_PNL_ANALYSIS:case Ke.WALLET_COPY_TRADING_PNL_ANALYSIS:case Ke.WALLET_AI_LEAD_TRADING_PNL_ANALYSIS:case Ke.WALLET_AI_COPY_TRADING_PNL_ANALYSIS:case Ke.WALLET_FUTURES_BOTS_PNL_ANALYSIS:case Ke.WALLET_EARN_REWARD_ANALYSIS:return wI;case"walletEarn":return Qx;case"historyEarn":return rO;case Ke.WALLET_TRANSACTION_HISTORY:return VM;case Ke.ACCOUNT_STATEMENT:return _B;case Ke.VESTING:return mU;default:return null}}(c.name)));return(e,t)=>(n(),r("div",HM,[h.value?(n(),i(Ba,{key:0})):d("",!0),y("div",{class:L(["main",{"default-justify-content":p.value}])},[(n(),i(A(v.value)))],2)]))}},[["__scopeId","data-v-c9784395"]]),YM=vr({__name:"Wallet",setup(e){const t=R((()=>Bt.visible.nav));return(e,a)=>(n(),r("div",{class:L(["wallet",{"is-not-desktop":e.isNotDesktop}])},[t.value?(n(),i(Ro,{key:0,switcherStickyEffect:!1})):d("",!0),m(GM,{class:"wallet-main"})],2))}},[["__scopeId","data-v-323c563b"]]),{enableWalletOverview:qM}=Ge,zM={name:"WhichWallet",components:{CommonDialogGroup:Be,DesktopWallet:YM,MobileWallet:wU},provide(){const e={};return Object.defineProperty(e,"info",{enumerable:!0,get:()=>({spotTotalBalanceInDisplayCurrency:this.spotTotalBalanceInDisplayCurrency,futuresTotalBalanceInDisplayCurrency:this.futuresTotalBalanceInDisplayCurrency})}),{priceInfoByWhichWallet:e}},computed:{...l({lang:"lang",isLogin:"loginState",isAccountInfoLoaded:"isAccountInfoLoaded",hideWalletPriceValue:"hideWalletPriceValue"}),...a(pt,["isEnableAutoTraderWallet"]),...a(dt,["isEnableLeadTradingWallet"]),...a(ct,["isEnableCopyTradingWallet"]),...a(ut,["isEnableAiLeadTradingWallet"]),...a(ot,["isEnableAiCopyTradingWallet"]),...a(rt,["isEnableFuturesBotsWallet"]),...a(ze,["isDisplayCurrencyReady"]),...t({getAccountValue:"getAccountValue",getFuturesBalance:"futuresBalance"}),spotTotalBalanceInDisplayCurrency(){return this.getAccountValue("totalInDisplayCurrency")},futuresTotalBalanceInDisplayCurrency(){return this.getFuturesBalance("totalInDisplayCurrency")}},watch:{isAccountInfoLoaded(e){e&&this.checkFeatureUnavailable(this.$route.name)}},created(){var e;!qM&&this.fetchEarnWallet(!0),(null==(e=this.$route.query)?void 0:e.code)&&(Oa.confirmWithdraw(this.$route.query.code),this.$router.replace({query:{}}))},beforeUnmount(){!qM&&this.removeEarnWalletTimer()},methods:{...u(["setWalletAction"]),...e(nt,{fetchEarnWallet:"update",removeEarnWalletTimer:"removeTimer"}),redirectToWalletDefaultRoute(){this.$router.replace({name:Ke.WALLETS,params:{lang:this.lang}})},checkFeatureUnavailable(e){switch(e){case Ke.WALLET_AUTO_TRADER:case Ke.WALLET_AUTO_TRADER_PNL_ANALYSIS:case Ke.WALLET_AUTO_TRADER_HISTORY:return!this.isEnableAutoTraderWallet&&this.redirectToWalletDefaultRoute();case Ke.WALLET_LEAD_TRADING:case Ke.WALLET_LEAD_TRADING_PNL_ANALYSIS:case Ke.WALLET_LEAD_TRADING_HISTORY:return!this.isEnableLeadTradingWallet&&this.redirectToWalletDefaultRoute();case Ke.WALLET_COPY_TRADING:case Ke.WALLET_COPY_TRADING_PNL_ANALYSIS:case Ke.WALLET_COPY_TRADING_HISTORY:return!this.isEnableCopyTradingWallet&&this.redirectToWalletDefaultRoute();case Ke.WALLET_AI_LEAD_TRADING:case Ke.WALLET_AI_LEAD_TRADING_PNL_ANALYSIS:case Ke.WALLET_AI_LEAD_TRADING_HISTORY:return!this.isEnableAiLeadTradingWallet&&this.redirectToWalletDefaultRoute();case Ke.WALLET_AI_COPY_TRADING:case Ke.WALLET_AI_COPY_TRADING_PNL_ANALYSIS:case Ke.WALLET_AI_COPY_TRADING_HISTORY:return!this.isEnableAiCopyTradingWallet&&this.redirectToWalletDefaultRoute();case Ke.WALLET_FUTURES_BOTS:case Ke.WALLET_FUTURES_BOTS_PNL_ANALYSIS:case Ke.WALLET_FUTURES_BOTS_HISTORY:return!this.isEnableFuturesBotsWallet&&this.redirectToWalletDefaultRoute()}}}},KM={key:0};const jM=vr(zM,[["render",function(e,t,a,l,o,u){const c=s("DesktopWallet"),p=s("MobileWallet"),y=s("CommonDialogGroup");return e.isDisplayCurrencyReady?(n(),r("div",KM,[m(y,null,{default:g((()=>[e.$isLargeSize(e.$mq)?(n(),i(c,{key:0})):(n(),i(p,ge(b({key:1},e.$props)),null,16))])),_:1})])):d("",!0)}]]),XM=Object.freeze(Object.defineProperty({__proto__:null,default:jM},Symbol.toStringTag,{value:"Module"})),QM=E({__name:"IconHot",setup:e=>(e,t)=>
1(n(),i(Tt,{width:"12",height:"16",viewBox:"0 0 12 16"},{default:g((()=>t[0]||(t[0]=[y("path",{d:"M5.58092 16C4.46252 15.9999 3.36995 15.6638 2.44485 15.0353C1.51975 14.4068 0.80481 13.5149 0.392713 12.4752C-0.0193843 11.4355 -0.109626 10.2959 0.133689 9.20434C0.377003 8.11273 0.942651 7.11939 1.75729 6.35312C2.75599 5.41321 5.20883 3.72093 4.83673 0C9.30185 2.97674 11.5344 5.95349 7.06929 10.4186C7.81348 10.4186 8.92976 10.4186 10.7902 8.58047C10.9912 9.15572 11.1623 9.77414 11.1623 10.4186C11.1623 11.8989 10.5743 13.3185 9.52756 14.3652C8.48085 15.412 7.0612 16 5.58092 16Z"},null,-1)]))),_:1,__:[0]}))}),ZM={class:"earn-top-section"},JM={class:"section-content"},eV={class:"earn-page-title"},tV={class:"earn-page-subtitle"},aV={class:"action-button-wrap"},lV={class:"earn-summary"},sV={class:"total-subscribed"},iV={class:"summary-info"},nV={class:"summary-info-label"},rV={class:"summary-info-value"},oV={class:"summary-info-currency"},uV={class:"profit-summary"},cV={class:"summary-info"},dV={class:"summary-info-label"},pV={class:"summary-info-currency"},yV={class:"summary-info"},hV={class:"summary-info-label"},vV={class:"summary-info-currency"},mV=vr(E({__name:"EarnTopSection",setup(e){const{enableAutoEarn:t}=Ge,a=U(),l=Ut(),o=nt(),u=ra(),{isUserEarnAllow:c}=Nt(),f=O(!1),T=O(!1),w=R((()=>a.state.hideWalletPriceValue)),D=R((()=>l.lang)),A=R((()=>l.loginState)),b=R((()=>l.accountCurrency)),_=R((()=>{const[e,t]=ua({rangeSize:1,nowDateOffset:-1});return{fromTimestamp:e.getTime(),toTimestamp:t.getTime()}})),S=R((()=>!A.value||w.value?"*****":Xt(o.totalBalanceInAccountCurrency,2))),C=R((()=>{const{fromTimestamp:e,toTimestamp:t}=_.value,{map:a,timestampList:l}=u.pnlData.earn,s=l.findIndex((t=>e<=t)),i=oa(l,(e=>e<=t))+1,n=l.slice(s,i);return 0===n.length?"0":n.reduce(((e,t)=>e.plus(a[t].value)),N(0)).toFixed()})),E=R((()=>k(C.value))),I=R((()=>k(o.totalInterestInAccountCurrency)));function k(e){if(!A.value||w.value)return"****";const t=N(e).gte(1e7);return Xt(e,{prefix:N(e).isZero()?"":"+",formatKey:t?"max3":2,compact:t})}function x(){a.commit("setWalletHidePriceValue",!w.value)}function W(){a.getters.isEnabledAutoEarn?T.value=!0:f.value=!0}return $((()=>a.state.accountInfo.uid),(e=>{e&&u.fetchPnlTrendData({type:"earn",..._.value})}),{immediate:!0}),(e,a)=>{const l=s("BaseButton"),u=s("RouterLink");return n(),r(p,null,[y("div",ZM,[y("div",JM,[y("div",null,[y("h1",eV,h(e.$t("earn.title.v2")),1),y("h3",tV,h(e.$t("earn.subtitle.v2")),1),y("div",aV,[m(l,{as:"RouterLink",class:"action-btn primary",size:P(qs).L,to:"#ourProducts"},{default:g((()=>[v(h(e.$t("earn.exploreAllProducts")),1)])),_:1},8,["size"]),P(t)&&A.value?(n(),i(l,{key:0,class:"action-btn primary",size:P(qs).L,disabled:!P(c),onClick:W},{default:g((()=>[v(h(e.$t("earn.autoEarn.autoEarnNow")),1)])),_:1},8,["size","disabled"])):d("",!0)])]),y("div",lV,[y("div",sV,[y("div",iV,[y("div",nV,[v(h(e.$t("wallets.earn.totalSubscribed"))+" ",1),A.value?(n(),r(p,{key:0},[w.value?(n(),i(zn,{key:0,class:"icon-eye no-select",onClick:x})):(n(),i(Kn,{key:1,class:"icon-eye no-select",onClick:x}))],64)):d("",!0)]),y("div",rV,[v(h(S.value)+" ",1),y("span",oV,h(b.value),1)])]),m(u,{class:"action-link",to:{name:"walletEarn",params:{lang:D.value}}},{default:g((()=>[v(h(A.value?e.$t("earn.earnWallet"):e.$t("earn.loginToViewEarnings"))+" ",1),m(ht,{width:"16",height:"16"})])),_:1},8,["to"])]),y("div",uV,[y("div",cV,[y("div",dV,h(e.$t("earn.yesterdayProfit")),1),y("div",{class:L(["summary-info-value",{"has-value":!A.value||P(N)(C.value).gt(0)}])},[v(h(E.value)+" ",1),y("span",pV,h(b.value),1)],2)]),y("div",yV,[y("div",hV,h(e.$t("t.totalProfit")),1),y("div",{class:L(["summary-info-value",{"has-value":!A.value||P(N)(P(o).totalInterestInAccountCurrency).gt(0)}])},[v(h(I.value)+" ",1),y("span",vV,h(b.value),1)],2)])])])])]),f.value?(n(),i(Bp,{key:0,onHandleOnClose:a[0]||(a[0]=e=>f.value=!1)})):T.value?(n(),i(oy,{key:1,onHandleOnClose:a[1]||(a[1]=e=>T.value=!1)})):d("",!0)],64)}}}),[["__scopeId","data-v-3e8d0852"]]);function gV(e,t){const a=V(),l=Ut(),{loginState:s,isAccountInfoLoaded:i,isSubAccount:n}=S(l),{isUserEarnAllow:r}=Nt(),o=R((()=>{var t;return(null==(t=ne(e))?void 0:t.type)===xi.LENDING})),u=R((()=>{var t;return(null==(t=ne(e))?void 0:t.category)===Ri.FUNDS})),c=R((()=>{var e;return!r.value||!ne(t)&&Boolean(null==(e=p.value)?void 0:e.isJoined)})),d=R((()=>jn[a.query.utm_campaign])),p=R((()=>{var t,a;return d.value&&s.value&&i.value&&!n.value?null==(a=null==(t=ne(e))?void 0:t.event)?void 0:a.find((({activityId:e})=>e===d.value)):void 0})),y=R((()=>
1{if(!p.value)return;const e=new Set,{days:t,rates:a}=p.value,l={days:[],rates:[]};return t.forEach(((t,s)=>{const i=`${t}-${a[s]}`;e.has(i)||(e.add(i),l.days.push(t),l.rates.push(a[s]))})),l})),h=R((()=>{const a=ne(e),l=ne(t);if(!a)return[];if(l)return l.rates;if(y.value)return y.value.rates;const{rate:s,rates:i}=a;return i||[s]})),v=R((()=>{var a;const l=ne(t);if(l)return l.days;if(y.value)return y.value.days;const s=null==(a=ne(e))?void 0:a.days;return o.value&&s?s.length>1?s:[]:s||[]})),m=R((()=>{const e=ne(t);if(e){const t=h.value.findIndex((t=>t===e.targetRate));return t>=0?t:0}return y.value?h.value.findIndex((e=>e===p.value.targetRate)):h.value.reduce(((e,t,a)=>0===a?0:t>=h.value[e]?a:e),0)??0}));return{isFundsCategory:u,isNotInvestable:c,campaignActivityId:d,event:p,rateList:h,durationList:v,maxRateIndex:m,generateEarnTransferPayload:function(t){const a=t??m.value,l=ne(e),s=v.value.length>0?h.value:[],i=Boolean(p.value&&!p.value.isJoined);return{...l,optionDurationList:v.value,rates:s,rate:h.value[a],insertRate:h.value[a],isTriggerEventImmediate:i,isShowEventUnlockDialog:void 0===t,categoryType:Xn[l.category]}}}}const fV={class:"earn-product-card"},TV={class:"card-body"},wV={class:"section"},DV={class:"asset-label"},AV={class:"category-label"},bV={class:"rate-block"},_V={class:"rate-value"},SV={class:"rate-label"},CV={class:"apr-tooltip-content"},LV={class:"duration-block no-select"},EV={class:"duration-option-list"},IV=["onClick"],kV={class:"duration-label"},RV={key:1,class:"no-minimum-duration-label"},NV={class:"section"},xV={key:0,class:"curator"},PV=["src"],OV=["href"],$V=vr(E({__name:"EarnProductCard",props:{product:{},campaign:{}},emits:["selected"],setup(e,{emit:t}){const a=e,l=t,o=M(),u=V(),{t:c}=I(),f=Ut(),{lang:T,loginState:w}=S(f),{showIdVerificationRequiredDialog:D}=Vr(),{isFundsCategory:A,isNotInvestable:b,event:_,rateList:C,durationList:E,maxRateIndex:k,generateEarnTransferPayload:N}=gV(re(a,"product"),re(a,"campaign")),W=G("eventIconRef"),F=O(k.value),B=R((()=>{const{rates:e,rate:t}=a.product,l=[...e??[]];return t>0&&l.push(t),l.length?Math.min(...l):0})),U=R((()=>{var e;return(null==(e=a.campaign)?void 0:e.campaignLabel)&&C.value[F.value]>B.value})),H=R((()=>{var e;return(null==(e=a.campaign)?void 0:e.campaignLabel)===Fi.VIP_EXCLUSIVE?"vip-exclusive":"standard"})),Y=R((()=>HI(c,a.product.category,!0))),q=R((()=>{switch(a.product.category){case Ri.FLEXIBLE:return c("earn.yesterdayApy");case Ri.STAKING:return c("earn.estimateApy");default:return c("t.annualPercentageRate")}})),z=R((()=>{switch(a.product.category){case Ri.STAKING:return c("earn.stake");case Ri.LENDING:return c("earn.lend");default:return c("earn.button")}}));function K(){w.value?D(Wt.EARN.EARN)||l("selected",{...N(F.value),campaign:a.campaign??null}):o.push({name:Ke.LOGIN,params:{lang:T.value},query:{redirect:u.fullPath}})}return $((()=>{var e;return _.value&&(null==(e=W.value)?void 0:e[0])}),(()=>{var e;(null==(e=W.value)?void 0:e[0])&&To.loadAnimation({container:W.value[0],renderer:"svg",path:"/static/lottie/diamond_small.json"})}),{once:!0}),(e,t)=>{var a,l;const o=s("Tooltip"),u=s("BaseButton");return n(),r("div",fV,[(null==(a=e.campaign)?void 0:a.campaignLabel)?(n(),r("div",{key:0,class:L(["campaign-label",H.value])},h(e.$t(`earn.campaignLabel.${e.campaign.campaignLabel}`)),3)):d("",!0),y("div",TV,[y("div",wV,[y("div",DV,[m(Pa,{name:e.product.currency,size:"36",showName:!1},null,8,["name"]),v(" "+h(e.product.currency),1)]),y("div",AV,h(Y.value),1)]),y("div",bV,[y("div",_V,[v(h(P(UI)(P(C)[F.value]))+" ",1),t[0]||(t[0]=y("span",{class:"percent"},"%",-1))]),y("div",SV,[v(h(q.value)+" ",1),U.value?(n(),i(o,{key:0,placement:"top"},{content:g((()=>[m(Qn,{class:"icon-info"})])),tooltip:g((()=>[y("div",CV,[y("div",null,h(e.$t("tradingEvent.chooseEarn.earnCard.tooltip.campaignApr",{percentage:P(UI)(P(C)[F.value])})),1),y("div",null,h(e.$t("tradingEvent.chooseEarn.earnCard.tooltip.regularApr",{percentage:P(UI)(B.value)})),1)])])),_:1})):d("",!0)])]),y("div",LV,[P(E).length>0?(n(),r(p,{key:0},[y("div",EV,[(n(!0),r(p,null,x(P(E),((e,t)=>(n(),r("div",{key:e,class:L(["duration-option",{selected:F.value===t}]),onClick:e=>F.value=t},[P(_)&&P(_).targetDay===e?(n(),r("div",{key:0,ref_for:!0,ref_key:"eventIconRef",ref:W,class:"event-icon"},null,512)):d("",!0),v(" "+h(e),1)],10,IV)))),128))]),y("div",kV,h(e.$t("earn.transferDialog.duration")),1)],64)):e.product.category===P(Ri).FLEXIBLE?(n(),r("div",RV,h(e.$t("t.noMinimumDuration")),1)):d("",!0)]),y("div",NV,[m(u,{class:"action-btn primary",size:P(qs).M,disabled:P(b),onClick:K},{default:g((()=>[v(h(z.value),1)])),_:1},8,["size","disabled"]),P(A)?(n(),r("div",xV,[v(h(e.$t("t.managedBy"))+" ",1),y("img",{src:P(MI)(e.product.iconName),class:"curator-logo"},null,8,PV)])):d("",!0),(null==(l=e.campaign)?void 0:l.campaignLink)?(n(),r("a",{key:1,href:e.campaign.campaignLink,target:"_blank",rel:"noopener noreferrer",class:"campaign-link"},h(e.$t("t.viewCampaignRules")),9,OV)):d("",!0)])])])}}}),[["__scopeId","data-v-ec998ee8"]]),WV={class:"trending-list"},FV={key:0,class:"pagination-container no-select"},BV=["onClick"],UV=vr(E({__name:"EarnRecommendList",props:{productList:{}},emits:["selected"],setup(e,{emit:t}
1){const a=e,l=t,s=ka(),o=G("containerRef"),u=O(1),c=O(0),h=O(0),v=R((()=>!s.isDesktop));function g(){const e=o.value;if(e&&e.scrollWidth>e.clientWidth){const t=(e.scrollWidth-16*(a.productList.length-1))/a.productList.length+16;h.value=Math.max(Math.floor(e.clientWidth/t)*t,t),c.value=Math.ceil(e.scrollWidth/h.value),T(1)}}function f(e){l("selected",e)}function T(e){const t=o.value;t&&u.value!==e&&(u.value=e,t.scrollTo({left:h.value*(e-1),behavior:"smooth"}))}let w=0,D=!1;function A(e){if(v.value)return;const t=e.changedTouches&&e.changedTouches[0];t&&(w=t.clientX,D=!0)}function b(e){if(!D||v.value)return;const t=e.changedTouches&&e.changedTouches[0];if(!t)return void(D=!1);const a=t.clientX-w;D=!1,a<=-30&&u.value<c.value?T(u.value+1):a>=30&&u.value>1&&T(u.value-1)}function _(){if(v.value&&o.value){const e=o.value,t=e.scrollWidth-e.clientWidth;t>0&&e.scrollLeft>=t-1?u.value=c.value:u.value=Math.round(e.scrollLeft/h.value)+1}}$((()=>a.productList.length),(async()=>{await H(),g()}));let S=null;return Y((()=>{H((()=>g())),o.value&&(S=new ResizeObserver((()=>g())),S.observe(o.value))})),q((()=>{S&&o.value&&S.unobserve(o.value),S=null})),(e,t)=>(n(),r(p,null,[y("div",{class:L(["shadow-container",{"no-before-shadow":c.value!==u.value,"no-after-shadow":c.value===u.value}])},[y("div",{ref_key:"containerRef",ref:o,class:L(["trending-list-container",{scrollable:!e.isDesktop}]),onTouchstart:A,onTouchend:b,onScroll:_},[y("div",WV,[(n(!0),r(p,null,x(e.productList,(({product:e,campaign:t})=>(n(),i($V,{key:t?t.activityId:e.id,product:e,campaign:t,onSelected:f},null,8,["product","campaign"])))),128))])],34),v.value?d("",!0):(n(),r(p,{key:0},[u.value>1?(n(),r("div",{key:0,class:"page-switch-button prev no-select",onClick:t[0]||(t[0]=e=>T(u.value-1))},[m(Hi)])):d("",!0),u.value<c.value?(n(),r("div",{key:1,class:"page-switch-button
1no-select",onClick:t[1]||(t[1]=e=>T(u.value+1))},[m(Hi)])):d("",!0)],64))],2),c.value>0?(n(),r("div",FV,[(n(!0),r(p,null,x(c.value,(e=>(n(),r("div",{key:e,class:L(["indicator-dot",{active:e===u.value}]),onClick:t=>T(e)},null,10,BV)))),128))])):d("",!0)],64))}}),[["__scopeId","data-v-96a182da"]]),MV={class:"earn-filter-chip"};const VV={name:"EarnFilter",components:{IconChevronDown:Ka,IconSearch:Zn,BrandIcon:Pa,IconNotificationCheck:Za,IconClose:Ts,EarnFilterChip:vr({name:"EarnFilterChip",components:{IconClose:Ts},props:{name:{type:String,default:""}},emits:["click"],methods:{handleClick(e){this.$emit("click",e)}}},[["render",function(e,t,a,l,i,o){const u=s("IconClose");return n(),r("div",MV,[v(h(a.name)+" ",1),m(u,{class:"earn-filter-chip-close",onClick:t[0]||(t[0]=e=>o.handleClick(a.name))})])}],["__scopeId","data-v-e61b838c"]])},props:{initCryptoType:{type:String,default:""},currencyList:{type:Array,required:!0},filterCallback:{type:Function,required:!0},showDropdownIcon:{type:Boolean,default:!0}},data(){return{loading:!0,initCurrency:this.initCryptoType,selectDatas:[],isMenuShow:!1,searchText:""}},computed:{...l(["currencyMap"])},watch:{isMobile(e){Jn(this.isMenuShow&&e)},isMenuShow(e){e?this.bindEvent():this.removeEvent(),Jn(e&&this.isMobile)},currencyList(){if(this.loading=!1,this.initCurrency){const e=this.getCoinData(this.initCurrency);this.selectDatas.push(e),this.initCurrency=""}},initCryptoType(e){const t=this.currencyList.find((t=>t.name.toUpperCase()===e.toUpperCase()));this.selectDatas=t?[t]:[]}},created(){this.selectDatas=[]},methods:{e2eID:Xe,getCurrencyIconType({name:e}){return(this.currencyMap[e]||{}).isFiat?"fiat":"icon"},getFilterCoinData(){return this.currencyList.filter((e=>{const{name:t,full:a}=e;return t.toLowerCase().includes(this.searchText.toLowerCase())||a.toLowerCase().includes(this.searchText.toLowerCase())}))},selecotrOnClicked(){this.isMenuShow=!this.isMenuShow,this.searchFocus()},searchFocus(){this.$nextTick((()=>this.$refs.input.focus()))},getCoinData(e=""){return this.getFilterCoinData().find((t=>t.name.toUpperCase()===e.toUpperCase()))},handleKeydown(e){switch(e.key){case"Backspace":return void(!this.searchText&&this.selectDatas.length&&(this.selectDatas.pop(),this.searchFocus()));case"Enter":if(this.searchText){const e=this.getFilterCoinData(),t=1===e.length?e[0]:this.getCoinData(this.searchText);t&&(this.coinOnClicked(t),this.searchText="")}return;case"Escape":return void this.selecotrOnClicked()}},overflowingChipCount(){var e;if(!this.selectDatas||!this.selectDatas.length)return 0;let t=0;const a=this.$refs.chipWrap;if(a&&a.children.length){const l=[...a.children],s=null==(e=l[0])?void 0:e.getBoundingClientRect().top;l.forEach((e=>{e.getBoundingClientRect().top>s&&(t+=1)}))}return t},chipOnClicked(e){this.selectDatas=this.selectDatas.filter((t=>t.name!==e)),this.searchFocus(),this.filterCallback(this.selectDatas)},coinOnClicked(e){const t=this.selectDatas.findIndex((({name:t,full:a})=>e.name===t&&e.full===a));t>-1?this.selectDatas.splice(t,1):this.selectDatas.push(e),this.searchFocus(),this.filterCallback(this.selectDatas)},clearInputOnClicked(){this.searchText=""},clearAllOnClicked(){this.selectDatas=[],this.applyOnClicked()},applyOnClicked(){this.isMenuShow=!1,this.filterCallback(this.selectDatas)},onClickOutside(e){this.isMenuShow&&this.$refs.filterContainer&&!this.$refs.filterContainer.contains(e.target)&&this.selecotrOnClicked()},bindEvent(){document.addEventListener("click",this.onClickOutside,!0)},removeEvent(){document.removeEventListener("click",this.onClickOutside)},reset(){this.selectDatas=[],this.searchText="",this.filterCallback([])}}},HV={key:0,class:"filter-relative"},GV={class:"filter-no-touch-bg"},YV={ref:"filterContainer"},qV={class:"filter-selector-item"},zV={key:0,class:"filter-selector-name"},KV={ref:"chipWrap",class:"chip-wrap"},jV={key:1,class:"chip-more"},XV={key:3,class:"filter-selector-icon-chevron-down-wrap"},QV={class:"filter-menu-wrapper"},ZV={class:"filter-menu-close"},JV={class:"filter-menu-search-wrap"},eH={class:"filter-menu-search-input-wrap"}
1,tH={class:"filter-menu-list"},aH=["onClick"],lH={class:"filter-menu-list-button-name"},sH={class:"filter-menu-button-wrapper"};const iH=vr(VV,[["render",function(e,t,a,l,o,u){const c=s("IconSearch"),D=s("EarnFilterChip"),A=s("IconClose"),b=s("IconChevronDown"),_=s("BrandIcon"),S=s("IconNotificationCheck"),C=s("BrandButton");return o.loading?d("",!0):(n(),r("div",HV,[f(y("div",GV,null,512),[[T,o.isMenuShow]]),y("div",YV,[y("div",{class:"filter-selector-button-wrapper",onClick:t[0]||(t[0]=(...e)=>u.selecotrOnClicked&&u.selecotrOnClicked(...e))},[y("div",qV,[m(c,{class:"search-icon filter-selector-icon-filter",fill:"currentColor"})]),o.selectDatas.length?d("",!0):(n(),r("div",zV,h(e.$t("earn.filter.search")),1)),y("div",KV,[(n(!0),r(p,null,x(o.selectDatas,(e=>(n(),i(D,{key:e.name,class:"filter-chip",name:e.name,onClick:u.chipOnClicked},null,8,["name","onClick"])))),128))],512),u.overflowingChipCount()?(n(),r("p",jV,h(e.$t("earn.filter.more",{count:u.overflowingChipCount()})),1)):d("",!0),o.selectDatas.length?(n(),i(A,{key:2,class:"filter-menu-search-close-icon",onClick:w(u.reset,["stop"])},null,8,["onClick"])):a.showDropdownIcon?(n(),r("div",XV,[m(b,{class:"filter-selector-icon-chevron-down"})])):d("",!0)]),f(y("div",QV,[y("div",ZV,[m(A,{id:u.e2eID("btn_cross"),class:"filter-menu-close-icon"},null,8,["id"])]),y("div",JV,[m(c,{class:"search-icon filter-menu-search-icon",fill:"currentColor"}),y("div",eH,[(n(!0),r(p,null,x(o.selectDatas,(e=>(n(),i(D,{key:e.name,class:"filter-menu-search-chip",name:e.name,onClick:u.chipOnClicked},null,8,["name","onClick"])))),128)),f(y("input",{ref:"input","onUpdate:modelValue":t[1]||(t[1]=e=>o.searchText=e),class:"filter-menu-search",onKeydown:t[2]||(t[2]=(...e)=>u.handleKeydown&&u.handleKeydown(...e))},null,544),[[he,o.searchText,void 0,{trim:!0}]])]),e.isMobile||!o.searchText&&!o.selectDatas.length?d("",!0):(n(),i(A,{key:0,class:"filter-menu-search-close-icon",onClick:w(u.reset,["stop"])},null,8,["onClick"])),t[3]||(t[3]=y("div",{class:"pseudo-input"},null,-1))]),y("div",tH,[(n(!0),r(p,null,x(o.searchText?u.getFilterCoinData():a.currencyList,(e=>(n(),r("button",{key:e.name,class:L(["filter-menu-list-button",{active:~o.selectDatas.findIndex((t=>t.name===e.name))}]),onClick:t=>u.coinOnClicked(e)},[m(_,{class:"filter-menu-list-button-icon",type:u.getCurrencyIconType(e),showName:!1,name:e.name,size:"24"},null,8,["type","name"]),m(S,{class:"filter-menu-list-icon-check"}),y("span",lH,h(e.name),1)],10,aH)))),128))]),y("div",sH,[m(C,{class:"filter-menu-button-clear",type:"cancel",onClick:u.clearAllOnClicked},{default:g((()=>[v(h(e.$t("earn.filter.clearAll")),1)])),_:1},8,["onClick"]),m(C,{class:"filter-menu-button-apply",type:"primary",onClick:u.applyOnClicked},{default:g((()=>[v(h(e.$t("earn.filter.apply")),1)])),_:1},8,["onClick"])])],512),[[T,o.isMenuShow]])],512)]))}],["__scopeId","data-v-8c2d2b68"]]),nH={class:"earn-product-list-header"},rH={class:"sortable-label no-select"},oH={class:"sortable-label no-select rate-label"},uH={class:"earn-product-list"},cH=["onClick"],dH={class:"asset-info"},pH={class:"asset-label"},yH={key:0,class:"available-balance"},hH={key:0,class:"supported-categories"},vH={class:"rate-block"},mH={class:"rate-value"},gH=vr(E({__name:"EarnAssetProductList",props:{productMap:{},assetCategoryMap:{},assetList:{},categoryLabel:{},displayIndex:{},productIdCampaignsMap:{}},emits:["selected"],setup(e,{emit:t}){const a={rate:"desc",currency:"asc"},l=e,s=t,{t:o}=I(),u=U(),c=Ut(),f=ka(),{loginState:T,currencyMap:w}=S(c),D=O("default"),A=O(),b=O({}),_=R((()=>T.value&&!u.state.hideWalletPriceValue)),C=R((()=>Object.keys(l.assetCategoryMap).reduce(((e,t)=>{const a=new Set;return Object.values(l.assetCategoryMap[t]).forEach((e=>e.forEach((e=>{var t,s;const{rate:i,rates:n}=l.productMap[e];i>0&&a.add(i),n&&n.forEach((e=>a.add(e))),null==(s=null==(t=l.productIdCampaignsMap)?void 0:t[e])||s.forEach((e=>
1e.rates.forEach((e=>a.add(e)))))})))),e[t]=[...a].sort(((e,t)=>ri(e,t,!1))),e}),{}))),E=R((()=>"default"===D.value?l.assetList.slice(0,l.displayIndex):l.assetList.slice().sort(((e,t)=>{const a="asc"===A.value;switch(D.value){case"currency":return Gs(e,t,a);case"rate":return ri(C.value[e][0],C.value[t][0],a)}})).slice(0,l.displayIndex)));function k(e,t){if(e===D.value)return t?void(A.value=t):A.value!==a[e]?(D.value="default",void(A.value=void 0)):void(A.value="asc"===a[e]?"desc":"asc");D.value=e,A.value=t||a[e]}function $(e){const{isFiat:t,available:a}=w.value[e]||{},l=N(a??0),s={formatKey:t||f.isMobile?"fc":"max8",compact:f.isMobile&&l.gt(1e6)};return l.gt(0)?`${o("t.available")} ${Xt(l.toNumber(),s)}`:""}const W=R((()=>Object.fromEntries(l.assetList.map((e=>[e,l.categoryLabel.flatMap((({key:t})=>{var a;return((null==(a=l.assetCategoryMap[e])?void 0:a[t])??[]).flatMap((e=>{var t;const a=l.productMap[e];return a?[...((null==(t=l.productIdCampaignsMap)?void 0:t[e])??[]).map((e=>({key:e.activityId,product:a,campaign:e}))),...!1===a.display?[]:[{key:`base-${e}`,product:a}]]:[]}))}))])))));function F(e){s("selected",e)}return(e,t)=>(n(),r(p,null,[y("div",nH,[y("div",rH,[y("div",{class:"sortable-label-text",onClick:t[0]||(t[0]=e=>k("currency"))},h(e.$t("t.currency")),1),y("div",{class:L(["sortable-icon",{active:"currency"===D.value}])},[y("div",{class:L(["triangle",{active:"asc"===A.value}]),onClick:t[1]||(t[1]=e=>k("currency","asc"))},null,2),y("div",{class:L(["triangle down",{active:"desc"===A.value}]),onClick:t[2]||(t[2]=e=>k("currency","desc"))},null,2)],2)]),e.isMobile?d("",!0):(n(),r(p,{key:0},[v(h(e.$t("t.term")),1)],64)),y("div",oH,[y("div",{class:"sortable-label-text",onClick:t[3]||(t[3]=e=>k("rate"))},h(e.$t("history.earn.apyorapr").replace(/\s+/g,"")),1),y("div",{class:L(["sortable-icon",{active:"rate"===D.value}])},[y("div",{class:L(["triangle",{active:"asc"===A.value}]),onClick:t[4]||(t[4]=e=>k("rate","asc"))},null,2),y("div",{class:L(["triangle down",{active:"desc"===A.value}]),onClick:t[5]||(t[5]=e=>k("rate","desc"))},null,2)],2)])]),y("div",uH,[(n(!0),r(p,null,x(E.value,(t=>(n(),r("div",{key:t,class:L(["earn-asset-accordion",{"is-open":b.value[t]}])},[y("div",{class:"earn-asset-block no-select",onClick:e=>function(e){b.value[e]?delete b.value[e]:b.value[e]=!0}(t)},[y("div",dH,[y("div",pH,[m(Pa,{name:t,size:"24",showName:!1},null,8,["name"]),v(" "+h(t),1)]),_.value?(n(),r("div",yH,h($(t)),1)):d("",!0)]),e.isMobile?d("",!0):(n(),r("div",hH,[(n(!0),r(p,null,x(e.categoryLabel,(a=>(n(),r(p,null,[e.assetCategoryMap[t][a.key]?(n(),r("div",{key:a.key,class:"category-label"},h(a.label),1)):d("",!0)],64)))),256))])),y("div",vH,[y("div",null,[C.value[t].length>1?(n(),r(p,{key:0},[v(h(e.$t("t.upTo")),1)],64)):d("",!0),y("span",mH,h(P(UI)(C.value[t][0]))+"% ",1)]),m(Ka,{class:"icon-chevron",width:"16",height:"16"})])],8,cH),m(fe,{name:"card-slide",tag:"div",class:"asset-product-list"},{default:g((()=>[b.value[t]?(n(!0),r(p,{key:0},x(W.value[t],(e=>(n(),i($V,{key:e.key,product:e.product,campaign:e.campaign,onSelected:F},null,8,["product","campaign"])))),128)):d("",!0)])),_:2},1024)],2)))),128))])],64))}}),[["__scopeId","data-v-17257430"]]),fH={class:"earn-faq-block"},TH={class:"earn-faq-wrap"},wH={class:"earn-faq-title"},DH=["innerHTML"],AH=["href"],bH=vr(E({__name:"EarnFaqBlock",props:{useV2Style:{type:Boolean,default:!1},categoryList:{default:null}},setup(e){const{enableEarnFunds:t,hideEarnFaqIndexList:a=[]}=Ge,l={4:Ri.STAKING,5:Ri.FLEXIBLE,6:Ri.FIXED,8:Ri.LENDING,10:Ri.FUNDS},o=e,u=U(),c=R((()=>u.getters.isArabic)),f=R((()=>
1{if(null!==o.categoryList){const e=new Set(o.categoryList);return[1,2,3,4,5,6,7,8,10].filter((t=>void 0===l[t]||e.has(l[t])))}return Array.from({length:10}).reduce(((e,l,s)=>{const i=s+1;switch(!0){case 9===i:case!t&&10===i:case!u.state.isDefaultBrand&&a.includes(i):break;default:e.push(i)}return e}),[])})),T=R((()=>gt(u.state.lang,"EARN")));function w(){window.open(T.value)}return(e,t)=>{const a=s("i18n-t");return n(),r("div",fH,[y("div",TH,[y("div",wH,h(e.$t("earn.faq")),1),m(oo,{class:"faq-wrap",isShowLatest:"",list:f.value,isRTL:c.value},D({title:g((({item:t,index:a})=>[e.useV2Style?(n(),r(p,{key:0},[v(h(a+1)+".",1)],64)):d("",!0),v(" "+h(e.$t(`earn.faq.title.${t}`,{brandName:e.$t("brand.name")})),1)])),content:g((({item:t})=>[y("div",{class:"faq-content",innerHTML:e.$t(`earn.faq.content.${t}`,{brandName:e.$t("brand.name")})},null,8,DH)])),_:2},[!e.useV2Style&&T.value?{name:"more",fn:g((()=>[y("div",{class:"more",onClick:w},[v(h(e.$t("msg.learnMore"))+" ",1),m(ht,{class:"icon"})])])),key:"0"}:void 0]),1032,["list","isRTL"]),e.useV2Style&&T.value?(n(),i(a,{key:0,keypath:"t.learnMoreIn",class:"learn-more-link-block",tag:"div"},{link:g((()=>[y("a",{class:"learn-more-link",href:T.value,target:"_blank",rel:"noopener nofollow"},h(`${e.$t("brand.name")} ${e.$t("footer.supportCenter")}`),9,AH)])),_:1})):d("",!0)])])}}}),[["__scopeId","data-v-8eb3e3c2"]]),_H={name:"DurationWrap",props:{optionDurationList:{type:Array,default:()=>[]},rates:{type:Array,default:()=>[]},insertRate:{type:Number,default:0},activeEvent:{type:Boolean,default:!1},eventData:{type:Object,default:()=>({})},isSpecialCoin:{type:Boolean,default:!1}},emits:["update:selectDuration"],data:()=>({dayBtnSelect:0,eventCanvas:null,publicPath:"/"}),computed:{isVisible(){return this.activeEvent?this.optionDurationList.length>0&&this.rates.length>0:this.optionDurationList.length>0&&this.rates.length>0&&this.optionDurationList.length===this.rates.length},dayCssVars(){const e=this.optionDurationList.length;return this.isMobile?{"--grid-columns":e>6?"repeat(4, 1fr)":"repeat(3, 1fr)"}:{"--grid-columns":e<6?"repeat(auto-fill, minmax(80px, 1fr))":"repeat(6, 1fr)"}},eventRateIndex(){return this.rates.findIndex((e=>e===this.eventData.targetRate))}},watch:{insertRate(){this.setDefaultLayout()},activeEvent(e){!this.isSpecialCoin&&e&&this.$nextTick((()=>{this.initialEasterEgg()}))}},mounted(){this.setDefaultLayout()},methods:{selectOnclicked(e){return this.dayBtnSelect=e,this.$emit("update:selectDuration",{day:this.optionDurationList[e],rate:this.rates[e]})},setDefaultLayout(){if(this.insertRate){const e=this.rates.findIndex((e=>this.insertRate===e));this.selectOnclicked(e)}else this.selectOnclicked(0)},initialEasterEgg(){this.eventCanvas=To.loadAnimation({container:this.$refs.eventCanvas[0],renderer:"svg",autoplay:!0,path:`${this.publicPath}static/lottie/diamond_small.json`}),this.eventCanvas.onComplete=()=>{this.eventCanvas.play()}},isEventDay(e){return!this.isSpecialCoin&&(this.activeEvent&&e===this.eventRateIndex)}}},SH={key:0,class:"duration-wrap"},CH={class:"duration-text"},LH={class:"btn-content"};const EH=vr(_H,[["render",function(e,t,a,l,o,u){const c=s("BrandButton");return u.isVisible?(n(),r("div",SH,[y("p",CH,h(e.$t("earn.transferDialog.duration")),1),y("div",{class:"duration-days",style:_(u.dayCssVars)},[(n(!0),r(p,null,x(a.optionDurationList,((e,t)=>(n(),i(c,{key:`${e}-${t}`,class:"duration-day-btn",size:"normalFontBiggest",type:o.dayBtnSelect===t?"select":"noSelect",onClick:()=>{u.selectOnclicked(t)}},{default:g((()=>[y("div",LH,[u.isEventDay(t)?(n(),r("div",{key:0,ref_for:!0,ref:"eventCanvas",class:"easter-egg"},null,512)):d("",!0),y("span",{class:L({"event-day":u.isEventDay(t)})},h(e),3)])])),_:2},1032,["type","onClick"])))),128))],4)])):d("",!0)}],["__scopeId","data-v-f6271c20"]]),IH={NORMAL:0,LINK:1},kH=1,RH=2,NH={name:"DescriptionItem",components:{BrandMessage:Ja},props:{leftText:{type:String,default:""},rightText:{type:String,default:""},rightStyle:{type:Number,default:0},rightIcon:{type:Object,default:null},onClickRightIcon:{type:Function,default:()=>{}},rightToolTipText:{type:String,default:""},highlight:{type:Boolean,default:!1},infoComponent:{type:Object,default:null},currency:{type:String,default:""},timelineComponent:{type:Object,default:null},timelineData:{type:Array,default:()=>[]},hasTimelinePreview:{type:Boolean,default:!1},isShowTimeline:{type:Boolean,default:!1}},data:()=>({TYPE_ENUM:IH}),computed:{getRightTextClass(){const e=[];return this.rightStyle===kH&&e.push("text--big"),this.rightStyle===RH&&e.push("text--medium"),this.highlight&&e.push("highlight"),e}},methods:{toRaw:Te}},xH={class:"description-item"},PH={key:0,class:"timeline-container"},OH={class:"item-left-wrap"},$H={class:"item-left-text"},WH={key:0,class:"info-block"},FH={class:"item-right-wrap"},BH={class:"text-content-wrap"},UH={key:0,class:"currency"};const MH=vr(NH,[["render",function(e,t,a,l,o,u){const c=s("ToolTip");return n(),r("div",xH,[a.isShowTimeline&&a.timelineComponent?(n(),r("div",PH,[(n(),i(A(u.toRaw(a.timelineComponent)),b(e.$attrs,{timelineData:a.timelineData,hasTimelinePreview:a.hasTimelinePreview}),null,16,["timelineData","hasTimelinePreview"]))])):(n(),r(p,{key:1}
1,[y("div",OH,[y("p",$H,h(a.leftText),1),a.infoComponent?(n(),r("div",WH,[(n(),i(A(u.toRaw(a.infoComponent))))])):d("",!0)]),y("div",FH,[y("div",BH,[m(c,{class:L(["item-right-text",[u.getRightTextClass,{"has-tooltip":a.rightToolTipText}]]),placement:"top",tooltip:a.rightToolTipText,disable:!a.rightToolTipText},{content:g((()=>[v(h(a.rightText),1)])),_:1},8,["class","tooltip","disable"]),(n(),i(A(u.toRaw(a.rightIcon)),{class:L(["icon no-select",{active:a.isShowTimeline}]),onClick:a.onClickRightIcon},null,8,["class","onClick"]))]),a.currency?(n(),r("div",UH,h(a.currency),1)):d("",!0)])],64))])}],["__scopeId","data-v-50ca00fb"]]),VH={name:"UpdatedDaily"},HH=vr(Object.assign(VH,{setup:e=>(e,t)=>(n(),i(Yl,{class:"updated-daily-tag",type:P(Vl).PRIMARY_LIGHT,text:"Updated Daily",suffixIcon:P(Fa),suffixIconTooltip:e.$t("earn.transferDialog.stakingWarningMessage")},null,8,["type","suffixIcon","suffixIconTooltip"]))}),[["__scopeId","data-v-5b2d4a76"]]),GH={name:"Timeline",components:{IconCalendar:da},props:{timelineData:{type:Array,default:()=>[]},hasTimelinePreview:{type:Boolean,default:!1}},emits:["update:isShowTimelinePreview"],methods:{openTimelinePreview(){this.hasTimelinePreview&&this.$emit("update:isShowTimelinePreview",!0)}}},YH={class:"timeline-wrapper"},qH={class:"timeline"},zH={class:"left-content"},KH={key:0,class:"info"},jH={class:"right-content"};const XH=vr(GH,[["render",function(e,t,a,l,i,o){const u=s("IconCalendar");return n(),r("div",YH,[y("div",{class:"title-wrapper",onClick:t[0]||(t[0]=(...e)=>o.openTimelinePreview&&o.openTimelinePreview(...e))},[m(u,{class:"icon-calendar"}),y("span",{class:L(["title",{"action-click":a.hasTimelinePreview}])},h(e.$t("earn.timelinePreview")),3)]),y("div",qH,[(n(!0),r(p,null,x(a.timelineData,(e=>(n(),r("div",{key:e.title,class:"content"},[y("div",zH,[y("span",null,h(e.title),1),e.info?(n(),r("div",KH,h(e.info),1)):d("",!0)]),y("div",jH,h(e.des),1)])))),128))])])}],["__scopeId","data-v-25584157"]]),QH={name:"DescriptionWrap",components:{DescriptionItem:MH},props:{type:{type:Number,required:!0},productData:{type:Object,default:()=>({})},selectDuration:{type:Object,default:()=>({})},isSelectEventDay:{type:Boolean,default:!1},isEventRedeemable:{type:Boolean,default:!0},hasOptionDurationList:{type:Boolean,default:!1}},data:()=>({TYPE_ENUM:IH,UpdatedDaily:HH,Timeline:XH,isShowTimeline:!1}),computed:{...l(["lang","currencyMap"]),getDescriptionList(){switch(this.type){case xi.FLEXIBLE:return this.getTransferFlexibleList;case xi.FIXED:return this.getTransferFixedList;case xi.LENDING:return this.getTransferLendingList;case xi.STAKING:return this.getTransferStakingList;default:return[]}},getTransferFlexibleList(){const{investmentStartDate:e,firstInterestPayoutDate:t}=this.productData,a=[{title:this.$t("earn.transferDialog.startDate"),des:this.formatDate(e)},{title:this.$t("earn.firstInterestPayout"),des:this.formatDate(t),info:this.$t("earn.paidDaily")}];return[{title:this.$t("earn.estimatedInterestEarned"),des:this.getInterestEarned(),rightStyle:RH,currency:this.productData.currency},{title:this.$t("earn.transferDialog.redemption"),des:this.$t("earn.transferDialog.anytime"),rightIcon:Ka,onClickRightIcon:this.toggleShowTimeline},{timelineComponent:this.Timeline,timelineData:a}]},getTransferFixedList(){const{firstInterestPayoutDate:e,investmentEndDate:t}=this.productData,a=[{title:this.$t("earn.transferDialog.startDate"),des:this.formatDate(new Date)},{title:this.$t("earn.interestPayout"),des:this.formatDate(e)},{title:this.$t("earn.transferDialog.endDate"),des:this.formatDate(t)}];return[{title:this.$t("earn.estimatedInterestEarned"),des:this.getInterestEarned(),rightStyle:RH,currency:this.productData.currency},{title:this.$t("earn.transferDialog.redemption"),des:this.$t("earn.transferDialog.anytime"),rightIcon:Ka,onClickRightIcon:this.toggleShowTimeline,rightToolTipText:this.showEarlyRedemptionDescription?this.$t("earn.transferDialog.tooltip.earlyRedeemPartialPayout"):this.$t("earn.transferDialog.tooltip.earlyRedeem"),disabled:this.isSelectEventDay&&!this.isEventRedeemable},{timelineComponent:this.Timeline,timelineData:a}].filter((e=>!e.disabled))}
1,getTransferLendingList(){const{firstInterestPayoutDate:e,investmentEndDate:t}=this.productData,a=[{title:this.$t("earn.transferDialog.startDate"),des:this.formatDate(new Date)},{title:this.$t("earn.firstInterestPayout"),des:this.formatDate(e),info:this.hasOptionDurationList?null:this.$t("earn.paidDaily")},{title:this.$t("earn.transferDialog.endDate"),des:this.formatDate(t)}];return[{title:this.$t("earn.estimatedInterestEarned"),des:this.getInterestEarned(),rightStyle:RH,currency:this.productData.currency},{title:this.$t("earn.transferDialog.redemption"),des:this.$t("earn.transferDialog.anytime"),rightIcon:Ka,onClickRightIcon:this.toggleShowTimeline,rightToolTipText:this.$t("earn.transferDialog.tooltip.earlyRedeem")},{timelineComponent:this.Timeline,timelineData:a}]},getTransferFundsList(){const{firstInterestPayoutDate:e,investmentEndDate:t}=this.productData,a=[{title:this.$t("earn.transferDialog.startDate"),des:this.formatDate(new Date)},{title:this.$t("earn.firstInterestPayout"),des:this.formatDate(e),info:this.$t("earn.paidMonthly")},{title:this.$t("earn.transferDialog.endDate"),des:this.formatDate(t)}];return[{title:this.$t("earn.estimatedInterestEarned"),des:this.getInterestEarned(),rightStyle:RH,currency:this.productData.currency},{title:this.$t("earn.transferDialog.redemption"),des:this.$t("earn.transferDialog.anytime"),rightIcon:Ka,onClickRightIcon:this.toggleShowTimeline,rightToolTipText:this.$t("earn.transferDialog.tooltip.fundsEarlyRedeem")},{timelineComponent:this.Timeline,timelineData:a,hasTimelinePreview:!0}]},getTransferStakingList(){const{investmentStartDate:e,firstInterestPayoutDate:t,investmentEndDate:a,lockedDurationAfter:l}=this.productData,s=l/1e3/3600,i=[{title:this.$t("earn.transferDialog.startDate"),des:this.formatDate(e)},{title:this.$t("earn.firstInterestPayout"),des:this.formatDate(t),info:this.$t("earn.paidDaily")},{title:this.$t("earn.transferDialog.endDate"),des:this.formatDate(a)}];return[{title:this.$t("earn.estimatedInterestEarned"),des:this.getInterestEarned(),rightStyle:RH,currency:this.productData.currency},{title:this.$t("earn.transferDialog.redemption"),des:this.$t("earn.frozenPeriod",{hour:s}),rightIcon:Ka,onClickRightIcon:this.toggleShowTimeline,rightToolTipText:this.$t("earn.transferDialog.tooltip.stakingEarlyRedeem")},{timelineComponent:this.Timeline,timelineData:i,hasTimelinePreview:!0}]},minInterestPayoutDays(){const{minInterestPayoutTenor:e}=this.productData;return void 0===e?e:0!==e?Pi(e):0},showEarlyRedemptionDescription(){return this.type===xi.FIXED&&void 0!==this.minInterestPayoutDays&&(0!==this.minInterestPayoutDays&&this.selectDuration.day>this.minInterestPayoutDays)},earlyRedemptionInterestPercentage(){const{rate:e,discountedRateForEarlyRedemption:t}=this.productData,a=N(e).times(t),l=a.dp(2,N.ROUND_DOWN).eq(0)?"max":2;return this.$filters.formatNumber(a.toNumber(),l)}},methods:{toggleShowTimeline(){this.isShowTimeline=!this.isShowTimeline},getInterestEarned(){const{amount:e,rate:t,day:a,compounding:l}=this.productData,s=hx(e,t,a,l),i=Math.floor(s)>1e9?"default":"max8";return this.$filters.formatNumber(s,i)},formatDate:(e=0)=>0===e?"--":X(e,"yyyy-MM-dd HH:mm")}},ZH={class:"description-wrapper"},JH={key:0,class:"early-redeem-description"},eG={class:"row-wrap"},tG={class:"row-wrap"},aG={class:"interest"},lG={class:"row-wrap"},sG={class:"interest"};const iG=vr(QH,[["render",function(e,t,a,l,o,u){const c=s("DescriptionItem");return n(),r("div",ZH,[(n(!0),r(p,null,x(u.getDescriptionList,(t=>(n(),i(c,b({ref_for:!0},e.$attrs,{key:t.title,leftText:t.title,rightText:t.des,handleRightOnclick:t.handleRightOnclick,rightStyle:t.rightStyle,rightIcon:t.rightIcon,onClickRightIcon:t.onClickRightIcon,rightToolTipText:t.rightToolTipText,highlight:t.highlight,infoComponent:t.infoComponent,currency:t.currency,timelineComponent:t.timelineComponent,timelineData:t.timelineData,hasTimelinePreview:t.hasTimelinePreview,isShowTimeline:o.isShowTimeline}),null,16,["leftText","rightText","handleRightOnclick","rightStyle","rightIcon","onClickRightIcon","rightToolTipText","highlight","infoComponent","currency","timelineComponent","timelineData","hasTimelinePreview","isShowTimeline"])))),128)),u.showEarlyRedemptionDescription?(n(),r("div",JH,[y("div",eG,h(e.$t("earn.transferDialog.earlyRedemptionTitle")),1),y("div",tG,[v(h(`< ${e.$t("t.days",{day:u.minInterestPayoutDays})}`)+" ",1),y("span",aG,h(e.$filters.formatNumber(0))+"%",1)]),y("div",lG,[v(h(e.$t("t.days",{day:`${u.minInterestPayoutDays}-${a.selectDuration.day}`}))+" ",1),y("span",sG,h(u.earlyRedemptionInterestPercentage)+"%",1)])])):d("",!0)])}
1],["__scopeId","data-v-f2c81d40"]]),nG={name:"EventUnlockDialog",components:{BrandDialog:wt},props:{isShow:{type:Boolean,default:!1},currencyData:{type:Object,required:!0},handleClose:{type:Function,required:!0}},data:()=>({publicPath:"/",eventCanvas:null}),computed:{eventData(){return this.currencyData.event[0]}},mounted(){this.initialEasterEgg()},methods:{initialEasterEgg(){this.eventCanvas=To.loadAnimation({container:this.$refs.eventCanvas,renderer:"svg",autoplay:!0,path:`${this.publicPath}static/lottie/diamond.json`}),this.eventCanvas.onComplete=()=>{this.eventCanvas.play()}},close(){this.handleClose(!1)},earnNow(){this.handleClose()}}},rG={class:"content-wrapper"},oG={class:"content"},uG={class:"title"},cG={class:"sub-title"},dG={class:"highlight"},pG={class:"info"},yG={class:"highlight"},hG={class:"info"},vG={class:"highlight highlight2"},mG={ref:"eventCanvas",class:"easter-egg"};const gG="earnSoldOutList",fG={name:"EarnTransferDialog",components:{BrandDialog:wt,TokenIcon:Pa,SwitchButton:ll,AmountWrap:pN,DurationWrap:EH,DescriptionWrap:iG,EventUnlockDialog:vr(nG,[["render",function(e,t,a,l,r,o){const u=s("BaseButton"),c=s("BrandDialog");return n(),i(c,{visible:a.isShow,class:"event-unlock-dialog",width:e.$isLargeSize(e.$mq)?"530px":"90%",idPrefix:"event_unlock_dialog",isBrandNewStyle:"",onClosed:o.close},{body:g((()=>[y("div",rG,[y("div",oG,[y("span",uG,h(e.$t("t.congratulations")),1),y("div",cG,[y("span",dG,h(o.eventData.activityName),1),v(" "+h(e.$t("t.unlocked")),1)]),y("div",pG,[v(h(e.$t("wallets.earn.fixed.duration"))+": ",1),y("span",yG,h(o.eventData.targetDay)+" "+h(e.$t("earn.calculator.days")),1)]),y("div",hG,[t[0]||(t[0]=v(" APR: ")),y("span",vG,h(o.eventData.targetRate)+" % ",1)]),m(u,{class:"primary view-btn",size:"large",onClick:o.earnNow},{default:g((()=>[v(h(e.$t("wallets.earn.earnNow")),1)])),_:1},8,["onClick"])]),y("div",mG,null,512)])])),_:1},8,["visible","width","onClosed"])}],["__scopeId","data-v-4157334b"]]),TimelinePreviewDialog:Yx},props:{type:{type:Number,default:-1},categoryType:{type:Number,default:-1},show:{type:Boolean,default:!1},currencyData:{type:Object,default:()=>({})},getProductList:{type:Function,required:!0}},emits:["update:successData","update:isShowSuccess","update:keepInvestmentData","update:show"],data(){return{amount:this.currencyData.insertAmount,autoRenewal:Boolean(this.currencyData.autoRenewSupported),agreeTermsAndConditions:!1,selectDuration:{day:1,rate:0},btnLoading:!1,amountError:!1,activeEvent:!1,isShowEventUnlockDialog:!1,isShowTimelinePreview:!1}},computed:{...l(["currencyMap","userConfig"]),randomId:()=>nr(),isAllowConvert(){var e;return(null==(e=this.currencyMap[this.currencyData.currency])?void 0:e.allowConvert)||!1},isDailyUpdateInterestRate(){return[xi.FLEXIBLE,xi.STAKING].includes(this.type)},isFundsCategory(){return this.currencyData.category===Ri.FUNDS},isSpecialCoin(){return ir.has(this.currencyData.currency)},investmentStartDate(){return this.currencyData.startDate},firstInterestPayoutDate(){switch(this.type){case xi.FIXED:case xi.LENDING:return pe(new Date,this.selectDuration.day)}const{interestStartDate:e,interestPayoutFrequency:t}=this.currencyData;return de(e,t)},investmentEndDate(){switch(this.type){case xi.FIXED:case xi.LENDING:return pe(new Date,this.selectDuration.day)}const{interestStartDate:e,lockedDurationAfter:t}=this.currencyData;return de(pe(e,this.selectDuration.day),t)},productData(){return{id:this.currencyData.id,day:this.selectDuration.day,rate:this.getRate,iconName:this.currencyData.iconName,startDate:this.currencyData.startDate,interestStartDate:this.currencyData.interestStartDate,currency:this.currencyData.currency,amount:this.amount,dailyLimit:this.currencyData.dailyLimit,compounding:this.currencyData.compounding,lockedDurationBefore:this.currencyData.lockedDurationBefore,lockedDurationAfter:this.currencyData.lockedDurationAfter,interestPayoutFrequency:this.currencyData.interestPayoutFrequency,minInterestPayoutTenor:this.currencyData.minInterestPayoutTenor,discountedRateForEarlyRedemption:this.currencyData.discountedRateForEarlyRedemption,investmentStartDate:this.investmentStartDate,firstInterestPayoutDate:this.firstInterestPayoutDate,investmentEndDate:this.investmentEndDate}},interestRateLabel(){switch(this.type){case xi.FIXED:case xi.LENDING:return this.$t("t.annualPercentageRate");default:return this.$t("earn.currentApy")}},campaign(){return this.currencyData.campaign||null},campaignLabelClass(){var e;return(null==(e=this.campaign)?void 0:e.campaignLabel)===Fi.VIP_EXCLUSIVE?"vip-exclusive":"standard"},minInvestAmt(){var e;return(null==(e=this.campaign)?void 0:e.minSize)>0?this.campaign.minSize:this.currencyData.minSize||0},defaultMaxInvestAmt(){return this.isSpecialCoin&&!this.hasProductEvent?sr.has(this.currencyData.id)?200:15e4:this.currencyData.dailyLimit||0},campaignMaxInvestAmt(){var e;return null==(e=this.campaign)?void 0:e.dailyLimit},maxInvestAmt(){return this.campaign?this.campaignMaxInvestAmt:this.defaultMaxInvestAmt},hasInvestLimitation(){return this.type===xi.STAKING&&(this.minInvestAmt>0||this.defaultMaxInvestAmt>0)},getAvailAmount(){return(this.currencyMap[this.currencyData.currency]||{}).available||0},getRate(){return this.currencyData.rates&&this.currencyData.rates.length?this.selectDuration.rate:this.currencyData.rate},isEventSoldOut(){if(this.activeEvent&&this.isSelectEventDay){const e=lr.getCookie(gG),t=JSON.parse(e)||[],{activityId:a}=this.eventData;return t.includes(a)||this.eventData.isSoldOut}return!1},isBtnDisabled(){return!!this.isEventSoldOut||(!(!this.campaign||!this.campaign.isSoldOut&&this.campaign.allowToDeposit)||(!this.agreeTermsAndConditions||""===this.amount||this.amountError))},hasOptionDurationList(){return this.currencyData.optionDurationList&&this.currencyData.optionDurationList.length>0},submitButtonText(){var e;if(this.isEventSoldOut||(null==(e=this.campaign)?void 0:e.isSoldOut))return this.$t("earn.soldOut");switch(this.currencyData.category){case Ri.LENDING:return this.$t("earn.transferDialog.startLending");case Ri.STAKING:return this.$t("earn.transferDialog.startStaking");default:return this.$t("earn.transferDialog.startEarning")}},eventData(){return this.currencyData.hasEvent?this.currencyData.event[0]:{}},isEventUnlocked(){const e=this.userConfig[Ve.EARN_EVENT_STATE],t=this.eventData.activityId;return!(!e||!e[t])&&e[t].isUnlocked},durationDaysList(){return this.activeEvent?[...new Set(this.eventData.days)]:this.currencyData.optionDurationList},rates(){return this.activeEvent?this.eventData.rates:this.currencyData.rates},insertRate(){return this.activeEvent?this.eventData.targetRate:this.currencyData.insertRate},isSelectEventDay(){return!this.campaign&&this.selectDuration.rate===this.eventData.targetRate},isEventRedeemable(){return this.eventData.redeemable},showAutoRenewal(){if(this.isSelectEventDay)return this.eventData.autoRenewSupported;const e=this.currencyData.campaign?this.currencyData.campaign.autoRenewSupported:this.currencyData.autoRenewSupported;return this.type!==xi.FLEXIBLE&&e},categoryTitle(){return HI(this.$t,this.currencyData.category)},providerImagePath(){return MI(this.currencyData.iconName)},isFromCampaignLink(){var e;return!!(null==(e=this.$route.query)?void 0:e.utm_campaign)},hasProductEvent(){return this.currencyData.hasEvent}},watch:{isSelectEventDay(e){e&&this.currencyData.isTriggerEventImmediate&&this.$refs.amountWrap&&(this.$refs.amountWrap.amountModel=String(this.eventData.minSize))}},created(){(this.isEventUnlocked&&!this.currencyData.isTriggerEventImmediate||this.isSpecialCoin&&this.hasProductEvent)&&this.unlockEvent()},mounted(){this.currencyData.isTriggerEventImmediate&&!1!==this.currencyData.isShowEventUnlockDialog&&this.showEventUnlockDialog(0)},methods:{formatRate:UI,...u(["updateUserConfigByKey"]),...e(nt,{fetchEarnWallet:"update"}),agreeTermsOnclick(){if("warpspeed"===this.currencyData.iconName){const e=ki("page/warpspeed_terms.html");return void window.open(e,"_blank")}const e=this.$router.resolve({name:Ke.LEGAL_DIGITAL_ASSET_SERVICE}
1).href,t=this.$router.resolve({name:Ke.LEGAL_TERMS_AND_CONDITIONS}).href;window.open(e??t,"_blank")},startEarnOnclicked(){var e;this.btnLoading=!0;const t=!!this.showAutoRenewal&&this.autoRenewal,a=(null==(e=this.campaign)?void 0:e.activityId)??(this.isSelectEventDay?this.eventData.activityId:null),l={type:this.type,category:this.currencyData.category,amount:this.amount,currencyName:this.currencyData.currency,...this.productData};Oa.postInvestDeposit(this.currencyData.id,a,Number(this.amount)||0,t,this.getRate,this.selectDuration.day).then((()=>{const e=this.currencyData.currency;this.fetchEarnWallet(),this.$emit("update:successData",{success:!0,categoryType:this.categoryType,...l}),this.$emit("update:isShowSuccess",!0);const t=Hl(qi[this.currencyData.category]),a=(this.currencyMap[e]||{}).usdRate,s=this.isSelectEventDay?`Easter Egg ${t}`:t,i=N(this.amount).times(a).toNumber();er({event:"EarnApplyEvent",earnType:s,currency:e,value:i,moneyValue:i}),tr.trackActivity(ar.EARN_APPLY),this.$sendEvent(Ot.EVENT_WEB_EARN_PURCHASE_SUBMITTED,{submitSuccess:!0,errorCode:null})}),(e=>{if(this.isSelectEventDay&&1000205===e){const e=lr.getCookie(gG),t=JSON.parse(e),a=t?[...t,this.eventData.activityId]:[this.eventData.activityId],l=2/1440;lr.saveCookie(gG,JSON.stringify(a),l)}this.$emit("update:keepInvestmentData",l),this.$emit("update:successData",{success:!1,type:this.t
1ype,category:this.currencyData.category,categoryType:this.categoryType,errorCode:e}),this.$emit("update:isShowSuccess",!0),this.$sendEvent(Ot.EVENT_WEB_EARN_PURCHASE_SUBMITTED,{submitSuccess:!1,errorCode:e})})).finally((()=>{this.getProductList(),this.btnLoading=!1,this.closeDialog()}))},closeDialog(){this.reset(),this.$emit("update:show",!1)},reset(){this.amount=0},openEventDialog(){const e=document.getElementById(this.randomId);e.classList.add("hide-animation"),setTimeout((()=>{this.isShowEventUnlockDialog=!0,e.classList.add("hide-height")}),500)},hideEventDialog(){this.isShowEventUnlockDialog=!1;const e=document.getElementById(this.randomId);e.classList.remove("hide-animation"),e.classList.remove("hide-height")},showEventUnlockDialog(e=1e3){this.openEventDialog(),this.saveUnlockEventByUser(),setTimeout((()=>{this.unlockEvent()}),e)},unlockEvent(){this.activeEvent=!0,this.selectDuration={day:this.eventData.targetDay,rate:this.eventData.targetRate}},saveUnlockEventByUser(){const e=this.userConfig[Ve.EARN_EVENT_STATE];this.updateUserConfigByKey({key:Ve.EARN_EVENT_STATE,value:{...e,[this.eventData.activityId]:{isUnlocked:!0}}})},closeEventUnlockDialog(e=!0){e?this.hideEventDialog():this.closeDialog()},showTimelinePreview(){this.isShowTimelinePreview=!0},hideTimelinePreview(){this.isShowTimelinePreview=!1}}},TG={class:"dialog-title"},wG={class:"dialog-body"},DG={class:"top-wrapper"},AG={class:"content-icon-wrap"},bG={class:"currency-name-row"},_G={key:0,class:"provider-wrap"},SG={class:"provider"},CG=["src"],LG=["href"],EG={class:"learn-more"},IG={key:2,class:"auto-renewal-wrapper"},kG={class:"auto-renewal-text"},RG={class:"dialog-agree-wrap"},NG={class:"agree-link"},xG={class:"dialog-button-wrapper"};const PG=vr(fG,[["render",function(e,t,a,l,o,u){const c=s("TokenIcon"),p=s("ToolTip"),f=s("AmountWrap"),T=s("DurationWrap"),w=s("SwitchButton"),D=s("DescriptionWrap"),A=s("CheckBox"),b=s("i18n-t"),_=s("BrandButton"),S=s("BrandDialog"),C=s("EventUnlockDialog"),E=s("TimelinePreviewDialog");return n(),r("div",null,[m(S,{id:u.randomId,ref:"transferDialog",visible:!o.isShowTimelinePreview,class:"event-transfer-dialog",width:e.$isLargeSize(e.$mq)?"530px":"90%",idPrefix:"earn_transfer_dialog",isBrandNewStyle:"",onClosed:u.closeDialog},{header:g((()=>[y("p",TG,h(u.categoryTitle),1)])),body:g((()=>[y("div",wG,[y("div",DG,[y("div",AG,[y("div",bG,[m(c,{class:"currency-icon",showName:!1,type:a.currencyData.isFiat?"fiat":"icon",name:a.currencyData.currency,size:"24"},null,8,["type","name"]),y("span",null,h(a.currencyData.displayCurrency),1)]),u.campaign&&u.campaign.campaignLabel?(n(),r("span",{key:0,class:L(["currency-badge campaign-label",u.campaignLabelClass])},h(e.$t(`earn.campaignLabel.${u.campaign.campaignLabel}`)),3)):d("",!0)]),y("div",{class:L(["rate-info",{highlight:u.isSelectEventDay}])},[v(h(u.formatRate(u.productData.rate))+"% ",1),m(p,{class:"rate-info-label",placement:"bottom-end",tooltip:e.$t("earn.transferDialog.stakingWarningMessage"),disable:!u.isDailyUpdateInterestRate},{content:g((()=>[y("span",{class:L({"has-tooltip":u.isDailyUpdateInterestRate})},h(u.interestRateLabel),3)])),_:1},8,["tooltip","disable"])],2)]),u.isFundsCategory?(n(),r("div",_G,[y("div",SG,[y("span",null,h(e.$t("t.managedBy")),1),y("img",{src:u.providerImagePath,class:"provider-icon"},null,8,CG)]),y("p",null,[v(h(e.$t(`earn.funds.${a.currencyData.iconName}.des`))+" ",1),y("a",{href:a.currencyData.description,target:"_blank",rel:"noopener nofollow"},[y("span",EG,h(e.$t("msg.learnMore")),1)],8,LG)])])):d("",!0),m(f,{ref:"amountWrap",amount:o.amount,"onUpdate:amount":t[0]||(t[0]=e=>o.amount=e),amountError:o.amountError,"onUpdate:amountError":t[1]||(t[1]=e=>o.amountError=e),class:"amount-wrap",type:a.type,availAmount:u.getAvailAmount,currency:a.currencyData.currency,minInvestAmt:u.minInvestAmt,maxInvestAmt:u.maxInvestAmt,closeDialog:u.closeDialog,showConvert:u.isAllowConvert,isSelectEventDay:u.isSelectEventDay,eventData:u.eventData},null,8,["amount","amountError","type","availAmount","currency","minInvestAmt","maxInvestAmt","closeDialog","showConvert","isSelectEventDay","eventData"]),u.hasOptionDurationList?(n(),i(T,{key:1,selectDuration:o.selectDuration,"onUpdate:selectDuration":t[2]||(t[2]=e=>o.selectDuration=e),class:"duration",optionDurationList:u.durationDaysList,rates:u.rates,insertRate:u.insertRate,activeEvent:o.activeEvent,eventData:u.eventData,isSpecialCoin:u.isSpecialCoin},null,8,["selectDuration","optionDurationList","rates","insertRate","activeEvent","eventData","isSpecialCoin"])):d("",!0),u.showAutoRenewal?(n(),r("div",IG,[m(w,{modelValue:o.autoRenewal,"onUpdate:modelValue":t[3]||(t[3]=e=>o.autoRenewal=e)},null,8,["modelValue"]),y("span",kG,h(e.$t("earn.transferDialog.autoRenewal")),1)])):d("",!0),m(D,{isS
1howTimelinePreview:o.isShowTimelinePreview,"onUpdate:isShowTimelinePreview":t[4]||(t[4]=e=>o.isShowTimelinePreview=e),type:a.type,productData:u.productData,selectDuration:o.selectDuration,isSelectEventDay:u.isSelectEventDay,isEventRedeemable:u.isEventRedeemable,hasOptionDurationList:u.hasOptionDurationList},null,8,["isShowTimelinePreview","type","productData","selectDuration","isSelectEventDay","isEventRedeemable","hasOptionDurationList"]),y("div",RG,[m(A,{value:o.agreeTermsAndConditions,"onUpdate:value":t[5]||(t[5]=e=>o.agreeTermsAndConditions=e),class:"agree-check-box",name:"agreeTermsAndConditions",filledIn:""},null,8,["value"]),y("div",NG,[m(b,{keypath:"t.agreeToBrandTerms",tag:"span"},{termsAndConditions:g((()=>[y("a",{onClick:t[6]||(t[6]=(...e)=>u.agreeTermsOnclick&&u.agreeTermsOnclick(...e))},h(e.$t("t.termsAndConditions"))+". ",1)])),_:1})])]),y("div",xG,[m(_,{disabled:u.isBtnDisabled,loading:o.btnLoading,class:"dialog-button",type:"confirm",onClick:u.startEarnOnclicked},{default:g((()=>[v(h(u.submitButtonText),1)])),_:1},8,["disabled","loading","onClick"])])])])),_:1},8,["id","visible","width","onClosed"]),o.isShowEventUnlockDialog?(n(),i(C,{key:0,isShow:o.isShowEventUnlockDialog,"onUpdate:isShow":t[7]||(t[7]=e=>o.isShowEventUnlockDialog=e),currencyData:a.currencyData,handleClose:u.closeEventUnlockDialog},null,8,["isShow","currencyData","handleClose"])):d("",!0),o.isShowTimelinePreview?(n(),i(E,{key:1,show:o.isShowTimelinePreview,"onUpdate:show":t[8]||(t[8]=e=>o.isShowTimelinePreview=e),productData:u.productData,type:a.type},null,8,["show","productData","type"])):d("",!0)])}],["__scopeId","data-v-755324b4"]]),OG={name:"SuccessDialog",components:{BrandDialog:wt,IconSuccess:Vi,IconFlashFail:Mi},props:{isShow:{type:Boolean,default:!1},successData:{type:Object,default:()=>({})},closeCallback:{type:Function,default:()=>{}}},emits:["update:isShow"],computed:{...l(["lang"]),titleText(){return this.successData.success?this.$t("msg.success"):this.successData.errorCode===Nn.EARN_SOLD_OUT?this.$t("earn.soldOut.title",{percentage:"100%"}):this.$t("t.unsuccessful")},desText(){if(this.successData.success)return this.$t("earn.investmentProcessed");switch(this.successData.errorCode){case Nn.EARN_EVENT_KYC_NOT_ALLOWED:return this.$t("earn.eventDepositNotAllowed.description");case Nn.EARN_SOLD_OUT:return this.$t("earn.soldOut.description");case Nn.EARN_EVENT_SUB_ACCOUNT_NOT_ALLOWED:return this.$t("earn.eventSubAccountNotAllowed.description")}return this.$t("earn.depositUnsuccessful")},errorText(){return`${this.$t("t.errorCode")} ${this.successData.errorCode}`},isFixed(){return this.successData.type===xi.FIXED},isShowErrorNote(){return![Nn.EARN_EVENT_KYC_NOT_ALLOWED,Nn.EARN_SOLD_OUT].includes(this.successData.errorCode)},apyText(){switch(this.successData.type){case xi.FIXED:case xi.LENDING:return this.$t("t.annualPercentageRate");case xi.FLEXIBLE:case xi.STAKING:return this.$t("earn.currentApy")}return""},hasTip(){return[xi.FLEXIBLE,xi.STAKING].includes(this.successData.type)},headerText(){return HI(this.$t,this.successData.category,!0)},typeText(){return qi[this.successData.category]},supportUrl(){return gt(this.lang,"NEW_TICKET")}},methods:{close(){this.closeCallback(),this.$emit("update:isShow",!1)},onESC(){this.close()},formatDate:(e=0)=>0===e?"--":X(e,"yyyy-MM-dd HH:mm"),tryAgain(){this.close();const e=document.querySelector('.earn-term-card[data-keep-investment="true"]');if(!e)return;const t=e.querySelector("button");t&&t.click()}}},$G={class:"success-dialog-body"},WG={class:"title-text"},FG={key:2,class:"error-text"},BG={class:"des-text"},UG={class:"action-text"},MG=["href"],VG={key:0,class:"dialog-info-wrapper"},HG={class:"row"},GG={class:"info-title"},YG={class:"value-wrap"},qG={class:"value"},zG={class:"currency"},KG={class:"row"},jG={class:"info-title-wrap"},XG={class:"info-title"},QG={key:0,class:"tip"},ZG={class:"info-value"},JG={class:"row"},eY={class:"info-title"},tY={class:"info-value"};const aY=vr(OG,[["render",function(e,t,a,l,o,u){const c=s("IconSuccess"),p=s("IconFlashFail"),f=s("RouterLink"),T=s("i18n-t"),w=s("Brand
1Button"),D=s("BrandDialog");return n(),i(D,{visible:a.isShow,class:"success-dialog-wrap",width:e.$isLargeSize(e.$mq)?"560px":"90%",idPrefix:"earn_success_dialog",isBrandNewStyle:"",onClosed:u.close},{header:g((()=>[y("div",null,h(u.headerText),1)])),body:g((()=>[y("div",$G,[a.successData.success?(n(),i(c,{key:0,class:"dialog-success-icon"})):(n(),i(p,{key:1,class:"dialog-failed-icon"})),y("p",WG,h(u.titleText),1),a.successData.success?d("",!0):(n(),r("span",FG,h(u.errorText),1)),y("p",BG,h(u.desText),1),y("p",UG,[a.successData.success?(n(),i(T,{key:0,keypath:"earn.viewEarnWallet",tag:"span"},{earnWallet:g((()=>[m(f,{class:"link",to:{name:"walletEarn",query:{type:u.typeText}}},{default:g((()=>[v(h(e.$t("earn.earnWallet")),1)])),_:1},8,["to"])])),_:1})):u.isShowErrorNote?(n(),i(T,{key:1,keypath:"earn.investmentErrorDes",tag:"span"},{tryAgain:g((()=>[y("span",{class:"link",onClick:t[0]||(t[0]=(...e)=>u.tryAgain&&u.tryAgain(...e))},h(e.$t("t.try_again").toLowerCase()),1)])),contactUs:g((()=>[y("a",{class:"link",href:u.supportUrl,target:"_blank",rel:"noopener nofollow"},h(e.$t("t.contactUs").toLowerCase()),9,MG)])),_:1})):d("",!0)])]),a.successData.success?(n(),r("div",VG,[y("div",HG,[y("span",GG,h(e.$t("earn.amountInvested")),1),y("div",YG,[y("span",qG,h(e.$filters.formatNumber(a.successData.amount,"max")),1),y("span",zG,h(a.successData.currency),1)])]),y("div",KG,[y("div",jG,[y("span",XG,h(u.apyText),1),u.hasTip?(n(),r("span",QG,h(e.$t("earn.updatedDaily")),1)):d("",!0)]),y("span",ZG,h(a.successData.rate)+"%",1)]),y("div",JG,[y("span",eY,h(u.isFixed?e.$t("earn.interestPayoutDate"):e.$t("earn.firstInterestPayoutDate")),1),y("span",tY,h(u.formatDate(a.successData.firstInterestPayoutDate)),1)])])):d("",!0),m(w,{class:"dialog-btn",type:"primary",size:"biggest",onClick:u.close},{default:g((()=>[v(h(e.$t("msg.ok")),1)])),_:1},8,["onClick"])])),_:1},8,["visible","width","onClosed"])}],["__scopeId","data-v-c2104366"]]),lY={class:"participate-dialog-body"},sY={class:"title-text"},iY={class:"action-text"},nY=vr(E({__name:"EarnParticipateEventDialog",props:{category:{}},emits:["closed"],setup(e,{emit:t}){const a=e,l=t,r=Ut(),o=G("eventCanvasRef"),u=R((()=>({name:"walletEarn",params:{lang:r.lang},query:{type:qi[a.category||Ni.ALL]||qi[Ni.ALL]}})));return Y((async()=>{await H(),o.value&&To.loadAnimation({container:o.value,renderer:"svg",path:"/static/lottie/diamond.json"})})),(e,t)=>{const a=s("RouterLink"),r=s("i18n-t"),c=s("BaseButton");return n(),i(wt,{class:"earn-participate-dialog",width:e.isLargeSize?"560px":"90%",idPrefix:"earn_participate_event_dialog",isBrandNewStyle:"",onClosed:t[1]||(t[1]=e=>l("closed"))},{body:g((()=>[y("div",lY,[y("div",{ref_key:"eventCanvasRef",ref:o,class:"event-diamond"},null,512),y("p",sY,h(e.$t("earn.event.participating")),1),y("p",iY,[m(r,{keypath:"earn.viewEarnWallet",tag:"span"},{earnWallet:g((()=>[m(a,{class:"link",to:u.value},{default:g((()=>[v(h(e.$t("earn.earnWallet")),1)])),_:1},8,["to"])])),_:1})])]),m(c,{class:"primary dialog-btn",size:"large",onClick:t[0]||(t[0]=e=>l("closed"))},{default:g((()=>[v(h(e.$t("msg.ok")),1)])),_:1})])),_:1},8,["width"])}}}),[["__scopeId","data-v-88c29f90"]]),rY={class:"outer-container"},oY={class:"earn-container"},uY={class:"earn-section"},cY={class:"earn-section-title"},dY={id:"ourProducts",class:"earn-section"},pY={class:"earn-section-title"},yY={class:"filter-container"},hY={class:"scroll-container"},vY={class:"asset-filter-container"},mY={key:0,class:"isolate-filter-container"},gY={key:1,class:"no-results"},fY={class:"earn-faq-section"},TY=vr(E({__name:"Earn",setup(e){const{enableEarnStaking:t,enableEarnFunds:a,enableEarnLending:l,enableAutoEarn:o,earnProductCategoryList:u,convertDefaultSelected:c}=Ge,f=V(),T=M(),{t:w}=I(),D=Ut(),A=ka(),b=nt(),{lang:_,loginState:C,isAccountInfoLoaded:E,isSubAccount:k,currencyMap:W}=S(D),F=O(10),B=O(0),U=O(""),H=O(!1),G=O(!1),Y=K(),z=K({}),X=K({}),Q=K({}),Z=K([]),J=K([]),ee=K(new Set),te=K([]),ae=K([]),le=K(),{campaignActivityId:se,generateEarnTransferPayload:ie}=gV(le),ne=K(),re=K(),oe=K(),ue=R((()=>"lg"===A.currentMq)),ce=R((()=>{const e={};for(const t of te.value)e[t.activityId]=t;return e})),de=R((()=>{const e={};for(const t of te.value)t.display&&(e[t.productId]||(e[t.productId]=[]),e[t.productId].push(t));for(const t of Object.values(e))t.sort(((e,t)=>t.targetRate-e.targetRate));return e})),pe=R((()=>C.value&&E.value&&!k.value&&void 0!==ne.value)),he=R((()=>J.value.map((e=>Ie(e))))),ve=R((()=>{const e=new Set(Ae.value);return Z.value.filter((t=>z.value[t]&&e.has(t)))})),me=R((()=>{const e=[Ie(Ni.ALL,!0)];return ve.value.length>0&&e.push({...Ie(Ni.HOT),icon:QM,iconClass:"icon-hot"}),e.concat(he.value)})),ge=R((()=>Object.keys(Q.value))),fe=R((()=>ge.value.map((e=>{var t;return{name:e,full:(null==(t=W.value[e])?void 0:t.name)||""}})))),Te=R((()=>me.value[B.value].key)),we=R((()=>Te.value===Ni.ALL)),Ae=R((()=>Object.keys(z.value).filter((e=>!1!==z.value[e].display)))),be=R((()=>{const e=[];for(const t of te.value)t.display&&z.value[t.productId]&&e.push({id:t.productId,activityId:t.activityId});for(const t of Ae.value)e.push({id:t});return e})),_e=R((()=>{const e=[];for(const t of ae.value){const a=ce.value[t];if(a&&z.value[a.productId]){e.push({product:z.value[a.productId],campaign:a});continue}const l=z.value[t];l&&e.push({product:l})}return e})),Se=R((()=>ee.value.size>0||H.value?ge.value.filter((e=>Re(e))):ge.value)),Ce=R((()=>{const e=ee.value.size>0||H.value;let t=Te.value===Ni.HOT?ve.value.slice().map((e=>({id:e}))):be.value.filter((({id:e})=>z.value[e].category===Te.value));e&&(t=t.filter((({id:e})=>Re(z.value[e].currency))));const a=e=>{if(e.activityId){const t=ce.value[e.activityId];return t?t.targetRate:0}return X.value[e.id]};return t.sort(((e,t)=>a(t)-a(e)))})),Le=R((()=>we.value?Se.value.length:Ce.value.length)),Ee=R((()=>Ce.value.slice(0,F.value)));function Ie(e,t=!1){return{id:VI(e),key:e,label:HI(w,e,t)}}function ke(e){const{rate:t,rates:a}=e;return a?N.max.apply(null,a).toNumber():t}function Re(e){var t;return!(ee.value.size>0&&!ee.value.has(e))&&(!H.value||!N((null==(t=W.value[e])?void 0:t.available)??0).lte(0))}function Ne(e){Y.value=e}function xe(e){B.value=e}function Pe(e){ee.value=new Set(e.map((({name:e})=>e)))}function Oe(e){re.value=e}function $e(){F.value+=10}function We({products:e,campaigns:s,recommendation:i}){const n=s.filter((e=>!or.has(e.activityId)||e.activityId===se.value));te.value=n,ae.value=i??[];const r=new Set;for(const t of n)t.display&&r.add(t.productId);const o={},c={},d={},p=new Set;for(let u=0,y=e.length;u<y;u++){const s=e[u],{id:i,category:n,currency:y,event:h,display:v}=s;if(n===Ri.STAKING&&!t||n===Ri.FUNDS&&!a||n===Ri.LENDING&&!l)continue;if(o[i]=s,d[i]=ke(s),se.value&&h){const e=h.find((({activityId:e})=>e===se.value));e&&(e.isJoined?ne.value=n:le.value=s)}if(!1===v&&!r.has(i))continue;p.add(n);const m=c[y]??{};c[y]||(c[y]=m),m[n]||(m[n]=[]),m[n].push(i)}z.value=o,X.value=d,Q.value=c,J.value=u.filter((e=>p.has(e)))}function Fe(){return Promise.allSettled([Fr().then(We),Br(20).then((e=>{Z.value=e}))])}let Ue;return ye("openConvertDialog",(function(e,t){oe.value={fromCurrency:W.value[e]?e:c.toCurrency,toCurrency:t}})),$(Te,(()=>{F.value=10})),$((()=>le.value&&!C.value),(e=>{e&&T.push({name:Ke.REGISTER,params:{lang:_.value},query:{redirect:f.fullPath}})}),{immediate:!0}),$((()=>le.value),(()=>{C.value&&Ne(ie())}),{once:!0}),j((async()=>{b.update(!0),await Fe(),Ue=window.setInterval(Fe,1e4)})),q((()=>{b.removeTimer(),clearInterval(Ue)})),(e,t)=>{const a=s("CheckBox");return n(),r("div",rY,[m(Ba,{class:"full-kyc-notification"}),m(mV),y("div",oY,[y("div",uY,[y("h3",cY,h(e.$t("t.recommendation")),1),m(UV,{productList:_e.value,onSelected:Ne},null,8,["productList"])]),y("div",dY,[y("h3",pY,h(e.$t("earn.ourProducts")),1),y("div",yY,[y("div",hY,[m(vy,{tabList:me.value,selectedIndex:B.value,onSelected:xe},null,8,["tabList","selectedIndex"])]),y("div",vY,[m(iH,{initCryptoType:U.value,currencyList:fe.value,filterCallback:Pe,showDropdownIcon:!1},null,8,["initCryptoType","currencyList"]),P(C)&&!ue.value?(n(),i(a,{key:0,value:H.value,"onUpdate:value":t[0]||(t[0]=e=>H.value=e)},{default:g((()=>
1[v(h(e.$t("earn.filter.matchMyAssets")),1)])),_:1},8,["value"])):d("",!0)])]),P(C)&&ue.value?(n(),r("div",mY,[m(a,{value:H.value,"onUpdate:value":t[1]||(t[1]=e=>H.value=e)},{default:g((()=>[v(h(e.$t("earn.filter.matchMyAssets")),1)])),_:1},8,["value"])])):d("",!0),0===Le.value?(n(),r("div",gY,[m(rr,{width:"160",height:"84"}),v(" "+h(e.$t("msg.noResults")),1)])):we.value?(n(),i(gH,{key:2,productMap:z.value,assetCategoryMap:Q.value,assetList:Se.value,categoryLabel:he.value,displayIndex:F.value,productIdCampaignsMap:de.value,onSelected:Ne},null,8,["productMap","assetCategoryMap","assetList","categoryLabel","displayIndex","productIdCampaignsMap"])):(n(),r("div",{key:3,class:L(["earn-product-list",{"filter-mode":!we.value}])},[(n(!0),r(p,null,x(Ee.value,(({id:e,activityId:t})=>(n(),i($V,{key:t??e,product:z.value[e],campaign:t?ce.value[t]:void 0,onSelected:Ne},null,8,["product","campaign"])))),128))],2)),F.value<Le.value?(n(),r("div",{key:4,class:"view-more",onClick:$e},[v(h(e.$t("t.viewMore"))+" ",1),m(Ka,{class:"icon-chevron",width:"16",height:"16"})])):d("",!0)]),P(o)?(n(),i($I,{key:0,class:"earn-section",isShowClose:!1})):d("",!0),y("div",fY,[m(bH,{class:"earn-section",useV2Style:"",categoryList:J.value},null,8,["categoryList"])])]),Y.value?(n(),i(PG,{key:0,show:"",type:Y.value.type,categoryType:P(Xn)[Y.value.category],currencyData:Y.value,getProductList:Fe,"onUpdate:show":t[2]||(t[2]=e=>Ne()),"onUpdate:successData":Oe},null,8,["type","categoryType","currencyData"])):re.value?(n(),i(aY,{key:1,isShow:"",successData:re.value,"onUpdate:isShow":t[3]||(t[3]=e=>Oe())},null,8,["successData"])):pe.value&&!G.value?(n(),i(nY,{key:2,category:ne.value,onClosed:t[4]||(t[4]=e=>G.value=!0)},null,8,["category"])):d("",!0),m(Be,null,{default:g((()=>[oe.value?(n(),i(De,{key:0,fromCurrency:oe.value.fromCurrency,toCurrency:oe.value.toCurrency,selectToDisabled:"",lockTransfer:"",closeDialog:()=>oe.value=void 0},null,8,["fromCurrency","toCurrency","closeDialog"])):d("",!0)])),_:1})])}}}),[["__scopeId","data-v-3034df4e"]]),wY=Object.freeze(Object.defineProperty({__proto__:null,default:TY},Symbol.toStringTag,{value:"Module"})),DY={name:"WalletExpressBuySuccess",components:{Status:uo,IconInfo2:Fa,IconChevronDown:ca},props:{isMobileSize:{type:Boolean,default:!1},status:{type:String,required:!0},paymentMethod:{type:String,default:""},unitPrice:{type:String,default:"-"},totalSpend:{type:String,default:""},receivedAmount:{type:String,required:!0},receiveCurrency:{type:String,default:""},spendCurrency:{type:String,default:""},hideViewHistory:{type:Boolean,default:!1},hideFooterViewWallet:{type:Boolean,default:!1},hideFooter:{type:Boolean,default:!1},isShowDone:{type:Boolean,default:!1},isForceShowUnitPrice:{type:Boolean,default:!1}},emits:["onAgain","onDone"],computed:{...l(["lang"]),isProcessing(){return this.status===ur.PROCESSING},isSuccess(){return this.status===ur.SUCCESS},title(){return this.isProcessing?this.$t("t.processing"):this.$t("t.successful")},iconType(){return this.isProcessing?co.PROCESSING:co.SUCCESS},resultFooter:()=>bi("express-buy/result-footer.png")},methods:{onViewHistory(){const e=an.BUY_SELL_CRYPTO;this.$router.replace({name:Ke.WALLET_TRANSACTION_HISTORY,params:{lang:this.lang,category:e}})},goToWallet(){this.$router.push({name:"walletSpot",params:{lang:this.lang}})},goToEarn(){this.$router.push({name:Ke.EARN,params:{lang:this.lang}})}}},AY={key:0},bY={key:1},_Y={class:"info"},SY={class:"flex-box justify-between"},CY={class:"val"},LY={key:0,class:"flex-box justify-between"},EY={class:"val"},IY={class:"flex-box justify-between divider"},kY={class:"val flex-box"},RY={class:"highlight"},NY={class:"flex-box justify-between"},xY={class:"flex-box items-center gap-4"},PY={class:"val flex-box"},OY={class:"highlight"},$Y={key:3,class:"button-wrap"},WY={class:"button-wrap"},FY={class:"footer-title"},BY=["src"];const UY=vr(DY,[["render",function(e,t,a,l,o,u){const c=s("IconInfo2"),p=s("ToolTip"),f=s("BaseButton"),T=s("IconChevronDown"),w=s("Status");return n(),i(w,{class:"status",iconType:u.iconType,title:u.title,isMobileSize:a.isMobileSize,isShowViewHistory:!1,isShowButton:!1},{content:g((()=>[u.isProcessing?(n(),r("div",AY,[y("p",null,h(e.$t("wallet.expressBuy.processing.des1")),1
1),y("p",null,h(e.$t("wallet.expressBuy.processing.des2")),1)])):d("",!0),u.isSuccess?(n(),r("p",bY,h(e.$t("wallet.expressBuy.success.title")),1)):d("",!0),a.hideViewHistory?d("",!0):(n(),r("p",{key:2,class:"view-history",onClick:t[0]||(t[0]=(...e)=>u.onViewHistory&&u.onViewHistory(...e))},h(e.$t("t.viewHistory")),1)),y("div",_Y,[y("div",SY,[v(h(e.$t("t.paymentMethod"))+" ",1),y("span",CY,h(a.paymentMethod),1)]),u.isSuccess||a.isForceShowUnitPrice?(n(),r("div",LY,[v(h(e.$t("t.unitPrice"))+" ",1),y("span",EY,h(a.unitPrice),1)])):d("",!0),y("div",IY,[v(h(e.$t("wallet.topUp.totalSpend"))+" ",1),y("div",kY,[y("span",RY,h(a.totalSpend),1),v(" "+h(a.spendCurrency),1)])]),y("div",NY,[y("div",xY,[v(h(e.$t("t.receive"))+" ",1),m(p,{placement:"top"},{content:g((()=>[m(c,{class:"info-icon",width:"12",height:"12"})])),tooltip:g((()=>[v(h(e.$t("wallet.expressBuy.tooltip")),1)])),_:1})]),y("div",PY,[y("span",OY,h(a.receivedAmount),1),v(" "+h(a.receiveCurrency),1)])])]),a.isShowDone?(n(),r("div",$Y,[m(f,{class:"primary block",size:"large",onClick:t[1]||(t[1]=t=>e.$emit("onDone"))},{default:g((()=>[v(h(e.$t("t.done")),1)])),_:1})])):d("",!0),y("div",WY,[u.isSuccess&&!a.hideFooterViewWallet?(n(),i(f,{key:0,class:"flex-1 outline-primary",size:"large",onClick:u.goToWallet},{default:g((()=>[v(h(e.$t("wallet.expressBuy.viewWallet")),1)])),_:1},8,["onClick"])):d("",!0),m(f,{class:L(["flex-1",{primary:!a.isShowDone}]),size:"large",onClick:t[2]||(t[2]=t=>e.$emit("onAgain"))},{default:g((()=>[v(h(e.$t("wallet.expressBuy.buyAgain")),1)])),_:1},8,["class"])]),a.hideFooter?d("",!0):(n(),r("div",{key:4,class:L(["footer",{"mobile-size":a.isMobileSize}])},[y("div",FY,h(e.$t("wallet.expressBuy.footer.title")),1),y("div",{class:L(["footer-content",{"mobile-size":a.isMobileSize}])},[v(h(e.$t("wallet.expressBuy.footer.subtitle"))+" ",1),y("div",{class:L(["earn-more",{"mobile-size":a.isMobileSize}]),onClick:t[3]||(t[3]=(...e)=>u.goToEarn&&u.goToEarn(...e))},[v(h(e.$t("wallet.expressBuy.earnMore"))+" ",1),m(T,{class:"icon-chevron-down",height:"16"})],2)],2),y("img",{class:"img",src:u.resultFooter},null,8,BY)],2))])),_:1},8,["iconType","title","isMobileSize"])}],["__scopeId","data-v-555369e0"]]);const MY=vr({name:"WalletExpressBuyPending",components:{Status:uo},props:{isMobileSize:{type:Boolean,default:!1},paymentMethod:{type:String,required:!0}},computed:{...l(["lang"]),iconType:()=>co.PROCESSING}},[["render",function(e,t,a,l,r,o){const u=s("Status");return n(),i(u,{class:"status",isMobileSize:a.isMobileSize,iconType:o.iconType,title:e.$t("t.processing"),isShowButton:!1,isShowViewHistory:!1},{content:g((()=>[y("p",null,h(e.$t("wallet.expressBuy.pending.desc.1",{provider:a.paymentMethod})),1),y("p",null,h(e.$t("wallet.expressBuy.pending.desc.2")),1),y("p",{class:"link-text",onClick:t[0]||(t[0]=t=>e.$router.push({name:"home",params:{lang:e.lang}}))},h(e.$t("wallets.payment.service_popup.return_home")),1)])),_:1},8,["isMobileSize","iconType","title"])}],["__scopeId","data-v-7691f2e7"]]),VY={name:"WalletExpressBuyFail",components:{Status:uo},props:{isMobileSize:{type:Boolean,default:!1},errorCode:{type:[Number,String],required:!0}},emits:["onAgain"],data:()=>({ICON_TYPE:co}),computed:{...l(["lang"]),supportUrl(){return gt(this.lang,"NEW_TICKET")}}},HY={key:0,class:"error-code"},GY=["href"];const YY=vr(VY,[["render",function(e,t,a,l,o,u){const c=s("i18n-t"),p=s("Status");return n(),i(p,{class:"status",isMobileSize:a.isMobileSize,iconType:o.ICON_TYPE.FAIL,title:e.$t("t.unsuccessful"),isShowViewHistory:!1,buttonText:e.$t("t.try_again"),onClick:()=>e.$emit("onAgain")},{content:g((()=>[a.errorCode?(n(),r("span",HY,h(e.$t("wallets.errorCode",{code:a.errorCode})),1)):d("",!0),y("p",null,h(e.$t("t.errorSubmitMsg")),1),m(c,{keypath:"t.errorTryAgain",tag:"div"},{customerSupport:g((()=>[y("a",{class:"link",href:u.supportUrl,target:"_blank",rel:"noreferrer noopener"},h(e.$t("t.customerSupport")),9,GY)])),_:1})])),_:1},8,["isMobileSize","iconType","title","buttonText","onClick"])}],["__scopeId","data-v-1eb9ee24"]]),qY=["href"],zY=vr({__name:"WalletExpressBuyPiqFail",props:{isMobileSize:{type:Boolean,default:!1},status:{type:String,default:ur.PIQ_FAIL_PAYMENT_PROCESSING}},emits:["onAgain"],setup(e,{emit:t}){const a=e,l=t,r=U(),o=R((()=>r.state.lang)),u=R((()=>gt(o.value,"NEW_TICKET"))),c=R((()=>cr[a.status]));return(e,t)=>{const r=s("i18n-t");return n(),i(uo,{class:"status",isMobileSize:a.isMobileSize,iconType:P(co).FAIL,title:e.$t("t.unsuccessful"),isShowViewHistory:!1,buttonText:e.$t("t.try_again"),onClick:()=>l("onAgain")},{content:g((()=>[m(r,{keypath:c.value,tag:"div"},{customerSupport:g((()=>[y("a",{class:"link",href:u.value,target:"_blank",rel:"noreferrer noopener"},h(e.$t("t.customerSupport")),9,qY)])),_:1},8,["keypath"])])),_:1},8,["isMobileSize","iconType","title","buttonText","onClick"])}}},[["__scopeId","data-v-c5da3bd5"]]),KY={class:"button-wrap"},jY=vr({__name:"WalletExpressBuyOnramperProcessing",props:{isMobileSize:{type:Boolean,default:!1}},setup(e){const t=M(),a=Ut(),l=e;function r(){t.replace({name:Ke.WALLET_TRANSACTION_HISTORY,params:{lang:a.lang,category:an.BUY_SELL_CRYPTO}})}function o(){t.replace({name:Ke.EXPRESS_BUY,params:{lang:a.lang}}
1)}return(e,t)=>{const a=s("BaseButton");return n(),i(uo,{class:"status",iconType:P(co).PROCESSING,title:e.$t("t.processing"),isMobileSize:l.isMobileSize,isShowViewHistory:!1,isShowButton:!1},{content:g((()=>[y("div",null,[y("p",null,h(e.$t("wallet.expressBuy.processing.des1")),1),y("p",null,h(e.$t("wallet.expressBuy.processing.des2")),1)]),y("p",{class:"view-history",onClick:r},h(e.$t("t.viewHistory")),1),y("div",KY,[m(a,{class:"flex-1 primary",size:"large",onClick:o},{default:g((()=>[v(h(e.$t("wallet.expressBuy.buyAgain")),1)])),_:1})])])),_:1},8,["iconType","title","isMobileSize"])}}},[["__scopeId","data-v-ea00e134"]]),XY={__name:"WalletExpressBuyStatus",props:{statusData:{type:Object,default:()=>({})}},emits:["onAgain","onDone"],setup(e,{emit:t}){const{t:a}=I(),l=e,s=t,r=R((()=>{var e;return null==(e=l.statusData)?void 0:e.isMobileSize})),o=R((()=>{var e;return null==(e=l.statusData)?void 0:e.status})),u=R((()=>{const{providerMethodKey:e}=l.statusData,t=us[e];return t?a(t):"-"})),c=R((()=>{var e;return(null==(e=l.statusData)?void 0:e.providerMethodKey)===hs.CASHTELLER_CASHTELLER})),d=R((()=>{const{receiveCurrency:e,unitPrice:t,spendCurrency:a}=l.statusData||{};return e&&t&&a?`1 ${e} â ${p(t)} ${a}`:"-"}));function p(e,t="max8"){return Xt(e,{formatKey:t,defaultValue:"-"})}const y=R((()=>{const{spendAmount:e}=l.statusData;return p(e||0)})),h=R((()=>{const{exchange:e}=l.statusData;return e?p(e||0):"-"})),v=R((()=>{var e;return(null==(e=l.statusData)?void 0:e.receiveCurrency)||""})),m=R((()=>{var e;return(null==(e=l.statusData)?void 0:e.spendCurrency)||""})),g=R((()=>{switch(o.value){case ur.SUCCESS:case ur.PROCESSING:return UY;case ur.ONRAMPER_PROCESSING:return jY;case ur.PENDING:return MY;case ur.PIQ_FAIL_PAYMENT_PROCESSING:case ur.PIQ_FAIL_BANK_DECLINE:case ur.PIQ_FAIL_REQUEST_COMPLETION:case ur.PIQ_FAIL_CARD_AUTHENTICATION:return zY;case ur.FAIL:default:return YY}}));return(t,a)=>(n(),i(A(g.value),{isMobileSize:r.value,status:o.value,paymentMethod:u.value,unitPrice:d.value,totalSpend:y.value,receivedAmount:h.value,receiveCurrency:v.value,spendCurrency:m.value,errorCode:e.statusData.errorCode||"",hideViewHistory:e.statusData.hideViewHistory,hideFooterViewWallet:e.statusData.hideFooterViewWallet,hideFooter:e.statusData.hideFooter,isShowDone:e.statusData.isShowDone,isForceShowUnitPrice:c.value,onOnAgain:a[0]||(a[0]=e=>s("onAgain",e)),onOnDone:a[1]||(a[1]=e=>s("onDone",e))},null,40,["isMobileSize","status","paymentMethod","unitPrice","totalSpend","receivedAmount","receiveCurrency","spendCurrency","errorCode","hideViewHistory","hideFooterViewWallet","hideFooter","isShowDone","isForceShowUnitPrice"]))}};const QY=vr({name:"WalletExpressBuyResultStandalone",components:{WalletExpressBuyStatus:XY},data:()=>({statusData:{status:ur.PROCESSING}}),computed:{...l(["lang"])},created(){const{status:e,receiveCurrency:t,spendCurrency:a,spendAmount:l,unitPrice:s,exchange:i,providerMethodKey:n,code:r,errorCode:o,transactionId:u}=this.$route.query||{};u?this.getTransactionDetail(u):this.statusData={status:e,spendCurrency:a,receiveCurrency:t,spendAmount:l,unitPrice:s,exchange:i,providerMethodKey:n,errorCode:r||o}},methods:{async getTransactionDetail(e){try{dr({transactionId:e,historyType:pr.EXPRESS_BUY});const t=await Xl.getSpotWalletDetail(e,pr.EXPRESS_BUY),{status:a,unitPrice:l,srcAmount:s,srcCurrency:i,targetAmount:n,targetCurrency:r,method:o,provider:u}=t,c={status:"",spendAmount:s,spendCurrency:i,receiveCurrency:r,unitPrice:l,exchange:n,providerMethodKey:`${u}_${o}`,errorCode:""};switch(a){case be.COMPLETED:case be.COMPLETE:c.status=ur.SUCCESS;break;case be.PROCESSING:case be.PENDING:c.status=ur.PROCESSING;break;case be.DECLINED:case be.FAILURE:default:c.status=ur.FAIL}this.statusData=c}catch(t){this.statusData.status=ur.FAIL,this.statusData.errorCode=t}},onAgain(){this.$router.replace({name:Ke.EXPRESS_BUY_CONFIRM,params:{lang:this.lang},query:{spendAmount:"",spendCurrency:this.statusData.spendCurrency,receiveCurrency:this.statusData.receiveCurrency,payment:this.statusData.providerMethodKey}}).catch()}}},[["render",function(e,t,a,l,r,o){const u=s("WalletExpressBuyStatus");return n(),i(u,{statusData:r.statusData,onOnAgain:o.onAgain},null,8,["statusData","onOnAgain"])}]]),ZY=Object.freeze(Object.defineProperty({__proto__:null,default:QY},Symbol.toStringTag,{value:"Module"}));const JY=vr({name:"ProcessingStatus",components:{Status:uo},props:{statusData:{type:Object,default:()=>({})}},data:()=>({ICON_TYPE:co}),computed:{supportUrl(){return gt(this.lang)},content(){return this.statusData.contentText||this.$t("wallets.deposit.processing.text")},isShowViewHistory(){return!1!==this.statusData.isShowViewHistory}}},[["render",function(e,t,a,l,r,o){const u=s("Status");return n(),i(u,{class:"processing-status",iconType:r.ICON_TYPE.PROCESSING,title:e.$t("wallets.requestReceived"),isS
1howViewHistory:o.isShowViewHistory},{content:g((()=>[v(h(o.content),1)])),_:1},8,["iconType","title","isShowViewHistory"])}]]),eq={name:"FailStatus",components:{Status:uo},props:{statusData:{type:Object,default:()=>({})}},data:()=>({ICON_TYPE:co}),computed:{...l(["lang"]),supportUrl(){return gt(this.lang)}}},tq=["href"];const aq=vr(eq,[["render",function(e,t,a,l,r,o){const u=s("i18n-t"),c=s("Status");return n(),i(c,{class:"fail-status",iconType:r.ICON_TYPE.FAIL,title:e.$t("wallets.somethingWentWrong"),note:a.statusData.errorCode&&e.$t("wallets.errorCode",{code:a.statusData.errorCode})},{content:g((()=>[m(u,{keypath:"wallets.deposit.fail.text"},{customerSupport:g((()=>[y("a",{class:"support-link",href:o.supportUrl,target:"_blank",rel:"noopener nofollow"},h(e.$t("t.customerSupport")),9,tq)])),_:1})])),_:1},8,["iconType","title","note"])}],["__scopeId","data-v-16206cc7"]]);const lq=vr({name:"CancelStatus",components:{Status:uo},data:()=>({ICON_TYPE:co})},[["render",function(e,t,a,l,r,o){const u=s("Status");return n(),i(u,{class:"cancel-status",iconType:r.ICON_TYPE.CANCEL,title:e.$t("t.cancel"),isShowViewHistory:""},{content:g((()=>[y("p",null,h(e.$t("wallets.deposit.processing.text")),1)])),_:1},8,["iconType","title"])}]]);const sq=vr({name:"SuccessStatus",components:{Status:uo},data:()=>({ICON_TYPE:co})},[["render",function(e,t,a,l,r,o){const u=s("Status");return n(),i(u,{class:"success-status",iconType:r.ICON_TYPE.SUCCESS,title:e.$t("wallets.deposit.success.title"),isShowViewHistory:!1},{content:g((()=>[v(h(e.$t("wallets.deposit.success.content")),1)])),_:1},8,["iconType","title"])}]]),iq={name:"PiqFailStatus",components:{Status:uo},props:{statusData:{type:Object,default:()=>({})}},data:()=>({ICON_TYPE:co}),computed:{...l(["lang"]),supportUrl(){return gt(this.lang)},failContantKey(){return yr[this.statusData.type]}}},nq=["href"];const rq=vr(iq,[["render",function(e,t,a,l,r,o){const u=s("i18n-t"),c=s("Status");return n(),i(c,{class:"fail-status",iconType:r.ICON_TYPE.FAIL,title:e.$t("wallets.somethingWentWrong")},{content:g((()=>[m(u,{keypath:o.failContantKey},{customerSupport:g((()=>[y("a",{class:"support-link",href:o.supportUrl,target:"_blank",rel:"noopener nofollow"},h(e.$t("t.customerSupport")),9,nq)])),_:1},8,["keypath"])])),_:1},8,["iconType","title"])}],["__scopeId","data-v-e74dbe7e"]]);const oq=vr({name:"WalletDepositFiatStatus",props:{statusData:{type:Object,default:()=>({})}},computed:{component(){switch(this.statusData.type){case hr.PROCESSING:return JY;case hr.CANCEL:return lq;case hr.SUCCESS:return sq;case hr.PIQ_FAIL_PAYMENT_PROCESSING:case hr.PIQ_FAIL_BANK_DECLINE:case hr.PIQ_FAIL_REQUEST_COMPLETION:case hr.PIQ_FAIL_CARD_AUTHENTICATION:return rq;case hr.FAIL:default:return aq}}}},[["render",function(e,t,a,l,s,r){return n(),i(A(r.component),{statusData:a.statusData},null,8,["statusData"])}]]);const uq=vr({name:"WalletDepositResultStandalone",components:{WalletDepositFiatStatus:oq},data:()=>({statusData:{}}),created(){const{status:e,code:t,errorCode:a}=this.$route.query||{};this.statusData={type:e.toUpperCase(),errorCode:t||a}}},[["render",function(e,t,a,l,r,o){const u=s("WalletDepositFiatStatus");return n(),i(u,{statusData:r.statusData},null,8,["statusData"])}]]),cq=Object.freeze(Object.defineProperty({__proto__:null,default:uq},Symbol.toStringTag,{value:"Module"}));export{zm as D,PG as E,Wm as H,_p as I,aY as S,oq as W,XY as _,Wg as a,TO as b,GO as c,XM as d,wY as e,ZY as f,hx as g,cq as h,lA as u}; 2//# sourceMappingURL=TD8YArC6.js.map
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.