1import{aD as L,u as A,j as e,c as k,T as n,aF as H,a as W,r as m,aM as q,aJ as z,aH as O}from"./index-DdjvC5Ct.js";import{u as $}from"./hook-DfbWSpZN.js";import{P as w}from"./index-BLfecQ3j.js";import{S as B}from"./index-DFpQZYCw.js";import{L as M}from"./index-DLMIHW6P.js";import{B as R}from"./index-BkIyAUuf.js";import{A as G}from"./index-BhYGyuey.js";import{f as P}from"./fixed-CPKla5vZ.js";import{T as Q}from"./index-C_xXpvxZ.js";import{c as U}from"./calcAmountFromCommision-BBKIUzcX.js";import"./toConsumableArray-BXiM10ZO.js";import"./right_arrow-Dy2-UBI4.js";const F={all:"All Types",LIQUIDITY:"Liquidity Staking",POOLED:"Pooled Staking",NATIVE:"Native Staking"},D=Object.entries(F).map(a=>{const[r,d]=a;return{value:r,label:d}}),Y="_coin_1pdae_1",J="_coinIconsWrapper_1pdae_7",V="_liquidity_1pdae_13",K="_img_1pdae_18",X="_imgPair_1pdae_19",Z="_op_1pdae_38",C="_textBox_1pdae_42",ee="_button_1pdae_48",c={coin:Y,coinIconsWrapper:J,liquidity:V,img:K,imgPair:X,op:Z,textBox:C,button:ee},se=({product:a})=>{const{coinsWallet:r}=L(["coinsWallet"]),{modal:d}=A(),t=r[a.coin],s=a.coin_pair?r[a.coin_pair]:null,x=F[a.type],b=a.duration.toLowerCase(),u=U(Number(a.pending_unstaked||0),a.unstake_penalty_amt,a.unstake_penalty_perc)+Number(a.unstaked||0),y=u*((t==null?void 0:t.price)||0),N=Number(a.received),g=N*((t==null?void 0:t.price)||0);let h=0,j=0,f=0,o=0;a.type==="LIQUIDITY"&&a.coin_pair&&(h=U(Number(a.pending_unstaked_pair||0),a.unstake_penalty_amt_pair,a.unstake_penalty_perc_pair)+Number(a.unstaked_pair||0),j=h*((s==null?void 0:s.price)||0),f=Number(a.received_pair||0),o=f*((s==null?void 0:s.price)||0));const S=y+j,i=g+o;return e.jsx(Q,{rows:[[{title:"",value:e.jsxs("div",{className:c.coin,children:[e.jsxs("div",{className:c.coinIconsWrapper,children:[e.jsx("img",{className:k(c.img,{[c.liquidity]:!!a.coin_pair}),alt:t==null?void 0:t.name,src:t==null?void 0:t.image}),s&&e.jsx("img",{className:k(c.img,c.imgPair,{[c.liquidity]:!!a.coin_pair}),alt:s==null?void 0:s.name,src:s==null?void 0:s.image})]}),e.jsxs("div",{className:c.textBox,children:[e.jsx(n,{type:"400_14",children:t==null?void 0:t.name}),s&&e.jsx(n,{className:c.op,type:"700_12",children:`${t==null?void 0:t.symbol}/${s==null?void 0:s.symbol}`}),!s&&e.jsx(n,{className:c.op,type:"700_12",children:t==null?void 0:t.symbol})]})]})},{title:"Product",value:e.jsx(n,{type:"500_14",children:x})},{title:"Term",value:e.jsx(n,{type:"500_14",className:c.capitalize,children:b})}],[{title:"Holdings",value:e.jsxs("div",{className:c.textBox,children:[e.jsxs(n,{type:"400_14",children:[u.toFixed(8)," ",(t==null?void 0:t.symbol)||""]}),a.coin_pair&&s&&e.jsxs(n,{type:"400_14",children:[h.toFixed(8)," ",(s==null?void 0:s.symbol)||""]}),e.jsxs(n,{type:"400_11",children:["â ",P(S,3)," USD"]})]})},{title:"Profit",value:e.jsxs("div",{className:c.textBox,children:[e.jsxs(n,{type:"400_14",children:[N.toFixed(8)," ",(t==null?void 0:t.symbol)||""]}),a.coin_pair&&s&&e.jsxs(n,{type:"400_14",children:[f.toFixed(8)," ",(s==null?void 0:s.symbol)||""]}),e.jsxs(n,{type:"400_11",children:["â ",P(i,3)," USD"]})]})}],[{title:"",value:e.jsx(H,{className:k(c.button,"button"),onClick:()=>d.open("staking-entry",[a.entry_id+"",a.type]),children:e.jsx(n,{type:"400_14",children:"Details"})})}]]})},te="_filters_1fovy_1",ae="_content_1fovy_9",ie="_empty_1fovy_16",ne="_loading_1fovy_37",le="_coinItem_1fovy_44",oe="_img_1fovy_49",ce="_name_1fovy_55",me="_noImg_1fovy_62",pe="_op_1fovy_67",_e="_select_1fovy_71",de="_subName_1fovy_71",re="_simpleText_1fovy_77",xe="_capitalize_1fovy_82",l={filters:te,content:ae,empty:ie,loading:ne,coinItem:le,img:oe,name:ce,noImg:me,op:pe,select:_e,subName:de,simpleText:re,capitalize:xe},E=25,T=1,Ie=({})=>{const{page:a,modal:r}=A(),{coins:d}=L(["coinsWallet"]),{getText:t}=$(),{tg:s}=W(),[x,b]=m.useState(T),[I,u]=m.useState(T),[y,N]=m.useState(0),[g,h]=m.useState(0),j=m.useMemo(()=>[{image:null,name:"All Coins",symbol:null,key:"all"},...d.map(({image:i,name:p,symbol:_})=>({image:i,name:p,symbol:_,key:_}))],[d]),[f,{data:o,loading:S}]=q(O.stakingHoldingsHistory,{});return m.useEffect(()=>{s==null||s.BackButton.show();const i=()=>a.navigate("staking/my");return s==null||s.BackButton.onClick(i),()=>{s==null||s.BackButton.hide(),s==null||s.BackButton.offClick(i)}},[]),m.useEffect(()=>{var _,v;const i=(_=j[g])==null?void 0:_.key,p=(v=D[y])==null?void 0:v.value;f({page:x,per_page:E,search:"",coin:i==="all"?null:i,type:p==="all"?null:p})},[x,g,y]),m.useEffect(()=>{const i=Math.ceil(((o==null?void 0:o.total)||1)/E);u(i)},[o==null?void 0:o.total]),e.jsx(w,{header:{title:"Historical Holdings"},children:e.jsxs("div",{className:l.holdings,children:[e.jsxs("div",{className:l.filters,children:[e.jsx(B,{classes:{container:l.select},onChange:h,value:g,children:j.map(({image:i,key:p,name:_,symbol
1:v})=>e.jsxs("div",{className:l.coinItem,children:[i?e.jsx("img",{className:l.img,src:i}):e.jsx("div",{className:l.noImg}),e.jsxs("div",{className:k(l.name,l.simpleText),children:[e.jsx(n,{type:"700_12",children:_}),v?e.jsx(n,{type:"700_12",className:k(l.op,l.subName),children:v}):null]})]}))}),e.jsx(B,{value:y,onChange:N,classes:{container:l.select},children:D.map(({label:i,value:p})=>e.jsx(n,{className:l.simpleText,type:"700_12",children:i}))})]}),e.jsx("div",{className:l.content,children:S?e.jsx("div",{className:l.loading,children:e.jsx(z,{size:50})}):o!=null&&o.products.length?e.jsxs(e.Fragment,{children:[o==null?void 0:o.products.map(i=>e.jsx(se,{product:i})),e.jsx("div",{className:l.pagination,children:e.jsx(G,{currentPage:x,onChange:b,firstPage:T,lastPage:I})})]}):e.jsx(e.Fragment,{children:e.jsxs(R,{className:l.empty,children:[e.jsx(n,{type:"500_16",children:t("staking/noTransactions")}),e.jsxs(n,{type:"500_14",children:["Well, that's okay! Find highest paying",e.jsx(M,{href:{location:"staking"},children:"crypto staking products"})]})]})})})]})})};export{Ie as default};
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.