@edgex-web/components 0.1.0-beta.58 → 0.1.0-beta.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { o as e, C as i, D as t, n, p as r, L as p, o as d, S as L, T as h, W as D, y as g, r as u, A as w, h as W, w as C, G as m, q as E, z as A, v as O, F as T, t as M, E as S, u as l, j as f, x as P, m as _, k as c, I as v } from "./index-DEAsjl9w.mjs";
1
+ import { o as e, C as i, D as t, n, p as r, L as p, o as d, S as L, T as h, W as D, y as g, r as u, A as w, h as W, w as C, G as m, q as E, z as A, v as O, F as T, t as M, E as S, u as l, j as f, x as P, m as _, k as c, I as v } from "./index-LtsKoLxi.mjs";
2
2
  import "react";
3
3
  export {
4
4
  e as ChromeLoader,
package/dist/index.umd.js CHANGED
@@ -168,5 +168,5 @@ ${Eb(d)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessa
168
168
  relative
169
169
  ${c}
170
170
  ${s}
171
- `,children:[t,o&&M.jsx(S0,{ref:f,placement:h.placement||n})]})})]})},Io="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAIcSURBVHgBxZc/T8JAGMafA4mDEXFw0DiQmDi4CP5JHGFx0qizg8QvIHwCZHYAvwEm7mji5CJuJv7DxcWYYMLmIEYXY/R8j6tQaBvuaCm/pOlbSu99+rZ97zlgwDBowvNLCdrF6NJ50891OvNC+wrL3JShgZIAnl+JAj97FKXoMNLl7ySGnQDBHMtcVeFGAM8nKNlnlsI0eoIVuwlhzsmXqcwoURSFK1iVRCSdRDDn5PwC3cutingsJOK60nkiYE0unrdi8uFRIDwFBSJiTKOqzgKMl00teXgS2D0Fto+BiVkoIMYs8Xws4iiAkmeVn/n0oqyA2NQEQI4dytoKMEqfQt/haZmrQ4C8e7/4TtsI4JvwDbYDswCjvXr1yakQMXI2KxCD/8RMAtx2ux5gcjIzBAT8LH8bAQwYbwR8fUAb/vtuEsAr0OX5Eng8o30ZqN1BHzFLAkPGkb4AcdfnObigkbM5HdN3+Qb/ekGdrNu4CMyd8Ag6iElo/QBYzcpYByYsm8QkIFSADmI2nEkAc2sUL0ALHsxZBEjLxA+hSu22tb0+KV9Gd18027M2SybNQui+f53R6g/b+gDLVMi7YQsND+c5dTtzamlE0jiyJLwVYZhSqzO27YRSxFD8v1m4Q4xh74gdBUgRQm2QKsH0Ps82xEs9EndK3sgDlWGkW96naANqSzMSHSy4XprZi2kuTqN09VjrBH9AD4vTgfMHJt+rxIFF7EgAAAAASUVORK5CYII=",XS=(e,t)=>Number(e)>Number(t),$t=e=>{if(!e||e===""||isNaN(Number(e)))return"0.00";const t=Number(e);if(t===0)return"0.00";let n=t.toString();n.includes("e")&&(n=t.toFixed(20));const r=n.split("."),o=r[0];let s=r[1]||"";return s.length>6&&(s=s.substring(0,6)),s=s.replace(/0+$/,""),s?(s.length===1&&(s+="0"),o+"."+s):o+".00"},Xc=(e,t="0")=>{if(/[^0-9.]/.test(e))return{isValid:!1,formattedValue:"",errorType:"invalid_char"};if(e===".")return{isValid:!0,formattedValue:"0."};if((e.match(/\./g)||[]).length>1)return{isValid:!1,formattedValue:"",errorType:"invalid_char"};if(!e||e==="")return{isValid:!0,formattedValue:""};const o=e.split(".");if(o.length===2&&o[1].length>6){const a=o[0]+"."+o[1].substring(0,6);return Xc(a,t)}const s=parseFloat(e),i=parseFloat(t);return!isNaN(s)&&!isNaN(i)&&s>i?{isValid:!0,formattedValue:$t(t),errorType:"auto_adjusted_to_max"}:{isValid:!0,formattedValue:e}},Ks={ETHEREUM:1,ARBITRUM:42161,ARBITRUM_SEPOLIA:421614,SEPOLIA:11155111},QS=[Ks.ETHEREUM,Ks.SEPOLIA,Ks.ARBITRUM,Ks.ARBITRUM_SEPOLIA],JS=e=>{if(e.chainId!==void 0){const t=typeof e.chainId=="string"?parseInt(e.chainId,10):e.chainId;return!QS.includes(t)}return!0},eP=({currentActiveChain:e,selectedToken:t,address:n,onDeposit:r,onCopy:o,onClose:s})=>{const{t:i}=dt(),c=v.useMemo(()=>JS(e||{}),[e]);return M.jsxs(M.Fragment,{children:[M.jsx("div",{className:"flex justify-center mt-4 mb-3",children:n&&M.jsx("div",{className:"bg-white rounded-lg",children:M.jsx(o0,{value:n,size:120,level:"L",bgColor:"#ffffff",fgColor:"#000000",marginSize:0})})}),n&&M.jsxs("div",{className:"flex items-center justify-between bg-fill-input-primary rounded-lg py-2 px-3 mb-3",children:[M.jsx("span",{className:"flex-1 text-text-primary text-sm font-medium break-all mr-3",children:n}),M.jsx(nS,{onCopy:()=>{o&&o(n)},text:n,children:M.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[M.jsx("rect",{x:"2.08496",y:"4.02295",width:"9.89893",height:"9.89893",rx:"2",stroke:"#F9F9F9"}),M.jsx("path",{d:"M5.85547 2.07861H11.415C12.7957 2.07861 13.915 3.1979 13.915 4.57861V10.0786",stroke:"#F9F9F9",strokeLinecap:"round"})]})},"copy")]}),M.jsxs("div",{className:"border-b border-dashed border-line-divider-secondary pb-4",children:[M.jsxs("div",{className:"flex items-start",children:[M.jsx("div",{className:"w-5",children:M.jsx("img",{src:Io,className:"w-4 h-4",alt:"Warning"})}),M.jsx("div",{className:"flex-1",children:M.jsx("p",{className:"text-xs text-functional-orange-1",children:i("deposit.depositAllTip",{coin:t,v:e==null?void 0:e.chain})})})]}),c&&M.jsxs(M.Fragment,{children:[M.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"}),M.jsx("div",{className:"flex items-start pl-5 text-functional-orange-1 text-xs",children:i("deposit.depositTipFor25w")})]})]}),M.jsxs("div",{className:"text-sm",children:[M.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-4",children:[M.jsx("span",{className:"text-text-tertiary",children:i("deposit.arrivalTime")}),M.jsx(Gn,{content:M.jsxs("div",{className:"grid flex-grow max-w-[300px] min-w-[80px] rounded-2xl flex-col gap-[10px]",children:[M.jsx("p",{children:i("deposit.arrivaltimeTooltip1",{v:(e==null?void 0:e.blockTime)*e.txConfirm/60,v1:e==null?void 0:e.txConfirm})}),M.jsx("p",{children:i("deposit.arrivaltimeTooltip2")})]}),placement:"top",children:M.jsx("span",{className:"text-text-primary font-medium text-right border-b-[2px] border-dashed border-line-divider-primary decoration-dashed",children:i("deposit.arrivalEstimated",{v:(e==null?void 0:e.blockTime)*e.txConfirm/60})})})]}),M.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-1",children:[M.jsx("span",{className:"text-text-tertiary",children:i("deposit.minDeposit")}),M.jsxs("span",{className:"text-text-primary font-medium text-right",children:["10 ",t]})]}),M.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-1",children:[M.jsx("span",{className:"text-text-tertiary",children:i("deposit.maxDeposit")}),M.jsxs("span",{className:"text-text-primary font-medium text-right",children:["200,000 ",t]})]})]}),M.jsx("button",{className:"w-full h-[38px] bg-fill-btn-primary rounded-xl text-sm font-medium text-text-on-sec-btn mt-4",onClick:()=>{r&&r({amount:"",chainId:e.chainId,tokenAddress:n,tokenSymbol:t}),s()},children:i("deposit.title")})]})},Mo=({size:e="xs",color:t,className:n="",label:r="Loading...",inline:o=!1})=>{const s=t?`loading-${t}`:"",i=o?"loading-inline":"";return M.jsx("span",{className:`loading loading-${e} loading-spinner ${s} ${i} ${n}`.trim(),"aria-label":r,role:"status","aria-live":"polite"})},tP=(e,t,n)=>{const r=parseFloat(String(e)||"0"),o=parseFloat(String(t)||"0");if(o>0){const s=r-o,i=$t(Math.max(0,s).toString());return M.jsxs("span",{className:"flex items-center gap-1",children:[$t(e),M.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),i," ",n]})}return`${$t(e)} ${n}`},nP=(e,t,n)=>{if(!e||e===""||e==="0"||e==="0.00")return!1;const r=parseFloat(e),o=parseFloat(t);return!(isNaN(r)||isNaN(o)||r>o||!n)},rP=(e,t,n)=>{if(!Rh(e,n))return!1;try{const r=new ke(t||"0"),o=new ke("200000");return r.isNaN()||o.isNaN()?!1:r.gte(o)}catch{return!1}},oP=(e,t,n)=>{let r=t||"0";if(Rh(e,n))try{const o=new ke(r),s=new ke("200000");o.gt(s)&&(r="200000")}catch(o){console.warn("Error calculating max amount limit:",o)}return r},P0={chains:[],spotChains:[],currentActiveAccount:{wallet:"EVM",ethAddress:"",accountId:"",smartWalletAddress:""},defaultChainId:1,defaultAccountType:"perpetual",balances:{spot:{},perpetual:{}}};let We=null;const $0=v.forwardRef((e,t)=>{const[n,r]=v.useState(!1),[o,s]=v.useState(!1),[i,c]=v.useState(P0),a=v.useCallback(h=>{c(h),r(!0)},[]),u=v.useCallback(h=>{c(m=>({...m,...h}))},[]),l=v.useCallback(()=>{r(!1),s(!1),i.onClose&&i.onClose()},[i.onClose]),f=v.useCallback(h=>{s(h)},[]),p=v.useCallback(()=>n,[n]),d=v.useCallback(()=>o,[o]);return v.useImperativeHandle(t,()=>({openDeposit:a,closeDeposit:l,updateDepositOptions:u,setDepositLoading:f,isOpen:p,isLoading:d}),[a,l,u,f,p,d]),v.useEffect(()=>(We={openDeposit:a,closeDeposit:l,updateDepositOptions:u,setDepositLoading:f,isOpen:p,isLoading:d},()=>{We=null}),[a,l,u,f,p,d]),n?M.jsx(I0,{isOpen:n,isLoading:o,onClose:l,currentActiveAccount:i.currentActiveAccount,chains:i.chains,spotChains:i.spotChains,defaultChainId:i.defaultChainId,defaultAccountType:i.defaultAccountType,balances:i.balances,wagmiHooks:i.wagmiHooks,onDeposit:i.onDeposit,onCopy:i.onCopy,onChainChange:h=>{var m;return(m=i.onChainChange)==null?void 0:m.call(i,h)},onTokenChange:h=>{var m;return(m=i.onTokenChange)==null?void 0:m.call(i,h)}}):null});$0.displayName="DepositManager";const A0=e=>{if(!We){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}We.openDeposit(e||P0)},T0=()=>{if(!We){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}We.closeDeposit()},O0=e=>{We&&We.updateDepositOptions(e)},Ys=e=>{if(!We){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}We.setDepositLoading(e)},sP=()=>We?We.isOpen():!1,C0=()=>We?We.isLoading():!1,iP=()=>({openDeposit:A0,closeDeposit:T0,updateDepositOptions:O0,setDepositLoading:Ys,isOpen:sP,isLoading:C0}),aP=e=>{const{t}=dt(),{isNetworkMismatch:n,depositAmount:r,approved:o,currentTokenBalance:s,selectedToken:i,showLayerZeroTip:c,minDeposit:a=10}=e;return v.useMemo(()=>{if(n)return{text:t("deposit.switchNetwork"),disabled:!0,isNetworkSwitch:!0};const u=parseFloat(r||"0"),f=(i||"").toUpperCase()==="ETH"?.001:a,p=nP(r,s||"0",o);return!r||u===0||!o?{text:t(c?"deposit.layerZeroDepositButton":"deposit.confirmDeposit"),disabled:!0,isNetworkSwitch:!1}:u<f?{text:t("deposit.minDepositParsed",{amount:f,token:i}),disabled:!0,isNetworkSwitch:!1}:{text:t(c?"deposit.layerZeroDepositButton":"deposit.confirmDeposit"),disabled:!p,isNetworkSwitch:!1}},[n,r,o,s,i,c,a,t])};function cP(e){const{account:t,accountChainId:n,targetChainId:r,tokenInfo:o,amount:s}=e,{useReadContract:i,useWriteContract:c,usePublicClient:a,useSwitchChain:u}=e.wagmiHooks,l=o==null?void 0:o.tokenAddress,f=(o==null?void 0:o.decimals)??18,p=o==null?void 0:o.contractAddress,d=!l||l.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",{switchChainAsync:h}=u(),{writeContractAsync:m}=c(),x=a(),T=i({address:l,abi:ur,functionName:"allowance",args:[An(t||""),p],chainId:r,query:{enabled:!!(!d&&t&&r&&l&&p)}}),y=T!=null&&T.isSuccess?T.data:void 0,A=v.useMemo(()=>{if(d)return!0;if(!T.isSuccess||y===void 0||y===0n)return!1;try{const L=mw(String(Number(s||"0")||0),Number(f));return y>=L}catch{return!1}},[d,T.isSuccess,y,s,f]),B=v.useCallback(async()=>{try{if(r&&n&&+n!=+r&&await h({chainId:+r}),!m||!x||!l||!p)return;const _=An(l),D=An(p);if((y||0n)>0n){const $=await m({abi:ur,address:_,functionName:"approve",args:[D,0n]});await x.waitForTransactionReceipt({hash:$})}const w=await m({abi:ur,address:_,functionName:"approve",args:[D,Ll]});await x.waitForTransactionReceipt({hash:w}),T!=null&&T.refetch&&await T.refetch()}catch(L){console.error("[useApprove] onApprove failed:",L)}},[r,n,l,p,y,T,m,x,h]);return{approve:A,onApprove:B}}const uP=({token:e,account:t,chainId:n,wagmiHooks:r,onResult:o})=>{var i;const s=(i=r==null?void 0:r.useBalance)==null?void 0:i.call(r,{address:t,token:e.tokenAddress,chainId:n,query:{enabled:!!t&&!!n&&!!e.tokenAddress&&!!(r!=null&&r.useBalance)}});return v.useEffect(()=>{o(An(e.tokenAddress),{balance:s})},[s,e.tokenAddress,o]),null},lP=({account:e,chainId:t,contractAddress:n,tokens:r=[],wagmiHooks:o})=>{var y;const s=typeof t=="string"?Number.isFinite(Number(t))?Number(t):void 0:t,i=v.useMemo(()=>{const A="0x0000000000000000000000000000000000000000",B="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";return r.filter(L=>{const _=L.tokenAddress;if(!_)return!1;const D=_.toLowerCase();return!(_===A||D===B)})},[r]),[c,a]=v.useState({}),u=v.useCallback((A,B)=>{a(L=>({...L,[A]:B}))},[]),l=(y=o==null?void 0:o.useBalance)==null?void 0:y.call(o,{address:e,chainId:s,query:{enabled:!!e&&!!s&&!!(o!=null&&o.useBalance)}}),[f,p]=v.useState(0),d=v.useMemo(()=>i.map(A=>v.createElement(uP,{key:`${A.tokenAddress}-${f}`,token:A,account:e,chainId:s,contractAddress:n,wagmiHooks:o,onResult:u})),[i,e,s,n,o,u,f]),h=v.useMemo(()=>{const A=l!=null&&l.data?{value:l.data.value,formatted:l.data.formatted,decimals:l.data.decimals,symbol:l.data.symbol}:{value:BigInt(0),formatted:"0",decimals:18,symbol:"ETH"},B=i.map(_=>{const D=c[An(_.tokenAddress)],g=D==null?void 0:D.balance,w=g==null?void 0:g.data;return{address:An(_.tokenAddress),value:(w==null?void 0:w.value)||BigInt(0),formatted:(w==null?void 0:w.formatted)||"0",decimals:(w==null?void 0:w.decimals)||_.decimals}}).filter(_=>_.address),L=B.reduce((_,D)=>({..._,[D.address]:{balance:D}}),{});return{balanceList:B,baseTokenBalance:A,combinedData:L}},[l,c,i]),m=v.useCallback(async()=>h,[h]),x=v.useMemo(()=>{const A=(l==null?void 0:l.isLoading)||!1,B=Object.values(c).some(L=>{var _;return(_=L.balance)==null?void 0:_.isLoading});return A||B},[l==null?void 0:l.isLoading,c]),T=v.useCallback(()=>p(A=>A+1),[]);return{multicallRun:m,multicallRefresh:T,multicallResult:h,validErcTokens:i,isLoading:x,queryComponents:d}},fP=({address:e,currentActiveChain:t,selectedToken:n,accountType:r,platformBalance:o,isLoading:s,wagmiHooks:i,onChainChange:c,onDeposit:a})=>{const{t:u}=dt(),l=i.useAccount(),f=t.tokenList.find(j=>j.token===n||j.symbol===n),p=t.chainId,[d,h]=v.useState("");v.useEffect(()=>{h("")},[n,t.chainId]);const{multicallResult:m,queryComponents:x}=lP({account:e,chainId:t.chainId,contractAddress:(f==null?void 0:f.contractAddress)||(t==null?void 0:t.contractAddress),tokens:(t==null?void 0:t.tokenList)||[],wagmiHooks:i}),T=v.useMemo(()=>{var U;if(!f)return"0";if(!f.tokenAddress||f.tokenAddress.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")return m.baseTokenBalance.formatted;const j=m.combinedData[f.tokenAddress];return((U=j==null?void 0:j.balance)==null?void 0:U.formatted)||"0"},[f,m]),y="0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9",A="0xceeed84620e5eb9ab1d6dfc316867d2cda332e41",B=v.useMemo(()=>{var j,U;return jv({chain:_v,transport:g1(t.rpcUrl||((j=window==null?void 0:window.ENV)==null?void 0:j.CHAIN_RPC_URL_42161)||((U=window==null?void 0:window.ENV)==null?void 0:U.CHAIN_RPC_URL_421614))})},[t.rpcUrl]),L="1000000000000",{formatted:_}=Uv({client:B,tokenAddress:y,holder:A,decimals:6,fallbackFormatted:L,pollingInterval:12e3}),[D,g]=v.useState(!1),{approve:w,onApprove:$}=cP({account:e,accountChainId:l.chainId,targetChainId:+t.chainId,tokenInfo:f,amount:d,wagmiHooks:i}),I=v.useCallback(async()=>{if(!D)try{g(!0),await $()}catch(j){console.error("Approve failed:",j)}finally{g(!1)}},[D,$]),C=v.useMemo(()=>+l.chainId!=+t.chainId,[l.chainId,t.chainId]),P=v.useCallback(async()=>{c&&c(p)},[c,p]);v.useEffect(()=>{C&&P()},[C,P]);const{showLayerZeroTip:S,layerZeroTipKey:E}=v.useMemo(()=>{const j=+t.chainId==42161||+t.chainId==421614,U=(n==null?void 0:n.toUpperCase())==="USDT",H=new ke(d||"0"),K=new ke("200000");let G=!1,W;if(j&&U&&d)if(H.gte(K))G=!0,W="deposit.layerZeroDepositTipGte200k";else{const V=_;if(typeof V=="string"&&V.length>0){const Q=new ke(V);!Q.isNaN()&&H.gte(Q)&&(G=!0,W="deposit.layerZeroDepositTipExceedPool")}}return{showLayerZeroTip:G,layerZeroTipKey:W}},[t.chainId,n,d,_]),O=v.useCallback(()=>oP(+t.chainId,T||"0",n),[T,t==null?void 0:t.chainId,n]),N=v.useMemo(()=>rP(+t.chainId,d,n),[t==null?void 0:t.chainId,d,n]),b=aP({isNetworkMismatch:C,depositAmount:d,approved:w,currentTokenBalance:T,selectedToken:n,showLayerZeroTip:S,minDeposit:10}),k=j=>{const U=j.target.value,H=O(),K=Xc(U,H);if(K.isValid)h(K.formattedValue),K.errorType;else return K.errorType==="exceed_balance",void 0},R=v.useCallback(async()=>{Ys(!0);try{a&&a({amount:d,chainId:p,tokenAddress:(f==null?void 0:f.tokenAddress)||"",tokenSymbol:n,accountType:r})}catch(j){console.error("Deposit error:",j),Ys(!1)}},[a,d,p,f==null?void 0:f.tokenAddress,r,n]);return M.jsxs(M.Fragment,{children:[x,M.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[M.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[M.jsx("input",{type:"text",placeholder:u("deposit.amount"),value:d,onChange:k,className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-none border-none p-0 h-full"}),M.jsx("button",{onClick:()=>{const j=O();h(j)},className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:u("deposit.max")})]}),M.jsx("div",{className:"h-[1px] bg-line-divider-secondary mb-2"}),M.jsxs("div",{className:"flex justify-between items-center",children:[M.jsx(Gn,{content:u("deposit.availableDesc"),children:M.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:u("deposit.available")})}),M.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:tP(T||"0",d,n)})]})]}),!w&&XS(d||"0",0)&&M.jsxs("div",{className:"flex justify-center flex-col items-center",children:[M.jsx("h3",{className:"text-text-primary text-sm leading-4 font-medium",children:u("deposit.enableSystemProWithToken",{token:n,network:t==null?void 0:t.chain})}),M.jsx("p",{className:"text-text-secondary text-xs leading-3 mt-4",children:u("deposit.enableTokenDesc",{token:n,network:t==null?void 0:t.chain})}),M.jsx("button",{className:"w-[180px] h-8 bg-fill-btn-primary hover:bg-fill-btn-primary-hover text-text-on-sec-btn rounded-xl text-sm font-medium transition-colors my-4 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center",onClick:I,disabled:D,children:D?M.jsx(Mo,{size:"xs",inline:!0}):u("deposit.enableWithToken",{token:n})})]}),S&&M.jsxs(M.Fragment,{children:[M.jsxs("div",{className:"flex mb-4",children:[M.jsx("div",{className:"w-5",children:M.jsx("img",{src:Io,className:"w-4 h-4",alt:"Warning"})}),M.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:u(E||"deposit.layerZeroDepositTip")})]}),M.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"})]}),N&&M.jsxs("div",{className:"flex mb-4",children:[M.jsx("div",{className:"w-5",children:M.jsx("img",{src:Io,className:"w-4 h-4",alt:"Warning"})}),M.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:u("deposit.depositTipFor25w")})]}),N&&M.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"}),M.jsxs("div",{className:"flex mb-4",children:[M.jsx("div",{className:"w-5",children:!(N||S)&&M.jsx("img",{src:Io,className:"w-4 h-4",alt:"Warning"})}),M.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:u("deposit.noPrivateKeyWalletWarning")})]}),M.jsxs("div",{className:"border-t border-line-divider-secondary border-dashed py-4",children:[M.jsxs("div",{className:"flex justify-between items-center h-[18px] leading-4",children:[M.jsx("span",{className:"text-sm text-text-tertiary",children:u("deposit.arrivalTime")}),M.jsx(Gn,{content:M.jsxs("div",{className:"grid flex-grow max-w-[300px] min-w-[80px] rounded-2xl flex-col gap-[10px]",children:[M.jsx("p",{children:u("deposit.arrivaltimeTooltip1",{v:(t==null?void 0:t.blockTime)*t.txConfirm/60,v1:t==null?void 0:t.txConfirm})}),M.jsx("p",{children:u("deposit.arrivaltimeTooltip2")})]}),placement:"top",children:M.jsx("span",{className:"text-text-primary font-medium text-right border-b-[2px] border-dashed border-line-divider-primary decoration-dashed text-sm",children:u("deposit.arrivalEstimated",{v:(t==null?void 0:t.blockTime)*t.txConfirm/60})})})]}),M.jsxs("div",{className:"flex justify-between items-center h-[18px] leading-4 mt-2",children:[M.jsx("span",{className:"text-sm text-text-tertiary",children:u("deposit.equity")}),M.jsx("span",{className:"text-sm text-text-primary font-medium",children:d?M.jsxs("span",{className:"flex items-center gap-1",children:[$t(o),M.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),$t((parseFloat(o)+parseFloat(d)).toString())," ",n]}):`${$t(o)} ${n}`})]})]}),M.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${b.disabled||s?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:R,disabled:b.disabled||s,children:[(s||C)&&M.jsx(Mo,{size:"xs"}),b.text]})]})},N0=e=>e.toLocaleUpperCase()===Dn?Dn:ka,Qc=e=>N0(e.wallet)===Dn,dP=e=>N0(e.wallet)===ka,I0=({isOpen:e,isLoading:t=!1,onClose:n,currentActiveAccount:r,chains:o,spotChains:s=[],defaultChainId:i,defaultAccountType:c="perpetual",balances:a,wagmiHooks:u,onDeposit:l,onCopy:f,onChainChange:p,onTokenChange:d})=>{const{t:h}=dt(),[m,x]=v.useState(c),T=v.useCallback(C=>C==="spot"&&s&&s.length>0?s:o,[o,s]),y=T(c),[A,B]=v.useState(()=>{var C;return!y||y.length===0?1:i||((C=y[0])==null?void 0:C.chainId)||1}),L=v.useMemo(()=>T(m),[m,T]),_=L.find(C=>C.chainId===A)||L[0],[D,g]=v.useState(()=>{var O,N;if(!y||y.length===0)return"";const C=i||((O=y[0])==null?void 0:O.chainId),P=y.find(b=>b.chainId===C)||y[0],S=((P==null?void 0:P.tokenList)||[]).length>0?P:y.find(b=>(b.tokenList||[]).length>0),E=(N=S==null?void 0:S.tokenList)==null?void 0:N[0];return(E==null?void 0:E.token)||(E==null?void 0:E.symbol)||""}),w=v.useCallback(C=>{B(C),p==null||p(C)},[p]),$=v.useCallback(C=>{g(C),d==null||d(C)},[d]),I=v.useMemo(()=>{const C=(D||"").toLowerCase();if(console.log("key:",C),!C)return"0";const P=m==="spot"?a==null?void 0:a.spot:a==null?void 0:a.perpetual,S=P==null?void 0:P[C];return typeof S=="string"&&S.length>0?S:"0"},[a,m,D]);return e?Me.createPortal(M.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:98},children:M.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-[99] flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.6)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)"},onClick:()=>{n()},"aria-hidden":"true",children:M.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl border-[2px] border-solid border-line-divider-secondary",onClick:C=>{C.stopPropagation()},children:[M.jsxs("div",{className:"flex items-center justify-between mb-4",children:[M.jsx("h2",{className:"text-lg font-semibold text-white",children:h("deposit.title")}),M.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:n,"aria-label":"Close",children:M.jsx(Ld,{className:"h-4 w-4"})})]}),M.jsx(jh,{selectedAccount:m,onAccountChange:C=>{var j,U;const P=C||"perpetual";x(P);const S=T(P);if(!S||S.length===0)return;const E=S.find(H=>H.chainId===A),O=E?E.chainId:S[0].chainId;B(O),p==null||p(O);const N=S.find(H=>H.chainId===O),b=(N==null?void 0:N.tokenList)||[],R=b.some(H=>(H.symbol||H.token)===D)?D:((j=b[0])==null?void 0:j.symbol)||((U=b[0])==null?void 0:U.token)||"";R&&(g(R),d==null||d(R))},className:"w-full"}),M.jsx(Dh,{currentActiveChain:_,chainList:L,onChainChange:w,curSelectToken:D,onTokenChange:$,walletType:Qc(r)?Dn:ka}),Qc(r)&&M.jsx(eP,{address:r.smartWalletAddress,currentActiveChain:_,selectedToken:D,onDeposit:l,onCopy:f,onClose:n}),dP(r)&&M.jsx(fP,{address:r.ethAddress,currentActiveChain:_,selectedToken:D,accountType:m,platformBalance:I,isLoading:t,wagmiHooks:u,onChainChange:w,onDeposit:l,onClose:n})]})})}),document.body):null},pP=({withdrawAmount:e,curSelectToken:t,tokenInfo:n,currentActiveChain:r,platformBalance:o="0",fee:s="0.00",walletType:i="evm",receiverAddress:c="",accountType:a="perpetual",onWithdrawAmountChange:u,onReceiverAddressChange:l,onAmountChanged:f,showPoolBalanceInsufficientTip:p=!1})=>{const{t:d}=dt(),h=v.useMemo(()=>{if(!an(r==null?void 0:r.chainId)){const B=new ke(e||"0").minus(s||"0").decimalPlaces(2,ke.ROUND_DOWN);return B.isNegative()?"0.00":B.toString()}return e||"0"},[e,s,r==null?void 0:r.chainId]),m=v.useMemo(()=>o||"0",[o]),x=v.useMemo(()=>{const B=(n==null?void 0:n.feeRate)||(r==null?void 0:r.feeRate)||0;try{return new ke(B||0).times(100).toString()}catch{return"0"}},[n==null?void 0:n.feeRate,r==null?void 0:r.feeRate]),T=B=>{const L=B.target.value,D=Xc(L,m||"0");if(D.isValid)u(D.formattedValue),D.errorType;else return D.errorType==="exceed_balance",void 0;f==null||f(D.formattedValue)},y=()=>{u(m),f==null||f(m)},A=()=>{const B=parseFloat(o||"0"),L=parseFloat(e||"0");if(L>0){const _=B-L,D=$t(Math.max(0,_).toString());return M.jsxs("span",{className:"flex items-center gap-1",children:[$t(o||"0"),M.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),D," ",t]})}return`${$t(o||"0")} ${t}`};return M.jsxs(M.Fragment,{children:[M.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[M.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[M.jsx("input",{type:"text",placeholder:d("deposit.amount"),value:e,onChange:T,className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-none border-none p-0 h-full"}),M.jsx("button",{onClick:y,className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:d("deposit.max")})]}),M.jsx("div",{className:"h-[1px] bg-line-divider-secondary mb-2"}),M.jsxs("div",{className:"flex justify-between items-center",children:[M.jsx(Gn,{content:d("withdraw.availableDesc"),children:M.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:d("deposit.available")})}),M.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:A()})]})]}),i==="mpc"&&(a==="spot"||!an(r==null?void 0:r.chainId))?M.jsx("div",{className:"bg-fill-input-primary rounded-lg my-4 h-9 flex items-center px-3",children:M.jsx("input",{type:"text",placeholder:d("withdraw.receiverAddress"),value:c,onChange:B=>l==null?void 0:l(B.target.value),className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-none border-none p-0 h-full"})}):null,M.jsx("div",{className:"bg-fill-page-secondary rounded-lg mb-4",children:an(r==null?void 0:r.chainId)?M.jsxs(M.Fragment,{children:[M.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:d("withdraw.noticeDesc")}),M.jsx("a",{className:"block text-xs leading-[18px] mt-1 text-theme-normal",href:"https://edgex-1.gitbook.io/edgeX-documentation/getting-started/deposits-and-withdrawals/withdrawals",rel:"noreferrer",target:"_blank",children:d("withdraw.commonWithdraw")})]}):M.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:d("withdraw.crossChainTips")})}),p&&M.jsxs("div",{className:"flex mb-4",children:[M.jsx("div",{className:"w-5",children:M.jsx("img",{src:Io,className:"w-4 h-4",alt:"Warning"})}),M.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:d("withdraw.poolBalanceInsufficientTip")})]}),M.jsxs("div",{className:"py-4 border-t border-line-divider-secondary border-dashed",children:[M.jsxs("div",{className:"flex items-center justify-between h-[18px] leading-[18px]",children:[M.jsx(Gn,{content:M.jsxs("div",{children:[M.jsx("div",{children:d("withdraw.speedNote")}),M.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[M.jsx(Oo,{selectedLevel:Pt.FAST,maxLevel:3}),M.jsx("span",{children:d("withdraw.speedNoteSpeed1")})]}),M.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[M.jsx(Oo,{selectedLevel:Pt.Medium,maxLevel:3}),M.jsx("span",{children:d("withdraw.speedNoteSpeed2")})]}),M.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[M.jsx(Oo,{selectedLevel:Pt.SLOW,maxLevel:3}),M.jsx("span",{children:d("withdraw.speedNoteSpeed3")})]})]}),children:M.jsx("span",{className:"text-text-tertiary text-sm leading-4 border-b border-dashed border-line-divider-primary",children:d("withdraw.speed")})}),M.jsx("div",{className:"flex items-center",children:M.jsx(Oo,{selectedLevel:an(r==null?void 0:r.chainId)?Pt.SLOW:Pt.FAST,maxLevel:3})})]}),!an(r==null?void 0:r.chainId)&&M.jsxs("div",{className:"flex items-center justify-between mt-2 h-[18px]",children:[M.jsx(Gn,{content:d("withdraw.feeCalculationTip"),children:M.jsxs("span",{className:"text-text-tertiary text-sm leading-4 border-b border-dashed border-line-divider-primary",children:[d("withdraw.fee"),"/",d("withdraw.feeRate")]})}),M.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[s," ",t," / ",x,"%"]})]}),M.jsxs("div",{className:"flex items-center justify-between mt-2 h-[18px]",children:[M.jsx("span",{className:"text-text-tertiary text-sm leading-4",children:d(an(r==null?void 0:r.chainId)?"withdraw.withdrawlAmount":"withdraw.amountToReceive")}),M.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[$t(h)," ",t]})]})]})]})},hP=[];let Ve=null;const M0=v.forwardRef((e,t)=>{const[n,r]=v.useState(!1),[o,s]=v.useState(!1),[i,c]=v.useState({chains:[],currentActiveAccount:{wallet:"EVM",ethAddress:"",accountId:"",smartWalletAddress:""}}),a=v.useCallback(h=>{c(h||{chains:[],currentActiveAccount:{wallet:"EVM",ethAddress:"",accountId:"",smartWalletAddress:""}}),r(!0)},[]),u=v.useCallback(h=>{c(m=>({...m,...h}))},[]),l=v.useCallback(()=>{r(!1),s(!1),i.onClose&&i.onClose()},[i.onClose]),f=v.useCallback(h=>{s(h)},[]),p=v.useCallback(()=>n,[n]),d=v.useCallback(()=>o,[o]);return v.useImperativeHandle(t,()=>({openWithdraw:a,closeWithdraw:l,updateWithdrawOptions:u,setWithdrawLoading:f,isOpen:p,isLoading:d}),[a,l,u,f,p,d]),v.useEffect(()=>(Ve={openWithdraw:a,closeWithdraw:l,updateWithdrawOptions:u,setWithdrawLoading:f,isOpen:p,isLoading:d},()=>{Ve=null}),[a,l,u,f,p,d]),n?M.jsx(R0,{isOpen:n,isLoading:o,onClose:l,config:i.config||{symbol:"USDT"},currentActiveAccount:i.currentActiveAccount,chains:i.chains||hP,spotChains:i.spotChains,balances:i.balances,defaultChainId:i.defaultChainId,defaultTokenAddress:i.defaultTokenAddress,defaultAmount:i.defaultAmount,defaultAccountType:i.defaultAccountType,currentEquity:i.currentEquity??5e3,platformBalance:i.platformBalance||"0",fee:i.fee,wagmiHooks:i.wagmiHooks,onWithdraw:i.onWithdraw,onChainChange:i.onChainChange,onTokenChange:i.onTokenChange,onAmountChanged:i.onAmountChanged}):null});M0.displayName="WithdrawManager";const k0=e=>{if(!Ve){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Ve.openWithdraw(e||{chains:[],currentActiveAccount:{wallet:"EVM",ethAddress:"",accountId:"",smartWalletAddress:""}})},B0=()=>{if(!Ve){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Ve.closeWithdraw()},L0=e=>{if(!Ve){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Ve.updateWithdrawOptions(e)},Xs=e=>{if(!Ve){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Ve.setWithdrawLoading(e)},mP=()=>Ve?Ve.isOpen():!1,F0=()=>Ve?Ve.isLoading():!1,gP=()=>({openWithdraw:k0,closeWithdraw:B0,updateWithdrawOptions:L0,setWithdrawLoading:Xs,isOpen:mP,isLoading:F0}),bP=({walletType:e,chains:t,spotChains:n=[],defaultChainId:r,defaultTokenAddress:o,defaultAmount:s="",defaultAccountType:i="perpetual",currentEquity:c,platformBalance:a="0",balances:u,fee:l="0.00",isLoading:f=!1,onWithdraw:p,onClose:d,onChainChange:h,onTokenChange:m,onAmountChanged:x})=>{var G;const{t:T}=dt(),[y,A]=v.useState(i),B=v.useCallback(W=>W==="spot"&&n&&n.length>0?n:t,[t,n]),L=v.useMemo(()=>B(y),[y,B]),_=v.useMemo(()=>{var pe,Se;const W="USDC";if(!L||L.length===0)return{chainId:1,tokenSymbol:""};const V=he=>Array.isArray(he.tokenList)&&he.tokenList.some(me=>(me.token||me.symbol||"").toUpperCase()===W),Y=L.find(V)||L[0];if(!Y||!Array.isArray(Y.tokenList)||Y.tokenList.length===0)return{chainId:(Y==null?void 0:Y.chainId)||1,tokenSymbol:""};const Q=Y.tokenList.find(he=>(he.token||he.symbol||"").toUpperCase()===W),oe=(Q==null?void 0:Q.token)||(Q==null?void 0:Q.symbol)||((pe=Y.tokenList[0])==null?void 0:pe.token)||((Se=Y.tokenList[0])==null?void 0:Se.symbol)||"";return{chainId:Y.chainId,tokenSymbol:oe}},[L]),[D,g]=v.useState(()=>_.chainId),[w,$]=v.useState(()=>_.tokenSymbol),[I,C]=v.useState(s),[P,S]=v.useState(""),E=v.useCallback(W=>{g(W),h==null||h(W)},[h]),O=v.useCallback(W=>{$(W),m==null||m(W)},[m]),N=v.useRef(!0),b=v.useRef(w),k=v.useRef(D);v.useEffect(()=>{if(N.current){N.current=!1,b.current=w,k.current=D;return}(b.current!==w||k.current!==D)&&(C(""),b.current=w,k.current=D)},[w,D]);const R=L&&L.length>0?L.find(W=>W.chainId===D)||L[0]:null,j=(G=R==null?void 0:R.tokenList)==null?void 0:G.find(W=>W.token===w),U=v.useMemo(()=>{const W=new ke(I||"0"),V=new ke(l||"0"),Y=an(D);return!I||W.isZero()||!Y&&W.isLessThan(V)?{text:T("withdraw.confirmWithdraw"),disabled:!0}:e==="mpc"&&(!Y||y==="spot")&&!P.trim()?{text:T("withdraw.invalidReceiverAddress"),disabled:!0}:{text:T("withdraw.confirmWithdraw"),disabled:!1}},[T,D,I,e,P,l,y]),H=v.useMemo(()=>{const W=(w||"").toLowerCase();if(!W)return a||"0";const V=y==="spot"?u==null?void 0:u.spot:u==null?void 0:u.perpetual,Y=V==null?void 0:V[W];return typeof Y=="string"&&Y.length>0?Y:a||"0"},[u,y,w,a]),K=v.useCallback(async()=>{Xs(!0);try{if(p){const W=new ke(I||"0");console.log("selectedToken:",j);const V={amount:W.toString(),chainId:D,tokenAddress:(j==null?void 0:j.tokenAddress)||"",coinId:(j==null?void 0:j.coinId)||"",tokenSymbol:w,accountType:y};e==="mpc"&&(!an(D)||y==="spot")&&(V.receiverAddress=P),p(V)}}catch{Xs(!1)}},[p,y,j,I,D,w,e,P]);return!L||L.length===0?M.jsx("div",{className:"text-center py-8",children:M.jsx("p",{className:"text-gray-400",children:"No chains available"})}):R?M.jsxs(M.Fragment,{children:[M.jsx(jh,{selectedAccount:y,onAccountChange:W=>{var le,xn;const V=W||"perpetual";A(V);const Y=B(V);if(!Y||Y.length===0)return;const Q=Y.find(cn=>cn.chainId===D),oe=Q?Q.chainId:Y[0].chainId;g(oe),h==null||h(oe);const pe=Y.find(cn=>cn.chainId===oe),Se=(pe==null?void 0:pe.tokenList)||[],me=Se.some(cn=>(cn.symbol||cn.token)===w)?w:((le=Se[0])==null?void 0:le.symbol)||((xn=Se[0])==null?void 0:xn.token)||"";me&&($(me),m==null||m(me))},className:"w-full"}),M.jsx(Dh,{currentActiveChain:R,chainList:L,onChainChange:E,curSelectToken:w,onTokenChange:O,walletType:"EVM",txType:"withdraw"}),M.jsx(pP,{withdrawAmount:I,curSelectToken:w,tokenInfo:j,curSelectTokenData:{balance:j==null?void 0:j.balance,allowance:j==null?void 0:j.allowance},currentActiveChain:R,currentEquity:c||0,decimals:(j==null?void 0:j.decimals)||6,platformBalance:H,fee:l,walletType:e,accountType:y,receiverAddress:P,onWithdrawAmountChange:C,onReceiverAddressChange:S,onAmountChanged:x}),M.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${U.disabled||f?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:K,disabled:U.disabled||f,children:[f&&M.jsx(Mo,{size:"xs"}),U.text]})]}):M.jsx("div",{className:"text-center py-8",children:M.jsx("p",{className:"text-gray-400",children:"Loading..."})})},R0=({isOpen:e,isLoading:t=!1,defaultAccountType:n="perpetual",onClose:r,config:o,currentActiveAccount:s,chains:i,spotChains:c=[],defaultChainId:a,defaultTokenAddress:u,defaultAmount:l="",currentEquity:f=5e3,platformBalance:p="0",balances:d,fee:h,wagmiHooks:m,onWithdraw:x,onChainChange:T,onTokenChange:y,onAmountChanged:A})=>{const{t:B}=dt();return e?Me.createPortal(M.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:98},children:M.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-[99] flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.6)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)"},onClick:()=>{r()},"aria-hidden":"true",children:M.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl",onClick:L=>{L.stopPropagation()},children:[M.jsxs("div",{className:"flex items-center justify-between mb-4",children:[M.jsx("h2",{className:"text-lg font-semibold text-white",children:B("withdraw.withdraw")}),M.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:r,"aria-label":"Close",children:M.jsx(Ld,{className:"h-4 w-4"})})]}),M.jsx(bP,{chains:i,spotChains:c,walletType:Qc(s)?"mpc":"evm",defaultChainId:a,defaultTokenAddress:u,defaultAmount:l,defaultAccountType:n,currentEquity:f,platformBalance:p,balances:d,fee:h,isLoading:t,wagmiHooks:m,onWithdraw:x,onClose:r,onChainChange:T,onTokenChange:y,onAmountChanged:A})]})})}),document.body):null};re.ChromeLoader=Mo,re.ComponentProvider=um,re.DEFAULT_LOCALE=Bo,re.Deposit=I0,re.DepositManager=$0,re.LOCALE_NAMES=im,re.LoadingSpinner=Mo,re.SUPPORTED_LOCALES=ei,re.Tooltip=Gn,re.Withdraw=R0,re.WithdrawManager=M0,re.closeDeposit=T0,re.closeWithdraw=B0,re.formatThousands=fm,re.isDepositLoading=C0,re.isWithdrawLoading=F0,re.openDeposit=A0,re.openWithdraw=k0,re.setDepositLoading=Ys,re.setWithdrawLoading=Xs,re.updateDepositOptions=O0,re.updateWithdrawOptions=L0,re.useComponentConfig=fu,re.useDeposit=zv,re.useDepositManager=iP,re.useTranslation=dt,re.useWithdraw=Hv,re.useWithdrawManager=gP,Object.defineProperty(re,Symbol.toStringTag,{value:"Module"})});
171
+ `,children:[t,o&&M.jsx(S0,{ref:f,placement:h.placement||n})]})})]})},Io="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAIcSURBVHgBxZc/T8JAGMafA4mDEXFw0DiQmDi4CP5JHGFx0qizg8QvIHwCZHYAvwEm7mji5CJuJv7DxcWYYMLmIEYXY/R8j6tQaBvuaCm/pOlbSu99+rZ97zlgwDBowvNLCdrF6NJ50891OvNC+wrL3JShgZIAnl+JAj97FKXoMNLl7ySGnQDBHMtcVeFGAM8nKNlnlsI0eoIVuwlhzsmXqcwoURSFK1iVRCSdRDDn5PwC3cutingsJOK60nkiYE0unrdi8uFRIDwFBSJiTKOqzgKMl00teXgS2D0Fto+BiVkoIMYs8Xws4iiAkmeVn/n0oqyA2NQEQI4dytoKMEqfQt/haZmrQ4C8e7/4TtsI4JvwDbYDswCjvXr1yakQMXI2KxCD/8RMAtx2ux5gcjIzBAT8LH8bAQwYbwR8fUAb/vtuEsAr0OX5Eng8o30ZqN1BHzFLAkPGkb4AcdfnObigkbM5HdN3+Qb/ekGdrNu4CMyd8Ag6iElo/QBYzcpYByYsm8QkIFSADmI2nEkAc2sUL0ALHsxZBEjLxA+hSu22tb0+KV9Gd18027M2SybNQui+f53R6g/b+gDLVMi7YQsND+c5dTtzamlE0jiyJLwVYZhSqzO27YRSxFD8v1m4Q4xh74gdBUgRQm2QKsH0Ps82xEs9EndK3sgDlWGkW96naANqSzMSHSy4XprZi2kuTqN09VjrBH9AD4vTgfMHJt+rxIFF7EgAAAAASUVORK5CYII=",XS=(e,t)=>Number(e)>Number(t),$t=e=>{if(!e||e===""||isNaN(Number(e)))return"0.00";const t=Number(e);if(t===0)return"0.00";let n=t.toString();n.includes("e")&&(n=t.toFixed(20));const r=n.split("."),o=r[0];let s=r[1]||"";return s.length>6&&(s=s.substring(0,6)),s=s.replace(/0+$/,""),s?(s.length===1&&(s+="0"),o+"."+s):o+".00"},Xc=(e,t="0")=>{if(/[^0-9.]/.test(e))return{isValid:!1,formattedValue:"",errorType:"invalid_char"};if(e===".")return{isValid:!0,formattedValue:"0."};if((e.match(/\./g)||[]).length>1)return{isValid:!1,formattedValue:"",errorType:"invalid_char"};if(!e||e==="")return{isValid:!0,formattedValue:""};const o=e.split(".");if(o.length===2&&o[1].length>6){const a=o[0]+"."+o[1].substring(0,6);return Xc(a,t)}const s=parseFloat(e),i=parseFloat(t);return!isNaN(s)&&!isNaN(i)&&s>i?{isValid:!0,formattedValue:$t(t),errorType:"auto_adjusted_to_max"}:{isValid:!0,formattedValue:e}},Ks={ETHEREUM:1,ARBITRUM:42161,ARBITRUM_SEPOLIA:421614,SEPOLIA:11155111},QS=[Ks.ETHEREUM,Ks.SEPOLIA,Ks.ARBITRUM,Ks.ARBITRUM_SEPOLIA],JS=e=>{if(e.chainId!==void 0){const t=typeof e.chainId=="string"?parseInt(e.chainId,10):e.chainId;return!QS.includes(t)}return!0},eP=({currentActiveChain:e,selectedToken:t,address:n,onDeposit:r,onCopy:o,onClose:s})=>{const{t:i}=dt(),c=v.useMemo(()=>JS(e||{}),[e]);return M.jsxs(M.Fragment,{children:[M.jsx("div",{className:"flex justify-center mt-4 mb-3",children:n&&M.jsx("div",{className:"bg-white rounded-lg",children:M.jsx(o0,{value:n,size:120,level:"L",bgColor:"#ffffff",fgColor:"#000000",marginSize:0})})}),n&&M.jsxs("div",{className:"flex items-center justify-between bg-fill-input-primary rounded-lg py-2 px-3 mb-3",children:[M.jsx("span",{className:"flex-1 text-text-primary text-sm font-medium break-all mr-3",children:n}),M.jsx(nS,{onCopy:()=>{o&&o(n)},text:n,children:M.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[M.jsx("rect",{x:"2.08496",y:"4.02295",width:"9.89893",height:"9.89893",rx:"2",stroke:"#F9F9F9"}),M.jsx("path",{d:"M5.85547 2.07861H11.415C12.7957 2.07861 13.915 3.1979 13.915 4.57861V10.0786",stroke:"#F9F9F9",strokeLinecap:"round"})]})},"copy")]}),M.jsxs("div",{className:"border-b border-dashed border-line-divider-secondary pb-4",children:[M.jsxs("div",{className:"flex items-start",children:[M.jsx("div",{className:"w-5",children:M.jsx("img",{src:Io,className:"w-4 h-4",alt:"Warning"})}),M.jsx("div",{className:"flex-1",children:M.jsx("p",{className:"text-xs text-functional-orange-1",children:i("deposit.depositAllTip",{coin:t,v:e==null?void 0:e.chain})})})]}),c&&M.jsxs(M.Fragment,{children:[M.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"}),M.jsx("div",{className:"flex items-start pl-5 text-functional-orange-1 text-xs",children:i("deposit.depositTipFor25w")})]})]}),M.jsxs("div",{className:"text-sm",children:[M.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-4",children:[M.jsx("span",{className:"text-text-tertiary",children:i("deposit.arrivalTime")}),M.jsx(Gn,{content:M.jsxs("div",{className:"grid flex-grow max-w-[300px] min-w-[80px] rounded-2xl flex-col gap-[10px]",children:[M.jsx("p",{children:i("deposit.arrivaltimeTooltip1",{v:(e==null?void 0:e.blockTime)*e.txConfirm/60,v1:e==null?void 0:e.txConfirm})}),M.jsx("p",{children:i("deposit.arrivaltimeTooltip2")})]}),placement:"top",children:M.jsx("span",{className:"text-text-primary font-medium text-right border-b-[2px] border-dashed border-line-divider-primary decoration-dashed",children:i("deposit.arrivalEstimated",{v:(e==null?void 0:e.blockTime)*e.txConfirm/60})})})]}),M.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-1",children:[M.jsx("span",{className:"text-text-tertiary",children:i("deposit.minDeposit")}),M.jsxs("span",{className:"text-text-primary font-medium text-right",children:["10 ",t]})]}),M.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-1",children:[M.jsx("span",{className:"text-text-tertiary",children:i("deposit.maxDeposit")}),M.jsxs("span",{className:"text-text-primary font-medium text-right",children:["200,000 ",t]})]})]}),M.jsx("button",{className:"w-full h-[38px] bg-fill-btn-primary rounded-xl text-sm font-medium text-text-on-sec-btn mt-4",onClick:()=>{r&&r({amount:"",chainId:e.chainId,tokenAddress:n,tokenSymbol:t}),s()},children:i("deposit.title")})]})},Mo=({size:e="xs",color:t,className:n="",label:r="Loading...",inline:o=!1})=>{const s=t?`loading-${t}`:"",i=o?"loading-inline":"";return M.jsx("span",{className:`loading loading-${e} loading-spinner ${s} ${i} ${n}`.trim(),"aria-label":r,role:"status","aria-live":"polite"})},tP=(e,t,n)=>{const r=parseFloat(String(e)||"0"),o=parseFloat(String(t)||"0");if(o>0){const s=r-o,i=$t(Math.max(0,s).toString());return M.jsxs("span",{className:"flex items-center gap-1",children:[$t(e),M.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),i," ",n]})}return`${$t(e)} ${n}`},nP=(e,t,n)=>{if(!e||e===""||e==="0"||e==="0.00")return!1;const r=parseFloat(e),o=parseFloat(t);return!(isNaN(r)||isNaN(o)||r>o||!n)},rP=(e,t,n)=>{if(!Rh(e,n))return!1;try{const r=new ke(t||"0"),o=new ke("200000");return r.isNaN()||o.isNaN()?!1:r.gte(o)}catch{return!1}},oP=(e,t,n)=>{let r=t||"0";if(Rh(e,n))try{const o=new ke(r),s=new ke("200000");o.gt(s)&&(r="200000")}catch(o){console.warn("Error calculating max amount limit:",o)}return r},P0={chains:[],spotChains:[],currentActiveAccount:{wallet:"EVM",ethAddress:"",accountId:"",smartWalletAddress:""},defaultChainId:1,defaultAccountType:"perpetual",balances:{spot:{},perpetual:{}}};let We=null;const $0=v.forwardRef((e,t)=>{const[n,r]=v.useState(!1),[o,s]=v.useState(!1),[i,c]=v.useState(P0),a=v.useCallback(h=>{c(h),r(!0)},[]),u=v.useCallback(h=>{c(m=>({...m,...h}))},[]),l=v.useCallback(()=>{r(!1),s(!1),i.onClose&&i.onClose()},[i.onClose]),f=v.useCallback(h=>{s(h)},[]),p=v.useCallback(()=>n,[n]),d=v.useCallback(()=>o,[o]);return v.useImperativeHandle(t,()=>({openDeposit:a,closeDeposit:l,updateDepositOptions:u,setDepositLoading:f,isOpen:p,isLoading:d}),[a,l,u,f,p,d]),v.useEffect(()=>(We={openDeposit:a,closeDeposit:l,updateDepositOptions:u,setDepositLoading:f,isOpen:p,isLoading:d},()=>{We=null}),[a,l,u,f,p,d]),n?M.jsx(I0,{isOpen:n,isLoading:o,onClose:l,currentActiveAccount:i.currentActiveAccount,chains:i.chains,spotChains:i.spotChains,defaultChainId:i.defaultChainId,defaultAccountType:i.defaultAccountType,balances:i.balances,wagmiHooks:i.wagmiHooks,onDeposit:i.onDeposit,onCopy:i.onCopy,onChainChange:h=>{var m;return(m=i.onChainChange)==null?void 0:m.call(i,h)},onTokenChange:h=>{var m;return(m=i.onTokenChange)==null?void 0:m.call(i,h)}}):null});$0.displayName="DepositManager";const A0=e=>{if(!We){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}We.openDeposit(e||P0)},T0=()=>{if(!We){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}We.closeDeposit()},O0=e=>{We&&We.updateDepositOptions(e)},Ys=e=>{if(!We){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}We.setDepositLoading(e)},sP=()=>We?We.isOpen():!1,C0=()=>We?We.isLoading():!1,iP=()=>({openDeposit:A0,closeDeposit:T0,updateDepositOptions:O0,setDepositLoading:Ys,isOpen:sP,isLoading:C0}),aP=e=>{const{t}=dt(),{isNetworkMismatch:n,depositAmount:r,approved:o,currentTokenBalance:s,selectedToken:i,showLayerZeroTip:c,minDeposit:a=10}=e;return v.useMemo(()=>{if(n)return{text:t("deposit.switchNetwork"),disabled:!0,isNetworkSwitch:!0};const u=parseFloat(r||"0"),f=(i||"").toUpperCase()==="ETH"?.001:a,p=nP(r,s||"0",o);return!r||u===0||!o?{text:t(c?"deposit.layerZeroDepositButton":"deposit.confirmDeposit"),disabled:!0,isNetworkSwitch:!1}:u<f?{text:t("deposit.minDepositParsed",{amount:f,token:i}),disabled:!0,isNetworkSwitch:!1}:{text:t(c?"deposit.layerZeroDepositButton":"deposit.confirmDeposit"),disabled:!p,isNetworkSwitch:!1}},[n,r,o,s,i,c,a,t])};function cP(e){const{account:t,accountChainId:n,targetChainId:r,tokenInfo:o,amount:s}=e,{useReadContract:i,useWriteContract:c,usePublicClient:a,useSwitchChain:u}=e.wagmiHooks,l=o==null?void 0:o.tokenAddress,f=(o==null?void 0:o.decimals)??18,p=o==null?void 0:o.contractAddress,d=!l||l.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",{switchChainAsync:h}=u(),{writeContractAsync:m}=c(),x=a(),T=i({address:l,abi:ur,functionName:"allowance",args:[An(t||""),p],chainId:r,query:{enabled:!!(!d&&t&&r&&l&&p)}}),y=T!=null&&T.isSuccess?T.data:void 0,A=v.useMemo(()=>{if(d)return!0;if(!T.isSuccess||y===void 0||y===0n)return!1;try{const L=mw(String(Number(s||"0")||0),Number(f));return y>=L}catch{return!1}},[d,T.isSuccess,y,s,f]),B=v.useCallback(async()=>{try{if(r&&n&&+n!=+r&&await h({chainId:+r}),!m||!x||!l||!p)return;const _=An(l),D=An(p);if((y||0n)>0n){const $=await m({abi:ur,address:_,functionName:"approve",args:[D,0n]});await x.waitForTransactionReceipt({hash:$})}const w=await m({abi:ur,address:_,functionName:"approve",args:[D,Ll]});await x.waitForTransactionReceipt({hash:w}),T!=null&&T.refetch&&await T.refetch()}catch(L){console.error("[useApprove] onApprove failed:",L)}},[r,n,l,p,y,T,m,x,h]);return{approve:A,onApprove:B}}const uP=({token:e,account:t,chainId:n,wagmiHooks:r,onResult:o})=>{var i;const s=(i=r==null?void 0:r.useBalance)==null?void 0:i.call(r,{address:t,token:e.tokenAddress,chainId:n,query:{enabled:!!t&&!!n&&!!e.tokenAddress&&!!(r!=null&&r.useBalance)}});return v.useEffect(()=>{o(An(e.tokenAddress),{balance:s})},[s,e.tokenAddress,o]),null},lP=({account:e,chainId:t,contractAddress:n,tokens:r=[],wagmiHooks:o})=>{var y;const s=typeof t=="string"?Number.isFinite(Number(t))?Number(t):void 0:t,i=v.useMemo(()=>{const A="0x0000000000000000000000000000000000000000",B="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";return r.filter(L=>{const _=L.tokenAddress;if(!_)return!1;const D=_.toLowerCase();return!(_===A||D===B)})},[r]),[c,a]=v.useState({}),u=v.useCallback((A,B)=>{a(L=>({...L,[A]:B}))},[]),l=(y=o==null?void 0:o.useBalance)==null?void 0:y.call(o,{address:e,chainId:s,query:{enabled:!!e&&!!s&&!!(o!=null&&o.useBalance)}}),[f,p]=v.useState(0),d=v.useMemo(()=>i.map(A=>v.createElement(uP,{key:`${A.tokenAddress}-${f}`,token:A,account:e,chainId:s,contractAddress:n,wagmiHooks:o,onResult:u})),[i,e,s,n,o,u,f]),h=v.useMemo(()=>{const A=l!=null&&l.data?{value:l.data.value,formatted:l.data.formatted,decimals:l.data.decimals,symbol:l.data.symbol}:{value:BigInt(0),formatted:"0",decimals:18,symbol:"ETH"},B=i.map(_=>{const D=c[An(_.tokenAddress)],g=D==null?void 0:D.balance,w=g==null?void 0:g.data;return{address:An(_.tokenAddress),value:(w==null?void 0:w.value)||BigInt(0),formatted:(w==null?void 0:w.formatted)||"0",decimals:(w==null?void 0:w.decimals)||_.decimals}}).filter(_=>_.address),L=B.reduce((_,D)=>({..._,[D.address]:{balance:D}}),{});return{balanceList:B,baseTokenBalance:A,combinedData:L}},[l,c,i]),m=v.useCallback(async()=>h,[h]),x=v.useMemo(()=>{const A=(l==null?void 0:l.isLoading)||!1,B=Object.values(c).some(L=>{var _;return(_=L.balance)==null?void 0:_.isLoading});return A||B},[l==null?void 0:l.isLoading,c]),T=v.useCallback(()=>p(A=>A+1),[]);return{multicallRun:m,multicallRefresh:T,multicallResult:h,validErcTokens:i,isLoading:x,queryComponents:d}},fP=({address:e,currentActiveChain:t,selectedToken:n,accountType:r,platformBalance:o,isLoading:s,wagmiHooks:i,onChainChange:c,onDeposit:a})=>{const{t:u}=dt(),l=i.useAccount(),f=t.tokenList.find(j=>j.token===n||j.symbol===n),p=t.chainId,[d,h]=v.useState("");v.useEffect(()=>{h("")},[n,t.chainId]);const{multicallResult:m,queryComponents:x}=lP({account:e,chainId:t.chainId,contractAddress:(f==null?void 0:f.contractAddress)||(t==null?void 0:t.contractAddress),tokens:(t==null?void 0:t.tokenList)||[],wagmiHooks:i}),T=v.useMemo(()=>{var U;if(!f)return"0";if(!f.tokenAddress||f.tokenAddress.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")return m.baseTokenBalance.formatted;const j=m.combinedData[f.tokenAddress];return((U=j==null?void 0:j.balance)==null?void 0:U.formatted)||"0"},[f,m]),y="0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9",A="0xceeed84620e5eb9ab1d6dfc316867d2cda332e41",B=v.useMemo(()=>{var j,U;return jv({chain:_v,transport:g1(t.rpcUrl||((j=window==null?void 0:window.ENV)==null?void 0:j.CHAIN_RPC_URL_42161)||((U=window==null?void 0:window.ENV)==null?void 0:U.CHAIN_RPC_URL_421614))})},[t.rpcUrl]),L="1000000000000",{formatted:_}=Uv({client:B,tokenAddress:y,holder:A,decimals:6,fallbackFormatted:L,pollingInterval:12e3}),[D,g]=v.useState(!1),{approve:w,onApprove:$}=cP({account:e,accountChainId:l.chainId,targetChainId:+t.chainId,tokenInfo:f,amount:d,wagmiHooks:i}),I=v.useCallback(async()=>{if(!D)try{g(!0),await $()}catch(j){console.error("Approve failed:",j)}finally{g(!1)}},[D,$]),C=v.useMemo(()=>+l.chainId!=+t.chainId,[l.chainId,t.chainId]),P=v.useCallback(async()=>{c&&c(p)},[c,p]);v.useEffect(()=>{C&&P()},[C,P]);const{showLayerZeroTip:S,layerZeroTipKey:E}=v.useMemo(()=>{const j=+t.chainId==42161||+t.chainId==421614,U=(n==null?void 0:n.toUpperCase())==="USDT",H=new ke(d||"0"),K=new ke("200000");let G=!1,W;if(j&&U&&d)if(H.gte(K))G=!0,W="deposit.layerZeroDepositTipGte200k";else{const V=_;if(typeof V=="string"&&V.length>0){const Q=new ke(V);!Q.isNaN()&&H.gte(Q)&&(G=!0,W="deposit.layerZeroDepositTipExceedPool")}}return{showLayerZeroTip:G,layerZeroTipKey:W}},[t.chainId,n,d,_]),O=v.useCallback(()=>oP(+t.chainId,T||"0",n),[T,t==null?void 0:t.chainId,n]),N=v.useMemo(()=>rP(+t.chainId,d,n),[t==null?void 0:t.chainId,d,n]),b=aP({isNetworkMismatch:C,depositAmount:d,approved:w,currentTokenBalance:T,selectedToken:n,showLayerZeroTip:S,minDeposit:10}),k=j=>{const U=j.target.value,H=O(),K=Xc(U,H);if(K.isValid)h(K.formattedValue),K.errorType;else return K.errorType==="exceed_balance",void 0},R=v.useCallback(async()=>{Ys(!0);try{a&&a({amount:d,chainId:p,tokenAddress:(f==null?void 0:f.tokenAddress)||"",tokenSymbol:n,accountType:r})}catch(j){console.error("Deposit error:",j),Ys(!1)}},[a,d,p,f==null?void 0:f.tokenAddress,r,n]);return M.jsxs(M.Fragment,{children:[x,M.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[M.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[M.jsx("input",{type:"text",placeholder:u("deposit.amount"),value:d,onChange:k,className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-none border-none p-0 h-full"}),M.jsx("button",{onClick:()=>{const j=O();h(j)},className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:u("deposit.max")})]}),M.jsx("div",{className:"h-[1px] bg-line-divider-secondary mb-2"}),M.jsxs("div",{className:"flex justify-between items-center",children:[M.jsx(Gn,{content:u("deposit.availableDesc"),children:M.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:u("deposit.available")})}),M.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:tP(T||"0",d,n)})]})]}),!w&&XS(d||"0",0)&&M.jsxs("div",{className:"flex justify-center flex-col items-center",children:[M.jsx("h3",{className:"text-text-primary text-sm leading-4 font-medium",children:u("deposit.enableSystemProWithToken",{token:n,network:t==null?void 0:t.chain})}),M.jsx("p",{className:"text-text-secondary text-xs leading-3 mt-4",children:u("deposit.enableTokenDesc",{token:n,network:t==null?void 0:t.chain})}),M.jsx("button",{className:"w-[180px] h-8 bg-fill-btn-primary hover:bg-fill-btn-primary-hover text-text-on-sec-btn rounded-xl text-sm font-medium transition-colors my-4 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center",onClick:I,disabled:D,children:D?M.jsx(Mo,{size:"xs",inline:!0}):u("deposit.enableWithToken",{token:n})})]}),S&&M.jsxs(M.Fragment,{children:[M.jsxs("div",{className:"flex mb-4",children:[M.jsx("div",{className:"w-5",children:M.jsx("img",{src:Io,className:"w-4 h-4",alt:"Warning"})}),M.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:u(E||"deposit.layerZeroDepositTip")})]}),M.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"})]}),N&&M.jsxs("div",{className:"flex mb-4",children:[M.jsx("div",{className:"w-5",children:M.jsx("img",{src:Io,className:"w-4 h-4",alt:"Warning"})}),M.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:u("deposit.depositTipFor25w")})]}),N&&M.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"}),M.jsxs("div",{className:"flex mb-4",children:[M.jsx("div",{className:"w-5",children:!(N||S)&&M.jsx("img",{src:Io,className:"w-4 h-4",alt:"Warning"})}),M.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:u("deposit.noPrivateKeyWalletWarning")})]}),M.jsxs("div",{className:"border-t border-line-divider-secondary border-dashed py-4",children:[M.jsxs("div",{className:"flex justify-between items-center h-[18px] leading-4",children:[M.jsx("span",{className:"text-sm text-text-tertiary",children:u("deposit.arrivalTime")}),M.jsx(Gn,{content:M.jsxs("div",{className:"grid flex-grow max-w-[300px] min-w-[80px] rounded-2xl flex-col gap-[10px]",children:[M.jsx("p",{children:u("deposit.arrivaltimeTooltip1",{v:(t==null?void 0:t.blockTime)*t.txConfirm/60,v1:t==null?void 0:t.txConfirm})}),M.jsx("p",{children:u("deposit.arrivaltimeTooltip2")})]}),placement:"top",children:M.jsx("span",{className:"text-text-primary font-medium text-right border-b-[2px] border-dashed border-line-divider-primary decoration-dashed text-sm",children:u("deposit.arrivalEstimated",{v:(t==null?void 0:t.blockTime)*t.txConfirm/60})})})]}),M.jsxs("div",{className:"flex justify-between items-center h-[18px] leading-4 mt-2",children:[M.jsx("span",{className:"text-sm text-text-tertiary",children:u("deposit.equity")}),M.jsx("span",{className:"text-sm text-text-primary font-medium",children:d?M.jsxs("span",{className:"flex items-center gap-1",children:[$t(o),M.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),$t((parseFloat(o)+parseFloat(d)).toString())," ",n]}):`${$t(o)} ${n}`})]})]}),M.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${b.disabled||s?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:R,disabled:b.disabled||s,children:[(s||C)&&M.jsx(Mo,{size:"xs"}),b.text]})]})},N0=e=>e.toLocaleUpperCase()===Dn?Dn:ka,Qc=e=>N0(e.wallet)===Dn,dP=e=>N0(e.wallet)===ka,I0=({isOpen:e,isLoading:t=!1,onClose:n,currentActiveAccount:r,chains:o,spotChains:s=[],defaultChainId:i,defaultAccountType:c="perpetual",balances:a,wagmiHooks:u,onDeposit:l,onCopy:f,onChainChange:p,onTokenChange:d})=>{const{t:h}=dt(),[m,x]=v.useState(c),T=v.useCallback(C=>C==="spot"&&s&&s.length>0?s:o,[o,s]),y=T(c),[A,B]=v.useState(()=>{var C;return!y||y.length===0?1:i||((C=y[0])==null?void 0:C.chainId)||1}),L=v.useMemo(()=>T(m),[m,T]),_=L.find(C=>C.chainId===A)||L[0],[D,g]=v.useState(()=>{var O,N;if(!y||y.length===0)return"";const C=i||((O=y[0])==null?void 0:O.chainId),P=y.find(b=>b.chainId===C)||y[0],S=((P==null?void 0:P.tokenList)||[]).length>0?P:y.find(b=>(b.tokenList||[]).length>0),E=(N=S==null?void 0:S.tokenList)==null?void 0:N[0];return(E==null?void 0:E.token)||(E==null?void 0:E.symbol)||""}),w=v.useCallback(C=>{B(C),p==null||p(C)},[p]),$=v.useCallback(C=>{g(C),d==null||d(C)},[d]),I=v.useMemo(()=>{const C=(D||"").toLowerCase();if(console.log("key:",C),!C)return"0";const P=m==="spot"?a==null?void 0:a.spot:a==null?void 0:a.perpetual,S=P==null?void 0:P[C];return typeof S=="string"&&S.length>0?S:"0"},[a,m,D]);return e?Me.createPortal(M.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:98},children:M.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-[99] flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.6)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)"},onClick:()=>{n()},"aria-hidden":"true",children:M.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl border-[2px] border-solid border-line-divider-secondary",onClick:C=>{C.stopPropagation()},children:[M.jsxs("div",{className:"flex items-center justify-between mb-4",children:[M.jsx("h2",{className:"text-lg font-semibold text-white",children:h("deposit.title")}),M.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:n,"aria-label":"Close",children:M.jsx(Ld,{className:"h-4 w-4"})})]}),M.jsx(jh,{selectedAccount:m,onAccountChange:C=>{var j,U;const P=C||"perpetual";x(P);const S=T(P);if(!S||S.length===0)return;const E=S.find(H=>H.chainId===A),O=E?E.chainId:S[0].chainId;B(O),p==null||p(O);const N=S.find(H=>H.chainId===O),b=(N==null?void 0:N.tokenList)||[],R=b.some(H=>(H.symbol||H.token)===D)?D:((j=b[0])==null?void 0:j.symbol)||((U=b[0])==null?void 0:U.token)||"";R&&(g(R),d==null||d(R))},className:"w-full"}),M.jsx(Dh,{currentActiveChain:_,chainList:L,onChainChange:w,curSelectToken:D,onTokenChange:$,walletType:Qc(r)?Dn:ka}),Qc(r)&&M.jsx(eP,{address:r.smartWalletAddress,currentActiveChain:_,selectedToken:D,onDeposit:l,onCopy:f,onClose:n}),dP(r)&&M.jsx(fP,{address:r.ethAddress,currentActiveChain:_,selectedToken:D,accountType:m,platformBalance:I,isLoading:t,wagmiHooks:u,onChainChange:w,onDeposit:l,onClose:n})]})})}),document.body):null},pP=({withdrawAmount:e,curSelectToken:t,tokenInfo:n,currentActiveChain:r,platformBalance:o="0",fee:s="0.00",walletType:i="evm",receiverAddress:c="",accountType:a="perpetual",onWithdrawAmountChange:u,onReceiverAddressChange:l,onAmountChanged:f,showPoolBalanceInsufficientTip:p=!1})=>{const{t:d}=dt(),h=v.useMemo(()=>{if(!an(r==null?void 0:r.chainId)){const B=new ke(e||"0").minus(s||"0").decimalPlaces(2,ke.ROUND_DOWN);return B.isNegative()?"0.00":B.toString()}return e||"0"},[e,s,r==null?void 0:r.chainId]),m=v.useMemo(()=>o||"0",[o]),x=v.useMemo(()=>{const B=(n==null?void 0:n.feeRate)||(r==null?void 0:r.feeRate)||0;try{return new ke(B||0).times(100).toString()}catch{return"0"}},[n==null?void 0:n.feeRate,r==null?void 0:r.feeRate]),T=B=>{const L=B.target.value,D=Xc(L,m||"0");if(D.isValid)u(D.formattedValue),D.errorType;else return D.errorType==="exceed_balance",void 0;f==null||f(D.formattedValue)},y=()=>{u(m),f==null||f(m)},A=()=>{const B=parseFloat(o||"0"),L=parseFloat(e||"0");if(L>0){const _=B-L,D=$t(Math.max(0,_).toString());return M.jsxs("span",{className:"flex items-center gap-1",children:[$t(o||"0"),M.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),D," ",t]})}return`${$t(o||"0")} ${t}`};return M.jsxs(M.Fragment,{children:[M.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[M.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[M.jsx("input",{type:"text",placeholder:d("deposit.amount"),value:e,onChange:T,className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-none border-none p-0 h-full"}),M.jsx("button",{onClick:y,className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:d("deposit.max")})]}),M.jsx("div",{className:"h-[1px] bg-line-divider-secondary mb-2"}),M.jsxs("div",{className:"flex justify-between items-center",children:[M.jsx(Gn,{content:d("withdraw.availableDesc"),children:M.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:d("deposit.available")})}),M.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:A()})]})]}),i==="mpc"&&(a==="spot"||!an(r==null?void 0:r.chainId))?M.jsx("div",{className:"bg-fill-input-primary rounded-lg my-4 h-9 flex items-center px-3",children:M.jsx("input",{type:"text",placeholder:d("withdraw.receiverAddress"),value:c,onChange:B=>l==null?void 0:l(B.target.value),className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-none border-none p-0 h-full"})}):null,M.jsx("div",{className:"bg-fill-page-secondary rounded-lg mb-4",children:an(r==null?void 0:r.chainId)?M.jsxs(M.Fragment,{children:[M.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:d("withdraw.noticeDesc")}),M.jsx("a",{className:"block text-xs leading-[18px] mt-1 text-theme-normal",href:"https://edgex-1.gitbook.io/edgeX-documentation/getting-started/deposits-and-withdrawals/withdrawals",rel:"noreferrer",target:"_blank",children:d("withdraw.commonWithdraw")})]}):M.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:d("withdraw.crossChainTips")})}),p&&M.jsxs("div",{className:"flex mb-4",children:[M.jsx("div",{className:"w-5",children:M.jsx("img",{src:Io,className:"w-4 h-4",alt:"Warning"})}),M.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:d("withdraw.poolBalanceInsufficientTip")})]}),M.jsxs("div",{className:"py-4 border-t border-line-divider-secondary border-dashed",children:[M.jsxs("div",{className:"flex items-center justify-between h-[18px] leading-[18px]",children:[M.jsx(Gn,{content:M.jsxs("div",{children:[M.jsx("div",{children:d("withdraw.speedNote")}),M.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[M.jsx(Oo,{selectedLevel:Pt.FAST,maxLevel:3}),M.jsx("span",{children:d("withdraw.speedNoteSpeed1")})]}),M.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[M.jsx(Oo,{selectedLevel:Pt.Medium,maxLevel:3}),M.jsx("span",{children:d("withdraw.speedNoteSpeed2")})]}),M.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[M.jsx(Oo,{selectedLevel:Pt.SLOW,maxLevel:3}),M.jsx("span",{children:d("withdraw.speedNoteSpeed3")})]})]}),children:M.jsx("span",{className:"text-text-tertiary text-sm leading-4 border-b border-dashed border-line-divider-primary",children:d("withdraw.speed")})}),M.jsx("div",{className:"flex items-center",children:M.jsx(Oo,{selectedLevel:an(r==null?void 0:r.chainId)?Pt.SLOW:Pt.FAST,maxLevel:3})})]}),!an(r==null?void 0:r.chainId)&&M.jsxs("div",{className:"flex items-center justify-between mt-2 h-[18px]",children:[M.jsx(Gn,{content:d("withdraw.feeCalculationTip"),children:M.jsxs("span",{className:"text-text-tertiary text-sm leading-4 border-b border-dashed border-line-divider-primary",children:[d("withdraw.fee"),"/",d("withdraw.feeRate")]})}),M.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[s," ",t," / ",x,"%"]})]}),M.jsxs("div",{className:"flex items-center justify-between mt-2 h-[18px]",children:[M.jsx("span",{className:"text-text-tertiary text-sm leading-4",children:d(an(r==null?void 0:r.chainId)?"withdraw.withdrawlAmount":"withdraw.amountToReceive")}),M.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[$t(h)," ",t]})]})]})]})},hP=[];let Ve=null;const M0=v.forwardRef((e,t)=>{const[n,r]=v.useState(!1),[o,s]=v.useState(!1),[i,c]=v.useState({chains:[],currentActiveAccount:{wallet:"EVM",ethAddress:"",accountId:"",smartWalletAddress:""}}),a=v.useCallback(h=>{c(h||{chains:[],currentActiveAccount:{wallet:"EVM",ethAddress:"",accountId:"",smartWalletAddress:""}}),r(!0)},[]),u=v.useCallback(h=>{c(m=>({...m,...h}))},[]),l=v.useCallback(()=>{r(!1),s(!1),i.onClose&&i.onClose()},[i.onClose]),f=v.useCallback(h=>{s(h)},[]),p=v.useCallback(()=>n,[n]),d=v.useCallback(()=>o,[o]);return v.useImperativeHandle(t,()=>({openWithdraw:a,closeWithdraw:l,updateWithdrawOptions:u,setWithdrawLoading:f,isOpen:p,isLoading:d}),[a,l,u,f,p,d]),v.useEffect(()=>(Ve={openWithdraw:a,closeWithdraw:l,updateWithdrawOptions:u,setWithdrawLoading:f,isOpen:p,isLoading:d},()=>{Ve=null}),[a,l,u,f,p,d]),n?M.jsx(R0,{isOpen:n,isLoading:o,onClose:l,config:i.config||{symbol:"USDT"},currentActiveAccount:i.currentActiveAccount,chains:i.chains||hP,spotChains:i.spotChains,balances:i.balances,defaultChainId:i.defaultChainId,defaultTokenAddress:i.defaultTokenAddress,defaultAmount:i.defaultAmount,defaultAccountType:i.defaultAccountType,currentEquity:i.currentEquity??5e3,platformBalance:i.platformBalance||"0",fee:i.fee,wagmiHooks:i.wagmiHooks,onWithdraw:i.onWithdraw,onChainChange:i.onChainChange,onTokenChange:i.onTokenChange,onAmountChanged:i.onAmountChanged}):null});M0.displayName="WithdrawManager";const k0=e=>{if(!Ve){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Ve.openWithdraw(e||{chains:[],currentActiveAccount:{wallet:"EVM",ethAddress:"",accountId:"",smartWalletAddress:""}})},B0=()=>{if(!Ve){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Ve.closeWithdraw()},L0=e=>{if(!Ve){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Ve.updateWithdrawOptions(e)},Xs=e=>{if(!Ve){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Ve.setWithdrawLoading(e)},mP=()=>Ve?Ve.isOpen():!1,F0=()=>Ve?Ve.isLoading():!1,gP=()=>({openWithdraw:k0,closeWithdraw:B0,updateWithdrawOptions:L0,setWithdrawLoading:Xs,isOpen:mP,isLoading:F0}),bP=({walletType:e,chains:t,spotChains:n=[],defaultChainId:r,defaultTokenAddress:o,defaultAmount:s="",defaultAccountType:i="perpetual",currentEquity:c,platformBalance:a="0",balances:u,fee:l="0.00",isLoading:f=!1,onWithdraw:p,onClose:d,onChainChange:h,onTokenChange:m,onAmountChanged:x})=>{var G;const{t:T}=dt(),[y,A]=v.useState(i),B=v.useCallback(W=>W==="spot"&&n&&n.length>0?n:t,[t,n]),L=v.useMemo(()=>B(y),[y,B]),_=v.useMemo(()=>{var pe,Se;const W="USDC";if(!L||L.length===0)return{chainId:1,tokenSymbol:""};const V=he=>Array.isArray(he.tokenList)&&he.tokenList.some(me=>(me.token||me.symbol||"").toUpperCase()===W),Y=L.find(V)||L[0];if(!Y||!Array.isArray(Y.tokenList)||Y.tokenList.length===0)return{chainId:(Y==null?void 0:Y.chainId)||1,tokenSymbol:""};const Q=Y.tokenList.find(he=>(he.token||he.symbol||"").toUpperCase()===W),oe=(Q==null?void 0:Q.token)||(Q==null?void 0:Q.symbol)||((pe=Y.tokenList[0])==null?void 0:pe.token)||((Se=Y.tokenList[0])==null?void 0:Se.symbol)||"";return{chainId:Y.chainId,tokenSymbol:oe}},[L]),[D,g]=v.useState(()=>_.chainId),[w,$]=v.useState(()=>_.tokenSymbol),[I,C]=v.useState(s),[P,S]=v.useState(""),E=v.useCallback(W=>{g(W),h==null||h(W)},[h]),O=v.useCallback(W=>{$(W),m==null||m(W)},[m]),N=v.useRef(!0),b=v.useRef(w),k=v.useRef(D);v.useEffect(()=>{if(N.current){N.current=!1,b.current=w,k.current=D;return}(b.current!==w||k.current!==D)&&(C(""),b.current=w,k.current=D)},[w,D]);const R=L&&L.length>0?L.find(W=>W.chainId===D)||L[0]:null,j=(G=R==null?void 0:R.tokenList)==null?void 0:G.find(W=>W.token===w),U=v.useMemo(()=>{const W=new ke(I||"0"),V=new ke(l||"0"),Y=an(D);return!I||W.isZero()||!Y&&W.isLessThan(V)?{text:T("withdraw.confirmWithdraw"),disabled:!0}:e==="mpc"&&(!Y||y==="spot")&&!P.trim()?{text:T("withdraw.invalidReceiverAddress"),disabled:!0}:{text:T("withdraw.confirmWithdraw"),disabled:!1}},[T,D,I,e,P,l,y]),H=v.useMemo(()=>{const W=(w||"").toLowerCase();if(!W)return a||"0";const V=y==="spot"?u==null?void 0:u.spot:u==null?void 0:u.perpetual,Y=V==null?void 0:V[W];return typeof Y=="string"&&Y.length>0?Y:a||"0"},[u,y,w,a]),K=v.useCallback(async()=>{Xs(!0);try{if(p){const W=new ke(I||"0");console.log("selectedToken:",j);const V={amount:W.toString(),chainId:D,tokenAddress:(j==null?void 0:j.tokenAddress)||"",coinId:(j==null?void 0:j.coinId)||"",tokenSymbol:w,accountType:y,selectedToken:j};e==="mpc"&&(!an(D)||y==="spot")&&(V.receiverAddress=P),p(V)}}catch{Xs(!1)}},[p,y,j,I,D,w,e,P]);return!L||L.length===0?M.jsx("div",{className:"text-center py-8",children:M.jsx("p",{className:"text-gray-400",children:"No chains available"})}):R?M.jsxs(M.Fragment,{children:[M.jsx(jh,{selectedAccount:y,onAccountChange:W=>{var le,xn;const V=W||"perpetual";A(V);const Y=B(V);if(!Y||Y.length===0)return;const Q=Y.find(cn=>cn.chainId===D),oe=Q?Q.chainId:Y[0].chainId;g(oe),h==null||h(oe);const pe=Y.find(cn=>cn.chainId===oe),Se=(pe==null?void 0:pe.tokenList)||[],me=Se.some(cn=>(cn.symbol||cn.token)===w)?w:((le=Se[0])==null?void 0:le.symbol)||((xn=Se[0])==null?void 0:xn.token)||"";me&&($(me),m==null||m(me))},className:"w-full"}),M.jsx(Dh,{currentActiveChain:R,chainList:L,onChainChange:E,curSelectToken:w,onTokenChange:O,walletType:"EVM",txType:"withdraw"}),M.jsx(pP,{withdrawAmount:I,curSelectToken:w,tokenInfo:j,curSelectTokenData:{balance:j==null?void 0:j.balance,allowance:j==null?void 0:j.allowance},currentActiveChain:R,currentEquity:c||0,decimals:(j==null?void 0:j.decimals)||6,platformBalance:H,fee:l,walletType:e,accountType:y,receiverAddress:P,onWithdrawAmountChange:C,onReceiverAddressChange:S,onAmountChanged:x}),M.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${U.disabled||f?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:K,disabled:U.disabled||f,children:[f&&M.jsx(Mo,{size:"xs"}),U.text]})]}):M.jsx("div",{className:"text-center py-8",children:M.jsx("p",{className:"text-gray-400",children:"Loading..."})})},R0=({isOpen:e,isLoading:t=!1,defaultAccountType:n="perpetual",onClose:r,config:o,currentActiveAccount:s,chains:i,spotChains:c=[],defaultChainId:a,defaultTokenAddress:u,defaultAmount:l="",currentEquity:f=5e3,platformBalance:p="0",balances:d,fee:h,wagmiHooks:m,onWithdraw:x,onChainChange:T,onTokenChange:y,onAmountChanged:A})=>{const{t:B}=dt();return e?Me.createPortal(M.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:98},children:M.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-[99] flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.6)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)"},onClick:()=>{r()},"aria-hidden":"true",children:M.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl",onClick:L=>{L.stopPropagation()},children:[M.jsxs("div",{className:"flex items-center justify-between mb-4",children:[M.jsx("h2",{className:"text-lg font-semibold text-white",children:B("withdraw.withdraw")}),M.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:r,"aria-label":"Close",children:M.jsx(Ld,{className:"h-4 w-4"})})]}),M.jsx(bP,{chains:i,spotChains:c,walletType:Qc(s)?"mpc":"evm",defaultChainId:a,defaultTokenAddress:u,defaultAmount:l,defaultAccountType:n,currentEquity:f,platformBalance:p,balances:d,fee:h,isLoading:t,wagmiHooks:m,onWithdraw:x,onClose:r,onChainChange:T,onTokenChange:y,onAmountChanged:A})]})})}),document.body):null};re.ChromeLoader=Mo,re.ComponentProvider=um,re.DEFAULT_LOCALE=Bo,re.Deposit=I0,re.DepositManager=$0,re.LOCALE_NAMES=im,re.LoadingSpinner=Mo,re.SUPPORTED_LOCALES=ei,re.Tooltip=Gn,re.Withdraw=R0,re.WithdrawManager=M0,re.closeDeposit=T0,re.closeWithdraw=B0,re.formatThousands=fm,re.isDepositLoading=C0,re.isWithdrawLoading=F0,re.openDeposit=A0,re.openWithdraw=k0,re.setDepositLoading=Ys,re.setWithdrawLoading=Xs,re.updateDepositOptions=O0,re.updateWithdrawOptions=L0,re.useComponentConfig=fu,re.useDeposit=zv,re.useDepositManager=iP,re.useTranslation=dt,re.useWithdraw=Hv,re.useWithdrawManager=gP,Object.defineProperty(re,Symbol.toStringTag,{value:"Module"})});
172
172
  //# sourceMappingURL=index.umd.js.map